@taiga-ui/cdk 3.0.0-rc.0 → 3.0.0-rc.3

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 (479) hide show
  1. package/abstract/control.d.ts +2 -1
  2. package/abstract/dialog.service.d.ts +1 -1
  3. package/abstract/portal-host.d.ts +5 -3
  4. package/abstract/portal-service.d.ts +3 -2
  5. package/abstract/theme-switcher.d.ts +0 -1
  6. package/bundles/taiga-ui-cdk-abstract.umd.js +25 -16
  7. package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
  8. package/bundles/taiga-ui-cdk-classes.umd.js +0 -8
  9. package/bundles/taiga-ui-cdk-classes.umd.js.map +1 -1
  10. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +0 -1
  11. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
  12. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +3 -1
  13. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
  14. package/bundles/taiga-ui-cdk-constants.umd.js +18 -1
  15. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  16. package/bundles/taiga-ui-cdk-date-time.umd.js +3 -29
  17. package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
  18. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +5 -6
  19. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  20. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +8 -9
  21. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  22. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js +1 -1
  23. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
  24. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js +0 -1
  25. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js.map +1 -1
  26. package/bundles/taiga-ui-cdk-directives-drag.umd.js +1 -1
  27. package/bundles/taiga-ui-cdk-directives-drag.umd.js.map +1 -1
  28. package/bundles/taiga-ui-cdk-directives-droppable.umd.js +5 -6
  29. package/bundles/taiga-ui-cdk-directives-droppable.umd.js.map +1 -1
  30. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js +11 -9
  31. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
  32. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js +0 -1
  33. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js.map +1 -1
  34. package/bundles/taiga-ui-cdk-directives-focused.umd.js +1 -1
  35. package/bundles/taiga-ui-cdk-directives-focused.umd.js.map +1 -1
  36. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js +0 -1
  37. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js.map +1 -1
  38. package/bundles/taiga-ui-cdk-directives-hovered.umd.js +7 -10
  39. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  40. package/bundles/taiga-ui-cdk-directives-media.umd.js +4 -11
  41. package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
  42. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +10 -12
  43. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
  44. package/bundles/taiga-ui-cdk-directives-pan.umd.js +0 -1
  45. package/bundles/taiga-ui-cdk-directives-pan.umd.js.map +1 -1
  46. package/bundles/taiga-ui-cdk-directives-pressed.umd.js +1 -1
  47. package/bundles/taiga-ui-cdk-directives-pressed.umd.js.map +1 -1
  48. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js +1 -2
  49. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js.map +1 -1
  50. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js +1 -1
  51. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js.map +1 -1
  52. package/bundles/taiga-ui-cdk-directives-resize.umd.js +0 -1
  53. package/bundles/taiga-ui-cdk-directives-resize.umd.js.map +1 -1
  54. package/bundles/taiga-ui-cdk-directives-swipe.umd.js +0 -1
  55. package/bundles/taiga-ui-cdk-directives-swipe.umd.js.map +1 -1
  56. package/bundles/taiga-ui-cdk-directives-zoom.umd.js +0 -1
  57. package/bundles/taiga-ui-cdk-directives-zoom.umd.js.map +1 -1
  58. package/bundles/taiga-ui-cdk-observables.umd.js +20 -76
  59. package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
  60. package/bundles/taiga-ui-cdk-pipes-keys.umd.js +68 -0
  61. package/bundles/taiga-ui-cdk-pipes-keys.umd.js.map +1 -0
  62. package/bundles/taiga-ui-cdk-pipes.umd.js +10 -4
  63. package/bundles/taiga-ui-cdk-pipes.umd.js.map +1 -1
  64. package/bundles/taiga-ui-cdk-services.umd.js +37 -72
  65. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  66. package/bundles/taiga-ui-cdk-tokens.umd.js +46 -20
  67. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  68. package/bundles/taiga-ui-cdk-utils-browser.umd.js +3 -26
  69. package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
  70. package/bundles/taiga-ui-cdk-utils-color.umd.js +81 -0
  71. package/bundles/taiga-ui-cdk-utils-color.umd.js.map +1 -0
  72. package/bundles/taiga-ui-cdk-utils-dom.umd.js +57 -87
  73. package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
  74. package/bundles/taiga-ui-cdk-utils-focus.umd.js +24 -67
  75. package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
  76. package/bundles/taiga-ui-cdk-utils-format.umd.js +0 -1
  77. package/bundles/taiga-ui-cdk-utils-format.umd.js.map +1 -1
  78. package/bundles/taiga-ui-cdk-utils-math.umd.js +8 -48
  79. package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
  80. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +349 -84
  81. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  82. package/bundles/taiga-ui-cdk-utils-os.umd.js +5 -21
  83. package/bundles/taiga-ui-cdk-utils-os.umd.js.map +1 -1
  84. package/bundles/taiga-ui-cdk-utils-svg.umd.js +1 -5
  85. package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
  86. package/bundles/taiga-ui-cdk-utils.umd.js +10 -4
  87. package/bundles/taiga-ui-cdk-utils.umd.js.map +1 -1
  88. package/classes/assert.d.ts +0 -3
  89. package/constants/browser.d.ts +4 -0
  90. package/constants/index.d.ts +1 -0
  91. package/constants/unicode-chars.d.ts +8 -0
  92. package/constants/version.d.ts +1 -0
  93. package/constants/version.js +4 -0
  94. package/date-time/day-range.d.ts +0 -5
  95. package/date-time/day.d.ts +1 -2
  96. package/date-time/month.d.ts +1 -2
  97. package/date-time/year.d.ts +1 -1
  98. package/directives/auto-focus/autofocus.directive.d.ts +2 -2
  99. package/directives/focus-visible/focus-visible.directive.d.ts +0 -1
  100. package/directives/high-dpi/high-dpi.directive.d.ts +0 -1
  101. package/directives/media/media.directive.d.ts +0 -2
  102. package/directives/overscroll/overscroll.directive.d.ts +0 -1
  103. package/directives/prevent-default/prevent-default.directive.d.ts +0 -1
  104. package/esm2015/abstract/control.js +7 -1
  105. package/esm2015/abstract/dialog.service.js +1 -1
  106. package/esm2015/abstract/portal-host.js +18 -15
  107. package/esm2015/abstract/portal-service.js +4 -4
  108. package/esm2015/abstract/theme-switcher.js +1 -2
  109. package/esm2015/classes/assert.js +1 -8
  110. package/esm2015/components/dialog-host/dialog-host.component.js +1 -2
  111. package/esm2015/components/dropdown-host/dropdown-host.component.js +4 -2
  112. package/esm2015/constants/browser.js +5 -1
  113. package/esm2015/constants/index.js +2 -1
  114. package/esm2015/constants/parent-animation.js +2 -2
  115. package/esm2015/constants/unicode-chars.js +9 -1
  116. package/esm2015/constants/version.js +2 -0
  117. package/esm2015/date-time/day-range.js +1 -6
  118. package/esm2015/date-time/day.js +2 -9
  119. package/esm2015/date-time/month.js +2 -8
  120. package/esm2015/date-time/year.js +2 -6
  121. package/esm2015/directives/active-zone/active-zone.directive.js +3 -6
  122. package/esm2015/directives/auto-focus/autofocus.directive.js +6 -5
  123. package/esm2015/directives/auto-focus/handlers/ios.handler.js +1 -2
  124. package/esm2015/directives/autofilled/autofilled-style.component.js +1 -1
  125. package/esm2015/directives/copy-processor/copy-processor.directive.js +1 -2
  126. package/esm2015/directives/drag/drag.directive.js +3 -3
  127. package/esm2015/directives/droppable/droppable.directive.js +7 -8
  128. package/esm2015/directives/focus-trap/focus-trap.directive.js +14 -12
  129. package/esm2015/directives/focus-visible/focus-visible.directive.js +1 -2
  130. package/esm2015/directives/focused/focused.directive.js +3 -3
  131. package/esm2015/directives/high-dpi/high-dpi.directive.js +1 -2
  132. package/esm2015/directives/hovered/hovered.service.js +5 -8
  133. package/esm2015/directives/media/media.directive.js +5 -10
  134. package/esm2015/directives/overscroll/overscroll.directive.js +13 -15
  135. package/esm2015/directives/pan/pan.directive.js +1 -2
  136. package/esm2015/directives/pressed/pressed.directive.js +3 -3
  137. package/esm2015/directives/prevent-default/prevent-default.directive.js +3 -4
  138. package/esm2015/directives/repeat-times/repeat-times.directive.js +3 -3
  139. package/esm2015/directives/resize/resize.directive.js +1 -2
  140. package/esm2015/directives/swipe/swipe.directive.js +1 -2
  141. package/esm2015/directives/zoom/zoom.directive.js +1 -2
  142. package/esm2015/observables/drag-and-drop-from.js +6 -11
  143. package/esm2015/observables/focus-visible-observable.js +7 -12
  144. package/esm2015/observables/items-query-list-observable.js +4 -7
  145. package/esm2015/observables/mouse-drag-finish-from.js +4 -7
  146. package/esm2015/observables/must-be-present.js +4 -9
  147. package/esm2015/observables/pressed-observable.js +5 -10
  148. package/esm2015/observables/prevent-default.js +2 -7
  149. package/esm2015/observables/stop-propagation.js +2 -7
  150. package/esm2015/observables/typed-from-event.js +2 -7
  151. package/esm2015/observables/watch.js +2 -7
  152. package/esm2015/pipes/index.js +2 -1
  153. package/esm2015/pipes/keys/index.js +3 -0
  154. package/esm2015/pipes/keys/keys.module.js +16 -0
  155. package/esm2015/pipes/keys/keys.pipe.js +14 -0
  156. package/esm2015/pipes/keys/taiga-ui-cdk-pipes-keys.js +5 -0
  157. package/esm2015/services/directive-styles.service.js +3 -26
  158. package/esm2015/services/focus-visible.service.js +3 -4
  159. package/esm2015/services/obscured.service.js +3 -5
  160. package/esm2015/services/pan.service.js +6 -9
  161. package/esm2015/services/parents-scroll.service.js +3 -5
  162. package/esm2015/services/resize.service.js +1 -2
  163. package/esm2015/services/scroll.service.js +4 -5
  164. package/esm2015/services/swipe.service.js +6 -9
  165. package/esm2015/services/zoom.service.js +8 -9
  166. package/esm2015/tokens/active-element.js +16 -16
  167. package/esm2015/tokens/alerts.js +8 -1
  168. package/esm2015/tokens/dialogs.js +8 -1
  169. package/esm2015/tokens/focusable-item-accessor.js +7 -1
  170. package/esm2015/tokens/index.js +2 -2
  171. package/esm2015/tokens/is-apple.js +3 -3
  172. package/esm2015/tokens/is-cypress.js +1 -1
  173. package/esm2015/tokens/is-ios.js +3 -3
  174. package/esm2015/tokens/range.js +8 -0
  175. package/esm2015/tokens/window-height.js +3 -3
  176. package/esm2015/utils/browser/index.js +1 -2
  177. package/esm2015/utils/browser/is-edge.js +2 -7
  178. package/esm2015/utils/browser/is-firefox.js +2 -7
  179. package/esm2015/utils/browser/is-safari.js +2 -7
  180. package/esm2015/utils/color/hex-to-rgb.js +12 -0
  181. package/esm2015/utils/color/hsv-to-rgb.js +11 -0
  182. package/esm2015/utils/color/index.js +6 -0
  183. package/esm2015/utils/color/parse-color.js +27 -0
  184. package/esm2015/utils/color/rgb-to-hex.js +4 -0
  185. package/esm2015/utils/color/rgb-to-hsv.js +7 -0
  186. package/esm2015/utils/color/taiga-ui-cdk-utils-color.js +5 -0
  187. package/esm2015/utils/dom/can-scroll.js +2 -7
  188. package/esm2015/utils/dom/contains-or-after.js +2 -7
  189. package/esm2015/utils/dom/element-checks.js +21 -0
  190. package/esm2015/utils/dom/get-actual-target.js +2 -5
  191. package/esm2015/utils/dom/get-clipboard-data-text.js +2 -5
  192. package/esm2015/utils/dom/get-document-or-shadow-root.js +2 -7
  193. package/esm2015/utils/dom/get-element-obscurers.js +14 -17
  194. package/esm2015/utils/dom/get-element-offset.js +4 -7
  195. package/esm2015/utils/dom/get-scroll-parent.js +3 -6
  196. package/esm2015/utils/dom/get-selected-text.js +3 -3
  197. package/esm2015/utils/dom/index.js +3 -2
  198. package/esm2015/utils/dom/is-current-target.js +2 -7
  199. package/esm2015/utils/dom/is-element-editable.js +5 -0
  200. package/esm2015/utils/dom/is-inside-iframe.js +2 -5
  201. package/esm2015/utils/dom/is-node-in.js +5 -7
  202. package/esm2015/utils/focus/blur-native-focused.js +4 -7
  203. package/esm2015/utils/focus/get-closest-focusable.js +26 -0
  204. package/esm2015/utils/focus/get-native-focused.js +3 -3
  205. package/esm2015/utils/focus/index.js +2 -3
  206. package/esm2015/utils/focus/is-native-focused-in.js +1 -2
  207. package/esm2015/utils/focus/is-native-focused.js +1 -2
  208. package/esm2015/utils/focus/is-native-keyboard-focusable.js +3 -3
  209. package/esm2015/utils/focus/is-native-mouse-focusable.js +1 -4
  210. package/esm2015/utils/focus/move-focus.js +2 -4
  211. package/esm2015/utils/focus/set-native-mouse-focused.js +8 -7
  212. package/esm2015/utils/format/px.js +1 -2
  213. package/esm2015/utils/index.js +2 -1
  214. package/esm2015/utils/math/clamp.js +2 -5
  215. package/esm2015/utils/math/quantize.js +2 -5
  216. package/esm2015/utils/math/round.js +4 -19
  217. package/esm2015/utils/math/sum.js +2 -5
  218. package/esm2015/utils/math/to-int.js +2 -7
  219. package/esm2015/utils/math/to-radians.js +2 -5
  220. package/esm2015/utils/miscellaneous/array-remove.js +4 -0
  221. package/esm2015/utils/miscellaneous/array-toggle.js +6 -0
  222. package/esm2015/utils/miscellaneous/distance-between-touches.js +2 -7
  223. package/esm2015/utils/miscellaneous/ease-in-out-quad.js +2 -7
  224. package/esm2015/utils/miscellaneous/flat-length.js +2 -5
  225. package/esm2015/utils/miscellaneous/get-original-array-from-query-list.js +2 -5
  226. package/esm2015/utils/miscellaneous/get-swipe-direction.js +2 -7
  227. package/esm2015/utils/miscellaneous/index.js +3 -3
  228. package/esm2015/utils/miscellaneous/is-number.js +2 -7
  229. package/esm2015/utils/miscellaneous/is-present.js +2 -7
  230. package/esm2015/utils/miscellaneous/mark-control-as-touched-and-validate.js +4 -9
  231. package/esm2015/utils/miscellaneous/uniq-by.js +2 -7
  232. package/esm2015/utils/os/is-apple-platform.js +2 -5
  233. package/esm2015/utils/os/is-apple.js +4 -9
  234. package/esm2015/utils/os/is-ios.js +4 -9
  235. package/esm2015/utils/svg/svg-linear-gradient-processor.js +2 -5
  236. package/fesm2015/taiga-ui-cdk-abstract.js +26 -18
  237. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  238. package/fesm2015/taiga-ui-cdk-classes.js +1 -8
  239. package/fesm2015/taiga-ui-cdk-classes.js.map +1 -1
  240. package/fesm2015/taiga-ui-cdk-components-dialog-host.js +0 -1
  241. package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  242. package/fesm2015/taiga-ui-cdk-components-dropdown-host.js +3 -1
  243. package/fesm2015/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
  244. package/fesm2015/taiga-ui-cdk-constants.js +16 -2
  245. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  246. package/fesm2015/taiga-ui-cdk-date-time.js +4 -26
  247. package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
  248. package/fesm2015/taiga-ui-cdk-directives-active-zone.js +2 -5
  249. package/fesm2015/taiga-ui-cdk-directives-active-zone.js.map +1 -1
  250. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +5 -5
  251. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  252. package/fesm2015/taiga-ui-cdk-directives-autofilled.js +1 -1
  253. package/fesm2015/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  254. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js +0 -1
  255. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js.map +1 -1
  256. package/fesm2015/taiga-ui-cdk-directives-drag.js +2 -2
  257. package/fesm2015/taiga-ui-cdk-directives-drag.js.map +1 -1
  258. package/fesm2015/taiga-ui-cdk-directives-droppable.js +6 -7
  259. package/fesm2015/taiga-ui-cdk-directives-droppable.js.map +1 -1
  260. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js +13 -11
  261. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
  262. package/fesm2015/taiga-ui-cdk-directives-focus-visible.js +0 -1
  263. package/fesm2015/taiga-ui-cdk-directives-focus-visible.js.map +1 -1
  264. package/fesm2015/taiga-ui-cdk-directives-focused.js +2 -2
  265. package/fesm2015/taiga-ui-cdk-directives-focused.js.map +1 -1
  266. package/fesm2015/taiga-ui-cdk-directives-high-dpi.js +0 -1
  267. package/fesm2015/taiga-ui-cdk-directives-high-dpi.js.map +1 -1
  268. package/fesm2015/taiga-ui-cdk-directives-hovered.js +4 -7
  269. package/fesm2015/taiga-ui-cdk-directives-hovered.js.map +1 -1
  270. package/fesm2015/taiga-ui-cdk-directives-media.js +5 -10
  271. package/fesm2015/taiga-ui-cdk-directives-media.js.map +1 -1
  272. package/fesm2015/taiga-ui-cdk-directives-overscroll.js +12 -14
  273. package/fesm2015/taiga-ui-cdk-directives-overscroll.js.map +1 -1
  274. package/fesm2015/taiga-ui-cdk-directives-pan.js +0 -1
  275. package/fesm2015/taiga-ui-cdk-directives-pan.js.map +1 -1
  276. package/fesm2015/taiga-ui-cdk-directives-pressed.js +2 -2
  277. package/fesm2015/taiga-ui-cdk-directives-pressed.js.map +1 -1
  278. package/fesm2015/taiga-ui-cdk-directives-prevent-default.js +2 -3
  279. package/fesm2015/taiga-ui-cdk-directives-prevent-default.js.map +1 -1
  280. package/fesm2015/taiga-ui-cdk-directives-repeat-times.js +2 -2
  281. package/fesm2015/taiga-ui-cdk-directives-repeat-times.js.map +1 -1
  282. package/fesm2015/taiga-ui-cdk-directives-resize.js +0 -1
  283. package/fesm2015/taiga-ui-cdk-directives-resize.js.map +1 -1
  284. package/fesm2015/taiga-ui-cdk-directives-swipe.js +0 -1
  285. package/fesm2015/taiga-ui-cdk-directives-swipe.js.map +1 -1
  286. package/fesm2015/taiga-ui-cdk-directives-zoom.js +0 -1
  287. package/fesm2015/taiga-ui-cdk-directives-zoom.js.map +1 -1
  288. package/fesm2015/taiga-ui-cdk-observables.js +21 -67
  289. package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
  290. package/fesm2015/taiga-ui-cdk-pipes-keys.js +34 -0
  291. package/fesm2015/taiga-ui-cdk-pipes-keys.js.map +1 -0
  292. package/fesm2015/taiga-ui-cdk-pipes.js +1 -0
  293. package/fesm2015/taiga-ui-cdk-pipes.js.map +1 -1
  294. package/fesm2015/taiga-ui-cdk-services.js +25 -60
  295. package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
  296. package/fesm2015/taiga-ui-cdk-tokens.js +46 -23
  297. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  298. package/fesm2015/taiga-ui-cdk-utils-browser.js +4 -23
  299. package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
  300. package/fesm2015/taiga-ui-cdk-utils-color.js +67 -0
  301. package/fesm2015/taiga-ui-cdk-utils-color.js.map +1 -0
  302. package/fesm2015/taiga-ui-cdk-utils-dom.js +53 -78
  303. package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
  304. package/fesm2015/taiga-ui-cdk-utils-focus.js +21 -57
  305. package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
  306. package/fesm2015/taiga-ui-cdk-utils-format.js +0 -1
  307. package/fesm2015/taiga-ui-cdk-utils-format.js.map +1 -1
  308. package/fesm2015/taiga-ui-cdk-utils-math.js +9 -41
  309. package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
  310. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +21 -73
  311. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  312. package/fesm2015/taiga-ui-cdk-utils-os.js +6 -19
  313. package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -1
  314. package/fesm2015/taiga-ui-cdk-utils-svg.js +2 -5
  315. package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
  316. package/fesm2015/taiga-ui-cdk-utils.js +1 -0
  317. package/fesm2015/taiga-ui-cdk-utils.js.map +1 -1
  318. package/observables/drag-and-drop-from.d.ts +1 -5
  319. package/observables/focus-visible-observable.d.ts +1 -5
  320. package/observables/items-query-list-observable.d.ts +1 -3
  321. package/observables/mouse-drag-finish-from.d.ts +1 -3
  322. package/observables/must-be-present.d.ts +1 -5
  323. package/observables/pressed-observable.d.ts +1 -5
  324. package/observables/prevent-default.d.ts +1 -5
  325. package/observables/stop-propagation.d.ts +1 -5
  326. package/observables/typed-from-event.d.ts +5 -21
  327. package/observables/watch.d.ts +1 -5
  328. package/package.json +7 -3
  329. package/pipes/index.d.ts +1 -0
  330. package/pipes/keys/index.d.ts +2 -0
  331. package/pipes/keys/keys.module.d.ts +7 -0
  332. package/pipes/keys/keys.pipe.d.ts +7 -0
  333. package/pipes/keys/package.json +10 -0
  334. package/pipes/keys/taiga-ui-cdk-pipes-keys.d.ts +5 -0
  335. package/schematics/collection.json +6 -0
  336. package/schematics/constants/file-globs.d.ts +2 -0
  337. package/schematics/constants/file-globs.js +11 -0
  338. package/schematics/constants/index.d.ts +1 -0
  339. package/schematics/constants/index.js +4 -0
  340. package/schematics/constants/taiga-styles.d.ts +2 -1
  341. package/schematics/constants/taiga-styles.js +3 -2
  342. package/schematics/ng-add/constants/versions.js +2 -2
  343. package/schematics/ng-add/index.js +6 -0
  344. package/schematics/ng-add/schema.d.ts +8 -0
  345. package/schematics/ng-add/schema.json +9 -0
  346. package/schematics/ng-add/steps/add-taiga-icons.js +5 -3
  347. package/schematics/ng-add/steps/add-taiga-modules.js +4 -0
  348. package/schematics/ng-add/steps/add-taiga-styles.js +6 -3
  349. package/schematics/ng-add/steps/wrap-with-tui-root.js +3 -0
  350. package/schematics/ng-update/constants/breakpoints.d.ts +82 -0
  351. package/schematics/ng-update/constants/breakpoints.js +34 -0
  352. package/schematics/ng-update/constants/consts.d.ts +1 -1
  353. package/schematics/ng-update/constants/consts.js +170 -0
  354. package/schematics/ng-update/constants/deprecated-functions.js +1 -36
  355. package/schematics/ng-update/constants/services.js +1 -1
  356. package/schematics/ng-update/constants/templates.d.ts +16 -0
  357. package/schematics/ng-update/constants/templates.js +261 -1
  358. package/schematics/ng-update/constants/warnings.js +10 -0
  359. package/schematics/ng-update/index.js +21 -10
  360. package/schematics/ng-update/schema.json +13 -0
  361. package/schematics/ng-update/steps/migrate-date-time.js +45 -1
  362. package/schematics/ng-update/steps/migrate-progress.d.ts +1 -1
  363. package/schematics/ng-update/steps/migrate-progress.js +2 -1
  364. package/schematics/ng-update/steps/migrate-sliders/index.d.ts +1 -1
  365. package/schematics/ng-update/steps/migrate-sliders/index.js +2 -0
  366. package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.d.ts +1 -1
  367. package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.js +4 -3
  368. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.d.ts +1 -1
  369. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +3 -2
  370. package/schematics/ng-update/steps/migrate-taiga-proprietary-icons.d.ts +3 -0
  371. package/schematics/ng-update/steps/migrate-taiga-proprietary-icons.js +51 -0
  372. package/schematics/ng-update/steps/migrate-templates.d.ts +1 -1
  373. package/schematics/ng-update/steps/migrate-templates.js +77 -5
  374. package/schematics/ng-update/steps/replace-deep-import.js +2 -1
  375. package/schematics/ng-update/steps/replace-enums.js +2 -1
  376. package/schematics/ng-update/steps/replace-functions.js +42 -2
  377. package/schematics/ng-update/steps/replace-styles.d.ts +1 -0
  378. package/schematics/ng-update/steps/replace-styles.js +18 -0
  379. package/schematics/ng-update/steps/show-warnings.js +2 -1
  380. package/schematics/utils/add-import-to-closest-module.d.ts +1 -0
  381. package/schematics/utils/add-import-to-closest-module.js +18 -0
  382. package/schematics/utils/add-styles.d.ts +6 -2
  383. package/schematics/utils/add-styles.js +32 -4
  384. package/schematics/utils/angular/ng-component.d.ts +1 -2
  385. package/schematics/utils/angular/ng-module.d.ts +1 -2
  386. package/schematics/utils/angular/ng-module.js +2 -1
  387. package/schematics/utils/colored-log.d.ts +1 -0
  388. package/schematics/utils/colored-log.js +5 -1
  389. package/schematics/utils/get-execution-time.d.ts +1 -0
  390. package/schematics/utils/get-execution-time.js +8 -0
  391. package/schematics/utils/get-named-import-references.js +2 -1
  392. package/schematics/utils/get-project.d.ts +1 -1
  393. package/schematics/utils/get-project.js +0 -4
  394. package/schematics/utils/insert-todo.d.ts +1 -0
  395. package/schematics/utils/insert-todo.js +3 -2
  396. package/schematics/utils/progress.d.ts +1 -0
  397. package/schematics/utils/progress.js +13 -0
  398. package/schematics/utils/templates/get-component-templates.d.ts +1 -2
  399. package/schematics/utils/templates/get-component-templates.js +1 -1
  400. package/schematics/utils/templates/ng-component-input-manipulations.js +2 -12
  401. package/schematics/utils/templates/template-resource.d.ts +1 -1
  402. package/services/directive-styles.service.d.ts +2 -9
  403. package/services/focus-visible.service.d.ts +0 -1
  404. package/services/pan.service.d.ts +0 -3
  405. package/services/swipe.service.d.ts +0 -3
  406. package/tokens/alerts.d.ts +2 -1
  407. package/tokens/dialogs.d.ts +2 -1
  408. package/tokens/focusable-item-accessor.d.ts +2 -1
  409. package/tokens/index.d.ts +1 -1
  410. package/tokens/is-cypress.d.ts +0 -3
  411. package/tokens/range.d.ts +2 -0
  412. package/utils/browser/index.d.ts +0 -1
  413. package/utils/browser/is-edge.d.ts +1 -5
  414. package/utils/browser/is-firefox.d.ts +1 -5
  415. package/utils/browser/is-safari.d.ts +1 -5
  416. package/utils/color/hex-to-rgb.d.ts +1 -0
  417. package/utils/color/hsv-to-rgb.d.ts +4 -0
  418. package/utils/color/index.d.ts +5 -0
  419. package/utils/color/package.json +10 -0
  420. package/utils/color/parse-color.d.ts +1 -0
  421. package/utils/color/rgb-to-hex.d.ts +1 -0
  422. package/utils/color/rgb-to-hsv.d.ts +1 -0
  423. package/utils/color/taiga-ui-cdk-utils-color.d.ts +5 -0
  424. package/utils/dom/can-scroll.d.ts +1 -5
  425. package/utils/dom/contains-or-after.d.ts +1 -5
  426. package/utils/dom/element-checks.d.ts +6 -0
  427. package/utils/dom/get-actual-target.d.ts +1 -3
  428. package/utils/dom/get-clipboard-data-text.d.ts +1 -3
  429. package/utils/dom/get-document-or-shadow-root.d.ts +1 -5
  430. package/utils/dom/get-element-obscurers.d.ts +1 -3
  431. package/utils/dom/get-element-offset.d.ts +1 -3
  432. package/utils/dom/get-scroll-parent.d.ts +1 -3
  433. package/utils/dom/index.d.ts +2 -1
  434. package/utils/dom/is-current-target.d.ts +1 -5
  435. package/utils/dom/is-element-editable.d.ts +1 -0
  436. package/utils/dom/is-inside-iframe.d.ts +1 -3
  437. package/utils/dom/is-node-in.d.ts +1 -3
  438. package/utils/focus/blur-native-focused.d.ts +1 -3
  439. package/utils/focus/get-closest-focusable.d.ts +27 -0
  440. package/utils/focus/index.d.ts +1 -2
  441. package/utils/focus/is-native-mouse-focusable.d.ts +0 -2
  442. package/utils/focus/set-native-mouse-focused.d.ts +1 -3
  443. package/utils/index.d.ts +1 -0
  444. package/utils/math/clamp.d.ts +1 -3
  445. package/utils/math/quantize.d.ts +1 -3
  446. package/utils/math/round.d.ts +3 -15
  447. package/utils/math/sum.d.ts +1 -3
  448. package/utils/math/to-int.d.ts +1 -5
  449. package/utils/math/to-radians.d.ts +1 -3
  450. package/utils/miscellaneous/array-remove.d.ts +1 -0
  451. package/utils/miscellaneous/array-toggle.d.ts +1 -0
  452. package/utils/miscellaneous/distance-between-touches.d.ts +1 -5
  453. package/utils/miscellaneous/ease-in-out-quad.d.ts +1 -5
  454. package/utils/miscellaneous/flat-length.d.ts +1 -3
  455. package/utils/miscellaneous/get-original-array-from-query-list.d.ts +1 -3
  456. package/utils/miscellaneous/get-swipe-direction.d.ts +1 -5
  457. package/utils/miscellaneous/index.d.ts +2 -2
  458. package/utils/miscellaneous/is-number.d.ts +1 -5
  459. package/utils/miscellaneous/is-present.d.ts +1 -5
  460. package/utils/miscellaneous/mark-control-as-touched-and-validate.d.ts +1 -5
  461. package/utils/miscellaneous/uniq-by.d.ts +1 -5
  462. package/utils/os/is-apple-platform.d.ts +1 -3
  463. package/utils/os/is-apple.d.ts +1 -5
  464. package/utils/os/is-ios.d.ts +1 -5
  465. package/utils/svg/svg-linear-gradient-processor.d.ts +1 -3
  466. package/esm2015/tokens/sanitizer.js +0 -4
  467. package/esm2015/utils/browser/is-ie.js +0 -4
  468. package/esm2015/utils/dom/is-form-field.js +0 -8
  469. package/esm2015/utils/focus/get-closest-keyboard-focusable.js +0 -34
  470. package/esm2015/utils/focus/set-native-focused.js +0 -19
  471. package/esm2015/utils/miscellaneous/identity.js +0 -8
  472. package/esm2015/utils/miscellaneous/is-element-editable.js +0 -12
  473. package/tokens/sanitizer.d.ts +0 -2
  474. package/utils/browser/is-ie.d.ts +0 -1
  475. package/utils/dom/is-form-field.d.ts +0 -1
  476. package/utils/focus/get-closest-keyboard-focusable.d.ts +0 -10
  477. package/utils/focus/set-native-focused.d.ts +0 -10
  478. package/utils/miscellaneous/identity.d.ts +0 -4
  479. package/utils/miscellaneous/is-element-editable.d.ts +0 -5
@@ -1,20 +1,19 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, Directive, Inject, Output, NgModule } from '@angular/core';
3
- import { typedFromEvent, preventDefault } from '@taiga-ui/cdk/observables';
3
+ import { tuiTypedFromEvent, tuiPreventDefault } from '@taiga-ui/cdk/observables';
4
4
  import { TuiDestroyService } from '@taiga-ui/cdk/services';
5
- import { isPresent } from '@taiga-ui/cdk/utils/miscellaneous';
5
+ import { tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
6
6
  import * as i1 from 'rxjs';
7
7
  import { merge } from 'rxjs';
8
8
  import { map, filter, switchMap, mapTo, startWith, distinctUntilChanged, takeUntil } from 'rxjs/operators';
9
9
 
10
- // @dynamic
11
10
  class TuiDroppableDirective {
12
11
  constructor({ nativeElement }, destroy$) {
13
- this.tuiDroppableDropped = typedFromEvent(nativeElement, `drop`).pipe(preventDefault(), map(event => event.dataTransfer), filter(isPresent));
14
- this.tuiDroppableDragOverChange = typedFromEvent(nativeElement, `dragenter`).pipe(switchMap(({ target, dataTransfer }) => merge(typedFromEvent(nativeElement, `dragleave`).pipe(filter(event => event.target === target)), typedFromEvent(nativeElement, `drop`)).pipe(mapTo(null), startWith(dataTransfer))), distinctUntilChanged((a, b) => (!!a && !!b) || (!a && !b)));
12
+ this.tuiDroppableDropped = tuiTypedFromEvent(nativeElement, `drop`).pipe(tuiPreventDefault(), map(event => event.dataTransfer), filter(tuiIsPresent));
13
+ this.tuiDroppableDragOverChange = tuiTypedFromEvent(nativeElement, `dragenter`).pipe(switchMap(({ target, dataTransfer }) => merge(tuiTypedFromEvent(nativeElement, `dragleave`).pipe(filter(event => event.target === target)), tuiTypedFromEvent(nativeElement, `drop`)).pipe(mapTo(null), startWith(dataTransfer))), distinctUntilChanged((a, b) => (!!a && !!b) || (!a && !b)));
15
14
  // Required by Drag and Drop API to stop redirecting
16
- typedFromEvent(nativeElement, `dragover`)
17
- .pipe(preventDefault(), takeUntil(destroy$))
15
+ tuiTypedFromEvent(nativeElement, `dragover`)
16
+ .pipe(tuiPreventDefault(), takeUntil(destroy$))
18
17
  .subscribe();
19
18
  }
20
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-droppable.js","sources":["../../../projects/cdk/directives/droppable/droppable.directive.ts","../../../projects/cdk/directives/droppable/droppable.module.ts","../../../projects/cdk/directives/droppable/taiga-ui-cdk-directives-droppable.ts"],"sourcesContent":["import {Directive, ElementRef, Inject, Output} from '@angular/core';\nimport {preventDefault, typedFromEvent} from '@taiga-ui/cdk/observables';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {isPresent} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {merge, Observable} from 'rxjs';\nimport {\n distinctUntilChanged,\n filter,\n map,\n mapTo,\n startWith,\n switchMap,\n takeUntil,\n} from 'rxjs/operators';\n\n// @dynamic\n@Directive({\n selector: `[tuiDroppableDropped], [tuiDroppableDragOverChange]`,\n providers: [TuiDestroyService],\n})\nexport class TuiDroppableDirective {\n @Output()\n readonly tuiDroppableDropped: Observable<DataTransfer>;\n\n @Output()\n readonly tuiDroppableDragOverChange: Observable<DataTransfer | null>;\n\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n ) {\n this.tuiDroppableDropped = typedFromEvent(nativeElement, `drop`).pipe(\n preventDefault(),\n map(event => event.dataTransfer),\n filter(isPresent),\n );\n\n this.tuiDroppableDragOverChange = typedFromEvent(nativeElement, `dragenter`).pipe(\n switchMap(({target, dataTransfer}) =>\n merge(\n typedFromEvent(nativeElement, `dragleave`).pipe(\n filter(event => event.target === target),\n ),\n typedFromEvent(nativeElement, `drop`),\n ).pipe(mapTo(null), startWith(dataTransfer)),\n ),\n distinctUntilChanged((a, b) => (!!a && !!b) || (!a && !b)),\n );\n\n // Required by Drag and Drop API to stop redirecting\n typedFromEvent(nativeElement, `dragover`)\n .pipe(preventDefault(), takeUntil(destroy$))\n .subscribe();\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiDroppableDirective} from './droppable.directive';\n\n@NgModule({\n declarations: [TuiDroppableDirective],\n exports: [TuiDroppableDirective],\n})\nexport class TuiDroppableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAeA;MAKa,qBAAqB,CAAA;AAO9B,IAAA,WAAA,CACwB,EAAC,aAAa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AAA,qBAAA,EAAA,0BAAA,EAAA,4BAAA,EAAA,EAAA,SAAA,EAFnB,CAAC,iBAAiB,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAErB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAqD,mDAAA,CAAA;oBAC/D,SAAS,EAAE,CAAC,iBAAiB,CAAC;AACjC,iBAAA,CAAA;;0BASQ,MAAM;2BAAC,UAAU,CAAA;;0BACjB,MAAM;2BAAC,iBAAiB,CAAA;4CAPpB,mBAAmB,EAAA,CAAA;sBAD3B,MAAM;gBAIE,0BAA0B,EAAA,CAAA;sBADlC,MAAM;;;MChBE,kBAAkB,CAAA;;gHAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;iHAAlB,kBAAkB,EAAA,YAAA,EAAA,CAHZ,qBAAqB,CAAA,EAAA,OAAA,EAAA,CAC1B,qBAAqB,CAAA,EAAA,CAAA,CAAA;iHAEtB,kBAAkB,EAAA,CAAA,CAAA;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACnC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-droppable.js","sources":["../../../projects/cdk/directives/droppable/droppable.directive.ts","../../../projects/cdk/directives/droppable/droppable.module.ts","../../../projects/cdk/directives/droppable/taiga-ui-cdk-directives-droppable.ts"],"sourcesContent":["import {Directive, ElementRef, Inject, Output} from '@angular/core';\nimport {tuiPreventDefault, tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {tuiIsPresent} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {merge, Observable} from 'rxjs';\nimport {\n distinctUntilChanged,\n filter,\n map,\n mapTo,\n startWith,\n switchMap,\n takeUntil,\n} from 'rxjs/operators';\n\n@Directive({\n selector: `[tuiDroppableDropped], [tuiDroppableDragOverChange]`,\n providers: [TuiDestroyService],\n})\nexport class TuiDroppableDirective {\n @Output()\n readonly tuiDroppableDropped: Observable<DataTransfer>;\n\n @Output()\n readonly tuiDroppableDragOverChange: Observable<DataTransfer | null>;\n\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n ) {\n this.tuiDroppableDropped = tuiTypedFromEvent(nativeElement, `drop`).pipe(\n tuiPreventDefault(),\n map(event => event.dataTransfer),\n filter(tuiIsPresent),\n );\n\n this.tuiDroppableDragOverChange = tuiTypedFromEvent(\n nativeElement,\n `dragenter`,\n ).pipe(\n switchMap(({target, dataTransfer}) =>\n merge(\n tuiTypedFromEvent(nativeElement, `dragleave`).pipe(\n filter(event => event.target === target),\n ),\n tuiTypedFromEvent(nativeElement, `drop`),\n ).pipe(mapTo(null), startWith(dataTransfer)),\n ),\n distinctUntilChanged((a, b) => (!!a && !!b) || (!a && !b)),\n );\n\n // Required by Drag and Drop API to stop redirecting\n tuiTypedFromEvent(nativeElement, `dragover`)\n .pipe(tuiPreventDefault(), takeUntil(destroy$))\n .subscribe();\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiDroppableDirective} from './droppable.directive';\n\n@NgModule({\n declarations: [TuiDroppableDirective],\n exports: [TuiDroppableDirective],\n})\nexport class TuiDroppableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAmBa,qBAAqB,CAAA;AAO9B,IAAA,WAAA,CACwB,EAAC,aAAa,EAA0B,EACjC,QAA0B,EAAA;AAErD,QAAA,IAAI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4BAAA,EAAA,EAAA,SAAA,EAFnB,CAAC,iBAAiB,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAErB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAqD,mDAAA,CAAA;oBAC/D,SAAS,EAAE,CAAC,iBAAiB,CAAC;AACjC,iBAAA,CAAA;;0BASQ,MAAM;2BAAC,UAAU,CAAA;;0BACjB,MAAM;2BAAC,iBAAiB,CAAA;4CAPpB,mBAAmB,EAAA,CAAA;sBAD3B,MAAM;gBAIE,0BAA0B,EAAA,CAAA;sBADlC,MAAM;;;MCfE,kBAAkB,CAAA;;gHAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;iHAAlB,kBAAkB,EAAA,YAAA,EAAA,CAHZ,qBAAqB,CAAA,EAAA,OAAA,EAAA,CAC1B,qBAAqB,CAAA,EAAA,CAAA,CAAA;iHAEtB,kBAAkB,EAAA,CAAA,CAAA;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACnC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -1,10 +1,9 @@
1
1
  import { DOCUMENT } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
3
  import { ElementRef, Renderer2, Directive, Inject, HostListener, NgModule } from '@angular/core';
4
- import { containsOrAfter } from '@taiga-ui/cdk/utils/dom';
5
- import { tuiGetNativeFocused, setNativeFocused, tuiGetClosestFocusable, blurNativeFocused } from '@taiga-ui/cdk/utils/focus';
4
+ import { tuiContainsOrAfter, tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
5
+ import { tuiGetNativeFocused, tuiGetClosestFocusable, tuiBlurNativeFocused } from '@taiga-ui/cdk/utils/focus';
6
6
 
7
- // @dynamic
8
7
  class TuiFocusTrapDirective {
9
8
  constructor(documentRef, elementRef, renderer) {
10
9
  this.documentRef = documentRef;
@@ -18,23 +17,27 @@ class TuiFocusTrapDirective {
18
17
  */
19
18
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
20
19
  Promise.resolve().then(() => {
21
- setNativeFocused(this.elementRef.nativeElement);
20
+ this.elementRef.nativeElement.focus();
22
21
  });
23
22
  }
24
23
  onBlur() {
25
24
  this.renderer.removeAttribute(this.elementRef.nativeElement, `tabIndex`);
26
25
  }
27
26
  onFocusIn(node) {
28
- if (containsOrAfter(this.elementRef.nativeElement, node)) {
27
+ const { nativeElement } = this.elementRef;
28
+ if (tuiContainsOrAfter(nativeElement, node)) {
29
29
  return;
30
30
  }
31
- const focusable = tuiGetClosestFocusable(this.elementRef.nativeElement, false, this.elementRef.nativeElement);
31
+ const focusable = tuiGetClosestFocusable({
32
+ initial: nativeElement,
33
+ root: nativeElement,
34
+ });
32
35
  if (focusable) {
33
- setNativeFocused(focusable);
36
+ focusable.focus();
34
37
  }
35
38
  }
36
39
  ngOnDestroy() {
37
- blurNativeFocused(this.documentRef);
40
+ tuiBlurNativeFocused(this.documentRef);
38
41
  /**
39
42
  * HostListeners are triggered even after ngOnDestroy
40
43
  * {@link https://github.com/angular/angular/issues/38100}
@@ -43,9 +46,8 @@ class TuiFocusTrapDirective {
43
46
  */
44
47
  // eslint-disable-next-line
45
48
  Promise.resolve().then(() => {
46
- // TODO: iframe warning
47
- if (this.activeElement instanceof HTMLElement) {
48
- setNativeFocused(this.activeElement);
49
+ if (tuiIsHTMLElement(this.activeElement)) {
50
+ this.activeElement.focus();
49
51
  }
50
52
  });
51
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-focus-trap.js","sources":["../../../projects/cdk/directives/focus-trap/focus-trap.directive.ts","../../../projects/cdk/directives/focus-trap/focus-trap.module.ts","../../../projects/cdk/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n HostListener,\n Inject,\n OnDestroy,\n Renderer2,\n} from '@angular/core';\nimport {containsOrAfter} from '@taiga-ui/cdk/utils/dom';\nimport {\n blurNativeFocused,\n setNativeFocused,\n tuiGetClosestFocusable,\n tuiGetNativeFocused,\n} from '@taiga-ui/cdk/utils/focus';\n\n// @dynamic\n@Directive({\n selector: `[tuiFocusTrap]`,\n host: {\n tabIndex: `0`,\n },\n})\nexport class TuiFocusTrapDirective implements OnDestroy {\n private readonly activeElement = tuiGetNativeFocused(this.documentRef);\n\n constructor(\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n ) {\n /**\n * This would cause currently focused element to lose focus,\n * but it might cause ExpressionChanged error due to potential HostBinding.\n * Microtask keeps it in the same frame but allows change detection to run\n */\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.resolve().then(() => {\n setNativeFocused(this.elementRef.nativeElement);\n });\n }\n\n @HostListener(`blur`)\n onBlur(): void {\n this.renderer.removeAttribute(this.elementRef.nativeElement, `tabIndex`);\n }\n\n @HostListener(`window:focusin.silent`, [`$event.target`])\n onFocusIn(node: Node): void {\n if (containsOrAfter(this.elementRef.nativeElement, node)) {\n return;\n }\n\n const focusable = tuiGetClosestFocusable(\n this.elementRef.nativeElement,\n false,\n this.elementRef.nativeElement,\n );\n\n if (focusable) {\n setNativeFocused(focusable);\n }\n }\n\n ngOnDestroy(): void {\n blurNativeFocused(this.documentRef);\n\n /**\n * HostListeners are triggered even after ngOnDestroy\n * {@link https://github.com/angular/angular/issues/38100}\n * so we need to delay it but stay in the same sync cycle,\n * therefore using Promise instead of setTimeout\n */\n // eslint-disable-next-line\n Promise.resolve().then(() => {\n // TODO: iframe warning\n if (this.activeElement instanceof HTMLElement) {\n setNativeFocused(this.activeElement);\n }\n });\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFocusTrapDirective} from './focus-trap.directive';\n\n@NgModule({\n declarations: [TuiFocusTrapDirective],\n exports: [TuiFocusTrapDirective],\n})\nexport class TuiFocusTrapModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAiBA;MAOa,qBAAqB,CAAA;AAG9B,IAAA,WAAA,CACuC,WAAqB,EAEvC,UAAmC,EAChB,QAAmB,EAAA;QAHpB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAU;QAEvC,IAAU,CAAA,UAAA,GAAV,UAAU,CAAyB;QAChB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;AAN1C,QAAA,IAAA,CAAA,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAQnE;;;;AAIG;;AAEH,QAAA,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAK;AACxB,YAAA,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACpD,SAAC,CAAC,CAAC;KACN;IAGD,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA,QAAA,CAAU,CAAC,CAAC;KAC5E;AAGD,IAAA,SAAS,CAAC,IAAU,EAAA;QAChB,IAAI,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;YACtD,OAAO;AACV,SAAA;AAED,QAAA,MAAM,SAAS,GAAG,sBAAsB,CACpC,IAAI,CAAC,UAAU,CAAC,aAAa,EAC7B,KAAK,EACL,IAAI,CAAC,UAAU,CAAC,aAAa,CAChC,CAAC;AAEF,QAAA,IAAI,SAAS,EAAE;YAC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BACf,MAAM;2BAAC,UAAU,CAAA;;0BAEjB,MAAM;2BAAC,SAAS,CAAA;4CAcrB,MAAM,EAAA,CAAA;sBADL,YAAY;uBAAC,CAAM,IAAA,CAAA,CAAA;gBAMpB,SAAS,EAAA,CAAA;sBADR,YAAY;uBAAC,CAAuB,qBAAA,CAAA,EAAE,CAAC,CAAA,aAAA,CAAe,CAAC,CAAA;;;MCzC/C,kBAAkB,CAAA;;gHAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;iHAAlB,kBAAkB,EAAA,YAAA,EAAA,CAHZ,qBAAqB,CAAA,EAAA,OAAA,EAAA,CAC1B,qBAAqB,CAAA,EAAA,CAAA,CAAA;iHAEtB,kBAAkB,EAAA,CAAA,CAAA;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACnC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-focus-trap.js","sources":["../../../projects/cdk/directives/focus-trap/focus-trap.directive.ts","../../../projects/cdk/directives/focus-trap/focus-trap.module.ts","../../../projects/cdk/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n HostListener,\n Inject,\n OnDestroy,\n Renderer2,\n} from '@angular/core';\nimport {tuiContainsOrAfter, tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n tuiBlurNativeFocused,\n tuiGetClosestFocusable,\n tuiGetNativeFocused,\n} from '@taiga-ui/cdk/utils/focus';\n\n@Directive({\n selector: `[tuiFocusTrap]`,\n host: {\n tabIndex: `0`,\n },\n})\nexport class TuiFocusTrapDirective implements OnDestroy {\n private readonly activeElement = tuiGetNativeFocused(this.documentRef);\n\n constructor(\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n ) {\n /**\n * This would cause currently focused element to lose focus,\n * but it might cause ExpressionChanged error due to potential HostBinding.\n * Microtask keeps it in the same frame but allows change detection to run\n */\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.resolve().then(() => {\n this.elementRef.nativeElement.focus();\n });\n }\n\n @HostListener(`blur`)\n onBlur(): void {\n this.renderer.removeAttribute(this.elementRef.nativeElement, `tabIndex`);\n }\n\n @HostListener(`window:focusin.silent`, [`$event.target`])\n onFocusIn(node: Node): void {\n const {nativeElement} = this.elementRef;\n\n if (tuiContainsOrAfter(nativeElement, node)) {\n return;\n }\n\n const focusable = tuiGetClosestFocusable({\n initial: nativeElement,\n root: nativeElement,\n });\n\n if (focusable) {\n focusable.focus();\n }\n }\n\n ngOnDestroy(): void {\n tuiBlurNativeFocused(this.documentRef);\n\n /**\n * HostListeners are triggered even after ngOnDestroy\n * {@link https://github.com/angular/angular/issues/38100}\n * so we need to delay it but stay in the same sync cycle,\n * therefore using Promise instead of setTimeout\n */\n // eslint-disable-next-line\n Promise.resolve().then(() => {\n if (tuiIsHTMLElement(this.activeElement)) {\n this.activeElement.focus();\n }\n });\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFocusTrapDirective} from './focus-trap.directive';\n\n@NgModule({\n declarations: [TuiFocusTrapDirective],\n exports: [TuiFocusTrapDirective],\n})\nexport class TuiFocusTrapModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAsBa,qBAAqB,CAAA;AAG9B,IAAA,WAAA,CACuC,WAAqB,EAEvC,UAAmC,EAChB,QAAmB,EAAA;QAHpB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAU;QA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AAA,CAHZ,qBAAqB,CAAA,EAAA,OAAA,EAAA,CAC1B,qBAAqB,CAAA,EAAA,CAAA,CAAA;iHAEtB,kBAAkB,EAAA,CAAA,CAAA;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACnC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -7,7 +7,6 @@ import * as i1 from 'rxjs';
7
7
  * Directive to imitate :focus-visible
8
8
  * (https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible)
9
9
  * in browsers that do not support it
10
- * @dynamic
11
10
  */
12
11
  class TuiFocusVisibleDirective {
13
12
  constructor(tuiFocusVisibleChange) {
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-focus-visible.js","sources":["../../../projects/cdk/directives/focus-visible/focus-visible.directive.ts","../../../projects/cdk/directives/focus-visible/focus-visible.module.ts","../../../projects/cdk/directives/focus-visible/taiga-ui-cdk-directives-focus-visible.ts"],"sourcesContent":["import {Directive, Inject} from '@angular/core';\nimport {TuiDestroyService, TuiFocusVisibleService} from '@taiga-ui/cdk/services';\nimport {Observable} from 'rxjs';\n\n/**\n * Directive to imitate :focus-visible\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible)\n * in browsers that do not support it\n * @dynamic\n */\n@Directive({\n selector: `[tuiFocusVisibleChange]`,\n outputs: [`tuiFocusVisibleChange`],\n providers: [TuiDestroyService, TuiFocusVisibleService],\n})\nexport class TuiFocusVisibleDirective {\n constructor(\n @Inject(TuiFocusVisibleService)\n readonly tuiFocusVisibleChange: Observable<boolean>,\n ) {}\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFocusVisibleDirective} from './focus-visible.directive';\n\n@NgModule({\n declarations: [TuiFocusVisibleDirective],\n exports: [TuiFocusVisibleD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,YAAA,EAAA,CAHf,wBAAwB,CAAA,EAAA,OAAA,EAAA,CAC7B,wBAAwB,CAAA,EAAA,CAAA,CAAA;oHAEzB,qBAAqB,EAAA,CAAA,CAAA;4FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AACtC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-focus-visible.js","sources":["../../../projects/cdk/directives/focus-visible/focus-visible.directive.ts","../../../projects/cdk/directives/focus-visible/focus-visible.module.ts","../../../projects/cdk/directives/focus-visible/taiga-ui-cdk-directives-focus-visible.ts"],"sourcesContent":["import {Directive, Inject} from '@angular/core';\nimport {TuiDestroyService, TuiFocusVisibleService} from '@taiga-ui/cdk/services';\nimport {Observable} from 'rxjs';\n\n/**\n * Directive to imitate :focus-visible\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible)\n * in browsers that do not support it\n */\n@Directive({\n selector: `[tuiFocusVisibleChange]`,\n outputs: [`tuiFocusVisibleChange`],\n providers: [TuiDestroyService, TuiFocusVisibleService],\n})\nexport class TuiFocusVisibleDirective {\n constructor(\n @Inject(TuiFocusVisibleService)\n readonly tuiFocusVisibleChange: Observable<boolean>,\n ) {}\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFocusVisibleDirective} from './focus-visible.directive';\n\n@NgModule({\n declarations: [TuiFocusVisibleDirective],\n exports: [TuiFocusVisibleDirective],\n})\nexport class TuiFocusVisibleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;;;;AAIG;MAMU,wBAAwB,CAAA;AACjC,IAAA,WAAA,CAEa,qBAA0C,EAAA;QAA1C,IAAqB,CAAA,qBAAA,GAArB,qBAAqB,CAAqB;KAC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EAAE,CAAC,wBAAwB,CAAC;oBACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AACtC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, NgZone, Directive, Inject, Output, NgModule } from '@angular/core';
3
- import { typedFromEvent, tuiZoneOptimized } from '@taiga-ui/cdk/observables';
3
+ import { tuiTypedFromEvent, tuiZoneOptimized } from '@taiga-ui/cdk/observables';
4
4
  import { tuiIsNativeFocused } from '@taiga-ui/cdk/utils/focus';
5
5
  import { merge } from 'rxjs';
6
6
  import { map, startWith, distinctUntilChanged, skip } from 'rxjs/operators';
@@ -12,7 +12,7 @@ import { map, startWith, distinctUntilChanged, skip } from 'rxjs/operators';
12
12
  */
13
13
  class TuiFocusedDirective {
14
14
  constructor({ nativeElement }, ngZone) {
15
- this.tuiFocusedChange = merge(typedFromEvent(nativeElement, `focusin`), typedFromEvent(nativeElement, `focusout`)).pipe(map(() => tuiIsNativeFocused(nativeElement)), startWith(false), distinctUntilChanged(), skip(1), tuiZoneOptimized(ngZone));
15
+ this.tuiFocusedChange = merge(tuiTypedFromEvent(nativeElement, `focusin`), tuiTypedFromEvent(nativeElement, `focusout`)).pipe(map(() => tuiIsNativeFocused(nativeElement)), startWith(false), distinctUntilChanged(), skip(1), tuiZoneOptimized(ngZone));
16
16
  }
17
17
  }
18
18
  TuiFocusedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiFocusedDirective, deps: [{ token: ElementRef }, { token: NgZone }], target: i0.ɵɵFactoryTarget.Directive });
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-focused.js","sources":["../../../projects/cdk/directives/focused/focused.directive.ts","../../../projects/cdk/directives/focused/focused.module.ts","../../../projects/cdk/directives/focused/taiga-ui-cdk-directives-focused.ts"],"sourcesContent":["import {Directive, ElementRef, Inject, NgZone, Output} from '@angular/core';\nimport {tuiZoneOptimized, typedFromEvent} from '@taiga-ui/cdk/observables';\nimport {tuiIsNativeFocused} from '@taiga-ui/cdk/utils/focus';\nimport {merge, Observable} from 'rxjs';\nimport {distinctUntilChanged, map, skip, startWith} from 'rxjs/operators';\n\n/**\n * Directive to monitor focus/blur status, works with focusIn/focus-out\n * instead of focus/blur to sync events order with Internet Explorer and\n * other focus related directives that require bubbling\n */\n@Directive({\n selector: `[tuiFocusedChange]`,\n})\nexport class TuiFocusedDirective {\n @Output()\n readonly tuiFocusedChange: Observable<boolean>;\n\n constructor(\n @Inject(ElementRef)\n {nativeElement}: ElementRef<HTMLElement>,\n @Inject(NgZone) ngZone: NgZone,\n ) {\n this.tuiFocusedChange = merge(\n typedFromEvent(nativeElement, `focusin`),\n typedFromEvent(nativeElement, `focusout`),\n ).pipe(\n map(() => tuiIsNativeFocused(nativeElement)),\n startWith(false),\n distinctUntilChanged(),\n skip(1),\n tuiZoneOptimized(ngZone),\n );\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFocusedDirective} from './focused.directive';\n\n@NgModule({\n declarations: [TuiFocusedDirective],\n exports: [TuiFocusedDirective],\n})\nexport class TuiFocusedModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA;;;;AAIG;MAIU,mBAAmB,CAAA;AAI5B,IAAA,WAAA,CAEI,EAAC,aAAa,EAA0B,EACxB,MAAc,EAAA;QAE9B,IAAI,CAAC,gBAAgB,GAAG,KAAK,CACzB,cAAc,CAAC,aAAa,EAAE,CAAS,OAAA,CAAA,CAAC,EACxC,cAAc,CAAC,aAAa,EAAE,CAAU,QAAA,CAAA,CAAC,CAC5C,CAAC,IAAI,CACF,GAAG,CAAC,MAAM,kBAAkB,CAAC,aAAa,CAAC,CAAC,EAC5C,SAAS,CAAC,KAAK,CAAC,EAChB,oBAAoB,EAAE,EACtB,IAAI,CAAC,CAAC,CAAC,EACP,gBAAgB,CAAC,MAAM,CAAC,CAC3B,CAAC;KACL;;iHAnBQ,mBAAmB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAKhB,UAAU,EAAA,EAAA,EAAA,KAAA,EAEV,MAAM,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qGAPT,mBAAmB,EAAA,QAAA,EAAA,oBAAA,EAAA,OAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAoB,kBAAA,CAAA;AACjC,iBAAA,CAAA;;0BAMQ,MAAM;2BAAC,UAAU,CAAA;;0BAEjB,MAAM;2BAAC,MAAM,CAAA;4CALT,gBAAgB,EAAA,CAAA;sBADxB,MAAM;;;MCPE,gBAAgB,CAAA;;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,CAHV,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACxB,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAEpB,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-focused.js","sources":["../../../projects/cdk/directives/focused/focused.directive.ts","../../../projects/cdk/directives/focused/focused.module.ts","../../../projects/cdk/directives/focused/taiga-ui-cdk-directives-focused.ts"],"sourcesContent":["import {Directive, ElementRef, Inject, NgZone, Output} from '@angular/core';\nimport {tuiTypedFromEvent, tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiIsNativeFocused} from '@taiga-ui/cdk/utils/focus';\nimport {merge, Observable} from 'rxjs';\nimport {distinctUntilChanged, map, skip, startWith} from 'rxjs/operators';\n\n/**\n * Directive to monitor focus/blur status, works with focusIn/focus-out\n * instead of focus/blur to sync events order with Internet Explorer and\n * other focus related directives that require bubbling\n */\n@Directive({\n selector: `[tuiFocusedChange]`,\n})\nexport class TuiFocusedDirective {\n @Output()\n readonly tuiFocusedChange: Observable<boolean>;\n\n constructor(\n @Inject(ElementRef)\n {nativeElement}: ElementRef<HTMLElement>,\n @Inject(NgZone) ngZone: NgZone,\n ) {\n this.tuiFocusedChange = merge(\n tuiTypedFromEvent(nativeElement, `focusin`),\n tuiTypedFromEvent(nativeElement, `focusout`),\n ).pipe(\n map(() => tuiIsNativeFocused(nativeElement)),\n startWith(false),\n distinctUntilChanged(),\n skip(1),\n tuiZoneOptimized(ngZone),\n );\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFocusedDirective} from './focused.directive';\n\n@NgModule({\n declarations: [TuiFocusedDirective],\n exports: [TuiFocusedDirective],\n})\nexport class TuiFocusedModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA;;;;AAIG;MAIU,mBAAmB,CAAA;AAI5B,IAAA,WAAA,CAEI,EAAC,aAAa,EAA0B,EACxB,MAAc,EAAA;QAE9B,IAAI,CAAC,gBAAgB,GAAG,KAAK,CACzB,iBAAiB,CAAC,aAAa,EAAE,CAAS,OAAA,CAAA,CAAC,EAC3C,iBAAiB,CAAC,aAAa,EAAE,CAAU,QAAA,CAAA,CAAC,CAC/C,CAAC,IAAI,CACF,GAAG,CAAC,MAAM,kBAAkB,CAAC,aAAa,CAAC,CAAC,EAC5C,SAAS,CAAC,K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/**
6
6
  * Only adds current content if user has High DPI display
7
- * @dynamic
8
7
  */
9
8
  class TuiHighDpiDirective {
10
9
  constructor({ devicePixelRatio }, viewContainer, templateRef) {
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-high-dpi.js","sources":["../../../projects/cdk/directives/high-dpi/high-dpi.directive.ts","../../../projects/cdk/directives/high-dpi/high-dpi.module.ts","../../../projects/cdk/directives/high-dpi/taiga-ui-cdk-directives-high-dpi.ts"],"sourcesContent":["import {Directive, Inject, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\n\n/**\n * Only adds current content if user has High DPI display\n * @dynamic\n */\n@Directive({\n selector: `[tuiHighDpi]`,\n})\nexport class TuiHighDpiDirective {\n constructor(\n @Inject(WINDOW) {devicePixelRatio}: Window,\n @Inject(ViewContainerRef) viewContainer: ViewContainerRef,\n @Inject(TemplateRef) templateRef: TemplateRef<Record<string, unknown>>,\n ) {\n if (devicePixelRatio > 1) {\n viewContainer.createEmbeddedView(templateRef);\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHighDpiDirective} from './high-dpi.directive';\n\n@NgModule({\n declarations: [TuiHighDpiDirective],\n exports: [TuiHighDpiDirective],\n})\nexport class TuiHighDpiModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;AAGG;MAIU,mBAAmB,CAAA;AAC5B,IAAA,WAAA,CACoB,EAAC,gBAAgB,EAAS,EAChB,aAA+B,EACpC,WAAiD,EAAA;QAEtE,IAAI,gBAAgB,GAAG,CAAC,EAAE;AACtB,YAAA,aAAa,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;AACjD,SAAA;KACJ;;AATQ,mBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAEhB,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,MAAM,EACN,EAAA,EAAA,KAAA,EAAA,gBAAgB,aAChB,WAAW,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qGAJd,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAc,YAAA,CAAA;AAC3B,iBAAA,CAAA;0DAG2C,MAAM,EAAA,UAAA,EAAA,CAAA;0BAAzC,MAAM;2BAAC,MAAM,CAAA;;0BACb,MAAM;2BAAC,gBAAgB,CAAA;;0BACvB,MAAM;2BAAC,WAAW,CAAA;;;MCNd,gBAAgB,CAAA;;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,CAHV,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACxB,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAEpB,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-high-dpi.js","sources":["../../../projects/cdk/directives/high-dpi/high-dpi.directive.ts","../../../projects/cdk/directives/high-dpi/high-dpi.module.ts","../../../projects/cdk/directives/high-dpi/taiga-ui-cdk-directives-high-dpi.ts"],"sourcesContent":["import {Directive, Inject, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\n\n/**\n * Only adds current content if user has High DPI display\n */\n@Directive({\n selector: `[tuiHighDpi]`,\n})\nexport class TuiHighDpiDirective {\n constructor(\n @Inject(WINDOW) {devicePixelRatio}: Window,\n @Inject(ViewContainerRef) viewContainer: ViewContainerRef,\n @Inject(TemplateRef) templateRef: TemplateRef<Record<string, unknown>>,\n ) {\n if (devicePixelRatio > 1) {\n viewContainer.createEmbeddedView(templateRef);\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHighDpiDirective} from './high-dpi.directive';\n\n@NgModule({\n declarations: [TuiHighDpiDirective],\n exports: [TuiHighDpiDirective],\n})\nexport class TuiHighDpiModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;AAEG;MAIU,mBAAmB,CAAA;AAC5B,IAAA,WAAA,CACoB,EAAC,gBAAgB,EAAS,EAChB,aAA+B,EACpC,WAAiD,EAAA;QAEtE,IAAI,gBAAgB,GAAG,CAAC,EAAE;AACtB,YAAA,aAAa,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;AACjD,SAAA;KACJ;;AATQ,mBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAEhB,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,MAAM,EACN,EAAA,EAAA,KAAA,EAAA,gBAAgB,aAChB,WAAW,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qGAJd,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAc,YAAA,CAAA;AAC3B,iBAAA,CAAA;0DAG2C,MAAM,EAAA,UAAA,EAAA,CAAA;0BAAzC,MAAM;2BAAC,MAAM,CAAA;;0BACb,MAAM;2BAAC,gBAAgB,CAAA;;0BACvB,MAAM;2BAAC,WAAW,CAAA;;;MCLd,gBAAgB,CAAA;;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,CAHV,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACxB,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAEpB,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -1,18 +1,15 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, NgZone, Injectable, Inject, Directive, NgModule } from '@angular/core';
3
- import { tuiAssertIsElement } from '@taiga-ui/cdk/classes';
4
3
  import { tuiTypedFromEvent, tuiZoneOptimized } from '@taiga-ui/cdk/observables';
4
+ import { tuiIsElement } from '@taiga-ui/cdk/utils';
5
5
  import * as i1 from 'rxjs';
6
6
  import { Observable, merge } from 'rxjs';
7
7
  import { mapTo, filter, distinctUntilChanged } from 'rxjs/operators';
8
8
 
9
9
  function movedOut({ currentTarget, relatedTarget }) {
10
- if (!relatedTarget) {
11
- return true;
12
- }
13
- tuiAssertIsElement(currentTarget);
14
- tuiAssertIsElement(relatedTarget);
15
- return !currentTarget.contains(relatedTarget);
10
+ return (!tuiIsElement(relatedTarget) ||
11
+ !tuiIsElement(currentTarget) ||
12
+ !currentTarget.contains(relatedTarget));
16
13
  }
17
14
  class TuiHoveredService extends Observable {
18
15
  constructor(elementRef, ngZone) {
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-hovered.js","sources":["../../../projects/cdk/directives/hovered/hovered.service.ts","../../../projects/cdk/directives/hovered/hovered.directive.ts","../../../projects/cdk/directives/hovered/hovered.module.ts","../../../projects/cdk/directives/hovered/taiga-ui-cdk-directives-hovered.ts"],"sourcesContent":["import {ElementRef, Inject, Injectable, NgZone} from '@angular/core';\nimport {tuiAssertIsElement} from '@taiga-ui/cdk/classes';\nimport {tuiTypedFromEvent, tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {merge, Observable} from 'rxjs';\nimport {distinctUntilChanged, filter, mapTo} from 'rxjs/operators';\n\nfunction movedOut({currentTarget, relatedTarget}: MouseEvent): boolean {\n if (!relatedTarget) {\n return true;\n }\n\n tuiAssertIsElement(currentTarget);\n tuiAssertIsElement(relatedTarget);\n\n return !currentTarget.contains(relatedTarget);\n}\n\n@Injectable()\nexport class TuiHoveredService extends Observable<boolean> {\n private readonly stream$ = merge(\n tuiTypedFromEvent(this.elementRef.nativeElement, `mouseenter`).pipe(mapTo(true)),\n tuiTypedFromEvent(this.elementRef.nativeElement, `mouseleave`).pipe(mapTo(false)),\n // Hello, Safari\n tuiTypedFromEvent(this.elementRef.nativeElement, `mouseout`).pipe(\n filter(movedOut),\n mapTo(false),\n ),\n ).pipe(distinctUntilChanged(), tuiZoneOptimized(this.ngZone));\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<Element>,\n @Inject(NgZone) private readonly ngZone: NgZone,\n ) {\n super(subscriber => this.stream$.subscribe(subscriber));\n }\n}\n","import {Directive, Inject} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {TuiHoveredService} from './hovered.service';\n\n@Directive({\n selector: `[tuiHoveredChange]`,\n outputs: [`tuiHoveredChange`],\n providers: [TuiHoveredService],\n})\nexport class TuiHoveredDirective {\n constructor(\n @Inject(TuiHoveredService) readonly tuiHoveredChange: Observable<boolean>,\n ) {}\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHoveredDirective} from './hovered.directive';\n\n@NgModule({\n declarations: [TuiHoveredDirective],\n exports: [TuiHoveredDirective],\n})\nexport class TuiHoveredModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAMA,SAAS,QAAQ,CAAC,EAAC,aAAa,EAAE,aAAa,EAAa,EAAA;IACxD,IAAI,CAAC,aAAa,EAAE;AAChB,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;IAED,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAClC,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAElC,IAAA,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AAClD,CAAC;AAGK,MAAO,iBAAkB,SAAQ,UAAmB,CAAA;IAWtD,WACyC,CAAA,UAA+B,EACnC,MAAc,EAAA;AAE/C,QAAA,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QAHnB,IAAU,CAAA,UAAA,GAAV,UAAU,CAAqB;QACnC,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;AAZlC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAC5B,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAY,UAAA,CAAA,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAChF,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAY,UAAA,CAAA,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;;AAEjF,QAAA,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,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EAAE,CAAC,CAAA,gBAAA,CAAkB,CAAC;oBAC7B,SAAS,EAAE,CAAC,iBAAiB,CAAC;AACjC,iBAAA,CAAA;;0BAGQ,MAAM;2BAAC,iBAAiB,CAAA;;;MCJpB,gBAAgB,CAAA;;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,CAHV,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACxB,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAEpB,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-hovered.js","sources":["../../../projects/cdk/directives/hovered/hovered.service.ts","../../../projects/cdk/directives/hovered/hovered.directive.ts","../../../projects/cdk/directives/hovered/hovered.module.ts","../../../projects/cdk/directives/hovered/taiga-ui-cdk-directives-hovered.ts"],"sourcesContent":["import {ElementRef, Inject, Injectable, NgZone} from '@angular/core';\nimport {tuiTypedFromEvent, tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiIsElement} from '@taiga-ui/cdk/utils';\nimport {merge, Observable} from 'rxjs';\nimport {distinctUntilChanged, filter, mapTo} from 'rxjs/operators';\n\nfunction movedOut({currentTarget, relatedTarget}: MouseEvent): boolean {\n return (\n !tuiIsElement(relatedTarget) ||\n !tuiIsElement(currentTarget) ||\n !currentTarget.contains(relatedTarget)\n );\n}\n\n@Injectable()\nexport class TuiHoveredService extends Observable<boolean> {\n private readonly stream$ = merge(\n tuiTypedFromEvent(this.elementRef.nativeElement, `mouseenter`).pipe(mapTo(true)),\n tuiTypedFromEvent(this.elementRef.nativeElement, `mouseleave`).pipe(mapTo(false)),\n // Hello, Safari\n tuiTypedFromEvent(this.elementRef.nativeElement, `mouseout`).pipe(\n filter(movedOut),\n mapTo(false),\n ),\n ).pipe(distinctUntilChanged(), tuiZoneOptimized(this.ngZone));\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<Element>,\n @Inject(NgZone) private readonly ngZone: NgZone,\n ) {\n super(subscriber => this.stream$.subscribe(subscriber));\n }\n}\n","import {Directive, Inject} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {TuiHoveredService} from './hovered.service';\n\n@Directive({\n selector: `[tuiHoveredChange]`,\n outputs: [`tuiHoveredChange`],\n providers: [TuiHoveredService],\n})\nexport class TuiHoveredDirective {\n constructor(\n @Inject(TuiHoveredService) readonly tuiHoveredChange: Observable<boolean>,\n ) {}\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHoveredDirective} from './hovered.directive';\n\n@NgModule({\n declarations: [TuiHoveredDirective],\n exports: [TuiHoveredDirective],\n})\nexport class TuiHoveredModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAMA,SAAS,QAAQ,CAAC,EAAC,aAAa,EAAE,aAAa,EAAa,EAAA;AACxD,IAAA,QACI,CAAC,YAAY,CAAC,aAAa,CAAC;QAC5B,CAAC,YAAY,CAAC,aAAa,CAAC;AAC5B,QAAA,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,EACxC;AACN,CAAC;AAGK,MAAO,iBAAkB,SAAQ,UAAmB,CAAA;IAWtD,WACyC,CAAA,UAA+B,EACnC,MAAc,EAAA;AAE/C,QAAA,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QAHnB,IAAU,CAAA,UAAA,GAAV,UAAU,CAAqB;QACnC,IAAM,CAAA,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CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qGAFpB,mBAAmB,EAAA,QAAA,EAAA,oBAAA,EAAA,OAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,SAAA,EAFjB,CAAC,iBAAiB,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAErB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAoB,kBAAA,CAAA;oBAC9B,OAAO,EAAE,CAAC,CAAA,gBAAA,CAAkB,CAAC;oBAC7B,SAAS,EAAE,CAAC,iBAAiB,CAAC;AACjC,iBAAA,CAAA;;0BAGQ,MAAM;2BAAC,iBAAiB,CAAA;;;MCJpB,gBAAgB,CAAA;;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,CAHV,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACxB,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAEpB,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -3,14 +3,6 @@ import * as i0 from '@angular/core';
3
3
  import { EventEmitter, ElementRef, Directive, Inject, Input, HostBinding, Output, HostListener, NgModule } from '@angular/core';
4
4
  import { tuiDefaultProp, tuiRequiredSetter } from '@taiga-ui/cdk/decorators';
5
5
 
6
- // eslint-disable-next-line @typescript-eslint/naming-convention
7
- function nonNegativeFiniteAssertion(value) {
8
- return isFinite(value) && value >= 0;
9
- }
10
- // eslint-disable-next-line @typescript-eslint/naming-convention
11
- function volumeAssertion(volume) {
12
- return isFinite(volume) && volume >= 0 && volume <= 1;
13
- }
14
6
  class TuiMediaDirective {
15
7
  constructor(elementRef) {
16
8
  this.elementRef = elementRef;
@@ -67,7 +59,7 @@ class TuiMediaDirective {
67
59
  TuiMediaDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMediaDirective, deps: [{ token: ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
68
60
  TuiMediaDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiMediaDirective, selector: "video[tuiMedia], audio[tuiMedia]", inputs: { volume: "volume", playbackRateSetter: ["playbackRate", "playbackRateSetter"], currentTime: "currentTime", paused: "paused" }, outputs: { currentTimeChange: "currentTimeChange", pausedChange: "pausedChange", volumeChange: "volumeChange" }, host: { listeners: { "ended": "onPausedChange(true)", "pause": "onPausedChange(true)", "play": "onPausedChange(false)", "volumechange": "onVolumeChange()", "timeupdate": "onCurrentTimeChange()", "seeking": "onCurrentTimeChange()", "seeked": "onCurrentTimeChange()", "durationchange": "changeDetectionTrigger()" }, properties: { "volume": "this.volume" } }, exportAs: ["tuiMedia"], ngImport: i0 });
69
61
  __decorate([
70
- tuiDefaultProp(volumeAssertion)
62
+ tuiDefaultProp((volume) => isFinite(volume) && volume >= 0 && volume <= 1)
71
63
  ], TuiMediaDirective.prototype, "volume", void 0);
72
64
  __decorate([
73
65
  tuiRequiredSetter(nonNegativeFiniteAssertion)
@@ -127,6 +119,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
127
119
  type: HostListener,
128
120
  args: [`durationchange`]
129
121
  }] } });
122
+ function nonNegativeFiniteAssertion(value) {
123
+ return isFinite(value) && value >= 0;
124
+ }
130
125
 
131
126
  class TuiMediaModule {
132
127
  }
@@ -145,5 +140,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
145
140
  * Generated bundle index. Do not edit.
146
141
  */
147
142
 
148
- export { TuiMediaDirective, TuiMediaModule, nonNegativeFiniteAssertion, volumeAssertion };
143
+ export { TuiMediaDirective, TuiMediaModule };
149
144
  //# sourceMappingURL=taiga-ui-cdk-directives-media.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-media.js","sources":["../../../projects/cdk/directives/media/media.directive.ts","../../../projects/cdk/directives/media/media.module.ts","../../../projects/cdk/directives/media/taiga-ui-cdk-directives-media.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n} from '@angular/core';\nimport {tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk/decorators';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function nonNegativeFiniteAssertion(value: number): boolean {\n return isFinite(value) && value >= 0;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function volumeAssertion(volume: number): boolean {\n return isFinite(volume) && volume >= 0 && volume <= 1;\n}\n\n@Directive({\n selector: `video[tuiMedia], audio[tuiMedia]`,\n exportAs: `tuiMedia`,\n})\nexport class TuiMediaDirective {\n private playbackRate = 1;\n\n @Input()\n @HostBinding(`volume`)\n @tuiDefaultProp(volumeAssertion)\n volume = 1;\n\n @Input(`playbackRate`)\n @tuiRequiredSetter(nonNegativeFiniteAssertion)\n set playbackRateSetter(playbackRate: number) {\n this.updatePlaybackRate(playbackRate);\n }\n\n @Input()\n @tuiRequiredSetter(nonNegativeFiniteAssertion)\n set currentTime(currentTime: number) {\n if (Math.abs(currentTime - this.currentTime) > 0.05) {\n this.elementRef.nativeElement.currentTime = currentTime;\n }\n }\n\n @Input()\n set paused(paused: boolean) {\n if (paused) {\n this.elementRef.nativeElement.pause();\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.elementRef.nativeElement.play();\n this.updatePlaybackRate(this.playbackRate);\n }\n }\n\n @Output()\n readonly currentTimeChange = new EventEmitter<number>();\n\n @Output()\n readonly pausedChange = new EventEmitter<boolean>();\n\n @Output()\n readonly volumeChange = new EventEmitter<number>();\n\n constructor(\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLMediaElement>,\n ) {}\n\n get paused(): boolean {\n return this.elementRef.nativeElement.paused;\n }\n\n get currentTime(): number {\n return this.elementRef.nativeElement.currentTime;\n }\n\n // @bad TODO: Make sure no other events can affect this like network issues etc.\n @HostListener(`ended`, [`true`])\n @HostListener(`pause`, [`true`])\n @HostListener(`play`, [`false`])\n onPausedChange(paused: boolean): void {\n this.pausedChange.emit(paused);\n this.updatePlaybackRate(this.playbackRate);\n }\n\n @HostListener(`volumechange`)\n onVolumeChange(): void {\n this.volume = this.elementRef.nativeElement.volume;\n this.volumeChange.emit(this.volume);\n }\n\n @HostListener(`timeupdate`)\n @HostListener(`seeking`)\n @HostListener(`seeked`)\n onCurrentTimeChange(): void {\n this.currentTimeChange.emit(this.currentTime);\n }\n\n @HostListener(`durationchange`)\n changeDetectionTrigger(): void {\n // @bad TODO: consider if other events need to trigger CD\n }\n\n private updatePlaybackRate(playbackRate: number): void {\n this.playbackRate = playbackRate;\n this.elementRef.nativeElement.playbackRate = this.playbackRate;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiMediaDirective} from './media.directive';\n\n@NgModule({\n declarations: [TuiMediaDirective],\n exports: [TuiMediaDirective],\n})\nexport class TuiMediaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAYA;AACM,SAAU,0BAA0B,CAAC,KAAa,EAAA;IACpD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACzC,CAAC;AAED;AACM,SAAU,eAAe,CAAC,MAAc,EAAA;AAC1C,I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 {"version":3,"file":"taiga-ui-cdk-directives-media.js","sources":["../../../projects/cdk/directives/media/media.directive.ts","../../../projects/cdk/directives/media/media.module.ts","../../../projects/cdk/directives/media/taiga-ui-cdk-directives-media.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n} from '@angular/core';\nimport {tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk/decorators';\n\n@Directive({\n selector: `video[tuiMedia], audio[tuiMedia]`,\n exportAs: `tuiMedia`,\n})\nexport class TuiMediaDirective {\n private playbackRate = 1;\n\n @Input()\n @HostBinding(`volume`)\n @tuiDefaultProp((volume: number) => isFinite(volume) && volume >= 0 && volume <= 1)\n volume = 1;\n\n @Input(`playbackRate`)\n @tuiRequiredSetter(nonNegativeFiniteAssertion)\n set playbackRateSetter(playbackRate: number) {\n this.updatePlaybackRate(playbackRate);\n }\n\n @Input()\n @tuiRequiredSetter(nonNegativeFiniteAssertion)\n set currentTime(currentTime: number) {\n if (Math.abs(currentTime - this.currentTime) > 0.05) {\n this.elementRef.nativeElement.currentTime = currentTime;\n }\n }\n\n @Input()\n set paused(paused: boolean) {\n if (paused) {\n this.elementRef.nativeElement.pause();\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.elementRef.nativeElement.play();\n this.updatePlaybackRate(this.playbackRate);\n }\n }\n\n @Output()\n readonly currentTimeChange = new EventEmitter<number>();\n\n @Output()\n readonly pausedChange = new EventEmitter<boolean>();\n\n @Output()\n readonly volumeChange = new EventEmitter<number>();\n\n constructor(\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLMediaElement>,\n ) {}\n\n get paused(): boolean {\n return this.elementRef.nativeElement.paused;\n }\n\n get currentTime(): number {\n return this.elementRef.nativeElement.currentTime;\n }\n\n // @bad TODO: Make sure no other events can affect this like network issues etc.\n @HostListener(`ended`, [`true`])\n @HostListener(`pause`, [`true`])\n @HostListener(`play`, [`false`])\n onPausedChange(paused: boolean): void {\n this.pausedChange.emit(paused);\n this.updatePlaybackRate(this.playbackRate);\n }\n\n @HostListener(`volumechange`)\n onVolumeChange(): void {\n this.volume = this.elementRef.nativeElement.volume;\n this.volumeChange.emit(this.volume);\n }\n\n @HostListener(`timeupdate`)\n @HostListener(`seeking`)\n @HostListener(`seeked`)\n onCurrentTimeChange(): void {\n this.currentTimeChange.emit(this.currentTime);\n }\n\n @HostListener(`durationchange`)\n changeDetectionTrigger(): void {\n // @bad TODO: consider if other events need to trigger CD\n }\n\n private updatePlaybackRate(playbackRate: number): void {\n this.playbackRate = playbackRate;\n this.elementRef.nativeElement.playbackRate = this.playbackRate;\n }\n}\n\nfunction nonNegativeFiniteAssertion(value: number): boolean {\n return isFinite(value) && value >= 0;\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiMediaDirective} from './media.directive';\n\n@NgModule({\n declarations: [TuiMediaDirective],\n exports: [TuiMediaDirective],\n})\nexport class TuiMediaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAgBa,iBAAiB,CAAA;AA0C1B,IAAA,WAAA,CAEqB,UAAwC,EAAA;QAAxC,IAAU,CAAA,UAAA,GAAV,UAAU,CAA8B;QA3CrD,IAAY,CAAA,YAAA,GAAG,CAAC,CAAC;QAKzB,IAAM,CAAA,MAAA,GAAG,CAAC,CAAC;AA4BF,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,YAAY,EAAU,CAAC;AAG/C,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAW,CAAC;AAG3C,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAU,CAAC;KAK/C;IAnCJ,IAAI,kBAAkB,CAAC,YAAoB,EAAA;AACvC,QAAA,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;KACzC;IAID,IAAI,WAAW,CAAC,WAAmB,EAAA;AAC/B,QAAA,IAAI,IAAI,CAAC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UAAA,CAAA,CAAA;;sBACzB,YAAY;uBAAC,CAAS,OAAA,CAAA,CAAA;;sBACtB,YAAY;uBAAC,CAAQ,MAAA,CAAA,CAAA;gBAMtB,sBAAsB,EAAA,CAAA;sBADrB,YAAY;uBAAC,CAAgB,cAAA,CAAA,CAAA;;AAWlC,SAAS,0BAA0B,CAAC,KAAa,EAAA;IAC7C,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACzC;;MClGa,cAAc,CAAA;;4GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;6GAAd,cAAc,EAAA,YAAA,EAAA,CAHR,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACtB,iBAAiB,CAAA,EAAA,CAAA,CAAA;6GAElB,cAAc,EAAA,CAAA,CAAA;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC/B,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -1,30 +1,29 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, NgZone, Directive, Inject, Input, HostBinding, NgModule } from '@angular/core';
3
- import { typedFromEvent, tuiZonefree } from '@taiga-ui/cdk/observables';
3
+ import { tuiTypedFromEvent, tuiZonefree } from '@taiga-ui/cdk/observables';
4
4
  import { TuiDestroyService } from '@taiga-ui/cdk/services';
5
- import { getScrollParent, canScroll } from '@taiga-ui/cdk/utils/dom';
5
+ import { tuiIsElement, tuiGetScrollParent, tuiCanScroll } from '@taiga-ui/cdk/utils/dom';
6
6
  import { filter, takeUntil, switchMap, tap } from 'rxjs/operators';
7
7
  import * as i1 from 'rxjs';
8
8
 
9
9
  /**
10
10
  * Directive to isolate scrolling, i.e. prevent body scroll behind modal dialog
11
- * @dynamic
12
11
  */
13
12
  class TuiOverscrollDirective {
14
13
  constructor({ nativeElement }, ngZone, destroy$) {
15
14
  this.mode = `scroll`;
16
- typedFromEvent(nativeElement, `wheel`, { passive: false })
15
+ tuiTypedFromEvent(nativeElement, `wheel`, { passive: false })
17
16
  .pipe(filter(() => this.enabled), tuiZonefree(ngZone), takeUntil(destroy$))
18
17
  .subscribe(event => {
19
18
  this.processEvent(event, !!event.deltaY, event.deltaY ? event.deltaY < 0 : event.deltaX < 0);
20
19
  });
21
- typedFromEvent(nativeElement, `touchstart`, { passive: true })
20
+ tuiTypedFromEvent(nativeElement, `touchstart`, { passive: true })
22
21
  .pipe(switchMap(({ touches }) => {
23
22
  let { clientX, clientY } = touches[0];
24
23
  let deltaX = 0;
25
24
  let deltaY = 0;
26
25
  let vertical;
27
- return typedFromEvent(nativeElement, `touchmove`, {
26
+ return tuiTypedFromEvent(nativeElement, `touchmove`, {
28
27
  passive: false,
29
28
  }).pipe(filter(() => this.enabled), tap(event => {
30
29
  // We have to have it in tap instead of subscribe due to variables in closure
@@ -50,29 +49,28 @@ class TuiOverscrollDirective {
50
49
  processEvent(event, vertical, negative) {
51
50
  var _a;
52
51
  const { target, currentTarget, cancelable } = event;
53
- // TODO: iframe warning
54
52
  if (!cancelable ||
55
- !(target instanceof Element) ||
53
+ !tuiIsElement(target) ||
56
54
  ((_a = target) === null || _a === void 0 ? void 0 : _a.type) === `range`) {
57
55
  return;
58
56
  }
59
57
  // This is all what's needed in Chrome/Firefox thanks to CSS overscroll-behavior
60
58
  if (this.mode === `all` &&
61
- ((vertical && !currentTarget.contains(getScrollParent(target))) ||
62
- (!vertical && !currentTarget.contains(getScrollParent(target, false))))) {
59
+ ((vertical && !currentTarget.contains(tuiGetScrollParent(target))) ||
60
+ (!vertical && !currentTarget.contains(tuiGetScrollParent(target, false))))) {
63
61
  event.preventDefault();
64
62
  return;
65
63
  }
66
64
  // This is Safari/IE/Edge fallback
67
65
  if (vertical &&
68
- ((negative && !canScroll(target, currentTarget, true, false)) ||
69
- (!negative && !canScroll(target, currentTarget, true, true)))) {
66
+ ((negative && !tuiCanScroll(target, currentTarget, true, false)) ||
67
+ (!negative && !tuiCanScroll(target, currentTarget, true, true)))) {
70
68
  event.preventDefault();
71
69
  return;
72
70
  }
73
71
  if (!vertical &&
74
- ((negative && !canScroll(target, currentTarget, false, false)) ||
75
- (!negative && !canScroll(target, currentTarget, false, true)))) {
72
+ ((negative && !tuiCanScroll(target, currentTarget, false, false)) ||
73
+ (!negative && !tuiCanScroll(target, currentTarget, false, true)))) {
76
74
  event.preventDefault();
77
75
  }
78
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-overscroll.js","sources":["../../../projects/cdk/directives/overscroll/overscroll.directive.ts","../../../projects/cdk/directives/overscroll/overscroll.module.ts","../../../projects/cdk/directives/overscroll/taiga-ui-cdk-directives-overscroll.ts"],"sourcesContent":["import {Directive, ElementRef, HostBinding, Inject, Input, NgZone} from '@angular/core';\nimport {tuiZonefree, typedFromEvent} from '@taiga-ui/cdk/observables';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {TuiEventWith, TuiOverscrollMode} from '@taiga-ui/cdk/types';\nimport {canScroll, getScrollParent} from '@taiga-ui/cdk/utils/dom';\nimport {Observable} from 'rxjs';\nimport {filter, switchMap, takeUntil, tap} from 'rxjs/operators';\n\n/**\n * Directive to isolate scrolling, i.e. prevent body scroll behind modal dialog\n * @dynamic\n */\n@Directive({\n selector: `[tuiOverscroll]`,\n providers: [TuiDestroyService],\n})\nexport class TuiOverscrollDirective {\n @Input(`tuiOverscroll`)\n mode: TuiOverscrollMode | '' = `scroll`;\n\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n ) {\n typedFromEvent(nativeElement, `wheel`, {passive: false})\n .pipe(\n filter(() => this.enabled),\n tuiZonefree(ngZone),\n takeUntil(destroy$),\n )\n .subscribe(event => {\n this.processEvent(\n event,\n !!event.deltaY,\n event.deltaY ? event.deltaY < 0 : event.deltaX < 0,\n );\n });\n\n typedFromEvent(nativeElement, `touchstart`, {passive: true})\n .pipe(\n switchMap(({touches}) => {\n let {clientX, clientY} = touches[0];\n let deltaX = 0;\n let deltaY = 0;\n let vertical: boolean;\n\n return typedFromEvent(nativeElement, `touchmove`, {\n passive: false,\n }).pipe(\n filter(() => this.enabled),\n tap(event => {\n // We have to have it in tap instead of subscribe due to variables in closure\n const changedTouch = event.changedTouches[0];\n\n deltaX = clientX - changedTouch.clientX;\n deltaY = clientY - changedTouch.clientY;\n clientX = changedTouch.clientX;\n clientY = changedTouch.clientY;\n\n if (vertical === undefined) {\n vertical = Math.abs(deltaY) > Math.abs(deltaX);\n }\n\n this.processEvent(\n event,\n vertical,\n vertical ? deltaY < 0 : deltaX < 0,\n );\n }),\n );\n }),\n tuiZonefree(ngZone),\n takeUntil(destroy$),\n )\n .subscribe();\n }\n\n get enabled(): boolean {\n return this.mode !== `none`;\n }\n\n @HostBinding(`style.overscrollBehavior`)\n get overscrollBehavior(): 'contain' | null {\n return this.enabled ? `contain` : null;\n }\n\n private processEvent(\n event: TuiEventWith<Event, HTMLElement>,\n vertical: boolean,\n negative: boolean,\n ): void {\n const {target, currentTarget, cancelable} = event;\n\n // TODO: iframe warning\n if (\n !cancelable ||\n !(target instanceof Element) ||\n (target as HTMLInputElement)?.type === `range`\n ) {\n return;\n }\n\n // This is all what's needed in Chrome/Firefox thanks to CSS overscroll-behavior\n if (\n this.mode === `all` &&\n ((vertical && !currentTarget.contains(getScrollParent(target))) ||\n (!vertical && !currentTarget.contains(getScrollParent(target, false))))\n ) {\n event.preventDefault();\n\n return;\n }\n\n // This is Safari/IE/Edge fallback\n if (\n vertical &&\n ((negative && !canScroll(target, currentTarget, true, false)) ||\n (!negative && !canScroll(target, currentTarget, true, true)))\n ) {\n event.preventDefault();\n\n return;\n }\n\n if (\n !vertical &&\n ((negative && !canScroll(target, currentTarget, false, false)) ||\n (!negative && !canScroll(target, currentTarget, false, true)))\n ) {\n event.preventDefault();\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiOverscrollDirective} from './overscroll.directive';\n\n@NgModule({\n declarations: [TuiOverscrollDirective],\n exports: [TuiOverscrollDirective],\n})\nexport class TuiOverscrollModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAQA;;;AAGG;MAKU,sBAAsB,CAAA;AAI/B,IAAA,WAAA,CACwB,EAAC,aAAa,EAA0B,EAC5C,MAAc,EACH,QAA0B,EAAA;QALzD,IAAI,CAAA,IAAA,GAA2B,QAAQ,CAAC;QAOpC,cAAc,CAAC,aAAa,EAAE,CAAO,KAAA,CAAA,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,CAAC;aACnD,IAAI,CACD,MAAM,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,EAC1B,WAAW,CAAC,MAAM,CAAC,EACnB,SAAS,CAAC,QAAQ,CAAC,CACtB;aACA,SAAS,CAAC,KAAK,IAAG;AACf,YAAA,IAAI,CAAC,YAAY,CACb,KAAK,EACL,CAAC,CAAC,KAAK,CAAC,MAAM,EACd,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CACrD,CAAC;AACN,SAAC,CAAC,CAAC;QAEP,cAAc,CAAC,aAAa,EAAE,CAAY,UAAA,CAAA,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;aACvD,IAAI,CACD,SAAS,CAAC,CAAC,EAAC,OAAO,EAAC,KAAI;YACpB,IAAI,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACpC,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,IAAI,MAAM,GAAG,CAAC,C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sB,CAAA,EAAA,CAAA,CAAA;kHAEvB,mBAAmB,EAAA,CAAA,CAAA;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,sBAAsB,CAAC;oBACtC,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACpC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-overscroll.js","sources":["../../../projects/cdk/directives/overscroll/overscroll.directive.ts","../../../projects/cdk/directives/overscroll/overscroll.module.ts","../../../projects/cdk/directives/overscroll/taiga-ui-cdk-directives-overscroll.ts"],"sourcesContent":["import {Directive, ElementRef, HostBinding, Inject, Input, NgZone} from '@angular/core';\nimport {tuiTypedFromEvent, tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {TuiEventWith, TuiOverscrollMode} from '@taiga-ui/cdk/types';\nimport {tuiCanScroll, tuiGetScrollParent, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\nimport {Observable} from 'rxjs';\nimport {filter, switchMap, takeUntil, tap} from 'rxjs/operators';\n\n/**\n * Directive to isolate scrolling, i.e. prevent body scroll behind modal dialog\n */\n@Directive({\n selector: `[tuiOverscroll]`,\n providers: [TuiDestroyService],\n})\nexport class TuiOverscrollDirective {\n @Input(`tuiOverscroll`)\n mode: TuiOverscrollMode | '' = `scroll`;\n\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n ) {\n tuiTypedFromEvent(nativeElement, `wheel`, {passive: false})\n .pipe(\n filter(() => this.enabled),\n tuiZonefree(ngZone),\n takeUntil(destroy$),\n )\n .subscribe(event => {\n this.processEvent(\n event,\n !!event.deltaY,\n event.deltaY ? event.deltaY < 0 : event.deltaX < 0,\n );\n });\n\n tuiTypedFromEvent(nativeElement, `touchstart`, {passive: true})\n .pipe(\n switchMap(({touches}) => {\n let {clientX, clientY} = touches[0];\n let deltaX = 0;\n let deltaY = 0;\n let vertical: boolean;\n\n return tuiTypedFromEvent(nativeElement, `touchmove`, {\n passive: false,\n }).pipe(\n filter(() => this.enabled),\n tap(event => {\n // We have to have it in tap instead of subscribe due to variables in closure\n const changedTouch = event.changedTouches[0];\n\n deltaX = clientX - changedTouch.clientX;\n deltaY = clientY - changedTouch.clientY;\n clientX = changedTouch.clientX;\n clientY = changedTouch.clientY;\n\n if (vertical === undefined) {\n vertical = Math.abs(deltaY) > Math.abs(deltaX);\n }\n\n this.processEvent(\n event,\n vertical,\n vertical ? deltaY < 0 : deltaX < 0,\n );\n }),\n );\n }),\n tuiZonefree(ngZone),\n takeUntil(destroy$),\n )\n .subscribe();\n }\n\n get enabled(): boolean {\n return this.mode !== `none`;\n }\n\n @HostBinding(`style.overscrollBehavior`)\n get overscrollBehavior(): 'contain' | null {\n return this.enabled ? `contain` : null;\n }\n\n private processEvent(\n event: TuiEventWith<Event, HTMLElement>,\n vertical: boolean,\n negative: boolean,\n ): void {\n const {target, currentTarget, cancelable} = event;\n\n if (\n !cancelable ||\n !tuiIsElement(target) ||\n (target as HTMLInputElement)?.type === `range`\n ) {\n return;\n }\n\n // This is all what's needed in Chrome/Firefox thanks to CSS overscroll-behavior\n if (\n this.mode === `all` &&\n ((vertical && !currentTarget.contains(tuiGetScrollParent(target))) ||\n (!vertical && !currentTarget.contains(tuiGetScrollParent(target, false))))\n ) {\n event.preventDefault();\n\n return;\n }\n\n // This is Safari/IE/Edge fallback\n if (\n vertical &&\n ((negative && !tuiCanScroll(target, currentTarget, true, false)) ||\n (!negative && !tuiCanScroll(target, currentTarget, true, true)))\n ) {\n event.preventDefault();\n\n return;\n }\n\n if (\n !vertical &&\n ((negative && !tuiCanScroll(target, currentTarget, false, false)) ||\n (!negative && !tuiCanScroll(target, currentTarget, false, true)))\n ) {\n event.preventDefault();\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiOverscrollDirective} from './overscroll.directive';\n\n@NgModule({\n declarations: [TuiOverscrollDirective],\n exports: [TuiOverscrollDirective],\n})\nexport class TuiOverscrollModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAQA;;AAEG;MAKU,sBAAsB,CAAA;AAI/B,IAAA,WAAA,CACwB,EAAC,aAAa,EAA0B,EAC5C,MAAc,EACH,QAA0B,EAAA;QALzD,IAAI,CAAA,IAAA,GAA2B,QAAQ,CAAC;QAOpC,iBAAiB,CAAC,aAAa,EAAE,CAAO,KAAA,CAAA,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,CAAC;aACtD,IAAI,CACD,MAAM,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,EAC1B,WAAW,CAAC,MAAM,CAAC,EACnB,SAAS,CAAC,QAAQ,CAAC,CACtB;aACA,SAAS,CAAC,KAAK,IAAG;AACf,YAAA,IAAI,CAAC,YAAY,CACb,KAAK,EACL,CAAC,CAAC,KAAK,CAAC,MAAM,EACd,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CACrD,CAAC;AACN,SAAC,CAAC,CAAC;QAEP,iBAAiB,CAAC,aAAa,EAAE,CAAY,UAAA,CAAA,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;aAC1D,IAAI,CACD,SAAS,CAAC,CAAC,EAAC,OAAO,EAAC,KAAI;YACpB,IAAI,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACpC,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,IAAI,MAAM,GAAG,CAAC,CAAC;AACf,YAAA,IAAI,QAAiB,CAAC;AAEtB,YAAA,OAAO,iBAAiB,CAAC,aAAa,EAAE,WAAW,EAAE;AACjD,gBAA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BAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,sBAAsB,CAAC;oBACtC,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACpC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -3,7 +3,6 @@ import { Directive, Inject, NgModule } from '@angular/core';
3
3
  import { TuiPanService } from '@taiga-ui/cdk/services';
4
4
  import * as i1 from 'rxjs';
5
5
 
6
- // @dynamic
7
6
  class TuiPanDirective {
8
7
  constructor(tuiPan) {
9
8
  this.tuiPan = tuiPan;
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-pan.js","sources":["../../../projects/cdk/directives/pan/pan.directive.ts","../../../projects/cdk/directives/pan/pan.module.ts","../../../projects/cdk/directives/pan/taiga-ui-cdk-directives-pan.ts"],"sourcesContent":["import {Directive, Inject} from '@angular/core';\nimport {TuiPanService} from '@taiga-ui/cdk/services';\nimport {Observable} from 'rxjs';\n\n// @dynamic\n@Directive({\n selector: `[tuiPan]`,\n outputs: [`tuiPan`],\n providers: [TuiPanService],\n})\nexport class TuiPanDirective {\n constructor(\n @Inject(TuiPanService) readonly tuiPan: Observable<readonly [number, number]>,\n ) {}\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPanDirective} from './pan.directive';\n\n/**\n * @experimental\n */\n@NgModule({\n declarations: [TuiPanDirective],\n exports: [TuiPanDirective],\n})\nexport class TuiPanModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;MAMa,eAAe,CAAA;AACxB,IAAA,WAAA,CACoC,MAA6C,EAAA;QAA7C,IAAM,CAAA,MAAA,GAAN,MAAM,CAAuC;KAC7E;;AAHK,eAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,kBAEZ,aAAa,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;iGAFhB,eAAe,EAAA,QAAA,EAAA,UAAA,EAAA,OAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,SAAA,EAFb,CAAC,aAAa,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAEjB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAU,QAAA,CAAA;oBACpB,OAAO,EAAE,CAAC,CAAA,MAAA,CAAQ,CAAC;oBACnB,SAAS,EAAE,CAAC,aAAa,CAAC;AAC7B,iBAAA,CAAA;;0BAGQ,MAAM;2BAAC,aAAa,CAAA;;;ACR7B;;AAEG;MAKU,YAAY,CAAA;;0GAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;2GAAZ,YAAY,EAAA,YAAA,EAAA,CAHN,eAAe,CAAA,EAAA,OAAA,EAAA,CACpB,eAAe,CAAA,EAAA,CAAA,CAAA;2GAEhB,YAAY,EAAA,CAAA,CAAA;4FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,eAAe,CAAC;oBAC/B,OAAO,EAAE,CAAC,eAAe,CAAC;AAC7B,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-pan.js","sources":["../../../projects/cdk/directives/pan/pan.directive.ts","../../../projects/cdk/directives/pan/pan.module.ts","../../../projects/cdk/directives/pan/taiga-ui-cdk-directives-pan.ts"],"sourcesContent":["import {Directive, Inject} from '@angular/core';\nimport {TuiPanService} from '@taiga-ui/cdk/services';\nimport {Observable} from 'rxjs';\n\n@Directive({\n selector: `[tuiPan]`,\n outputs: [`tuiPan`],\n providers: [TuiPanService],\n})\nexport class TuiPanDirective {\n constructor(\n @Inject(TuiPanService) readonly tuiPan: Observable<readonly [number, number]>,\n ) {}\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPanDirective} from './pan.directive';\n\n/**\n * @experimental\n */\n@NgModule({\n declarations: [TuiPanDirective],\n exports: [TuiPanDirective],\n})\nexport class TuiPanModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MASa,eAAe,CAAA;AACxB,IAAA,WAAA,CACoC,MAA6C,EAAA;QAA7C,IAAM,CAAA,MAAA,GAAN,MAAM,CAAuC;KAC7E;;AAHK,eAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,kBAEZ,aAAa,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;iGAFhB,eAAe,EAAA,QAAA,EAAA,UAAA,EAAA,OAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,SAAA,EAFb,CAAC,aAAa,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAEjB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAU,QAAA,CAAA;oBACpB,OAAO,EAAE,CAAC,CAAA,MAAA,CAAQ,CAAC;oBACnB,SAAS,EAAE,CAAC,aAAa,CAAC;AAC7B,iBAAA,CAAA;;0BAGQ,MAAM;2BAAC,aAAa,CAAA;;;ACP7B;;AAEG;MAKU,YAAY,CAAA;;0GAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;2GAAZ,YAAY,EAAA,YAAA,EAAA,CAHN,eAAe,CAAA,EAAA,OAAA,EAAA,CACpB,eAAe,CAAA,EAAA,CAAA,CAAA;2GAEhB,YAAY,EAAA,CAAA,CAAA;4FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,eAAe,CAAC;oBAC/B,OAAO,EAAE,CAAC,eAAe,CAAC;AAC7B,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
@@ -1,13 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, Directive, Inject, Output, NgModule } from '@angular/core';
3
- import { pressedObservable } from '@taiga-ui/cdk/observables';
3
+ import { tuiPressedObservable } from '@taiga-ui/cdk/observables';
4
4
  import { TUI_TAKE_ONLY_TRUSTED_EVENTS } from '@taiga-ui/cdk/tokens';
5
5
 
6
6
  class TuiPressedDirective {
7
7
  constructor(elementRef, takeOnlyTrustedEvents) {
8
8
  this.elementRef = elementRef;
9
9
  this.takeOnlyTrustedEvents = takeOnlyTrustedEvents;
10
- this.tuiPressedChange = pressedObservable(this.elementRef.nativeElement, {
10
+ this.tuiPressedChange = tuiPressedObservable(this.elementRef.nativeElement, {
11
11
  onlyTrusted: this.takeOnlyTrustedEvents,
12
12
  });
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-pressed.js","sources":["../../../projects/cdk/directives/pressed/pressed.directive.ts","../../../projects/cdk/directives/pressed/pressed.module.ts","../../../projects/cdk/directives/pressed/taiga-ui-cdk-directives-pressed.ts"],"sourcesContent":["import {Directive, ElementRef, Inject, Output} from '@angular/core';\nimport {pressedObservable} from '@taiga-ui/cdk/observables';\nimport {TUI_TAKE_ONLY_TRUSTED_EVENTS} from '@taiga-ui/cdk/tokens';\n\n@Directive({\n selector: `[tuiPressedChange]`,\n})\nexport class TuiPressedDirective {\n @Output()\n readonly tuiPressedChange = pressedObservable(this.elementRef.nativeElement, {\n onlyTrusted: this.takeOnlyTrustedEvents,\n });\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<Element>,\n @Inject(TUI_TAKE_ONLY_TRUSTED_EVENTS)\n private readonly takeOnlyTrustedEvents: boolean,\n ) {}\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPressedDirective} from './pressed.directive';\n\n@NgModule({\n declarations: [TuiPressedDirective],\n exports: [TuiPressedDirective],\n})\nexport class TuiPressedModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAOa,mBAAmB,CAAA;IAM5B,WACyC,CAAA,UAA+B,EAEnD,qBAA8B,EAAA;QAFV,IAAU,CAAA,UAAA,GAAV,UAAU,CAAqB;QAEnD,IAAqB,CAAA,qBAAA,GAArB,qBAAqB,CAAS;QAP1C,IAAgB,CAAA,gBAAA,GAAG,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE;YACzE,WAAW,EAAE,IAAI,CAAC,qBAAqB;AAC1C,SAAA,CAAC,CAAC;KAMC;;iHAVK,mBAAmB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAOhB,UAAU,EAAA,EAAA,EAAA,KAAA,EACV,4BAA4B,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qGAR/B,mBAAmB,EAAA,QAAA,EAAA,oBAAA,EAAA,OAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAoB,kBAAA,CAAA;AACjC,iBAAA,CAAA;;0BAQQ,MAAM;2BAAC,UAAU,CAAA;;0BACjB,MAAM;2BAAC,4BAA4B,CAAA;4CAN/B,gBAAgB,EAAA,CAAA;sBADxB,MAAM;;;MCAE,gBAAgB,CAAA;;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,CAHV,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACxB,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAEpB,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-pressed.js","sources":["../../../projects/cdk/directives/pressed/pressed.directive.ts","../../../projects/cdk/directives/pressed/pressed.module.ts","../../../projects/cdk/directives/pressed/taiga-ui-cdk-directives-pressed.ts"],"sourcesContent":["import {Directive, ElementRef, Inject, Output} from '@angular/core';\nimport {tuiPressedObservable} from '@taiga-ui/cdk/observables';\nimport {TUI_TAKE_ONLY_TRUSTED_EVENTS} from '@taiga-ui/cdk/tokens';\n\n@Directive({\n selector: `[tuiPressedChange]`,\n})\nexport class TuiPressedDirective {\n @Output()\n readonly tuiPressedChange = tuiPressedObservable(this.elementRef.nativeElement, {\n onlyTrusted: this.takeOnlyTrustedEvents,\n });\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<Element>,\n @Inject(TUI_TAKE_ONLY_TRUSTED_EVENTS)\n private readonly takeOnlyTrustedEvents: boolean,\n ) {}\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPressedDirective} from './pressed.directive';\n\n@NgModule({\n declarations: [TuiPressedDirective],\n exports: [TuiPressedDirective],\n})\nexport class TuiPressedModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAOa,mBAAmB,CAAA;IAM5B,WACyC,CAAA,UAA+B,EAEnD,qBAA8B,EAAA;QAFV,IAAU,CAAA,UAAA,GAAV,UAAU,CAAqB;QAEnD,IAAqB,CAAA,qBAAA,GAArB,qBAAqB,CAAS;QAP1C,IAAgB,CAAA,gBAAA,GAAG,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE;YAC5E,WAAW,EAAE,IAAI,CAAC,qBAAqB;AAC1C,SAAA,CAAC,CAAC;KAMC;;iHAVK,mBAAmB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAOhB,UAAU,EAAA,EAAA,EAAA,KAAA,EACV,4BAA4B,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qGAR/B,mBAAmB,EAAA,QAAA,EAAA,oBAAA,EAAA,OAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAoB,kBAAA,CAAA;AACjC,iBAAA,CAAA;;0BAQQ,MAAM;2BAAC,UAAU,CAAA;;0BACjB,MAAM;2BAAC,4BAA4B,CAAA;4CAN/B,gBAAgB,EAAA,CAAA;sBADxB,MAAM;;;MCAE,gBAAgB,CAAA;;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,CAHV,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACxB,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAEpB,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, NgZone, Directive, Inject, Attribute, NgModule } from '@angular/core';
3
- import { tuiZonefree, preventDefault } from '@taiga-ui/cdk/observables';
3
+ import { tuiZonefree, tuiPreventDefault } from '@taiga-ui/cdk/observables';
4
4
  import { TuiDestroyService } from '@taiga-ui/cdk/services';
5
5
  import * as i1 from 'rxjs';
6
6
  import { fromEvent } from 'rxjs';
@@ -9,12 +9,11 @@ import { takeUntil } from 'rxjs/operators';
9
9
  /**
10
10
  * Simple prevent default on event directive when you do not need anything
11
11
  * else on event and do not want to trigger change detection
12
- * @dynamic
13
12
  */
14
13
  class TuiPreventDefaultDirective {
15
14
  constructor({ nativeElement }, ngZone, destroy$, eventName) {
16
15
  fromEvent(nativeElement, eventName, { passive: false })
17
- .pipe(tuiZonefree(ngZone), preventDefault(), takeUntil(destroy$))
16
+ .pipe(tuiZonefree(ngZone), tuiPreventDefault(), takeUntil(destroy$))
18
17
  .subscribe();
19
18
  }
20
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-prevent-default.js","sources":["../../../projects/cdk/directives/prevent-default/prevent-default.directive.ts","../../../projects/cdk/directives/prevent-default/prevent-default.module.ts","../../../projects/cdk/directives/prevent-default/taiga-ui-cdk-directives-prevent-default.ts"],"sourcesContent":["import {Attribute, Directive, ElementRef, Inject, NgZone} from '@angular/core';\nimport {preventDefault, tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {fromEvent, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Simple prevent default on event directive when you do not need anything\n * else on event and do not want to trigger change detection\n * @dynamic\n */\n@Directive({\n selector: `[tuiPreventDefault]`,\n providers: [TuiDestroyService],\n})\nexport class TuiPreventDefaultDirective {\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Attribute(`tuiPreventDefault`) eventName: string,\n ) {\n fromEvent(nativeElement, eventName, {passive: false})\n .pipe(tuiZonefree(ngZone), preventDefault(), takeUntil(destroy$))\n .subscribe();\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPreventDefaultDirective} from './prevent-default.directive';\n\n@NgModule({\n declarations: [TuiPreventDefaultDirective],\n exports: [TuiPreventDefaultDirective],\n})\nexport class TuiPreventDefaultModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAMA;;;;AAIG;MAKU,0BAA0B,CAAA;IACnC,WACwB,CAAA,EAAC,aAAa,EAA0B,EAC5C,MAAc,EACH,QAA0B,EACrB,SAAiB,EAAA;QAEjD,SAAS,CAAC,aAAa,EAAE,SAAS,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,CAAC;AAChD,aAAA,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;AAChE,aAAA,SAAS,EAAE,CAAC;KACpB;;AAVQ,0BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,kBAEvB,UAAU,EAAA,EAAA,EAAA,KAAA,EACV,MAAM,EACN,EAAA,EAAA,KAAA,EAAA,iBAAiB,aACd,CAAmB,iBAAA,CAAA,EAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;4GALzB,0BAA0B,EAAA,QAAA,EAAA,qBAAA,EAAA,SAAA,EAFxB,CAAC,iBAAiB,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAErB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,CAAqB,mBAAA,CAAA;oBAC/B,SAAS,EAAE,CAAC,iBAAiB,CAAC;AACjC,iBAAA,CAAA;;0BAGQ,MAAM;2BAAC,UAAU,CAAA;;0BACjB,MAAM;2BAAC,MAAM,CAAA;;0BACb,MAAM;2BAAC,iBAAiB,CAAA;;0BACxB,SAAS;2BAAC,CAAmB,iBAAA,CAAA,CAAA;;;MCZzB,uBAAuB,CAAA;;qHAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;sHAAvB,uBAAuB,EAAA,YAAA,EAAA,CAHjB,0BAA0B,CAAA,EAAA,OAAA,EAAA,CAC/B,0BAA0B,CAAA,EAAA,CAAA,CAAA;sHAE3B,uBAAuB,EAAA,CAAA,CAAA;4FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,0BAA0B,CAAC;oBAC1C,OAAO,EAAE,CAAC,0BAA0B,CAAC;AACxC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-prevent-default.js","sources":["../../../projects/cdk/directives/prevent-default/prevent-default.directive.ts","../../../projects/cdk/directives/prevent-default/prevent-default.module.ts","../../../projects/cdk/directives/prevent-default/taiga-ui-cdk-directives-prevent-default.ts"],"sourcesContent":["import {Attribute, Directive, ElementRef, Inject, NgZone} from '@angular/core';\nimport {tuiPreventDefault, tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {fromEvent, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Simple prevent default on event directive when you do not need anything\n * else on event and do not want to trigger change detection\n */\n@Directive({\n selector: `[tuiPreventDefault]`,\n providers: [TuiDestroyService],\n})\nexport class TuiPreventDefaultDirective {\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Attribute(`tuiPreventDefault`) eventName: string,\n ) {\n fromEvent(nativeElement, eventName, {passive: false})\n .pipe(tuiZonefree(ngZone), tuiPreventDefault(), takeUntil(destroy$))\n .subscribe();\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPreventDefaultDirective} from './prevent-default.directive';\n\n@NgModule({\n declarations: [TuiPreventDefaultDirective],\n exports: [TuiPreventDefaultDirective],\n})\nexport class TuiPreventDefaultModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAMA;;;AAGG;MAKU,0BAA0B,CAAA;IACnC,WACwB,CAAA,EAAC,aAAa,EAA0B,EAC5C,MAAc,EACH,QAA0B,EACrB,SAAiB,EAAA;QAEjD,SAAS,CAAC,aAAa,EAAE,SAAS,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,CAAC;AAChD,aAAA,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;AACnE,aAAA,SAAS,EAAE,CAAC;KACpB;;AAVQ,0BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,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