@taiga-ui/cdk 2.75.0 → 2.76.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 (580) hide show
  1. package/abstract/dialog.service.d.ts +1 -1
  2. package/bundles/taiga-ui-cdk-abstract.umd.js +46 -1
  3. package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
  4. package/bundles/taiga-ui-cdk-abstract.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-classes.umd.js.map +1 -1
  6. package/bundles/taiga-ui-cdk-classes.umd.min.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-coercion.umd.js.map +1 -1
  8. package/bundles/taiga-ui-cdk-coercion.umd.min.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-components-alert-host.umd.js +47 -2
  10. package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
  11. package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js.map +1 -1
  12. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +50 -5
  13. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
  14. package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js.map +1 -1
  15. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +48 -3
  16. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
  17. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js.map +1 -1
  18. package/bundles/taiga-ui-cdk-components-portal-host.umd.js +46 -1
  19. package/bundles/taiga-ui-cdk-components-portal-host.umd.js.map +1 -1
  20. package/bundles/taiga-ui-cdk-components-portal-host.umd.min.js.map +1 -1
  21. package/bundles/taiga-ui-cdk-constants.umd.js +1 -1
  22. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  23. package/bundles/taiga-ui-cdk-constants.umd.min.js +1 -1
  24. package/bundles/taiga-ui-cdk-constants.umd.min.js.map +1 -1
  25. package/bundles/taiga-ui-cdk-date-time.umd.js +47 -2
  26. package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
  27. package/bundles/taiga-ui-cdk-date-time.umd.min.js.map +1 -1
  28. package/bundles/taiga-ui-cdk-decorators.umd.js +46 -1
  29. package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
  30. package/bundles/taiga-ui-cdk-decorators.umd.min.js.map +1 -1
  31. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +49 -4
  32. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  33. package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js.map +1 -1
  34. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +47 -2
  35. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  36. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js.map +1 -1
  37. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js +52 -7
  38. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
  39. package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js.map +1 -1
  40. package/bundles/taiga-ui-cdk-directives-checked.umd.js +52 -7
  41. package/bundles/taiga-ui-cdk-directives-checked.umd.js.map +1 -1
  42. package/bundles/taiga-ui-cdk-directives-checked.umd.min.js.map +1 -1
  43. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js +49 -4
  44. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js.map +1 -1
  45. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js.map +1 -1
  46. package/bundles/taiga-ui-cdk-directives-drag.umd.js +50 -5
  47. package/bundles/taiga-ui-cdk-directives-drag.umd.js.map +1 -1
  48. package/bundles/taiga-ui-cdk-directives-drag.umd.min.js.map +1 -1
  49. package/bundles/taiga-ui-cdk-directives-droppable.umd.js +51 -6
  50. package/bundles/taiga-ui-cdk-directives-droppable.umd.js.map +1 -1
  51. package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js.map +1 -1
  52. package/bundles/taiga-ui-cdk-directives-element.umd.js +48 -3
  53. package/bundles/taiga-ui-cdk-directives-element.umd.js.map +1 -1
  54. package/bundles/taiga-ui-cdk-directives-element.umd.min.js.map +1 -1
  55. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js +51 -6
  56. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
  57. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js.map +1 -1
  58. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js +48 -3
  59. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js.map +1 -1
  60. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js.map +1 -1
  61. package/bundles/taiga-ui-cdk-directives-focusable.umd.js +49 -4
  62. package/bundles/taiga-ui-cdk-directives-focusable.umd.js.map +1 -1
  63. package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js.map +1 -1
  64. package/bundles/taiga-ui-cdk-directives-focused.umd.js +48 -3
  65. package/bundles/taiga-ui-cdk-directives-focused.umd.js.map +1 -1
  66. package/bundles/taiga-ui-cdk-directives-focused.umd.min.js.map +1 -1
  67. package/bundles/taiga-ui-cdk-directives-for-async.umd.js +47 -2
  68. package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -1
  69. package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js.map +1 -1
  70. package/bundles/taiga-ui-cdk-directives-for.umd.js +47 -2
  71. package/bundles/taiga-ui-cdk-directives-for.umd.js.map +1 -1
  72. package/bundles/taiga-ui-cdk-directives-for.umd.min.js.map +1 -1
  73. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js +47 -2
  74. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js.map +1 -1
  75. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js.map +1 -1
  76. package/bundles/taiga-ui-cdk-directives-hovered.umd.js +50 -5
  77. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  78. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js.map +1 -1
  79. package/bundles/taiga-ui-cdk-directives-input-mode.umd.js +56 -11
  80. package/bundles/taiga-ui-cdk-directives-input-mode.umd.js.map +1 -1
  81. package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js.map +1 -1
  82. package/bundles/taiga-ui-cdk-directives-item.umd.js +47 -2
  83. package/bundles/taiga-ui-cdk-directives-item.umd.js.map +1 -1
  84. package/bundles/taiga-ui-cdk-directives-item.umd.min.js.map +1 -1
  85. package/bundles/taiga-ui-cdk-directives-let.umd.js +47 -2
  86. package/bundles/taiga-ui-cdk-directives-let.umd.js.map +1 -1
  87. package/bundles/taiga-ui-cdk-directives-let.umd.min.js.map +1 -1
  88. package/bundles/taiga-ui-cdk-directives-media.umd.js +60 -15
  89. package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
  90. package/bundles/taiga-ui-cdk-directives-media.umd.min.js +1 -1
  91. package/bundles/taiga-ui-cdk-directives-media.umd.min.js.map +1 -1
  92. package/bundles/taiga-ui-cdk-directives-obscured.umd.js +47 -2
  93. package/bundles/taiga-ui-cdk-directives-obscured.umd.js.map +1 -1
  94. package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js.map +1 -1
  95. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +57 -12
  96. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
  97. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js.map +1 -1
  98. package/bundles/taiga-ui-cdk-directives-pan.umd.js +48 -3
  99. package/bundles/taiga-ui-cdk-directives-pan.umd.js.map +1 -1
  100. package/bundles/taiga-ui-cdk-directives-pan.umd.min.js.map +1 -1
  101. package/bundles/taiga-ui-cdk-directives-portal.umd.js +47 -2
  102. package/bundles/taiga-ui-cdk-directives-portal.umd.js.map +1 -1
  103. package/bundles/taiga-ui-cdk-directives-portal.umd.min.js.map +1 -1
  104. package/bundles/taiga-ui-cdk-directives-pressed.umd.js +47 -2
  105. package/bundles/taiga-ui-cdk-directives-pressed.umd.js.map +1 -1
  106. package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js.map +1 -1
  107. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js +49 -4
  108. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js.map +1 -1
  109. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js.map +1 -1
  110. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js +47 -2
  111. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js.map +1 -1
  112. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js.map +1 -1
  113. package/bundles/taiga-ui-cdk-directives-resize.umd.js +48 -3
  114. package/bundles/taiga-ui-cdk-directives-resize.umd.js.map +1 -1
  115. package/bundles/taiga-ui-cdk-directives-resize.umd.min.js.map +1 -1
  116. package/bundles/taiga-ui-cdk-directives-swipe.umd.js +48 -3
  117. package/bundles/taiga-ui-cdk-directives-swipe.umd.js.map +1 -1
  118. package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js.map +1 -1
  119. package/bundles/taiga-ui-cdk-directives-validator.umd.js +47 -2
  120. package/bundles/taiga-ui-cdk-directives-validator.umd.js.map +1 -1
  121. package/bundles/taiga-ui-cdk-directives-validator.umd.min.js.map +1 -1
  122. package/bundles/taiga-ui-cdk-directives-zoom.umd.js +49 -4
  123. package/bundles/taiga-ui-cdk-directives-zoom.umd.js.map +1 -1
  124. package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js.map +1 -1
  125. package/bundles/taiga-ui-cdk-enums.umd.js.map +1 -1
  126. package/bundles/taiga-ui-cdk-enums.umd.min.js.map +1 -1
  127. package/bundles/taiga-ui-cdk-exceptions.umd.js +46 -1
  128. package/bundles/taiga-ui-cdk-exceptions.umd.js.map +1 -1
  129. package/bundles/taiga-ui-cdk-exceptions.umd.min.js.map +1 -1
  130. package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
  131. package/bundles/taiga-ui-cdk-observables.umd.min.js.map +1 -1
  132. package/bundles/taiga-ui-cdk-pipes-filter.umd.js +46 -1
  133. package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
  134. package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js.map +1 -1
  135. package/bundles/taiga-ui-cdk-pipes-keys.umd.js +46 -1
  136. package/bundles/taiga-ui-cdk-pipes-keys.umd.js.map +1 -1
  137. package/bundles/taiga-ui-cdk-pipes-keys.umd.min.js.map +1 -1
  138. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +46 -1
  139. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
  140. package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js.map +1 -1
  141. package/bundles/taiga-ui-cdk-services.umd.js +46 -1
  142. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  143. package/bundles/taiga-ui-cdk-services.umd.min.js.map +1 -1
  144. package/bundles/taiga-ui-cdk-tokens.umd.js +47 -2
  145. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  146. package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -1
  147. package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
  148. package/bundles/taiga-ui-cdk-utils-dom.umd.js +1 -1
  149. package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
  150. package/bundles/taiga-ui-cdk-utils-dom.umd.min.js +1 -1
  151. package/bundles/taiga-ui-cdk-utils-dom.umd.min.js.map +1 -1
  152. package/bundles/taiga-ui-cdk-utils-focus.umd.js +2 -1
  153. package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
  154. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js +1 -1
  155. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js.map +1 -1
  156. package/bundles/taiga-ui-cdk-utils-math.umd.js +8 -8
  157. package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
  158. package/bundles/taiga-ui-cdk-utils-math.umd.min.js +1 -1
  159. package/bundles/taiga-ui-cdk-utils-math.umd.min.js.map +1 -1
  160. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +2 -4
  161. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  162. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.min.js +1 -1
  163. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.min.js.map +1 -1
  164. package/bundles/taiga-ui-cdk-utils-svg.umd.js +46 -1
  165. package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
  166. package/bundles/taiga-ui-cdk-utils-svg.umd.min.js.map +1 -1
  167. package/classes/assert.d.ts +1 -1
  168. package/classes/validation-error.d.ts +1 -1
  169. package/coercion/coerce-boolean-property.d.ts +1 -1
  170. package/constants/taiga-ui-cdk-constants.metadata.json +1 -1
  171. package/constants/version.d.ts +1 -1
  172. package/constants/version.js +1 -1
  173. package/date-time/time.d.ts +1 -1
  174. package/date-time/year.d.ts +1 -1
  175. package/decorators/default-prop.d.ts +1 -1
  176. package/decorators/pure.d.ts +1 -1
  177. package/decorators/required-setter.d.ts +1 -1
  178. package/directives/active-zone/taiga-ui-cdk-directives-active-zone.metadata.json +1 -1
  179. package/directives/checked/checked.directive.d.ts +1 -1
  180. package/directives/for-async/for-async.directive.d.ts +1 -1
  181. package/directives/media/media.directive.d.ts +2 -2
  182. package/directives/media/taiga-ui-cdk-directives-media.metadata.json +1 -1
  183. package/enums/autocomplete.d.ts +1 -1
  184. package/esm2015/abstract/dialog.service.js +1 -1
  185. package/esm2015/classes/assert.js +1 -1
  186. package/esm2015/classes/validation-error.js +1 -1
  187. package/esm2015/coercion/coerce-boolean-property.js +1 -1
  188. package/esm2015/components/alert-host/alert-host.component.js +2 -2
  189. package/esm2015/components/dialog-host/dialog-host.component.js +5 -5
  190. package/esm2015/components/dropdown-host/dropdown-host.component.js +3 -3
  191. package/esm2015/constants/version.js +2 -2
  192. package/esm2015/date-time/day-range.js +1 -1
  193. package/esm2015/date-time/day.js +2 -2
  194. package/esm2015/date-time/time.js +1 -1
  195. package/esm2015/date-time/year.js +1 -1
  196. package/esm2015/decorators/default-prop.js +1 -1
  197. package/esm2015/decorators/pure.js +1 -1
  198. package/esm2015/decorators/required-setter.js +1 -1
  199. package/esm2015/directives/active-zone/active-zone.directive.js +4 -4
  200. package/esm2015/directives/auto-focus/autofocus.directive.js +2 -2
  201. package/esm2015/directives/autofilled/autofilled-style.component.js +2 -2
  202. package/esm2015/directives/autofilled/autofilled.directive.js +6 -6
  203. package/esm2015/directives/checked/checked.directive.js +7 -7
  204. package/esm2015/directives/copy-processor/copy-processor.directive.js +4 -4
  205. package/esm2015/directives/drag/drag.directive.js +5 -5
  206. package/esm2015/directives/droppable/droppable.directive.js +5 -5
  207. package/esm2015/directives/element/element.directive.js +3 -3
  208. package/esm2015/directives/focus-trap/focus-trap.directive.js +6 -6
  209. package/esm2015/directives/focus-visible/focus-visible.directive.js +3 -3
  210. package/esm2015/directives/focusable/focusable.directive.js +4 -4
  211. package/esm2015/directives/focused/focused.directive.js +3 -3
  212. package/esm2015/directives/for/for.directive.js +2 -2
  213. package/esm2015/directives/for-async/for-async.directive.js +2 -2
  214. package/esm2015/directives/high-dpi/high-dpi.directive.js +2 -2
  215. package/esm2015/directives/hovered/hovered.directive.js +5 -5
  216. package/esm2015/directives/input-mode/input-mode.directive.js +11 -11
  217. package/esm2015/directives/item/item.directive.js +2 -2
  218. package/esm2015/directives/let/let.directive.js +2 -2
  219. package/esm2015/directives/media/media.directive.js +18 -18
  220. package/esm2015/directives/obscured/obscured.directive.js +2 -2
  221. package/esm2015/directives/overscroll/overscroll.directive.js +12 -12
  222. package/esm2015/directives/pan/pan.directive.js +3 -3
  223. package/esm2015/directives/portal/portal.directive.js +2 -2
  224. package/esm2015/directives/pressed/pressed.directive.js +2 -2
  225. package/esm2015/directives/prevent-default/prevent-default.directive.js +4 -4
  226. package/esm2015/directives/repeat-times/repeat-times.directive.js +2 -2
  227. package/esm2015/directives/resize/resize.directive.js +3 -3
  228. package/esm2015/directives/swipe/swipe.directive.js +3 -3
  229. package/esm2015/directives/validator/validator.directive.js +2 -2
  230. package/esm2015/directives/zoom/zoom.directive.js +4 -4
  231. package/esm2015/enums/autocomplete.js +1 -1
  232. package/esm2015/interfaces/alert-context.js +1 -1
  233. package/esm2015/interfaces/swipe.js +1 -1
  234. package/esm2015/interfaces/zoom.js +1 -1
  235. package/esm2015/observables/must-be-present.js +1 -1
  236. package/esm2015/services/obscured.service.js +1 -1
  237. package/esm2015/tokens/active-element.js +2 -2
  238. package/esm2015/types/dialog.js +1 -1
  239. package/esm2015/types/event-with.js +1 -1
  240. package/esm2015/types/input-mode.js +1 -1
  241. package/esm2015/types/input-type.js +1 -1
  242. package/esm2015/types/overscroll-mode.js +1 -1
  243. package/esm2015/types/time-mode.js +1 -1
  244. package/esm2015/utils/dom/get-closest-element.js +1 -1
  245. package/esm2015/utils/dom/get-document-or-shadow-root.js +1 -1
  246. package/esm2015/utils/dom/get-element-obscurers.js +2 -2
  247. package/esm2015/utils/focus/get-native-focused.js +3 -2
  248. package/esm2015/utils/focus/set-native-mouse-focused.js +1 -1
  249. package/esm2015/utils/math/clamp.js +4 -4
  250. package/esm2015/utils/math/in-range.js +4 -4
  251. package/esm2015/utils/math/normalize-to-int-number.js +2 -2
  252. package/esm2015/utils/math/round.js +2 -2
  253. package/esm2015/utils/math/to-int.js +1 -1
  254. package/esm2015/utils/miscellaneous/ease-in-out-quad.js +2 -2
  255. package/esm2015/utils/miscellaneous/get-swipe-direction.js +2 -4
  256. package/esm2015/utils/miscellaneous/uniq-by.js +1 -1
  257. package/esm5/abstract/dialog.service.js +1 -1
  258. package/esm5/classes/assert.js +1 -1
  259. package/esm5/classes/validation-error.js +1 -1
  260. package/esm5/coercion/coerce-boolean-property.js +1 -1
  261. package/esm5/components/alert-host/alert-host.component.js +2 -2
  262. package/esm5/components/dialog-host/dialog-host.component.js +5 -5
  263. package/esm5/components/dropdown-host/dropdown-host.component.js +3 -3
  264. package/esm5/constants/version.js +2 -2
  265. package/esm5/date-time/day-range.js +1 -1
  266. package/esm5/date-time/day.js +2 -2
  267. package/esm5/date-time/time.js +1 -1
  268. package/esm5/date-time/year.js +1 -1
  269. package/esm5/decorators/default-prop.js +1 -1
  270. package/esm5/decorators/pure.js +1 -1
  271. package/esm5/decorators/required-setter.js +1 -1
  272. package/esm5/directives/active-zone/active-zone.directive.js +4 -4
  273. package/esm5/directives/auto-focus/autofocus.directive.js +2 -2
  274. package/esm5/directives/autofilled/autofilled-style.component.js +2 -2
  275. package/esm5/directives/autofilled/autofilled.directive.js +6 -6
  276. package/esm5/directives/checked/checked.directive.js +7 -7
  277. package/esm5/directives/copy-processor/copy-processor.directive.js +4 -4
  278. package/esm5/directives/drag/drag.directive.js +5 -5
  279. package/esm5/directives/droppable/droppable.directive.js +6 -6
  280. package/esm5/directives/element/element.directive.js +3 -3
  281. package/esm5/directives/focus-trap/focus-trap.directive.js +6 -6
  282. package/esm5/directives/focus-visible/focus-visible.directive.js +3 -3
  283. package/esm5/directives/focusable/focusable.directive.js +4 -4
  284. package/esm5/directives/focused/focused.directive.js +3 -3
  285. package/esm5/directives/for/for.directive.js +2 -2
  286. package/esm5/directives/for-async/for-async.directive.js +2 -2
  287. package/esm5/directives/high-dpi/high-dpi.directive.js +2 -2
  288. package/esm5/directives/hovered/hovered.directive.js +5 -5
  289. package/esm5/directives/input-mode/input-mode.directive.js +11 -11
  290. package/esm5/directives/item/item.directive.js +2 -2
  291. package/esm5/directives/let/let.directive.js +2 -2
  292. package/esm5/directives/media/media.directive.js +15 -15
  293. package/esm5/directives/obscured/obscured.directive.js +2 -2
  294. package/esm5/directives/overscroll/overscroll.directive.js +12 -12
  295. package/esm5/directives/pan/pan.directive.js +3 -3
  296. package/esm5/directives/portal/portal.directive.js +2 -2
  297. package/esm5/directives/pressed/pressed.directive.js +2 -2
  298. package/esm5/directives/prevent-default/prevent-default.directive.js +4 -4
  299. package/esm5/directives/repeat-times/repeat-times.directive.js +2 -2
  300. package/esm5/directives/resize/resize.directive.js +3 -3
  301. package/esm5/directives/swipe/swipe.directive.js +3 -3
  302. package/esm5/directives/validator/validator.directive.js +2 -2
  303. package/esm5/directives/zoom/zoom.directive.js +4 -4
  304. package/esm5/enums/autocomplete.js +1 -1
  305. package/esm5/interfaces/alert-context.js +1 -1
  306. package/esm5/interfaces/swipe.js +1 -1
  307. package/esm5/interfaces/zoom.js +1 -1
  308. package/esm5/observables/must-be-present.js +1 -1
  309. package/esm5/services/obscured.service.js +1 -1
  310. package/esm5/tokens/active-element.js +2 -2
  311. package/esm5/types/dialog.js +1 -1
  312. package/esm5/types/event-with.js +1 -1
  313. package/esm5/types/input-mode.js +1 -1
  314. package/esm5/types/input-type.js +1 -1
  315. package/esm5/types/overscroll-mode.js +1 -1
  316. package/esm5/types/time-mode.js +1 -1
  317. package/esm5/utils/dom/get-closest-element.js +1 -1
  318. package/esm5/utils/dom/get-document-or-shadow-root.js +1 -1
  319. package/esm5/utils/dom/get-element-obscurers.js +2 -2
  320. package/esm5/utils/focus/get-native-focused.js +3 -2
  321. package/esm5/utils/focus/set-native-mouse-focused.js +1 -1
  322. package/esm5/utils/math/clamp.js +4 -4
  323. package/esm5/utils/math/in-range.js +4 -4
  324. package/esm5/utils/math/normalize-to-int-number.js +2 -2
  325. package/esm5/utils/math/round.js +2 -2
  326. package/esm5/utils/math/to-int.js +1 -1
  327. package/esm5/utils/miscellaneous/ease-in-out-quad.js +2 -2
  328. package/esm5/utils/miscellaneous/get-swipe-direction.js +2 -4
  329. package/esm5/utils/miscellaneous/uniq-by.js +1 -1
  330. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  331. package/fesm2015/taiga-ui-cdk-classes.js.map +1 -1
  332. package/fesm2015/taiga-ui-cdk-coercion.js.map +1 -1
  333. package/fesm2015/taiga-ui-cdk-components-alert-host.js +1 -1
  334. package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
  335. package/fesm2015/taiga-ui-cdk-components-dialog-host.js +4 -4
  336. package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  337. package/fesm2015/taiga-ui-cdk-components-dropdown-host.js +2 -2
  338. package/fesm2015/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
  339. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  340. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  341. package/fesm2015/taiga-ui-cdk-date-time.js +1 -1
  342. package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
  343. package/fesm2015/taiga-ui-cdk-decorators.js.map +1 -1
  344. package/fesm2015/taiga-ui-cdk-directives-active-zone.js +3 -3
  345. package/fesm2015/taiga-ui-cdk-directives-active-zone.js.map +1 -1
  346. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +1 -1
  347. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  348. package/fesm2015/taiga-ui-cdk-directives-autofilled.js +6 -6
  349. package/fesm2015/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  350. package/fesm2015/taiga-ui-cdk-directives-checked.js +6 -6
  351. package/fesm2015/taiga-ui-cdk-directives-checked.js.map +1 -1
  352. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js +3 -3
  353. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js.map +1 -1
  354. package/fesm2015/taiga-ui-cdk-directives-drag.js +4 -4
  355. package/fesm2015/taiga-ui-cdk-directives-drag.js.map +1 -1
  356. package/fesm2015/taiga-ui-cdk-directives-droppable.js +4 -4
  357. package/fesm2015/taiga-ui-cdk-directives-droppable.js.map +1 -1
  358. package/fesm2015/taiga-ui-cdk-directives-element.js +2 -2
  359. package/fesm2015/taiga-ui-cdk-directives-element.js.map +1 -1
  360. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js +5 -5
  361. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
  362. package/fesm2015/taiga-ui-cdk-directives-focus-visible.js +2 -2
  363. package/fesm2015/taiga-ui-cdk-directives-focus-visible.js.map +1 -1
  364. package/fesm2015/taiga-ui-cdk-directives-focusable.js +3 -3
  365. package/fesm2015/taiga-ui-cdk-directives-focusable.js.map +1 -1
  366. package/fesm2015/taiga-ui-cdk-directives-focused.js +2 -2
  367. package/fesm2015/taiga-ui-cdk-directives-focused.js.map +1 -1
  368. package/fesm2015/taiga-ui-cdk-directives-for-async.js +1 -1
  369. package/fesm2015/taiga-ui-cdk-directives-for-async.js.map +1 -1
  370. package/fesm2015/taiga-ui-cdk-directives-for.js +1 -1
  371. package/fesm2015/taiga-ui-cdk-directives-for.js.map +1 -1
  372. package/fesm2015/taiga-ui-cdk-directives-high-dpi.js +1 -1
  373. package/fesm2015/taiga-ui-cdk-directives-high-dpi.js.map +1 -1
  374. package/fesm2015/taiga-ui-cdk-directives-hovered.js +4 -4
  375. package/fesm2015/taiga-ui-cdk-directives-hovered.js.map +1 -1
  376. package/fesm2015/taiga-ui-cdk-directives-input-mode.js +10 -10
  377. package/fesm2015/taiga-ui-cdk-directives-input-mode.js.map +1 -1
  378. package/fesm2015/taiga-ui-cdk-directives-item.js +1 -1
  379. package/fesm2015/taiga-ui-cdk-directives-item.js.map +1 -1
  380. package/fesm2015/taiga-ui-cdk-directives-let.js +1 -1
  381. package/fesm2015/taiga-ui-cdk-directives-let.js.map +1 -1
  382. package/fesm2015/taiga-ui-cdk-directives-media.js +17 -17
  383. package/fesm2015/taiga-ui-cdk-directives-media.js.map +1 -1
  384. package/fesm2015/taiga-ui-cdk-directives-obscured.js +1 -1
  385. package/fesm2015/taiga-ui-cdk-directives-obscured.js.map +1 -1
  386. package/fesm2015/taiga-ui-cdk-directives-overscroll.js +11 -11
  387. package/fesm2015/taiga-ui-cdk-directives-overscroll.js.map +1 -1
  388. package/fesm2015/taiga-ui-cdk-directives-pan.js +2 -2
  389. package/fesm2015/taiga-ui-cdk-directives-pan.js.map +1 -1
  390. package/fesm2015/taiga-ui-cdk-directives-portal.js +1 -1
  391. package/fesm2015/taiga-ui-cdk-directives-portal.js.map +1 -1
  392. package/fesm2015/taiga-ui-cdk-directives-pressed.js +1 -1
  393. package/fesm2015/taiga-ui-cdk-directives-pressed.js.map +1 -1
  394. package/fesm2015/taiga-ui-cdk-directives-prevent-default.js +3 -3
  395. package/fesm2015/taiga-ui-cdk-directives-prevent-default.js.map +1 -1
  396. package/fesm2015/taiga-ui-cdk-directives-repeat-times.js +1 -1
  397. package/fesm2015/taiga-ui-cdk-directives-repeat-times.js.map +1 -1
  398. package/fesm2015/taiga-ui-cdk-directives-resize.js +2 -2
  399. package/fesm2015/taiga-ui-cdk-directives-resize.js.map +1 -1
  400. package/fesm2015/taiga-ui-cdk-directives-swipe.js +2 -2
  401. package/fesm2015/taiga-ui-cdk-directives-swipe.js.map +1 -1
  402. package/fesm2015/taiga-ui-cdk-directives-validator.js +1 -1
  403. package/fesm2015/taiga-ui-cdk-directives-validator.js.map +1 -1
  404. package/fesm2015/taiga-ui-cdk-directives-zoom.js +3 -3
  405. package/fesm2015/taiga-ui-cdk-directives-zoom.js.map +1 -1
  406. package/fesm2015/taiga-ui-cdk-enums.js.map +1 -1
  407. package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
  408. package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
  409. package/fesm2015/taiga-ui-cdk-tokens.js +1 -1
  410. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  411. package/fesm2015/taiga-ui-cdk-utils-dom.js +1 -1
  412. package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
  413. package/fesm2015/taiga-ui-cdk-utils-focus.js +2 -1
  414. package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
  415. package/fesm2015/taiga-ui-cdk-utils-math.js +8 -8
  416. package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
  417. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +2 -4
  418. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  419. package/fesm5/taiga-ui-cdk-abstract.js.map +1 -1
  420. package/fesm5/taiga-ui-cdk-classes.js.map +1 -1
  421. package/fesm5/taiga-ui-cdk-coercion.js.map +1 -1
  422. package/fesm5/taiga-ui-cdk-components-alert-host.js +1 -1
  423. package/fesm5/taiga-ui-cdk-components-alert-host.js.map +1 -1
  424. package/fesm5/taiga-ui-cdk-components-dialog-host.js +4 -4
  425. package/fesm5/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  426. package/fesm5/taiga-ui-cdk-components-dropdown-host.js +2 -2
  427. package/fesm5/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
  428. package/fesm5/taiga-ui-cdk-constants.js +1 -1
  429. package/fesm5/taiga-ui-cdk-constants.js.map +1 -1
  430. package/fesm5/taiga-ui-cdk-date-time.js +1 -1
  431. package/fesm5/taiga-ui-cdk-date-time.js.map +1 -1
  432. package/fesm5/taiga-ui-cdk-decorators.js.map +1 -1
  433. package/fesm5/taiga-ui-cdk-directives-active-zone.js +3 -3
  434. package/fesm5/taiga-ui-cdk-directives-active-zone.js.map +1 -1
  435. package/fesm5/taiga-ui-cdk-directives-auto-focus.js +1 -1
  436. package/fesm5/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  437. package/fesm5/taiga-ui-cdk-directives-autofilled.js +6 -6
  438. package/fesm5/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  439. package/fesm5/taiga-ui-cdk-directives-checked.js +6 -6
  440. package/fesm5/taiga-ui-cdk-directives-checked.js.map +1 -1
  441. package/fesm5/taiga-ui-cdk-directives-copy-processor.js +3 -3
  442. package/fesm5/taiga-ui-cdk-directives-copy-processor.js.map +1 -1
  443. package/fesm5/taiga-ui-cdk-directives-drag.js +4 -4
  444. package/fesm5/taiga-ui-cdk-directives-drag.js.map +1 -1
  445. package/fesm5/taiga-ui-cdk-directives-droppable.js +5 -5
  446. package/fesm5/taiga-ui-cdk-directives-droppable.js.map +1 -1
  447. package/fesm5/taiga-ui-cdk-directives-element.js +2 -2
  448. package/fesm5/taiga-ui-cdk-directives-element.js.map +1 -1
  449. package/fesm5/taiga-ui-cdk-directives-focus-trap.js +5 -5
  450. package/fesm5/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
  451. package/fesm5/taiga-ui-cdk-directives-focus-visible.js +2 -2
  452. package/fesm5/taiga-ui-cdk-directives-focus-visible.js.map +1 -1
  453. package/fesm5/taiga-ui-cdk-directives-focusable.js +3 -3
  454. package/fesm5/taiga-ui-cdk-directives-focusable.js.map +1 -1
  455. package/fesm5/taiga-ui-cdk-directives-focused.js +2 -2
  456. package/fesm5/taiga-ui-cdk-directives-focused.js.map +1 -1
  457. package/fesm5/taiga-ui-cdk-directives-for-async.js +1 -1
  458. package/fesm5/taiga-ui-cdk-directives-for-async.js.map +1 -1
  459. package/fesm5/taiga-ui-cdk-directives-for.js +1 -1
  460. package/fesm5/taiga-ui-cdk-directives-for.js.map +1 -1
  461. package/fesm5/taiga-ui-cdk-directives-high-dpi.js +1 -1
  462. package/fesm5/taiga-ui-cdk-directives-high-dpi.js.map +1 -1
  463. package/fesm5/taiga-ui-cdk-directives-hovered.js +4 -4
  464. package/fesm5/taiga-ui-cdk-directives-hovered.js.map +1 -1
  465. package/fesm5/taiga-ui-cdk-directives-input-mode.js +10 -10
  466. package/fesm5/taiga-ui-cdk-directives-input-mode.js.map +1 -1
  467. package/fesm5/taiga-ui-cdk-directives-item.js +1 -1
  468. package/fesm5/taiga-ui-cdk-directives-item.js.map +1 -1
  469. package/fesm5/taiga-ui-cdk-directives-let.js +1 -1
  470. package/fesm5/taiga-ui-cdk-directives-let.js.map +1 -1
  471. package/fesm5/taiga-ui-cdk-directives-media.js +14 -14
  472. package/fesm5/taiga-ui-cdk-directives-media.js.map +1 -1
  473. package/fesm5/taiga-ui-cdk-directives-obscured.js +1 -1
  474. package/fesm5/taiga-ui-cdk-directives-obscured.js.map +1 -1
  475. package/fesm5/taiga-ui-cdk-directives-overscroll.js +11 -11
  476. package/fesm5/taiga-ui-cdk-directives-overscroll.js.map +1 -1
  477. package/fesm5/taiga-ui-cdk-directives-pan.js +2 -2
  478. package/fesm5/taiga-ui-cdk-directives-pan.js.map +1 -1
  479. package/fesm5/taiga-ui-cdk-directives-portal.js +1 -1
  480. package/fesm5/taiga-ui-cdk-directives-portal.js.map +1 -1
  481. package/fesm5/taiga-ui-cdk-directives-pressed.js +1 -1
  482. package/fesm5/taiga-ui-cdk-directives-pressed.js.map +1 -1
  483. package/fesm5/taiga-ui-cdk-directives-prevent-default.js +3 -3
  484. package/fesm5/taiga-ui-cdk-directives-prevent-default.js.map +1 -1
  485. package/fesm5/taiga-ui-cdk-directives-repeat-times.js +1 -1
  486. package/fesm5/taiga-ui-cdk-directives-repeat-times.js.map +1 -1
  487. package/fesm5/taiga-ui-cdk-directives-resize.js +2 -2
  488. package/fesm5/taiga-ui-cdk-directives-resize.js.map +1 -1
  489. package/fesm5/taiga-ui-cdk-directives-swipe.js +2 -2
  490. package/fesm5/taiga-ui-cdk-directives-swipe.js.map +1 -1
  491. package/fesm5/taiga-ui-cdk-directives-validator.js +1 -1
  492. package/fesm5/taiga-ui-cdk-directives-validator.js.map +1 -1
  493. package/fesm5/taiga-ui-cdk-directives-zoom.js +3 -3
  494. package/fesm5/taiga-ui-cdk-directives-zoom.js.map +1 -1
  495. package/fesm5/taiga-ui-cdk-enums.js.map +1 -1
  496. package/fesm5/taiga-ui-cdk-observables.js.map +1 -1
  497. package/fesm5/taiga-ui-cdk-services.js.map +1 -1
  498. package/fesm5/taiga-ui-cdk-tokens.js +1 -1
  499. package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
  500. package/fesm5/taiga-ui-cdk-utils-dom.js +1 -1
  501. package/fesm5/taiga-ui-cdk-utils-dom.js.map +1 -1
  502. package/fesm5/taiga-ui-cdk-utils-focus.js +2 -1
  503. package/fesm5/taiga-ui-cdk-utils-focus.js.map +1 -1
  504. package/fesm5/taiga-ui-cdk-utils-math.js +8 -8
  505. package/fesm5/taiga-ui-cdk-utils-math.js.map +1 -1
  506. package/fesm5/taiga-ui-cdk-utils-miscellaneous.js +2 -4
  507. package/fesm5/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  508. package/interfaces/alert-context.d.ts +1 -1
  509. package/interfaces/swipe.d.ts +1 -1
  510. package/interfaces/zoom.d.ts +1 -1
  511. package/observables/must-be-present.d.ts +1 -1
  512. package/package.json +1 -1
  513. package/schematics/constants/file-globs.js +2 -2
  514. package/schematics/ng-add/constants/modules.d.ts +4 -4
  515. package/schematics/ng-add/constants/modules.js +12 -12
  516. package/schematics/ng-add/constants/packages.js +1 -1
  517. package/schematics/ng-add/constants/versions.js +3 -3
  518. package/schematics/ng-add/index.js +7 -7
  519. package/schematics/ng-add/schema.d.ts +1 -1
  520. package/schematics/ng-add/steps/add-taiga-icons.js +4 -4
  521. package/schematics/ng-add/steps/add-taiga-modules.js +4 -4
  522. package/schematics/ng-add/steps/add-taiga-styles.js +3 -3
  523. package/schematics/ng-add/steps/wrap-with-tui-root.js +12 -12
  524. package/schematics/ng-update/constants/consts.js +57 -57
  525. package/schematics/ng-update/constants/deprecated-functions.js +426 -426
  526. package/schematics/ng-update/constants/enums.js +109 -109
  527. package/schematics/ng-update/constants/modules.js +3 -3
  528. package/schematics/ng-update/constants/services.d.ts +2 -2
  529. package/schematics/ng-update/constants/services.js +16 -16
  530. package/schematics/ng-update/constants/templates.d.ts +1 -1
  531. package/schematics/ng-update/constants/templates.js +123 -123
  532. package/schematics/ng-update/constants/tui-interactive-selectors.js +50 -50
  533. package/schematics/ng-update/constants/types.d.ts +1 -1
  534. package/schematics/ng-update/constants/types.js +87 -87
  535. package/schematics/ng-update/constants/warnings.js +56 -56
  536. package/schematics/ng-update/index.js +14 -14
  537. package/schematics/ng-update/steps/migrate-date-time.js +38 -38
  538. package/schematics/ng-update/steps/migrate-progress.js +11 -9
  539. package/schematics/ng-update/steps/migrate-sliders/index.js +2 -2
  540. package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.js +28 -26
  541. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +28 -27
  542. package/schematics/ng-update/steps/migrate-templates.js +24 -21
  543. package/schematics/ng-update/steps/miscellaneous.js +10 -10
  544. package/schematics/ng-update/steps/remove-module.js +1 -1
  545. package/schematics/ng-update/steps/rename-types.js +5 -5
  546. package/schematics/ng-update/steps/replace-const.js +3 -3
  547. package/schematics/ng-update/steps/replace-deep-import.js +2 -2
  548. package/schematics/ng-update/steps/replace-enums.js +3 -3
  549. package/schematics/ng-update/steps/replace-functions.js +8 -8
  550. package/schematics/ng-update/steps/replace-services.js +4 -5
  551. package/schematics/ng-update/steps/show-warnings.js +2 -2
  552. package/schematics/utils/add-unique-import.js +1 -1
  553. package/schematics/utils/angular/ng-component.js +1 -1
  554. package/schematics/utils/angular/ng-module.js +1 -1
  555. package/schematics/utils/colored-log.js +5 -5
  556. package/schematics/utils/get-named-import-references.d.ts +1 -1
  557. package/schematics/utils/get-named-import-references.js +2 -2
  558. package/schematics/utils/get-project-target-options.d.ts +1 -1
  559. package/schematics/utils/get-project-target-options.js +1 -1
  560. package/schematics/utils/get-project.js +1 -1
  561. package/schematics/utils/progress.js +1 -1
  562. package/schematics/utils/templates/elements.js +3 -3
  563. package/schematics/utils/templates/get-component-templates.js +9 -11
  564. package/schematics/utils/templates/ng-component-input-manipulations.d.ts +5 -5
  565. package/schematics/utils/templates/ng-component-input-manipulations.js +8 -8
  566. package/schematics/utils/templates/template-resource.d.ts +1 -1
  567. package/schematics/utils/templates/template-resource.js +3 -3
  568. package/services/obscured.service.d.ts +1 -1
  569. package/types/dialog.d.ts +2 -2
  570. package/types/event-with.d.ts +2 -2
  571. package/types/input-mode.d.ts +1 -1
  572. package/types/input-type.d.ts +1 -1
  573. package/types/overscroll-mode.d.ts +1 -1
  574. package/types/time-mode.d.ts +1 -1
  575. package/utils/dom/taiga-ui-cdk-utils-dom.metadata.json +1 -1
  576. package/utils/focus/set-native-mouse-focused.d.ts +1 -1
  577. package/utils/math/to-int.d.ts +1 -1
  578. package/utils/miscellaneous/uniq-by.d.ts +1 -1
  579. package/schematics/ng-update/constants/functions.d.ts +0 -0
  580. package/schematics/ng-update/constants/functions.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-utils-dom.umd.js","sources":["ng://@taiga-ui/cdk/utils/dom/can-scroll.ts","ng://@taiga-ui/cdk/utils/dom/contains-or-after.ts","ng://@taiga-ui/cdk/utils/dom/custom-event.ts","ng://@taiga-ui/cdk/utils/dom/get-actual-target.ts","ng://@taiga-ui/cdk/utils/dom/get-clipboard-data-text.ts","ng://@taiga-ui/cdk/utils/dom/get-closest-element.ts","ng://@taiga-ui/cdk/utils/dom/get-document-or-shadow-root.ts","ng://@taiga-ui/cdk/utils/dom/get-element-obscurers.ts","ng://@taiga-ui/cdk/utils/dom/get-element-offset.ts","ng://@taiga-ui/cdk/utils/dom/get-scroll-parent.ts","ng://@taiga-ui/cdk/utils/dom/is-form-field.ts","ng://@taiga-ui/cdk/utils/dom/get-selected-text.ts","ng://@taiga-ui/cdk/utils/dom/is-current-target.ts","ng://@taiga-ui/cdk/utils/dom/is-element.ts","ng://@taiga-ui/cdk/utils/dom/is-inside-iframe.ts","ng://@taiga-ui/cdk/utils/dom/is-node-in.ts","ng://@taiga-ui/cdk/utils/dom/point-to-client-rect.ts"],"sourcesContent":["/**\n * @deprecated: use {@link tuiCanScroll} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function canScroll(\n element: Element,\n rootElement: Element,\n vertical: boolean,\n scrollEnd: boolean,\n): boolean {\n return vertical\n ? canScrollVertical(element, rootElement, scrollEnd)\n : canScrollHorizontal(element, rootElement, scrollEnd);\n}\n\nexport const tuiCanScroll = canScroll;\n\nfunction canScrollVertical(\n element: Element,\n rootElement: Element,\n scrollEnd: boolean,\n): boolean {\n let currentElement = element;\n\n while (currentElement !== rootElement.parentElement) {\n if (\n (Math.floor(currentElement.scrollTop) > 0 && !scrollEnd) ||\n (Math.ceil(currentElement.scrollTop + currentElement.clientHeight) <\n currentElement.scrollHeight &&\n scrollEnd)\n ) {\n return true;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n } else {\n return false;\n }\n }\n\n return false;\n}\n\nfunction canScrollHorizontal(\n element: Element,\n rootElement: Element,\n scrollEnd: boolean,\n): boolean {\n let currentElement = element;\n\n while (currentElement !== rootElement.parentElement) {\n if (\n (Math.floor(currentElement.scrollLeft) > 0 && !scrollEnd) ||\n (Math.ceil(currentElement.scrollLeft + currentElement.clientWidth) <\n currentElement.scrollWidth &&\n scrollEnd)\n ) {\n return true;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n } else {\n return false;\n }\n }\n\n return false;\n}\n","/**\n * @deprecated: use {@link tuiContainsOrAfter} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function containsOrAfter(current: Node, node: Node): boolean {\n return (\n current.contains(node) ||\n !!(node.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_PRECEDING)\n );\n}\n\nexport const tuiContainsOrAfter = containsOrAfter;\n","/** @deprecated only needed for IE, remove in 3.0 */\nexport function tuiCustomEvent<T = null>(\n name: string,\n {bubbles = false, cancelable = false, detail = null}: CustomEventInit<T | null> = {},\n documentRef: Document,\n): CustomEvent {\n if (typeof CustomEvent === `function`) {\n return new CustomEvent(name, {bubbles, cancelable, detail});\n }\n\n const customEvent = documentRef.createEvent(`CustomEvent`);\n\n customEvent.initCustomEvent(name, bubbles, cancelable, detail);\n\n return customEvent;\n}\n","/**\n * @deprecated: use {@link tuiGetActualTarget} instead\n * Gets actual target from open Shadow DOM if event happened within it\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getActualTarget(event: Event): Node {\n if (`composedPath` in event) {\n return (event as any).composedPath()[0];\n }\n\n return (event as any).target;\n}\n\nexport const tuiGetActualTarget = getActualTarget;\n","const DEFAULT_FORMAT = `text/plain`;\n\n/**\n * @deprecated: use {@link tuiGetClipboardDataText} instead\n * Gets text from data of clipboardEvent, it also works in IE and Edge browsers\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClipboardDataText(\n event: ClipboardEvent,\n format: string = DEFAULT_FORMAT,\n): string {\n return `clipboardData` in event && event.clipboardData !== null\n ? event.clipboardData.getData(format) ||\n event.clipboardData.getData(DEFAULT_FORMAT)\n : (event as any).target.ownerDocument.defaultView.clipboardData.getData(`text`);\n}\n\nexport const tuiGetClipboardDataText = getClipboardDataText;\n","/**\n * @deprecated only needed for IE, remove in 3.0\n * Gets the closest element by selector i.e. {@link Element.closest}\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClosestElement(element: Element, selector: string): Element | null {\n const closest = Element.prototype.closest;\n\n if (closest) {\n return closest.call(element, selector);\n }\n\n const matchesSelector =\n Element.prototype.matches || (Element.prototype as any).msMatchesSelector;\n\n do {\n if (matchesSelector.call(element, selector)) {\n return element;\n }\n\n (element as Element | null) = element.parentElement;\n } while (element !== null);\n\n return null;\n}\n","/**\n * @deprecated: use {@link tuiGetDocumentOrShadowRoot} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getDocumentOrShadowRoot(node: Node): DocumentOrShadowRoot {\n return `getRootNode` in node && node.isConnected\n ? (node.getRootNode() as Document)\n : node.ownerDocument!;\n}\n\nexport const tuiGetDocumentOrShadowRoot = getDocumentOrShadowRoot;\n","import {clamp} from '@taiga-ui/cdk/utils/math';\nimport {isPresent} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {getDocumentOrShadowRoot} from './get-document-or-shadow-root';\n\n/**\n * @deprecated: use {@link tuiGetElementObscures} instead\n * Returns array of Elements covering edges of given element or null if at least one edge middle point is visible\n *\n * CAUTION: Empty array means element if offscreen i.e. covered by no elements, rather than not covered\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getElementObscurers(element: Element): readonly Element[] | null {\n const {ownerDocument} = element;\n\n if (!ownerDocument || !ownerDocument.defaultView) {\n return null;\n }\n\n const {innerWidth, innerHeight} = ownerDocument.defaultView;\n const documentRef = getDocumentOrShadowRoot(element);\n const rect = element.getBoundingClientRect();\n const left = clamp(Math.round(rect.left) + 2, 0, innerWidth);\n const top = clamp(Math.round(rect.top) + 2, 0, innerHeight);\n const right = clamp(Math.round(rect.right) - 2, 0, innerWidth);\n const bottom = clamp(Math.round(rect.bottom) - 2, 0, innerHeight);\n const horizontalMiddle = clamp(Math.round(rect.left + rect.width / 2), 0, innerWidth);\n const verticalMiddle = clamp(Math.round(rect.top + rect.height / 2), 0, innerHeight);\n const elements = [\n documentRef.elementFromPoint(horizontalMiddle, top),\n documentRef.elementFromPoint(horizontalMiddle, bottom),\n documentRef.elementFromPoint(left, verticalMiddle),\n documentRef.elementFromPoint(right, verticalMiddle),\n ];\n const nonNull = elements.filter(isPresent);\n\n if (!nonNull.length) {\n return nonNull;\n }\n\n const filtered = nonNull.filter(el => !element.contains(el));\n\n return filtered.length === 4 ? filtered : null;\n}\n\nexport const tuiGetElementObscures = getElementObscurers;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiGetElementOffset} instead\n * Calculates offset for an element relative to it's parent several levels above\n *\n * @param host parent element\n * @param element\n * @return object with offsetTop and offsetLeft number properties\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getElementOffset(\n host: Element,\n element: HTMLElement,\n): {offsetTop: number; offsetLeft: number} {\n tuiAssert.assert(host.contains(element), `Host must contain element`);\n\n let {offsetTop, offsetLeft, offsetParent} = element;\n\n // TODO: iframe warning\n while (offsetParent && offsetParent instanceof HTMLElement && offsetParent !== host) {\n offsetTop += offsetParent.offsetTop;\n offsetLeft += offsetParent.offsetLeft;\n offsetParent = offsetParent.offsetParent;\n }\n\n return {offsetTop, offsetLeft};\n}\n\nexport const tuiGetElementOffset = getElementOffset;\n","/**\n * @deprecated: use {@link tuiGetScrollParent} instead\n * Finds the nearest parent with scroll in it\n *\n * @param element initial element\n * @param vertical flag for orientation of scroll\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getScrollParent(\n element: Element | null,\n vertical: boolean = true,\n): Element | null {\n if (element === null) {\n return null;\n }\n\n if (vertical && element.scrollHeight > element.clientHeight) {\n return element;\n }\n\n if (!vertical && element.scrollWidth > element.clientWidth) {\n return element;\n }\n\n return getScrollParent(element.parentElement, vertical);\n}\n\nexport const tuiGetScrollParent = getScrollParent;\n","export function tuiIsFormFieldElement(\n element: unknown | null,\n): element is HTMLInputElement | HTMLTextAreaElement {\n const textfield = element as Record<string, unknown> | null;\n\n return (\n !!textfield &&\n `value` in textfield &&\n `selectionStart` in textfield &&\n `selectionEnd` in textfield\n );\n}\n","import {tuiIsFormFieldElement} from './is-form-field';\n\n/**\n * @description:\n * cross browser way to get selected text\n *\n * History:\n * BUG - window.getSelection() fails when text selected in a form field\n * https://bugzilla.mozilla.org/show_bug.cgi?id=85686\n */\nexport function tuiGetSelectedText({getSelection, document}: Window): string | null {\n return tuiIsFormFieldElement(document.activeElement)\n ? document.activeElement.value.slice(\n document.activeElement.selectionStart || 0,\n document.activeElement.selectionEnd || 0,\n )\n : getSelection()?.toString() || null;\n}\n","/**\n * @deprecated: use {@link tuiIsCurrentTarget} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCurrentTarget({target, currentTarget}: Event): boolean {\n return target === currentTarget;\n}\n\nexport const tuiIsCurrentTarget = isCurrentTarget;\n","// TODO: Refactor to use this check everywhere\nexport function tuiIsElement(node: Node): node is Element {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n","/**\n * @deprecated: use {@link tuiIsInsideIframe} instead\n * Checks if an app is running inside <iframe /> tag\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isInsideIframe(windowRef: Window): boolean {\n return windowRef.parent !== windowRef;\n}\n\nexport const tuiIsInsideIframe = isInsideIframe;\n","import {getClosestElement} from './get-closest-element';\n\n/**\n * @deprecated: use {@link tuiIsNodeIn} instead\n * Checks if node is inside a specific selector\n *\n * @param node\n * @param selector\n * @return true if node is inside a particular selector\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNodeIn(node: Node, selector: string): boolean {\n return node.nodeType === Node.TEXT_NODE\n ? !!node.parentElement && !!getClosestElement(node.parentElement, selector)\n : node.nodeType === Node.ELEMENT_NODE &&\n !!getClosestElement(node as Element, selector);\n}\n\nexport const tuiIsNodeIn = isNodeIn;\n","export function tuiPointToClientRect(x: number = 0, y: number = 0): ClientRect {\n return {\n left: x,\n right: x,\n top: y,\n bottom: y,\n width: 0,\n height: 0,\n };\n}\n"],"names":["clamp","isPresent","tuiAssert"],"mappings":";;;;;;IAAA;;;IAGA;aACgB,SAAS,CACrB,OAAgB,EAChB,WAAoB,EACpB,QAAiB,EACjB,SAAkB;QAElB,OAAO,QAAQ;cACT,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC;cAClD,mBAAmB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;QAEY,YAAY,GAAG,UAAU;IAEtC,SAAS,iBAAiB,CACtB,OAAgB,EAChB,WAAoB,EACpB,SAAkB;QAElB,IAAI,cAAc,GAAG,OAAO,CAAC;QAE7B,OAAO,cAAc,KAAK,WAAW,CAAC,aAAa,EAAE;YACjD,IACI,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS;iBACtD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,GAAG,cAAc,CAAC,YAAY,CAAC;oBAC9D,cAAc,CAAC,YAAY;oBAC3B,SAAS,CAAC,EAChB;gBACE,OAAO,IAAI,CAAC;aACf;YAED,IAAI,cAAc,CAAC,aAAa,EAAE;gBAC9B,cAAc,GAAG,cAAc,CAAC,aAAa,CAAC;aACjD;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;SACJ;QAED,OAAO,KAAK,CA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,kBAAkB,GAAG;;ICRlC;aACgB,YAAY,CAAC,IAAU;QACnC,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,CAAC;IAC/C;;ICHA;;;;IAIA;aACgB,cAAc,CAAC,SAAiB;QAC5C,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,CAAC;IAC1C,CAAC;QAEY,iBAAiB,GAAG;;ICPjC;;;;;;;;IAQA;aACgB,QAAQ,CAAC,IAAU,EAAE,QAAgB;QACjD,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS;cACjC,CAAC,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC;cACzE,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY;gBAC/B,CAAC,CAAC,iBAAiB,CAAC,IAAe,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;QAEY,WAAW,GAAG;;aClBX,oBAAoB,CAAC,CAAa,EAAE,CAAa;QAA5B,kBAAA,EAAA,KAAa;QAAE,kBAAA,EAAA,KAAa;QAC7D,OAAO;YACH,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;SACZ,CAAC;IACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-utils-dom.umd.js","sources":["ng://@taiga-ui/cdk/utils/dom/can-scroll.ts","ng://@taiga-ui/cdk/utils/dom/contains-or-after.ts","ng://@taiga-ui/cdk/utils/dom/custom-event.ts","ng://@taiga-ui/cdk/utils/dom/get-actual-target.ts","ng://@taiga-ui/cdk/utils/dom/get-clipboard-data-text.ts","ng://@taiga-ui/cdk/utils/dom/get-closest-element.ts","ng://@taiga-ui/cdk/utils/dom/get-document-or-shadow-root.ts","ng://@taiga-ui/cdk/utils/dom/get-element-obscurers.ts","ng://@taiga-ui/cdk/utils/dom/get-element-offset.ts","ng://@taiga-ui/cdk/utils/dom/get-scroll-parent.ts","ng://@taiga-ui/cdk/utils/dom/is-form-field.ts","ng://@taiga-ui/cdk/utils/dom/get-selected-text.ts","ng://@taiga-ui/cdk/utils/dom/is-current-target.ts","ng://@taiga-ui/cdk/utils/dom/is-element.ts","ng://@taiga-ui/cdk/utils/dom/is-inside-iframe.ts","ng://@taiga-ui/cdk/utils/dom/is-node-in.ts","ng://@taiga-ui/cdk/utils/dom/point-to-client-rect.ts"],"sourcesContent":["/**\n * @deprecated: use {@link tuiCanScroll} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function canScroll(\n element: Element,\n rootElement: Element,\n vertical: boolean,\n scrollEnd: boolean,\n): boolean {\n return vertical\n ? canScrollVertical(element, rootElement, scrollEnd)\n : canScrollHorizontal(element, rootElement, scrollEnd);\n}\n\nexport const tuiCanScroll = canScroll;\n\nfunction canScrollVertical(\n element: Element,\n rootElement: Element,\n scrollEnd: boolean,\n): boolean {\n let currentElement = element;\n\n while (currentElement !== rootElement.parentElement) {\n if (\n (Math.floor(currentElement.scrollTop) > 0 && !scrollEnd) ||\n (Math.ceil(currentElement.scrollTop + currentElement.clientHeight) <\n currentElement.scrollHeight &&\n scrollEnd)\n ) {\n return true;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n } else {\n return false;\n }\n }\n\n return false;\n}\n\nfunction canScrollHorizontal(\n element: Element,\n rootElement: Element,\n scrollEnd: boolean,\n): boolean {\n let currentElement = element;\n\n while (currentElement !== rootElement.parentElement) {\n if (\n (Math.floor(currentElement.scrollLeft) > 0 && !scrollEnd) ||\n (Math.ceil(currentElement.scrollLeft + currentElement.clientWidth) <\n currentElement.scrollWidth &&\n scrollEnd)\n ) {\n return true;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n } else {\n return false;\n }\n }\n\n return false;\n}\n","/**\n * @deprecated: use {@link tuiContainsOrAfter} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function containsOrAfter(current: Node, node: Node): boolean {\n return (\n current.contains(node) ||\n !!(node.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_PRECEDING)\n );\n}\n\nexport const tuiContainsOrAfter = containsOrAfter;\n","/** @deprecated only needed for IE, remove in 3.0 */\nexport function tuiCustomEvent<T = null>(\n name: string,\n {bubbles = false, cancelable = false, detail = null}: CustomEventInit<T | null> = {},\n documentRef: Document,\n): CustomEvent {\n if (typeof CustomEvent === `function`) {\n return new CustomEvent(name, {bubbles, cancelable, detail});\n }\n\n const customEvent = documentRef.createEvent(`CustomEvent`);\n\n customEvent.initCustomEvent(name, bubbles, cancelable, detail);\n\n return customEvent;\n}\n","/**\n * @deprecated: use {@link tuiGetActualTarget} instead\n * Gets actual target from open Shadow DOM if event happened within it\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getActualTarget(event: Event): Node {\n if (`composedPath` in event) {\n return (event as any).composedPath()[0];\n }\n\n return (event as any).target;\n}\n\nexport const tuiGetActualTarget = getActualTarget;\n","const DEFAULT_FORMAT = `text/plain`;\n\n/**\n * @deprecated: use {@link tuiGetClipboardDataText} instead\n * Gets text from data of clipboardEvent, it also works in IE and Edge browsers\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClipboardDataText(\n event: ClipboardEvent,\n format: string = DEFAULT_FORMAT,\n): string {\n return `clipboardData` in event && event.clipboardData !== null\n ? event.clipboardData.getData(format) ||\n event.clipboardData.getData(DEFAULT_FORMAT)\n : (event as any).target.ownerDocument.defaultView.clipboardData.getData(`text`);\n}\n\nexport const tuiGetClipboardDataText = getClipboardDataText;\n","/**\n * @deprecated only needed for IE, remove in 3.0\n * Gets the closest element by selector i.e. {@link Element.closest}\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClosestElement(element: Element, selector: string): Element | null {\n const closest = Element.prototype.closest;\n\n if (closest) {\n return closest.call(element, selector);\n }\n\n const matchesSelector =\n Element.prototype.matches || (Element.prototype as any).msMatchesSelector;\n\n do {\n if (matchesSelector.call(element, selector)) {\n return element;\n }\n\n element = element.parentElement as Element;\n } while (element !== null);\n\n return null;\n}\n","/**\n * @deprecated: use {@link tuiGetDocumentOrShadowRoot} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getDocumentOrShadowRoot(node: Node): DocumentOrShadowRoot {\n return `getRootNode` in node && node.isConnected\n ? (node.getRootNode() as Document)\n : (node.ownerDocument as DocumentOrShadowRoot);\n}\n\nexport const tuiGetDocumentOrShadowRoot = getDocumentOrShadowRoot;\n","import {clamp} from '@taiga-ui/cdk/utils/math';\nimport {isPresent} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {getDocumentOrShadowRoot} from './get-document-or-shadow-root';\n\n/**\n * @deprecated: use {@link tuiGetElementObscures} instead\n * Returns array of Elements covering edges of given element or null if at least one edge middle point is visible\n *\n * CAUTION: Empty array means element if offscreen i.e. covered by no elements, rather than not covered\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getElementObscurers(element: Element): readonly Element[] | null {\n const {ownerDocument} = element;\n\n if (!ownerDocument?.defaultView) {\n return null;\n }\n\n const {innerWidth, innerHeight} = ownerDocument.defaultView;\n const documentRef = getDocumentOrShadowRoot(element);\n const rect = element.getBoundingClientRect();\n const left = clamp(Math.round(rect.left) + 2, 0, innerWidth);\n const top = clamp(Math.round(rect.top) + 2, 0, innerHeight);\n const right = clamp(Math.round(rect.right) - 2, 0, innerWidth);\n const bottom = clamp(Math.round(rect.bottom) - 2, 0, innerHeight);\n const horizontalMiddle = clamp(Math.round(rect.left + rect.width / 2), 0, innerWidth);\n const verticalMiddle = clamp(Math.round(rect.top + rect.height / 2), 0, innerHeight);\n const elements = [\n documentRef.elementFromPoint(horizontalMiddle, top),\n documentRef.elementFromPoint(horizontalMiddle, bottom),\n documentRef.elementFromPoint(left, verticalMiddle),\n documentRef.elementFromPoint(right, verticalMiddle),\n ];\n const nonNull = elements.filter(isPresent);\n\n if (!nonNull.length) {\n return nonNull;\n }\n\n const filtered = nonNull.filter(el => !element.contains(el));\n\n return filtered.length === 4 ? filtered : null;\n}\n\nexport const tuiGetElementObscures = getElementObscurers;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiGetElementOffset} instead\n * Calculates offset for an element relative to it's parent several levels above\n *\n * @param host parent element\n * @param element\n * @return object with offsetTop and offsetLeft number properties\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getElementOffset(\n host: Element,\n element: HTMLElement,\n): {offsetTop: number; offsetLeft: number} {\n tuiAssert.assert(host.contains(element), `Host must contain element`);\n\n let {offsetTop, offsetLeft, offsetParent} = element;\n\n // TODO: iframe warning\n while (offsetParent && offsetParent instanceof HTMLElement && offsetParent !== host) {\n offsetTop += offsetParent.offsetTop;\n offsetLeft += offsetParent.offsetLeft;\n offsetParent = offsetParent.offsetParent;\n }\n\n return {offsetTop, offsetLeft};\n}\n\nexport const tuiGetElementOffset = getElementOffset;\n","/**\n * @deprecated: use {@link tuiGetScrollParent} instead\n * Finds the nearest parent with scroll in it\n *\n * @param element initial element\n * @param vertical flag for orientation of scroll\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getScrollParent(\n element: Element | null,\n vertical: boolean = true,\n): Element | null {\n if (element === null) {\n return null;\n }\n\n if (vertical && element.scrollHeight > element.clientHeight) {\n return element;\n }\n\n if (!vertical && element.scrollWidth > element.clientWidth) {\n return element;\n }\n\n return getScrollParent(element.parentElement, vertical);\n}\n\nexport const tuiGetScrollParent = getScrollParent;\n","export function tuiIsFormFieldElement(\n element: unknown | null,\n): element is HTMLInputElement | HTMLTextAreaElement {\n const textfield = element as Record<string, unknown> | null;\n\n return (\n !!textfield &&\n `value` in textfield &&\n `selectionStart` in textfield &&\n `selectionEnd` in textfield\n );\n}\n","import {tuiIsFormFieldElement} from './is-form-field';\n\n/**\n * @description:\n * cross browser way to get selected text\n *\n * History:\n * BUG - window.getSelection() fails when text selected in a form field\n * https://bugzilla.mozilla.org/show_bug.cgi?id=85686\n */\nexport function tuiGetSelectedText({getSelection, document}: Window): string | null {\n return tuiIsFormFieldElement(document.activeElement)\n ? document.activeElement.value.slice(\n document.activeElement.selectionStart || 0,\n document.activeElement.selectionEnd || 0,\n )\n : getSelection()?.toString() || null;\n}\n","/**\n * @deprecated: use {@link tuiIsCurrentTarget} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCurrentTarget({target, currentTarget}: Event): boolean {\n return target === currentTarget;\n}\n\nexport const tuiIsCurrentTarget = isCurrentTarget;\n","// TODO: Refactor to use this check everywhere\nexport function tuiIsElement(node: Node): node is Element {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n","/**\n * @deprecated: use {@link tuiIsInsideIframe} instead\n * Checks if an app is running inside <iframe /> tag\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isInsideIframe(windowRef: Window): boolean {\n return windowRef.parent !== windowRef;\n}\n\nexport const tuiIsInsideIframe = isInsideIframe;\n","import {getClosestElement} from './get-closest-element';\n\n/**\n * @deprecated: use {@link tuiIsNodeIn} instead\n * Checks if node is inside a specific selector\n *\n * @param node\n * @param selector\n * @return true if node is inside a particular selector\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNodeIn(node: Node, selector: string): boolean {\n return node.nodeType === Node.TEXT_NODE\n ? !!node.parentElement && !!getClosestElement(node.parentElement, selector)\n : node.nodeType === Node.ELEMENT_NODE &&\n !!getClosestElement(node as Element, selector);\n}\n\nexport const tuiIsNodeIn = isNodeIn;\n","export function tuiPointToClientRect(x: number = 0, y: number = 0): ClientRect {\n return {\n left: x,\n right: x,\n top: y,\n bottom: y,\n width: 0,\n height: 0,\n };\n}\n"],"names":["clamp","isPresent","tuiAssert"],"mappings":";;;;;;IAAA;;;IAGA;aACgB,SAAS,CACr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a,EAAE,QAAQ,CAAC;cACzE,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY;gBAC/B,CAAC,CAAC,iBAAiB,CAAC,IAAe,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;QAEY,WAAW,GAAG;;aClBX,oBAAoB,CAAC,CAAa,EAAE,CAAa;QAA5B,kBAAA,EAAA,KAAa;QAAE,kBAAA,EAAA,KAAa;QAC7D,OAAO;YACH,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;SACZ,CAAC;IACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@taiga-ui/cdk/utils/math"),require("@taiga-ui/cdk/utils/miscellaneous"),require("@taiga-ui/cdk/classes")):"function"==typeof define&&define.amd?define("@taiga-ui/cdk/utils/dom",["exports","@taiga-ui/cdk/utils/math","@taiga-ui/cdk/utils/miscellaneous","@taiga-ui/cdk/classes"],e):e(((t=t||self)["taiga-ui"]=t["taiga-ui"]||{},t["taiga-ui"].cdk=t["taiga-ui"].cdk||{},t["taiga-ui"].cdk.utils=t["taiga-ui"].cdk.utils||{},t["taiga-ui"].cdk.utils.dom={}),t["taiga-ui"].cdk.utils.math,t["taiga-ui"].cdk.utils.miscellaneous,t["taiga-ui"].cdk.classes)}(this,(function(t,e,n,i){"use strict";function r(t,e,n,i){return n?function(t,e,n){var i=t;for(;i!==e.parentElement;){if(Math.floor(i.scrollTop)>0&&!n||Math.ceil(i.scrollTop+i.clientHeight)<i.scrollHeight&&n)return!0;if(!i.parentElement)return!1;i=i.parentElement}return!1}(t,e,i):function(t,e,n){var i=t;for(;i!==e.parentElement;){if(Math.floor(i.scrollLeft)>0&&!n||Math.ceil(i.scrollLeft+i.clientWidth)<i.scrollWidth&&n)return!0;if(!i.parentElement)return!1;i=i.parentElement}return!1}(t,e,i)}var o=r;function a(t,e){return t.contains(e)||!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}var l=a;function u(t){return"composedPath"in t?t.composedPath()[0]:t.target}var c=u;function s(t,e){return void 0===e&&(e="text/plain"),"clipboardData"in t&&null!==t.clipboardData?t.clipboardData.getData(e)||t.clipboardData.getData("text/plain"):t.target.ownerDocument.defaultView.clipboardData.getData("text")}var d=s;function f(t,e){var n=Element.prototype.closest;if(n)return n.call(t,e);var i=Element.prototype.matches||Element.prototype.msMatchesSelector;do{if(i.call(t,e))return t;t=t.parentElement}while(null!==t);return null}function m(t){return"getRootNode"in t&&t.isConnected?t.getRootNode():t.ownerDocument}var p=m;function g(t){var i=t.ownerDocument;if(!i||!i.defaultView)return null;var r=i.defaultView,o=r.innerWidth,a=r.innerHeight,l=m(t),u=t.getBoundingClientRect(),c=e.clamp(Math.round(u.left)+2,0,o),s=e.clamp(Math.round(u.top)+2,0,a),d=e.clamp(Math.round(u.right)-2,0,o),f=e.clamp(Math.round(u.bottom)-2,0,a),p=e.clamp(Math.round(u.left+u.width/2),0,o),g=e.clamp(Math.round(u.top+u.height/2),0,a),E=[l.elementFromPoint(p,s),l.elementFromPoint(p,f),l.elementFromPoint(c,g),l.elementFromPoint(d,g)].filter(n.isPresent);if(!E.length)return E;var v=E.filter((function(e){return!t.contains(e)}));return 4===v.length?v:null}var E=g;function v(t,e){i.tuiAssert.assert(t.contains(e),"Host must contain element");for(var n=e.offsetTop,r=e.offsetLeft,o=e.offsetParent;o&&o instanceof HTMLElement&&o!==t;)n+=o.offsetTop,r+=o.offsetLeft,o=o.offsetParent;return{offsetTop:n,offsetLeft:r}}var h=v;function T(t,e){return void 0===e&&(e=!0),null===t?null:e&&t.scrollHeight>t.clientHeight||!e&&t.scrollWidth>t.clientWidth?t:T(t.parentElement,e)}var b=T;function D(t){return!!t&&"value"in t&&"selectionStart"in t&&"selectionEnd"in t}function C(t){return t.target===t.currentTarget}var M=C;function N(t){return t.parent!==t}var P=N;function k(t,e){return t.nodeType===Node.TEXT_NODE?!!t.parentElement&&!!f(t.parentElement,e):t.nodeType===Node.ELEMENT_NODE&&!!f(t,e)}var O=k;t.canScroll=r,t.containsOrAfter=a,t.getActualTarget=u,t.getClipboardDataText=s,t.getClosestElement=f,t.getDocumentOrShadowRoot=m,t.getElementObscurers=g,t.getElementOffset=v,t.getScrollParent=T,t.isCurrentTarget=C,t.isInsideIframe=N,t.isNodeIn=k,t.tuiCanScroll=o,t.tuiContainsOrAfter=l,t.tuiCustomEvent=function(t,e,n){var i=void 0===e?{}:e,r=i.bubbles,o=void 0!==r&&r,a=i.cancelable,l=void 0!==a&&a,u=i.detail,c=void 0===u?null:u;if("function"==typeof CustomEvent)return new CustomEvent(t,{bubbles:o,cancelable:l,detail:c});var s=n.createEvent("CustomEvent");return s.initCustomEvent(t,o,l,c),s},t.tuiGetActualTarget=c,t.tuiGetClipboardDataText=d,t.tuiGetDocumentOrShadowRoot=p,t.tuiGetElementObscures=E,t.tuiGetElementOffset=h,t.tuiGetScrollParent=b,t.tuiGetSelectedText=function(t){var e,n=t.getSelection,i=t.document;return D(i.activeElement)?i.activeElement.value.slice(i.activeElement.selectionStart||0,i.activeElement.selectionEnd||0):(null===(e=n())||void 0===e?void 0:e.toString())||null},t.tuiIsCurrentTarget=M,t.tuiIsElement=function(t){return t.nodeType===Node.ELEMENT_NODE},t.tuiIsFormFieldElement=D,t.tuiIsInsideIframe=P,t.tuiIsNodeIn=O,t.tuiPointToClientRect=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),{left:t,right:t,top:e,bottom:e,width:0,height:0}},Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@taiga-ui/cdk/utils/math"),require("@taiga-ui/cdk/utils/miscellaneous"),require("@taiga-ui/cdk/classes")):"function"==typeof define&&define.amd?define("@taiga-ui/cdk/utils/dom",["exports","@taiga-ui/cdk/utils/math","@taiga-ui/cdk/utils/miscellaneous","@taiga-ui/cdk/classes"],e):e(((t=t||self)["taiga-ui"]=t["taiga-ui"]||{},t["taiga-ui"].cdk=t["taiga-ui"].cdk||{},t["taiga-ui"].cdk.utils=t["taiga-ui"].cdk.utils||{},t["taiga-ui"].cdk.utils.dom={}),t["taiga-ui"].cdk.utils.math,t["taiga-ui"].cdk.utils.miscellaneous,t["taiga-ui"].cdk.classes)}(this,(function(t,e,n,i){"use strict";function r(t,e,n,i){return n?function(t,e,n){var i=t;for(;i!==e.parentElement;){if(Math.floor(i.scrollTop)>0&&!n||Math.ceil(i.scrollTop+i.clientHeight)<i.scrollHeight&&n)return!0;if(!i.parentElement)return!1;i=i.parentElement}return!1}(t,e,i):function(t,e,n){var i=t;for(;i!==e.parentElement;){if(Math.floor(i.scrollLeft)>0&&!n||Math.ceil(i.scrollLeft+i.clientWidth)<i.scrollWidth&&n)return!0;if(!i.parentElement)return!1;i=i.parentElement}return!1}(t,e,i)}var o=r;function a(t,e){return t.contains(e)||!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}var l=a;function u(t){return"composedPath"in t?t.composedPath()[0]:t.target}var c=u;function s(t,e){return void 0===e&&(e="text/plain"),"clipboardData"in t&&null!==t.clipboardData?t.clipboardData.getData(e)||t.clipboardData.getData("text/plain"):t.target.ownerDocument.defaultView.clipboardData.getData("text")}var d=s;function f(t,e){var n=Element.prototype.closest;if(n)return n.call(t,e);var i=Element.prototype.matches||Element.prototype.msMatchesSelector;do{if(i.call(t,e))return t;t=t.parentElement}while(null!==t);return null}function m(t){return"getRootNode"in t&&t.isConnected?t.getRootNode():t.ownerDocument}var p=m;function g(t){var i=t.ownerDocument;if(!(null==i?void 0:i.defaultView))return null;var r=i.defaultView,o=r.innerWidth,a=r.innerHeight,l=m(t),u=t.getBoundingClientRect(),c=e.clamp(Math.round(u.left)+2,0,o),s=e.clamp(Math.round(u.top)+2,0,a),d=e.clamp(Math.round(u.right)-2,0,o),f=e.clamp(Math.round(u.bottom)-2,0,a),p=e.clamp(Math.round(u.left+u.width/2),0,o),g=e.clamp(Math.round(u.top+u.height/2),0,a),v=[l.elementFromPoint(p,s),l.elementFromPoint(p,f),l.elementFromPoint(c,g),l.elementFromPoint(d,g)].filter(n.isPresent);if(!v.length)return v;var E=v.filter((function(e){return!t.contains(e)}));return 4===E.length?E:null}var v=g;function E(t,e){i.tuiAssert.assert(t.contains(e),"Host must contain element");for(var n=e.offsetTop,r=e.offsetLeft,o=e.offsetParent;o&&o instanceof HTMLElement&&o!==t;)n+=o.offsetTop,r+=o.offsetLeft,o=o.offsetParent;return{offsetTop:n,offsetLeft:r}}var h=E;function T(t,e){return void 0===e&&(e=!0),null===t?null:e&&t.scrollHeight>t.clientHeight||!e&&t.scrollWidth>t.clientWidth?t:T(t.parentElement,e)}var b=T;function D(t){return!!t&&"value"in t&&"selectionStart"in t&&"selectionEnd"in t}function C(t){return t.target===t.currentTarget}var M=C;function N(t){return t.parent!==t}var P=N;function k(t,e){return t.nodeType===Node.TEXT_NODE?!!t.parentElement&&!!f(t.parentElement,e):t.nodeType===Node.ELEMENT_NODE&&!!f(t,e)}var O=k;t.canScroll=r,t.containsOrAfter=a,t.getActualTarget=u,t.getClipboardDataText=s,t.getClosestElement=f,t.getDocumentOrShadowRoot=m,t.getElementObscurers=g,t.getElementOffset=E,t.getScrollParent=T,t.isCurrentTarget=C,t.isInsideIframe=N,t.isNodeIn=k,t.tuiCanScroll=o,t.tuiContainsOrAfter=l,t.tuiCustomEvent=function(t,e,n){var i=void 0===e?{}:e,r=i.bubbles,o=void 0!==r&&r,a=i.cancelable,l=void 0!==a&&a,u=i.detail,c=void 0===u?null:u;if("function"==typeof CustomEvent)return new CustomEvent(t,{bubbles:o,cancelable:l,detail:c});var s=n.createEvent("CustomEvent");return s.initCustomEvent(t,o,l,c),s},t.tuiGetActualTarget=c,t.tuiGetClipboardDataText=d,t.tuiGetDocumentOrShadowRoot=p,t.tuiGetElementObscures=v,t.tuiGetElementOffset=h,t.tuiGetScrollParent=b,t.tuiGetSelectedText=function(t){var e,n=t.getSelection,i=t.document;return D(i.activeElement)?i.activeElement.value.slice(i.activeElement.selectionStart||0,i.activeElement.selectionEnd||0):(null===(e=n())||void 0===e?void 0:e.toString())||null},t.tuiIsCurrentTarget=M,t.tuiIsElement=function(t){return t.nodeType===Node.ELEMENT_NODE},t.tuiIsFormFieldElement=D,t.tuiIsInsideIframe=P,t.tuiIsNodeIn=O,t.tuiPointToClientRect=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),{left:t,right:t,top:e,bottom:e,width:0,height:0}},Object.defineProperty(t,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=taiga-ui-cdk-utils-dom.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ng://@taiga-ui/cdk/utils/dom/can-scroll.ts","ng://@taiga-ui/cdk/utils/dom/contains-or-after.ts","ng://@taiga-ui/cdk/utils/dom/get-actual-target.ts","ng://@taiga-ui/cdk/utils/dom/get-clipboard-data-text.ts","ng://@taiga-ui/cdk/utils/dom/get-closest-element.ts","ng://@taiga-ui/cdk/utils/dom/get-document-or-shadow-root.ts","ng://@taiga-ui/cdk/utils/dom/get-element-obscurers.ts","ng://@taiga-ui/cdk/utils/dom/get-element-offset.ts","ng://@taiga-ui/cdk/utils/dom/get-scroll-parent.ts","ng://@taiga-ui/cdk/utils/dom/is-form-field.ts","ng://@taiga-ui/cdk/utils/dom/is-current-target.ts","ng://@taiga-ui/cdk/utils/dom/is-inside-iframe.ts","ng://@taiga-ui/cdk/utils/dom/is-node-in.ts","ng://@taiga-ui/cdk/utils/dom/custom-event.ts","ng://@taiga-ui/cdk/utils/dom/get-selected-text.ts","ng://@taiga-ui/cdk/utils/dom/is-element.ts","ng://@taiga-ui/cdk/utils/dom/point-to-client-rect.ts"],"names":["canScroll","element","rootElement","vertical","scrollEnd","currentElement","parentElement","Math","floor","scrollTop","ceil","clientHeight","scrollHeight","canScrollVertical","scrollLeft","clientWidth","scrollWidth","canScrollHorizontal","tuiCanScroll","containsOrAfter","current","node","contains","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","tuiContainsOrAfter","getActualTarget","event","composedPath","target","tuiGetActualTarget","getClipboardDataText","format","clipboardData","getData","ownerDocument","defaultView","tuiGetClipboardDataText","getClosestElement","selector","closest","Element","prototype","call","matchesSelector","matches","msMatchesSelector","getDocumentOrShadowRoot","isConnected","getRootNode","tuiGetDocumentOrShadowRoot","getElementObscurers","_a","innerWidth","innerHeight","documentRef","rect","getBoundingClientRect","left","clamp","round","top","right","bottom","horizontalMiddle","width","verticalMiddle","height","nonNull","elementFromPoint","filter","isPresent","length","filtered","el","tuiGetElementObscures","getElementOffset","host","tuiAssert","assert","offsetTop","offsetLeft","offsetParent","HTMLElement","tuiGetElementOffset","getScrollParent","tuiGetScrollParent","tuiIsFormFieldElement","isCurrentTarget","currentTarget","tuiIsCurrentTarget","isInsideIframe","windowRef","parent","tuiIsInsideIframe","isNodeIn","nodeType","TEXT_NODE","ELEMENT_NODE","tuiIsNodeIn","name","_b","_c","bubbles","_d","cancelable","_e","detail","CustomEvent","customEvent","createEvent","initCustomEvent","getSelection","document","activeElement","value","slice","selectionStart","selectionEnd","toString","x","y"],"mappings":"oqBAIgBA,EACZC,EACAC,EACAC,EACAC,GAEA,OAAOD,EAOX,SACIF,EACAC,EACAE,GAEA,IAAIC,EAAiBJ,EAErB,KAAOI,IAAmBH,EAAYI,eAAe,CACjD,GACKC,KAAKC,MAAMH,EAAeI,WAAa,IAAML,GAC7CG,KAAKG,KAAKL,EAAeI,UAAYJ,EAAeM,cACjDN,EAAeO,cACfR,EAEJ,OAAO,EAGX,IAAIC,EAAeC,cAGf,OAAO,EAFPD,EAAiBA,EAAeC,cAMxC,OAAO,EA9BDO,CAAkBZ,EAASC,EAAaE,GAiClD,SACIH,EACAC,EACAE,GAEA,IAAIC,EAAiB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,GACzB,OAAOA,EAAK4E,WAAazE,KAAK2E,8GCFGsB,EAAeC,GAChD,YADiC,IAAAD,IAAAA,EAAA,QAAe,IAAAC,IAAAA,EAAA,GACzC,CACH/D,KAAM8D,EACN1D,MAAO0D,EACP3D,IAAK4D,EACL1D,OAAQ0D,EACRxD,MAAO,EACPE,OAAQ","sourcesContent":["/**\n * @deprecated: use {@link tuiCanScroll} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function canScroll(\n element: Element,\n rootElement: Element,\n vertical: boolean,\n scrollEnd: boolean,\n): boolean {\n return vertical\n ? canScrollVertical(element, rootElement, scrollEnd)\n : canScrollHorizontal(element, rootElement, scrollEnd);\n}\n\nexport const tuiCanScroll = canScroll;\n\nfunction canScrollVertical(\n element: Element,\n rootElement: Element,\n scrollEnd: boolean,\n): boolean {\n let currentElement = element;\n\n while (currentElement !== rootElement.parentElement) {\n if (\n (Math.floor(currentElement.scrollTop) > 0 && !scrollEnd) ||\n (Math.ceil(currentElement.scrollTop + currentElement.clientHeight) <\n currentElement.scrollHeight &&\n scrollEnd)\n ) {\n return true;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n } else {\n return false;\n }\n }\n\n return false;\n}\n\nfunction canScrollHorizontal(\n element: Element,\n rootElement: Element,\n scrollEnd: boolean,\n): boolean {\n let currentElement = element;\n\n while (currentElement !== rootElement.parentElement) {\n if (\n (Math.floor(currentElement.scrollLeft) > 0 && !scrollEnd) ||\n (Math.ceil(currentElement.scrollLeft + currentElement.clientWidth) <\n currentElement.scrollWidth &&\n scrollEnd)\n ) {\n return true;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n } else {\n return false;\n }\n }\n\n return false;\n}\n","/**\n * @deprecated: use {@link tuiContainsOrAfter} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function containsOrAfter(current: Node, node: Node): boolean {\n return (\n current.contains(node) ||\n !!(node.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_PRECEDING)\n );\n}\n\nexport const tuiContainsOrAfter = containsOrAfter;\n","/**\n * @deprecated: use {@link tuiGetActualTarget} instead\n * Gets actual target from open Shadow DOM if event happened within it\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getActualTarget(event: Event): Node {\n if (`composedPath` in event) {\n return (event as any).composedPath()[0];\n }\n\n return (event as any).target;\n}\n\nexport const tuiGetActualTarget = getActualTarget;\n","const DEFAULT_FORMAT = `text/plain`;\n\n/**\n * @deprecated: use {@link tuiGetClipboardDataText} instead\n * Gets text from data of clipboardEvent, it also works in IE and Edge browsers\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClipboardDataText(\n event: ClipboardEvent,\n format: string = DEFAULT_FORMAT,\n): string {\n return `clipboardData` in event && event.clipboardData !== null\n ? event.clipboardData.getData(format) ||\n event.clipboardData.getData(DEFAULT_FORMAT)\n : (event as any).target.ownerDocument.defaultView.clipboardData.getData(`text`);\n}\n\nexport const tuiGetClipboardDataText = getClipboardDataText;\n","/**\n * @deprecated only needed for IE, remove in 3.0\n * Gets the closest element by selector i.e. {@link Element.closest}\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClosestElement(element: Element, selector: string): Element | null {\n const closest = Element.prototype.closest;\n\n if (closest) {\n return closest.call(element, selector);\n }\n\n const matchesSelector =\n Element.prototype.matches || (Element.prototype as any).msMatchesSelector;\n\n do {\n if (matchesSelector.call(element, selector)) {\n return element;\n }\n\n (element as Element | null) = element.parentElement;\n } while (element !== null);\n\n return null;\n}\n","/**\n * @deprecated: use {@link tuiGetDocumentOrShadowRoot} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getDocumentOrShadowRoot(node: Node): DocumentOrShadowRoot {\n return `getRootNode` in node && node.isConnected\n ? (node.getRootNode() as Document)\n : node.ownerDocument!;\n}\n\nexport const tuiGetDocumentOrShadowRoot = getDocumentOrShadowRoot;\n","import {clamp} from '@taiga-ui/cdk/utils/math';\nimport {isPresent} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {getDocumentOrShadowRoot} from './get-document-or-shadow-root';\n\n/**\n * @deprecated: use {@link tuiGetElementObscures} instead\n * Returns array of Elements covering edges of given element or null if at least one edge middle point is visible\n *\n * CAUTION: Empty array means element if offscreen i.e. covered by no elements, rather than not covered\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getElementObscurers(element: Element): readonly Element[] | null {\n const {ownerDocument} = element;\n\n if (!ownerDocument || !ownerDocument.defaultView) {\n return null;\n }\n\n const {innerWidth, innerHeight} = ownerDocument.defaultView;\n const documentRef = getDocumentOrShadowRoot(element);\n const rect = element.getBoundingClientRect();\n const left = clamp(Math.round(rect.left) + 2, 0, innerWidth);\n const top = clamp(Math.round(rect.top) + 2, 0, innerHeight);\n const right = clamp(Math.round(rect.right) - 2, 0, innerWidth);\n const bottom = clamp(Math.round(rect.bottom) - 2, 0, innerHeight);\n const horizontalMiddle = clamp(Math.round(rect.left + rect.width / 2), 0, innerWidth);\n const verticalMiddle = clamp(Math.round(rect.top + rect.height / 2), 0, innerHeight);\n const elements = [\n documentRef.elementFromPoint(horizontalMiddle, top),\n documentRef.elementFromPoint(horizontalMiddle, bottom),\n documentRef.elementFromPoint(left, verticalMiddle),\n documentRef.elementFromPoint(right, verticalMiddle),\n ];\n const nonNull = elements.filter(isPresent);\n\n if (!nonNull.length) {\n return nonNull;\n }\n\n const filtered = nonNull.filter(el => !element.contains(el));\n\n return filtered.length === 4 ? filtered : null;\n}\n\nexport const tuiGetElementObscures = getElementObscurers;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiGetElementOffset} instead\n * Calculates offset for an element relative to it's parent several levels above\n *\n * @param host parent element\n * @param element\n * @return object with offsetTop and offsetLeft number properties\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getElementOffset(\n host: Element,\n element: HTMLElement,\n): {offsetTop: number; offsetLeft: number} {\n tuiAssert.assert(host.contains(element), `Host must contain element`);\n\n let {offsetTop, offsetLeft, offsetParent} = element;\n\n // TODO: iframe warning\n while (offsetParent && offsetParent instanceof HTMLElement && offsetParent !== host) {\n offsetTop += offsetParent.offsetTop;\n offsetLeft += offsetParent.offsetLeft;\n offsetParent = offsetParent.offsetParent;\n }\n\n return {offsetTop, offsetLeft};\n}\n\nexport const tuiGetElementOffset = getElementOffset;\n","/**\n * @deprecated: use {@link tuiGetScrollParent} instead\n * Finds the nearest parent with scroll in it\n *\n * @param element initial element\n * @param vertical flag for orientation of scroll\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getScrollParent(\n element: Element | null,\n vertical: boolean = true,\n): Element | null {\n if (element === null) {\n return null;\n }\n\n if (vertical && element.scrollHeight > element.clientHeight) {\n return element;\n }\n\n if (!vertical && element.scrollWidth > element.clientWidth) {\n return element;\n }\n\n return getScrollParent(element.parentElement, vertical);\n}\n\nexport const tuiGetScrollParent = getScrollParent;\n","export function tuiIsFormFieldElement(\n element: unknown | null,\n): element is HTMLInputElement | HTMLTextAreaElement {\n const textfield = element as Record<string, unknown> | null;\n\n return (\n !!textfield &&\n `value` in textfield &&\n `selectionStart` in textfield &&\n `selectionEnd` in textfield\n );\n}\n","/**\n * @deprecated: use {@link tuiIsCurrentTarget} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCurrentTarget({target, currentTarget}: Event): boolean {\n return target === currentTarget;\n}\n\nexport const tuiIsCurrentTarget = isCurrentTarget;\n","/**\n * @deprecated: use {@link tuiIsInsideIframe} instead\n * Checks if an app is running inside <iframe /> tag\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isInsideIframe(windowRef: Window): boolean {\n return windowRef.parent !== windowRef;\n}\n\nexport const tuiIsInsideIframe = isInsideIframe;\n","import {getClosestElement} from './get-closest-element';\n\n/**\n * @deprecated: use {@link tuiIsNodeIn} instead\n * Checks if node is inside a specific selector\n *\n * @param node\n * @param selector\n * @return true if node is inside a particular selector\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNodeIn(node: Node, selector: string): boolean {\n return node.nodeType === Node.TEXT_NODE\n ? !!node.parentElement && !!getClosestElement(node.parentElement, selector)\n : node.nodeType === Node.ELEMENT_NODE &&\n !!getClosestElement(node as Element, selector);\n}\n\nexport const tuiIsNodeIn = isNodeIn;\n","/** @deprecated only needed for IE, remove in 3.0 */\nexport function tuiCustomEvent<T = null>(\n name: string,\n {bubbles = false, cancelable = false, detail = null}: CustomEventInit<T | null> = {},\n documentRef: Document,\n): CustomEvent {\n if (typeof CustomEvent === `function`) {\n return new CustomEvent(name, {bubbles, cancelable, detail});\n }\n\n const customEvent = documentRef.createEvent(`CustomEvent`);\n\n customEvent.initCustomEvent(name, bubbles, cancelable, detail);\n\n return customEvent;\n}\n","import {tuiIsFormFieldElement} from './is-form-field';\n\n/**\n * @description:\n * cross browser way to get selected text\n *\n * History:\n * BUG - window.getSelection() fails when text selected in a form field\n * https://bugzilla.mozilla.org/show_bug.cgi?id=85686\n */\nexport function tuiGetSelectedText({getSelection, document}: Window): string | null {\n return tuiIsFormFieldElement(document.activeElement)\n ? document.activeElement.value.slice(\n document.activeElement.selectionStart || 0,\n document.activeElement.selectionEnd || 0,\n )\n : getSelection()?.toString() || null;\n}\n","// TODO: Refactor to use this check everywhere\nexport function tuiIsElement(node: Node): node is Element {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n","export function tuiPointToClientRect(x: number = 0, y: number = 0): ClientRect {\n return {\n left: x,\n right: x,\n top: y,\n bottom: y,\n width: 0,\n height: 0,\n };\n}\n"]}
1
+ {"version":3,"sources":["ng://@taiga-ui/cdk/utils/dom/can-scroll.ts","ng://@taiga-ui/cdk/utils/dom/contains-or-after.ts","ng://@taiga-ui/cdk/utils/dom/get-actual-target.ts","ng://@taiga-ui/cdk/utils/dom/get-clipboard-data-text.ts","ng://@taiga-ui/cdk/utils/dom/get-closest-element.ts","ng://@taiga-ui/cdk/utils/dom/get-document-or-shadow-root.ts","ng://@taiga-ui/cdk/utils/dom/get-element-obscurers.ts","ng://@taiga-ui/cdk/utils/dom/get-element-offset.ts","ng://@taiga-ui/cdk/utils/dom/get-scroll-parent.ts","ng://@taiga-ui/cdk/utils/dom/is-form-field.ts","ng://@taiga-ui/cdk/utils/dom/is-current-target.ts","ng://@taiga-ui/cdk/utils/dom/is-inside-iframe.ts","ng://@taiga-ui/cdk/utils/dom/is-node-in.ts","ng://@taiga-ui/cdk/utils/dom/custom-event.ts","ng://@taiga-ui/cdk/utils/dom/get-selected-text.ts","ng://@taiga-ui/cdk/utils/dom/is-element.ts","ng://@taiga-ui/cdk/utils/dom/point-to-client-rect.ts"],"names":["canScroll","element","rootElement","vertical","scrollEnd","currentElement","parentElement","Math","floor","scrollTop","ceil","clientHeight","scrollHeight","canScrollVertical","scrollLeft","clientWidth","scrollWidth","canScrollHorizontal","tuiCanScroll","containsOrAfter","current","node","contains","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","tuiContainsOrAfter","getActualTarget","event","composedPath","target","tuiGetActualTarget","getClipboardDataText","format","clipboardData","getData","ownerDocument","defaultView","tuiGetClipboardDataText","getClosestElement","selector","closest","Element","prototype","call","matchesSelector","matches","msMatchesSelector","getDocumentOrShadowRoot","isConnected","getRootNode","tuiGetDocumentOrShadowRoot","getElementObscurers","_a","innerWidth","innerHeight","documentRef","rect","getBoundingClientRect","left","clamp","round","top","right","bottom","horizontalMiddle","width","verticalMiddle","height","nonNull","elementFromPoint","filter","isPresent","length","filtered","el","tuiGetElementObscures","getElementOffset","host","tuiAssert","assert","offsetTop","offsetLeft","offsetParent","HTMLElement","tuiGetElementOffset","getScrollParent","tuiGetScrollParent","tuiIsFormFieldElement","isCurrentTarget","currentTarget","tuiIsCurrentTarget","isInsideIframe","windowRef","parent","tuiIsInsideIframe","isNodeIn","nodeType","TEXT_NODE","ELEMENT_NODE","tuiIsNodeIn","name","_b","_c","bubbles","_d","cancelable","_e","detail","CustomEvent","customEvent","createEvent","initCustomEvent","getSelection","document","activeElement","value","slice","selectionStart","selectionEnd","toString","x","y"],"mappings":"oqBAIgBA,EACZC,EACAC,EACAC,EACAC,GAEA,OAAOD,EAOX,SACIF,EACAC,EACAE,GAEA,IAAIC,EAAiBJ,EAErB,KAAOI,IAAmBH,EAAYI,eAAe,CACjD,GACKC,KAAKC,MAAMH,EAAeI,WAAa,IAAML,GAC7CG,KAAKG,KAAKL,EAAeI,UAAYJ,EAAeM,cACjDN,EAAeO,cACfR,EAEJ,OAAO,EAGX,IAAIC,EAAeC,cAGf,OAAO,EAFPD,EAAiBA,EAAeC,cAMxC,OAAO,EA9BDO,CAAkBZ,EAASC,EAAaE,GAiClD,SACIH,EACAC,EACAE,GAEA,IAAIC,EAAiBJ,EAErB,KAAOI,IAAmBH,EAAYI,eAAe,CACjD,GACKC,KAAKC,MAAMH,EAAeS,YAAc,IAAMV,GAC9CG,KAAKG,KAAKL,EAAeS,WAAaT,EAAeU,aAClDV,EAAeW,aACfZ,EAEJ,OAAO,EAGX,IAAIC,EAAeC,cAGf,OAAO,EAFPD,EAAiBA,EAAeC,cAMxC,OAAO,EAxDDW,CAAoBhB,EAASC,EAAaE,OAGvCc,EAAelB,WCXZmB,EAAgBC,EAAeC,GAC3C,OACID,EAAQE,SAASD,OACdA,EAAKE,wBAAwBH,GAAWI,KAAKC,iCAI3CC,EAAqBP,WCNlBQ,EAAgBC,GAC5B,MAAI,iBAAkBA,EACVA,EAAcC,eAAe,GAGjCD,EAAcE,WAGbC,EAAqBJ,WCNlBK,EACZJ,EACAK,GAEA,YAFA,IAAAA,IAAAA,EATmB,cAWZ,kBAAmBL,GAAiC,OAAxBA,EAAMM,cACnCN,EAAMM,cAAcC,QAAQF,IACxBL,EAAMM,cAAcC,QAbX,cAcZP,EAAcE,OAAOM,cAAcC,YAAYH,cAAcC,QAAQ,YAGnEG,EAA0BN,WCZvBO,EAAkBtC,EAAkBuC,GAChD,IAAMC,EAAUC,QAAQC,UAAUF,QAElC,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AM,OAAAA,OAAA,IAAAD,EAAA,KAAAA,EAGtC,GAA2B,mBAAhBE,YACP,OAAO,IAAIA,YAAYR,EAAM,CAACG,QAAOA,EAAEE,WAAUA,EAAEE,OAAMA,IAG7D,IAAME,EAActD,EAAYuD,YAAY,eAI5C,OAFAD,EAAYE,gBAAgBX,EAAMG,EAASE,EAAYE,GAEhDE,4LCJwBzD,SAAC4D,EAAA5D,EAAA4D,aAAcC,EAAA7D,EAAA6D,SAC9C,OAAO1B,EAAsB0B,EAASC,eAChCD,EAASC,cAAcC,MAAMC,MACzBH,EAASC,cAAcG,gBAAkB,EACzCJ,EAASC,cAAcI,cAAgB,IAE7B,QAAdjB,EAAAW,WAAc,IAAAX,OAAA,EAAAA,EAAEkB,aAAc,qDCfXnG,GACzB,OAAOA,EAAK4E,WAAazE,KAAK2E,8GCFGsB,EAAeC,GAChD,YADiC,IAAAD,IAAAA,EAAA,QAAe,IAAAC,IAAAA,EAAA,GACzC,CACH/D,KAAM8D,EACN1D,MAAO0D,EACP3D,IAAK4D,EACL1D,OAAQ0D,EACRxD,MAAO,EACPE,OAAQ","sourcesContent":["/**\n * @deprecated: use {@link tuiCanScroll} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function canScroll(\n element: Element,\n rootElement: Element,\n vertical: boolean,\n scrollEnd: boolean,\n): boolean {\n return vertical\n ? canScrollVertical(element, rootElement, scrollEnd)\n : canScrollHorizontal(element, rootElement, scrollEnd);\n}\n\nexport const tuiCanScroll = canScroll;\n\nfunction canScrollVertical(\n element: Element,\n rootElement: Element,\n scrollEnd: boolean,\n): boolean {\n let currentElement = element;\n\n while (currentElement !== rootElement.parentElement) {\n if (\n (Math.floor(currentElement.scrollTop) > 0 && !scrollEnd) ||\n (Math.ceil(currentElement.scrollTop + currentElement.clientHeight) <\n currentElement.scrollHeight &&\n scrollEnd)\n ) {\n return true;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n } else {\n return false;\n }\n }\n\n return false;\n}\n\nfunction canScrollHorizontal(\n element: Element,\n rootElement: Element,\n scrollEnd: boolean,\n): boolean {\n let currentElement = element;\n\n while (currentElement !== rootElement.parentElement) {\n if (\n (Math.floor(currentElement.scrollLeft) > 0 && !scrollEnd) ||\n (Math.ceil(currentElement.scrollLeft + currentElement.clientWidth) <\n currentElement.scrollWidth &&\n scrollEnd)\n ) {\n return true;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n } else {\n return false;\n }\n }\n\n return false;\n}\n","/**\n * @deprecated: use {@link tuiContainsOrAfter} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function containsOrAfter(current: Node, node: Node): boolean {\n return (\n current.contains(node) ||\n !!(node.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_PRECEDING)\n );\n}\n\nexport const tuiContainsOrAfter = containsOrAfter;\n","/**\n * @deprecated: use {@link tuiGetActualTarget} instead\n * Gets actual target from open Shadow DOM if event happened within it\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getActualTarget(event: Event): Node {\n if (`composedPath` in event) {\n return (event as any).composedPath()[0];\n }\n\n return (event as any).target;\n}\n\nexport const tuiGetActualTarget = getActualTarget;\n","const DEFAULT_FORMAT = `text/plain`;\n\n/**\n * @deprecated: use {@link tuiGetClipboardDataText} instead\n * Gets text from data of clipboardEvent, it also works in IE and Edge browsers\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClipboardDataText(\n event: ClipboardEvent,\n format: string = DEFAULT_FORMAT,\n): string {\n return `clipboardData` in event && event.clipboardData !== null\n ? event.clipboardData.getData(format) ||\n event.clipboardData.getData(DEFAULT_FORMAT)\n : (event as any).target.ownerDocument.defaultView.clipboardData.getData(`text`);\n}\n\nexport const tuiGetClipboardDataText = getClipboardDataText;\n","/**\n * @deprecated only needed for IE, remove in 3.0\n * Gets the closest element by selector i.e. {@link Element.closest}\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClosestElement(element: Element, selector: string): Element | null {\n const closest = Element.prototype.closest;\n\n if (closest) {\n return closest.call(element, selector);\n }\n\n const matchesSelector =\n Element.prototype.matches || (Element.prototype as any).msMatchesSelector;\n\n do {\n if (matchesSelector.call(element, selector)) {\n return element;\n }\n\n element = element.parentElement as Element;\n } while (element !== null);\n\n return null;\n}\n","/**\n * @deprecated: use {@link tuiGetDocumentOrShadowRoot} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getDocumentOrShadowRoot(node: Node): DocumentOrShadowRoot {\n return `getRootNode` in node && node.isConnected\n ? (node.getRootNode() as Document)\n : (node.ownerDocument as DocumentOrShadowRoot);\n}\n\nexport const tuiGetDocumentOrShadowRoot = getDocumentOrShadowRoot;\n","import {clamp} from '@taiga-ui/cdk/utils/math';\nimport {isPresent} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {getDocumentOrShadowRoot} from './get-document-or-shadow-root';\n\n/**\n * @deprecated: use {@link tuiGetElementObscures} instead\n * Returns array of Elements covering edges of given element or null if at least one edge middle point is visible\n *\n * CAUTION: Empty array means element if offscreen i.e. covered by no elements, rather than not covered\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getElementObscurers(element: Element): readonly Element[] | null {\n const {ownerDocument} = element;\n\n if (!ownerDocument?.defaultView) {\n return null;\n }\n\n const {innerWidth, innerHeight} = ownerDocument.defaultView;\n const documentRef = getDocumentOrShadowRoot(element);\n const rect = element.getBoundingClientRect();\n const left = clamp(Math.round(rect.left) + 2, 0, innerWidth);\n const top = clamp(Math.round(rect.top) + 2, 0, innerHeight);\n const right = clamp(Math.round(rect.right) - 2, 0, innerWidth);\n const bottom = clamp(Math.round(rect.bottom) - 2, 0, innerHeight);\n const horizontalMiddle = clamp(Math.round(rect.left + rect.width / 2), 0, innerWidth);\n const verticalMiddle = clamp(Math.round(rect.top + rect.height / 2), 0, innerHeight);\n const elements = [\n documentRef.elementFromPoint(horizontalMiddle, top),\n documentRef.elementFromPoint(horizontalMiddle, bottom),\n documentRef.elementFromPoint(left, verticalMiddle),\n documentRef.elementFromPoint(right, verticalMiddle),\n ];\n const nonNull = elements.filter(isPresent);\n\n if (!nonNull.length) {\n return nonNull;\n }\n\n const filtered = nonNull.filter(el => !element.contains(el));\n\n return filtered.length === 4 ? filtered : null;\n}\n\nexport const tuiGetElementObscures = getElementObscurers;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiGetElementOffset} instead\n * Calculates offset for an element relative to it's parent several levels above\n *\n * @param host parent element\n * @param element\n * @return object with offsetTop and offsetLeft number properties\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getElementOffset(\n host: Element,\n element: HTMLElement,\n): {offsetTop: number; offsetLeft: number} {\n tuiAssert.assert(host.contains(element), `Host must contain element`);\n\n let {offsetTop, offsetLeft, offsetParent} = element;\n\n // TODO: iframe warning\n while (offsetParent && offsetParent instanceof HTMLElement && offsetParent !== host) {\n offsetTop += offsetParent.offsetTop;\n offsetLeft += offsetParent.offsetLeft;\n offsetParent = offsetParent.offsetParent;\n }\n\n return {offsetTop, offsetLeft};\n}\n\nexport const tuiGetElementOffset = getElementOffset;\n","/**\n * @deprecated: use {@link tuiGetScrollParent} instead\n * Finds the nearest parent with scroll in it\n *\n * @param element initial element\n * @param vertical flag for orientation of scroll\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getScrollParent(\n element: Element | null,\n vertical: boolean = true,\n): Element | null {\n if (element === null) {\n return null;\n }\n\n if (vertical && element.scrollHeight > element.clientHeight) {\n return element;\n }\n\n if (!vertical && element.scrollWidth > element.clientWidth) {\n return element;\n }\n\n return getScrollParent(element.parentElement, vertical);\n}\n\nexport const tuiGetScrollParent = getScrollParent;\n","export function tuiIsFormFieldElement(\n element: unknown | null,\n): element is HTMLInputElement | HTMLTextAreaElement {\n const textfield = element as Record<string, unknown> | null;\n\n return (\n !!textfield &&\n `value` in textfield &&\n `selectionStart` in textfield &&\n `selectionEnd` in textfield\n );\n}\n","/**\n * @deprecated: use {@link tuiIsCurrentTarget} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCurrentTarget({target, currentTarget}: Event): boolean {\n return target === currentTarget;\n}\n\nexport const tuiIsCurrentTarget = isCurrentTarget;\n","/**\n * @deprecated: use {@link tuiIsInsideIframe} instead\n * Checks if an app is running inside <iframe /> tag\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isInsideIframe(windowRef: Window): boolean {\n return windowRef.parent !== windowRef;\n}\n\nexport const tuiIsInsideIframe = isInsideIframe;\n","import {getClosestElement} from './get-closest-element';\n\n/**\n * @deprecated: use {@link tuiIsNodeIn} instead\n * Checks if node is inside a specific selector\n *\n * @param node\n * @param selector\n * @return true if node is inside a particular selector\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNodeIn(node: Node, selector: string): boolean {\n return node.nodeType === Node.TEXT_NODE\n ? !!node.parentElement && !!getClosestElement(node.parentElement, selector)\n : node.nodeType === Node.ELEMENT_NODE &&\n !!getClosestElement(node as Element, selector);\n}\n\nexport const tuiIsNodeIn = isNodeIn;\n","/** @deprecated only needed for IE, remove in 3.0 */\nexport function tuiCustomEvent<T = null>(\n name: string,\n {bubbles = false, cancelable = false, detail = null}: CustomEventInit<T | null> = {},\n documentRef: Document,\n): CustomEvent {\n if (typeof CustomEvent === `function`) {\n return new CustomEvent(name, {bubbles, cancelable, detail});\n }\n\n const customEvent = documentRef.createEvent(`CustomEvent`);\n\n customEvent.initCustomEvent(name, bubbles, cancelable, detail);\n\n return customEvent;\n}\n","import {tuiIsFormFieldElement} from './is-form-field';\n\n/**\n * @description:\n * cross browser way to get selected text\n *\n * History:\n * BUG - window.getSelection() fails when text selected in a form field\n * https://bugzilla.mozilla.org/show_bug.cgi?id=85686\n */\nexport function tuiGetSelectedText({getSelection, document}: Window): string | null {\n return tuiIsFormFieldElement(document.activeElement)\n ? document.activeElement.value.slice(\n document.activeElement.selectionStart || 0,\n document.activeElement.selectionEnd || 0,\n )\n : getSelection()?.toString() || null;\n}\n","// TODO: Refactor to use this check everywhere\nexport function tuiIsElement(node: Node): node is Element {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n","export function tuiPointToClientRect(x: number = 0, y: number = 0): ClientRect {\n return {\n left: x,\n right: x,\n top: y,\n bottom: y,\n width: 0,\n height: 0,\n };\n}\n"]}
@@ -12,7 +12,8 @@
12
12
  */
13
13
  // eslint-disable-next-line @typescript-eslint/naming-convention
14
14
  function getNativeFocused(documentRef) {
15
- if (!documentRef.activeElement || !documentRef.activeElement.shadowRoot) {
15
+ var _a;
16
+ if (!((_a = documentRef.activeElement) === null || _a === void 0 ? void 0 : _a.shadowRoot)) {
16
17
  return documentRef.activeElement;
17
18
  }
18
19
  var element = documentRef.activeElement.shadowRoot.activeElement;
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-utils-focus.umd.js","sources":["ng://@taiga-ui/cdk/utils/focus/get-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/set-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/blur-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-mouse-focusable.ts","ng://@taiga-ui/cdk/utils/focus/get-closest-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused-in.ts","ng://@taiga-ui/cdk/utils/focus/move-focus.ts","ng://@taiga-ui/cdk/utils/focus/set-native-mouse-focused.ts"],"sourcesContent":["/**\n * @deprecated: use {@link tuiGetNativeFocused} instead\n * Returns current active element, including shadow dom\n *\n * @return element or null\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getNativeFocused(documentRef: Document): Element | null {\n if (!documentRef.activeElement || !documentRef.activeElement.shadowRoot) {\n return documentRef.activeElement;\n }\n\n let element = documentRef.activeElement.shadowRoot.activeElement;\n\n while (element?.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n\nexport const tuiGetNativeFocused = getNativeFocused;\n","/**\n * @deprecated: use native element.focus()\n * TODO: remove in v3.0\n * Focuses or blurs and element\n *\n * @param element native element\n * @param focused boolean focused state\n * @param preventScroll optional flag to prevent native scroll to the element\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function setNativeFocused(\n element: HTMLOrSVGElement,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (focused) {\n element.focus({preventScroll});\n } else {\n element.blur();\n }\n}\n","import {getNativeFocused} from './get-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiBlurNativeFocused} instead\n * Finds and blurs current active element, including shadow DOM\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function blurNativeFocused(documentRef: Document): void {\n const activeElement = getNativeFocused(documentRef);\n\n // TODO: iframe warning\n if (activeElement instanceof HTMLElement) {\n setNativeFocused(activeElement, false);\n }\n}\n\nexport const tuiBlurNativeFocused = blurNativeFocused;\n","/**\n * @deprecated: use {@link tuiIsNativeKeyboardFocusable} instead\n * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to\n * only target natural focus order. Not checking the possibility of an element to\n * be focused, for example element can have display: none applied to it or any other\n * circumstances could prevent actual focus.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeKeyboardFocusable(element: Element): boolean {\n if (element.hasAttribute(`disabled`) || element.getAttribute(`tabIndex`) === `-1`) {\n return false;\n }\n\n // TODO: iframe warning\n if (\n (element instanceof HTMLElement && element.isContentEditable) ||\n element.getAttribute(`tabIndex`) === `0`\n ) {\n return true;\n }\n\n switch (element.tagName) {\n case `BUTTON`:\n case `SELECT`:\n case `TEXTAREA`:\n return true;\n case `VIDEO`:\n case `AUDIO`:\n return element.hasAttribute(`controls`);\n case `INPUT`:\n return element.getAttribute(`type`) !== `hidden`;\n case `A`:\n case `LINK`:\n return element.hasAttribute(`href`);\n default:\n return false;\n }\n}\n\nexport const tuiIsNativeKeyboardFocusable = isNativeKeyboardFocusable;\n","import {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\n/**\n * @deprecated: use {@link tuiIsNativeMouseFocusable} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute(`disabled`) &&\n (element.getAttribute(`tabIndex`) === `-1` || isNativeKeyboardFocusable(element))\n );\n}\n\nexport const tuiIsNativeMouseFocusable = isNativeMouseFocusable;\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\n\nimport {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\nimport {isNativeMouseFocusable} from './is-native-mouse-focusable';\n\n/**\n * @deprecated: use {@link tuiGetClosestFocusable} instead\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n *\n * @param initial current HTML element\n * @param prev should it look backwards instead (find item that will be focused with Shift + Tab)\n * @param root top Node limiting the search area\n * @param keyboard determine if only keyboard focus is of interest\n *\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClosestFocusable(\n initial: HTMLElement,\n prev: boolean = false,\n root: Node,\n keyboard: boolean = true,\n): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const check = keyboard ? isNativeKeyboardFocusable : isNativeMouseFocusable;\n\n // Deprecated but ony this overload works in IE\n // Filter must be a function in IE, other modern browsers are compliant to this format\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n false,\n );\n\n treeWalker.currentNode = initial;\n\n while (prev ? treeWalker.previousNode() : treeWalker.nextNode()) {\n // TODO: iframe warning\n if (treeWalker.currentNode instanceof HTMLElement) {\n initial = treeWalker.currentNode;\n }\n\n if (check(initial)) {\n return initial;\n }\n }\n\n return null;\n}\n\n/**\n * @deprecated: use {@link tuiGetClosestFocusable} instead\n */\nexport const getClosestKeyboardFocusable = getClosestFocusable;\n\nexport const tuiGetClosestFocusable = getClosestFocusable;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\n * @deprecated: use {@link tuiIsNativeFocused} instead\n * Checks if element is focused.\n *\n * Could return true even after blur since element remains focused if you switch away from a browser tab.\n *\n * @param node or null (as a common return value of DOM nodes walking)\n * @return true if focused\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeFocused(node: Node | null): boolean {\n return (\n !!node && !!node.ownerDocument && getNativeFocused(node.ownerDocument) === node\n );\n}\n\nexport const tuiIsNativeFocused = isNativeFocused;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\n * @deprecated: use {@link tuiIsNativeFocusedIn} instead\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeFocusedIn(node: Node): boolean {\n // !node.contains - check for IE11\n if (!node.ownerDocument || !node.contains) {\n return false;\n }\n\n const nativeFocused = getNativeFocused(node.ownerDocument);\n\n return nativeFocused !== null && node.contains(nativeFocused);\n}\n\nexport const tuiIsNativeFocusedIn = isNativeFocusedIn;\n","import {isNativeFocused} from './is-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiMoveFocus} instead\n * Utility method for moving focus in a list of elements\n *\n * @param currentIndex currently focused index\n * @param elements array of focusable elements\n * @param step a step to move focus by, typically -1 or 1\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function moveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n setNativeFocused(elements[currentIndex]);\n\n if (isNativeFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n\nexport const tuiMoveFocus = moveFocus;\n","import {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiSetNativeMouseFocused} instead\n * Focuses or blurs element with mouse action imitation (to spoof {@link TuiFocusVisibleService})\n *\n * @param element\n * @param focused desired focused state\n * @param preventScroll optionally prevent native browser scroll after focus\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function setNativeMouseFocused(\n element: HTMLOrSVGElement & Element,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (!element.ownerDocument) {\n return;\n }\n\n if (typeof Event === `function`) {\n element.dispatchEvent(new Event(`mousedown`, {bubbles: true, cancelable: true}));\n } else {\n const event = element.ownerDocument.createEvent(`Event`);\n\n event.initEvent(`mousedown`, true, true);\n element.dispatchEvent(event);\n }\n\n setNativeFocused(element, focused, preventScroll);\n}\n\nexport const tuiSetNativeMouseFocused = setNativeMouseFocused;\n"],"names":["svgNodeFilter"],"mappings":";;;;;;IAAA;;;;;;IAMA;aACgB,gBAAgB,CAAC,WAAqB;QAClD,IAAI,CAAC,WAAW,CAAC,aAAa,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,UAAU,EAAE;YACrE,OAAO,WAAW,CAAC,aAAa,CAAC;SACpC;QAED,IAAI,OAAO,GAAG,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;QAEjE,OAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,EAAE;YACxB,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;SAC9C;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;QAEY,mBAAmB,GAAG;;ICrBnC;;;;;;;;;IASA;aACgB,gBAAgB,CAC5B,OAAyB,EACzB,OAAuB,EACvB,aAA8B;QAD9B,wBAAA,EAAA,cAAuB;QACvB,8BAAA,EAAA,qBAA8B;QAE9B,IAAI,OAAO,EAAE;YACT,OAAO,CAAC,KAAK,CAAC,EAAC,aAAa,eAAA,EAAC,CAAC,CAAC;SAClC;aAAM;YACH,OAAO,CAAC,IAAI,EAAE,CAAC;SAClB;IACL;;ICjBA;;;;IAIA;aACgB,iBAAiB,CAAC,WAAqB;QACnD,IAAM,aAAa,G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js","sources":["ng://@taiga-ui/cdk/utils/focus/get-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/set-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/blur-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-mouse-focusable.ts","ng://@taiga-ui/cdk/utils/focus/get-closest-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused-in.ts","ng://@taiga-ui/cdk/utils/focus/move-focus.ts","ng://@taiga-ui/cdk/utils/focus/set-native-mouse-focused.ts"],"sourcesContent":["/**\n * @deprecated: use {@link tuiGetNativeFocused} instead\n * Returns current active element, including shadow dom\n *\n * @return element or null\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getNativeFocused(documentRef: Document): Element | null {\n if (!documentRef.activeElement?.shadowRoot) {\n return documentRef.activeElement;\n }\n\n let element = documentRef.activeElement.shadowRoot.activeElement;\n\n while (element?.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n\nexport const tuiGetNativeFocused = getNativeFocused;\n","/**\n * @deprecated: use native element.focus()\n * TODO: remove in v3.0\n * Focuses or blurs and element\n *\n * @param element native element\n * @param focused boolean focused state\n * @param preventScroll optional flag to prevent native scroll to the element\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function setNativeFocused(\n element: HTMLOrSVGElement,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (focused) {\n element.focus({preventScroll});\n } else {\n element.blur();\n }\n}\n","import {getNativeFocused} from './get-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiBlurNativeFocused} instead\n * Finds and blurs current active element, including shadow DOM\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function blurNativeFocused(documentRef: Document): void {\n const activeElement = getNativeFocused(documentRef);\n\n // TODO: iframe warning\n if (activeElement instanceof HTMLElement) {\n setNativeFocused(activeElement, false);\n }\n}\n\nexport const tuiBlurNativeFocused = blurNativeFocused;\n","/**\n * @deprecated: use {@link tuiIsNativeKeyboardFocusable} instead\n * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to\n * only target natural focus order. Not checking the possibility of an element to\n * be focused, for example element can have display: none applied to it or any other\n * circumstances could prevent actual focus.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeKeyboardFocusable(element: Element): boolean {\n if (element.hasAttribute(`disabled`) || element.getAttribute(`tabIndex`) === `-1`) {\n return false;\n }\n\n // TODO: iframe warning\n if (\n (element instanceof HTMLElement && element.isContentEditable) ||\n element.getAttribute(`tabIndex`) === `0`\n ) {\n return true;\n }\n\n switch (element.tagName) {\n case `BUTTON`:\n case `SELECT`:\n case `TEXTAREA`:\n return true;\n case `VIDEO`:\n case `AUDIO`:\n return element.hasAttribute(`controls`);\n case `INPUT`:\n return element.getAttribute(`type`) !== `hidden`;\n case `A`:\n case `LINK`:\n return element.hasAttribute(`href`);\n default:\n return false;\n }\n}\n\nexport const tuiIsNativeKeyboardFocusable = isNativeKeyboardFocusable;\n","import {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\n/**\n * @deprecated: use {@link tuiIsNativeMouseFocusable} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute(`disabled`) &&\n (element.getAttribute(`tabIndex`) === `-1` || isNativeKeyboardFocusable(element))\n );\n}\n\nexport const tuiIsNativeMouseFocusable = isNativeMouseFocusable;\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\n\nimport {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\nimport {isNativeMouseFocusable} from './is-native-mouse-focusable';\n\n/**\n * @deprecated: use {@link tuiGetClosestFocusable} instead\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n *\n * @param initial current HTML element\n * @param prev should it look backwards instead (find item that will be focused with Shift + Tab)\n * @param root top Node limiting the search area\n * @param keyboard determine if only keyboard focus is of interest\n *\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClosestFocusable(\n initial: HTMLElement,\n prev: boolean = false,\n root: Node,\n keyboard: boolean = true,\n): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const check = keyboard ? isNativeKeyboardFocusable : isNativeMouseFocusable;\n\n // Deprecated but ony this overload works in IE\n // Filter must be a function in IE, other modern browsers are compliant to this format\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n false,\n );\n\n treeWalker.currentNode = initial;\n\n while (prev ? treeWalker.previousNode() : treeWalker.nextNode()) {\n // TODO: iframe warning\n if (treeWalker.currentNode instanceof HTMLElement) {\n initial = treeWalker.currentNode;\n }\n\n if (check(initial)) {\n return initial;\n }\n }\n\n return null;\n}\n\n/**\n * @deprecated: use {@link tuiGetClosestFocusable} instead\n */\nexport const getClosestKeyboardFocusable = getClosestFocusable;\n\nexport const tuiGetClosestFocusable = getClosestFocusable;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\n * @deprecated: use {@link tuiIsNativeFocused} instead\n * Checks if element is focused.\n *\n * Could return true even after blur since element remains focused if you switch away from a browser tab.\n *\n * @param node or null (as a common return value of DOM nodes walking)\n * @return true if focused\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeFocused(node: Node | null): boolean {\n return (\n !!node && !!node.ownerDocument && getNativeFocused(node.ownerDocument) === node\n );\n}\n\nexport const tuiIsNativeFocused = isNativeFocused;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\n * @deprecated: use {@link tuiIsNativeFocusedIn} instead\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeFocusedIn(node: Node): boolean {\n // !node.contains - check for IE11\n if (!node.ownerDocument || !node.contains) {\n return false;\n }\n\n const nativeFocused = getNativeFocused(node.ownerDocument);\n\n return nativeFocused !== null && node.contains(nativeFocused);\n}\n\nexport const tuiIsNativeFocusedIn = isNativeFocusedIn;\n","import {isNativeFocused} from './is-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiMoveFocus} instead\n * Utility method for moving focus in a list of elements\n *\n * @param currentIndex currently focused index\n * @param elements array of focusable elements\n * @param step a step to move focus by, typically -1 or 1\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function moveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n setNativeFocused(elements[currentIndex]);\n\n if (isNativeFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n\nexport const tuiMoveFocus = moveFocus;\n","import {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiSetNativeMouseFocused} instead\n * Focuses or blurs element with mouse action imitation (to spoof {@link TuiFocusVisibleService})\n *\n * @param element\n * @param focused desired focused state\n * @param preventScroll optionally prevent native browser scroll after focus\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function setNativeMouseFocused(\n element: Element & HTMLOrSVGElement,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (!element.ownerDocument) {\n return;\n }\n\n if (typeof Event === `function`) {\n element.dispatchEvent(new Event(`mousedown`, {bubbles: true, cancelable: true}));\n } else {\n const event = element.ownerDocument.createEvent(`Event`);\n\n event.initEvent(`mousedown`, true, true);\n element.dispatchEvent(event);\n }\n\n setNativeFocused(element, focused, preventScroll);\n}\n\nexport const tuiSetNativeMouseFocused = setNativeMouseFocused;\n"],"names":["svgNodeFilter"],"mappings":";;;;;;IAAA;;;;;;IAMA;aACgB,gBAAgB,CAAC,WAAqB;;QAClD,IAAI,QAAC,WAAW,CAAC,aAAa,0CAAE,UAAU,CAAA,EAAE;YACxC,OA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AA8B;QAE9B,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YACxB,OAAO;SACV;QAED,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;YAC7B,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;SACpF;aAAM;YACH,IAAM,OAAK,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAEzD,OAAK,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YACzC,OAAO,CAAC,aAAa,CAAC,OAAK,CAAC,CAAC;SAChC;QAED,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;IACtD,CAAC;QAEY,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@taiga-ui/cdk/constants")):"function"==typeof define&&define.amd?define("@taiga-ui/cdk/utils/focus",["exports","@taiga-ui/cdk/constants"],t):t(((e=e||self)["taiga-ui"]=e["taiga-ui"]||{},e["taiga-ui"].cdk=e["taiga-ui"].cdk||{},e["taiga-ui"].cdk.utils=e["taiga-ui"].cdk.utils||{},e["taiga-ui"].cdk.utils.focus={}),e["taiga-ui"].cdk.constants)}(this,(function(e,t){"use strict";function i(e){if(!e.activeElement||!e.activeElement.shadowRoot)return e.activeElement;for(var t=e.activeElement.shadowRoot.activeElement;null==t?void 0:t.shadowRoot;)t=t.shadowRoot.activeElement;return t}var n=i;function o(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!1),t?e.focus({preventScroll:i}):e.blur()}function u(e){var t=i(e);t instanceof HTMLElement&&o(t,!1)}var a=u;function r(e){if(e.hasAttribute("disabled")||"-1"===e.getAttribute("tabIndex"))return!1;if(e instanceof HTMLElement&&e.isContentEditable||"0"===e.getAttribute("tabIndex"))return!0;switch(e.tagName){case"BUTTON":case"SELECT":case"TEXTAREA":return!0;case"VIDEO":case"AUDIO":return e.hasAttribute("controls");case"INPUT":return"hidden"!==e.getAttribute("type");case"A":case"LINK":return e.hasAttribute("href");default:return!1}}var s=r;function c(e){return!e.hasAttribute("disabled")&&("-1"===e.getAttribute("tabIndex")||r(e))}var d=c;function v(e,i,n,o){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!n.ownerDocument)return null;var u=o?r:c,a=n.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,t.svgNodeFilter,!1);for(a.currentNode=e;i?a.previousNode():a.nextNode();)if(a.currentNode instanceof HTMLElement&&(e=a.currentNode),u(e))return e;return null}var l=v,f=v;function b(e){return!!e&&!!e.ownerDocument&&i(e.ownerDocument)===e}var N=b;function E(e){if(!e.ownerDocument||!e.contains)return!1;var t=i(e.ownerDocument);return null!==t&&e.contains(t)}var m=E;function F(e,t,i){for(e+=i;e>=0&&e<t.length;){if(o(t[e]),b(t[e]))return;e+=i}}var g=F;function w(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),e.ownerDocument){if("function"==typeof Event)e.dispatchEvent(new Event("mousedown",{bubbles:!0,cancelable:!0}));else{var n=e.ownerDocument.createEvent("Event");n.initEvent("mousedown",!0,!0),e.dispatchEvent(n)}o(e,t,i)}}var h=w;e.blurNativeFocused=u,e.getClosestFocusable=v,e.getClosestKeyboardFocusable=l,e.getNativeFocused=i,e.isNativeFocused=b,e.isNativeFocusedIn=E,e.isNativeKeyboardFocusable=r,e.isNativeMouseFocusable=c,e.moveFocus=F,e.setNativeFocused=o,e.setNativeMouseFocused=w,e.tuiBlurNativeFocused=a,e.tuiGetClosestFocusable=f,e.tuiGetNativeFocused=n,e.tuiIsNativeFocused=N,e.tuiIsNativeFocusedIn=m,e.tuiIsNativeKeyboardFocusable=s,e.tuiIsNativeMouseFocusable=d,e.tuiMoveFocus=g,e.tuiSetNativeMouseFocused=h,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@taiga-ui/cdk/constants")):"function"==typeof define&&define.amd?define("@taiga-ui/cdk/utils/focus",["exports","@taiga-ui/cdk/constants"],t):t(((e=e||self)["taiga-ui"]=e["taiga-ui"]||{},e["taiga-ui"].cdk=e["taiga-ui"].cdk||{},e["taiga-ui"].cdk.utils=e["taiga-ui"].cdk.utils||{},e["taiga-ui"].cdk.utils.focus={}),e["taiga-ui"].cdk.constants)}(this,(function(e,t){"use strict";function i(e){var t;if(!(null===(t=e.activeElement)||void 0===t?void 0:t.shadowRoot))return e.activeElement;for(var i=e.activeElement.shadowRoot.activeElement;null==i?void 0:i.shadowRoot;)i=i.shadowRoot.activeElement;return i}var o=i;function n(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!1),t?e.focus({preventScroll:i}):e.blur()}function u(e){var t=i(e);t instanceof HTMLElement&&n(t,!1)}var a=u;function r(e){if(e.hasAttribute("disabled")||"-1"===e.getAttribute("tabIndex"))return!1;if(e instanceof HTMLElement&&e.isContentEditable||"0"===e.getAttribute("tabIndex"))return!0;switch(e.tagName){case"BUTTON":case"SELECT":case"TEXTAREA":return!0;case"VIDEO":case"AUDIO":return e.hasAttribute("controls");case"INPUT":return"hidden"!==e.getAttribute("type");case"A":case"LINK":return e.hasAttribute("href");default:return!1}}var s=r;function c(e){return!e.hasAttribute("disabled")&&("-1"===e.getAttribute("tabIndex")||r(e))}var d=c;function v(e,i,o,n){if(void 0===i&&(i=!1),void 0===n&&(n=!0),!o.ownerDocument)return null;var u=n?r:c,a=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,t.svgNodeFilter,!1);for(a.currentNode=e;i?a.previousNode():a.nextNode();)if(a.currentNode instanceof HTMLElement&&(e=a.currentNode),u(e))return e;return null}var l=v,f=v;function b(e){return!!e&&!!e.ownerDocument&&i(e.ownerDocument)===e}var N=b;function E(e){if(!e.ownerDocument||!e.contains)return!1;var t=i(e.ownerDocument);return null!==t&&e.contains(t)}var m=E;function F(e,t,i){for(e+=i;e>=0&&e<t.length;){if(n(t[e]),b(t[e]))return;e+=i}}var g=F;function w(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),e.ownerDocument){if("function"==typeof Event)e.dispatchEvent(new Event("mousedown",{bubbles:!0,cancelable:!0}));else{var o=e.ownerDocument.createEvent("Event");o.initEvent("mousedown",!0,!0),e.dispatchEvent(o)}n(e,t,i)}}var h=w;e.blurNativeFocused=u,e.getClosestFocusable=v,e.getClosestKeyboardFocusable=l,e.getNativeFocused=i,e.isNativeFocused=b,e.isNativeFocusedIn=E,e.isNativeKeyboardFocusable=r,e.isNativeMouseFocusable=c,e.moveFocus=F,e.setNativeFocused=n,e.setNativeMouseFocused=w,e.tuiBlurNativeFocused=a,e.tuiGetClosestFocusable=f,e.tuiGetNativeFocused=o,e.tuiIsNativeFocused=N,e.tuiIsNativeFocusedIn=m,e.tuiIsNativeKeyboardFocusable=s,e.tuiIsNativeMouseFocusable=d,e.tuiMoveFocus=g,e.tuiSetNativeMouseFocused=h,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=taiga-ui-cdk-utils-focus.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ng://@taiga-ui/cdk/utils/focus/get-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/set-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/blur-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-mouse-focusable.ts","ng://@taiga-ui/cdk/utils/focus/get-closest-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused-in.ts","ng://@taiga-ui/cdk/utils/focus/move-focus.ts","ng://@taiga-ui/cdk/utils/focus/set-native-mouse-focused.ts"],"names":["getNativeFocused","documentRef","activeElement","shadowRoot","element","tuiGetNativeFocused","setNativeFocused","focused","preventScroll","focus","blur","blurNativeFocused","HTMLElement","tuiBlurNativeFocused","isNativeKeyboardFocusable","hasAttribute","getAttribute","isContentEditable","tagName","tuiIsNativeKeyboardFocusable","isNativeMouseFocusable","tuiIsNativeMouseFocusable","getClosestFocusable","initial","prev","root","keyboard","ownerDocument","check","treeWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","svgNodeFilter","currentNode","previousNode","nextNode","getClosestKeyboardFocusable","tuiGetClosestFocusable","isNativeFocused","node","tuiIsNativeFocused","isNativeFocusedIn","contains","nativeFocused","tuiIsNativeFocusedIn","moveFocus","currentIndex","elements","step","length","tuiMoveFocus","setNativeMouseFocused","Event","dispatchEvent","bubbles","cancelable","event_1","createEvent","initEvent","tuiSetNativeMouseFocused"],"mappings":"udAOgBA,EAAiBC,GAC7B,IAAKA,EAAYC,gBAAkBD,EAAYC,cAAcC,WACzD,OAAOF,EAAYC,cAKvB,IAFA,IAAIE,EAAUH,EAAYC,cAAcC,WAAWD,cAE5CE,MAAAA,OAAO,EAAPA,EAASD,YACZC,EAAUA,EAAQD,WAAWD,cAGjC,OAAOE,MAGEC,EAAsBL,WCXnBM,EACZF,EACAG,EACAC,QADA,IAAAD,IAAAA,GAAA,QACA,IAAAC,IAAAA,GAAA,GAEID,EACAH,EAAQK,MAAM,CAACD,cAAaA,IAE5BJ,EAAQM,gBCVAC,EAAkBV,GAC9B,IAAMC,EAAgBF,EAAiBC,GAGnCC,aAAyBU,aACzBN,EAAiBJ,GAAe,OAI3BW,EAAuBF,WCTpBG,EAA0BV,GACtC,GAAIA,EAAQW,aAAa,aAAoD,OAArCX,EAAQY,aAAa,YACzD,OAAO,EAIX,GACKZ,aAAmBQ,aAAeR,EAAQa,mBACN,MAArCb,EAAQY,aAAa,YAErB,OAAO,EAGX,OAAQZ,EAAQc,SACZ,IAAK,SACL,IAAK,SACL,IAAK,WACD,O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,GAAA,GAEKJ,EAAQuB,cAAb,CAIA,GAAqB,mBAAV0B,MACPjD,EAAQkD,cAAc,IAAID,MAAM,YAAa,CAACE,SAAS,EAAMC,YAAY,SACtE,CACH,IAAMC,EAAQrD,EAAQuB,cAAc+B,YAAY,SAEhDD,EAAME,UAAU,aAAa,GAAM,GACnCvD,EAAQkD,cAAcG,GAG1BnD,EAAiBF,EAASG,EAASC,QAG1BoD,EAA2BR","sourcesContent":["/**\n * @deprecated: use {@link tuiGetNativeFocused} instead\n * Returns current active element, including shadow dom\n *\n * @return element or null\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getNativeFocused(documentRef: Document): Element | null {\n if (!documentRef.activeElement || !documentRef.activeElement.shadowRoot) {\n return documentRef.activeElement;\n }\n\n let element = documentRef.activeElement.shadowRoot.activeElement;\n\n while (element?.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n\nexport const tuiGetNativeFocused = getNativeFocused;\n","/**\n * @deprecated: use native element.focus()\n * TODO: remove in v3.0\n * Focuses or blurs and element\n *\n * @param element native element\n * @param focused boolean focused state\n * @param preventScroll optional flag to prevent native scroll to the element\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function setNativeFocused(\n element: HTMLOrSVGElement,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (focused) {\n element.focus({preventScroll});\n } else {\n element.blur();\n }\n}\n","import {getNativeFocused} from './get-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiBlurNativeFocused} instead\n * Finds and blurs current active element, including shadow DOM\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function blurNativeFocused(documentRef: Document): void {\n const activeElement = getNativeFocused(documentRef);\n\n // TODO: iframe warning\n if (activeElement instanceof HTMLElement) {\n setNativeFocused(activeElement, false);\n }\n}\n\nexport const tuiBlurNativeFocused = blurNativeFocused;\n","/**\n * @deprecated: use {@link tuiIsNativeKeyboardFocusable} instead\n * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to\n * only target natural focus order. Not checking the possibility of an element to\n * be focused, for example element can have display: none applied to it or any other\n * circumstances could prevent actual focus.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeKeyboardFocusable(element: Element): boolean {\n if (element.hasAttribute(`disabled`) || element.getAttribute(`tabIndex`) === `-1`) {\n return false;\n }\n\n // TODO: iframe warning\n if (\n (element instanceof HTMLElement && element.isContentEditable) ||\n element.getAttribute(`tabIndex`) === `0`\n ) {\n return true;\n }\n\n switch (element.tagName) {\n case `BUTTON`:\n case `SELECT`:\n case `TEXTAREA`:\n return true;\n case `VIDEO`:\n case `AUDIO`:\n return element.hasAttribute(`controls`);\n case `INPUT`:\n return element.getAttribute(`type`) !== `hidden`;\n case `A`:\n case `LINK`:\n return element.hasAttribute(`href`);\n default:\n return false;\n }\n}\n\nexport const tuiIsNativeKeyboardFocusable = isNativeKeyboardFocusable;\n","import {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\n/**\n * @deprecated: use {@link tuiIsNativeMouseFocusable} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute(`disabled`) &&\n (element.getAttribute(`tabIndex`) === `-1` || isNativeKeyboardFocusable(element))\n );\n}\n\nexport const tuiIsNativeMouseFocusable = isNativeMouseFocusable;\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\n\nimport {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\nimport {isNativeMouseFocusable} from './is-native-mouse-focusable';\n\n/**\n * @deprecated: use {@link tuiGetClosestFocusable} instead\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n *\n * @param initial current HTML element\n * @param prev should it look backwards instead (find item that will be focused with Shift + Tab)\n * @param root top Node limiting the search area\n * @param keyboard determine if only keyboard focus is of interest\n *\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClosestFocusable(\n initial: HTMLElement,\n prev: boolean = false,\n root: Node,\n keyboard: boolean = true,\n): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const check = keyboard ? isNativeKeyboardFocusable : isNativeMouseFocusable;\n\n // Deprecated but ony this overload works in IE\n // Filter must be a function in IE, other modern browsers are compliant to this format\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n false,\n );\n\n treeWalker.currentNode = initial;\n\n while (prev ? treeWalker.previousNode() : treeWalker.nextNode()) {\n // TODO: iframe warning\n if (treeWalker.currentNode instanceof HTMLElement) {\n initial = treeWalker.currentNode;\n }\n\n if (check(initial)) {\n return initial;\n }\n }\n\n return null;\n}\n\n/**\n * @deprecated: use {@link tuiGetClosestFocusable} instead\n */\nexport const getClosestKeyboardFocusable = getClosestFocusable;\n\nexport const tuiGetClosestFocusable = getClosestFocusable;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\n * @deprecated: use {@link tuiIsNativeFocused} instead\n * Checks if element is focused.\n *\n * Could return true even after blur since element remains focused if you switch away from a browser tab.\n *\n * @param node or null (as a common return value of DOM nodes walking)\n * @return true if focused\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeFocused(node: Node | null): boolean {\n return (\n !!node && !!node.ownerDocument && getNativeFocused(node.ownerDocument) === node\n );\n}\n\nexport const tuiIsNativeFocused = isNativeFocused;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\n * @deprecated: use {@link tuiIsNativeFocusedIn} instead\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeFocusedIn(node: Node): boolean {\n // !node.contains - check for IE11\n if (!node.ownerDocument || !node.contains) {\n return false;\n }\n\n const nativeFocused = getNativeFocused(node.ownerDocument);\n\n return nativeFocused !== null && node.contains(nativeFocused);\n}\n\nexport const tuiIsNativeFocusedIn = isNativeFocusedIn;\n","import {isNativeFocused} from './is-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiMoveFocus} instead\n * Utility method for moving focus in a list of elements\n *\n * @param currentIndex currently focused index\n * @param elements array of focusable elements\n * @param step a step to move focus by, typically -1 or 1\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function moveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n setNativeFocused(elements[currentIndex]);\n\n if (isNativeFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n\nexport const tuiMoveFocus = moveFocus;\n","import {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiSetNativeMouseFocused} instead\n * Focuses or blurs element with mouse action imitation (to spoof {@link TuiFocusVisibleService})\n *\n * @param element\n * @param focused desired focused state\n * @param preventScroll optionally prevent native browser scroll after focus\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function setNativeMouseFocused(\n element: HTMLOrSVGElement & Element,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (!element.ownerDocument) {\n return;\n }\n\n if (typeof Event === `function`) {\n element.dispatchEvent(new Event(`mousedown`, {bubbles: true, cancelable: true}));\n } else {\n const event = element.ownerDocument.createEvent(`Event`);\n\n event.initEvent(`mousedown`, true, true);\n element.dispatchEvent(event);\n }\n\n setNativeFocused(element, focused, preventScroll);\n}\n\nexport const tuiSetNativeMouseFocused = setNativeMouseFocused;\n"]}
1
+ {"version":3,"sources":["ng://@taiga-ui/cdk/utils/focus/get-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/set-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/blur-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-mouse-focusable.ts","ng://@taiga-ui/cdk/utils/focus/get-closest-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused-in.ts","ng://@taiga-ui/cdk/utils/focus/move-focus.ts","ng://@taiga-ui/cdk/utils/focus/set-native-mouse-focused.ts"],"names":["getNativeFocused","documentRef","_a","activeElement","shadowRoot","element","tuiGetNativeFocused","setNativeFocused","focused","preventScroll","focus","blur","blurNativeFocused","HTMLElement","tuiBlurNativeFocused","isNativeKeyboardFocusable","hasAttribute","getAttribute","isContentEditable","tagName","tuiIsNativeKeyboardFocusable","isNativeMouseFocusable","tuiIsNativeMouseFocusable","getClosestFocusable","initial","prev","root","keyboard","ownerDocument","check","treeWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","svgNodeFilter","currentNode","previousNode","nextNode","getClosestKeyboardFocusable","tuiGetClosestFocusable","isNativeFocused","node","tuiIsNativeFocused","isNativeFocusedIn","contains","nativeFocused","tuiIsNativeFocusedIn","moveFocus","currentIndex","elements","step","length","tuiMoveFocus","setNativeMouseFocused","Event","dispatchEvent","bubbles","cancelable","event_1","createEvent","initEvent","tuiSetNativeMouseFocused"],"mappings":"udAOgBA,EAAiBC,SAC7B,KAA8B,QAA1BC,EAACD,EAAYE,qBAAa,IAAAD,OAAA,EAAAA,EAAEE,YAC5B,OAAOH,EAAYE,cAKvB,IAFA,IAAIE,EAAUJ,EAAYE,cAAcC,WAAWD,cAE5CE,MAAAA,OAAO,EAAPA,EAASD,YACZC,EAAUA,EAAQD,WAAWD,cAGjC,OAAOE,MAGEC,EAAsBN,WCXnBO,EACZF,EACAG,EACAC,QADA,IAAAD,IAAAA,GAAA,QACA,IAAAC,IAAAA,GAAA,GAEID,EACAH,EAAQK,MAAM,CAACD,cAAaA,IAE5BJ,EAAQM,gBCVAC,EAAkBX,GAC9B,IAAME,EAAgBH,EAAiBC,GAGnCE,aAAyBU,aACzBN,EAAiBJ,GAAe,OAI3BW,EAAuBF,WCTpBG,EAA0BV,GACtC,GAAIA,EAAQW,aAAa,aAAoD,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AGxD,GAFA5C,EAAiB0C,EAASD,IAEtBR,EAAgBS,EAASD,IACzB,OAGJA,GAAgBE,OAIXE,EAAeL,WCnBZM,EACZhD,EACAG,EACAC,GAEA,QAHA,IAAAD,IAAAA,GAAA,QACA,IAAAC,IAAAA,GAAA,GAEKJ,EAAQuB,cAAb,CAIA,GAAqB,mBAAV0B,MACPjD,EAAQkD,cAAc,IAAID,MAAM,YAAa,CAACE,SAAS,EAAMC,YAAY,SACtE,CACH,IAAMC,EAAQrD,EAAQuB,cAAc+B,YAAY,SAEhDD,EAAME,UAAU,aAAa,GAAM,GACnCvD,EAAQkD,cAAcG,GAG1BnD,EAAiBF,EAASG,EAASC,QAG1BoD,EAA2BR","sourcesContent":["/**\n * @deprecated: use {@link tuiGetNativeFocused} instead\n * Returns current active element, including shadow dom\n *\n * @return element or null\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getNativeFocused(documentRef: Document): Element | null {\n if (!documentRef.activeElement?.shadowRoot) {\n return documentRef.activeElement;\n }\n\n let element = documentRef.activeElement.shadowRoot.activeElement;\n\n while (element?.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n\nexport const tuiGetNativeFocused = getNativeFocused;\n","/**\n * @deprecated: use native element.focus()\n * TODO: remove in v3.0\n * Focuses or blurs and element\n *\n * @param element native element\n * @param focused boolean focused state\n * @param preventScroll optional flag to prevent native scroll to the element\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function setNativeFocused(\n element: HTMLOrSVGElement,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (focused) {\n element.focus({preventScroll});\n } else {\n element.blur();\n }\n}\n","import {getNativeFocused} from './get-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiBlurNativeFocused} instead\n * Finds and blurs current active element, including shadow DOM\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function blurNativeFocused(documentRef: Document): void {\n const activeElement = getNativeFocused(documentRef);\n\n // TODO: iframe warning\n if (activeElement instanceof HTMLElement) {\n setNativeFocused(activeElement, false);\n }\n}\n\nexport const tuiBlurNativeFocused = blurNativeFocused;\n","/**\n * @deprecated: use {@link tuiIsNativeKeyboardFocusable} instead\n * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to\n * only target natural focus order. Not checking the possibility of an element to\n * be focused, for example element can have display: none applied to it or any other\n * circumstances could prevent actual focus.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeKeyboardFocusable(element: Element): boolean {\n if (element.hasAttribute(`disabled`) || element.getAttribute(`tabIndex`) === `-1`) {\n return false;\n }\n\n // TODO: iframe warning\n if (\n (element instanceof HTMLElement && element.isContentEditable) ||\n element.getAttribute(`tabIndex`) === `0`\n ) {\n return true;\n }\n\n switch (element.tagName) {\n case `BUTTON`:\n case `SELECT`:\n case `TEXTAREA`:\n return true;\n case `VIDEO`:\n case `AUDIO`:\n return element.hasAttribute(`controls`);\n case `INPUT`:\n return element.getAttribute(`type`) !== `hidden`;\n case `A`:\n case `LINK`:\n return element.hasAttribute(`href`);\n default:\n return false;\n }\n}\n\nexport const tuiIsNativeKeyboardFocusable = isNativeKeyboardFocusable;\n","import {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\n/**\n * @deprecated: use {@link tuiIsNativeMouseFocusable} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute(`disabled`) &&\n (element.getAttribute(`tabIndex`) === `-1` || isNativeKeyboardFocusable(element))\n );\n}\n\nexport const tuiIsNativeMouseFocusable = isNativeMouseFocusable;\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\n\nimport {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\nimport {isNativeMouseFocusable} from './is-native-mouse-focusable';\n\n/**\n * @deprecated: use {@link tuiGetClosestFocusable} instead\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n *\n * @param initial current HTML element\n * @param prev should it look backwards instead (find item that will be focused with Shift + Tab)\n * @param root top Node limiting the search area\n * @param keyboard determine if only keyboard focus is of interest\n *\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getClosestFocusable(\n initial: HTMLElement,\n prev: boolean = false,\n root: Node,\n keyboard: boolean = true,\n): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const check = keyboard ? isNativeKeyboardFocusable : isNativeMouseFocusable;\n\n // Deprecated but ony this overload works in IE\n // Filter must be a function in IE, other modern browsers are compliant to this format\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n false,\n );\n\n treeWalker.currentNode = initial;\n\n while (prev ? treeWalker.previousNode() : treeWalker.nextNode()) {\n // TODO: iframe warning\n if (treeWalker.currentNode instanceof HTMLElement) {\n initial = treeWalker.currentNode;\n }\n\n if (check(initial)) {\n return initial;\n }\n }\n\n return null;\n}\n\n/**\n * @deprecated: use {@link tuiGetClosestFocusable} instead\n */\nexport const getClosestKeyboardFocusable = getClosestFocusable;\n\nexport const tuiGetClosestFocusable = getClosestFocusable;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\n * @deprecated: use {@link tuiIsNativeFocused} instead\n * Checks if element is focused.\n *\n * Could return true even after blur since element remains focused if you switch away from a browser tab.\n *\n * @param node or null (as a common return value of DOM nodes walking)\n * @return true if focused\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeFocused(node: Node | null): boolean {\n return (\n !!node && !!node.ownerDocument && getNativeFocused(node.ownerDocument) === node\n );\n}\n\nexport const tuiIsNativeFocused = isNativeFocused;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\n * @deprecated: use {@link tuiIsNativeFocusedIn} instead\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isNativeFocusedIn(node: Node): boolean {\n // !node.contains - check for IE11\n if (!node.ownerDocument || !node.contains) {\n return false;\n }\n\n const nativeFocused = getNativeFocused(node.ownerDocument);\n\n return nativeFocused !== null && node.contains(nativeFocused);\n}\n\nexport const tuiIsNativeFocusedIn = isNativeFocusedIn;\n","import {isNativeFocused} from './is-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiMoveFocus} instead\n * Utility method for moving focus in a list of elements\n *\n * @param currentIndex currently focused index\n * @param elements array of focusable elements\n * @param step a step to move focus by, typically -1 or 1\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function moveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n setNativeFocused(elements[currentIndex]);\n\n if (isNativeFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n\nexport const tuiMoveFocus = moveFocus;\n","import {setNativeFocused} from './set-native-focused';\n\n/**\n * @deprecated: use {@link tuiSetNativeMouseFocused} instead\n * Focuses or blurs element with mouse action imitation (to spoof {@link TuiFocusVisibleService})\n *\n * @param element\n * @param focused desired focused state\n * @param preventScroll optionally prevent native browser scroll after focus\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function setNativeMouseFocused(\n element: Element & HTMLOrSVGElement,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (!element.ownerDocument) {\n return;\n }\n\n if (typeof Event === `function`) {\n element.dispatchEvent(new Event(`mousedown`, {bubbles: true, cancelable: true}));\n } else {\n const event = element.ownerDocument.createEvent(`Event`);\n\n event.initEvent(`mousedown`, true, true);\n element.dispatchEvent(event);\n }\n\n setNativeFocused(element, focused, preventScroll);\n}\n\nexport const tuiSetNativeMouseFocused = setNativeMouseFocused;\n"]}
@@ -14,9 +14,9 @@
14
14
  */
15
15
  // eslint-disable-next-line @typescript-eslint/naming-convention
16
16
  function clamp(value, min, max) {
17
- classes.tuiAssert.assert(!isNaN(value));
18
- classes.tuiAssert.assert(!isNaN(min));
19
- classes.tuiAssert.assert(!isNaN(max));
17
+ classes.tuiAssert.assert(!Number.isNaN(value));
18
+ classes.tuiAssert.assert(!Number.isNaN(min));
19
+ classes.tuiAssert.assert(!Number.isNaN(max));
20
20
  classes.tuiAssert.assert(max >= min);
21
21
  return Math.min(max, Math.max(min, value));
22
22
  }
@@ -32,9 +32,9 @@
32
32
  */
33
33
  // eslint-disable-next-line @typescript-eslint/naming-convention
34
34
  function inRange(value, fromInclude, toExclude) {
35
- classes.tuiAssert.assert(!isNaN(value));
36
- classes.tuiAssert.assert(!isNaN(fromInclude));
37
- classes.tuiAssert.assert(!isNaN(toExclude));
35
+ classes.tuiAssert.assert(!Number.isNaN(value));
36
+ classes.tuiAssert.assert(!Number.isNaN(fromInclude));
37
+ classes.tuiAssert.assert(!Number.isNaN(toExclude));
38
38
  classes.tuiAssert.assert(fromInclude < toExclude);
39
39
  return value >= fromInclude && value < toExclude;
40
40
  }
@@ -54,7 +54,7 @@
54
54
  classes.tuiAssert.assert(Number.isInteger(min));
55
55
  classes.tuiAssert.assert(Number.isInteger(max));
56
56
  classes.tuiAssert.assert(min <= max);
57
- if (isNaN(value) || value <= min) {
57
+ if (Number.isNaN(value) || value <= min) {
58
58
  return min;
59
59
  }
60
60
  if (value >= max) {
@@ -120,7 +120,7 @@
120
120
  if (value === Infinity) {
121
121
  return value;
122
122
  }
123
- classes.tuiAssert.assert(!isNaN(value), "Value must be number");
123
+ classes.tuiAssert.assert(!Number.isNaN(value), "Value must be number");
124
124
  classes.tuiAssert.assert(Number.isInteger(precision), "Precision must be integer");
125
125
  precision = Math.min(precision, MAX_PRECISION);
126
126
  var pair = (value + "e").split("e");
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-utils-math.umd.js","sources":["ng://@taiga-ui/cdk/utils/math/clamp.ts","ng://@taiga-ui/cdk/utils/math/in-range.ts","ng://@taiga-ui/cdk/utils/math/normalize-to-int-number.ts","ng://@taiga-ui/cdk/utils/math/quantize.ts","ng://@taiga-ui/cdk/utils/math/round.ts","ng://@taiga-ui/cdk/utils/math/sum.ts","ng://@taiga-ui/cdk/utils/math/to-int.ts","ng://@taiga-ui/cdk/utils/math/to-radians.ts"],"sourcesContent":["import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiClamp} instead\n * Clamps a value between two inclusive limits\n *\n * @param value\n * @param min lower limit\n * @param max upper limit\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function clamp(value: number, min: number, max: number): number {\n tuiAssert.assert(!isNaN(value));\n tuiAssert.assert(!isNaN(min));\n tuiAssert.assert(!isNaN(max));\n tuiAssert.assert(max >= min);\n\n return Math.min(max, Math.max(min, value));\n}\n\nexport const tuiClamp = clamp;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiInRange} instead\n * Checks if the value is in range\n *\n * @param value\n * @param fromInclude lower inclusive limit\n * @param toExclude upper exclusive limit\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function inRange(value: number, fromInclude: number, toExclude: number): boolean {\n tuiAssert.assert(!isNaN(value));\n tuiAssert.assert(!isNaN(fromInclude));\n tuiAssert.assert(!isNaN(toExclude));\n tuiAssert.assert(fromInclude < toExclude);\n\n return value >= fromInclude && value < toExclude;\n}\n\nexport const tuiInRange = inRange;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiNormalizeToIntNumber} instead\n * Normalizes any number to an integer within inclusive range\n *\n * @param value\n * @param min lower inclusive integer\n * @param max upper inclusive integer\n * @return an integer between min and max inclusive\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function normalizeToIntNumber(value: number, min: number, max: number): number {\n tuiAssert.assert(Number.isInteger(min));\n tuiAssert.assert(Number.isInteger(max));\n tuiAssert.assert(min <= max);\n\n if (isNaN(value) || value <= min) {\n return min;\n }\n\n if (value >= max) {\n return max;\n }\n\n return Math.round(value);\n}\n\nexport const tuiNormalizeToIntNumber = normalizeToIntNumber;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiQuantize} instead\n * Rounds a number to the closest value in a fixed discrete series\n *\n * @param value\n * @param quantum series step\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function quantize(value: number, quantum: number): number {\n tuiAssert.assert(Number.isFinite(value));\n tuiAssert.assert(Number.isFinite(quantum));\n tuiAssert.assert(quantum > 0);\n\n const remainder = value % quantum;\n\n return remainder < quantum / 2 ? value - remainder : value + quantum - remainder;\n}\n\nexport const tuiQuantize = quantize;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\nconst MAX_PRECISION = 292;\n\n/**\n * @deprecated: use {@link tuiRound} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function round(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.round);\n}\n\n/**\n * @deprecated: use {@link tuiCeil} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function ceil(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.ceil);\n}\n\n/**\n * @deprecated: use {@link tuiFloor} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function floor(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.floor);\n}\n\nexport const tuiRound = round;\nexport const tuiCeil = ceil;\nexport const tuiFloor = floor;\n\n/**\n * Rounding number to the set precision\n *\n * @param value\n * @param precision number of digits in a float part\n * @param func rounding function (round, floor, ceil)\n */\nfunction calculate(\n value: number,\n precision: number,\n func: (x: number) => number,\n): number {\n if (value === Infinity) {\n return value;\n }\n\n tuiAssert.assert(!isNaN(value), `Value must be number`);\n tuiAssert.assert(Number.isInteger(precision), `Precision must be integer`);\n\n precision = Math.min(precision, MAX_PRECISION);\n\n const pair = `${value}e`.split(`e`);\n const tempValue = func(Number(`${pair[0]}e${Number(pair[1]) + precision}`));\n const processedPair = `${tempValue}e`.split(`e`);\n\n return Number(`${processedPair[0]}e${Number(processedPair[1]) - precision}`);\n}\n","/**\n * @deprecated: use {@link tuiSum} instead\n * Calculates sum of any number of passed arguments\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function sum(...args: number[]): number {\n return args.reduce((a, b) => a + b, 0);\n}\n\nexport const tuiSum = sum;\n","/**\n * @deprecated: use {@link tuiToInt} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function toInt(bool: boolean): 1 | 0 {\n return bool ? 1 : 0;\n}\n\nexport const tuiToInt = toInt;\n","/**\n * @deprecated: use {@link tuiToRadians} instead\n * Converts angle in degrees to radians\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function toRadians(deg: number): number {\n return (deg * Math.PI) / 180;\n}\n\nexport const tuiToRadians = toRadians;\n"],"names":["tuiAssert"],"mappings":";;;;;;IAEA;;;;;;;;IAQA;aACgB,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;QACzDA,iBAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAChCA,iBAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9BA,iBAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9BA,iBAAS,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QAE7B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;QAEY,QAAQ,GAAG;;IClBxB;;;;;;;;IAQA;aACgB,OAAO,CAAC,KAAa,EAAE,WAAmB,EAAE,SAAiB;QACzEA,iBAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAChCA,iBAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAA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C,CAAC,CAAC,CAAC,GAAG,SAAS,CAAE,CAAC,CAAC,CAAC;QAC5E,IAAM,aAAa,GAAG,CAAG,SAAS,MAAG,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjD,OAAO,MAAM,CAAI,aAAa,CAAC,CAAC,CAAC,UAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAE,CAAC,CAAC;IACjF;;IC1DA;;;;IAIA;aACgB,GAAG;QAAC,cAAiB;aAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;YAAjB,yBAAiB;;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,GAAG,CAAC,GAAA,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;QAEY,MAAM,GAAG;;ICTtB;;;IAGA;aACgB,KAAK,CAAC,IAAa;QAC/B,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;QAEY,QAAQ,GAAG;;ICRxB;;;;IAIA;aACgB,SAAS,CAAC,GAAW;QACjC,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC;IACjC,CAAC;QAEY,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-utils-math.umd.js","sources":["ng://@taiga-ui/cdk/utils/math/clamp.ts","ng://@taiga-ui/cdk/utils/math/in-range.ts","ng://@taiga-ui/cdk/utils/math/normalize-to-int-number.ts","ng://@taiga-ui/cdk/utils/math/quantize.ts","ng://@taiga-ui/cdk/utils/math/round.ts","ng://@taiga-ui/cdk/utils/math/sum.ts","ng://@taiga-ui/cdk/utils/math/to-int.ts","ng://@taiga-ui/cdk/utils/math/to-radians.ts"],"sourcesContent":["import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiClamp} instead\n * Clamps a value between two inclusive limits\n *\n * @param value\n * @param min lower limit\n * @param max upper limit\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function clamp(value: number, min: number, max: number): number {\n tuiAssert.assert(!Number.isNaN(value));\n tuiAssert.assert(!Number.isNaN(min));\n tuiAssert.assert(!Number.isNaN(max));\n tuiAssert.assert(max >= min);\n\n return Math.min(max, Math.max(min, value));\n}\n\nexport const tuiClamp = clamp;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiInRange} instead\n * Checks if the value is in range\n *\n * @param value\n * @param fromInclude lower inclusive limit\n * @param toExclude upper exclusive limit\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function inRange(value: number, fromInclude: number, toExclude: number): boolean {\n tuiAssert.assert(!Number.isNaN(value));\n tuiAssert.assert(!Number.isNaN(fromInclude));\n tuiAssert.assert(!Number.isNaN(toExclude));\n tuiAssert.assert(fromInclude < toExclude);\n\n return value >= fromInclude && value < toExclude;\n}\n\nexport const tuiInRange = inRange;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiNormalizeToIntNumber} instead\n * Normalizes any number to an integer within inclusive range\n *\n * @param value\n * @param min lower inclusive integer\n * @param max upper inclusive integer\n * @return an integer between min and max inclusive\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function normalizeToIntNumber(value: number, min: number, max: number): number {\n tuiAssert.assert(Number.isInteger(min));\n tuiAssert.assert(Number.isInteger(max));\n tuiAssert.assert(min <= max);\n\n if (Number.isNaN(value) || value <= min) {\n return min;\n }\n\n if (value >= max) {\n return max;\n }\n\n return Math.round(value);\n}\n\nexport const tuiNormalizeToIntNumber = normalizeToIntNumber;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiQuantize} instead\n * Rounds a number to the closest value in a fixed discrete series\n *\n * @param value\n * @param quantum series step\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function quantize(value: number, quantum: number): number {\n tuiAssert.assert(Number.isFinite(value));\n tuiAssert.assert(Number.isFinite(quantum));\n tuiAssert.assert(quantum > 0);\n\n const remainder = value % quantum;\n\n return remainder < quantum / 2 ? value - remainder : value + quantum - remainder;\n}\n\nexport const tuiQuantize = quantize;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\nconst MAX_PRECISION = 292;\n\n/**\n * @deprecated: use {@link tuiRound} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function round(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.round);\n}\n\n/**\n * @deprecated: use {@link tuiCeil} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function ceil(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.ceil);\n}\n\n/**\n * @deprecated: use {@link tuiFloor} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function floor(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.floor);\n}\n\nexport const tuiRound = round;\nexport const tuiCeil = ceil;\nexport const tuiFloor = floor;\n\n/**\n * Rounding number to the set precision\n *\n * @param value\n * @param precision number of digits in a float part\n * @param func rounding function (round, floor, ceil)\n */\nfunction calculate(\n value: number,\n precision: number,\n func: (x: number) => number,\n): number {\n if (value === Infinity) {\n return value;\n }\n\n tuiAssert.assert(!Number.isNaN(value), `Value must be number`);\n tuiAssert.assert(Number.isInteger(precision), `Precision must be integer`);\n\n precision = Math.min(precision, MAX_PRECISION);\n\n const pair = `${value}e`.split(`e`);\n const tempValue = func(Number(`${pair[0]}e${Number(pair[1]) + precision}`));\n const processedPair = `${tempValue}e`.split(`e`);\n\n return Number(`${processedPair[0]}e${Number(processedPair[1]) - precision}`);\n}\n","/**\n * @deprecated: use {@link tuiSum} instead\n * Calculates sum of any number of passed arguments\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function sum(...args: number[]): number {\n return args.reduce((a, b) => a + b, 0);\n}\n\nexport const tuiSum = sum;\n","/**\n * @deprecated: use {@link tuiToInt} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function toInt(bool: boolean): 0 | 1 {\n return bool ? 1 : 0;\n}\n\nexport const tuiToInt = toInt;\n","/**\n * @deprecated: use {@link tuiToRadians} instead\n * Converts angle in degrees to radians\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function toRadians(deg: number): number {\n return (deg * Math.PI) / 180;\n}\n\nexport const tuiToRadians = toRadians;\n"],"names":["tuiAssert"],"mappings":";;;;;;IAEA;;;;;;;;IAQA;aACgB,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;QACzDA,iBAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACvCA,iBAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACrCA,iBAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACrCA,iBAAS,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QAE7B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;QAEY,QAAQ,GAAG;;IClBxB;;;;;;;;IAQA;aACgB,OAAO,CAAC,KAAa,EAAE,WAAmB,EAAE,SAAiB;QACzEA,iBAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACvCA,iBAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;QAC7CA,iBAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAC3CA,iBAAS,CAAC,MAAM,CAAC,WAAW,GAAG,S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,CAAC,CAAC;QAEjD,OAAO,MAAM,CAAI,aAAa,CAAC,CAAC,CAAC,UAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAE,CAAC,CAAC;IACjF;;IC1DA;;;;IAIA;aACgB,GAAG;QAAC,cAAiB;aAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;YAAjB,yBAAiB;;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,GAAG,CAAC,GAAA,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;QAEY,MAAM,GAAG;;ICTtB;;;IAGA;aACgB,KAAK,CAAC,IAAa;QAC/B,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;QAEY,QAAQ,GAAG;;ICRxB;;;;IAIA;aACgB,SAAS,CAAC,GAAW;QACjC,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC;IACjC,CAAC;QAEY,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@taiga-ui/cdk/classes")):"function"==typeof define&&define.amd?define("@taiga-ui/cdk/utils/math",["exports","@taiga-ui/cdk/classes"],e):e(((t=t||self)["taiga-ui"]=t["taiga-ui"]||{},t["taiga-ui"].cdk=t["taiga-ui"].cdk||{},t["taiga-ui"].cdk.utils=t["taiga-ui"].cdk.utils||{},t["taiga-ui"].cdk.utils.math={}),t["taiga-ui"].cdk.classes)}(this,(function(t,e){"use strict";function i(t,i,s){return e.tuiAssert.assert(!isNaN(t)),e.tuiAssert.assert(!isNaN(i)),e.tuiAssert.assert(!isNaN(s)),e.tuiAssert.assert(s>=i),Math.min(s,Math.max(i,t))}var s=i;function r(t,i,s){return e.tuiAssert.assert(!isNaN(t)),e.tuiAssert.assert(!isNaN(i)),e.tuiAssert.assert(!isNaN(s)),e.tuiAssert.assert(i<s),t>=i&&t<s}var u=r;function a(t,i,s){return e.tuiAssert.assert(Number.isInteger(i)),e.tuiAssert.assert(Number.isInteger(s)),e.tuiAssert.assert(i<=s),isNaN(t)||t<=i?i:t>=s?s:Math.round(t)}var n=a;function o(t,i){e.tuiAssert.assert(Number.isFinite(t)),e.tuiAssert.assert(Number.isFinite(i)),e.tuiAssert.assert(i>0);var s=t%i;return s<i/2?t-s:t+i-s}var c=o;function d(t,e){return void 0===e&&(e=0),b(t,e,Math.round)}function f(t,e){return void 0===e&&(e=0),b(t,e,Math.ceil)}function N(t,e){return void 0===e&&(e=0),b(t,e,Math.floor)}var m=d,l=f,g=N;function b(t,i,s){if(t===1/0)return t;e.tuiAssert.assert(!isNaN(t),"Value must be number"),e.tuiAssert.assert(Number.isInteger(i),"Precision must be integer"),i=Math.min(i,292);var r=(t+"e").split("e"),u=(s(Number(r[0]+"e"+(Number(r[1])+i)))+"e").split("e");return Number(u[0]+"e"+(Number(u[1])-i))}function A(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t+e}),0)}var v=A;function h(t){return t?1:0}var p=h;function k(t){return t*Math.PI/180}var I=k;t.ceil=f,t.clamp=i,t.floor=N,t.inRange=r,t.normalizeToIntNumber=a,t.quantize=o,t.round=d,t.sum=A,t.toInt=h,t.toRadians=k,t.tuiCeil=l,t.tuiClamp=s,t.tuiFloor=g,t.tuiInRange=u,t.tuiNormalizeToIntNumber=n,t.tuiQuantize=c,t.tuiRound=m,t.tuiSum=v,t.tuiToInt=p,t.tuiToRadians=I,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@taiga-ui/cdk/classes")):"function"==typeof define&&define.amd?define("@taiga-ui/cdk/utils/math",["exports","@taiga-ui/cdk/classes"],e):e(((t=t||self)["taiga-ui"]=t["taiga-ui"]||{},t["taiga-ui"].cdk=t["taiga-ui"].cdk||{},t["taiga-ui"].cdk.utils=t["taiga-ui"].cdk.utils||{},t["taiga-ui"].cdk.utils.math={}),t["taiga-ui"].cdk.classes)}(this,(function(t,e){"use strict";function i(t,i,r){return e.tuiAssert.assert(!Number.isNaN(t)),e.tuiAssert.assert(!Number.isNaN(i)),e.tuiAssert.assert(!Number.isNaN(r)),e.tuiAssert.assert(r>=i),Math.min(r,Math.max(i,t))}var r=i;function u(t,i,r){return e.tuiAssert.assert(!Number.isNaN(t)),e.tuiAssert.assert(!Number.isNaN(i)),e.tuiAssert.assert(!Number.isNaN(r)),e.tuiAssert.assert(i<r),t>=i&&t<r}var s=u;function a(t,i,r){return e.tuiAssert.assert(Number.isInteger(i)),e.tuiAssert.assert(Number.isInteger(r)),e.tuiAssert.assert(i<=r),Number.isNaN(t)||t<=i?i:t>=r?r:Math.round(t)}var n=a;function o(t,i){e.tuiAssert.assert(Number.isFinite(t)),e.tuiAssert.assert(Number.isFinite(i)),e.tuiAssert.assert(i>0);var r=t%i;return r<i/2?t-r:t+i-r}var N=o;function c(t,e){return void 0===e&&(e=0),g(t,e,Math.round)}function m(t,e){return void 0===e&&(e=0),g(t,e,Math.ceil)}function d(t,e){return void 0===e&&(e=0),g(t,e,Math.floor)}var f=c,l=m,b=d;function g(t,i,r){if(t===1/0)return t;e.tuiAssert.assert(!Number.isNaN(t),"Value must be number"),e.tuiAssert.assert(Number.isInteger(i),"Precision must be integer"),i=Math.min(i,292);var u=(t+"e").split("e"),s=(r(Number(u[0]+"e"+(Number(u[1])+i)))+"e").split("e");return Number(s[0]+"e"+(Number(s[1])-i))}function A(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t+e}),0)}var v=A;function h(t){return t?1:0}var p=h;function k(t){return t*Math.PI/180}var I=k;t.ceil=m,t.clamp=i,t.floor=d,t.inRange=u,t.normalizeToIntNumber=a,t.quantize=o,t.round=c,t.sum=A,t.toInt=h,t.toRadians=k,t.tuiCeil=l,t.tuiClamp=r,t.tuiFloor=b,t.tuiInRange=s,t.tuiNormalizeToIntNumber=n,t.tuiQuantize=N,t.tuiRound=f,t.tuiSum=v,t.tuiToInt=p,t.tuiToRadians=I,Object.defineProperty(t,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=taiga-ui-cdk-utils-math.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ng://@taiga-ui/cdk/utils/math/clamp.ts","ng://@taiga-ui/cdk/utils/math/in-range.ts","ng://@taiga-ui/cdk/utils/math/normalize-to-int-number.ts","ng://@taiga-ui/cdk/utils/math/quantize.ts","ng://@taiga-ui/cdk/utils/math/round.ts","ng://@taiga-ui/cdk/utils/math/sum.ts","ng://@taiga-ui/cdk/utils/math/to-int.ts","ng://@taiga-ui/cdk/utils/math/to-radians.ts"],"names":["clamp","value","min","max","tuiAssert","assert","isNaN","Math","tuiClamp","inRange","fromInclude","toExclude","tuiInRange","normalizeToIntNumber","Number","isInteger","round","tuiNormalizeToIntNumber","quantize","quantum","isFinite","remainder","tuiQuantize","precision","calculate","ceil","floor","tuiRound","tuiCeil","tuiFloor","func","Infinity","pair","split","processedPair","sum","args","_i","arguments","length","reduce","a","b","tuiSum","toInt","bool","tuiToInt","toRadians","deg","PI","tuiToRadians"],"mappings":"+cAWgBA,EAAMC,EAAeC,EAAaC,GAM9C,OALAC,EAAAA,UAAUC,QAAQC,MAAML,IACxBG,EAAAA,UAAUC,QAAQC,MAAMJ,IACxBE,EAAAA,UAAUC,QAAQC,MAAMH,IACxBC,EAAAA,UAAUC,OAAOF,GAAOD,GAEjBK,KAAKL,IAAIC,EAAKI,KAAKJ,IAAID,EAAKD,QAG1BO,EAAWR,WCTRS,EAAQR,EAAeS,EAAqBC,GAMxD,OALAP,EAAAA,UAAUC,QAAQC,MAAML,IACxBG,EAAAA,UAAUC,QAAQC,MAAMI,IACxBN,EAAAA,UAAUC,QAAQC,MAAMK,IACxBP,EAAAA,UAAUC,OAAOK,EA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B,KAAIU,MAAM,KAE5C,OAAOnB,OAAUoB,EAAc,GAAE,KAAIpB,OAAOoB,EAAc,IAAMX,aCpDpDY,QAAI,IAAAC,EAAA,GAAAC,EAAA,EAAAA,EAAAC,UAAAC,OAAAF,IAAAD,EAAAC,GAAAC,UAAAD,GAChB,OAAOD,EAAKI,QAAO,SAACC,EAAGC,GAAM,OAAAD,EAAIC,IAAG,OAG3BC,EAASR,WCLNS,EAAMC,GAClB,OAAOA,EAAO,EAAI,MAGTC,EAAWF,WCHRG,EAAUC,GACtB,OAAQA,EAAMzC,KAAK0C,GAAM,QAGhBC,EAAeH","sourcesContent":["import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiClamp} instead\n * Clamps a value between two inclusive limits\n *\n * @param value\n * @param min lower limit\n * @param max upper limit\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function clamp(value: number, min: number, max: number): number {\n tuiAssert.assert(!isNaN(value));\n tuiAssert.assert(!isNaN(min));\n tuiAssert.assert(!isNaN(max));\n tuiAssert.assert(max >= min);\n\n return Math.min(max, Math.max(min, value));\n}\n\nexport const tuiClamp = clamp;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiInRange} instead\n * Checks if the value is in range\n *\n * @param value\n * @param fromInclude lower inclusive limit\n * @param toExclude upper exclusive limit\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function inRange(value: number, fromInclude: number, toExclude: number): boolean {\n tuiAssert.assert(!isNaN(value));\n tuiAssert.assert(!isNaN(fromInclude));\n tuiAssert.assert(!isNaN(toExclude));\n tuiAssert.assert(fromInclude < toExclude);\n\n return value >= fromInclude && value < toExclude;\n}\n\nexport const tuiInRange = inRange;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiNormalizeToIntNumber} instead\n * Normalizes any number to an integer within inclusive range\n *\n * @param value\n * @param min lower inclusive integer\n * @param max upper inclusive integer\n * @return an integer between min and max inclusive\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function normalizeToIntNumber(value: number, min: number, max: number): number {\n tuiAssert.assert(Number.isInteger(min));\n tuiAssert.assert(Number.isInteger(max));\n tuiAssert.assert(min <= max);\n\n if (isNaN(value) || value <= min) {\n return min;\n }\n\n if (value >= max) {\n return max;\n }\n\n return Math.round(value);\n}\n\nexport const tuiNormalizeToIntNumber = normalizeToIntNumber;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiQuantize} instead\n * Rounds a number to the closest value in a fixed discrete series\n *\n * @param value\n * @param quantum series step\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function quantize(value: number, quantum: number): number {\n tuiAssert.assert(Number.isFinite(value));\n tuiAssert.assert(Number.isFinite(quantum));\n tuiAssert.assert(quantum > 0);\n\n const remainder = value % quantum;\n\n return remainder < quantum / 2 ? value - remainder : value + quantum - remainder;\n}\n\nexport const tuiQuantize = quantize;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\nconst MAX_PRECISION = 292;\n\n/**\n * @deprecated: use {@link tuiRound} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function round(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.round);\n}\n\n/**\n * @deprecated: use {@link tuiCeil} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function ceil(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.ceil);\n}\n\n/**\n * @deprecated: use {@link tuiFloor} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function floor(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.floor);\n}\n\nexport const tuiRound = round;\nexport const tuiCeil = ceil;\nexport const tuiFloor = floor;\n\n/**\n * Rounding number to the set precision\n *\n * @param value\n * @param precision number of digits in a float part\n * @param func rounding function (round, floor, ceil)\n */\nfunction calculate(\n value: number,\n precision: number,\n func: (x: number) => number,\n): number {\n if (value === Infinity) {\n return value;\n }\n\n tuiAssert.assert(!isNaN(value), `Value must be number`);\n tuiAssert.assert(Number.isInteger(precision), `Precision must be integer`);\n\n precision = Math.min(precision, MAX_PRECISION);\n\n const pair = `${value}e`.split(`e`);\n const tempValue = func(Number(`${pair[0]}e${Number(pair[1]) + precision}`));\n const processedPair = `${tempValue}e`.split(`e`);\n\n return Number(`${processedPair[0]}e${Number(processedPair[1]) - precision}`);\n}\n","/**\n * @deprecated: use {@link tuiSum} instead\n * Calculates sum of any number of passed arguments\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function sum(...args: number[]): number {\n return args.reduce((a, b) => a + b, 0);\n}\n\nexport const tuiSum = sum;\n","/**\n * @deprecated: use {@link tuiToInt} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function toInt(bool: boolean): 1 | 0 {\n return bool ? 1 : 0;\n}\n\nexport const tuiToInt = toInt;\n","/**\n * @deprecated: use {@link tuiToRadians} instead\n * Converts angle in degrees to radians\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function toRadians(deg: number): number {\n return (deg * Math.PI) / 180;\n}\n\nexport const tuiToRadians = toRadians;\n"]}
1
+ {"version":3,"sources":["ng://@taiga-ui/cdk/utils/math/clamp.ts","ng://@taiga-ui/cdk/utils/math/in-range.ts","ng://@taiga-ui/cdk/utils/math/normalize-to-int-number.ts","ng://@taiga-ui/cdk/utils/math/quantize.ts","ng://@taiga-ui/cdk/utils/math/round.ts","ng://@taiga-ui/cdk/utils/math/sum.ts","ng://@taiga-ui/cdk/utils/math/to-int.ts","ng://@taiga-ui/cdk/utils/math/to-radians.ts"],"names":["clamp","value","min","max","tuiAssert","assert","Number","isNaN","Math","tuiClamp","inRange","fromInclude","toExclude","tuiInRange","normalizeToIntNumber","isInteger","round","tuiNormalizeToIntNumber","quantize","quantum","isFinite","remainder","tuiQuantize","precision","calculate","ceil","floor","tuiRound","tuiCeil","tuiFloor","func","Infinity","pair","split","processedPair","s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AAKxB,EAAesB,GAChC,YADgC,IAAAA,IAAAA,EAAA,GACzBC,EAAUvB,EAAOsB,EAAWf,KAAKiB,eAO5BC,EAAMzB,EAAesB,GACjC,YADiC,IAAAA,IAAAA,EAAA,GAC1BC,EAAUvB,EAAOsB,EAAWf,KAAKkB,WAG/BC,EAAWX,EACXY,EAAUH,EACVI,EAAWH,EASxB,SAASF,EACLvB,EACAsB,EACAO,GAEA,GAAI7B,IAAU8B,EAAAA,EACV,OAAO9B,EAGXG,EAAAA,UAAUC,QAAQC,OAAOC,MAAMN,GAAQ,wBACvCG,EAAAA,UAAUC,OAAOC,OAAOS,UAAUQ,GAAY,6BAE9CA,EAAYf,KAAKN,IAAIqB,EAjDH,KAmDlB,IAAMS,GAAU/B,EAAK,KAAIgC,MAAM,KAEzBC,GADYJ,EAAKxB,OAAU0B,EAAK,GAAE,KAAI1B,OAAO0B,EAAK,IAAMT,KAC5B,KAAIU,MAAM,KAE5C,OAAO3B,OAAU4B,EAAc,GAAE,KAAI5B,OAAO4B,EAAc,IAAMX,aCpDpDY,QAAI,IAAAC,EAAA,GAAAC,EAAA,EAAAA,EAAAC,UAAAC,OAAAF,IAAAD,EAAAC,GAAAC,UAAAD,GAChB,OAAOD,EAAKI,QAAO,SAACC,EAAGC,GAAM,OAAAD,EAAIC,IAAG,OAG3BC,EAASR,WCLNS,EAAMC,GAClB,OAAOA,EAAO,EAAI,MAGTC,EAAWF,WCHRG,EAAUC,GACtB,OAAQA,EAAMxC,KAAKyC,GAAM,QAGhBC,EAAeH","sourcesContent":["import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiClamp} instead\n * Clamps a value between two inclusive limits\n *\n * @param value\n * @param min lower limit\n * @param max upper limit\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function clamp(value: number, min: number, max: number): number {\n tuiAssert.assert(!Number.isNaN(value));\n tuiAssert.assert(!Number.isNaN(min));\n tuiAssert.assert(!Number.isNaN(max));\n tuiAssert.assert(max >= min);\n\n return Math.min(max, Math.max(min, value));\n}\n\nexport const tuiClamp = clamp;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiInRange} instead\n * Checks if the value is in range\n *\n * @param value\n * @param fromInclude lower inclusive limit\n * @param toExclude upper exclusive limit\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function inRange(value: number, fromInclude: number, toExclude: number): boolean {\n tuiAssert.assert(!Number.isNaN(value));\n tuiAssert.assert(!Number.isNaN(fromInclude));\n tuiAssert.assert(!Number.isNaN(toExclude));\n tuiAssert.assert(fromInclude < toExclude);\n\n return value >= fromInclude && value < toExclude;\n}\n\nexport const tuiInRange = inRange;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiNormalizeToIntNumber} instead\n * Normalizes any number to an integer within inclusive range\n *\n * @param value\n * @param min lower inclusive integer\n * @param max upper inclusive integer\n * @return an integer between min and max inclusive\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function normalizeToIntNumber(value: number, min: number, max: number): number {\n tuiAssert.assert(Number.isInteger(min));\n tuiAssert.assert(Number.isInteger(max));\n tuiAssert.assert(min <= max);\n\n if (Number.isNaN(value) || value <= min) {\n return min;\n }\n\n if (value >= max) {\n return max;\n }\n\n return Math.round(value);\n}\n\nexport const tuiNormalizeToIntNumber = normalizeToIntNumber;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiQuantize} instead\n * Rounds a number to the closest value in a fixed discrete series\n *\n * @param value\n * @param quantum series step\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function quantize(value: number, quantum: number): number {\n tuiAssert.assert(Number.isFinite(value));\n tuiAssert.assert(Number.isFinite(quantum));\n tuiAssert.assert(quantum > 0);\n\n const remainder = value % quantum;\n\n return remainder < quantum / 2 ? value - remainder : value + quantum - remainder;\n}\n\nexport const tuiQuantize = quantize;\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\nconst MAX_PRECISION = 292;\n\n/**\n * @deprecated: use {@link tuiRound} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function round(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.round);\n}\n\n/**\n * @deprecated: use {@link tuiCeil} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function ceil(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.ceil);\n}\n\n/**\n * @deprecated: use {@link tuiFloor} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function floor(value: number, precision: number = 0): number {\n return calculate(value, precision, Math.floor);\n}\n\nexport const tuiRound = round;\nexport const tuiCeil = ceil;\nexport const tuiFloor = floor;\n\n/**\n * Rounding number to the set precision\n *\n * @param value\n * @param precision number of digits in a float part\n * @param func rounding function (round, floor, ceil)\n */\nfunction calculate(\n value: number,\n precision: number,\n func: (x: number) => number,\n): number {\n if (value === Infinity) {\n return value;\n }\n\n tuiAssert.assert(!Number.isNaN(value), `Value must be number`);\n tuiAssert.assert(Number.isInteger(precision), `Precision must be integer`);\n\n precision = Math.min(precision, MAX_PRECISION);\n\n const pair = `${value}e`.split(`e`);\n const tempValue = func(Number(`${pair[0]}e${Number(pair[1]) + precision}`));\n const processedPair = `${tempValue}e`.split(`e`);\n\n return Number(`${processedPair[0]}e${Number(processedPair[1]) - precision}`);\n}\n","/**\n * @deprecated: use {@link tuiSum} instead\n * Calculates sum of any number of passed arguments\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function sum(...args: number[]): number {\n return args.reduce((a, b) => a + b, 0);\n}\n\nexport const tuiSum = sum;\n","/**\n * @deprecated: use {@link tuiToInt} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function toInt(bool: boolean): 0 | 1 {\n return bool ? 1 : 0;\n}\n\nexport const tuiToInt = toInt;\n","/**\n * @deprecated: use {@link tuiToRadians} instead\n * Converts angle in degrees to radians\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function toRadians(deg: number): number {\n return (deg * Math.PI) / 180;\n}\n\nexport const tuiToRadians = toRadians;\n"]}
@@ -19,7 +19,7 @@
19
19
  */
20
20
  // eslint-disable-next-line @typescript-eslint/naming-convention
21
21
  function easeInOutQuad(t) {
22
- classes.tuiAssert.assert(0 <= t && t <= 1, "Input must be between 0 and 1 inclusive but received ", t);
22
+ classes.tuiAssert.assert(t >= 0 && t <= 1, "Input must be between 0 and 1 inclusive but received ", t);
23
23
  return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
24
24
  }
25
25
  var tuiEaseInOutQuad = easeInOutQuad;
@@ -82,9 +82,7 @@
82
82
  if (Math.abs(deltaY) > Math.abs(deltaX)) {
83
83
  return deltaY > 0 ? "top" : "bottom";
84
84
  }
85
- else {
86
- return deltaX > 0 ? "left" : "right";
87
- }
85
+ return deltaX > 0 ? "left" : "right";
88
86
  }
89
87
  var tuiGetSwipeDirection = getSwipeDirection;
90
88