@taiga-ui/core 3.49.0 → 3.50.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 (594) hide show
  1. package/abstract/taiga-ui-core-abstract.d.ts +0 -3
  2. package/animations/taiga-ui-core-animations.d.ts +0 -3
  3. package/bundles/taiga-ui-core-abstract.umd.js +0 -9
  4. package/bundles/taiga-ui-core-abstract.umd.js.map +1 -1
  5. package/bundles/taiga-ui-core-animations.umd.js +0 -4
  6. package/bundles/taiga-ui-core-animations.umd.js.map +1 -1
  7. package/bundles/taiga-ui-core-components-alert.umd.js +1 -16
  8. package/bundles/taiga-ui-core-components-alert.umd.js.map +1 -1
  9. package/bundles/taiga-ui-core-components-button.umd.js +0 -7
  10. package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
  11. package/bundles/taiga-ui-core-components-calendar.umd.js +0 -4
  12. package/bundles/taiga-ui-core-components-calendar.umd.js.map +1 -1
  13. package/bundles/taiga-ui-core-components-data-list.umd.js +0 -10
  14. package/bundles/taiga-ui-core-components-data-list.umd.js.map +1 -1
  15. package/bundles/taiga-ui-core-components-dialog.umd.js +1 -13
  16. package/bundles/taiga-ui-core-components-dialog.umd.js.map +1 -1
  17. package/bundles/taiga-ui-core-components-error.umd.js +0 -4
  18. package/bundles/taiga-ui-core-components-error.umd.js.map +1 -1
  19. package/bundles/taiga-ui-core-components-expand.umd.js +0 -5
  20. package/bundles/taiga-ui-core-components-expand.umd.js.map +1 -1
  21. package/bundles/taiga-ui-core-components-group.umd.js +1 -5
  22. package/bundles/taiga-ui-core-components-group.umd.js.map +1 -1
  23. package/bundles/taiga-ui-core-components-hints-host.umd.js +0 -8
  24. package/bundles/taiga-ui-core-components-hints-host.umd.js.map +1 -1
  25. package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js +11 -7
  26. package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js.map +1 -1
  27. package/bundles/taiga-ui-core-components-label.umd.js +0 -4
  28. package/bundles/taiga-ui-core-components-label.umd.js.map +1 -1
  29. package/bundles/taiga-ui-core-components-link.umd.js +0 -5
  30. package/bundles/taiga-ui-core-components-link.umd.js.map +1 -1
  31. package/bundles/taiga-ui-core-components-loader.umd.js +0 -9
  32. package/bundles/taiga-ui-core-components-loader.umd.js.map +1 -1
  33. package/bundles/taiga-ui-core-components-notification.umd.js +1 -8
  34. package/bundles/taiga-ui-core-components-notification.umd.js.map +1 -1
  35. package/bundles/taiga-ui-core-components-primitive-calendar.umd.js +0 -7
  36. package/bundles/taiga-ui-core-components-primitive-calendar.umd.js.map +1 -1
  37. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js +0 -8
  38. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js.map +1 -1
  39. package/bundles/taiga-ui-core-components-primitive-spin-button.umd.js +0 -4
  40. package/bundles/taiga-ui-core-components-primitive-spin-button.umd.js.map +1 -1
  41. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +1 -33
  42. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
  43. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.js +0 -4
  44. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.js.map +1 -1
  45. package/bundles/taiga-ui-core-components-root.umd.js +1 -7
  46. package/bundles/taiga-ui-core-components-root.umd.js.map +1 -1
  47. package/bundles/taiga-ui-core-components-scroll-controls.umd.js +0 -5
  48. package/bundles/taiga-ui-core-components-scroll-controls.umd.js.map +1 -1
  49. package/bundles/taiga-ui-core-components-scrollbar.umd.js +0 -8
  50. package/bundles/taiga-ui-core-components-scrollbar.umd.js.map +1 -1
  51. package/bundles/taiga-ui-core-components-svg.umd.js +0 -9
  52. package/bundles/taiga-ui-core-components-svg.umd.js.map +1 -1
  53. package/bundles/taiga-ui-core-components-theme-night.umd.js +0 -4
  54. package/bundles/taiga-ui-core-components-theme-night.umd.js.map +1 -1
  55. package/bundles/taiga-ui-core-components-tooltip.umd.js +0 -4
  56. package/bundles/taiga-ui-core-components-tooltip.umd.js.map +1 -1
  57. package/bundles/taiga-ui-core-components.umd.js +0 -4
  58. package/bundles/taiga-ui-core-components.umd.js.map +1 -1
  59. package/bundles/taiga-ui-core-constants.umd.js +0 -26
  60. package/bundles/taiga-ui-core-constants.umd.js.map +1 -1
  61. package/bundles/taiga-ui-core-directives-dropdown.umd.js +22 -51
  62. package/bundles/taiga-ui-core-directives-dropdown.umd.js.map +1 -1
  63. package/bundles/taiga-ui-core-directives-hint.umd.js +0 -13
  64. package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
  65. package/bundles/taiga-ui-core-directives-mask-accessor.umd.js +0 -7
  66. package/bundles/taiga-ui-core-directives-mask-accessor.umd.js.map +1 -1
  67. package/bundles/taiga-ui-core-directives-mode.umd.js +0 -4
  68. package/bundles/taiga-ui-core-directives-mode.umd.js.map +1 -1
  69. package/bundles/taiga-ui-core-directives-scroll-into-view.umd.js +0 -9
  70. package/bundles/taiga-ui-core-directives-scroll-into-view.umd.js.map +1 -1
  71. package/bundles/taiga-ui-core-directives-textfield-controller.umd.js +0 -11
  72. package/bundles/taiga-ui-core-directives-textfield-controller.umd.js.map +1 -1
  73. package/bundles/taiga-ui-core-directives-wrapper.umd.js +0 -4
  74. package/bundles/taiga-ui-core-directives-wrapper.umd.js.map +1 -1
  75. package/bundles/taiga-ui-core-directives.umd.js +0 -4
  76. package/bundles/taiga-ui-core-directives.umd.js.map +1 -1
  77. package/bundles/taiga-ui-core-enums.umd.js +0 -22
  78. package/bundles/taiga-ui-core-enums.umd.js.map +1 -1
  79. package/bundles/taiga-ui-core-interfaces.umd.js +1 -3
  80. package/bundles/taiga-ui-core-interfaces.umd.js.map +1 -1
  81. package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.js +0 -4
  82. package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.js.map +1 -1
  83. package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js +0 -5
  84. package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js.map +1 -1
  85. package/bundles/taiga-ui-core-internal.umd.js +0 -4
  86. package/bundles/taiga-ui-core-internal.umd.js.map +1 -1
  87. package/bundles/taiga-ui-core-mask.umd.js +1 -3
  88. package/bundles/taiga-ui-core-mask.umd.js.map +1 -1
  89. package/bundles/taiga-ui-core-observables.umd.js +0 -11
  90. package/bundles/taiga-ui-core-observables.umd.js.map +1 -1
  91. package/bundles/taiga-ui-core-pipes-calendar-sheet.umd.js +0 -11
  92. package/bundles/taiga-ui-core-pipes-calendar-sheet.umd.js.map +1 -1
  93. package/bundles/taiga-ui-core-pipes-flag.umd.js +0 -4
  94. package/bundles/taiga-ui-core-pipes-flag.umd.js.map +1 -1
  95. package/bundles/taiga-ui-core-pipes-format-date.umd.js +0 -4
  96. package/bundles/taiga-ui-core-pipes-format-date.umd.js.map +1 -1
  97. package/bundles/taiga-ui-core-pipes-format-number.umd.js +0 -10
  98. package/bundles/taiga-ui-core-pipes-format-number.umd.js.map +1 -1
  99. package/bundles/taiga-ui-core-pipes-format-phone.umd.js +0 -11
  100. package/bundles/taiga-ui-core-pipes-format-phone.umd.js.map +1 -1
  101. package/bundles/taiga-ui-core-pipes-month.umd.js +0 -4
  102. package/bundles/taiga-ui-core-pipes-month.umd.js.map +1 -1
  103. package/bundles/taiga-ui-core-pipes-order-week-days.umd.js +0 -4
  104. package/bundles/taiga-ui-core-pipes-order-week-days.umd.js.map +1 -1
  105. package/bundles/taiga-ui-core-pipes.umd.js +0 -4
  106. package/bundles/taiga-ui-core-pipes.umd.js.map +1 -1
  107. package/bundles/taiga-ui-core-providers.umd.js +0 -4
  108. package/bundles/taiga-ui-core-providers.umd.js.map +1 -1
  109. package/bundles/taiga-ui-core-services.umd.js +2 -20
  110. package/bundles/taiga-ui-core-services.umd.js.map +1 -1
  111. package/bundles/taiga-ui-core-tokens.umd.js +0 -123
  112. package/bundles/taiga-ui-core-tokens.umd.js.map +1 -1
  113. package/bundles/taiga-ui-core-types.umd.js +1 -3
  114. package/bundles/taiga-ui-core-types.umd.js.map +1 -1
  115. package/bundles/taiga-ui-core-utils-dom.umd.js +0 -50
  116. package/bundles/taiga-ui-core-utils-dom.umd.js.map +1 -1
  117. package/bundles/taiga-ui-core-utils-format.umd.js +0 -51
  118. package/bundles/taiga-ui-core-utils-format.umd.js.map +1 -1
  119. package/bundles/taiga-ui-core-utils-mask.umd.js +1 -40
  120. package/bundles/taiga-ui-core-utils-mask.umd.js.map +1 -1
  121. package/bundles/taiga-ui-core-utils-miscellaneous.umd.js +0 -17
  122. package/bundles/taiga-ui-core-utils-miscellaneous.umd.js.map +1 -1
  123. package/bundles/taiga-ui-core-utils-mobile.umd.js +0 -4
  124. package/bundles/taiga-ui-core-utils-mobile.umd.js.map +1 -1
  125. package/bundles/taiga-ui-core-utils.umd.js +0 -4
  126. package/bundles/taiga-ui-core-utils.umd.js.map +1 -1
  127. package/bundles/taiga-ui-core.umd.js +0 -4
  128. package/bundles/taiga-ui-core.umd.js.map +1 -1
  129. package/components/alert/taiga-ui-core-components-alert.d.ts +0 -3
  130. package/components/button/button.options.d.ts +0 -3
  131. package/components/button/taiga-ui-core-components-button.d.ts +0 -3
  132. package/components/calendar/calendar.component.d.ts +2 -2
  133. package/components/calendar/taiga-ui-core-components-calendar.d.ts +0 -3
  134. package/components/data-list/option/option.component.d.ts +0 -1
  135. package/components/data-list/taiga-ui-core-components-data-list.d.ts +0 -3
  136. package/components/dialog/dialog.tokens.d.ts +0 -6
  137. package/components/dialog/taiga-ui-core-components-dialog.d.ts +0 -3
  138. package/components/error/taiga-ui-core-components-error.d.ts +0 -3
  139. package/components/expand/taiga-ui-core-components-expand.d.ts +0 -3
  140. package/components/group/taiga-ui-core-components-group.d.ts +0 -3
  141. package/components/hints-host/taiga-ui-core-components-hints-host.d.ts +0 -3
  142. package/components/hosted-dropdown/hosted-dropdown.component.d.ts +1 -1
  143. package/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.d.ts +0 -3
  144. package/components/label/taiga-ui-core-components-label.d.ts +0 -3
  145. package/components/link/taiga-ui-core-components-link.d.ts +0 -3
  146. package/components/loader/loader.options.d.ts +0 -4
  147. package/components/loader/taiga-ui-core-components-loader.d.ts +0 -3
  148. package/components/notification/notification.component.d.ts +0 -3
  149. package/components/notification/taiga-ui-core-components-notification.d.ts +0 -3
  150. package/components/primitive-calendar/primitive-calendar.component.d.ts +0 -3
  151. package/components/primitive-calendar/taiga-ui-core-components-primitive-calendar.d.ts +0 -3
  152. package/components/primitive-checkbox/checkbox.options.d.ts +0 -4
  153. package/components/primitive-checkbox/taiga-ui-core-components-primitive-checkbox.d.ts +0 -3
  154. package/components/primitive-spin-button/taiga-ui-core-components-primitive-spin-button.d.ts +0 -3
  155. package/components/primitive-textfield/primitive-textfield-options.d.ts +0 -16
  156. package/components/primitive-textfield/primitive-textfield.component.d.ts +0 -7
  157. package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.d.ts +0 -3
  158. package/components/primitive-year-picker/taiga-ui-core-components-primitive-year-picker.d.ts +0 -3
  159. package/components/root/taiga-ui-core-components-root.d.ts +0 -3
  160. package/components/scroll-controls/scroll-controls.module.d.ts +0 -1
  161. package/components/scroll-controls/taiga-ui-core-components-scroll-controls.d.ts +0 -3
  162. package/components/scrollbar/scroll-ref.directive.d.ts +0 -2
  163. package/components/scrollbar/taiga-ui-core-components-scrollbar.d.ts +0 -3
  164. package/components/svg/svg-options.d.ts +0 -3
  165. package/components/svg/taiga-ui-core-components-svg.d.ts +0 -3
  166. package/components/taiga-ui-core-components.d.ts +0 -3
  167. package/components/theme-night/taiga-ui-core-components-theme-night.d.ts +0 -3
  168. package/components/tooltip/taiga-ui-core-components-tooltip.d.ts +0 -3
  169. package/constants/cache-basting-payload.d.ts +1 -1
  170. package/constants/decimal-symbols.d.ts +0 -4
  171. package/constants/events.d.ts +0 -14
  172. package/constants/mask-caret-trap.d.ts +0 -4
  173. package/constants/taiga-ui-core-constants.d.ts +0 -3
  174. package/directives/dropdown/dropdown-hover.options.d.ts +0 -4
  175. package/directives/dropdown/dropdown-options.directive.d.ts +0 -4
  176. package/directives/dropdown/dropdown-selection.directive.d.ts +0 -9
  177. package/directives/dropdown/dropdown.component.d.ts +2 -9
  178. package/directives/dropdown/dropdown.providers.d.ts +0 -3
  179. package/directives/dropdown/taiga-ui-core-directives-dropdown.d.ts +0 -3
  180. package/directives/hint/hint-options.directive.d.ts +0 -4
  181. package/directives/hint/hint.providers.d.ts +0 -3
  182. package/directives/hint/taiga-ui-core-directives-hint.d.ts +0 -3
  183. package/directives/mask-accessor/mask-accessor.module.d.ts +0 -3
  184. package/directives/mask-accessor/taiga-ui-core-directives-mask-accessor.d.ts +0 -3
  185. package/directives/mode/taiga-ui-core-directives-mode.d.ts +0 -3
  186. package/directives/scroll-into-view/scroll-into-view.directive.d.ts +0 -3
  187. package/directives/scroll-into-view/taiga-ui-core-directives-scroll-into-view.d.ts +0 -3
  188. package/directives/taiga-ui-core-directives.d.ts +0 -3
  189. package/directives/textfield-controller/taiga-ui-core-directives-textfield-controller.d.ts +0 -3
  190. package/directives/textfield-controller/textfield.options.d.ts +0 -7
  191. package/directives/wrapper/taiga-ui-core-directives-wrapper.d.ts +0 -3
  192. package/enums/dropdown-animation.d.ts +0 -1
  193. package/enums/interactive-state.d.ts +0 -3
  194. package/enums/notification.d.ts +0 -3
  195. package/enums/range-state.d.ts +0 -3
  196. package/enums/taiga-ui-core-enums.d.ts +0 -3
  197. package/esm2015/abstract/driver.js +1 -2
  198. package/esm2015/abstract/position-accessor.js +1 -2
  199. package/esm2015/abstract/rect-accessor.js +1 -3
  200. package/esm2015/abstract/taiga-ui-core-abstract.js +1 -4
  201. package/esm2015/abstract/vehicle.js +1 -2
  202. package/esm2015/animations/taiga-ui-core-animations.js +1 -4
  203. package/esm2015/components/alert/alert.component.js +2 -13
  204. package/esm2015/components/alert/taiga-ui-core-components-alert.js +1 -4
  205. package/esm2015/components/button/button.options.js +1 -4
  206. package/esm2015/components/button/taiga-ui-core-components-button.js +1 -4
  207. package/esm2015/components/calendar/calendar.component.js +1 -1
  208. package/esm2015/components/calendar/taiga-ui-core-components-calendar.js +1 -4
  209. package/esm2015/components/data-list/data-list.component.js +1 -3
  210. package/esm2015/components/data-list/option/option.component.js +1 -5
  211. package/esm2015/components/data-list/taiga-ui-core-components-data-list.js +1 -4
  212. package/esm2015/components/dialog/dialog.component.js +2 -4
  213. package/esm2015/components/dialog/dialog.tokens.js +1 -7
  214. package/esm2015/components/dialog/taiga-ui-core-components-dialog.js +1 -4
  215. package/esm2015/components/error/taiga-ui-core-components-error.js +1 -4
  216. package/esm2015/components/expand/expand.component.js +1 -2
  217. package/esm2015/components/expand/taiga-ui-core-components-expand.js +1 -4
  218. package/esm2015/components/group/group-styles.component.js +1 -1
  219. package/esm2015/components/group/taiga-ui-core-components-group.js +1 -4
  220. package/esm2015/components/hints-host/hints-host.component.js +1 -5
  221. package/esm2015/components/hints-host/taiga-ui-core-components-hints-host.js +1 -4
  222. package/esm2015/components/hosted-dropdown/hosted-dropdown.component.js +12 -7
  223. package/esm2015/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.js +1 -4
  224. package/esm2015/components/label/taiga-ui-core-components-label.js +1 -4
  225. package/esm2015/components/link/link.component.js +1 -2
  226. package/esm2015/components/link/taiga-ui-core-components-link.js +1 -4
  227. package/esm2015/components/loader/loader.component.js +1 -2
  228. package/esm2015/components/loader/loader.options.js +1 -5
  229. package/esm2015/components/loader/taiga-ui-core-components-loader.js +1 -4
  230. package/esm2015/components/notification/notification.component.js +2 -5
  231. package/esm2015/components/notification/taiga-ui-core-components-notification.js +1 -4
  232. package/esm2015/components/primitive-calendar/primitive-calendar.component.js +1 -4
  233. package/esm2015/components/primitive-calendar/taiga-ui-core-components-primitive-calendar.js +1 -4
  234. package/esm2015/components/primitive-checkbox/checkbox.options.js +1 -5
  235. package/esm2015/components/primitive-checkbox/taiga-ui-core-components-primitive-checkbox.js +1 -4
  236. package/esm2015/components/primitive-spin-button/taiga-ui-core-components-primitive-spin-button.js +1 -4
  237. package/esm2015/components/primitive-textfield/primitive-textfield-options.js +1 -13
  238. package/esm2015/components/primitive-textfield/primitive-textfield.component.js +1 -9
  239. package/esm2015/components/primitive-textfield/primitive-textfield.directive.js +1 -6
  240. package/esm2015/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.js +1 -4
  241. package/esm2015/components/primitive-textfield/value-decoration/value-decoration.component.js +1 -3
  242. package/esm2015/components/primitive-year-picker/taiga-ui-core-components-primitive-year-picker.js +1 -4
  243. package/esm2015/components/root/root.component.js +2 -4
  244. package/esm2015/components/root/taiga-ui-core-components-root.js +1 -4
  245. package/esm2015/components/scroll-controls/scroll-controls.module.js +1 -2
  246. package/esm2015/components/scroll-controls/taiga-ui-core-components-scroll-controls.js +1 -4
  247. package/esm2015/components/scrollbar/scroll-ref.directive.js +1 -3
  248. package/esm2015/components/scrollbar/scrollbar.component.js +1 -3
  249. package/esm2015/components/scrollbar/taiga-ui-core-components-scrollbar.js +1 -4
  250. package/esm2015/components/svg/svg-options.js +1 -4
  251. package/esm2015/components/svg/svg.component.js +1 -3
  252. package/esm2015/components/svg/taiga-ui-core-components-svg.js +1 -4
  253. package/esm2015/components/taiga-ui-core-components.js +1 -4
  254. package/esm2015/components/theme-night/taiga-ui-core-components-theme-night.js +1 -4
  255. package/esm2015/components/tooltip/taiga-ui-core-components-tooltip.js +1 -4
  256. package/esm2015/constants/decimal-symbols.js +1 -5
  257. package/esm2015/constants/events.js +1 -15
  258. package/esm2015/constants/mask-caret-trap.js +1 -5
  259. package/esm2015/constants/taiga-ui-core-constants.js +1 -4
  260. package/esm2015/directives/dropdown/dropdown-driver.directive.js +1 -2
  261. package/esm2015/directives/dropdown/dropdown-hover.options.js +1 -5
  262. package/esm2015/directives/dropdown/dropdown-options.directive.js +1 -5
  263. package/esm2015/directives/dropdown/dropdown-position-sided.directive.js +2 -2
  264. package/esm2015/directives/dropdown/dropdown-position.directive.js +13 -6
  265. package/esm2015/directives/dropdown/dropdown-selection.directive.js +1 -10
  266. package/esm2015/directives/dropdown/dropdown.component.js +8 -18
  267. package/esm2015/directives/dropdown/dropdown.directive.js +1 -2
  268. package/esm2015/directives/dropdown/dropdown.providers.js +1 -4
  269. package/esm2015/directives/dropdown/taiga-ui-core-directives-dropdown.js +1 -4
  270. package/esm2015/directives/hint/hint-driver.directive.js +1 -2
  271. package/esm2015/directives/hint/hint-hover.directive.js +1 -2
  272. package/esm2015/directives/hint/hint-options.directive.js +1 -5
  273. package/esm2015/directives/hint/hint-position.directive.js +1 -2
  274. package/esm2015/directives/hint/hint.directive.js +1 -2
  275. package/esm2015/directives/hint/hint.providers.js +1 -5
  276. package/esm2015/directives/hint/taiga-ui-core-directives-hint.js +1 -4
  277. package/esm2015/directives/mask-accessor/mask-accessor.module.js +1 -4
  278. package/esm2015/directives/mask-accessor/taiga-ui-core-directives-mask-accessor.js +1 -4
  279. package/esm2015/directives/mode/taiga-ui-core-directives-mode.js +1 -4
  280. package/esm2015/directives/scroll-into-view/scroll-into-view.directive.js +1 -6
  281. package/esm2015/directives/scroll-into-view/taiga-ui-core-directives-scroll-into-view.js +1 -4
  282. package/esm2015/directives/taiga-ui-core-directives.js +1 -4
  283. package/esm2015/directives/textfield-controller/taiga-ui-core-directives-textfield-controller.js +1 -4
  284. package/esm2015/directives/textfield-controller/textfield-appearance.directive.js +1 -4
  285. package/esm2015/directives/textfield-controller/textfield.options.js +1 -5
  286. package/esm2015/directives/wrapper/taiga-ui-core-directives-wrapper.js +1 -4
  287. package/esm2015/enums/appearance.js +1 -3
  288. package/esm2015/enums/dropdown-animation.js +1 -3
  289. package/esm2015/enums/interactive-state.js +1 -6
  290. package/esm2015/enums/notification.js +1 -5
  291. package/esm2015/enums/range-state.js +1 -6
  292. package/esm2015/enums/taiga-ui-core-enums.js +1 -4
  293. package/esm2015/interfaces/taiga-ui-core-interfaces.js +1 -4
  294. package/esm2015/internal/primitive-year-month-pagination/taiga-ui-core-internal-primitive-year-month-pagination.js +1 -4
  295. package/esm2015/internal/svg-defs-host/svg-defs-host.component.js +1 -2
  296. package/esm2015/internal/svg-defs-host/taiga-ui-core-internal-svg-defs-host.js +1 -4
  297. package/esm2015/internal/taiga-ui-core-internal.js +1 -4
  298. package/esm2015/mask/taiga-ui-core-mask.js +1 -4
  299. package/esm2015/observables/taiga-ui-core-observables.js +1 -4
  300. package/esm2015/observables/zoneful-map.js +1 -8
  301. package/esm2015/pipes/calendar-sheet/taiga-ui-core-pipes-calendar-sheet.js +1 -4
  302. package/esm2015/pipes/calendar-sheet/utils.js +1 -8
  303. package/esm2015/pipes/flag/taiga-ui-core-pipes-flag.js +1 -4
  304. package/esm2015/pipes/format-date/taiga-ui-core-pipes-format-date.js +1 -4
  305. package/esm2015/pipes/format-number/format-number.pipe.js +1 -7
  306. package/esm2015/pipes/format-number/taiga-ui-core-pipes-format-number.js +1 -4
  307. package/esm2015/pipes/format-phone/format-phone.pipe.js +1 -8
  308. package/esm2015/pipes/format-phone/taiga-ui-core-pipes-format-phone.js +1 -4
  309. package/esm2015/pipes/month/taiga-ui-core-pipes-month.js +1 -4
  310. package/esm2015/pipes/order-week-days/taiga-ui-core-pipes-order-week-days.js +1 -4
  311. package/esm2015/pipes/taiga-ui-core-pipes.js +1 -4
  312. package/esm2015/providers/taiga-ui-core-providers.js +1 -4
  313. package/esm2015/services/breakpoint.service.js +1 -4
  314. package/esm2015/services/hint.service.js +1 -4
  315. package/esm2015/services/position.service.js +2 -4
  316. package/esm2015/services/router-link-active.service.js +2 -4
  317. package/esm2015/services/svg.service.js +1 -4
  318. package/esm2015/services/taiga-ui-core-services.js +1 -4
  319. package/esm2015/services/visual-viewport.service.js +1 -2
  320. package/esm2015/taiga-ui-core.js +1 -4
  321. package/esm2015/tokens/animation-options.js +1 -4
  322. package/esm2015/tokens/animations-duration.js +1 -4
  323. package/esm2015/tokens/assert-enabled.js +1 -8
  324. package/esm2015/tokens/data-list-accessor.js +1 -4
  325. package/esm2015/tokens/data-list-host.js +1 -4
  326. package/esm2015/tokens/day-type-handler.js +1 -4
  327. package/esm2015/tokens/element-ref.js +1 -4
  328. package/esm2015/tokens/first-day-of-week.js +1 -4
  329. package/esm2015/tokens/i18n.js +1 -19
  330. package/esm2015/tokens/icon-place.js +1 -5
  331. package/esm2015/tokens/icons-path.js +1 -5
  332. package/esm2015/tokens/icons.js +1 -4
  333. package/esm2015/tokens/is-mobile-resolution.js +1 -6
  334. package/esm2015/tokens/legacy-mask.js +1 -6
  335. package/esm2015/tokens/media.js +1 -4
  336. package/esm2015/tokens/mode.js +1 -4
  337. package/esm2015/tokens/notification-options.js +1 -6
  338. package/esm2015/tokens/number-format.js +1 -4
  339. package/esm2015/tokens/option-content.js +1 -4
  340. package/esm2015/tokens/ordered-short-week-days.js +1 -8
  341. package/esm2015/tokens/sanitizer.js +1 -4
  342. package/esm2015/tokens/scroll-ref.js +1 -4
  343. package/esm2015/tokens/selection-stream.js +1 -4
  344. package/esm2015/tokens/svg-content-processor.js +1 -5
  345. package/esm2015/tokens/svg-src-processor.js +1 -5
  346. package/esm2015/tokens/taiga-ui-core-tokens.js +1 -4
  347. package/esm2015/tokens/textfield-appearance.js +1 -6
  348. package/esm2015/tokens/textfield-host.js +1 -4
  349. package/esm2015/tokens/value-accessor.js +1 -4
  350. package/esm2015/tokens/viewport.js +1 -4
  351. package/esm2015/types/size.js +1 -12
  352. package/esm2015/types/taiga-ui-core-types.js +1 -4
  353. package/esm2015/utils/dom/get-safe-area-size.js +1 -6
  354. package/esm2015/utils/dom/get-viewport-height.js +1 -18
  355. package/esm2015/utils/dom/get-viewport-width.js +1 -18
  356. package/esm2015/utils/dom/get-word-range.js +1 -8
  357. package/esm2015/utils/dom/taiga-ui-core-utils-dom.js +1 -4
  358. package/esm2015/utils/format/capitalize.js +1 -8
  359. package/esm2015/utils/format/format-number.js +1 -9
  360. package/esm2015/utils/format/format-phone.js +1 -20
  361. package/esm2015/utils/format/get-fractional-part-padded.js +1 -8
  362. package/esm2015/utils/format/number-to-string-without-exp.js +1 -7
  363. package/esm2015/utils/format/taiga-ui-core-utils-format.js +1 -4
  364. package/esm2015/utils/mask/create-auto-corrected-money-pipe.js +1 -9
  365. package/esm2015/utils/mask/create-correction-mask.js +1 -5
  366. package/esm2015/utils/mask/create-number-mask.js +2 -10
  367. package/esm2015/utils/mask/enable-auto-correct-decimal-symbol.js +1 -5
  368. package/esm2015/utils/mask/masked-money-value-is-empty.js +1 -8
  369. package/esm2015/utils/mask/masked-number-string-to-number.js +1 -5
  370. package/esm2015/utils/mask/taiga-ui-core-utils-mask.js +1 -4
  371. package/esm2015/utils/miscellaneous/is-editing-key.js +1 -4
  372. package/esm2015/utils/miscellaneous/is-obscured.js +1 -4
  373. package/esm2015/utils/miscellaneous/override-options.js +1 -2
  374. package/esm2015/utils/miscellaneous/size-bigger.js +1 -7
  375. package/esm2015/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.js +1 -4
  376. package/esm2015/utils/mobile/taiga-ui-core-utils-mobile.js +1 -4
  377. package/esm2015/utils/taiga-ui-core-utils.js +1 -4
  378. package/fesm2015/taiga-ui-core-abstract.js +0 -9
  379. package/fesm2015/taiga-ui-core-abstract.js.map +1 -1
  380. package/fesm2015/taiga-ui-core-animations.js +0 -4
  381. package/fesm2015/taiga-ui-core-animations.js.map +1 -1
  382. package/fesm2015/taiga-ui-core-components-alert.js +1 -16
  383. package/fesm2015/taiga-ui-core-components-alert.js.map +1 -1
  384. package/fesm2015/taiga-ui-core-components-button.js +0 -7
  385. package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
  386. package/fesm2015/taiga-ui-core-components-calendar.js +0 -4
  387. package/fesm2015/taiga-ui-core-components-calendar.js.map +1 -1
  388. package/fesm2015/taiga-ui-core-components-data-list.js +0 -10
  389. package/fesm2015/taiga-ui-core-components-data-list.js.map +1 -1
  390. package/fesm2015/taiga-ui-core-components-dialog.js +1 -13
  391. package/fesm2015/taiga-ui-core-components-dialog.js.map +1 -1
  392. package/fesm2015/taiga-ui-core-components-error.js +0 -4
  393. package/fesm2015/taiga-ui-core-components-error.js.map +1 -1
  394. package/fesm2015/taiga-ui-core-components-expand.js +0 -5
  395. package/fesm2015/taiga-ui-core-components-expand.js.map +1 -1
  396. package/fesm2015/taiga-ui-core-components-group.js +1 -5
  397. package/fesm2015/taiga-ui-core-components-group.js.map +1 -1
  398. package/fesm2015/taiga-ui-core-components-hints-host.js +0 -8
  399. package/fesm2015/taiga-ui-core-components-hints-host.js.map +1 -1
  400. package/fesm2015/taiga-ui-core-components-hosted-dropdown.js +11 -10
  401. package/fesm2015/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
  402. package/fesm2015/taiga-ui-core-components-label.js +0 -4
  403. package/fesm2015/taiga-ui-core-components-label.js.map +1 -1
  404. package/fesm2015/taiga-ui-core-components-link.js +0 -5
  405. package/fesm2015/taiga-ui-core-components-link.js.map +1 -1
  406. package/fesm2015/taiga-ui-core-components-loader.js +0 -9
  407. package/fesm2015/taiga-ui-core-components-loader.js.map +1 -1
  408. package/fesm2015/taiga-ui-core-components-notification.js +1 -8
  409. package/fesm2015/taiga-ui-core-components-notification.js.map +1 -1
  410. package/fesm2015/taiga-ui-core-components-primitive-calendar.js +0 -7
  411. package/fesm2015/taiga-ui-core-components-primitive-calendar.js.map +1 -1
  412. package/fesm2015/taiga-ui-core-components-primitive-checkbox.js +0 -8
  413. package/fesm2015/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
  414. package/fesm2015/taiga-ui-core-components-primitive-spin-button.js +0 -4
  415. package/fesm2015/taiga-ui-core-components-primitive-spin-button.js.map +1 -1
  416. package/fesm2015/taiga-ui-core-components-primitive-textfield.js +0 -31
  417. package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  418. package/fesm2015/taiga-ui-core-components-primitive-year-picker.js +0 -4
  419. package/fesm2015/taiga-ui-core-components-primitive-year-picker.js.map +1 -1
  420. package/fesm2015/taiga-ui-core-components-root.js +1 -7
  421. package/fesm2015/taiga-ui-core-components-root.js.map +1 -1
  422. package/fesm2015/taiga-ui-core-components-scroll-controls.js +0 -5
  423. package/fesm2015/taiga-ui-core-components-scroll-controls.js.map +1 -1
  424. package/fesm2015/taiga-ui-core-components-scrollbar.js +0 -8
  425. package/fesm2015/taiga-ui-core-components-scrollbar.js.map +1 -1
  426. package/fesm2015/taiga-ui-core-components-svg.js +0 -9
  427. package/fesm2015/taiga-ui-core-components-svg.js.map +1 -1
  428. package/fesm2015/taiga-ui-core-components-theme-night.js +0 -4
  429. package/fesm2015/taiga-ui-core-components-theme-night.js.map +1 -1
  430. package/fesm2015/taiga-ui-core-components-tooltip.js +0 -4
  431. package/fesm2015/taiga-ui-core-components-tooltip.js.map +1 -1
  432. package/fesm2015/taiga-ui-core-components.js +0 -4
  433. package/fesm2015/taiga-ui-core-components.js.map +1 -1
  434. package/fesm2015/taiga-ui-core-constants.js +0 -26
  435. package/fesm2015/taiga-ui-core-constants.js.map +1 -1
  436. package/fesm2015/taiga-ui-core-directives-dropdown.js +20 -49
  437. package/fesm2015/taiga-ui-core-directives-dropdown.js.map +1 -1
  438. package/fesm2015/taiga-ui-core-directives-hint.js +0 -14
  439. package/fesm2015/taiga-ui-core-directives-hint.js.map +1 -1
  440. package/fesm2015/taiga-ui-core-directives-mask-accessor.js +0 -7
  441. package/fesm2015/taiga-ui-core-directives-mask-accessor.js.map +1 -1
  442. package/fesm2015/taiga-ui-core-directives-mode.js +0 -4
  443. package/fesm2015/taiga-ui-core-directives-mode.js.map +1 -1
  444. package/fesm2015/taiga-ui-core-directives-scroll-into-view.js +0 -9
  445. package/fesm2015/taiga-ui-core-directives-scroll-into-view.js.map +1 -1
  446. package/fesm2015/taiga-ui-core-directives-textfield-controller.js +0 -11
  447. package/fesm2015/taiga-ui-core-directives-textfield-controller.js.map +1 -1
  448. package/fesm2015/taiga-ui-core-directives-wrapper.js +0 -4
  449. package/fesm2015/taiga-ui-core-directives-wrapper.js.map +1 -1
  450. package/fesm2015/taiga-ui-core-directives.js +0 -4
  451. package/fesm2015/taiga-ui-core-directives.js.map +1 -1
  452. package/fesm2015/taiga-ui-core-enums.js +0 -22
  453. package/fesm2015/taiga-ui-core-enums.js.map +1 -1
  454. package/fesm2015/taiga-ui-core-interfaces.js +1 -3
  455. package/fesm2015/taiga-ui-core-interfaces.js.map +1 -1
  456. package/fesm2015/taiga-ui-core-internal-primitive-year-month-pagination.js +0 -4
  457. package/fesm2015/taiga-ui-core-internal-primitive-year-month-pagination.js.map +1 -1
  458. package/fesm2015/taiga-ui-core-internal-svg-defs-host.js +0 -5
  459. package/fesm2015/taiga-ui-core-internal-svg-defs-host.js.map +1 -1
  460. package/fesm2015/taiga-ui-core-internal.js +0 -4
  461. package/fesm2015/taiga-ui-core-internal.js.map +1 -1
  462. package/fesm2015/taiga-ui-core-mask.js +1 -3
  463. package/fesm2015/taiga-ui-core-mask.js.map +1 -1
  464. package/fesm2015/taiga-ui-core-observables.js +0 -11
  465. package/fesm2015/taiga-ui-core-observables.js.map +1 -1
  466. package/fesm2015/taiga-ui-core-pipes-calendar-sheet.js +0 -11
  467. package/fesm2015/taiga-ui-core-pipes-calendar-sheet.js.map +1 -1
  468. package/fesm2015/taiga-ui-core-pipes-flag.js +0 -4
  469. package/fesm2015/taiga-ui-core-pipes-flag.js.map +1 -1
  470. package/fesm2015/taiga-ui-core-pipes-format-date.js +0 -4
  471. package/fesm2015/taiga-ui-core-pipes-format-date.js.map +1 -1
  472. package/fesm2015/taiga-ui-core-pipes-format-number.js +0 -10
  473. package/fesm2015/taiga-ui-core-pipes-format-number.js.map +1 -1
  474. package/fesm2015/taiga-ui-core-pipes-format-phone.js +0 -11
  475. package/fesm2015/taiga-ui-core-pipes-format-phone.js.map +1 -1
  476. package/fesm2015/taiga-ui-core-pipes-month.js +0 -4
  477. package/fesm2015/taiga-ui-core-pipes-month.js.map +1 -1
  478. package/fesm2015/taiga-ui-core-pipes-order-week-days.js +0 -4
  479. package/fesm2015/taiga-ui-core-pipes-order-week-days.js.map +1 -1
  480. package/fesm2015/taiga-ui-core-pipes.js +0 -4
  481. package/fesm2015/taiga-ui-core-pipes.js.map +1 -1
  482. package/fesm2015/taiga-ui-core-providers.js +0 -4
  483. package/fesm2015/taiga-ui-core-providers.js.map +1 -1
  484. package/fesm2015/taiga-ui-core-services.js +2 -20
  485. package/fesm2015/taiga-ui-core-services.js.map +1 -1
  486. package/fesm2015/taiga-ui-core-tokens.js +0 -126
  487. package/fesm2015/taiga-ui-core-tokens.js.map +1 -1
  488. package/fesm2015/taiga-ui-core-types.js +0 -14
  489. package/fesm2015/taiga-ui-core-types.js.map +1 -1
  490. package/fesm2015/taiga-ui-core-utils-dom.js +0 -50
  491. package/fesm2015/taiga-ui-core-utils-dom.js.map +1 -1
  492. package/fesm2015/taiga-ui-core-utils-format.js +0 -51
  493. package/fesm2015/taiga-ui-core-utils-format.js.map +1 -1
  494. package/fesm2015/taiga-ui-core-utils-mask.js +1 -40
  495. package/fesm2015/taiga-ui-core-utils-mask.js.map +1 -1
  496. package/fesm2015/taiga-ui-core-utils-miscellaneous.js +0 -17
  497. package/fesm2015/taiga-ui-core-utils-miscellaneous.js.map +1 -1
  498. package/fesm2015/taiga-ui-core-utils-mobile.js +0 -4
  499. package/fesm2015/taiga-ui-core-utils-mobile.js.map +1 -1
  500. package/fesm2015/taiga-ui-core-utils.js +0 -4
  501. package/fesm2015/taiga-ui-core-utils.js.map +1 -1
  502. package/fesm2015/taiga-ui-core.js +0 -4
  503. package/fesm2015/taiga-ui-core.js.map +1 -1
  504. package/interfaces/alert-options.d.ts +0 -2
  505. package/interfaces/dialog-options.d.ts +0 -11
  506. package/interfaces/number-format-settings.d.ts +0 -21
  507. package/interfaces/taiga-ui-core-interfaces.d.ts +0 -3
  508. package/internal/primitive-year-month-pagination/taiga-ui-core-internal-primitive-year-month-pagination.d.ts +0 -3
  509. package/internal/svg-defs-host/taiga-ui-core-internal-svg-defs-host.d.ts +0 -3
  510. package/internal/taiga-ui-core-internal.d.ts +0 -3
  511. package/mask/taiga-ui-core-mask.d.ts +0 -3
  512. package/mask/text-mask-config.d.ts +0 -5
  513. package/mask/text-mask-correction-handler.d.ts +0 -3
  514. package/mask/text-mask-list-handler.d.ts +0 -3
  515. package/mask/text-mask-list.d.ts +0 -4
  516. package/mask/text-mask-options.d.ts +0 -22
  517. package/mask/text-mask-pipe-handler.d.ts +0 -4
  518. package/mask/text-mask-pipe-result.d.ts +0 -4
  519. package/observables/taiga-ui-core-observables.d.ts +0 -3
  520. package/observables/zoneful-map.d.ts +0 -7
  521. package/package.json +4 -4
  522. package/pipes/calendar-sheet/taiga-ui-core-pipes-calendar-sheet.d.ts +0 -3
  523. package/pipes/calendar-sheet/utils.d.ts +0 -13
  524. package/pipes/flag/taiga-ui-core-pipes-flag.d.ts +0 -3
  525. package/pipes/format-date/taiga-ui-core-pipes-format-date.d.ts +0 -3
  526. package/pipes/format-number/format-number.pipe.d.ts +0 -6
  527. package/pipes/format-number/taiga-ui-core-pipes-format-number.d.ts +0 -3
  528. package/pipes/format-phone/format-phone.pipe.d.ts +0 -7
  529. package/pipes/format-phone/taiga-ui-core-pipes-format-phone.d.ts +0 -3
  530. package/pipes/month/taiga-ui-core-pipes-month.d.ts +0 -3
  531. package/pipes/order-week-days/taiga-ui-core-pipes-order-week-days.d.ts +0 -3
  532. package/pipes/taiga-ui-core-pipes.d.ts +0 -3
  533. package/providers/taiga-ui-core-providers.d.ts +0 -3
  534. package/services/breakpoint.service.d.ts +0 -3
  535. package/services/hint.service.d.ts +0 -3
  536. package/services/svg.service.d.ts +0 -3
  537. package/services/taiga-ui-core-services.d.ts +0 -3
  538. package/taiga-ui-core.d.ts +0 -3
  539. package/tokens/animation-options.d.ts +0 -3
  540. package/tokens/animations-duration.d.ts +0 -3
  541. package/tokens/assert-enabled.d.ts +0 -7
  542. package/tokens/data-list-accessor.d.ts +0 -3
  543. package/tokens/data-list-host.d.ts +0 -3
  544. package/tokens/day-type-handler.d.ts +0 -3
  545. package/tokens/element-ref.d.ts +0 -3
  546. package/tokens/first-day-of-week.d.ts +0 -3
  547. package/tokens/i18n.d.ts +0 -18
  548. package/tokens/icon-place.d.ts +0 -4
  549. package/tokens/icons-path.d.ts +0 -4
  550. package/tokens/icons.d.ts +0 -3
  551. package/tokens/is-mobile-resolution.d.ts +0 -5
  552. package/tokens/legacy-mask.d.ts +0 -5
  553. package/tokens/media.d.ts +0 -3
  554. package/tokens/mode.d.ts +0 -3
  555. package/tokens/notification-options.d.ts +0 -5
  556. package/tokens/number-format.d.ts +0 -3
  557. package/tokens/option-content.d.ts +0 -3
  558. package/tokens/ordered-short-week-days.d.ts +0 -7
  559. package/tokens/sanitizer.d.ts +0 -3
  560. package/tokens/scroll-ref.d.ts +0 -3
  561. package/tokens/selection-stream.d.ts +0 -3
  562. package/tokens/svg-content-processor.d.ts +0 -4
  563. package/tokens/svg-src-processor.d.ts +0 -4
  564. package/tokens/taiga-ui-core-tokens.d.ts +0 -3
  565. package/tokens/textfield-appearance.d.ts +0 -5
  566. package/tokens/textfield-host.d.ts +0 -3
  567. package/tokens/value-accessor.d.ts +0 -3
  568. package/tokens/viewport.d.ts +0 -3
  569. package/types/size.d.ts +0 -11
  570. package/types/taiga-ui-core-types.d.ts +0 -3
  571. package/utils/dom/get-safe-area-size.d.ts +0 -5
  572. package/utils/dom/get-viewport-height.d.ts +0 -17
  573. package/utils/dom/get-viewport-width.d.ts +0 -17
  574. package/utils/dom/get-word-range.d.ts +0 -6
  575. package/utils/dom/taiga-ui-core-utils-dom.d.ts +0 -3
  576. package/utils/format/capitalize.d.ts +0 -7
  577. package/utils/format/format-number.d.ts +0 -8
  578. package/utils/format/format-phone.d.ts +0 -19
  579. package/utils/format/get-fractional-part-padded.d.ts +0 -7
  580. package/utils/format/number-to-string-without-exp.d.ts +0 -6
  581. package/utils/format/taiga-ui-core-utils-format.d.ts +0 -3
  582. package/utils/mask/create-auto-corrected-money-pipe.d.ts +0 -5
  583. package/utils/mask/create-correction-mask.d.ts +0 -4
  584. package/utils/mask/create-number-mask.d.ts +0 -5
  585. package/utils/mask/enable-auto-correct-decimal-symbol.d.ts +0 -4
  586. package/utils/mask/masked-money-value-is-empty.d.ts +0 -7
  587. package/utils/mask/masked-number-string-to-number.d.ts +0 -4
  588. package/utils/mask/taiga-ui-core-utils-mask.d.ts +0 -3
  589. package/utils/miscellaneous/is-editing-key.d.ts +0 -3
  590. package/utils/miscellaneous/is-obscured.d.ts +0 -3
  591. package/utils/miscellaneous/size-bigger.d.ts +0 -6
  592. package/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.d.ts +0 -3
  593. package/utils/mobile/taiga-ui-core-utils-mobile.d.ts +0 -3
  594. package/utils/taiga-ui-core-utils.d.ts +0 -3
@@ -9,11 +9,6 @@ function tuiCheckFixedPosition(element) {
9
9
  tuiCheckFixedPosition(element.parentElement));
10
10
  }
11
11
 
12
- /**
13
- * Calculates size of safe area on mobile devices (status bars)
14
- *
15
- * ATTENTION: Only use in browser environment
16
- */
17
12
  function tuiGetSafeAreaSize() {
18
13
  if (!CSS.supports(`padding-top: env(safe-area-inset-top)`)) {
19
14
  return 0;
@@ -30,55 +25,14 @@ function tuiGetScreenWidth(doc) {
30
25
  return Math.max(doc.documentElement.clientWidth, doc.defaultView ? doc.defaultView.innerWidth : 0);
31
26
  }
32
27
 
33
- /**
34
- * @description:
35
- * Cross-browser @media (height)
36
- *
37
- * 1. window.innerWidth
38
- * 1.1. gets CSS viewport @media (height) which include scrollbars
39
- * 1.2. initial-scale and zoom variations may cause mobile values to
40
- * wrongly scale down to what PPK calls the visual
41
- * viewport and be smaller than the @media values
42
- * 1.3. zoom may cause values to be 1px off due to native rounding
43
- *
44
- * 2. document.documentElement.clientHeight
45
- * 2.1. equals CSS viewport width minus scrollbar width
46
- * 2.2. matches @media (height) when there is no scrollbar
47
- * 2.3. available cross-browser
48
- * 2.4. inaccurate if doctype is missing
49
- */
50
28
  function tuiGetViewportHeight({ document, innerHeight }) {
51
29
  return Math.max(document.documentElement.clientHeight || 0, innerHeight || 0);
52
30
  }
53
31
 
54
- /**
55
- * @description:
56
- * Cross-browser @media (width)
57
- *
58
- * 1. window.innerWidth
59
- * 1.1. gets CSS viewport @media (width) which include scrollbars
60
- * 1.2. initial-scale and zoom variations may cause mobile values to
61
- * wrongly scale down to what PPK calls the visual
62
- * viewport and be smaller than the @media values
63
- * 1.3. zoom may cause values to be 1px off due to native rounding
64
- *
65
- * 2. document.documentElement.clientWidth
66
- * 2.1. equals CSS viewport width minus scrollbar width
67
- * 2.2. matches @media (width) when there is no scrollbar
68
- * 2.3. available cross-browser
69
- * 2.4. inaccurate if doctype is missing
70
- */
71
32
  function tuiGetViewportWidth({ document, innerWidth }) {
72
33
  return Math.max(document.documentElement.clientWidth || 0, innerWidth || 0);
73
34
  }
74
35
 
75
- /**
76
- * Creates a cloned range with its boundaries set at word boundaries
77
- *
78
- * @param currentRange a range to clone
79
- * @return modified range
80
- */
81
- // eslint-disable-next-line max-statements
82
36
  function tuiGetWordRange(currentRange) {
83
37
  const range = currentRange.cloneRange();
84
38
  const { startContainer, startOffset, endContainer, endOffset } = range;
@@ -153,9 +107,5 @@ function tuiProcessIcon(source, name) {
153
107
  return `<g id="${name}" xmlns="http://www.w3.org/2000/svg"><svg x="50%" y="50%" width="${width / 16}em" height="${height / 16}em" overflow="visible" viewBox="0 0 ${width} ${height}"><svg x="${-width / 2}" y="${-height / 2}">${src}</svg></svg></g>`;
154
108
  }
155
109
 
156
- /**
157
- * Generated bundle index. Do not edit.
158
- */
159
-
160
110
  export { tuiCheckFixedPosition, tuiGetSafeAreaSize, tuiGetScreenWidth, tuiGetViewportHeight, tuiGetViewportWidth, tuiGetWordRange, tuiProcessIcon };
161
111
  //# sourceMappingURL=taiga-ui-core-utils-dom.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-utils-dom.js","sources":["../../../projects/core/utils/dom/check-fixed-position.ts","../../../projects/core/utils/dom/get-safe-area-size.ts","../../../projects/core/utils/dom/get-screen-width.ts","../../../projects/core/utils/dom/get-viewport-height.ts","../../../projects/core/utils/dom/get-viewport-width.ts","../../../projects/core/utils/dom/get-word-range.ts","../../../projects/core/utils/dom/process-icon.ts","../../../projects/core/utils/dom/taiga-ui-core-utils-dom.ts"],"sourcesContent":["export function tuiCheckFixedPosition(element: HTMLElement | null): boolean {\n if (!element || typeof getComputedStyle === `undefined`) {\n return false;\n }\n\n const style = getComputedStyle(element);\n\n return (\n style.getPropertyValue(`position`) === `fixed` ||\n tuiCheckFixedPosition(element.parentElement)\n );\n}\n","/**\n * Calculates size of safe area on mobile devices (status bars)\n *\n * ATTENTION: Only use in browser environment\n */\nexport function tuiGetSafeAreaSize(): number {\n if (!CSS.supports(`padding-top: env(safe-area-inset-top)`)) {\n return 0;\n }\n\n const div = document.createElement(`div`);\n\n div.style.paddingTop = `env(safe-area-inset-top)`;\n document.body.appendChild(div);\n\n const safeAreaSize = parseInt(window.getComputedStyle(div).paddingTop, 10) || 0;\n\n document.body.removeChild(div);\n\n return safeAreaSize;\n}\n","export function tuiGetScreenWidth(doc: Document): number {\n return Math.max(\n doc.documentElement.clientWidth,\n doc.defaultView ? doc.defaultView.innerWidth : 0,\n );\n}\n","/**\n * @description:\n * Cross-browser @media (height)\n *\n * 1. window.innerWidth\n * 1.1. gets CSS viewport @media (height) which include scrollbars\n * 1.2. initial-scale and zoom variations may cause mobile values to\n * wrongly scale down to what PPK calls the visual\n * viewport and be smaller than the @media values\n * 1.3. zoom may cause values to be 1px off due to native rounding\n *\n * 2. document.documentElement.clientHeight\n * 2.1. equals CSS viewport width minus scrollbar width\n * 2.2. matches @media (height) when there is no scrollbar\n * 2.3. available cross-browser\n * 2.4. inaccurate if doctype is missing\n */\nexport function tuiGetViewportHeight({document, innerHeight}: Window): number {\n return Math.max(document.documentElement.clientHeight || 0, innerHeight || 0);\n}\n","/**\n * @description:\n * Cross-browser @media (width)\n *\n * 1. window.innerWidth\n * 1.1. gets CSS viewport @media (width) which include scrollbars\n * 1.2. initial-scale and zoom variations may cause mobile values to\n * wrongly scale down to what PPK calls the visual\n * viewport and be smaller than the @media values\n * 1.3. zoom may cause values to be 1px off due to native rounding\n *\n * 2. document.documentElement.clientWidth\n * 2.1. equals CSS viewport width minus scrollbar width\n * 2.2. matches @media (width) when there is no scrollbar\n * 2.3. available cross-browser\n * 2.4. inaccurate if doctype is missing\n */\nexport function tuiGetViewportWidth({document, innerWidth}: Window): number {\n return Math.max(document.documentElement.clientWidth || 0, innerWidth || 0);\n}\n","import {CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_SPACE, svgNodeFilter} from '@taiga-ui/cdk';\n\n/**\n * Creates a cloned range with its boundaries set at word boundaries\n *\n * @param currentRange a range to clone\n * @return modified range\n */\n// eslint-disable-next-line max-statements\nexport function tuiGetWordRange(currentRange: Range): Range {\n const range = currentRange.cloneRange();\n const {startContainer, startOffset, endContainer, endOffset} = range;\n const {ownerDocument} = startContainer;\n\n if (!ownerDocument) {\n return range;\n }\n\n const treeWalker = ownerDocument.createTreeWalker(\n ownerDocument.body,\n NodeFilter.SHOW_TEXT,\n svgNodeFilter,\n );\n\n treeWalker.currentNode = startContainer;\n\n do {\n const container = treeWalker.currentNode;\n const textContent = container.textContent || ``;\n const content =\n container === startContainer\n ? textContent.slice(0, Math.max(0, startOffset + 1))\n : textContent;\n const offset =\n Math.max(\n content.lastIndexOf(` `),\n content.lastIndexOf(CHAR_NO_BREAK_SPACE),\n content.lastIndexOf(CHAR_ZERO_WIDTH_SPACE),\n ) + 1;\n\n range.setStart(container, 0);\n\n if (offset) {\n range.setStart(container, offset);\n break;\n }\n } while (treeWalker.previousNode());\n\n treeWalker.currentNode = endContainer;\n\n do {\n const container = treeWalker.currentNode;\n const textContent = container.textContent || ``;\n const content =\n container === endContainer ? textContent.slice(endOffset + 1) : textContent;\n const offset = [\n content.indexOf(` `),\n content.indexOf(CHAR_NO_BREAK_SPACE),\n content.indexOf(CHAR_ZERO_WIDTH_SPACE),\n ].reduce(\n (result, item) =>\n result === -1 || item === -1\n ? Math.max(result, item)\n : Math.min(result, item),\n -1,\n );\n\n range.setEnd(container, textContent.length);\n\n if (offset !== -1) {\n range.setEnd(container, offset + textContent.length - content.length);\n break;\n }\n } while (treeWalker.nextNode());\n\n return range;\n}\n","const WIDTH_SEARCH = `width=\"`;\nconst HEIGHT_SEARCH = `height=\"`;\nconst START = `<svg`;\n\nexport function tuiProcessIcon(source: string, name: string): string {\n if (source.includes(`id=\"${name}\"`)) {\n return source;\n }\n\n const src = source.slice(Math.max(0, source.indexOf(START)));\n const attributes = src.slice(0, Math.max(0, src.indexOf(`>`)));\n\n if (!attributes?.includes(WIDTH_SEARCH) || !attributes.includes(HEIGHT_SEARCH)) {\n return `${src.replace(\n START,\n `<svg xmlns=\"http://www.w3.org/2000/svg\"><g id=\"${name}\" xmlns=\"http://www.w3.org/2000/svg\"><svg`,\n )}</g></svg>`;\n }\n\n const indexOfWidth = attributes.indexOf(WIDTH_SEARCH);\n const indexOfHeight = attributes.indexOf(HEIGHT_SEARCH);\n const widthOffset = indexOfWidth + WIDTH_SEARCH.length;\n const heightOffset = indexOfHeight + HEIGHT_SEARCH.length;\n const widthString = attributes.slice(\n widthOffset,\n attributes.indexOf(`\"`, widthOffset),\n );\n const heightString = attributes.slice(\n heightOffset,\n attributes.indexOf(`\"`, heightOffset),\n );\n\n if (\n !heightString ||\n !widthString ||\n widthString.includes(`%`) ||\n heightString.includes(`%`) ||\n widthString.includes(`em`) ||\n heightString.includes(`em`)\n ) {\n return src.replace(START, `<svg id=\"${name}\"`);\n }\n\n const width = parseInt(widthString, 10);\n const height = parseInt(heightString, 10);\n\n return `<g id=\"${name}\" xmlns=\"http://www.w3.org/2000/svg\"><svg x=\"50%\" y=\"50%\" width=\"${\n width / 16\n }em\" height=\"${\n height / 16\n }em\" overflow=\"visible\" viewBox=\"0 0 ${width} ${height}\"><svg x=\"${-width / 2}\" y=\"${\n -height / 2\n }\">${src}</svg></svg></g>`;\n}\n","/**\n * Generated bund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G,EACb,CAAA,oCAAA,EAAuC,KAAK,CAAA,CAAA,EAAI,MAAM,CAAA,UAAA,EAAa,CAAC,KAAK,GAAG,CAAC,CACzE,KAAA,EAAA,CAAC,MAAM,GAAG,CACd,CAAA,EAAA,EAAK,GAAG,CAAA,gBAAA,CAAkB,CAAC;AAC/B;;ACrDA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-utils-dom.js","sources":["../../../projects/core/utils/dom/check-fixed-position.ts","../../../projects/core/utils/dom/get-safe-area-size.ts","../../../projects/core/utils/dom/get-screen-width.ts","../../../projects/core/utils/dom/get-viewport-height.ts","../../../projects/core/utils/dom/get-viewport-width.ts","../../../projects/core/utils/dom/get-word-range.ts","../../../projects/core/utils/dom/process-icon.ts"],"sourcesContent":["export function tuiCheckFixedPosition(element: HTMLElement | null): boolean {\n if (!element || typeof getComputedStyle === `undefined`) {\n return false;\n }\n\n const style = getComputedStyle(element);\n\n return (\n style.getPropertyValue(`position`) === `fixed` ||\n tuiCheckFixedPosition(element.parentElement)\n );\n}\n","/**\n * Calculates size of safe area on mobile devices (status bars)\n *\n * ATTENTION: Only use in browser environment\n */\nexport function tuiGetSafeAreaSize(): number {\n if (!CSS.supports(`padding-top: env(safe-area-inset-top)`)) {\n return 0;\n }\n\n const div = document.createElement(`div`);\n\n div.style.paddingTop = `env(safe-area-inset-top)`;\n document.body.appendChild(div);\n\n const safeAreaSize = parseInt(window.getComputedStyle(div).paddingTop, 10) || 0;\n\n document.body.removeChild(div);\n\n return safeAreaSize;\n}\n","export function tuiGetScreenWidth(doc: Document): number {\n return Math.max(\n doc.documentElement.clientWidth,\n doc.defaultView ? doc.defaultView.innerWidth : 0,\n );\n}\n","/**\n * @description:\n * Cross-browser @media (height)\n *\n * 1. window.innerWidth\n * 1.1. gets CSS viewport @media (height) which include scrollbars\n * 1.2. initial-scale and zoom variations may cause mobile values to\n * wrongly scale down to what PPK calls the visual\n * viewport and be smaller than the @media values\n * 1.3. zoom may cause values to be 1px off due to native rounding\n *\n * 2. document.documentElement.clientHeight\n * 2.1. equals CSS viewport width minus scrollbar width\n * 2.2. matches @media (height) when there is no scrollbar\n * 2.3. available cross-browser\n * 2.4. inaccurate if doctype is missing\n */\nexport function tuiGetViewportHeight({document, innerHeight}: Window): number {\n return Math.max(document.documentElement.clientHeight || 0, innerHeight || 0);\n}\n","/**\n * @description:\n * Cross-browser @media (width)\n *\n * 1. window.innerWidth\n * 1.1. gets CSS viewport @media (width) which include scrollbars\n * 1.2. initial-scale and zoom variations may cause mobile values to\n * wrongly scale down to what PPK calls the visual\n * viewport and be smaller than the @media values\n * 1.3. zoom may cause values to be 1px off due to native rounding\n *\n * 2. document.documentElement.clientWidth\n * 2.1. equals CSS viewport width minus scrollbar width\n * 2.2. matches @media (width) when there is no scrollbar\n * 2.3. available cross-browser\n * 2.4. inaccurate if doctype is missing\n */\nexport function tuiGetViewportWidth({document, innerWidth}: Window): number {\n return Math.max(document.documentElement.clientWidth || 0, innerWidth || 0);\n}\n","import {CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_SPACE, svgNodeFilter} from '@taiga-ui/cdk';\n\n/**\n * Creates a cloned range with its boundaries set at word boundaries\n *\n * @param currentRange a range to clone\n * @return modified range\n */\n// eslint-disable-next-line max-statements\nexport function tuiGetWordRange(currentRange: Range): Range {\n const range = currentRange.cloneRange();\n const {startContainer, startOffset, endContainer, endOffset} = range;\n const {ownerDocument} = startContainer;\n\n if (!ownerDocument) {\n return range;\n }\n\n const treeWalker = ownerDocument.createTreeWalker(\n ownerDocument.body,\n NodeFilter.SHOW_TEXT,\n svgNodeFilter,\n );\n\n treeWalker.currentNode = startContainer;\n\n do {\n const container = treeWalker.currentNode;\n const textContent = container.textContent || ``;\n const content =\n container === startContainer\n ? textContent.slice(0, Math.max(0, startOffset + 1))\n : textContent;\n const offset =\n Math.max(\n content.lastIndexOf(` `),\n content.lastIndexOf(CHAR_NO_BREAK_SPACE),\n content.lastIndexOf(CHAR_ZERO_WIDTH_SPACE),\n ) + 1;\n\n range.setStart(container, 0);\n\n if (offset) {\n range.setStart(container, offset);\n break;\n }\n } while (treeWalker.previousNode());\n\n treeWalker.currentNode = endContainer;\n\n do {\n const container = treeWalker.currentNode;\n const textContent = container.textContent || ``;\n const content =\n container === endContainer ? textContent.slice(endOffset + 1) : textContent;\n const offset = [\n content.indexOf(` `),\n content.indexOf(CHAR_NO_BREAK_SPACE),\n content.indexOf(CHAR_ZERO_WIDTH_SPACE),\n ].reduce(\n (result, item) =>\n result === -1 || item === -1\n ? Math.max(result, item)\n : Math.min(result, item),\n -1,\n );\n\n range.setEnd(container, textContent.length);\n\n if (offset !== -1) {\n range.setEnd(container, offset + textContent.length - content.length);\n break;\n }\n } while (treeWalker.nextNode());\n\n return range;\n}\n","const WIDTH_SEARCH = `width=\"`;\nconst HEIGHT_SEARCH = `height=\"`;\nconst START = `<svg`;\n\nexport function tuiProcessIcon(source: string, name: string): string {\n if (source.includes(`id=\"${name}\"`)) {\n return source;\n }\n\n const src = source.slice(Math.max(0, source.indexOf(START)));\n const attributes = src.slice(0, Math.max(0, src.indexOf(`>`)));\n\n if (!attributes?.includes(WIDTH_SEARCH) || !attributes.includes(HEIGHT_SEARCH)) {\n return `${src.replace(\n START,\n `<svg xmlns=\"http://www.w3.org/2000/svg\"><g id=\"${name}\" xmlns=\"http://www.w3.org/2000/svg\"><svg`,\n )}</g></svg>`;\n }\n\n const indexOfWidth = attributes.indexOf(WIDTH_SEARCH);\n const indexOfHeight = attributes.indexOf(HEIGHT_SEARCH);\n const widthOffset = indexOfWidth + WIDTH_SEARCH.length;\n const heightOffset = indexOfHeight + HEIGHT_SEARCH.length;\n const widthString = attributes.slice(\n widthOffset,\n attributes.indexOf(`\"`, widthOffset),\n );\n const heightString = attributes.slice(\n heightOffset,\n attributes.indexOf(`\"`, heightOffset),\n );\n\n if (\n !heightString ||\n !widthString ||\n widthString.includes(`%`) ||\n heightString.includes(`%`) ||\n widthString.includes(`em`) ||\n heightString.includes(`em`)\n ) {\n return src.replace(START, `<svg id=\"${name}\"`);\n }\n\n const width = parseInt(widthString, 10);\n const height = parseInt(heightString, 10);\n\n return `<g id=\"${name}\" xmlns=\"http://www.w3.org/2000/svg\"><svg x=\"50%\" y=\"50%\" width=\"${\n width / 16\n }em\" height=\"${\n height / 16\n }em\" overflow=\"visible\" viewBox=\"0 0 ${width} ${height}\"><svg x=\"${-width / 2}\" y=\"${\n -height / 2\n }\">${src}</svg></svg></g>`;\n}\n"],"names":[],"mappings":";;AAAM,SAAU,qBAAqB,CAAC,OAA2B,EAAA;AAC7D,IAAA,IAAI,CAAC,OAAO,IAAI,OAAO,gBAAgB,KAAK,WAAW,EAAE;AACrD,QAAA,OAAO,KAAK,CAAC;AAChB,KAAA;AAED,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAExC,QACI,KAAK,CAAC,gBAAgB,CAAC,CAAU,QAAA,CAAA,CAAC,KAAK,CAAO,KAAA,CAAA;AAC9C,QAAA,qBAAqB,CAAC,OAAO,CAAC,aAAa,CAAC,EAC9C;AACN;;SCNgB,kBAAkB,GAAA;AAC9B,IAAA,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA,qCAAA,CAAuC,CAAC,EAAE;AACxD,QAAA,OAAO,CAAC,CAAC;AACZ,KAAA;IAED,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA,GAAA,CAAK,CAAC,CAAC;AAE1C,IAAA,GAAG,CAAC,KAAK,CAAC,UAAU,GAAG,0BAA0B,CAAC;AAClD,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAE/B,IAAA,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AAEhF,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAA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CAAC;IACxC,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAE1C,OAAO,CAAA,OAAA,EAAU,IAAI,CAAA,kEAAA,EACjB,KAAK,GAAG,EACZ,CAAA,YAAA,EACI,MAAM,GAAG,EACb,CAAA,oCAAA,EAAuC,KAAK,CAAA,CAAA,EAAI,MAAM,CAAA,UAAA,EAAa,CAAC,KAAK,GAAG,CAAC,CACzE,KAAA,EAAA,CAAC,MAAM,GAAG,CACd,CAAA,EAAA,EAAK,GAAG,CAAA,gBAAA,CAAkB,CAAC;AAC/B;;;;"}
@@ -1,13 +1,6 @@
1
1
  import { tuiIsNumber, tuiRoundWith, CHAR_HYPHEN, CHAR_PLUS } from '@taiga-ui/cdk';
2
2
  import { TUI_DEFAULT_NUMBER_FORMAT } from '@taiga-ui/core/constants';
3
3
 
4
- /**
5
- * Capitalizes a given string, replacing it with a lowercase string and making
6
- * the first letter of each word uppercase.
7
- *
8
- * @param value the input string
9
- * @return the capitalized string
10
- */
11
4
  function tuiCapitalize(value) {
12
5
  return value.toLowerCase().replace(/(?:^|\s)\S/g, char => char.toUpperCase());
13
6
  }
@@ -16,12 +9,6 @@ function tuiCapitalizeFirstLetter(value) {
16
9
  return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
17
10
  }
18
11
 
19
- /**
20
- * Convert number to string with replacing exponent part on decimals
21
- *
22
- * @param value the number
23
- * @return string representation of a number
24
- */
25
12
  function tuiNumberToStringWithoutExp(value) {
26
13
  const valueAsString = String(value);
27
14
  const [numberPart, expPart] = valueAsString.split(`e-`);
@@ -34,13 +21,6 @@ function tuiNumberToStringWithoutExp(value) {
34
21
  return valueWithoutExp;
35
22
  }
36
23
 
37
- /**
38
- * Return fractional part of number
39
- *
40
- * @param value the number
41
- * @param precision number of digits of decimal part, null to keep untouched
42
- * @return the fractional part of number
43
- */
44
24
  function tuiGetFractionPartPadded(value, precision) {
45
25
  const [, fractionPartPadded = ``] = tuiNumberToStringWithoutExp(value).split(`.`);
46
26
  return tuiIsNumber(precision)
@@ -48,14 +28,6 @@ function tuiGetFractionPartPadded(value, precision) {
48
28
  : fractionPartPadded;
49
29
  }
50
30
 
51
- /**
52
- * Formats number adding a thousand separators and correct decimal separator
53
- * padding decimal part with zeroes to given length
54
- *
55
- * @param value the input number
56
- * @param settings See {@link TuiNumberFormatSettings}
57
- * @return the formatted string
58
- */
59
31
  function tuiFormatNumber(value, settings = {}) {
60
32
  const { decimalLimit, decimalSeparator, thousandSeparator, zeroPadding, rounding } = Object.assign(Object.assign({}, TUI_DEFAULT_NUMBER_FORMAT), settings);
61
33
  const rounded = Number.isFinite(decimalLimit)
@@ -85,25 +57,6 @@ function tuiFormatNumber(value, settings = {}) {
85
57
  return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;
86
58
  }
87
59
 
88
- /**
89
- * TODO: delete in v4.0
90
- * @deprecated Use {@link https://maskito.dev/core-concepts/transformer maskitoTransform} instead<br/>
91
- * @example
92
- * import {maskitoTransform} from '@maskito/core';
93
- *
94
- * const mask = {
95
- * mask: ['+', '1', ' ', /\d/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
96
- * };
97
- * maskitoTransform('12125552368', mask); // +1 (212) 555-2368
98
- * ___
99
- * Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,
100
- * adding parentheses and hyphens.
101
- *
102
- * @param value the input string
103
- * @param countryCode a country code
104
- * @param phoneMask a phone number mask
105
- * @return the formatted phone string of the form +7 XXX XXX-XX-XX
106
- */
107
60
  function tuiFormatPhone(value, countryCode, phoneMask) {
108
61
  if (!value) {
109
62
  return ``;
@@ -138,9 +91,5 @@ function tuiOtherDecimalSymbol(symbol) {
138
91
  return symbol === `.` ? `,` : `.`;
139
92
  }
140
93
 
141
- /**
142
- * Generated bundle index. Do not edit.
143
- */
144
-
145
94
  export { tuiCapitalize, tuiCapitalizeFirstLetter, tuiFormatNumber, tuiFormatPhone, tuiGetFractionPartPadded, tuiNumberToStringWithoutExp, tuiOtherDecimalSymbol };
146
95
  //# sourceMappingURL=taiga-ui-core-utils-format.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-utils-format.js","sources":["../../../projects/core/utils/format/capitalize.ts","../../../projects/core/utils/format/capitalize-first-letter.ts","../../../projects/core/utils/format/number-to-string-without-exp.ts","../../../projects/core/utils/format/get-fractional-part-padded.ts","../../../projects/core/utils/format/format-number.ts","../../../projects/core/utils/format/format-phone.ts","../../../projects/core/utils/format/other-decimal-symbol.ts","../../../projects/core/utils/format/taiga-ui-core-utils-format.ts"],"sourcesContent":["/**\n * Capitalizes a given string, replacing it with a lowercase string and making\n * the first letter of each word uppercase.\n *\n * @param value the input string\n * @return the capitalized string\n */\nexport function tuiCapitalize(value: string): string {\n return value.toLowerCase().replace(/(?:^|\\s)\\S/g, char => char.toUpperCase());\n}\n","export function tuiCapitalizeFirstLetter(value: string): string {\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n","/**\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\nexport function tuiNumberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split(`e-`);\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart] = numberPart.split(`.`);\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n","import {tuiIsNumber} from '@taiga-ui/cdk';\n\nimport {tuiNumberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\nexport function tuiGetFractionPartPadded(\n value: number,\n precision?: number | null,\n): string {\n const [, fractionPartPadded = ``] = tuiNumberToStringWithoutExp(value).split(`.`);\n\n return tuiIsNumber(precision)\n ? fractionPartPadded.slice(0, Math.max(0, precision))\n : fractionPartPadded;\n}\n","import {CHAR_HYPHEN, tuiRoundWith} from '@taiga-ui/cdk';\nimport {TUI_DEFAULT_NUMBER_FORMAT} from '@taiga-ui/core/constants';\nimport {TuiNumberFormatSettings} from '@taiga-ui/core/interfaces';\n\nimport {tuiGetFractionPartPadded} from './get-fractional-part-padded';\n\n/**\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param settings See {@link TuiNumberFormatSettings}\n * @return the formatted string\n */\nexport function tuiFormatNumber(\n value: number,\n settings: Partial<TuiNumberFormatSettings> = {},\n): string {\n const {decimalLimit, decimalSeparator, thousandSeparator, zeroPadding, rounding} = {\n ...TUI_DEFAULT_NUMBER_FORMAT,\n ...settings,\n };\n\n const rounded = Number.isFinite(decimalLimit)\n ? tuiRoundWith({value, precision: decimalLimit, method: rounding})\n : value;\n const integerPartString = String(Math.floor(Math.abs(rounded)));\n\n let fractionPartPadded = tuiGetFractionPartPadded(rounded, decimalLimit);\n\n if (Number.isFinite(decimalLimit)) {\n if (zeroPadding) {\n const zeroPaddingSize: number = Math.max(\n decimalLimit - fractionPartPadded.length,\n 0,\n );\n const zeroPartString = `0`.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n } else {\n fractionPartPadded = fractionPartPadded.replace(/0*$/, ``);\n }\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? CHAR_HYPHEN : ``;\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;\n}\n","import {CHAR_PLUS} from '@taiga-ui/cdk';\n\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/core-concepts/transformer maskitoTransform} instead<br/>\n * @example\n * import {maskitoTransform} from '@maskito/core';\n *\n * const mask = {\n * mask: ['+', '1', ' ', /\\d/, /\\d/, /\\d/, ')', ' ', /\\d/, /\\d/, /\\d/, '-', /\\d/, /\\d/, /\\d/, /\\d/],\n * };\n * maskitoTransform('12125552368', mask); // +1 (212) 555-2368\n * ___\n * Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,\n * adding parentheses and hyphens.\n *\n * @param value the input string\n * @param countryCode a country code\n * @param phoneMask a phone number mask\n * @return the formatted phone string of the form +7 XXX XXX-XX-XX\n */\nexport function tuiFormatPhone(\n value: string,\n countryCode: string,\n phoneMask: string,\n): string {\n if (!value) {\n return ``;\n }\n\n let result = countryCode;\n\n countryCode = countryCode.replace(/[()]/g, ``);\n\n if (!value.startsWith(countryCode)) {\n value = countryCode + value.replace(CHAR_PLUS, ``);\n }\n\n const splitPhoneMask = phoneMask.split(``);\n const splitValue = value.slice(countryCode.length).split(``);\n\n result += ` `;\n\n if (splitValue.length === 0) {\n return result;\n }\n\n for (const mask of splitPhoneMask) {\n if (splitValue.length === 0) {\n break;\n }\n\n if (mask === `#`) {\n result += splitValue[0] || ``;\n splitValue.splice(0, 1);\n } else {\n result += mask;\n }\n }\n\n return result;\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\nexport function tuiOtherDecimalSymbol(symbol: TuiDecimalSymbol): TuiDecimalSymbol {\n return symbol === `.` ? `,` : `.`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;;;;AAMG;AACG,SAAU,aAAa,CAAC,KAAa,EAAA;AACvC,IAAA,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AAClF;;ACTM,SAAU,wBAAwB,CAAC,KAAa,EAAA;AAClD,IAAA,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CA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QAAA,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,MAAM;AACT,SAAA;QAED,IAAI,IAAI,KAAK,CAAA,CAAA,CAAG,EAAE;AACd,YAAA,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9B,YAAA,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3B,SAAA;AAAM,aAAA;YACH,MAAM,IAAI,IAAI,CAAC;AAClB,SAAA;AACJ,KAAA;AAED,IAAA,OAAO,MAAM,CAAC;AAClB;;AC3DM,SAAU,qBAAqB,CAAC,MAAwB,EAAA;IAC1D,OAAO,MAAM,KAAK,CAAA,CAAA,CAAG,GAAG,CAAA,CAAA,CAAG,GAAG,CAAA,CAAA,CAAG,CAAC;AACtC;;ACJA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-utils-format.js","sources":["../../../projects/core/utils/format/capitalize.ts","../../../projects/core/utils/format/capitalize-first-letter.ts","../../../projects/core/utils/format/number-to-string-without-exp.ts","../../../projects/core/utils/format/get-fractional-part-padded.ts","../../../projects/core/utils/format/format-number.ts","../../../projects/core/utils/format/format-phone.ts","../../../projects/core/utils/format/other-decimal-symbol.ts"],"sourcesContent":["/**\n * Capitalizes a given string, replacing it with a lowercase string and making\n * the first letter of each word uppercase.\n *\n * @param value the input string\n * @return the capitalized string\n */\nexport function tuiCapitalize(value: string): string {\n return value.toLowerCase().replace(/(?:^|\\s)\\S/g, char => char.toUpperCase());\n}\n","export function tuiCapitalizeFirstLetter(value: string): string {\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n","/**\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\nexport function tuiNumberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split(`e-`);\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart] = numberPart.split(`.`);\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n","import {tuiIsNumber} from '@taiga-ui/cdk';\n\nimport {tuiNumberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\nexport function tuiGetFractionPartPadded(\n value: number,\n precision?: number | null,\n): string {\n const [, fractionPartPadded = ``] = tuiNumberToStringWithoutExp(value).split(`.`);\n\n return tuiIsNumber(precision)\n ? fractionPartPadded.slice(0, Math.max(0, precision))\n : fractionPartPadded;\n}\n","import {CHAR_HYPHEN, tuiRoundWith} from '@taiga-ui/cdk';\nimport {TUI_DEFAULT_NUMBER_FORMAT} from '@taiga-ui/core/constants';\nimport {TuiNumberFormatSettings} from '@taiga-ui/core/interfaces';\n\nimport {tuiGetFractionPartPadded} from './get-fractional-part-padded';\n\n/**\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param settings See {@link TuiNumberFormatSettings}\n * @return the formatted string\n */\nexport function tuiFormatNumber(\n value: number,\n settings: Partial<TuiNumberFormatSettings> = {},\n): string {\n const {decimalLimit, decimalSeparator, thousandSeparator, zeroPadding, rounding} = {\n ...TUI_DEFAULT_NUMBER_FORMAT,\n ...settings,\n };\n\n const rounded = Number.isFinite(decimalLimit)\n ? tuiRoundWith({value, precision: decimalLimit, method: rounding})\n : value;\n const integerPartString = String(Math.floor(Math.abs(rounded)));\n\n let fractionPartPadded = tuiGetFractionPartPadded(rounded, decimalLimit);\n\n if (Number.isFinite(decimalLimit)) {\n if (zeroPadding) {\n const zeroPaddingSize: number = Math.max(\n decimalLimit - fractionPartPadded.length,\n 0,\n );\n const zeroPartString = `0`.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n } else {\n fractionPartPadded = fractionPartPadded.replace(/0*$/, ``);\n }\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? CHAR_HYPHEN : ``;\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;\n}\n","import {CHAR_PLUS} from '@taiga-ui/cdk';\n\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/core-concepts/transformer maskitoTransform} instead<br/>\n * @example\n * import {maskitoTransform} from '@maskito/core';\n *\n * const mask = {\n * mask: ['+', '1', ' ', /\\d/, /\\d/, /\\d/, ')', ' ', /\\d/, /\\d/, /\\d/, '-', /\\d/, /\\d/, /\\d/, /\\d/],\n * };\n * maskitoTransform('12125552368', mask); // +1 (212) 555-2368\n * ___\n * Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,\n * adding parentheses and hyphens.\n *\n * @param value the input string\n * @param countryCode a country code\n * @param phoneMask a phone number mask\n * @return the formatted phone string of the form +7 XXX XXX-XX-XX\n */\nexport function tuiFormatPhone(\n value: string,\n countryCode: string,\n phoneMask: string,\n): string {\n if (!value) {\n return ``;\n }\n\n let result = countryCode;\n\n countryCode = countryCode.replace(/[()]/g, ``);\n\n if (!value.startsWith(countryCode)) {\n value = countryCode + value.replace(CHAR_PLUS, ``);\n }\n\n const splitPhoneMask = phoneMask.split(``);\n const splitValue = value.slice(countryCode.length).split(``);\n\n result += ` `;\n\n if (splitValue.length === 0) {\n return result;\n }\n\n for (const mask of splitPhoneMask) {\n if (splitValue.length === 0) {\n break;\n }\n\n if (mask === `#`) {\n result += splitValue[0] || ``;\n splitValue.splice(0, 1);\n } else {\n result += mask;\n }\n }\n\n return result;\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\nexport function tuiOtherDecimalSymbol(symbol: TuiDecimalSymbol): TuiDecimal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AM,CAAC,CAAC,KAAK,CAAC,CAAA,CAAE,CAAC,CAAC;IAE7D,MAAM,IAAI,GAAG,CAAC;AAEd,IAAA,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;AACzB,QAAA,OAAO,MAAM,CAAC;AACjB,KAAA;AAED,IAAA,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE;AAC/B,QAAA,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,MAAM;AACT,SAAA;QAED,IAAI,IAAI,KAAK,CAAA,CAAA,CAAG,EAAE;AACd,YAAA,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9B,YAAA,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3B,SAAA;AAAM,aAAA;YACH,MAAM,IAAI,IAAI,CAAC;AAClB,SAAA;AACJ,KAAA;AAED,IAAA,OAAO,MAAM,CAAC;AAClB;;AC3DM,SAAU,qBAAqB,CAAC,MAAwB,EAAA;IAC1D,OAAO,MAAM,KAAK,CAAA,CAAA,CAAG,GAAG,CAAA,CAAA,CAAG,GAAG,CAAA,CAAA,CAAG,CAAC;AACtC;;;;"}
@@ -2,14 +2,8 @@ import { tuiAssert, tuiIsSafari, CHAR_HYPHEN, tuiIsNativeFocused, tuiGetDocument
2
2
  import { MASK_CARET_TRAP, TUI_DIGIT_REGEXP, TUI_NON_DIGITS_REGEXP, TUI_LEADING_ZEROES_REGEXP, TUI_DECIMAL_SYMBOLS } from '@taiga-ui/core/constants';
3
3
  import { tuiOtherDecimalSymbol } from '@taiga-ui/core/utils/format';
4
4
 
5
- /**
6
- * TODO: delete in v4.0
7
- * @deprecated Use {@link https://maskito.dev/kit/number Number} from {@link https://github.com/taiga-family/maskito Maskito} instead <br/>
8
- * Used to finish a number with zeros to a given precision
9
- */
10
5
  function tuiCreateAutoCorrectedNumberPipe(decimalLimit = 0, decimalSymbol = `,`, thousandSymbol = CHAR_NO_BREAK_SPACE, nativeInput, allowNegative, isIOS = false) {
11
6
  ngDevMode && tuiAssert.assert(decimalLimit >= 0);
12
- // Guess for which browser I need this :)
13
7
  let previousCaret = -1;
14
8
  const unlucky = (!!nativeInput && tuiIsSafari(nativeInput)) || isIOS;
15
9
  if (nativeInput && unlucky) {
@@ -18,11 +12,9 @@ function tuiCreateAutoCorrectedNumberPipe(decimalLimit = 0, decimalSymbol = `,`,
18
12
  });
19
13
  }
20
14
  return (conformedValue, config) => {
21
- // Removing everything by selecting and pressing '-'
22
15
  if (!conformedValue && config.rawValue === CHAR_HYPHEN && allowNegative) {
23
16
  return CHAR_HYPHEN;
24
17
  }
25
- // remove these hacks after text mask library has changed
26
18
  if (nativeInput && unlucky && tuiIsNativeFocused(nativeInput)) {
27
19
  const caret = calculateSafariCaret(config.previousConformedValue, conformedValue, previousCaret);
28
20
  setTimeout(() => {
@@ -94,10 +86,6 @@ function calculateCaretGap(previousValue = ``, current, thousandSymbol) {
94
86
  }
95
87
 
96
88
  const ASSERTION = `Correction function must return single char or null`;
97
- /**
98
- * TODO: delete in v4.0
99
- * @deprecated Use {@link https://maskito.dev/core-concepts/processors processors} from {@link https://github.com/taiga-family/maskito Maskito}
100
- */
101
89
  function tuiCreateCorrectionMask(allowed, correctionHandler) {
102
90
  return rawValue => {
103
91
  const mask = rawValue.split(``).reduce((result, char, index) => {
@@ -124,16 +112,10 @@ function tuiCreateCorrectionMask(allowed, correctionHandler) {
124
112
  }
125
113
 
126
114
  const NON_ZERO_DIGIT = /[1-9]/;
127
- /**
128
- * TODO: delete in v4.0
129
- * @deprecated Use {@link https://maskito.dev/kit/number Number} from {@link https://github.com/taiga-family/maskito Maskito} instead <br/>
130
- * Adaptation for {@link https://github.com/text-mask/text-mask/tree/master/addons#createnumbermask `createNumberMask`}
131
- */
132
115
  function tuiCreateNumberMask({ allowDecimal = false, decimalSymbol = `,`, thousandSymbol = CHAR_NO_BREAK_SPACE, autoCorrectDecimalSymbol = true, decimalLimit = 2, requireDecimal = false, allowNegative = false, integerLimit = 0, } = {}) {
133
116
  ngDevMode && tuiAssert.assert(decimalLimit >= 0);
134
117
  ngDevMode && tuiAssert.assert(Number.isInteger(integerLimit));
135
118
  ngDevMode && tuiAssert.assert(integerLimit >= 0);
136
- // eslint-disable-next-line max-statements
137
119
  return (rawValue, { previousConformedValue }) => {
138
120
  if (previousConformedValue && requireDecimal) {
139
121
  const conformedWithoutSeparator = rawValue.split(thousandSymbol).join(``);
@@ -142,7 +124,6 @@ function tuiCreateNumberMask({ allowDecimal = false, decimalSymbol = `,`, thousa
142
124
  .join(``)
143
125
  .split(decimalSymbol)
144
126
  .join(``);
145
- // Forbid removal of decimal separator if decimal part is required
146
127
  if (conformedWithoutSeparator ===
147
128
  previousConformedValueWithoutDecimalSymbolAndSeparator) {
148
129
  rawValue = previousConformedValue;
@@ -236,27 +217,15 @@ function convertToMask(strNumber) {
236
217
  }
237
218
  function addThousandsSeparator(strNumber, thousandSymbol) {
238
219
  return strNumber.length > 3
239
- ? // TODO: investigate to disallow potentially catastrophic exponential-time regular expressions.
240
- // eslint-disable-next-line unicorn/no-unsafe-regex
220
+ ?
241
221
  strNumber.replace(/\B(?=(\d{3})+(?!\d))/g, thousandSymbol)
242
222
  : strNumber;
243
223
  }
244
224
 
245
- /**
246
- * TODO: delete in v4.0
247
- * @deprecated Use {@link https://maskito.dev/kit/number Number} from {@link https://github.com/taiga-family/maskito Maskito} instead
248
- */
249
225
  function tuiEnableAutoCorrectDecimalSymbol({ thousandSeparator, }) {
250
226
  return !TUI_DECIMAL_SYMBOLS.includes(thousandSeparator);
251
227
  }
252
228
 
253
- /**
254
- * TODO: delete in v4.0
255
- * @deprecated use {@link https://maskito.dev/kit/number maskitoParseNumber} instead
256
- * ```ts
257
- * Number.isNaN(maskitoParseNumber(value, decimalSeparator))
258
- * ```
259
- */
260
229
  function tuiMaskedMoneyValueIsEmpty(value) {
261
230
  switch (value) {
262
231
  case ``:
@@ -269,17 +238,9 @@ function tuiMaskedMoneyValueIsEmpty(value) {
269
238
  }
270
239
  }
271
240
 
272
- /**
273
- * TODO: delete in v4.0
274
- * @deprecated use {@link https://maskito.dev/kit/number maskitoParseNumber} instead
275
- */
276
241
  function tuiMaskedNumberStringToNumber(value, decimalsSymbol, thousandSymbol) {
277
242
  return parseFloat(value.split(thousandSymbol).join(``).split(decimalsSymbol).join(`.`));
278
243
  }
279
244
 
280
- /**
281
- * Generated bundle index. Do not edit.
282
- */
283
-
284
245
  export { tuiCreateAutoCorrectedNumberPipe, tuiCreateCorrectionMask, tuiCreateNumberMask, tuiEnableAutoCorrectDecimalSymbol, tuiMaskedMoneyValueIsEmpty, tuiMaskedNumberStringToNumber };
285
246
  //# sourceMappingURL=taiga-ui-core-utils-mask.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-utils-mask.js","sources":["../../../projects/core/utils/mask/create-auto-corrected-money-pipe.ts","../../../projects/core/utils/mask/create-correction-mask.ts","../../../projects/core/utils/mask/create-number-mask.ts","../../../projects/core/utils/mask/enable-auto-correct-decimal-symbol.ts","../../../projects/core/utils/mask/masked-money-value-is-empty.ts","../../../projects/core/utils/mask/masked-number-string-to-number.ts","../../../projects/core/utils/mask/taiga-ui-core-utils-mask.ts"],"sourcesContent":["import {\n CHAR_HYPHEN,\n CHAR_NO_BREAK_SPACE,\n tuiAssert,\n tuiGetDocumentOrShadowRoot,\n tuiIsNativeFocused,\n tuiIsSafari,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/kit/number Number} from {@link https://github.com/taiga-family/maskito Maskito} instead <br/>\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 | null,\n allowNegative?: boolean,\n isIOS = false,\n): TuiTextMaskPipeHandler {\n ngDevMode && tuiAssert.assert(decimalLimit >= 0);\n\n // Guess for which browser I need this :)\n let previousCaret = -1;\n const unlucky = (!!nativeInput && tuiIsSafari(nativeInput)) || isIOS;\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 === CHAR_HYPHEN && allowNegative) {\n return CHAR_HYPHEN;\n }\n\n // remove these hacks after text mask library has changed\n if (nativeInput && unlucky && tuiIsNativeFocused(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 !== tuiGetDocumentOrShadowRoot(nativeInput) &&\n tuiIsNativeFocused(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 || !Number.isInteger(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.includes(decimalSymbol) ? 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\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/core-concepts/processors processors} from {@link https://github.com/taiga-family/maskito Maskito}\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 ngDevMode &&\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_HYPHEN, 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 {tuiOtherDecimalSymbol} from '@taiga-ui/core/utils/format';\n\nconst NON_ZERO_DIGIT = /[1-9]/;\n\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/kit/number Number} from {@link https://github.com/taiga-family/maskito Maskito} instead <br/>\n * Adaptation for {@link https://github.com/text-mask/text-mask/tree/master/addons#createnumbermask `createNumberMask`}\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 ngDevMode && tuiAssert.assert(decimalLimit >= 0);\n ngDevMode && tuiAssert.assert(Number.isInteger(integerLimit));\n ngDevMode && tuiAssert.assert(integerLimit >= 0);\n\n // eslint-disable-next-line max-statements\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?.startsWith(CHAR_HYPHEN) || rawValue?.startsWith(CHAR_EN_DASH)) &&\n 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.slice(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] !== tuiOtherDecimalSymbol(decimalSymbol)) {\n mask.push(MASK_CARET_TRAP);\n }\n\n mask.push(decimalSymbol, MASK_CARET_TRAP, ...fractionCapped);\n\n for (let i = 0; i < Math.min(decimalLimit - fractionCapped.length, 20); 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(CHAR_HYPHEN);\n }\n\n return preventLeadingZeroes(mask, isOnlyZeroDigit, leadingZerosAmount);\n };\n}\n\nfunction preventLeadingZeroes(\n mask: Array<RegExp | string>,\n isOnlyZeroDigit: boolean = false,\n leadingZerosAmount: number = 0,\n): Array<RegExp | string> {\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 }\n\n 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(tuiOtherDecimalSymbol(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<RegExp | string> {\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 ? // TODO: investigate to disallow potentially catastrophic exponential-time regular expressions.\n // eslint-disable-next-line unicorn/no-unsafe-regex\n strNumber.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandSymbol)\n : strNumber;\n}\n","import {TUI_DECIMAL_SYMBOLS} from '@taiga-ui/core/constants';\nimport {TuiNumberFormatSettings} from '@taiga-ui/core/interfaces';\n\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/kit/number Number} from {@link https://github.com/taiga-family/maskito Maskito} instead\n */\nexport function tuiEnableAutoCorrectDecimalSymbol({\n thousandSeparator,\n}: TuiNumberFormatSettings): boolean {\n return !TUI_DECIMAL_SYMBOLS.includes(thousandSeparator);\n}\n","import {CHAR_HYPHEN} from '@taiga-ui/cdk';\n\n/**\n * TODO: delete in v4.0\n * @deprecated use {@link https://maskito.dev/kit/number maskitoParseNumber} instead\n * ```ts\n * Number.isNaN(maskitoParseNumber(value, decimalSeparator))\n * ```\n */\nexport function tuiMaskedMoneyValueIsEmpty(value: string): boolean {\n switch (value) {\n case ``:\n case CHAR_HYPHEN:\n case `,`:\n case `${CHAR_HYPHEN},`:\n return true;\n default:\n return false;\n }\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * TODO: delete in v4.0\n * @deprecated use {@link https://maskito.dev/kit/number maskitoParseNumber} instead\n */\nexport function tuiMaskedNumberStringToNumber(\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"],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AC;AACpB;;ACpMA;;;AAGG;AACa,SAAA,iCAAiC,CAAC,EAC9C,iBAAiB,GACK,EAAA;AACtB,IAAA,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAC5D;;ACTA;;;;;;AAMG;AACG,SAAU,0BAA0B,CAAC,KAAa,EAAA;AACpD,IAAA,QAAQ,KAAK;AACT,QAAA,KAAK,EAAE,CAAC;AACR,QAAA,KAAK,WAAW,CAAC;AACjB,QAAA,KAAK,GAAG,CAAC;QACT,KAAK,CAAA,EAAG,WAAW,CAAG,CAAA,CAAA;AAClB,YAAA,OAAO,IAAI,CAAC;AAChB,QAAA;AACI,YAAA,OAAO,KAAK,CAAC;AACpB,KAAA;AACL;;ACjBA;;;AAGG;SACa,6BAA6B,CACzC,KAAa,EACb,cAAgC,EAChC,cAAsB,EAAA;IAEtB,OAAO,UAAU,CACb,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAA,CAAA,CAAG,CAAC,CACvE,CAAC;AACN;;ACdA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-utils-mask.js","sources":["../../../projects/core/utils/mask/create-auto-corrected-money-pipe.ts","../../../projects/core/utils/mask/create-correction-mask.ts","../../../projects/core/utils/mask/create-number-mask.ts","../../../projects/core/utils/mask/enable-auto-correct-decimal-symbol.ts","../../../projects/core/utils/mask/masked-money-value-is-empty.ts","../../../projects/core/utils/mask/masked-number-string-to-number.ts"],"sourcesContent":["import {\n CHAR_HYPHEN,\n CHAR_NO_BREAK_SPACE,\n tuiAssert,\n tuiGetDocumentOrShadowRoot,\n tuiIsNativeFocused,\n tuiIsSafari,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/kit/number Number} from {@link https://github.com/taiga-family/maskito Maskito} instead <br/>\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 | null,\n allowNegative?: boolean,\n isIOS = false,\n): TuiTextMaskPipeHandler {\n ngDevMode && tuiAssert.assert(decimalLimit >= 0);\n\n // Guess for which browser I need this :)\n let previousCaret = -1;\n const unlucky = (!!nativeInput && tuiIsSafari(nativeInput)) || isIOS;\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 === CHAR_HYPHEN && allowNegative) {\n return CHAR_HYPHEN;\n }\n\n // remove these hacks after text mask library has changed\n if (nativeInput && unlucky && tuiIsNativeFocused(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 !== tuiGetDocumentOrShadowRoot(nativeInput) &&\n tuiIsNativeFocused(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 || !Number.isInteger(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.includes(decimalSymbol) ? 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\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/core-concepts/processors processors} from {@link https://github.com/taiga-family/maskito Maskito}\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 ngDevMode &&\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_HYPHEN, 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 {tuiOtherDecimalSymbol} from '@taiga-ui/core/utils/format';\n\nconst NON_ZERO_DIGIT = /[1-9]/;\n\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/kit/number Number} from {@link https://github.com/taiga-family/maskito Maskito} instead <br/>\n * Adaptation for {@link https://github.com/text-mask/text-mask/tree/master/addons#createnumbermask `createNumberMask`}\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 ngDevMode && tuiAssert.assert(decimalLimit >= 0);\n ngDevMode && tuiAssert.assert(Number.isInteger(integerLimit));\n ngDevMode && tuiAssert.assert(integerLimit >= 0);\n\n // eslint-disable-next-line max-statements\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?.startsWith(CHAR_HYPHEN) || rawValue?.startsWith(CHAR_EN_DASH)) &&\n 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.slice(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] !== tuiOtherDecimalSymbol(decimalSymbol)) {\n mask.push(MASK_CARET_TRAP);\n }\n\n mask.push(decimalSymbol, MASK_CARET_TRAP, ...fractionCapped);\n\n for (let i = 0; i < Math.min(decimalLimit - fractionCapped.length, 20); 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(CHAR_HYPHEN);\n }\n\n return preventLeadingZeroes(mask, isOnlyZeroDigit, leadingZerosAmount);\n };\n}\n\nfunction preventLeadingZeroes(\n mask: Array<RegExp | string>,\n isOnlyZeroDigit: boolean = false,\n leadingZerosAmount: number = 0,\n): Array<RegExp | string> {\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 }\n\n 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(tuiOtherDecimalSymbol(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<RegExp | string> {\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 ? // TODO: investigate to disallow potentially catastrophic exponential-time regular expressions.\n // eslint-disable-next-line unicorn/no-unsafe-regex\n strNumber.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandSymbol)\n : strNumber;\n}\n","import {TUI_DECIMAL_SYMBOLS} from '@taiga-ui/core/constants';\nimport {TuiNumberFormatSettings} from '@taiga-ui/core/interfaces';\n\n/**\n * TODO: delete in v4.0\n * @deprecated Use {@link https://maskito.dev/kit/number Number} from {@link https://github.com/taiga-family/maskito Maskito} instead\n */\nexport function tuiEnableAutoCorrectDecimalSymbol({\n thousandSeparator,\n}: TuiNumberFormatSettings): boolean {\n return !TUI_DECIMAL_SYMBOLS.includes(thousandSeparator);\n}\n","import {CHAR_HYPHEN} from '@taiga-ui/cdk';\n\n/**\n * TODO: delete in v4.0\n * @deprecated use {@link https://maskito.dev/kit/number maskitoParseNumber} instead\n * ```ts\n * Number.isNaN(maskitoParseNumber(value, decimalSeparator))\n * ```\n */\nexport function tuiMaskedMoneyValueIsEmpty(value: string): boolean {\n switch (value) {\n case ``:\n case CHAR_HYPHEN:\n case `,`:\n case `${CHAR_HYPHEN},`:\n return true;\n default:\n return false;\n }\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * TODO: delete in v4.0\n * @deprecated use {@link https://maskito.dev/kit/number maskitoParseNumber} instead\n */\nexport function tuiMaskedNumberStringToNumber(\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"],"names":[],"mappings":";;;;SAgBgB,gCAAgC,CAC5C,eAAuB,CAAC,EACxB,gBAAkC,CAAG,CAAA,CAAA,EACrC,cAAyB,GAAA,mBAAmB,EAC5C,WAAqC,EACrC,aAAuB,EACvB,KAAK,GAAG,KAAK,EAAA;IAEb,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC;AAGjD,IAAA,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC;AACvB,IAAA,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,WAAW,CAAC,WAAW,CAAC,KAAK,KAAK,CAAC;IAErE,IAAI,WAAW,IAAI,OAAO,EAAE;AACxB,QAAA,WAAW,CAAC,gBAAgB,CAAC,CAAa,WAAA,CAAA,EAAE,MAAK;AAC7C,YAAA,aAAa,GAAG,WAAW,CAAC,cAAc,IAAI,CAAC,CAAC;AACpD,SAAC,CAAC,CAAC;AACN,KAAA;AAED,IAAA,OAAO,CAAC,cAAc,EAAE,MAAM,KAAI;QAE9B,IAAI,CAAC,cAAc,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,aAAa,EAAE;AACrE,YAAA,OAAO,WAAW,CAAC;AACtB,SAAA;QAGD,IAAI,WAAW,IAAI,OAAO,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE;AAC3D,YAAA,MAAM,KAAK,GAAG,oBAAoB,CAC9B,MAAM,CAAC,sBAAsB,EAC7B,cAAc,EACd,aAAa,CAChB,CAAC;YAEF,UAAU,CAAC,MAAK;AACZ,gBAAA,WAAW,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAChD,aAAC,CAAC,CAAC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pE,IAAA,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC;;AAGrB,YAAA,SAAS,CAAC,OAAO,CAAC,uBAAuB,EAAE,cAAc,CAAC;UAC1D,SAAS,CAAC;AACpB;;AChMgB,SAAA,iCAAiC,CAAC,EAC9C,iBAAiB,GACK,EAAA;AACtB,IAAA,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAC5D;;ACFM,SAAU,0BAA0B,CAAC,KAAa,EAAA;AACpD,IAAA,QAAQ,KAAK;AACT,QAAA,KAAK,EAAE,CAAC;AACR,QAAA,KAAK,WAAW,CAAC;AACjB,QAAA,KAAK,GAAG,CAAC;QACT,KAAK,CAAA,EAAG,WAAW,CAAG,CAAA,CAAA;AAClB,YAAA,OAAO,IAAI,CAAC;AAChB,QAAA;AACI,YAAA,OAAO,KAAK,CAAC;AACpB,KAAA;AACL;;SCbgB,6BAA6B,CACzC,KAAa,EACb,cAAgC,EAChC,cAAsB,EAAA;IAEtB,OAAO,UAAU,CACb,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAA,CAAA,CAAG,CAAC,CACvE,CAAC;AACN;;;;"}
@@ -31,16 +31,10 @@ function tuiIconsPathFactory(staticPath) {
31
31
  };
32
32
  }
33
33
 
34
- /**
35
- * Check if pressed key is interactive in terms of input field
36
- */
37
34
  function tuiIsEditingKey(key) {
38
35
  return key.length === 1 || tuiEditingKeys.includes(key);
39
36
  }
40
37
 
41
- /**
42
- * @internal
43
- */
44
38
  function tuiIsObscured(el, exceptSelector = `tui-hints-host`) {
45
39
  var _a;
46
40
  return !!((_a = tuiGetElementObscures(el)) === null || _a === void 0 ? void 0 : _a.some(el => !el.closest(exceptSelector)));
@@ -55,7 +49,6 @@ function tuiOverrideOptions(override, fallback) {
55
49
  return (directive, options) => {
56
50
  const result = directive || Object.assign({}, (options || fallback));
57
51
  Object.keys(override).forEach(key => {
58
- // Update directive props with new defaults before inputs are processed
59
52
  result[key] = override[key];
60
53
  });
61
54
  return result;
@@ -71,19 +64,9 @@ const SIZES = {
71
64
  xl: 5,
72
65
  xxl: 6,
73
66
  };
74
- /**
75
- * Compares size constants to determine if first size is bigger than the second
76
- *
77
- * @param size size that we need to compare
78
- * @param biggerThanSize size to compare with, 's' by default
79
- */
80
67
  function tuiSizeBigger(size, biggerThanSize = `s`) {
81
68
  return SIZES[size] > SIZES[biggerThanSize];
82
69
  }
83
70
 
84
- /**
85
- * Generated bundle index. Do not edit.
86
- */
87
-
88
71
  export { tuiGetBorder, tuiIconsPathFactory, tuiIsEditingKey, tuiIsObscured, tuiIsPresumedHTMLString, tuiOverrideOptions, tuiSizeBigger };
89
72
  //# sourceMappingURL=taiga-ui-core-utils-miscellaneous.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-utils-miscellaneous.js","sources":["../../../projects/core/utils/miscellaneous/get-border.ts","../../../projects/core/utils/miscellaneous/icons-path-factory.ts","../../../projects/core/utils/miscellaneous/is-editing-key.ts","../../../projects/core/utils/miscellaneous/is-obscured.ts","../../../projects/core/utils/miscellaneous/is-presumed-html-string.ts","../../../projects/core/utils/miscellaneous/override-options.ts","../../../projects/core/utils/miscellaneous/size-bigger.ts","../../../projects/core/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.ts"],"sourcesContent":["import {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\n\nconst ITEM_SIZE = 1.5;\nconst CONTENT_SIZE = 2.5;\n\nexport function tuiGetBorder(\n hasIcon: boolean,\n hasCleaner: boolean = false,\n hasTooltip: boolean = false,\n hasContent: boolean = false,\n size: TuiSizeL | TuiSizeS = `m`,\n): number {\n const offset = size === `s` ? 0 : 0.25;\n let border = 0;\n\n if (hasIcon) {\n border += ITEM_SIZE + offset;\n }\n\n if (hasCleaner) {\n border += ITEM_SIZE + offset;\n }\n\n if (hasTooltip) {\n border += ITEM_SIZE + offset;\n }\n\n if (hasContent) {\n border += CONTENT_SIZE + offset;\n }\n\n return border;\n}\n","import {TuiStringHandler} from '@taiga-ui/cdk';\nimport {DEFAULT_ICONS_PATH, TUI_CACHE_BUSTING_PAYLOAD} from '@taiga-ui/core/constants';\n\nexport function tuiIconsPathFactory(staticPath: string): TuiStringHandler<string> {\n const base = staticPath.endsWith(`/`) ? staticPath : `${staticPath}/`;\n\n return name => {\n if (name.startsWith(`tuiIcon`)) {\n return `${base}${name}.svg${TUI_CACHE_BUSTING_PAYLOAD}#${name}`;\n }\n\n return DEFAULT_ICONS_PATH(name);\n };\n}\n","import {tuiEditingKeys} from '@taiga-ui/core/constants';\n\n/**\n * Check if pressed key is interactive in terms of input field\n */\nexport function tuiIsEditingKey(key: string): boolean {\n return key.length === 1 || tuiEditingKeys.includes(key);\n}\n","import {tuiGetElementObscures} from '@taiga-ui/cdk';\n\n/**\n * @internal\n */\nexport function tuiIsObscured(\n el: HTMLElement,\n exceptSelector = `tui-hints-host`,\n): boolean {\n return !!tuiGetElementObscures(el)?.some(el => !el.closest(exceptSelector));\n}\n","export function tuiIsPresumedHTMLString(candidate: string): boolean {\n const trimmed = candidate.trim();\n\n return trimmed.startsWith(`<`) && trimmed.endsWith(`>`);\n}\n","export function tuiOverrideOptions<T>(\n override: Partial<T>,\n fallback: T,\n): (directive: T | null, options: T | null) => T {\n return (directive, options) => {\n const result = directive || {...(options || fallback)};\n\n Object.keys(override).forEach(key => {\n // Update directive props with new defaults before inputs are processed\n (result as any)[key] = override[key as keyof T];\n });\n\n return result;\n };\n}\n","import {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core/types';\n\nconst SIZES: Record<TuiSizeXXL | TuiSizeXXS, number> = {\n xxs: 0,\n xs: 1,\n s: 2,\n m: 3,\n l: 4,\n xl: 5,\n xxl: 6,\n};\n\n/**\n * Compares size constants to determine if first size is bigger than the second\n *\n * @param size size that we need to compare\n * @param biggerThanSize size to compare with, 's' by default\n */\nexport function tuiSizeBigger(\n size: TuiSizeXXL | TuiSizeXXS,\n biggerThanSize: TuiSizeXXL | TuiSizeXXS = `s`,\n): boolean {\n return SIZES[size] > SIZES[biggerThanSize];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,YAAY,GAAG,GAAG,CAAC;AAET,SAAA,YAAY,CACxB,OAAgB,EAChB,UAAsB,GAAA,KAAK,EAC3B,UAAA,GAAsB,KAAK,EAC3B,UAAA,GAAsB,KAAK,EAC3B,OAA4B,CAAG,CAAA,CAAA,EAAA;AAE/B,IAAA,MAAM,MAAM,GAAG,IAAI,KAAK,CAAG,CAAA,CAAA,GAAG,CAAC,GAAG,IAAI,CAAC;IACvC,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,IAAA,IAAI,OAAO,EAAE;AACT,QAAA,MAAM,IAAI,SAAS,GAAG,MAAM,CAAC;AAChC,KAAA;AAED,IAAA,IAAI,UAAU,EAAE;AACZ,QAAA,MAAM,IAAI,SAAS,GAAG,MAAM,CAAC;AAChC,KAAA;AAED,IAAA,IAAI,UAAU,EAAE;AACZ,QAAA,MAAM,IAAI,SAAS,GAAG,MAAM,CAAC;AAChC,KAAA;AAED,IAAA,IAAI,UAAU,EAAE;AACZ,QAAA,MAAM,IAAI,YAAY,GAAG,MAAM,CAAC;AACnC,KAAA;AAED,IAAA,OAAO,MAAM,CAAC;AAClB;;AC7BM,SAAU,mBAAmB,CAAC,UAAkB,EAAA;AAClD,IAAA,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,UAAU,GAAG,CAAG,EAAA,UAAU,GAAG,CAAC;IAEtE,OAAO,IAAI,IAAG;AACV,QAAA,IAAI,IAAI,CAAC,UAAU,CAAC,CAAA,OAAA,CAAS,CAAC,EAAE;YAC5B,OAAO,CAAA,EAAG,IAAI,CAAG,EAA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AAC;AAEH,QAAA,OAAO,MAAM,CAAC;AAClB,KAAC,CAAC;AACN;;ACZA,MAAM,KAAK,GAA4C;AACnD,IAAA,GAAG,EAAE,CAAC;AACN,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,GAAG,EAAE,CAAC;CACT,CAAC;AAEF;;;;;AAKG;SACa,aAAa,CACzB,IAA6B,EAC7B,iBAA0C,CAAG,CAAA,CAAA,EAAA;IAE7C,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAC/C;;ACvBA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-utils-miscellaneous.js","sources":["../../../projects/core/utils/miscellaneous/get-border.ts","../../../projects/core/utils/miscellaneous/icons-path-factory.ts","../../../projects/core/utils/miscellaneous/is-editing-key.ts","../../../projects/core/utils/miscellaneous/is-obscured.ts","../../../projects/core/utils/miscellaneous/is-presumed-html-string.ts","../../../projects/core/utils/miscellaneous/override-options.ts","../../../projects/core/utils/miscellaneous/size-bigger.ts"],"sourcesContent":["import {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\n\nconst ITEM_SIZE = 1.5;\nconst CONTENT_SIZE = 2.5;\n\nexport function tuiGetBorder(\n hasIcon: boolean,\n hasCleaner: boolean = false,\n hasTooltip: boolean = false,\n hasContent: boolean = false,\n size: TuiSizeL | TuiSizeS = `m`,\n): number {\n const offset = size === `s` ? 0 : 0.25;\n let border = 0;\n\n if (hasIcon) {\n border += ITEM_SIZE + offset;\n }\n\n if (hasCleaner) {\n border += ITEM_SIZE + offset;\n }\n\n if (hasTooltip) {\n border += ITEM_SIZE + offset;\n }\n\n if (hasContent) {\n border += CONTENT_SIZE + offset;\n }\n\n return border;\n}\n","import {TuiStringHandler} from '@taiga-ui/cdk';\nimport {DEFAULT_ICONS_PATH, TUI_CACHE_BUSTING_PAYLOAD} from '@taiga-ui/core/constants';\n\nexport function tuiIconsPathFactory(staticPath: string): TuiStringHandler<string> {\n const base = staticPath.endsWith(`/`) ? staticPath : `${staticPath}/`;\n\n return name => {\n if (name.startsWith(`tuiIcon`)) {\n return `${base}${name}.svg${TUI_CACHE_BUSTING_PAYLOAD}#${name}`;\n }\n\n return DEFAULT_ICONS_PATH(name);\n };\n}\n","import {tuiEditingKeys} from '@taiga-ui/core/constants';\n\n/**\n * Check if pressed key is interactive in terms of input field\n */\nexport function tuiIsEditingKey(key: string): boolean {\n return key.length === 1 || tuiEditingKeys.includes(key);\n}\n","import {tuiGetElementObscures} from '@taiga-ui/cdk';\n\n/**\n * @internal\n */\nexport function tuiIsObscured(\n el: HTMLElement,\n exceptSelector = `tui-hints-host`,\n): boolean {\n return !!tuiGetElementObscures(el)?.some(el => !el.closest(exceptSelector));\n}\n","export function tuiIsPresumedHTMLString(candidate: string): boolean {\n const trimmed = candidate.trim();\n\n return trimmed.startsWith(`<`) && trimmed.endsWith(`>`);\n}\n","export function tuiOverrideOptions<T>(\n override: Partial<T>,\n fallback: T,\n): (directive: T | null, options: T | null) => T {\n return (directive, options) => {\n const result = directive || {...(options || fallback)};\n\n Object.keys(override).forEach(key => {\n // Update directive props with new defaults before inputs are processed\n (result as any)[key] = override[key as keyof T];\n });\n\n return result;\n };\n}\n","import {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core/types';\n\nconst SIZES: Record<TuiSizeXXL | TuiSizeXXS, number> = {\n xxs: 0,\n xs: 1,\n s: 2,\n m: 3,\n l: 4,\n xl: 5,\n xxl: 6,\n};\n\n/**\n * Compares size constants to determine if first size is bigger than the second\n *\n * @param size size that we need to compare\n * @param biggerThanSize size to compare with, 's' by default\n */\nexport function tuiSizeBigger(\n size: TuiSizeXXL | TuiSizeXXS,\n biggerThanSize: TuiSizeXXL | TuiSizeXXS = `s`,\n): boolean {\n return SIZES[size] > SI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AC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,GAAG,EAAE,CAAC;CACT,CAAC;SAQc,aAAa,CACzB,IAA6B,EAC7B,iBAA0C,CAAG,CAAA,CAAA,EAAA;IAE7C,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAC/C;;;;"}
@@ -4,9 +4,5 @@ function tuiIsMobile(win, { mobile }) {
4
4
  return tuiGetViewportWidth(win) < mobile;
5
5
  }
6
6
 
7
- /**
8
- * Generated bundle index. Do not edit.
9
- */
10
-
11
7
  export { tuiIsMobile };
12
8
  //# sourceMappingURL=taiga-ui-core-utils-mobile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-utils-mobile.js","sources":["../../../projects/core/utils/mobile/is-mobile.ts","../../../projects/core/utils/mobile/taiga-ui-core-utils-mobile.ts"],"sourcesContent":["import {TuiMedia} from '@taiga-ui/core/interfaces';\nimport {tuiGetViewportWidth} from '@taiga-ui/core/utils/dom';\n\nexport function tuiIsMobile(win: Window, {mobile}: TuiMedia): boolean {\n return tuiGetViewportWidth(win) < mobile;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;SAGgB,WAAW,CAAC,GAAW,EAAE,EAAC,MAAM,EAAW,EAAA;AACvD,IAAA,OAAO,mBAAmB,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;AAC7C;;ACLA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-utils-mobile.js","sources":["../../../projects/core/utils/mobile/is-mobile.ts"],"sourcesContent":["import {TuiMedia} from '@taiga-ui/core/interfaces';\nimport {tuiGetViewportWidth} from '@taiga-ui/core/utils/dom';\n\nexport function tuiIsMobile(win: Window, {mobile}: TuiMedia): boolean {\n return tuiGetViewportWidth(win) < mobile;\n}\n"],"names":[],"mappings":";;SAGgB,WAAW,CAAC,GAAW,EAAE,EAAC,MAAM,EAAW,EAAA;AACvD,IAAA,OAAO,mBAAmB,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;AAC7C;;;;"}
@@ -3,8 +3,4 @@ export * from '@taiga-ui/core/utils/format';
3
3
  export * from '@taiga-ui/core/utils/mask';
4
4
  export * from '@taiga-ui/core/utils/miscellaneous';
5
5
  export * from '@taiga-ui/core/utils/mobile';
6
-
7
- /**
8
- * Generated bundle index. Do not edit.
9
- */
10
6
  //# sourceMappingURL=taiga-ui-core-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-utils.js","sources":["../../../projects/core/utils/taiga-ui-core-utils.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;AAEG"}
1
+ {"version":3,"file":"taiga-ui-core-utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}