@taiga-ui/kit 4.52.0-canary.e444d19 → 4.52.0-canary.eb5ffe3

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 (306) hide show
  1. package/components/accordion/accordion.component.d.ts +13 -0
  2. package/components/accordion/accordion.d.ts +4 -4
  3. package/components/accordion/accordion.directive.d.ts +11 -10
  4. package/components/accordion/index.d.ts +1 -3
  5. package/components/action-bar/action-bar.component.d.ts +5 -7
  6. package/components/action-bar/index.d.ts +0 -2
  7. package/components/avatar/avatar-outline.directive.d.ts +3 -3
  8. package/components/avatar/avatar.directive.d.ts +15 -0
  9. package/components/avatar/avatar.options.d.ts +1 -4
  10. package/components/avatar/index.d.ts +1 -1
  11. package/components/badge/badge.directive.d.ts +2 -2
  12. package/components/block/block.directive.d.ts +4 -4
  13. package/components/block/block.options.d.ts +1 -1
  14. package/components/calendar-month/calendar-month.component.d.ts +1 -1
  15. package/components/calendar-month/calendar-month.options.d.ts +1 -1
  16. package/components/calendar-range/calendar-range.component.d.ts +1 -2
  17. package/components/checkbox/checkbox.component.d.ts +7 -18
  18. package/components/checkbox/checkbox.options.d.ts +5 -9
  19. package/components/chip/chip.directive.d.ts +2 -4
  20. package/components/comment/comment.directive.d.ts +2 -2
  21. package/components/confirm/confirm.component.d.ts +2 -1
  22. package/components/confirm/confirm.service.d.ts +2 -1
  23. package/{directives → components}/copy/copy.component.d.ts +1 -1
  24. package/{directives → components}/copy/copy.directive.d.ts +2 -2
  25. package/{directives → components}/copy/copy.options.d.ts +2 -2
  26. package/components/data-list-wrapper/data-list-group-wrapper.component.d.ts +2 -0
  27. package/components/files/file/file.options.d.ts +1 -1
  28. package/components/files/files/files.component.d.ts +2 -2
  29. package/components/floating-container/floating-container.directive.d.ts +2 -2
  30. package/components/fullscreen/fullscreen.component.d.ts +14 -0
  31. package/components/fullscreen/index.d.ts +1 -0
  32. package/components/index.d.ts +3 -2
  33. package/components/input-chip/input-chip.options.d.ts +1 -1
  34. package/components/input-color/input-color.component.d.ts +2 -2
  35. package/components/input-color/input-color.options.d.ts +1 -1
  36. package/components/input-date/input-date.options.d.ts +1 -1
  37. package/components/input-number/input-number.options.d.ts +1 -1
  38. package/components/input-number/quantum.directive.d.ts +1 -1
  39. package/components/input-number/step/input-number-step.component.d.ts +1 -1
  40. package/components/input-phone/input-phone.options.d.ts +1 -1
  41. package/components/input-phone-international/input-phone-international.component.d.ts +24 -30
  42. package/components/input-pin/input-pin.component.d.ts +1 -1
  43. package/components/input-range/input-range.component.d.ts +9 -12
  44. package/components/input-slider/input-slider.directive.d.ts +2 -4
  45. package/components/input-time/input-time.directive.d.ts +1 -0
  46. package/components/input-time/input-time.options.d.ts +1 -1
  47. package/components/like/like.component.d.ts +4 -11
  48. package/components/like/like.options.d.ts +3 -4
  49. package/components/line-clamp/line-clamp-box.component.d.ts +3 -4
  50. package/components/line-clamp/line-clamp.component.d.ts +8 -10
  51. package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +3 -3
  52. package/components/multi-select/multi-select-option/multi-select-option.component.d.ts +1 -1
  53. package/components/pager/pager.component.d.ts +1 -1
  54. package/components/pagination/pagination.component.d.ts +1 -1
  55. package/components/pin/pin.directive.d.ts +2 -2
  56. package/components/preview/pagination/preview-pagination.component.d.ts +1 -1
  57. package/components/preview/preview.component.d.ts +1 -1
  58. package/components/preview/zoom/preview-zoom.component.d.ts +1 -1
  59. package/components/progress/progress-bar/fixed-gradient/progress-fixed-gradient.directive.d.ts +1 -2
  60. package/components/progress/progress-segmented/progress-segmented.directive.d.ts +2 -2
  61. package/components/push/push-alert.component.d.ts +4 -3
  62. package/components/push/push.component.d.ts +2 -2
  63. package/components/push/push.directive.d.ts +4 -6
  64. package/components/push/push.options.d.ts +4 -8
  65. package/components/push/push.service.d.ts +6 -2
  66. package/components/radio/radio.component.d.ts +7 -8
  67. package/components/radio/radio.directive.d.ts +2 -2
  68. package/components/radio/radio.options.d.ts +2 -5
  69. package/components/range/range-change.directive.d.ts +1 -1
  70. package/components/range/range.component.d.ts +0 -5
  71. package/components/rating/rating.component.d.ts +5 -5
  72. package/components/rating/rating.options.d.ts +5 -3
  73. package/components/segmented/segmented.component.d.ts +1 -3
  74. package/components/slider/helpers/key-steps.d.ts +1 -2
  75. package/components/slider/helpers/slider-key-steps.directive.d.ts +12 -21
  76. package/components/slides/slides.directive.d.ts +4 -4
  77. package/components/status/status.directive.d.ts +2 -2
  78. package/components/switch/switch.component.d.ts +7 -19
  79. package/components/switch/switch.options.d.ts +4 -8
  80. package/components/tabs/tabs-with-more.component.d.ts +1 -1
  81. package/components/textarea/textarea-limit.directive.d.ts +4 -5
  82. package/components/textarea/textarea.options.d.ts +1 -1
  83. package/components/toast/index.d.ts +5 -0
  84. package/components/toast/toast.component.d.ts +18 -0
  85. package/components/toast/toast.d.ts +3 -0
  86. package/components/toast/toast.directive.d.ts +7 -0
  87. package/components/toast/toast.options.d.ts +9 -0
  88. package/components/toast/toast.service.d.ts +17 -0
  89. package/components/tree/components/tree-item-content/tree-item-content.component.d.ts +1 -1
  90. package/directives/button-select/button-select.directive.d.ts +1 -2
  91. package/directives/chevron/chevron.directive.d.ts +2 -3
  92. package/directives/fade/fade.directive.d.ts +1 -0
  93. package/directives/highlight/highlight.directive.d.ts +1 -3
  94. package/directives/index.d.ts +0 -1
  95. package/directives/password/password.options.d.ts +1 -1
  96. package/directives/sensitive/sensitive.directive.d.ts +2 -2
  97. package/directives/shimmer/shimmer.directive.d.ts +3 -3
  98. package/directives/skeleton/skeleton.directive.d.ts +3 -3
  99. package/directives/tooltip/tooltip.directive.d.ts +2 -2
  100. package/directives/tooltip/tooltip.options.d.ts +1 -4
  101. package/fesm2022/taiga-ui-kit-components-accordion.mjs +69 -144
  102. package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
  103. package/fesm2022/taiga-ui-kit-components-action-bar.mjs +22 -38
  104. package/fesm2022/taiga-ui-kit-components-action-bar.mjs.map +1 -1
  105. package/fesm2022/taiga-ui-kit-components-avatar.mjs +52 -70
  106. package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
  107. package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
  108. package/fesm2022/taiga-ui-kit-components-badge.mjs +11 -18
  109. package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
  110. package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
  111. package/fesm2022/taiga-ui-kit-components-block.mjs +15 -22
  112. package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
  113. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +3 -4
  114. package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
  115. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +3 -4
  116. package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
  117. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +4 -5
  118. package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
  119. package/fesm2022/taiga-ui-kit-components-carousel.mjs +2 -2
  120. package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
  121. package/fesm2022/taiga-ui-kit-components-checkbox.mjs +18 -75
  122. package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
  123. package/fesm2022/taiga-ui-kit-components-chip.mjs +20 -25
  124. package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
  125. package/fesm2022/taiga-ui-kit-components-combo-box.mjs +5 -5
  126. package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
  127. package/fesm2022/taiga-ui-kit-components-comment.mjs +11 -18
  128. package/fesm2022/taiga-ui-kit-components-comment.mjs.map +1 -1
  129. package/fesm2022/taiga-ui-kit-components-compass.mjs.map +1 -1
  130. package/fesm2022/taiga-ui-kit-components-confirm.mjs +8 -9
  131. package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
  132. package/fesm2022/{taiga-ui-kit-directives-copy.mjs → taiga-ui-kit-components-copy.mjs} +11 -12
  133. package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -0
  134. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs +14 -6
  135. package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
  136. package/fesm2022/taiga-ui-kit-components-drawer.mjs +2 -2
  137. package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
  138. package/fesm2022/taiga-ui-kit-components-elastic-container.mjs.map +1 -1
  139. package/fesm2022/taiga-ui-kit-components-files.mjs +12 -11
  140. package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
  141. package/fesm2022/taiga-ui-kit-components-filter.mjs +1 -1
  142. package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
  143. package/fesm2022/taiga-ui-kit-components-floating-container.mjs +11 -17
  144. package/fesm2022/taiga-ui-kit-components-floating-container.mjs.map +1 -1
  145. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +63 -0
  146. package/fesm2022/taiga-ui-kit-components-fullscreen.mjs.map +1 -0
  147. package/fesm2022/taiga-ui-kit-components-input-chip.mjs +10 -5
  148. package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
  149. package/fesm2022/taiga-ui-kit-components-input-color.mjs +6 -8
  150. package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
  151. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +3 -4
  152. package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs.map +1 -1
  153. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +1 -2
  154. package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
  155. package/fesm2022/taiga-ui-kit-components-input-date.mjs +5 -6
  156. package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
  157. package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
  158. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +5 -6
  159. package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
  160. package/fesm2022/taiga-ui-kit-components-input-month.mjs +5 -6
  161. package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
  162. package/fesm2022/taiga-ui-kit-components-input-number.mjs +10 -9
  163. package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
  164. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +103 -126
  165. package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
  166. package/fesm2022/taiga-ui-kit-components-input-phone.mjs +2 -3
  167. package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
  168. package/fesm2022/taiga-ui-kit-components-input-pin.mjs +2 -2
  169. package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
  170. package/fesm2022/taiga-ui-kit-components-input-range.mjs +31 -27
  171. package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
  172. package/fesm2022/taiga-ui-kit-components-input-slider.mjs +25 -39
  173. package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
  174. package/fesm2022/taiga-ui-kit-components-input-time.mjs +21 -5
  175. package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
  176. package/fesm2022/taiga-ui-kit-components-input-year.mjs +4 -5
  177. package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
  178. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +2 -2
  179. package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
  180. package/fesm2022/taiga-ui-kit-components-like.mjs +38 -31
  181. package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
  182. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +25 -64
  183. package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
  184. package/fesm2022/taiga-ui-kit-components-message.mjs +6 -8
  185. package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
  186. package/fesm2022/taiga-ui-kit-components-multi-select.mjs +17 -18
  187. package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
  188. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +2 -9
  189. package/fesm2022/taiga-ui-kit-components-notification-middle.mjs.map +1 -1
  190. package/fesm2022/taiga-ui-kit-components-pager.mjs +3 -3
  191. package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
  192. package/fesm2022/taiga-ui-kit-components-pagination.mjs +5 -6
  193. package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
  194. package/fesm2022/taiga-ui-kit-components-pin.mjs +13 -17
  195. package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
  196. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs +2 -2
  197. package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs.map +1 -1
  198. package/fesm2022/taiga-ui-kit-components-preview.mjs +13 -13
  199. package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
  200. package/fesm2022/taiga-ui-kit-components-progress.mjs +21 -34
  201. package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
  202. package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
  203. package/fesm2022/taiga-ui-kit-components-push.mjs +40 -47
  204. package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
  205. package/fesm2022/taiga-ui-kit-components-radio-list.mjs +2 -2
  206. package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
  207. package/fesm2022/taiga-ui-kit-components-radio.mjs +30 -35
  208. package/fesm2022/taiga-ui-kit-components-radio.mjs.map +1 -1
  209. package/fesm2022/taiga-ui-kit-components-range.mjs +4 -13
  210. package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
  211. package/fesm2022/taiga-ui-kit-components-rating.mjs +15 -19
  212. package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
  213. package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
  214. package/fesm2022/taiga-ui-kit-components-select.mjs +29 -22
  215. package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
  216. package/fesm2022/taiga-ui-kit-components-slider.mjs +57 -55
  217. package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
  218. package/fesm2022/taiga-ui-kit-components-slides.mjs +12 -20
  219. package/fesm2022/taiga-ui-kit-components-slides.mjs.map +1 -1
  220. package/fesm2022/taiga-ui-kit-components-status.mjs +10 -14
  221. package/fesm2022/taiga-ui-kit-components-status.mjs.map +1 -1
  222. package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
  223. package/fesm2022/taiga-ui-kit-components-switch.mjs +18 -64
  224. package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
  225. package/fesm2022/taiga-ui-kit-components-tabs.mjs +14 -17
  226. package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
  227. package/fesm2022/taiga-ui-kit-components-textarea.mjs +4 -11
  228. package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
  229. package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
  230. package/fesm2022/taiga-ui-kit-components-toast.mjs +165 -0
  231. package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -0
  232. package/fesm2022/taiga-ui-kit-components-tree.mjs +4 -4
  233. package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
  234. package/fesm2022/taiga-ui-kit-components.mjs +3 -2
  235. package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
  236. package/fesm2022/taiga-ui-kit-directives-button-group.mjs +6 -9
  237. package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
  238. package/fesm2022/taiga-ui-kit-directives-button-select.mjs +2 -9
  239. package/fesm2022/taiga-ui-kit-directives-button-select.mjs.map +1 -1
  240. package/fesm2022/taiga-ui-kit-directives-chevron.mjs +11 -18
  241. package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
  242. package/fesm2022/taiga-ui-kit-directives-connected.mjs +7 -12
  243. package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
  244. package/fesm2022/taiga-ui-kit-directives-fade.mjs +6 -9
  245. package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
  246. package/fesm2022/taiga-ui-kit-directives-password.mjs +5 -8
  247. package/fesm2022/taiga-ui-kit-directives-password.mjs.map +1 -1
  248. package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +11 -16
  249. package/fesm2022/taiga-ui-kit-directives-sensitive.mjs.map +1 -1
  250. package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +22 -32
  251. package/fesm2022/taiga-ui-kit-directives-shimmer.mjs.map +1 -1
  252. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +25 -36
  253. package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
  254. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +13 -18
  255. package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
  256. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs +2 -3
  257. package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs.map +1 -1
  258. package/fesm2022/taiga-ui-kit-directives.mjs +0 -1
  259. package/fesm2022/taiga-ui-kit-directives.mjs.map +1 -1
  260. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs +2 -1
  261. package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs.map +1 -1
  262. package/fesm2022/taiga-ui-kit-pipes.mjs +0 -1
  263. package/fesm2022/taiga-ui-kit-pipes.mjs.map +1 -1
  264. package/fesm2022/taiga-ui-kit-tokens.mjs +4 -7
  265. package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
  266. package/package.json +34 -37
  267. package/pipes/index.d.ts +0 -1
  268. package/styles/components/avatar.less +188 -0
  269. package/styles/components/badge.less +1 -0
  270. package/styles/components/checkbox.less +14 -12
  271. package/styles/components/chip.less +12 -3
  272. package/styles/components/like.less +4 -9
  273. package/styles/components/pin.less +3 -7
  274. package/styles/components/radio.less +1 -1
  275. package/styles/components/switch.less +9 -9
  276. package/styles/components/toast.less +44 -0
  277. package/tokens/i18n.d.ts +25 -26
  278. package/tokens/index.d.ts +0 -1
  279. package/tokens/input-date-options.d.ts +1 -1
  280. package/components/accordion/accordion-item-content.directive.d.ts +0 -6
  281. package/components/accordion/accordion-item-eager-content.directive.d.ts +0 -5
  282. package/components/accordion/accordion-item.component.d.ts +0 -25
  283. package/components/action-bar/action-bar.d.ts +0 -3
  284. package/components/action-bar/action-bar.directive.d.ts +0 -6
  285. package/components/avatar/avatar.component.d.ts +0 -15
  286. package/components/input-password/index.d.ts +0 -2
  287. package/components/input-password/input-password.component.d.ts +0 -16
  288. package/components/input-password/input-password.options.d.ts +0 -24
  289. package/components/pdf-viewer/index.d.ts +0 -4
  290. package/components/pdf-viewer/pdf-viewer.component.d.ts +0 -12
  291. package/components/pdf-viewer/pdf-viewer.directive.d.ts +0 -7
  292. package/components/pdf-viewer/pdf-viewer.options.d.ts +0 -13
  293. package/components/pdf-viewer/pdf-viewer.service.d.ts +0 -13
  294. package/fesm2022/taiga-ui-kit-components-input-password.mjs +0 -95
  295. package/fesm2022/taiga-ui-kit-components-input-password.mjs.map +0 -1
  296. package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs +0 -83
  297. package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs.map +0 -1
  298. package/fesm2022/taiga-ui-kit-directives-copy.mjs.map +0 -1
  299. package/fesm2022/taiga-ui-kit-pipes-field-error.mjs +0 -147
  300. package/fesm2022/taiga-ui-kit-pipes-field-error.mjs.map +0 -1
  301. package/pipes/field-error/field-error-content-pipe.d.ts +0 -14
  302. package/pipes/field-error/field-error-pipe.d.ts +0 -29
  303. package/pipes/field-error/index.d.ts +0 -2
  304. package/tokens/validation-errors.d.ts +0 -5
  305. /package/{directives → components}/copy/copy.d.ts +0 -0
  306. /package/{directives → components}/copy/index.d.ts +0 -0
@@ -1,83 +0,0 @@
1
- import { AsyncPipe } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, ChangeDetectionStrategy, Component, InjectionToken, Injectable, Directive } from '@angular/core';
4
- import * as i1 from '@taiga-ui/cdk/directives/animated';
5
- import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
6
- import { TuiButton } from '@taiga-ui/core/components/button';
7
- import { TUI_CLOSE_WORD, TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
8
- import { injectContext, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
9
- import { TuiPopoverDirective } from '@taiga-ui/cdk/directives/popover';
10
- import { TuiPopoverService, tuiAsPopover } from '@taiga-ui/cdk/services';
11
- import { TUI_DIALOGS } from '@taiga-ui/core/components/dialog';
12
- import { tuiProvideOptions } from '@taiga-ui/cdk/utils/miscellaneous';
13
-
14
- class TuiPdfViewerComponent {
15
- constructor() {
16
- this.closeWord$ = inject(TUI_CLOSE_WORD);
17
- this.icons = inject(TUI_COMMON_ICONS);
18
- this.context = injectContext();
19
- }
20
- onKeyDownEsc() {
21
- this.context.$implicit.complete();
22
- }
23
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPdfViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
24
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiPdfViewerComponent, isStandalone: true, selector: "tui-pdf-viewer", host: { listeners: { "document:keydown.esc": "onKeyDownEsc()" } }, hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "<header class=\"t-header\">\n <h2\n automation-id=\"tui-pdf-viewer__label\"\n class=\"t-title\"\n >\n {{ context.label }}\n </h2>\n <div class=\"t-actions\">\n <ng-container *polymorpheusOutlet=\"context.actions as text; context: context\">\n {{ text }}\n </ng-container>\n </div>\n <button\n appearance=\"\"\n size=\"s\"\n tuiIconButton\n type=\"button\"\n class=\"t-close\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"context.$implicit.complete()\"\n >\n {{ closeWord$ | async }}\n </button>\n</header>\n<section class=\"t-content\">\n <iframe\n *polymorpheusOutlet=\"context.content as content; context: context\"\n title=\"pdf\"\n class=\"t-iframe\"\n [src]=\"content\"\n ></iframe>\n</section>\n", styles: [":host{display:block;inline-size:100%;block-size:100%;box-sizing:border-box;color:#fff;background:#333639;padding-block-start:env(safe-area-inset-top);padding-block-end:env(safe-area-inset-bottom)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}.t-header{display:flex;align-items:center;block-size:4rem;padding:0 1rem 0 1.5625rem;box-shadow:inset 0 -1px #535659}.t-title{margin:0;font:var(--tui-font-text-m);white-space:nowrap;text-overflow:ellipsis;padding-inline-end:.3125rem;overflow:hidden}.t-actions{display:flex;margin-inline-start:auto}.t-close{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-inline-start:.75rem;color:#fff;background:#ffffff52}.t-close:hover{background:#fff6}.t-content{block-size:calc(100% - 4rem);overflow:hidden}.t-iframe{inline-size:100%;block-size:100%}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
25
- }
26
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPdfViewerComponent, decorators: [{
27
- type: Component,
28
- args: [{ selector: 'tui-pdf-viewer', imports: [AsyncPipe, PolymorpheusOutlet, TuiButton], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiAnimated], host: {
29
- '(document:keydown.esc)': 'onKeyDownEsc()',
30
- }, template: "<header class=\"t-header\">\n <h2\n automation-id=\"tui-pdf-viewer__label\"\n class=\"t-title\"\n >\n {{ context.label }}\n </h2>\n <div class=\"t-actions\">\n <ng-container *polymorpheusOutlet=\"context.actions as text; context: context\">\n {{ text }}\n </ng-container>\n </div>\n <button\n appearance=\"\"\n size=\"s\"\n tuiIconButton\n type=\"button\"\n class=\"t-close\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"context.$implicit.complete()\"\n >\n {{ closeWord$ | async }}\n </button>\n</header>\n<section class=\"t-content\">\n <iframe\n *polymorpheusOutlet=\"context.content as content; context: context\"\n title=\"pdf\"\n class=\"t-iframe\"\n [src]=\"content\"\n ></iframe>\n</section>\n", styles: [":host{display:block;inline-size:100%;block-size:100%;box-sizing:border-box;color:#fff;background:#333639;padding-block-start:env(safe-area-inset-top);padding-block-end:env(safe-area-inset-bottom)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}.t-header{display:flex;align-items:center;block-size:4rem;padding:0 1rem 0 1.5625rem;box-shadow:inset 0 -1px #535659}.t-title{margin:0;font:var(--tui-font-text-m);white-space:nowrap;text-overflow:ellipsis;padding-inline-end:.3125rem;overflow:hidden}.t-actions{display:flex;margin-inline-start:auto}.t-close{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-inline-start:.75rem;color:#fff;background:#ffffff52}.t-close:hover{background:#fff6}.t-content{block-size:calc(100% - 4rem);overflow:hidden}.t-iframe{inline-size:100%;block-size:100%}\n"] }]
31
- }] });
32
-
33
- const TUI_PDF_VIEWER_DEFAULT_OPTIONS = {
34
- label: '',
35
- actions: '',
36
- data: undefined,
37
- };
38
- /**
39
- * Default parameters for PdfViewer component
40
- */
41
- const TUI_PDF_VIEWER_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_PDF_VIEWER_OPTIONS' : '', {
42
- factory: () => TUI_PDF_VIEWER_DEFAULT_OPTIONS,
43
- });
44
- function tuiPdfViewerOptionsProvider(options) {
45
- return tuiProvideOptions(TUI_PDF_VIEWER_OPTIONS, options, TUI_PDF_VIEWER_DEFAULT_OPTIONS);
46
- }
47
-
48
- class TuiPdfViewerService extends TuiPopoverService {
49
- open(content, options = {}) {
50
- return super.open(content, options);
51
- }
52
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPdfViewerService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
53
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPdfViewerService, providedIn: 'root', useFactory: () => new TuiPdfViewerService(TUI_DIALOGS, TuiPdfViewerComponent, inject(TUI_PDF_VIEWER_OPTIONS)) }); }
54
- }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPdfViewerService, decorators: [{
56
- type: Injectable,
57
- args: [{
58
- providedIn: 'root',
59
- useFactory: () => new TuiPdfViewerService(TUI_DIALOGS, TuiPdfViewerComponent, inject(TUI_PDF_VIEWER_OPTIONS)),
60
- }]
61
- }] });
62
-
63
- class TuiPdfViewerDirective extends TuiPopoverDirective {
64
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPdfViewerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
65
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiPdfViewerDirective, isStandalone: true, selector: "ng-template[tuiPdfViewer]", inputs: { options: ["tuiPdfViewerOptions", "options"], open: ["tuiPdfViewer", "open"] }, outputs: { openChange: "tuiPdfViewerChange" }, providers: [tuiAsPopover(TuiPdfViewerService)], usesInheritance: true, ngImport: i0 }); }
66
- }
67
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPdfViewerDirective, decorators: [{
68
- type: Directive,
69
- args: [{
70
- standalone: true,
71
- selector: 'ng-template[tuiPdfViewer]',
72
- inputs: ['options: tuiPdfViewerOptions', 'open: tuiPdfViewer'],
73
- outputs: ['openChange: tuiPdfViewerChange'],
74
- providers: [tuiAsPopover(TuiPdfViewerService)],
75
- }]
76
- }] });
77
-
78
- /**
79
- * Generated bundle index. Do not edit.
80
- */
81
-
82
- export { TUI_PDF_VIEWER_DEFAULT_OPTIONS, TUI_PDF_VIEWER_OPTIONS, TuiPdfViewerComponent, TuiPdfViewerDirective, TuiPdfViewerService, tuiPdfViewerOptionsProvider };
83
- //# sourceMappingURL=taiga-ui-kit-components-pdf-viewer.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taiga-ui-kit-components-pdf-viewer.mjs","sources":["../../../projects/kit/components/pdf-viewer/pdf-viewer.component.ts","../../../projects/kit/components/pdf-viewer/pdf-viewer.template.html","../../../projects/kit/components/pdf-viewer/pdf-viewer.options.ts","../../../projects/kit/components/pdf-viewer/pdf-viewer.service.ts","../../../projects/kit/components/pdf-viewer/pdf-viewer.directive.ts","../../../projects/kit/components/pdf-viewer/taiga-ui-kit-components-pdf-viewer.ts"],"sourcesContent":["import {AsyncPipe} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {type TuiPopover} from '@taiga-ui/cdk/services';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TUI_CLOSE_WORD, TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {injectContext, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {type TuiPdfViewerOptions} from './pdf-viewer.options';\n\n@Component({\n selector: 'tui-pdf-viewer',\n imports: [AsyncPipe, PolymorpheusOutlet, TuiButton],\n templateUrl: './pdf-viewer.template.html',\n styleUrls: ['./pdf-viewer.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiAnimated],\n host: {\n '(document:keydown.esc)': 'onKeyDownEsc()',\n },\n})\nexport class TuiPdfViewerComponent<I, O> {\n protected readonly closeWord$ = inject(TUI_CLOSE_WORD);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly context = injectContext<TuiPopover<TuiPdfViewerOptions<I>, O>>();\n\n protected onKeyDownEsc(): void {\n this.context.$implicit.complete();\n }\n}\n","<header class=\"t-header\">\n <h2\n automation-id=\"tui-pdf-viewer__label\"\n class=\"t-title\"\n >\n {{ context.label }}\n </h2>\n <div class=\"t-actions\">\n <ng-container *polymorpheusOutlet=\"context.actions as text; context: context\">\n {{ text }}\n </ng-container>\n </div>\n <button\n appearance=\"\"\n size=\"s\"\n tuiIconButton\n type=\"button\"\n class=\"t-close\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"context.$implicit.complete()\"\n >\n {{ closeWord$ | async }}\n </button>\n</header>\n<section class=\"t-content\">\n <iframe\n *polymorpheusOutlet=\"context.content as content; context: context\"\n title=\"pdf\"\n class=\"t-iframe\"\n [src]=\"content\"\n ></iframe>\n</section>\n","import {InjectionToken, type Provider} from '@angular/core';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport const TUI_PDF_VIEWER_DEFAULT_OPTIONS: TuiPdfViewerOptions = {\n label: '',\n actions: '',\n data: undefined,\n};\n\n/**\n * Default parameters for PdfViewer component\n */\nexport const TUI_PDF_VIEWER_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_PDF_VIEWER_OPTIONS' : '',\n {\n factory: () => TUI_PDF_VIEWER_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiPdfViewerOptionsProvider(\n options: Partial<TuiPdfViewerOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_PDF_VIEWER_OPTIONS,\n options,\n TUI_PDF_VIEWER_DEFAULT_OPTIONS,\n );\n}\n\nexport interface TuiPdfViewerOptions<I = undefined> {\n readonly actions: PolymorpheusContent<TuiPdfViewerOptions<I>>;\n readonly data: I;\n readonly label: string;\n}\n","import {inject, Injectable} from '@angular/core';\nimport {type SafeResourceUrl} from '@angular/platform-browser';\nimport {type TuiPopoverContext, TuiPopoverService} from '@taiga-ui/cdk/services';\nimport {TUI_DIALOGS} from '@taiga-ui/core/components/dialog';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {type Observable} from 'rxjs';\n\nimport {TuiPdfViewerComponent} from './pdf-viewer.component';\nimport {TUI_PDF_VIEWER_OPTIONS, type TuiPdfViewerOptions} from './pdf-viewer.options';\n\ntype Content<G> = PolymorpheusContent<\n TuiPdfViewerOptions<unknown> & TuiPopoverContext<G>\n>;\n\n@Injectable({\n providedIn: 'root',\n useFactory: () =>\n new TuiPdfViewerService(\n TUI_DIALOGS,\n TuiPdfViewerComponent,\n inject(TUI_PDF_VIEWER_OPTIONS),\n ),\n})\nexport class TuiPdfViewerService extends TuiPopoverService<TuiPdfViewerOptions<unknown>> {\n public override open<G>(\n content: Content<G> | SafeResourceUrl,\n options: Partial<TuiPdfViewerOptions<any>> = {},\n ): Observable<G> {\n return super.open(content as Content<G>, options);\n }\n}\n","import {Directive} from '@angular/core';\nimport {TuiPopoverDirective} from '@taiga-ui/cdk/directives/popover';\nimport {tuiAsPopover} from '@taiga-ui/cdk/services';\n\nimport {type TuiPdfViewerOptions} from './pdf-viewer.options';\nimport {TuiPdfViewerService} from './pdf-viewer.service';\n\n@Directive({\n standalone: true,\n selector: 'ng-template[tuiPdfViewer]',\n inputs: ['options: tuiPdfViewerOptions', 'open: tuiPdfViewer'],\n outputs: ['openChange: tuiPdfViewerChange'],\n providers: [tuiAsPopover(TuiPdfViewerService)],\n})\nexport class TuiPdfViewerDirective<T> extends TuiPopoverDirective<\n TuiPdfViewerOptions<T>\n> {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;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BAAsB,CAAC,CACjC;AACR,iBAAA;;;ACRK,MAAO,qBAAyB,SAAQ,mBAE7C,CAAA;+GAFY,qBAAqB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,qBAAqB,gNAFnB,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAErC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,2BAA2B;AACrC,oBAAA,MAAM,EAAE,CAAC,8BAA8B,EAAE,oBAAoB,CAAC;oBAC9D,OAAO,EAAE,CAAC,gCAAgC,CAAC;AAC3C,oBAAA,SAAS,EAAE,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;AACjD,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"taiga-ui-kit-directives-copy.mjs","sources":["../../../projects/kit/directives/copy/copy.options.ts","../../../projects/kit/directives/copy/copy.component.ts","../../../projects/kit/directives/copy/copy.template.html","../../../projects/kit/directives/copy/copy.directive.ts","../../../projects/kit/directives/copy/copy.ts","../../../projects/kit/directives/copy/index.ts","../../../projects/kit/directives/copy/taiga-ui-kit-directives-copy.ts"],"sourcesContent":["import {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiCopyOptions {\n readonly icon: TuiStringHandler<TuiSizeL | TuiSizeS> | string;\n}\n\nexport const [TUI_COPY_OPTIONS, tuiCopyOptionsProvider] =\n tuiCreateOptions<TuiCopyOptions>({icon: '@tui.copy'});\n","import {ClipboardModule} from '@angular/cdk/clipboard';\nimport {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/components/notification';\nimport {TuiHint} from '@taiga-ui/core/directives/hint';\nimport {type TuiSizeL} from '@taiga-ui/core/types';\nimport {TUI_COPY_TEXTS} from '@taiga-ui/kit/tokens';\nimport {BehaviorSubject, map, startWith, switchMap, timer} from 'rxjs';\n\nimport {TUI_COPY_OPTIONS} from './copy.options';\n\n@Component({\n selector: 'tui-copy',\n imports: [ClipboardModule, TuiButton, TuiHint, TuiIcon],\n templateUrl: './copy.template.html',\n styleUrls: ['./copy.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size',\n '(pointerdown)': 'copied$.next(false)',\n },\n})\nexport class TuiCopyComponent {\n protected readonly notification = inject(TUI_NOTIFICATION_OPTIONS);\n protected readonly options = inject(TUI_COPY_OPTIONS);\n protected readonly copied$ = new BehaviorSubject<boolean>(false);\n protected readonly texts = toSignal(inject(TUI_COPY_TEXTS));\n protected readonly hint = toSignal(\n this.copied$.pipe(\n switchMap((copied) =>\n timer(2000).pipe(map(TUI_FALSE_HANDLER), startWith(copied)),\n ),\n ),\n );\n\n @Input()\n public size: TuiSizeL = 'm';\n\n protected get icon(): string {\n return tuiIsString(this.options.icon)\n ? this.options.icon\n : this.options.icon(this.size);\n }\n\n protected get check(): string {\n return tuiIsString(this.notification.icon)\n ? this.notification.icon\n : this.notification.icon('positive');\n }\n}\n","<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"content.textContent ?? ''\"\n [tuiHint]=\"template\"\n [tuiHintManual]=\"!!hint()\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n>\n <ng-content />\n</span>\n<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [attr.aria-label]=\"texts()?.[0]\"\n [cdkCopyToClipboard]=\"content.textContent ?? ''\"\n [iconStart]=\"icon\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n></button>\n<ng-template #template>\n <tui-icon\n class=\"t-icon\"\n [icon]=\"check\"\n />\n {{ texts()?.[1] }}\n</ng-template>\n","import {DOCUMENT} from '@angular/common';\nimport {computed, Directive, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiDirectiveBinding, tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {\n TUI_APPEARANCE_OPTIONS,\n TuiWithAppearance,\n} from '@taiga-ui/core/directives/appearance';\nimport {TuiHintDirective} from '@taiga-ui/core/directives/hint';\nimport {TuiIcons} from '@taiga-ui/core/directives/icons';\nimport {TUI_COPY_TEXTS} from '@taiga-ui/kit/tokens';\nimport {map, startWith, Subject, switchMap, timer} from 'rxjs';\n\nimport {TUI_COPY_OPTIONS} from './copy.options';\n\n@Directive({\n standalone: true,\n selector: 'tui-icon[tuiCopy]',\n providers: [\n {\n provide: TUI_APPEARANCE_OPTIONS,\n useValue: {appearance: 'icon'},\n },\n ],\n hostDirectives: [\n TuiWithAppearance,\n {\n directive: TuiHintDirective,\n inputs: ['tuiHintAppearance', 'tuiHintContext'],\n },\n ],\n host: {\n style: 'cursor: pointer',\n '(click)': 'copy()',\n '[style.pointer-events]': 'disabled ? \"none\" : null',\n '[style.opacity]': 'disabled ? \"var(--tui-disabled-opacity)\" : null',\n '[style.border-width.rem]': 'textfield.options.size() === \"l\" ? null : 0.25',\n },\n})\nexport class TuiCopyDirective {\n private readonly options = inject(TUI_COPY_OPTIONS);\n private readonly copied$ = new Subject<void>();\n private readonly doc = inject(DOCUMENT);\n\n protected readonly textfield = inject(TuiTextfieldComponent);\n protected readonly hint = tuiDirectiveBinding(\n TuiHintDirective,\n 'tuiHint',\n toSignal(\n inject(TUI_COPY_TEXTS).pipe(\n switchMap(([copy, copied]) =>\n this.copied$.pipe(\n switchMap(() =>\n timer(3000).pipe(\n map(() => copy),\n startWith(copied),\n ),\n ),\n startWith(copy),\n ),\n ),\n ),\n {initialValue: ''},\n ),\n );\n\n protected readonly icons = tuiDirectiveBinding(\n TuiIcons,\n 'iconStart',\n computed((size = this.textfield.options.size()) =>\n tuiIsString(this.options.icon) ? this.options.icon : this.options.icon(size),\n ),\n );\n\n @Input()\n public tuiCopy = '';\n\n protected get disabled(): boolean {\n return !this.textfield.input?.nativeElement.value;\n }\n\n protected copy(): void {\n this.textfield.input?.nativeElement.select();\n this.doc.execCommand('copy');\n this.copied$.next();\n }\n}\n","import {TuiCopyComponent} from './copy.component';\nimport {TuiCopyDirective} from './copy.directive';\n\nexport const TuiCopy = [TuiCopyComponent, TuiCopyDirective] as const;\n","// TODO: Move to components in v5\nexport * from './copy';\nexport * from './copy.component';\nexport * from './copy.directive';\nexport * from './copy.options';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQa,MAAA,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,GACnD,gBAAgB,CAAiB,EAAC,IAAI,EAAE,WAAW,EAAC;;MCiB3C,gBAAgB,CAAA;AAX7B,IAAA,WAAA,GAAA;AAYuB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAC/C,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM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AA,wBAAwB,EAAE,0BAA0B;AACpD,wBAAA,iBAAiB,EAAE,iDAAiD;AACpE,wBAAA,0BAA0B,EAAE,gDAAgD;AAC/E,qBAAA;AACJ,iBAAA;8BAqCU,OAAO,EAAA,CAAA;sBADb;;;MCxEQ,OAAO,GAAG,CAAC,gBAAgB,EAAE,gBAAgB;;ACH1D;;ACAA;;AAEG;;;;"}
@@ -1,147 +0,0 @@
1
- import { AsyncPipe } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, Pipe, INJECTOR, Injector } from '@angular/core';
4
- import { __decorate } from 'tslib';
5
- import { NgControl, ControlContainer } from '@angular/forms';
6
- import { TuiValidationError } from '@taiga-ui/cdk/classes';
7
- import { tuiIsString, tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
8
- import { TUI_VALIDATION_ERRORS } from '@taiga-ui/kit/tokens';
9
- import { map, of, Observable } from 'rxjs';
10
-
11
- const EMPTY_RECORD = {};
12
- function unwrapObservable(content, context) {
13
- return content.pipe(map((error) => new TuiValidationError(error || '', context)));
14
- }
15
- function defaultError(content, context) {
16
- return of(new TuiValidationError(content || '', context));
17
- }
18
- class TuiFieldErrorPipe {
19
- constructor() {
20
- this.order = [];
21
- this.parent = inject(NgControl, { skipSelf: true, optional: true });
22
- this.self = inject(NgControl, { self: true, optional: true });
23
- this.container = inject(ControlContainer, { optional: true });
24
- this.validationErrors = inject(TUI_VALIDATION_ERRORS);
25
- if (this.self && !this.self.valueAccessor) {
26
- this.self.valueAccessor = this;
27
- }
28
- }
29
- transform(order) {
30
- this.order = order;
31
- return this.computedError;
32
- }
33
- registerOnChange() { }
34
- registerOnTouched() { }
35
- setDisabledState() { }
36
- writeValue() { }
37
- get computedError() {
38
- return (this.invalid && this.touched && this.error) || of(null);
39
- }
40
- get error() {
41
- const { errorId } = this;
42
- if (!errorId) {
43
- return null;
44
- }
45
- const firstError = this.controlErrors[errorId];
46
- const errorContent = this.validationErrors[errorId];
47
- return this.getError(firstError, errorContent);
48
- }
49
- get invalid() {
50
- return !!this.control?.invalid;
51
- }
52
- get touched() {
53
- return !!this.control?.touched;
54
- }
55
- get control() {
56
- return this.self?.control || this.parent?.control || this.container?.control;
57
- }
58
- get errorId() {
59
- return this.getErrorId(this.order, this.controlErrors);
60
- }
61
- get controlErrors() {
62
- return this.control?.errors || EMPTY_RECORD;
63
- }
64
- getError(context, content) {
65
- if (context instanceof TuiValidationError) {
66
- return of(context);
67
- }
68
- if (content === undefined && tuiIsString(context)) {
69
- return of(new TuiValidationError(context));
70
- }
71
- if (content instanceof Observable) {
72
- return unwrapObservable(content, context);
73
- }
74
- if (content instanceof Function) {
75
- const message = content(context);
76
- return message instanceof Observable
77
- ? unwrapObservable(message, context)
78
- : defaultError(message, context);
79
- }
80
- return defaultError(content, context);
81
- }
82
- getErrorId(order, controlErrors) {
83
- const id = order?.find((errorId) => controlErrors[errorId]);
84
- const [fallback] = Object.keys(controlErrors);
85
- return id || fallback || '';
86
- }
87
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFieldErrorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
88
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiFieldErrorPipe, isStandalone: true, name: "tuiFieldError", pure: false }); }
89
- }
90
- __decorate([
91
- tuiPure
92
- ], TuiFieldErrorPipe.prototype, "getError", null);
93
- __decorate([
94
- tuiPure
95
- ], TuiFieldErrorPipe.prototype, "getErrorId", null);
96
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFieldErrorPipe, decorators: [{
97
- type: Pipe,
98
- args: [{
99
- standalone: true,
100
- name: 'tuiFieldError',
101
- pure: false,
102
- }]
103
- }], ctorParameters: () => [], propDecorators: { getError: [], getErrorId: [] } });
104
-
105
- class TuiFieldErrorContentPipe {
106
- constructor() {
107
- this.injector = inject(INJECTOR);
108
- this.localInjector = Injector.create({
109
- providers: [{ provide: AsyncPipe }, { provide: TuiFieldErrorPipe }],
110
- parent: this.injector,
111
- });
112
- this.asyncPipe = this.localInjector.get(AsyncPipe);
113
- this.fieldErrorPipe = this.localInjector.get(TuiFieldErrorPipe);
114
- }
115
- transform(order) {
116
- return this.getErrorContent(order);
117
- }
118
- ngOnDestroy() {
119
- this.asyncPipe.ngOnDestroy();
120
- }
121
- getErrorContent(order) {
122
- const error = this.asyncPipe.transform(this.fieldErrorPipe.transform(order));
123
- if (!error) {
124
- return '';
125
- }
126
- return typeof error.message === 'function'
127
- ? error.message(error.context)
128
- : error.message;
129
- }
130
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFieldErrorContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
131
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiFieldErrorContentPipe, isStandalone: true, name: "tuiFieldErrorContent", pure: false }); }
132
- }
133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFieldErrorContentPipe, decorators: [{
134
- type: Pipe,
135
- args: [{
136
- standalone: true,
137
- name: 'tuiFieldErrorContent',
138
- pure: false,
139
- }]
140
- }] });
141
-
142
- /**
143
- * Generated bundle index. Do not edit.
144
- */
145
-
146
- export { TuiFieldErrorContentPipe, TuiFieldErrorPipe };
147
- //# sourceMappingURL=taiga-ui-kit-pipes-field-error.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taiga-ui-kit-pipes-field-error.mjs","sources":["../../../projects/kit/pipes/field-error/field-error-pipe.ts","../../../projects/kit/pipes/field-error/field-error-content-pipe.ts","../../../projects/kit/pipes/field-error/taiga-ui-kit-pipes-field-error.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {\n type AbstractControl,\n ControlContainer,\n type ControlValueAccessor,\n NgControl,\n} from '@angular/forms';\nimport {TuiValidationError} from '@taiga-ui/cdk/classes';\nimport {tuiIsString, tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_VALIDATION_ERRORS} from '@taiga-ui/kit/tokens';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {map, Observable, of} from 'rxjs';\n\nconst EMPTY_RECORD = {};\n\nfunction unwrapObservable(\n content: Observable<PolymorpheusContent>,\n context: any,\n): Observable<TuiValidationError> {\n return content.pipe(map((error) => new TuiValidationError(error || '', context)));\n}\n\nfunction defaultError(\n content: PolymorpheusContent,\n context: any,\n): Observable<TuiValidationError> {\n return of(new TuiValidationError(content || '', context));\n}\n\n@Pipe({\n standalone: true,\n name: 'tuiFieldError',\n pure: false,\n})\nexport class TuiFieldErrorPipe implements PipeTransform, ControlValueAccessor {\n private order: readonly string[] = [];\n private readonly parent = inject(NgControl, {skipSelf: true, optional: true});\n private readonly self = inject(NgControl, {self: true, optional: true});\n private readonly container = inject(ControlContainer, {optional: true});\n private readonly validationErrors = inject(TUI_VALIDATION_ERRORS);\n\n constructor() {\n if (this.self && !this.self.valueAccessor) {\n this.self.valueAccessor = this;\n }\n }\n\n public transform(order: readonly string[]): Observable<TuiValidationError | null> {\n this.order = order;\n\n return this.computedError;\n }\n\n public registerOnChange(): void {}\n\n public registerOnTouched(): void {}\n\n public setDisabledState(): void {}\n\n public writeValue(): void {}\n\n protected get computedError(): Observable<TuiValidationError | null> {\n return (this.invalid && this.touched && this.error) || of(null);\n }\n\n private get error(): Observable<TuiValidationError> | null {\n const {errorId} = this;\n\n if (!errorId) {\n return null;\n }\n\n const firstError = this.controlErrors[errorId];\n const errorContent = this.validationErrors[errorId];\n\n return this.getError(firstError, errorContent);\n }\n\n private get invalid(): boolean {\n return !!this.control?.invalid;\n }\n\n private get touched(): boolean {\n return !!this.control?.touched;\n }\n\n private get control(): AbstractControl | null | undefined {\n return this.self?.control || this.parent?.control || this.container?.control;\n }\n\n private get errorId(): string {\n return this.getErrorId(this.order, this.controlErrors);\n }\n\n private get controlErrors(): Record<string, unknown> {\n return this.control?.errors || EMPTY_RECORD;\n }\n\n @tuiPure\n private getError(\n context: any,\n content?: Observable<PolymorpheusContent> | PolymorpheusContent,\n ): Observable<TuiValidationError> {\n if (context instanceof TuiValidationError) {\n return of(context);\n }\n\n if (content === undefined && tuiIsString(context)) {\n return of(new TuiValidationError(context));\n }\n\n if (content instanceof Observable) {\n return unwrapObservable(content, context);\n }\n\n if (content instanceof Function) {\n const message = content(context) as\n | Observable<PolymorpheusContent>\n | PolymorpheusContent;\n\n return message instanceof Observable\n ? unwrapObservable(message, context)\n : defaultError(message, context);\n }\n\n return defaultError(content, context);\n }\n\n @tuiPure\n private getErrorId(\n order: readonly string[],\n controlErrors: Record<string, unknown>,\n ): string {\n const id = order?.find((errorId) => controlErrors[errorId]);\n const [fallback] = Object.keys(controlErrors);\n\n return id || fallback || '';\n }\n}\n","import {AsyncPipe} from '@angular/common';\nimport {\n inject,\n INJECTOR,\n Injector,\n type OnDestroy,\n Pipe,\n type PipeTransform,\n} from '@angular/core';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nimport {TuiFieldErrorPipe} from './field-error-pipe';\n\n@Pipe({\n standalone: true,\n name: 'tuiFieldErrorContent',\n pure: false,\n})\nexport class TuiFieldErrorContentPipe implements PipeTransform, OnDestroy {\n private readonly injector = inject(INJECTOR);\n private readonly localInjector = Injector.create({\n providers: [{provide: AsyncPipe}, {provide: TuiFieldErrorPipe}],\n parent: this.injector,\n });\n\n private readonly asyncPipe = this.localInjector.get(AsyncPipe);\n private readonly fieldErrorPipe = this.localInjector.get(TuiFieldErrorPipe);\n\n public transform(order: readonly string[]): PolymorpheusContent {\n return this.getErrorContent(order);\n }\n\n public ngOnDestroy(): void {\n this.asyncPipe.ngOnDestroy();\n }\n\n private getErrorContent(order: readonly string[]): PolymorpheusContent {\n const error = this.asyncPipe.transform(this.fieldErrorPipe.transform(order));\n\n if (!error) {\n return '';\n }\n\n return typeof error.message === 'function'\n ? error.message(error.context)\n : error.message;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAaA,MAAM,YAAY,GAAG,EAAE;AAEvB,SAAS,gBAAgB,CACrB,OAAwC,EACxC,OAAY,EAAA;IAEZ,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,IAAI,kBAAkB,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;AACrF;AAEA,SAAS,YAAY,CACjB,OAA4B,EAC5B,OAAY,EAAA;AAEZ,IAAA,OAAO,EAAE,CAAC,IAAI,kBAAkB,CAAC,OAAO,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;AAC7D;MAOa,iBAAiB,CAAA;AAO1B,IAAA,WAAA,GAAA;QANQ,IAAK,CAAA,KAAA,GAAsB,EAAE;AACpB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;AAC5D,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,SAAS,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;QACtD,IAAS,CAAA,SAAA,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;AACtD,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,qBAAqB,CAAC;QAG7D,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;AACvC,YAAA,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,IAAI;;;AAI/B,IAAA,SAAS,CAAC,KAAwB,EAAA;AACrC,QAAA,IAAI,CA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AO,KAAK,CAAC,OAAO,KAAK;cAC1B,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO;AAC7B,cAAE,KAAK,CAAC,OAAO;;+GA3Bd,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA,CAAA;;4FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBALpC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,sBAAsB;AAC5B,oBAAA,IAAI,EAAE,KAAK;AACd,iBAAA;;;ACjBD;;AAEG;;;;"}
@@ -1,14 +0,0 @@
1
- import { type OnDestroy, type PipeTransform } from '@angular/core';
2
- import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
3
- import * as i0 from "@angular/core";
4
- export declare class TuiFieldErrorContentPipe implements PipeTransform, OnDestroy {
5
- private readonly injector;
6
- private readonly localInjector;
7
- private readonly asyncPipe;
8
- private readonly fieldErrorPipe;
9
- transform(order: readonly string[]): PolymorpheusContent;
10
- ngOnDestroy(): void;
11
- private getErrorContent;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<TuiFieldErrorContentPipe, never>;
13
- static ɵpipe: i0.ɵɵPipeDeclaration<TuiFieldErrorContentPipe, "tuiFieldErrorContent", true>;
14
- }
@@ -1,29 +0,0 @@
1
- import { type PipeTransform } from '@angular/core';
2
- import { type ControlValueAccessor } from '@angular/forms';
3
- import { TuiValidationError } from '@taiga-ui/cdk/classes';
4
- import { Observable } from 'rxjs';
5
- import * as i0 from "@angular/core";
6
- export declare class TuiFieldErrorPipe implements PipeTransform, ControlValueAccessor {
7
- private order;
8
- private readonly parent;
9
- private readonly self;
10
- private readonly container;
11
- private readonly validationErrors;
12
- constructor();
13
- transform(order: readonly string[]): Observable<TuiValidationError | null>;
14
- registerOnChange(): void;
15
- registerOnTouched(): void;
16
- setDisabledState(): void;
17
- writeValue(): void;
18
- protected get computedError(): Observable<TuiValidationError | null>;
19
- private get error();
20
- private get invalid();
21
- private get touched();
22
- private get control();
23
- private get errorId();
24
- private get controlErrors();
25
- private getError;
26
- private getErrorId;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<TuiFieldErrorPipe, never>;
28
- static ɵpipe: i0.ɵɵPipeDeclaration<TuiFieldErrorPipe, "tuiFieldError", true>;
29
- }
@@ -1,2 +0,0 @@
1
- export * from './field-error-content-pipe';
2
- export * from './field-error-pipe';
@@ -1,5 +0,0 @@
1
- import { InjectionToken, type Provider } from '@angular/core';
2
- import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
3
- import { type Observable } from 'rxjs';
4
- export declare const TUI_VALIDATION_ERRORS: InjectionToken<Record<string, PolymorpheusContent | Observable<PolymorpheusContent>>>;
5
- export declare const tuiValidationErrorsProvider: (useValue: Record<string, Observable<PolymorpheusContent> | PolymorpheusContent>) => Provider;
File without changes
File without changes