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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (397) hide show
  1. package/README.md +1 -1
  2. package/components/avatar/avatar-labeled.component.d.ts +3 -3
  3. package/components/avatar/avatar-stack.component.d.ts +2 -2
  4. package/components/badge/badge.options.d.ts +1 -3
  5. package/components/badge-notification/badge-notification.component.d.ts +2 -3
  6. package/components/badge-notification/badge-notification.options.d.ts +1 -3
  7. package/components/badged-content/badged-content.directive.d.ts +2 -2
  8. package/components/block/block.options.d.ts +1 -3
  9. package/components/breadcrumbs/breadcrumbs.component.d.ts +6 -7
  10. package/components/breadcrumbs/breadcrumbs.options.d.ts +1 -3
  11. package/components/button-loading/button-loading.component.d.ts +5 -5
  12. package/components/calendar-range/calendar-range.component.d.ts +0 -1
  13. package/components/calendar-range/day-range-period.d.ts +2 -1
  14. package/components/carousel/carousel.component.d.ts +15 -18
  15. package/components/carousel/carousel.directive.d.ts +5 -4
  16. package/components/chip/chip.options.d.ts +1 -3
  17. package/components/combo-box/combo-box.d.ts +5 -0
  18. package/components/combo-box/combo-box.directive.d.ts +7 -9
  19. package/components/combo-box/index.d.ts +1 -0
  20. package/components/compass/compass.component.d.ts +2 -2
  21. package/components/confirm/confirm.component.d.ts +4 -3
  22. package/components/confirm/confirm.service.d.ts +1 -1
  23. package/components/copy/copy.component.d.ts +3 -4
  24. package/components/copy/copy.directive.d.ts +2 -4
  25. package/components/data-list-wrapper/data-list-group-wrapper.component.d.ts +2 -2
  26. package/components/data-list-wrapper/data-list-wrapper.component.d.ts +14 -22
  27. package/components/data-list-wrapper/{data-list-wrapper.module.d.ts → data-list-wrapper.d.ts} +1 -2
  28. package/components/data-list-wrapper/index.d.ts +1 -1
  29. package/components/drawer/drawer.component.d.ts +3 -4
  30. package/components/files/file/file.component.d.ts +16 -29
  31. package/components/files/file/file.options.d.ts +1 -1
  32. package/components/files/files/files.component.d.ts +5 -8
  33. package/components/files/input-files/input-files.component.d.ts +2 -2
  34. package/components/files/input-files/input-files.content.d.ts +7 -8
  35. package/components/files/input-files/input-files.directive.d.ts +2 -2
  36. package/components/files/input-files/input-files.options.d.ts +1 -3
  37. package/components/filter/filter.component.d.ts +9 -11
  38. package/components/fullscreen/fullscreen.component.d.ts +5 -8
  39. package/components/index.d.ts +0 -3
  40. package/components/input-chip/input-chip.component.d.ts +9 -8
  41. package/components/input-chip/input-chip.d.ts +5 -1
  42. package/components/input-chip/input-chip.directive.d.ts +7 -12
  43. package/components/input-color/index.d.ts +1 -0
  44. package/components/input-color/input-color.component.d.ts +4 -4
  45. package/components/input-color/input-color.d.ts +5 -0
  46. package/components/input-date/input-date.d.ts +4 -1
  47. package/components/input-date/input-date.directive.d.ts +12 -14
  48. package/components/input-date/input-date.options.d.ts +3 -3
  49. package/components/input-date-multi/input-date-multi.d.ts +1 -2
  50. package/components/input-date-multi/input-date-multi.directive.d.ts +10 -14
  51. package/components/input-date-range/input-date-range.d.ts +4 -1
  52. package/components/input-date-range/input-date-range.directive.d.ts +5 -8
  53. package/components/input-date-range/input-date-range.options.d.ts +2 -2
  54. package/components/input-date-time/input-date-time.d.ts +4 -1
  55. package/components/input-date-time/input-date-time.directive.d.ts +6 -6
  56. package/components/input-date-time/input-date-time.options.d.ts +2 -2
  57. package/components/input-month/input-month.d.ts +4 -1
  58. package/components/input-month/input-month.directive.d.ts +6 -5
  59. package/components/input-month-range/input-month-range.d.ts +4 -1
  60. package/components/input-month-range/input-month-range.directive.d.ts +6 -5
  61. package/components/input-number/input-number.d.ts +4 -1
  62. package/components/input-number/input-number.directive.d.ts +5 -7
  63. package/components/input-number/input-number.options.d.ts +2 -3
  64. package/components/input-number/step/input-number-step.component.d.ts +2 -1
  65. package/components/input-phone/index.d.ts +1 -0
  66. package/components/input-phone/input-phone.d.ts +5 -0
  67. package/components/input-phone/input-phone.directive.d.ts +7 -7
  68. package/components/input-phone-international/index.d.ts +1 -0
  69. package/components/input-phone-international/input-phone-international.component.d.ts +9 -8
  70. package/components/input-phone-international/input-phone-international.d.ts +5 -0
  71. package/components/input-phone-international/input-phone-international.options.d.ts +1 -3
  72. package/components/input-pin/index.d.ts +1 -0
  73. package/components/input-pin/input-pin.component.d.ts +3 -3
  74. package/components/input-pin/input-pin.d.ts +5 -0
  75. package/components/input-range/index.d.ts +0 -1
  76. package/components/input-range/input-range.component.d.ts +5 -4
  77. package/components/input-slider/input-slider.d.ts +4 -1
  78. package/components/input-slider/input-slider.directive.d.ts +1 -1
  79. package/components/input-time/input-time.component.d.ts +1 -3
  80. package/components/input-time/input-time.d.ts +4 -1
  81. package/components/input-time/input-time.directive.d.ts +4 -4
  82. package/components/input-year/input-year.d.ts +4 -1
  83. package/components/input-year/input-year.directive.d.ts +5 -5
  84. package/components/input-year/input-year.options.d.ts +2 -2
  85. package/components/like/like.options.d.ts +1 -1
  86. package/components/line-clamp/line-clamp-box.component.d.ts +1 -1
  87. package/components/line-clamp/line-clamp.options.d.ts +1 -3
  88. package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +4 -6
  89. package/components/notification-middle/notification-middle.component.d.ts +2 -2
  90. package/components/notification-middle/notification-middle.directive.d.ts +4 -3
  91. package/components/notification-middle/notification-middle.service.d.ts +7 -3
  92. package/components/pagination/pagination.component.d.ts +22 -52
  93. package/components/pagination/pagination.options.d.ts +3 -6
  94. package/components/preview/dialog/preview-dialog.component.d.ts +2 -2
  95. package/components/preview/dialog/preview-dialog.directive.d.ts +3 -3
  96. package/components/preview/dialog/preview-dialog.service.d.ts +5 -2
  97. package/components/preview/index.d.ts +1 -0
  98. package/components/preview/pagination/preview-pagination.component.d.ts +2 -1
  99. package/components/preview/preview.component.d.ts +1 -1
  100. package/components/preview/preview.d.ts +2 -1
  101. package/{tokens/preview-icons.d.ts → components/preview/preview.options.d.ts} +1 -3
  102. package/components/preview/zoom/preview-zoom.component.d.ts +3 -1
  103. package/components/progress/progress-bar/progress-bar.component.d.ts +3 -4
  104. package/components/progress/progress.options.d.ts +1 -3
  105. package/components/pulse/pulse.component.d.ts +2 -2
  106. package/components/push/push-alert.component.d.ts +2 -2
  107. package/components/push/push.options.d.ts +4 -3
  108. package/components/push/push.service.d.ts +2 -2
  109. package/components/radio/radio.component.d.ts +1 -1
  110. package/components/radio-list/radio-list.component.d.ts +5 -3
  111. package/components/rating/rating.component.d.ts +1 -1
  112. package/components/rating/rating.options.d.ts +1 -3
  113. package/components/routable-dialog/generate-dialogable-route.d.ts +1 -1
  114. package/components/segmented/segmented.component.d.ts +4 -6
  115. package/components/segmented/segmented.directive.d.ts +6 -7
  116. package/components/select/native-select/native-select.component.d.ts +4 -4
  117. package/components/select/select.d.ts +4 -1
  118. package/components/select/select.directive.d.ts +4 -3
  119. package/components/slider/slider.options.d.ts +1 -6
  120. package/components/stepper/step.component.d.ts +6 -8
  121. package/components/stepper/stepper.component.d.ts +6 -11
  122. package/components/switch/switch.component.d.ts +1 -0
  123. package/components/tabs/tabs.options.d.ts +1 -6
  124. package/components/textarea/index.d.ts +2 -1
  125. package/components/textarea/textarea.component.d.ts +4 -4
  126. package/components/textarea/textarea.d.ts +6 -0
  127. package/components/textarea/textarea.directive.d.ts +13 -0
  128. package/components/toast/toast.component.d.ts +4 -4
  129. package/components/toast/toast.options.d.ts +4 -3
  130. package/components/toast/toast.service.d.ts +2 -2
  131. package/components/tree/components/tree-item-content/tree-item-content.component.d.ts +7 -0
  132. package/components/tree/misc/tree.constants.d.ts +0 -3
  133. package/components/tree/misc/tree.tokens.d.ts +1 -6
  134. package/directives/appearance-proxy/appearance-proxy.directive.d.ts +10 -0
  135. package/directives/appearance-proxy/index.d.ts +1 -0
  136. package/directives/button-select/button-select.directive.d.ts +3 -2
  137. package/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.d.ts +5 -5
  138. package/directives/fade/fade.directive.d.ts +5 -6
  139. package/directives/fluid-typography/fluid-typography.options.d.ts +1 -3
  140. package/directives/highlight/highlight.directive.d.ts +4 -4
  141. package/directives/index.d.ts +1 -1
  142. package/directives/password/password.directive.d.ts +1 -1
  143. package/directives/present/present.directive.d.ts +2 -4
  144. package/directives/tooltip/tooltip.directive.d.ts +1 -1
  145. package/directives/unfinished-validator/unfinished-validator.directive.d.ts +2 -2
  146. package/directives/unmask-handler/unmask-handler.directive.d.ts +3 -3
  147. package/fesm2022/taiga-ui-kit-components-accordion.mjs +8 -9
  148. package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
  149. package/fesm2022/taiga-ui-kit-components-action-bar.mjs +7 -7
  150. package/fesm2022/taiga-ui-kit-components-action-bar.mjs.map +1 -1
  151. package/fesm2022/taiga-ui-kit-components-avatar.mjs +34 -48
  152. package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
  153. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +11 -18
  154. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
  155. package/fesm2022/taiga-ui-kit-components-badge.mjs +11 -15
  156. package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
  157. package/fesm2022/taiga-ui-kit-components-badged-content.mjs +9 -12
  158. package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
  159. package/fesm2022/taiga-ui-kit-components-block.mjs +11 -15
  160. package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
  161. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +18 -37
  162. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
  163. package/fesm2022/taiga-ui-kit-components-button-loading.mjs +18 -26
  164. package/fesm2022/taiga-ui-kit-components-button-loading.mjs.map +1 -1
  165. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +5 -13
  166. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
  167. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +23 -23
  168. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
  169. package/fesm2022/taiga-ui-kit-components-carousel.mjs +64 -114
  170. package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
  171. package/fesm2022/taiga-ui-kit-components-checkbox.mjs +5 -6
  172. package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
  173. package/fesm2022/taiga-ui-kit-components-chip.mjs +11 -15
  174. package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
  175. package/fesm2022/taiga-ui-kit-components-combo-box.mjs +40 -45
  176. package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
  177. package/fesm2022/taiga-ui-kit-components-comment.mjs +7 -7
  178. package/fesm2022/taiga-ui-kit-components-compass.mjs +9 -11
  179. package/fesm2022/taiga-ui-kit-components-compass.mjs.map +1 -1
  180. package/fesm2022/taiga-ui-kit-components-confirm.mjs +10 -12
  181. package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
  182. package/fesm2022/taiga-ui-kit-components-copy.mjs +19 -33
  183. package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
  184. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs +24 -85
  185. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
  186. package/fesm2022/taiga-ui-kit-components-drawer.mjs +15 -32
  187. package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
  188. package/fesm2022/taiga-ui-kit-components-files.mjs +111 -239
  189. package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
  190. package/fesm2022/taiga-ui-kit-components-filter.mjs +20 -34
  191. package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
  192. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +23 -42
  193. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs.map +1 -1
  194. package/fesm2022/taiga-ui-kit-components-input-chip.mjs +63 -77
  195. package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
  196. package/fesm2022/taiga-ui-kit-components-input-color.mjs +24 -13
  197. package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
  198. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +35 -51
  199. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs.map +1 -1
  200. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +30 -36
  201. package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
  202. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +32 -29
  203. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
  204. package/fesm2022/taiga-ui-kit-components-input-date.mjs +45 -48
  205. package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
  206. package/fesm2022/taiga-ui-kit-components-input-inline.mjs +3 -3
  207. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +26 -23
  208. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
  209. package/fesm2022/taiga-ui-kit-components-input-month.mjs +32 -23
  210. package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
  211. package/fesm2022/taiga-ui-kit-components-input-number.mjs +53 -50
  212. package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
  213. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +50 -42
  214. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
  215. package/fesm2022/taiga-ui-kit-components-input-phone.mjs +29 -19
  216. package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
  217. package/fesm2022/taiga-ui-kit-components-input-pin.mjs +18 -9
  218. package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
  219. package/fesm2022/taiga-ui-kit-components-input-range.mjs +18 -16
  220. package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
  221. package/fesm2022/taiga-ui-kit-components-input-slider.mjs +15 -10
  222. package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
  223. package/fesm2022/taiga-ui-kit-components-input-time.mjs +38 -40
  224. package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
  225. package/fesm2022/taiga-ui-kit-components-input-year.mjs +27 -19
  226. package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
  227. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +12 -14
  228. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
  229. package/fesm2022/taiga-ui-kit-components-like.mjs +4 -4
  230. package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
  231. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +18 -23
  232. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
  233. package/fesm2022/taiga-ui-kit-components-message.mjs +7 -8
  234. package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
  235. package/fesm2022/taiga-ui-kit-components-multi-select.mjs +30 -40
  236. package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
  237. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +37 -26
  238. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs.map +1 -1
  239. package/fesm2022/taiga-ui-kit-components-pager.mjs +6 -8
  240. package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
  241. package/fesm2022/taiga-ui-kit-components-pagination.mjs +59 -140
  242. package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
  243. package/fesm2022/taiga-ui-kit-components-pin.mjs +7 -7
  244. package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
  245. package/fesm2022/taiga-ui-kit-components-preview.mjs +68 -48
  246. package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
  247. package/fesm2022/taiga-ui-kit-components-progress.mjs +36 -45
  248. package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
  249. package/fesm2022/taiga-ui-kit-components-pulse.mjs +7 -11
  250. package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
  251. package/fesm2022/taiga-ui-kit-components-push.mjs +22 -23
  252. package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
  253. package/fesm2022/taiga-ui-kit-components-radio-list.mjs +8 -8
  254. package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
  255. package/fesm2022/taiga-ui-kit-components-radio.mjs +8 -9
  256. package/fesm2022/taiga-ui-kit-components-radio.mjs.map +1 -1
  257. package/fesm2022/taiga-ui-kit-components-range.mjs +8 -11
  258. package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
  259. package/fesm2022/taiga-ui-kit-components-rating.mjs +7 -12
  260. package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
  261. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs +11 -7
  262. package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs.map +1 -1
  263. package/fesm2022/taiga-ui-kit-components-segmented.mjs +32 -59
  264. package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
  265. package/fesm2022/taiga-ui-kit-components-select.mjs +52 -29
  266. package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
  267. package/fesm2022/taiga-ui-kit-components-slider.mjs +23 -33
  268. package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
  269. package/fesm2022/taiga-ui-kit-components-status.mjs +6 -6
  270. package/fesm2022/taiga-ui-kit-components-stepper.mjs +45 -79
  271. package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
  272. package/fesm2022/taiga-ui-kit-components-switch.mjs +10 -6
  273. package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
  274. package/fesm2022/taiga-ui-kit-components-tabs.mjs +28 -36
  275. package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
  276. package/fesm2022/taiga-ui-kit-components-textarea.mjs +51 -52
  277. package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
  278. package/fesm2022/taiga-ui-kit-components-tiles.mjs +14 -15
  279. package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
  280. package/fesm2022/taiga-ui-kit-components-toast.mjs +27 -28
  281. package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
  282. package/fesm2022/taiga-ui-kit-components-tree.mjs +55 -58
  283. package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
  284. package/fesm2022/taiga-ui-kit-components.mjs +0 -3
  285. package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
  286. package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs +27 -0
  287. package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs.map +1 -0
  288. package/fesm2022/taiga-ui-kit-directives-button-close.mjs +3 -4
  289. package/fesm2022/taiga-ui-kit-directives-button-close.mjs.map +1 -1
  290. package/fesm2022/taiga-ui-kit-directives-button-group.mjs +7 -7
  291. package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
  292. package/fesm2022/taiga-ui-kit-directives-button-select.mjs +18 -10
  293. package/fesm2022/taiga-ui-kit-directives-button-select.mjs.map +1 -1
  294. package/fesm2022/taiga-ui-kit-directives-chevron.mjs +10 -9
  295. package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
  296. package/fesm2022/taiga-ui-kit-directives-connected.mjs +6 -7
  297. package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
  298. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs +25 -53
  299. package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs.map +1 -1
  300. package/fesm2022/taiga-ui-kit-directives-fade.mjs +25 -34
  301. package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
  302. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs +6 -12
  303. package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs.map +1 -1
  304. package/fesm2022/taiga-ui-kit-directives-highlight.mjs +16 -21
  305. package/fesm2022/taiga-ui-kit-directives-highlight.mjs.map +1 -1
  306. package/fesm2022/taiga-ui-kit-directives-password.mjs +10 -9
  307. package/fesm2022/taiga-ui-kit-directives-password.mjs.map +1 -1
  308. package/fesm2022/taiga-ui-kit-directives-present.mjs +10 -18
  309. package/fesm2022/taiga-ui-kit-directives-present.mjs.map +1 -1
  310. package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +6 -6
  311. package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +6 -6
  312. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +7 -6
  313. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
  314. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +9 -9
  315. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
  316. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs +8 -11
  317. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs.map +1 -1
  318. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs +10 -15
  319. package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs.map +1 -1
  320. package/fesm2022/taiga-ui-kit-directives.mjs +1 -1
  321. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs +43 -0
  322. package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs.map +1 -0
  323. package/fesm2022/taiga-ui-kit-pipes-emails.mjs +3 -4
  324. package/fesm2022/taiga-ui-kit-pipes-emails.mjs.map +1 -1
  325. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs +12 -25
  326. package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs.map +1 -1
  327. package/fesm2022/taiga-ui-kit-pipes-flag.mjs +30 -0
  328. package/fesm2022/taiga-ui-kit-pipes-flag.mjs.map +1 -0
  329. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs +4 -5
  330. package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs.map +1 -1
  331. package/fesm2022/taiga-ui-kit-pipes-initials.mjs +28 -0
  332. package/fesm2022/taiga-ui-kit-pipes-initials.mjs.map +1 -0
  333. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs +10 -9
  334. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs.map +1 -1
  335. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs +3 -4
  336. package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs.map +1 -1
  337. package/fesm2022/taiga-ui-kit-pipes-stringify.mjs +3 -4
  338. package/fesm2022/taiga-ui-kit-pipes-stringify.mjs.map +1 -1
  339. package/fesm2022/taiga-ui-kit-pipes.mjs +3 -0
  340. package/fesm2022/taiga-ui-kit-pipes.mjs.map +1 -1
  341. package/fesm2022/taiga-ui-kit-tokens.mjs +4 -123
  342. package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
  343. package/fesm2022/taiga-ui-kit-utils.mjs +3 -15
  344. package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
  345. package/package.json +66 -67
  346. package/pipes/auto-color/auto-color.pipe.d.ts +13 -0
  347. package/pipes/auto-color/index.d.ts +1 -0
  348. package/pipes/filter-by-input/filter-by-input.pipe.d.ts +2 -2
  349. package/pipes/flag/flag.pipe.d.ts +14 -0
  350. package/pipes/flag/index.d.ts +1 -0
  351. package/pipes/index.d.ts +3 -0
  352. package/pipes/initials/index.d.ts +1 -0
  353. package/pipes/initials/initials.pipe.d.ts +7 -0
  354. package/pipes/sort-countries/sort-countries.pipe.d.ts +4 -3
  355. package/pipes/stringify-content/stringify-content.pipe.d.ts +2 -3
  356. package/styles/components/avatar.less +14 -14
  357. package/styles/components/badge.less +3 -3
  358. package/styles/components/block.less +4 -4
  359. package/styles/components/chip.less +3 -3
  360. package/styles/components/comment.less +1 -1
  361. package/styles/components/message.less +1 -1
  362. package/styles/components/pin.less +3 -3
  363. package/styles/components/switch.less +2 -2
  364. package/styles/components/toast.less +1 -1
  365. package/tokens/i18n.d.ts +1 -0
  366. package/tokens/index.d.ts +0 -7
  367. package/utils/index.d.ts +0 -2
  368. package/components/elastic-container/elastic-container.component.d.ts +0 -8
  369. package/components/elastic-container/elastic-container.directive.d.ts +0 -7
  370. package/components/elastic-container/index.d.ts +0 -2
  371. package/components/floating-container/floating-container.directive.d.ts +0 -7
  372. package/components/floating-container/index.d.ts +0 -1
  373. package/components/input-range/input-range.d.ts +0 -3
  374. package/components/slides/index.d.ts +0 -1
  375. package/components/slides/slides.directive.d.ts +0 -11
  376. package/components/textarea/textarea-limit.directive.d.ts +0 -26
  377. package/directives/lazy-loading/index.d.ts +0 -2
  378. package/directives/lazy-loading/lazy-loading.directive.d.ts +0 -18
  379. package/directives/lazy-loading/lazy-loading.service.d.ts +0 -12
  380. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs +0 -78
  381. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs.map +0 -1
  382. package/fesm2022/taiga-ui-kit-components-floating-container.mjs +0 -37
  383. package/fesm2022/taiga-ui-kit-components-floating-container.mjs.map +0 -1
  384. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs +0 -64
  385. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs.map +0 -1
  386. package/fesm2022/taiga-ui-kit-components-slides.mjs +0 -49
  387. package/fesm2022/taiga-ui-kit-components-slides.mjs.map +0 -1
  388. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs +0 -81
  389. package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs.map +0 -1
  390. package/tokens/calendar-date-stream.d.ts +0 -10
  391. package/tokens/date-inputs-value-transformers.d.ts +0 -19
  392. package/tokens/input-date-options.d.ts +0 -15
  393. package/tokens/items-handlers.d.ts +0 -26
  394. package/tokens/mobile-calendar.d.ts +0 -6
  395. package/tokens/month-formatter.d.ts +0 -5
  396. package/utils/phone.d.ts +0 -3
  397. package/utils/toggle-day.d.ts +0 -2
@@ -2,9 +2,7 @@ import { TuiDayRange, TUI_FIRST_DAY, TUI_LAST_DAY, TuiDay, TuiMonth } from '@tai
2
2
  import { __decorate } from 'tslib';
3
3
  import * as i0 from '@angular/core';
4
4
  import { inject, ChangeDetectorRef, EventEmitter, Input, Output, ChangeDetectionStrategy, Component } from '@angular/core';
5
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
5
  import { TUI_FALSE_HANDLER } from '@taiga-ui/cdk/constants';
7
- import { tuiWatch } from '@taiga-ui/cdk/observables';
8
6
  import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
9
7
  import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
10
8
  import { tuiIsString, tuiNullableSame, tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
@@ -13,7 +11,7 @@ import * as i1 from '@taiga-ui/core/components/data-list';
13
11
  import { TuiDataList } from '@taiga-ui/core/components/data-list';
14
12
  import { TuiIcon } from '@taiga-ui/core/components/icon';
15
13
  import { TUI_COMMON_ICONS, tuiAsAuxiliary } from '@taiga-ui/core/tokens';
16
- import { TUI_OTHER_DATE_TEXT, TUI_CALENDAR_DATE_STREAM } from '@taiga-ui/kit/tokens';
14
+ import { TUI_OTHER_DATE_TEXT, TUI_DAY_RANGE_PERIODS } from '@taiga-ui/kit/tokens';
17
15
 
18
16
  const calculateDisabledItemHandler = (disabledItemHandler, value, minLength) => (item) => {
19
17
  if (!value || value instanceof TuiDayRange || !minLength) {
@@ -87,12 +85,6 @@ class TuiCalendarRange {
87
85
  (max === null || item.range.from.daySameOrBefore(max))),
88
86
  otherDateText || '',
89
87
  ];
90
- inject(TUI_CALENDAR_DATE_STREAM, { optional: true })
91
- ?.pipe(tuiWatch(), takeUntilDestroyed())
92
- .subscribe((value) => {
93
- this.currentValue = value;
94
- this.initDefaultViewedMonth();
95
- });
96
88
  }
97
89
  set valueSetter(value) {
98
90
  this.currentValue = value;
@@ -210,16 +202,16 @@ class TuiCalendarRange {
210
202
  findItemByDayRange(dayRange) {
211
203
  return this.items.find((item) => dayRange.daySame(item.range)) ?? null;
212
204
  }
213
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCalendarRange, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
214
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiCalendarRange, isStandalone: true, selector: "tui-calendar-range", inputs: { disabledItemHandler: "disabledItemHandler", markerHandler: "markerHandler", items: "items", min: "min", max: "max", minLength: "minLength", maxLength: "maxLength", item: "item", valueSetter: ["value", "valueSetter"], defaultViewedMonth: "defaultViewedMonth" }, outputs: { valueChange: "valueChange", itemChange: "itemChange" }, host: { listeners: { "document:keydown.capture": "onEsc($event)" }, properties: { "class._mobile": "mobile" } }, providers: [
205
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCalendarRange, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
206
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiCalendarRange, isStandalone: true, selector: "tui-calendar-range", inputs: { disabledItemHandler: "disabledItemHandler", markerHandler: "markerHandler", items: "items", min: "min", max: "max", minLength: "minLength", maxLength: "maxLength", item: "item", valueSetter: ["value", "valueSetter"], defaultViewedMonth: "defaultViewedMonth" }, outputs: { valueChange: "valueChange", itemChange: "itemChange" }, host: { listeners: { "document:keydown.capture": "onEsc($event)" }, properties: { "class._mobile": "mobile" } }, providers: [
215
207
  tuiAsAuxiliary(TuiCalendarRange),
216
208
  tuiCalendarSheetOptionsProvider({ rangeMode: true }),
217
- ], usesOnChanges: true, ngImport: i0, template: "<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n [icon]=\"icons.check\"\n [style.font-size.rem]=\"1\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n", styles: [":host:not(._mobile){display:flex;min-inline-size:30rem}.t-calendar{border-inline-end:1px solid var(--tui-border-normal)}\n"], dependencies: [{ kind: "component", type: TuiCalendar, selector: "tui-calendar", inputs: ["month", "disabledItemHandler", "min", "max", "minViewedMonth", "maxViewedMonth", "hoveredItem", "showAdjacent", "markerHandler", "value", "initialView"], outputs: ["dayClick", "monthChange", "hoveredItemChange"] }, { kind: "component", type: i1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "component", type: i1.TuiOption, selector: "button[tuiOption]:not([new]), a[tuiOption]:not([new]), label[tuiOption]:not([new])", inputs: ["disabled", "value"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
209
+ ], usesOnChanges: true, ngImport: i0, template: "<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n class=\"t-check\"\n [icon]=\"icons.check\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n", styles: [":host:not(._mobile){display:flex;min-inline-size:30rem}.t-calendar{border-inline-end:1px solid var(--tui-border-normal)}.t-check{font-size:1rem;margin-inline-start:auto}\n"], dependencies: [{ kind: "component", type: TuiCalendar, selector: "tui-calendar", inputs: ["month", "disabledItemHandler", "min", "max", "minViewedMonth", "maxViewedMonth", "hoveredItem", "showAdjacent", "markerHandler", "value", "initialView"], outputs: ["dayClick", "monthChange", "hoveredItemChange"] }, { kind: "component", type: i1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i1.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
218
210
  }
219
211
  __decorate([
220
212
  tuiPure
221
213
  ], TuiCalendarRange.prototype, "calculateDisabledItemHandler", null);
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCalendarRange, decorators: [{
214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCalendarRange, decorators: [{
223
215
  type: Component,
224
216
  args: [{ selector: 'tui-calendar-range', imports: [TuiCalendar, TuiDataList, TuiIcon, TuiMapperPipe], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
225
217
  tuiAsAuxiliary(TuiCalendarRange),
@@ -227,8 +219,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
227
219
  ], host: {
228
220
  '[class._mobile]': 'mobile',
229
221
  '(document:keydown.capture)': 'onEsc($event)',
230
- }, template: "<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n [icon]=\"icons.check\"\n [style.font-size.rem]=\"1\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n", styles: [":host:not(._mobile){display:flex;min-inline-size:30rem}.t-calendar{border-inline-end:1px solid var(--tui-border-normal)}\n"] }]
231
- }], ctorParameters: () => [], propDecorators: { disabledItemHandler: [{
222
+ }, template: "<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n class=\"t-check\"\n [icon]=\"icons.check\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n", styles: [":host:not(._mobile){display:flex;min-inline-size:30rem}.t-calendar{border-inline-end:1px solid var(--tui-border-normal)}.t-check{font-size:1rem;margin-inline-start:auto}\n"] }]
223
+ }], propDecorators: { disabledItemHandler: [{
232
224
  type: Input
233
225
  }], markerHandler: [{
234
226
  type: Input
@@ -265,14 +257,22 @@ class TuiDayRangePeriod {
265
257
  return this.name;
266
258
  }
267
259
  }
268
- function tuiCreateDefaultDayRangePeriods(periodTitles = [
269
- 'For all the time',
270
- 'Today',
271
- 'Yesterday',
272
- 'Current week',
273
- 'Current month',
274
- 'Previous month',
275
- ]) {
260
+ function getDefaultPeriodTitles() {
261
+ try {
262
+ return inject(TUI_DAY_RANGE_PERIODS)();
263
+ }
264
+ catch {
265
+ return [
266
+ 'For all the time',
267
+ 'Today',
268
+ 'Yesterday',
269
+ 'Current week',
270
+ 'Current month',
271
+ 'Previous month',
272
+ ];
273
+ }
274
+ }
275
+ function tuiCreateDefaultDayRangePeriods(periodTitles = getDefaultPeriodTitles()) {
276
276
  const today = TuiDay.currentLocal();
277
277
  const yesterday = today.append({ day: -1 });
278
278
  const startOfWeek = today.append({ day: -today.dayOfWeek() });
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-calendar-range.mjs","sources":["../../../projects/kit/components/calendar-range/calculate-disabled-item-handler.ts","../../../projects/kit/components/calendar-range/day-caps-mapper.ts","../../../projects/kit/components/calendar-range/calendar-range.component.ts","../../../projects/kit/components/calendar-range/calendar-range.template.html","../../../projects/kit/components/calendar-range/day-range-period.ts","../../../projects/kit/components/calendar-range/taiga-ui-kit-components-calendar-range.ts"],"sourcesContent":["import {type TuiDay, type TuiDayLike, TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {type TuiBooleanHandler} from '@taiga-ui/cdk/types';\n\nexport const calculateDisabledItemHandler: (\n disabledItemHandler: TuiBooleanHandler<TuiDay>,\n value: TuiDay | TuiDayRange | null,\n minLength: TuiDayLike | null,\n) => TuiBooleanHandler<TuiDay> = (disabledItemHandler, value, minLength) => (item) => {\n if (!value || value instanceof TuiDayRange || !minLength) {\n return disabledItemHandler(item);\n }\n\n const negativeMinLength = Object.fromEntries(\n Object.entries(minLength).map(([key, value]) => [key, -value]),\n );\n const disabledBefore = value.append(negativeMinLength).append({day: 1});\n const disabledAfter = value.append(minLength).append({day: -1});\n const inDisabledRange =\n disabledBefore.dayBefore(item) && disabledAfter.dayAfter(item);\n\n return inDisabledRange || disabledItemHandler(item);\n};\n","import {\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiDay,\n type TuiDayLike,\n TuiDayRange,\n} from '@taiga-ui/cdk/date-time';\nimport {type TuiMapper} from '@taiga-ui/cdk/types';\n\nexport const TUI_DAY_CAPS_MAPPER: TuiMapper<\n [TuiDay | null, TuiDay | TuiDayRange | null, TuiDayLike | null, boolean],\n TuiDay\n> = (current, value, maxLength, backwards) => {\n if (\n // TODO(v5): replace with `if (!(value instanceof TuiDay) || !maxLength)` (backward compatibility)\n (value instanceof TuiDayRange && !value.isSingleDay) ||\n !value ||\n !maxLength\n ) {\n return backwards ? current || TUI_FIRST_DAY : current || TUI_LAST_DAY;\n }\n\n const negativeMaxLength = Object.fromEntries(\n Object.entries(maxLength).map(([key, value]) => [key, -value]),\n );\n\n // TODO(v5): `value instanceof TuiDay` always `true`\n const from = value instanceof TuiDay ? value : value.from;\n const dateShift = from\n .append(backwards ? negativeMaxLength : maxLength)\n .append({day: !backwards ? -1 : 1});\n\n if (backwards) {\n return dateShift.dayBefore(current || TUI_FIRST_DAY)\n ? current || TUI_FIRST_DAY\n : dateShift;\n }\n\n if (!current) {\n return dateShift;\n }\n\n return dateShift.dayAfter(current) ? current : dateShift;\n};\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n type OnChanges,\n type OnInit,\n Output,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiDay,\n type TuiDayLike,\n TuiDayRange,\n TuiMonth,\n} from '@taiga-ui/cdk/date-time';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {type TuiBooleanHandler, type TuiMapper} from '@taiga-ui/cdk/types';\nimport {tuiIsString, tuiNullableSame, tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiCalendar,\n tuiCalendarSheetOptionsProvider,\n type TuiMarkerHandler,\n} from '@taiga-ui/core/components/calendar';\nimport {TuiDataList} from '@taiga-ui/core/components/data-list';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TUI_COMMON_ICONS, tuiAsAuxiliary} from '@taiga-ui/core/tokens';\nimport {TUI_CALENDAR_DATE_STREAM, TUI_OTHER_DATE_TEXT} from '@taiga-ui/kit/tokens';\nimport {type Observable} from 'rxjs';\n\nimport {calculateDisabledItemHandler} from './calculate-disabled-item-handler';\nimport {TUI_DAY_CAPS_MAPPER} from './day-caps-mapper';\nimport {type TuiDayRangePeriod} from './day-range-period';\n\n@Component({\n selector: 'tui-calendar-range',\n imports: [TuiCalendar, TuiDataList, TuiIcon, TuiMapperPipe],\n templateUrl: './calendar-range.template.html',\n styleUrl: './calendar-range.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsAuxiliary(TuiCalendarRange),\n tuiCalendarSheetOptionsProvider({rangeMode: true}),\n ],\n host: {\n '[class._mobile]': 'mobile',\n '(document:keydown.capture)': 'onEsc($event)',\n },\n})\nexport class TuiCalendarRange implements OnInit, OnChanges {\n /**\n * @deprecated use `item`\n */\n private selectedPeriod: TuiDayRangePeriod | null = null;\n private readonly cdr = inject(ChangeDetectorRef);\n\n protected currentValue: TuiDay | TuiDayRange | null = null;\n protected previousValue: TuiDay | TuiDayRange | null = null;\n protected hoveredItem: TuiDay | null = null;\n protected month: TuiMonth = TuiMonth.currentLocal();\n\n protected readonly otherDateText = inject(TUI_OTHER_DATE_TEXT);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly capsMapper = TUI_DAY_CAPS_MAPPER;\n protected readonly mobile = inject(TUI_IS_MOBILE);\n\n @Input()\n public disabledItemHandler: TuiBooleanHandler<TuiDay> = TUI_FALSE_HANDLER;\n\n @Input()\n public markerHandler: TuiMarkerHandler | null = null;\n\n @Input()\n public items: readonly TuiDayRangePeriod[] = [];\n\n @Input()\n public min: TuiDay | null = TUI_FIRST_DAY;\n\n @Input()\n public max: TuiDay | null = TUI_LAST_DAY;\n\n @Input()\n public minLength: TuiDayLike | null = null;\n\n @Input()\n public maxLength: TuiDayLike | null = null;\n\n @Input()\n public item: TuiDayRangePeriod | null = null;\n\n @Output()\n public readonly valueChange = new EventEmitter<TuiDayRange | null>();\n\n @Output()\n public readonly itemChange = new EventEmitter<TuiDayRangePeriod | null>();\n\n constructor() {\n inject<Observable<TuiDayRange | null>>(TUI_CALENDAR_DATE_STREAM, {optional: true})\n ?.pipe(tuiWatch(), takeUntilDestroyed())\n .subscribe((value) => {\n this.currentValue = value;\n this.initDefaultViewedMonth();\n });\n }\n\n @Input('value')\n public set valueSetter(value: TuiDayRange | null) {\n this.currentValue = value;\n }\n\n @Input()\n public set defaultViewedMonth(month: TuiMonth) {\n if (!this.currentValue) {\n this.month = month;\n }\n }\n\n public set value(value: TuiDayRange | null) {\n this.cdr.markForCheck();\n this.currentValue = value;\n this.initDefaultViewedMonth();\n }\n\n public get defaultViewedMonth(): TuiMonth {\n return this.month;\n }\n\n /**\n * @deprecated use `item`\n */\n public get selectedActivePeriod(): TuiDayRangePeriod | null {\n return this.selectedPeriod;\n }\n\n /**\n * @deprecated use `item`\n */\n public set selectedActivePeriod(period: TuiDayRangePeriod | null) {\n this.selectedPeriod = period;\n }\n\n public ngOnChanges(): void {\n if (!this.currentValue) {\n this.initDefaultViewedMonth();\n }\n }\n\n public ngOnInit(): void {\n this.initDefaultViewedMonth();\n }\n\n protected get calculatedDisabledItemHandler(): TuiBooleanHandler<TuiDay> {\n return this.calculateDisabledItemHandler(\n this.disabledItemHandler,\n this.currentValue,\n this.minLength,\n );\n }\n\n protected onEsc(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !(this.currentValue instanceof TuiDay)) {\n return;\n }\n\n event.stopPropagation();\n this.currentValue = this.previousValue;\n }\n\n protected readonly monthOffset: TuiMapper<[TuiMonth, number], TuiMonth> = (\n value,\n month,\n ) => value.append({month});\n\n protected readonly mapper: TuiMapper<\n [\n readonly TuiDayRangePeriod[],\n TuiDay | null,\n TuiDay | null,\n TuiDayLike | null,\n string | null | undefined,\n ],\n ReadonlyArray<TuiDayRangePeriod | string>\n > = (items, min, max, minLength, otherDateText) => [\n ...items.filter(\n (item) =>\n (minLength === null ||\n item.range.from\n .append(minLength)\n .append({day: -1})\n .daySameOrBefore(item.range.to)) &&\n (min === null || item.range.to.daySameOrAfter(min)) &&\n (max === null || item.range.from.daySameOrBefore(max)),\n ),\n otherDateText || '',\n ];\n\n protected isItemActive(item: TuiDayRangePeriod | string): boolean {\n const {activePeriod} = this;\n\n return (\n (tuiIsString(item) && activePeriod === null) ||\n activePeriod === item ||\n activePeriod?.toString() === item.toString()\n );\n }\n\n protected onItemSelect(item: TuiDayRangePeriod | string): void {\n if (!tuiIsString(item)) {\n this.selectedActivePeriod = item;\n this.itemChange.emit(item);\n this.updateValue(item.range.dayLimit(this.min, this.max));\n } else if (this.activePeriod !== null) {\n this.selectedActivePeriod = null;\n this.itemChange.emit(null);\n this.updateValue(null);\n }\n\n this.initDefaultViewedMonth();\n }\n\n protected onMonthChange(month: TuiMonth): void {\n this.month = month;\n }\n\n protected onDayClick(day: TuiDay): void {\n this.previousValue = this.currentValue;\n this.selectedActivePeriod = null;\n\n if (this.currentValue instanceof TuiDay) {\n const range = TuiDayRange.sort(this.currentValue, day);\n\n this.currentValue = range;\n this.itemChange.emit(this.findItemByDayRange(range));\n this.updateValue(range);\n } else {\n this.currentValue = day;\n }\n }\n\n protected updateValue(value: TuiDayRange | null): void {\n this.currentValue = value;\n this.valueChange.emit(value);\n }\n\n private get activePeriod(): TuiDayRangePeriod | null {\n return (\n this.item ??\n this.selectedActivePeriod ??\n (this.items.find((item) =>\n tuiNullableSame<TuiDayRange>(\n this.currentValue instanceof TuiDay\n ? new TuiDayRange(this.currentValue, this.currentValue)\n : this.currentValue,\n item.range,\n (a, b) =>\n a.from.daySame(b.from.dayLimit(this.min, this.max)) &&\n a.to.daySame(b.to.dayLimit(this.min, this.max)),\n ),\n ) ||\n null)\n );\n }\n\n @tuiPure\n private calculateDisabledItemHandler(\n disabledItemHandler: TuiBooleanHandler<TuiDay>,\n value: TuiDay | TuiDayRange | null,\n minLength: TuiDayLike | null,\n ): TuiBooleanHandler<TuiDay> {\n return calculateDisabledItemHandler(disabledItemHandler, value, minLength);\n }\n\n private initDefaultViewedMonth(): void {\n if (this.currentValue instanceof TuiDay) {\n this.month = this.currentValue;\n } else if (this.currentValue) {\n this.month = this.items.length\n ? this.currentValue.to\n : this.currentValue.from;\n } else if (this.max && this.month.monthSameOrAfter(this.max)) {\n this.month = this.items.length ? this.max : this.max.append({month: -1});\n } else if (this.min && this.month.monthSameOrBefore(this.min)) {\n this.month = this.min;\n }\n }\n\n private findItemByDayRange(dayRange: TuiDayRange): TuiDayRangePeriod | null {\n return this.items.find((item) => dayRange.daySame(item.range)) ?? null;\n }\n}\n","<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n [icon]=\"icons.check\"\n [style.font-size.rem]=\"1\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n","import {TUI_FIRST_DAY, TuiDay, TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport class TuiDayRangePeriod {\n constructor(\n public readonly range: TuiDayRange,\n private readonly name: string,\n public readonly content?: PolymorpheusContent<TuiContext<TuiDayRange>>,\n ) {}\n\n public toString(): string {\n return this.name;\n }\n}\n\nexport function tuiCreateDefaultDayRangePeriods(\n periodTitles: [string, string, string, string, string, string] = [\n 'For all the time',\n 'Today',\n 'Yesterday',\n 'Current week',\n 'Current month',\n 'Previous month',\n ],\n): readonly TuiDayRangePeriod[] {\n const today = TuiDay.currentLocal();\n const yesterday = today.append({day: -1});\n const startOfWeek = today.append({day: -today.dayOfWeek()});\n const endOfWeek = startOfWeek.append({day: 6});\n const startOfMonth = today.append({day: 1 - today.day});\n const endOfMonth = startOfMonth.append({month: 1, day: -1});\n const startOfLastMonth = startOfMonth.append({month: -1});\n\n return [\n new TuiDayRangePeriod(new TuiDayRange(TUI_FIRST_DAY, today), periodTitles[0]),\n new TuiDayRangePeriod(new TuiDayRange(today, today), periodTitles[1]),\n new TuiDayRangePeriod(new TuiDayRange(yesterday, yesterday), periodTitles[2]),\n new TuiDayRangePeriod(new TuiDayRange(startOfWeek, endOfWeek), periodTitles[3]),\n new TuiDayRangePeriod(new TuiDayRange(startOfMonth, endOfMonth), periodTitles[4]),\n new TuiDayRangePeriod(\n new TuiDayRange(startOfLastMonth, startOfMonth.append({day: -1})),\n periodTitles[5],\n ),\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],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K,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAC7E,QAAA,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AACrE,QAAA,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAC7E,QAAA,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAC/E,QAAA,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QACjF,IAAI,iBAAiB,CACjB,IAAI,WAAW,CAAC,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EACjE,YAAY,CAAC,CAAC,CAAC,CAClB;KACJ;AACL;;AC7CA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-kit-components-calendar-range.mjs","sources":["../../../projects/kit/components/calendar-range/calculate-disabled-item-handler.ts","../../../projects/kit/components/calendar-range/day-caps-mapper.ts","../../../projects/kit/components/calendar-range/calendar-range.component.ts","../../../projects/kit/components/calendar-range/calendar-range.template.html","../../../projects/kit/components/calendar-range/day-range-period.ts","../../../projects/kit/components/calendar-range/taiga-ui-kit-components-calendar-range.ts"],"sourcesContent":["import {type TuiDay, type TuiDayLike, TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {type TuiBooleanHandler} from '@taiga-ui/cdk/types';\n\nexport const calculateDisabledItemHandler: (\n disabledItemHandler: TuiBooleanHandler<TuiDay>,\n value: TuiDay | TuiDayRange | null,\n minLength: TuiDayLike | null,\n) => TuiBooleanHandler<TuiDay> = (disabledItemHandler, value, minLength) => (item) => {\n if (!value || value instanceof TuiDayRange || !minLength) {\n return disabledItemHandler(item);\n }\n\n const negativeMinLength = Object.fromEntries(\n Object.entries(minLength).map(([key, value]) => [key, -value]),\n );\n const disabledBefore = value.append(negativeMinLength).append({day: 1});\n const disabledAfter = value.append(minLength).append({day: -1});\n const inDisabledRange =\n disabledBefore.dayBefore(item) && disabledAfter.dayAfter(item);\n\n return inDisabledRange || disabledItemHandler(item);\n};\n","import {\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiDay,\n type TuiDayLike,\n TuiDayRange,\n} from '@taiga-ui/cdk/date-time';\nimport {type TuiMapper} from '@taiga-ui/cdk/types';\n\nexport const TUI_DAY_CAPS_MAPPER: TuiMapper<\n [TuiDay | null, TuiDay | TuiDayRange | null, TuiDayLike | null, boolean],\n TuiDay\n> = (current, value, maxLength, backwards) => {\n if (\n // TODO(v5): replace with `if (!(value instanceof TuiDay) || !maxLength)` (backward compatibility)\n (value instanceof TuiDayRange && !value.isSingleDay) ||\n !value ||\n !maxLength\n ) {\n return backwards ? current || TUI_FIRST_DAY : current || TUI_LAST_DAY;\n }\n\n const negativeMaxLength = Object.fromEntries(\n Object.entries(maxLength).map(([key, value]) => [key, -value]),\n );\n\n // TODO(v5): `value instanceof TuiDay` always `true`\n const from = value instanceof TuiDay ? value : value.from;\n const dateShift = from\n .append(backwards ? negativeMaxLength : maxLength)\n .append({day: !backwards ? -1 : 1});\n\n if (backwards) {\n return dateShift.dayBefore(current || TUI_FIRST_DAY)\n ? current || TUI_FIRST_DAY\n : dateShift;\n }\n\n if (!current) {\n return dateShift;\n }\n\n return dateShift.dayAfter(current) ? current : dateShift;\n};\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n type OnChanges,\n type OnInit,\n Output,\n} from '@angular/core';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiDay,\n type TuiDayLike,\n TuiDayRange,\n TuiMonth,\n} from '@taiga-ui/cdk/date-time';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {type TuiBooleanHandler, type TuiMapper} from '@taiga-ui/cdk/types';\nimport {tuiIsString, tuiNullableSame, tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiCalendar,\n tuiCalendarSheetOptionsProvider,\n type TuiMarkerHandler,\n} from '@taiga-ui/core/components/calendar';\nimport {TuiDataList} from '@taiga-ui/core/components/data-list';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TUI_COMMON_ICONS, tuiAsAuxiliary} from '@taiga-ui/core/tokens';\nimport {TUI_OTHER_DATE_TEXT} from '@taiga-ui/kit/tokens';\n\nimport {calculateDisabledItemHandler} from './calculate-disabled-item-handler';\nimport {TUI_DAY_CAPS_MAPPER} from './day-caps-mapper';\nimport {type TuiDayRangePeriod} from './day-range-period';\n\n@Component({\n selector: 'tui-calendar-range',\n imports: [TuiCalendar, TuiDataList, TuiIcon, TuiMapperPipe],\n templateUrl: './calendar-range.template.html',\n styleUrl: './calendar-range.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsAuxiliary(TuiCalendarRange),\n tuiCalendarSheetOptionsProvider({rangeMode: true}),\n ],\n host: {\n '[class._mobile]': 'mobile',\n '(document:keydown.capture)': 'onEsc($event)',\n },\n})\nexport class TuiCalendarRange implements OnInit, OnChanges {\n /**\n * @deprecated use `item`\n */\n private selectedPeriod: TuiDayRangePeriod | null = null;\n private readonly cdr = inject(ChangeDetectorRef);\n\n protected currentValue: TuiDay | TuiDayRange | null = null;\n protected previousValue: TuiDay | TuiDayRange | null = null;\n protected hoveredItem: TuiDay | null = null;\n protected month: TuiMonth = TuiMonth.currentLocal();\n\n protected readonly otherDateText = inject(TUI_OTHER_DATE_TEXT);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly capsMapper = TUI_DAY_CAPS_MAPPER;\n protected readonly mobile = inject(TUI_IS_MOBILE);\n\n @Input()\n public disabledItemHandler: TuiBooleanHandler<TuiDay> = TUI_FALSE_HANDLER;\n\n @Input()\n public markerHandler: TuiMarkerHandler | null = null;\n\n @Input()\n public items: readonly TuiDayRangePeriod[] = [];\n\n @Input()\n public min: TuiDay | null = TUI_FIRST_DAY;\n\n @Input()\n public max: TuiDay | null = TUI_LAST_DAY;\n\n @Input()\n public minLength: TuiDayLike | null = null;\n\n @Input()\n public maxLength: TuiDayLike | null = null;\n\n @Input()\n public item: TuiDayRangePeriod | null = null;\n\n @Output()\n public readonly valueChange = new EventEmitter<TuiDayRange | null>();\n\n @Output()\n public readonly itemChange = new EventEmitter<TuiDayRangePeriod | null>();\n\n @Input('value')\n public set valueSetter(value: TuiDayRange | null) {\n this.currentValue = value;\n }\n\n @Input()\n public set defaultViewedMonth(month: TuiMonth) {\n if (!this.currentValue) {\n this.month = month;\n }\n }\n\n public set value(value: TuiDayRange | null) {\n this.cdr.markForCheck();\n this.currentValue = value;\n this.initDefaultViewedMonth();\n }\n\n public get defaultViewedMonth(): TuiMonth {\n return this.month;\n }\n\n /**\n * @deprecated use `item`\n */\n public get selectedActivePeriod(): TuiDayRangePeriod | null {\n return this.selectedPeriod;\n }\n\n /**\n * @deprecated use `item`\n */\n public set selectedActivePeriod(period: TuiDayRangePeriod | null) {\n this.selectedPeriod = period;\n }\n\n public ngOnChanges(): void {\n if (!this.currentValue) {\n this.initDefaultViewedMonth();\n }\n }\n\n public ngOnInit(): void {\n this.initDefaultViewedMonth();\n }\n\n protected get calculatedDisabledItemHandler(): TuiBooleanHandler<TuiDay> {\n return this.calculateDisabledItemHandler(\n this.disabledItemHandler,\n this.currentValue,\n this.minLength,\n );\n }\n\n protected onEsc(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !(this.currentValue instanceof TuiDay)) {\n return;\n }\n\n event.stopPropagation();\n this.currentValue = this.previousValue;\n }\n\n protected readonly monthOffset: TuiMapper<[TuiMonth, number], TuiMonth> = (\n value,\n month,\n ) => value.append({month});\n\n protected readonly mapper: TuiMapper<\n [\n readonly TuiDayRangePeriod[],\n TuiDay | null,\n TuiDay | null,\n TuiDayLike | null,\n string | null | undefined,\n ],\n ReadonlyArray<TuiDayRangePeriod | string>\n > = (items, min, max, minLength, otherDateText) => [\n ...items.filter(\n (item) =>\n (minLength === null ||\n item.range.from\n .append(minLength)\n .append({day: -1})\n .daySameOrBefore(item.range.to)) &&\n (min === null || item.range.to.daySameOrAfter(min)) &&\n (max === null || item.range.from.daySameOrBefore(max)),\n ),\n otherDateText || '',\n ];\n\n protected isItemActive(item: TuiDayRangePeriod | string): boolean {\n const {activePeriod} = this;\n\n return (\n (tuiIsString(item) && activePeriod === null) ||\n activePeriod === item ||\n activePeriod?.toString() === item.toString()\n );\n }\n\n protected onItemSelect(item: TuiDayRangePeriod | string): void {\n if (!tuiIsString(item)) {\n this.selectedActivePeriod = item;\n this.itemChange.emit(item);\n this.updateValue(item.range.dayLimit(this.min, this.max));\n } else if (this.activePeriod !== null) {\n this.selectedActivePeriod = null;\n this.itemChange.emit(null);\n this.updateValue(null);\n }\n\n this.initDefaultViewedMonth();\n }\n\n protected onMonthChange(month: TuiMonth): void {\n this.month = month;\n }\n\n protected onDayClick(day: TuiDay): void {\n this.previousValue = this.currentValue;\n this.selectedActivePeriod = null;\n\n if (this.currentValue instanceof TuiDay) {\n const range = TuiDayRange.sort(this.currentValue, day);\n\n this.currentValue = range;\n this.itemChange.emit(this.findItemByDayRange(range));\n this.updateValue(range);\n } else {\n this.currentValue = day;\n }\n }\n\n protected updateValue(value: TuiDayRange | null): void {\n this.currentValue = value;\n this.valueChange.emit(value);\n }\n\n private get activePeriod(): TuiDayRangePeriod | null {\n return (\n this.item ??\n this.selectedActivePeriod ??\n (this.items.find((item) =>\n tuiNullableSame<TuiDayRange>(\n this.currentValue instanceof TuiDay\n ? new TuiDayRange(this.currentValue, this.currentValue)\n : this.currentValue,\n item.range,\n (a, b) =>\n a.from.daySame(b.from.dayLimit(this.min, this.max)) &&\n a.to.daySame(b.to.dayLimit(this.min, this.max)),\n ),\n ) ||\n null)\n );\n }\n\n @tuiPure\n private calculateDisabledItemHandler(\n disabledItemHandler: TuiBooleanHandler<TuiDay>,\n value: TuiDay | TuiDayRange | null,\n minLength: TuiDayLike | null,\n ): TuiBooleanHandler<TuiDay> {\n return calculateDisabledItemHandler(disabledItemHandler, value, minLength);\n }\n\n private initDefaultViewedMonth(): void {\n if (this.currentValue instanceof TuiDay) {\n this.month = this.currentValue;\n } else if (this.currentValue) {\n this.month = this.items.length\n ? this.currentValue.to\n : this.currentValue.from;\n } else if (this.max && this.month.monthSameOrAfter(this.max)) {\n this.month = this.items.length ? this.max : this.max.append({month: -1});\n } else if (this.min && this.month.monthSameOrBefore(this.min)) {\n this.month = this.min;\n }\n }\n\n private findItemByDayRange(dayRange: TuiDayRange): TuiDayRangePeriod | null {\n return this.items.find((item) => dayRange.daySame(item.range)) ?? null;\n }\n}\n","<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n class=\"t-check\"\n [icon]=\"icons.check\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n","import {inject} from '@angular/core';\nimport {TUI_FIRST_DAY, TuiDay, TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {type TuiLanguageKit} from '@taiga-ui/i18n/types';\nimport {TUI_DAY_RANGE_PERIODS} from '@taiga-ui/kit/tokens';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport class TuiDayRangePeriod {\n constructor(\n public readonly range: TuiDayRange,\n private readonly name: string,\n public readonly content?: PolymorpheusContent<TuiContext<TuiDayRange>>,\n ) {}\n\n public toString(): string {\n return this.name;\n }\n}\n\nfunction getDefaultPeriodTitles(): TuiLanguageKit['dayRangePeriods'] {\n try {\n return inject(TUI_DAY_RANGE_PERIODS)();\n } catch {\n return [\n 'For all the time',\n 'Today',\n 'Yesterday',\n 'Current week',\n 'Current month',\n 'Previous month',\n ];\n }\n}\n\nexport function tuiCreateDefaultDayRangePeriods(\n periodTitles: TuiLanguageKit['dayRangePeriods'] = getDefaultPeriodTitles(),\n): readonly TuiDayRangePeriod[] {\n const today = TuiDay.currentLocal();\n const yesterday = today.append({day: -1});\n const startOfWeek = today.append({day: -today.dayOfWeek()});\n const endOfWeek = startOfWeek.append({day: 6});\n const startOfMonth = today.append({day: 1 - today.day});\n const endOfMonth = startOfMonth.append({month: 1, day: -1});\n const startOfLastMonth = startOfMonth.append({month: -1});\n\n return [\n new TuiDayRangePeriod(new TuiDayRange(TUI_FIRST_DAY, today), periodTitles[0]),\n new TuiDayRangePeriod(new TuiDayRange(today, today), periodTitles[1]),\n new TuiDayRangePeriod(new TuiDayRange(yesterday, yesterday), periodTitles[2]),\n new TuiDayRangePeriod(new TuiDayRange(startOfWeek, endOfWeek), periodTitles[3]),\n new TuiDayRangePeriod(new TuiDayRange(startOfMonth, endOfMonth), periodTitles[4]),\n new TuiDayRangePeriod(\n new TuiDayRange(startOfLastMonth, startOfMonth.append({day: -1})),\n periodTitles[5],\n ),\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGa,MAAA,4BAA4B,GAIR,CAAC,mBAAmB,EAAE,KAAK,EAAE,SAAS,KAAK,CAAC,IAAI,KAAI;IACjF,IAAI,CAAC,KAAK,IAAI,KAAK,YAAY,WAAW,IAAI,CAAC,SAAS,EAAE;AACtD,QAAA,OAAO,mBAAmB,CAAC,IAAI,CAAC;;AAGpC,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CACxC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CACjE;AACD,IAAA,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,EAAC,GAAG,EAA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ACxDA;;AAEG;;;;"}
@@ -1,20 +1,18 @@
1
1
  import { TuiItem } from '@taiga-ui/cdk/directives/item';
2
- import { __decorate } from 'tslib';
3
- import { isPlatformServer, AsyncPipe, NgTemplateOutlet } from '@angular/common';
2
+ import { isPlatformServer, NgTemplateOutlet } from '@angular/common';
4
3
  import * as i0 from '@angular/core';
5
- import { inject, PLATFORM_ID, NgZone, Input, Directive, Output, ChangeDetectorRef, EventEmitter, TemplateRef, ContentChildren, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { inject, PLATFORM_ID, NgZone, input, Directive, Output, signal, computed, contentChildren, TemplateRef, effect, model, output, ChangeDetectionStrategy, Component } from '@angular/core';
6
5
  import * as i2 from '@ng-web-apis/intersection-observer';
7
6
  import { WaIntersectionObserver } from '@ng-web-apis/intersection-observer';
8
- import { TUI_FALSE_HANDLER, TUI_TRUE_HANDLER, EMPTY_QUERY } from '@taiga-ui/cdk/constants';
9
7
  import { TuiPan } from '@taiga-ui/cdk/directives/pan';
10
8
  import { TuiSwipe, TUI_SWIPE_OPTIONS } from '@taiga-ui/cdk/directives/swipe';
11
9
  import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
12
10
  import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
13
11
  import { tuiClamp } from '@taiga-ui/cdk/utils/math';
14
- import { tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
15
12
  import { WA_PAGE_VISIBILITY } from '@ng-web-apis/common';
13
+ import { TUI_FALSE_HANDLER, TUI_TRUE_HANDLER } from '@taiga-ui/cdk/constants';
16
14
  import { tuiTypedFromEvent, tuiIfMap, tuiZoneOptimized, tuiZonefreeScheduler } from '@taiga-ui/cdk/observables';
17
- import { Observable, BehaviorSubject, merge, map, EMPTY, combineLatest, interval, filter, throttleTime, tap } from 'rxjs';
15
+ import { Observable, Subject, merge, map, EMPTY, combineLatest, interval, filter, throttleTime, tap } from 'rxjs';
18
16
  import { tuiButtonOptionsProvider } from '@taiga-ui/core/components/button';
19
17
 
20
18
  class TuiCarouselDirective extends Observable {
@@ -24,38 +22,36 @@ class TuiCarouselDirective extends Observable {
24
22
  this.platform = inject(PLATFORM_ID);
25
23
  this.visible$ = inject(WA_PAGE_VISIBILITY);
26
24
  this.zone = inject(NgZone);
27
- this.duration$ = new BehaviorSubject(0);
25
+ this.trigger$ = new Subject();
28
26
  this.running$ = merge(tuiTypedFromEvent(this.el, 'mouseenter').pipe(map(TUI_FALSE_HANDLER)), tuiTypedFromEvent(this.el, 'touchstart').pipe(map(TUI_FALSE_HANDLER)), tuiTypedFromEvent(this.el, 'touchend').pipe(map(TUI_TRUE_HANDLER)), tuiTypedFromEvent(this.el, 'mouseleave').pipe(map(TUI_TRUE_HANDLER)), this.visible$);
27
+ this.duration = input(0);
29
28
  this.output$ = isPlatformServer(this.platform)
30
29
  ? EMPTY
31
- : combineLatest([this.duration$, this.running$]).pipe(tuiIfMap(([duration]) => interval(duration).pipe(tuiZoneOptimized(this.zone)), (values) => values.every(Boolean)));
30
+ : combineLatest([
31
+ this.trigger$.pipe(map(() => this.duration())),
32
+ this.running$,
33
+ ]).pipe(tuiIfMap(([duration]) => interval(duration).pipe(tuiZoneOptimized(this.zone)), (values) => values.every(Boolean)));
32
34
  }
33
- set duration(duration) {
34
- this.duration$.next(Number.isNaN(duration) ? this.duration$.value : duration);
35
+ restart() {
36
+ this.trigger$.next();
35
37
  }
36
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
37
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiCarouselDirective, isStandalone: true, inputs: { duration: "duration" }, usesInheritance: true, ngImport: i0 }); }
38
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
39
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiCarouselDirective, isStandalone: true, inputs: { duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
38
40
  }
39
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselDirective, decorators: [{
40
- type: Directive,
41
- args: [{
42
- standalone: true,
43
- }]
44
- }], ctorParameters: () => [], propDecorators: { duration: [{
45
- type: Input
46
- }] } });
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselDirective, decorators: [{
42
+ type: Directive
43
+ }], ctorParameters: () => [] });
47
44
 
48
45
  class TuiCarouselAutoscroll {
49
46
  constructor() {
50
47
  this.tuiCarouselAutoscroll = inject(TuiCarouselDirective);
51
48
  }
52
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselAutoscroll, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
53
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiCarouselAutoscroll, isStandalone: true, selector: "[tuiCarouselAutoscroll]", outputs: { tuiCarouselAutoscroll: "tuiCarouselAutoscroll" }, ngImport: i0 }); }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselAutoscroll, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
50
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiCarouselAutoscroll, isStandalone: true, selector: "[tuiCarouselAutoscroll]", outputs: { tuiCarouselAutoscroll: "tuiCarouselAutoscroll" }, ngImport: i0 }); }
54
51
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselAutoscroll, decorators: [{
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselAutoscroll, decorators: [{
56
53
  type: Directive,
57
54
  args: [{
58
- standalone: true,
59
55
  selector: '[tuiCarouselAutoscroll]',
60
56
  }]
61
57
  }], propDecorators: { tuiCarouselAutoscroll: [{
@@ -70,13 +66,12 @@ class TuiCarouselScroll {
70
66
  this.el.scrollLeft = 10;
71
67
  }));
72
68
  }
73
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselScroll, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
74
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiCarouselScroll, isStandalone: true, selector: "[tuiCarouselScroll]", outputs: { tuiCarouselScroll: "tuiCarouselScroll" }, ngImport: i0 }); }
69
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselScroll, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
70
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiCarouselScroll, isStandalone: true, selector: "[tuiCarouselScroll]", outputs: { tuiCarouselScroll: "tuiCarouselScroll" }, ngImport: i0 }); }
75
71
  }
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselScroll, decorators: [{
72
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselScroll, decorators: [{
77
73
  type: Directive,
78
74
  args: [{
79
- standalone: true,
80
75
  selector: '[tuiCarouselScroll]',
81
76
  }]
82
77
  }], propDecorators: { tuiCarouselScroll: [{
@@ -86,73 +81,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
86
81
  class TuiCarouselComponent {
87
82
  constructor() {
88
83
  this.el = tuiInjectElement();
89
- this.cdr = inject(ChangeDetectorRef);
90
84
  this.isMobile = inject(TUI_IS_MOBILE);
91
85
  this.directive = inject(TuiCarouselDirective);
92
- this.translate = 0;
93
- this.items = EMPTY_QUERY;
94
- this.transitioned = true;
95
- this.index = 0;
96
- this.draggable = false;
97
- this.itemsCount = 1;
98
- this.indexChange = new EventEmitter();
99
- this.shift = new EventEmitter();
100
- }
101
- set indexSetter(index) {
102
- this.index = index;
103
- this.directive.duration = NaN;
86
+ this.translate = signal(0);
87
+ this.transitioned = signal(true);
88
+ this.transform = computed(() => `translateX(${100 * this.x()}%)`);
89
+ this.items = contentChildren(TuiItem, { read: TemplateRef });
90
+ this.computedDraggable = computed(() => this.isMobile || this.draggable());
91
+ this.computedTranslate = computed(() => -this.index() / this.itemsCount());
92
+ this.x = computed(() => this.transitioned() ? this.computedTranslate() : this.translate());
93
+ this.resetDuration = effect(() => {
94
+ this.index();
95
+ this.directive.restart();
96
+ });
97
+ this.draggable = input(false);
98
+ this.itemsCount = input(1);
99
+ this.index = model(0);
100
+ this.shift = output();
104
101
  }
105
102
  next() {
106
- if (this.items && this.index === this.items.length - this.itemsCount) {
107
- return;
103
+ if (this.index() !== this.items().length - this.itemsCount()) {
104
+ this.updateIndex(this.index() + 1);
108
105
  }
109
- this.updateIndex(this.index + 1);
110
106
  }
111
107
  prev() {
112
- this.updateIndex(this.index - 1);
113
- }
114
- get transform() {
115
- return `translateX(${100 * this.x}%)`;
116
- }
117
- getStyle(itemsCount) {
118
- const percent = `${100 / itemsCount}%`;
119
- return {
120
- flexBasis: percent,
121
- minWidth: percent,
122
- maxWidth: percent,
123
- };
108
+ this.updateIndex(this.index() - 1);
124
109
  }
125
110
  onTransitioned(transitioned) {
126
- this.transitioned = transitioned;
111
+ this.transitioned.set(transitioned);
127
112
  if (!transitioned) {
128
- this.translate = this.computedTranslate;
113
+ this.translate.set(this.computedTranslate());
129
114
  }
130
115
  this.onShift();
131
116
  }
132
117
  isDisabled(index) {
133
- return index < this.index || index >= this.index + this.itemsCount;
118
+ return index < this.index() || index >= this.index() + this.itemsCount();
134
119
  }
135
- onIntersection({ intersectionRatio }, index) {
136
- if (intersectionRatio && intersectionRatio >= 0.5 && !this.transitioned) {
137
- this.updateIndex(this.index < index ? index - this.itemsCount + 1 : index);
120
+ onIntersection(ratio, index) {
121
+ if (ratio && ratio >= 0.5 && !this.transitioned()) {
122
+ this.updateIndex(this.index() < index ? index - this.itemsCount() + 1 : index);
138
123
  }
139
124
  }
140
125
  onScroll(delta) {
141
126
  if (!this.isMobile) {
142
- if (delta > 0) {
143
- this.next();
144
- }
145
- else {
146
- this.prev();
147
- }
127
+ this.onSwipe(delta > 0 ? 'left' : 'right');
148
128
  }
149
129
  }
150
130
  onPan(x) {
151
- if (!this.computedDraggable) {
131
+ if (!this.computedDraggable()) {
152
132
  return;
153
133
  }
154
- const min = 1 - this.items.length / this.itemsCount;
155
- this.translate = tuiClamp(x / this.el.clientWidth + this.translate, min, 0);
134
+ const min = 1 - this.items().length / this.itemsCount();
135
+ this.translate.set(tuiClamp(x / this.el.clientWidth + this.translate(), min, 0));
156
136
  this.onShift();
157
137
  }
158
138
  onSwipe(direction) {
@@ -164,35 +144,20 @@ class TuiCarouselComponent {
164
144
  }
165
145
  }
166
146
  onAutoscroll() {
167
- this.updateIndex(this.index === this.items.length - 1 ? 0 : this.index + 1);
147
+ this.updateIndex(this.index() === this.items().length - 1 ? 0 : this.index() + 1);
168
148
  }
169
149
  onShift() {
170
- this.shift.emit(Math.abs((this.x % 1) + 0.5) * 2);
171
- }
172
- get x() {
173
- return this.transitioned ? this.computedTranslate : this.translate;
174
- }
175
- get computedTranslate() {
176
- return -this.index / this.itemsCount;
177
- }
178
- get computedDraggable() {
179
- return this.isMobile || this.draggable;
150
+ this.shift.emit(Math.abs((this.x() % 1) + 0.5) * 2);
180
151
  }
181
152
  updateIndex(index) {
182
- this.index = tuiClamp(index, 0, this.items.length - 1);
183
- this.indexChange.emit(this.index);
184
- this.cdr.markForCheck();
153
+ this.index.set(tuiClamp(index, 0, this.items().length - 1));
185
154
  }
186
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
187
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiCarouselComponent, isStandalone: true, selector: "tui-carousel", inputs: { draggable: "draggable", itemsCount: "itemsCount", indexSetter: ["index", "indexSetter"] }, outputs: { indexChange: "indexChange", shift: "shift" }, host: { listeners: { "touchstart": "onTransitioned(false)", "touchend": "onTransitioned(true)", "mousedown": "onTransitioned(false)", "document:mouseup.zoneless": "onTransitioned(true)" }, properties: { "class._transitioned": "transitioned", "class._draggable": "draggable" } }, providers: [{ provide: TUI_SWIPE_OPTIONS, useValue: { timeout: 200, threshold: 30 } }], queries: [{ propertyName: "items", predicate: TuiItem, read: TemplateRef }], hostDirectives: [{ directive: TuiCarouselDirective, inputs: ["duration", "duration"] }], ngImport: i0, template: "@if (items.changes | async) {}\n<div\n class=\"t-scroller\"\n (tuiCarouselScroll)=\"onScroll($event)\"\n>\n <div\n waIntersectionObserver\n waIntersectionThreshold=\"0.5\"\n class=\"t-wrapper\"\n >\n <div\n class=\"t-items\"\n [style.transform]=\"transform\"\n (tuiCarouselAutoscroll)=\"onAutoscroll()\"\n (tuiPan)=\"onPan($event[0])\"\n (tuiSwipe)=\"onSwipe($event.direction)\"\n >\n @for (item of items; track item) {\n <fieldset\n class=\"t-item\"\n [disabled]=\"isDisabled($index)\"\n [style]=\"getStyle(itemsCount)\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0], $index)\"\n >\n <ng-container [ngTemplateOutlet]=\"item\" />\n </fieldset>\n }\n </div>\n </div>\n</div>\n", styles: [":host{position:relative;display:block;overflow:hidden}:host._draggable{-webkit-user-select:none;user-select:none}:host._draggable:hover{cursor:grab}:host._draggable:active{cursor:grabbing}.t-items{display:flex}:host._transitioned .t-items{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}::ng-deep [tuiCarouselButtons] [tuiIconButton]{border-radius:100%}.t-item{display:flex;flex-direction:column;justify-content:center;padding:var(--tui-carousel-padding, 0 1.25rem);flex:1;min-inline-size:100%;max-inline-size:100%;box-sizing:border-box;border:none;margin:0}.t-wrapper{position:sticky;left:0;right:0;min-inline-size:100%;overflow:hidden}.t-scroller{scrollbar-width:none;-ms-overflow-style:none;display:flex;overflow:auto;overscroll-behavior-x:none;touch-action:pan-y}.t-scroller::-webkit-scrollbar,.t-scroller::-webkit-scrollbar-thumb{display:none}.t-scroller:before,.t-scroller:after{content:\"\";display:block;min-inline-size:1rem}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TuiCarouselAutoscroll, selector: "[tuiCarouselAutoscroll]", outputs: ["tuiCarouselAutoscroll"] }, { kind: "directive", type: TuiCarouselScroll, selector: "[tuiCarouselScroll]", outputs: ["tuiCarouselScroll"] }, { kind: "directive", type: TuiPan, selector: "[tuiPan]", outputs: ["tuiPan"] }, { kind: "directive", type: TuiSwipe, selector: "[tuiSwipe]", outputs: ["tuiSwipe"] }, { kind: "directive", type: i2.WaIntersectionObserverDirective, selector: "[waIntersectionObserver]", inputs: ["waIntersectionRootMargin", "waIntersectionThreshold"], exportAs: ["IntersectionObserver"] }, { kind: "directive", type: i2.WaIntersectionObservee, selector: "[waIntersectionObservee]", outputs: ["waIntersectionObservee"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
155
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
156
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiCarouselComponent, isStandalone: true, selector: "tui-carousel", inputs: { draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, itemsCount: { classPropertyName: "itemsCount", publicName: "itemsCount", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { index: "indexChange", shift: "shift" }, host: { listeners: { "touchstart": "onTransitioned(false)", "touchend": "onTransitioned(true)", "mousedown": "onTransitioned(false)", "document:mouseup.zoneless": "onTransitioned(true)" }, properties: { "class._transitioned": "transitioned()", "class._draggable": "draggable()" } }, providers: [{ provide: TUI_SWIPE_OPTIONS, useValue: { timeout: 200, threshold: 30 } }], queries: [{ propertyName: "items", predicate: TuiItem, read: TemplateRef, isSignal: true }], hostDirectives: [{ directive: TuiCarouselDirective, inputs: ["duration", "duration"] }], ngImport: i0, template: "<div\n class=\"t-scroller\"\n (tuiCarouselScroll)=\"onScroll($event)\"\n>\n <div\n waIntersectionObserver\n waIntersectionThreshold=\"0.5\"\n class=\"t-wrapper\"\n >\n <div\n class=\"t-items\"\n [style.transform]=\"transform()\"\n (tuiCarouselAutoscroll)=\"onAutoscroll()\"\n (tuiPan)=\"onPan($event[0])\"\n (tuiSwipe)=\"onSwipe($event.direction)\"\n >\n @for (item of items(); track $index) {\n <fieldset\n class=\"t-item\"\n [disabled]=\"isDisabled($index)\"\n [style.flex-basis.%]=\"100 / itemsCount()\"\n [style.max-width.%]=\"100 / itemsCount()\"\n [style.min-width.%]=\"100 / itemsCount()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0].intersectionRatio, $index)\"\n >\n <ng-container [ngTemplateOutlet]=\"item\" />\n </fieldset>\n }\n </div>\n </div>\n</div>\n", styles: [":host{position:relative;display:block;overflow:hidden}:host._draggable{-webkit-user-select:none;user-select:none}:host._draggable:hover{cursor:grab}:host._draggable:active{cursor:grabbing}.t-items{display:flex}:host._transitioned .t-items{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}::ng-deep [tuiCarouselButtons] [tuiIconButton]{border-radius:100%}.t-item{display:flex;flex-direction:column;justify-content:center;padding:var(--tui-carousel-padding, 0 1.25rem);flex:1;min-inline-size:100%;max-inline-size:100%;box-sizing:border-box;border:none;margin:0}.t-wrapper{position:sticky;left:0;right:0;min-inline-size:100%;overflow:hidden}.t-scroller{scrollbar-width:none;-ms-overflow-style:none;display:flex;overflow:auto;overscroll-behavior-x:none;touch-action:pan-y}.t-scroller::-webkit-scrollbar,.t-scroller::-webkit-scrollbar-thumb{display:none}.t-scroller:before,.t-scroller:after{content:\"\";display:block;min-inline-size:1rem}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TuiCarouselAutoscroll, selector: "[tuiCarouselAutoscroll]", outputs: ["tuiCarouselAutoscroll"] }, { kind: "directive", type: TuiCarouselScroll, selector: "[tuiCarouselScroll]", outputs: ["tuiCarouselScroll"] }, { kind: "directive", type: TuiPan, selector: "[tuiPan]", outputs: ["tuiPan"] }, { kind: "directive", type: TuiSwipe, selector: "[tuiSwipe]", outputs: ["tuiSwipe"] }, { kind: "directive", type: i2.WaIntersectionObserverDirective, selector: "[waIntersectionObserver]", inputs: ["waIntersectionRootMargin", "waIntersectionThreshold"], exportAs: ["IntersectionObserver"] }, { kind: "directive", type: i2.WaIntersectionObservee, selector: "[waIntersectionObservee]", outputs: ["waIntersectionObservee"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
188
157
  }
189
- __decorate([
190
- tuiPure
191
- ], TuiCarouselComponent.prototype, "getStyle", null);
192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselComponent, decorators: [{
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselComponent, decorators: [{
193
159
  type: Component,
194
160
  args: [{ selector: 'tui-carousel', imports: [
195
- AsyncPipe,
196
161
  NgTemplateOutlet,
197
162
  TuiCarouselAutoscroll,
198
163
  TuiCarouselScroll,
@@ -205,42 +170,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
205
170
  inputs: ['duration'],
206
171
  },
207
172
  ], host: {
208
- '[class._transitioned]': 'transitioned',
209
- '[class._draggable]': 'draggable',
173
+ '[class._transitioned]': 'transitioned()',
174
+ '[class._draggable]': 'draggable()',
210
175
  '(touchstart)': 'onTransitioned(false)',
211
176
  '(touchend)': 'onTransitioned(true)',
212
177
  '(mousedown)': 'onTransitioned(false)',
213
178
  '(document:mouseup.zoneless)': 'onTransitioned(true)',
214
- }, template: "@if (items.changes | async) {}\n<div\n class=\"t-scroller\"\n (tuiCarouselScroll)=\"onScroll($event)\"\n>\n <div\n waIntersectionObserver\n waIntersectionThreshold=\"0.5\"\n class=\"t-wrapper\"\n >\n <div\n class=\"t-items\"\n [style.transform]=\"transform\"\n (tuiCarouselAutoscroll)=\"onAutoscroll()\"\n (tuiPan)=\"onPan($event[0])\"\n (tuiSwipe)=\"onSwipe($event.direction)\"\n >\n @for (item of items; track item) {\n <fieldset\n class=\"t-item\"\n [disabled]=\"isDisabled($index)\"\n [style]=\"getStyle(itemsCount)\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0], $index)\"\n >\n <ng-container [ngTemplateOutlet]=\"item\" />\n </fieldset>\n }\n </div>\n </div>\n</div>\n", styles: [":host{position:relative;display:block;overflow:hidden}:host._draggable{-webkit-user-select:none;user-select:none}:host._draggable:hover{cursor:grab}:host._draggable:active{cursor:grabbing}.t-items{display:flex}:host._transitioned .t-items{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}::ng-deep [tuiCarouselButtons] [tuiIconButton]{border-radius:100%}.t-item{display:flex;flex-direction:column;justify-content:center;padding:var(--tui-carousel-padding, 0 1.25rem);flex:1;min-inline-size:100%;max-inline-size:100%;box-sizing:border-box;border:none;margin:0}.t-wrapper{position:sticky;left:0;right:0;min-inline-size:100%;overflow:hidden}.t-scroller{scrollbar-width:none;-ms-overflow-style:none;display:flex;overflow:auto;overscroll-behavior-x:none;touch-action:pan-y}.t-scroller::-webkit-scrollbar,.t-scroller::-webkit-scrollbar-thumb{display:none}.t-scroller:before,.t-scroller:after{content:\"\";display:block;min-inline-size:1rem}\n"] }]
215
- }], propDecorators: { items: [{
216
- type: ContentChildren,
217
- args: [TuiItem, { read: TemplateRef }]
218
- }], draggable: [{
219
- type: Input
220
- }], itemsCount: [{
221
- type: Input
222
- }], indexChange: [{
223
- type: Output
224
- }], shift: [{
225
- type: Output
226
- }], indexSetter: [{
227
- type: Input,
228
- args: ['index']
229
- }], getStyle: [] } });
179
+ }, template: "<div\n class=\"t-scroller\"\n (tuiCarouselScroll)=\"onScroll($event)\"\n>\n <div\n waIntersectionObserver\n waIntersectionThreshold=\"0.5\"\n class=\"t-wrapper\"\n >\n <div\n class=\"t-items\"\n [style.transform]=\"transform()\"\n (tuiCarouselAutoscroll)=\"onAutoscroll()\"\n (tuiPan)=\"onPan($event[0])\"\n (tuiSwipe)=\"onSwipe($event.direction)\"\n >\n @for (item of items(); track $index) {\n <fieldset\n class=\"t-item\"\n [disabled]=\"isDisabled($index)\"\n [style.flex-basis.%]=\"100 / itemsCount()\"\n [style.max-width.%]=\"100 / itemsCount()\"\n [style.min-width.%]=\"100 / itemsCount()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0].intersectionRatio, $index)\"\n >\n <ng-container [ngTemplateOutlet]=\"item\" />\n </fieldset>\n }\n </div>\n </div>\n</div>\n", styles: [":host{position:relative;display:block;overflow:hidden}:host._draggable{-webkit-user-select:none;user-select:none}:host._draggable:hover{cursor:grab}:host._draggable:active{cursor:grabbing}.t-items{display:flex}:host._transitioned .t-items{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}::ng-deep [tuiCarouselButtons] [tuiIconButton]{border-radius:100%}.t-item{display:flex;flex-direction:column;justify-content:center;padding:var(--tui-carousel-padding, 0 1.25rem);flex:1;min-inline-size:100%;max-inline-size:100%;box-sizing:border-box;border:none;margin:0}.t-wrapper{position:sticky;left:0;right:0;min-inline-size:100%;overflow:hidden}.t-scroller{scrollbar-width:none;-ms-overflow-style:none;display:flex;overflow:auto;overscroll-behavior-x:none;touch-action:pan-y}.t-scroller::-webkit-scrollbar,.t-scroller::-webkit-scrollbar-thumb{display:none}.t-scroller:before,.t-scroller:after{content:\"\";display:block;min-inline-size:1rem}\n"] }]
180
+ }] });
230
181
 
231
182
  class TuiCarouselButtons {
232
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselButtons, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
233
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiCarouselButtons, isStandalone: true, selector: "[tuiCarouselButtons]", providers: [
183
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselButtons, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
184
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiCarouselButtons, isStandalone: true, selector: "[tuiCarouselButtons]", providers: [
234
185
  tuiButtonOptionsProvider({
235
186
  appearance: 'secondary',
236
187
  size: 'm',
237
188
  }),
238
189
  ], ngImport: i0 }); }
239
190
  }
240
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselButtons, decorators: [{
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselButtons, decorators: [{
241
192
  type: Directive,
242
193
  args: [{
243
- standalone: true,
244
194
  selector: '[tuiCarouselButtons]',
245
195
  providers: [
246
196
  tuiButtonOptionsProvider({