@taiga-ui/kit 2.34.0 → 2.37.0

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 (609) hide show
  1. package/abstract/input-slider.d.ts +22 -3
  2. package/abstract/taiga-ui-kit-abstract.metadata.json +1 -1
  3. package/bundles/taiga-ui-kit-abstract.umd.js +65 -17
  4. package/bundles/taiga-ui-kit-abstract.umd.js.map +1 -1
  5. package/bundles/taiga-ui-kit-abstract.umd.min.js +2 -2
  6. package/bundles/taiga-ui-kit-abstract.umd.min.js.map +1 -1
  7. package/bundles/taiga-ui-kit-components-accordion.umd.js +1 -1
  8. package/bundles/taiga-ui-kit-components-accordion.umd.js.map +1 -1
  9. package/bundles/taiga-ui-kit-components-accordion.umd.min.js +1 -1
  10. package/bundles/taiga-ui-kit-components-accordion.umd.min.js.map +1 -1
  11. package/bundles/taiga-ui-kit-components-arrow.umd.js.map +1 -1
  12. package/bundles/taiga-ui-kit-components-arrow.umd.min.js.map +1 -1
  13. package/bundles/taiga-ui-kit-components-badge.umd.js.map +1 -1
  14. package/bundles/taiga-ui-kit-components-badge.umd.min.js.map +1 -1
  15. package/bundles/taiga-ui-kit-components-badged-content.umd.js +1 -1
  16. package/bundles/taiga-ui-kit-components-badged-content.umd.js.map +1 -1
  17. package/bundles/taiga-ui-kit-components-badged-content.umd.min.js +1 -1
  18. package/bundles/taiga-ui-kit-components-badged-content.umd.min.js.map +1 -1
  19. package/bundles/taiga-ui-kit-components-calendar-month.umd.js +2 -2
  20. package/bundles/taiga-ui-kit-components-calendar-month.umd.js.map +1 -1
  21. package/bundles/taiga-ui-kit-components-calendar-month.umd.min.js +2 -2
  22. package/bundles/taiga-ui-kit-components-calendar-month.umd.min.js.map +1 -1
  23. package/bundles/taiga-ui-kit-components-combo-box.umd.js +1 -1
  24. package/bundles/taiga-ui-kit-components-combo-box.umd.js.map +1 -1
  25. package/bundles/taiga-ui-kit-components-combo-box.umd.min.js +1 -1
  26. package/bundles/taiga-ui-kit-components-combo-box.umd.min.js.map +1 -1
  27. package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.js +4 -4
  28. package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.js.map +1 -1
  29. package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.min.js +2 -2
  30. package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.min.js.map +1 -1
  31. package/bundles/taiga-ui-kit-components-files.umd.js +504 -0
  32. package/bundles/taiga-ui-kit-components-files.umd.js.map +1 -0
  33. package/bundles/taiga-ui-kit-components-files.umd.min.js +16 -0
  34. package/bundles/taiga-ui-kit-components-files.umd.min.js.map +1 -0
  35. package/bundles/taiga-ui-kit-components-input-count.umd.js +2 -2
  36. package/bundles/taiga-ui-kit-components-input-count.umd.js.map +1 -1
  37. package/bundles/taiga-ui-kit-components-input-count.umd.min.js +1 -1
  38. package/bundles/taiga-ui-kit-components-input-count.umd.min.js.map +1 -1
  39. package/bundles/taiga-ui-kit-components-input-date-range.umd.js +3 -1
  40. package/bundles/taiga-ui-kit-components-input-date-range.umd.js.map +1 -1
  41. package/bundles/taiga-ui-kit-components-input-date-range.umd.min.js.map +1 -1
  42. package/bundles/taiga-ui-kit-components-input-date-time.umd.js +1 -1
  43. package/bundles/taiga-ui-kit-components-input-date-time.umd.js.map +1 -1
  44. package/bundles/taiga-ui-kit-components-input-date-time.umd.min.js +1 -1
  45. package/bundles/taiga-ui-kit-components-input-date-time.umd.min.js.map +1 -1
  46. package/bundles/taiga-ui-kit-components-input-date.umd.js +4 -2
  47. package/bundles/taiga-ui-kit-components-input-date.umd.js.map +1 -1
  48. package/bundles/taiga-ui-kit-components-input-date.umd.min.js +1 -1
  49. package/bundles/taiga-ui-kit-components-input-date.umd.min.js.map +1 -1
  50. package/bundles/taiga-ui-kit-components-input-file.umd.js +43 -45
  51. package/bundles/taiga-ui-kit-components-input-file.umd.js.map +1 -1
  52. package/bundles/taiga-ui-kit-components-input-file.umd.min.js +1 -1
  53. package/bundles/taiga-ui-kit-components-input-file.umd.min.js.map +1 -1
  54. package/bundles/taiga-ui-kit-components-input-files.umd.js +490 -0
  55. package/bundles/taiga-ui-kit-components-input-files.umd.js.map +1 -0
  56. package/bundles/taiga-ui-kit-components-input-files.umd.min.js +16 -0
  57. package/bundles/taiga-ui-kit-components-input-files.umd.min.js.map +1 -0
  58. package/bundles/taiga-ui-kit-components-input-month-range.umd.js +64 -41
  59. package/bundles/taiga-ui-kit-components-input-month-range.umd.js.map +1 -1
  60. package/bundles/taiga-ui-kit-components-input-month-range.umd.min.js +2 -2
  61. package/bundles/taiga-ui-kit-components-input-month-range.umd.min.js.map +1 -1
  62. package/bundles/taiga-ui-kit-components-input-month.umd.js +57 -32
  63. package/bundles/taiga-ui-kit-components-input-month.umd.js.map +1 -1
  64. package/bundles/taiga-ui-kit-components-input-month.umd.min.js +2 -2
  65. package/bundles/taiga-ui-kit-components-input-month.umd.min.js.map +1 -1
  66. package/bundles/taiga-ui-kit-components-input-number.umd.js +24 -16
  67. package/bundles/taiga-ui-kit-components-input-number.umd.js.map +1 -1
  68. package/bundles/taiga-ui-kit-components-input-number.umd.min.js +1 -1
  69. package/bundles/taiga-ui-kit-components-input-number.umd.min.js.map +1 -1
  70. package/bundles/taiga-ui-kit-components-input-password.umd.js +2 -2
  71. package/bundles/taiga-ui-kit-components-input-password.umd.js.map +1 -1
  72. package/bundles/taiga-ui-kit-components-input-password.umd.min.js +1 -1
  73. package/bundles/taiga-ui-kit-components-input-password.umd.min.js.map +1 -1
  74. package/bundles/taiga-ui-kit-components-input-phone-international.umd.js +20 -8
  75. package/bundles/taiga-ui-kit-components-input-phone-international.umd.js.map +1 -1
  76. package/bundles/taiga-ui-kit-components-input-phone-international.umd.min.js +2 -2
  77. package/bundles/taiga-ui-kit-components-input-phone-international.umd.min.js.map +1 -1
  78. package/bundles/taiga-ui-kit-components-input-phone.umd.js +13 -6
  79. package/bundles/taiga-ui-kit-components-input-phone.umd.js.map +1 -1
  80. package/bundles/taiga-ui-kit-components-input-phone.umd.min.js +2 -2
  81. package/bundles/taiga-ui-kit-components-input-phone.umd.min.js.map +1 -1
  82. package/bundles/taiga-ui-kit-components-input-range.umd.js +16 -4
  83. package/bundles/taiga-ui-kit-components-input-range.umd.js.map +1 -1
  84. package/bundles/taiga-ui-kit-components-input-range.umd.min.js +2 -2
  85. package/bundles/taiga-ui-kit-components-input-range.umd.min.js.map +1 -1
  86. package/bundles/taiga-ui-kit-components-input-slider.umd.js +61 -14
  87. package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
  88. package/bundles/taiga-ui-kit-components-input-slider.umd.min.js +2 -2
  89. package/bundles/taiga-ui-kit-components-input-slider.umd.min.js.map +1 -1
  90. package/bundles/taiga-ui-kit-components-input-tag.umd.js +16 -9
  91. package/bundles/taiga-ui-kit-components-input-tag.umd.js.map +1 -1
  92. package/bundles/taiga-ui-kit-components-input-tag.umd.min.js +2 -2
  93. package/bundles/taiga-ui-kit-components-input-tag.umd.min.js.map +1 -1
  94. package/bundles/taiga-ui-kit-components-input-time.umd.js.map +1 -1
  95. package/bundles/taiga-ui-kit-components-input-time.umd.min.js.map +1 -1
  96. package/bundles/taiga-ui-kit-components-input.umd.js.map +1 -1
  97. package/bundles/taiga-ui-kit-components-input.umd.min.js.map +1 -1
  98. package/bundles/taiga-ui-kit-components-line-clamp.umd.js +27 -16
  99. package/bundles/taiga-ui-kit-components-line-clamp.umd.js.map +1 -1
  100. package/bundles/taiga-ui-kit-components-line-clamp.umd.min.js +1 -1
  101. package/bundles/taiga-ui-kit-components-line-clamp.umd.min.js.map +1 -1
  102. package/bundles/taiga-ui-kit-components-multi-select-option.umd.js +2 -2
  103. package/bundles/taiga-ui-kit-components-multi-select-option.umd.js.map +1 -1
  104. package/bundles/taiga-ui-kit-components-multi-select-option.umd.min.js +1 -1
  105. package/bundles/taiga-ui-kit-components-multi-select-option.umd.min.js.map +1 -1
  106. package/bundles/taiga-ui-kit-components-multi-select.umd.js +23 -9
  107. package/bundles/taiga-ui-kit-components-multi-select.umd.js.map +1 -1
  108. package/bundles/taiga-ui-kit-components-multi-select.umd.min.js +2 -2
  109. package/bundles/taiga-ui-kit-components-multi-select.umd.min.js.map +1 -1
  110. package/bundles/taiga-ui-kit-components-pagination.umd.js +1 -1
  111. package/bundles/taiga-ui-kit-components-pagination.umd.js.map +1 -1
  112. package/bundles/taiga-ui-kit-components-pagination.umd.min.js +1 -1
  113. package/bundles/taiga-ui-kit-components-pagination.umd.min.js.map +1 -1
  114. package/bundles/taiga-ui-kit-components-progress.umd.js +140 -73
  115. package/bundles/taiga-ui-kit-components-progress.umd.js.map +1 -1
  116. package/bundles/taiga-ui-kit-components-progress.umd.min.js +2 -2
  117. package/bundles/taiga-ui-kit-components-progress.umd.min.js.map +1 -1
  118. package/bundles/taiga-ui-kit-components-radio.umd.js.map +1 -1
  119. package/bundles/taiga-ui-kit-components-radio.umd.min.js.map +1 -1
  120. package/bundles/taiga-ui-kit-components-select.umd.js.map +1 -1
  121. package/bundles/taiga-ui-kit-components-select.umd.min.js.map +1 -1
  122. package/bundles/taiga-ui-kit-components-slider.umd.js +205 -30
  123. package/bundles/taiga-ui-kit-components-slider.umd.js.map +1 -1
  124. package/bundles/taiga-ui-kit-components-slider.umd.min.js +2 -2
  125. package/bundles/taiga-ui-kit-components-slider.umd.min.js.map +1 -1
  126. package/bundles/taiga-ui-kit-components-text-area.umd.js +50 -13
  127. package/bundles/taiga-ui-kit-components-text-area.umd.js.map +1 -1
  128. package/bundles/taiga-ui-kit-components-text-area.umd.min.js +1 -1
  129. package/bundles/taiga-ui-kit-components-text-area.umd.min.js.map +1 -1
  130. package/bundles/taiga-ui-kit-components.umd.js +20 -4
  131. package/bundles/taiga-ui-kit-components.umd.js.map +1 -1
  132. package/bundles/taiga-ui-kit-components.umd.min.js +1 -1
  133. package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.js +22 -5
  134. package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.js.map +1 -1
  135. package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.min.js +1 -1
  136. package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.min.js.map +1 -1
  137. package/bundles/taiga-ui-kit-directives-lazy-loading.umd.js +1 -1
  138. package/bundles/taiga-ui-kit-directives-lazy-loading.umd.min.js +1 -1
  139. package/bundles/taiga-ui-kit-enums.umd.js.map +1 -1
  140. package/bundles/taiga-ui-kit-enums.umd.min.js.map +1 -1
  141. package/bundles/taiga-ui-kit-pipes-field-error.umd.js +46 -6
  142. package/bundles/taiga-ui-kit-pipes-field-error.umd.js.map +1 -1
  143. package/bundles/taiga-ui-kit-pipes-field-error.umd.min.js +2 -2
  144. package/bundles/taiga-ui-kit-pipes-field-error.umd.min.js.map +1 -1
  145. package/bundles/taiga-ui-kit-providers.umd.js +29 -12
  146. package/bundles/taiga-ui-kit-providers.umd.js.map +1 -1
  147. package/bundles/taiga-ui-kit-providers.umd.min.js +1 -1
  148. package/bundles/taiga-ui-kit-providers.umd.min.js.map +1 -1
  149. package/bundles/taiga-ui-kit-tokens.umd.js +11 -0
  150. package/bundles/taiga-ui-kit-tokens.umd.js.map +1 -1
  151. package/bundles/taiga-ui-kit-tokens.umd.min.js +1 -1
  152. package/bundles/taiga-ui-kit-tokens.umd.min.js.map +1 -1
  153. package/bundles/taiga-ui-kit-utils-files.umd.js +8 -0
  154. package/bundles/taiga-ui-kit-utils-files.umd.js.map +1 -1
  155. package/bundles/taiga-ui-kit-utils-files.umd.min.js +1 -1
  156. package/bundles/taiga-ui-kit-utils-files.umd.min.js.map +1 -1
  157. package/components/arrow/arrow-options.d.ts +4 -2
  158. package/components/arrow/taiga-ui-kit-components-arrow.metadata.json +1 -1
  159. package/components/badge/badge.component.d.ts +2 -1
  160. package/components/badge/taiga-ui-kit-components-badge.metadata.json +1 -1
  161. package/components/calendar-month/taiga-ui-kit-components-calendar-month.metadata.json +1 -1
  162. package/components/combo-box/combo-box.component.d.ts +4 -4
  163. package/components/combo-box/taiga-ui-kit-components-combo-box.metadata.json +1 -1
  164. package/components/data-list-wrapper/taiga-ui-kit-components-data-list-wrapper.metadata.json +1 -1
  165. package/components/files/file/file.component.d.ts +42 -0
  166. package/components/files/files.component.d.ts +12 -0
  167. package/components/files/files.module.d.ts +2 -0
  168. package/components/files/index.d.ts +2 -0
  169. package/components/files/package.json +13 -0
  170. package/components/files/taiga-ui-kit-components-files.d.ts +5 -0
  171. package/components/files/taiga-ui-kit-components-files.metadata.json +1 -0
  172. package/components/index.d.ts +2 -0
  173. package/components/input/input.component.d.ts +2 -2
  174. package/components/input/taiga-ui-kit-components-input.metadata.json +1 -1
  175. package/components/input-count/input-count.component.d.ts +3 -2
  176. package/components/input-count/taiga-ui-kit-components-input-count.metadata.json +1 -1
  177. package/components/input-date/input-date.component.d.ts +5 -3
  178. package/components/input-date/taiga-ui-kit-components-input-date.metadata.json +1 -1
  179. package/components/input-date-range/input-date-range.component.d.ts +3 -2
  180. package/components/input-date-range/taiga-ui-kit-components-input-date-range.metadata.json +1 -1
  181. package/components/input-date-time/input-date-time.component.d.ts +7 -5
  182. package/components/input-date-time/taiga-ui-kit-components-input-date-time.metadata.json +1 -1
  183. package/components/input-file/file/file.component.d.ts +1 -1
  184. package/components/input-file/taiga-ui-kit-components-input-file.metadata.json +1 -1
  185. package/components/input-files/index.d.ts +2 -0
  186. package/components/input-files/input-files.component.d.ts +41 -0
  187. package/components/input-files/input-files.module.d.ts +2 -0
  188. package/components/input-files/package.json +13 -0
  189. package/components/input-files/taiga-ui-kit-components-input-files.d.ts +4 -0
  190. package/components/input-files/taiga-ui-kit-components-input-files.metadata.json +1 -0
  191. package/components/input-month/index.d.ts +1 -0
  192. package/components/input-month/input-month.component.d.ts +6 -4
  193. package/components/input-month/input-month.directive.d.ts +8 -1
  194. package/components/input-month/input-month.providers.d.ts +2 -0
  195. package/components/input-month/taiga-ui-kit-components-input-month.metadata.json +1 -1
  196. package/components/input-month-range/index.d.ts +1 -0
  197. package/components/input-month-range/input-month-range.component.d.ts +6 -7
  198. package/components/input-month-range/input-month-range.directive.d.ts +8 -1
  199. package/components/input-month-range/input-month-range.providers.d.ts +2 -0
  200. package/components/input-month-range/taiga-ui-kit-components-input-month-range.metadata.json +1 -1
  201. package/components/input-number/input-number.component.d.ts +3 -2
  202. package/components/input-number/input-number.directive.d.ts +4 -1
  203. package/components/input-number/taiga-ui-kit-components-input-number.metadata.json +1 -1
  204. package/components/input-password/input-password.component.d.ts +4 -3
  205. package/components/input-password/taiga-ui-kit-components-input-password.metadata.json +1 -1
  206. package/components/input-phone/input-phone.component.d.ts +5 -6
  207. package/components/input-phone/input-phone.directive.d.ts +4 -1
  208. package/components/input-phone/taiga-ui-kit-components-input-phone.metadata.json +1 -1
  209. package/components/input-phone-international/input-phone-international.component.d.ts +4 -2
  210. package/components/input-phone-international/taiga-ui-kit-components-input-phone-international.metadata.json +1 -1
  211. package/components/input-range/input-range.component.d.ts +2 -0
  212. package/components/input-range/taiga-ui-kit-components-input-range.metadata.json +1 -1
  213. package/components/input-slider/input-slider.component.d.ts +19 -3
  214. package/components/input-slider/taiga-ui-kit-components-input-slider.metadata.json +1 -1
  215. package/components/input-tag/input-tag.component.d.ts +6 -4
  216. package/components/input-tag/taiga-ui-kit-components-input-tag.metadata.json +1 -1
  217. package/components/input-time/input-time.component.d.ts +2 -2
  218. package/components/input-time/taiga-ui-kit-components-input-time.metadata.json +1 -1
  219. package/components/line-clamp/line-clamp.component.d.ts +7 -3
  220. package/components/line-clamp/taiga-ui-kit-components-line-clamp.metadata.json +1 -1
  221. package/components/multi-select/hide-selected.pipe.d.ts +1 -1
  222. package/components/multi-select/multi-select.component.d.ts +8 -6
  223. package/components/multi-select/taiga-ui-kit-components-multi-select.metadata.json +1 -1
  224. package/components/multi-select-option/taiga-ui-kit-components-multi-select-option.metadata.json +1 -1
  225. package/components/pagination/taiga-ui-kit-components-pagination.metadata.json +1 -1
  226. package/components/progress/index.d.ts +4 -3
  227. package/components/progress/progress-bar/progress-color-segments.directive.d.ts +11 -0
  228. package/components/progress/taiga-ui-kit-components-progress.metadata.json +1 -1
  229. package/components/progress/{pipes → utils}/abstract-color-segments.d.ts +0 -0
  230. package/components/progress/utils/calculate-color-segments.d.ts +1 -0
  231. package/components/progress/{pipes → utils}/progress-color-segments-async.pipe.d.ts +5 -0
  232. package/components/progress/utils/progress-color-segments.pipe.d.ts +9 -0
  233. package/components/radio/radio.component.d.ts +1 -1
  234. package/components/select/select.component.d.ts +4 -4
  235. package/components/select/taiga-ui-kit-components-select.metadata.json +1 -1
  236. package/components/slider/index.d.ts +2 -0
  237. package/components/slider/slider-key-steps.directive.d.ts +27 -0
  238. package/components/slider/slider-options.d.ts +9 -0
  239. package/components/slider/slider.component.d.ts +8 -6
  240. package/components/slider/taiga-ui-kit-components-slider.metadata.json +1 -1
  241. package/components/taiga-ui-kit-components.metadata.json +1 -1
  242. package/components/text-area/index.d.ts +1 -0
  243. package/components/text-area/taiga-ui-kit-components-text-area.metadata.json +1 -1
  244. package/components/text-area/text-area.component.d.ts +2 -1
  245. package/components/text-area/text-area.directive.d.ts +5 -0
  246. package/directives/dropdown-selection/dropdown-selection.directive.d.ts +2 -2
  247. package/directives/dropdown-selection/taiga-ui-kit-directives-dropdown-selection.metadata.json +1 -1
  248. package/directives/lazy-loading/index.d.ts +1 -0
  249. package/directives/lazy-loading/taiga-ui-kit-directives-lazy-loading.d.ts +0 -1
  250. package/directives/lazy-loading/taiga-ui-kit-directives-lazy-loading.metadata.json +1 -1
  251. package/enums/file-state.d.ts +1 -0
  252. package/enums/taiga-ui-kit-enums.metadata.json +1 -1
  253. package/esm2015/abstract/input-slider.js +43 -4
  254. package/esm2015/components/accordion/accordion.component.js +2 -2
  255. package/esm2015/components/arrow/arrow-options.js +1 -1
  256. package/esm2015/components/badge/badge.component.js +1 -1
  257. package/esm2015/components/badged-content/badged-content.component.js +3 -3
  258. package/esm2015/components/calendar-month/calendar-month.component.js +3 -3
  259. package/esm2015/components/combo-box/combo-box.component.js +2 -2
  260. package/esm2015/components/data-list-wrapper/data-list-group-wrapper.component.js +3 -3
  261. package/esm2015/components/data-list-wrapper/data-list-wrapper.component.js +3 -3
  262. package/esm2015/components/files/file/file.component.js +164 -0
  263. package/esm2015/components/files/files.component.js +45 -0
  264. package/esm2015/components/files/files.module.js +29 -0
  265. package/esm2015/components/files/index.js +3 -0
  266. package/esm2015/components/files/taiga-ui-kit-components-files.js +6 -0
  267. package/esm2015/components/index.js +3 -1
  268. package/esm2015/components/input/input.component.js +1 -1
  269. package/esm2015/components/input-count/input-count.component.js +3 -3
  270. package/esm2015/components/input-date/input-date.component.js +5 -3
  271. package/esm2015/components/input-date-range/input-date-range.component.js +4 -2
  272. package/esm2015/components/input-date-time/input-date-time.component.js +2 -2
  273. package/esm2015/components/input-file/file/file.component.js +19 -19
  274. package/esm2015/components/input-file/input-file.component.js +7 -7
  275. package/esm2015/components/input-file/input-file.module.js +3 -3
  276. package/esm2015/components/input-files/index.js +3 -0
  277. package/esm2015/components/input-files/input-files.component.js +208 -0
  278. package/esm2015/components/input-files/input-files.module.js +34 -0
  279. package/esm2015/components/input-files/taiga-ui-kit-components-input-files.js +5 -0
  280. package/esm2015/components/input-month/index.js +2 -1
  281. package/esm2015/components/input-month/input-month.component.js +19 -25
  282. package/esm2015/components/input-month/input-month.directive.js +32 -7
  283. package/esm2015/components/input-month/input-month.module.js +4 -4
  284. package/esm2015/components/input-month/input-month.providers.js +19 -0
  285. package/esm2015/components/input-month-range/index.js +2 -1
  286. package/esm2015/components/input-month-range/input-month-range.component.js +21 -37
  287. package/esm2015/components/input-month-range/input-month-range.directive.js +37 -7
  288. package/esm2015/components/input-month-range/input-month-range.module.js +3 -2
  289. package/esm2015/components/input-month-range/input-month-range.providers.js +19 -0
  290. package/esm2015/components/input-number/input-number.component.js +5 -5
  291. package/esm2015/components/input-number/input-number.directive.js +9 -3
  292. package/esm2015/components/input-password/input-password.component.js +3 -3
  293. package/esm2015/components/input-phone/input-phone.component.js +6 -5
  294. package/esm2015/components/input-phone/input-phone.directive.js +9 -3
  295. package/esm2015/components/input-phone-international/input-phone-international.component.js +20 -6
  296. package/esm2015/components/input-range/input-range.component.js +18 -6
  297. package/esm2015/components/input-slider/input-slider.component.js +55 -11
  298. package/esm2015/components/input-slider/input-slider.module.js +10 -6
  299. package/esm2015/components/input-tag/input-tag.component.js +17 -10
  300. package/esm2015/components/input-time/input-time.component.js +1 -1
  301. package/esm2015/components/line-clamp/line-clamp.component.js +25 -15
  302. package/esm2015/components/line-clamp/line-clamp.directive.js +5 -4
  303. package/esm2015/components/multi-select/hide-selected.pipe.js +4 -3
  304. package/esm2015/components/multi-select/multi-select-group/multi-select-group.component.js +3 -3
  305. package/esm2015/components/multi-select/multi-select.component.js +16 -6
  306. package/esm2015/components/multi-select-option/multi-select-option.component.js +3 -3
  307. package/esm2015/components/pagination/pagination.component.js +2 -2
  308. package/esm2015/components/progress/index.js +5 -4
  309. package/esm2015/components/progress/progress-bar/progress-color-segments.directive.js +48 -0
  310. package/esm2015/components/progress/progress.module.js +6 -3
  311. package/esm2015/components/progress/utils/abstract-color-segments.js +32 -0
  312. package/esm2015/components/progress/utils/calculate-color-segments.js +11 -0
  313. package/esm2015/components/progress/utils/progress-color-segments-async.pipe.js +21 -0
  314. package/esm2015/components/progress/utils/progress-color-segments.pipe.js +19 -0
  315. package/esm2015/components/radio/radio.component.js +1 -1
  316. package/esm2015/components/select/select.component.js +2 -2
  317. package/esm2015/components/slider/index.js +3 -1
  318. package/esm2015/components/slider/slider-key-steps.directive.js +106 -0
  319. package/esm2015/components/slider/slider-options.js +13 -0
  320. package/esm2015/components/slider/slider.component.js +48 -26
  321. package/esm2015/components/slider/slider.module.js +14 -3
  322. package/esm2015/components/text-area/index.js +2 -1
  323. package/esm2015/components/text-area/text-area.component.js +21 -13
  324. package/esm2015/components/text-area/text-area.directive.js +22 -0
  325. package/esm2015/components/text-area/text-area.module.js +7 -6
  326. package/esm2015/components/text-area/text-area.providers.js +6 -2
  327. package/esm2015/directives/dropdown-selection/dropdown-selection.directive.js +23 -6
  328. package/esm2015/directives/lazy-loading/index.js +2 -1
  329. package/esm2015/directives/lazy-loading/taiga-ui-kit-directives-lazy-loading.js +1 -2
  330. package/esm2015/enums/file-state.js +1 -1
  331. package/esm2015/pipes/field-error/field-error-content-pipe.js +43 -0
  332. package/esm2015/pipes/field-error/field-error.module.js +4 -3
  333. package/esm2015/pipes/field-error/index.js +2 -1
  334. package/esm2015/providers/index.js +2 -1
  335. package/esm2015/providers/month-formatter.provider.js +17 -0
  336. package/esm2015/providers/value-accessor.provider.js +2 -2
  337. package/esm2015/tokens/i18n.js +7 -1
  338. package/esm2015/tokens/index.js +2 -1
  339. package/esm2015/tokens/month-formatter.js +3 -0
  340. package/esm2015/utils/files/get-accept-array.js +7 -0
  341. package/esm2015/utils/files/index.js +2 -1
  342. package/esm5/abstract/input-slider.js +65 -16
  343. package/esm5/components/accordion/accordion.component.js +2 -2
  344. package/esm5/components/arrow/arrow-options.js +1 -1
  345. package/esm5/components/badge/badge.component.js +1 -1
  346. package/esm5/components/badged-content/badged-content.component.js +3 -3
  347. package/esm5/components/calendar-month/calendar-month.component.js +3 -3
  348. package/esm5/components/combo-box/combo-box.component.js +2 -2
  349. package/esm5/components/data-list-wrapper/data-list-group-wrapper.component.js +3 -3
  350. package/esm5/components/data-list-wrapper/data-list-wrapper.component.js +3 -3
  351. package/esm5/components/files/file/file.component.js +213 -0
  352. package/esm5/components/files/files.component.js +50 -0
  353. package/esm5/components/files/files.module.js +32 -0
  354. package/esm5/components/files/index.js +3 -0
  355. package/esm5/components/files/taiga-ui-kit-components-files.js +6 -0
  356. package/esm5/components/index.js +3 -1
  357. package/esm5/components/input/input.component.js +1 -1
  358. package/esm5/components/input-count/input-count.component.js +3 -3
  359. package/esm5/components/input-date/input-date.component.js +5 -3
  360. package/esm5/components/input-date-range/input-date-range.component.js +4 -2
  361. package/esm5/components/input-date-time/input-date-time.component.js +2 -2
  362. package/esm5/components/input-file/file/file.component.js +37 -37
  363. package/esm5/components/input-file/input-file.component.js +7 -9
  364. package/esm5/components/input-file/input-file.module.js +3 -3
  365. package/esm5/components/input-files/index.js +3 -0
  366. package/esm5/components/input-files/input-files.component.js +239 -0
  367. package/esm5/components/input-files/input-files.module.js +37 -0
  368. package/esm5/components/input-files/taiga-ui-kit-components-input-files.js +5 -0
  369. package/esm5/components/input-month/index.js +2 -1
  370. package/esm5/components/input-month/input-month.component.js +18 -25
  371. package/esm5/components/input-month/input-month.directive.js +32 -9
  372. package/esm5/components/input-month/input-month.module.js +4 -4
  373. package/esm5/components/input-month/input-month.providers.js +19 -0
  374. package/esm5/components/input-month-range/index.js +2 -1
  375. package/esm5/components/input-month-range/input-month-range.component.js +20 -38
  376. package/esm5/components/input-month-range/input-month-range.directive.js +38 -8
  377. package/esm5/components/input-month-range/input-month-range.module.js +3 -2
  378. package/esm5/components/input-month-range/input-month-range.providers.js +19 -0
  379. package/esm5/components/input-number/input-number.component.js +18 -16
  380. package/esm5/components/input-number/input-number.directive.js +9 -3
  381. package/esm5/components/input-password/input-password.component.js +3 -3
  382. package/esm5/components/input-phone/input-phone.component.js +6 -5
  383. package/esm5/components/input-phone/input-phone.directive.js +9 -3
  384. package/esm5/components/input-phone-international/input-phone-international.component.js +21 -9
  385. package/esm5/components/input-range/input-range.component.js +18 -6
  386. package/esm5/components/input-slider/input-slider.component.js +58 -11
  387. package/esm5/components/input-slider/input-slider.module.js +10 -6
  388. package/esm5/components/input-tag/input-tag.component.js +17 -10
  389. package/esm5/components/input-time/input-time.component.js +1 -1
  390. package/esm5/components/line-clamp/line-clamp.component.js +26 -16
  391. package/esm5/components/line-clamp/line-clamp.directive.js +5 -4
  392. package/esm5/components/multi-select/hide-selected.pipe.js +4 -4
  393. package/esm5/components/multi-select/multi-select-group/multi-select-group.component.js +3 -3
  394. package/esm5/components/multi-select/multi-select.component.js +20 -6
  395. package/esm5/components/multi-select-option/multi-select-option.component.js +3 -3
  396. package/esm5/components/pagination/pagination.component.js +2 -2
  397. package/esm5/components/progress/index.js +5 -4
  398. package/esm5/components/progress/progress-bar/progress-color-segments.directive.js +56 -0
  399. package/esm5/components/progress/progress.module.js +6 -3
  400. package/esm5/components/progress/utils/abstract-color-segments.js +33 -0
  401. package/esm5/components/progress/utils/calculate-color-segments.js +13 -0
  402. package/esm5/components/progress/utils/progress-color-segments-async.pipe.js +27 -0
  403. package/esm5/components/progress/utils/progress-color-segments.pipe.js +24 -0
  404. package/esm5/components/radio/radio.component.js +1 -1
  405. package/esm5/components/select/select.component.js +2 -2
  406. package/esm5/components/slider/index.js +3 -1
  407. package/esm5/components/slider/slider-key-steps.directive.js +137 -0
  408. package/esm5/components/slider/slider-options.js +14 -0
  409. package/esm5/components/slider/slider.component.js +49 -27
  410. package/esm5/components/slider/slider.module.js +14 -3
  411. package/esm5/components/text-area/index.js +2 -1
  412. package/esm5/components/text-area/text-area.component.js +21 -13
  413. package/esm5/components/text-area/text-area.directive.js +28 -0
  414. package/esm5/components/text-area/text-area.module.js +7 -6
  415. package/esm5/components/text-area/text-area.providers.js +6 -2
  416. package/esm5/directives/dropdown-selection/dropdown-selection.directive.js +23 -6
  417. package/esm5/directives/lazy-loading/index.js +2 -1
  418. package/esm5/directives/lazy-loading/taiga-ui-kit-directives-lazy-loading.js +1 -2
  419. package/esm5/enums/file-state.js +1 -1
  420. package/esm5/pipes/field-error/field-error-content-pipe.js +44 -0
  421. package/esm5/pipes/field-error/field-error.module.js +4 -3
  422. package/esm5/pipes/field-error/index.js +2 -1
  423. package/esm5/providers/index.js +2 -1
  424. package/esm5/providers/month-formatter.provider.js +19 -0
  425. package/esm5/providers/value-accessor.provider.js +2 -2
  426. package/esm5/tokens/i18n.js +7 -1
  427. package/esm5/tokens/index.js +2 -1
  428. package/esm5/tokens/month-formatter.js +3 -0
  429. package/esm5/utils/files/get-accept-array.js +7 -0
  430. package/esm5/utils/files/index.js +2 -1
  431. package/fesm2015/taiga-ui-kit-abstract.js +42 -3
  432. package/fesm2015/taiga-ui-kit-abstract.js.map +1 -1
  433. package/fesm2015/taiga-ui-kit-components-accordion.js +1 -1
  434. package/fesm2015/taiga-ui-kit-components-accordion.js.map +1 -1
  435. package/fesm2015/taiga-ui-kit-components-arrow.js.map +1 -1
  436. package/fesm2015/taiga-ui-kit-components-badge.js.map +1 -1
  437. package/fesm2015/taiga-ui-kit-components-badged-content.js +2 -2
  438. package/fesm2015/taiga-ui-kit-components-badged-content.js.map +1 -1
  439. package/fesm2015/taiga-ui-kit-components-calendar-month.js +2 -2
  440. package/fesm2015/taiga-ui-kit-components-calendar-month.js.map +1 -1
  441. package/fesm2015/taiga-ui-kit-components-combo-box.js +1 -1
  442. package/fesm2015/taiga-ui-kit-components-combo-box.js.map +1 -1
  443. package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js +4 -4
  444. package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js.map +1 -1
  445. package/fesm2015/taiga-ui-kit-components-files.js +232 -0
  446. package/fesm2015/taiga-ui-kit-components-files.js.map +1 -0
  447. package/fesm2015/taiga-ui-kit-components-input-count.js +2 -2
  448. package/fesm2015/taiga-ui-kit-components-input-count.js.map +1 -1
  449. package/fesm2015/taiga-ui-kit-components-input-date-range.js +3 -1
  450. package/fesm2015/taiga-ui-kit-components-input-date-range.js.map +1 -1
  451. package/fesm2015/taiga-ui-kit-components-input-date-time.js +1 -1
  452. package/fesm2015/taiga-ui-kit-components-input-date-time.js.map +1 -1
  453. package/fesm2015/taiga-ui-kit-components-input-date.js +4 -2
  454. package/fesm2015/taiga-ui-kit-components-input-date.js.map +1 -1
  455. package/fesm2015/taiga-ui-kit-components-input-file.js +25 -25
  456. package/fesm2015/taiga-ui-kit-components-input-file.js.map +1 -1
  457. package/fesm2015/taiga-ui-kit-components-input-files.js +242 -0
  458. package/fesm2015/taiga-ui-kit-components-input-files.js.map +1 -0
  459. package/fesm2015/taiga-ui-kit-components-input-month-range.js +67 -41
  460. package/fesm2015/taiga-ui-kit-components-input-month-range.js.map +1 -1
  461. package/fesm2015/taiga-ui-kit-components-input-month.js +61 -31
  462. package/fesm2015/taiga-ui-kit-components-input-month.js.map +1 -1
  463. package/fesm2015/taiga-ui-kit-components-input-number.js +12 -6
  464. package/fesm2015/taiga-ui-kit-components-input-number.js.map +1 -1
  465. package/fesm2015/taiga-ui-kit-components-input-password.js +3 -3
  466. package/fesm2015/taiga-ui-kit-components-input-password.js.map +1 -1
  467. package/fesm2015/taiga-ui-kit-components-input-phone-international.js +19 -5
  468. package/fesm2015/taiga-ui-kit-components-input-phone-international.js.map +1 -1
  469. package/fesm2015/taiga-ui-kit-components-input-phone.js +13 -6
  470. package/fesm2015/taiga-ui-kit-components-input-phone.js.map +1 -1
  471. package/fesm2015/taiga-ui-kit-components-input-range.js +17 -5
  472. package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
  473. package/fesm2015/taiga-ui-kit-components-input-slider.js +61 -15
  474. package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
  475. package/fesm2015/taiga-ui-kit-components-input-tag.js +16 -9
  476. package/fesm2015/taiga-ui-kit-components-input-tag.js.map +1 -1
  477. package/fesm2015/taiga-ui-kit-components-input-time.js.map +1 -1
  478. package/fesm2015/taiga-ui-kit-components-input.js.map +1 -1
  479. package/fesm2015/taiga-ui-kit-components-line-clamp.js +28 -17
  480. package/fesm2015/taiga-ui-kit-components-line-clamp.js.map +1 -1
  481. package/fesm2015/taiga-ui-kit-components-multi-select-option.js +2 -2
  482. package/fesm2015/taiga-ui-kit-components-multi-select-option.js.map +1 -1
  483. package/fesm2015/taiga-ui-kit-components-multi-select.js +20 -9
  484. package/fesm2015/taiga-ui-kit-components-multi-select.js.map +1 -1
  485. package/fesm2015/taiga-ui-kit-components-pagination.js +1 -1
  486. package/fesm2015/taiga-ui-kit-components-pagination.js.map +1 -1
  487. package/fesm2015/taiga-ui-kit-components-progress.js +113 -55
  488. package/fesm2015/taiga-ui-kit-components-progress.js.map +1 -1
  489. package/fesm2015/taiga-ui-kit-components-radio.js.map +1 -1
  490. package/fesm2015/taiga-ui-kit-components-select.js.map +1 -1
  491. package/fesm2015/taiga-ui-kit-components-slider.js +169 -28
  492. package/fesm2015/taiga-ui-kit-components-slider.js.map +1 -1
  493. package/fesm2015/taiga-ui-kit-components-text-area.js +47 -17
  494. package/fesm2015/taiga-ui-kit-components-text-area.js.map +1 -1
  495. package/fesm2015/taiga-ui-kit-components.js +2 -0
  496. package/fesm2015/taiga-ui-kit-components.js.map +1 -1
  497. package/fesm2015/taiga-ui-kit-directives-dropdown-selection.js +22 -5
  498. package/fesm2015/taiga-ui-kit-directives-dropdown-selection.js.map +1 -1
  499. package/fesm2015/taiga-ui-kit-directives-lazy-loading.js +1 -1
  500. package/fesm2015/taiga-ui-kit-directives-lazy-loading.js.map +1 -1
  501. package/fesm2015/taiga-ui-kit-enums.js.map +1 -1
  502. package/fesm2015/taiga-ui-kit-pipes-field-error.js +43 -4
  503. package/fesm2015/taiga-ui-kit-pipes-field-error.js.map +1 -1
  504. package/fesm2015/taiga-ui-kit-providers.js +18 -4
  505. package/fesm2015/taiga-ui-kit-providers.js.map +1 -1
  506. package/fesm2015/taiga-ui-kit-tokens.js +9 -1
  507. package/fesm2015/taiga-ui-kit-tokens.js.map +1 -1
  508. package/fesm2015/taiga-ui-kit-utils-files.js +8 -1
  509. package/fesm2015/taiga-ui-kit-utils-files.js.map +1 -1
  510. package/fesm5/taiga-ui-kit-abstract.js +64 -15
  511. package/fesm5/taiga-ui-kit-abstract.js.map +1 -1
  512. package/fesm5/taiga-ui-kit-components-accordion.js +1 -1
  513. package/fesm5/taiga-ui-kit-components-accordion.js.map +1 -1
  514. package/fesm5/taiga-ui-kit-components-arrow.js.map +1 -1
  515. package/fesm5/taiga-ui-kit-components-badge.js.map +1 -1
  516. package/fesm5/taiga-ui-kit-components-badged-content.js +2 -2
  517. package/fesm5/taiga-ui-kit-components-badged-content.js.map +1 -1
  518. package/fesm5/taiga-ui-kit-components-calendar-month.js +2 -2
  519. package/fesm5/taiga-ui-kit-components-calendar-month.js.map +1 -1
  520. package/fesm5/taiga-ui-kit-components-combo-box.js +1 -1
  521. package/fesm5/taiga-ui-kit-components-combo-box.js.map +1 -1
  522. package/fesm5/taiga-ui-kit-components-data-list-wrapper.js +4 -4
  523. package/fesm5/taiga-ui-kit-components-data-list-wrapper.js.map +1 -1
  524. package/fesm5/taiga-ui-kit-components-files.js +289 -0
  525. package/fesm5/taiga-ui-kit-components-files.js.map +1 -0
  526. package/fesm5/taiga-ui-kit-components-input-count.js +2 -2
  527. package/fesm5/taiga-ui-kit-components-input-count.js.map +1 -1
  528. package/fesm5/taiga-ui-kit-components-input-date-range.js +3 -1
  529. package/fesm5/taiga-ui-kit-components-input-date-range.js.map +1 -1
  530. package/fesm5/taiga-ui-kit-components-input-date-time.js +1 -1
  531. package/fesm5/taiga-ui-kit-components-input-date-time.js.map +1 -1
  532. package/fesm5/taiga-ui-kit-components-input-date.js +4 -2
  533. package/fesm5/taiga-ui-kit-components-input-date.js.map +1 -1
  534. package/fesm5/taiga-ui-kit-components-input-file.js +43 -45
  535. package/fesm5/taiga-ui-kit-components-input-file.js.map +1 -1
  536. package/fesm5/taiga-ui-kit-components-input-files.js +276 -0
  537. package/fesm5/taiga-ui-kit-components-input-files.js.map +1 -0
  538. package/fesm5/taiga-ui-kit-components-input-month-range.js +68 -44
  539. package/fesm5/taiga-ui-kit-components-input-month-range.js.map +1 -1
  540. package/fesm5/taiga-ui-kit-components-input-month.js +60 -33
  541. package/fesm5/taiga-ui-kit-components-input-month.js.map +1 -1
  542. package/fesm5/taiga-ui-kit-components-input-number.js +25 -17
  543. package/fesm5/taiga-ui-kit-components-input-number.js.map +1 -1
  544. package/fesm5/taiga-ui-kit-components-input-password.js +3 -3
  545. package/fesm5/taiga-ui-kit-components-input-password.js.map +1 -1
  546. package/fesm5/taiga-ui-kit-components-input-phone-international.js +20 -8
  547. package/fesm5/taiga-ui-kit-components-input-phone-international.js.map +1 -1
  548. package/fesm5/taiga-ui-kit-components-input-phone.js +13 -6
  549. package/fesm5/taiga-ui-kit-components-input-phone.js.map +1 -1
  550. package/fesm5/taiga-ui-kit-components-input-range.js +17 -5
  551. package/fesm5/taiga-ui-kit-components-input-range.js.map +1 -1
  552. package/fesm5/taiga-ui-kit-components-input-slider.js +65 -16
  553. package/fesm5/taiga-ui-kit-components-input-slider.js.map +1 -1
  554. package/fesm5/taiga-ui-kit-components-input-tag.js +16 -9
  555. package/fesm5/taiga-ui-kit-components-input-tag.js.map +1 -1
  556. package/fesm5/taiga-ui-kit-components-input-time.js.map +1 -1
  557. package/fesm5/taiga-ui-kit-components-input.js.map +1 -1
  558. package/fesm5/taiga-ui-kit-components-line-clamp.js +29 -18
  559. package/fesm5/taiga-ui-kit-components-line-clamp.js.map +1 -1
  560. package/fesm5/taiga-ui-kit-components-multi-select-option.js +2 -2
  561. package/fesm5/taiga-ui-kit-components-multi-select-option.js.map +1 -1
  562. package/fesm5/taiga-ui-kit-components-multi-select.js +24 -10
  563. package/fesm5/taiga-ui-kit-components-multi-select.js.map +1 -1
  564. package/fesm5/taiga-ui-kit-components-pagination.js +1 -1
  565. package/fesm5/taiga-ui-kit-components-pagination.js.map +1 -1
  566. package/fesm5/taiga-ui-kit-components-progress.js +135 -69
  567. package/fesm5/taiga-ui-kit-components-progress.js.map +1 -1
  568. package/fesm5/taiga-ui-kit-components-radio.js.map +1 -1
  569. package/fesm5/taiga-ui-kit-components-select.js.map +1 -1
  570. package/fesm5/taiga-ui-kit-components-slider.js +202 -30
  571. package/fesm5/taiga-ui-kit-components-slider.js.map +1 -1
  572. package/fesm5/taiga-ui-kit-components-text-area.js +53 -17
  573. package/fesm5/taiga-ui-kit-components-text-area.js.map +1 -1
  574. package/fesm5/taiga-ui-kit-components.js +2 -0
  575. package/fesm5/taiga-ui-kit-components.js.map +1 -1
  576. package/fesm5/taiga-ui-kit-directives-dropdown-selection.js +22 -5
  577. package/fesm5/taiga-ui-kit-directives-dropdown-selection.js.map +1 -1
  578. package/fesm5/taiga-ui-kit-directives-lazy-loading.js +1 -1
  579. package/fesm5/taiga-ui-kit-directives-lazy-loading.js.map +1 -1
  580. package/fesm5/taiga-ui-kit-enums.js.map +1 -1
  581. package/fesm5/taiga-ui-kit-pipes-field-error.js +44 -4
  582. package/fesm5/taiga-ui-kit-pipes-field-error.js.map +1 -1
  583. package/fesm5/taiga-ui-kit-providers.js +20 -4
  584. package/fesm5/taiga-ui-kit-providers.js.map +1 -1
  585. package/fesm5/taiga-ui-kit-tokens.js +9 -1
  586. package/fesm5/taiga-ui-kit-tokens.js.map +1 -1
  587. package/fesm5/taiga-ui-kit-utils-files.js +8 -1
  588. package/fesm5/taiga-ui-kit-utils-files.js.map +1 -1
  589. package/package.json +4 -4
  590. package/pipes/field-error/field-error-content-pipe.d.ts +12 -0
  591. package/pipes/field-error/index.d.ts +1 -0
  592. package/pipes/field-error/taiga-ui-kit-pipes-field-error.metadata.json +1 -1
  593. package/providers/index.d.ts +1 -0
  594. package/providers/month-formatter.provider.d.ts +6 -0
  595. package/providers/taiga-ui-kit-providers.metadata.json +1 -1
  596. package/tokens/i18n.d.ts +2 -0
  597. package/tokens/index.d.ts +1 -0
  598. package/tokens/month-formatter.d.ts +4 -0
  599. package/tokens/taiga-ui-kit-tokens.metadata.json +1 -1
  600. package/utils/files/get-accept-array.d.ts +1 -0
  601. package/utils/files/index.d.ts +1 -0
  602. package/utils/files/taiga-ui-kit-utils-files.metadata.json +1 -1
  603. package/components/progress/pipes/progress-color-segments.pipe.d.ts +0 -9
  604. package/esm2015/components/progress/pipes/abstract-color-segments.js +0 -32
  605. package/esm2015/components/progress/pipes/progress-color-segments-async.pipe.js +0 -15
  606. package/esm2015/components/progress/pipes/progress-color-segments.pipe.js +0 -18
  607. package/esm5/components/progress/pipes/abstract-color-segments.js +0 -35
  608. package/esm5/components/progress/pipes/progress-color-segments-async.pipe.js +0 -21
  609. package/esm5/components/progress/pipes/progress-color-segments.pipe.js +0 -23
@@ -0,0 +1,276 @@
1
+ import { __extends, __spread, __decorate, __param } from 'tslib';
2
+ import { EventEmitter, Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Output, Component, ChangeDetectionStrategy, ViewEncapsulation, forwardRef, NgModule } from '@angular/core';
3
+ import { NgControl } from '@angular/forms';
4
+ import { isNativeFocused, EMPTY_ARRAY, TUI_IS_MOBILE, tuiDefaultProp, tuiPure, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiNullableControl, TuiLetModule, TuiFocusedModule, TuiFocusVisibleModule, TuiPressedModule, TuiHoveredModule, TuiFocusableModule, TuiDroppableModule } from '@taiga-ui/cdk';
5
+ import { MODE_PROVIDER, TuiWrapperModule, TuiSvgModule, TuiLinkModule, TuiLoaderModule, TuiButtonModule, TuiGroupModule } from '@taiga-ui/core';
6
+ import { TUI_INPUT_FILE_TEXTS, TUI_DIGITAL_INFORMATION_UNITS } from '@taiga-ui/kit/tokens';
7
+ import { formatSize, getAcceptArray } from '@taiga-ui/kit/utils/files';
8
+ import { of, Observable } from 'rxjs';
9
+ import { map } from 'rxjs/operators';
10
+ import { CommonModule } from '@angular/common';
11
+ import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
12
+
13
+ var DEFAULT_MAX_SIZE = 30 * 1000 * 1000; // 30 MB
14
+ // @dynamic
15
+ var TuiInputFilesComponent = /** @class */ (function (_super) {
16
+ __extends(TuiInputFilesComponent, _super);
17
+ function TuiInputFilesComponent(control, changeDetectorRef, isMobile, inputFileTexts$, units$) {
18
+ var _this = _super.call(this, control, changeDetectorRef) || this;
19
+ _this.isMobile = isMobile;
20
+ _this.inputFileTexts$ = inputFileTexts$;
21
+ _this.units$ = units$;
22
+ _this.dataTransfer = null;
23
+ _this.link = '';
24
+ _this.label = '';
25
+ _this.accept = '';
26
+ _this.multiple = false;
27
+ _this.size = 'm';
28
+ _this.maxFileSize = DEFAULT_MAX_SIZE;
29
+ _this.reject = new EventEmitter();
30
+ return _this;
31
+ }
32
+ TuiInputFilesComponent_1 = TuiInputFilesComponent;
33
+ Object.defineProperty(TuiInputFilesComponent.prototype, "nativeFocusableElement", {
34
+ get: function () {
35
+ var _a;
36
+ return ((_a = this.input) === null || _a === void 0 ? void 0 : _a.nativeElement) || null;
37
+ },
38
+ enumerable: true,
39
+ configurable: true
40
+ });
41
+ Object.defineProperty(TuiInputFilesComponent.prototype, "focused", {
42
+ get: function () {
43
+ return isNativeFocused(this.nativeFocusableElement);
44
+ },
45
+ enumerable: true,
46
+ configurable: true
47
+ });
48
+ Object.defineProperty(TuiInputFilesComponent.prototype, "computedLink$", {
49
+ get: function () {
50
+ return this.computeLink$(this.fileDragged, this.multiple, this.link);
51
+ },
52
+ enumerable: true,
53
+ configurable: true
54
+ });
55
+ Object.defineProperty(TuiInputFilesComponent.prototype, "computedLabel$", {
56
+ get: function () {
57
+ return this.computeLabel$(this.isMobile, this.fileDragged, this.multiple, this.label);
58
+ },
59
+ enumerable: true,
60
+ configurable: true
61
+ });
62
+ Object.defineProperty(TuiInputFilesComponent.prototype, "fileDragged", {
63
+ get: function () {
64
+ var _a;
65
+ return !!((_a = this.dataTransfer) === null || _a === void 0 ? void 0 : _a.types.includes('Files'));
66
+ },
67
+ enumerable: true,
68
+ configurable: true
69
+ });
70
+ Object.defineProperty(TuiInputFilesComponent.prototype, "arrayValue", {
71
+ get: function () {
72
+ return this.getValueArray(this.value);
73
+ },
74
+ enumerable: true,
75
+ configurable: true
76
+ });
77
+ TuiInputFilesComponent.prototype.onHovered = function (hovered) {
78
+ this.updateHovered(hovered);
79
+ };
80
+ TuiInputFilesComponent.prototype.onFocused = function (focused) {
81
+ this.updateFocused(focused);
82
+ };
83
+ TuiInputFilesComponent.prototype.onPressed = function (pressed) {
84
+ this.updatePressed(pressed);
85
+ };
86
+ TuiInputFilesComponent.prototype.onFilesSelected = function (input, texts, units) {
87
+ this.processSelectedFiles(input.files, texts, units);
88
+ input.value = '';
89
+ };
90
+ TuiInputFilesComponent.prototype.onDropped = function (event, texts, units) {
91
+ this.processSelectedFiles(event.files, texts, units);
92
+ };
93
+ TuiInputFilesComponent.prototype.onDragOver = function (dataTransfer) {
94
+ this.dataTransfer = dataTransfer;
95
+ };
96
+ TuiInputFilesComponent.prototype.removeFile = function (removedFile) {
97
+ this.updateValue(this.multiple ? this.arrayValue.filter(function (file) { return file !== removedFile; }) : null);
98
+ };
99
+ TuiInputFilesComponent.prototype.computeLink$ = function (fileDragged, multiple, link) {
100
+ return fileDragged
101
+ ? of('')
102
+ : this.inputFileTexts$.pipe(map(function (texts) {
103
+ return multiple && link === ''
104
+ ? texts.defaultLinkMultiple
105
+ : link || texts.defaultLinkSingle;
106
+ }));
107
+ };
108
+ TuiInputFilesComponent.prototype.computeLabel$ = function (isMobile, fileDragged, multiple, label) {
109
+ if (isMobile) {
110
+ return of('');
111
+ }
112
+ if (fileDragged) {
113
+ return this.inputFileTexts$.pipe(map(function (texts) { return (multiple ? texts.dropMultiple : texts.drop); }));
114
+ }
115
+ return this.inputFileTexts$.pipe(map(function (texts) {
116
+ return multiple && label === ''
117
+ ? texts.defaultLabelMultiple
118
+ : label || texts.defaultLabelSingle;
119
+ }));
120
+ };
121
+ TuiInputFilesComponent.prototype.getValueArray = function (value) {
122
+ if (!value) {
123
+ return EMPTY_ARRAY;
124
+ }
125
+ return Array.isArray(value) ? value : [value];
126
+ };
127
+ TuiInputFilesComponent.prototype.processSelectedFiles = function (files, texts, units) {
128
+ var _this = this;
129
+ // IE11 after selecting a file through the open dialog generates a second event passing an empty FileList.
130
+ if (!(files === null || files === void 0 ? void 0 : files.length)) {
131
+ return;
132
+ }
133
+ var newFiles = this.multiple ? Array.from(files) : [files[0]];
134
+ var tooBigFiles = newFiles.filter(function (file) { return file.size > _this.maxFileSize; });
135
+ var wrongFormatFiles = newFiles.filter(function (file) { return !_this.isFormatAcceptable(file) && !tooBigFiles.includes(file); });
136
+ var acceptedFiles = newFiles.filter(function (file) { return !tooBigFiles.includes(file) && !wrongFormatFiles.includes(file); });
137
+ if (tooBigFiles.length || wrongFormatFiles.length) {
138
+ this.rejectFiles(__spread(tooBigFiles.map(function (file) { return ({
139
+ name: file.name,
140
+ type: file.type,
141
+ size: file.size,
142
+ content: texts.maxSizeRejectionReason +
143
+ formatSize(units, _this.maxFileSize),
144
+ }); }), wrongFormatFiles.map(function (file) { return ({
145
+ name: file.name,
146
+ type: file.type,
147
+ size: file.size,
148
+ content: texts.formatRejectionReason,
149
+ }); })));
150
+ }
151
+ this.updateValue(this.multiple
152
+ ? __spread(this.arrayValue, acceptedFiles) : acceptedFiles[0] || null);
153
+ };
154
+ TuiInputFilesComponent.prototype.isFormatAcceptable = function (file) {
155
+ if (!this.accept) {
156
+ return true;
157
+ }
158
+ var extension = "." + (file.name.split('.').pop() || '').toLowerCase();
159
+ return getAcceptArray(this.accept).some(function (format) {
160
+ return format === extension ||
161
+ format === file.type ||
162
+ (format.split('/')[1] === '*' &&
163
+ file.type.split('/')[0] === format.split('/')[0]);
164
+ });
165
+ };
166
+ TuiInputFilesComponent.prototype.rejectFiles = function (rejectedFiles) {
167
+ this.reject.emit(this.multiple ? rejectedFiles : rejectedFiles[0]);
168
+ };
169
+ var TuiInputFilesComponent_1;
170
+ TuiInputFilesComponent.ctorParameters = function () { return [
171
+ { type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
172
+ { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
173
+ { type: Boolean, decorators: [{ type: Inject, args: [TUI_IS_MOBILE,] }] },
174
+ { type: Observable, decorators: [{ type: Inject, args: [TUI_INPUT_FILE_TEXTS,] }] },
175
+ { type: Observable, decorators: [{ type: Inject, args: [TUI_DIGITAL_INFORMATION_UNITS,] }] }
176
+ ]; };
177
+ __decorate([
178
+ ViewChild('input')
179
+ ], TuiInputFilesComponent.prototype, "input", void 0);
180
+ __decorate([
181
+ Input(),
182
+ tuiDefaultProp()
183
+ ], TuiInputFilesComponent.prototype, "link", void 0);
184
+ __decorate([
185
+ Input(),
186
+ tuiDefaultProp()
187
+ ], TuiInputFilesComponent.prototype, "label", void 0);
188
+ __decorate([
189
+ Input(),
190
+ tuiDefaultProp()
191
+ ], TuiInputFilesComponent.prototype, "accept", void 0);
192
+ __decorate([
193
+ Input(),
194
+ tuiDefaultProp()
195
+ ], TuiInputFilesComponent.prototype, "multiple", void 0);
196
+ __decorate([
197
+ Input(),
198
+ tuiDefaultProp()
199
+ ], TuiInputFilesComponent.prototype, "size", void 0);
200
+ __decorate([
201
+ Input(),
202
+ tuiDefaultProp()
203
+ ], TuiInputFilesComponent.prototype, "maxFileSize", void 0);
204
+ __decorate([
205
+ Output()
206
+ ], TuiInputFilesComponent.prototype, "reject", void 0);
207
+ __decorate([
208
+ tuiPure
209
+ ], TuiInputFilesComponent.prototype, "computeLink$", null);
210
+ __decorate([
211
+ tuiPure
212
+ ], TuiInputFilesComponent.prototype, "computeLabel$", null);
213
+ __decorate([
214
+ tuiPure
215
+ ], TuiInputFilesComponent.prototype, "getValueArray", null);
216
+ TuiInputFilesComponent = TuiInputFilesComponent_1 = __decorate([
217
+ Component({
218
+ selector: 'tui-input-files',
219
+ template: "<tui-wrapper\n appearance=\"input-file\"\n class=\"t-wrapper\"\n [class._mobile]=\"isMobile\"\n [focused]=\"computedFocused\"\n [hovered]=\"computedHovered || fileDragged\"\n [pressed]=\"computedPressed\"\n [disabled]=\"computedDisabled\"\n>\n <label\n *ngIf=\"units$ | async as units\"\n automation-id=\"tui-input-file__label\"\n >\n <a tuiLink>\n <span\n polymorpheus-outlet\n class=\"t-inline\"\n [content]=\"computedLink$ | async\"\n ></span>\n </a>\n <ng-container *ngIf=\"computedLabel$ | async as computedLabel\">\n <span>&nbsp;</span>\n <span\n polymorpheus-outlet\n class=\"t-inline\"\n [content]=\"computedLabel\"\n ></span>\n </ng-container>\n <ng-container *ngIf=\"!readOnly && !computedDisabled\">\n <input\n *ngIf=\"inputFileTexts$ | async as texts\"\n #input\n type=\"file\"\n class=\"t-native\"\n [id]=\"id\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n [tuiFocusable]=\"focusable\"\n (change)=\"onFilesSelected(input, texts, units)\"\n (tuiHoveredChange)=\"onHovered($event)\"\n (tuiFocusedChange)=\"onFocused($event)\"\n (tuiPressedChange)=\"onPressed($event)\"\n (tuiDroppableDropped)=\"onDropped($event, texts, units)\"\n (tuiDroppableDragOverChange)=\"onDragOver($event)\"\n (mousedown.prevent.silent)=\"0\"\n />\n </ng-container>\n </label>\n</tui-wrapper>\n",
220
+ changeDetection: ChangeDetectionStrategy.OnPush,
221
+ encapsulation: ViewEncapsulation.None,
222
+ providers: [
223
+ MODE_PROVIDER,
224
+ {
225
+ provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
226
+ useExisting: forwardRef(function () { return TuiInputFilesComponent_1; }),
227
+ },
228
+ ],
229
+ styles: ["tui-input-files{display:block}tui-wrapper[data-appearance=input-file]{display:flex;background:0 0;font:var(--tui-font-text-m);word-wrap:break-word;color:var(--tui-text-02);flex:1;justify-content:center;align-items:center;min-height:var(--tui-height-l);border-radius:var(--tui-radius-m);padding:1rem .5rem;box-sizing:border-box}tui-wrapper[data-appearance=input-file]:after{border:1px dashed;color:var(--tui-link)}tui-wrapper[data-appearance=input-file]._mobile:after{border:1px solid}tui-wrapper[data-appearance=input-file][data-state=hovered]{background:var(--tui-secondary)}tui-wrapper[data-appearance=input-file][data-state=hovered]:after{color:var(--tui-link-hover)}tui-wrapper[data-appearance=input-file][data-state=pressed]{background:var(--tui-secondary-hover)}tui-wrapper[data-appearance=input-file][data-state=disabled]{opacity:var(--tui-disabled-opacity);pointer-events:none}tui-wrapper[data-appearance=input-file][data-state=disabled]:after{color:var(--tui-text-03)}tui-wrapper[data-appearance=input-file]._focused:after{border-style:solid;border-width:2px;color:var(--tui-focus)}tui-wrapper[data-appearance=input-file][data-mode=onDark],tui-wrapper[data-appearance=input-file][data-mode=onDark]._focused:after,tui-wrapper[data-appearance=input-file][data-mode=onDark]:after{color:var(--tui-text-01-night)}tui-wrapper[data-appearance=input-file][data-mode=onDark][data-state=hovered]{background:var(--tui-clear-inverse-hover)}tui-wrapper[data-appearance=input-file][data-mode=onDark][data-state=hovered]:after,tui-wrapper[data-appearance=input-file][data-mode=onDark][data-state=pressed]:after{color:var(--tui-text-03-night)}tui-wrapper[data-appearance=input-file][data-mode=onDark][data-state=pressed]{background:var(--tui-clear-inverse-active)}tui-wrapper[data-appearance=input-file][data-mode=onLight],tui-wrapper[data-appearance=input-file][data-mode=onLight]:after{color:var(--tui-text-01)}tui-wrapper[data-appearance=input-file][data-mode=onLight][data-state=hovered]{background:var(--tui-clear-hover)}tui-wrapper[data-appearance=input-file][data-mode=onLight][data-state=hovered]:after,tui-wrapper[data-appearance=input-file][data-mode=onLight][data-state=pressed]:after{color:var(--tui-text-03)}tui-wrapper[data-appearance=input-file][data-mode=onLight][data-state=pressed]{background:var(--tui-clear-active)}.t-native{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer}.t-native::-webkit-file-upload-button{display:none}.t-inline{display:inline}"]
230
+ }),
231
+ __param(0, Optional()),
232
+ __param(0, Self()),
233
+ __param(0, Inject(NgControl)),
234
+ __param(1, Inject(ChangeDetectorRef)),
235
+ __param(2, Inject(TUI_IS_MOBILE)),
236
+ __param(3, Inject(TUI_INPUT_FILE_TEXTS)),
237
+ __param(4, Inject(TUI_DIGITAL_INFORMATION_UNITS))
238
+ ], TuiInputFilesComponent);
239
+ return TuiInputFilesComponent;
240
+ }(AbstractTuiNullableControl));
241
+
242
+ var TuiInputFilesModule = /** @class */ (function () {
243
+ function TuiInputFilesModule() {
244
+ }
245
+ TuiInputFilesModule = __decorate([
246
+ NgModule({
247
+ imports: [
248
+ CommonModule,
249
+ PolymorpheusModule,
250
+ TuiLetModule,
251
+ TuiFocusedModule,
252
+ TuiFocusVisibleModule,
253
+ TuiPressedModule,
254
+ TuiHoveredModule,
255
+ TuiFocusableModule,
256
+ TuiDroppableModule,
257
+ TuiWrapperModule,
258
+ TuiSvgModule,
259
+ TuiLinkModule,
260
+ TuiLoaderModule,
261
+ TuiButtonModule,
262
+ TuiGroupModule,
263
+ ],
264
+ declarations: [TuiInputFilesComponent],
265
+ exports: [TuiInputFilesComponent],
266
+ })
267
+ ], TuiInputFilesModule);
268
+ return TuiInputFilesModule;
269
+ }());
270
+
271
+ /**
272
+ * Generated bundle index. Do not edit.
273
+ */
274
+
275
+ export { TuiInputFilesComponent, TuiInputFilesModule };
276
+ //# sourceMappingURL=taiga-ui-kit-components-input-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taiga-ui-kit-components-input-files.js","sources":["ng://@taiga-ui/kit/components/input-files/input-files.component.ts","ng://@taiga-ui/kit/components/input-files/input-files.module.ts","ng://@taiga-ui/kit/components/input-files/taiga-ui-kit-components-input-files.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n Optional,\n Output,\n Self,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiNullableControl,\n EMPTY_ARRAY,\n isNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TUI_IS_MOBILE,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {MODE_PROVIDER, TuiSizeL} from '@taiga-ui/core';\nimport {TuiFileLike} from '@taiga-ui/kit/interfaces';\nimport {TUI_DIGITAL_INFORMATION_UNITS, TUI_INPUT_FILE_TEXTS} from '@taiga-ui/kit/tokens';\nimport {formatSize, getAcceptArray} from '@taiga-ui/kit/utils/files';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nconst DEFAULT_MAX_SIZE = 30 * 1000 * 1000; // 30 MB\n\n// @dynamic\n@Component({\n selector: 'tui-input-files',\n templateUrl: './input-files.template.html',\n styleUrls: ['./input-files.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n MODE_PROVIDER,\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputFilesComponent),\n },\n ],\n})\nexport class TuiInputFilesComponent\n extends AbstractTuiNullableControl<TuiFileLike | ReadonlyArray<TuiFileLike>>\n implements TuiFocusableElementAccessor\n{\n @ViewChild('input')\n private readonly input?: ElementRef<HTMLInputElement>;\n\n private dataTransfer: DataTransfer | null = null;\n\n @Input()\n @tuiDefaultProp()\n link: PolymorpheusContent = '';\n\n @Input()\n @tuiDefaultProp()\n label: PolymorpheusContent = '';\n\n @Input()\n @tuiDefaultProp()\n accept = '';\n\n @Input()\n @tuiDefaultProp()\n multiple = false;\n\n @Input()\n @tuiDefaultProp()\n size: TuiSizeL = 'm';\n\n @Input()\n @tuiDefaultProp()\n maxFileSize = DEFAULT_MAX_SIZE;\n\n @Output()\n reject = new EventEmitter<ReadonlyArray<TuiFileLike> | TuiFileLike>();\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef)\n changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_IS_MOBILE)\n readonly isMobile: boolean,\n @Inject(TUI_INPUT_FILE_TEXTS)\n readonly inputFileTexts$: Observable<\n Record<\n | 'defaultLabelSingle'\n | 'defaultLabelMultiple'\n | 'defaultLinkSingle'\n | 'defaultLinkMultiple'\n | 'maxSizeRejectionReason'\n | 'formatRejectionReason'\n | 'drop'\n | 'dropMultiple',\n string\n >\n >,\n @Inject(TUI_DIGITAL_INFORMATION_UNITS)\n readonly units$: Observable<[string, string, string]>,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.input?.nativeElement || null;\n }\n\n get focused(): boolean {\n return isNativeFocused(this.nativeFocusableElement);\n }\n\n get computedLink$(): Observable<PolymorpheusContent> {\n return this.computeLink$(this.fileDragged, this.multiple, this.link);\n }\n\n get computedLabel$(): Observable<PolymorpheusContent> {\n return this.computeLabel$(\n this.isMobile,\n this.fileDragged,\n this.multiple,\n this.label,\n );\n }\n\n get fileDragged(): boolean {\n return !!this.dataTransfer?.types.includes('Files');\n }\n\n get arrayValue(): ReadonlyArray<TuiFileLike> {\n return this.getValueArray(this.value);\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n }\n\n onPressed(pressed: boolean) {\n this.updatePressed(pressed);\n }\n\n onFilesSelected(\n input: HTMLInputElement,\n texts: Record<'maxSizeRejectionReason' | 'formatRejectionReason', string>,\n units: [string, string, string],\n ) {\n this.processSelectedFiles(input.files, texts, units);\n input.value = '';\n }\n\n onDropped(\n event: DataTransfer,\n texts: Record<'maxSizeRejectionReason' | 'formatRejectionReason', string>,\n units: [string, string, string],\n ) {\n this.processSelectedFiles(event.files, texts, units);\n }\n\n onDragOver(dataTransfer: DataTransfer | null) {\n this.dataTransfer = dataTransfer;\n }\n\n removeFile(removedFile: TuiFileLike) {\n this.updateValue(\n this.multiple ? this.arrayValue.filter(file => file !== removedFile) : null,\n );\n }\n\n @tuiPure\n private computeLink$(\n fileDragged: boolean,\n multiple: boolean,\n link: PolymorpheusContent,\n ): Observable<PolymorpheusContent> {\n return fileDragged\n ? of('')\n : this.inputFileTexts$.pipe(\n map(texts =>\n multiple && link === ''\n ? texts.defaultLinkMultiple\n : link || texts.defaultLinkSingle,\n ),\n );\n }\n\n @tuiPure\n private computeLabel$(\n isMobile: boolean,\n fileDragged: boolean,\n multiple: boolean,\n label: PolymorpheusContent,\n ): Observable<PolymorpheusContent> {\n if (isMobile) {\n return of('');\n }\n\n if (fileDragged) {\n return this.inputFileTexts$.pipe(\n map(texts => (multiple ? texts.dropMultiple : texts.drop)),\n );\n }\n\n return this.inputFileTexts$.pipe(\n map(texts =>\n multiple && label === ''\n ? texts.defaultLabelMultiple\n : label || texts.defaultLabelSingle,\n ),\n );\n }\n\n @tuiPure\n private getValueArray(\n value: TuiFileLike | ReadonlyArray<TuiFileLike> | null,\n ): ReadonlyArray<TuiFileLike> {\n if (!value) {\n return EMPTY_ARRAY;\n }\n\n return Array.isArray(value) ? value : [value];\n }\n\n private processSelectedFiles(\n files: FileList | null,\n texts: Record<'maxSizeRejectionReason' | 'formatRejectionReason', string>,\n units: [string, string, string],\n ) {\n // IE11 after selecting a file through the open dialog generates a second event passing an empty FileList.\n if (!files?.length) {\n return;\n }\n\n const newFiles = this.multiple ? Array.from(files) : [files[0]];\n const tooBigFiles = newFiles.filter(file => file.size > this.maxFileSize);\n const wrongFormatFiles = newFiles.filter(\n file => !this.isFormatAcceptable(file) && !tooBigFiles.includes(file),\n );\n const acceptedFiles = newFiles.filter(\n file => !tooBigFiles.includes(file) && !wrongFormatFiles.includes(file),\n );\n\n if (tooBigFiles.length || wrongFormatFiles.length) {\n this.rejectFiles([\n ...tooBigFiles.map(file => ({\n name: file.name,\n type: file.type,\n size: file.size,\n content:\n texts.maxSizeRejectionReason +\n formatSize(units, this.maxFileSize),\n })),\n ...wrongFormatFiles.map(file => ({\n name: file.name,\n type: file.type,\n size: file.size,\n content: texts.formatRejectionReason,\n })),\n ]);\n }\n\n this.updateValue(\n this.multiple\n ? [...this.arrayValue, ...acceptedFiles]\n : acceptedFiles[0] || null,\n );\n }\n\n private isFormatAcceptable(file: File): boolean {\n if (!this.accept) {\n return true;\n }\n\n const extension = `.${(file.name.split('.').pop() || '').toLowerCase()}`;\n\n return getAcceptArray(this.accept).some(\n format =>\n format === extension ||\n format === file.type ||\n (format.split('/')[1] === '*' &&\n file.type.split('/')[0] === format.split('/')[0]),\n );\n }\n\n private rejectFiles(rejectedFiles: ReadonlyArray<TuiFileLike>) {\n this.reject.emit(this.multiple ? rejectedFiles : rejectedFiles[0]);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {\n TuiDroppableModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiFocusVisibleModule,\n TuiHoveredModule,\n TuiLetModule,\n TuiPressedModule,\n} from '@taiga-ui/cdk';\nimport {\n TuiButtonModule,\n TuiGroupModule,\n TuiLinkModule,\n TuiLoaderModule,\n TuiSvgModule,\n TuiWrapperModule,\n} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiInputFilesComponent} from './input-files.component';\n\n@NgModule({\n imports: [\n CommonModule,\n PolymorpheusModule,\n TuiLetModule,\n TuiFocusedModule,\n TuiFocusVisibleModule,\n TuiPressedModule,\n TuiHoveredModule,\n TuiFocusableModule,\n TuiDroppableModule,\n TuiWrapperModule,\n TuiSvgModule,\n TuiLinkModule,\n TuiLoaderModule,\n TuiButtonModule,\n TuiGroupModule,\n ],\n declarations: [TuiInputFilesComponent],\n exports: [TuiInputFilesComponent],\n})\nexport class TuiInputFilesModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAmCA,IAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C;;IAgBY,0CAAoE;IAmC5E,gCAII,OAAyB,EAEzB,iBAAoC,EAE3B,QAAiB,EAEjB,eAYR,EAEQ,MAA4C;QAxBzD,YA0BI,kBAAM,OAAO,EAAE,iBAAiB,CAAC,SACpC;QAnBY,cAAQ,GAAR,QAAQ,CAAS;QAEjB,qBAAe,GAAf,eAAe,CAYvB;QAEQ,YAAM,GAAN,MAAM,CAAsC;QArDjD,kBAAY,GAAwB,IAAI,CAAC;QAIjD,UAAI,GAAwB,EAAE,CAAC;QAI/B,WAAK,GAAwB,EAAE,CAAC;QAIhC,YAAM,GAAG,EAAE,CAAC;QAIZ,cAAQ,GAAG,KAAK,CAAC;QAIjB,UAAI,GAAa,GAAG,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E,CAAA;QACV,WAAA,IAAI,EAAE,CAAA;QACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;QAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QAEzB,WAAA,MAAM,CAAC,aAAa,CAAC,CAAA;QAErB,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;QAc5B,WAAA,MAAM,CAAC,6BAA6B,CAAC,CAAA;OA3DjC,sBAAsB,CA2PlC;IAAD,6BAAC;CAAA,CA1PW,0BAA0B;;;ICTtC;KAAmC;IAAtB,mBAAmB;QArB/B,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,YAAY;gBACZ,kBAAkB;gBAClB,YAAY;gBACZ,gBAAgB;gBAChB,qBAAqB;gBACrB,gBAAgB;gBAChB,gBAAgB;gBAChB,kBAAkB;gBAClB,kBAAkB;gBAClB,gBAAgB;gBAChB,YAAY;gBACZ,aAAa;gBACb,eAAe;gBACf,eAAe;gBACf,cAAc;aACjB;YACD,YAAY,EAAE,CAAC,sBAAsB,CAAC;YACtC,OAAO,EAAE,CAAC,sBAAsB,CAAC;SACpC,CAAC;OACW,mBAAmB,CAAG;IAAD,0BAAC;CAAnC;;AC5CA;;;;;;"}
@@ -1,19 +1,35 @@
1
- import { __extends, __decorate, __param } from 'tslib';
2
- import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Component, forwardRef, ChangeDetectionStrategy, Directive, NgModule } from '@angular/core';
1
+ import { __extends, __decorate, __param, __spread } from 'tslib';
2
+ import { forwardRef, Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Component, ChangeDetectionStrategy, Directive, NgModule } from '@angular/core';
3
3
  import { NgControl } from '@angular/forms';
4
- import { TUI_FIRST_DAY, TUI_LAST_DAY, ALWAYS_FALSE_HANDLER, TuiMonthRange, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiControl, AbstractTuiNullableControl, TuiPreventDefaultModule, TuiActiveZoneModule } from '@taiga-ui/cdk';
5
- import { sizeBigger, TUI_MONTHS, TuiTextfieldSizeDirective, TUI_TEXTFIELD_SIZE, TuiPrimitiveTextfieldComponent, TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost, TuiHostedDropdownModule, TuiPrimitiveTextfieldModule, TuiSvgModule, TuiTextfieldComponent } from '@taiga-ui/core';
6
- import { LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER } from '@taiga-ui/kit/providers';
7
- import { Observable } from 'rxjs';
4
+ import { TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiControl, TUI_FIRST_DAY, TUI_LAST_DAY, ALWAYS_FALSE_HANDLER, TuiMonthRange, tuiDefaultProp, AbstractTuiNullableControl, TuiDestroyService, TuiPreventDefaultModule, TuiActiveZoneModule, TuiMapperPipeModule } from '@taiga-ui/cdk';
5
+ import { TuiMonthPipe, sizeBigger, TuiTextfieldSizeDirective, TUI_TEXTFIELD_SIZE, TuiPrimitiveTextfieldComponent, TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost, TuiHostedDropdownModule, TuiPrimitiveTextfieldModule, TuiSvgModule, TuiTextfieldComponent } from '@taiga-ui/core';
6
+ import { TUI_MONTH_FORMATTER } from '@taiga-ui/kit/tokens';
7
+ import { LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER, TUI_MONTH_FORMATTER_PROVIDER } from '@taiga-ui/kit/providers';
8
+ import { Subject, combineLatest, Observable } from 'rxjs';
9
+ import { distinctUntilChanged, switchMap, takeUntil } from 'rxjs/operators';
8
10
  import { CommonModule } from '@angular/common';
9
11
  import { TuiCalendarMonthModule } from '@taiga-ui/kit/components/calendar-month';
10
12
 
13
+ var TUI_INPUT_MONTH_RANGE_PROVIDERS = [
14
+ {
15
+ provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
16
+ useExisting: forwardRef(function () { return TuiInputMonthRangeComponent; }),
17
+ },
18
+ {
19
+ provide: AbstractTuiControl,
20
+ useExisting: forwardRef(function () { return TuiInputMonthRangeComponent; }),
21
+ },
22
+ LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER,
23
+ TUI_MONTH_FORMATTER_PROVIDER,
24
+ TuiMonthPipe,
25
+ ];
26
+
11
27
  // @dynamic
12
28
  var TuiInputMonthRangeComponent = /** @class */ (function (_super) {
13
29
  __extends(TuiInputMonthRangeComponent, _super);
14
- function TuiInputMonthRangeComponent(control, changeDetectorRef, months$, textfieldSize) {
30
+ function TuiInputMonthRangeComponent(control, changeDetectorRef, formatter, textfieldSize) {
15
31
  var _this = _super.call(this, control, changeDetectorRef) || this;
16
- _this.months$ = months$;
32
+ _this.formatter = formatter;
17
33
  _this.textfieldSize = textfieldSize;
18
34
  _this.min = TUI_FIRST_DAY;
19
35
  _this.max = TUI_LAST_DAY;
@@ -21,7 +37,6 @@ var TuiInputMonthRangeComponent = /** @class */ (function (_super) {
21
37
  _this.open = false;
22
38
  return _this;
23
39
  }
24
- TuiInputMonthRangeComponent_1 = TuiInputMonthRangeComponent;
25
40
  Object.defineProperty(TuiInputMonthRangeComponent.prototype, "nativeFocusableElement", {
26
41
  get: function () {
27
42
  return this.textfield ? this.textfield.nativeFocusableElement : null;
@@ -45,18 +60,16 @@ var TuiInputMonthRangeComponent = /** @class */ (function (_super) {
45
60
  enumerable: true,
46
61
  configurable: true
47
62
  });
48
- TuiInputMonthRangeComponent.prototype.computeValue = function (value, focused, months) {
49
- if (value === null) {
50
- return '';
51
- }
52
- var formattedValueTo = !value.isSingleMonth || !focused ? this.formatMonth(value.to, months) : '';
53
- return this.formatMonth(value.from, months) + " \u2014 " + formattedValueTo;
63
+ TuiInputMonthRangeComponent.prototype.computeValue = function (from, to) {
64
+ var formattedTo = from === to && this.focused ? '' : to;
65
+ return from + " \u2014 " + formattedTo;
54
66
  };
55
67
  TuiInputMonthRangeComponent.prototype.onValueChange = function (value) {
56
- if (value === '') {
57
- this.updateValue(null);
58
- this.onOpenChange(true);
68
+ if (value) {
69
+ return;
59
70
  }
71
+ this.updateValue(null);
72
+ this.onOpenChange(true);
60
73
  };
61
74
  TuiInputMonthRangeComponent.prototype.onMonthClick = function (month) {
62
75
  if (this.value === null || !this.value.isSingleMonth) {
@@ -85,18 +98,13 @@ var TuiInputMonthRangeComponent = /** @class */ (function (_super) {
85
98
  _super.prototype.setDisabledState.call(this);
86
99
  this.close();
87
100
  };
88
- TuiInputMonthRangeComponent.prototype.formatMonth = function (_a, months) {
89
- var month = _a.month, formattedYear = _a.formattedYear;
90
- return months[month] + " " + formattedYear;
91
- };
92
101
  TuiInputMonthRangeComponent.prototype.close = function () {
93
102
  this.open = false;
94
103
  };
95
- var TuiInputMonthRangeComponent_1;
96
104
  TuiInputMonthRangeComponent.ctorParameters = function () { return [
97
105
  { type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
98
106
  { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
99
- { type: Observable, decorators: [{ type: Inject, args: [TUI_MONTHS,] }] },
107
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_MONTH_FORMATTER,] }] },
100
108
  { type: TuiTextfieldSizeDirective, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_SIZE,] }] }
101
109
  ]; };
102
110
  __decorate([
@@ -114,21 +122,11 @@ var TuiInputMonthRangeComponent = /** @class */ (function (_super) {
114
122
  Input(),
115
123
  tuiDefaultProp()
116
124
  ], TuiInputMonthRangeComponent.prototype, "disabledItemHandler", void 0);
117
- TuiInputMonthRangeComponent = TuiInputMonthRangeComponent_1 = __decorate([
125
+ TuiInputMonthRangeComponent = __decorate([
118
126
  Component({
119
127
  selector: 'tui-input-month-range',
120
- template: "<tui-hosted-dropdown\n class=\"hosted\"\n [canOpen]=\"interactive\"\n [content]=\"dropdown\"\n [open]=\"open && interactive\"\n (openChange)=\"onOpenChange($event)\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-primitive-textfield\n *ngIf=\"months$ | async as months\"\n class=\"textfield\"\n [editable]=\"false\"\n [disabled]=\"computedDisabled\"\n [nativeId]=\"nativeId\"\n [readOnly]=\"readOnly\"\n [iconContent]=\"calendarIcon\"\n [pseudoFocused]=\"pseudoFocused\"\n [pseudoHovered]=\"pseudoHovered\"\n [invalid]=\"computedInvalid\"\n [value]=\"computeValue(value, focused, months)\"\n (valueChange)=\"onValueChange($event)\"\n (hoveredChange)=\"onHovered($event)\"\n >\n <ng-content></ng-content>\n <ng-content select=\"input\" ngProjectAs=\"input\"></ng-content>\n </tui-primitive-textfield>\n\n <ng-template #dropdown>\n <tui-calendar-month\n tuiPreventDefault=\"mousedown\"\n [disabledItemHandler]=\"disabledItemHandler\"\n [min]=\"min\"\n [max]=\"max\"\n [value]=\"value\"\n (monthClick)=\"onMonthClick($event)\"\n ></tui-calendar-month>\n </ng-template>\n</tui-hosted-dropdown>\n",
121
- providers: [
122
- {
123
- provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
124
- useExisting: forwardRef(function () { return TuiInputMonthRangeComponent_1; }),
125
- },
126
- {
127
- provide: AbstractTuiControl,
128
- useExisting: forwardRef(function () { return TuiInputMonthRangeComponent_1; }),
129
- },
130
- LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER,
131
- ],
128
+ template: "<tui-hosted-dropdown\n class=\"hosted\"\n [canOpen]=\"interactive\"\n [content]=\"dropdown\"\n [open]=\"open && interactive\"\n (openChange)=\"onOpenChange($event)\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-primitive-textfield\n class=\"textfield\"\n [editable]=\"false\"\n [disabled]=\"computedDisabled\"\n [nativeId]=\"nativeId\"\n [readOnly]=\"readOnly\"\n [iconContent]=\"calendarIcon\"\n [pseudoFocused]=\"pseudoFocused\"\n [pseudoHovered]=\"pseudoHovered\"\n [invalid]=\"computedInvalid\"\n [value]=\"value ? computeValue(value.from | tuiMapper : formatter | async, value.to | tuiMapper : formatter | async) : ''\"\n (valueChange)=\"onValueChange($event)\"\n (hoveredChange)=\"onHovered($event)\"\n >\n <ng-content></ng-content>\n <ng-content select=\"input\" ngProjectAs=\"input\"></ng-content>\n </tui-primitive-textfield>\n\n <ng-template #dropdown>\n <tui-calendar-month\n tuiPreventDefault=\"mousedown\"\n [disabledItemHandler]=\"disabledItemHandler\"\n [min]=\"min\"\n [max]=\"max\"\n [value]=\"value\"\n (monthClick)=\"onMonthClick($event)\"\n ></tui-calendar-month>\n </ng-template>\n</tui-hosted-dropdown>\n",
129
+ providers: TUI_INPUT_MONTH_RANGE_PROVIDERS,
132
130
  changeDetection: ChangeDetectionStrategy.OnPush,
133
131
  styles: [":host{display:block;border-radius:var(--tui-radius-m);text-align:left}.hosted{display:block;border-radius:inherit}.textfield{border-radius:inherit;text-align:inherit}.icon{position:relative;cursor:pointer}"]
134
132
  }),
@@ -136,7 +134,7 @@ var TuiInputMonthRangeComponent = /** @class */ (function (_super) {
136
134
  __param(0, Self()),
137
135
  __param(0, Inject(NgControl)),
138
136
  __param(1, Inject(ChangeDetectorRef)),
139
- __param(2, Inject(TUI_MONTHS)),
137
+ __param(2, Inject(TUI_MONTH_FORMATTER)),
140
138
  __param(3, Inject(TUI_TEXTFIELD_SIZE))
141
139
  ], TuiInputMonthRangeComponent);
142
140
  return TuiInputMonthRangeComponent;
@@ -144,8 +142,21 @@ var TuiInputMonthRangeComponent = /** @class */ (function (_super) {
144
142
 
145
143
  var TuiInputMonthRangeDirective = /** @class */ (function (_super) {
146
144
  __extends(TuiInputMonthRangeDirective, _super);
147
- function TuiInputMonthRangeDirective() {
148
- return _super !== null && _super.apply(this, arguments) || this;
145
+ function TuiInputMonthRangeDirective(host, formatter, destroy$) {
146
+ var _this = _super.call(this, host) || this;
147
+ _this.value$ = new Subject();
148
+ _this.localizedValue = ['', ''];
149
+ _this.value$
150
+ .pipe(distinctUntilChanged(), switchMap(function (value) {
151
+ return combineLatest([
152
+ formatter(value && value.from),
153
+ formatter(value && value.to),
154
+ ]);
155
+ }), takeUntil(destroy$))
156
+ .subscribe(function (localizedValue) {
157
+ _this.localizedValue = localizedValue;
158
+ });
159
+ return _this;
149
160
  }
150
161
  TuiInputMonthRangeDirective_1 = TuiInputMonthRangeDirective;
151
162
  Object.defineProperty(TuiInputMonthRangeDirective.prototype, "readOnly", {
@@ -156,18 +167,26 @@ var TuiInputMonthRangeDirective = /** @class */ (function (_super) {
156
167
  configurable: true
157
168
  });
158
169
  Object.defineProperty(TuiInputMonthRangeDirective.prototype, "value", {
159
- // TODO: Fix change detection
160
170
  get: function () {
161
171
  var _a;
162
- return ((_a = this.host.textfield) === null || _a === void 0 ? void 0 : _a.value) || '';
172
+ return this.localizedValue[0]
173
+ ? (_a = this.host).computeValue.apply(_a, __spread(this.localizedValue)) : '';
163
174
  },
164
175
  enumerable: true,
165
176
  configurable: true
166
177
  });
178
+ TuiInputMonthRangeDirective.prototype.ngDoCheck = function () {
179
+ this.value$.next(this.host.value);
180
+ };
167
181
  TuiInputMonthRangeDirective.prototype.onValueChange = function (value) {
168
182
  this.host.onValueChange(value);
169
183
  };
170
184
  var TuiInputMonthRangeDirective_1;
185
+ TuiInputMonthRangeDirective.ctorParameters = function () { return [
186
+ { type: TuiInputMonthRangeComponent, decorators: [{ type: Inject, args: [AbstractTuiControl,] }] },
187
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_MONTH_FORMATTER,] }] },
188
+ { type: Observable, decorators: [{ type: Self }, { type: Inject, args: [TuiDestroyService,] }] }
189
+ ]; };
171
190
  TuiInputMonthRangeDirective = TuiInputMonthRangeDirective_1 = __decorate([
172
191
  Directive({
173
192
  selector: 'tui-input-month-range',
@@ -176,8 +195,12 @@ var TuiInputMonthRangeDirective = /** @class */ (function (_super) {
176
195
  provide: TUI_TEXTFIELD_HOST,
177
196
  useExisting: forwardRef(function () { return TuiInputMonthRangeDirective_1; }),
178
197
  },
198
+ TuiDestroyService,
179
199
  ],
180
- })
200
+ }),
201
+ __param(0, Inject(AbstractTuiControl)),
202
+ __param(1, Inject(TUI_MONTH_FORMATTER)),
203
+ __param(2, Self()), __param(2, Inject(TuiDestroyService))
181
204
  ], TuiInputMonthRangeDirective);
182
205
  return TuiInputMonthRangeDirective;
183
206
  }(TuiAbstractTextfieldHost));
@@ -195,6 +218,7 @@ var TuiInputMonthRangeModule = /** @class */ (function () {
195
218
  TuiSvgModule,
196
219
  TuiPreventDefaultModule,
197
220
  TuiActiveZoneModule,
221
+ TuiMapperPipeModule,
198
222
  ],
199
223
  declarations: [TuiInputMonthRangeComponent, TuiInputMonthRangeDirective],
200
224
  exports: [
@@ -211,5 +235,5 @@ var TuiInputMonthRangeModule = /** @class */ (function () {
211
235
  * Generated bundle index. Do not edit.
212
236
  */
213
237
 
214
- export { TuiInputMonthRangeComponent, TuiInputMonthRangeDirective, TuiInputMonthRangeModule };
238
+ export { TUI_INPUT_MONTH_RANGE_PROVIDERS, TuiInputMonthRangeComponent, TuiInputMonthRangeDirective, TuiInputMonthRangeModule };
215
239
  //# sourceMappingURL=taiga-ui-kit-components-input-month-range.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-input-month-range.js","sources":["ng://@taiga-ui/kit/components/input-month-range/input-month-range.component.ts","ng://@taiga-ui/kit/components/input-month-range/input-month-range.directive.ts","ng://@taiga-ui/kit/components/input-month-range/input-month-range.module.ts","ng://@taiga-ui/kit/components/input-month-range/taiga-ui-kit-components-input-month-range.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiControl,\n AbstractTuiNullableControl,\n ALWAYS_FALSE_HANDLER,\n TUI_FIRST_DAY,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TUI_LAST_DAY,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiMonth,\n TuiMonthRange,\n} from '@taiga-ui/cdk';\nimport {\n sizeBigger,\n TUI_MONTHS,\n TUI_TEXTFIELD_SIZE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldSizeDirective,\n TuiWithOptionalMinMax,\n} from '@taiga-ui/core';\nimport {TuiMonthContext} from '@taiga-ui/kit/interfaces';\nimport {LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers';\nimport {TuiBooleanHandlerWithContext} from '@taiga-ui/kit/types';\nimport {Observable} from 'rxjs';\n\n// @dynamic\n@Component({\n selector: 'tui-input-month-range',\n templateUrl: './input-month-range.template.html',\n styleUrls: ['./input-month-range.style.less'],\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputMonthRangeComponent),\n },\n {\n provide: AbstractTuiControl,\n useExisting: forwardRef(() => TuiInputMonthRangeComponent),\n },\n LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiInputMonthRangeComponent\n extends AbstractTuiNullableControl<TuiMonthRange>\n implements TuiWithOptionalMinMax<TuiMonth>, TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n readonly textfield?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n min: TuiMonth = TUI_FIRST_DAY;\n\n @Input()\n @tuiDefaultProp()\n max: TuiMonth = TUI_LAST_DAY;\n\n @Input()\n @tuiDefaultProp()\n disabledItemHandler: TuiBooleanHandlerWithContext<TuiMonth, TuiMonthContext> =\n ALWAYS_FALSE_HANDLER;\n\n open = false;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_MONTHS) readonly months$: Observable<readonly string[]>,\n @Inject(TUI_TEXTFIELD_SIZE)\n private readonly textfieldSize: TuiTextfieldSizeDirective,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.textfield ? this.textfield.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.textfield && this.textfield.focused;\n }\n\n get calendarIcon(): string {\n return sizeBigger(this.textfieldSize.size)\n ? 'tuiIconCalendarLarge'\n : 'tuiIconCalendar';\n }\n\n computeValue(\n value: TuiMonthRange | null,\n focused: boolean,\n months: readonly string[],\n ): string {\n if (value === null) {\n return '';\n }\n\n const formattedValueTo =\n !value.isSingleMonth || !focused ? this.formatMonth(value.to, months) : '';\n\n return `${this.formatMonth(value.from, months)} — ${formattedValueTo}`;\n }\n\n onValueChange(value: string) {\n if (value === '') {\n this.updateValue(null);\n this.onOpenChange(true);\n }\n }\n\n onMonthClick(month: TuiMonth) {\n if (this.value === null || !this.value.isSingleMonth) {\n this.writeValue(new TuiMonthRange(month, month));\n\n return;\n }\n\n this.updateValue(TuiMonthRange.sort(this.value.from, month));\n this.close();\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onOpenChange(open: boolean) {\n this.open = open;\n }\n\n onActiveZone(focused: boolean) {\n this.updateFocused(focused);\n\n if (focused) {\n return;\n }\n\n if (this.value && this.value.isSingleMonth) {\n this.updateValue(new TuiMonthRange(this.value.from, this.value.from));\n }\n }\n\n setDisabledState() {\n super.setDisabledState();\n this.close();\n }\n\n private formatMonth(\n {month, formattedYear}: TuiMonth,\n months: readonly string[],\n ): string {\n return `${months[month]} ${formattedYear}`;\n }\n\n private close() {\n this.open = false;\n }\n}\n","import {Directive, forwardRef} from '@angular/core';\nimport {TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost} from '@taiga-ui/core';\n\nimport {TuiInputMonthRangeComponent} from './input-month-range.component';\n\n@Directive({\n selector: 'tui-input-month-range',\n providers: [\n {\n provide: TUI_TEXTFIELD_HOST,\n useExisting: forwardRef(() => TuiInputMonthRangeDirective),\n },\n ],\n})\nexport class TuiInputMonthRangeDirective extends TuiAbstractTextfieldHost<TuiInputMonthRangeComponent> {\n get readOnly(): boolean {\n return true;\n }\n\n // TODO: Fix change detection\n get value(): string {\n return this.host.textfield?.value || '';\n }\n\n onValueChange(value: string) {\n this.host.onValueChange(value);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiPreventDefaultModule} from '@taiga-ui/cdk';\nimport {\n TuiHostedDropdownModule,\n TuiPrimitiveTextfieldModule,\n TuiSvgModule,\n TuiTextfieldComponent,\n} from '@taiga-ui/core';\nimport {TuiCalendarMonthModule} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthRangeComponent} from './input-month-range.component';\nimport {TuiInputMonthRangeDirective} from './input-month-range.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiCalendarMonthModule,\n TuiHostedDropdownModule,\n TuiPrimitiveTextfieldModule,\n TuiSvgModule,\n TuiPreventDefaultModule,\n TuiActiveZoneModule,\n ],\n declarations: [TuiInputMonthRangeComponent, TuiInputMonthRangeDirective],\n exports: [\n TuiInputMonthRangeComponent,\n TuiInputMonthRangeDirective,\n TuiTextfieldComponent,\n ],\n})\nexport class TuiInputMonthRangeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAqCA;;IAmBY,+CAAyC;IAqBjD,qCAII,OAAyB,EACE,iBAAoC,EAClC,OAAsC,EAElD,aAAwC;QAR7D,YAUI,kBAAM,OAAO,EAAE,iBAAiB,CAAC,SACpC;QALgC,aAAO,GAAP,OAAO,CAA+B;QAElD,mBAAa,GAAb,aAAa,CAA2B;QArB7D,SAAG,GAAa,aAAa,CAAC;QAI9B,SAAG,GAAa,YAAY,CAAC;QAI7B,yBAAmB,GACf,oBAAoB,CAAC;QAEzB,UAAI,GAAG,KAAK,CAAC;;KAaZ;oCAjCQ,2BAA2B;IAmCpC,sBAAI,+DAAsB;aAA1B;YACI,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS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;ICiBzE;KAAwC;IAA3B,wBAAwB;QAjBpC,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,YAAY;gBACZ,sBAAsB;gBACtB,uBAAuB;gBACvB,2BAA2B;gBAC3B,YAAY;gBACZ,uBAAuB;gBACvB,mBAAmB;aACtB;YACD,YAAY,EAAE,CAAC,2BAA2B,EAAE,2BAA2B,CAAC;YACxE,OAAO,EAAE;gBACL,2BAA2B;gBAC3B,2BAA2B;gBAC3B,qBAAqB;aACxB;SACJ,CAAC;OACW,wBAAwB,CAAG;IAAD,+BAAC;CAAxC;;AC/BA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-kit-components-input-month-range.js","sources":["ng://@taiga-ui/kit/components/input-month-range/input-month-range.providers.ts","ng://@taiga-ui/kit/components/input-month-range/input-month-range.component.ts","ng://@taiga-ui/kit/components/input-month-range/input-month-range.directive.ts","ng://@taiga-ui/kit/components/input-month-range/input-month-range.module.ts","ng://@taiga-ui/kit/components/input-month-range/taiga-ui-kit-components-input-month-range.ts"],"sourcesContent":["import {forwardRef, Provider} from '@angular/core';\nimport {AbstractTuiControl, TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk';\nimport {TuiMonthPipe} from '@taiga-ui/core';\nimport {\n LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER,\n TUI_MONTH_FORMATTER_PROVIDER,\n} from '@taiga-ui/kit/providers';\n\nimport {TuiInputMonthRangeComponent} from './input-month-range.component';\n\nexport const TUI_INPUT_MONTH_RANGE_PROVIDERS: Provider[] = [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputMonthRangeComponent),\n },\n {\n provide: AbstractTuiControl,\n useExisting: forwardRef(() => TuiInputMonthRangeComponent),\n },\n LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER,\n TUI_MONTH_FORMATTER_PROVIDER,\n TuiMonthPipe,\n];\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiNullableControl,\n ALWAYS_FALSE_HANDLER,\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiHandler,\n TuiMonth,\n TuiMonthRange,\n} from '@taiga-ui/cdk';\nimport {\n sizeBigger,\n TUI_TEXTFIELD_SIZE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldSizeDirective,\n TuiWithOptionalMinMax,\n} from '@taiga-ui/core';\nimport {TuiMonthContext} from '@taiga-ui/kit/interfaces';\nimport {TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\nimport {TuiBooleanHandlerWithContext} from '@taiga-ui/kit/types';\nimport {Observable} from 'rxjs';\n\nimport {TUI_INPUT_MONTH_RANGE_PROVIDERS} from './input-month-range.providers';\n\n// @dynamic\n@Component({\n selector: 'tui-input-month-range',\n templateUrl: './input-month-range.template.html',\n styleUrls: ['./input-month-range.style.less'],\n providers: TUI_INPUT_MONTH_RANGE_PROVIDERS,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiInputMonthRangeComponent\n extends AbstractTuiNullableControl<TuiMonthRange>\n implements TuiWithOptionalMinMax<TuiMonth>, TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly textfield?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n min: TuiMonth = TUI_FIRST_DAY;\n\n @Input()\n @tuiDefaultProp()\n max: TuiMonth = TUI_LAST_DAY;\n\n @Input()\n @tuiDefaultProp()\n disabledItemHandler: TuiBooleanHandlerWithContext<TuiMonth, TuiMonthContext> =\n ALWAYS_FALSE_HANDLER;\n\n open = false;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_MONTH_FORMATTER)\n readonly formatter: TuiHandler<TuiMonth | null, Observable<string>>,\n @Inject(TUI_TEXTFIELD_SIZE)\n private readonly textfieldSize: TuiTextfieldSizeDirective,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.textfield ? this.textfield.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.textfield && this.textfield.focused;\n }\n\n get calendarIcon(): string {\n return sizeBigger(this.textfieldSize.size)\n ? 'tuiIconCalendarLarge'\n : 'tuiIconCalendar';\n }\n\n computeValue(from: string | null, to: string | null): string {\n const formattedTo = from === to && this.focused ? '' : to;\n\n return `${from} — ${formattedTo}`;\n }\n\n onValueChange(value: string) {\n if (value) {\n return;\n }\n\n this.updateValue(null);\n this.onOpenChange(true);\n }\n\n onMonthClick(month: TuiMonth) {\n if (this.value === null || !this.value.isSingleMonth) {\n this.writeValue(new TuiMonthRange(month, month));\n\n return;\n }\n\n this.updateValue(TuiMonthRange.sort(this.value.from, month));\n this.close();\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onOpenChange(open: boolean) {\n this.open = open;\n }\n\n onActiveZone(focused: boolean) {\n this.updateFocused(focused);\n\n if (focused) {\n return;\n }\n\n if (this.value && this.value.isSingleMonth) {\n this.updateValue(new TuiMonthRange(this.value.from, this.value.from));\n }\n }\n\n setDisabledState() {\n super.setDisabledState();\n this.close();\n }\n\n private close() {\n this.open = false;\n }\n}\n","import {Directive, DoCheck, forwardRef, Inject, Self} from '@angular/core';\nimport {\n AbstractTuiControl,\n TuiDestroyService,\n TuiHandler,\n TuiMonth,\n TuiMonthRange,\n} from '@taiga-ui/cdk';\nimport {TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost} from '@taiga-ui/core';\nimport {TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\nimport {combineLatest, Observable, Subject} from 'rxjs';\nimport {distinctUntilChanged, switchMap, takeUntil} from 'rxjs/operators';\n\nimport {TuiInputMonthRangeComponent} from './input-month-range.component';\n\n@Directive({\n selector: 'tui-input-month-range',\n providers: [\n {\n provide: TUI_TEXTFIELD_HOST,\n useExisting: forwardRef(() => TuiInputMonthRangeDirective),\n },\n TuiDestroyService,\n ],\n})\nexport class TuiInputMonthRangeDirective\n extends TuiAbstractTextfieldHost<TuiInputMonthRangeComponent>\n implements DoCheck\n{\n private readonly value$ = new Subject<TuiMonthRange | null>();\n\n private localizedValue: [string, string] = ['', ''];\n\n constructor(\n @Inject(AbstractTuiControl) host: TuiInputMonthRangeComponent,\n @Inject(TUI_MONTH_FORMATTER)\n formatter: TuiHandler<TuiMonth | null, Observable<string>>,\n @Self() @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n ) {\n super(host);\n\n this.value$\n .pipe(\n distinctUntilChanged(),\n switchMap((value: TuiMonthRange | null) =>\n combineLatest([\n formatter(value && value.from),\n formatter(value && value.to),\n ]),\n ),\n takeUntil(destroy$),\n )\n .subscribe(localizedValue => {\n this.localizedValue = localizedValue;\n });\n }\n\n get readOnly(): boolean {\n return true;\n }\n\n get value(): string {\n return this.localizedValue[0]\n ? this.host.computeValue(...this.localizedValue)\n : '';\n }\n\n ngDoCheck() {\n this.value$.next(this.host.value);\n }\n\n onValueChange(value: string) {\n this.host.onValueChange(value);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {\n TuiActiveZoneModule,\n TuiMapperPipeModule,\n TuiPreventDefaultModule,\n} from '@taiga-ui/cdk';\nimport {\n TuiHostedDropdownModule,\n TuiPrimitiveTextfieldModule,\n TuiSvgModule,\n TuiTextfieldComponent,\n} from '@taiga-ui/core';\nimport {TuiCalendarMonthModule} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthRangeComponent} from './input-month-range.component';\nimport {TuiInputMonthRangeDirective} from './input-month-range.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiCalendarMonthModule,\n TuiHostedDropdownModule,\n TuiPrimitiveTextfieldModule,\n TuiSvgModule,\n TuiPreventDefaultModule,\n TuiActiveZoneModule,\n TuiMapperPipeModule,\n ],\n declarations: [TuiInputMonthRangeComponent, TuiInputMonthRangeDirective],\n exports: [\n TuiInputMonthRangeComponent,\n TuiInputMonthRangeDirective,\n TuiTextfieldComponent,\n ],\n})\nexport class TuiInputMonthRangeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;IAUa,+BAA+B,GAAe;IACvD;QACI,OAAO,EAAE,2BAA2B;QACpC,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,2BAA2B,GAAA,CAAC;KAC7D;IACD;QACI,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,2BAA2B,GAAA,CAAC;KAC7D;IACD,yCAAyC;IACzC,4BAA4B;IAC5B,YAAY;;;ACehB;;IASY,+CAAyC;IAqBjD,qCAII,OAAyB,EACE,iBAAoC,EAEtD,SAA0D,EAElD,aAAwC;QAT7D,YAWI,kBAAM,OAAO,EAAE,iBAAiB,CAAC,SACpC;QALY,eAAS,GAAT,SAAS,CAAiD;QAElD,mBAAa,GAAb,aAAa,CAA2B;QAtB7D,SAAG,GAAa,aAAa,CAAC;QAI9B,SAAG,GAAa,YAAY,CAAC;QAI7B,yBAAmB,GACf,oBAAoB,CAAC;QAEzB,UAAI,GAAG,KAAK,CAAC;;KAcZ;IAED,sBAAI,+DAAsB;aAA1B;YACI,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,sBAAsB,GAAG,IAAI,CAAC;SACxE;;;OAAA;IAED,sBAAI,gDAAO;aAAX;YACI,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;SACrD;;;OAAA;IAED,sBAAI,qDAAY;aAAhB;YACI,OAAO,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC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