@taiga-ui/kit 4.52.0-canary.c107f6a → 4.52.0-canary.c8448e0

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 (438) 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 -3
  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-month/calendar-month.component.d.ts +5 -5
  13. package/components/calendar-range/calendar-range.component.d.ts +1 -3
  14. package/components/calendar-range/day-range-period.d.ts +2 -1
  15. package/components/carousel/carousel-autoscroll.directive.d.ts +1 -2
  16. package/components/carousel/carousel-scroll.directive.d.ts +1 -1
  17. package/components/carousel/carousel.component.d.ts +15 -18
  18. package/components/carousel/carousel.directive.d.ts +5 -4
  19. package/components/chip/chip.options.d.ts +1 -3
  20. package/components/combo-box/combo-box.d.ts +5 -0
  21. package/components/combo-box/combo-box.directive.d.ts +7 -9
  22. package/components/combo-box/index.d.ts +1 -0
  23. package/components/compass/compass.component.d.ts +2 -2
  24. package/components/confirm/confirm.component.d.ts +4 -3
  25. package/components/confirm/confirm.service.d.ts +1 -1
  26. package/components/copy/copy.component.d.ts +3 -4
  27. package/components/copy/copy.directive.d.ts +2 -4
  28. package/components/data-list-wrapper/data-list-group-wrapper.component.d.ts +2 -2
  29. package/components/data-list-wrapper/data-list-wrapper.component.d.ts +14 -22
  30. package/components/data-list-wrapper/{data-list-wrapper.module.d.ts → data-list-wrapper.d.ts} +1 -2
  31. package/components/data-list-wrapper/index.d.ts +1 -1
  32. package/components/drawer/drawer.component.d.ts +3 -4
  33. package/components/files/file/file.component.d.ts +16 -29
  34. package/components/files/file/file.options.d.ts +1 -1
  35. package/components/files/files/files.component.d.ts +5 -8
  36. package/components/files/input-files/input-files.component.d.ts +2 -2
  37. package/components/files/input-files/input-files.content.d.ts +7 -8
  38. package/components/files/input-files/input-files.directive.d.ts +2 -2
  39. package/components/files/input-files/input-files.options.d.ts +1 -3
  40. package/components/filter/filter.component.d.ts +9 -12
  41. package/components/fullscreen/fullscreen.component.d.ts +5 -8
  42. package/components/index.d.ts +0 -3
  43. package/components/input-chip/input-chip.component.d.ts +9 -8
  44. package/components/input-chip/input-chip.d.ts +5 -1
  45. package/components/input-chip/input-chip.directive.d.ts +7 -12
  46. package/components/input-color/index.d.ts +1 -0
  47. package/components/input-color/input-color.component.d.ts +9 -13
  48. package/components/input-color/input-color.d.ts +5 -0
  49. package/components/input-date/input-date.component.d.ts +2 -2
  50. package/components/input-date/input-date.d.ts +4 -1
  51. package/components/input-date/input-date.directive.d.ts +21 -22
  52. package/components/input-date/input-date.options.d.ts +3 -3
  53. package/components/input-date-multi/input-date-multi.d.ts +1 -2
  54. package/components/input-date-multi/input-date-multi.directive.d.ts +10 -14
  55. package/components/input-date-range/input-date-range.d.ts +4 -1
  56. package/components/input-date-range/input-date-range.directive.d.ts +9 -10
  57. package/components/input-date-range/input-date-range.options.d.ts +2 -2
  58. package/components/input-date-time/input-date-time.d.ts +4 -1
  59. package/components/input-date-time/input-date-time.directive.d.ts +14 -14
  60. package/components/input-date-time/input-date-time.options.d.ts +2 -2
  61. package/components/input-inline/input-inline.component.d.ts +3 -2
  62. package/components/input-month/input-month.component.d.ts +3 -5
  63. package/components/input-month/input-month.d.ts +4 -1
  64. package/components/input-month/input-month.directive.d.ts +6 -5
  65. package/components/input-month-range/input-month-range.d.ts +4 -1
  66. package/components/input-month-range/input-month-range.directive.d.ts +6 -5
  67. package/components/input-number/index.d.ts +3 -0
  68. package/components/input-number/input-number.d.ts +7 -2
  69. package/components/input-number/input-number.directive.d.ts +11 -24
  70. package/components/input-number/input-number.options.d.ts +4 -7
  71. package/components/input-number/number-mask.directive.d.ts +42 -0
  72. package/components/input-number/quantum.directive.d.ts +10 -8
  73. package/components/input-number/step/input-number-step.component.d.ts +10 -9
  74. package/components/input-number/transformers/bigint.value-transformer.d.ts +11 -0
  75. package/components/input-number/transformers/number.value-transformer.d.ts +11 -0
  76. package/components/input-phone/index.d.ts +1 -0
  77. package/components/input-phone/input-phone.d.ts +5 -0
  78. package/components/input-phone/input-phone.directive.d.ts +12 -14
  79. package/components/input-phone-international/index.d.ts +1 -0
  80. package/components/input-phone-international/input-phone-international.component.d.ts +14 -16
  81. package/components/input-phone-international/input-phone-international.d.ts +5 -0
  82. package/components/input-phone-international/input-phone-international.options.d.ts +2 -3
  83. package/components/input-pin/index.d.ts +1 -0
  84. package/components/input-pin/input-pin.component.d.ts +5 -6
  85. package/components/input-pin/input-pin.d.ts +5 -0
  86. package/components/input-range/index.d.ts +0 -1
  87. package/components/input-range/input-range.component.d.ts +23 -53
  88. package/components/input-slider/input-slider.d.ts +4 -1
  89. package/components/input-slider/input-slider.directive.d.ts +4 -3
  90. package/components/input-time/input-time.component.d.ts +1 -3
  91. package/components/input-time/input-time.d.ts +4 -1
  92. package/components/input-time/input-time.directive.d.ts +5 -5
  93. package/components/input-year/input-year.d.ts +4 -1
  94. package/components/input-year/input-year.directive.d.ts +8 -10
  95. package/components/input-year/input-year.options.d.ts +2 -2
  96. package/components/items-with-more/items-with-more.component.d.ts +6 -6
  97. package/components/items-with-more/items-with-more.directive.d.ts +6 -6
  98. package/components/like/like.options.d.ts +1 -1
  99. package/components/line-clamp/line-clamp-box.component.d.ts +1 -1
  100. package/components/line-clamp/line-clamp.options.d.ts +1 -3
  101. package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +4 -6
  102. package/components/multi-select/multi-select-native/multi-select-native.component.d.ts +5 -4
  103. package/components/notification-middle/notification-middle.component.d.ts +2 -2
  104. package/components/notification-middle/notification-middle.directive.d.ts +4 -3
  105. package/components/notification-middle/notification-middle.service.d.ts +7 -3
  106. package/components/pager/pager.component.d.ts +12 -12
  107. package/components/pagination/pagination.component.d.ts +22 -53
  108. package/components/pagination/pagination.options.d.ts +3 -6
  109. package/components/preview/dialog/preview-dialog.component.d.ts +2 -2
  110. package/components/preview/dialog/preview-dialog.directive.d.ts +3 -3
  111. package/components/preview/dialog/preview-dialog.service.d.ts +5 -2
  112. package/components/preview/index.d.ts +1 -0
  113. package/components/preview/pagination/preview-pagination.component.d.ts +6 -10
  114. package/components/preview/preview.component.d.ts +6 -6
  115. package/components/preview/preview.d.ts +2 -1
  116. package/{tokens/preview-icons.d.ts → components/preview/preview.options.d.ts} +1 -3
  117. package/components/preview/zoom/preview-zoom.component.d.ts +11 -17
  118. package/components/progress/progress-bar/progress-bar.component.d.ts +3 -4
  119. package/components/progress/progress-circle/progress-circle.component.d.ts +7 -11
  120. package/components/progress/progress.options.d.ts +1 -3
  121. package/components/pulse/pulse.component.d.ts +2 -2
  122. package/components/push/push-alert.component.d.ts +2 -2
  123. package/components/push/push.component.d.ts +6 -7
  124. package/components/push/push.options.d.ts +4 -3
  125. package/components/push/push.service.d.ts +2 -2
  126. package/components/radio/radio.component.d.ts +1 -1
  127. package/components/radio-list/radio-list.component.d.ts +11 -9
  128. package/components/range/range.component.d.ts +3 -4
  129. package/components/rating/rating.component.d.ts +1 -1
  130. package/components/rating/rating.options.d.ts +1 -3
  131. package/components/routable-dialog/generate-dialogable-route.d.ts +1 -1
  132. package/components/segmented/segmented.component.d.ts +4 -6
  133. package/components/segmented/segmented.directive.d.ts +6 -7
  134. package/components/select/native-select/native-select.component.d.ts +4 -4
  135. package/components/select/select.d.ts +4 -1
  136. package/components/select/select.directive.d.ts +4 -3
  137. package/components/slider/helpers/slider-key-steps.directive.d.ts +10 -7
  138. package/components/slider/helpers/slider-readonly.directive.d.ts +2 -4
  139. package/components/slider/helpers/slider-thumb-label.component.d.ts +2 -4
  140. package/components/slider/slider.component.d.ts +4 -7
  141. package/components/slider/slider.options.d.ts +1 -6
  142. package/components/stepper/step.component.d.ts +14 -9
  143. package/components/stepper/stepper.component.d.ts +5 -12
  144. package/components/switch/switch.component.d.ts +1 -0
  145. package/components/tabs/tabs-horizontal.directive.d.ts +4 -5
  146. package/components/tabs/tabs-vertical.directive.d.ts +2 -2
  147. package/components/tabs/tabs-with-more.component.d.ts +12 -16
  148. package/components/tabs/tabs.directive.d.ts +5 -7
  149. package/components/tabs/tabs.options.d.ts +1 -6
  150. package/components/textarea/index.d.ts +2 -1
  151. package/components/textarea/textarea.component.d.ts +10 -11
  152. package/components/textarea/textarea.d.ts +6 -0
  153. package/components/textarea/textarea.directive.d.ts +13 -0
  154. package/components/tiles/tile-handle.directive.d.ts +2 -1
  155. package/components/tiles/tile.component.d.ts +7 -10
  156. package/components/tiles/tile.service.d.ts +1 -1
  157. package/components/tiles/tiles.component.d.ts +4 -7
  158. package/components/toast/toast.component.d.ts +4 -4
  159. package/components/toast/toast.options.d.ts +4 -3
  160. package/components/toast/toast.service.d.ts +2 -2
  161. package/components/tree/components/tree/tree.component.d.ts +7 -7
  162. package/components/tree/components/tree-item/tree-item.component.d.ts +1 -1
  163. package/components/tree/components/tree-item-content/tree-item-content.component.d.ts +7 -0
  164. package/components/tree/directives/tree-children.directive.d.ts +2 -2
  165. package/components/tree/directives/tree-controller.directive.d.ts +4 -5
  166. package/components/tree/directives/tree-item-controller.directive.d.ts +2 -2
  167. package/components/tree/directives/tree-node.directive.d.ts +5 -4
  168. package/components/tree/misc/tree.constants.d.ts +0 -3
  169. package/components/tree/misc/tree.tokens.d.ts +1 -6
  170. package/directives/appearance-proxy/appearance-proxy.directive.d.ts +10 -0
  171. package/directives/appearance-proxy/index.d.ts +1 -0
  172. package/directives/button-select/button-select.directive.d.ts +3 -2
  173. package/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.d.ts +5 -5
  174. package/directives/fade/fade.directive.d.ts +5 -6
  175. package/directives/fluid-typography/fluid-typography.options.d.ts +1 -3
  176. package/directives/highlight/highlight.directive.d.ts +4 -4
  177. package/directives/index.d.ts +1 -2
  178. package/directives/password/password.directive.d.ts +1 -1
  179. package/directives/present/present.directive.d.ts +2 -4
  180. package/directives/tooltip/tooltip.directive.d.ts +1 -1
  181. package/directives/unfinished-validator/unfinished-validator.directive.d.ts +2 -2
  182. package/directives/unmask-handler/unmask-handler.directive.d.ts +3 -3
  183. package/fesm2022/taiga-ui-kit-components-accordion.mjs +8 -8
  184. package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
  185. package/fesm2022/taiga-ui-kit-components-action-bar.mjs +7 -7
  186. package/fesm2022/taiga-ui-kit-components-action-bar.mjs.map +1 -1
  187. package/fesm2022/taiga-ui-kit-components-avatar.mjs +34 -48
  188. package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
  189. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +10 -17
  190. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
  191. package/fesm2022/taiga-ui-kit-components-badge.mjs +11 -15
  192. package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
  193. package/fesm2022/taiga-ui-kit-components-badged-content.mjs +9 -11
  194. package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
  195. package/fesm2022/taiga-ui-kit-components-block.mjs +11 -15
  196. package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
  197. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +18 -37
  198. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
  199. package/fesm2022/taiga-ui-kit-components-button-loading.mjs +18 -26
  200. package/fesm2022/taiga-ui-kit-components-button-loading.mjs.map +1 -1
  201. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +13 -33
  202. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
  203. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +26 -35
  204. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
  205. package/fesm2022/taiga-ui-kit-components-carousel.mjs +69 -116
  206. package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
  207. package/fesm2022/taiga-ui-kit-components-checkbox.mjs +4 -5
  208. package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
  209. package/fesm2022/taiga-ui-kit-components-chip.mjs +11 -15
  210. package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
  211. package/fesm2022/taiga-ui-kit-components-combo-box.mjs +40 -44
  212. package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
  213. package/fesm2022/taiga-ui-kit-components-comment.mjs +7 -7
  214. package/fesm2022/taiga-ui-kit-components-comment.mjs.map +1 -1
  215. package/fesm2022/taiga-ui-kit-components-compass.mjs +8 -10
  216. package/fesm2022/taiga-ui-kit-components-compass.mjs.map +1 -1
  217. package/fesm2022/taiga-ui-kit-components-confirm.mjs +10 -12
  218. package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
  219. package/fesm2022/taiga-ui-kit-components-copy.mjs +19 -32
  220. package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
  221. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs +24 -85
  222. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
  223. package/fesm2022/taiga-ui-kit-components-drawer.mjs +11 -32
  224. package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
  225. package/fesm2022/taiga-ui-kit-components-files.mjs +112 -237
  226. package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
  227. package/fesm2022/taiga-ui-kit-components-filter.mjs +21 -34
  228. package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
  229. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +23 -42
  230. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs.map +1 -1
  231. package/fesm2022/taiga-ui-kit-components-input-chip.mjs +63 -75
  232. package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
  233. package/fesm2022/taiga-ui-kit-components-input-color.mjs +31 -32
  234. package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
  235. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +34 -46
  236. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs.map +1 -1
  237. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +37 -36
  238. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
  239. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +41 -56
  240. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
  241. package/fesm2022/taiga-ui-kit-components-input-date.mjs +52 -58
  242. package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
  243. package/fesm2022/taiga-ui-kit-components-input-inline.mjs +10 -12
  244. package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
  245. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +26 -22
  246. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
  247. package/fesm2022/taiga-ui-kit-components-input-month.mjs +39 -45
  248. package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
  249. package/fesm2022/taiga-ui-kit-components-input-number.mjs +262 -182
  250. package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
  251. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +63 -73
  252. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
  253. package/fesm2022/taiga-ui-kit-components-input-phone.mjs +37 -41
  254. package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
  255. package/fesm2022/taiga-ui-kit-components-input-pin.mjs +24 -22
  256. package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
  257. package/fesm2022/taiga-ui-kit-components-input-range.mjs +42 -69
  258. package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
  259. package/fesm2022/taiga-ui-kit-components-input-slider.mjs +27 -17
  260. package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
  261. package/fesm2022/taiga-ui-kit-components-input-time.mjs +38 -39
  262. package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
  263. package/fesm2022/taiga-ui-kit-components-input-year.mjs +31 -36
  264. package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
  265. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +50 -70
  266. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
  267. package/fesm2022/taiga-ui-kit-components-like.mjs +3 -3
  268. package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
  269. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +18 -22
  270. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
  271. package/fesm2022/taiga-ui-kit-components-message.mjs +7 -7
  272. package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
  273. package/fesm2022/taiga-ui-kit-components-multi-select.mjs +37 -52
  274. package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
  275. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +37 -25
  276. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs.map +1 -1
  277. package/fesm2022/taiga-ui-kit-components-pager.mjs +30 -44
  278. package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
  279. package/fesm2022/taiga-ui-kit-components-pagination.mjs +68 -153
  280. package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
  281. package/fesm2022/taiga-ui-kit-components-pin.mjs +7 -7
  282. package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
  283. package/fesm2022/taiga-ui-kit-components-preview.mjs +96 -154
  284. package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
  285. package/fesm2022/taiga-ui-kit-components-progress.mjs +47 -70
  286. package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
  287. package/fesm2022/taiga-ui-kit-components-pulse.mjs +7 -11
  288. package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
  289. package/fesm2022/taiga-ui-kit-components-push.mjs +27 -40
  290. package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
  291. package/fesm2022/taiga-ui-kit-components-radio-list.mjs +23 -35
  292. package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
  293. package/fesm2022/taiga-ui-kit-components-radio.mjs +7 -7
  294. package/fesm2022/taiga-ui-kit-components-radio.mjs.map +1 -1
  295. package/fesm2022/taiga-ui-kit-components-range.mjs +19 -29
  296. package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
  297. package/fesm2022/taiga-ui-kit-components-rating.mjs +7 -12
  298. package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
  299. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs +4 -4
  300. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs.map +1 -1
  301. package/fesm2022/taiga-ui-kit-components-segmented.mjs +31 -57
  302. package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
  303. package/fesm2022/taiga-ui-kit-components-select.mjs +52 -28
  304. package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
  305. package/fesm2022/taiga-ui-kit-components-slider.mjs +55 -84
  306. package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
  307. package/fesm2022/taiga-ui-kit-components-status.mjs +6 -6
  308. package/fesm2022/taiga-ui-kit-components-stepper.mjs +61 -88
  309. package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
  310. package/fesm2022/taiga-ui-kit-components-switch.mjs +10 -6
  311. package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
  312. package/fesm2022/taiga-ui-kit-components-tabs.mjs +90 -154
  313. package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
  314. package/fesm2022/taiga-ui-kit-components-textarea.mjs +60 -71
  315. package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
  316. package/fesm2022/taiga-ui-kit-components-tiles.mjs +52 -96
  317. package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
  318. package/fesm2022/taiga-ui-kit-components-toast.mjs +27 -28
  319. package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
  320. package/fesm2022/taiga-ui-kit-components-tree.mjs +90 -120
  321. package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
  322. package/fesm2022/taiga-ui-kit-components.mjs +0 -3
  323. package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
  324. package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs +27 -0
  325. package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs.map +1 -0
  326. package/fesm2022/taiga-ui-kit-directives-button-group.mjs +7 -7
  327. package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
  328. package/fesm2022/taiga-ui-kit-directives-button-select.mjs +20 -11
  329. package/fesm2022/taiga-ui-kit-directives-button-select.mjs.map +1 -1
  330. package/fesm2022/taiga-ui-kit-directives-chevron.mjs +10 -9
  331. package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
  332. package/fesm2022/taiga-ui-kit-directives-connected.mjs +7 -7
  333. package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
  334. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs +25 -52
  335. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs.map +1 -1
  336. package/fesm2022/taiga-ui-kit-directives-fade.mjs +25 -34
  337. package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
  338. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs +6 -11
  339. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs.map +1 -1
  340. package/fesm2022/taiga-ui-kit-directives-highlight.mjs +16 -20
  341. package/fesm2022/taiga-ui-kit-directives-highlight.mjs.map +1 -1
  342. package/fesm2022/taiga-ui-kit-directives-password.mjs +10 -8
  343. package/fesm2022/taiga-ui-kit-directives-password.mjs.map +1 -1
  344. package/fesm2022/taiga-ui-kit-directives-present.mjs +10 -17
  345. package/fesm2022/taiga-ui-kit-directives-present.mjs.map +1 -1
  346. package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +6 -6
  347. package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +6 -6
  348. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +7 -6
  349. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
  350. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +9 -9
  351. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
  352. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs +8 -10
  353. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs.map +1 -1
  354. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs +10 -14
  355. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs.map +1 -1
  356. package/fesm2022/taiga-ui-kit-directives.mjs +1 -2
  357. package/fesm2022/taiga-ui-kit-directives.mjs.map +1 -1
  358. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs +43 -0
  359. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs.map +1 -0
  360. package/fesm2022/taiga-ui-kit-pipes-emails.mjs +3 -3
  361. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs +22 -35
  362. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs.map +1 -1
  363. package/fesm2022/taiga-ui-kit-pipes-flag.mjs +30 -0
  364. package/fesm2022/taiga-ui-kit-pipes-flag.mjs.map +1 -0
  365. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs +23 -26
  366. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs.map +1 -1
  367. package/fesm2022/taiga-ui-kit-pipes-initials.mjs +28 -0
  368. package/fesm2022/taiga-ui-kit-pipes-initials.mjs.map +1 -0
  369. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs +10 -8
  370. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs.map +1 -1
  371. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs +3 -3
  372. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs.map +1 -1
  373. package/fesm2022/taiga-ui-kit-pipes-stringify.mjs +3 -3
  374. package/fesm2022/taiga-ui-kit-pipes.mjs +3 -0
  375. package/fesm2022/taiga-ui-kit-pipes.mjs.map +1 -1
  376. package/fesm2022/taiga-ui-kit-tokens.mjs +4 -123
  377. package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
  378. package/fesm2022/taiga-ui-kit-utils.mjs +3 -15
  379. package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
  380. package/package.json +60 -68
  381. package/pipes/auto-color/auto-color.pipe.d.ts +13 -0
  382. package/pipes/auto-color/index.d.ts +1 -0
  383. package/pipes/filter-by-input/filter-by-input.pipe.d.ts +5 -2
  384. package/pipes/flag/flag.pipe.d.ts +13 -0
  385. package/pipes/flag/index.d.ts +1 -0
  386. package/pipes/hide-selected/hide-selected.pipe.d.ts +2 -0
  387. package/pipes/index.d.ts +3 -0
  388. package/pipes/initials/index.d.ts +1 -0
  389. package/pipes/initials/initials.pipe.d.ts +7 -0
  390. package/pipes/sort-countries/sort-countries.pipe.d.ts +4 -3
  391. package/pipes/stringify-content/stringify-content.pipe.d.ts +2 -3
  392. package/styles/components/avatar.less +14 -14
  393. package/styles/components/badge.less +3 -3
  394. package/styles/components/block.less +4 -4
  395. package/styles/components/chip.less +4 -4
  396. package/styles/components/comment.less +15 -17
  397. package/styles/components/message.less +1 -1
  398. package/styles/components/pin.less +3 -3
  399. package/styles/components/switch.less +3 -2
  400. package/styles/components/toast.less +1 -1
  401. package/tokens/i18n.d.ts +1 -0
  402. package/tokens/index.d.ts +0 -7
  403. package/utils/index.d.ts +0 -2
  404. package/utils/maskito.binding.d.ts +1 -1
  405. package/components/elastic-container/elastic-container.component.d.ts +0 -8
  406. package/components/elastic-container/elastic-container.directive.d.ts +0 -7
  407. package/components/elastic-container/index.d.ts +0 -2
  408. package/components/floating-container/floating-container.directive.d.ts +0 -7
  409. package/components/floating-container/index.d.ts +0 -1
  410. package/components/input-range/input-range.d.ts +0 -3
  411. package/components/slides/index.d.ts +0 -1
  412. package/components/slides/slides.directive.d.ts +0 -11
  413. package/components/textarea/textarea-limit.directive.d.ts +0 -26
  414. package/directives/button-close/button-close.directive.d.ts +0 -6
  415. package/directives/button-close/index.d.ts +0 -1
  416. package/directives/lazy-loading/index.d.ts +0 -2
  417. package/directives/lazy-loading/lazy-loading.directive.d.ts +0 -18
  418. package/directives/lazy-loading/lazy-loading.service.d.ts +0 -12
  419. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs +0 -77
  420. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs.map +0 -1
  421. package/fesm2022/taiga-ui-kit-components-floating-container.mjs +0 -37
  422. package/fesm2022/taiga-ui-kit-components-floating-container.mjs.map +0 -1
  423. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs +0 -63
  424. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs.map +0 -1
  425. package/fesm2022/taiga-ui-kit-components-slides.mjs +0 -49
  426. package/fesm2022/taiga-ui-kit-components-slides.mjs.map +0 -1
  427. package/fesm2022/taiga-ui-kit-directives-button-close.mjs +0 -47
  428. package/fesm2022/taiga-ui-kit-directives-button-close.mjs.map +0 -1
  429. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs +0 -80
  430. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs.map +0 -1
  431. package/tokens/calendar-date-stream.d.ts +0 -10
  432. package/tokens/date-inputs-value-transformers.d.ts +0 -19
  433. package/tokens/input-date-options.d.ts +0 -15
  434. package/tokens/items-handlers.d.ts +0 -26
  435. package/tokens/mobile-calendar.d.ts +0 -6
  436. package/tokens/month-formatter.d.ts +0 -5
  437. package/utils/phone.d.ts +0 -3
  438. package/utils/toggle-day.d.ts +0 -2
@@ -1,13 +1,16 @@
1
+ import { TuiLabel } from '@taiga-ui/core/components/label';
2
+ import { TuiTextfieldComponent, TuiTextfieldOptionsDirective } from '@taiga-ui/core/components/textfield';
3
+ import { TuiDropdownContent } from '@taiga-ui/core/portals/dropdown';
1
4
  import * as i0 from '@angular/core';
2
- import { inject, computed, effect, untracked, signal, Input, Directive } from '@angular/core';
5
+ import { inject, computed, effect, untracked, input, Directive } from '@angular/core';
3
6
  import * as i2 from '@maskito/angular';
4
7
  import { MaskitoDirective } from '@maskito/angular';
5
8
  import { maskitoTransform, MASKITO_DEFAULT_OPTIONS } from '@maskito/core';
6
9
  import { maskitoCaretGuard, maskitoPrefixPostprocessorGenerator } from '@maskito/kit';
7
10
  import { TUI_IDENTITY_VALUE_TRANSFORMER, TuiControl, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
8
11
  import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
9
- import * as i1 from '@taiga-ui/core/components/textfield';
10
- import { TuiTextfieldDirective, TuiTextfieldComponent, TuiWithTextfield } from '@taiga-ui/core/components/textfield';
12
+ import * as i1 from '@taiga-ui/core/components/input';
13
+ import { TuiInputDirective, TuiWithInput } from '@taiga-ui/core/components/input';
11
14
  import { tuiMaskito } from '@taiga-ui/kit/utils';
12
15
  import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
13
16
 
@@ -80,48 +83,39 @@ const MASK_SYMBOLS = /[ \-_()]/g;
80
83
  function isText(value) {
81
84
  return Number.isNaN(parseInt(value.replaceAll(MASK_SYMBOLS, ''), 10));
82
85
  }
83
- class TuiInputPhone extends TuiControl {
86
+ class TuiInputPhoneDirective extends TuiControl {
84
87
  constructor() {
85
88
  super(...arguments);
86
- this.textfield = inject(TuiTextfieldDirective);
89
+ this.input = inject(TuiInputDirective);
87
90
  this.host = inject(TuiTextfieldComponent);
91
+ this.options = inject(TUI_INPUT_PHONE_OPTIONS);
92
+ this.el = tuiInjectElement();
88
93
  this.nonRemovablePrefix = computed(() => `${this.countryCode()} `);
89
94
  this.inputMode = computed(() => (this.allowText() ? 'text' : 'numeric'));
90
95
  this.valueEffect = effect(() => {
91
96
  if (this.value()) {
92
- this.textfield.value.set(maskitoTransform(this.value() ?? '', this.mask()));
97
+ this.input.value.set(maskitoTransform(this.value() ?? '', this.maskito()));
93
98
  }
94
99
  });
95
100
  this.blurEffect = effect(() => {
96
101
  const incomplete = untracked(() => !this.value());
97
102
  const prefix = incomplete && this.interactive() && !this.allowText();
98
103
  if (!this.host.focused() && incomplete) {
99
- this.textfield.value.set('');
104
+ this.input.value.set('');
100
105
  }
101
106
  else if (this.host.focused() && prefix) {
102
- this.textfield.value.set(this.nonRemovablePrefix());
107
+ this.input.value.set(this.nonRemovablePrefix());
103
108
  }
104
109
  });
105
- this.options = inject(TUI_INPUT_PHONE_OPTIONS);
106
- this.el = tuiInjectElement();
107
- this.mask = computed(() => this.calculateMask(this.countryCode(), this.phoneMask(), this.nonRemovablePrefix(), this.allowText()));
108
- this.maskito = tuiMaskito(computed(() => this.mask()));
109
- this.countryCode = signal(extractCountryCode(this.options.mask));
110
- this.allowText = signal(this.options.allowText);
111
- this.phoneMask = signal(extractMask(this.options.mask));
112
- }
113
- // TODO(v5): replace with signal input
114
- set allowTextSetter(allow) {
115
- this.allowText.set(allow);
116
- }
117
- // TODO(v5): replace with signal input
118
- set maskSetter(mask) {
119
- this.countryCode.set(extractCountryCode(mask));
120
- this.phoneMask.set(extractMask(mask));
110
+ this.countryCode = computed(() => extractCode(this.mask()));
111
+ this.phoneMask = computed(() => extractMask(this.mask()));
112
+ this.maskito = tuiMaskito(computed(() => this.calculateMask(this.countryCode(), this.phoneMask(), this.nonRemovablePrefix(), this.allowText())));
113
+ this.allowText = input(this.options.allowText);
114
+ this.mask = input(this.options.mask);
121
115
  }
122
116
  onInput(value) {
123
117
  if (!value && !this.allowText()) {
124
- this.textfield.value.set(this.nonRemovablePrefix());
118
+ this.input.value.set(this.nonRemovablePrefix());
125
119
  }
126
120
  const parsed = isText(value)
127
121
  ? value
@@ -157,21 +151,21 @@ class TuiInputPhone extends TuiControl {
157
151
  ],
158
152
  };
159
153
  }
160
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputPhone, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
161
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiInputPhone, isStandalone: true, selector: "input[tuiInputPhone]", inputs: { allowTextSetter: ["allowText", "allowTextSetter"], maskSetter: ["mask", "maskSetter"] }, host: { attributes: { "type": "tel" }, listeners: { "input": "onInput($event.target.value)" }, properties: { "inputMode": "inputMode()", "disabled": "disabled()" } }, providers: [
162
- tuiAsControl(TuiInputPhone),
154
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputPhoneDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
155
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiInputPhoneDirective, isStandalone: true, selector: "input[tuiInputPhone]", inputs: { allowText: { classPropertyName: "allowText", publicName: "allowText", isSignal: true, isRequired: false, transformFunction: null }, mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "tel" }, listeners: { "input": "onInput($event.target.value)" }, properties: { "inputMode": "inputMode()", "disabled": "disabled()" } }, providers: [
156
+ tuiAsControl(TuiInputPhoneDirective),
163
157
  tuiValueTransformerFrom(TUI_INPUT_PHONE_OPTIONS),
164
- ], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithTextfield }, { directive: i2.MaskitoDirective }], ngImport: i0 }); }
158
+ ], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.MaskitoDirective }], ngImport: i0 }); }
165
159
  }
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputPhone, decorators: [{
160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputPhoneDirective, decorators: [{
167
161
  type: Directive,
168
162
  args: [{
169
163
  selector: 'input[tuiInputPhone]',
170
164
  providers: [
171
- tuiAsControl(TuiInputPhone),
165
+ tuiAsControl(TuiInputPhoneDirective),
172
166
  tuiValueTransformerFrom(TUI_INPUT_PHONE_OPTIONS),
173
167
  ],
174
- hostDirectives: [TuiWithTextfield, MaskitoDirective],
168
+ hostDirectives: [TuiWithInput, MaskitoDirective],
175
169
  host: {
176
170
  type: 'tel',
177
171
  '[inputMode]': 'inputMode()',
@@ -179,14 +173,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
179
173
  '(input)': 'onInput($event.target.value)',
180
174
  },
181
175
  }]
182
- }], propDecorators: { allowTextSetter: [{
183
- type: Input,
184
- args: ['allowText']
185
- }], maskSetter: [{
186
- type: Input,
187
- args: ['mask']
188
- }] } });
189
- function extractCountryCode(mask) {
176
+ }] });
177
+ function extractCode(mask) {
190
178
  const match = /^(\+\d+)/.exec(mask);
191
179
  return match?.[1] || '';
192
180
  }
@@ -195,9 +183,17 @@ function extractMask(mask) {
195
183
  return match?.[1]?.trim() || '';
196
184
  }
197
185
 
186
+ const TuiInputPhone = [
187
+ TuiInputPhoneDirective,
188
+ TuiLabel,
189
+ TuiTextfieldComponent,
190
+ TuiTextfieldOptionsDirective,
191
+ TuiDropdownContent,
192
+ ];
193
+
198
194
  /**
199
195
  * Generated bundle index. Do not edit.
200
196
  */
201
197
 
202
- export { TUI_INPUT_PHONE_DEFAULT_OPTIONS, TUI_INPUT_PHONE_OPTIONS, TuiInputPhone, tuiInputPhoneOptionsProvider };
198
+ export { TUI_INPUT_PHONE_DEFAULT_OPTIONS, TUI_INPUT_PHONE_OPTIONS, TuiInputPhone, TuiInputPhoneDirective, tuiInputPhoneOptionsProvider };
203
199
  //# sourceMappingURL=taiga-ui-kit-components-input-phone.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-input-phone.mjs","sources":["../../../projects/kit/components/input-phone/input-phone.options.ts","../../../projects/kit/components/input-phone/utils/complete-phone-insertion-preprocessor.ts","../../../projects/kit/components/input-phone/utils/create-phone-mask-expression.ts","../../../projects/kit/components/input-phone/input-phone.directive.ts","../../../projects/kit/components/input-phone/taiga-ui-kit-components-input-phone.ts"],"sourcesContent":["import {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\n\nexport interface TuiInputPhoneOptions {\n readonly allowText: boolean;\n readonly mask: string;\n readonly valueTransformer: TuiValueTransformer<string | null, any>;\n}\n\nexport const TUI_INPUT_PHONE_DEFAULT_OPTIONS: TuiInputPhoneOptions = {\n mask: '+1 ### ###-####',\n allowText: false,\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n};\n\nexport const [TUI_INPUT_PHONE_OPTIONS, tuiInputPhoneOptionsProvider] = tuiCreateOptions(\n TUI_INPUT_PHONE_DEFAULT_OPTIONS,\n);\n","import {type MaskitoPreprocessor} from '@maskito/core';\n\nconst countDigits = (value: string): number => value.replaceAll(/\\D/g, '').length;\n\n/**\n * `InputPhone` component sets country code as non-removable prefix.\n * This prefix appears on focus and cannot be erased.\n * But users sometimes can copy complete phone number (from any different source)\n * and try to insert the whole string inside our `InputPhone` textfield.\n * This preprocessor helps to avoid country prefix duplication on paste/drop/autofill events.\n */\nexport function tuiCreateCompletePhoneInsertionPreprocessor(\n countryCode: string,\n phoneMaskAfterCountryCode: string,\n): MaskitoPreprocessor {\n const completePhoneLength = (countryCode + phoneMaskAfterCountryCode).replaceAll(\n /[^#\\d]+/g,\n '',\n ).length;\n\n const trimCountryPrefix = (value: string): string =>\n countryCode === '+7'\n ? value.replace(/^(\\+?\\s*7?\\s?8?)\\s?/, '')\n : value.replace(\n new RegExp(String.raw`^(\\+?\\s*${countryCode.replace('+', '')}?)\\s?`),\n '',\n );\n\n return ({elementState, data}) => {\n const {value, selection} = elementState;\n\n return {\n elementState: {\n selection,\n value:\n /**\n * The only possible case when `value` includes digits more\n * than mask expression allows – browser autofill.\n * It means that we are inside `input`-event\n * and mask are ready to reject \"extra\" characters.\n * We should cut leading country prefix to save trailing characters!\n */\n countDigits(value) > completePhoneLength\n ? trimCountryPrefix(value)\n : value,\n },\n data:\n countDigits(data) >= completePhoneLength || data.startsWith(countryCode)\n ? /**\n * User tries to insert/drop the complete phone number (with country prefix).\n * We should drop already existing non-removable prefix.\n */\n trimCountryPrefix(data)\n : data,\n };\n };\n}\n","/**\n * Create {@link https://maskito.dev/core-concepts/mask-expression pattern mask expression} for phone number\n *\n * @example\n * tuiCreatePhoneMaskExpression('+1', '(###) ###-####');\n */\nexport function tuiCreatePhoneMaskExpression(\n countryCode: string,\n phoneMaskAfterCountryCode: string,\n): Array<RegExp | string> {\n return [\n ...countryCode.split(''),\n ' ',\n ...phoneMaskAfterCountryCode\n .replaceAll(/[^#\\- ()]+/g, '')\n .split('')\n .map((item) => (item === '#' ? /\\d/ : item)),\n ];\n}\n","import {\n computed,\n Directive,\n effect,\n inject,\n Input,\n signal,\n untracked,\n} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {\n MASKITO_DEFAULT_OPTIONS,\n type MaskitoOptions,\n maskitoTransform,\n} from '@maskito/core';\nimport {maskitoCaretGuard, maskitoPrefixPostprocessorGenerator} from '@maskito/kit';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n TuiTextfieldComponent,\n TuiTextfieldDirective,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {TUI_INPUT_PHONE_OPTIONS} from './input-phone.options';\nimport {tuiCreateCompletePhoneInsertionPreprocessor} from './utils/complete-phone-insertion-preprocessor';\nimport {tuiCreatePhoneMaskExpression} from './utils/create-phone-mask-expression';\n\nconst MASK_SYMBOLS = /[ \\-_()]/g;\n\nfunction isText(value: string): boolean {\n return Number.isNaN(parseInt(value.replaceAll(MASK_SYMBOLS, ''), 10));\n}\n\n@Directive({\n selector: 'input[tuiInputPhone]',\n providers: [\n tuiAsControl(TuiInputPhone),\n tuiValueTransformerFrom(TUI_INPUT_PHONE_OPTIONS),\n ],\n hostDirectives: [TuiWithTextfield, MaskitoDirective],\n host: {\n type: 'tel',\n '[inputMode]': 'inputMode()',\n '[disabled]': 'disabled()',\n '(input)': 'onInput($event.target.value)',\n },\n})\nexport class TuiInputPhone extends TuiControl<string | null> {\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly host: TuiTextfieldComponent<string> = inject(TuiTextfieldComponent);\n\n protected readonly nonRemovablePrefix = computed(() => `${this.countryCode()} `);\n protected inputMode = computed(() => (this.allowText() ? 'text' : 'numeric'));\n\n protected readonly valueEffect = effect(() => {\n if (this.value()) {\n this.textfield.value.set(maskitoTransform(this.value() ?? '', this.mask()));\n }\n });\n\n protected readonly blurEffect = effect(() => {\n const incomplete = untracked(() => !this.value());\n const prefix = incomplete && this.interactive() && !this.allowText();\n\n if (!this.host.focused() && incomplete) {\n this.textfield.value.set('');\n } else if (this.host.focused() && prefix) {\n this.textfield.value.set(this.nonRemovablePrefix());\n }\n });\n\n protected readonly options = inject(TUI_INPUT_PHONE_OPTIONS);\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n\n protected readonly mask = computed(() =>\n this.calculateMask(\n this.countryCode(),\n this.phoneMask(),\n this.nonRemovablePrefix(),\n this.allowText(),\n ),\n );\n\n protected readonly maskito = tuiMaskito(computed(() => this.mask()));\n\n public readonly countryCode = signal(extractCountryCode(this.options.mask));\n public readonly allowText = signal(this.options.allowText);\n public readonly phoneMask = signal(extractMask(this.options.mask));\n\n // TODO(v5): replace with signal input\n @Input('allowText')\n public set allowTextSetter(allow: boolean) {\n this.allowText.set(allow);\n }\n\n // TODO(v5): replace with signal input\n @Input('mask')\n public set maskSetter(mask: string) {\n this.countryCode.set(extractCountryCode(mask));\n this.phoneMask.set(extractMask(mask));\n }\n\n protected onInput(value: string): void {\n if (!value && !this.allowText()) {\n this.textfield.value.set(this.nonRemovablePrefix());\n }\n\n const parsed = isText(value)\n ? value\n : value.replaceAll(MASK_SYMBOLS, '').slice(0, this.maxPhoneLength);\n\n this.onChange(parsed === this.countryCode() || isText(parsed) ? '' : parsed);\n }\n\n private get maxPhoneLength(): number {\n return (\n this.countryCode().length + this.phoneMask().replaceAll(/[^#]+/g, '').length\n );\n }\n\n private calculateMask(\n countryCode: string,\n phoneMaskAfterCountryCode: string,\n nonRemovablePrefix: string,\n allowText: boolean,\n ): MaskitoOptions {\n const mask = tuiCreatePhoneMaskExpression(countryCode, phoneMaskAfterCountryCode);\n const preprocessors = [\n tuiCreateCompletePhoneInsertionPreprocessor(\n countryCode,\n phoneMaskAfterCountryCode,\n ),\n ];\n\n return allowText\n ? {\n mask: ({value}) =>\n isText(value) && value !== '+'\n ? (MASKITO_DEFAULT_OPTIONS.mask as RegExp)\n : mask,\n preprocessors,\n }\n : {\n mask,\n preprocessors,\n postprocessors: [\n maskitoPrefixPostprocessorGenerator(nonRemovablePrefix),\n ],\n plugins: [\n maskitoCaretGuard((value, [from, to]) => [\n from === to ? nonRemovablePrefix.length : 0,\n value.length,\n ]),\n ],\n };\n }\n}\n\nfunction extractCountryCode(mask: string): string {\n const match = /^(\\+\\d+)/.exec(mask);\n\n return match?.[1] || '';\n}\n\nfunction extractMask(mask: string): string {\n const match = /^\\+\\d+(.*)$/.exec(mask);\n\n return match?.[1]?.trim() || '';\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAYa,MAAA,+BAA+B,GAAyB;AACjE,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,gBAAgB,EAAE,8BAA8B;;AAG7C,MAAM,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,GAAG,gBAAgB,CACnF,+BAA+B;;ACjBnC,MAAM,WAAW,GAAG,CAAC,KAAa,KAAa,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM;AAEjF;;;;;;AAMG;AACa,SAAA,2CAA2C,CACvD,WAAmB,EACnB,yBAAiC,EAAA;AAEjC,IAAA,MAAM,mBAAmB,GAAG,CAAC,WAAW,GAAG,yBAAyB,EAAE,UAAU,CAC5E,UAAU,EACV,EAAE,CACL,CAAC,MAAM;IAER,MAAM,iBAAiB,GAAG,CAAC,KAAa,KACpC,WAAW,KAAK;UACV,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE;UACvC,KAAK,CAAC,OAAO,CACT,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,CAAA,QAAA,EAAW,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA,KAAA,CAAO,CAAC,EACpE,EAAE,CACL;AAEX,IAAA,OAAO,CAAC,EAAC,YAAY,EAAE,IAAI,EAAC,KAAI;AAC5B,QAAA,MAAM,EAAC,KAAK,EAAE,SAAS,EAAC,GAAG,YAAY;QAEvC,OAAO;AACH,YAAA,YAAY,EAAE;gBACV,SAAS;gBACT,KAAK;AACD;;;;;;AAMG;AACH,gBAAA,WAAW,CAAC,KAAK,CAAC,GAAG;AACjB,sBAAE,iBAAiB,CAAC,KAAK;AACzB,sBAAE,KAAK;AAClB,aAAA;AACD,YAAA,IAA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EAAE,IAAI,EAAE,IAAI,EAAE;AACnC;;AC1KA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-kit-components-input-phone.mjs","sources":["../../../projects/kit/components/input-phone/input-phone.options.ts","../../../projects/kit/components/input-phone/utils/complete-phone-insertion-preprocessor.ts","../../../projects/kit/components/input-phone/utils/create-phone-mask-expression.ts","../../../projects/kit/components/input-phone/input-phone.directive.ts","../../../projects/kit/components/input-phone/input-phone.ts","../../../projects/kit/components/input-phone/taiga-ui-kit-components-input-phone.ts"],"sourcesContent":["import {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\n\nexport interface TuiInputPhoneOptions {\n readonly allowText: boolean;\n readonly mask: string;\n readonly valueTransformer: TuiValueTransformer<string | null, any>;\n}\n\nexport const TUI_INPUT_PHONE_DEFAULT_OPTIONS: TuiInputPhoneOptions = {\n mask: '+1 ### ###-####',\n allowText: false,\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n};\n\nexport const [TUI_INPUT_PHONE_OPTIONS, tuiInputPhoneOptionsProvider] = tuiCreateOptions(\n TUI_INPUT_PHONE_DEFAULT_OPTIONS,\n);\n","import {type MaskitoPreprocessor} from '@maskito/core';\n\nconst countDigits = (value: string): number => value.replaceAll(/\\D/g, '').length;\n\n/**\n * `InputPhone` component sets country code as non-removable prefix.\n * This prefix appears on focus and cannot be erased.\n * But users sometimes can copy complete phone number (from any different source)\n * and try to insert the whole string inside our `InputPhone` textfield.\n * This preprocessor helps to avoid country prefix duplication on paste/drop/autofill events.\n */\nexport function tuiCreateCompletePhoneInsertionPreprocessor(\n countryCode: string,\n phoneMaskAfterCountryCode: string,\n): MaskitoPreprocessor {\n const completePhoneLength = (countryCode + phoneMaskAfterCountryCode).replaceAll(\n /[^#\\d]+/g,\n '',\n ).length;\n\n const trimCountryPrefix = (value: string): string =>\n countryCode === '+7'\n ? value.replace(/^(\\+?\\s*7?\\s?8?)\\s?/, '')\n : value.replace(\n new RegExp(String.raw`^(\\+?\\s*${countryCode.replace('+', '')}?)\\s?`),\n '',\n );\n\n return ({elementState, data}) => {\n const {value, selection} = elementState;\n\n return {\n elementState: {\n selection,\n value:\n /**\n * The only possible case when `value` includes digits more\n * than mask expression allows – browser autofill.\n * It means that we are inside `input`-event\n * and mask are ready to reject \"extra\" characters.\n * We should cut leading country prefix to save trailing characters!\n */\n countDigits(value) > completePhoneLength\n ? trimCountryPrefix(value)\n : value,\n },\n data:\n countDigits(data) >= completePhoneLength || data.startsWith(countryCode)\n ? /**\n * User tries to insert/drop the complete phone number (with country prefix).\n * We should drop already existing non-removable prefix.\n */\n trimCountryPrefix(data)\n : data,\n };\n };\n}\n","/**\n * Create {@link https://maskito.dev/core-concepts/mask-expression pattern mask expression} for phone number\n *\n * @example\n * tuiCreatePhoneMaskExpression('+1', '(###) ###-####');\n */\nexport function tuiCreatePhoneMaskExpression(\n countryCode: string,\n phoneMaskAfterCountryCode: string,\n): Array<RegExp | string> {\n return [\n ...countryCode.split(''),\n ' ',\n ...phoneMaskAfterCountryCode\n .replaceAll(/[^#\\- ()]+/g, '')\n .split('')\n .map((item) => (item === '#' ? /\\d/ : item)),\n ];\n}\n","import {computed, Directive, effect, inject, input, untracked} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {\n MASKITO_DEFAULT_OPTIONS,\n type MaskitoOptions,\n maskitoTransform,\n} from '@maskito/core';\nimport {maskitoCaretGuard, maskitoPrefixPostprocessorGenerator} from '@maskito/kit';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TuiInputDirective, TuiWithInput} from '@taiga-ui/core/components/input';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {TUI_INPUT_PHONE_OPTIONS} from './input-phone.options';\nimport {tuiCreateCompletePhoneInsertionPreprocessor} from './utils/complete-phone-insertion-preprocessor';\nimport {tuiCreatePhoneMaskExpression} from './utils/create-phone-mask-expression';\n\nconst MASK_SYMBOLS = /[ \\-_()]/g;\n\nfunction isText(value: string): boolean {\n return Number.isNaN(parseInt(value.replaceAll(MASK_SYMBOLS, ''), 10));\n}\n\n@Directive({\n selector: 'input[tuiInputPhone]',\n providers: [\n tuiAsControl(TuiInputPhoneDirective),\n tuiValueTransformerFrom(TUI_INPUT_PHONE_OPTIONS),\n ],\n hostDirectives: [TuiWithInput, MaskitoDirective],\n host: {\n type: 'tel',\n '[inputMode]': 'inputMode()',\n '[disabled]': 'disabled()',\n '(input)': 'onInput($event.target.value)',\n },\n})\nexport class TuiInputPhoneDirective extends TuiControl<string | null> {\n private readonly input = inject(TuiInputDirective);\n private readonly host: TuiTextfieldComponent<string> = inject(TuiTextfieldComponent);\n\n protected readonly options = inject(TUI_INPUT_PHONE_OPTIONS);\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly nonRemovablePrefix = computed(() => `${this.countryCode()} `);\n protected inputMode = computed(() => (this.allowText() ? 'text' : 'numeric'));\n protected readonly valueEffect = effect(() => {\n if (this.value()) {\n this.input.value.set(maskitoTransform(this.value() ?? '', this.maskito()));\n }\n });\n\n protected readonly blurEffect = effect(() => {\n const incomplete = untracked(() => !this.value());\n const prefix = incomplete && this.interactive() && !this.allowText();\n\n if (!this.host.focused() && incomplete) {\n this.input.value.set('');\n } else if (this.host.focused() && prefix) {\n this.input.value.set(this.nonRemovablePrefix());\n }\n });\n\n protected readonly countryCode = computed(() => extractCode(this.mask()));\n protected readonly phoneMask = computed(() => extractMask(this.mask()));\n protected readonly maskito = tuiMaskito(\n computed(() =>\n this.calculateMask(\n this.countryCode(),\n this.phoneMask(),\n this.nonRemovablePrefix(),\n this.allowText(),\n ),\n ),\n );\n\n public readonly allowText = input(this.options.allowText);\n public readonly mask = input(this.options.mask);\n\n protected onInput(value: string): void {\n if (!value && !this.allowText()) {\n this.input.value.set(this.nonRemovablePrefix());\n }\n\n const parsed = isText(value)\n ? value\n : value.replaceAll(MASK_SYMBOLS, '').slice(0, this.maxPhoneLength);\n\n this.onChange(parsed === this.countryCode() || isText(parsed) ? '' : parsed);\n }\n\n private get maxPhoneLength(): number {\n return (\n this.countryCode().length + this.phoneMask().replaceAll(/[^#]+/g, '').length\n );\n }\n\n private calculateMask(\n countryCode: string,\n phoneMaskAfterCountryCode: string,\n nonRemovablePrefix: string,\n allowText: boolean,\n ): MaskitoOptions {\n const mask = tuiCreatePhoneMaskExpression(countryCode, phoneMaskAfterCountryCode);\n const preprocessors = [\n tuiCreateCompletePhoneInsertionPreprocessor(\n countryCode,\n phoneMaskAfterCountryCode,\n ),\n ];\n\n return allowText\n ? {\n mask: ({value}) =>\n isText(value) && value !== '+'\n ? (MASKITO_DEFAULT_OPTIONS.mask as RegExp)\n : mask,\n preprocessors,\n }\n : {\n mask,\n preprocessors,\n postprocessors: [\n maskitoPrefixPostprocessorGenerator(nonRemovablePrefix),\n ],\n plugins: [\n maskitoCaretGuard((value, [from, to]) => [\n from === to ? nonRemovablePrefix.length : 0,\n value.length,\n ]),\n ],\n };\n }\n}\n\nfunction extractCode(mask: string): string {\n const match = /^(\\+\\d+)/.exec(mask);\n\n return match?.[1] || '';\n}\n\nfunction extractMask(mask: string): string {\n const match = /^\\+\\d+(.*)$/.exec(mask);\n\n return match?.[1]?.trim() || '';\n}\n","import {TuiLabel} from '@taiga-ui/core/components/label';\nimport {\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiDropdownContent} from '@taiga-ui/core/portals/dropdown';\n\nimport {TuiInputPhoneDirective} from './input-phone.directive';\n\nexport const TuiInputPhone = [\n TuiInputPhoneDirective,\n TuiLabel,\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n TuiDropdownContent,\n] as const;\n","/**\n * Generated b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uiTextfieldOptionsDirective } from '@taiga-ui/core/components/textfield';
3
+ import { TuiDropdownContent } from '@taiga-ui/core/portals/dropdown';
1
4
  import * as i0 from '@angular/core';
2
- import { signal, inject, computed, Input, ChangeDetectionStrategy, Component } from '@angular/core';
5
+ import { inject, computed, input, ChangeDetectionStrategy, Component } from '@angular/core';
3
6
  import { NgControl } from '@angular/forms';
4
7
  import * as i1 from '@maskito/angular';
5
8
  import { MaskitoDirective } from '@maskito/angular';
6
- import { TuiRepeatTimes } from '@taiga-ui/cdk/directives/repeat-times';
7
9
  import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
8
10
  import { tuiIsFocused } from '@taiga-ui/cdk/utils/focus';
9
11
  import { tuiIsString } from '@taiga-ui/cdk/utils/miscellaneous';
10
- import { TUI_TEXTFIELD_OPTIONS, TuiTextfieldContent } from '@taiga-ui/core/components/textfield';
11
12
  import { TuiAppearance } from '@taiga-ui/core/directives/appearance';
12
13
  import { tuiMaskito } from '@taiga-ui/kit/utils';
13
14
 
14
- class TuiInputPin {
15
+ class TuiInputPinComponent {
15
16
  constructor() {
16
17
  this.el = tuiInjectElement();
17
- this.mask = signal(/^\d+$/);
18
18
  this.appearance = inject(TUI_TEXTFIELD_OPTIONS).appearance;
19
19
  this.control = inject(NgControl);
20
- this.maskito = tuiMaskito(computed(() => ({
21
- mask: this.mask(),
22
- overwriteMode: 'replace',
23
- })));
24
- }
25
- set maskSetter(mask) {
26
- this.mask.set(tuiIsString(mask) ? new RegExp(mask) : mask);
20
+ this.maskito = tuiMaskito(computed(() => ({ mask: this.mask(), overwriteMode: 'replace' })));
21
+ this.mask = input(/^\d+$/, {
22
+ transform: (mask) => tuiIsString(mask) ? new RegExp(mask) : mask,
23
+ });
27
24
  }
28
25
  onClick(index) {
29
26
  this.el.focus();
@@ -46,27 +43,32 @@ class TuiInputPin {
46
43
  (this.el.selectionStart === this.el.maxLength &&
47
44
  index === this.el.maxLength - 1)));
48
45
  }
49
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputPin, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
50
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiInputPin, isStandalone: true, selector: "input[tuiInputPin]", inputs: { maskSetter: ["mask", "maskSetter"] }, host: { attributes: { "ngSkipHydration": "true", "inputmode": "numeric", "spellcheck": "false" }, listeners: { "pointerdown.prevent": "onClick(0)", "selectionchange": "onSelection()", "keydown.arrowLeft": "onArrow()" } }, hostDirectives: [{ directive: i1.MaskitoDirective }], ngImport: i0, template: "<div\n *tuiTextfieldContent\n class=\"t-wrapper\"\n>\n <label\n *tuiRepeatTimes=\"let index of el.maxLength\"\n class=\"t-item\"\n [tuiAppearance]=\"appearance()\"\n [tuiAppearanceFocus]=\"isFocused(index)\"\n [tuiAppearanceMode]=\"control.invalid && control.touched ? 'invalid' : null\"\n (pointerdown.prevent)=\"onClick(index)\"\n >\n <span\n class=\"t-value\"\n [class.t-value_filled]=\"el.value[index]\"\n [textContent]=\"el.value[index] || el.placeholder[index]\"\n ></span>\n </label>\n</div>\n", styles: ["@keyframes blink{50%{opacity:0}}:host{color:transparent;background:transparent;border:none;outline:none;--t-caret-color: rgba(255, 255, 255, .01);caret-color:var(--t-caret-color)}:host :host-context([tuiTheme=\"dark\"]){--t-caret-color: rgba(50, 50, 50, .01)}:host::selection{background:transparent}:host::placeholder{color:transparent!important}:host ::ng-deep+.t-content .t-clear{display:none!important}.t-wrapper{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;gap:inherit;border-radius:inherit}.t-item{display:flex;flex:1;align-items:center;justify-content:center;border-radius:inherit;pointer-events:auto;cursor:text}.t-item:first-child{pointer-events:none}.t-item[data-focus=true] .t-value_filled{background:var(--tui-service-selection-background)}.t-item[data-focus=true] .t-value_filled:before{display:none}.t-item[data-focus=true] .t-value:before{content:\"\";block-size:1em;border-inline-start:1px solid var(--tui-text-primary);animation:blink 1s steps(1) infinite}.t-value{color:var(--tui-text-tertiary)}.t-value_filled{color:var(--tui-text-primary)}\n"], dependencies: [{ kind: "directive", type: TuiAppearance, selector: "[tuiAppearance]", inputs: ["tuiAppearance", "tuiAppearanceState", "tuiAppearanceFocus", "tuiAppearanceMode"] }, { kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }, { kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
46
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputPinComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
47
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiInputPinComponent, isStandalone: true, selector: "input[tuiInputPin]", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "ngSkipHydration": "true", "inputmode": "numeric", "spellcheck": "false" }, listeners: { "pointerdown.prevent": "onClick(0)", "selectionchange": "onSelection()", "keydown.arrowLeft": "onArrow()" } }, hostDirectives: [{ directive: i1.MaskitoDirective }], ngImport: i0, template: "<div\n *tuiTextfieldContent\n class=\"t-wrapper\"\n>\n @for (_ of '-'.repeat(el.maxLength); track $index) {\n <label\n class=\"t-item\"\n [tuiAppearance]=\"appearance()\"\n [tuiAppearanceFocus]=\"isFocused($index)\"\n [tuiAppearanceMode]=\"control.invalid && control.touched ? 'invalid' : null\"\n (pointerdown.prevent)=\"onClick($index)\"\n >\n <span\n class=\"t-value\"\n [class.t-value_filled]=\"el.value[$index]\"\n [textContent]=\"el.value[$index] || el.placeholder[$index]\"\n ></span>\n </label>\n }\n</div>\n", styles: ["@keyframes blink{50%{opacity:0}}:host{position:absolute;inset:0;color:transparent;background:transparent;border:none;outline:none;--t-caret-color: rgba(255, 255, 255, .01);caret-color:var(--t-caret-color)}:host :host-context([tuiTheme=\"dark\"]){--t-caret-color: rgba(50, 50, 50, .01)}:host::selection{background:transparent}:host::placeholder{color:transparent!important}:host ::ng-deep+.t-content [tuiButtonX]{display:none!important}.t-wrapper{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;gap:inherit;border-radius:inherit}.t-item{display:flex;flex:1;align-items:center;justify-content:center;border-radius:inherit;pointer-events:auto;cursor:text}.t-item:first-child{pointer-events:none}.t-item[data-focus=true] .t-value_filled{background:var(--tui-service-selection-background)}.t-item[data-focus=true] .t-value_filled:before{display:none}.t-item[data-focus=true] .t-value:before{content:\"\";block-size:1em;border-inline-start:1px solid var(--tui-text-primary);animation:blink 1s steps(1) infinite}.t-value{color:var(--tui-text-tertiary)}.t-value_filled{color:var(--tui-text-primary)}\n"], dependencies: [{ kind: "directive", type: TuiAppearance, selector: "[tuiAppearance]", inputs: ["tuiAppearance", "tuiAppearanceState", "tuiAppearanceFocus", "tuiAppearanceMode"] }, { kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
51
48
  }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputPin, decorators: [{
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputPinComponent, decorators: [{
53
50
  type: Component,
54
- args: [{ selector: 'input[tuiInputPin]', imports: [TuiAppearance, TuiRepeatTimes, TuiTextfieldContent], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [MaskitoDirective], host: {
51
+ args: [{ selector: 'input[tuiInputPin]', imports: [TuiAppearance, TuiTextfieldContent], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [MaskitoDirective], host: {
55
52
  ngSkipHydration: 'true',
56
53
  inputmode: 'numeric',
57
54
  spellcheck: 'false',
58
55
  '(pointerdown.prevent)': 'onClick(0)',
59
56
  '(selectionchange)': 'onSelection()',
60
57
  '(keydown.arrowLeft)': 'onArrow()',
61
- }, template: "<div\n *tuiTextfieldContent\n class=\"t-wrapper\"\n>\n <label\n *tuiRepeatTimes=\"let index of el.maxLength\"\n class=\"t-item\"\n [tuiAppearance]=\"appearance()\"\n [tuiAppearanceFocus]=\"isFocused(index)\"\n [tuiAppearanceMode]=\"control.invalid && control.touched ? 'invalid' : null\"\n (pointerdown.prevent)=\"onClick(index)\"\n >\n <span\n class=\"t-value\"\n [class.t-value_filled]=\"el.value[index]\"\n [textContent]=\"el.value[index] || el.placeholder[index]\"\n ></span>\n </label>\n</div>\n", styles: ["@keyframes blink{50%{opacity:0}}:host{color:transparent;background:transparent;border:none;outline:none;--t-caret-color: rgba(255, 255, 255, .01);caret-color:var(--t-caret-color)}:host :host-context([tuiTheme=\"dark\"]){--t-caret-color: rgba(50, 50, 50, .01)}:host::selection{background:transparent}:host::placeholder{color:transparent!important}:host ::ng-deep+.t-content .t-clear{display:none!important}.t-wrapper{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;gap:inherit;border-radius:inherit}.t-item{display:flex;flex:1;align-items:center;justify-content:center;border-radius:inherit;pointer-events:auto;cursor:text}.t-item:first-child{pointer-events:none}.t-item[data-focus=true] .t-value_filled{background:var(--tui-service-selection-background)}.t-item[data-focus=true] .t-value_filled:before{display:none}.t-item[data-focus=true] .t-value:before{content:\"\";block-size:1em;border-inline-start:1px solid var(--tui-text-primary);animation:blink 1s steps(1) infinite}.t-value{color:var(--tui-text-tertiary)}.t-value_filled{color:var(--tui-text-primary)}\n"] }]
62
- }], propDecorators: { maskSetter: [{
63
- type: Input,
64
- args: ['mask']
65
- }] } });
58
+ }, template: "<div\n *tuiTextfieldContent\n class=\"t-wrapper\"\n>\n @for (_ of '-'.repeat(el.maxLength); track $index) {\n <label\n class=\"t-item\"\n [tuiAppearance]=\"appearance()\"\n [tuiAppearanceFocus]=\"isFocused($index)\"\n [tuiAppearanceMode]=\"control.invalid && control.touched ? 'invalid' : null\"\n (pointerdown.prevent)=\"onClick($index)\"\n >\n <span\n class=\"t-value\"\n [class.t-value_filled]=\"el.value[$index]\"\n [textContent]=\"el.value[$index] || el.placeholder[$index]\"\n ></span>\n </label>\n }\n</div>\n", styles: ["@keyframes blink{50%{opacity:0}}:host{position:absolute;inset:0;color:transparent;background:transparent;border:none;outline:none;--t-caret-color: rgba(255, 255, 255, .01);caret-color:var(--t-caret-color)}:host :host-context([tuiTheme=\"dark\"]){--t-caret-color: rgba(50, 50, 50, .01)}:host::selection{background:transparent}:host::placeholder{color:transparent!important}:host ::ng-deep+.t-content [tuiButtonX]{display:none!important}.t-wrapper{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;gap:inherit;border-radius:inherit}.t-item{display:flex;flex:1;align-items:center;justify-content:center;border-radius:inherit;pointer-events:auto;cursor:text}.t-item:first-child{pointer-events:none}.t-item[data-focus=true] .t-value_filled{background:var(--tui-service-selection-background)}.t-item[data-focus=true] .t-value_filled:before{display:none}.t-item[data-focus=true] .t-value:before{content:\"\";block-size:1em;border-inline-start:1px solid var(--tui-text-primary);animation:blink 1s steps(1) infinite}.t-value{color:var(--tui-text-tertiary)}.t-value_filled{color:var(--tui-text-primary)}\n"] }]
59
+ }] });
60
+
61
+ const TuiInputPin = [
62
+ TuiInputPinComponent,
63
+ TuiLabel,
64
+ TuiTextfieldComponent,
65
+ TuiTextfieldOptionsDirective,
66
+ TuiDropdownContent,
67
+ ];
66
68
 
67
69
  /**
68
70
  * Generated bundle index. Do not edit.
69
71
  */
70
72
 
71
- export { TuiInputPin };
73
+ export { TuiInputPin, TuiInputPinComponent };
72
74
  //# sourceMappingURL=taiga-ui-kit-components-input-pin.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-input-pin.mjs","sources":["../../../projects/kit/components/input-pin/input-pin.component.ts","../../../projects/kit/components/input-pin/input-pin.template.html","../../../projects/kit/components/input-pin/taiga-ui-kit-components-input-pin.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Input,\n signal,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {type MaskitoMask} from '@maskito/core';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TUI_TEXTFIELD_OPTIONS,\n TuiTextfieldContent,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiAppearance} from '@taiga-ui/core/directives/appearance';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\n@Component({\n selector: 'input[tuiInputPin]',\n imports: [TuiAppearance, TuiRepeatTimes, TuiTextfieldContent],\n templateUrl: './input-pin.template.html',\n styleUrl: './input-pin.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [MaskitoDirective],\n host: {\n ngSkipHydration: 'true',\n inputmode: 'numeric',\n spellcheck: 'false',\n '(pointerdown.prevent)': 'onClick(0)',\n '(selectionchange)': 'onSelection()',\n '(keydown.arrowLeft)': 'onArrow()',\n },\n})\nexport class TuiInputPin {\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly mask = signal<MaskitoMask>(/^\\d+$/);\n protected readonly appearance = inject(TUI_TEXTFIELD_OPTIONS).appearance;\n protected readonly control = inject(NgControl);\n\n protected readonly maskito = tuiMaskito(\n computed(() => ({\n mask: this.mask(),\n overwriteMode: 'replace',\n })),\n );\n\n @Input('mask')\n public set maskSetter(mask: MaskitoMask | string) {\n this.mask.set(tuiIsString(mask) ? new RegExp(mask) : mask);\n }\n\n public onClick(index: number): void {\n this.el.focus();\n this.el.setSelectionRange(index, index + 1);\n }\n\n public onSelection(): void {\n if (this.el.selectionStart === this.el.maxLength) {\n this.el.setSelectionRange(this.el.maxLength - 1, this.el.maxLength);\n }\n }\n\n public onArrow(): void {\n if (\n this.el.selectionStart === this.el.maxLength - 1 &&\n this.el.selectionEnd === this.el.maxLength\n ) {\n this.el.setSelectionRange(this.el.maxLength - 2, this.el.maxLength - 2);\n }\n }\n\n public isFocused(index: number): boolean {\n return (\n tuiIsFocused(this.el) &&\n (this.el.selectionStart === index ||\n (this.el.selectionStart === this.el.maxLength &&\n index === this.el.maxLength - 1))\n );\n }\n}\n","<div\n *tuiTextfieldContent\n class=\"t-wrapper\"\n>\n <label\n *tuiRepeatTimes=\"let index of el.maxLength\"\n class=\"t-item\"\n [tuiAppearance]=\"appearance()\"\n [tuiAppearanceFocus]=\"isFocused(index)\"\n [tuiAppearanceMode]=\"control.invalid && control.touched ? 'invalid' : null\"\n (pointerdown.prevent)=\"onClick(index)\"\n >\n <span\n class=\"t-value\"\n [class.t-value_filled]=\"el.value[index]\"\n [textContent]=\"el.value[index] || el.placeholder[index]\"\n ></span>\n </label>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAsCa,WAAW,CAAA;AAhBxB,IAAA,WAAA,GAAA;QAiBuB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAoB;AACzC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAc,OAAO,CAAC;AACnC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,UAAU;AACrD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC;QAE3B,IAAO,CAAA,OAAA,GAAG,UAAU,CACnC,QAAQ,CAAC,OAAO;AACZ,YAAA,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;AACjB,YAAA,aAAa,EAAE,SAAS;SAC3B,CAAC,CAAC,CACN;AAmCJ;IAjCG,IACW,UAAU,CAAC,IA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iga-ui-kit-components-input-pin.mjs","sources":["../../../projects/kit/components/input-pin/input-pin.component.ts","../../../projects/kit/components/input-pin/input-pin.template.html","../../../projects/kit/components/input-pin/input-pin.ts","../../../projects/kit/components/input-pin/taiga-ui-kit-components-input-pin.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, computed, inject, input} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {type MaskitoMask} from '@maskito/core';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TUI_TEXTFIELD_OPTIONS,\n TuiTextfieldContent,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiAppearance} from '@taiga-ui/core/directives/appearance';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\n@Component({\n selector: 'input[tuiInputPin]',\n imports: [TuiAppearance, TuiTextfieldContent],\n templateUrl: './input-pin.template.html',\n styleUrl: './input-pin.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [MaskitoDirective],\n host: {\n ngSkipHydration: 'true',\n inputmode: 'numeric',\n spellcheck: 'false',\n '(pointerdown.prevent)': 'onClick(0)',\n '(selectionchange)': 'onSelection()',\n '(keydown.arrowLeft)': 'onArrow()',\n },\n})\nexport class TuiInputPinComponent {\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly appearance = inject(TUI_TEXTFIELD_OPTIONS).appearance;\n protected readonly control = inject(NgControl);\n protected readonly maskito = tuiMaskito(\n computed(() => ({mask: this.mask(), overwriteMode: 'replace'})),\n );\n\n public readonly mask = input(/^\\d+$/, {\n transform: (mask: MaskitoMask | string): MaskitoMask =>\n tuiIsString(mask) ? new RegExp(mask) : mask,\n });\n\n public onClick(index: number): void {\n this.el.focus();\n this.el.setSelectionRange(index, index + 1);\n }\n\n public onSelection(): void {\n if (this.el.selectionStart === this.el.maxLength) {\n this.el.setSelectionRange(this.el.maxLength - 1, this.el.maxLength);\n }\n }\n\n public onArrow(): void {\n if (\n this.el.selectionStart === this.el.maxLength - 1 &&\n this.el.selectionEnd === this.el.maxLength\n ) {\n this.el.setSelectionRange(this.el.maxLength - 2, this.el.maxLength - 2);\n }\n }\n\n public isFocused(index: number): boolean {\n return (\n tuiIsFocused(this.el) &&\n (this.el.selectionStart === index ||\n (this.el.selectionStart === this.el.maxLength &&\n index === this.el.maxLength - 1))\n );\n }\n}\n","<div\n *tuiTextfieldContent\n class=\"t-wrapper\"\n>\n @for (_ of '-'.repeat(el.maxLength); track $index) {\n <label\n class=\"t-item\"\n [tuiAppearance]=\"appearance()\"\n [tuiAppearanceFocus]=\"isFocused($index)\"\n [tuiAppearanceMode]=\"control.invalid && control.touched ? 'invalid' : null\"\n (pointerdown.prevent)=\"onClick($index)\"\n >\n <span\n class=\"t-value\"\n [class.t-value_filled]=\"el.value[$index]\"\n [textContent]=\"el.value[$index] || el.placeholder[$index]\"\n ></span>\n </label>\n }\n</div>\n","import {TuiLabel} from '@taiga-ui/core/components/label';\nimport {\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiDropdownContent} from '@taiga-ui/core/portals/dropdown';\n\nimport {TuiInputPinComponent} from './input-pin.component';\n\nexport const TuiInputPin = [\n TuiInputPinComponent,\n TuiLabel,\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n TuiDropdownContent,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MA8Ba,oBAAoB,CAAA;AAhBjC,IAAA,WAAA,GAAA;QAiBuB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAoB;AACzC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,UAAU;AACrD,QAAA,IAAA,CAAA,OAAO,GAAG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;4FAcnC,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAhBhC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EACrB,OAAA,EAAA,CAAC,aAAa,EAAE,mBAAmB,CAAC,EAAA,eAAA,EAG5B,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/B,CAAC,gBAAgB,CAAC,EAC5B,IAAA,EAAA;AACF,wBAAA,eAAe,EAAE,MAAM;AACvB,wBAAA,SAAS,EAAE,SAAS;AACpB,wBAAA,UAAU,EAAE,OAAO;AACnB,wBAAA,uBAAuB,EAAE,YAAY;AACrC,wBAAA,mBAAmB,EAAE,eAAe;AACpC,wBAAA,qBAAqB,EAAE,WAAW;AACrC,qBAAA,EAAA,QAAA,EAAA,iqBAAA,EAAA,MAAA,EAAA,CAAA,omCAAA,CAAA,EAAA;;;AEnBQ,MAAA,WAAW,GAAG;IACvB,oBAAoB;IACpB,QAAQ;IACR,qBAAqB;IACrB,4BAA4B;IAC5B,kBAAkB;;;ACdtB;;AAEG;;;;"}
@@ -1,32 +1,34 @@
1
- import { TuiLabel } from '@taiga-ui/core/components/label';
2
1
  import * as i0 from '@angular/core';
3
- import { inject, signal, computed, input, ElementRef, Input, ViewChild, ViewChildren, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { viewChildren, ElementRef, viewChild, inject, computed, input, ChangeDetectionStrategy, Component } from '@angular/core';
4
3
  import * as i1 from '@angular/forms';
5
4
  import { FormsModule } from '@angular/forms';
6
5
  import { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
7
- import { EMPTY_QUERY, CHAR_NO_BREAK_SPACE, CHAR_EN_DASH } from '@taiga-ui/cdk/constants';
6
+ import { CHAR_NO_BREAK_SPACE, CHAR_EN_DASH } from '@taiga-ui/cdk/constants';
8
7
  import { TUI_IS_MOBILE, tuiFallbackValueProvider } from '@taiga-ui/cdk/tokens';
9
8
  import { tuiIsFocused } from '@taiga-ui/cdk/utils/focus';
10
9
  import { tuiIsString, tuiIsNumber } from '@taiga-ui/cdk/utils/miscellaneous';
11
- import * as i3 from '@taiga-ui/core/components/textfield';
10
+ import * as i4 from '@taiga-ui/core/components/textfield';
12
11
  import { TUI_TEXTFIELD_OPTIONS, TuiTextfield } from '@taiga-ui/core/components/textfield';
13
12
  import * as i2 from '@taiga-ui/kit/components/input-number';
14
- import { TuiQuantumValueTransformerBase, TuiInputNumberDirective, TuiInputNumber } from '@taiga-ui/kit/components/input-number';
13
+ import { TuiInputNumberDirective, TUI_INPUT_NUMBER_OPTIONS, TuiQuantumValueTransformerBase, TuiInputNumber } from '@taiga-ui/kit/components/input-number';
15
14
  import { TuiRange } from '@taiga-ui/kit/components/range';
16
15
  import { tuiSliderOptionsProvider } from '@taiga-ui/kit/components/slider';
17
16
  import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
17
+ import * as i3 from '@taiga-ui/core/components/label';
18
18
 
19
- class TuiInputRangeComponent extends TuiControl {
19
+ const transform = (x) => x ?? ['', ''];
20
+ class TuiInputRange extends TuiControl {
20
21
  constructor() {
21
22
  super(...arguments);
22
- this.inputNumberRefs = EMPTY_QUERY;
23
+ this.inputs = viewChildren(TuiInputNumberDirective, { read: ElementRef });
24
+ this.range = viewChild(TuiRange);
25
+ this.options = inject(TUI_INPUT_NUMBER_OPTIONS);
23
26
  this.isMobile = inject(TUI_IS_MOBILE);
24
- this.quantum = signal(0);
25
27
  this.quantumTransformer = computed(() => new TuiQuantumValueTransformerBase(this.quantum()));
26
28
  this.size = inject(TUI_TEXTFIELD_OPTIONS).size;
27
- this.textfieldValueStart = this.value()[0];
28
- this.textfieldValueEnd = this.value()[1];
29
- this.lastActiveSide = 'start';
29
+ this.start = this.value()[0];
30
+ this.end = this.value()[1];
31
+ this.side = 'start';
30
32
  this.contentStart = computed(() => {
31
33
  const [start, end] = this.content().map((x, i) => {
32
34
  const value = this.value()[i];
@@ -38,19 +40,20 @@ class TuiInputRangeComponent extends TuiControl {
38
40
  return `${start}${CHAR_NO_BREAK_SPACE}${CHAR_EN_DASH}${CHAR_NO_BREAK_SPACE}${end}`;
39
41
  });
40
42
  this.contentEnd = computed(() => this.contentStart() === this.content()[0] ? this.content()[1] : '');
41
- this.min = 0;
42
- this.max = 100;
43
- this.step = 1;
44
- this.segments = 1;
45
- this.keySteps = null;
46
- this.prefix = ['', ''];
47
- this.postfix = ['', ''];
43
+ this.min = input(0);
44
+ this.max = input(100);
45
+ this.step = input(1);
46
+ this.segments = input(1);
47
+ this.keySteps = input();
48
+ this.quantum = input(0);
49
+ this.prefix = input([this.options.prefix, this.options.prefix], {
50
+ transform,
51
+ });
52
+ this.postfix = input([this.options.postfix, this.options.postfix], {
53
+ transform,
54
+ });
48
55
  this.content = input(['', '']);
49
56
  }
50
- // TODO(v5): use signal inputs
51
- set quantumSetter(x) {
52
- this.quantum.set(x);
53
- }
54
57
  writeValue(value) {
55
58
  super.writeValue(value);
56
59
  this.setTextfieldValues(this.value());
@@ -62,19 +65,18 @@ class TuiInputRangeComponent extends TuiControl {
62
65
  return (!this.content()[1] || (this.interactive() && tuiIsFocused(this.textfieldEnd)));
63
66
  }
64
67
  takeStep(event, coefficients) {
65
- if (!this.interactive() || !this.range) {
68
+ if (!this.interactive() || !this.range()) {
66
69
  return;
67
70
  }
68
71
  event.preventDefault();
69
72
  const [start, end] = this.value();
70
- const newValue = this.valueGuard(this.range.takeStep(coefficients));
73
+ const newValue = this.valueGuard(this.range().takeStep(coefficients));
71
74
  if (newValue[0] !== start || newValue[1] !== end) {
72
75
  this.onExternalValueUpdate(newValue);
73
76
  }
74
77
  }
75
78
  onInput([start, end]) {
76
- const [prevStart, prevEnd] = this.value();
77
- this.setValue([start ?? prevStart, end ?? prevEnd]);
79
+ this.setValue([start ?? this.value()[0], end ?? this.value()[1]]);
78
80
  }
79
81
  onExternalValueUpdate(value) {
80
82
  this.setValue(value);
@@ -91,17 +93,17 @@ class TuiInputRangeComponent extends TuiControl {
91
93
  }
92
94
  }
93
95
  setTextfieldValues([start, end]) {
94
- this.textfieldValueStart = start;
95
- this.textfieldValueEnd = end;
96
+ this.start = start;
97
+ this.end = end;
96
98
  }
97
99
  get textfieldStart() {
98
- return this.inputNumberRefs.first?.nativeElement || null;
100
+ return this.inputs()[0]?.nativeElement || null;
99
101
  }
100
102
  get textfieldEnd() {
101
- return this.inputNumberRefs.last?.nativeElement || null;
103
+ return this.inputs()[this.inputs().length - 1]?.nativeElement || null;
102
104
  }
103
105
  get activeTextfield() {
104
- return this.lastActiveSide === 'start' ? this.textfieldStart : this.textfieldEnd;
106
+ return this.side === 'start' ? this.textfieldStart : this.textfieldEnd;
105
107
  }
106
108
  setValue(value) {
107
109
  this.onChange(this.valueGuard(value));
@@ -114,58 +116,29 @@ class TuiInputRangeComponent extends TuiControl {
114
116
  isPrimitive(x) {
115
117
  return !x || tuiIsString(x) || tuiIsNumber(x);
116
118
  }
117
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputRangeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
118
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiInputRangeComponent, isStandalone: true, selector: "tui-input-range", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: false, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: false, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: false, isRequired: false, transformFunction: null }, segments: { classPropertyName: "segments", publicName: "segments", isSignal: false, isRequired: false, transformFunction: null }, keySteps: { classPropertyName: "keySteps", publicName: "keySteps", isSignal: false, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: false, isRequired: false, transformFunction: (x) => x ?? ['', ''] }, postfix: { classPropertyName: "postfix", publicName: "postfix", isSignal: false, isRequired: false, transformFunction: (x) => x ?? ['', ''] }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, quantumSetter: { classPropertyName: "quantumSetter", publicName: "quantum", isSignal: false, isRequired: false, transformFunction: null } }, host: { attributes: { "new": "" }, properties: { "attr.data-size": "size()", "style.--t-icon-lock": "contentEnd() ? \"none\" : null" } }, providers: [
119
- tuiAsControl(TuiInputRangeComponent),
119
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputRange, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
120
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiInputRange, isStandalone: true, selector: "tui-input-range", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, segments: { classPropertyName: "segments", publicName: "segments", isSignal: true, isRequired: false, transformFunction: null }, keySteps: { classPropertyName: "keySteps", publicName: "keySteps", isSignal: true, isRequired: false, transformFunction: null }, quantum: { classPropertyName: "quantum", publicName: "quantum", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, postfix: { classPropertyName: "postfix", publicName: "postfix", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-size": "size()", "style.--t-icon-lock": "contentEnd() ? \"none\" : null" } }, providers: [
121
+ tuiAsControl(TuiInputRange),
120
122
  tuiSliderOptionsProvider({ trackColor: 'transparent' }),
121
123
  tuiFallbackValueProvider([0, 0]),
122
- ], viewQueries: [{ propertyName: "range", first: true, predicate: TuiRange, descendants: true }, { propertyName: "inputNumberRefs", predicate: TuiInputNumberDirective, descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<tui-textfield [content]=\"contentStartHidden ? '' : contentStart()\">\n <ng-container ngProjectAs=\"label\">\n <ng-content select=\"label\" />\n </ng-container>\n\n <input\n tuiInputNumber\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [max]=\"value()[1]\"\n [min]=\"min\"\n [postfix]=\"postfix[0]\"\n [prefix]=\"prefix[0]\"\n [readOnly]=\"readOnly()\"\n [(ngModel)]=\"textfieldValueStart\"\n (blur)=\"textfieldValueStart = value()[0]\"\n (keydown.arrowDown)=\"takeStep($event, [-1, 0])\"\n (keydown.arrowUp)=\"takeStep($event, [1, 0])\"\n (ngModelChange)=\"onInput([$event, null])\"\n />\n\n <input\n tuiInputNumber\n tuiTextfieldAppearance=\"none\"\n class=\"t-end\"\n [class._hidden]=\"!contentEndHidden || !this.interactive()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [max]=\"max\"\n [min]=\"value()[0]\"\n [postfix]=\"postfix[1]\"\n [prefix]=\"prefix[1]\"\n [readOnly]=\"readOnly()\"\n [(ngModel)]=\"textfieldValueEnd\"\n (blur)=\"textfieldValueEnd = value()[1]\"\n (keydown.arrowDown)=\"takeStep($event, [0, -1])\"\n (keydown.arrowUp)=\"takeStep($event, [0, 1])\"\n (ngModelChange)=\"onInput([null, $event])\"\n />\n\n @if (!contentEndHidden && contentEnd()) {\n <div class=\"t-content-end\">\n <ng-container *polymorpheusOutlet=\"contentEnd() as text; context: {$implicit: value()[1]}\">\n {{ text }}\n </ng-container>\n </div>\n }\n</tui-textfield>\n\n@if (interactive()) {\n <tui-range\n [focusable]=\"false\"\n [keySteps]=\"keySteps\"\n [max]=\"max\"\n [min]=\"min\"\n [ngModel]=\"value()\"\n [segments]=\"segments\"\n [step]=\"step\"\n (activeThumbChange)=\"lastActiveSide = $event\"\n (mousedown.prevent)=\"focusToTextfield()\"\n (ngModelChange)=\"onExternalValueUpdate($event)\"\n />\n}\n", styles: [":host{position:relative;display:block}.t-end{position:absolute;top:0;bottom:0;right:0;left:50%;display:flex;inline-size:50%;text-align:end;outline:none!important;border:none;padding-inline-end:var(--t-padding);color:var(--tui-text-primary);transition:none}.t-end:dir(rtl){right:unset;inset-inline-end:0}.t-content-end{color:var(--tui-text-primary)}tui-textfield:has(label:not(:empty)) .t-content-end{padding-block-start:calc(var(--t-height) / 3)}tui-textfield._with-label .t-content-end{padding-block-start:calc(var(--t-height) / 3)}._hidden._hidden{opacity:0}tui-range{position:absolute;top:100%;left:1rem;right:1rem;z-index:1;margin:calc(-1 * var(--tui-thickness)) 0 0}:host[data-size=m] tui-range{right:.75rem;left:.75rem}:host[data-size=s] tui-range{right:.625rem;left:.625rem}tui-textfield::ng-deep .t-clear{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: i2.TuiInputNumberDirective, selector: "input[tuiInputNumber]", inputs: ["prefix", "postfix", "min", "max"] }, { kind: "component", type: TuiRange, selector: "tui-range", inputs: ["min", "max", "step", "size", "segments", "keySteps", "focusable", "margin", "limit"] }, { kind: "component", type: i3.TuiTextfieldComponent, selector: "tui-textfield:not([multi])" }, { kind: "directive", type: i3.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
124
+ ], viewQueries: [{ propertyName: "inputs", predicate: TuiInputNumberDirective, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "range", first: true, predicate: TuiRange, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<tui-textfield [content]=\"contentStartHidden ? '' : contentStart()\">\n <label tuiLabel>\n <ng-content />\n </label>\n\n <input\n tuiInputNumber\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [max]=\"value()[1]\"\n [min]=\"min()\"\n [postfix]=\"postfix()[0]\"\n [prefix]=\"prefix()[0]\"\n [readOnly]=\"readOnly()\"\n [(ngModel)]=\"start\"\n (blur)=\"start = value()[0]\"\n (keydown.arrowDown)=\"takeStep($event, [-1, 0])\"\n (keydown.arrowUp)=\"takeStep($event, [1, 0])\"\n (ngModelChange)=\"onInput([$event, null])\"\n />\n\n <input\n tuiInputNumber\n class=\"t-end\"\n [class._hidden]=\"!contentEndHidden || !this.interactive()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [max]=\"max()\"\n [min]=\"value()[0]\"\n [postfix]=\"postfix()[1]\"\n [prefix]=\"prefix()[1]\"\n [readOnly]=\"readOnly()\"\n [(ngModel)]=\"end\"\n (blur)=\"end = value()[1]\"\n (keydown.arrowDown)=\"takeStep($event, [0, -1])\"\n (keydown.arrowUp)=\"takeStep($event, [0, 1])\"\n (ngModelChange)=\"onInput([null, $event])\"\n />\n\n @if (!contentEndHidden && contentEnd()) {\n <div class=\"t-content-end\">\n <ng-container *polymorpheusOutlet=\"contentEnd() as text; context: {$implicit: value()[1]}\">\n {{ text }}\n </ng-container>\n </div>\n }\n\n @if (interactive()) {\n <tui-range\n [focusable]=\"false\"\n [keySteps]=\"keySteps()\"\n [max]=\"max()\"\n [min]=\"min()\"\n [ngModel]=\"value()\"\n [segments]=\"segments()\"\n [step]=\"step()\"\n (activeThumbChange)=\"side = $event\"\n (ngModelChange)=\"onExternalValueUpdate($event)\"\n (pointerdown.prevent.stop)=\"focusToTextfield()\"\n />\n }\n</tui-textfield>\n", styles: [":host{position:relative;display:block}:host-context([tuiTable]){block-size:100%}.t-end{inset-inline:auto 0;inline-size:50%;text-align:end;padding-inline-start:0}.t-content-end{color:var(--tui-text-primary)}tui-textfield._with-label .t-content-end{padding-block-start:calc(var(--t-height) / 3)}._hidden._hidden{opacity:0}tui-range{position:absolute;z-index:1;inset:100% var(--t-padding) auto;margin:calc(-1 * var(--tui-thickness)) 0 0;pointer-events:auto}tui-textfield::ng-deep [tuiButtonX]{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: i2.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "directive", type: i3.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i4.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "component", type: TuiRange, selector: "tui-range", inputs: ["min", "max", "step", "size", "segments", "keySteps", "focusable", "margin", "limit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
123
125
  }
124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputRangeComponent, decorators: [{
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputRange, decorators: [{
125
127
  type: Component,
126
128
  args: [{ selector: 'tui-input-range', imports: [FormsModule, PolymorpheusOutlet, TuiInputNumber, TuiRange, TuiTextfield], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
127
- tuiAsControl(TuiInputRangeComponent),
129
+ tuiAsControl(TuiInputRange),
128
130
  tuiSliderOptionsProvider({ trackColor: 'transparent' }),
129
131
  tuiFallbackValueProvider([0, 0]),
130
132
  ], host: {
131
- new: '', // TODO(v5): remove after deletion of legacy control
132
- // TODO: use css :host:has(tui-textfield[data-size]) after browser bump
133
133
  '[attr.data-size]': 'size()',
134
134
  // TODO: Delete this line and put `tui-input-range:has(.t-content-end) {--t-icon-lock: none}` to proprietary styles
135
135
  '[style.--t-icon-lock]': 'contentEnd() ? "none" : null',
136
- }, template: "<tui-textfield [content]=\"contentStartHidden ? '' : contentStart()\">\n <ng-container ngProjectAs=\"label\">\n <ng-content select=\"label\" />\n </ng-container>\n\n <input\n tuiInputNumber\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [max]=\"value()[1]\"\n [min]=\"min\"\n [postfix]=\"postfix[0]\"\n [prefix]=\"prefix[0]\"\n [readOnly]=\"readOnly()\"\n [(ngModel)]=\"textfieldValueStart\"\n (blur)=\"textfieldValueStart = value()[0]\"\n (keydown.arrowDown)=\"takeStep($event, [-1, 0])\"\n (keydown.arrowUp)=\"takeStep($event, [1, 0])\"\n (ngModelChange)=\"onInput([$event, null])\"\n />\n\n <input\n tuiInputNumber\n tuiTextfieldAppearance=\"none\"\n class=\"t-end\"\n [class._hidden]=\"!contentEndHidden || !this.interactive()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [max]=\"max\"\n [min]=\"value()[0]\"\n [postfix]=\"postfix[1]\"\n [prefix]=\"prefix[1]\"\n [readOnly]=\"readOnly()\"\n [(ngModel)]=\"textfieldValueEnd\"\n (blur)=\"textfieldValueEnd = value()[1]\"\n (keydown.arrowDown)=\"takeStep($event, [0, -1])\"\n (keydown.arrowUp)=\"takeStep($event, [0, 1])\"\n (ngModelChange)=\"onInput([null, $event])\"\n />\n\n @if (!contentEndHidden && contentEnd()) {\n <div class=\"t-content-end\">\n <ng-container *polymorpheusOutlet=\"contentEnd() as text; context: {$implicit: value()[1]}\">\n {{ text }}\n </ng-container>\n </div>\n }\n</tui-textfield>\n\n@if (interactive()) {\n <tui-range\n [focusable]=\"false\"\n [keySteps]=\"keySteps\"\n [max]=\"max\"\n [min]=\"min\"\n [ngModel]=\"value()\"\n [segments]=\"segments\"\n [step]=\"step\"\n (activeThumbChange)=\"lastActiveSide = $event\"\n (mousedown.prevent)=\"focusToTextfield()\"\n (ngModelChange)=\"onExternalValueUpdate($event)\"\n />\n}\n", styles: [":host{position:relative;display:block}.t-end{position:absolute;top:0;bottom:0;right:0;left:50%;display:flex;inline-size:50%;text-align:end;outline:none!important;border:none;padding-inline-end:var(--t-padding);color:var(--tui-text-primary);transition:none}.t-end:dir(rtl){right:unset;inset-inline-end:0}.t-content-end{color:var(--tui-text-primary)}tui-textfield:has(label:not(:empty)) .t-content-end{padding-block-start:calc(var(--t-height) / 3)}tui-textfield._with-label .t-content-end{padding-block-start:calc(var(--t-height) / 3)}._hidden._hidden{opacity:0}tui-range{position:absolute;top:100%;left:1rem;right:1rem;z-index:1;margin:calc(-1 * var(--tui-thickness)) 0 0}:host[data-size=m] tui-range{right:.75rem;left:.75rem}:host[data-size=s] tui-range{right:.625rem;left:.625rem}tui-textfield::ng-deep .t-clear{display:none!important}\n"] }]
137
- }], propDecorators: { inputNumberRefs: [{
138
- type: ViewChildren,
139
- args: [TuiInputNumberDirective, { read: ElementRef }]
140
- }], range: [{
141
- type: ViewChild,
142
- args: [TuiRange]
143
- }], min: [{
144
- type: Input
145
- }], max: [{
146
- type: Input
147
- }], step: [{
148
- type: Input
149
- }], segments: [{
150
- type: Input
151
- }], keySteps: [{
152
- type: Input
153
- }], prefix: [{
154
- type: Input,
155
- args: [{ transform: (x) => x ?? ['', ''] }]
156
- }], postfix: [{
157
- type: Input,
158
- args: [{ transform: (x) => x ?? ['', ''] }]
159
- }], quantumSetter: [{
160
- type: Input,
161
- args: ['quantum']
162
- }] } });
163
-
164
- const TuiInputRange = [TuiInputRangeComponent, TuiLabel];
136
+ }, template: "<tui-textfield [content]=\"contentStartHidden ? '' : contentStart()\">\n <label tuiLabel>\n <ng-content />\n </label>\n\n <input\n tuiInputNumber\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [max]=\"value()[1]\"\n [min]=\"min()\"\n [postfix]=\"postfix()[0]\"\n [prefix]=\"prefix()[0]\"\n [readOnly]=\"readOnly()\"\n [(ngModel)]=\"start\"\n (blur)=\"start = value()[0]\"\n (keydown.arrowDown)=\"takeStep($event, [-1, 0])\"\n (keydown.arrowUp)=\"takeStep($event, [1, 0])\"\n (ngModelChange)=\"onInput([$event, null])\"\n />\n\n <input\n tuiInputNumber\n class=\"t-end\"\n [class._hidden]=\"!contentEndHidden || !this.interactive()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [max]=\"max()\"\n [min]=\"value()[0]\"\n [postfix]=\"postfix()[1]\"\n [prefix]=\"prefix()[1]\"\n [readOnly]=\"readOnly()\"\n [(ngModel)]=\"end\"\n (blur)=\"end = value()[1]\"\n (keydown.arrowDown)=\"takeStep($event, [0, -1])\"\n (keydown.arrowUp)=\"takeStep($event, [0, 1])\"\n (ngModelChange)=\"onInput([null, $event])\"\n />\n\n @if (!contentEndHidden && contentEnd()) {\n <div class=\"t-content-end\">\n <ng-container *polymorpheusOutlet=\"contentEnd() as text; context: {$implicit: value()[1]}\">\n {{ text }}\n </ng-container>\n </div>\n }\n\n @if (interactive()) {\n <tui-range\n [focusable]=\"false\"\n [keySteps]=\"keySteps()\"\n [max]=\"max()\"\n [min]=\"min()\"\n [ngModel]=\"value()\"\n [segments]=\"segments()\"\n [step]=\"step()\"\n (activeThumbChange)=\"side = $event\"\n (ngModelChange)=\"onExternalValueUpdate($event)\"\n (pointerdown.prevent.stop)=\"focusToTextfield()\"\n />\n }\n</tui-textfield>\n", styles: [":host{position:relative;display:block}:host-context([tuiTable]){block-size:100%}.t-end{inset-inline:auto 0;inline-size:50%;text-align:end;padding-inline-start:0}.t-content-end{color:var(--tui-text-primary)}tui-textfield._with-label .t-content-end{padding-block-start:calc(var(--t-height) / 3)}._hidden._hidden{opacity:0}tui-range{position:absolute;z-index:1;inset:100% var(--t-padding) auto;margin:calc(-1 * var(--tui-thickness)) 0 0;pointer-events:auto}tui-textfield::ng-deep [tuiButtonX]{display:none!important}\n"] }]
137
+ }] });
165
138
 
166
139
  /**
167
140
  * Generated bundle index. Do not edit.
168
141
  */
169
142
 
170
- export { TuiInputRange, TuiInputRangeComponent };
143
+ export { TuiInputRange };
171
144
  //# sourceMappingURL=taiga-ui-kit-components-input-range.mjs.map