@taiga-ui/kit 4.52.0-canary.1ea42f6 → 4.52.0-canary.217a686

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 (443) hide show
  1. package/README.md +1 -1
  2. package/components/accordion/accordion.component.d.ts +13 -0
  3. package/components/accordion/accordion.d.ts +4 -4
  4. package/components/accordion/accordion.directive.d.ts +11 -10
  5. package/components/accordion/index.d.ts +1 -3
  6. package/components/action-bar/action-bar.component.d.ts +5 -7
  7. package/components/action-bar/index.d.ts +0 -2
  8. package/components/avatar/avatar-labeled.component.d.ts +3 -3
  9. package/components/avatar/avatar-stack.component.d.ts +2 -2
  10. package/components/badge/badge.options.d.ts +1 -3
  11. package/components/badge-notification/badge-notification.component.d.ts +2 -3
  12. package/components/badge-notification/badge-notification.options.d.ts +1 -3
  13. package/components/badged-content/badged-content.directive.d.ts +2 -2
  14. package/components/block/block.options.d.ts +1 -3
  15. package/components/breadcrumbs/breadcrumbs.component.d.ts +6 -7
  16. package/components/breadcrumbs/breadcrumbs.options.d.ts +1 -3
  17. package/components/button-loading/button-loading.component.d.ts +5 -5
  18. package/components/calendar-month/calendar-month.component.d.ts +1 -1
  19. package/components/calendar-range/calendar-range.component.d.ts +1 -3
  20. package/components/calendar-range/day-range-period.d.ts +2 -1
  21. package/components/carousel/carousel.component.d.ts +15 -18
  22. package/components/carousel/carousel.directive.d.ts +5 -4
  23. package/components/chip/chip.options.d.ts +1 -3
  24. package/components/combo-box/combo-box.d.ts +5 -0
  25. package/components/combo-box/combo-box.directive.d.ts +7 -9
  26. package/components/combo-box/index.d.ts +1 -0
  27. package/components/compass/compass.component.d.ts +2 -2
  28. package/components/confirm/confirm.component.d.ts +5 -4
  29. package/components/confirm/confirm.service.d.ts +1 -1
  30. package/components/copy/copy.component.d.ts +4 -5
  31. package/components/copy/copy.directive.d.ts +3 -4
  32. package/components/data-list-wrapper/data-list-group-wrapper.component.d.ts +4 -2
  33. package/components/data-list-wrapper/data-list-wrapper.component.d.ts +14 -22
  34. package/components/data-list-wrapper/{data-list-wrapper.module.d.ts → data-list-wrapper.d.ts} +1 -2
  35. package/components/data-list-wrapper/index.d.ts +1 -1
  36. package/components/drawer/drawer.component.d.ts +3 -4
  37. package/components/files/file/file.component.d.ts +16 -29
  38. package/components/files/file/file.options.d.ts +1 -1
  39. package/components/files/files/files.component.d.ts +7 -10
  40. package/components/files/input-files/input-files.component.d.ts +2 -2
  41. package/components/files/input-files/input-files.content.d.ts +7 -8
  42. package/components/files/input-files/input-files.directive.d.ts +2 -2
  43. package/components/files/input-files/input-files.options.d.ts +1 -3
  44. package/components/filter/filter.component.d.ts +9 -12
  45. package/components/fullscreen/fullscreen.component.d.ts +5 -8
  46. package/components/index.d.ts +0 -4
  47. package/components/input-chip/input-chip.component.d.ts +9 -8
  48. package/components/input-chip/input-chip.d.ts +5 -1
  49. package/components/input-chip/input-chip.directive.d.ts +7 -12
  50. package/components/input-color/index.d.ts +1 -0
  51. package/components/input-color/input-color.component.d.ts +4 -4
  52. package/components/input-color/input-color.d.ts +5 -0
  53. package/components/input-date/input-date.d.ts +4 -1
  54. package/components/input-date/input-date.directive.d.ts +12 -14
  55. package/components/input-date/input-date.options.d.ts +3 -3
  56. package/components/input-date-multi/input-date-multi.d.ts +1 -2
  57. package/components/input-date-multi/input-date-multi.directive.d.ts +10 -14
  58. package/components/input-date-range/input-date-range.d.ts +4 -1
  59. package/components/input-date-range/input-date-range.directive.d.ts +5 -8
  60. package/components/input-date-range/input-date-range.options.d.ts +2 -2
  61. package/components/input-date-time/input-date-time.d.ts +4 -1
  62. package/components/input-date-time/input-date-time.directive.d.ts +6 -6
  63. package/components/input-date-time/input-date-time.options.d.ts +2 -2
  64. package/components/input-inline/input-inline.component.d.ts +3 -2
  65. package/components/input-month/input-month.d.ts +4 -1
  66. package/components/input-month/input-month.directive.d.ts +6 -5
  67. package/components/input-month-range/input-month-range.d.ts +4 -1
  68. package/components/input-month-range/input-month-range.directive.d.ts +6 -5
  69. package/components/input-number/input-number.d.ts +4 -1
  70. package/components/input-number/input-number.directive.d.ts +7 -13
  71. package/components/input-number/input-number.options.d.ts +2 -3
  72. package/components/input-number/step/input-number-step.component.d.ts +3 -2
  73. package/components/input-phone/index.d.ts +1 -0
  74. package/components/input-phone/input-phone.d.ts +5 -0
  75. package/components/input-phone/input-phone.directive.d.ts +7 -7
  76. package/components/input-phone-international/index.d.ts +1 -0
  77. package/components/input-phone-international/input-phone-international.component.d.ts +27 -32
  78. package/components/input-phone-international/input-phone-international.d.ts +5 -0
  79. package/components/input-phone-international/input-phone-international.options.d.ts +1 -3
  80. package/components/input-pin/index.d.ts +1 -0
  81. package/components/input-pin/input-pin.component.d.ts +4 -4
  82. package/components/input-pin/input-pin.d.ts +5 -0
  83. package/components/input-range/index.d.ts +0 -1
  84. package/components/input-range/input-range.component.d.ts +29 -62
  85. package/components/input-slider/input-slider.d.ts +4 -1
  86. package/components/input-slider/input-slider.directive.d.ts +2 -4
  87. package/components/input-time/input-time.component.d.ts +1 -3
  88. package/components/input-time/input-time.d.ts +4 -1
  89. package/components/input-time/input-time.directive.d.ts +8 -10
  90. package/components/input-year/input-year.d.ts +4 -1
  91. package/components/input-year/input-year.directive.d.ts +5 -5
  92. package/components/input-year/input-year.options.d.ts +2 -2
  93. package/components/items-with-more/items-with-more.component.d.ts +5 -5
  94. package/components/like/like.options.d.ts +1 -1
  95. package/components/line-clamp/line-clamp-box.component.d.ts +3 -4
  96. package/components/line-clamp/line-clamp.component.d.ts +8 -10
  97. package/components/line-clamp/line-clamp.options.d.ts +1 -3
  98. package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +5 -7
  99. package/components/multi-select/multi-select-option/multi-select-option.component.d.ts +1 -1
  100. package/components/notification-middle/notification-middle.component.d.ts +2 -2
  101. package/components/notification-middle/notification-middle.directive.d.ts +4 -3
  102. package/components/notification-middle/notification-middle.service.d.ts +7 -3
  103. package/components/pager/pager.component.d.ts +12 -12
  104. package/components/pagination/index.d.ts +1 -0
  105. package/components/pagination/pagination.component.d.ts +25 -54
  106. package/components/pagination/pagination.options.d.ts +7 -0
  107. package/components/preview/dialog/preview-dialog.component.d.ts +2 -2
  108. package/components/preview/dialog/preview-dialog.directive.d.ts +3 -3
  109. package/components/preview/dialog/preview-dialog.service.d.ts +5 -2
  110. package/components/preview/index.d.ts +1 -0
  111. package/components/preview/pagination/preview-pagination.component.d.ts +3 -2
  112. package/components/preview/preview.component.d.ts +2 -2
  113. package/components/preview/preview.d.ts +2 -1
  114. package/{tokens/preview-icons.d.ts → components/preview/preview.options.d.ts} +1 -3
  115. package/components/preview/zoom/preview-zoom.component.d.ts +4 -2
  116. package/components/progress/progress-bar/progress-bar.component.d.ts +3 -4
  117. package/components/progress/progress-bar/progress-color-segments.directive.d.ts +4 -4
  118. package/components/progress/progress.options.d.ts +1 -3
  119. package/components/pulse/pulse.component.d.ts +2 -2
  120. package/components/push/push-alert.component.d.ts +4 -3
  121. package/components/push/push.component.d.ts +1 -1
  122. package/components/push/push.directive.d.ts +4 -6
  123. package/components/push/push.options.d.ts +5 -8
  124. package/components/push/push.service.d.ts +6 -2
  125. package/components/radio/radio.component.d.ts +1 -1
  126. package/components/radio-list/radio-list.component.d.ts +11 -9
  127. package/components/range/range-change.directive.d.ts +1 -2
  128. package/components/range/range.component.d.ts +16 -25
  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 +7 -8
  135. package/components/select/select.d.ts +4 -1
  136. package/components/select/select.directive.d.ts +4 -3
  137. package/components/slider/helpers/key-steps.d.ts +1 -2
  138. package/components/slider/helpers/slider-key-steps.directive.d.ts +15 -23
  139. package/components/slider/helpers/slider-thumb-label.component.d.ts +2 -4
  140. package/components/slider/slider.options.d.ts +1 -6
  141. package/components/stepper/step.component.d.ts +14 -9
  142. package/components/stepper/stepper.component.d.ts +5 -12
  143. package/components/switch/switch.component.d.ts +1 -0
  144. package/components/tabs/tabs-horizontal.directive.d.ts +3 -4
  145. package/components/tabs/tabs-with-more.component.d.ts +13 -17
  146. package/components/tabs/tabs.options.d.ts +1 -6
  147. package/components/textarea/index.d.ts +2 -1
  148. package/components/textarea/textarea.component.d.ts +10 -11
  149. package/components/textarea/textarea.d.ts +6 -0
  150. package/components/textarea/textarea.directive.d.ts +13 -0
  151. package/components/tiles/tile.component.d.ts +7 -10
  152. package/components/tiles/tile.service.d.ts +1 -1
  153. package/components/toast/toast.component.d.ts +4 -3
  154. package/components/toast/toast.options.d.ts +9 -7
  155. package/components/toast/toast.service.d.ts +10 -9
  156. package/components/tree/components/tree/tree.component.d.ts +7 -7
  157. package/components/tree/components/tree-item/tree-item.component.d.ts +1 -1
  158. package/components/tree/components/tree-item-content/tree-item-content.component.d.ts +8 -1
  159. package/components/tree/misc/tree.constants.d.ts +0 -3
  160. package/components/tree/misc/tree.tokens.d.ts +1 -6
  161. package/directives/appearance-proxy/appearance-proxy.directive.d.ts +10 -0
  162. package/directives/appearance-proxy/index.d.ts +1 -0
  163. package/directives/button-close/button-close.directive.d.ts +2 -1
  164. package/directives/button-select/button-select.directive.d.ts +4 -4
  165. package/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.d.ts +5 -5
  166. package/directives/fade/fade.directive.d.ts +5 -6
  167. package/directives/fluid-typography/fluid-typography.directive.d.ts +3 -6
  168. package/directives/fluid-typography/fluid-typography.options.d.ts +1 -3
  169. package/directives/highlight/highlight.directive.d.ts +4 -4
  170. package/directives/index.d.ts +1 -1
  171. package/directives/password/password.directive.d.ts +1 -1
  172. package/directives/present/present.directive.d.ts +2 -4
  173. package/directives/tooltip/tooltip.directive.d.ts +1 -1
  174. package/directives/unfinished-validator/unfinished-validator.directive.d.ts +2 -2
  175. package/directives/unmask-handler/unmask-handler.directive.d.ts +3 -3
  176. package/fesm2022/taiga-ui-kit-components-accordion.mjs +69 -145
  177. package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
  178. package/fesm2022/taiga-ui-kit-components-action-bar.mjs +24 -40
  179. package/fesm2022/taiga-ui-kit-components-action-bar.mjs.map +1 -1
  180. package/fesm2022/taiga-ui-kit-components-avatar.mjs +34 -48
  181. package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
  182. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +11 -18
  183. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
  184. package/fesm2022/taiga-ui-kit-components-badge.mjs +11 -15
  185. package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
  186. package/fesm2022/taiga-ui-kit-components-badged-content.mjs +9 -12
  187. package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
  188. package/fesm2022/taiga-ui-kit-components-block.mjs +11 -15
  189. package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
  190. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +19 -39
  191. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
  192. package/fesm2022/taiga-ui-kit-components-button-loading.mjs +19 -27
  193. package/fesm2022/taiga-ui-kit-components-button-loading.mjs.map +1 -1
  194. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +6 -17
  195. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
  196. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +25 -26
  197. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
  198. package/fesm2022/taiga-ui-kit-components-carousel.mjs +64 -114
  199. package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
  200. package/fesm2022/taiga-ui-kit-components-checkbox.mjs +5 -6
  201. package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
  202. package/fesm2022/taiga-ui-kit-components-chip.mjs +11 -15
  203. package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
  204. package/fesm2022/taiga-ui-kit-components-combo-box.mjs +45 -50
  205. package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
  206. package/fesm2022/taiga-ui-kit-components-comment.mjs +7 -7
  207. package/fesm2022/taiga-ui-kit-components-comment.mjs.map +1 -1
  208. package/fesm2022/taiga-ui-kit-components-compass.mjs +9 -11
  209. package/fesm2022/taiga-ui-kit-components-compass.mjs.map +1 -1
  210. package/fesm2022/taiga-ui-kit-components-confirm.mjs +11 -14
  211. package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
  212. package/fesm2022/taiga-ui-kit-components-copy.mjs +23 -36
  213. package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
  214. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs +25 -78
  215. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
  216. package/fesm2022/taiga-ui-kit-components-drawer.mjs +15 -32
  217. package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
  218. package/fesm2022/taiga-ui-kit-components-files.mjs +117 -244
  219. package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
  220. package/fesm2022/taiga-ui-kit-components-filter.mjs +21 -34
  221. package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
  222. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +24 -45
  223. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs.map +1 -1
  224. package/fesm2022/taiga-ui-kit-components-input-chip.mjs +63 -77
  225. package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
  226. package/fesm2022/taiga-ui-kit-components-input-color.mjs +24 -13
  227. package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
  228. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +36 -53
  229. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs.map +1 -1
  230. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +30 -36
  231. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
  232. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +33 -31
  233. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
  234. package/fesm2022/taiga-ui-kit-components-input-date.mjs +49 -53
  235. package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
  236. package/fesm2022/taiga-ui-kit-components-input-inline.mjs +10 -13
  237. package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
  238. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +29 -27
  239. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
  240. package/fesm2022/taiga-ui-kit-components-input-month.mjs +35 -27
  241. package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
  242. package/fesm2022/taiga-ui-kit-components-input-number.mjs +60 -77
  243. package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
  244. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +124 -142
  245. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
  246. package/fesm2022/taiga-ui-kit-components-input-phone.mjs +32 -23
  247. package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
  248. package/fesm2022/taiga-ui-kit-components-input-pin.mjs +18 -9
  249. package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
  250. package/fesm2022/taiga-ui-kit-components-input-range.mjs +64 -85
  251. package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
  252. package/fesm2022/taiga-ui-kit-components-input-slider.mjs +30 -36
  253. package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
  254. package/fesm2022/taiga-ui-kit-components-input-time.mjs +63 -70
  255. package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
  256. package/fesm2022/taiga-ui-kit-components-input-year.mjs +28 -21
  257. package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
  258. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +27 -35
  259. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
  260. package/fesm2022/taiga-ui-kit-components-like.mjs +4 -4
  261. package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
  262. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +38 -82
  263. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
  264. package/fesm2022/taiga-ui-kit-components-message.mjs +7 -8
  265. package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
  266. package/fesm2022/taiga-ui-kit-components-multi-select.mjs +38 -50
  267. package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
  268. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +37 -26
  269. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs.map +1 -1
  270. package/fesm2022/taiga-ui-kit-components-pager.mjs +30 -44
  271. package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
  272. package/fesm2022/taiga-ui-kit-components-pagination.mjs +73 -148
  273. package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
  274. package/fesm2022/taiga-ui-kit-components-pin.mjs +7 -7
  275. package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
  276. package/fesm2022/taiga-ui-kit-components-preview.mjs +74 -54
  277. package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
  278. package/fesm2022/taiga-ui-kit-components-progress.mjs +69 -65
  279. package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
  280. package/fesm2022/taiga-ui-kit-components-pulse.mjs +7 -11
  281. package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
  282. package/fesm2022/taiga-ui-kit-components-push.mjs +49 -57
  283. package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
  284. package/fesm2022/taiga-ui-kit-components-radio-list.mjs +23 -35
  285. package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
  286. package/fesm2022/taiga-ui-kit-components-radio.mjs +8 -9
  287. package/fesm2022/taiga-ui-kit-components-radio.mjs.map +1 -1
  288. package/fesm2022/taiga-ui-kit-components-range.mjs +42 -96
  289. package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
  290. package/fesm2022/taiga-ui-kit-components-rating.mjs +7 -12
  291. package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
  292. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs +11 -7
  293. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs.map +1 -1
  294. package/fesm2022/taiga-ui-kit-components-segmented.mjs +32 -59
  295. package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
  296. package/fesm2022/taiga-ui-kit-components-select.mjs +81 -62
  297. package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
  298. package/fesm2022/taiga-ui-kit-components-slider.mjs +87 -101
  299. package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
  300. package/fesm2022/taiga-ui-kit-components-status.mjs +6 -6
  301. package/fesm2022/taiga-ui-kit-components-status.mjs.map +1 -1
  302. package/fesm2022/taiga-ui-kit-components-stepper.mjs +61 -88
  303. package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
  304. package/fesm2022/taiga-ui-kit-components-switch.mjs +10 -6
  305. package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
  306. package/fesm2022/taiga-ui-kit-components-tabs.mjs +65 -113
  307. package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
  308. package/fesm2022/taiga-ui-kit-components-textarea.mjs +62 -82
  309. package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
  310. package/fesm2022/taiga-ui-kit-components-tiles.mjs +25 -46
  311. package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
  312. package/fesm2022/taiga-ui-kit-components-toast.mjs +51 -53
  313. package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
  314. package/fesm2022/taiga-ui-kit-components-tree.mjs +75 -94
  315. package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
  316. package/fesm2022/taiga-ui-kit-components.mjs +0 -4
  317. package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
  318. package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs +27 -0
  319. package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs.map +1 -0
  320. package/fesm2022/taiga-ui-kit-directives-button-close.mjs +15 -7
  321. package/fesm2022/taiga-ui-kit-directives-button-close.mjs.map +1 -1
  322. package/fesm2022/taiga-ui-kit-directives-button-group.mjs +7 -7
  323. package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
  324. package/fesm2022/taiga-ui-kit-directives-button-select.mjs +20 -19
  325. package/fesm2022/taiga-ui-kit-directives-button-select.mjs.map +1 -1
  326. package/fesm2022/taiga-ui-kit-directives-chevron.mjs +10 -9
  327. package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
  328. package/fesm2022/taiga-ui-kit-directives-connected.mjs +7 -8
  329. package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
  330. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs +25 -53
  331. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs.map +1 -1
  332. package/fesm2022/taiga-ui-kit-directives-fade.mjs +25 -34
  333. package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
  334. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs +14 -27
  335. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs.map +1 -1
  336. package/fesm2022/taiga-ui-kit-directives-highlight.mjs +16 -21
  337. package/fesm2022/taiga-ui-kit-directives-highlight.mjs.map +1 -1
  338. package/fesm2022/taiga-ui-kit-directives-password.mjs +12 -14
  339. package/fesm2022/taiga-ui-kit-directives-password.mjs.map +1 -1
  340. package/fesm2022/taiga-ui-kit-directives-present.mjs +10 -18
  341. package/fesm2022/taiga-ui-kit-directives-present.mjs.map +1 -1
  342. package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +6 -6
  343. package/fesm2022/taiga-ui-kit-directives-sensitive.mjs.map +1 -1
  344. package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +6 -6
  345. package/fesm2022/taiga-ui-kit-directives-shimmer.mjs.map +1 -1
  346. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +7 -6
  347. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
  348. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +11 -11
  349. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
  350. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs +9 -12
  351. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs.map +1 -1
  352. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs +10 -15
  353. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs.map +1 -1
  354. package/fesm2022/taiga-ui-kit-directives.mjs +1 -1
  355. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs +43 -0
  356. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs.map +1 -0
  357. package/fesm2022/taiga-ui-kit-pipes-emails.mjs +3 -4
  358. package/fesm2022/taiga-ui-kit-pipes-emails.mjs.map +1 -1
  359. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs +12 -25
  360. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs.map +1 -1
  361. package/fesm2022/taiga-ui-kit-pipes-flag.mjs +30 -0
  362. package/fesm2022/taiga-ui-kit-pipes-flag.mjs.map +1 -0
  363. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs +4 -5
  364. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs.map +1 -1
  365. package/fesm2022/taiga-ui-kit-pipes-initials.mjs +28 -0
  366. package/fesm2022/taiga-ui-kit-pipes-initials.mjs.map +1 -0
  367. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs +10 -8
  368. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs.map +1 -1
  369. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs +3 -4
  370. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs.map +1 -1
  371. package/fesm2022/taiga-ui-kit-pipes-stringify.mjs +3 -4
  372. package/fesm2022/taiga-ui-kit-pipes-stringify.mjs.map +1 -1
  373. package/fesm2022/taiga-ui-kit-pipes.mjs +3 -0
  374. package/fesm2022/taiga-ui-kit-pipes.mjs.map +1 -1
  375. package/fesm2022/taiga-ui-kit-tokens.mjs +4 -121
  376. package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
  377. package/fesm2022/taiga-ui-kit-utils.mjs +3 -15
  378. package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
  379. package/package.json +47 -51
  380. package/pipes/auto-color/auto-color.pipe.d.ts +13 -0
  381. package/pipes/auto-color/index.d.ts +1 -0
  382. package/pipes/filter-by-input/filter-by-input.pipe.d.ts +2 -2
  383. package/pipes/flag/flag.pipe.d.ts +14 -0
  384. package/pipes/flag/index.d.ts +1 -0
  385. package/pipes/index.d.ts +3 -0
  386. package/pipes/initials/index.d.ts +1 -0
  387. package/pipes/initials/initials.pipe.d.ts +7 -0
  388. package/pipes/sort-countries/sort-countries.pipe.d.ts +4 -3
  389. package/pipes/stringify-content/stringify-content.pipe.d.ts +2 -3
  390. package/styles/components/avatar.less +14 -14
  391. package/styles/components/badge.less +4 -3
  392. package/styles/components/block.less +4 -4
  393. package/styles/components/chip.less +15 -4
  394. package/styles/components/comment.less +1 -1
  395. package/styles/components/message.less +1 -1
  396. package/styles/components/pin.less +3 -3
  397. package/styles/components/switch.less +3 -2
  398. package/styles/components/toast.less +1 -1
  399. package/tokens/i18n.d.ts +26 -26
  400. package/tokens/index.d.ts +0 -7
  401. package/utils/index.d.ts +0 -2
  402. package/components/accordion/accordion-item-content.directive.d.ts +0 -6
  403. package/components/accordion/accordion-item-eager-content.directive.d.ts +0 -5
  404. package/components/accordion/accordion-item.component.d.ts +0 -25
  405. package/components/action-bar/action-bar.d.ts +0 -3
  406. package/components/action-bar/action-bar.directive.d.ts +0 -6
  407. package/components/elastic-container/elastic-container.component.d.ts +0 -8
  408. package/components/elastic-container/elastic-container.directive.d.ts +0 -7
  409. package/components/elastic-container/index.d.ts +0 -2
  410. package/components/floating-container/floating-container.directive.d.ts +0 -7
  411. package/components/floating-container/index.d.ts +0 -1
  412. package/components/input-range/input-range.d.ts +0 -3
  413. package/components/pdf-viewer/index.d.ts +0 -4
  414. package/components/pdf-viewer/pdf-viewer.component.d.ts +0 -12
  415. package/components/pdf-viewer/pdf-viewer.directive.d.ts +0 -7
  416. package/components/pdf-viewer/pdf-viewer.options.d.ts +0 -13
  417. package/components/pdf-viewer/pdf-viewer.service.d.ts +0 -13
  418. package/components/slides/index.d.ts +0 -1
  419. package/components/slides/slides.directive.d.ts +0 -11
  420. package/components/textarea/textarea-limit.directive.d.ts +0 -27
  421. package/directives/lazy-loading/index.d.ts +0 -2
  422. package/directives/lazy-loading/lazy-loading.directive.d.ts +0 -18
  423. package/directives/lazy-loading/lazy-loading.service.d.ts +0 -12
  424. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs +0 -78
  425. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs.map +0 -1
  426. package/fesm2022/taiga-ui-kit-components-floating-container.mjs +0 -37
  427. package/fesm2022/taiga-ui-kit-components-floating-container.mjs.map +0 -1
  428. package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs +0 -83
  429. package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs.map +0 -1
  430. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs +0 -64
  431. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs.map +0 -1
  432. package/fesm2022/taiga-ui-kit-components-slides.mjs +0 -49
  433. package/fesm2022/taiga-ui-kit-components-slides.mjs.map +0 -1
  434. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs +0 -81
  435. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs.map +0 -1
  436. package/tokens/calendar-date-stream.d.ts +0 -10
  437. package/tokens/date-inputs-value-transformers.d.ts +0 -19
  438. package/tokens/input-date-options.d.ts +0 -15
  439. package/tokens/items-handlers.d.ts +0 -26
  440. package/tokens/mobile-calendar.d.ts +0 -6
  441. package/tokens/month-formatter.d.ts +0 -5
  442. package/utils/phone.d.ts +0 -3
  443. package/utils/toggle-day.d.ts +0 -2
@@ -1,3 +1,6 @@
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
5
  import { inject, computed, effect, untracked, signal, Input, Directive } from '@angular/core';
3
6
  import * as i2 from '@maskito/angular';
@@ -5,10 +8,9 @@ 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
- import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
9
11
  import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
10
- import * as i1 from '@taiga-ui/core/components/textfield';
11
- 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';
12
14
  import { tuiMaskito } from '@taiga-ui/kit/utils';
13
15
  import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
14
16
 
@@ -31,7 +33,7 @@ function tuiCreateCompletePhoneInsertionPreprocessor(countryCode, phoneMaskAfter
31
33
  const completePhoneLength = (countryCode + phoneMaskAfterCountryCode).replaceAll(/[^#\d]+/g, '').length;
32
34
  const trimCountryPrefix = (value) => countryCode === '+7'
33
35
  ? value.replace(/^(\+?\s*7?\s?8?)\s?/, '')
34
- : value.replace(new RegExp(`^(\\+?\\s*${countryCode.replace('+', '')}?)\\s?`), '');
36
+ : value.replace(new RegExp(String.raw `^(\+?\s*${countryCode.replace('+', '')}?)\s?`), '');
35
37
  return ({ elementState, data }) => {
36
38
  const { value, selection } = elementState;
37
39
  return {
@@ -81,30 +83,30 @@ const MASK_SYMBOLS = /[ \-_()]/g;
81
83
  function isText(value) {
82
84
  return Number.isNaN(parseInt(value.replaceAll(MASK_SYMBOLS, ''), 10));
83
85
  }
84
- class TuiInputPhone extends TuiControl {
86
+ class TuiInputPhoneDirective extends TuiControl {
85
87
  constructor() {
86
88
  super(...arguments);
87
- this.textfield = inject(TuiTextfieldDirective);
89
+ this.input = inject(TuiInputDirective);
88
90
  this.host = inject(TuiTextfieldComponent);
91
+ this.options = inject(TUI_INPUT_PHONE_OPTIONS);
92
+ this.el = tuiInjectElement();
89
93
  this.nonRemovablePrefix = computed(() => `${this.countryCode()} `);
90
94
  this.inputMode = computed(() => (this.allowText() ? 'text' : 'numeric'));
91
95
  this.valueEffect = effect(() => {
92
96
  if (this.value()) {
93
- this.textfield.value.set(maskitoTransform(this.value() ?? '', this.mask()));
97
+ this.input.value.set(maskitoTransform(this.value() ?? '', this.mask()));
94
98
  }
95
- }, TUI_ALLOW_SIGNAL_WRITES);
99
+ });
96
100
  this.blurEffect = effect(() => {
97
101
  const incomplete = untracked(() => !this.value());
98
102
  const prefix = incomplete && this.interactive() && !this.allowText();
99
103
  if (!this.host.focused() && incomplete) {
100
- this.textfield.value.set('');
104
+ this.input.value.set('');
101
105
  }
102
106
  else if (this.host.focused() && prefix) {
103
- this.textfield.value.set(this.nonRemovablePrefix());
107
+ this.input.value.set(this.nonRemovablePrefix());
104
108
  }
105
- }, TUI_ALLOW_SIGNAL_WRITES);
106
- this.options = inject(TUI_INPUT_PHONE_OPTIONS);
107
- this.el = tuiInjectElement();
109
+ });
108
110
  this.mask = computed(() => this.calculateMask(this.countryCode(), this.phoneMask(), this.nonRemovablePrefix(), this.allowText()));
109
111
  this.maskito = tuiMaskito(computed(() => this.mask()));
110
112
  this.countryCode = signal(extractCountryCode(this.options.mask));
@@ -122,7 +124,7 @@ class TuiInputPhone extends TuiControl {
122
124
  }
123
125
  onInput(value) {
124
126
  if (!value && !this.allowText()) {
125
- this.textfield.value.set(this.nonRemovablePrefix());
127
+ this.input.value.set(this.nonRemovablePrefix());
126
128
  }
127
129
  const parsed = isText(value)
128
130
  ? value
@@ -158,22 +160,21 @@ class TuiInputPhone extends TuiControl {
158
160
  ],
159
161
  };
160
162
  }
161
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputPhone, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
162
- 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: [
163
- tuiAsControl(TuiInputPhone),
163
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputPhoneDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
164
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiInputPhoneDirective, 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: [
165
+ tuiAsControl(TuiInputPhoneDirective),
164
166
  tuiValueTransformerFrom(TUI_INPUT_PHONE_OPTIONS),
165
- ], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithTextfield }, { directive: i2.MaskitoDirective }], ngImport: i0 }); }
167
+ ], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.MaskitoDirective }], ngImport: i0 }); }
166
168
  }
167
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputPhone, decorators: [{
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputPhoneDirective, decorators: [{
168
170
  type: Directive,
169
171
  args: [{
170
- standalone: true,
171
172
  selector: 'input[tuiInputPhone]',
172
173
  providers: [
173
- tuiAsControl(TuiInputPhone),
174
+ tuiAsControl(TuiInputPhoneDirective),
174
175
  tuiValueTransformerFrom(TUI_INPUT_PHONE_OPTIONS),
175
176
  ],
176
- hostDirectives: [TuiWithTextfield, MaskitoDirective],
177
+ hostDirectives: [TuiWithInput, MaskitoDirective],
177
178
  host: {
178
179
  type: 'tel',
179
180
  '[inputMode]': 'inputMode()',
@@ -197,9 +198,17 @@ function extractMask(mask) {
197
198
  return match?.[1]?.trim() || '';
198
199
  }
199
200
 
201
+ const TuiInputPhone = [
202
+ TuiInputPhoneDirective,
203
+ TuiLabel,
204
+ TuiTextfieldComponent,
205
+ TuiTextfieldOptionsDirective,
206
+ TuiDropdownContent,
207
+ ];
208
+
200
209
  /**
201
210
  * Generated bundle index. Do not edit.
202
211
  */
203
212
 
204
- export { TUI_INPUT_PHONE_DEFAULT_OPTIONS, TUI_INPUT_PHONE_OPTIONS, TuiInputPhone, tuiInputPhoneOptionsProvider };
213
+ export { TUI_INPUT_PHONE_DEFAULT_OPTIONS, TUI_INPUT_PHONE_OPTIONS, TuiInputPhone, TuiInputPhoneDirective, tuiInputPhoneOptionsProvider };
205
214
  //# 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(`^(\\\\+?\\\\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 {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\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 standalone: true,\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 }, TUI_ALLOW_SIGNAL_WRITES);\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 }, TUI_ALLOW_SIGNAL_WRITES);\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,CAAA,UAAA,EAAa,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,EAC7D,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,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A;IAC7B,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;IAEtC,OAAO,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE;AACnC;;AC5KA;;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 {\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 {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.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.input.value.set('');\n } else if (this.host.focused() && prefix) {\n this.input.value.set(this.nonRemovablePrefix());\n }\n });\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.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 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","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 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,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AAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAEnC,IAAA,OAAO,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE;AAC3B;AAEA,SAAS,WAAW,CAAC,IAAY,EAAA;IAC7B,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;IAEtC,OAAO,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE;AACnC;;AC5Ja,MAAA,aAAa,GAAG;IACzB,sBAAsB;IACtB,QAAQ;IACR,qBAAqB;IACrB,4BAA4B;IAC5B,kBAAkB;;;ACdtB;;AAEG;;;;"}
@@ -1,17 +1,18 @@
1
+ import { TuiLabel } from '@taiga-ui/core/components/label';
2
+ import { TUI_TEXTFIELD_OPTIONS, TuiTextfieldContent, 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
5
  import { signal, 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
18
  this.mask = signal(/^\d+$/);
@@ -46,27 +47,35 @@ class TuiInputPin {
46
47
  (this.el.selectionStart === this.el.maxLength &&
47
48
  index === this.el.maxLength - 1)));
48
49
  }
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 }); }
50
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputPinComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
51
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiInputPinComponent, 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 @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 .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: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
51
52
  }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputPin, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputPinComponent, decorators: [{
53
54
  type: Component,
54
- args: [{ selector: 'input[tuiInputPin]', imports: [TuiAppearance, TuiRepeatTimes, TuiTextfieldContent], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [MaskitoDirective], host: {
55
+ args: [{ selector: 'input[tuiInputPin]', imports: [TuiAppearance, TuiTextfieldContent], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [MaskitoDirective], host: {
55
56
  ngSkipHydration: 'true',
56
57
  inputmode: 'numeric',
57
58
  spellcheck: 'false',
58
59
  '(pointerdown.prevent)': 'onClick(0)',
59
60
  '(selectionchange)': 'onSelection()',
60
61
  '(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
+ }, 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 .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
63
  }], propDecorators: { maskSetter: [{
63
64
  type: Input,
64
65
  args: ['mask']
65
66
  }] } });
66
67
 
68
+ const TuiInputPin = [
69
+ TuiInputPinComponent,
70
+ TuiLabel,
71
+ TuiTextfieldComponent,
72
+ TuiTextfieldOptionsDirective,
73
+ TuiDropdownContent,
74
+ ];
75
+
67
76
  /**
68
77
  * Generated bundle index. Do not edit.
69
78
  */
70
79
 
71
- export { TuiInputPin };
80
+ export { TuiInputPin, TuiInputPinComponent };
72
81
  //# 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 styleUrls: ['./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;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K;uBAAC,MAAM;;;AEnDjB;;AAEG;;;;"}
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/input-pin.ts","../../../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 {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 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 @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":";;;;;;;;;;;;;;MAqCa,oBAAoB,CAAA;AAhBjC,IAAA,WAAA,GAAA;QAiBuB,IAAE,CAAA,EAAA,GAAG,gBAAgB,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AA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;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,gmCAAA,CAAA,EAAA;8BAgBU,UAAU,EAAA,CAAA;sBADpB,KAAK;uBAAC,MAAM;;;AEzCJ,MAAA,WAAW,GAAG;IACvB,oBAAoB;IACpB,QAAQ;IACR,qBAAqB;IACrB,4BAA4B;IAC5B,kBAAkB;;;ACdtB;;AAEG;;;;"}
@@ -1,73 +1,82 @@
1
- import { TuiLabel } from '@taiga-ui/core/components/label';
2
1
  import * as i0 from '@angular/core';
3
- import { inject, signal, computed, 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 } 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
- import * as i3 from '@taiga-ui/core/components/textfield';
9
+ import { tuiIsString, tuiIsNumber } from '@taiga-ui/cdk/utils/miscellaneous';
10
+ import * as i4 from '@taiga-ui/core/components/textfield';
11
11
  import { TUI_TEXTFIELD_OPTIONS, TuiTextfield } from '@taiga-ui/core/components/textfield';
12
12
  import * as i2 from '@taiga-ui/kit/components/input-number';
13
- 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';
14
14
  import { TuiRange } from '@taiga-ui/kit/components/range';
15
15
  import { tuiSliderOptionsProvider } from '@taiga-ui/kit/components/slider';
16
16
  import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
17
+ import * as i3 from '@taiga-ui/core/components/label';
17
18
 
18
- class TuiInputRangeComponent extends TuiControl {
19
+ const transform = (x) => x ?? ['', ''];
20
+ class TuiInputRange extends TuiControl {
19
21
  constructor() {
20
22
  super(...arguments);
21
- this.inputNumberRefs = EMPTY_QUERY;
23
+ this.inputs = viewChildren(TuiInputNumberDirective, { read: ElementRef });
24
+ this.range = viewChild(TuiRange);
25
+ this.options = inject(TUI_INPUT_NUMBER_OPTIONS);
22
26
  this.isMobile = inject(TUI_IS_MOBILE);
23
- this.quantum = signal(0);
24
27
  this.quantumTransformer = computed(() => new TuiQuantumValueTransformerBase(this.quantum()));
25
28
  this.size = inject(TUI_TEXTFIELD_OPTIONS).size;
26
- this.textfieldValueStart = this.value()[0];
27
- this.textfieldValueEnd = this.value()[1];
28
- this.lastActiveSide = 'start';
29
- this.min = 0;
30
- this.max = 100;
31
- this.step = 1;
32
- this.segments = 1;
33
- this.keySteps = null;
34
- this.content = ['', ''];
35
- this.prefix = ['', ''];
36
- this.postfix = ['', ''];
37
- }
38
- // TODO(v5): use signal inputs
39
- set quantumSetter(x) {
40
- this.quantum.set(x);
29
+ this.start = this.value()[0];
30
+ this.end = this.value()[1];
31
+ this.side = 'start';
32
+ this.contentStart = computed(() => {
33
+ const [start, end] = this.content().map((x, i) => {
34
+ const value = this.value()[i];
35
+ return typeof x === 'function' ? x({ $implicit: value }) : x || value;
36
+ });
37
+ if (this.interactive() || !this.isPrimitive(start) || !this.isPrimitive(end)) {
38
+ return this.content()[0];
39
+ }
40
+ return `${start}${CHAR_NO_BREAK_SPACE}${CHAR_EN_DASH}${CHAR_NO_BREAK_SPACE}${end}`;
41
+ });
42
+ this.contentEnd = computed(() => this.contentStart() === this.content()[0] ? this.content()[1] : '');
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
+ });
55
+ this.content = input(['', '']);
41
56
  }
42
57
  writeValue(value) {
43
58
  super.writeValue(value);
44
59
  this.setTextfieldValues(this.value());
45
60
  }
46
- ngAfterViewInit() {
47
- if (this.range) {
48
- this.range.legacyMode = false; // TODO(v5): remove backward compatibility
49
- }
61
+ get contentStartHidden() {
62
+ return this.interactive() && tuiIsFocused(this.textfieldStart);
50
63
  }
51
- get hideStartContent() {
52
- return !this.content[0] || tuiIsFocused(this.textfieldStart);
53
- }
54
- get hideEndContent() {
55
- return !this.content[1] || tuiIsFocused(this.textfieldEnd);
64
+ get contentEndHidden() {
65
+ return (!this.content()[1] || (this.interactive() && tuiIsFocused(this.textfieldEnd)));
56
66
  }
57
67
  takeStep(event, coefficients) {
58
- if (!this.interactive() || !this.range) {
68
+ if (!this.interactive() || !this.range()) {
59
69
  return;
60
70
  }
61
71
  event.preventDefault();
62
72
  const [start, end] = this.value();
63
- const newValue = this.valueGuard(this.range.takeStep(coefficients));
73
+ const newValue = this.valueGuard(this.range().takeStep(coefficients));
64
74
  if (newValue[0] !== start || newValue[1] !== end) {
65
75
  this.onExternalValueUpdate(newValue);
66
76
  }
67
77
  }
68
78
  onInput([start, end]) {
69
- const [prevStart, prevEnd] = this.value();
70
- this.setValue([start ?? prevStart, end ?? prevEnd]);
79
+ this.setValue([start ?? this.value()[0], end ?? this.value()[1]]);
71
80
  }
72
81
  onExternalValueUpdate(value) {
73
82
  this.setValue(value);
@@ -83,22 +92,18 @@ class TuiInputRangeComponent extends TuiControl {
83
92
  this.activeTextfield?.focus();
84
93
  }
85
94
  }
86
- onActiveThumbChange(activeThumb) {
87
- // TODO(v5): remove backward compatibility
88
- this.lastActiveSide = activeThumb === 'left' ? 'start' : 'end';
89
- }
90
95
  setTextfieldValues([start, end]) {
91
- this.textfieldValueStart = start;
92
- this.textfieldValueEnd = end;
96
+ this.start = start;
97
+ this.end = end;
93
98
  }
94
99
  get textfieldStart() {
95
- return this.inputNumberRefs.first?.nativeElement || null;
100
+ return this.inputs()[0]?.nativeElement || null;
96
101
  }
97
102
  get textfieldEnd() {
98
- return this.inputNumberRefs.last?.nativeElement || null;
103
+ return this.inputs()[this.inputs().length - 1]?.nativeElement || null;
99
104
  }
100
105
  get activeTextfield() {
101
- return this.lastActiveSide === 'start' ? this.textfieldStart : this.textfieldEnd;
106
+ return this.side === 'start' ? this.textfieldStart : this.textfieldEnd;
102
107
  }
103
108
  setValue(value) {
104
109
  this.onChange(this.valueGuard(value));
@@ -108,58 +113,32 @@ class TuiInputRangeComponent extends TuiControl {
108
113
  const [start, end] = value.map((x) => this.quantumTransformer().toControlValue(x) ?? x);
109
114
  return [Math.min(start, prevEnd), Math.max(end, prevStart)];
110
115
  }
111
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputRangeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
112
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiInputRangeComponent, isStandalone: true, selector: "tui-input-range", inputs: { min: "min", max: "max", step: "step", segments: "segments", keySteps: "keySteps", content: "content", prefix: ["prefix", "prefix", (x) => x ?? ['', '']], postfix: ["postfix", "postfix", (x) => x ?? ['', '']], quantumSetter: ["quantum", "quantumSetter"] }, host: { attributes: { "new": "" }, properties: { "attr.data-size": "size()" } }, providers: [
113
- tuiAsControl(TuiInputRangeComponent),
116
+ isPrimitive(x) {
117
+ return !x || tuiIsString(x) || tuiIsNumber(x);
118
+ }
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),
114
122
  tuiSliderOptionsProvider({ trackColor: 'transparent' }),
115
123
  tuiFallbackValueProvider([0, 0]),
116
- ], 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]=\"hideStartContent ? '' : content[0]\">\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]=\"!hideEndContent\"\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 <div\n class=\"t-content-end\"\n [class._hidden]=\"hideEndContent\"\n >\n <ng-container *polymorpheusOutlet=\"content[1] as text; context: {$implicit: value()[1]}\">\n {{ text }}\n </ng-container>\n </div>\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)=\"onActiveThumbChange($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{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: ["min", "max", "prefix", "postfix"] }, { 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 .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: ["min", "max", "prefix", "postfix"] }, { 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 }); }
117
125
  }
118
- 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: [{
119
127
  type: Component,
120
128
  args: [{ selector: 'tui-input-range', imports: [FormsModule, PolymorpheusOutlet, TuiInputNumber, TuiRange, TuiTextfield], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
121
- tuiAsControl(TuiInputRangeComponent),
129
+ tuiAsControl(TuiInputRange),
122
130
  tuiSliderOptionsProvider({ trackColor: 'transparent' }),
123
131
  tuiFallbackValueProvider([0, 0]),
124
132
  ], host: {
125
- new: '', // TODO(v5): remove after deletion of legacy control
126
- // TODO: use css :host:has(tui-textfield[data-size]) after browser bump
127
133
  '[attr.data-size]': 'size()',
128
- }, template: "<tui-textfield [content]=\"hideStartContent ? '' : content[0]\">\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]=\"!hideEndContent\"\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 <div\n class=\"t-content-end\"\n [class._hidden]=\"hideEndContent\"\n >\n <ng-container *polymorpheusOutlet=\"content[1] as text; context: {$implicit: value()[1]}\">\n {{ text }}\n </ng-container>\n </div>\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)=\"onActiveThumbChange($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{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"] }]
129
- }], propDecorators: { inputNumberRefs: [{
130
- type: ViewChildren,
131
- args: [TuiInputNumberDirective, { read: ElementRef }]
132
- }], range: [{
133
- type: ViewChild,
134
- args: [TuiRange]
135
- }], min: [{
136
- type: Input
137
- }], max: [{
138
- type: Input
139
- }], step: [{
140
- type: Input
141
- }], segments: [{
142
- type: Input
143
- }], keySteps: [{
144
- type: Input
145
- }], content: [{
146
- type: Input
147
- }], prefix: [{
148
- type: Input,
149
- args: [{ transform: (x) => x ?? ['', ''] }]
150
- }], postfix: [{
151
- type: Input,
152
- args: [{ transform: (x) => x ?? ['', ''] }]
153
- }], quantumSetter: [{
154
- type: Input,
155
- args: ['quantum']
156
- }] } });
157
-
158
- const TuiInputRange = [TuiInputRangeComponent, TuiLabel];
134
+ // TODO: Delete this line and put `tui-input-range:has(.t-content-end) {--t-icon-lock: none}` to proprietary styles
135
+ '[style.--t-icon-lock]': 'contentEnd() ? "none" : null',
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 .t-clear{display:none!important}\n"] }]
137
+ }] });
159
138
 
160
139
  /**
161
140
  * Generated bundle index. Do not edit.
162
141
  */
163
142
 
164
- export { TuiInputRange, TuiInputRangeComponent };
143
+ export { TuiInputRange };
165
144
  //# sourceMappingURL=taiga-ui-kit-components-input-range.mjs.map