@taiga-ui/kit 4.52.0-canary.ece97e9 → 4.52.0-canary.efbd0d4

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 (397) hide show
  1. package/README.md +1 -1
  2. package/components/avatar/avatar-labeled.component.d.ts +3 -3
  3. package/components/avatar/avatar-stack.component.d.ts +2 -2
  4. package/components/badge/badge.options.d.ts +1 -3
  5. package/components/badge-notification/badge-notification.component.d.ts +2 -3
  6. package/components/badge-notification/badge-notification.options.d.ts +1 -3
  7. package/components/badged-content/badged-content.directive.d.ts +2 -2
  8. package/components/block/block.options.d.ts +1 -3
  9. package/components/breadcrumbs/breadcrumbs.component.d.ts +6 -7
  10. package/components/breadcrumbs/breadcrumbs.options.d.ts +1 -3
  11. package/components/button-loading/button-loading.component.d.ts +5 -5
  12. package/components/calendar-range/calendar-range.component.d.ts +0 -1
  13. package/components/calendar-range/day-range-period.d.ts +2 -1
  14. package/components/carousel/carousel.component.d.ts +15 -18
  15. package/components/carousel/carousel.directive.d.ts +5 -4
  16. package/components/chip/chip.options.d.ts +1 -3
  17. package/components/combo-box/combo-box.d.ts +5 -0
  18. package/components/combo-box/combo-box.directive.d.ts +7 -9
  19. package/components/combo-box/index.d.ts +1 -0
  20. package/components/compass/compass.component.d.ts +2 -2
  21. package/components/confirm/confirm.component.d.ts +4 -3
  22. package/components/confirm/confirm.service.d.ts +1 -1
  23. package/components/copy/copy.component.d.ts +3 -4
  24. package/components/copy/copy.directive.d.ts +2 -4
  25. package/components/data-list-wrapper/data-list-group-wrapper.component.d.ts +2 -2
  26. package/components/data-list-wrapper/data-list-wrapper.component.d.ts +14 -22
  27. package/components/data-list-wrapper/{data-list-wrapper.module.d.ts → data-list-wrapper.d.ts} +1 -2
  28. package/components/data-list-wrapper/index.d.ts +1 -1
  29. package/components/drawer/drawer.component.d.ts +3 -4
  30. package/components/files/file/file.component.d.ts +16 -29
  31. package/components/files/file/file.options.d.ts +1 -1
  32. package/components/files/files/files.component.d.ts +5 -8
  33. package/components/files/input-files/input-files.component.d.ts +2 -2
  34. package/components/files/input-files/input-files.content.d.ts +7 -8
  35. package/components/files/input-files/input-files.directive.d.ts +2 -2
  36. package/components/files/input-files/input-files.options.d.ts +1 -3
  37. package/components/filter/filter.component.d.ts +9 -11
  38. package/components/fullscreen/fullscreen.component.d.ts +5 -8
  39. package/components/index.d.ts +0 -3
  40. package/components/input-chip/input-chip.component.d.ts +9 -8
  41. package/components/input-chip/input-chip.d.ts +5 -1
  42. package/components/input-chip/input-chip.directive.d.ts +7 -12
  43. package/components/input-color/index.d.ts +1 -0
  44. package/components/input-color/input-color.component.d.ts +4 -4
  45. package/components/input-color/input-color.d.ts +5 -0
  46. package/components/input-date/input-date.d.ts +4 -1
  47. package/components/input-date/input-date.directive.d.ts +12 -14
  48. package/components/input-date/input-date.options.d.ts +3 -3
  49. package/components/input-date-multi/input-date-multi.d.ts +1 -2
  50. package/components/input-date-multi/input-date-multi.directive.d.ts +10 -14
  51. package/components/input-date-range/input-date-range.d.ts +4 -1
  52. package/components/input-date-range/input-date-range.directive.d.ts +5 -8
  53. package/components/input-date-range/input-date-range.options.d.ts +2 -2
  54. package/components/input-date-time/input-date-time.d.ts +4 -1
  55. package/components/input-date-time/input-date-time.directive.d.ts +6 -6
  56. package/components/input-date-time/input-date-time.options.d.ts +2 -2
  57. package/components/input-month/input-month.d.ts +4 -1
  58. package/components/input-month/input-month.directive.d.ts +6 -5
  59. package/components/input-month-range/input-month-range.d.ts +4 -1
  60. package/components/input-month-range/input-month-range.directive.d.ts +6 -5
  61. package/components/input-number/input-number.d.ts +4 -1
  62. package/components/input-number/input-number.directive.d.ts +5 -7
  63. package/components/input-number/input-number.options.d.ts +2 -3
  64. package/components/input-number/step/input-number-step.component.d.ts +2 -1
  65. package/components/input-phone/index.d.ts +1 -0
  66. package/components/input-phone/input-phone.d.ts +5 -0
  67. package/components/input-phone/input-phone.directive.d.ts +7 -7
  68. package/components/input-phone-international/index.d.ts +1 -0
  69. package/components/input-phone-international/input-phone-international.component.d.ts +9 -8
  70. package/components/input-phone-international/input-phone-international.d.ts +5 -0
  71. package/components/input-phone-international/input-phone-international.options.d.ts +1 -3
  72. package/components/input-pin/index.d.ts +1 -0
  73. package/components/input-pin/input-pin.component.d.ts +3 -3
  74. package/components/input-pin/input-pin.d.ts +5 -0
  75. package/components/input-range/index.d.ts +0 -1
  76. package/components/input-range/input-range.component.d.ts +5 -4
  77. package/components/input-slider/input-slider.d.ts +4 -1
  78. package/components/input-slider/input-slider.directive.d.ts +1 -1
  79. package/components/input-time/input-time.component.d.ts +1 -3
  80. package/components/input-time/input-time.d.ts +4 -1
  81. package/components/input-time/input-time.directive.d.ts +4 -4
  82. package/components/input-year/input-year.d.ts +4 -1
  83. package/components/input-year/input-year.directive.d.ts +5 -5
  84. package/components/input-year/input-year.options.d.ts +2 -2
  85. package/components/like/like.options.d.ts +1 -1
  86. package/components/line-clamp/line-clamp-box.component.d.ts +1 -1
  87. package/components/line-clamp/line-clamp.options.d.ts +1 -3
  88. package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +4 -6
  89. package/components/notification-middle/notification-middle.component.d.ts +2 -2
  90. package/components/notification-middle/notification-middle.directive.d.ts +4 -3
  91. package/components/notification-middle/notification-middle.service.d.ts +7 -3
  92. package/components/pagination/pagination.component.d.ts +22 -52
  93. package/components/pagination/pagination.options.d.ts +3 -6
  94. package/components/preview/dialog/preview-dialog.component.d.ts +2 -2
  95. package/components/preview/dialog/preview-dialog.directive.d.ts +3 -3
  96. package/components/preview/dialog/preview-dialog.service.d.ts +5 -2
  97. package/components/preview/index.d.ts +1 -0
  98. package/components/preview/pagination/preview-pagination.component.d.ts +2 -1
  99. package/components/preview/preview.component.d.ts +1 -1
  100. package/components/preview/preview.d.ts +2 -1
  101. package/{tokens/preview-icons.d.ts → components/preview/preview.options.d.ts} +1 -3
  102. package/components/preview/zoom/preview-zoom.component.d.ts +3 -1
  103. package/components/progress/progress-bar/progress-bar.component.d.ts +3 -4
  104. package/components/progress/progress.options.d.ts +1 -3
  105. package/components/pulse/pulse.component.d.ts +2 -2
  106. package/components/push/push-alert.component.d.ts +2 -2
  107. package/components/push/push.options.d.ts +4 -3
  108. package/components/push/push.service.d.ts +2 -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/rating/rating.component.d.ts +1 -1
  112. package/components/rating/rating.options.d.ts +1 -3
  113. package/components/routable-dialog/generate-dialogable-route.d.ts +1 -1
  114. package/components/segmented/segmented.component.d.ts +4 -6
  115. package/components/segmented/segmented.directive.d.ts +6 -7
  116. package/components/select/native-select/native-select.component.d.ts +4 -4
  117. package/components/select/select.d.ts +4 -1
  118. package/components/select/select.directive.d.ts +4 -3
  119. package/components/slider/slider.options.d.ts +1 -6
  120. package/components/stepper/step.component.d.ts +6 -8
  121. package/components/stepper/stepper.component.d.ts +6 -11
  122. package/components/switch/switch.component.d.ts +1 -0
  123. package/components/tabs/tabs.options.d.ts +1 -6
  124. package/components/textarea/index.d.ts +2 -1
  125. package/components/textarea/textarea.component.d.ts +4 -4
  126. package/components/textarea/textarea.d.ts +6 -0
  127. package/components/textarea/textarea.directive.d.ts +13 -0
  128. package/components/toast/toast.component.d.ts +4 -4
  129. package/components/toast/toast.options.d.ts +4 -3
  130. package/components/toast/toast.service.d.ts +2 -2
  131. package/components/tree/components/tree-item-content/tree-item-content.component.d.ts +7 -0
  132. package/components/tree/misc/tree.constants.d.ts +0 -3
  133. package/components/tree/misc/tree.tokens.d.ts +1 -6
  134. package/directives/appearance-proxy/appearance-proxy.directive.d.ts +10 -0
  135. package/directives/appearance-proxy/index.d.ts +1 -0
  136. package/directives/button-select/button-select.directive.d.ts +3 -2
  137. package/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.d.ts +5 -5
  138. package/directives/fade/fade.directive.d.ts +5 -6
  139. package/directives/fluid-typography/fluid-typography.options.d.ts +1 -3
  140. package/directives/highlight/highlight.directive.d.ts +4 -4
  141. package/directives/index.d.ts +1 -1
  142. package/directives/password/password.directive.d.ts +1 -1
  143. package/directives/present/present.directive.d.ts +2 -4
  144. package/directives/tooltip/tooltip.directive.d.ts +1 -1
  145. package/directives/unfinished-validator/unfinished-validator.directive.d.ts +2 -2
  146. package/directives/unmask-handler/unmask-handler.directive.d.ts +3 -3
  147. package/fesm2022/taiga-ui-kit-components-accordion.mjs +8 -9
  148. package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
  149. package/fesm2022/taiga-ui-kit-components-action-bar.mjs +7 -7
  150. package/fesm2022/taiga-ui-kit-components-action-bar.mjs.map +1 -1
  151. package/fesm2022/taiga-ui-kit-components-avatar.mjs +34 -48
  152. package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
  153. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +11 -18
  154. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
  155. package/fesm2022/taiga-ui-kit-components-badge.mjs +11 -15
  156. package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
  157. package/fesm2022/taiga-ui-kit-components-badged-content.mjs +9 -12
  158. package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
  159. package/fesm2022/taiga-ui-kit-components-block.mjs +11 -15
  160. package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
  161. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +18 -37
  162. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
  163. package/fesm2022/taiga-ui-kit-components-button-loading.mjs +18 -26
  164. package/fesm2022/taiga-ui-kit-components-button-loading.mjs.map +1 -1
  165. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +5 -13
  166. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
  167. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +23 -23
  168. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
  169. package/fesm2022/taiga-ui-kit-components-carousel.mjs +64 -114
  170. package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
  171. package/fesm2022/taiga-ui-kit-components-checkbox.mjs +5 -6
  172. package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
  173. package/fesm2022/taiga-ui-kit-components-chip.mjs +11 -15
  174. package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
  175. package/fesm2022/taiga-ui-kit-components-combo-box.mjs +40 -45
  176. package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
  177. package/fesm2022/taiga-ui-kit-components-comment.mjs +7 -7
  178. package/fesm2022/taiga-ui-kit-components-compass.mjs +9 -11
  179. package/fesm2022/taiga-ui-kit-components-compass.mjs.map +1 -1
  180. package/fesm2022/taiga-ui-kit-components-confirm.mjs +10 -12
  181. package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
  182. package/fesm2022/taiga-ui-kit-components-copy.mjs +19 -33
  183. package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
  184. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs +24 -85
  185. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
  186. package/fesm2022/taiga-ui-kit-components-drawer.mjs +15 -32
  187. package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
  188. package/fesm2022/taiga-ui-kit-components-files.mjs +111 -239
  189. package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
  190. package/fesm2022/taiga-ui-kit-components-filter.mjs +20 -34
  191. package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
  192. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +23 -42
  193. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs.map +1 -1
  194. package/fesm2022/taiga-ui-kit-components-input-chip.mjs +63 -77
  195. package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
  196. package/fesm2022/taiga-ui-kit-components-input-color.mjs +24 -13
  197. package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
  198. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +35 -51
  199. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs.map +1 -1
  200. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +30 -36
  201. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
  202. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +32 -29
  203. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
  204. package/fesm2022/taiga-ui-kit-components-input-date.mjs +45 -48
  205. package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
  206. package/fesm2022/taiga-ui-kit-components-input-inline.mjs +3 -3
  207. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +26 -23
  208. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
  209. package/fesm2022/taiga-ui-kit-components-input-month.mjs +32 -23
  210. package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
  211. package/fesm2022/taiga-ui-kit-components-input-number.mjs +53 -50
  212. package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
  213. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +50 -42
  214. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
  215. package/fesm2022/taiga-ui-kit-components-input-phone.mjs +29 -19
  216. package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
  217. package/fesm2022/taiga-ui-kit-components-input-pin.mjs +18 -9
  218. package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
  219. package/fesm2022/taiga-ui-kit-components-input-range.mjs +18 -16
  220. package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
  221. package/fesm2022/taiga-ui-kit-components-input-slider.mjs +15 -10
  222. package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
  223. package/fesm2022/taiga-ui-kit-components-input-time.mjs +38 -40
  224. package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
  225. package/fesm2022/taiga-ui-kit-components-input-year.mjs +27 -19
  226. package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
  227. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +12 -14
  228. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
  229. package/fesm2022/taiga-ui-kit-components-like.mjs +4 -4
  230. package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
  231. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +18 -23
  232. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
  233. package/fesm2022/taiga-ui-kit-components-message.mjs +7 -8
  234. package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
  235. package/fesm2022/taiga-ui-kit-components-multi-select.mjs +30 -40
  236. package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
  237. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +37 -26
  238. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs.map +1 -1
  239. package/fesm2022/taiga-ui-kit-components-pager.mjs +6 -8
  240. package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
  241. package/fesm2022/taiga-ui-kit-components-pagination.mjs +59 -140
  242. package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
  243. package/fesm2022/taiga-ui-kit-components-pin.mjs +7 -7
  244. package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
  245. package/fesm2022/taiga-ui-kit-components-preview.mjs +68 -48
  246. package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
  247. package/fesm2022/taiga-ui-kit-components-progress.mjs +36 -45
  248. package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
  249. package/fesm2022/taiga-ui-kit-components-pulse.mjs +7 -11
  250. package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
  251. package/fesm2022/taiga-ui-kit-components-push.mjs +22 -23
  252. package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
  253. package/fesm2022/taiga-ui-kit-components-radio-list.mjs +8 -8
  254. package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
  255. package/fesm2022/taiga-ui-kit-components-radio.mjs +8 -9
  256. package/fesm2022/taiga-ui-kit-components-radio.mjs.map +1 -1
  257. package/fesm2022/taiga-ui-kit-components-range.mjs +8 -11
  258. package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
  259. package/fesm2022/taiga-ui-kit-components-rating.mjs +7 -12
  260. package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
  261. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs +11 -7
  262. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs.map +1 -1
  263. package/fesm2022/taiga-ui-kit-components-segmented.mjs +32 -59
  264. package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
  265. package/fesm2022/taiga-ui-kit-components-select.mjs +52 -29
  266. package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
  267. package/fesm2022/taiga-ui-kit-components-slider.mjs +23 -33
  268. package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
  269. package/fesm2022/taiga-ui-kit-components-status.mjs +6 -6
  270. package/fesm2022/taiga-ui-kit-components-stepper.mjs +45 -79
  271. package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
  272. package/fesm2022/taiga-ui-kit-components-switch.mjs +10 -6
  273. package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
  274. package/fesm2022/taiga-ui-kit-components-tabs.mjs +28 -36
  275. package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
  276. package/fesm2022/taiga-ui-kit-components-textarea.mjs +51 -52
  277. package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
  278. package/fesm2022/taiga-ui-kit-components-tiles.mjs +14 -15
  279. package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
  280. package/fesm2022/taiga-ui-kit-components-toast.mjs +27 -28
  281. package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
  282. package/fesm2022/taiga-ui-kit-components-tree.mjs +55 -58
  283. package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
  284. package/fesm2022/taiga-ui-kit-components.mjs +0 -3
  285. package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
  286. package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs +27 -0
  287. package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs.map +1 -0
  288. package/fesm2022/taiga-ui-kit-directives-button-close.mjs +3 -4
  289. package/fesm2022/taiga-ui-kit-directives-button-close.mjs.map +1 -1
  290. package/fesm2022/taiga-ui-kit-directives-button-group.mjs +7 -7
  291. package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
  292. package/fesm2022/taiga-ui-kit-directives-button-select.mjs +18 -10
  293. package/fesm2022/taiga-ui-kit-directives-button-select.mjs.map +1 -1
  294. package/fesm2022/taiga-ui-kit-directives-chevron.mjs +10 -9
  295. package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
  296. package/fesm2022/taiga-ui-kit-directives-connected.mjs +6 -7
  297. package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
  298. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs +25 -53
  299. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs.map +1 -1
  300. package/fesm2022/taiga-ui-kit-directives-fade.mjs +25 -34
  301. package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
  302. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs +6 -12
  303. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs.map +1 -1
  304. package/fesm2022/taiga-ui-kit-directives-highlight.mjs +16 -21
  305. package/fesm2022/taiga-ui-kit-directives-highlight.mjs.map +1 -1
  306. package/fesm2022/taiga-ui-kit-directives-password.mjs +10 -9
  307. package/fesm2022/taiga-ui-kit-directives-password.mjs.map +1 -1
  308. package/fesm2022/taiga-ui-kit-directives-present.mjs +10 -18
  309. package/fesm2022/taiga-ui-kit-directives-present.mjs.map +1 -1
  310. package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +6 -6
  311. package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +6 -6
  312. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +7 -6
  313. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
  314. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +9 -9
  315. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
  316. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs +8 -11
  317. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs.map +1 -1
  318. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs +10 -15
  319. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs.map +1 -1
  320. package/fesm2022/taiga-ui-kit-directives.mjs +1 -1
  321. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs +43 -0
  322. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs.map +1 -0
  323. package/fesm2022/taiga-ui-kit-pipes-emails.mjs +3 -4
  324. package/fesm2022/taiga-ui-kit-pipes-emails.mjs.map +1 -1
  325. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs +12 -25
  326. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs.map +1 -1
  327. package/fesm2022/taiga-ui-kit-pipes-flag.mjs +30 -0
  328. package/fesm2022/taiga-ui-kit-pipes-flag.mjs.map +1 -0
  329. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs +4 -5
  330. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs.map +1 -1
  331. package/fesm2022/taiga-ui-kit-pipes-initials.mjs +28 -0
  332. package/fesm2022/taiga-ui-kit-pipes-initials.mjs.map +1 -0
  333. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs +10 -9
  334. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs.map +1 -1
  335. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs +3 -4
  336. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs.map +1 -1
  337. package/fesm2022/taiga-ui-kit-pipes-stringify.mjs +3 -4
  338. package/fesm2022/taiga-ui-kit-pipes-stringify.mjs.map +1 -1
  339. package/fesm2022/taiga-ui-kit-pipes.mjs +3 -0
  340. package/fesm2022/taiga-ui-kit-pipes.mjs.map +1 -1
  341. package/fesm2022/taiga-ui-kit-tokens.mjs +4 -123
  342. package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
  343. package/fesm2022/taiga-ui-kit-utils.mjs +3 -15
  344. package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
  345. package/package.json +66 -67
  346. package/pipes/auto-color/auto-color.pipe.d.ts +13 -0
  347. package/pipes/auto-color/index.d.ts +1 -0
  348. package/pipes/filter-by-input/filter-by-input.pipe.d.ts +2 -2
  349. package/pipes/flag/flag.pipe.d.ts +14 -0
  350. package/pipes/flag/index.d.ts +1 -0
  351. package/pipes/index.d.ts +3 -0
  352. package/pipes/initials/index.d.ts +1 -0
  353. package/pipes/initials/initials.pipe.d.ts +7 -0
  354. package/pipes/sort-countries/sort-countries.pipe.d.ts +4 -3
  355. package/pipes/stringify-content/stringify-content.pipe.d.ts +2 -3
  356. package/styles/components/avatar.less +14 -14
  357. package/styles/components/badge.less +3 -3
  358. package/styles/components/block.less +4 -4
  359. package/styles/components/chip.less +3 -3
  360. package/styles/components/comment.less +1 -1
  361. package/styles/components/message.less +1 -1
  362. package/styles/components/pin.less +3 -3
  363. package/styles/components/switch.less +2 -2
  364. package/styles/components/toast.less +1 -1
  365. package/tokens/i18n.d.ts +1 -0
  366. package/tokens/index.d.ts +0 -7
  367. package/utils/index.d.ts +0 -2
  368. package/components/elastic-container/elastic-container.component.d.ts +0 -8
  369. package/components/elastic-container/elastic-container.directive.d.ts +0 -7
  370. package/components/elastic-container/index.d.ts +0 -2
  371. package/components/floating-container/floating-container.directive.d.ts +0 -7
  372. package/components/floating-container/index.d.ts +0 -1
  373. package/components/input-range/input-range.d.ts +0 -3
  374. package/components/slides/index.d.ts +0 -1
  375. package/components/slides/slides.directive.d.ts +0 -11
  376. package/components/textarea/textarea-limit.directive.d.ts +0 -26
  377. package/directives/lazy-loading/index.d.ts +0 -2
  378. package/directives/lazy-loading/lazy-loading.directive.d.ts +0 -18
  379. package/directives/lazy-loading/lazy-loading.service.d.ts +0 -12
  380. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs +0 -78
  381. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs.map +0 -1
  382. package/fesm2022/taiga-ui-kit-components-floating-container.mjs +0 -37
  383. package/fesm2022/taiga-ui-kit-components-floating-container.mjs.map +0 -1
  384. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs +0 -64
  385. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs.map +0 -1
  386. package/fesm2022/taiga-ui-kit-components-slides.mjs +0 -49
  387. package/fesm2022/taiga-ui-kit-components-slides.mjs.map +0 -1
  388. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs +0 -81
  389. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs.map +0 -1
  390. package/tokens/calendar-date-stream.d.ts +0 -10
  391. package/tokens/date-inputs-value-transformers.d.ts +0 -19
  392. package/tokens/input-date-options.d.ts +0 -15
  393. package/tokens/items-handlers.d.ts +0 -26
  394. package/tokens/mobile-calendar.d.ts +0 -6
  395. package/tokens/month-formatter.d.ts +0 -5
  396. package/utils/phone.d.ts +0 -3
  397. package/utils/toggle-day.d.ts +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-rating.mjs","sources":["../../../projects/kit/components/rating/rating.options.ts","../../../projects/kit/components/rating/rating.component.ts","../../../projects/kit/components/rating/rating.template.html","../../../projects/kit/components/rating/taiga-ui-kit-components-rating.ts"],"sourcesContent":["import {InjectionToken, type Provider} from '@angular/core';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport interface TuiRatingContext extends TuiContext<number> {\n readonly value: number;\n readonly filled: boolean;\n}\n\nexport interface TuiRatingOptions {\n readonly icon: PolymorpheusContent<TuiRatingContext>;\n readonly max: number;\n}\n\nexport const TUI_RATING_DEFAULT_OPTIONS: TuiRatingOptions = {\n icon: '@tui.star',\n max: 5,\n};\n\nexport const TUI_RATING_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_RATING_OPTIONS' : '',\n {\n factory: () => TUI_RATING_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiRatingOptionsProvider(options: Partial<TuiRatingOptions>): Provider {\n return tuiProvideOptions(TUI_RATING_OPTIONS, options, TUI_RATING_DEFAULT_OPTIONS);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TUI_RATING_OPTIONS} from './rating.options';\n\n@Component({\n selector: 'tui-rating',\n imports: [FormsModule, PolymorpheusOutlet, TuiIcon],\n templateUrl: './rating.template.html',\n styleUrl: './rating.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiFallbackValueProvider(0)],\n host: {\n '[class._disabled]': 'disabled()',\n '[class._readonly]': 'readOnly()',\n '[class._active]': 'active()',\n '(keydown.capture)': 'onKeyDown($event)',\n '(pointerdown)': 'onPointer(1)',\n '(pointercancel)': 'onPointer(-1)',\n '(document:pointerup)': 'onPointer(-1)',\n },\n})\nexport class TuiRating extends TuiControl<number> {\n private readonly options = inject(TUI_RATING_OPTIONS);\n\n protected readonly active = signal(0);\n protected readonly array = computed(() => new Array(this.max()));\n\n public readonly icon = input(this.options.icon);\n public readonly max = input(this.options.max);\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.readOnly()) {\n event.preventDefault();\n }\n }\n\n protected onPointer(delta: number): void {\n this.active.update((active) => tuiClamp(active + delta, 0, 1));\n }\n\n protected onClick(value: number): void {\n if (this.active()) {\n this.onChange(value);\n }\n }\n\n protected isActive(index: number): boolean {\n return Math.ceil(this.value()) >= this.max() - index;\n }\n\n protected isFraction(index: number): boolean {\n return this.value() > this.max() - index - 1 && this.value() < this.max() - index;\n }\n\n protected getCut(index: number): number {\n return this.isFraction(index)\n ? 100 * Math.max(this.max() - index - this.value(), 0)\n : 0;\n }\n}\n","<input\n min=\"1\"\n type=\"range\"\n class=\"t-range\"\n [attr.aria-disabled]=\"readOnly()\"\n [disabled]=\"disabled()\"\n [max]=\"max()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{standalone: true}\"\n (blur)=\"onTouched()\"\n (ngModelChange)=\"onChange($event)\"\n/>\n<div class=\"t-items\">\n @for (_ of array(); track $index) {\n @let $implicit = max() - $index;\n @let filled = $implicit - value() < 1;\n\n <div\n class=\"t-item\"\n [class.t-item_active]=\"isActive($index)\"\n (pointerup)=\"onClick($implicit)\"\n >\n @if (isFraction($index)) {\n <tui-icon\n *polymorpheusOutlet=\"icon() as src; context: {$implicit, filled: false, value: value()}\"\n class=\"t-icon t-icon_blank\"\n [background]=\"src.toString()\"\n [style.--t-cut.%]=\"100 - getCut($index)\"\n />\n }\n <tui-icon\n *polymorpheusOutlet=\"icon() as src; context: {$implicit, filled, value: value()}\"\n class=\"t-icon\"\n [background]=\"src.toString()\"\n [style.--t-cut.%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,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAezC,SAAS,EAAA,UAAA,EAAA,CAAA;kBAjBrB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,WACb,CAAC,WAAW,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAA,eAAA,EAGlC,uBAAuB,CAAC,MAAM,aACpC,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,EAClC,IAAA,EAAA;AACF,wBAAA,mBAAmB,EAAE,YAAY;AACjC,wBAAA,mBAAmB,EAAE,YAAY;AACjC,wBAAA,iBAAiB,EAAE,UAAU;AAC7B,wBAAA,mBAAmB,EAAE,mBAAmB;AACxC,wBAAA,eAAe,EAAE,cAAc;AAC/B,wBAAA,iBAAiB,EAAE,eAAe;AAClC,wBAAA,sBAAsB,EAAE,eAAe;AAC1C,qBAAA,EAAA,QAAA,EAAA,kyCAAA,EAAA,MAAA,EAAA,CAAA,0zEAAA,CAAA,EAAA;;;AEhCL;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-kit-components-rating.mjs","sources":["../../../projects/kit/components/rating/rating.options.ts","../../../projects/kit/components/rating/rating.component.ts","../../../projects/kit/components/rating/rating.template.html","../../../projects/kit/components/rating/taiga-ui-kit-components-rating.ts"],"sourcesContent":["import {type TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport interface TuiRatingContext extends TuiContext<number> {\n readonly value: number;\n readonly filled: boolean;\n}\n\nexport interface TuiRatingOptions {\n readonly icon: PolymorpheusContent<TuiRatingContext>;\n readonly max: number;\n}\n\nexport const TUI_RATING_DEFAULT_OPTIONS: TuiRatingOptions = {\n icon: '@tui.star',\n max: 5,\n};\n\nexport const [TUI_RATING_OPTIONS, tuiRatingOptionsProvider] = tuiCreateOptions(\n TUI_RATING_DEFAULT_OPTIONS,\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TUI_RATING_OPTIONS} from './rating.options';\n\n@Component({\n selector: 'tui-rating',\n imports: [FormsModule, PolymorpheusOutlet, TuiIcon],\n templateUrl: './rating.template.html',\n styleUrl: './rating.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiFallbackValueProvider(0)],\n host: {\n '[class._disabled]': 'disabled()',\n '[class._readonly]': 'readOnly()',\n '[class._active]': 'active()',\n '(keydown.capture)': 'onKeyDown($event)',\n '(pointerdown)': 'onPointer(1)',\n '(pointercancel)': 'onPointer(-1)',\n '(document:pointerup)': 'onPointer(-1)',\n },\n})\nexport class TuiRating extends TuiControl<number> {\n private readonly options = inject(TUI_RATING_OPTIONS);\n\n protected readonly active = signal(0);\n protected readonly array = computed(() => Array.from({length: this.max()}));\n\n public readonly icon = input(this.options.icon);\n public readonly max = input(this.options.max);\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.readOnly()) {\n event.preventDefault();\n }\n }\n\n protected onPointer(delta: number): void {\n this.active.update((active) => tuiClamp(active + delta, 0, 1));\n }\n\n protected onClick(value: number): void {\n if (this.active()) {\n this.onChange(value);\n }\n }\n\n protected isActive(index: number): boolean {\n return Math.ceil(this.value()) >= this.max() - index;\n }\n\n protected isFraction(index: number): boolean {\n return this.value() > this.max() - index - 1 && this.value() < this.max() - index;\n }\n\n protected getCut(index: number): number {\n return this.isFraction(index)\n ? 100 * Math.max(this.max() - index - this.value(), 0)\n : 0;\n }\n}\n","<input\n min=\"1\"\n type=\"range\"\n class=\"t-range\"\n [attr.aria-disabled]=\"readOnly()\"\n [disabled]=\"disabled()\"\n [max]=\"max()\"\n [ngModel]=\"value()\"\n [ngModelOptions]=\"{standalone: true}\"\n (blur)=\"onTouched()\"\n (ngModelChange)=\"onChange($event)\"\n/>\n<div class=\"t-items\">\n @for (_ of array(); track $index) {\n @let $implicit = max() - $index;\n @let filled = $implicit - value() < 1;\n\n <div\n class=\"t-item\"\n [class.t-item_active]=\"isActive($index)\"\n (pointerup)=\"onClick($implicit)\"\n >\n @if (isFraction($index)) {\n <tui-icon\n *polymorpheusOutlet=\"icon() as src; context: {$implicit, filled: false, value: value()}\"\n class=\"t-icon t-icon_blank\"\n [background]=\"src.toString()\"\n [style.--t-cut.%]=\"100 - getCut($index)\"\n />\n }\n <tui-icon\n *polymorpheusOutlet=\"icon() as src; context: {$implicit, filled, value: value()}\"\n class=\"t-icon\"\n [background]=\"src.toString()\"\n [style.--t-cut.%]=\"getCut($index)\"\n />\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAca,MAAA,0BAA0B,GAAqB;AACxD,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,GAAG,EAAE,CAAC;;AAGH,MAAM,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,GAAG,gBAAgB,CAC1E,0BAA0B;;ACcxB,MAAO,SAAU,SAAQ,UAAkB,CAAA;AAjBjD,IAAA,WAAA,GAAA;;AAkBqB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAElC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;QAClB,IAAK,CAAA,KAAA,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,EAAC,CAAC,CAAC;QAE3D,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC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yed } 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.17", ngImport: i0, type: TuiRoutableDialog, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
60
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", 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.17", 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,SA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AAC,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,C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C,QAAQ;cAC3C,IAAI,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;;+GA7CW,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;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.17", ngImport: i0, type: TuiSegmentedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
43
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.17", 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.17", 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.17", ngImport: i0, type: TuiSegmented, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
89
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.17", 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-body-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-body-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-body-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.17", 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-body-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-body-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-body-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 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 @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,CAA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CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACpC,SAAA,EAAA,CAAC,qBAAqB,EAAE,mCAAmC,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,CAAC,EAAA,cAAA,EACpE,CAAC,qBAAqB,CAAC,EACjC,IAAA,EAAA;AACF,wBAAA,kBAAkB,EAAE,MAAM;AAC7B,qBAAA,EAAA,MAAA,EAAA,CAAA,ijJAAA,CAAA,EAAA;8BAUM,IAAI,EAAA,CAAA;sBADV;gBAIM,eAAe,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,CAA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ionStrategy, 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 { tuiIsPresent, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/miscellaneous';
6
- import * as i1 from '@taiga-ui/core/components/textfield';
7
- 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';
8
10
  import { TUI_ITEMS_HANDLERS } from '@taiga-ui/core/directives/items-handlers';
9
11
  import { tuiIsFlat, tuiInjectValue } from '@taiga-ui/kit/utils';
12
+ import { TuiLabel } from '@taiga-ui/core/components/label';
13
+ import { TuiDropdownOpen, tuiDropdownEnabled, TuiDropdownContent } from '@taiga-ui/core/portals/dropdown';
10
14
  import { TuiDataListComponent, TuiOptionWithValue, tuiAsOptionContent } from '@taiga-ui/core/components/data-list';
11
- import { tuiDropdownOpen, tuiDropdownEnabled } from '@taiga-ui/core/directives/dropdown';
15
+ import { tuiDirectiveBinding } from '@taiga-ui/cdk/utils/di';
12
16
  import * as i1$1 from '@taiga-ui/core/components/scrollbar';
13
17
  import { TuiScrollIntoView } from '@taiga-ui/core/components/scrollbar';
14
18
  import { TuiCheckbox, tuiCheckboxOptionsProvider } from '@taiga-ui/kit/components/checkbox';
@@ -16,14 +20,26 @@ import { TuiCheckbox, tuiCheckboxOptionsProvider } from '@taiga-ui/kit/component
16
20
  class TuiNativeSelect extends TuiControl {
17
21
  constructor() {
18
22
  super(...arguments);
19
- this.textfield = inject(TuiTextfieldDirective);
23
+ this.input = inject(TuiInputDirective);
24
+ this.options = viewChildren('option');
20
25
  this.isFlat = tuiIsFlat;
21
26
  this.itemsHandlers = inject(TUI_ITEMS_HANDLERS);
22
27
  this.stringified = computed((value = this.value()) => tuiIsPresent(value) ? this.itemsHandlers.stringify()(value) : '');
23
- this.showPlaceholder = computed(() => this.placeholder() && !this.stringified());
24
28
  this.isSelected = computed((value = this.value()) => (x) => tuiIsPresent(value) && this.itemsHandlers.identityMatcher()(x, value));
25
29
  this.valueEffect = effect(() => {
26
- this.textfield.value.set(this.stringified());
30
+ /**
31
+ * Wait until all `<option>`-s are inside DOM.
32
+ * Otherwise
33
+ * ```
34
+ * document.querySelector('select').value = 'even upcoming valid value';
35
+ * // same as
36
+ * document.querySelector('select').value = '';
37
+ * ```
38
+ * (it breaks `tuiValue` utility logic)
39
+ */
40
+ if (this.options().length) {
41
+ this.input.value.set(this.stringified());
42
+ }
27
43
  });
28
44
  this.items = input([]);
29
45
  this.labels = input([]);
@@ -34,18 +50,19 @@ class TuiNativeSelect extends TuiControl {
34
50
  }
35
51
  selectOption(index) {
36
52
  const items = (this.items()?.flat() ?? []);
37
- this.onChange(items[index - (this.showPlaceholder() ? 1 : 0)] ?? null);
53
+ const placeholderOffset = this.stringified() ? 0 : 1;
54
+ this.onChange(items[index - placeholderOffset] ?? null);
38
55
  }
39
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeSelect, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
40
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", 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)], 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@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 [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 }); }
56
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiNativeSelect, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
57
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", 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 }); }
41
58
  }
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeSelect, decorators: [{
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiNativeSelect, decorators: [{
43
60
  type: Component,
44
- args: [{ selector: 'select[tuiSelect]', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsTextfieldAccessor(TuiNativeSelect), tuiAsControl(TuiNativeSelect)], hostDirectives: [TuiWithTextfield], host: {
61
+ args: [{ selector: 'select[tuiSelect]', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsTextfieldAccessor(TuiNativeSelect), tuiAsControl(TuiNativeSelect)], hostDirectives: [TuiWithInput], host: {
45
62
  '[attr.aria-invalid]': 'invalid()',
46
63
  '[disabled]': '!interactive()',
47
64
  '(change)': 'selectOption($event.target.options.selectedIndex)',
48
- }, template: "@if (showPlaceholder()) {\n <option\n disabled\n selected\n value=\"\"\n >\n {{ placeholder() }}\n </option>\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 [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" }]
65
+ }, 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" }]
49
66
  }] });
50
67
 
51
68
  class TuiSelectOption {
@@ -61,22 +78,22 @@ class TuiSelectOption {
61
78
  this.handlers.identityMatcher()(controlValue, optionValue));
62
79
  this.scrolled = tuiDirectiveBinding(TuiScrollIntoView, 'tuiScrollIntoView', this.selected);
63
80
  }
64
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSelectOption, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
65
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.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: `
81
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSelectOption, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
82
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", 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: `
66
83
  @if (selected()) {
67
84
  <input
68
85
  tuiCheckbox
69
86
  type="checkbox"
70
87
  class="t-check"
71
88
  [checked]="selected()"
72
- [size]="datalist.size === 'l' ? 'm' : 's'"
89
+ [size]="datalist.size() === 'l' ? 'm' : 's'"
73
90
  />
74
91
  } @else {
75
92
  <span class="t-dummy"></span>
76
93
  }
77
94
  `, 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 }); }
78
95
  }
79
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSelectOption, decorators: [{
96
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSelectOption, decorators: [{
80
97
  type: Component,
81
98
  args: [{ imports: [TuiCheckbox], template: `
82
99
  @if (selected()) {
@@ -85,7 +102,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
85
102
  type="checkbox"
86
103
  class="t-check"
87
104
  [checked]="selected()"
88
- [size]="datalist.size === 'l' ? 'm' : 's'"
105
+ [size]="datalist.size() === 'l' ? 'm' : 's'"
89
106
  />
90
107
  } @else {
91
108
  <span class="t-dummy"></span>
@@ -100,14 +117,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
100
117
  class TuiSelectDirective extends TuiControl {
101
118
  constructor() {
102
119
  super(...arguments);
103
- this.textfield = inject(TuiTextfieldDirective);
104
- this.open = tuiDropdownOpen();
120
+ this.input = inject(TuiInputDirective);
121
+ this.open = inject(TuiDropdownOpen).open;
105
122
  this.itemsHandlers = inject(TUI_ITEMS_HANDLERS);
106
123
  this.dropdownEnabled = tuiDropdownEnabled(this.interactive);
107
124
  this.valueEffect = effect(() => {
108
125
  const value = this.value();
109
126
  const string = tuiIsPresent(value) ? this.itemsHandlers.stringify()(value) : '';
110
- this.textfield.value.set(string);
127
+ this.input.value.set(string);
111
128
  });
112
129
  }
113
130
  setValue(value) {
@@ -116,24 +133,23 @@ class TuiSelectDirective extends TuiControl {
116
133
  this.open.set(true);
117
134
  }
118
135
  }
119
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSelectDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
120
- 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: [
136
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSelectDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
137
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiSelectDirective, isStandalone: true, selector: "input[tuiSelect]", host: { listeners: { "input": "$event.inputType?.includes(\"delete\") && setValue(null)" }, properties: { "disabled": "disabled()" } }, providers: [
121
138
  tuiAsOptionContent(TuiSelectOption),
122
139
  tuiAsTextfieldAccessor(TuiSelectDirective),
123
140
  tuiAsControl(TuiSelectDirective),
124
- ], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithTextfield }, { directive: i1.TuiSelectLike }], ngImport: i0 }); }
141
+ ], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.TuiSelectLike }], ngImport: i0 }); }
125
142
  }
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSelectDirective, decorators: [{
143
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSelectDirective, decorators: [{
127
144
  type: Directive,
128
145
  args: [{
129
- standalone: true,
130
146
  selector: 'input[tuiSelect]',
131
147
  providers: [
132
148
  tuiAsOptionContent(TuiSelectOption),
133
149
  tuiAsTextfieldAccessor(TuiSelectDirective),
134
150
  tuiAsControl(TuiSelectDirective),
135
151
  ],
136
- hostDirectives: [TuiWithTextfield, TuiSelectLike],
152
+ hostDirectives: [TuiWithInput, TuiSelectLike],
137
153
  host: {
138
154
  '[disabled]': 'disabled()',
139
155
  '(input)': '$event.inputType?.includes("delete") && setValue(null)',
@@ -141,7 +157,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
141
157
  }]
142
158
  }] });
143
159
 
144
- const TuiSelect = [TuiSelectDirective, TuiNativeSelect];
160
+ const TuiSelect = [
161
+ TuiSelectDirective,
162
+ TuiNativeSelect,
163
+ TuiLabel,
164
+ TuiTextfieldComponent,
165
+ TuiTextfieldOptionsDirective,
166
+ TuiDropdownContent,
167
+ ];
145
168
 
146
169
  /**
147
170
  * Generated bundle index. Do not edit.