@taiga-ui/kit 2.36.0 → 2.38.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 (490) hide show
  1. package/abstract/input-slider.d.ts +30 -7
  2. package/abstract/taiga-ui-kit-abstract.metadata.json +1 -1
  3. package/bundles/taiga-ui-kit-abstract.umd.js +67 -21
  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 +2 -2
  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-checkbox.umd.js +2 -2
  20. package/bundles/taiga-ui-kit-components-checkbox.umd.js.map +1 -1
  21. package/bundles/taiga-ui-kit-components-checkbox.umd.min.js +2 -2
  22. package/bundles/taiga-ui-kit-components-checkbox.umd.min.js.map +1 -1
  23. package/bundles/taiga-ui-kit-components-combo-box.umd.js.map +1 -1
  24. package/bundles/taiga-ui-kit-components-combo-box.umd.min.js.map +1 -1
  25. package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.js +4 -4
  26. package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.js.map +1 -1
  27. package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.min.js +2 -2
  28. package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.min.js.map +1 -1
  29. package/bundles/taiga-ui-kit-components-files.umd.js +504 -0
  30. package/bundles/taiga-ui-kit-components-files.umd.js.map +1 -0
  31. package/bundles/taiga-ui-kit-components-files.umd.min.js +16 -0
  32. package/bundles/taiga-ui-kit-components-files.umd.min.js.map +1 -0
  33. package/bundles/taiga-ui-kit-components-input-count.umd.js +2 -2
  34. package/bundles/taiga-ui-kit-components-input-count.umd.js.map +1 -1
  35. package/bundles/taiga-ui-kit-components-input-count.umd.min.js +1 -1
  36. package/bundles/taiga-ui-kit-components-input-count.umd.min.js.map +1 -1
  37. package/bundles/taiga-ui-kit-components-input-date-range.umd.js +3 -1
  38. package/bundles/taiga-ui-kit-components-input-date-range.umd.js.map +1 -1
  39. package/bundles/taiga-ui-kit-components-input-date-range.umd.min.js.map +1 -1
  40. package/bundles/taiga-ui-kit-components-input-date-time.umd.js +1 -1
  41. package/bundles/taiga-ui-kit-components-input-date-time.umd.js.map +1 -1
  42. package/bundles/taiga-ui-kit-components-input-date-time.umd.min.js +1 -1
  43. package/bundles/taiga-ui-kit-components-input-date-time.umd.min.js.map +1 -1
  44. package/bundles/taiga-ui-kit-components-input-date.umd.js +4 -2
  45. package/bundles/taiga-ui-kit-components-input-date.umd.js.map +1 -1
  46. package/bundles/taiga-ui-kit-components-input-date.umd.min.js +1 -1
  47. package/bundles/taiga-ui-kit-components-input-date.umd.min.js.map +1 -1
  48. package/bundles/taiga-ui-kit-components-input-file.umd.js +43 -45
  49. package/bundles/taiga-ui-kit-components-input-file.umd.js.map +1 -1
  50. package/bundles/taiga-ui-kit-components-input-file.umd.min.js +1 -1
  51. package/bundles/taiga-ui-kit-components-input-file.umd.min.js.map +1 -1
  52. package/bundles/taiga-ui-kit-components-input-files.umd.js +498 -0
  53. package/bundles/taiga-ui-kit-components-input-files.umd.js.map +1 -0
  54. package/bundles/taiga-ui-kit-components-input-files.umd.min.js +16 -0
  55. package/bundles/taiga-ui-kit-components-input-files.umd.min.js.map +1 -0
  56. package/bundles/taiga-ui-kit-components-input-number.umd.js +37 -28
  57. package/bundles/taiga-ui-kit-components-input-number.umd.js.map +1 -1
  58. package/bundles/taiga-ui-kit-components-input-number.umd.min.js +2 -2
  59. package/bundles/taiga-ui-kit-components-input-number.umd.min.js.map +1 -1
  60. package/bundles/taiga-ui-kit-components-input-password.umd.js +2 -2
  61. package/bundles/taiga-ui-kit-components-input-password.umd.js.map +1 -1
  62. package/bundles/taiga-ui-kit-components-input-password.umd.min.js +1 -1
  63. package/bundles/taiga-ui-kit-components-input-password.umd.min.js.map +1 -1
  64. package/bundles/taiga-ui-kit-components-input-phone-international.umd.js +20 -8
  65. package/bundles/taiga-ui-kit-components-input-phone-international.umd.js.map +1 -1
  66. package/bundles/taiga-ui-kit-components-input-phone-international.umd.min.js +2 -2
  67. package/bundles/taiga-ui-kit-components-input-phone-international.umd.min.js.map +1 -1
  68. package/bundles/taiga-ui-kit-components-input-phone.umd.js +5 -4
  69. package/bundles/taiga-ui-kit-components-input-phone.umd.js.map +1 -1
  70. package/bundles/taiga-ui-kit-components-input-phone.umd.min.js +1 -1
  71. package/bundles/taiga-ui-kit-components-input-phone.umd.min.js.map +1 -1
  72. package/bundles/taiga-ui-kit-components-input-range.umd.js +26 -4
  73. package/bundles/taiga-ui-kit-components-input-range.umd.js.map +1 -1
  74. package/bundles/taiga-ui-kit-components-input-range.umd.min.js +2 -2
  75. package/bundles/taiga-ui-kit-components-input-range.umd.min.js.map +1 -1
  76. package/bundles/taiga-ui-kit-components-input-slider.umd.js +200 -117
  77. package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
  78. package/bundles/taiga-ui-kit-components-input-slider.umd.min.js +2 -2
  79. package/bundles/taiga-ui-kit-components-input-slider.umd.min.js.map +1 -1
  80. package/bundles/taiga-ui-kit-components-input-tag.umd.js +1 -1
  81. package/bundles/taiga-ui-kit-components-input-tag.umd.js.map +1 -1
  82. package/bundles/taiga-ui-kit-components-input-tag.umd.min.js +1 -1
  83. package/bundles/taiga-ui-kit-components-input-tag.umd.min.js.map +1 -1
  84. package/bundles/taiga-ui-kit-components-input-time.umd.js.map +1 -1
  85. package/bundles/taiga-ui-kit-components-input-time.umd.min.js.map +1 -1
  86. package/bundles/taiga-ui-kit-components-input.umd.js.map +1 -1
  87. package/bundles/taiga-ui-kit-components-input.umd.min.js.map +1 -1
  88. package/bundles/taiga-ui-kit-components-line-clamp.umd.js +2 -2
  89. package/bundles/taiga-ui-kit-components-line-clamp.umd.js.map +1 -1
  90. package/bundles/taiga-ui-kit-components-line-clamp.umd.min.js +1 -1
  91. package/bundles/taiga-ui-kit-components-line-clamp.umd.min.js.map +1 -1
  92. package/bundles/taiga-ui-kit-components-multi-select-option.umd.js +2 -2
  93. package/bundles/taiga-ui-kit-components-multi-select-option.umd.js.map +1 -1
  94. package/bundles/taiga-ui-kit-components-multi-select-option.umd.min.js +1 -1
  95. package/bundles/taiga-ui-kit-components-multi-select-option.umd.min.js.map +1 -1
  96. package/bundles/taiga-ui-kit-components-multi-select.umd.js +2 -2
  97. package/bundles/taiga-ui-kit-components-multi-select.umd.js.map +1 -1
  98. package/bundles/taiga-ui-kit-components-multi-select.umd.min.js +1 -1
  99. package/bundles/taiga-ui-kit-components-multi-select.umd.min.js.map +1 -1
  100. package/bundles/taiga-ui-kit-components-pagination.umd.js +1 -1
  101. package/bundles/taiga-ui-kit-components-pagination.umd.js.map +1 -1
  102. package/bundles/taiga-ui-kit-components-pagination.umd.min.js +1 -1
  103. package/bundles/taiga-ui-kit-components-pagination.umd.min.js.map +1 -1
  104. package/bundles/taiga-ui-kit-components-progress.umd.js +1 -1
  105. package/bundles/taiga-ui-kit-components-progress.umd.js.map +1 -1
  106. package/bundles/taiga-ui-kit-components-progress.umd.min.js +1 -1
  107. package/bundles/taiga-ui-kit-components-progress.umd.min.js.map +1 -1
  108. package/bundles/taiga-ui-kit-components-radio.umd.js +1 -1
  109. package/bundles/taiga-ui-kit-components-radio.umd.js.map +1 -1
  110. package/bundles/taiga-ui-kit-components-radio.umd.min.js +1 -1
  111. package/bundles/taiga-ui-kit-components-radio.umd.min.js.map +1 -1
  112. package/bundles/taiga-ui-kit-components-select.umd.js +1 -1
  113. package/bundles/taiga-ui-kit-components-select.umd.js.map +1 -1
  114. package/bundles/taiga-ui-kit-components-select.umd.min.js +1 -1
  115. package/bundles/taiga-ui-kit-components-select.umd.min.js.map +1 -1
  116. package/bundles/taiga-ui-kit-components-slider.umd.js +66 -21
  117. package/bundles/taiga-ui-kit-components-slider.umd.js.map +1 -1
  118. package/bundles/taiga-ui-kit-components-slider.umd.min.js +2 -2
  119. package/bundles/taiga-ui-kit-components-slider.umd.min.js.map +1 -1
  120. package/bundles/taiga-ui-kit-components-text-area.umd.js +2 -2
  121. package/bundles/taiga-ui-kit-components-text-area.umd.js.map +1 -1
  122. package/bundles/taiga-ui-kit-components-text-area.umd.min.js +1 -1
  123. package/bundles/taiga-ui-kit-components-text-area.umd.min.js.map +1 -1
  124. package/bundles/taiga-ui-kit-components-toggle.umd.js +2 -2
  125. package/bundles/taiga-ui-kit-components-toggle.umd.js.map +1 -1
  126. package/bundles/taiga-ui-kit-components-toggle.umd.min.js +1 -1
  127. package/bundles/taiga-ui-kit-components-toggle.umd.min.js.map +1 -1
  128. package/bundles/taiga-ui-kit-components.umd.js +20 -4
  129. package/bundles/taiga-ui-kit-components.umd.js.map +1 -1
  130. package/bundles/taiga-ui-kit-components.umd.min.js +1 -1
  131. package/bundles/taiga-ui-kit-enums.umd.js.map +1 -1
  132. package/bundles/taiga-ui-kit-enums.umd.min.js.map +1 -1
  133. package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.js +25 -1
  134. package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.js.map +1 -1
  135. package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.min.js +2 -2
  136. package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.min.js.map +1 -1
  137. package/bundles/taiga-ui-kit-pipes-field-error.umd.js +10 -2
  138. package/bundles/taiga-ui-kit-pipes-field-error.umd.js.map +1 -1
  139. package/bundles/taiga-ui-kit-pipes-field-error.umd.min.js +1 -1
  140. package/bundles/taiga-ui-kit-pipes-field-error.umd.min.js.map +1 -1
  141. package/bundles/taiga-ui-kit-tokens.umd.js +8 -0
  142. package/bundles/taiga-ui-kit-tokens.umd.js.map +1 -1
  143. package/bundles/taiga-ui-kit-tokens.umd.min.js +1 -1
  144. package/bundles/taiga-ui-kit-tokens.umd.min.js.map +1 -1
  145. package/bundles/taiga-ui-kit-utils-files.umd.js +8 -0
  146. package/bundles/taiga-ui-kit-utils-files.umd.js.map +1 -1
  147. package/bundles/taiga-ui-kit-utils-files.umd.min.js +1 -1
  148. package/bundles/taiga-ui-kit-utils-files.umd.min.js.map +1 -1
  149. package/components/accordion/taiga-ui-kit-components-accordion.metadata.json +1 -1
  150. package/components/arrow/arrow-options.d.ts +4 -2
  151. package/components/arrow/taiga-ui-kit-components-arrow.metadata.json +1 -1
  152. package/components/badge/badge.component.d.ts +2 -1
  153. package/components/badge/taiga-ui-kit-components-badge.metadata.json +1 -1
  154. package/components/checkbox/taiga-ui-kit-components-checkbox.metadata.json +1 -1
  155. package/components/combo-box/combo-box.component.d.ts +4 -4
  156. package/components/combo-box/taiga-ui-kit-components-combo-box.metadata.json +1 -1
  157. package/components/data-list-wrapper/taiga-ui-kit-components-data-list-wrapper.metadata.json +1 -1
  158. package/components/files/file/file.component.d.ts +42 -0
  159. package/components/files/files.component.d.ts +12 -0
  160. package/components/files/files.module.d.ts +2 -0
  161. package/components/files/index.d.ts +2 -0
  162. package/components/files/package.json +13 -0
  163. package/components/files/taiga-ui-kit-components-files.d.ts +5 -0
  164. package/components/files/taiga-ui-kit-components-files.metadata.json +1 -0
  165. package/components/index.d.ts +2 -0
  166. package/components/input/input.component.d.ts +2 -2
  167. package/components/input/taiga-ui-kit-components-input.metadata.json +1 -1
  168. package/components/input-count/input-count.component.d.ts +3 -2
  169. package/components/input-count/taiga-ui-kit-components-input-count.metadata.json +1 -1
  170. package/components/input-date/input-date.component.d.ts +5 -3
  171. package/components/input-date/taiga-ui-kit-components-input-date.metadata.json +1 -1
  172. package/components/input-date-range/input-date-range.component.d.ts +3 -2
  173. package/components/input-date-range/taiga-ui-kit-components-input-date-range.metadata.json +1 -1
  174. package/components/input-date-time/input-date-time.component.d.ts +7 -5
  175. package/components/input-date-time/taiga-ui-kit-components-input-date-time.metadata.json +1 -1
  176. package/components/input-file/file/file.component.d.ts +1 -1
  177. package/components/input-file/taiga-ui-kit-components-input-file.metadata.json +1 -1
  178. package/components/input-files/index.d.ts +2 -0
  179. package/components/input-files/input-files.component.d.ts +42 -0
  180. package/components/input-files/input-files.module.d.ts +2 -0
  181. package/components/input-files/package.json +13 -0
  182. package/components/input-files/taiga-ui-kit-components-input-files.d.ts +4 -0
  183. package/components/input-files/taiga-ui-kit-components-input-files.metadata.json +1 -0
  184. package/components/input-number/input-number.component.d.ts +7 -4
  185. package/components/input-number/taiga-ui-kit-components-input-number.metadata.json +1 -1
  186. package/components/input-password/input-password.component.d.ts +4 -3
  187. package/components/input-password/taiga-ui-kit-components-input-password.metadata.json +1 -1
  188. package/components/input-phone/input-phone.component.d.ts +5 -6
  189. package/components/input-phone/taiga-ui-kit-components-input-phone.metadata.json +1 -1
  190. package/components/input-phone-international/input-phone-international.component.d.ts +4 -2
  191. package/components/input-phone-international/taiga-ui-kit-components-input-phone-international.metadata.json +1 -1
  192. package/components/input-range/input-range.component.d.ts +4 -1
  193. package/components/input-range/taiga-ui-kit-components-input-range.metadata.json +1 -1
  194. package/components/input-slider/input-slider.component.d.ts +56 -23
  195. package/components/input-slider/taiga-ui-kit-components-input-slider.metadata.json +1 -1
  196. package/components/input-tag/input-tag.component.d.ts +2 -1
  197. package/components/input-tag/taiga-ui-kit-components-input-tag.metadata.json +1 -1
  198. package/components/input-time/input-time.component.d.ts +2 -2
  199. package/components/input-time/taiga-ui-kit-components-input-time.metadata.json +1 -1
  200. package/components/multi-select/multi-select.component.d.ts +5 -5
  201. package/components/multi-select/taiga-ui-kit-components-multi-select.metadata.json +1 -1
  202. package/components/multi-select-option/taiga-ui-kit-components-multi-select-option.metadata.json +1 -1
  203. package/components/pagination/taiga-ui-kit-components-pagination.metadata.json +1 -1
  204. package/components/progress/utils/calculate-color-segments.d.ts +0 -4
  205. package/components/radio/radio.component.d.ts +1 -1
  206. package/components/radio/taiga-ui-kit-components-radio.metadata.json +1 -1
  207. package/components/select/select.component.d.ts +4 -4
  208. package/components/select/taiga-ui-kit-components-select.metadata.json +1 -1
  209. package/components/slider/slider-key-steps.directive.d.ts +12 -2
  210. package/components/slider/slider-options.d.ts +1 -1
  211. package/components/slider/taiga-ui-kit-components-slider.metadata.json +1 -1
  212. package/components/taiga-ui-kit-components.metadata.json +1 -1
  213. package/components/text-area/taiga-ui-kit-components-text-area.metadata.json +1 -1
  214. package/components/toggle/taiga-ui-kit-components-toggle.metadata.json +1 -1
  215. package/enums/file-state.d.ts +1 -0
  216. package/enums/taiga-ui-kit-enums.metadata.json +1 -1
  217. package/esm2015/abstract/input-slider.js +49 -8
  218. package/esm2015/components/accordion/accordion-item/accordion-item.component.js +1 -1
  219. package/esm2015/components/accordion/accordion.component.js +2 -2
  220. package/esm2015/components/arrow/arrow-options.js +1 -1
  221. package/esm2015/components/badge/badge.component.js +1 -1
  222. package/esm2015/components/badged-content/badged-content.component.js +3 -3
  223. package/esm2015/components/checkbox/checkbox.component.js +3 -3
  224. package/esm2015/components/combo-box/combo-box.component.js +1 -1
  225. package/esm2015/components/data-list-wrapper/data-list-group-wrapper.component.js +3 -3
  226. package/esm2015/components/data-list-wrapper/data-list-wrapper.component.js +3 -3
  227. package/esm2015/components/files/file/file.component.js +164 -0
  228. package/esm2015/components/files/files.component.js +45 -0
  229. package/esm2015/components/files/files.module.js +29 -0
  230. package/esm2015/components/files/index.js +3 -0
  231. package/esm2015/components/files/taiga-ui-kit-components-files.js +6 -0
  232. package/esm2015/components/index.js +3 -1
  233. package/esm2015/components/input/input.component.js +1 -1
  234. package/esm2015/components/input-count/input-count.component.js +3 -3
  235. package/esm2015/components/input-date/input-date.component.js +5 -3
  236. package/esm2015/components/input-date-range/input-date-range.component.js +4 -2
  237. package/esm2015/components/input-date-time/input-date-time.component.js +2 -2
  238. package/esm2015/components/input-file/file/file.component.js +19 -19
  239. package/esm2015/components/input-file/input-file.component.js +7 -7
  240. package/esm2015/components/input-file/input-file.module.js +3 -3
  241. package/esm2015/components/input-files/index.js +3 -0
  242. package/esm2015/components/input-files/input-files.component.js +212 -0
  243. package/esm2015/components/input-files/input-files.module.js +34 -0
  244. package/esm2015/components/input-files/taiga-ui-kit-components-input-files.js +5 -0
  245. package/esm2015/components/input-number/input-number.component.js +25 -19
  246. package/esm2015/components/input-number/input-number.module.js +5 -1
  247. package/esm2015/components/input-password/input-password.component.js +3 -3
  248. package/esm2015/components/input-phone/input-phone.component.js +6 -5
  249. package/esm2015/components/input-phone-international/input-phone-international.component.js +20 -6
  250. package/esm2015/components/input-range/input-range.component.js +25 -7
  251. package/esm2015/components/input-slider/input-slider.component.js +196 -105
  252. package/esm2015/components/input-slider/input-slider.module.js +13 -6
  253. package/esm2015/components/input-tag/input-tag.component.js +2 -2
  254. package/esm2015/components/input-time/input-time.component.js +1 -1
  255. package/esm2015/components/line-clamp/line-clamp.directive.js +4 -4
  256. package/esm2015/components/multi-select/multi-select-group/multi-select-group.component.js +3 -3
  257. package/esm2015/components/multi-select/multi-select.component.js +2 -2
  258. package/esm2015/components/multi-select-option/multi-select-option.component.js +3 -3
  259. package/esm2015/components/pagination/pagination.component.js +2 -2
  260. package/esm2015/components/progress/utils/calculate-color-segments.js +3 -2
  261. package/esm2015/components/radio/radio.component.js +2 -2
  262. package/esm2015/components/select/select.component.js +3 -3
  263. package/esm2015/components/slider/slider-key-steps.directive.js +33 -8
  264. package/esm2015/components/slider/slider-options.js +7 -5
  265. package/esm2015/components/slider/slider.component.js +1 -1
  266. package/esm2015/components/slider/slider.module.js +14 -4
  267. package/esm2015/components/text-area/text-area.component.js +3 -3
  268. package/esm2015/components/toggle/toggle.component.js +3 -3
  269. package/esm2015/enums/file-state.js +1 -1
  270. package/esm2015/internal/primitive-calendar-range/primitive-calendar-range.component.js +26 -2
  271. package/esm2015/pipes/field-error/field-error-content-pipe.js +11 -3
  272. package/esm2015/tokens/i18n.js +7 -1
  273. package/esm2015/utils/files/get-accept-array.js +7 -0
  274. package/esm2015/utils/files/index.js +2 -1
  275. package/esm5/abstract/input-slider.js +67 -20
  276. package/esm5/components/accordion/accordion-item/accordion-item.component.js +1 -1
  277. package/esm5/components/accordion/accordion.component.js +2 -2
  278. package/esm5/components/arrow/arrow-options.js +1 -1
  279. package/esm5/components/badge/badge.component.js +1 -1
  280. package/esm5/components/badged-content/badged-content.component.js +3 -3
  281. package/esm5/components/checkbox/checkbox.component.js +3 -3
  282. package/esm5/components/combo-box/combo-box.component.js +1 -1
  283. package/esm5/components/data-list-wrapper/data-list-group-wrapper.component.js +3 -3
  284. package/esm5/components/data-list-wrapper/data-list-wrapper.component.js +3 -3
  285. package/esm5/components/files/file/file.component.js +213 -0
  286. package/esm5/components/files/files.component.js +50 -0
  287. package/esm5/components/files/files.module.js +32 -0
  288. package/esm5/components/files/index.js +3 -0
  289. package/esm5/components/files/taiga-ui-kit-components-files.js +6 -0
  290. package/esm5/components/index.js +3 -1
  291. package/esm5/components/input/input.component.js +1 -1
  292. package/esm5/components/input-count/input-count.component.js +3 -3
  293. package/esm5/components/input-date/input-date.component.js +5 -3
  294. package/esm5/components/input-date-range/input-date-range.component.js +4 -2
  295. package/esm5/components/input-date-time/input-date-time.component.js +2 -2
  296. package/esm5/components/input-file/file/file.component.js +37 -37
  297. package/esm5/components/input-file/input-file.component.js +7 -9
  298. package/esm5/components/input-file/input-file.module.js +3 -3
  299. package/esm5/components/input-files/index.js +3 -0
  300. package/esm5/components/input-files/input-files.component.js +247 -0
  301. package/esm5/components/input-files/input-files.module.js +37 -0
  302. package/esm5/components/input-files/taiga-ui-kit-components-input-files.js +5 -0
  303. package/esm5/components/input-number/input-number.component.js +35 -27
  304. package/esm5/components/input-number/input-number.module.js +5 -1
  305. package/esm5/components/input-password/input-password.component.js +3 -3
  306. package/esm5/components/input-phone/input-phone.component.js +6 -5
  307. package/esm5/components/input-phone-international/input-phone-international.component.js +21 -9
  308. package/esm5/components/input-range/input-range.component.js +29 -7
  309. package/esm5/components/input-slider/input-slider.component.js +198 -115
  310. package/esm5/components/input-slider/input-slider.module.js +13 -6
  311. package/esm5/components/input-tag/input-tag.component.js +2 -2
  312. package/esm5/components/input-time/input-time.component.js +1 -1
  313. package/esm5/components/line-clamp/line-clamp.directive.js +4 -4
  314. package/esm5/components/multi-select/multi-select-group/multi-select-group.component.js +3 -3
  315. package/esm5/components/multi-select/multi-select.component.js +2 -2
  316. package/esm5/components/multi-select-option/multi-select-option.component.js +3 -3
  317. package/esm5/components/pagination/pagination.component.js +2 -2
  318. package/esm5/components/progress/utils/calculate-color-segments.js +3 -2
  319. package/esm5/components/radio/radio.component.js +2 -2
  320. package/esm5/components/select/select.component.js +3 -3
  321. package/esm5/components/slider/slider-key-steps.directive.js +48 -13
  322. package/esm5/components/slider/slider-options.js +7 -5
  323. package/esm5/components/slider/slider.component.js +1 -1
  324. package/esm5/components/slider/slider.module.js +14 -4
  325. package/esm5/components/text-area/text-area.component.js +3 -3
  326. package/esm5/components/toggle/toggle.component.js +3 -3
  327. package/esm5/enums/file-state.js +1 -1
  328. package/esm5/internal/primitive-calendar-range/primitive-calendar-range.component.js +26 -2
  329. package/esm5/pipes/field-error/field-error-content-pipe.js +11 -3
  330. package/esm5/tokens/i18n.js +7 -1
  331. package/esm5/utils/files/get-accept-array.js +7 -0
  332. package/esm5/utils/files/index.js +2 -1
  333. package/fesm2015/taiga-ui-kit-abstract.js +48 -7
  334. package/fesm2015/taiga-ui-kit-abstract.js.map +1 -1
  335. package/fesm2015/taiga-ui-kit-components-accordion.js +2 -2
  336. package/fesm2015/taiga-ui-kit-components-accordion.js.map +1 -1
  337. package/fesm2015/taiga-ui-kit-components-arrow.js.map +1 -1
  338. package/fesm2015/taiga-ui-kit-components-badge.js.map +1 -1
  339. package/fesm2015/taiga-ui-kit-components-badged-content.js +2 -2
  340. package/fesm2015/taiga-ui-kit-components-badged-content.js.map +1 -1
  341. package/fesm2015/taiga-ui-kit-components-checkbox.js +2 -2
  342. package/fesm2015/taiga-ui-kit-components-checkbox.js.map +1 -1
  343. package/fesm2015/taiga-ui-kit-components-combo-box.js.map +1 -1
  344. package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js +4 -4
  345. package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js.map +1 -1
  346. package/fesm2015/taiga-ui-kit-components-files.js +232 -0
  347. package/fesm2015/taiga-ui-kit-components-files.js.map +1 -0
  348. package/fesm2015/taiga-ui-kit-components-input-count.js +2 -2
  349. package/fesm2015/taiga-ui-kit-components-input-count.js.map +1 -1
  350. package/fesm2015/taiga-ui-kit-components-input-date-range.js +3 -1
  351. package/fesm2015/taiga-ui-kit-components-input-date-range.js.map +1 -1
  352. package/fesm2015/taiga-ui-kit-components-input-date-time.js +1 -1
  353. package/fesm2015/taiga-ui-kit-components-input-date-time.js.map +1 -1
  354. package/fesm2015/taiga-ui-kit-components-input-date.js +4 -2
  355. package/fesm2015/taiga-ui-kit-components-input-date.js.map +1 -1
  356. package/fesm2015/taiga-ui-kit-components-input-file.js +25 -25
  357. package/fesm2015/taiga-ui-kit-components-input-file.js.map +1 -1
  358. package/fesm2015/taiga-ui-kit-components-input-files.js +246 -0
  359. package/fesm2015/taiga-ui-kit-components-input-files.js.map +1 -0
  360. package/fesm2015/taiga-ui-kit-components-input-number.js +27 -18
  361. package/fesm2015/taiga-ui-kit-components-input-number.js.map +1 -1
  362. package/fesm2015/taiga-ui-kit-components-input-password.js +3 -3
  363. package/fesm2015/taiga-ui-kit-components-input-password.js.map +1 -1
  364. package/fesm2015/taiga-ui-kit-components-input-phone-international.js +19 -5
  365. package/fesm2015/taiga-ui-kit-components-input-phone-international.js.map +1 -1
  366. package/fesm2015/taiga-ui-kit-components-input-phone.js +5 -4
  367. package/fesm2015/taiga-ui-kit-components-input-phone.js.map +1 -1
  368. package/fesm2015/taiga-ui-kit-components-input-range.js +23 -5
  369. package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
  370. package/fesm2015/taiga-ui-kit-components-input-slider.js +203 -108
  371. package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
  372. package/fesm2015/taiga-ui-kit-components-input-tag.js +1 -1
  373. package/fesm2015/taiga-ui-kit-components-input-tag.js.map +1 -1
  374. package/fesm2015/taiga-ui-kit-components-input-time.js.map +1 -1
  375. package/fesm2015/taiga-ui-kit-components-input.js.map +1 -1
  376. package/fesm2015/taiga-ui-kit-components-line-clamp.js +3 -3
  377. package/fesm2015/taiga-ui-kit-components-line-clamp.js.map +1 -1
  378. package/fesm2015/taiga-ui-kit-components-multi-select-option.js +2 -2
  379. package/fesm2015/taiga-ui-kit-components-multi-select-option.js.map +1 -1
  380. package/fesm2015/taiga-ui-kit-components-multi-select.js +2 -2
  381. package/fesm2015/taiga-ui-kit-components-multi-select.js.map +1 -1
  382. package/fesm2015/taiga-ui-kit-components-pagination.js +1 -1
  383. package/fesm2015/taiga-ui-kit-components-pagination.js.map +1 -1
  384. package/fesm2015/taiga-ui-kit-components-progress.js +2 -2
  385. package/fesm2015/taiga-ui-kit-components-progress.js.map +1 -1
  386. package/fesm2015/taiga-ui-kit-components-radio.js +1 -1
  387. package/fesm2015/taiga-ui-kit-components-radio.js.map +1 -1
  388. package/fesm2015/taiga-ui-kit-components-select.js +1 -1
  389. package/fesm2015/taiga-ui-kit-components-select.js.map +1 -1
  390. package/fesm2015/taiga-ui-kit-components-slider.js +51 -16
  391. package/fesm2015/taiga-ui-kit-components-slider.js.map +1 -1
  392. package/fesm2015/taiga-ui-kit-components-text-area.js +2 -2
  393. package/fesm2015/taiga-ui-kit-components-text-area.js.map +1 -1
  394. package/fesm2015/taiga-ui-kit-components-toggle.js +2 -2
  395. package/fesm2015/taiga-ui-kit-components-toggle.js.map +1 -1
  396. package/fesm2015/taiga-ui-kit-components.js +2 -0
  397. package/fesm2015/taiga-ui-kit-components.js.map +1 -1
  398. package/fesm2015/taiga-ui-kit-enums.js.map +1 -1
  399. package/fesm2015/taiga-ui-kit-internal-primitive-calendar-range.js +25 -1
  400. package/fesm2015/taiga-ui-kit-internal-primitive-calendar-range.js.map +1 -1
  401. package/fesm2015/taiga-ui-kit-pipes-field-error.js +10 -2
  402. package/fesm2015/taiga-ui-kit-pipes-field-error.js.map +1 -1
  403. package/fesm2015/taiga-ui-kit-tokens.js +7 -1
  404. package/fesm2015/taiga-ui-kit-tokens.js.map +1 -1
  405. package/fesm2015/taiga-ui-kit-utils-files.js +8 -1
  406. package/fesm2015/taiga-ui-kit-utils-files.js.map +1 -1
  407. package/fesm5/taiga-ui-kit-abstract.js +66 -19
  408. package/fesm5/taiga-ui-kit-abstract.js.map +1 -1
  409. package/fesm5/taiga-ui-kit-components-accordion.js +2 -2
  410. package/fesm5/taiga-ui-kit-components-accordion.js.map +1 -1
  411. package/fesm5/taiga-ui-kit-components-arrow.js.map +1 -1
  412. package/fesm5/taiga-ui-kit-components-badge.js.map +1 -1
  413. package/fesm5/taiga-ui-kit-components-badged-content.js +2 -2
  414. package/fesm5/taiga-ui-kit-components-badged-content.js.map +1 -1
  415. package/fesm5/taiga-ui-kit-components-checkbox.js +2 -2
  416. package/fesm5/taiga-ui-kit-components-checkbox.js.map +1 -1
  417. package/fesm5/taiga-ui-kit-components-combo-box.js.map +1 -1
  418. package/fesm5/taiga-ui-kit-components-data-list-wrapper.js +4 -4
  419. package/fesm5/taiga-ui-kit-components-data-list-wrapper.js.map +1 -1
  420. package/fesm5/taiga-ui-kit-components-files.js +289 -0
  421. package/fesm5/taiga-ui-kit-components-files.js.map +1 -0
  422. package/fesm5/taiga-ui-kit-components-input-count.js +2 -2
  423. package/fesm5/taiga-ui-kit-components-input-count.js.map +1 -1
  424. package/fesm5/taiga-ui-kit-components-input-date-range.js +3 -1
  425. package/fesm5/taiga-ui-kit-components-input-date-range.js.map +1 -1
  426. package/fesm5/taiga-ui-kit-components-input-date-time.js +1 -1
  427. package/fesm5/taiga-ui-kit-components-input-date-time.js.map +1 -1
  428. package/fesm5/taiga-ui-kit-components-input-date.js +4 -2
  429. package/fesm5/taiga-ui-kit-components-input-date.js.map +1 -1
  430. package/fesm5/taiga-ui-kit-components-input-file.js +43 -45
  431. package/fesm5/taiga-ui-kit-components-input-file.js.map +1 -1
  432. package/fesm5/taiga-ui-kit-components-input-files.js +284 -0
  433. package/fesm5/taiga-ui-kit-components-input-files.js.map +1 -0
  434. package/fesm5/taiga-ui-kit-components-input-number.js +37 -26
  435. package/fesm5/taiga-ui-kit-components-input-number.js.map +1 -1
  436. package/fesm5/taiga-ui-kit-components-input-password.js +3 -3
  437. package/fesm5/taiga-ui-kit-components-input-password.js.map +1 -1
  438. package/fesm5/taiga-ui-kit-components-input-phone-international.js +20 -8
  439. package/fesm5/taiga-ui-kit-components-input-phone-international.js.map +1 -1
  440. package/fesm5/taiga-ui-kit-components-input-phone.js +5 -4
  441. package/fesm5/taiga-ui-kit-components-input-phone.js.map +1 -1
  442. package/fesm5/taiga-ui-kit-components-input-range.js +27 -5
  443. package/fesm5/taiga-ui-kit-components-input-range.js.map +1 -1
  444. package/fesm5/taiga-ui-kit-components-input-slider.js +206 -119
  445. package/fesm5/taiga-ui-kit-components-input-slider.js.map +1 -1
  446. package/fesm5/taiga-ui-kit-components-input-tag.js +1 -1
  447. package/fesm5/taiga-ui-kit-components-input-tag.js.map +1 -1
  448. package/fesm5/taiga-ui-kit-components-input-time.js.map +1 -1
  449. package/fesm5/taiga-ui-kit-components-input.js.map +1 -1
  450. package/fesm5/taiga-ui-kit-components-line-clamp.js +3 -3
  451. package/fesm5/taiga-ui-kit-components-line-clamp.js.map +1 -1
  452. package/fesm5/taiga-ui-kit-components-multi-select-option.js +2 -2
  453. package/fesm5/taiga-ui-kit-components-multi-select-option.js.map +1 -1
  454. package/fesm5/taiga-ui-kit-components-multi-select.js +2 -2
  455. package/fesm5/taiga-ui-kit-components-multi-select.js.map +1 -1
  456. package/fesm5/taiga-ui-kit-components-pagination.js +1 -1
  457. package/fesm5/taiga-ui-kit-components-pagination.js.map +1 -1
  458. package/fesm5/taiga-ui-kit-components-progress.js +2 -2
  459. package/fesm5/taiga-ui-kit-components-progress.js.map +1 -1
  460. package/fesm5/taiga-ui-kit-components-radio.js +1 -1
  461. package/fesm5/taiga-ui-kit-components-radio.js.map +1 -1
  462. package/fesm5/taiga-ui-kit-components-select.js +1 -1
  463. package/fesm5/taiga-ui-kit-components-select.js.map +1 -1
  464. package/fesm5/taiga-ui-kit-components-slider.js +66 -21
  465. package/fesm5/taiga-ui-kit-components-slider.js.map +1 -1
  466. package/fesm5/taiga-ui-kit-components-text-area.js +2 -2
  467. package/fesm5/taiga-ui-kit-components-text-area.js.map +1 -1
  468. package/fesm5/taiga-ui-kit-components-toggle.js +2 -2
  469. package/fesm5/taiga-ui-kit-components-toggle.js.map +1 -1
  470. package/fesm5/taiga-ui-kit-components.js +2 -0
  471. package/fesm5/taiga-ui-kit-components.js.map +1 -1
  472. package/fesm5/taiga-ui-kit-enums.js.map +1 -1
  473. package/fesm5/taiga-ui-kit-internal-primitive-calendar-range.js +25 -1
  474. package/fesm5/taiga-ui-kit-internal-primitive-calendar-range.js.map +1 -1
  475. package/fesm5/taiga-ui-kit-pipes-field-error.js +10 -2
  476. package/fesm5/taiga-ui-kit-pipes-field-error.js.map +1 -1
  477. package/fesm5/taiga-ui-kit-tokens.js +7 -1
  478. package/fesm5/taiga-ui-kit-tokens.js.map +1 -1
  479. package/fesm5/taiga-ui-kit-utils-files.js +8 -1
  480. package/fesm5/taiga-ui-kit-utils-files.js.map +1 -1
  481. package/internal/primitive-calendar-range/primitive-calendar-range.component.d.ts +3 -0
  482. package/internal/primitive-calendar-range/taiga-ui-kit-internal-primitive-calendar-range.metadata.json +1 -1
  483. package/package.json +4 -4
  484. package/pipes/field-error/field-error-content-pipe.d.ts +1 -0
  485. package/pipes/field-error/taiga-ui-kit-pipes-field-error.metadata.json +1 -1
  486. package/tokens/i18n.d.ts +2 -0
  487. package/tokens/taiga-ui-kit-tokens.metadata.json +1 -1
  488. package/utils/files/get-accept-array.d.ts +1 -0
  489. package/utils/files/index.d.ts +1 -0
  490. package/utils/files/taiga-ui-kit-utils-files.metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-input-file.js","sources":["ng://@taiga-ui/kit/components/input-file/file/file.component.ts","ng://@taiga-ui/kit/components/input-file/input-file.component.ts","ng://@taiga-ui/kit/components/input-file/input-file.module.ts","ng://@taiga-ui/kit/components/input-file/taiga-ui-kit-components-input-file.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n Inject,\n Input,\n Output,\n} from '@angular/core';\nimport {DomSanitizer, SafeValue} from '@angular/platform-browser';\nimport {TUI_IS_MOBILE, tuiDefaultProp, tuiPure} from '@taiga-ui/cdk';\nimport {TuiSizeL} from '@taiga-ui/core';\nimport {TuiFileState} from '@taiga-ui/kit/enums';\nimport {TuiFileLike} from '@taiga-ui/kit/interfaces';\nimport {TUI_DIGITAL_INFORMATION_UNITS, TUI_FILE_TEXTS} from '@taiga-ui/kit/tokens';\nimport {formatSize} from '@taiga-ui/kit/utils/files';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n// @dynamic\n@Component({\n selector: 'tui-file',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './file.template.html',\n styleUrls: ['./file.style.less'],\n})\nexport class TuiFileComponent {\n @Input()\n @tuiDefaultProp()\n file: TuiFileLike = {name: ''};\n\n @Input()\n @tuiDefaultProp()\n state: TuiFileState = TuiFileState.Normal;\n\n @Input()\n @tuiDefaultProp()\n size: TuiSizeL = 'm';\n\n @Input()\n @tuiDefaultProp()\n allowDelete = true;\n\n @Input()\n @tuiDefaultProp()\n showSize = true;\n\n @Output()\n readonly fileRemoved = new EventEmitter<void>();\n\n @HostBinding('class._focused')\n focused = false;\n\n constructor(\n @Inject(TUI_IS_MOBILE) readonly isMobile: boolean,\n @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer,\n @Inject(TUI_FILE_TEXTS)\n readonly fileTexts$: Observable<\n Record<'loadingError' | 'preview' | 'remove', string>\n >,\n @Inject(TUI_DIGITAL_INFORMATION_UNITS)\n private readonly units$: Observable<[string, string, string]>,\n ) {}\n\n get preview(): SafeValue {\n return this.isBig ? this.createPreview(this.file, this.sanitizer) : '';\n }\n\n get isBig(): boolean {\n return this.size === 'l';\n }\n\n get isLoading(): boolean {\n return this.state === TuiFileState.Loading;\n }\n\n get isError(): boolean {\n return this.state === TuiFileState.Error;\n }\n\n get isDeleted(): boolean {\n return this.state === TuiFileState.Deleted;\n }\n\n get icon(): string {\n if (this.state === TuiFileState.Normal && this.isBig) {\n return 'tuiIconDefaultDocLarge';\n }\n\n switch (this.state) {\n case TuiFileState.Deleted:\n return 'tuiIconTrashLarge';\n case TuiFileState.Error:\n return 'tuiIconAlertCircleLarge';\n default:\n return 'tuiIconCheckCircleLarge';\n }\n }\n\n @HostBinding('class._link')\n get src(): string {\n return this.file.src || '';\n }\n\n get name(): string {\n return this.file.name.split('.').slice(0, -1).join('.');\n }\n\n get type(): string {\n return '.' + this.file.name.split('.').pop() || '';\n }\n\n get content$(): Observable<PolymorpheusContent> {\n return this.calculateContent$(this.state, this.file, this.fileTexts$);\n }\n\n get fileSize$(): Observable<string | null> {\n return this.calculateFileSize$(this.file, this.units$);\n }\n\n onRemoveClick() {\n this.fileRemoved.emit();\n }\n\n onFocusVisible(focusVisible: boolean) {\n this.focused = focusVisible;\n }\n\n @tuiPure\n private calculateContent$(\n state: TuiFileState,\n file: TuiFileLike,\n fileTexts$: Observable<Record<'loadingError' | 'preview' | 'remove', string>>,\n ): Observable<PolymorpheusContent> {\n return state === TuiFileState.Error && !file.content\n ? fileTexts$.pipe(map(texts => texts.loadingError))\n : of(this.file.content || '');\n }\n\n @tuiPure\n private calculateFileSize$(\n file: TuiFileLike,\n units$: Observable<[string, string, string]>,\n ): Observable<string | null> {\n return units$.pipe(map(units => formatSize(units, file.size)));\n }\n\n @tuiPure\n private createPreview(file: TuiFileLike, sanitizer: DomSanitizer): SafeValue {\n if (file.src) {\n return file.src;\n }\n\n // TODO: iframe warning\n if (file instanceof File && file.type && file.type.startsWith('image/')) {\n return sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(file));\n }\n\n return '';\n }\n}\n","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} 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 {\n MODE_PROVIDER,\n TUI_MODE,\n TuiAppearance,\n TuiBrightness,\n TuiSizeL,\n} 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} 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-file',\n templateUrl: './input-file.template.html',\n styleUrls: ['./input-file.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n MODE_PROVIDER,\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputFileComponent),\n },\n ],\n})\nexport class TuiInputFileComponent\n extends AbstractTuiNullableControl<TuiFileLike | ReadonlyArray<TuiFileLike>>\n implements TuiFocusableElementAccessor\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 showSize = true;\n\n @Input()\n @tuiDefaultProp()\n maxFileSize = DEFAULT_MAX_SIZE;\n\n @Input()\n @tuiDefaultProp()\n loadingFiles: ReadonlyArray<TuiFileLike> = [];\n\n @Input()\n @tuiDefaultProp()\n rejectedFiles: ReadonlyArray<TuiFileLike> = [];\n\n @Output()\n rejectedFilesChange = new EventEmitter<ReadonlyArray<TuiFileLike>>();\n\n @ViewChild('input')\n readonly input?: ElementRef<HTMLInputElement>;\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_MODE) readonly mode$: Observable<TuiBrightness | null>,\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 ? 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 // @bad TODO: refactor after IE is dropped\n get fileDragged(): boolean {\n return (\n !!this.dataTransfer &&\n Array.prototype.indexOf.call(this.dataTransfer.types, 'Files') !== -1\n );\n }\n\n get acceptArray(): readonly string[] {\n return this.getAcceptArray(this.accept);\n }\n\n get arrayValue(): ReadonlyArray<TuiFileLike> {\n return this.getValueArray(this.value);\n }\n\n get readyFiles(): ReadonlyArray<TuiFileLike> {\n return this.getReadyFiles(this.arrayValue, this.loadingFiles);\n }\n\n get computedLoading(): ReadonlyArray<TuiFileLike> {\n return this.getLoadingFiles(this.arrayValue, this.loadingFiles);\n }\n\n get hasFiles(): boolean {\n return !!this.rejectedFiles.length || !!this.arrayValue.length;\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 // TODO: refactor i18n messages\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 removeRejectedFile(removedFile: TuiFileLike) {\n this.updateRejectedFiles(this.rejectedFiles.filter(file => file !== removedFile));\n }\n\n getAppearance(mode: null | unknown): string {\n return mode === null ? '' : TuiAppearance.Outline;\n }\n\n @tuiPure\n private computeLink$(\n fileDragged: boolean,\n multiple: boolean,\n link: PolymorpheusContent,\n ): Observable<PolymorpheusContent> {\n if (fileDragged) {\n return of('');\n }\n\n return 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 value instanceof Array ? value : [value];\n }\n\n @tuiPure\n private getReadyFiles(\n value: ReadonlyArray<TuiFileLike>,\n loading: ReadonlyArray<TuiFileLike>,\n ): ReadonlyArray<TuiFileLike> {\n return value.filter(file => loading.indexOf(file) === -1);\n }\n\n @tuiPure\n private getLoadingFiles(\n value: ReadonlyArray<TuiFileLike>,\n loading: ReadonlyArray<TuiFileLike>,\n ): ReadonlyArray<TuiFileLike> {\n return loading.filter(file => value.indexOf(file) !== -1);\n }\n\n @tuiPure\n private getAcceptArray(accept: string): readonly string[] {\n return accept\n .toLowerCase()\n .split(',')\n .map(format => format.trim());\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 === null || files.length === 0) {\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.indexOf(file) === -1,\n );\n const acceptedFiles = newFiles.filter(\n file =>\n tooBigFiles.indexOf(file) === -1 && wrongFormatFiles.indexOf(file) === -1,\n );\n\n this.updateRejectedFiles([\n ...tooBigFiles.map(file => ({\n name: file.name,\n type: file.type,\n size: file.size,\n content:\n texts.maxSizeRejectionReason + 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 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 this.acceptArray.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 updateRejectedFiles(rejectedFiles: ReadonlyArray<TuiFileLike>) {\n this.rejectedFiles = rejectedFiles;\n this.rejectedFilesChange.emit(rejectedFiles);\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 TuiPreventDefaultModule,\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 {TuiFileComponent} from './file/file.component';\nimport {TuiInputFileComponent} from './input-file.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 TuiPreventDefaultModule,\n TuiGroupModule,\n ],\n declarations: [TuiFileComponent, TuiInputFileComponent],\n exports: [TuiInputFileComponent],\n})\nexport class TuiInputFileModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAoBA;IAOa,gBAAgB,GAA7B,MAAa,gBAAgB;IA2BzB,YACoC,QAAiB,EACV,SAAuB,EAErD,UAER,EAEgB,MAA4C;QAP7B,aAAQ,GAAR,QAAQ,CAAS;QACV,cAAS,GAAT,SAAS,CAAc;QAErD,eAAU,GAAV,UAAU,CAElB;QAEgB,WAAM,GAAN,MAAM,CAAsC;QAhCjE,SAAI,GAAgB,EAAC,IAAI,EAAE,EAAE,EAAC,CAAC;QAI/B,UAAK,yBAAqC;QAI1C,SAAI,GAAa,GAAG,CAAC;QAIrB,gBAAW,GAAG,IAAI,CAAC;QAInB,aAAQ,GAAG,IAAI,CAAC;QAGP,gBAAW,GAAG,IAAI,YAAY,EAAQ,CAAC;QAGhD,YAAO,GAAG,KAAK,CAAC;KAWZ;IAEJ,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,S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EzB,WAAA,MAAM,CAAC,aAAa,CAAC,CAAA;IAErB,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAc5B,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;IAChB,WAAA,MAAM,CAAC,6BAA6B,CAAC,CAAA;GAxEjC,qBAAqB,CA6TjC;;ICtUY,kBAAkB,GAA/B,MAAa,kBAAkB;EAAG;AAArB,kBAAkB;IAtB9B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,kBAAkB;YAClB,YAAY;YACZ,gBAAgB;YAChB,qBAAqB;YACrB,gBAAgB;YAChB,gBAAgB;YAChB,kBAAkB;YAClB,kBAAkB;YAClB,gBAAgB;YAChB,YAAY;YACZ,aAAa;YACb,eAAe;YACf,eAAe;YACf,uBAAuB;YACvB,cAAc;SACjB;QACD,YAAY,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;QACvD,OAAO,EAAE,CAAC,qBAAqB,CAAC;KACnC,CAAC;GACW,kBAAkB,CAAG;;AC/ClC;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-kit-components-input-file.js","sources":["ng://@taiga-ui/kit/components/input-file/file/file.component.ts","ng://@taiga-ui/kit/components/input-file/input-file.component.ts","ng://@taiga-ui/kit/components/input-file/input-file.module.ts","ng://@taiga-ui/kit/components/input-file/taiga-ui-kit-components-input-file.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n Inject,\n Input,\n Output,\n} from '@angular/core';\nimport {DomSanitizer, SafeValue} from '@angular/platform-browser';\nimport {TUI_IS_MOBILE, tuiDefaultProp, tuiPure} from '@taiga-ui/cdk';\nimport {TuiSizeL} from '@taiga-ui/core';\nimport {TuiFileState} from '@taiga-ui/kit/enums';\nimport {TuiFileLike} from '@taiga-ui/kit/interfaces';\nimport {TUI_DIGITAL_INFORMATION_UNITS, TUI_FILE_TEXTS} from '@taiga-ui/kit/tokens';\nimport {formatSize} from '@taiga-ui/kit/utils/files';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n// @dynamic\n@Component({\n selector: 'tui-file',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './file.template.html',\n styleUrls: ['./file.style.less'],\n})\nexport class TuiFileOldComponent {\n @Input()\n @tuiDefaultProp()\n file: TuiFileLike = {name: ''};\n\n @Input()\n @tuiDefaultProp()\n state: TuiFileState = TuiFileState.Normal;\n\n @Input()\n @tuiDefaultProp()\n size: TuiSizeL = 'm';\n\n @Input()\n @tuiDefaultProp()\n allowDelete = true;\n\n @Input()\n @tuiDefaultProp()\n showSize = true;\n\n @Output()\n readonly fileRemoved = new EventEmitter<void>();\n\n @HostBinding('class._focused')\n focused = false;\n\n constructor(\n @Inject(TUI_IS_MOBILE) readonly isMobile: boolean,\n @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer,\n @Inject(TUI_FILE_TEXTS)\n readonly fileTexts$: Observable<\n Record<'loadingError' | 'preview' | 'remove', string>\n >,\n @Inject(TUI_DIGITAL_INFORMATION_UNITS)\n private readonly units$: Observable<[string, string, string]>,\n ) {}\n\n get preview(): SafeValue {\n return this.isBig ? this.createPreview(this.file, this.sanitizer) : '';\n }\n\n get isBig(): boolean {\n return this.size === 'l';\n }\n\n get isLoading(): boolean {\n return this.state === TuiFileState.Loading;\n }\n\n get isError(): boolean {\n return this.state === TuiFileState.Error;\n }\n\n get isDeleted(): boolean {\n return this.state === TuiFileState.Deleted;\n }\n\n get icon(): string {\n if (this.state === TuiFileState.Normal && this.isBig) {\n return 'tuiIconDefaultDocLarge';\n }\n\n switch (this.state) {\n case TuiFileState.Deleted:\n return 'tuiIconTrashLarge';\n case TuiFileState.Error:\n return 'tuiIconAlertCircleLarge';\n default:\n return 'tuiIconCheckCircleLarge';\n }\n }\n\n @HostBinding('class._link')\n get src(): string {\n return this.file.src || '';\n }\n\n get name(): string {\n return this.file.name.split('.').slice(0, -1).join('.');\n }\n\n get type(): string {\n return `.${this.file.name.split('.').pop()}` || '';\n }\n\n get content$(): Observable<PolymorpheusContent> {\n return this.calculateContent$(this.state, this.file, this.fileTexts$);\n }\n\n get fileSize$(): Observable<string | null> {\n return this.calculateFileSize$(this.file, this.units$);\n }\n\n onRemoveClick() {\n this.fileRemoved.emit();\n }\n\n onFocusVisible(focusVisible: boolean) {\n this.focused = focusVisible;\n }\n\n @tuiPure\n private calculateContent$(\n state: TuiFileState,\n file: TuiFileLike,\n fileTexts$: Observable<Record<'loadingError' | 'preview' | 'remove', string>>,\n ): Observable<PolymorpheusContent> {\n return state === TuiFileState.Error && !file.content\n ? fileTexts$.pipe(map(texts => texts.loadingError))\n : of(this.file.content || '');\n }\n\n @tuiPure\n private calculateFileSize$(\n file: TuiFileLike,\n units$: Observable<[string, string, string]>,\n ): Observable<string | null> {\n return units$.pipe(map(units => formatSize(units, file.size)));\n }\n\n @tuiPure\n private createPreview(file: TuiFileLike, sanitizer: DomSanitizer): SafeValue {\n if (file.src) {\n return file.src;\n }\n\n // TODO: iframe warning\n if (file instanceof File && file.type && file.type.startsWith('image/')) {\n return sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(file));\n }\n\n return '';\n }\n}\n","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} 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 {\n MODE_PROVIDER,\n TUI_MODE,\n TuiAppearance,\n TuiBrightness,\n TuiSizeL,\n} 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} 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-file',\n templateUrl: './input-file.template.html',\n styleUrls: ['./input-file.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n MODE_PROVIDER,\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputFileComponent),\n },\n ],\n})\nexport class TuiInputFileComponent\n extends AbstractTuiNullableControl<TuiFileLike | ReadonlyArray<TuiFileLike>>\n implements TuiFocusableElementAccessor\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 showSize = true;\n\n @Input()\n @tuiDefaultProp()\n maxFileSize = DEFAULT_MAX_SIZE;\n\n @Input()\n @tuiDefaultProp()\n loadingFiles: ReadonlyArray<TuiFileLike> = [];\n\n @Input()\n @tuiDefaultProp()\n rejectedFiles: ReadonlyArray<TuiFileLike> = [];\n\n @Output()\n rejectedFilesChange = new EventEmitter<ReadonlyArray<TuiFileLike>>();\n\n @ViewChild('input')\n readonly input?: ElementRef<HTMLInputElement>;\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_MODE) readonly mode$: Observable<TuiBrightness | null>,\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 ? 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 // @bad TODO: refactor after IE is dropped\n get fileDragged(): boolean {\n return (\n !!this.dataTransfer &&\n Array.prototype.indexOf.call(this.dataTransfer.types, 'Files') !== -1\n );\n }\n\n get acceptArray(): readonly string[] {\n return this.getAcceptArray(this.accept);\n }\n\n get arrayValue(): ReadonlyArray<TuiFileLike> {\n return this.getValueArray(this.value);\n }\n\n get readyFiles(): ReadonlyArray<TuiFileLike> {\n return this.getReadyFiles(this.arrayValue, this.loadingFiles);\n }\n\n get computedLoading(): ReadonlyArray<TuiFileLike> {\n return this.getLoadingFiles(this.arrayValue, this.loadingFiles);\n }\n\n get hasFiles(): boolean {\n return !!this.rejectedFiles.length || !!this.arrayValue.length;\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 // TODO: refactor i18n messages\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 removeRejectedFile(removedFile: TuiFileLike) {\n this.updateRejectedFiles(this.rejectedFiles.filter(file => file !== removedFile));\n }\n\n getAppearance(mode: null | unknown): string {\n return mode === null ? '' : TuiAppearance.Outline;\n }\n\n @tuiPure\n private computeLink$(\n fileDragged: boolean,\n multiple: boolean,\n link: PolymorpheusContent,\n ): Observable<PolymorpheusContent> {\n if (fileDragged) {\n return of('');\n }\n\n return 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 value instanceof Array ? value : [value];\n }\n\n @tuiPure\n private getReadyFiles(\n value: ReadonlyArray<TuiFileLike>,\n loading: ReadonlyArray<TuiFileLike>,\n ): ReadonlyArray<TuiFileLike> {\n return value.filter(file => !loading.includes(file));\n }\n\n @tuiPure\n private getLoadingFiles(\n value: ReadonlyArray<TuiFileLike>,\n loading: ReadonlyArray<TuiFileLike>,\n ): ReadonlyArray<TuiFileLike> {\n return loading.filter(file => value.includes(file));\n }\n\n @tuiPure\n private getAcceptArray(accept: string): readonly string[] {\n return accept\n .toLowerCase()\n .split(',')\n .map(format => format.trim());\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 === null || files.length === 0) {\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 this.updateRejectedFiles([\n ...tooBigFiles.map(file => ({\n name: file.name,\n type: file.type,\n size: file.size,\n content:\n texts.maxSizeRejectionReason + 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 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 this.acceptArray.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 updateRejectedFiles(rejectedFiles: ReadonlyArray<TuiFileLike>) {\n this.rejectedFiles = rejectedFiles;\n this.rejectedFilesChange.emit(rejectedFiles);\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 TuiPreventDefaultModule,\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 {TuiFileOldComponent} from './file/file.component';\nimport {TuiInputFileComponent} from './input-file.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 TuiPreventDefaultModule,\n TuiGroupModule,\n ],\n declarations: [TuiFileOldComponent, TuiInputFileComponent],\n exports: [TuiInputFileComponent],\n})\nexport class TuiInputFileModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAoBA;IAOa,mBAAmB,GAAhC,MAAa,mBAAmB;IA2B5B,YACoC,QAAiB,EACV,SAAuB,EAErD,UAER,EAEgB,MAA4C;QAP7B,aAAQ,GAAR,QAAQ,CAAS;QACV,cAAS,GAAT,SAAS,CAAc;QAErD,eAAU,GAAV,UAAU,CAElB;QAEgB,WAAM,GAAN,MAAM,CAAsC;QAhCjE,SAAI,GAAgB,EAAC,IAAI,EAAE,EAAE,EAAC,CAAC;QAI/B,UAAK,yBAAqC;QAI1C,SAAI,GAAa,GAAG,CAAC;QAIrB,gBAAW,GAAG,IAAI,CAAC;QAInB,aAAQ,GAAG,IAAI,CAAC;QAGP,gBAAW,G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A;IACV,WAAA,IAAI,EAAE,CAAA;IACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,MAAM,CAAC,aAAa,CAAC,CAAA;IAErB,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAc5B,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;IAChB,WAAA,MAAM,CAAC,6BAA6B,CAAC,CAAA;GAxEjC,qBAAqB,CA4TjC;;ICrUY,kBAAkB,GAA/B,MAAa,kBAAkB;EAAG;AAArB,kBAAkB;IAtB9B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,kBAAkB;YAClB,YAAY;YACZ,gBAAgB;YAChB,qBAAqB;YACrB,gBAAgB;YAChB,gBAAgB;YAChB,kBAAkB;YAClB,kBAAkB;YAClB,gBAAgB;YAChB,YAAY;YACZ,aAAa;YACb,eAAe;YACf,eAAe;YACf,uBAAuB;YACvB,cAAc;SACjB;QACD,YAAY,EAAE,CAAC,mBAAmB,EAAE,qBAAqB,CAAC;QAC1D,OAAO,EAAE,CAAC,qBAAqB,CAAC;KACnC,CAAC;GACW,kBAAkB,CAAG;;AC/ClC;;;;;;"}
@@ -0,0 +1,246 @@
1
+ import { __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 { AbstractTuiNullableControl, isNativeFocused, EMPTY_ARRAY, TUI_IS_MOBILE, tuiDefaultProp, tuiPure, TUI_FOCUSABLE_ITEM_ACCESSOR, 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 TuiInputFilesComponent_1;
14
+ const DEFAULT_MAX_SIZE = 30 * 1000 * 1000; // 30 MB
15
+ // @dynamic
16
+ let TuiInputFilesComponent = TuiInputFilesComponent_1 = class TuiInputFilesComponent extends AbstractTuiNullableControl {
17
+ constructor(control, changeDetectorRef, isMobile, inputFileTexts$, units$) {
18
+ super(control, changeDetectorRef);
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
+ }
31
+ get nativeFocusableElement() {
32
+ var _a;
33
+ return ((_a = this.input) === null || _a === void 0 ? void 0 : _a.nativeElement) || null;
34
+ }
35
+ get focused() {
36
+ return isNativeFocused(this.nativeFocusableElement);
37
+ }
38
+ get computedPseudoHovered() {
39
+ var _a;
40
+ return (_a = this.pseudoHovered) !== null && _a !== void 0 ? _a : (this.fileDragged || null);
41
+ }
42
+ get computedLink$() {
43
+ return this.computeLink$(this.fileDragged, this.multiple, this.link);
44
+ }
45
+ get computedLabel$() {
46
+ return this.computeLabel$(this.isMobile, this.fileDragged, this.multiple, this.label);
47
+ }
48
+ get fileDragged() {
49
+ var _a;
50
+ return !!((_a = this.dataTransfer) === null || _a === void 0 ? void 0 : _a.types.includes('Files'));
51
+ }
52
+ get arrayValue() {
53
+ return this.getValueArray(this.value);
54
+ }
55
+ onHovered(hovered) {
56
+ this.updateHovered(hovered);
57
+ }
58
+ onFocused(focused) {
59
+ this.updateFocused(focused);
60
+ }
61
+ onPressed(pressed) {
62
+ this.updatePressed(pressed);
63
+ }
64
+ onFilesSelected(input, texts, units) {
65
+ this.processSelectedFiles(input.files, texts, units);
66
+ input.value = '';
67
+ }
68
+ onDropped(event, texts, units) {
69
+ this.processSelectedFiles(event.files, texts, units);
70
+ }
71
+ onDragOver(dataTransfer) {
72
+ this.dataTransfer = dataTransfer;
73
+ }
74
+ removeFile(removedFile) {
75
+ this.updateValue(this.multiple ? this.arrayValue.filter(file => file !== removedFile) : null);
76
+ }
77
+ computeLink$(fileDragged, multiple, link) {
78
+ return fileDragged
79
+ ? of('')
80
+ : this.inputFileTexts$.pipe(map(texts => multiple && link === ''
81
+ ? texts.defaultLinkMultiple
82
+ : link || texts.defaultLinkSingle));
83
+ }
84
+ computeLabel$(isMobile, fileDragged, multiple, label) {
85
+ if (isMobile) {
86
+ return of('');
87
+ }
88
+ if (fileDragged) {
89
+ return this.inputFileTexts$.pipe(map(texts => (multiple ? texts.dropMultiple : texts.drop)));
90
+ }
91
+ return this.inputFileTexts$.pipe(map(texts => multiple && label === ''
92
+ ? texts.defaultLabelMultiple
93
+ : label || texts.defaultLabelSingle));
94
+ }
95
+ getValueArray(value) {
96
+ if (!value) {
97
+ return EMPTY_ARRAY;
98
+ }
99
+ return Array.isArray(value) ? value : [value];
100
+ }
101
+ processSelectedFiles(files, texts, units) {
102
+ // IE11 after selecting a file through the open dialog generates a second event passing an empty FileList.
103
+ if (!(files === null || files === void 0 ? void 0 : files.length)) {
104
+ return;
105
+ }
106
+ const newFiles = this.multiple ? Array.from(files) : [files[0]];
107
+ const tooBigFiles = newFiles.filter(file => file.size > this.maxFileSize);
108
+ const wrongFormatFiles = newFiles.filter(file => !this.isFormatAcceptable(file) && !tooBigFiles.includes(file));
109
+ const acceptedFiles = newFiles.filter(file => !tooBigFiles.includes(file) && !wrongFormatFiles.includes(file));
110
+ if (tooBigFiles.length || wrongFormatFiles.length) {
111
+ this.rejectFiles([
112
+ ...tooBigFiles.map(file => ({
113
+ name: file.name,
114
+ type: file.type,
115
+ size: file.size,
116
+ content: texts.maxSizeRejectionReason +
117
+ formatSize(units, this.maxFileSize),
118
+ })),
119
+ ...wrongFormatFiles.map(file => ({
120
+ name: file.name,
121
+ type: file.type,
122
+ size: file.size,
123
+ content: texts.formatRejectionReason,
124
+ })),
125
+ ]);
126
+ }
127
+ this.updateValue(this.multiple
128
+ ? [...this.arrayValue, ...acceptedFiles]
129
+ : acceptedFiles[0] || null);
130
+ }
131
+ isFormatAcceptable(file) {
132
+ if (!this.accept) {
133
+ return true;
134
+ }
135
+ const extension = `.${(file.name.split('.').pop() || '').toLowerCase()}`;
136
+ return getAcceptArray(this.accept).some(format => format === extension ||
137
+ format === file.type ||
138
+ (format.split('/')[1] === '*' &&
139
+ file.type.split('/')[0] === format.split('/')[0]));
140
+ }
141
+ rejectFiles(rejectedFiles) {
142
+ this.reject.emit(this.multiple ? rejectedFiles : rejectedFiles[0]);
143
+ }
144
+ };
145
+ TuiInputFilesComponent.ctorParameters = () => [
146
+ { type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
147
+ { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
148
+ { type: Boolean, decorators: [{ type: Inject, args: [TUI_IS_MOBILE,] }] },
149
+ { type: Observable, decorators: [{ type: Inject, args: [TUI_INPUT_FILE_TEXTS,] }] },
150
+ { type: Observable, decorators: [{ type: Inject, args: [TUI_DIGITAL_INFORMATION_UNITS,] }] }
151
+ ];
152
+ __decorate([
153
+ ViewChild('input')
154
+ ], TuiInputFilesComponent.prototype, "input", void 0);
155
+ __decorate([
156
+ Input(),
157
+ tuiDefaultProp()
158
+ ], TuiInputFilesComponent.prototype, "link", void 0);
159
+ __decorate([
160
+ Input(),
161
+ tuiDefaultProp()
162
+ ], TuiInputFilesComponent.prototype, "label", void 0);
163
+ __decorate([
164
+ Input(),
165
+ tuiDefaultProp()
166
+ ], TuiInputFilesComponent.prototype, "accept", void 0);
167
+ __decorate([
168
+ Input(),
169
+ tuiDefaultProp()
170
+ ], TuiInputFilesComponent.prototype, "multiple", void 0);
171
+ __decorate([
172
+ Input(),
173
+ tuiDefaultProp()
174
+ ], TuiInputFilesComponent.prototype, "size", void 0);
175
+ __decorate([
176
+ Input(),
177
+ tuiDefaultProp()
178
+ ], TuiInputFilesComponent.prototype, "maxFileSize", void 0);
179
+ __decorate([
180
+ Output()
181
+ ], TuiInputFilesComponent.prototype, "reject", void 0);
182
+ __decorate([
183
+ tuiPure
184
+ ], TuiInputFilesComponent.prototype, "computeLink$", null);
185
+ __decorate([
186
+ tuiPure
187
+ ], TuiInputFilesComponent.prototype, "computeLabel$", null);
188
+ __decorate([
189
+ tuiPure
190
+ ], TuiInputFilesComponent.prototype, "getValueArray", null);
191
+ TuiInputFilesComponent = TuiInputFilesComponent_1 = __decorate([
192
+ Component({
193
+ selector: 'tui-input-files',
194
+ 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",
195
+ changeDetection: ChangeDetectionStrategy.OnPush,
196
+ encapsulation: ViewEncapsulation.None,
197
+ providers: [
198
+ MODE_PROVIDER,
199
+ {
200
+ provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
201
+ useExisting: forwardRef(() => TuiInputFilesComponent_1),
202
+ },
203
+ ],
204
+ 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}"]
205
+ }),
206
+ __param(0, Optional()),
207
+ __param(0, Self()),
208
+ __param(0, Inject(NgControl)),
209
+ __param(1, Inject(ChangeDetectorRef)),
210
+ __param(2, Inject(TUI_IS_MOBILE)),
211
+ __param(3, Inject(TUI_INPUT_FILE_TEXTS)),
212
+ __param(4, Inject(TUI_DIGITAL_INFORMATION_UNITS))
213
+ ], TuiInputFilesComponent);
214
+
215
+ let TuiInputFilesModule = class TuiInputFilesModule {
216
+ };
217
+ TuiInputFilesModule = __decorate([
218
+ NgModule({
219
+ imports: [
220
+ CommonModule,
221
+ PolymorpheusModule,
222
+ TuiLetModule,
223
+ TuiFocusedModule,
224
+ TuiFocusVisibleModule,
225
+ TuiPressedModule,
226
+ TuiHoveredModule,
227
+ TuiFocusableModule,
228
+ TuiDroppableModule,
229
+ TuiWrapperModule,
230
+ TuiSvgModule,
231
+ TuiLinkModule,
232
+ TuiLoaderModule,
233
+ TuiButtonModule,
234
+ TuiGroupModule,
235
+ ],
236
+ declarations: [TuiInputFilesComponent],
237
+ exports: [TuiInputFilesComponent],
238
+ })
239
+ ], TuiInputFilesModule);
240
+
241
+ /**
242
+ * Generated bundle index. Do not edit.
243
+ */
244
+
245
+ export { TuiInputFilesComponent, TuiInputFilesModule };
246
+ //# 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 computedPseudoHovered(): boolean | null {\n return this.pseudoHovered ?? (this.fileDragged || null);\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,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C;IAea,sBAAsB,8BAAnC,MAAa,sBACT,SAAQ,0BAAoE;IAmC5E,YAII,OAAyB,EAEzB,iBAAoC,EAE3B,QAAiB,EAEjB,eAYR,EAEQ,MAA4C;QAErD,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAlBzB,aAAQ,GAAR,QAAQ,CAAS;QAEjB,oBAAe,GAAf,eAAe,CAYvB;QAEQ,WAAM,GAAN,MAAM,CAAsC;QArDjD,iBAAY,GAAwB,IAAI,CAAC;QAIjD,SAAI,GAAwB,EAAE,CAAC;QAI/B,UAAK,GAAwB,EAAE,CAAC;QAIhC,WAAM,GAAG,EAAE,CAAC;QAIZ,aAAQ,GAAG,KAAK,CAAC;QAIjB,SAAI,GAAa,GAAG,CAAC;QAIrB,gBAAW,GAAG,gBAAgB,CAAC;Q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BAAmB,GAAhC,MAAa,mBAAmB;EAAG;AAAtB,mBAAmB;IArB/B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,kBAAkB;YAClB,YAAY;YACZ,gBAAgB;YAChB,qBAAqB;YACrB,gBAAgB;YAChB,gBAAgB;YAChB,kBAAkB;YAClB,kBAAkB;YAClB,gBAAgB;YAChB,YAAY;YACZ,aAAa;YACb,eAAe;YACf,eAAe;YACf,cAAc;SACjB;QACD,YAAY,EAAE,CAAC,sBAAsB,CAAC;QACtC,OAAO,EAAE,CAAC,sBAAsB,CAAC;KACpC,CAAC;GACW,mBAAmB,CAAG;;AC5CnC;;;;;;"}
@@ -1,8 +1,10 @@
1
1
  import { __decorate, __param } from 'tslib';
2
- import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, HostListener, Component, ChangeDetectionStrategy, forwardRef, Directive, NgModule } from '@angular/core';
2
+ import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, ContentChild, HostListener, Component, ChangeDetectionStrategy, forwardRef, Directive, NgModule } from '@angular/core';
3
3
  import { NgControl } from '@angular/forms';
4
4
  import { AbstractTuiNullableControl, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiControl, TuiMapperPipeModule } from '@taiga-ui/cdk';
5
- import { tuiCreateNumberMask, tuiCreateAutoCorrectedNumberPipe, getFractionPartPadded, formatNumber, maskedMoneyValueIsEmpty, maskedNumberStringToNumber, TUI_DECIMAL_SYMBOLS, TUI_NUMBER_FORMAT, TuiPrimitiveTextfieldComponent, TuiAbstractTextfieldHost, TUI_TEXTFIELD_HOST, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule, TuiTextfieldComponent } from '@taiga-ui/core';
5
+ import { tuiCreateNumberMask, tuiEnableAutoCorrectDecimalSymbol, tuiCreateAutoCorrectedNumberPipe, maskedMoneyValueIsEmpty, maskedNumberStringToNumber, TUI_DECIMAL_SYMBOLS, getFractionPartPadded, formatNumber, TUI_NUMBER_FORMAT, TuiPrimitiveTextfieldComponent, TuiAbstractTextfieldHost, TUI_TEXTFIELD_HOST, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule, TuiTextfieldComponent } from '@taiga-ui/core';
6
+ import { PolymorpheusOutletComponent, PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
7
+ import { CommonModule } from '@angular/common';
6
8
  import { TuiValueAccessorModule } from '@taiga-ui/kit/directives';
7
9
  import { TextMaskModule } from 'angular2-text-mask';
8
10
 
@@ -25,11 +27,11 @@ let TuiInputNumberComponent = TuiInputNumberComponent_1 = class TuiInputNumberCo
25
27
  decimalLimit,
26
28
  allowDecimal: decimal !== 'never',
27
29
  requireDecimal: decimal === 'always',
28
- autoCorrectDecimalSymbol: false,
29
30
  decimalSymbol: this.numberFormat.decimalSeparator,
30
31
  thousandSymbol: this.numberFormat.thousandSeparator,
32
+ autoCorrectDecimalSymbol: tuiEnableAutoCorrectDecimalSymbol(this.numberFormat),
31
33
  }),
32
- pipe: tuiCreateAutoCorrectedNumberPipe(decimal === 'always' ? decimalLimit : 0, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator, nativeFocusableElement || undefined, allowNegative),
34
+ pipe: tuiCreateAutoCorrectedNumberPipe(decimal === 'always' ? decimalLimit : 0, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator, nativeFocusableElement, allowNegative),
33
35
  guide: false,
34
36
  });
35
37
  }
@@ -55,15 +57,7 @@ let TuiInputNumberComponent = TuiInputNumberComponent_1 = class TuiInputNumberCo
55
57
  return DEFAULT_MAX_LENGTH + precision + takeThousand;
56
58
  }
57
59
  get formattedValue() {
58
- const value = this.value || 0;
59
- const absValue = Math.abs(value);
60
- const hasFraction = absValue % 1 > 0;
61
- let limit = this.decimal === 'always' || hasFraction ? this.precision : 0;
62
- const fraction = hasFraction ? getFractionPartPadded(value, this.precision) : '';
63
- if (this.focused && this.decimal !== 'always') {
64
- limit = fraction.length;
65
- }
66
- return formatNumber(value, limit, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator, this.numberFormat.zeroPadding);
60
+ return this.getFormattedValue(this.value || 0);
67
61
  }
68
62
  get computedValue() {
69
63
  if (this.focused) {
@@ -102,7 +96,7 @@ let TuiInputNumberComponent = TuiInputNumberComponent_1 = class TuiInputNumberCo
102
96
  }
103
97
  }
104
98
  onKeyDown(event) {
105
- if (TUI_DECIMAL_SYMBOLS.indexOf(event.key) === -1) {
99
+ if (!TUI_DECIMAL_SYMBOLS.includes(event.key)) {
106
100
  return;
107
101
  }
108
102
  if (this.decimal === 'never') {
@@ -134,6 +128,16 @@ let TuiInputNumberComponent = TuiInputNumberComponent_1 = class TuiInputNumberCo
134
128
  onPressed(pressed) {
135
129
  this.updatePressed(pressed);
136
130
  }
131
+ getFormattedValue(value) {
132
+ const absValue = Math.abs(value);
133
+ const hasFraction = absValue % 1 > 0;
134
+ let limit = this.decimal === 'always' || hasFraction ? this.precision : 0;
135
+ const fraction = hasFraction ? getFractionPartPadded(value, this.precision) : '';
136
+ if (this.focused && this.decimal !== 'always') {
137
+ limit = fraction.length;
138
+ }
139
+ return formatNumber(value, limit, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator, this.numberFormat.zeroPadding);
140
+ }
137
141
  get isNativeValueNotFinished() {
138
142
  const nativeNumberValue = this.nativeNumberValue;
139
143
  return nativeNumberValue < 0
@@ -143,9 +147,6 @@ let TuiInputNumberComponent = TuiInputNumberComponent_1 = class TuiInputNumberCo
143
147
  get nativeValue() {
144
148
  return this.nativeFocusableElement ? this.nativeFocusableElement.value : '';
145
149
  }
146
- get nativeNumberValue() {
147
- return maskedNumberStringToNumber(this.nativeValue, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
148
- }
149
150
  set nativeValue(value) {
150
151
  if (!this.primitiveTextfield || !this.nativeFocusableElement) {
151
152
  return;
@@ -153,6 +154,9 @@ let TuiInputNumberComponent = TuiInputNumberComponent_1 = class TuiInputNumberCo
153
154
  this.primitiveTextfield.value = value;
154
155
  this.nativeFocusableElement.value = value;
155
156
  }
157
+ get nativeNumberValue() {
158
+ return maskedNumberStringToNumber(this.nativeValue, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
159
+ }
156
160
  clear() {
157
161
  this.nativeValue = '';
158
162
  this.updateValue(null);
@@ -205,13 +209,16 @@ __decorate([
205
209
  Input(),
206
210
  tuiDefaultProp()
207
211
  ], TuiInputNumberComponent.prototype, "postfix", void 0);
212
+ __decorate([
213
+ ContentChild(PolymorpheusOutletComponent)
214
+ ], TuiInputNumberComponent.prototype, "polymorpheusValueContent", void 0);
208
215
  __decorate([
209
216
  HostListener('keydown.0', ['$event'])
210
217
  ], TuiInputNumberComponent.prototype, "onZero", null);
211
218
  TuiInputNumberComponent = TuiInputNumberComponent_1 = __decorate([
212
219
  Component({
213
220
  selector: 'tui-input-number',
214
- template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"decimal\"\n class=\"textfield\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoFocused]=\"computedFocused\"\n [invalid]=\"computedInvalid\"\n [tuiTextfieldMaxLength]=\"calculatedMaxLength\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [textMask]=\"isNegativeAllowed | tuiMapper: mask:decimal:precision:nativeFocusableElement\"\n [value]=\"computedValue\"\n [prefix]=\"prefix\"\n [postfix]=\"postfix\"\n [focusable]=\"focusable\"\n (valueChange)=\"onValueChange($event)\"\n (hoveredChange)=\"onHovered($event)\"\n (focusedChange)=\"onFocused($event)\"\n (pressedChange)=\"onPressed($event)\"\n (keydown)=\"onKeyDown($event)\"\n>\n <ng-content></ng-content>\n <ng-content select=\"input\" ngProjectAs=\"input\"></ng-content>\n</tui-primitive-textfield>\n",
221
+ template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"decimal\"\n class=\"textfield\"\n [pseudoHovered]=\"computedHovered\"\n [pseudoFocused]=\"computedFocused\"\n [pseudoPressed]=\"computedPressed\"\n [invalid]=\"computedInvalid\"\n [tuiTextfieldMaxLength]=\"calculatedMaxLength\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [textMask]=\"isNegativeAllowed | tuiMapper: mask:decimal:precision:nativeFocusableElement\"\n [value]=\"computedValue\"\n [prefix]=\"prefix\"\n [postfix]=\"postfix\"\n [focusable]=\"focusable\"\n (valueChange)=\"onValueChange($event)\"\n (hoveredChange)=\"onHovered($event)\"\n (focusedChange)=\"onFocused($event)\"\n (pressedChange)=\"onPressed($event)\"\n (keydown)=\"onKeyDown($event)\"\n>\n <ng-content></ng-content>\n <ng-content select=\"input\" ngProjectAs=\"input\"></ng-content>\n <div\n *ngIf=\"polymorpheusValueContent\"\n polymorpheus-outlet\n [content]=\"valueContent\"\n ></div>\n</tui-primitive-textfield>\n\n<ng-template #valueContent>\n <ng-content select=\"[polymorpheus-outlet]\"></ng-content>\n</ng-template>\n",
215
222
  changeDetection: ChangeDetectionStrategy.OnPush,
216
223
  providers: [
217
224
  {
@@ -268,11 +275,13 @@ let TuiInputNumberModule = class TuiInputNumberModule {
268
275
  TuiInputNumberModule = __decorate([
269
276
  NgModule({
270
277
  imports: [
278
+ CommonModule,
271
279
  TextMaskModule,
272
280
  TuiMapperPipeModule,
273
281
  TuiPrimitiveTextfieldModule,
274
282
  TuiTextfieldControllerModule,
275
283
  TuiValueAccessorModule,
284
+ PolymorpheusModule,
276
285
  ],
277
286
  declarations: [TuiInputNumberComponent, TuiInputNumberDirective],
278
287
  exports: [TuiInputNumberComponent, TuiInputNumberDirective, TuiTextfieldComponent],