@taiga-ui/core 2.31.0 → 2.35.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 (396) hide show
  1. package/abstract/abstract-dropdown.d.ts +2 -1
  2. package/abstract/abstract-hint-options.d.ts +7 -0
  3. package/abstract/abstract-hint.d.ts +5 -4
  4. package/abstract/abstract-textfield-host.d.ts +13 -0
  5. package/abstract/index.d.ts +2 -0
  6. package/abstract/taiga-ui-core-abstract.metadata.json +1 -1
  7. package/bundles/taiga-ui-core-abstract.umd.js +76 -4
  8. package/bundles/taiga-ui-core-abstract.umd.js.map +1 -1
  9. package/bundles/taiga-ui-core-abstract.umd.min.js +1 -1
  10. package/bundles/taiga-ui-core-abstract.umd.min.js.map +1 -1
  11. package/bundles/taiga-ui-core-components-button.umd.js +7 -2
  12. package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
  13. package/bundles/taiga-ui-core-components-button.umd.min.js +2 -2
  14. package/bundles/taiga-ui-core-components-button.umd.min.js.map +1 -1
  15. package/bundles/taiga-ui-core-components-dialog.umd.js +1 -1
  16. package/bundles/taiga-ui-core-components-dialog.umd.min.js +1 -1
  17. package/bundles/taiga-ui-core-components-dialog.umd.min.js.map +1 -1
  18. package/bundles/taiga-ui-core-components-dropdown-box.umd.js +1 -1
  19. package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js +1 -1
  20. package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js.map +1 -1
  21. package/bundles/taiga-ui-core-components-label.umd.js +1 -1
  22. package/bundles/taiga-ui-core-components-label.umd.min.js +1 -1
  23. package/bundles/taiga-ui-core-components-label.umd.min.js.map +1 -1
  24. package/bundles/taiga-ui-core-components-link.umd.js +2 -2
  25. package/bundles/taiga-ui-core-components-link.umd.js.map +1 -1
  26. package/bundles/taiga-ui-core-components-link.umd.min.js +1 -1
  27. package/bundles/taiga-ui-core-components-link.umd.min.js.map +1 -1
  28. package/bundles/taiga-ui-core-components-loader.umd.js +5 -2
  29. package/bundles/taiga-ui-core-components-loader.umd.js.map +1 -1
  30. package/bundles/taiga-ui-core-components-loader.umd.min.js +1 -1
  31. package/bundles/taiga-ui-core-components-loader.umd.min.js.map +1 -1
  32. package/bundles/taiga-ui-core-components-primitive-calendar.umd.js +2 -6
  33. package/bundles/taiga-ui-core-components-primitive-calendar.umd.js.map +1 -1
  34. package/bundles/taiga-ui-core-components-primitive-calendar.umd.min.js +2 -2
  35. package/bundles/taiga-ui-core-components-primitive-calendar.umd.min.js.map +1 -1
  36. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js +7 -2
  37. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js.map +1 -1
  38. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js +1 -1
  39. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js.map +1 -1
  40. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +231 -44
  41. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
  42. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js +2 -2
  43. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js.map +1 -1
  44. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.js +2 -2
  45. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.js.map +1 -1
  46. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.min.js +1 -1
  47. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.min.js.map +1 -1
  48. package/bundles/taiga-ui-core-components-root.umd.js +13 -7
  49. package/bundles/taiga-ui-core-components-root.umd.js.map +1 -1
  50. package/bundles/taiga-ui-core-components-root.umd.min.js +2 -2
  51. package/bundles/taiga-ui-core-components-root.umd.min.js.map +1 -1
  52. package/bundles/taiga-ui-core-components-scroll-controls.umd.js +1 -1
  53. package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js +2 -2
  54. package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js.map +1 -1
  55. package/bundles/taiga-ui-core-components-theme-night.umd.js +1 -1
  56. package/bundles/taiga-ui-core-components-theme-night.umd.min.js +1 -1
  57. package/bundles/taiga-ui-core-components-theme-night.umd.min.js.map +1 -1
  58. package/bundles/taiga-ui-core-components-tooltip.umd.js +24 -14
  59. package/bundles/taiga-ui-core-components-tooltip.umd.js.map +1 -1
  60. package/bundles/taiga-ui-core-components-tooltip.umd.min.js +2 -2
  61. package/bundles/taiga-ui-core-components-tooltip.umd.min.js.map +1 -1
  62. package/bundles/taiga-ui-core-constants.umd.js +1 -1
  63. package/bundles/taiga-ui-core-constants.umd.js.map +1 -1
  64. package/bundles/taiga-ui-core-constants.umd.min.js +1 -1
  65. package/bundles/taiga-ui-core-constants.umd.min.js.map +1 -1
  66. package/bundles/taiga-ui-core-directives-described-by.umd.js +4 -4
  67. package/bundles/taiga-ui-core-directives-described-by.umd.js.map +1 -1
  68. package/bundles/taiga-ui-core-directives-described-by.umd.min.js +1 -1
  69. package/bundles/taiga-ui-core-directives-described-by.umd.min.js.map +1 -1
  70. package/bundles/taiga-ui-core-directives-dropdown.umd.js +1 -6
  71. package/bundles/taiga-ui-core-directives-dropdown.umd.js.map +1 -1
  72. package/bundles/taiga-ui-core-directives-dropdown.umd.min.js +2 -2
  73. package/bundles/taiga-ui-core-directives-dropdown.umd.min.js.map +1 -1
  74. package/bundles/taiga-ui-core-directives-hint-controller.umd.js +17 -12
  75. package/bundles/taiga-ui-core-directives-hint-controller.umd.js.map +1 -1
  76. package/bundles/taiga-ui-core-directives-hint-controller.umd.min.js +2 -2
  77. package/bundles/taiga-ui-core-directives-hint-controller.umd.min.js.map +1 -1
  78. package/bundles/taiga-ui-core-directives-hint.umd.js +25 -6
  79. package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
  80. package/bundles/taiga-ui-core-directives-hint.umd.min.js +1 -1
  81. package/bundles/taiga-ui-core-directives-hint.umd.min.js.map +1 -1
  82. package/bundles/taiga-ui-core-directives-manual-hint.umd.js +20 -4
  83. package/bundles/taiga-ui-core-directives-manual-hint.umd.js.map +1 -1
  84. package/bundles/taiga-ui-core-directives-manual-hint.umd.min.js +1 -1
  85. package/bundles/taiga-ui-core-directives-manual-hint.umd.min.js.map +1 -1
  86. package/bundles/taiga-ui-core-directives-pointer-hint.umd.js +22 -6
  87. package/bundles/taiga-ui-core-directives-pointer-hint.umd.js.map +1 -1
  88. package/bundles/taiga-ui-core-directives-pointer-hint.umd.min.js +1 -1
  89. package/bundles/taiga-ui-core-directives-pointer-hint.umd.min.js.map +1 -1
  90. package/bundles/taiga-ui-core-directives.umd.js +4 -12
  91. package/bundles/taiga-ui-core-directives.umd.js.map +1 -1
  92. package/bundles/taiga-ui-core-directives.umd.min.js +1 -1
  93. package/bundles/taiga-ui-core-tokens.umd.js +8 -0
  94. package/bundles/taiga-ui-core-tokens.umd.js.map +1 -1
  95. package/bundles/taiga-ui-core-tokens.umd.min.js +1 -1
  96. package/bundles/taiga-ui-core-tokens.umd.min.js.map +1 -1
  97. package/bundles/taiga-ui-core-utils-format.umd.js +1 -1
  98. package/bundles/taiga-ui-core-utils-format.umd.js.map +1 -1
  99. package/bundles/taiga-ui-core-utils-format.umd.min.js +1 -1
  100. package/bundles/taiga-ui-core-utils-format.umd.min.js.map +1 -1
  101. package/bundles/taiga-ui-core-utils-mask.umd.js +1 -1
  102. package/bundles/taiga-ui-core-utils-mask.umd.js.map +1 -1
  103. package/bundles/taiga-ui-core-utils-mask.umd.min.js +1 -1
  104. package/bundles/taiga-ui-core-utils-mask.umd.min.js.map +1 -1
  105. package/bundles/taiga-ui-core-utils-polyfills.umd.js +5 -5
  106. package/bundles/taiga-ui-core-utils-polyfills.umd.js.map +1 -1
  107. package/bundles/taiga-ui-core-utils-polyfills.umd.min.js +1 -1
  108. package/bundles/taiga-ui-core-utils-polyfills.umd.min.js.map +1 -1
  109. package/components/button/button-options.d.ts +10 -4
  110. package/components/button/button.component.d.ts +3 -3
  111. package/components/button/taiga-ui-core-components-button.metadata.json +1 -1
  112. package/components/dialog/taiga-ui-core-components-dialog.metadata.json +1 -1
  113. package/components/dropdown-box/taiga-ui-core-components-dropdown-box.metadata.json +1 -1
  114. package/components/label/taiga-ui-core-components-label.metadata.json +1 -1
  115. package/components/link/taiga-ui-core-components-link.metadata.json +1 -1
  116. package/components/loader/loader.directive.d.ts +3 -0
  117. package/components/loader/taiga-ui-core-components-loader.metadata.json +1 -1
  118. package/components/primitive-calendar/primitive-calendar.component.d.ts +0 -1
  119. package/components/primitive-calendar/taiga-ui-core-components-primitive-calendar.metadata.json +1 -1
  120. package/components/primitive-checkbox/checkbox-options.d.ts +10 -4
  121. package/components/primitive-checkbox/primitive-checkbox.component.d.ts +2 -2
  122. package/components/primitive-checkbox/taiga-ui-core-components-primitive-checkbox.metadata.json +1 -1
  123. package/components/primitive-textfield/index.d.ts +3 -0
  124. package/components/primitive-textfield/primitive-textfield-options.d.ts +12 -0
  125. package/components/primitive-textfield/primitive-textfield.component.d.ts +18 -11
  126. package/components/primitive-textfield/primitive-textfield.directive.d.ts +8 -0
  127. package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.metadata.json +1 -1
  128. package/components/primitive-textfield/textfield/textfield.component.d.ts +15 -0
  129. package/components/primitive-textfield/value-decoration/value-decoration.component.d.ts +1 -0
  130. package/components/primitive-year-picker/taiga-ui-core-components-primitive-year-picker.metadata.json +1 -1
  131. package/components/root/root.component.d.ts +1 -1
  132. package/components/root/taiga-ui-core-components-root.metadata.json +1 -1
  133. package/components/scroll-controls/taiga-ui-core-components-scroll-controls.metadata.json +1 -1
  134. package/components/theme-night/taiga-ui-core-components-theme-night.metadata.json +1 -1
  135. package/components/tooltip/taiga-ui-core-components-tooltip.metadata.json +1 -1
  136. package/components/tooltip/tooltip.component.d.ts +9 -6
  137. package/constants/taiga-ui-core-constants.metadata.json +1 -1
  138. package/constants/version.d.ts +1 -1
  139. package/directives/described-by/taiga-ui-core-directives-described-by.metadata.json +1 -1
  140. package/directives/dropdown/taiga-ui-core-directives-dropdown.metadata.json +1 -1
  141. package/directives/hint/hint-options.d.ts +13 -0
  142. package/directives/hint/hint.directive.d.ts +5 -3
  143. package/directives/hint/index.d.ts +1 -0
  144. package/directives/hint/taiga-ui-core-directives-hint.metadata.json +1 -1
  145. package/directives/hint-controller/hint-controller.directive.d.ts +7 -5
  146. package/directives/hint-controller/taiga-ui-core-directives-hint-controller.metadata.json +1 -1
  147. package/directives/index.d.ts +0 -1
  148. package/directives/manual-hint/index.d.ts +1 -0
  149. package/directives/manual-hint/manual-hint-options.d.ts +7 -0
  150. package/directives/manual-hint/manual-hint.directive.d.ts +3 -1
  151. package/directives/manual-hint/taiga-ui-core-directives-manual-hint.metadata.json +1 -1
  152. package/directives/pointer-hint/index.d.ts +1 -0
  153. package/directives/pointer-hint/pointer-hint-options.d.ts +10 -0
  154. package/directives/pointer-hint/pointer-hint.directive.d.ts +5 -3
  155. package/directives/pointer-hint/taiga-ui-core-directives-pointer-hint.metadata.json +1 -1
  156. package/directives/taiga-ui-core-directives.metadata.json +1 -1
  157. package/esm2015/abstract/abstract-dropdown.js +12 -1
  158. package/esm2015/abstract/abstract-hint-options.js +6 -0
  159. package/esm2015/abstract/abstract-hint.js +7 -5
  160. package/esm2015/abstract/abstract-textfield-host.js +34 -0
  161. package/esm2015/abstract/index.js +3 -1
  162. package/esm2015/components/button/button-options.js +5 -1
  163. package/esm2015/components/button/button.component.js +3 -3
  164. package/esm2015/components/dialog/dialog.component.js +1 -1
  165. package/esm2015/components/dropdown-box/dropdown-box.component.js +1 -1
  166. package/esm2015/components/label/label.component.js +1 -1
  167. package/esm2015/components/link/link.component.js +3 -3
  168. package/esm2015/components/loader/loader.component.js +1 -1
  169. package/esm2015/components/loader/loader.directive.js +5 -2
  170. package/esm2015/components/primitive-calendar/primitive-calendar.component.js +3 -7
  171. package/esm2015/components/primitive-checkbox/checkbox-options.js +5 -1
  172. package/esm2015/components/primitive-checkbox/primitive-checkbox.component.js +3 -3
  173. package/esm2015/components/primitive-textfield/index.js +4 -1
  174. package/esm2015/components/primitive-textfield/primitive-textfield-options.js +16 -0
  175. package/esm2015/components/primitive-textfield/primitive-textfield.component.js +66 -31
  176. package/esm2015/components/primitive-textfield/primitive-textfield.directive.js +40 -0
  177. package/esm2015/components/primitive-textfield/primitive-textfield.module.js +15 -7
  178. package/esm2015/components/primitive-textfield/textfield/textfield.component.js +68 -0
  179. package/esm2015/components/primitive-textfield/value-decoration/value-decoration.component.js +12 -5
  180. package/esm2015/components/primitive-year-picker/primitive-year-picker.component.js +3 -3
  181. package/esm2015/components/root/root.component.js +11 -5
  182. package/esm2015/components/scroll-controls/scroll-controls.component.js +1 -1
  183. package/esm2015/components/theme-night/theme-night.component.js +1 -1
  184. package/esm2015/components/tooltip/tooltip.component.js +17 -10
  185. package/esm2015/components/tooltip/tooltip.module.js +3 -2
  186. package/esm2015/constants/version.js +2 -2
  187. package/esm2015/directives/described-by/described-by.providers.js +6 -6
  188. package/esm2015/directives/dropdown/dropdown.directive.js +2 -7
  189. package/esm2015/directives/hint/hint-options.js +14 -0
  190. package/esm2015/directives/hint/hint.directive.js +11 -7
  191. package/esm2015/directives/hint/index.js +2 -1
  192. package/esm2015/directives/hint-controller/hint-controller.directive.js +16 -10
  193. package/esm2015/directives/hint-controller/hint-controller.token.js +4 -3
  194. package/esm2015/directives/index.js +1 -2
  195. package/esm2015/directives/manual-hint/index.js +2 -1
  196. package/esm2015/directives/manual-hint/manual-hint-options.js +12 -0
  197. package/esm2015/directives/manual-hint/manual-hint.directive.js +9 -5
  198. package/esm2015/directives/pointer-hint/index.js +2 -1
  199. package/esm2015/directives/pointer-hint/pointer-hint-options.js +12 -0
  200. package/esm2015/directives/pointer-hint/pointer-hint.directive.js +11 -7
  201. package/esm2015/interfaces/index.js +1 -1
  202. package/esm2015/interfaces/textfield-host.js +1 -0
  203. package/esm2015/tokens/index.js +3 -1
  204. package/esm2015/tokens/textfield-host.js +3 -0
  205. package/esm2015/tokens/theme.js +5 -0
  206. package/esm2015/utils/format/format-number.js +2 -2
  207. package/esm2015/utils/mask/create-number-mask.js +2 -2
  208. package/esm2015/utils/polyfills/inner-HTML.js +3 -2
  209. package/esm5/abstract/abstract-dropdown.js +12 -1
  210. package/esm5/abstract/abstract-hint-options.js +6 -0
  211. package/esm5/abstract/abstract-hint.js +7 -5
  212. package/esm5/abstract/abstract-textfield-host.js +55 -0
  213. package/esm5/abstract/index.js +3 -1
  214. package/esm5/components/button/button-options.js +6 -1
  215. package/esm5/components/button/button.component.js +3 -3
  216. package/esm5/components/dialog/dialog.component.js +1 -1
  217. package/esm5/components/dropdown-box/dropdown-box.component.js +1 -1
  218. package/esm5/components/label/label.component.js +1 -1
  219. package/esm5/components/link/link.component.js +3 -3
  220. package/esm5/components/loader/loader.component.js +1 -1
  221. package/esm5/components/loader/loader.directive.js +5 -2
  222. package/esm5/components/primitive-calendar/primitive-calendar.component.js +3 -7
  223. package/esm5/components/primitive-checkbox/checkbox-options.js +6 -1
  224. package/esm5/components/primitive-checkbox/primitive-checkbox.component.js +3 -3
  225. package/esm5/components/primitive-textfield/index.js +4 -1
  226. package/esm5/components/primitive-textfield/primitive-textfield-options.js +17 -0
  227. package/esm5/components/primitive-textfield/primitive-textfield.component.js +70 -35
  228. package/esm5/components/primitive-textfield/primitive-textfield.directive.js +49 -0
  229. package/esm5/components/primitive-textfield/primitive-textfield.module.js +15 -7
  230. package/esm5/components/primitive-textfield/textfield/textfield.component.js +77 -0
  231. package/esm5/components/primitive-textfield/value-decoration/value-decoration.component.js +16 -5
  232. package/esm5/components/primitive-year-picker/primitive-year-picker.component.js +3 -3
  233. package/esm5/components/root/root.component.js +12 -5
  234. package/esm5/components/scroll-controls/scroll-controls.component.js +1 -1
  235. package/esm5/components/theme-night/theme-night.component.js +1 -1
  236. package/esm5/components/tooltip/tooltip.component.js +21 -10
  237. package/esm5/components/tooltip/tooltip.module.js +3 -2
  238. package/esm5/constants/version.js +2 -2
  239. package/esm5/directives/described-by/described-by.providers.js +7 -7
  240. package/esm5/directives/dropdown/dropdown.directive.js +2 -7
  241. package/esm5/directives/hint/hint-options.js +15 -0
  242. package/esm5/directives/hint/hint.directive.js +11 -7
  243. package/esm5/directives/hint/index.js +2 -1
  244. package/esm5/directives/hint-controller/hint-controller.directive.js +16 -10
  245. package/esm5/directives/hint-controller/hint-controller.token.js +4 -3
  246. package/esm5/directives/index.js +1 -2
  247. package/esm5/directives/manual-hint/index.js +2 -1
  248. package/esm5/directives/manual-hint/manual-hint-options.js +13 -0
  249. package/esm5/directives/manual-hint/manual-hint.directive.js +9 -5
  250. package/esm5/directives/pointer-hint/index.js +2 -1
  251. package/esm5/directives/pointer-hint/pointer-hint-options.js +13 -0
  252. package/esm5/directives/pointer-hint/pointer-hint.directive.js +11 -7
  253. package/esm5/interfaces/index.js +1 -1
  254. package/esm5/interfaces/textfield-host.js +1 -0
  255. package/esm5/tokens/index.js +3 -1
  256. package/esm5/tokens/textfield-host.js +3 -0
  257. package/esm5/tokens/theme.js +5 -0
  258. package/esm5/utils/format/format-number.js +2 -2
  259. package/esm5/utils/mask/create-number-mask.js +2 -2
  260. package/esm5/utils/polyfills/inner-HTML.js +3 -2
  261. package/fesm2015/taiga-ui-core-abstract.js +57 -8
  262. package/fesm2015/taiga-ui-core-abstract.js.map +1 -1
  263. package/fesm2015/taiga-ui-core-components-button.js +7 -3
  264. package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
  265. package/fesm2015/taiga-ui-core-components-dialog.js +1 -1
  266. package/fesm2015/taiga-ui-core-components-dropdown-box.js +1 -1
  267. package/fesm2015/taiga-ui-core-components-label.js +1 -1
  268. package/fesm2015/taiga-ui-core-components-link.js +2 -2
  269. package/fesm2015/taiga-ui-core-components-link.js.map +1 -1
  270. package/fesm2015/taiga-ui-core-components-loader.js +5 -2
  271. package/fesm2015/taiga-ui-core-components-loader.js.map +1 -1
  272. package/fesm2015/taiga-ui-core-components-primitive-calendar.js +2 -6
  273. package/fesm2015/taiga-ui-core-components-primitive-calendar.js.map +1 -1
  274. package/fesm2015/taiga-ui-core-components-primitive-checkbox.js +7 -3
  275. package/fesm2015/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
  276. package/fesm2015/taiga-ui-core-components-primitive-textfield.js +201 -42
  277. package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  278. package/fesm2015/taiga-ui-core-components-primitive-year-picker.js +2 -2
  279. package/fesm2015/taiga-ui-core-components-primitive-year-picker.js.map +1 -1
  280. package/fesm2015/taiga-ui-core-components-root.js +10 -5
  281. package/fesm2015/taiga-ui-core-components-root.js.map +1 -1
  282. package/fesm2015/taiga-ui-core-components-scroll-controls.js +1 -1
  283. package/fesm2015/taiga-ui-core-components-theme-night.js +1 -1
  284. package/fesm2015/taiga-ui-core-components-tooltip.js +18 -10
  285. package/fesm2015/taiga-ui-core-components-tooltip.js.map +1 -1
  286. package/fesm2015/taiga-ui-core-constants.js +1 -1
  287. package/fesm2015/taiga-ui-core-constants.js.map +1 -1
  288. package/fesm2015/taiga-ui-core-directives-described-by.js +6 -6
  289. package/fesm2015/taiga-ui-core-directives-described-by.js.map +1 -1
  290. package/fesm2015/taiga-ui-core-directives-dropdown.js +1 -6
  291. package/fesm2015/taiga-ui-core-directives-dropdown.js.map +1 -1
  292. package/fesm2015/taiga-ui-core-directives-hint-controller.js +16 -10
  293. package/fesm2015/taiga-ui-core-directives-hint-controller.js.map +1 -1
  294. package/fesm2015/taiga-ui-core-directives-hint.js +24 -9
  295. package/fesm2015/taiga-ui-core-directives-hint.js.map +1 -1
  296. package/fesm2015/taiga-ui-core-directives-manual-hint.js +20 -7
  297. package/fesm2015/taiga-ui-core-directives-manual-hint.js.map +1 -1
  298. package/fesm2015/taiga-ui-core-directives-pointer-hint.js +22 -9
  299. package/fesm2015/taiga-ui-core-directives-pointer-hint.js.map +1 -1
  300. package/fesm2015/taiga-ui-core-directives.js +0 -1
  301. package/fesm2015/taiga-ui-core-directives.js.map +1 -1
  302. package/fesm2015/taiga-ui-core-tokens.js +7 -1
  303. package/fesm2015/taiga-ui-core-tokens.js.map +1 -1
  304. package/fesm2015/taiga-ui-core-utils-format.js +1 -1
  305. package/fesm2015/taiga-ui-core-utils-format.js.map +1 -1
  306. package/fesm2015/taiga-ui-core-utils-mask.js +1 -1
  307. package/fesm2015/taiga-ui-core-utils-mask.js.map +1 -1
  308. package/fesm2015/taiga-ui-core-utils-polyfills.js +3 -1
  309. package/fesm2015/taiga-ui-core-utils-polyfills.js.map +1 -1
  310. package/fesm5/taiga-ui-core-abstract.js +78 -8
  311. package/fesm5/taiga-ui-core-abstract.js.map +1 -1
  312. package/fesm5/taiga-ui-core-components-button.js +8 -4
  313. package/fesm5/taiga-ui-core-components-button.js.map +1 -1
  314. package/fesm5/taiga-ui-core-components-dialog.js +1 -1
  315. package/fesm5/taiga-ui-core-components-dropdown-box.js +1 -1
  316. package/fesm5/taiga-ui-core-components-label.js +1 -1
  317. package/fesm5/taiga-ui-core-components-link.js +2 -2
  318. package/fesm5/taiga-ui-core-components-link.js.map +1 -1
  319. package/fesm5/taiga-ui-core-components-loader.js +5 -2
  320. package/fesm5/taiga-ui-core-components-loader.js.map +1 -1
  321. package/fesm5/taiga-ui-core-components-primitive-calendar.js +2 -6
  322. package/fesm5/taiga-ui-core-components-primitive-calendar.js.map +1 -1
  323. package/fesm5/taiga-ui-core-components-primitive-checkbox.js +8 -4
  324. package/fesm5/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
  325. package/fesm5/taiga-ui-core-components-primitive-textfield.js +228 -47
  326. package/fesm5/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  327. package/fesm5/taiga-ui-core-components-primitive-year-picker.js +2 -2
  328. package/fesm5/taiga-ui-core-components-primitive-year-picker.js.map +1 -1
  329. package/fesm5/taiga-ui-core-components-root.js +11 -5
  330. package/fesm5/taiga-ui-core-components-root.js.map +1 -1
  331. package/fesm5/taiga-ui-core-components-scroll-controls.js +1 -1
  332. package/fesm5/taiga-ui-core-components-theme-night.js +1 -1
  333. package/fesm5/taiga-ui-core-components-tooltip.js +22 -10
  334. package/fesm5/taiga-ui-core-components-tooltip.js.map +1 -1
  335. package/fesm5/taiga-ui-core-constants.js +1 -1
  336. package/fesm5/taiga-ui-core-constants.js.map +1 -1
  337. package/fesm5/taiga-ui-core-directives-described-by.js +7 -7
  338. package/fesm5/taiga-ui-core-directives-described-by.js.map +1 -1
  339. package/fesm5/taiga-ui-core-directives-dropdown.js +1 -6
  340. package/fesm5/taiga-ui-core-directives-dropdown.js.map +1 -1
  341. package/fesm5/taiga-ui-core-directives-hint-controller.js +16 -10
  342. package/fesm5/taiga-ui-core-directives-hint-controller.js.map +1 -1
  343. package/fesm5/taiga-ui-core-directives-hint.js +25 -10
  344. package/fesm5/taiga-ui-core-directives-hint.js.map +1 -1
  345. package/fesm5/taiga-ui-core-directives-manual-hint.js +21 -8
  346. package/fesm5/taiga-ui-core-directives-manual-hint.js.map +1 -1
  347. package/fesm5/taiga-ui-core-directives-pointer-hint.js +23 -10
  348. package/fesm5/taiga-ui-core-directives-pointer-hint.js.map +1 -1
  349. package/fesm5/taiga-ui-core-directives.js +0 -1
  350. package/fesm5/taiga-ui-core-directives.js.map +1 -1
  351. package/fesm5/taiga-ui-core-tokens.js +7 -1
  352. package/fesm5/taiga-ui-core-tokens.js.map +1 -1
  353. package/fesm5/taiga-ui-core-utils-format.js +1 -1
  354. package/fesm5/taiga-ui-core-utils-format.js.map +1 -1
  355. package/fesm5/taiga-ui-core-utils-mask.js +1 -1
  356. package/fesm5/taiga-ui-core-utils-mask.js.map +1 -1
  357. package/fesm5/taiga-ui-core-utils-polyfills.js +3 -1
  358. package/fesm5/taiga-ui-core-utils-polyfills.js.map +1 -1
  359. package/interfaces/index.d.ts +1 -0
  360. package/interfaces/taiga-ui-core-interfaces.metadata.json +1 -1
  361. package/interfaces/textfield-host.d.ts +9 -0
  362. package/package.json +7 -6
  363. package/styles/markup/tui-form-old.less +13 -11
  364. package/styles/markup/tui-form.less +12 -15
  365. package/styles/markup/tui-island.less +1 -0
  366. package/styles/mixins/picker.less +10 -10
  367. package/styles/mixins/picker.scss +10 -10
  368. package/styles/mixins/textfield.less +48 -28
  369. package/styles/mixins/textfield.scss +21 -30
  370. package/styles/theme/variables.less +3 -0
  371. package/tokens/index.d.ts +2 -0
  372. package/tokens/taiga-ui-core-tokens.metadata.json +1 -1
  373. package/tokens/textfield-host.d.ts +3 -0
  374. package/tokens/theme.d.ts +2 -0
  375. package/bundles/taiga-ui-core-directives-border.umd.js +0 -291
  376. package/bundles/taiga-ui-core-directives-border.umd.js.map +0 -1
  377. package/bundles/taiga-ui-core-directives-border.umd.min.js +0 -16
  378. package/bundles/taiga-ui-core-directives-border.umd.min.js.map +0 -1
  379. package/directives/border/border.directive.d.ts +0 -9
  380. package/directives/border/border.module.d.ts +0 -2
  381. package/directives/border/index.d.ts +0 -2
  382. package/directives/border/package.json +0 -13
  383. package/directives/border/taiga-ui-core-directives-border.d.ts +0 -4
  384. package/directives/border/taiga-ui-core-directives-border.metadata.json +0 -1
  385. package/esm2015/directives/border/border.directive.js +0 -42
  386. package/esm2015/directives/border/border.module.js +0 -13
  387. package/esm2015/directives/border/index.js +0 -3
  388. package/esm2015/directives/border/taiga-ui-core-directives-border.js +0 -5
  389. package/esm5/directives/border/border.directive.js +0 -51
  390. package/esm5/directives/border/border.module.js +0 -16
  391. package/esm5/directives/border/index.js +0 -3
  392. package/esm5/directives/border/taiga-ui-core-directives-border.js +0 -5
  393. package/fesm2015/taiga-ui-core-directives-border.js +0 -57
  394. package/fesm2015/taiga-ui-core-directives-border.js.map +0 -1
  395. package/fesm5/taiga-ui-core-directives-border.js +0 -69
  396. package/fesm5/taiga-ui-core-directives-border.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-utils-mask.js","sources":["ng://@taiga-ui/core/utils/mask/create-auto-corrected-money-pipe.ts","ng://@taiga-ui/core/utils/mask/create-correction-mask.ts","ng://@taiga-ui/core/utils/mask/create-number-mask.ts","ng://@taiga-ui/core/utils/mask/masked-money-value-is-empty.ts","ng://@taiga-ui/core/utils/mask/masked-number-string-to-number.ts","ng://@taiga-ui/core/utils/mask/taiga-ui-core-utils-mask.ts"],"sourcesContent":["import {\n CHAR_NO_BREAK_SPACE,\n getDocumentOrShadowRoot,\n isNativeFocused,\n isSafari,\n tuiAssert,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * Used to finish a number with zeros to a given precision\n */\nexport function tuiCreateAutoCorrectedNumberPipe(\n decimalLimit: number = 0,\n decimalSymbol: TuiDecimalSymbol = ',',\n thousandSymbol: string = CHAR_NO_BREAK_SPACE,\n nativeInput?: HTMLInputElement,\n allowNegative?: boolean,\n): TuiTextMaskPipeHandler {\n tuiAssert.assert(Number.isInteger(decimalLimit));\n tuiAssert.assert(decimalLimit >= 0);\n\n // Guess for which browser I need this :)\n let previousCaret = -1;\n\n const unlucky = !!nativeInput && isSafari(nativeInput);\n\n if (nativeInput && unlucky) {\n nativeInput.addEventListener('beforeinput', () => {\n previousCaret = nativeInput.selectionStart || 0;\n });\n }\n\n return (conformedValue, config) => {\n // Removing everything by selecting and pressing '-'\n if (!conformedValue && config.rawValue === '-' && allowNegative) {\n return '-';\n }\n\n // remove these hacks after text mask library has changed\n if (nativeInput && unlucky && isNativeFocused(nativeInput)) {\n const caret = calculateSafariCaret(\n config.previousConformedValue,\n conformedValue,\n previousCaret,\n );\n\n setTimeout(() => {\n nativeInput.setSelectionRange(caret, caret);\n });\n }\n\n if (\n nativeInput &&\n nativeInput.ownerDocument !== getDocumentOrShadowRoot(nativeInput) &&\n isNativeFocused(nativeInput) &&\n config.currentCaretPosition\n ) {\n const realCaretPosition =\n config.currentCaretPosition +\n calculateCaretGap(\n config.previousConformedValue,\n conformedValue,\n thousandSymbol,\n );\n\n setTimeout(() => {\n nativeInput.setSelectionRange(realCaretPosition, realCaretPosition);\n });\n }\n\n if (conformedValue === '' || !decimalLimit) {\n return {value: conformedValue};\n }\n\n const withDecimalSymbol = addDecimalSymbolIfNeeded(conformedValue, decimalSymbol);\n const decimalPart = withDecimalSymbol.split(decimalSymbol)[1];\n const zeroPaddingSize = decimalLimit - decimalPart.length;\n\n return {\n value: withDecimalSymbol + '0'.repeat(zeroPaddingSize),\n };\n };\n}\n\nfunction addDecimalSymbolIfNeeded(\n value: string,\n decimalSymbol: TuiDecimalSymbol = ',',\n): string {\n return value.indexOf(decimalSymbol) === -1 ? value + decimalSymbol : value;\n}\n\nfunction calculateSafariCaret(\n previousValue: string = '',\n current: string,\n previousCaret: number,\n decimalSymbol: string = ',',\n): number {\n const tailRegex = new RegExp(`${decimalSymbol}.+`);\n const previousWithoutTail = previousValue.replace(tailRegex, '');\n const currentWithoutTail = current.replace(tailRegex, '');\n\n const pasteOrCutOperation =\n Math.abs(previousWithoutTail.length - currentWithoutTail.length) > 2;\n\n if (pasteOrCutOperation) {\n return current.length;\n }\n\n if (previousValue.length === current.length) {\n if (previousValue.indexOf(decimalSymbol) <= previousCaret) {\n return calculateChangedTailIndex(previousValue, current);\n }\n\n return previousWithoutTail === currentWithoutTail\n ? previousCaret - 1\n : previousCaret + 1;\n }\n\n if (previousValue.length === 0) {\n return 1;\n }\n\n const changeLength = current.length - previousValue.length;\n\n return previousCaret + changeLength;\n}\n\nfunction calculateChangedTailIndex(previous: string, current: string): number {\n for (let i = 0; i < current.length; i++) {\n if (previous[i] !== current[i]) {\n return current[i] === '0' ? i : i + 1;\n }\n }\n\n return current.length;\n}\n\nfunction calculateCaretGap(\n previousValue: string = '',\n current: string,\n thousandSymbol: string,\n): number {\n const pasteOrCutOperation = Math.abs(previousValue.length - current.length) > 2;\n\n if (pasteOrCutOperation) {\n return 0;\n }\n\n const wereSpaces = previousValue.split(thousandSymbol).length;\n const nowSpaces = current.split(thousandSymbol).length;\n\n return nowSpaces - wereSpaces;\n}\n","import {tuiAssert} from '@taiga-ui/cdk';\nimport {MASK_CARET_TRAP} from '@taiga-ui/core/constants';\nimport {\n TuiTextMaskCorrectionHandler,\n TuiTextMaskList,\n TuiTextMaskListHandler,\n} from '@taiga-ui/core/mask';\n\nconst ASSERTION = 'Correction function must return single char or null';\n\nexport function tuiCreateCorrectionMask(\n allowed: RegExp,\n correctionHandler: TuiTextMaskCorrectionHandler,\n): TuiTextMaskListHandler {\n return rawValue => {\n const mask = rawValue.split('').reduce<TuiTextMaskList>((result, char, index) => {\n const corrected = correctionHandler(char, index);\n\n tuiAssert.assert(corrected === null || corrected.length === 1, ASSERTION);\n\n if (!allowed.test(char) && !corrected) {\n return result;\n }\n\n if (allowed.test(char)) {\n return [...result, allowed];\n }\n\n if (corrected) {\n return [...result, corrected, MASK_CARET_TRAP];\n }\n\n return result;\n }, []);\n const lastIndex = mask.lastIndexOf(MASK_CARET_TRAP);\n const filtered = mask.filter(\n (item, index) => item !== MASK_CARET_TRAP || index === lastIndex,\n );\n\n return filtered.some(item => item !== allowed)\n ? [...filtered, allowed]\n : filtered;\n };\n}\n","import {CHAR_EN_DASH, CHAR_NO_BREAK_SPACE, tuiAssert} from '@taiga-ui/cdk';\nimport {\n MASK_CARET_TRAP,\n TUI_DIGIT_REGEXP,\n TUI_LEADING_ZEROES_REGEXP,\n TUI_NON_DIGITS_REGEXP,\n} from '@taiga-ui/core/constants';\nimport {TuiNumberMaskOptions, TuiTextMaskListHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\nimport {otherDecimalSymbol} from '@taiga-ui/core/utils/format';\n\nconst NON_ZERO_DIGIT = /[1-9]/;\n\n/**\n * Adaptation for {@link https://github.com/text-mask/text-mask/tree/master/addons#createnumbermask `createNumberMask`}\n * @todo TODO: autocCorrectDecimalSymbol is no longer needed. Remove it in 3.0\n */\nexport function tuiCreateNumberMask({\n allowDecimal = false,\n decimalSymbol = ',',\n thousandSymbol = CHAR_NO_BREAK_SPACE,\n autoCorrectDecimalSymbol = true,\n decimalLimit = 2,\n requireDecimal = false,\n allowNegative = false,\n integerLimit = 0,\n}: TuiNumberMaskOptions = {}): TuiTextMaskListHandler {\n tuiAssert.assert(Number.isInteger(decimalLimit));\n tuiAssert.assert(decimalLimit > 0);\n tuiAssert.assert(Number.isInteger(integerLimit));\n tuiAssert.assert(integerLimit >= 0);\n\n return (rawValue, {previousConformedValue}) => {\n if (previousConformedValue && requireDecimal) {\n const conformedWithoutSeparator = rawValue.split(thousandSymbol).join('');\n const previousConformedValueWithoutDecimalSymbolAndSeparator =\n previousConformedValue\n .split(thousandSymbol)\n .join('')\n .split(decimalSymbol)\n .join('');\n\n // Forbid removal of decimal separator if decimal part is required\n if (\n conformedWithoutSeparator ===\n previousConformedValueWithoutDecimalSymbolAndSeparator\n ) {\n rawValue = previousConformedValue;\n }\n }\n\n const isNegative =\n (rawValue[0] === '-' || rawValue[0] === CHAR_EN_DASH) && allowNegative;\n\n if (\n isDecimalSymbol(rawValue, decimalSymbol, autoCorrectDecimalSymbol) &&\n allowDecimal\n ) {\n return ['0', decimalSymbol, TUI_DIGIT_REGEXP];\n }\n\n if (isNegative) {\n rawValue = rawValue.substr(1);\n }\n\n const decimalIndex = getDecimalSymbolIndex(\n rawValue,\n decimalSymbol,\n autoCorrectDecimalSymbol,\n );\n const hasDecimal = decimalIndex !== -1;\n const integer = hasDecimal ? rawValue.slice(0, decimalIndex) : rawValue;\n const thousandSeparators = integer.match(new RegExp(thousandSymbol, 'g')) || [];\n const integerCapped = integerLimit\n ? integer.slice(0, integerLimit + thousandSeparators.length)\n : integer;\n const integerCappedClean = integerCapped.replace(TUI_NON_DIGITS_REGEXP, '');\n const [leadingZerosMatch] = integerCappedClean.match(\n TUI_LEADING_ZEROES_REGEXP,\n ) || [''];\n const leadingZerosAmount = leadingZerosMatch.length;\n const integerCappedZerosClean = integerCappedClean\n .replace(/^0+(?!\\.|$)/, '')\n .trim();\n const withSeparator = addThousandsSeparator(\n integerCappedZerosClean,\n thousandSymbol,\n );\n const mask = convertToMask(withSeparator);\n\n if ((hasDecimal && allowDecimal) || requireDecimal) {\n const fraction = hasDecimal\n ? convertToMask(\n rawValue.slice(decimalIndex + 1).replace(TUI_NON_DIGITS_REGEXP, ''),\n )\n : [];\n const fractionCapped = decimalLimit\n ? fraction.slice(0, decimalLimit)\n : fraction;\n\n if (rawValue[decimalIndex] !== otherDecimalSymbol(decimalSymbol)) {\n mask.push(MASK_CARET_TRAP);\n }\n\n mask.push(decimalSymbol, MASK_CARET_TRAP, ...fractionCapped);\n\n for (let i = 0; i < decimalLimit - fractionCapped.length; i++) {\n mask.push(TUI_DIGIT_REGEXP);\n }\n }\n\n const isOnlyZeroDigit = mask.length === 1 && integerCappedZerosClean === '0';\n\n if (isNegative) {\n if (mask.length === 0) {\n mask.push(TUI_DIGIT_REGEXP);\n }\n\n mask.unshift('-');\n }\n\n return preventLeadingZeroes(mask, isOnlyZeroDigit, leadingZerosAmount);\n };\n}\n\nfunction preventLeadingZeroes(\n mask: Array<string | RegExp>,\n isOnlyZeroDigit: boolean = false,\n leadingZerosAmount: number = 0,\n): Array<string | RegExp> {\n if (isOnlyZeroDigit || leadingZerosAmount === 0) {\n return mask;\n }\n\n const firstDigitIndex = mask.indexOf(TUI_DIGIT_REGEXP);\n\n if (firstDigitIndex === -1) {\n return mask;\n }\n\n const secondMaskDigit = mask[firstDigitIndex + 1];\n const isCaretTrap = secondMaskDigit === MASK_CARET_TRAP;\n\n if (isCaretTrap && leadingZerosAmount === 1) {\n return mask;\n } else if (isCaretTrap) {\n mask.unshift(NON_ZERO_DIGIT);\n\n return mask;\n }\n\n mask[firstDigitIndex] = NON_ZERO_DIGIT;\n\n return mask;\n}\n\nfunction getDecimalSymbolIndex(\n str: string,\n decimalSymbol: TuiDecimalSymbol,\n autoCorrectDecimalSymbol: boolean,\n): number {\n if (!autoCorrectDecimalSymbol) {\n return str.lastIndexOf(decimalSymbol);\n }\n\n return Math.max(\n str.lastIndexOf(decimalSymbol),\n str.lastIndexOf(otherDecimalSymbol(decimalSymbol)),\n );\n}\n\nfunction isDecimalSymbol(\n str: string,\n decimalSymbol: TuiDecimalSymbol,\n autoCorrectDecimalSymbol: boolean,\n): boolean {\n if (autoCorrectDecimalSymbol) {\n return /^[,.]$/.test(str);\n }\n\n return str === decimalSymbol;\n}\n\nfunction convertToMask(strNumber: string): Array<string | RegExp> {\n return strNumber\n .split('')\n .map(char => (TUI_DIGIT_REGEXP.test(char) ? TUI_DIGIT_REGEXP : char));\n}\n\nfunction addThousandsSeparator(strNumber: string, thousandSymbol: string): string {\n return strNumber.length > 3\n ? strNumber.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandSymbol)\n : strNumber;\n}\n","export function maskedMoneyValueIsEmpty(value: string): boolean {\n switch (value) {\n case '':\n case '-':\n case ',':\n case '-,':\n return true;\n default:\n return false;\n }\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\nexport function maskedNumberStringToNumber(\n value: string,\n decimalsSymbol: TuiDecimalSymbol,\n thousandSymbol: string,\n): number {\n return parseFloat(\n value.split(thousandSymbol).join('').split(decimalsSymbol).join('.'),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAUA;;;SAGgB,gCAAgC,CAC5C,YAAwB,EACxB,aAAqC,EACrC,cAA4C,EAC5C,WAA8B,EAC9B,aAAuB;IAJvB,6BAAA,EAAA,gBAAwB;IACxB,8BAAA,EAAA,mBAAqC;IACrC,+BAAA,EAAA,oCAA4C;IAI5C,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IACjD,SAAS,CAAC,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC;;IAGpC,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC;IAEvB,IAAM,OAAO,GAAG,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEvD,IAAI,WAAW,IAAI,O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C,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACvE,CAAC;AACN;;ACVA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-utils-mask.js","sources":["ng://@taiga-ui/core/utils/mask/create-auto-corrected-money-pipe.ts","ng://@taiga-ui/core/utils/mask/create-correction-mask.ts","ng://@taiga-ui/core/utils/mask/create-number-mask.ts","ng://@taiga-ui/core/utils/mask/masked-money-value-is-empty.ts","ng://@taiga-ui/core/utils/mask/masked-number-string-to-number.ts","ng://@taiga-ui/core/utils/mask/taiga-ui-core-utils-mask.ts"],"sourcesContent":["import {\n CHAR_NO_BREAK_SPACE,\n getDocumentOrShadowRoot,\n isNativeFocused,\n isSafari,\n tuiAssert,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * Used to finish a number with zeros to a given precision\n */\nexport function tuiCreateAutoCorrectedNumberPipe(\n decimalLimit: number = 0,\n decimalSymbol: TuiDecimalSymbol = ',',\n thousandSymbol: string = CHAR_NO_BREAK_SPACE,\n nativeInput?: HTMLInputElement,\n allowNegative?: boolean,\n): TuiTextMaskPipeHandler {\n tuiAssert.assert(Number.isInteger(decimalLimit));\n tuiAssert.assert(decimalLimit >= 0);\n\n // Guess for which browser I need this :)\n let previousCaret = -1;\n\n const unlucky = !!nativeInput && isSafari(nativeInput);\n\n if (nativeInput && unlucky) {\n nativeInput.addEventListener('beforeinput', () => {\n previousCaret = nativeInput.selectionStart || 0;\n });\n }\n\n return (conformedValue, config) => {\n // Removing everything by selecting and pressing '-'\n if (!conformedValue && config.rawValue === '-' && allowNegative) {\n return '-';\n }\n\n // remove these hacks after text mask library has changed\n if (nativeInput && unlucky && isNativeFocused(nativeInput)) {\n const caret = calculateSafariCaret(\n config.previousConformedValue,\n conformedValue,\n previousCaret,\n );\n\n setTimeout(() => {\n nativeInput.setSelectionRange(caret, caret);\n });\n }\n\n if (\n nativeInput &&\n nativeInput.ownerDocument !== getDocumentOrShadowRoot(nativeInput) &&\n isNativeFocused(nativeInput) &&\n config.currentCaretPosition\n ) {\n const realCaretPosition =\n config.currentCaretPosition +\n calculateCaretGap(\n config.previousConformedValue,\n conformedValue,\n thousandSymbol,\n );\n\n setTimeout(() => {\n nativeInput.setSelectionRange(realCaretPosition, realCaretPosition);\n });\n }\n\n if (conformedValue === '' || !decimalLimit) {\n return {value: conformedValue};\n }\n\n const withDecimalSymbol = addDecimalSymbolIfNeeded(conformedValue, decimalSymbol);\n const decimalPart = withDecimalSymbol.split(decimalSymbol)[1];\n const zeroPaddingSize = decimalLimit - decimalPart.length;\n\n return {\n value: withDecimalSymbol + '0'.repeat(zeroPaddingSize),\n };\n };\n}\n\nfunction addDecimalSymbolIfNeeded(\n value: string,\n decimalSymbol: TuiDecimalSymbol = ',',\n): string {\n return value.indexOf(decimalSymbol) === -1 ? value + decimalSymbol : value;\n}\n\nfunction calculateSafariCaret(\n previousValue: string = '',\n current: string,\n previousCaret: number,\n decimalSymbol: string = ',',\n): number {\n const tailRegex = new RegExp(`${decimalSymbol}.+`);\n const previousWithoutTail = previousValue.replace(tailRegex, '');\n const currentWithoutTail = current.replace(tailRegex, '');\n\n const pasteOrCutOperation =\n Math.abs(previousWithoutTail.length - currentWithoutTail.length) > 2;\n\n if (pasteOrCutOperation) {\n return current.length;\n }\n\n if (previousValue.length === current.length) {\n if (previousValue.indexOf(decimalSymbol) <= previousCaret) {\n return calculateChangedTailIndex(previousValue, current);\n }\n\n return previousWithoutTail === currentWithoutTail\n ? previousCaret - 1\n : previousCaret + 1;\n }\n\n if (previousValue.length === 0) {\n return 1;\n }\n\n const changeLength = current.length - previousValue.length;\n\n return previousCaret + changeLength;\n}\n\nfunction calculateChangedTailIndex(previous: string, current: string): number {\n for (let i = 0; i < current.length; i++) {\n if (previous[i] !== current[i]) {\n return current[i] === '0' ? i : i + 1;\n }\n }\n\n return current.length;\n}\n\nfunction calculateCaretGap(\n previousValue: string = '',\n current: string,\n thousandSymbol: string,\n): number {\n const pasteOrCutOperation = Math.abs(previousValue.length - current.length) > 2;\n\n if (pasteOrCutOperation) {\n return 0;\n }\n\n const wereSpaces = previousValue.split(thousandSymbol).length;\n const nowSpaces = current.split(thousandSymbol).length;\n\n return nowSpaces - wereSpaces;\n}\n","import {tuiAssert} from '@taiga-ui/cdk';\nimport {MASK_CARET_TRAP} from '@taiga-ui/core/constants';\nimport {\n TuiTextMaskCorrectionHandler,\n TuiTextMaskList,\n TuiTextMaskListHandler,\n} from '@taiga-ui/core/mask';\n\nconst ASSERTION = 'Correction function must return single char or null';\n\nexport function tuiCreateCorrectionMask(\n allowed: RegExp,\n correctionHandler: TuiTextMaskCorrectionHandler,\n): TuiTextMaskListHandler {\n return rawValue => {\n const mask = rawValue.split('').reduce<TuiTextMaskList>((result, char, index) => {\n const corrected = correctionHandler(char, index);\n\n tuiAssert.assert(corrected === null || corrected.length === 1, ASSERTION);\n\n if (!allowed.test(char) && !corrected) {\n return result;\n }\n\n if (allowed.test(char)) {\n return [...result, allowed];\n }\n\n if (corrected) {\n return [...result, corrected, MASK_CARET_TRAP];\n }\n\n return result;\n }, []);\n const lastIndex = mask.lastIndexOf(MASK_CARET_TRAP);\n const filtered = mask.filter(\n (item, index) => item !== MASK_CARET_TRAP || index === lastIndex,\n );\n\n return filtered.some(item => item !== allowed)\n ? [...filtered, allowed]\n : filtered;\n };\n}\n","import {CHAR_EN_DASH, CHAR_NO_BREAK_SPACE, tuiAssert} from '@taiga-ui/cdk';\nimport {\n MASK_CARET_TRAP,\n TUI_DIGIT_REGEXP,\n TUI_LEADING_ZEROES_REGEXP,\n TUI_NON_DIGITS_REGEXP,\n} from '@taiga-ui/core/constants';\nimport {TuiNumberMaskOptions, TuiTextMaskListHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\nimport {otherDecimalSymbol} from '@taiga-ui/core/utils/format';\n\nconst NON_ZERO_DIGIT = /[1-9]/;\n\n/**\n * Adaptation for {@link https://github.com/text-mask/text-mask/tree/master/addons#createnumbermask `createNumberMask`}\n * @todo TODO: autocCorrectDecimalSymbol is no longer needed. Remove it in 3.0\n */\nexport function tuiCreateNumberMask({\n allowDecimal = false,\n decimalSymbol = ',',\n thousandSymbol = CHAR_NO_BREAK_SPACE,\n autoCorrectDecimalSymbol = true,\n decimalLimit = 2,\n requireDecimal = false,\n allowNegative = false,\n integerLimit = 0,\n}: TuiNumberMaskOptions = {}): TuiTextMaskListHandler {\n tuiAssert.assert(Number.isInteger(decimalLimit));\n tuiAssert.assert(decimalLimit >= 0);\n tuiAssert.assert(Number.isInteger(integerLimit));\n tuiAssert.assert(integerLimit >= 0);\n\n return (rawValue, {previousConformedValue}) => {\n if (previousConformedValue && requireDecimal) {\n const conformedWithoutSeparator = rawValue.split(thousandSymbol).join('');\n const previousConformedValueWithoutDecimalSymbolAndSeparator =\n previousConformedValue\n .split(thousandSymbol)\n .join('')\n .split(decimalSymbol)\n .join('');\n\n // Forbid removal of decimal separator if decimal part is required\n if (\n conformedWithoutSeparator ===\n previousConformedValueWithoutDecimalSymbolAndSeparator\n ) {\n rawValue = previousConformedValue;\n }\n }\n\n const isNegative =\n (rawValue[0] === '-' || rawValue[0] === CHAR_EN_DASH) && allowNegative;\n\n if (\n isDecimalSymbol(rawValue, decimalSymbol, autoCorrectDecimalSymbol) &&\n allowDecimal\n ) {\n return ['0', decimalSymbol, TUI_DIGIT_REGEXP];\n }\n\n if (isNegative) {\n rawValue = rawValue.substr(1);\n }\n\n const decimalIndex = getDecimalSymbolIndex(\n rawValue,\n decimalSymbol,\n autoCorrectDecimalSymbol,\n );\n const hasDecimal = decimalIndex !== -1;\n const integer = hasDecimal ? rawValue.slice(0, decimalIndex) : rawValue;\n const thousandSeparators = integer.match(new RegExp(thousandSymbol, 'g')) || [];\n const integerCapped = integerLimit\n ? integer.slice(0, integerLimit + thousandSeparators.length)\n : integer;\n const integerCappedClean = integerCapped.replace(TUI_NON_DIGITS_REGEXP, '');\n const [leadingZerosMatch] = integerCappedClean.match(\n TUI_LEADING_ZEROES_REGEXP,\n ) || [''];\n const leadingZerosAmount = leadingZerosMatch.length;\n const integerCappedZerosClean = integerCappedClean\n .replace(/^0+(?!\\.|$)/, '')\n .trim();\n const withSeparator = addThousandsSeparator(\n integerCappedZerosClean,\n thousandSymbol,\n );\n const mask = convertToMask(withSeparator);\n\n if ((hasDecimal && allowDecimal) || requireDecimal) {\n const fraction = hasDecimal\n ? convertToMask(\n rawValue.slice(decimalIndex + 1).replace(TUI_NON_DIGITS_REGEXP, ''),\n )\n : [];\n const fractionCapped = decimalLimit\n ? fraction.slice(0, decimalLimit)\n : fraction;\n\n if (rawValue[decimalIndex] !== otherDecimalSymbol(decimalSymbol)) {\n mask.push(MASK_CARET_TRAP);\n }\n\n mask.push(decimalSymbol, MASK_CARET_TRAP, ...fractionCapped);\n\n for (let i = 0; i < decimalLimit - fractionCapped.length; i++) {\n mask.push(TUI_DIGIT_REGEXP);\n }\n }\n\n const isOnlyZeroDigit = mask.length === 1 && integerCappedZerosClean === '0';\n\n if (isNegative) {\n if (mask.length === 0) {\n mask.push(TUI_DIGIT_REGEXP);\n }\n\n mask.unshift('-');\n }\n\n return preventLeadingZeroes(mask, isOnlyZeroDigit, leadingZerosAmount);\n };\n}\n\nfunction preventLeadingZeroes(\n mask: Array<string | RegExp>,\n isOnlyZeroDigit: boolean = false,\n leadingZerosAmount: number = 0,\n): Array<string | RegExp> {\n if (isOnlyZeroDigit || leadingZerosAmount === 0) {\n return mask;\n }\n\n const firstDigitIndex = mask.indexOf(TUI_DIGIT_REGEXP);\n\n if (firstDigitIndex === -1) {\n return mask;\n }\n\n const secondMaskDigit = mask[firstDigitIndex + 1];\n const isCaretTrap = secondMaskDigit === MASK_CARET_TRAP;\n\n if (isCaretTrap && leadingZerosAmount === 1) {\n return mask;\n } else if (isCaretTrap) {\n mask.unshift(NON_ZERO_DIGIT);\n\n return mask;\n }\n\n mask[firstDigitIndex] = NON_ZERO_DIGIT;\n\n return mask;\n}\n\nfunction getDecimalSymbolIndex(\n str: string,\n decimalSymbol: TuiDecimalSymbol,\n autoCorrectDecimalSymbol: boolean,\n): number {\n if (!autoCorrectDecimalSymbol) {\n return str.lastIndexOf(decimalSymbol);\n }\n\n return Math.max(\n str.lastIndexOf(decimalSymbol),\n str.lastIndexOf(otherDecimalSymbol(decimalSymbol)),\n );\n}\n\nfunction isDecimalSymbol(\n str: string,\n decimalSymbol: TuiDecimalSymbol,\n autoCorrectDecimalSymbol: boolean,\n): boolean {\n if (autoCorrectDecimalSymbol) {\n return /^[,.]$/.test(str);\n }\n\n return str === decimalSymbol;\n}\n\nfunction convertToMask(strNumber: string): Array<string | RegExp> {\n return strNumber\n .split('')\n .map(char => (TUI_DIGIT_REGEXP.test(char) ? TUI_DIGIT_REGEXP : char));\n}\n\nfunction addThousandsSeparator(strNumber: string, thousandSymbol: string): string {\n return strNumber.length > 3\n ? strNumber.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandSymbol)\n : strNumber;\n}\n","export function maskedMoneyValueIsEmpty(value: string): boolean {\n switch (value) {\n case '':\n case '-':\n case ',':\n case '-,':\n return true;\n default:\n return false;\n }\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\nexport function maskedNumberStringToNumber(\n value: string,\n decimalsSymbol: TuiDecimalSymbol,\n thousandSymbol: string,\n): number {\n return parseFloat(\n value.split(thousandSymbol).join('').split(decimalsSymbol).join('.'),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAUA;;;SAGgB,gCAAgC,CAC5C,YAAwB,EACxB,aAAqC,EACrC,cAA4C,EAC5C,WAA8B,EAC9B,aAAuB;IAJvB,6BAAA,EAAA,gBAAwB;IACxB,8BAAA,EAAA,mBAAqC;IACrC,+BAAA,EAAA,oCAA4C;IAI5C,SAAS,CAAC,MAAM,CAAC,MAAM,C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C;QACT,KAAK,GAAG,CAAC;QACT,KAAK,IAAI;YACL,OAAO,IAAI,CAAC;QAChB;YACI,OAAO,KAAK,CAAC;KACpB;AACL;;SCRgB,0BAA0B,CACtC,KAAa,EACb,cAAgC,EAChC,cAAsB;IAEtB,OAAO,UAAU,CACb,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACvE,CAAC;AACN;;ACVA;;;;;;"}
@@ -1,3 +1,5 @@
1
+ import { TuiXmlParsingException } from '@taiga-ui/cdk';
2
+
1
3
  /**
2
4
  * @internal
3
5
  */
@@ -29,7 +31,7 @@ function innerHTML(documentRef) {
29
31
  }
30
32
  }
31
33
  catch (e) {
32
- throw new Error('Error parsing XML string');
34
+ throw new TuiXmlParsingException();
33
35
  }
34
36
  },
35
37
  });
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-utils-polyfills.js","sources":["ng://@taiga-ui/core/utils/polyfills/inner-HTML.ts","ng://@taiga-ui/core/utils/polyfills/taiga-ui-core-utils-polyfills.ts"],"sourcesContent":["/**\n * @internal\n */\nexport function innerHTML(documentRef: Document): void {\n const svg = documentRef.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n if (svg.innerHTML !== undefined) {\n return;\n }\n\n const serializer = new XMLSerializer();\n const parser = new DOMParser();\n\n Object.defineProperty(SVGElement.prototype, 'innerHTML', {\n get: function (this: SVGElement) {\n const result: string[] = [];\n let childNode: any = this.firstChild;\n\n while (childNode) {\n result.push(serializer.serializeToString(childNode));\n childNode = childNode.nextSibling;\n }\n\n return result.join('');\n },\n set: function (this: SVGElement, text: string) {\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n\n try {\n const svgDocElement = parser.parseFromString(\n text,\n 'image/svg+xml',\n ).documentElement;\n\n if (this.ownerDocument) {\n this.appendChild(this.ownerDocument.importNode(svgDocElement, true));\n }\n } catch (e) {\n throw new Error('Error parsing XML string');\n }\n },\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;SAGgB,SAAS,CAAC,WAAqB;IAC3C,IAAM,GAAG,GAAG,WAAW,CAAC,eAAe,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IAE7E,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS,EAAE;QAC7B,OAAO;KACV;IAED,IAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;IACvC,IAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;IAE/B,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE;QACrD,GAAG,EAAE;YACD,IAAM,MAAM,GAAa,EAAE,CAAC;YAC5B,IAAI,SAAS,GAAQ,IAAI,CAAC,UAAU,CAAC;YAErC,OAAO,SAAS,EAAE;gBACd,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;gBACrD,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC;aACrC;YAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC1B;QACD,GAAG,EAAE,UAA4B,IAAY;YACzC,OAAO,IAAI,CAAC,UAAU,EAAE;gBACpB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aACrC;YAED,IAAI;gBACA,IAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CACxC,IAAI,EACJ,eAAe,CAClB,CAAC,eAAe,CAAC;gBAElB,IAAI,IAAI,CAAC,aAAa,EAAE;oBACpB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;iBACxE;aACJ;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;aAC/C;SACJ;KACJ,CAAC,CAAC;AACP;;AC5CA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-utils-polyfills.js","sources":["ng://@taiga-ui/core/utils/polyfills/inner-HTML.ts","ng://@taiga-ui/core/utils/polyfills/taiga-ui-core-utils-polyfills.ts"],"sourcesContent":["import {TuiXmlParsingException} from '@taiga-ui/cdk';\n\n/**\n * @internal\n */\nexport function innerHTML(documentRef: Document): void {\n const svg = documentRef.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n if (svg.innerHTML !== undefined) {\n return;\n }\n\n const serializer = new XMLSerializer();\n const parser = new DOMParser();\n\n Object.defineProperty(SVGElement.prototype, 'innerHTML', {\n get: function (this: SVGElement) {\n const result: string[] = [];\n let childNode: any = this.firstChild;\n\n while (childNode) {\n result.push(serializer.serializeToString(childNode));\n childNode = childNode.nextSibling;\n }\n\n return result.join('');\n },\n set: function (this: SVGElement, text: string) {\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n\n try {\n const svgDocElement = parser.parseFromString(\n text,\n 'image/svg+xml',\n ).documentElement;\n\n if (this.ownerDocument) {\n this.appendChild(this.ownerDocument.importNode(svgDocElement, true));\n }\n } catch (e) {\n throw new TuiXmlParsingException();\n }\n },\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA;;;SAGgB,SAAS,CAAC,WAAqB;IAC3C,IAAM,GAAG,GAAG,WAAW,CAAC,eAAe,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IAE7E,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS,EAAE;QAC7B,OAAO;KACV;IAED,IAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;IACvC,IAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;IAE/B,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE;QACrD,GAAG,EAAE;YACD,IAAM,MAAM,GAAa,EAAE,CAAC;YAC5B,IAAI,SAAS,GAAQ,IAAI,CAAC,UAAU,CAAC;YAErC,OAAO,SAAS,EAAE;gBACd,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;gBACrD,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC;aACrC;YAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC1B;QACD,GAAG,EAAE,UAA4B,IAAY;YACzC,OAAO,IAAI,CAAC,UAAU,EAAE;gBACpB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aACrC;YAED,IAAI;gBACA,IAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CACxC,IAAI,EACJ,eAAe,CAClB,CAAC,eAAe,CAAC;gBAElB,IAAI,IAAI,CAAC,aAAa,EAAE;oBACpB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;iBACxE;aACJ;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,sBAAsB,EAAE,CAAC;aACtC;SACJ;KACJ,CAAC,CAAC;AACP;;AC9CA;;;;;;"}
@@ -8,5 +8,6 @@ export * from './icon-error';
8
8
  export * from './media';
9
9
  export * from './notification-options';
10
10
  export * from './number-format-settings';
11
+ export * from './textfield-host';
11
12
  export * from './value-content-context';
12
13
  export * from './with-optional-min-max';
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"TuiAnimationOptions":{"__symbolic":"interface"},"TuiDataListAccessor":{"__symbolic":"interface"},"TuiDataListHost":{"__symbolic":"interface"},"TuiDialogContext":{"__symbolic":"interface"},"TuiDialogOptions":{"__symbolic":"interface"},"TuiDropdown":{"__symbolic":"interface"},"TuiIconError":{"__symbolic":"interface"},"TuiMedia":{"__symbolic":"interface"},"TuiNotificationAutoClose":{"__symbolic":"interface"},"TuiNotificationOptions":{"__symbolic":"interface"},"TuiNotificationOptionsWithData":{"__symbolic":"interface"},"NumberFormatSettings":{"__symbolic":"interface"},"TuiValueContentContext":{"__symbolic":"interface"},"TuiWithOptionalMinMax":{"__symbolic":"interface"},"TuiWithOptionalMinMaxWithValue":{"__symbolic":"interface"}},"origins":{"TuiAnimationOptions":"./animation-options","TuiDataListAccessor":"./data-list-accessor","TuiDataListHost":"./data-list-host","TuiDialogContext":"./dialog-context","TuiDialogOptions":"./dialog-options","TuiDropdown":"./dropdown-directive","TuiIconError":"./icon-error","TuiMedia":"./media","TuiNotificationAutoClose":"./notification-options","TuiNotificationOptions":"./notification-options","TuiNotificationOptionsWithData":"./notification-options","NumberFormatSettings":"./number-format-settings","TuiValueContentContext":"./value-content-context","TuiWithOptionalMinMax":"./with-optional-min-max","TuiWithOptionalMinMaxWithValue":"./with-optional-min-max"},"importAs":"@taiga-ui/core/interfaces"}
1
+ {"__symbolic":"module","version":4,"metadata":{"TuiAnimationOptions":{"__symbolic":"interface"},"TuiDataListAccessor":{"__symbolic":"interface"},"TuiDataListHost":{"__symbolic":"interface"},"TuiDialogContext":{"__symbolic":"interface"},"TuiDialogOptions":{"__symbolic":"interface"},"TuiDropdown":{"__symbolic":"interface"},"TuiIconError":{"__symbolic":"interface"},"TuiMedia":{"__symbolic":"interface"},"TuiNotificationAutoClose":{"__symbolic":"interface"},"TuiNotificationOptions":{"__symbolic":"interface"},"TuiNotificationOptionsWithData":{"__symbolic":"interface"},"NumberFormatSettings":{"__symbolic":"interface"},"TuiTextfieldHost":{"__symbolic":"interface"},"TuiValueContentContext":{"__symbolic":"interface"},"TuiWithOptionalMinMax":{"__symbolic":"interface"},"TuiWithOptionalMinMaxWithValue":{"__symbolic":"interface"}},"origins":{"TuiAnimationOptions":"./animation-options","TuiDataListAccessor":"./data-list-accessor","TuiDataListHost":"./data-list-host","TuiDialogContext":"./dialog-context","TuiDialogOptions":"./dialog-options","TuiDropdown":"./dropdown-directive","TuiIconError":"./icon-error","TuiMedia":"./media","TuiNotificationAutoClose":"./notification-options","TuiNotificationOptions":"./notification-options","TuiNotificationOptionsWithData":"./notification-options","NumberFormatSettings":"./number-format-settings","TuiTextfieldHost":"./textfield-host","TuiValueContentContext":"./value-content-context","TuiWithOptionalMinMax":"./with-optional-min-max","TuiWithOptionalMinMaxWithValue":"./with-optional-min-max"},"importAs":"@taiga-ui/core/interfaces"}
@@ -0,0 +1,9 @@
1
+ export interface TuiTextfieldHost {
2
+ readonly readOnly: boolean;
3
+ readonly disabled: boolean;
4
+ readonly invalid: boolean;
5
+ readonly focusable: boolean;
6
+ readonly value: string;
7
+ onValueChange(value: string): void;
8
+ process(input: HTMLInputElement): void;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/core",
3
- "version": "2.31.0",
3
+ "version": "2.35.0",
4
4
  "description": "Core library for creating Angular components and applications using Taiga UI",
5
5
  "keywords": [
6
6
  "angular",
@@ -16,21 +16,22 @@
16
16
  "homepage": "https://github.com/tinkoff/taiga-ui",
17
17
  "schematics": "./schematics/collection.json",
18
18
  "dependencies": {
19
- "@taiga-ui/i18n": "2.31.0",
19
+ "@taiga-ui/i18n": "^2.35.0",
20
20
  "tslib": "^1.10.0"
21
21
  },
22
22
  "peerDependencies": {
23
- "@taiga-ui/cdk": "2.31.0",
23
+ "@taiga-ui/i18n": ">=2.35.0",
24
+ "@taiga-ui/cdk": ">=2.35.0",
24
25
  "@angular/animations": ">=9.0.0",
25
26
  "@angular/common": ">=9.0.0",
26
27
  "@angular/core": ">=9.0.0",
27
28
  "@angular/forms": ">=9.0.0",
28
29
  "@angular/platform-browser": ">=9.0.0",
29
30
  "@angular/router": ">=9.0.0",
30
- "@ng-web-apis/common": "1.12.1",
31
- "@ng-web-apis/mutation-observer": "1.1.0",
31
+ "@ng-web-apis/common": ">=1.12.1 < 2",
32
+ "@ng-web-apis/mutation-observer": ">=1.1.0",
32
33
  "@tinkoff/ng-event-plugins": ">=2.3.2",
33
- "@tinkoff/ng-polymorpheus": "3.1.12",
34
+ "@tinkoff/ng-polymorpheus": ">=3.1.12 < 4",
34
35
  "rxjs": ">=6.0.0"
35
36
  },
36
37
  "main": "bundles/taiga-ui-core.umd.js",
@@ -4,9 +4,21 @@
4
4
  @fields-space-large-mobile: @space * 6;
5
5
 
6
6
  .tui-form {
7
+ /* stylelint-disable */
7
8
  &__header {
8
9
  margin-top: @fields-space-large;
9
10
 
11
+ @media @mobile {
12
+ font: var(--tui-font-text-l);
13
+ font-weight: bold;
14
+ margin-bottom: @fields-space-mobile;
15
+ }
16
+
17
+ @media @tablet-min {
18
+ font: var(--tui-font-heading-5);
19
+ margin-bottom: @fields-space;
20
+ }
21
+
10
22
  &_margin-top_none {
11
23
  margin-top: 0;
12
24
  }
@@ -24,18 +36,8 @@
24
36
  margin-bottom: @fields-space - @space;
25
37
  }
26
38
  }
27
-
28
- @media @mobile {
29
- font: var(--tui-font-text-l);
30
- font-weight: bold;
31
- margin-bottom: @fields-space-mobile;
32
- }
33
-
34
- @media @tablet-min {
35
- font: var(--tui-font-heading-5);
36
- margin-bottom: @fields-space;
37
- }
38
39
  }
40
+ /* stylelint-enable */
39
41
 
40
42
  &__row {
41
43
  margin-top: @fields-space;
@@ -4,8 +4,17 @@
4
4
  @fields-space-large-mobile: @space * 6;
5
5
 
6
6
  .tui-form {
7
+ /* stylelint-disable */
7
8
  &__header {
9
+ font: var(--tui-font-heading-5);
8
10
  margin-top: @fields-space-large;
11
+ margin-bottom: @fields-space;
12
+
13
+ @media @mobile-m {
14
+ font: var(--tui-font-text-l);
15
+ font-weight: bold;
16
+ margin-bottom: @fields-space-mobile;
17
+ }
9
18
 
10
19
  &_margin-top_none {
11
20
  margin-top: 0;
@@ -16,26 +25,14 @@
16
25
  }
17
26
 
18
27
  &_margin-bottom_small {
28
+ margin-bottom: @fields-space - @space;
29
+
19
30
  @media @mobile-m {
20
31
  margin-bottom: @fields-space-mobile - @space;
21
32
  }
22
-
23
- @media @desktop-s-min {
24
- margin-bottom: @fields-space - @space;
25
- }
26
- }
27
-
28
- @media @mobile-m {
29
- font: var(--tui-font-text-l);
30
- font-weight: bold;
31
- margin-bottom: @fields-space-mobile;
32
- }
33
-
34
- @media @desktop-s-min {
35
- font: var(--tui-font-heading-5);
36
- margin-bottom: @fields-space;
37
33
  }
38
34
  }
35
+ /* stylelint-enable */
39
36
 
40
37
  &__row {
41
38
  margin-top: @fields-space;
@@ -39,6 +39,7 @@
39
39
 
40
40
  &_hoverable {
41
41
  .hoverable-with-shadow();
42
+ background: var(--tui-elevation-02);
42
43
  }
43
44
 
44
45
  &_size_s {
@@ -96,7 +96,7 @@
96
96
  }
97
97
  }
98
98
 
99
- &[data-tui-element-range] {
99
+ &[data-range] {
100
100
  &:after {
101
101
  background-color: var(--tui-primary-text);
102
102
  }
@@ -110,18 +110,18 @@
110
110
  }
111
111
  }
112
112
 
113
- &[data-tui-element-state='hovered'] > .t-item:before,
114
- &[data-tui-element-state='hovered'] > .t-item:after {
113
+ &[data-state='hovered'] > .t-item:before,
114
+ &[data-state='hovered'] > .t-item:after {
115
115
  background-color: var(--tui-primary-hover);
116
116
  }
117
117
 
118
- &[data-tui-element-state='pressed'] > .t-item:before,
119
- &[data-tui-element-state='pressed'] > .t-item:after {
118
+ &[data-state='pressed'] > .t-item:before,
119
+ &[data-state='pressed'] > .t-item:after {
120
120
  background-color: var(--tui-primary-active);
121
121
  }
122
122
  }
123
123
 
124
- &[data-tui-element-range='end'] > .t-item {
124
+ &[data-range='end'] > .t-item {
125
125
  &:before {
126
126
  left: 0.25rem;
127
127
  }
@@ -133,7 +133,7 @@
133
133
  }
134
134
  }
135
135
 
136
- &[data-tui-element-range='start'] > .t-item {
136
+ &[data-range='start'] > .t-item {
137
137
  &:before {
138
138
  right: 0.25rem;
139
139
  }
@@ -145,7 +145,7 @@
145
145
  }
146
146
  }
147
147
 
148
- &[data-tui-element-state='disabled'] {
148
+ &[data-state='disabled'] {
149
149
  pointer-events: none;
150
150
 
151
151
  & > .t-item {
@@ -153,11 +153,11 @@
153
153
  }
154
154
  }
155
155
 
156
- &[data-tui-element-state='hovered']:hover:not([data-tui-element-range]) > .t-item {
156
+ &[data-state='hovered']:hover:not([data-range]) > .t-item {
157
157
  background-color: var(--tui-secondary-hover);
158
158
  }
159
159
 
160
- &[data-tui-element-state='pressed']:hover:not([data-tui-element-range]) > .t-item {
160
+ &[data-state='pressed']:hover:not([data-range]) > .t-item {
161
161
  background-color: var(--tui-secondary-active);
162
162
  }
163
163
  }
@@ -96,7 +96,7 @@
96
96
  }
97
97
  }
98
98
 
99
- &[data-tui-element-range] {
99
+ &[data-range] {
100
100
  &:after {
101
101
  background-color: var(--tui-primary-text);
102
102
  }
@@ -110,18 +110,18 @@
110
110
  }
111
111
  }
112
112
 
113
- &[data-tui-element-state='hovered'] > .t-item:before,
114
- &[data-tui-element-state='hovered'] > .t-item:after {
113
+ &[data-state='hovered'] > .t-item:before,
114
+ &[data-state='hovered'] > .t-item:after {
115
115
  background-color: var(--tui-primary-hover);
116
116
  }
117
117
 
118
- &[data-tui-element-state='pressed'] > .t-item:before,
119
- &[data-tui-element-state='pressed'] > .t-item:after {
118
+ &[data-state='pressed'] > .t-item:before,
119
+ &[data-state='pressed'] > .t-item:after {
120
120
  background-color: var(--tui-primary-active);
121
121
  }
122
122
  }
123
123
 
124
- &[data-tui-element-range='end'] > .t-item {
124
+ &[data-range='end'] > .t-item {
125
125
  &:before {
126
126
  left: 4px;
127
127
  }
@@ -133,7 +133,7 @@
133
133
  }
134
134
  }
135
135
 
136
- &[data-tui-element-range='start'] > .t-item {
136
+ &[data-range='start'] > .t-item {
137
137
  &:before {
138
138
  right: 4px;
139
139
  }
@@ -145,7 +145,7 @@
145
145
  }
146
146
  }
147
147
 
148
- &[data-tui-element-state='disabled'] {
148
+ &[data-state='disabled'] {
149
149
  pointer-events: none;
150
150
 
151
151
  & > .t-item {
@@ -153,12 +153,12 @@
153
153
  }
154
154
  }
155
155
 
156
- &[data-tui-element-state='hovered']:hover:not([data-tui-element-range])
156
+ &[data-state='hovered']:hover:not([data-range])
157
157
  > .t-item {
158
158
  background-color: var(--tui-secondary-hover);
159
159
  }
160
160
 
161
- &[data-tui-element-state='pressed']:hover:not([data-tui-element-range])
161
+ &[data-state='pressed']:hover:not([data-range])
162
162
  > .t-item {
163
163
  background-color: var(--tui-secondary-active);
164
164
  }
@@ -5,19 +5,19 @@
5
5
  border-radius: var(--tui-radius-m);
6
6
  text-align: left;
7
7
 
8
- &[data-tui-host-size='s'] {
8
+ &[data-size='s'] {
9
9
  height: var(--tui-height-s);
10
10
  min-height: var(--tui-height-s);
11
11
  max-height: var(--tui-height-s);
12
12
  }
13
13
 
14
- &[data-tui-host-size='m'] {
14
+ &[data-size='m'] {
15
15
  height: var(--tui-height-m);
16
16
  min-height: var(--tui-height-m);
17
17
  max-height: var(--tui-height-m);
18
18
  }
19
19
 
20
- &[data-tui-host-size='l'] {
20
+ &[data-size='l'] {
21
21
  height: var(--tui-height-l);
22
22
  min-height: var(--tui-height-l);
23
23
  max-height: var(--tui-height-l);
@@ -34,11 +34,11 @@
34
34
  align-items: center;
35
35
  overflow: hidden;
36
36
 
37
- :host[data-tui-host-size='s'] & {
37
+ :host[data-size='s'] & {
38
38
  padding: 0 var(--tui-padding-s);
39
39
  }
40
40
 
41
- :host[data-tui-host-size='l'] & {
41
+ :host[data-size='l'] & {
42
42
  padding: 0 var(--tui-padding-l);
43
43
  }
44
44
 
@@ -47,7 +47,7 @@
47
47
  margin-right: -0.25rem;
48
48
  }
49
49
 
50
- :host[data-tui-host-size='m'] &:after {
50
+ :host[data-size='m'] &:after {
51
51
  display: none;
52
52
  }
53
53
  }
@@ -57,35 +57,40 @@
57
57
  .clearinput();
58
58
  .fullsize();
59
59
  padding: 0 var(--tui-padding-m);
60
- border: 0 solid transparent;
60
+ border: solid transparent;
61
+ border-width: 0 var(--border-end, 0) 0 var(--border-start, 0);
62
+ border-inline-start-width: var(--border-start, 0);
63
+ border-inline-end-width: var(--border-end, 0);
64
+ text-indent: var(--text-indent);
61
65
  text-align: inherit;
62
66
  box-sizing: border-box;
63
67
  white-space: nowrap;
64
68
  overflow: hidden;
65
69
  text-transform: inherit;
66
70
 
67
- :host[data-mode='onDark'] & {
71
+ :host[data-mode='onDark'] &,
72
+ :host-context(tui-primitive-textfield[data-mode='onDark']) {
68
73
  .autofill(dark);
69
74
  }
70
75
 
71
- :host[data-tui-host-size='s'] & {
76
+ :host[data-size='s'] &,
77
+ :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield) {
72
78
  padding: 0 var(--tui-padding-s);
73
79
  }
74
80
 
75
- :host[data-tui-host-size='l'] & {
81
+ :host[data-size='l'] &,
82
+ :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield) {
76
83
  padding: 0 var(--tui-padding-l);
77
84
  }
78
85
 
79
- :host._disabled & {
86
+ :host._disabled &,
87
+ :host-context(tui-primitive-textfield._disabled) {
80
88
  // @bad TODO: research why you can reach disabled textfield with mask inside a label without that
81
89
  pointer-events: none;
82
90
  }
83
91
 
84
- :host._right-aligned & {
85
- text-align: right;
86
- }
87
-
88
- :host[data-tui-host-size='l']:not(._label-outside) & {
92
+ :host[data-size='l']:not(._label-outside) &,
93
+ :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield) {
89
94
  padding-top: 1.25rem;
90
95
 
91
96
  // Workaround for raising placeholder in temporary autofill
@@ -95,7 +100,8 @@
95
100
  }
96
101
  }
97
102
 
98
- :host[data-tui-host-size='m']:not(._label-outside) & {
103
+ :host[data-size='m']:not(._label-outside) &,
104
+ :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield) {
99
105
  padding-top: 1.125rem;
100
106
 
101
107
  // Workaround for raising placeholder in temporary autofill
@@ -104,6 +110,13 @@
104
110
  transform: translateY(-0.5rem);
105
111
  }
106
112
  }
113
+
114
+ :host._hidden input&,
115
+ :host-context(tui-primitive-textfield._hidden) {
116
+ opacity: 0;
117
+ text-indent: -10em; // Hide blinking caret even in IE
118
+ -webkit-user-select: none; // Hide blinking caret in mobile safari
119
+ }
107
120
  }
108
121
 
109
122
  .textfield-wrapper() {
@@ -128,7 +141,7 @@
128
141
  &_raised {
129
142
  transform: translateY(-0.625rem);
130
143
 
131
- :host[data-tui-host-size='m'] & {
144
+ :host[data-size='m'] & {
132
145
  font-size: 0.69rem;
133
146
  transform: translateY(-0.5rem);
134
147
  letter-spacing: 0.025rem;
@@ -146,12 +159,12 @@
146
159
  }
147
160
 
148
161
  :host._focused &,
149
- :host[data-tui-host-size='m']._focused._label-outside &,
150
- :host[data-tui-host-size='l']._focused._label-outside & {
162
+ :host[data-size='m']._focused._label-outside &,
163
+ :host[data-size='l']._focused._label-outside & {
151
164
  color: var(--tui-text-03);
152
165
  }
153
166
 
154
- :host[data-tui-host-size='l'] & {
167
+ :host[data-size='l'] & {
155
168
  font-size: 0.9375rem;
156
169
 
157
170
  &_raised {
@@ -159,8 +172,8 @@
159
172
  }
160
173
  }
161
174
 
162
- :host[data-tui-host-size='m']._focused:not(._label-outside) &,
163
- :host[data-tui-host-size='l']._focused:not(._label-outside) & {
175
+ :host[data-size='m']._focused:not(._label-outside) &,
176
+ :host[data-size='l']._focused:not(._label-outside) & {
164
177
  color: var(--tui-text-01);
165
178
  }
166
179
 
@@ -170,14 +183,14 @@
170
183
  color: var(--tui-text-02-night);
171
184
  }
172
185
 
173
- :host[data-tui-host-size='m'][data-mode='onDark']._focused:not(._label-outside) &,
174
- :host[data-tui-host-size='l'][data-mode='onDark']._focused:not(._label-outside) & {
186
+ :host[data-size='m'][data-mode='onDark']._focused:not(._label-outside) &,
187
+ :host[data-size='l'][data-mode='onDark']._focused:not(._label-outside) & {
175
188
  color: var(--tui-text-01-night);
176
189
  }
177
190
 
178
191
  :host[data-mode='onDark']._focused &,
179
- :host[data-tui-host-size='m'][data-mode='onDark']._focused._label-outside &,
180
- :host[data-tui-host-size='l'][data-mode='onDark']._focused._label-outside & {
192
+ :host[data-size='m'][data-mode='onDark']._focused._label-outside &,
193
+ :host[data-size='l'][data-mode='onDark']._focused._label-outside & {
181
194
  color: var(--tui-text-02-night);
182
195
  }
183
196
  /* stylelint-enable selector-max-specificity */
@@ -245,6 +258,13 @@
245
258
 
246
259
  .placeholder {
247
260
  .textfield-placeholder();
261
+
262
+ /* Safari 9+ */
263
+ @supports (-webkit-hyphens: none) {
264
+ & {
265
+ transition-property: transform, color, letter-spacing;
266
+ }
267
+ }
248
268
  }
249
269
 
250
270
  .cleaner {
@@ -260,7 +280,7 @@
260
280
  margin-inline-start: -@space;
261
281
  margin-inline-end: 2 * @space;
262
282
 
263
- :host[data-tui-host-size='s'] & {
283
+ :host[data-size='s'] & {
264
284
  margin-right: @space;
265
285
  margin-inline-end: @space;
266
286
  }