@taiga-ui/kit 4.52.0-canary.e10b718 → 4.52.0-canary.e53e79e

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 (418) hide show
  1. package/README.md +1 -1
  2. package/components/accordion/accordion.component.d.ts +13 -0
  3. package/components/accordion/accordion.d.ts +4 -4
  4. package/components/accordion/accordion.directive.d.ts +11 -10
  5. package/components/accordion/index.d.ts +1 -3
  6. package/components/action-bar/action-bar.component.d.ts +5 -7
  7. package/components/action-bar/index.d.ts +0 -2
  8. package/components/avatar/avatar-outline.directive.d.ts +3 -3
  9. package/components/badge/badge.directive.d.ts +2 -2
  10. package/components/badge/badge.options.d.ts +1 -3
  11. package/components/badge-notification/badge-notification.options.d.ts +1 -3
  12. package/components/block/block.directive.d.ts +4 -4
  13. package/components/block/block.options.d.ts +2 -4
  14. package/components/breadcrumbs/breadcrumbs.options.d.ts +1 -3
  15. package/components/calendar-month/calendar-month.component.d.ts +1 -1
  16. package/components/calendar-range/calendar-range.component.d.ts +1 -2
  17. package/components/chip/chip.directive.d.ts +2 -4
  18. package/components/chip/chip.options.d.ts +1 -3
  19. package/components/combo-box/combo-box.d.ts +5 -0
  20. package/components/combo-box/combo-box.directive.d.ts +5 -5
  21. package/components/combo-box/index.d.ts +1 -0
  22. package/components/comment/comment.directive.d.ts +2 -2
  23. package/components/confirm/confirm.component.d.ts +5 -3
  24. package/components/confirm/confirm.service.d.ts +3 -2
  25. package/{directives → components}/copy/copy.component.d.ts +2 -2
  26. package/{directives → components}/copy/copy.directive.d.ts +3 -4
  27. package/components/data-list-wrapper/data-list-group-wrapper.component.d.ts +4 -2
  28. package/components/data-list-wrapper/data-list-wrapper.component.d.ts +14 -22
  29. package/components/data-list-wrapper/{data-list-wrapper.module.d.ts → data-list-wrapper.d.ts} +1 -2
  30. package/components/data-list-wrapper/index.d.ts +1 -1
  31. package/components/elastic-container/elastic-container.component.d.ts +1 -1
  32. package/components/files/file/file.options.d.ts +1 -1
  33. package/components/files/files/files.component.d.ts +2 -2
  34. package/components/files/input-files/input-files.options.d.ts +1 -3
  35. package/components/floating-container/floating-container.directive.d.ts +3 -2
  36. package/components/fullscreen/fullscreen.component.d.ts +14 -0
  37. package/components/fullscreen/index.d.ts +1 -0
  38. package/components/index.d.ts +3 -1
  39. package/components/input-chip/input-chip.component.d.ts +9 -8
  40. package/components/input-chip/input-chip.d.ts +5 -1
  41. package/components/input-chip/input-chip.directive.d.ts +7 -12
  42. package/components/input-color/index.d.ts +1 -0
  43. package/components/input-color/input-color.component.d.ts +4 -4
  44. package/components/input-color/input-color.d.ts +5 -0
  45. package/components/input-date/input-date.d.ts +4 -1
  46. package/components/input-date/input-date.directive.d.ts +10 -12
  47. package/components/input-date-multi/input-date-multi.d.ts +1 -2
  48. package/components/input-date-multi/input-date-multi.directive.d.ts +10 -14
  49. package/components/input-date-range/input-date-range.d.ts +4 -1
  50. package/components/input-date-range/input-date-range.directive.d.ts +5 -8
  51. package/components/input-date-time/input-date-time.d.ts +4 -1
  52. package/components/input-date-time/input-date-time.directive.d.ts +6 -6
  53. package/components/input-month/input-month.d.ts +4 -1
  54. package/components/input-month/input-month.directive.d.ts +5 -4
  55. package/components/input-month-range/input-month-range.d.ts +4 -1
  56. package/components/input-month-range/input-month-range.directive.d.ts +5 -4
  57. package/components/input-number/input-number.d.ts +4 -1
  58. package/components/input-number/input-number.directive.d.ts +7 -11
  59. package/components/input-number/quantum.directive.d.ts +1 -1
  60. package/components/input-number/step/input-number-step.component.d.ts +1 -1
  61. package/components/input-phone/index.d.ts +1 -0
  62. package/components/input-phone/input-phone.d.ts +5 -0
  63. package/components/input-phone/input-phone.directive.d.ts +7 -7
  64. package/components/input-phone-international/index.d.ts +1 -0
  65. package/components/input-phone-international/input-phone-international.component.d.ts +26 -32
  66. package/components/input-phone-international/input-phone-international.d.ts +5 -0
  67. package/components/input-phone-international/input-phone-international.options.d.ts +1 -3
  68. package/components/input-pin/index.d.ts +1 -0
  69. package/components/input-pin/input-pin.component.d.ts +4 -4
  70. package/components/input-pin/input-pin.d.ts +5 -0
  71. package/components/input-range/input-range.component.d.ts +9 -12
  72. package/components/input-slider/input-slider.d.ts +4 -1
  73. package/components/input-slider/input-slider.directive.d.ts +3 -5
  74. package/components/input-time/input-time.component.d.ts +1 -3
  75. package/components/input-time/input-time.d.ts +4 -1
  76. package/components/input-time/input-time.directive.d.ts +8 -10
  77. package/components/input-year/input-year.d.ts +4 -1
  78. package/components/input-year/input-year.directive.d.ts +5 -5
  79. package/components/like/like.component.d.ts +2 -2
  80. package/components/like/like.options.d.ts +1 -1
  81. package/components/line-clamp/line-clamp-box.component.d.ts +3 -4
  82. package/components/line-clamp/line-clamp.component.d.ts +8 -10
  83. package/components/line-clamp/line-clamp.options.d.ts +1 -3
  84. package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +6 -8
  85. package/components/multi-select/multi-select-option/multi-select-option.component.d.ts +1 -1
  86. package/components/notification-middle/notification-middle.component.d.ts +2 -2
  87. package/components/notification-middle/notification-middle.directive.d.ts +4 -3
  88. package/components/notification-middle/notification-middle.service.d.ts +7 -3
  89. package/components/pagination/index.d.ts +1 -0
  90. package/components/pagination/pagination.component.d.ts +25 -54
  91. package/components/pagination/pagination.options.d.ts +7 -0
  92. package/components/pin/pin.directive.d.ts +2 -2
  93. package/components/preview/dialog/preview-dialog.component.d.ts +2 -2
  94. package/components/preview/dialog/preview-dialog.directive.d.ts +3 -3
  95. package/components/preview/dialog/preview-dialog.service.d.ts +5 -2
  96. package/components/preview/pagination/preview-pagination.component.d.ts +1 -1
  97. package/components/preview/preview.component.d.ts +1 -1
  98. package/components/preview/preview.d.ts +2 -1
  99. package/components/preview/zoom/preview-zoom.component.d.ts +2 -1
  100. package/components/progress/progress-bar/fixed-gradient/progress-fixed-gradient.directive.d.ts +1 -2
  101. package/components/progress/progress-bar/progress-color-segments.directive.d.ts +4 -4
  102. package/components/progress/progress-segmented/progress-segmented.directive.d.ts +2 -2
  103. package/components/progress/progress.options.d.ts +1 -3
  104. package/components/push/push-alert.component.d.ts +4 -3
  105. package/components/push/push.component.d.ts +1 -1
  106. package/components/push/push.directive.d.ts +4 -6
  107. package/components/push/push.options.d.ts +5 -8
  108. package/components/push/push.service.d.ts +6 -2
  109. package/components/radio/radio.component.d.ts +1 -1
  110. package/components/radio-list/radio-list.component.d.ts +5 -3
  111. package/components/range/range-change.directive.d.ts +1 -2
  112. package/components/range/range.component.d.ts +16 -24
  113. package/components/rating/rating.component.d.ts +5 -5
  114. package/components/rating/rating.options.d.ts +6 -6
  115. package/components/routable-dialog/generate-dialogable-route.d.ts +1 -1
  116. package/components/segmented/segmented.component.d.ts +4 -6
  117. package/components/segmented/segmented.directive.d.ts +6 -7
  118. package/components/select/native-select/native-select.component.d.ts +7 -8
  119. package/components/select/select.d.ts +4 -1
  120. package/components/select/select.directive.d.ts +4 -3
  121. package/components/slider/helpers/key-steps.d.ts +1 -2
  122. package/components/slider/helpers/slider-key-steps.directive.d.ts +12 -21
  123. package/components/slider/slider.options.d.ts +1 -6
  124. package/components/slides/slides.directive.d.ts +4 -4
  125. package/components/status/status.directive.d.ts +2 -2
  126. package/components/stepper/step.component.d.ts +6 -8
  127. package/components/stepper/stepper.component.d.ts +6 -11
  128. package/components/switch/switch.component.d.ts +1 -0
  129. package/components/tabs/tabs-with-more.component.d.ts +1 -1
  130. package/components/tabs/tabs.options.d.ts +1 -6
  131. package/components/textarea/index.d.ts +2 -1
  132. package/components/textarea/textarea.component.d.ts +4 -4
  133. package/components/textarea/textarea.d.ts +6 -0
  134. package/components/textarea/textarea.directive.d.ts +13 -0
  135. package/components/toast/index.d.ts +5 -0
  136. package/components/toast/toast.component.d.ts +18 -0
  137. package/components/toast/toast.d.ts +3 -0
  138. package/components/toast/toast.directive.d.ts +7 -0
  139. package/components/toast/toast.options.d.ts +10 -0
  140. package/components/toast/toast.service.d.ts +17 -0
  141. package/components/tree/components/tree-item-content/tree-item-content.component.d.ts +8 -1
  142. package/components/tree/misc/tree.constants.d.ts +0 -3
  143. package/components/tree/misc/tree.tokens.d.ts +1 -6
  144. package/directives/button-close/button-close.directive.d.ts +2 -1
  145. package/directives/button-select/button-select.directive.d.ts +4 -4
  146. package/directives/chevron/chevron.directive.d.ts +2 -3
  147. package/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.d.ts +5 -5
  148. package/directives/fade/fade.directive.d.ts +2 -2
  149. package/directives/fluid-typography/fluid-typography.directive.d.ts +3 -6
  150. package/directives/fluid-typography/fluid-typography.options.d.ts +1 -3
  151. package/directives/index.d.ts +0 -2
  152. package/directives/password/password.directive.d.ts +1 -1
  153. package/directives/sensitive/sensitive.directive.d.ts +2 -2
  154. package/directives/shimmer/shimmer.directive.d.ts +3 -3
  155. package/directives/skeleton/skeleton.directive.d.ts +3 -3
  156. package/directives/tooltip/tooltip.directive.d.ts +3 -3
  157. package/fesm2022/taiga-ui-kit-components-accordion.mjs +69 -145
  158. package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
  159. package/fesm2022/taiga-ui-kit-components-action-bar.mjs +24 -40
  160. package/fesm2022/taiga-ui-kit-components-action-bar.mjs.map +1 -1
  161. package/fesm2022/taiga-ui-kit-components-avatar.mjs +33 -44
  162. package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
  163. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +7 -12
  164. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
  165. package/fesm2022/taiga-ui-kit-components-badge.mjs +16 -27
  166. package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
  167. package/fesm2022/taiga-ui-kit-components-badged-content.mjs +6 -7
  168. package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
  169. package/fesm2022/taiga-ui-kit-components-block.mjs +20 -31
  170. package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
  171. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +12 -18
  172. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
  173. package/fesm2022/taiga-ui-kit-components-button-loading.mjs +6 -6
  174. package/fesm2022/taiga-ui-kit-components-button-loading.mjs.map +1 -1
  175. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +6 -17
  176. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
  177. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +7 -8
  178. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
  179. package/fesm2022/taiga-ui-kit-components-carousel.mjs +17 -23
  180. package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
  181. package/fesm2022/taiga-ui-kit-components-checkbox.mjs +5 -6
  182. package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
  183. package/fesm2022/taiga-ui-kit-components-chip.mjs +18 -34
  184. package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
  185. package/fesm2022/taiga-ui-kit-components-combo-box.mjs +42 -32
  186. package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
  187. package/fesm2022/taiga-ui-kit-components-comment.mjs +13 -20
  188. package/fesm2022/taiga-ui-kit-components-comment.mjs.map +1 -1
  189. package/fesm2022/taiga-ui-kit-components-compass.mjs +5 -5
  190. package/fesm2022/taiga-ui-kit-components-compass.mjs.map +1 -1
  191. package/fesm2022/taiga-ui-kit-components-confirm.mjs +14 -17
  192. package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
  193. package/fesm2022/taiga-ui-kit-components-copy.mjs +113 -0
  194. package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -0
  195. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs +25 -78
  196. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
  197. package/fesm2022/taiga-ui-kit-components-drawer.mjs +5 -5
  198. package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
  199. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs +8 -12
  200. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs.map +1 -1
  201. package/fesm2022/taiga-ui-kit-components-files.mjs +43 -50
  202. package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
  203. package/fesm2022/taiga-ui-kit-components-filter.mjs +5 -5
  204. package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
  205. package/fesm2022/taiga-ui-kit-components-floating-container.mjs +16 -19
  206. package/fesm2022/taiga-ui-kit-components-floating-container.mjs.map +1 -1
  207. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +63 -0
  208. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs.map +1 -0
  209. package/fesm2022/taiga-ui-kit-components-input-chip.mjs +69 -74
  210. package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
  211. package/fesm2022/taiga-ui-kit-components-input-color.mjs +24 -14
  212. package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
  213. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +34 -51
  214. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs.map +1 -1
  215. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +27 -32
  216. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
  217. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +32 -29
  218. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
  219. package/fesm2022/taiga-ui-kit-components-input-date.mjs +44 -47
  220. package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
  221. package/fesm2022/taiga-ui-kit-components-input-inline.mjs +4 -5
  222. package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
  223. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +24 -18
  224. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
  225. package/fesm2022/taiga-ui-kit-components-input-month.mjs +27 -21
  226. package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
  227. package/fesm2022/taiga-ui-kit-components-input-number.mjs +60 -77
  228. package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
  229. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +122 -138
  230. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
  231. package/fesm2022/taiga-ui-kit-components-input-phone.mjs +32 -23
  232. package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
  233. package/fesm2022/taiga-ui-kit-components-input-pin.mjs +20 -11
  234. package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
  235. package/fesm2022/taiga-ui-kit-components-input-range.mjs +33 -29
  236. package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
  237. package/fesm2022/taiga-ui-kit-components-input-slider.mjs +36 -45
  238. package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
  239. package/fesm2022/taiga-ui-kit-components-input-time.mjs +64 -70
  240. package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
  241. package/fesm2022/taiga-ui-kit-components-input-year.mjs +26 -18
  242. package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
  243. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +14 -16
  244. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
  245. package/fesm2022/taiga-ui-kit-components-like.mjs +6 -6
  246. package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
  247. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +38 -82
  248. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
  249. package/fesm2022/taiga-ui-kit-components-message.mjs +9 -12
  250. package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
  251. package/fesm2022/taiga-ui-kit-components-multi-select.mjs +37 -48
  252. package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
  253. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +37 -33
  254. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs.map +1 -1
  255. package/fesm2022/taiga-ui-kit-components-pager.mjs +6 -8
  256. package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
  257. package/fesm2022/taiga-ui-kit-components-pagination.mjs +69 -140
  258. package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
  259. package/fesm2022/taiga-ui-kit-components-pin.mjs +15 -19
  260. package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
  261. package/fesm2022/taiga-ui-kit-components-preview.mjs +59 -50
  262. package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
  263. package/fesm2022/taiga-ui-kit-components-progress.mjs +76 -81
  264. package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
  265. package/fesm2022/taiga-ui-kit-components-pulse.mjs +4 -4
  266. package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
  267. package/fesm2022/taiga-ui-kit-components-push.mjs +49 -57
  268. package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
  269. package/fesm2022/taiga-ui-kit-components-radio-list.mjs +8 -8
  270. package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
  271. package/fesm2022/taiga-ui-kit-components-radio.mjs +8 -9
  272. package/fesm2022/taiga-ui-kit-components-radio.mjs.map +1 -1
  273. package/fesm2022/taiga-ui-kit-components-range.mjs +41 -85
  274. package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
  275. package/fesm2022/taiga-ui-kit-components-rating.mjs +19 -28
  276. package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
  277. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs +11 -7
  278. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs.map +1 -1
  279. package/fesm2022/taiga-ui-kit-components-segmented.mjs +32 -59
  280. package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
  281. package/fesm2022/taiga-ui-kit-components-select.mjs +82 -62
  282. package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
  283. package/fesm2022/taiga-ui-kit-components-slider.mjs +74 -82
  284. package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
  285. package/fesm2022/taiga-ui-kit-components-slides.mjs +16 -24
  286. package/fesm2022/taiga-ui-kit-components-slides.mjs.map +1 -1
  287. package/fesm2022/taiga-ui-kit-components-status.mjs +12 -16
  288. package/fesm2022/taiga-ui-kit-components-status.mjs.map +1 -1
  289. package/fesm2022/taiga-ui-kit-components-stepper.mjs +45 -79
  290. package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
  291. package/fesm2022/taiga-ui-kit-components-switch.mjs +10 -6
  292. package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
  293. package/fesm2022/taiga-ui-kit-components-tabs.mjs +36 -47
  294. package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
  295. package/fesm2022/taiga-ui-kit-components-textarea.mjs +54 -62
  296. package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
  297. package/fesm2022/taiga-ui-kit-components-tiles.mjs +14 -15
  298. package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
  299. package/fesm2022/taiga-ui-kit-components-toast.mjs +164 -0
  300. package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -0
  301. package/fesm2022/taiga-ui-kit-components-tree.mjs +59 -63
  302. package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
  303. package/fesm2022/taiga-ui-kit-components.mjs +3 -1
  304. package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
  305. package/fesm2022/taiga-ui-kit-directives-button-close.mjs +15 -7
  306. package/fesm2022/taiga-ui-kit-directives-button-close.mjs.map +1 -1
  307. package/fesm2022/taiga-ui-kit-directives-button-group.mjs +9 -12
  308. package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
  309. package/fesm2022/taiga-ui-kit-directives-button-select.mjs +20 -19
  310. package/fesm2022/taiga-ui-kit-directives-button-select.mjs.map +1 -1
  311. package/fesm2022/taiga-ui-kit-directives-chevron.mjs +16 -22
  312. package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
  313. package/fesm2022/taiga-ui-kit-directives-connected.mjs +9 -15
  314. package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
  315. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs +25 -53
  316. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs.map +1 -1
  317. package/fesm2022/taiga-ui-kit-directives-fade.mjs +15 -17
  318. package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
  319. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs +14 -27
  320. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs.map +1 -1
  321. package/fesm2022/taiga-ui-kit-directives-highlight.mjs +3 -4
  322. package/fesm2022/taiga-ui-kit-directives-highlight.mjs.map +1 -1
  323. package/fesm2022/taiga-ui-kit-directives-password.mjs +12 -14
  324. package/fesm2022/taiga-ui-kit-directives-password.mjs.map +1 -1
  325. package/fesm2022/taiga-ui-kit-directives-present.mjs +3 -4
  326. package/fesm2022/taiga-ui-kit-directives-present.mjs.map +1 -1
  327. package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +13 -18
  328. package/fesm2022/taiga-ui-kit-directives-sensitive.mjs.map +1 -1
  329. package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +24 -34
  330. package/fesm2022/taiga-ui-kit-directives-shimmer.mjs.map +1 -1
  331. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +28 -38
  332. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
  333. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +17 -22
  334. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
  335. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs +6 -8
  336. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs.map +1 -1
  337. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs +4 -5
  338. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs.map +1 -1
  339. package/fesm2022/taiga-ui-kit-directives.mjs +0 -2
  340. package/fesm2022/taiga-ui-kit-directives.mjs.map +1 -1
  341. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs +43 -0
  342. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs.map +1 -0
  343. package/fesm2022/taiga-ui-kit-pipes-emails.mjs +3 -4
  344. package/fesm2022/taiga-ui-kit-pipes-emails.mjs.map +1 -1
  345. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs +12 -25
  346. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs.map +1 -1
  347. package/fesm2022/taiga-ui-kit-pipes-flag.mjs +31 -0
  348. package/fesm2022/taiga-ui-kit-pipes-flag.mjs.map +1 -0
  349. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs +4 -5
  350. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs.map +1 -1
  351. package/fesm2022/taiga-ui-kit-pipes-initials.mjs +28 -0
  352. package/fesm2022/taiga-ui-kit-pipes-initials.mjs.map +1 -0
  353. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs +5 -5
  354. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs.map +1 -1
  355. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs +3 -4
  356. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs.map +1 -1
  357. package/fesm2022/taiga-ui-kit-pipes-stringify.mjs +3 -4
  358. package/fesm2022/taiga-ui-kit-pipes-stringify.mjs.map +1 -1
  359. package/fesm2022/taiga-ui-kit-pipes.mjs +3 -1
  360. package/fesm2022/taiga-ui-kit-pipes.mjs.map +1 -1
  361. package/fesm2022/taiga-ui-kit-tokens.mjs +7 -25
  362. package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
  363. package/fesm2022/taiga-ui-kit-utils.mjs +2 -8
  364. package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
  365. package/package.json +54 -46
  366. package/pipes/auto-color/auto-color.pipe.d.ts +13 -0
  367. package/pipes/auto-color/index.d.ts +1 -0
  368. package/pipes/filter-by-input/filter-by-input.pipe.d.ts +2 -2
  369. package/pipes/flag/flag.pipe.d.ts +14 -0
  370. package/pipes/flag/index.d.ts +1 -0
  371. package/pipes/index.d.ts +3 -1
  372. package/pipes/initials/index.d.ts +1 -0
  373. package/pipes/initials/initials.pipe.d.ts +7 -0
  374. package/pipes/stringify-content/stringify-content.pipe.d.ts +2 -3
  375. package/styles/components/badge.less +1 -0
  376. package/styles/components/checkbox.less +1 -1
  377. package/styles/components/chip.less +12 -1
  378. package/styles/components/pin.less +0 -1
  379. package/styles/components/radio.less +1 -1
  380. package/styles/components/switch.less +1 -1
  381. package/styles/components/toast.less +44 -0
  382. package/tokens/i18n.d.ts +25 -26
  383. package/tokens/index.d.ts +0 -1
  384. package/tokens/items-handlers.d.ts +1 -7
  385. package/tokens/preview-icons.d.ts +1 -3
  386. package/utils/index.d.ts +0 -1
  387. package/components/accordion/accordion-item-content.directive.d.ts +0 -6
  388. package/components/accordion/accordion-item-eager-content.directive.d.ts +0 -5
  389. package/components/accordion/accordion-item.component.d.ts +0 -25
  390. package/components/action-bar/action-bar.d.ts +0 -3
  391. package/components/action-bar/action-bar.directive.d.ts +0 -6
  392. package/components/pdf-viewer/index.d.ts +0 -4
  393. package/components/pdf-viewer/pdf-viewer.component.d.ts +0 -12
  394. package/components/pdf-viewer/pdf-viewer.directive.d.ts +0 -7
  395. package/components/pdf-viewer/pdf-viewer.options.d.ts +0 -13
  396. package/components/pdf-viewer/pdf-viewer.service.d.ts +0 -13
  397. package/components/textarea/textarea-limit.directive.d.ts +0 -27
  398. package/directives/lazy-loading/index.d.ts +0 -2
  399. package/directives/lazy-loading/lazy-loading.directive.d.ts +0 -18
  400. package/directives/lazy-loading/lazy-loading.service.d.ts +0 -12
  401. package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs +0 -83
  402. package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs.map +0 -1
  403. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs +0 -64
  404. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs.map +0 -1
  405. package/fesm2022/taiga-ui-kit-directives-copy.mjs +0 -119
  406. package/fesm2022/taiga-ui-kit-directives-copy.mjs.map +0 -1
  407. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs +0 -81
  408. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs.map +0 -1
  409. package/fesm2022/taiga-ui-kit-pipes-field-error.mjs +0 -147
  410. package/fesm2022/taiga-ui-kit-pipes-field-error.mjs.map +0 -1
  411. package/pipes/field-error/field-error-content-pipe.d.ts +0 -14
  412. package/pipes/field-error/field-error-pipe.d.ts +0 -29
  413. package/pipes/field-error/index.d.ts +0 -2
  414. package/tokens/validation-errors.d.ts +0 -5
  415. package/utils/phone.d.ts +0 -3
  416. /package/{directives → components}/copy/copy.d.ts +0 -0
  417. /package/{directives → components}/copy/copy.options.d.ts +0 -0
  418. /package/{directives → components}/copy/index.d.ts +0 -0
@@ -2,9 +2,9 @@ import * as i0 from '@angular/core';
2
2
  import { inject, INJECTOR, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { ActivatedRoute, Router } from '@angular/router';
5
- import { TuiDialogService } from '@taiga-ui/core/components/dialog';
5
+ import { TuiDialogService } from '@taiga-ui/core/portals/dialog';
6
6
  import { PolymorpheusComponent } from '@taiga-ui/polymorpheus';
7
- import { from, of, switchMap } from 'rxjs';
7
+ import { from, of, delay, switchMap } from 'rxjs';
8
8
 
9
9
  function tuiGenerateDialogableRoute(component, { path = '', outlet = '', ...dialogOptions } = {}) {
10
10
  return {
@@ -32,7 +32,12 @@ class TuiRoutableDialog {
32
32
  this.dialog = inject(TuiDialogService);
33
33
  const { dialog } = this.route.snapshot.data;
34
34
  from(isClass(dialog) ? of(dialog) : dialog().then((m) => m.default ?? m))
35
- .pipe(switchMap((dialog) => this.dialog.open(new PolymorpheusComponent(dialog, this.injector), this.route.snapshot.data['dialogOptions'])), takeUntilDestroyed())
35
+ .pipe(
36
+ /**
37
+ * All portal hosts are created only after the first render
38
+ * See `@if (top()) {...}` condition in `tui-root`
39
+ */
40
+ delay(0), switchMap((dialog) => this.dialog.open(new PolymorpheusComponent(dialog, this.injector), this.route.snapshot.data['dialogOptions'])), takeUntilDestroyed())
36
41
  .subscribe({ complete: () => this.onDialogClosing() });
37
42
  }
38
43
  get lazyLoadedBackUrl() {
@@ -51,13 +56,12 @@ class TuiRoutableDialog {
51
56
  relativeTo: this.route,
52
57
  });
53
58
  }
54
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRoutableDialog, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
55
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiRoutableDialog, isStandalone: true, selector: "tui-routable-dialog", ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
59
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiRoutableDialog, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
60
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.16", type: TuiRoutableDialog, isStandalone: true, selector: "tui-routable-dialog", ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
56
61
  }
57
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRoutableDialog, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiRoutableDialog, decorators: [{
58
63
  type: Component,
59
64
  args: [{
60
- standalone: true,
61
65
  selector: 'tui-routable-dialog',
62
66
  template: '',
63
67
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-routable-dialog.mjs","sources":["../../../projects/kit/components/routable-dialog/generate-dialogable-route.ts","../../../projects/kit/components/routable-dialog/routable-dialog.component.ts","../../../projects/kit/components/routable-dialog/taiga-ui-kit-components-routable-dialog.ts"],"sourcesContent":["import {type Type} from '@angular/core';\nimport {type DefaultExport, type Route} from '@angular/router';\nimport {type TuiDialogOptions} from '@taiga-ui/core/components/dialog';\n\nexport function tuiGenerateDialogableRoute<I>(\n component: Type<any> | (() => Promise<DefaultExport<Type<any>> | Type<any>>),\n {\n path = '',\n outlet = '',\n ...dialogOptions\n }: Partial<TuiDialogOptions<I>> & {path?: string; outlet?: string} = {},\n): Route {\n return {\n path,\n outlet,\n loadComponent: async () => import('./routable-dialog.component'),\n data: {\n dialog: component,\n backUrl: path\n .split('/')\n .map(() => '..')\n .join('/'),\n isLazy: path === '',\n dialogOptions,\n },\n };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n INJECTOR,\n type Type,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {TuiDialogService} from '@taiga-ui/core/components/dialog';\nimport {PolymorpheusComponent} from '@taiga-ui/polymorpheus';\nimport {from, of, switchMap} from 'rxjs';\n\n@Component({\n standalone: true,\n selector: 'tui-routable-dialog',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class TuiRoutableDialog {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly injector = inject(INJECTOR);\n private readonly initialUrl = this.router.url;\n private readonly dialog = inject(TuiDialogService);\n\n constructor() {\n const {dialog} = this.route.snapshot.data;\n\n from(isClass(dialog) ? of(dialog) : dialog().then((m: any) => m.default ?? m))\n .pipe(\n switchMap((dialog: any) =>\n this.dialog.open(\n new PolymorpheusComponent<Type<any>>(dialog, this.injector),\n this.route.snapshot.data['dialogOptions'],\n ),\n ),\n takeUntilDestroyed(),\n )\n .subscribe({complete: () => this.onDialogClosing()});\n }\n\n private get lazyLoadedBackUrl(): string {\n return (this.route.parent?.snapshot.url || []).map(() => '..').join('/');\n }\n\n private onDialogClosing(): void {\n if (this.initialUrl === this.router.url) {\n this.navigateToParent();\n }\n }\n\n private navigateToParent(): void {\n const backUrl = this.route.snapshot.data['isLazy']\n ? this.lazyLoadedBackUrl\n : this.route.snapshot.data['backUrl'];\n\n void this.router.navigate([backUrl], {\n relativeTo: this.route,\n });\n }\n}\n\nfunction isClass(fn: unknown): boolean {\n return (\n typeof fn === 'function' &&\n Object.getOwnPropertyDescriptor(fn, 'prototype')?.writable === false\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAIgB,0BAA0B,CACtC,SAA4E,EAC5E,EACI,IAAI,GAAG,EAAE,EACT,MAAM,GAAG,EAAE,EACX,GAAG,aAAa,KACiD,EAAE,EAAA;IAEvE,OAAO;QACH,IAAI;QACJ,MAAM;QACN,aAAa,EAAE,YAAY,wEAAqC;AAChE,QAAA,IAAI,EAAE;AACF,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,OAAO,EAAE;iBACJ,KAAK,CAAC,GAAG;AACT,iBAAA,GAAG,CAAC,MAAM,IAAI;iBACd,IAAI,CAAC,GAAG,CAAC;YACd,MAAM,EAAE,IAAI,KAAK,EAAE;YACnB,aAAa;AAChB,SAAA;KACJ;AACL;;ACPc,MAAO,iBAAiB,CAAA;AAOlC,IAAA,WAAA,GAAA;AANiB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,MAAM,GAA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I,CAAC;cACL,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;QAEzC,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE;YACjC,UAAU,EAAE,IAAI,CAAC,KAAK;AACzB,SAAA,CAAC;;+GAxCW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,+EAHxB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGK,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBANrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAClD,iBAAA;;AA6CD,SAAS,OAAO,CAAC,EAAW,EAAA;AACxB,IAAA,QACI,OAAO,EAAE,KAAK,UAAU;AACxB,QAAA,MAAM,CAAC,wBAAwB,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,QAAQ,KAAK,KAAK;AAE5E;;;;;;;ACpEA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-kit-components-routable-dialog.mjs","sources":["../../../projects/kit/components/routable-dialog/generate-dialogable-route.ts","../../../projects/kit/components/routable-dialog/routable-dialog.component.ts","../../../projects/kit/components/routable-dialog/taiga-ui-kit-components-routable-dialog.ts"],"sourcesContent":["import {type Type} from '@angular/core';\nimport {type DefaultExport, type Route} from '@angular/router';\nimport {type TuiDialogOptions} from '@taiga-ui/core/portals/dialog';\n\nexport function tuiGenerateDialogableRoute<I>(\n component: Type<any> | (() => Promise<DefaultExport<Type<any>> | Type<any>>),\n {\n path = '',\n outlet = '',\n ...dialogOptions\n }: Partial<TuiDialogOptions<I>> & {path?: string; outlet?: string} = {},\n): Route {\n return {\n path,\n outlet,\n loadComponent: async () => import('./routable-dialog.component'),\n data: {\n dialog: component,\n backUrl: path\n .split('/')\n .map(() => '..')\n .join('/'),\n isLazy: path === '',\n dialogOptions,\n },\n };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n INJECTOR,\n type Type,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {TuiDialogService} from '@taiga-ui/core/portals/dialog';\nimport {PolymorpheusComponent} from '@taiga-ui/polymorpheus';\nimport {delay, from, of, switchMap} from 'rxjs';\n\n@Component({\n selector: 'tui-routable-dialog',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class TuiRoutableDialog {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly injector = inject(INJECTOR);\n private readonly initialUrl = this.router.url;\n private readonly dialog = inject(TuiDialogService);\n\n constructor() {\n const {dialog} = this.route.snapshot.data;\n\n from(isClass(dialog) ? of(dialog) : dialog().then((m: any) => m.default ?? m))\n .pipe(\n /**\n * All portal hosts are created only after the first render\n * See `@if (top()) {...}` condition in `tui-root`\n */\n delay(0),\n switchMap((dialog: any) =>\n this.dialog.open(\n new PolymorpheusComponent<Type<any>>(dialog, this.injector),\n this.route.snapshot.data['dialogOptions'],\n ),\n ),\n takeUntilDestroyed(),\n )\n .subscribe({complete: () => this.onDialogClosing()});\n }\n\n private get lazyLoadedBackUrl(): string {\n return (this.route.parent?.snapshot.url || []).map(() => '..').join('/');\n }\n\n private onDialogClosing(): void {\n if (this.initialUrl === this.router.url) {\n this.navigateToParent();\n }\n }\n\n private navigateToParent(): void {\n const backUrl = this.route.snapshot.data['isLazy']\n ? this.lazyLoadedBackUrl\n : this.route.snapshot.data['backUrl'];\n\n void this.router.navigate([backUrl], {\n relativeTo: this.route,\n });\n }\n}\n\nfunction isClass(fn: unknown): boolean {\n return (\n typeof fn === 'function' &&\n Object.getOwnPropertyDescriptor(fn, 'prototype')?.writable === false\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAIgB,0BAA0B,CACtC,SAA4E,EAC5E,EACI,IAAI,GAAG,EAAE,EACT,MAAM,GAAG,EAAE,EACX,GAAG,aAAa,KACiD,EAAE,EAAA;IAEvE,OAAO;QACH,IAAI;QACJ,MAAM;QACN,aAAa,EAAE,YAAY,wEAAqC;AAChE,QAAA,IAAI,EAAE;AACF,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,OAAO,EAAE;iBACJ,KAAK,CAAC,GAAG;AACT,iBAAA,GAAG,CAAC,MAAM,IAAI;iBACd,IAAI,CAAC,GAAG,CAAC;YACd,MAAM,EAAE,IAAI,KAAK,EAAE;YACnB,aAAa;AAChB,SAAA;KACJ;AACL;;ACRc,MAAO,iBAAiB,CAAA;AAOlC,IAAA,WAAA,GAAA;AANiB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG;AAC5B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAG9C,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI;AAEzC,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EA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B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,+EAHxB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGK,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBALrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAClD,iBAAA;;AAkDD,SAAS,OAAO,CAAC,EAAW,EAAA;AACxB,IAAA,QACI,OAAO,EAAE,KAAK,UAAU;AACxB,QAAA,MAAM,CAAC,wBAAwB,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,QAAQ,KAAK,KAAK;AAE5E;;;;;;;ACxEA;;AAEG;;;;"}
@@ -1,71 +1,55 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, ContentChildren, Directive, EventEmitter, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
2
+ import { inject, contentChildren, ElementRef, Directive, input, model, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
+ import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { ResizeObserverService } from '@ng-web-apis/resize-observer';
5
- import { tuiQueryListChanges, tuiControlValue, tuiZonefree } from '@taiga-ui/cdk/observables';
5
+ import { tuiControlValue, tuiZonefree } from '@taiga-ui/cdk/observables';
6
6
  import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
7
7
  import { tuiInjectElement, tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
8
8
  import { tuiPx } from '@taiga-ui/cdk/utils/miscellaneous';
9
9
  import { tuiBadgeNotificationOptionsProvider } from '@taiga-ui/kit/components/badge-notification';
10
10
  import { NgControl, RadioControlValueAccessor } from '@angular/forms';
11
11
  import { RouterLinkActive } from '@angular/router';
12
- import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
13
12
  import { switchMap, map } from 'rxjs';
14
13
 
15
14
  class TuiSegmentedDirective {
16
15
  constructor() {
17
- this.controls = EMPTY_QUERY;
18
- this.radios = EMPTY_QUERY;
19
- this.links = EMPTY_QUERY;
20
- this.elements = EMPTY_QUERY;
21
16
  this.component = inject(TuiSegmented);
22
17
  this.el = tuiInjectElement();
18
+ this.links = contentChildren(RouterLinkActive);
19
+ this.elements = contentChildren(RouterLinkActive, { read: ElementRef });
20
+ this.controls = contentChildren(NgControl, { descendants: true });
21
+ this.controls$ = toObservable(this.controls);
22
+ this.radios = contentChildren(RadioControlValueAccessor, {
23
+ descendants: true,
24
+ });
23
25
  }
24
26
  ngAfterContentInit() {
25
- tuiQueryListChanges(this.controls)
26
- .pipe(switchMap(() => tuiControlValue(this.controls.first)), map((value) => this.radios.toArray().findIndex((c) => c.value === value)))
27
+ this.controls$
28
+ .pipe(switchMap(([control]) => tuiControlValue(control)), map((value) => this.radios().findIndex((c) => c.value === value)))
27
29
  .subscribe((index) => {
28
30
  this.component.update(index);
29
31
  });
30
32
  }
31
33
  ngAfterContentChecked() {
32
- if (this.links.length) {
33
- this.update(this.elements.get(this.linkIndex)?.nativeElement || null);
34
+ const index = this.links().findIndex(({ isActive }) => isActive);
35
+ if (index !== -1) {
36
+ this.update(this.elements()[index]?.nativeElement || null);
34
37
  }
35
38
  }
36
39
  update(target) {
37
- this.component.update(this.getIndex(target));
38
- }
39
- get linkIndex() {
40
- return this.links.toArray().findIndex((link) => link.isActive);
40
+ this.component.update(Array.from(this.el.children).findIndex((tab) => tab.contains(target)));
41
41
  }
42
- getIndex(element) {
43
- return Array.from(this.el.children).findIndex((tab) => tab.contains(element));
44
- }
45
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSegmentedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
46
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiSegmentedDirective, isStandalone: true, host: { listeners: { "click": "update($event.target)" } }, queries: [{ propertyName: "controls", predicate: NgControl, descendants: true }, { propertyName: "radios", predicate: RadioControlValueAccessor, descendants: true }, { propertyName: "links", predicate: RouterLinkActive }, { propertyName: "elements", predicate: RouterLinkActive, read: ElementRef }], ngImport: i0 }); }
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiSegmentedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
43
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.16", type: TuiSegmentedDirective, isStandalone: true, host: { listeners: { "click": "update($event.target)" } }, queries: [{ propertyName: "links", predicate: RouterLinkActive, isSignal: true }, { propertyName: "elements", predicate: RouterLinkActive, read: ElementRef, isSignal: true }, { propertyName: "controls", predicate: NgControl, descendants: true, isSignal: true }, { propertyName: "radios", predicate: RadioControlValueAccessor, descendants: true, isSignal: true }], ngImport: i0 }); }
47
44
  }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSegmentedDirective, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiSegmentedDirective, decorators: [{
49
46
  type: Directive,
50
47
  args: [{
51
- standalone: true,
52
48
  host: {
53
49
  '(click)': 'update($event.target)',
54
50
  },
55
51
  }]
56
- }], propDecorators: { controls: [{
57
- type: ContentChildren,
58
- args: [NgControl, { descendants: true }]
59
- }], radios: [{
60
- type: ContentChildren,
61
- args: [RadioControlValueAccessor, { descendants: true }]
62
- }], links: [{
63
- type: ContentChildren,
64
- args: [RouterLinkActive]
65
- }], elements: [{
66
- type: ContentChildren,
67
- args: [RouterLinkActive, { read: ElementRef }]
68
- }] } });
52
+ }] });
69
53
 
70
54
  const [TUI_SEGMENTED_OPTIONS, tuiSegmentedOptionsProvider] = tuiCreateOptions({
71
55
  size: 's',
@@ -76,26 +60,21 @@ class TuiSegmented {
76
60
  this.sub = inject(ResizeObserverService, { self: true })
77
61
  .pipe(tuiZonefree(), takeUntilDestroyed())
78
62
  .subscribe(() => this.refresh());
79
- this.size = inject(TUI_SEGMENTED_OPTIONS).size;
80
- this.activeItemIndex = 0;
81
- this.activeItemIndexChange = new EventEmitter();
63
+ this.size = input(inject(TUI_SEGMENTED_OPTIONS).size);
64
+ this.activeItemIndex = model(0);
82
65
  }
83
66
  ngOnChanges() {
84
67
  this.refresh();
85
68
  }
86
69
  update(activeItemIndex) {
87
- if (activeItemIndex === this.activeItemIndex || activeItemIndex < 0) {
70
+ if (activeItemIndex === this.activeItemIndex() || activeItemIndex < 0) {
88
71
  return;
89
72
  }
90
- this.activeItemIndex = activeItemIndex;
91
- this.activeItemIndexChange.emit(activeItemIndex);
73
+ this.activeItemIndex.set(activeItemIndex);
92
74
  this.refresh();
93
75
  }
94
- get activeElement() {
95
- return this.el.children.item(this.activeItemIndex);
96
- }
97
76
  refresh() {
98
- const el = this.activeElement;
77
+ const el = this.el.children.item(this.activeItemIndex());
99
78
  if (!tuiIsHTMLElement(el)) {
100
79
  return;
101
80
  }
@@ -106,21 +85,15 @@ class TuiSegmented {
106
85
  this.el.style.setProperty('--t-left', tuiPx(offsetLeft));
107
86
  this.el.style.setProperty('--t-width', tuiPx(offsetWidth));
108
87
  }
109
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSegmented, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
110
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiSegmented, isStandalone: true, selector: "tui-segmented", inputs: { size: "size", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size" } }, providers: [ResizeObserverService, tuiBadgeNotificationOptionsProvider({ size: 's' })], usesOnChanges: true, hostDirectives: [{ directive: TuiSegmentedDirective }], ngImport: i0, template: '<ng-content />', isInline: true, styles: ["tui-segmented{position:relative;display:flex;color:var(--tui-background-base);background:var(--tui-background-neutral-1);overflow:hidden;-webkit-mask-image:linear-gradient(#000,#000);mask-image:linear-gradient(#000,#000)}tui-segmented[data-size=s]{--t-padding: .5rem;--t-gap: .5rem;--t-margin: -.125rem;--t-height: var(--tui-height-s);font:var(--tui-font-text-s);border-radius:var(--tui-radius-m)}tui-segmented[data-size=s] tui-icon{font-size:1rem}tui-segmented[data-size=m]{--t-padding: .875rem;--t-gap: 1rem;--t-margin: -.375rem;--t-height: var(--tui-height-m);font:var(--tui-font-text-m);border-radius:var(--tui-radius-m)}tui-segmented[data-size=l]{--t-padding: 1.25rem;--t-gap: 1rem;--t-margin: -.375rem;--t-height: var(--tui-height-l);font:var(--tui-font-text-l);border-radius:var(--tui-radius-l)}tui-segmented[data-size=l]>*:before{block-size:1.25rem}tui-segmented>a,tui-segmented>button,tui-segmented>label,tui-segmented>label>input:not([tuiRadio]){transition-property:color,background,opacity,border-image;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;position:relative;display:flex;align-items:center;justify-content:center;block-size:var(--t-height);white-space:nowrap;gap:var(--t-gap);margin:0;padding:0 var(--t-padding);color:var(--tui-text-primary);overflow:hidden;cursor:pointer;font:inherit;border-radius:inherit;border:.125rem solid transparent;background-clip:padding-box;box-sizing:border-box;border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 0 0 100 .5;clip-path:polygon(-1rem calc(50% - .5rem),1px calc(50% - .5rem),1px 0,100% 0,100% 100%,1px 100%,1px calc(50% + .5rem),-1rem calc(50% + .5rem))}tui-segmented>a>*,tui-segmented>button>*,tui-segmented>label>*,tui-segmented>label>input:not([tuiRadio])>*{margin:0 var(--t-margin)}tui-segmented>a:focus-visible,tui-segmented>button:focus-visible,tui-segmented>label:focus-visible,tui-segmented>label>input:not([tuiRadio]):focus-visible{outline:.125rem solid var(--tui-border-focus);outline-offset:-.25rem}@media (hover: hover) and (pointer: fine){tui-segmented>a:not(.tui-segmented_active):not(:active):hover,tui-segmented>button:not(.tui-segmented_active):not(:active):hover,tui-segmented>label:not(.tui-segmented_active):not(:active):hover,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover{background-color:var(--tui-background-neutral-1-hover)}tui-segmented>a:not(.tui-segmented_active):not(:active):hover,tui-segmented>button:not(.tui-segmented_active):not(:active):hover,tui-segmented>label:not(.tui-segmented_active):not(:active):hover,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover,tui-segmented>a:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>button:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>label:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover+*{border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 100 0 0 .5}}tui-segmented>a:active,tui-segmented>button:active,tui-segmented>label:active,tui-segmented>label>input:not([tuiRadio]):active,tui-segmented>a:active+*,tui-segmented>button:active+*,tui-segmented>label:active+*,tui-segmented>label>input:not([tuiRadio]):active+*,tui-segmented>a.tui-segmented_active,tui-segmented>button.tui-segmented_active,tui-segmented>label.tui-segmented_active,tui-segmented>label>input:not([tuiRadio]).tui-segmented_active,tui-segmented>a.tui-segmented_active+*,tui-segmented>button.tui-segmented_active+*,tui-segmented>label.tui-segmented_active+*,tui-segmented>label>input:not([tuiRadio]).tui-segmented_active+*{border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 100 0 0 .5}tui-segmented>label>input:not([tuiRadio]){position:absolute;top:-.125rem;left:-.125rem;right:-.125rem;bottom:-.125rem;background:transparent!important}tui-segmented:before{transition-property:top,left,width;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;left:var(--t-left);top:var(--t-top);block-size:var(--t-height);inline-size:var(--t-width);border-radius:inherit;background:currentColor;background-clip:padding-box;border:.125rem solid transparent;box-sizing:border-box;filter:drop-shadow(0 .25rem 1.25rem rgba(0,0,0,.1))}[tuiTheme=dark] tui-segmented,tui-segmented[tuiTheme=dark]{--tui-background-base: var(--tui-background-neutral-1-hover)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
88
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiSegmented, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
89
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.16", type: TuiSegmented, isStandalone: true, selector: "tui-segmented", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, activeItemIndex: { classPropertyName: "activeItemIndex", publicName: "activeItemIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeItemIndex: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size()" } }, providers: [ResizeObserverService, tuiBadgeNotificationOptionsProvider({ size: 's' })], usesOnChanges: true, hostDirectives: [{ directive: TuiSegmentedDirective }], ngImport: i0, template: '<ng-content />', isInline: true, styles: ["tui-segmented{position:relative;display:flex;color:var(--tui-background-base);background:var(--tui-background-neutral-1);overflow:hidden;-webkit-mask-image:linear-gradient(#000,#000);mask-image:linear-gradient(#000,#000)}tui-segmented[data-size=s]{--t-padding: .5rem;--t-gap: .5rem;--t-margin: -.125rem;--t-height: var(--tui-height-s);font:var(--tui-font-text-s);border-radius:var(--tui-radius-m)}tui-segmented[data-size=s] tui-icon{font-size:1rem}tui-segmented[data-size=m]{--t-padding: .875rem;--t-gap: 1rem;--t-margin: -.375rem;--t-height: var(--tui-height-m);font:var(--tui-font-text-m);border-radius:var(--tui-radius-m)}tui-segmented[data-size=l]{--t-padding: 1.25rem;--t-gap: 1rem;--t-margin: -.375rem;--t-height: var(--tui-height-l);font:var(--tui-font-text-l);border-radius:var(--tui-radius-l)}tui-segmented[data-size=l]>*:before{block-size:1.25rem}tui-segmented>a,tui-segmented>button,tui-segmented>label,tui-segmented>label>input:not([tuiRadio]){transition-property:color,background,opacity,border-image;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;position:relative;display:flex;align-items:center;justify-content:center;block-size:var(--t-height);white-space:nowrap;gap:var(--t-gap);margin:0;padding:0 var(--t-padding);color:var(--tui-text-primary);overflow:hidden;cursor:pointer;font:inherit;border-radius:inherit;border:.125rem solid transparent;background-clip:padding-box;box-sizing:border-box;border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 0 0 100 .5;clip-path:polygon(-1rem calc(50% - .5rem),1px calc(50% - .5rem),1px 0,100% 0,100% 100%,1px 100%,1px calc(50% + .5rem),-1rem calc(50% + .5rem))}tui-segmented>a>*,tui-segmented>button>*,tui-segmented>label>*,tui-segmented>label>input:not([tuiRadio])>*{margin:0 var(--t-margin)}tui-segmented>a:focus-visible,tui-segmented>button:focus-visible,tui-segmented>label:focus-visible,tui-segmented>label>input:not([tuiRadio]):focus-visible{outline:.125rem solid var(--tui-border-focus);outline-offset:-.25rem}@media (hover: hover) and (pointer: fine){tui-segmented>a:not(.tui-segmented_active):not(:active):hover,tui-segmented>button:not(.tui-segmented_active):not(:active):hover,tui-segmented>label:not(.tui-segmented_active):not(:active):hover,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover{background-color:var(--tui-background-neutral-1-hover)}tui-segmented>a:not(.tui-segmented_active):not(:active):hover,tui-segmented>button:not(.tui-segmented_active):not(:active):hover,tui-segmented>label:not(.tui-segmented_active):not(:active):hover,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover,tui-segmented>a:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>button:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>label:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover+*{border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 100 0 0 .5}}tui-segmented>a:active,tui-segmented>button:active,tui-segmented>label:active,tui-segmented>label>input:not([tuiRadio]):active,tui-segmented>a:active+*,tui-segmented>button:active+*,tui-segmented>label:active+*,tui-segmented>label>input:not([tuiRadio]):active+*,tui-segmented>a.tui-segmented_active,tui-segmented>button.tui-segmented_active,tui-segmented>label.tui-segmented_active,tui-segmented>label>input:not([tuiRadio]).tui-segmented_active,tui-segmented>a.tui-segmented_active+*,tui-segmented>button.tui-segmented_active+*,tui-segmented>label.tui-segmented_active+*,tui-segmented>label>input:not([tuiRadio]).tui-segmented_active+*{border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 100 0 0 .5}tui-segmented>label>input:not([tuiRadio]){position:absolute;inset:-.125rem;background:transparent!important}tui-segmented:before{transition-property:top,left,width;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;inset:var(--t-top) auto auto var(--t-left);block-size:var(--t-height);inline-size:var(--t-width);border-radius:inherit;background:currentColor;background-clip:padding-box;border:.125rem solid transparent;box-sizing:border-box;filter:drop-shadow(0 .25rem 1.25rem rgba(0,0,0,.1))}[dir=rtl] tui-segmented:before{inset-inline:auto var(--t-left)}[tuiTheme=dark] tui-segmented,tui-segmented[tuiTheme=dark]{--tui-background-base: var(--tui-background-neutral-1-hover)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
111
90
  }
112
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSegmented, decorators: [{
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiSegmented, decorators: [{
113
92
  type: Component,
114
- args: [{ standalone: true, selector: 'tui-segmented', template: '<ng-content />', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [ResizeObserverService, tuiBadgeNotificationOptionsProvider({ size: 's' })], hostDirectives: [TuiSegmentedDirective], host: {
115
- '[attr.data-size]': 'size',
116
- }, styles: ["tui-segmented{position:relative;display:flex;color:var(--tui-background-base);background:var(--tui-background-neutral-1);overflow:hidden;-webkit-mask-image:linear-gradient(#000,#000);mask-image:linear-gradient(#000,#000)}tui-segmented[data-size=s]{--t-padding: .5rem;--t-gap: .5rem;--t-margin: -.125rem;--t-height: var(--tui-height-s);font:var(--tui-font-text-s);border-radius:var(--tui-radius-m)}tui-segmented[data-size=s] tui-icon{font-size:1rem}tui-segmented[data-size=m]{--t-padding: .875rem;--t-gap: 1rem;--t-margin: -.375rem;--t-height: var(--tui-height-m);font:var(--tui-font-text-m);border-radius:var(--tui-radius-m)}tui-segmented[data-size=l]{--t-padding: 1.25rem;--t-gap: 1rem;--t-margin: -.375rem;--t-height: var(--tui-height-l);font:var(--tui-font-text-l);border-radius:var(--tui-radius-l)}tui-segmented[data-size=l]>*:before{block-size:1.25rem}tui-segmented>a,tui-segmented>button,tui-segmented>label,tui-segmented>label>input:not([tuiRadio]){transition-property:color,background,opacity,border-image;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;position:relative;display:flex;align-items:center;justify-content:center;block-size:var(--t-height);white-space:nowrap;gap:var(--t-gap);margin:0;padding:0 var(--t-padding);color:var(--tui-text-primary);overflow:hidden;cursor:pointer;font:inherit;border-radius:inherit;border:.125rem solid transparent;background-clip:padding-box;box-sizing:border-box;border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 0 0 100 .5;clip-path:polygon(-1rem calc(50% - .5rem),1px calc(50% - .5rem),1px 0,100% 0,100% 100%,1px 100%,1px calc(50% + .5rem),-1rem calc(50% + .5rem))}tui-segmented>a>*,tui-segmented>button>*,tui-segmented>label>*,tui-segmented>label>input:not([tuiRadio])>*{margin:0 var(--t-margin)}tui-segmented>a:focus-visible,tui-segmented>button:focus-visible,tui-segmented>label:focus-visible,tui-segmented>label>input:not([tuiRadio]):focus-visible{outline:.125rem solid var(--tui-border-focus);outline-offset:-.25rem}@media (hover: hover) and (pointer: fine){tui-segmented>a:not(.tui-segmented_active):not(:active):hover,tui-segmented>button:not(.tui-segmented_active):not(:active):hover,tui-segmented>label:not(.tui-segmented_active):not(:active):hover,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover{background-color:var(--tui-background-neutral-1-hover)}tui-segmented>a:not(.tui-segmented_active):not(:active):hover,tui-segmented>button:not(.tui-segmented_active):not(:active):hover,tui-segmented>label:not(.tui-segmented_active):not(:active):hover,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover,tui-segmented>a:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>button:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>label:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover+*{border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 100 0 0 .5}}tui-segmented>a:active,tui-segmented>button:active,tui-segmented>label:active,tui-segmented>label>input:not([tuiRadio]):active,tui-segmented>a:active+*,tui-segmented>button:active+*,tui-segmented>label:active+*,tui-segmented>label>input:not([tuiRadio]):active+*,tui-segmented>a.tui-segmented_active,tui-segmented>button.tui-segmented_active,tui-segmented>label.tui-segmented_active,tui-segmented>label>input:not([tuiRadio]).tui-segmented_active,tui-segmented>a.tui-segmented_active+*,tui-segmented>button.tui-segmented_active+*,tui-segmented>label.tui-segmented_active+*,tui-segmented>label>input:not([tuiRadio]).tui-segmented_active+*{border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 100 0 0 .5}tui-segmented>label>input:not([tuiRadio]){position:absolute;top:-.125rem;left:-.125rem;right:-.125rem;bottom:-.125rem;background:transparent!important}tui-segmented:before{transition-property:top,left,width;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;left:var(--t-left);top:var(--t-top);block-size:var(--t-height);inline-size:var(--t-width);border-radius:inherit;background:currentColor;background-clip:padding-box;border:.125rem solid transparent;box-sizing:border-box;filter:drop-shadow(0 .25rem 1.25rem rgba(0,0,0,.1))}[tuiTheme=dark] tui-segmented,tui-segmented[tuiTheme=dark]{--tui-background-base: var(--tui-background-neutral-1-hover)}\n"] }]
117
- }], propDecorators: { size: [{
118
- type: Input
119
- }], activeItemIndex: [{
120
- type: Input
121
- }], activeItemIndexChange: [{
122
- type: Output
123
- }] } });
93
+ args: [{ selector: 'tui-segmented', template: '<ng-content />', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [ResizeObserverService, tuiBadgeNotificationOptionsProvider({ size: 's' })], hostDirectives: [TuiSegmentedDirective], host: {
94
+ '[attr.data-size]': 'size()',
95
+ }, styles: ["tui-segmented{position:relative;display:flex;color:var(--tui-background-base);background:var(--tui-background-neutral-1);overflow:hidden;-webkit-mask-image:linear-gradient(#000,#000);mask-image:linear-gradient(#000,#000)}tui-segmented[data-size=s]{--t-padding: .5rem;--t-gap: .5rem;--t-margin: -.125rem;--t-height: var(--tui-height-s);font:var(--tui-font-text-s);border-radius:var(--tui-radius-m)}tui-segmented[data-size=s] tui-icon{font-size:1rem}tui-segmented[data-size=m]{--t-padding: .875rem;--t-gap: 1rem;--t-margin: -.375rem;--t-height: var(--tui-height-m);font:var(--tui-font-text-m);border-radius:var(--tui-radius-m)}tui-segmented[data-size=l]{--t-padding: 1.25rem;--t-gap: 1rem;--t-margin: -.375rem;--t-height: var(--tui-height-l);font:var(--tui-font-text-l);border-radius:var(--tui-radius-l)}tui-segmented[data-size=l]>*:before{block-size:1.25rem}tui-segmented>a,tui-segmented>button,tui-segmented>label,tui-segmented>label>input:not([tuiRadio]){transition-property:color,background,opacity,border-image;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;position:relative;display:flex;align-items:center;justify-content:center;block-size:var(--t-height);white-space:nowrap;gap:var(--t-gap);margin:0;padding:0 var(--t-padding);color:var(--tui-text-primary);overflow:hidden;cursor:pointer;font:inherit;border-radius:inherit;border:.125rem solid transparent;background-clip:padding-box;box-sizing:border-box;border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 0 0 100 .5;clip-path:polygon(-1rem calc(50% - .5rem),1px calc(50% - .5rem),1px 0,100% 0,100% 100%,1px 100%,1px calc(50% + .5rem),-1rem calc(50% + .5rem))}tui-segmented>a>*,tui-segmented>button>*,tui-segmented>label>*,tui-segmented>label>input:not([tuiRadio])>*{margin:0 var(--t-margin)}tui-segmented>a:focus-visible,tui-segmented>button:focus-visible,tui-segmented>label:focus-visible,tui-segmented>label>input:not([tuiRadio]):focus-visible{outline:.125rem solid var(--tui-border-focus);outline-offset:-.25rem}@media (hover: hover) and (pointer: fine){tui-segmented>a:not(.tui-segmented_active):not(:active):hover,tui-segmented>button:not(.tui-segmented_active):not(:active):hover,tui-segmented>label:not(.tui-segmented_active):not(:active):hover,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover{background-color:var(--tui-background-neutral-1-hover)}tui-segmented>a:not(.tui-segmented_active):not(:active):hover,tui-segmented>button:not(.tui-segmented_active):not(:active):hover,tui-segmented>label:not(.tui-segmented_active):not(:active):hover,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover,tui-segmented>a:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>button:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>label:not(.tui-segmented_active):not(:active):hover+*,tui-segmented>label>input:not([tuiRadio]):not(.tui-segmented_active):not(:active):hover+*{border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 100 0 0 .5}}tui-segmented>a:active,tui-segmented>button:active,tui-segmented>label:active,tui-segmented>label>input:not([tuiRadio]):active,tui-segmented>a:active+*,tui-segmented>button:active+*,tui-segmented>label:active+*,tui-segmented>label>input:not([tuiRadio]):active+*,tui-segmented>a.tui-segmented_active,tui-segmented>button.tui-segmented_active,tui-segmented>label.tui-segmented_active,tui-segmented>label>input:not([tuiRadio]).tui-segmented_active,tui-segmented>a.tui-segmented_active+*,tui-segmented>button.tui-segmented_active+*,tui-segmented>label.tui-segmented_active+*,tui-segmented>label>input:not([tuiRadio]).tui-segmented_active+*{border-image:linear-gradient(var(--tui-border-normal),transparent) 1 / 0 0 25% .5 / 100 0 0 .5}tui-segmented>label>input:not([tuiRadio]){position:absolute;inset:-.125rem;background:transparent!important}tui-segmented:before{transition-property:top,left,width;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;inset:var(--t-top) auto auto var(--t-left);block-size:var(--t-height);inline-size:var(--t-width);border-radius:inherit;background:currentColor;background-clip:padding-box;border:.125rem solid transparent;box-sizing:border-box;filter:drop-shadow(0 .25rem 1.25rem rgba(0,0,0,.1))}[dir=rtl] tui-segmented:before{inset-inline:auto var(--t-left)}[tuiTheme=dark] tui-segmented,tui-segmented[tuiTheme=dark]{--tui-background-base: var(--tui-background-neutral-1-hover)}\n"] }]
96
+ }] });
124
97
 
125
98
  /**
126
99
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-segmented.mjs","sources":["../../../projects/kit/components/segmented/segmented.directive.ts","../../../projects/kit/components/segmented/segmented.component.ts","../../../projects/kit/components/segmented/taiga-ui-kit-components-segmented.ts"],"sourcesContent":["import {\n type AfterContentChecked,\n type AfterContentInit,\n ContentChildren,\n Directive,\n ElementRef,\n inject,\n type QueryList,\n} from '@angular/core';\nimport {NgControl, RadioControlValueAccessor} from '@angular/forms';\nimport {RouterLinkActive} from '@angular/router';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {tuiControlValue, tuiQueryListChanges} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {map, switchMap} from 'rxjs';\n\nimport {TuiSegmented} from './segmented.component';\n\n@Directive({\n standalone: true,\n host: {\n '(click)': 'update($event.target)',\n },\n})\nexport class TuiSegmentedDirective implements AfterContentChecked, AfterContentInit {\n @ContentChildren(NgControl, {descendants: true})\n private readonly controls: QueryList<NgControl> = EMPTY_QUERY;\n\n @ContentChildren(RadioControlValueAccessor, {descendants: true})\n private readonly radios: QueryList<RadioControlValueAccessor> = EMPTY_QUERY;\n\n @ContentChildren(RouterLinkActive)\n private readonly links: QueryList<RouterLinkActive> = EMPTY_QUERY;\n\n @ContentChildren(RouterLinkActive, {read: ElementRef})\n private readonly elements: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n private readonly component = inject(TuiSegmented);\n private readonly el = tuiInjectElement();\n\n public ngAfterContentInit(): void {\n tuiQueryListChanges(this.controls)\n .pipe(\n switchMap(() => tuiControlValue(this.controls.first)),\n map((value) => this.radios.toArray().findIndex((c) => c.value === value)),\n )\n .subscribe((index) => {\n this.component.update(index);\n });\n }\n\n public ngAfterContentChecked(): void {\n if (this.links.length) {\n this.update(this.elements.get(this.linkIndex)?.nativeElement || null);\n }\n }\n\n protected update(target: Element | null): void {\n this.component.update(this.getIndex(target));\n }\n\n private get linkIndex(): number {\n return this.links.toArray().findIndex((link) => link.isActive);\n }\n\n private getIndex(element: Element | null): number {\n return Array.from(this.el.children).findIndex((tab) => tab.contains(element));\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n inject,\n Input,\n type OnChanges,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ResizeObserverService} from '@ng-web-apis/resize-observer';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {tuiInjectElement, tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\nimport {tuiBadgeNotificationOptionsProvider} from '@taiga-ui/kit/components/badge-notification';\n\nimport {TuiSegmentedDirective} from './segmented.directive';\n\nexport const [TUI_SEGMENTED_OPTIONS, tuiSegmentedOptionsProvider] = tuiCreateOptions({\n size: 's' as TuiSizeL | TuiSizeS,\n});\n\n@Component({\n standalone: true,\n selector: 'tui-segmented',\n template: '<ng-content />',\n styleUrls: ['./segmented.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [ResizeObserverService, tuiBadgeNotificationOptionsProvider({size: 's'})],\n hostDirectives: [TuiSegmentedDirective],\n host: {\n '[attr.data-size]': 'size',\n },\n})\nexport class TuiSegmented implements OnChanges {\n private readonly el = tuiInjectElement();\n\n protected readonly sub = inject(ResizeObserverService, {self: true})\n .pipe(tuiZonefree(), takeUntilDestroyed())\n .subscribe(() => this.refresh());\n\n @Input()\n public size: TuiSizeL | TuiSizeS = inject(TUI_SEGMENTED_OPTIONS).size;\n\n @Input()\n public activeItemIndex = 0;\n\n @Output()\n public readonly activeItemIndexChange = new EventEmitter<number>();\n\n public ngOnChanges(): void {\n this.refresh();\n }\n\n public update(activeItemIndex: number): void {\n if (activeItemIndex === this.activeItemIndex || activeItemIndex < 0) {\n return;\n }\n\n this.activeItemIndex = activeItemIndex;\n this.activeItemIndexChange.emit(activeItemIndex);\n this.refresh();\n }\n\n private get activeElement(): Element | null {\n return this.el.children.item(this.activeItemIndex);\n }\n\n private refresh(): void {\n const el = this.activeElement;\n\n if (!tuiIsHTMLElement(el)) {\n return;\n }\n\n Array.from(this.el.children).forEach((e) =>\n e.classList.remove('tui-segmented_active'),\n );\n\n el.classList.add('tui-segmented_active');\n\n const {offsetWidth = 0, offsetLeft = 0, offsetTop = 0} = el;\n\n this.el.style.setProperty('--t-top', tuiPx(offsetTop));\n this.el.style.setProperty('--t-left', tuiPx(offsetLeft));\n this.el.style.setProperty('--t-width', tuiPx(offsetWidth));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAwBa,qBAAqB,CAAA;AANlC,IAAA,WAAA,GAAA;QAQqB,IAAQ,CAAA,QAAA,GAAyB,WAAW;QAG5C,IAAM,CAAA,MAAA,GAAyC,WAAW;QAG1D,IAAK,CAAA,KAAA,GAAgC,WAAW;QAGhD,IAAQ,CAAA,QAAA,GAAuC,WAAW;AAE1D,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;QAChC,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;AA8B3C;IA5BU,kBAAkB,GAAA;AACrB,QAAA,mBAAmB,CAAC,IAAI,CAAC,QAAQ;aAC5B,IAAI,CACD,SAAS,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EACrD,GAAG,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AAE5E,aAAA,SAAS,CAAC,CAAC,KAAK,KAAI;AACjB,YAAA,IAAI,CAAC,SAAS,CAAC,MA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AAe,EAAA,CAAA;sBADrB;gBAIe,qBAAqB,EAAA,CAAA;sBADpC;;;ACnDL;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-kit-components-segmented.mjs","sources":["../../../projects/kit/components/segmented/segmented.directive.ts","../../../projects/kit/components/segmented/segmented.component.ts","../../../projects/kit/components/segmented/taiga-ui-kit-components-segmented.ts"],"sourcesContent":["import {\n type AfterContentChecked,\n type AfterContentInit,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n} from '@angular/core';\nimport {toObservable} from '@angular/core/rxjs-interop';\nimport {NgControl, RadioControlValueAccessor} from '@angular/forms';\nimport {RouterLinkActive} from '@angular/router';\nimport {tuiControlValue} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {map, switchMap} from 'rxjs';\n\nimport {TuiSegmented} from './segmented.component';\n\n@Directive({\n host: {\n '(click)': 'update($event.target)',\n },\n})\nexport class TuiSegmentedDirective implements AfterContentChecked, AfterContentInit {\n private readonly component = inject(TuiSegmented);\n private readonly el = tuiInjectElement();\n private readonly links = contentChildren(RouterLinkActive);\n private readonly elements = contentChildren(RouterLinkActive, {read: ElementRef});\n private readonly controls = contentChildren(NgControl, {descendants: true});\n private readonly controls$ = toObservable(this.controls);\n private readonly radios = contentChildren(RadioControlValueAccessor, {\n descendants: true,\n });\n\n public ngAfterContentInit(): void {\n this.controls$\n .pipe(\n switchMap(([control]) => tuiControlValue(control)),\n map((value) => this.radios().findIndex((c) => c.value === value)),\n )\n .subscribe((index) => {\n this.component.update(index);\n });\n }\n\n public ngAfterContentChecked(): void {\n const index = this.links().findIndex(({isActive}) => isActive);\n\n if (index !== -1) {\n this.update(this.elements()[index]?.nativeElement || null);\n }\n }\n\n protected update(target: Element | null): void {\n this.component.update(\n Array.from(this.el.children).findIndex((tab) => tab.contains(target)),\n );\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n model,\n type OnChanges,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ResizeObserverService} from '@ng-web-apis/resize-observer';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {tuiInjectElement, tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\nimport {tuiBadgeNotificationOptionsProvider} from '@taiga-ui/kit/components/badge-notification';\n\nimport {TuiSegmentedDirective} from './segmented.directive';\n\nexport const [TUI_SEGMENTED_OPTIONS, tuiSegmentedOptionsProvider] = tuiCreateOptions({\n size: 's' as TuiSizeL | TuiSizeS,\n});\n\n@Component({\n selector: 'tui-segmented',\n template: '<ng-content />',\n styleUrl: './segmented.style.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [ResizeObserverService, tuiBadgeNotificationOptionsProvider({size: 's'})],\n hostDirectives: [TuiSegmentedDirective],\n host: {\n '[attr.data-size]': 'size()',\n },\n})\nexport class TuiSegmented implements OnChanges {\n private readonly el = tuiInjectElement();\n\n protected readonly sub = inject(ResizeObserverService, {self: true})\n .pipe(tuiZonefree(), takeUntilDestroyed())\n .subscribe(() => this.refresh());\n\n public readonly size = input(inject(TUI_SEGMENTED_OPTIONS).size);\n public readonly activeItemIndex = model(0);\n\n public ngOnChanges(): void {\n this.refresh();\n }\n\n public update(activeItemIndex: number): void {\n if (activeItemIndex === this.activeItemIndex() || activeItemIndex < 0) {\n return;\n }\n\n this.activeItemIndex.set(activeItemIndex);\n this.refresh();\n }\n\n private refresh(): void {\n const el = this.el.children.item(this.activeItemIndex());\n\n if (!tuiIsHTMLElement(el)) {\n return;\n }\n\n Array.from(this.el.children).forEach((e) =>\n e.classList.remove('tui-segmented_active'),\n );\n\n el.classList.add('tui-segmented_active');\n\n const {offsetWidth = 0, offsetLeft = 0, offsetTop = 0} = el;\n\n this.el.style.setProperty('--t-top', tuiPx(offsetTop));\n this.el.style.setProperty('--t-left', tuiPx(offsetLeft));\n this.el.style.setProperty('--t-width', tuiPx(offsetWidth));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAsBa,qBAAqB,CAAA;AALlC,IAAA,WAAA,GAAA;AAMqB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;QAChC,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;AACvB,QAAA,IAAA,CAAA,KAAK,GAAG,eAAe,CAAC,gBAAgB,CAAC;QACzC,IAAQ,CAAA,QAAA,GAAG,eAAe,CAAC,gBAAgB,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC;QAChE,IAAQ,CAAA,QAAA,GAAG,eAAe,CAAC,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;AAC1D,QAAA,IAAA,CAAA,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC;AACvC,QAAA,IAAA,CAAA,MAAM,GAAG,eAAe,CAAC,yBAAyB,EAAE;AACjE,YAAA,WAAW,EAAE,IAAI;AACpB,SAAA,CAAC;AA0BL;IAxBU,kBAAkB,GAAA;AACrB,QAAA,IAAI,CAAC;AACA,aAAA,IAAI,CACD,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,eAAe,CAAC,OAAO,CAAC,CAAC,EAClD,GAAG,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AAEpE,aAAA,SAAS,CAAC,CAAC,KAAK,KAAI;AACjB,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;AAChC,SAAC,CAAC;;IAGH,qBA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IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,SAAA,EAAA,CAAC,qBAAqB,EAAE,mCAAmC,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,CAAC,uGAJ1E,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,4kJAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FAUjB,YAAY,EAAA,UAAA,EAAA,CAAA;kBAZxB,SAAS;+BACI,eAAe,EAAA,QAAA,EACf,gBAAgB,EAAA,aAAA,EAEX,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC,CAAC,qBAAqB,EAAE,mCAAmC,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,CAAC,EACpE,cAAA,EAAA,CAAC,qBAAqB,CAAC,EACjC,IAAA,EAAA;AACF,wBAAA,kBAAkB,EAAE,QAAQ;AAC/B,qBAAA,EAAA,MAAA,EAAA,CAAA,4kJAAA,CAAA,EAAA;;;AClCL;;AAEG;;;;"}
@@ -1,15 +1,19 @@
1
1
  import { NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, signal, computed, effect, Input, ChangeDetectionStrategy, Component, Directive } from '@angular/core';
3
+ import { inject, viewChildren, computed, effect, input, ChangeDetectionStrategy, Component, Directive } from '@angular/core';
4
4
  import { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
5
- import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
6
- import { tuiIsPresent, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/miscellaneous';
7
- import * as i1 from '@taiga-ui/core/components/textfield';
8
- import { TuiTextfieldDirective, tuiAsTextfieldAccessor, TuiWithTextfield, TuiSelectLike } from '@taiga-ui/core/components/textfield';
5
+ import { tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
6
+ import * as i1 from '@taiga-ui/core/components/input';
7
+ import { TuiInputDirective, TuiWithInput } from '@taiga-ui/core/components/input';
8
+ import * as i2 from '@taiga-ui/core/components/textfield';
9
+ import { tuiAsTextfieldAccessor, TuiSelectLike, TuiTextfieldComponent, TuiTextfieldOptionsDirective } from '@taiga-ui/core/components/textfield';
9
10
  import { TUI_ITEMS_HANDLERS } from '@taiga-ui/core/directives/items-handlers';
10
11
  import { tuiIsFlat, tuiInjectValue } from '@taiga-ui/kit/utils';
12
+ import { TuiLabel } from '@taiga-ui/core/components/label';
13
+ import { TuiDropdownContent } from '@taiga-ui/core/portals';
11
14
  import { TuiDataListComponent, TuiOptionWithValue, tuiAsOptionContent } from '@taiga-ui/core/components/data-list';
12
- import { tuiDropdownOpen, tuiDropdownEnabled } from '@taiga-ui/core/directives/dropdown';
15
+ import { TuiDropdownOpen, tuiDropdownEnabled } from '@taiga-ui/core/portals/dropdown';
16
+ import { tuiDirectiveBinding } from '@taiga-ui/cdk/utils/di';
13
17
  import * as i1$1 from '@taiga-ui/core/components/scrollbar';
14
18
  import { TuiScrollIntoView } from '@taiga-ui/core/components/scrollbar';
15
19
  import { TuiCheckbox, tuiCheckboxOptionsProvider } from '@taiga-ui/kit/components/checkbox';
@@ -17,48 +21,50 @@ import { TuiCheckbox, tuiCheckboxOptionsProvider } from '@taiga-ui/kit/component
17
21
  class TuiNativeSelect extends TuiControl {
18
22
  constructor() {
19
23
  super(...arguments);
20
- this.textfield = inject(TuiTextfieldDirective);
24
+ this.input = inject(TuiInputDirective);
25
+ this.options = viewChildren('option');
21
26
  this.isFlat = tuiIsFlat;
22
- this.placeholder = signal('');
23
27
  this.itemsHandlers = inject(TUI_ITEMS_HANDLERS);
24
28
  this.stringified = computed((value = this.value()) => tuiIsPresent(value) ? this.itemsHandlers.stringify()(value) : '');
25
- this.showPlaceholder = computed(() => this.placeholder() && !this.stringified());
26
29
  this.isSelected = computed((value = this.value()) => (x) => tuiIsPresent(value) && this.itemsHandlers.identityMatcher()(x, value));
27
30
  this.valueEffect = effect(() => {
28
- this.textfield.value.set(this.stringified());
29
- }, TUI_ALLOW_SIGNAL_WRITES);
30
- this.items = [];
31
- this.labels = [];
32
- }
33
- // TODO(v5): use signal inputs
34
- set placeholderSetter(x) {
35
- this.placeholder.set(x);
31
+ /**
32
+ * Wait until all `<option>`-s are inside DOM.
33
+ * Otherwise
34
+ * ```
35
+ * document.querySelector('select').value = 'even upcoming valid value';
36
+ * // same as
37
+ * document.querySelector('select').value = '';
38
+ * ```
39
+ * (it breaks `tuiValue` utility logic)
40
+ */
41
+ if (this.options().length) {
42
+ this.input.value.set(this.stringified());
43
+ }
44
+ });
45
+ this.items = input([]);
46
+ this.labels = input([]);
47
+ this.placeholder = input('');
36
48
  }
37
49
  setValue(value) {
38
50
  this.onChange(value);
39
51
  }
40
52
  selectOption(index) {
41
- const items = (this.items?.flat() ?? []);
42
- this.onChange(items[index - (this.showPlaceholder() ? 1 : 0)] ?? null);
53
+ const items = (this.items()?.flat() ?? []);
54
+ const placeholderOffset = this.stringified() ? 0 : 1;
55
+ this.onChange(items[index - placeholderOffset] ?? null);
43
56
  }
44
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeSelect, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
45
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiNativeSelect, isStandalone: true, selector: "select[tuiSelect]", inputs: { items: "items", labels: "labels", placeholderSetter: ["placeholder", "placeholderSetter"] }, host: { listeners: { "change": "selectOption($event.target.options.selectedIndex)" }, properties: { "attr.aria-invalid": "invalid()", "disabled": "!interactive()" } }, providers: [tuiAsTextfieldAccessor(TuiNativeSelect), tuiAsControl(TuiNativeSelect)], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithTextfield }], ngImport: i0, template: "@if (showPlaceholder()) {\n <option\n disabled\n selected\n value=\"\"\n >\n {{ placeholder() }}\n </option>\n}\n\n@if (items && !isFlat(items)) {\n @for (group of labels; track group; let index = $index) {\n <optgroup [label]=\"labels[index]\">\n <ng-container *ngTemplateOutlet=\"options; context: {$implicit: items[index]}\" />\n </optgroup>\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"options; context: {$implicit: items}\" />\n}\n\n<ng-template\n #options\n let-items\n>\n @for (option of items; track option) {\n <option\n [disabled]=\"itemsHandlers.disabledItemHandler()(option)\"\n [selected]=\"isSelected()(option)\"\n [value]=\"itemsHandlers.stringify()(option)\"\n >\n {{ itemsHandlers.stringify()(option) }}\n </option>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
57
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiNativeSelect, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
58
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: TuiNativeSelect, isStandalone: true, selector: "select[tuiSelect]", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "change": "selectOption($event.target.options.selectedIndex)" }, properties: { "attr.aria-invalid": "invalid()", "disabled": "!interactive()" } }, providers: [tuiAsTextfieldAccessor(TuiNativeSelect), tuiAsControl(TuiNativeSelect)], viewQueries: [{ propertyName: "options", predicate: ["option"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }], ngImport: i0, template: "@if (!stringified()) {\n <option\n disabled\n selected\n value=\"\"\n >\n {{ placeholder() }}\n </option>\n}\n\n@let elements = items();\n\n@if (elements && !isFlat(elements)) {\n @for (group of labels(); track group) {\n <optgroup [label]=\"labels()[$index]\">\n <ng-container *ngTemplateOutlet=\"options; context: {$implicit: elements[$index]}\" />\n </optgroup>\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"options; context: {$implicit: elements}\" />\n}\n\n<ng-template\n #options\n let-items\n>\n @for (option of items; track option) {\n <option\n #option\n [disabled]=\"itemsHandlers.disabledItemHandler()(option)\"\n [selected]=\"isSelected()(option)\"\n [value]=\"itemsHandlers.stringify()(option)\"\n >\n {{ itemsHandlers.stringify()(option) }}\n </option>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
46
59
  }
47
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeSelect, decorators: [{
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiNativeSelect, decorators: [{
48
61
  type: Component,
49
- args: [{ selector: 'select[tuiSelect]', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsTextfieldAccessor(TuiNativeSelect), tuiAsControl(TuiNativeSelect)], hostDirectives: [TuiWithTextfield], host: {
62
+ args: [{ selector: 'select[tuiSelect]', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsTextfieldAccessor(TuiNativeSelect), tuiAsControl(TuiNativeSelect)], hostDirectives: [TuiWithInput], host: {
50
63
  '[attr.aria-invalid]': 'invalid()',
51
64
  '[disabled]': '!interactive()',
52
65
  '(change)': 'selectOption($event.target.options.selectedIndex)',
53
- }, template: "@if (showPlaceholder()) {\n <option\n disabled\n selected\n value=\"\"\n >\n {{ placeholder() }}\n </option>\n}\n\n@if (items && !isFlat(items)) {\n @for (group of labels; track group; let index = $index) {\n <optgroup [label]=\"labels[index]\">\n <ng-container *ngTemplateOutlet=\"options; context: {$implicit: items[index]}\" />\n </optgroup>\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"options; context: {$implicit: items}\" />\n}\n\n<ng-template\n #options\n let-items\n>\n @for (option of items; track option) {\n <option\n [disabled]=\"itemsHandlers.disabledItemHandler()(option)\"\n [selected]=\"isSelected()(option)\"\n [value]=\"itemsHandlers.stringify()(option)\"\n >\n {{ itemsHandlers.stringify()(option) }}\n </option>\n }\n</ng-template>\n" }]
54
- }], propDecorators: { items: [{
55
- type: Input
56
- }], labels: [{
57
- type: Input
58
- }], placeholderSetter: [{
59
- type: Input,
60
- args: ['placeholder']
61
- }] } });
66
+ }, template: "@if (!stringified()) {\n <option\n disabled\n selected\n value=\"\"\n >\n {{ placeholder() }}\n </option>\n}\n\n@let elements = items();\n\n@if (elements && !isFlat(elements)) {\n @for (group of labels(); track group) {\n <optgroup [label]=\"labels()[$index]\">\n <ng-container *ngTemplateOutlet=\"options; context: {$implicit: elements[$index]}\" />\n </optgroup>\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"options; context: {$implicit: elements}\" />\n}\n\n<ng-template\n #options\n let-items\n>\n @for (option of items; track option) {\n <option\n #option\n [disabled]=\"itemsHandlers.disabledItemHandler()(option)\"\n [selected]=\"isSelected()(option)\"\n [value]=\"itemsHandlers.stringify()(option)\"\n >\n {{ itemsHandlers.stringify()(option) }}\n </option>\n }\n</ng-template>\n" }]
67
+ }] });
62
68
 
63
69
  class TuiSelectOption {
64
70
  constructor() {
@@ -73,46 +79,54 @@ class TuiSelectOption {
73
79
  this.handlers.identityMatcher()(controlValue, optionValue));
74
80
  this.scrolled = tuiDirectiveBinding(TuiScrollIntoView, 'tuiScrollIntoView', this.selected);
75
81
  }
76
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSelectOption, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
77
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiSelectOption, isStandalone: true, selector: "ng-component", host: { attributes: { "tuiSelectOption": "" }, properties: { "class._value": "option", "class._selected": "selected()" } }, providers: [tuiCheckboxOptionsProvider({ appearance: () => 'action' })], hostDirectives: [{ directive: i1$1.TuiScrollIntoView }], ngImport: i0, template: `
78
- <input
79
- tuiCheckbox
80
- type="checkbox"
81
- class="t-check"
82
- [checked]="selected()"
83
- [size]="datalist.size === 'l' ? 'm' : 's'"
84
- />
85
- `, isInline: true, styles: [":host._value>.t-check{order:100;margin-inline-start:auto;pointer-events:none}:host._value._selected~::ng-deep [tuiSelectOption]>.t-check:before{opacity:0}:host:not(._value)>.t-check,:host-context(tui-dropdown-mobile:not(._sheet))>.t-check{display:none}.t-check:before{font-size:var(--t-size)}\n"], dependencies: [{ kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
82
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiSelectOption, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
83
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: TuiSelectOption, isStandalone: true, selector: "ng-component", host: { attributes: { "tuiSelectOption": "" }, properties: { "class._value": "option", "class._selected": "selected()" } }, providers: [tuiCheckboxOptionsProvider({ appearance: () => 'action' })], hostDirectives: [{ directive: i1$1.TuiScrollIntoView }], ngImport: i0, template: `
84
+ @if (selected()) {
85
+ <input
86
+ tuiCheckbox
87
+ type="checkbox"
88
+ class="t-check"
89
+ [checked]="selected()"
90
+ [size]="datalist.size() === 'l' ? 'm' : 's'"
91
+ />
92
+ } @else {
93
+ <span class="t-dummy"></span>
94
+ }
95
+ `, isInline: true, styles: [":host._value>.t-check,:host._value>.t-dummy{order:100;margin-inline-start:auto;pointer-events:none}:host._value._selected~::ng-deep [tuiSelectOption]>.t-check:before{opacity:0}:host:not(._value)>.t-check,:host-context(tui-dropdown-mobile)>.t-check{display:none}.t-check:before{font-size:var(--t-size)}.t-dummy{inline-size:1.5rem}\n"], dependencies: [{ kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
86
96
  }
87
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSelectOption, decorators: [{
97
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiSelectOption, decorators: [{
88
98
  type: Component,
89
99
  args: [{ imports: [TuiCheckbox], template: `
90
- <input
91
- tuiCheckbox
92
- type="checkbox"
93
- class="t-check"
94
- [checked]="selected()"
95
- [size]="datalist.size === 'l' ? 'm' : 's'"
96
- />
100
+ @if (selected()) {
101
+ <input
102
+ tuiCheckbox
103
+ type="checkbox"
104
+ class="t-check"
105
+ [checked]="selected()"
106
+ [size]="datalist.size() === 'l' ? 'm' : 's'"
107
+ />
108
+ } @else {
109
+ <span class="t-dummy"></span>
110
+ }
97
111
  `, changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiCheckboxOptionsProvider({ appearance: () => 'action' })], hostDirectives: [TuiScrollIntoView], host: {
98
112
  tuiSelectOption: '',
99
113
  '[class._value]': 'option',
100
114
  '[class._selected]': 'selected()',
101
- }, styles: [":host._value>.t-check{order:100;margin-inline-start:auto;pointer-events:none}:host._value._selected~::ng-deep [tuiSelectOption]>.t-check:before{opacity:0}:host:not(._value)>.t-check,:host-context(tui-dropdown-mobile:not(._sheet))>.t-check{display:none}.t-check:before{font-size:var(--t-size)}\n"] }]
115
+ }, styles: [":host._value>.t-check,:host._value>.t-dummy{order:100;margin-inline-start:auto;pointer-events:none}:host._value._selected~::ng-deep [tuiSelectOption]>.t-check:before{opacity:0}:host:not(._value)>.t-check,:host-context(tui-dropdown-mobile)>.t-check{display:none}.t-check:before{font-size:var(--t-size)}.t-dummy{inline-size:1.5rem}\n"] }]
102
116
  }] });
103
117
 
104
118
  class TuiSelectDirective extends TuiControl {
105
119
  constructor() {
106
120
  super(...arguments);
107
- this.textfield = inject(TuiTextfieldDirective);
108
- this.open = tuiDropdownOpen();
121
+ this.input = inject(TuiInputDirective);
122
+ this.open = inject(TuiDropdownOpen).open;
109
123
  this.itemsHandlers = inject(TUI_ITEMS_HANDLERS);
110
124
  this.dropdownEnabled = tuiDropdownEnabled(this.interactive);
111
125
  this.valueEffect = effect(() => {
112
126
  const value = this.value();
113
127
  const string = tuiIsPresent(value) ? this.itemsHandlers.stringify()(value) : '';
114
- this.textfield.value.set(string);
115
- }, TUI_ALLOW_SIGNAL_WRITES);
128
+ this.input.value.set(string);
129
+ });
116
130
  }
117
131
  setValue(value) {
118
132
  this.onChange(value);
@@ -120,24 +134,23 @@ class TuiSelectDirective extends TuiControl {
120
134
  this.open.set(true);
121
135
  }
122
136
  }
123
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSelectDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
124
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiSelectDirective, isStandalone: true, selector: "input[tuiSelect]", host: { listeners: { "input": "$event.inputType?.includes(\"delete\") && setValue(null)" }, properties: { "disabled": "disabled()" } }, providers: [
137
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiSelectDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
138
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.16", type: TuiSelectDirective, isStandalone: true, selector: "input[tuiSelect]", host: { listeners: { "input": "$event.inputType?.includes(\"delete\") && setValue(null)" }, properties: { "disabled": "disabled()" } }, providers: [
125
139
  tuiAsOptionContent(TuiSelectOption),
126
140
  tuiAsTextfieldAccessor(TuiSelectDirective),
127
141
  tuiAsControl(TuiSelectDirective),
128
- ], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithTextfield }, { directive: i1.TuiSelectLike }], ngImport: i0 }); }
142
+ ], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.TuiSelectLike }], ngImport: i0 }); }
129
143
  }
130
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSelectDirective, decorators: [{
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiSelectDirective, decorators: [{
131
145
  type: Directive,
132
146
  args: [{
133
- standalone: true,
134
147
  selector: 'input[tuiSelect]',
135
148
  providers: [
136
149
  tuiAsOptionContent(TuiSelectOption),
137
150
  tuiAsTextfieldAccessor(TuiSelectDirective),
138
151
  tuiAsControl(TuiSelectDirective),
139
152
  ],
140
- hostDirectives: [TuiWithTextfield, TuiSelectLike],
153
+ hostDirectives: [TuiWithInput, TuiSelectLike],
141
154
  host: {
142
155
  '[disabled]': 'disabled()',
143
156
  '(input)': '$event.inputType?.includes("delete") && setValue(null)',
@@ -145,7 +158,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
145
158
  }]
146
159
  }] });
147
160
 
148
- const TuiSelect = [TuiSelectDirective, TuiNativeSelect];
161
+ const TuiSelect = [
162
+ TuiSelectDirective,
163
+ TuiNativeSelect,
164
+ TuiLabel,
165
+ TuiTextfieldComponent,
166
+ TuiTextfieldOptionsDirective,
167
+ TuiDropdownContent,
168
+ ];
149
169
 
150
170
  /**
151
171
  * Generated bundle index. Do not edit.