@taiga-ui/cdk 2.52.0 → 2.53.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 (364) hide show
  1. package/bundles/taiga-ui-cdk-components-alert-host.umd.js +1 -1
  2. package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js +1 -1
  4. package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +5 -13
  6. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js +1 -1
  8. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-constants.umd.js +9 -0
  10. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  11. package/bundles/taiga-ui-cdk-constants.umd.min.js +1 -1
  12. package/bundles/taiga-ui-cdk-constants.umd.min.js.map +1 -1
  13. package/bundles/taiga-ui-cdk-directives-hovered.umd.js +29 -14
  14. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  15. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js +1 -1
  16. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js.map +1 -1
  17. package/bundles/taiga-ui-cdk-directives-media.umd.js +2 -0
  18. package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
  19. package/bundles/taiga-ui-cdk-directives-media.umd.min.js.map +1 -1
  20. package/bundles/taiga-ui-cdk-observables.umd.js +56 -0
  21. package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
  22. package/bundles/taiga-ui-cdk-observables.umd.min.js +1 -1
  23. package/bundles/taiga-ui-cdk-observables.umd.min.js.map +1 -1
  24. package/bundles/taiga-ui-cdk-services.umd.js +1 -0
  25. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  26. package/bundles/taiga-ui-cdk-services.umd.min.js.map +1 -1
  27. package/bundles/taiga-ui-cdk-tokens.umd.js +1 -1
  28. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  29. package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -1
  30. package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
  31. package/bundles/taiga-ui-cdk-utils-browser.umd.js +30 -0
  32. package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
  33. package/bundles/taiga-ui-cdk-utils-browser.umd.min.js +1 -1
  34. package/bundles/taiga-ui-cdk-utils-browser.umd.min.js.map +1 -1
  35. package/bundles/taiga-ui-cdk-utils-dom.umd.js +69 -2
  36. package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
  37. package/bundles/taiga-ui-cdk-utils-dom.umd.min.js +1 -1
  38. package/bundles/taiga-ui-cdk-utils-dom.umd.min.js.map +1 -1
  39. package/bundles/taiga-ui-cdk-utils-focus.umd.js +42 -1
  40. package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
  41. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js +1 -1
  42. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js.map +1 -1
  43. package/bundles/taiga-ui-cdk-utils-format.umd.js +6 -2
  44. package/bundles/taiga-ui-cdk-utils-format.umd.js.map +1 -1
  45. package/bundles/taiga-ui-cdk-utils-format.umd.min.js +1 -1
  46. package/bundles/taiga-ui-cdk-utils-format.umd.min.js.map +1 -1
  47. package/bundles/taiga-ui-cdk-utils-math.umd.js +48 -0
  48. package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
  49. package/bundles/taiga-ui-cdk-utils-math.umd.min.js +1 -1
  50. package/bundles/taiga-ui-cdk-utils-math.umd.min.js.map +1 -1
  51. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +64 -2
  52. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  53. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.min.js +1 -1
  54. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.min.js.map +1 -1
  55. package/bundles/taiga-ui-cdk-utils-os.umd.js +17 -1
  56. package/bundles/taiga-ui-cdk-utils-os.umd.js.map +1 -1
  57. package/bundles/taiga-ui-cdk-utils-os.umd.min.js +1 -1
  58. package/bundles/taiga-ui-cdk-utils-os.umd.min.js.map +1 -1
  59. package/bundles/taiga-ui-cdk-utils-svg.umd.js +5 -1
  60. package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
  61. package/bundles/taiga-ui-cdk-utils-svg.umd.min.js +1 -1
  62. package/bundles/taiga-ui-cdk-utils-svg.umd.min.js.map +1 -1
  63. package/components/alert-host/taiga-ui-cdk-components-alert-host.metadata.json +1 -1
  64. package/components/dropdown-host/taiga-ui-cdk-components-dropdown-host.metadata.json +1 -1
  65. package/constants/empty.d.ts +1 -0
  66. package/constants/taiga-ui-cdk-constants.metadata.json +1 -1
  67. package/directives/hovered/hovered.directive.d.ts +5 -5
  68. package/directives/hovered/taiga-ui-cdk-directives-hovered.metadata.json +1 -1
  69. package/directives/media/taiga-ui-cdk-directives-media.metadata.json +1 -1
  70. package/esm2015/components/alert-host/alert-host.component.js +2 -2
  71. package/esm2015/components/dropdown-host/dropdown-host.component.js +3 -10
  72. package/esm2015/constants/empty.js +9 -1
  73. package/esm2015/directives/hovered/hovered.directive.js +28 -13
  74. package/esm2015/directives/media/media.directive.js +3 -1
  75. package/esm2015/observables/drag-and-drop-from.js +6 -1
  76. package/esm2015/observables/focus-visible-observable.js +6 -1
  77. package/esm2015/observables/items-query-list-observable.js +4 -1
  78. package/esm2015/observables/mouse-drag-finish-from.js +4 -1
  79. package/esm2015/observables/must-be-present.js +6 -1
  80. package/esm2015/observables/pressed-observable.js +6 -1
  81. package/esm2015/observables/prevent-default.js +6 -1
  82. package/esm2015/observables/stop-propagation.js +6 -1
  83. package/esm2015/observables/typed-from-event.js +6 -1
  84. package/esm2015/observables/watch.js +6 -1
  85. package/esm2015/services/hovered.service.js +2 -1
  86. package/esm2015/tokens/is-firefox.js +2 -2
  87. package/esm2015/utils/browser/is-edge-older-than.js +6 -1
  88. package/esm2015/utils/browser/is-edge.js +6 -1
  89. package/esm2015/utils/browser/is-firefox.js +6 -1
  90. package/esm2015/utils/browser/is-ie.js +6 -1
  91. package/esm2015/utils/browser/is-safari.js +6 -1
  92. package/esm2015/utils/dom/can-scroll.js +6 -1
  93. package/esm2015/utils/dom/contains-or-after.js +6 -1
  94. package/esm2015/utils/dom/get-actual-target.js +4 -1
  95. package/esm2015/utils/dom/get-clipboard-data-text.js +4 -1
  96. package/esm2015/utils/dom/get-closest-element.js +3 -2
  97. package/esm2015/utils/dom/get-document-or-shadow-root.js +6 -1
  98. package/esm2015/utils/dom/get-element-obscurers.js +4 -1
  99. package/esm2015/utils/dom/get-element-offset.js +4 -1
  100. package/esm2015/utils/dom/get-scroll-parent.js +5 -2
  101. package/esm2015/utils/dom/index.js +2 -1
  102. package/esm2015/utils/dom/is-current-target.js +6 -1
  103. package/esm2015/utils/dom/is-inside-iframe.js +4 -1
  104. package/esm2015/utils/dom/is-node-in.js +4 -1
  105. package/esm2015/utils/dom/point-to-client-rect.js +11 -0
  106. package/esm2015/utils/focus/blur-native-focused.js +4 -1
  107. package/esm2015/utils/focus/get-closest-keyboard-focusable.js +7 -2
  108. package/esm2015/utils/focus/get-native-focused.js +4 -1
  109. package/esm2015/utils/focus/is-native-focused-in.js +4 -1
  110. package/esm2015/utils/focus/is-native-focused.js +4 -1
  111. package/esm2015/utils/focus/is-native-keyboard-focusable.js +4 -1
  112. package/esm2015/utils/focus/is-native-mouse-focusable.js +6 -1
  113. package/esm2015/utils/focus/move-focus.js +4 -1
  114. package/esm2015/utils/focus/set-native-focused.js +2 -1
  115. package/esm2015/utils/focus/set-native-mouse-focused.js +4 -1
  116. package/esm2015/utils/format/pad-start.js +3 -3
  117. package/esm2015/utils/format/px.js +4 -1
  118. package/esm2015/utils/math/clamp.js +4 -1
  119. package/esm2015/utils/math/in-range.js +4 -1
  120. package/esm2015/utils/math/normalize-to-int-number.js +4 -1
  121. package/esm2015/utils/math/quantize.js +4 -1
  122. package/esm2015/utils/math/round.js +16 -1
  123. package/esm2015/utils/math/sum.js +4 -1
  124. package/esm2015/utils/math/to-int.js +6 -1
  125. package/esm2015/utils/math/to-radians.js +4 -1
  126. package/esm2015/utils/miscellaneous/distance-between-touches.js +6 -1
  127. package/esm2015/utils/miscellaneous/ease-in-out-quad.js +6 -1
  128. package/esm2015/utils/miscellaneous/fallback-value.js +3 -2
  129. package/esm2015/utils/miscellaneous/flat-length.js +5 -2
  130. package/esm2015/utils/miscellaneous/get-original-array-from-query-list.js +4 -1
  131. package/esm2015/utils/miscellaneous/get-swipe-direction.js +6 -1
  132. package/esm2015/utils/miscellaneous/identity.js +2 -1
  133. package/esm2015/utils/miscellaneous/is-element-editable.js +6 -1
  134. package/esm2015/utils/miscellaneous/is-number.js +6 -1
  135. package/esm2015/utils/miscellaneous/is-present.js +6 -1
  136. package/esm2015/utils/miscellaneous/mark-control-as-touched-and-validate.js +6 -1
  137. package/esm2015/utils/miscellaneous/nullable-same.js +4 -1
  138. package/esm2015/utils/miscellaneous/uniq-by.js +6 -1
  139. package/esm2015/utils/os/is-apple-platform.js +5 -2
  140. package/esm2015/utils/os/is-apple.js +6 -1
  141. package/esm2015/utils/os/is-ios.js +6 -1
  142. package/esm2015/utils/svg/svg-linear-gradient-processor.js +5 -2
  143. package/esm5/components/alert-host/alert-host.component.js +2 -2
  144. package/esm5/components/dropdown-host/dropdown-host.component.js +3 -10
  145. package/esm5/constants/empty.js +9 -1
  146. package/esm5/directives/hovered/hovered.directive.js +29 -14
  147. package/esm5/directives/media/media.directive.js +3 -1
  148. package/esm5/observables/drag-and-drop-from.js +6 -1
  149. package/esm5/observables/focus-visible-observable.js +6 -1
  150. package/esm5/observables/items-query-list-observable.js +4 -1
  151. package/esm5/observables/mouse-drag-finish-from.js +4 -1
  152. package/esm5/observables/must-be-present.js +6 -1
  153. package/esm5/observables/pressed-observable.js +6 -1
  154. package/esm5/observables/prevent-default.js +6 -1
  155. package/esm5/observables/stop-propagation.js +6 -1
  156. package/esm5/observables/typed-from-event.js +6 -1
  157. package/esm5/observables/watch.js +6 -1
  158. package/esm5/services/hovered.service.js +2 -1
  159. package/esm5/tokens/is-firefox.js +2 -2
  160. package/esm5/utils/browser/is-edge-older-than.js +6 -1
  161. package/esm5/utils/browser/is-edge.js +6 -1
  162. package/esm5/utils/browser/is-firefox.js +6 -1
  163. package/esm5/utils/browser/is-ie.js +6 -1
  164. package/esm5/utils/browser/is-safari.js +6 -1
  165. package/esm5/utils/dom/can-scroll.js +6 -1
  166. package/esm5/utils/dom/contains-or-after.js +6 -1
  167. package/esm5/utils/dom/get-actual-target.js +4 -1
  168. package/esm5/utils/dom/get-clipboard-data-text.js +4 -1
  169. package/esm5/utils/dom/get-closest-element.js +3 -2
  170. package/esm5/utils/dom/get-document-or-shadow-root.js +6 -1
  171. package/esm5/utils/dom/get-element-obscurers.js +4 -1
  172. package/esm5/utils/dom/get-element-offset.js +4 -1
  173. package/esm5/utils/dom/get-scroll-parent.js +5 -2
  174. package/esm5/utils/dom/index.js +2 -1
  175. package/esm5/utils/dom/is-current-target.js +6 -1
  176. package/esm5/utils/dom/is-inside-iframe.js +4 -1
  177. package/esm5/utils/dom/is-node-in.js +4 -1
  178. package/esm5/utils/dom/point-to-client-rect.js +13 -0
  179. package/esm5/utils/focus/blur-native-focused.js +4 -1
  180. package/esm5/utils/focus/get-closest-keyboard-focusable.js +7 -2
  181. package/esm5/utils/focus/get-native-focused.js +4 -1
  182. package/esm5/utils/focus/is-native-focused-in.js +4 -1
  183. package/esm5/utils/focus/is-native-focused.js +4 -1
  184. package/esm5/utils/focus/is-native-keyboard-focusable.js +4 -1
  185. package/esm5/utils/focus/is-native-mouse-focusable.js +6 -1
  186. package/esm5/utils/focus/move-focus.js +4 -1
  187. package/esm5/utils/focus/set-native-focused.js +2 -1
  188. package/esm5/utils/focus/set-native-mouse-focused.js +4 -1
  189. package/esm5/utils/format/pad-start.js +3 -3
  190. package/esm5/utils/format/px.js +4 -1
  191. package/esm5/utils/math/clamp.js +4 -1
  192. package/esm5/utils/math/in-range.js +4 -1
  193. package/esm5/utils/math/normalize-to-int-number.js +4 -1
  194. package/esm5/utils/math/quantize.js +4 -1
  195. package/esm5/utils/math/round.js +16 -1
  196. package/esm5/utils/math/sum.js +4 -1
  197. package/esm5/utils/math/to-int.js +6 -1
  198. package/esm5/utils/math/to-radians.js +4 -1
  199. package/esm5/utils/miscellaneous/distance-between-touches.js +6 -1
  200. package/esm5/utils/miscellaneous/ease-in-out-quad.js +6 -1
  201. package/esm5/utils/miscellaneous/fallback-value.js +3 -2
  202. package/esm5/utils/miscellaneous/flat-length.js +5 -2
  203. package/esm5/utils/miscellaneous/get-original-array-from-query-list.js +4 -1
  204. package/esm5/utils/miscellaneous/get-swipe-direction.js +6 -1
  205. package/esm5/utils/miscellaneous/identity.js +2 -1
  206. package/esm5/utils/miscellaneous/is-element-editable.js +6 -1
  207. package/esm5/utils/miscellaneous/is-number.js +6 -1
  208. package/esm5/utils/miscellaneous/is-present.js +6 -1
  209. package/esm5/utils/miscellaneous/mark-control-as-touched-and-validate.js +6 -1
  210. package/esm5/utils/miscellaneous/nullable-same.js +4 -1
  211. package/esm5/utils/miscellaneous/uniq-by.js +6 -1
  212. package/esm5/utils/os/is-apple-platform.js +5 -2
  213. package/esm5/utils/os/is-apple.js +6 -1
  214. package/esm5/utils/os/is-ios.js +6 -1
  215. package/esm5/utils/svg/svg-linear-gradient-processor.js +5 -2
  216. package/fesm2015/taiga-ui-cdk-components-alert-host.js +1 -1
  217. package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
  218. package/fesm2015/taiga-ui-cdk-components-dropdown-host.js +2 -9
  219. package/fesm2015/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
  220. package/fesm2015/taiga-ui-cdk-constants.js +9 -1
  221. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  222. package/fesm2015/taiga-ui-cdk-directives-hovered.js +28 -13
  223. package/fesm2015/taiga-ui-cdk-directives-hovered.js.map +1 -1
  224. package/fesm2015/taiga-ui-cdk-directives-media.js +2 -0
  225. package/fesm2015/taiga-ui-cdk-directives-media.js.map +1 -1
  226. package/fesm2015/taiga-ui-cdk-observables.js +47 -1
  227. package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
  228. package/fesm2015/taiga-ui-cdk-services.js +1 -0
  229. package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
  230. package/fesm2015/taiga-ui-cdk-tokens.js +1 -1
  231. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  232. package/fesm2015/taiga-ui-cdk-utils-browser.js +26 -1
  233. package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
  234. package/fesm2015/taiga-ui-cdk-utils-dom.js +56 -3
  235. package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
  236. package/fesm2015/taiga-ui-cdk-utils-focus.js +34 -2
  237. package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
  238. package/fesm2015/taiga-ui-cdk-utils-format.js +6 -3
  239. package/fesm2015/taiga-ui-cdk-utils-format.js.map +1 -1
  240. package/fesm2015/taiga-ui-cdk-utils-math.js +39 -1
  241. package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
  242. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +54 -3
  243. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  244. package/fesm2015/taiga-ui-cdk-utils-os.js +15 -2
  245. package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -1
  246. package/fesm2015/taiga-ui-cdk-utils-svg.js +5 -2
  247. package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
  248. package/fesm5/taiga-ui-cdk-components-alert-host.js +1 -1
  249. package/fesm5/taiga-ui-cdk-components-alert-host.js.map +1 -1
  250. package/fesm5/taiga-ui-cdk-components-dropdown-host.js +2 -9
  251. package/fesm5/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
  252. package/fesm5/taiga-ui-cdk-constants.js +9 -1
  253. package/fesm5/taiga-ui-cdk-constants.js.map +1 -1
  254. package/fesm5/taiga-ui-cdk-directives-hovered.js +29 -14
  255. package/fesm5/taiga-ui-cdk-directives-hovered.js.map +1 -1
  256. package/fesm5/taiga-ui-cdk-directives-media.js +2 -0
  257. package/fesm5/taiga-ui-cdk-directives-media.js.map +1 -1
  258. package/fesm5/taiga-ui-cdk-observables.js +47 -1
  259. package/fesm5/taiga-ui-cdk-observables.js.map +1 -1
  260. package/fesm5/taiga-ui-cdk-services.js +1 -0
  261. package/fesm5/taiga-ui-cdk-services.js.map +1 -1
  262. package/fesm5/taiga-ui-cdk-tokens.js +1 -1
  263. package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
  264. package/fesm5/taiga-ui-cdk-utils-browser.js +26 -1
  265. package/fesm5/taiga-ui-cdk-utils-browser.js.map +1 -1
  266. package/fesm5/taiga-ui-cdk-utils-dom.js +58 -3
  267. package/fesm5/taiga-ui-cdk-utils-dom.js.map +1 -1
  268. package/fesm5/taiga-ui-cdk-utils-focus.js +34 -2
  269. package/fesm5/taiga-ui-cdk-utils-focus.js.map +1 -1
  270. package/fesm5/taiga-ui-cdk-utils-format.js +6 -3
  271. package/fesm5/taiga-ui-cdk-utils-format.js.map +1 -1
  272. package/fesm5/taiga-ui-cdk-utils-math.js +39 -1
  273. package/fesm5/taiga-ui-cdk-utils-math.js.map +1 -1
  274. package/fesm5/taiga-ui-cdk-utils-miscellaneous.js +54 -3
  275. package/fesm5/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  276. package/fesm5/taiga-ui-cdk-utils-os.js +15 -2
  277. package/fesm5/taiga-ui-cdk-utils-os.js.map +1 -1
  278. package/fesm5/taiga-ui-cdk-utils-svg.js +5 -2
  279. package/fesm5/taiga-ui-cdk-utils-svg.js.map +1 -1
  280. package/observables/drag-and-drop-from.d.ts +4 -0
  281. package/observables/focus-visible-observable.d.ts +4 -0
  282. package/observables/items-query-list-observable.d.ts +2 -0
  283. package/observables/mouse-drag-finish-from.d.ts +2 -0
  284. package/observables/must-be-present.d.ts +4 -0
  285. package/observables/pressed-observable.d.ts +4 -0
  286. package/observables/prevent-default.d.ts +4 -0
  287. package/observables/stop-propagation.d.ts +4 -0
  288. package/observables/taiga-ui-cdk-observables.metadata.json +1 -1
  289. package/observables/typed-from-event.d.ts +16 -0
  290. package/observables/watch.d.ts +4 -0
  291. package/package.json +1 -1
  292. package/schematics/ng-update/constants/deprecated-functions.d.ts +2 -0
  293. package/schematics/ng-update/constants/deprecated-functions.js +714 -0
  294. package/schematics/ng-update/constants/templates.d.ts +8 -0
  295. package/schematics/ng-update/constants/templates.js +75 -0
  296. package/schematics/ng-update/constants/types.d.ts +1 -2
  297. package/schematics/ng-update/steps/migrate-templates.js +18 -3
  298. package/schematics/ng-update/steps/replace-functions.js +12 -0
  299. package/schematics/utils/templates/ng-component-input-manipulations.d.ts +2 -1
  300. package/schematics/utils/templates/ng-component-input-manipulations.js +2 -1
  301. package/services/hovered.service.d.ts +1 -0
  302. package/services/taiga-ui-cdk-services.metadata.json +1 -1
  303. package/utils/browser/is-edge-older-than.d.ts +4 -0
  304. package/utils/browser/is-edge.d.ts +4 -0
  305. package/utils/browser/is-firefox.d.ts +4 -0
  306. package/utils/browser/is-ie.d.ts +4 -0
  307. package/utils/browser/is-safari.d.ts +4 -0
  308. package/utils/browser/taiga-ui-cdk-utils-browser.metadata.json +1 -1
  309. package/utils/dom/can-scroll.d.ts +4 -0
  310. package/utils/dom/contains-or-after.d.ts +4 -0
  311. package/utils/dom/get-actual-target.d.ts +2 -0
  312. package/utils/dom/get-clipboard-data-text.d.ts +2 -0
  313. package/utils/dom/get-closest-element.d.ts +1 -1
  314. package/utils/dom/get-document-or-shadow-root.d.ts +4 -0
  315. package/utils/dom/get-element-obscurers.d.ts +2 -0
  316. package/utils/dom/get-element-offset.d.ts +2 -0
  317. package/utils/dom/get-scroll-parent.d.ts +3 -1
  318. package/utils/dom/index.d.ts +1 -0
  319. package/utils/dom/is-current-target.d.ts +4 -0
  320. package/utils/dom/is-inside-iframe.d.ts +2 -0
  321. package/utils/dom/is-node-in.d.ts +2 -0
  322. package/utils/dom/point-to-client-rect.d.ts +1 -0
  323. package/utils/dom/taiga-ui-cdk-utils-dom.metadata.json +1 -1
  324. package/utils/focus/blur-native-focused.d.ts +2 -0
  325. package/utils/focus/get-closest-keyboard-focusable.d.ts +5 -1
  326. package/utils/focus/get-native-focused.d.ts +2 -0
  327. package/utils/focus/is-native-focused-in.d.ts +2 -0
  328. package/utils/focus/is-native-focused.d.ts +2 -0
  329. package/utils/focus/is-native-keyboard-focusable.d.ts +2 -0
  330. package/utils/focus/is-native-mouse-focusable.d.ts +4 -0
  331. package/utils/focus/move-focus.d.ts +2 -0
  332. package/utils/focus/set-native-mouse-focused.d.ts +2 -0
  333. package/utils/focus/taiga-ui-cdk-utils-focus.metadata.json +1 -1
  334. package/utils/format/pad-start.d.ts +1 -2
  335. package/utils/format/px.d.ts +2 -0
  336. package/utils/format/taiga-ui-cdk-utils-format.metadata.json +1 -1
  337. package/utils/math/clamp.d.ts +2 -0
  338. package/utils/math/in-range.d.ts +2 -0
  339. package/utils/math/normalize-to-int-number.d.ts +2 -0
  340. package/utils/math/quantize.d.ts +2 -0
  341. package/utils/math/round.d.ts +12 -0
  342. package/utils/math/sum.d.ts +2 -0
  343. package/utils/math/taiga-ui-cdk-utils-math.metadata.json +1 -1
  344. package/utils/math/to-int.d.ts +4 -0
  345. package/utils/math/to-radians.d.ts +2 -0
  346. package/utils/miscellaneous/distance-between-touches.d.ts +4 -0
  347. package/utils/miscellaneous/ease-in-out-quad.d.ts +4 -0
  348. package/utils/miscellaneous/fallback-value.d.ts +1 -1
  349. package/utils/miscellaneous/flat-length.d.ts +3 -1
  350. package/utils/miscellaneous/get-original-array-from-query-list.d.ts +2 -0
  351. package/utils/miscellaneous/get-swipe-direction.d.ts +4 -0
  352. package/utils/miscellaneous/is-element-editable.d.ts +4 -0
  353. package/utils/miscellaneous/is-number.d.ts +4 -0
  354. package/utils/miscellaneous/is-present.d.ts +4 -0
  355. package/utils/miscellaneous/mark-control-as-touched-and-validate.d.ts +4 -0
  356. package/utils/miscellaneous/nullable-same.d.ts +2 -0
  357. package/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.metadata.json +1 -1
  358. package/utils/miscellaneous/uniq-by.d.ts +4 -0
  359. package/utils/os/is-apple-platform.d.ts +3 -1
  360. package/utils/os/is-apple.d.ts +4 -0
  361. package/utils/os/is-ios.d.ts +4 -0
  362. package/utils/os/taiga-ui-cdk-utils-os.metadata.json +1 -1
  363. package/utils/svg/svg-linear-gradient-processor.d.ts +3 -1
  364. package/utils/svg/taiga-ui-cdk-utils-svg.metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["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/is-form-field.ts","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-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-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"],"names":["getClosestElement","element","selector","closest","Element","prototype","call","matchesSelector","matches","msMatchesSelector","parentElement","getDocumentOrShadowRoot","node","isConnected","getRootNode","ownerDocument","tuiIsFormFieldElement","rootElement","vertical","scrollEnd","currentElement","Math","floor","scrollTop","ceil","clientHeight","scrollHeight","canScrollVertical","scrollLeft","clientWidth","scrollWidth","canScrollHorizontal","current","contains","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","event","composedPath","target","format","clipboardData","getData","defaultView","_a","innerWidth","innerHeight","documentRef","rect","getBoundingClientRect","left","clamp","round","top","right","bottom","horizontalMiddle","width","verticalMiddle","height","nonNull","elementFromPoint","filter","isPresent","length","filtered","el","host","tuiAssert","assert","offsetTop","offsetLeft","offsetParent","HTMLElement","getScrollParent","currentTarget","windowRef","parent","nodeType","TEXT_NODE","ELEMENT_NODE","name","_b","_c","bubbles","_d","cancelable","_e","detail","CustomEvent","customEvent","createEvent","initCustomEvent","getSelection","document","activeElement","value","slice","selectionStart","selectionEnd","toString"],"mappings":"oqBAIgBA,EAAkBC,EAAkBC,GAChD,IAAMC,EAAUC,QAAQC,UAAUF,QAElC,GAAIA,EACA,OAAOA,EAAQG,KAAKL,EAASC,GAGjC,IAAMK,EACFH,QAAQC,UAAUG,SAAYJ,QAAQC,UAAkBI,kBAE5D,EAAG,CACC,GAAIF,EAAgBD,KAAKL,EAASC,GAC9B,OAAOD,EAGVA,EAA6BA,EAAQS,oBACrB,OAAZT,GAET,OAAO,cCtBKU,EAAwBC,GACpC,MAAO,gBAAiBA,GAAQA,EAAKC,YAC9BD,EAAKE,cACNF,EAAKG,uBCHCC,EACZf,GAIA,QAFkBA,GAId,UAJcA,GAKd,mBALcA,GAMd,iBANcA,uBCFlBA,EACAgB,EACAC,EACAC,GAEA,OAAOD,EAKX,SACIjB,EACAgB,EACAE,GAEA,IAAIC,EAAiBnB,EAErB,KAAOmB,IAAmBH,EAAYP,eAAe,CACjD,GACKW,KAAKC,MAAMF,EAAeG,WAAa,IAAMJ,GAC7CE,KAAKG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WAAa3C,KAAK4C,YACtBnE,EAAKF,iBAAmBV,EAAkBY,EAAKF,cAAeR,GAChEU,EAAKkE,WAAa3C,KAAK6C,gBACjBhF,EAAkBY,EAAiBV,8BCX/C+E,EACArC,EACAG,OADAmC,OAAA,IAAAtC,EAAA,GAAAA,EAACuC,EAAAD,EAAAE,QAAAA,OAAA,IAAAD,GAAAA,EAAiBE,EAAAH,EAAAI,WAAAA,OAAA,IAAAD,GAAAA,EAAoBE,EAAAL,EAAAM,OAAAA,OAAA,IAAAD,EAAA,KAAAA,EAGtC,GAA2B,mBAAhBE,YACP,OAAO,IAAIA,YAAYR,EAAM,CAACG,QAAOA,EAAEE,WAAUA,EAAEE,OAAMA,IAG7D,IAAME,EAAc3C,EAAY4C,YAAY,eAI5C,OAFAD,EAAYE,gBAAgBX,EAAMG,EAASE,EAAYE,GAEhDE,iCCJwB9C,SAACiD,EAAAjD,EAAAiD,aAAcC,EAAAlD,EAAAkD,SAC9C,OAAO9E,EAAsB8E,EAASC,eAChCD,EAASC,cAAcC,MAAMC,MACzBH,EAASC,cAAcG,gBAAkB,EACzCJ,EAASC,cAAcI,cAAgB,IAE7B,QAAdjB,EAAAW,WAAc,IAAAX,OAAA,EAAAA,EAAEkB,aAAc","sourcesContent":["/**\n * Gets closest element by selector i.e. {@link Element.closest}\n * @deprecated only needed for IE, remove in 3.0\n */\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","export function getDocumentOrShadowRoot(node: Node): DocumentOrShadowRoot {\n return 'getRootNode' in node && node.isConnected\n ? (node.getRootNode() as Document)\n : node.ownerDocument!;\n}\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","export 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\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","export function containsOrAfter(current: Node, node: Node): boolean {\n return (\n current.contains(node) ||\n !!(node.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_PRECEDING)\n );\n}\n","/**\n * Gets actual target from open Shadow DOM if event happened within it\n */\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","const DEFAULT_FORMAT = 'text/plain';\n\n/**\n * Gets text from data of clipboardEvent, it also works in IE and Edge browsers\n */\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","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 * 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 */\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","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\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 */\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","/**\n * Finds nearest parent with scroll in it\n *\n * @param element initial element\n * @param vertical flag for orientation of scroll\n */\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","export function isCurrentTarget({target, currentTarget}: Event): boolean {\n return target === currentTarget;\n}\n","/**\n * Checks if an app is running inside <iframe /> tag\n */\nexport function isInsideIframe(windowRef: Window): boolean {\n return windowRef.parent !== windowRef;\n}\n","import {getClosestElement} from './get-closest-element';\n\n/**\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 */\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","/** @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"]}
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/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,EA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GAC3B,OAAOA,EAAUC,SAAWD,MAGnBE,EAAoBH,WCEjBI,EAAS3E,EAAYmB,GACjC,OAAOnB,EAAK4E,WAAazE,KAAK0E,YACtB7E,EAAKf,iBAAmBiC,EAAkBlB,EAAKf,cAAekC,GAChEnB,EAAK4E,WAAazE,KAAK2E,gBACjB5D,EAAkBlB,EAAiBmB,OAGtC4D,EAAcJ,0TChBvBK,EACAhD,EACAG,OADA8C,OAAA,IAAAjD,EAAA,GAAAA,EAACkD,EAAAD,EAAAE,QAAAA,OAAA,IAAAD,GAAAA,EAAiBE,EAAAH,EAAAI,WAAAA,OAAA,IAAAD,GAAAA,EAAoBE,EAAAL,EAAAM,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,6HChBHC,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","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"]}
@@ -5,10 +5,12 @@
5
5
  }(this, (function (exports, constants) { 'use strict';
6
6
 
7
7
  /**
8
+ * @deprecated: use {@link tuiGetNativeFocused} instead
8
9
  * Returns current active element, including shadow dom
9
10
  *
10
11
  * @return element or null
11
12
  */
13
+ // eslint-disable-next-line @typescript-eslint/naming-convention
12
14
  function getNativeFocused(documentRef) {
13
15
  if (!documentRef.activeElement || !documentRef.activeElement.shadowRoot) {
14
16
  return documentRef.activeElement;
@@ -19,6 +21,7 @@
19
21
  }
20
22
  return element;
21
23
  }
24
+ var tuiGetNativeFocused = getNativeFocused;
22
25
 
23
26
  /**
24
27
  * @deprecated: use native element.focus()
@@ -29,6 +32,7 @@
29
32
  * @param focused boolean focused state
30
33
  * @param preventScroll optional flag to prevent native scroll to the element
31
34
  */
35
+ // eslint-disable-next-line @typescript-eslint/naming-convention
32
36
  function setNativeFocused(element, focused, preventScroll) {
33
37
  if (focused === void 0) { focused = true; }
34
38
  if (preventScroll === void 0) { preventScroll = false; }
@@ -41,8 +45,10 @@
41
45
  }
42
46
 
43
47
  /**
48
+ * @deprecated: use {@link tuiBlurNativeFocused} instead
44
49
  * Finds and blurs current active element, including shadow DOM
45
50
  */
51
+ // eslint-disable-next-line @typescript-eslint/naming-convention
46
52
  function blurNativeFocused(documentRef) {
47
53
  var activeElement = getNativeFocused(documentRef);
48
54
  // TODO: iframe warning
@@ -50,13 +56,16 @@
50
56
  setNativeFocused(activeElement, false);
51
57
  }
52
58
  }
59
+ var tuiBlurNativeFocused = blurNativeFocused;
53
60
 
54
61
  /**
62
+ * @deprecated: use {@link tuiIsNativeKeyboardFocusable} instead
55
63
  * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to
56
64
  * only target natural focus order. Not checking the possibility of an element to
57
65
  * be focused, for example element can have display: none applied to it or any other
58
66
  * circumstances could prevent actual focus.
59
67
  */
68
+ // eslint-disable-next-line @typescript-eslint/naming-convention
60
69
  function isNativeKeyboardFocusable(element) {
61
70
  if (element.hasAttribute('disabled') || element.getAttribute('tabIndex') === '-1') {
62
71
  return false;
@@ -83,13 +92,20 @@
83
92
  return false;
84
93
  }
85
94
  }
95
+ var tuiIsNativeKeyboardFocusable = isNativeKeyboardFocusable;
86
96
 
97
+ /**
98
+ * @deprecated: use {@link tuiIsNativeMouseFocusable} instead
99
+ */
100
+ // eslint-disable-next-line @typescript-eslint/naming-convention
87
101
  function isNativeMouseFocusable(element) {
88
102
  return (!element.hasAttribute('disabled') &&
89
103
  (element.getAttribute('tabIndex') === '-1' || isNativeKeyboardFocusable(element)));
90
104
  }
105
+ var tuiIsNativeMouseFocusable = isNativeMouseFocusable;
91
106
 
92
107
  /**
108
+ * @deprecated: use {@link tuiGetClosestFocusable} instead
93
109
  * Finds the closest element that can be focused with a keyboard or mouse in theory
94
110
  *
95
111
  * @param initial current HTML element
@@ -98,6 +114,7 @@
98
114
  * @param keyboard determine if only keyboard focus is of interest
99
115
  *
100
116
  */
117
+ // eslint-disable-next-line @typescript-eslint/naming-convention
101
118
  function getClosestFocusable(initial, prev, root, keyboard) {
102
119
  if (prev === void 0) { prev = false; }
103
120
  if (keyboard === void 0) { keyboard = true; }
@@ -120,10 +137,14 @@
120
137
  }
121
138
  return null;
122
139
  }
123
- /** @deprecated use getClosestFocusable */
140
+ /**
141
+ * @deprecated: use {@link tuiGetClosestFocusable} instead
142
+ */
124
143
  var getClosestKeyboardFocusable = getClosestFocusable;
144
+ var tuiGetClosestFocusable = getClosestFocusable;
125
145
 
126
146
  /**
147
+ * @deprecated: use {@link tuiIsNativeFocused} instead
127
148
  * Checks if element is focused.
128
149
  *
129
150
  * Could return true even after blur since element remains focused if you switch away from a browser tab.
@@ -131,16 +152,20 @@
131
152
  * @param node or null (as a common return value of DOM nodes walking)
132
153
  * @return true if focused
133
154
  */
155
+ // eslint-disable-next-line @typescript-eslint/naming-convention
134
156
  function isNativeFocused(node) {
135
157
  return (!!node && !!node.ownerDocument && getNativeFocused(node.ownerDocument) === node);
136
158
  }
159
+ var tuiIsNativeFocused = isNativeFocused;
137
160
 
138
161
  /**
162
+ * @deprecated: use {@link tuiIsNativeFocusedIn} instead
139
163
  * Checks if focused element is within given element.
140
164
  *
141
165
  * @param node
142
166
  * @return true if focused node is contained within element
143
167
  */
168
+ // eslint-disable-next-line @typescript-eslint/naming-convention
144
169
  function isNativeFocusedIn(node) {
145
170
  // !node.contains - check for IE11
146
171
  if (!node.ownerDocument || !node.contains) {
@@ -149,14 +174,17 @@
149
174
  var nativeFocused = getNativeFocused(node.ownerDocument);
150
175
  return nativeFocused !== null && node.contains(nativeFocused);
151
176
  }
177
+ var tuiIsNativeFocusedIn = isNativeFocusedIn;
152
178
 
153
179
  /**
180
+ * @deprecated: use {@link tuiMoveFocus} instead
154
181
  * Utility method for moving focus in a list of elements
155
182
  *
156
183
  * @param currentIndex currently focused index
157
184
  * @param elements array of focusable elements
158
185
  * @param step a step to move focus by, typically -1 or 1
159
186
  */
187
+ // eslint-disable-next-line @typescript-eslint/naming-convention
160
188
  function moveFocus(currentIndex, elements, step) {
161
189
  currentIndex += step;
162
190
  while (currentIndex >= 0 && currentIndex < elements.length) {
@@ -167,14 +195,17 @@
167
195
  currentIndex += step;
168
196
  }
169
197
  }
198
+ var tuiMoveFocus = moveFocus;
170
199
 
171
200
  /**
201
+ * @deprecated: use {@link tuiSetNativeMouseFocused} instead
172
202
  * Focuses or blurs element with mouse action imitation (to spoof {@link TuiFocusVisibleService})
173
203
  *
174
204
  * @param element
175
205
  * @param focused desired focused state
176
206
  * @param preventScroll optionally prevent native browser scroll after focus
177
207
  */
208
+ // eslint-disable-next-line @typescript-eslint/naming-convention
178
209
  function setNativeMouseFocused(element, focused, preventScroll) {
179
210
  if (focused === void 0) { focused = true; }
180
211
  if (preventScroll === void 0) { preventScroll = false; }
@@ -191,6 +222,7 @@
191
222
  }
192
223
  setNativeFocused(element, focused, preventScroll);
193
224
  }
225
+ var tuiSetNativeMouseFocused = setNativeMouseFocused;
194
226
 
195
227
  exports.blurNativeFocused = blurNativeFocused;
196
228
  exports.getClosestFocusable = getClosestFocusable;
@@ -203,6 +235,15 @@
203
235
  exports.moveFocus = moveFocus;
204
236
  exports.setNativeFocused = setNativeFocused;
205
237
  exports.setNativeMouseFocused = setNativeMouseFocused;
238
+ exports.tuiBlurNativeFocused = tuiBlurNativeFocused;
239
+ exports.tuiGetClosestFocusable = tuiGetClosestFocusable;
240
+ exports.tuiGetNativeFocused = tuiGetNativeFocused;
241
+ exports.tuiIsNativeFocused = tuiIsNativeFocused;
242
+ exports.tuiIsNativeFocusedIn = tuiIsNativeFocusedIn;
243
+ exports.tuiIsNativeKeyboardFocusable = tuiIsNativeKeyboardFocusable;
244
+ exports.tuiIsNativeMouseFocusable = tuiIsNativeMouseFocusable;
245
+ exports.tuiMoveFocus = tuiMoveFocus;
246
+ exports.tuiSetNativeMouseFocused = tuiSetNativeMouseFocused;
206
247
 
207
248
  Object.defineProperty(exports, '__esModule', { value: true });
208
249
 
@@ -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 * Returns current active element, including shadow dom\n *\n * @return element or null\n */\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","/**\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 */\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 * Finds and blurs current active element, including shadow DOM\n */\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","/**\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 */\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","import {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\nexport function isNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute('disabled') &&\n (element.getAttribute('tabIndex') === '-1' || isNativeKeyboardFocusable(element))\n );\n}\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 * 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 */\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/** @deprecated use getClosestFocusable */\nexport const getClosestKeyboardFocusable = getClosestFocusable;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\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 */\nexport function isNativeFocused(node: Node | null): boolean {\n return (\n !!node && !!node.ownerDocument && getNativeFocused(node.ownerDocument) === node\n );\n}\n","import {getNativeFocused} from './get-native-focused';\n\n/**\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\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","import {isNativeFocused} from './is-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\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 */\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","import {setNativeFocused} from './set-native-focused';\n\n/**\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 */\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);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AO,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;;;;;;;;;;;;;;;;;;;;;;"}
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,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;;QAGpD,IAAI,aAAa,YAAY,WAAW,EAAE;YACtC,gBAAgB,CAAC,aAAa,EAAE,KAAK,CA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ACgB,SAAS,CACrB,YAAoB,EACpB,QAAgC,EAChC,IAAY;QAEZ,YAAY,IAAI,IAAI,CAAC;QAErB,OAAO,YAAY,IAAI,CAAC,IAAI,YAAY,GAAG,QAAQ,CAAC,MAAM,EAAE;YACxD,gBAAgB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;YAEzC,IAAI,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE;gBACzC,OAAO;aACV;YAED,YAAY,IAAI,IAAI,CAAC;SACxB;IACL,CAAC;QAEY,YAAY,GAAG;;IC5B5B;;;;;;;;IAQA;aACgB,qBAAqB,CACjC,OAAmC,EACnC,OAAuB,EACvB,aAA8B;QAD9B,wBAAA,EAAA,cAAuB;QACvB,8BAAA,EAAA,qBAA8B;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 n(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}function i(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!1),t?e.focus({preventScroll:n}):e.blur()}function o(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}}function u(e){return!e.hasAttribute("disabled")&&("-1"===e.getAttribute("tabIndex")||o(e))}function a(e,n,i,a){if(void 0===n&&(n=!1),void 0===a&&(a=!0),!i.ownerDocument)return null;var r=a?o:u,c=i.ownerDocument.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,t.svgNodeFilter,!1);for(c.currentNode=e;n?c.previousNode():c.nextNode();)if(c.currentNode instanceof HTMLElement&&(e=c.currentNode),r(e))return e;return null}var r=a;function c(e){return!!e&&!!e.ownerDocument&&n(e.ownerDocument)===e}e.blurNativeFocused=function(e){var t=n(e);t instanceof HTMLElement&&i(t,!1)},e.getClosestFocusable=a,e.getClosestKeyboardFocusable=r,e.getNativeFocused=n,e.isNativeFocused=c,e.isNativeFocusedIn=function(e){if(!e.ownerDocument||!e.contains)return!1;var t=n(e.ownerDocument);return null!==t&&e.contains(t)},e.isNativeKeyboardFocusable=o,e.isNativeMouseFocusable=u,e.moveFocus=function(e,t,n){for(e+=n;e>=0&&e<t.length;){if(i(t[e]),c(t[e]))return;e+=n}},e.setNativeFocused=i,e.setNativeMouseFocused=function(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=!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)}i(e,t,n)}},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){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})}));
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/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/blur-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","setNativeFocused","focused","preventScroll","focus","blur","isNativeKeyboardFocusable","hasAttribute","getAttribute","HTMLElement","isContentEditable","tagName","isNativeMouseFocusable","getClosestFocusable","initial","prev","root","keyboard","ownerDocument","check","treeWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","svgNodeFilter","currentNode","previousNode","nextNode","getClosestKeyboardFocusable","isNativeFocused","node","contains","nativeFocused","currentIndex","elements","step","length","Event","dispatchEvent","bubbles","cancelable","event_1","createEvent","initEvent"],"mappings":"udAKgBA,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,WCPKC,EACZD,EACAE,EACAC,QADA,IAAAD,IAAAA,GAAA,QACA,IAAAC,IAAAA,GAAA,GAEID,EACAF,EAAQI,MAAM,CAACD,cAAaA,IAE5BH,EAAQK,gBCXAC,EAA0BN,GACtC,GAAIA,EAAQO,aAAa,aAAoD,OAArCP,EAAQQ,aAAa,YACzD,OAAO,EAIX,GACKR,aAAmBS,aAAeT,EAAQU,mBACN,MAArCV,EAAQQ,aAAa,YAErB,OAAO,EAGX,OAAQR,EAAQW,SACZ,IAAK,SACL,IAAK,SACL,IAAK,WACD,OAAO,EACX,IAAK,QACL,IAAK,QACD,OAAOX,EAAQO,aAAa,YAChC,IAAK,QACD,MAAwC,WAAjCP,EAAQQ,aAAa,QAChC,IAAK,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EAAQkB,cAAcwB,YAAY,SAEhDD,EAAME,UAAU,aAAa,GAAM,GACnC3C,EAAQsC,cAAcG,GAG1BxC,EAAiBD,EAASE,EAASC","sourcesContent":["/**\n * Returns current active element, including shadow dom\n *\n * @return element or null\n */\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","/**\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 */\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","/**\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 */\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","import {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\nexport function isNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute('disabled') &&\n (element.getAttribute('tabIndex') === '-1' || isNativeKeyboardFocusable(element))\n );\n}\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 * 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 */\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/** @deprecated use getClosestFocusable */\nexport const getClosestKeyboardFocusable = getClosestFocusable;\n","import {getNativeFocused} from './get-native-focused';\n\n/**\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 */\nexport function isNativeFocused(node: Node | null): boolean {\n return (\n !!node && !!node.ownerDocument && getNativeFocused(node.ownerDocument) === node\n );\n}\n","import {getNativeFocused} from './get-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * Finds and blurs current active element, including shadow DOM\n */\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","import {getNativeFocused} from './get-native-focused';\n\n/**\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\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","import {isNativeFocused} from './is-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\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 */\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","import {setNativeFocused} from './set-native-focused';\n\n/**\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 */\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"]}
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,EAA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AeC,EAASE,QAAQ,CAGxD,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 || !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"]}
@@ -5,14 +5,14 @@
5
5
  }(this, (function (exports, classes) { 'use strict';
6
6
 
7
7
  /**
8
+ * @deprecated use String.prototype.padStart in 3.0 (after Chrome 49 support is dropped)
8
9
  * Pads a string with symbols in the beginning
9
10
  *
10
11
  * @param sourceString
11
12
  * @param minResultLength
12
13
  * @param padString string to pad with
13
- *
14
- * @deprecated use String.prototype.padStart in 3.0 (after Chrome 49 support is dropped)
15
14
  */
15
+ // eslint-disable-next-line @typescript-eslint/naming-convention
16
16
  function padStart(sourceString, minResultLength, padString) {
17
17
  if (padString === void 0) { padString = ' '; }
18
18
  var padSize = minResultLength - sourceString.length;
@@ -23,15 +23,19 @@
23
23
  }
24
24
 
25
25
  /**
26
+ * @deprecated: use {@link tuiPx} instead
26
27
  * Adds 'px' to the number and turns it into a string
27
28
  */
29
+ // eslint-disable-next-line @typescript-eslint/naming-convention
28
30
  function px(value) {
29
31
  classes.tuiAssert.assert(Number.isFinite(value), 'Value must be finite number');
30
32
  return value + "px";
31
33
  }
34
+ var tuiPx = px;
32
35
 
33
36
  exports.padStart = padStart;
34
37
  exports.px = px;
38
+ exports.tuiPx = tuiPx;
35
39
 
36
40
  Object.defineProperty(exports, '__esModule', { value: true });
37
41
 
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-utils-format.umd.js","sources":["ng://@taiga-ui/cdk/utils/format/pad-start.ts","ng://@taiga-ui/cdk/utils/format/px.ts"],"sourcesContent":["/**\n * Pads a string with symbols in the beginning\n *\n * @param sourceString\n * @param minResultLength\n * @param padString string to pad with\n *\n * @deprecated use String.prototype.padStart in 3.0 (after Chrome 49 support is dropped)\n */\nexport function padStart(\n sourceString: string,\n minResultLength: number,\n padString: string = ' ',\n): string {\n const padSize = minResultLength - sourceString.length;\n\n if (padSize <= 0) {\n return sourceString;\n }\n\n return padString.repeat(padSize / padString.length).slice(0, padSize) + sourceString;\n}\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * Adds 'px' to the number and turns it into a string\n */\nexport function px(value: number): string {\n tuiAssert.assert(Number.isFinite(value), 'Value must be finite number');\n\n return `${value}px`;\n}\n"],"names":["tuiAssert"],"mappings":";;;;;;IAAA;;;;;;;;;aASgB,QAAQ,CACpB,YAAoB,EACpB,eAAuB,EACvB,SAAuB;QAAvB,0BAAA,EAAA,eAAuB;QAEvB,IAAM,OAAO,GAAG,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC;QAEtD,IAAI,OAAO,IAAI,CAAC,EAAE;YACd,OAAO,YAAY,CAAC;SACvB;QAED,OAAO,SAAS,CAAC,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC;IACzF;;ICnBA;;;aAGgB,EAAE,CAAC,KAAa;QAC5BA,iBAAS,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,6BAA6B,CAAC,CAAC;QAExE,OAAU,KAAK,OAAI,CAAC;IACxB;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-utils-format.umd.js","sources":["ng://@taiga-ui/cdk/utils/format/pad-start.ts","ng://@taiga-ui/cdk/utils/format/px.ts"],"sourcesContent":["/**\n * @deprecated use String.prototype.padStart in 3.0 (after Chrome 49 support is dropped)\n * Pads a string with symbols in the beginning\n *\n * @param sourceString\n * @param minResultLength\n * @param padString string to pad with\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function padStart(\n sourceString: string,\n minResultLength: number,\n padString: string = ' ',\n): string {\n const padSize = minResultLength - sourceString.length;\n\n if (padSize <= 0) {\n return sourceString;\n }\n\n return padString.repeat(padSize / padString.length).slice(0, padSize) + sourceString;\n}\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiPx} instead\n * Adds 'px' to the number and turns it into a string\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function px(value: number): string {\n tuiAssert.assert(Number.isFinite(value), 'Value must be finite number');\n\n return `${value}px`;\n}\n\nexport const tuiPx = px;\n"],"names":["tuiAssert"],"mappings":";;;;;;IAAA;;;;;;;;IAQA;aACgB,QAAQ,CACpB,YAAoB,EACpB,eAAuB,EACvB,SAAuB;QAAvB,0BAAA,EAAA,eAAuB;QAEvB,IAAM,OAAO,GAAG,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC;QAEtD,IAAI,OAAO,IAAI,CAAC,EAAE;YACd,OAAO,YAAY,CAAC;SACvB;QAED,OAAO,SAAS,CAAC,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC;IACzF;;ICnBA;;;;IAIA;aACgB,EAAE,CAAC,KAAa;QAC5BA,iBAAS,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,6BAA6B,CAAC,CAAC;QAExE,OAAU,KAAK,OAAI,CAAC;IACxB,CAAC;QAEY,KAAK,GAAG;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(i,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@taiga-ui/cdk/classes")):"function"==typeof define&&define.amd?define("@taiga-ui/cdk/utils/format",["exports","@taiga-ui/cdk/classes"],t):t(((i=i||self)["taiga-ui"]=i["taiga-ui"]||{},i["taiga-ui"].cdk=i["taiga-ui"].cdk||{},i["taiga-ui"].cdk.utils=i["taiga-ui"].cdk.utils||{},i["taiga-ui"].cdk.utils.format={}),i["taiga-ui"].cdk.classes)}(this,(function(i,t){"use strict";i.padStart=function(i,t,e){void 0===e&&(e=" ");var a=t-i.length;return a<=0?i:e.repeat(a/e.length).slice(0,a)+i},i.px=function(i){return t.tuiAssert.assert(Number.isFinite(i),"Value must be finite number"),i+"px"},Object.defineProperty(i,"__esModule",{value:!0})}));
1
+ !function(i,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@taiga-ui/cdk/classes")):"function"==typeof define&&define.amd?define("@taiga-ui/cdk/utils/format",["exports","@taiga-ui/cdk/classes"],t):t(((i=i||self)["taiga-ui"]=i["taiga-ui"]||{},i["taiga-ui"].cdk=i["taiga-ui"].cdk||{},i["taiga-ui"].cdk.utils=i["taiga-ui"].cdk.utils||{},i["taiga-ui"].cdk.utils.format={}),i["taiga-ui"].cdk.classes)}(this,(function(i,t){"use strict";function e(i){return t.tuiAssert.assert(Number.isFinite(i),"Value must be finite number"),i+"px"}var a=e;i.padStart=function(i,t,e){void 0===e&&(e=" ");var a=t-i.length;return a<=0?i:e.repeat(a/e.length).slice(0,a)+i},i.px=e,i.tuiPx=a,Object.defineProperty(i,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=taiga-ui-cdk-utils-format.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ng://@taiga-ui/cdk/utils/format/pad-start.ts","ng://@taiga-ui/cdk/utils/format/px.ts"],"names":["sourceString","minResultLength","padString","padSize","length","repeat","slice","value","tuiAssert","assert","Number","isFinite"],"mappings":"8dAUIA,EACAC,EACAC,QAAA,IAAAA,IAAAA,EAAA,KAEA,IAAMC,EAAUF,EAAkBD,EAAaI,OAE/C,OAAID,GAAW,EACJH,EAGJE,EAAUG,OAAOF,EAAUD,EAAUE,QAAQE,MAAM,EAAGH,GAAWH,iBCfzDO,GAGf,OAFAC,EAAAA,UAAUC,OAAOC,OAAOC,SAASJ,GAAQ,+BAE/BA,EAAK","sourcesContent":["/**\n * Pads a string with symbols in the beginning\n *\n * @param sourceString\n * @param minResultLength\n * @param padString string to pad with\n *\n * @deprecated use String.prototype.padStart in 3.0 (after Chrome 49 support is dropped)\n */\nexport function padStart(\n sourceString: string,\n minResultLength: number,\n padString: string = ' ',\n): string {\n const padSize = minResultLength - sourceString.length;\n\n if (padSize <= 0) {\n return sourceString;\n }\n\n return padString.repeat(padSize / padString.length).slice(0, padSize) + sourceString;\n}\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * Adds 'px' to the number and turns it into a string\n */\nexport function px(value: number): string {\n tuiAssert.assert(Number.isFinite(value), 'Value must be finite number');\n\n return `${value}px`;\n}\n"]}
1
+ {"version":3,"sources":["ng://@taiga-ui/cdk/utils/format/px.ts","ng://@taiga-ui/cdk/utils/format/pad-start.ts"],"names":["px","value","tuiAssert","assert","Number","isFinite","tuiPx","sourceString","minResultLength","padString","padSize","length","repeat","slice"],"mappings":"mdAOgBA,EAAGC,GAGf,OAFAC,EAAAA,UAAUC,OAAOC,OAAOC,SAASJ,GAAQ,+BAE/BA,EAAK,SAGNK,EAAQN,sBCHjBO,EACAC,EACAC,QAAA,IAAAA,IAAAA,EAAA,KAEA,IAAMC,EAAUF,EAAkBD,EAAaI,OAE/C,OAAID,GAAW,EACJH,EAGJE,EAAUG,OAAOF,EAAUD,EAAUE,QAAQE,MAAM,EAAGH,GAAWH","sourcesContent":["import {tuiAssert} from '@taiga-ui/cdk/classes';\n\n/**\n * @deprecated: use {@link tuiPx} instead\n * Adds 'px' to the number and turns it into a string\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function px(value: number): string {\n tuiAssert.assert(Number.isFinite(value), 'Value must be finite number');\n\n return `${value}px`;\n}\n\nexport const tuiPx = px;\n","/**\n * @deprecated use String.prototype.padStart in 3.0 (after Chrome 49 support is dropped)\n * Pads a string with symbols in the beginning\n *\n * @param sourceString\n * @param minResultLength\n * @param padString string to pad with\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function padStart(\n sourceString: string,\n minResultLength: number,\n padString: string = ' ',\n): string {\n const padSize = minResultLength - sourceString.length;\n\n if (padSize <= 0) {\n return sourceString;\n }\n\n return padString.repeat(padSize / padString.length).slice(0, padSize) + sourceString;\n}\n"]}