@taiga-ui/cdk 4.52.0-canary.ece97e9 → 4.52.0-canary.efbd0d4

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 (266) hide show
  1. package/README.md +1 -1
  2. package/classes/control.d.ts +4 -6
  3. package/constants/used-icons.d.ts +2 -2
  4. package/constants/version.d.ts +1 -1
  5. package/constants/version.js +1 -1
  6. package/date-time/date-fillers.d.ts +5 -5
  7. package/date-time/day-range.d.ts +1 -1
  8. package/date-time/day.d.ts +3 -3
  9. package/date-time/types.d.ts +1 -7
  10. package/directives/active-zone/active-zone.directive.d.ts +0 -2
  11. package/directives/animated/animated.directive.d.ts +1 -3
  12. package/directives/animated/index.d.ts +0 -1
  13. package/directives/auto-focus/autofocus.directive.d.ts +2 -3
  14. package/directives/copy-processor/copy-processor.directive.d.ts +2 -2
  15. package/directives/hovered/hovered.directive.d.ts +1 -2
  16. package/directives/index.d.ts +0 -5
  17. package/directives/media/media.directive.d.ts +8 -12
  18. package/directives/native-validator/native-validator.directive.d.ts +2 -2
  19. package/directives/obscured/obscured.directive.d.ts +4 -4
  20. package/directives/pan/pan.directive.d.ts +1 -2
  21. package/directives/platform/platform.directive.d.ts +2 -2
  22. package/directives/resizer/resizer.directive.d.ts +3 -4
  23. package/directives/swipe/swipe.directive.d.ts +1 -2
  24. package/directives/transitioned/transitioned.directive.d.ts +1 -0
  25. package/directives/value-changes/value-changes.directive.d.ts +2 -2
  26. package/fesm2022/taiga-ui-cdk-classes.mjs +8 -20
  27. package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
  28. package/fesm2022/taiga-ui-cdk-constants.mjs +14 -3
  29. package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
  30. package/fesm2022/taiga-ui-cdk-date-time.mjs +23 -24
  31. package/fesm2022/taiga-ui-cdk-date-time.mjs.map +1 -1
  32. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +12 -17
  33. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
  34. package/fesm2022/taiga-ui-cdk-directives-animated.mjs +23 -72
  35. package/fesm2022/taiga-ui-cdk-directives-animated.mjs.map +1 -1
  36. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +12 -14
  37. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
  38. package/fesm2022/taiga-ui-cdk-directives-control.mjs +3 -4
  39. package/fesm2022/taiga-ui-cdk-directives-control.mjs.map +1 -1
  40. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs +8 -11
  41. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs.map +1 -1
  42. package/fesm2022/taiga-ui-cdk-directives-element.mjs +4 -5
  43. package/fesm2022/taiga-ui-cdk-directives-element.mjs.map +1 -1
  44. package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs +5 -8
  45. package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs.map +1 -1
  46. package/fesm2022/taiga-ui-cdk-directives-font-size.mjs +4 -7
  47. package/fesm2022/taiga-ui-cdk-directives-font-size.mjs.map +1 -1
  48. package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs +3 -4
  49. package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs.map +1 -1
  50. package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +11 -14
  51. package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
  52. package/fesm2022/taiga-ui-cdk-directives-item.mjs +3 -4
  53. package/fesm2022/taiga-ui-cdk-directives-item.mjs.map +1 -1
  54. package/fesm2022/taiga-ui-cdk-directives-media.mjs +33 -58
  55. package/fesm2022/taiga-ui-cdk-directives-media.mjs.map +1 -1
  56. package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs +9 -11
  57. package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs.map +1 -1
  58. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +14 -26
  59. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
  60. package/fesm2022/taiga-ui-cdk-directives-pan.mjs +10 -12
  61. package/fesm2022/taiga-ui-cdk-directives-pan.mjs.map +1 -1
  62. package/fesm2022/taiga-ui-cdk-directives-platform.mjs +9 -12
  63. package/fesm2022/taiga-ui-cdk-directives-platform.mjs.map +1 -1
  64. package/fesm2022/taiga-ui-cdk-directives-resizer.mjs +19 -23
  65. package/fesm2022/taiga-ui-cdk-directives-resizer.mjs.map +1 -1
  66. package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +10 -12
  67. package/fesm2022/taiga-ui-cdk-directives-swipe.mjs.map +1 -1
  68. package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs +8 -15
  69. package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs.map +1 -1
  70. package/fesm2022/taiga-ui-cdk-directives-validator.mjs +4 -5
  71. package/fesm2022/taiga-ui-cdk-directives-validator.mjs.map +1 -1
  72. package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +8 -9
  73. package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs.map +1 -1
  74. package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs +5 -5
  75. package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs.map +1 -1
  76. package/fesm2022/taiga-ui-cdk-directives-with-styles.mjs +3 -3
  77. package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +8 -8
  78. package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
  79. package/fesm2022/taiga-ui-cdk-directives.mjs +0 -5
  80. package/fesm2022/taiga-ui-cdk-directives.mjs.map +1 -1
  81. package/fesm2022/taiga-ui-cdk-observables.mjs +2 -24
  82. package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
  83. package/fesm2022/taiga-ui-cdk-pipes-filter.mjs +3 -4
  84. package/fesm2022/taiga-ui-cdk-pipes-filter.mjs.map +1 -1
  85. package/fesm2022/taiga-ui-cdk-pipes-mapper.mjs +3 -4
  86. package/fesm2022/taiga-ui-cdk-pipes-mapper.mjs.map +1 -1
  87. package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs +5 -5
  88. package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs.map +1 -1
  89. package/fesm2022/taiga-ui-cdk-pipes.mjs +0 -6
  90. package/fesm2022/taiga-ui-cdk-pipes.mjs.map +1 -1
  91. package/fesm2022/taiga-ui-cdk-portals.mjs +16 -16
  92. package/fesm2022/taiga-ui-cdk-portals.mjs.map +1 -1
  93. package/fesm2022/taiga-ui-cdk-tokens.mjs +14 -47
  94. package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
  95. package/fesm2022/taiga-ui-cdk-utils-browser.mjs +2 -3
  96. package/fesm2022/taiga-ui-cdk-utils-browser.mjs.map +1 -1
  97. package/fesm2022/taiga-ui-cdk-utils-di.mjs +45 -4
  98. package/fesm2022/taiga-ui-cdk-utils-di.mjs.map +1 -1
  99. package/fesm2022/taiga-ui-cdk-utils-dom.mjs +2 -74
  100. package/fesm2022/taiga-ui-cdk-utils-dom.mjs.map +1 -1
  101. package/fesm2022/taiga-ui-cdk-utils-focus.mjs +22 -38
  102. package/fesm2022/taiga-ui-cdk-utils-focus.mjs.map +1 -1
  103. package/fesm2022/taiga-ui-cdk-utils-math.mjs +1 -12
  104. package/fesm2022/taiga-ui-cdk-utils-math.mjs.map +1 -1
  105. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +45 -119
  106. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
  107. package/fesm2022/taiga-ui-cdk-utils.mjs +0 -1
  108. package/fesm2022/taiga-ui-cdk-utils.mjs.map +1 -1
  109. package/fesm2022/taiga-ui-cdk.mjs +0 -1
  110. package/fesm2022/taiga-ui-cdk.mjs.map +1 -1
  111. package/index.d.ts +0 -1
  112. package/observables/index.d.ts +0 -2
  113. package/package.json +19 -69
  114. package/pipes/index.d.ts +0 -6
  115. package/pipes/obfuscate/obfuscate.options.d.ts +1 -1
  116. package/portals/portal.d.ts +1 -2
  117. package/schematics/index.d.ts +1 -0
  118. package/schematics/index.js +1 -0
  119. package/schematics/index.js.map +1 -1
  120. package/schematics/ng-add/constants/versions.d.ts +1 -1
  121. package/schematics/ng-add/steps/add-taiga-modules.js +0 -15
  122. package/schematics/ng-add/steps/add-taiga-modules.js.map +1 -1
  123. package/schematics/ng-update/interfaces/html-comment.d.ts +1 -1
  124. package/schematics/ng-update/interfaces/removable-input.d.ts +1 -1
  125. package/schematics/ng-update/interfaces/replacement-attribute-to-directive.d.ts +1 -1
  126. package/schematics/ng-update/interfaces/replacement-attribute-value.d.ts +1 -1
  127. package/schematics/ng-update/interfaces/replacement-attribute.d.ts +1 -1
  128. package/schematics/ng-update/interfaces/replacement-tag.d.ts +1 -1
  129. package/schematics/ng-update/v4/migrate-css-vars/palette.d.ts +4 -4
  130. package/schematics/ng-update/v4/migrate-css-vars/palette.js +4 -4
  131. package/schematics/ng-update/v4/migrate-css-vars/palette.js.map +1 -1
  132. package/schematics/ng-update/v4/steps/migrate-templates.d.ts +2 -2
  133. package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.js +13 -13
  134. package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.js.map +1 -1
  135. package/schematics/ng-update/v5/index.js +2 -0
  136. package/schematics/ng-update/v5/index.js.map +1 -1
  137. package/schematics/ng-update/v5/steps/constants/attrs-to-replace.d.ts +2 -0
  138. package/schematics/ng-update/v5/steps/constants/attrs-to-replace.js +22 -0
  139. package/schematics/ng-update/v5/steps/constants/attrs-to-replace.js.map +1 -0
  140. package/schematics/ng-update/v5/steps/constants/functions.js +1 -6
  141. package/schematics/ng-update/v5/steps/constants/functions.js.map +1 -1
  142. package/schematics/ng-update/v5/steps/migrate-css-variables.d.ts +3 -0
  143. package/schematics/ng-update/v5/steps/migrate-css-variables.js +30 -0
  144. package/schematics/ng-update/v5/steps/migrate-css-variables.js.map +1 -0
  145. package/schematics/ng-update/v5/steps/migrate-templates.d.ts +2 -2
  146. package/schematics/ng-update/v5/steps/migrate-templates.js +6 -0
  147. package/schematics/ng-update/v5/steps/migrate-templates.js.map +1 -1
  148. package/schematics/ng-update/v5/steps/templates/migrate-avatar.d.ts +8 -0
  149. package/schematics/ng-update/v5/steps/templates/migrate-avatar.js +111 -0
  150. package/schematics/ng-update/v5/steps/templates/migrate-avatar.js.map +1 -0
  151. package/schematics/ng-update/v5/steps/templates/migrate-notification.d.ts +8 -0
  152. package/schematics/ng-update/v5/steps/templates/migrate-notification.js +45 -0
  153. package/schematics/ng-update/v5/steps/templates/migrate-notification.js.map +1 -0
  154. package/schematics/utils/run-migration.d.ts +2 -2
  155. package/schematics/utils/run-migration.js +4 -3
  156. package/schematics/utils/run-migration.js.map +1 -1
  157. package/schematics/utils/templates/elements.d.ts +4 -1
  158. package/schematics/utils/templates/elements.js.map +1 -1
  159. package/schematics/utils/templates/ng-component-input-manipulations.d.ts +3 -3
  160. package/tokens/environment.d.ts +0 -13
  161. package/tokens/index.d.ts +0 -2
  162. package/tokens/removed-element.d.ts +0 -3
  163. package/types/index.d.ts +0 -2
  164. package/utils/di/index.d.ts +3 -0
  165. package/utils/dom/index.d.ts +0 -6
  166. package/utils/focus/get-closest-focusable.d.ts +1 -6
  167. package/utils/focus/index.d.ts +4 -6
  168. package/utils/focus/{is-native-keyboard-focusable.d.ts → is-focusable.d.ts} +1 -1
  169. package/utils/index.d.ts +0 -1
  170. package/utils/math/index.d.ts +0 -2
  171. package/utils/miscellaneous/generate-id.d.ts +1 -0
  172. package/utils/miscellaneous/index.d.ts +2 -10
  173. package/utils/miscellaneous/sanitize-text.d.ts +23 -0
  174. package/directives/animated/animated-parent.directive.d.ts +0 -10
  175. package/directives/click-outside/click-outside.directive.d.ts +0 -14
  176. package/directives/click-outside/index.d.ts +0 -1
  177. package/directives/droppable/droppable.directive.d.ts +0 -8
  178. package/directives/droppable/index.d.ts +0 -1
  179. package/directives/let/index.d.ts +0 -2
  180. package/directives/let/let-context.d.ts +0 -11
  181. package/directives/let/let.directive.d.ts +0 -18
  182. package/directives/popover/index.d.ts +0 -1
  183. package/directives/popover/popover.directive.d.ts +0 -14
  184. package/directives/repeat-times/index.d.ts +0 -1
  185. package/directives/repeat-times/repeat-times.directive.d.ts +0 -22
  186. package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +0 -39
  187. package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +0 -1
  188. package/fesm2022/taiga-ui-cdk-directives-droppable.mjs +0 -37
  189. package/fesm2022/taiga-ui-cdk-directives-droppable.mjs.map +0 -1
  190. package/fesm2022/taiga-ui-cdk-directives-let.mjs +0 -53
  191. package/fesm2022/taiga-ui-cdk-directives-let.mjs.map +0 -1
  192. package/fesm2022/taiga-ui-cdk-directives-popover.mjs +0 -32
  193. package/fesm2022/taiga-ui-cdk-directives-popover.mjs.map +0 -1
  194. package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs +0 -61
  195. package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs.map +0 -1
  196. package/fesm2022/taiga-ui-cdk-pipes-animation.mjs +0 -33
  197. package/fesm2022/taiga-ui-cdk-pipes-animation.mjs.map +0 -1
  198. package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs +0 -25
  199. package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs.map +0 -1
  200. package/fesm2022/taiga-ui-cdk-pipes-keys.mjs +0 -24
  201. package/fesm2022/taiga-ui-cdk-pipes-keys.mjs.map +0 -1
  202. package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs +0 -25
  203. package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs.map +0 -1
  204. package/fesm2022/taiga-ui-cdk-pipes-replace.mjs +0 -26
  205. package/fesm2022/taiga-ui-cdk-pipes-replace.mjs.map +0 -1
  206. package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs +0 -24
  207. package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs.map +0 -1
  208. package/fesm2022/taiga-ui-cdk-services.mjs +0 -151
  209. package/fesm2022/taiga-ui-cdk-services.mjs.map +0 -1
  210. package/fesm2022/taiga-ui-cdk-utils-color.mjs +0 -195
  211. package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +0 -1
  212. package/observables/must-be-present.d.ts +0 -5
  213. package/observables/query-list-observable.d.ts +0 -6
  214. package/pipes/animation/animation.pipe.d.ts +0 -13
  215. package/pipes/animation/index.d.ts +0 -1
  216. package/pipes/is-present/index.d.ts +0 -1
  217. package/pipes/is-present/is-present.pipe.d.ts +0 -7
  218. package/pipes/keys/index.d.ts +0 -1
  219. package/pipes/keys/keys.pipe.d.ts +0 -7
  220. package/pipes/repeat-times/index.d.ts +0 -7
  221. package/pipes/replace/index.d.ts +0 -1
  222. package/pipes/replace/replace.pipe.d.ts +0 -7
  223. package/pipes/to-array/index.d.ts +0 -1
  224. package/pipes/to-array/to-array.pipe.d.ts +0 -7
  225. package/services/id.service.d.ts +0 -8
  226. package/services/index.d.ts +0 -4
  227. package/services/popover.service.d.ts +0 -25
  228. package/services/scroll.service.d.ts +0 -13
  229. package/services/theme-color.service.d.ts +0 -18
  230. package/tokens/base-href.d.ts +0 -2
  231. package/tokens/range.d.ts +0 -5
  232. package/types/safe-html.d.ts +0 -2
  233. package/types/values-of.d.ts +0 -1
  234. package/utils/color/get-gradient-data.d.ts +0 -1
  235. package/utils/color/hex-to-rgb.d.ts +0 -1
  236. package/utils/color/hex-to-rgba.d.ts +0 -3
  237. package/utils/color/hsv-to-rgb.d.ts +0 -4
  238. package/utils/color/index.d.ts +0 -9
  239. package/utils/color/parse-color.d.ts +0 -1
  240. package/utils/color/parse-gradient.d.ts +0 -10
  241. package/utils/color/rgb-to-hex.d.ts +0 -1
  242. package/utils/color/rgb-to-hsv.d.ts +0 -1
  243. package/utils/color/rgba-to-hex.d.ts +0 -2
  244. package/utils/dom/get-element-point.d.ts +0 -2
  245. package/utils/dom/is-current-target.d.ts +0 -1
  246. package/utils/dom/is-inside-iframe.d.ts +0 -4
  247. package/utils/dom/is-node-in.d.ts +0 -8
  248. package/utils/dom/retarget-boundary-crossing.d.ts +0 -1
  249. package/utils/dom/value-binding.d.ts +0 -3
  250. package/utils/focus/blur-native-focused.d.ts +0 -4
  251. package/utils/focus/is-native-mouse-focusable.d.ts +0 -1
  252. package/utils/math/to-integer.d.ts +0 -1
  253. package/utils/math/to-radians.d.ts +0 -4
  254. package/utils/miscellaneous/change-date-separator.d.ts +0 -1
  255. package/utils/miscellaneous/create-token.d.ts +0 -9
  256. package/utils/miscellaneous/flat-length.d.ts +0 -6
  257. package/utils/miscellaneous/get-original-array-from-query-list.d.ts +0 -8
  258. package/utils/miscellaneous/is-falsy.d.ts +0 -1
  259. package/utils/miscellaneous/is-valid-url.d.ts +0 -4
  260. package/utils/miscellaneous/uniq-by.d.ts +0 -1
  261. /package/utils/{miscellaneous → di}/directive-binding.d.ts +0 -0
  262. /package/utils/{miscellaneous → di}/provide-options.d.ts +0 -0
  263. /package/utils/{miscellaneous → di}/provide.d.ts +0 -0
  264. /package/utils/focus/{get-native-focused.d.ts → get-focused.d.ts} +0 -0
  265. /package/utils/focus/{is-native-focused-in.d.ts → is-focused-in.d.ts} +0 -0
  266. /package/utils/focus/{is-native-focused.d.ts → is-focused.d.ts} +0 -0
@@ -1,9 +1,7 @@
1
- import { isPlatformServer } from '@angular/common';
1
+ import { isPlatformBrowser } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, ViewContainerRef, afterNextRender, PLATFORM_ID, Directive, ApplicationRef, Renderer2 } from '@angular/core';
4
- import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
5
- import * as i2 from '@ng-web-apis/mutation-observer';
6
- import { provideMutationObserverInit, WaMutationObserver } from '@ng-web-apis/mutation-observer';
3
+ import { inject, ViewContainerRef, afterNextRender, PLATFORM_ID, Directive } from '@angular/core';
4
+ import { tuiInjectElement, tuiIsElement } from '@taiga-ui/cdk/utils/dom';
7
5
 
8
6
  const TUI_ENTER = 'tui-enter';
9
7
  const TUI_LEAVE = 'tui-leave';
@@ -13,37 +11,22 @@ class TuiAnimated {
13
11
  this.renderer = inject(ViewContainerRef)._hostLView?.[11];
14
12
  this.el = tuiInjectElement();
15
13
  afterNextRender(() => this.remove());
16
- if (!this.renderer || isPlatformServer(inject(PLATFORM_ID))) {
17
- return;
18
- }
19
- // delegate is used in Angular Animations renderer
20
- const renderer = this.renderer.delegate || this.renderer;
21
- if (renderer.data[TUI_LEAVE]) {
22
- renderer.data[TUI_LEAVE].push(this.el);
14
+ if (this.renderer && isPlatformBrowser(inject(PLATFORM_ID))) {
15
+ // delegate is used in Angular Animations renderer
16
+ wrap(this.renderer.delegate || this.renderer);
23
17
  }
24
- else {
25
- renderer.data[TUI_LEAVE] = [this.el];
26
- renderer.removeChild = wrap(renderer);
27
- }
28
- }
29
- ngOnDestroy() {
30
- const data = this.renderer?.data || { [TUI_LEAVE]: [] };
31
- setTimeout(() => {
32
- data[TUI_LEAVE] = data[TUI_LEAVE]?.filter((e) => e !== this.el);
33
- });
34
18
  }
35
19
  remove() {
36
20
  if (this.el.isConnected && !this.el.getAnimations?.().length) {
37
21
  this.el.classList.remove(TUI_ENTER);
38
22
  }
39
23
  }
40
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAnimated, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
41
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiAnimated, isStandalone: true, selector: "[tuiAnimated]", host: { listeners: { "animationend.self": "remove()", "animationcancel.self": "remove()" }, classAttribute: "tui-enter" }, ngImport: i0 }); }
24
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiAnimated, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
25
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiAnimated, isStandalone: true, selector: "[tuiAnimated]", host: { listeners: { "animationend.self": "remove()", "animationcancel.self": "remove()" }, classAttribute: "tui-enter" }, ngImport: i0 }); }
42
26
  }
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAnimated, decorators: [{
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiAnimated, decorators: [{
44
28
  type: Directive,
45
29
  args: [{
46
- standalone: true,
47
30
  selector: '[tuiAnimated]',
48
31
  host: {
49
32
  class: TUI_ENTER,
@@ -53,25 +36,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
53
36
  }]
54
37
  }], ctorParameters: () => [] });
55
38
  function wrap(renderer) {
39
+ if (renderer.data[TUI_LEAVE]) {
40
+ return;
41
+ }
56
42
  const { removeChild } = renderer;
57
- const app = inject(ApplicationRef);
58
- return (parent, el, host) => {
59
- const remove = () => removeChild.call(renderer, parent, el, host);
60
- const elements = renderer.data[TUI_LEAVE];
61
- const element = elements.find((leave) => el.contains(leave));
62
- if (!element) {
63
- remove();
43
+ renderer.data[TUI_LEAVE] = true;
44
+ renderer.removeChild = (parent, el, host) => {
45
+ if (!tuiIsElement(el)) {
46
+ removeChild.call(renderer, parent, el, host);
64
47
  return;
65
48
  }
66
- element.classList.remove(TUI_ENTER);
67
- const { length } = element.getAnimations?.() || [];
68
- element.classList.add(TUI_LEAVE);
69
- const animations = element.getAnimations?.() ?? [];
49
+ el.classList.remove(TUI_ENTER);
50
+ const { length } = el.getAnimations?.() || [];
51
+ el.classList.add(TUI_LEAVE);
52
+ const animations = el.getAnimations?.() ?? [];
70
53
  const last = animations[animations.length - 1];
71
54
  const finish = () => {
72
55
  if (!parent || parent.contains(el)) {
73
- remove();
74
- app.tick();
56
+ removeChild.call(renderer, parent, el, host);
75
57
  }
76
58
  };
77
59
  if (animations.length > length && last) {
@@ -79,45 +61,14 @@ function wrap(renderer) {
79
61
  last.oncancel = finish;
80
62
  }
81
63
  else {
82
- remove();
64
+ finish();
83
65
  }
84
66
  };
85
67
  }
86
68
 
87
- class TuiAnimatedParent {
88
- constructor() {
89
- this.el = tuiInjectElement();
90
- this.renderer = inject(Renderer2);
91
- }
92
- handle() {
93
- this.el.classList.remove(TUI_ENTER);
94
- this.renderer.data[TUI_LEAVE] = Array.from(this.el.children);
95
- }
96
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAnimatedParent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
97
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiAnimatedParent, isStandalone: true, selector: "[tuiAnimatedParent]", host: { listeners: { "waMutationObserver": "handle()" } }, providers: [provideMutationObserverInit({ childList: true })], hostDirectives: [{ directive: TuiAnimated }, { directive: i2.WaMutationObserver, outputs: ["waMutationObserver", "waMutationObserver"] }], ngImport: i0 }); }
98
- }
99
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAnimatedParent, decorators: [{
100
- type: Directive,
101
- args: [{
102
- standalone: true,
103
- selector: '[tuiAnimatedParent]',
104
- providers: [provideMutationObserverInit({ childList: true })],
105
- hostDirectives: [
106
- TuiAnimated,
107
- {
108
- directive: WaMutationObserver,
109
- outputs: ['waMutationObserver'],
110
- },
111
- ],
112
- host: {
113
- '(waMutationObserver)': 'handle()',
114
- },
115
- }]
116
- }] });
117
-
118
69
  /**
119
70
  * Generated bundle index. Do not edit.
120
71
  */
121
72
 
122
- export { TUI_ENTER, TUI_LEAVE, TuiAnimated, TuiAnimatedParent };
73
+ export { TUI_ENTER, TUI_LEAVE, TuiAnimated };
123
74
  //# sourceMappingURL=taiga-ui-cdk-directives-animated.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-animated.mjs","sources":["../../../projects/cdk/directives/animated/animated.directive.ts","../../../projects/cdk/directives/animated/animated-parent.directive.ts","../../../projects/cdk/directives/animated/taiga-ui-cdk-directives-animated.ts"],"sourcesContent":["import {isPlatformServer} from '@angular/common';\nimport {\n afterNextRender,\n ApplicationRef,\n Directive,\n inject,\n type OnDestroy,\n PLATFORM_ID,\n type Renderer2,\n ViewContainerRef,\n} from '@angular/core';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\n\nexport const TUI_ENTER = 'tui-enter';\nexport const TUI_LEAVE = 'tui-leave';\n\n@Directive({\n standalone: true,\n selector: '[tuiAnimated]',\n host: {\n class: TUI_ENTER,\n '(animationend.self)': 'remove()',\n '(animationcancel.self)': 'remove()',\n },\n})\nexport class TuiAnimated implements OnDestroy {\n // @ts-ignore https://github.com/angular/angular/blob/main/packages/core/src/render3/interfaces/view.ts#L56\n private readonly renderer = inject(ViewContainerRef)._hostLView?.[11];\n private readonly el = tuiInjectElement();\n\n constructor() {\n afterNextRender(() => this.remove());\n\n if (!this.renderer || isPlatformServer(inject(PLATFORM_ID))) {\n return;\n }\n\n // delegate is used in Angular Animations renderer\n const renderer = this.renderer.delegate || this.renderer;\n\n if (renderer.data[TUI_LEAVE]) {\n renderer.data[TUI_LEAVE].push(this.el);\n } else {\n renderer.data[TUI_LEAVE] = [this.el];\n renderer.removeChild = wrap(renderer);\n }\n }\n\n public ngOnDestroy(): void {\n const data = this.renderer?.data || {[TUI_LEAVE]: []};\n\n setTimeout(() => {\n data[TUI_LEAVE] = data[TUI_LEAVE]?.filter((e: Element) => e !== this.el);\n });\n }\n\n protected remove(): void {\n if (this.el.isConnected && !this.el.getAnimations?.().length) {\n this.el.classList.remove(TUI_ENTER);\n }\n }\n}\n\nfunction wrap(renderer: Renderer2): Renderer2['removeChild'] {\n const {removeChild} = renderer;\n const app = inject(ApplicationRef);\n\n return (parent: Node, el: Node, host?: boolean): void => {\n const remove = (): void => removeChild.call(renderer, parent, el, host);\n const elements: Element[] = renderer.data[TUI_LEAVE];\n const element = elements.find((leave) => el.contains(leave));\n\n if (!element) {\n remove();\n\n return;\n }\n\n element.classList.remove(TUI_ENTER);\n\n const {length} = element.getAnimations?.() || [];\n\n element.classList.add(TUI_LEAVE);\n\n const animations = element.getAnimations?.() ?? [];\n const last = animations[animations.length - 1];\n const finish = (): void => {\n if (!parent || parent.contains(el)) {\n remove();\n app.tick();\n }\n };\n\n if (animations.length > length && last) {\n last.onfinish = finish;\n last.oncancel = finish;\n } else {\n remove();\n }\n };\n}\n","import {Directive, inject, Renderer2} from '@angular/core';\nimport {\n provideMutationObserverInit,\n WaMutationObserver,\n} from '@ng-web-apis/mutation-observer';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {TUI_ENTER, TUI_LEAVE, TuiAnimated} from './animated.directive';\n\n@Directive({\n standalone: true,\n selector: '[tuiAnimatedParent]',\n providers: [provideMutationObserverInit({childList: true})],\n hostDirectives: [\n TuiAnimated,\n {\n directive: WaMutationObserver,\n outputs: ['waMutationObserver'],\n },\n ],\n host: {\n '(waMutationObserver)': 'handle()',\n },\n})\nexport class TuiAnimatedParent {\n private readonly el = tuiInjectElement();\n private readonly renderer = inject(Renderer2);\n\n protected handle(): void {\n this.el.classList.remove(TUI_ENTER);\n this.renderer.data[TUI_LEAVE] = Array.from(this.el.children);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.TuiAnimated"],"mappings":";;;;;;;AAaO,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;MAWZ,WAAW,CAAA;AAKpB,IAAA,WAAA,GAAA;;QAHiB,IAAQ,CAAA,QAAA,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC,UAAU,GAAG,EAAE,CAAC;QACpD,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;QAGpC,eAAe,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;AAEpC,Q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BAAA,EAAA,oBAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAYlD,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAf7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,qBAAqB;oBAC/B,SAAS,EAAE,CAAC,2BAA2B,CAAC,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;AAC3D,oBAAA,cAAc,EAAE;wBACZ,WAAW;AACX,wBAAA;AACI,4BAAA,SAAS,EAAE,kBAAkB;4BAC7B,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAClC,yBAAA;AACJ,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,sBAAsB,EAAE,UAAU;AACrC,qBAAA;AACJ,iBAAA;;;ACvBD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-animated.mjs","sources":["../../../projects/cdk/directives/animated/animated.directive.ts","../../../projects/cdk/directives/animated/taiga-ui-cdk-directives-animated.ts"],"sourcesContent":["import {isPlatformBrowser} from '@angular/common';\nimport {\n afterNextRender,\n Directive,\n inject,\n PLATFORM_ID,\n type Renderer2,\n ViewContainerRef,\n} from '@angular/core';\nimport {tuiInjectElement, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\n\nexport const TUI_ENTER = 'tui-enter';\nexport const TUI_LEAVE = 'tui-leave';\n\n@Directive({\n selector: '[tuiAnimated]',\n host: {\n class: TUI_ENTER,\n '(animationend.self)': 'remove()',\n '(animationcancel.self)': 'remove()',\n },\n})\nexport class TuiAnimated {\n // @ts-ignore https://github.com/angular/angular/blob/main/packages/core/src/render3/interfaces/view.ts#L56\n private readonly renderer = inject(ViewContainerRef)._hostLView?.[11];\n private readonly el = tuiInjectElement();\n\n constructor() {\n afterNextRender(() => this.remove());\n\n if (this.renderer && isPlatformBrowser(inject(PLATFORM_ID))) {\n // delegate is used in Angular Animations renderer\n wrap(this.renderer.delegate || this.renderer);\n }\n }\n\n protected remove(): void {\n if (this.el.isConnected && !this.el.getAnimations?.().length) {\n this.el.classList.remove(TUI_ENTER);\n }\n }\n}\n\nfunction wrap(renderer: Renderer2): void {\n if (renderer.data[TUI_LEAVE]) {\n return;\n }\n\n const {removeChild} = renderer;\n\n renderer.data[TUI_LEAVE] = true;\n\n renderer.removeChild = (parent: Node, el: Node, host?: boolean): void => {\n if (!tuiIsElement(el)) {\n removeChild.call(renderer, parent, el, host);\n\n return;\n }\n\n el.classList.remove(TUI_ENTER);\n\n const {length} = el.getAnimations?.() || [];\n\n el.classList.add(TUI_LEAVE);\n\n const animations = el.getAnimations?.() ?? [];\n const last = animations[animations.length - 1];\n const finish = (): void => {\n if (!parent || parent.contains(el)) {\n removeChild.call(renderer, parent, el, host);\n }\n };\n\n if (animations.length > length && last) {\n last.onfinish = finish;\n last.oncancel = finish;\n } else {\n finish();\n }\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWO,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;MAUZ,WAAW,CAAA;AAKpB,IAAA,WAAA,GAAA;;QAHiB,IAAQ,CAAA,QAAA,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC,UAAU,GAAG,EAAE,CAAC;QACpD,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;QAGpC,eAAe,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;AAEpC,QAAA,IAAI,IAAI,CAAC,QAAQ,IAAI,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE;;YAEzD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC;;;IAI3C,MAAM,GAAA;AACZ,QAAA,IAAI,IAAI,CAAC,EAAE,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,EAAE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AC,GAAG,EAAE,CAAC,aAAa,IAAI,IAAI,EAAE;AAE3C,QAAA,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC;QAE3B,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,IAAI,IAAI,EAAE;QAC7C,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,MAAW;YACtB,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;gBAChC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC;;AAEpD,SAAC;QAED,IAAI,UAAU,CAAC,MAAM,GAAG,MAAM,IAAI,IAAI,EAAE;AACpC,YAAA,IAAI,CAAC,QAAQ,GAAG,MAAM;AACtB,YAAA,IAAI,CAAC,QAAQ,GAAG,MAAM;;aACnB;AACH,YAAA,MAAM,EAAE;;AAEhB,KAAC;AACL;;AChFA;;AAEG;;;;"}
@@ -1,12 +1,13 @@
1
1
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
2
  import * as i0 from '@angular/core';
3
- import { InjectionToken, ElementRef, Renderer2, NgZone, inject, DestroyRef, Input, Directive } from '@angular/core';
3
+ import { InjectionToken, ElementRef, Renderer2, NgZone, inject, DestroyRef, input, Directive } from '@angular/core';
4
4
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
  import { race, timer, throttleTime, map, skipWhile, take } from 'rxjs';
6
6
  import { WA_ANIMATION_FRAME, WA_WINDOW } from '@ng-web-apis/common';
7
7
  import { TUI_IS_IOS } from '@taiga-ui/cdk/tokens';
8
- import { tuiPx, tuiIsPresent, tuiCreateOptions } from '@taiga-ui/cdk/utils';
8
+ import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
9
9
  import { tuiZonefreeScheduler } from '@taiga-ui/cdk/observables';
10
+ import { tuiPx, tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
10
11
 
11
12
  class AbstractTuiAutofocusHandler {
12
13
  constructor(el, options) {
@@ -196,9 +197,13 @@ class TuiAutoFocus {
196
197
  this.handler = inject(TUI_AUTOFOCUS_HANDLER);
197
198
  this.options = inject(TUI_AUTOFOCUS_OPTIONS);
198
199
  this.destroyRef = inject(DestroyRef);
200
+ this.autoFocus = input(undefined, {
201
+ alias: 'tuiAutoFocus',
202
+ transform: coerceBooleanProperty,
203
+ });
199
204
  }
200
205
  ngAfterViewInit() {
201
- if (this.autoFocus) {
206
+ if (this.autoFocus()) {
202
207
  this.focus();
203
208
  }
204
209
  }
@@ -212,23 +217,16 @@ class TuiAutoFocus {
212
217
  .subscribe(() => this.handler.setFocus());
213
218
  }
214
219
  }
215
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAutoFocus, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
216
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.15", type: TuiAutoFocus, isStandalone: true, selector: "[tuiAutoFocus]", inputs: { autoFocus: ["tuiAutoFocus", "autoFocus", coerceBooleanProperty] }, providers: TUI_AUTOFOCUS_PROVIDERS, ngImport: i0 }); }
220
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiAutoFocus, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
221
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiAutoFocus, isStandalone: true, selector: "[tuiAutoFocus]", inputs: { autoFocus: { classPropertyName: "autoFocus", publicName: "tuiAutoFocus", isSignal: true, isRequired: false, transformFunction: null } }, providers: TUI_AUTOFOCUS_PROVIDERS, ngImport: i0 }); }
217
222
  }
218
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAutoFocus, decorators: [{
223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiAutoFocus, decorators: [{
219
224
  type: Directive,
220
225
  args: [{
221
- standalone: true,
222
226
  selector: '[tuiAutoFocus]',
223
227
  providers: TUI_AUTOFOCUS_PROVIDERS,
224
228
  }]
225
- }], propDecorators: { autoFocus: [{
226
- type: Input,
227
- args: [{
228
- alias: 'tuiAutoFocus',
229
- transform: coerceBooleanProperty,
230
- }]
231
- }] } });
229
+ }] });
232
230
 
233
231
  class TuiSynchronousAutofocusHandler extends AbstractTuiAutofocusHandler {
234
232
  setFocus() {
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-auto-focus.mjs","sources":["../../../projects/cdk/directives/auto-focus/handlers/abstract.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/default.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/ios.handler.ts","../../../projects/cdk/directives/auto-focus/autofocus.options.ts","../../../projects/cdk/directives/auto-focus/autofocus.directive.ts","../../../projects/cdk/directives/auto-focus/handlers/sync.handler.ts","../../../projects/cdk/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.ts"],"sourcesContent":["import {type ElementRef} from '@angular/core';\n\nimport {type TuiAutofocusHandler, type TuiAutofocusOptions} from '../autofocus.options';\n\nexport abstract class AbstractTuiAutofocusHandler implements TuiAutofocusHandler {\n constructor(\n protected readonly el: ElementRef<HTMLElement>,\n protected readonly options: TuiAutofocusOptions,\n ) {}\n\n public abstract setFocus(): void;\n\n protected get element(): HTMLElement {\n // TODO: Remove when legacy controls are dropped\n const el = this.el.nativeElement.tagName.includes('-')\n ? this.el.nativeElement.querySelector<HTMLElement>(this.options.query)\n : this.el.nativeElement;\n\n return el || this.el.nativeElement;\n }\n\n protected get isTextFieldElement(): boolean {\n return this.element.matches(this.options.query);\n }\n}\n","import {type ElementRef, type NgZone} from '@angular/core';\nimport {tuiZonefreeScheduler} from '@taiga-ui/cdk/observables';\nimport {map, type Observable, race, skipWhile, take, throttleTime, timer} from 'rxjs';\n\nimport {type TuiAutofocusOptions} from '../autofocus.options';\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TIMEOUT = 1000;\nconst NG_ANIMATION_SELECTOR = '.ng-animating';\n\nexport class TuiDefaultAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n el: ElementRef<HTMLElement>,\n private readonly animationFrame$: Observable<number>,\n private readonly zone: NgZone,\n options: TuiAutofocusOptions,\n ) {\n super(el, options);\n }\n\n public setFocus(): void {\n if (this.isTextFieldElement) {\n race(\n timer(this.options.delay || TIMEOUT),\n this.animationFrame$.pipe(\n throttleTime(100, tuiZonefreeScheduler(this.zone)),\n map(() => this.element.closest(NG_ANIMATION_SELECTOR)),\n skipWhile(Boolean),\n take(1),\n ),\n ).subscribe(() =>\n this.element.focus({preventScroll: this.options.preventScroll}),\n );\n } else {\n this.element.focus({preventScroll: true});\n }\n }\n}\n","import {type ElementRef, type NgZone, type Renderer2} from '@angular/core';\nimport {tuiIsPresent, tuiPx} from '@taiga-ui/cdk/utils';\n\nimport {type TuiAutofocusOptions} from '../autofocus.options';\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TEXTFIELD_ATTRS = [\n 'type',\n 'inputMode',\n 'autocomplete',\n 'accept',\n 'min',\n 'max',\n 'step',\n 'pattern',\n 'size',\n 'maxlength',\n] as const;\n\nexport class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n el: ElementRef<HTMLElement>,\n private readonly renderer: Renderer2,\n private readonly zone: NgZone,\n private readonly win: Window,\n options: TuiAutofocusOptions,\n ) {\n super(el, options);\n }\n\n public setFocus(): void {\n if (this.isTextFieldElement) {\n this.zone.runOutsideAngular(() => this.iosWebkitAutofocus());\n } else {\n this.element.focus({preventScroll: true});\n }\n }\n\n private iosWebkitAutofocus(): void {\n const fakeInput: HTMLInputElement = this.makeFakeInput();\n const duration = this.getDurationTimeBeforeFocus();\n let fakeFocusTimeoutId = 0;\n let elementFocusTimeoutId = 0;\n\n const blurHandler = (): void => fakeInput.focus({preventScroll: true});\n const focusHandler = (): void => {\n clearTimeout(fakeFocusTimeoutId);\n\n fakeFocusTimeoutId = this.win.setTimeout(() => {\n clearTimeout(elementFocusTimeoutId);\n\n fakeInput.removeEventListener('blur', blurHandler);\n fakeInput.removeEventListener('focus', focusHandler);\n\n elementFocusTimeoutId = this.win.setTimeout(() => {\n this.element.focus({preventScroll: this.options.preventScroll});\n fakeInput.remove();\n }, duration);\n });\n };\n\n fakeInput.addEventListener('blur', blurHandler, {once: true});\n fakeInput.addEventListener('focus', focusHandler);\n\n if (this.insideDialog()) {\n this.win.document.body.appendChild(fakeInput);\n } else {\n this.element.parentElement?.appendChild(fakeInput);\n }\n\n fakeInput.focus({preventScroll: true});\n }\n\n /**\n * @note:\n * emulate textfield position in layout with cursor\n * before focus to real textfield element\n *\n * required note:\n * [fakeInput.readOnly = true] ~\n * don't use {readOnly: true} value, it's doesn't work for emulate autofill\n *\n * [fakeInput.style.opacity = 0] ~\n * don't use {opacity: 0}, sometimes it's doesn't work for emulate real input\n *\n * [fakeInput.style.fontSize = 16px] ~\n * disable possible auto zoom\n *\n * [fakeInput.style.top/left] ~\n * emulate position cursor before focus to real textfield element\n */\n private makeFakeInput(): HTMLInputElement {\n const fakeInput: HTMLInputElement = this.renderer.createElement('input');\n const rect: DOMRect = this.element.getBoundingClientRect();\n\n this.patchFakeInputFromFocusableElement(fakeInput);\n\n fakeInput.style.height = tuiPx(rect.height);\n fakeInput.style.width = tuiPx(rect.width / 2);\n fakeInput.style.position = 'fixed';\n fakeInput.style.zIndex = '-99999999';\n fakeInput.style.caretColor = 'transparent';\n fakeInput.style.border = 'none';\n fakeInput.style.outline = 'none';\n fakeInput.style.color = 'transparent';\n fakeInput.style.background = 'transparent';\n fakeInput.style.cursor = 'none';\n fakeInput.style.fontSize = tuiPx(16);\n fakeInput.style.top = tuiPx(rect.top);\n fakeInput.style.left = tuiPx(rect.left);\n\n return fakeInput;\n }\n\n private getDurationTimeBeforeFocus(): number {\n return (\n parseFloat(\n this.win\n .getComputedStyle(this.element)\n .getPropertyValue('--tui-duration'),\n ) || 0\n );\n }\n\n /**\n * @note:\n * unfortunately, in older versions of iOS\n * there is a bug that the fake input cursor\n * will move along with the dialog animation\n * and then that dialog will be shaking\n */\n private insideDialog(): boolean {\n return !!this.element.closest('tui-dialog');\n }\n\n /**\n * @note:\n * inherit basic attributes values from real input\n * for help iOS detect what do you want see on keyboard,\n * for example [inputMode=numeric, autocomplete=cc-number]\n */\n private patchFakeInputFromFocusableElement(fakeInput: HTMLInputElement): void {\n TEXTFIELD_ATTRS.forEach((attr) => {\n const value = this.element.getAttribute(attr);\n\n if (tuiIsPresent(value)) {\n fakeInput.setAttribute(attr, value);\n }\n });\n }\n}\n","import {ElementRef, InjectionToken, NgZone, Renderer2} from '@angular/core';\nimport {WA_ANIMATION_FRAME, WA_WINDOW} from '@ng-web-apis/common';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils';\nimport {type Observable} from 'rxjs';\n\nimport {TuiDefaultAutofocusHandler} from './handlers/default.handler';\nimport {TuiIosAutofocusHandler} from './handlers/ios.handler';\n\nexport interface TuiAutofocusHandler {\n setFocus(): void;\n}\n\nexport interface TuiAutofocusOptions {\n readonly delay: number;\n readonly query: string;\n readonly preventScroll: boolean;\n}\n\nexport const [TUI_AUTOFOCUS_OPTIONS, tuiAutoFocusOptionsProvider] =\n tuiCreateOptions<TuiAutofocusOptions>({\n delay: NaN, // NaN = no delay/sync\n query: 'input, textarea, select, [contenteditable]',\n preventScroll: false,\n });\n\nexport const TUI_AUTOFOCUS_HANDLER = new InjectionToken<TuiAutofocusHandler>(\n ngDevMode ? 'TUI_AUTOFOCUS_HANDLER' : '',\n);\n\nexport const TUI_AUTOFOCUS_PROVIDERS = [\n {\n provide: TUI_AUTOFOCUS_HANDLER,\n deps: [\n ElementRef,\n WA_ANIMATION_FRAME,\n Renderer2,\n NgZone,\n WA_WINDOW,\n TUI_IS_IOS,\n TUI_AUTOFOCUS_OPTIONS,\n ],\n\n // eslint-disable-next-line @typescript-eslint/max-params,max-params\n useFactory: (\n el: ElementRef<HTMLElement>,\n animationFrame$: Observable<number>,\n renderer: Renderer2,\n zone: NgZone,\n win: Window,\n isIos: boolean,\n options: TuiAutofocusOptions,\n ) =>\n isIos\n ? new TuiIosAutofocusHandler(el, renderer, zone, win, options)\n : new TuiDefaultAutofocusHandler(el, animationFrame$, zone, options),\n },\n];\n","import {type BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {type AfterViewInit, DestroyRef, Directive, inject, Input} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {timer} from 'rxjs';\n\nimport {\n TUI_AUTOFOCUS_HANDLER,\n TUI_AUTOFOCUS_OPTIONS,\n TUI_AUTOFOCUS_PROVIDERS,\n} from './autofocus.options';\n\n@Directive({\n standalone: true,\n selector: '[tuiAutoFocus]',\n providers: TUI_AUTOFOCUS_PROVIDERS,\n})\nexport class TuiAutoFocus implements AfterViewInit {\n private readonly handler = inject(TUI_AUTOFOCUS_HANDLER);\n private readonly options = inject(TUI_AUTOFOCUS_OPTIONS);\n private readonly destroyRef = inject(DestroyRef);\n\n @Input({\n alias: 'tuiAutoFocus',\n transform: coerceBooleanProperty,\n })\n public autoFocus: BooleanInput;\n\n public ngAfterViewInit(): void {\n if (this.autoFocus) {\n this.focus();\n }\n }\n\n public focus(): void {\n if (Number.isNaN(this.options.delay)) {\n void Promise.resolve().then(() => this.handler.setFocus());\n } else {\n timer(this.options.delay)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.handler.setFocus());\n }\n }\n}\n","import {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nexport class TuiSynchronousAutofocusHandler extends AbstractTuiAutofocusHandler {\n public setFocus(): void {\n this.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AqB;AACnC,qBAAA;;;ACtBC,MAAO,8BAA+B,SAAQ,2BAA2B,CAAA;IACpE,QAAQ,GAAA;QACX,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAC,aAAa,EAAE,IAAI,EAAC,CAAC;;AAEhD;;ACND;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-auto-focus.mjs","sources":["../../../projects/cdk/directives/auto-focus/handlers/abstract.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/default.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/ios.handler.ts","../../../projects/cdk/directives/auto-focus/autofocus.options.ts","../../../projects/cdk/directives/auto-focus/autofocus.directive.ts","../../../projects/cdk/directives/auto-focus/handlers/sync.handler.ts","../../../projects/cdk/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.ts"],"sourcesContent":["import {type ElementRef} from '@angular/core';\n\nimport {type TuiAutofocusHandler, type TuiAutofocusOptions} from '../autofocus.options';\n\nexport abstract class AbstractTuiAutofocusHandler implements TuiAutofocusHandler {\n constructor(\n protected readonly el: ElementRef<HTMLElement>,\n protected readonly options: TuiAutofocusOptions,\n ) {}\n\n public abstract setFocus(): void;\n\n protected get element(): HTMLElement {\n // TODO: Remove when legacy controls are dropped\n const el = this.el.nativeElement.tagName.includes('-')\n ? this.el.nativeElement.querySelector<HTMLElement>(this.options.query)\n : this.el.nativeElement;\n\n return el || this.el.nativeElement;\n }\n\n protected get isTextFieldElement(): boolean {\n return this.element.matches(this.options.query);\n }\n}\n","import {type ElementRef, type NgZone} from '@angular/core';\nimport {tuiZonefreeScheduler} from '@taiga-ui/cdk/observables';\nimport {map, type Observable, race, skipWhile, take, throttleTime, timer} from 'rxjs';\n\nimport {type TuiAutofocusOptions} from '../autofocus.options';\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TIMEOUT = 1000;\nconst NG_ANIMATION_SELECTOR = '.ng-animating';\n\nexport class TuiDefaultAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n el: ElementRef<HTMLElement>,\n private readonly animationFrame$: Observable<number>,\n private readonly zone: NgZone,\n options: TuiAutofocusOptions,\n ) {\n super(el, options);\n }\n\n public setFocus(): void {\n if (this.isTextFieldElement) {\n race(\n timer(this.options.delay || TIMEOUT),\n this.animationFrame$.pipe(\n throttleTime(100, tuiZonefreeScheduler(this.zone)),\n map(() => this.element.closest(NG_ANIMATION_SELECTOR)),\n skipWhile(Boolean),\n take(1),\n ),\n ).subscribe(() =>\n this.element.focus({preventScroll: this.options.preventScroll}),\n );\n } else {\n this.element.focus({preventScroll: true});\n }\n }\n}\n","import {type ElementRef, type NgZone, type Renderer2} from '@angular/core';\nimport {tuiIsPresent, tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {type TuiAutofocusOptions} from '../autofocus.options';\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TEXTFIELD_ATTRS = [\n 'type',\n 'inputMode',\n 'autocomplete',\n 'accept',\n 'min',\n 'max',\n 'step',\n 'pattern',\n 'size',\n 'maxlength',\n] as const;\n\nexport class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n el: ElementRef<HTMLElement>,\n private readonly renderer: Renderer2,\n private readonly zone: NgZone,\n private readonly win: Window,\n options: TuiAutofocusOptions,\n ) {\n super(el, options);\n }\n\n public setFocus(): void {\n if (this.isTextFieldElement) {\n this.zone.runOutsideAngular(() => this.iosWebkitAutofocus());\n } else {\n this.element.focus({preventScroll: true});\n }\n }\n\n private iosWebkitAutofocus(): void {\n const fakeInput: HTMLInputElement = this.makeFakeInput();\n const duration = this.getDurationTimeBeforeFocus();\n let fakeFocusTimeoutId = 0;\n let elementFocusTimeoutId = 0;\n\n const blurHandler = (): void => fakeInput.focus({preventScroll: true});\n const focusHandler = (): void => {\n clearTimeout(fakeFocusTimeoutId);\n\n fakeFocusTimeoutId = this.win.setTimeout(() => {\n clearTimeout(elementFocusTimeoutId);\n\n fakeInput.removeEventListener('blur', blurHandler);\n fakeInput.removeEventListener('focus', focusHandler);\n\n elementFocusTimeoutId = this.win.setTimeout(() => {\n this.element.focus({preventScroll: this.options.preventScroll});\n fakeInput.remove();\n }, duration);\n });\n };\n\n fakeInput.addEventListener('blur', blurHandler, {once: true});\n fakeInput.addEventListener('focus', focusHandler);\n\n if (this.insideDialog()) {\n this.win.document.body.appendChild(fakeInput);\n } else {\n this.element.parentElement?.appendChild(fakeInput);\n }\n\n fakeInput.focus({preventScroll: true});\n }\n\n /**\n * @note:\n * emulate textfield position in layout with cursor\n * before focus to real textfield element\n *\n * required note:\n * [fakeInput.readOnly = true] ~\n * don't use {readOnly: true} value, it's doesn't work for emulate autofill\n *\n * [fakeInput.style.opacity = 0] ~\n * don't use {opacity: 0}, sometimes it's doesn't work for emulate real input\n *\n * [fakeInput.style.fontSize = 16px] ~\n * disable possible auto zoom\n *\n * [fakeInput.style.top/left] ~\n * emulate position cursor before focus to real textfield element\n */\n private makeFakeInput(): HTMLInputElement {\n const fakeInput: HTMLInputElement = this.renderer.createElement('input');\n const rect: DOMRect = this.element.getBoundingClientRect();\n\n this.patchFakeInputFromFocusableElement(fakeInput);\n\n fakeInput.style.height = tuiPx(rect.height);\n fakeInput.style.width = tuiPx(rect.width / 2);\n fakeInput.style.position = 'fixed';\n fakeInput.style.zIndex = '-99999999';\n fakeInput.style.caretColor = 'transparent';\n fakeInput.style.border = 'none';\n fakeInput.style.outline = 'none';\n fakeInput.style.color = 'transparent';\n fakeInput.style.background = 'transparent';\n fakeInput.style.cursor = 'none';\n fakeInput.style.fontSize = tuiPx(16);\n fakeInput.style.top = tuiPx(rect.top);\n fakeInput.style.left = tuiPx(rect.left);\n\n return fakeInput;\n }\n\n private getDurationTimeBeforeFocus(): number {\n return (\n parseFloat(\n this.win\n .getComputedStyle(this.element)\n .getPropertyValue('--tui-duration'),\n ) || 0\n );\n }\n\n /**\n * @note:\n * unfortunately, in older versions of iOS\n * there is a bug that the fake input cursor\n * will move along with the dialog animation\n * and then that dialog will be shaking\n */\n private insideDialog(): boolean {\n return !!this.element.closest('tui-dialog');\n }\n\n /**\n * @note:\n * inherit basic attributes values from real input\n * for help iOS detect what do you want see on keyboard,\n * for example [inputMode=numeric, autocomplete=cc-number]\n */\n private patchFakeInputFromFocusableElement(fakeInput: HTMLInputElement): void {\n TEXTFIELD_ATTRS.forEach((attr) => {\n const value = this.element.getAttribute(attr);\n\n if (tuiIsPresent(value)) {\n fakeInput.setAttribute(attr, value);\n }\n });\n }\n}\n","import {ElementRef, InjectionToken, NgZone, Renderer2} from '@angular/core';\nimport {WA_ANIMATION_FRAME, WA_WINDOW} from '@ng-web-apis/common';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type Observable} from 'rxjs';\n\nimport {TuiDefaultAutofocusHandler} from './handlers/default.handler';\nimport {TuiIosAutofocusHandler} from './handlers/ios.handler';\n\nexport interface TuiAutofocusHandler {\n setFocus(): void;\n}\n\nexport interface TuiAutofocusOptions {\n readonly delay: number;\n readonly query: string;\n readonly preventScroll: boolean;\n}\n\nexport const [TUI_AUTOFOCUS_OPTIONS, tuiAutoFocusOptionsProvider] =\n tuiCreateOptions<TuiAutofocusOptions>({\n delay: NaN, // NaN = no delay/sync\n query: 'input, textarea, select, [contenteditable]',\n preventScroll: false,\n });\n\nexport const TUI_AUTOFOCUS_HANDLER = new InjectionToken<TuiAutofocusHandler>(\n ngDevMode ? 'TUI_AUTOFOCUS_HANDLER' : '',\n);\n\nexport const TUI_AUTOFOCUS_PROVIDERS = [\n {\n provide: TUI_AUTOFOCUS_HANDLER,\n deps: [\n ElementRef,\n WA_ANIMATION_FRAME,\n Renderer2,\n NgZone,\n WA_WINDOW,\n TUI_IS_IOS,\n TUI_AUTOFOCUS_OPTIONS,\n ],\n // eslint-disable-next-line @typescript-eslint/max-params,max-params\n useFactory: (\n el: ElementRef<HTMLElement>,\n animationFrame$: Observable<number>,\n renderer: Renderer2,\n zone: NgZone,\n win: Window,\n isIos: boolean,\n options: TuiAutofocusOptions,\n ) =>\n isIos\n ? new TuiIosAutofocusHandler(el, renderer, zone, win, options)\n : new TuiDefaultAutofocusHandler(el, animationFrame$, zone, options),\n },\n];\n","import {type BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {type AfterViewInit, DestroyRef, Directive, inject, input} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {timer} from 'rxjs';\n\nimport {\n TUI_AUTOFOCUS_HANDLER,\n TUI_AUTOFOCUS_OPTIONS,\n TUI_AUTOFOCUS_PROVIDERS,\n} from './autofocus.options';\n\n@Directive({\n selector: '[tuiAutoFocus]',\n providers: TUI_AUTOFOCUS_PROVIDERS,\n})\nexport class TuiAutoFocus implements AfterViewInit {\n private readonly handler = inject(TUI_AUTOFOCUS_HANDLER);\n private readonly options = inject(TUI_AUTOFOCUS_OPTIONS);\n private readonly destroyRef = inject(DestroyRef);\n\n public readonly autoFocus = input<BooleanInput, any>(undefined, {\n alias: 'tuiAutoFocus',\n transform: coerceBooleanProperty,\n });\n\n public ngAfterViewInit(): void {\n if (this.autoFocus()) {\n this.focus();\n }\n }\n\n public focus(): void {\n if (Number.isNaN(this.options.delay)) {\n void Promise.resolve().then(() => this.handler.setFocus());\n } else {\n timer(this.options.delay)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.handler.setFocus());\n }\n }\n}\n","import {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nexport class TuiSynchronousAutofocusHandler extends AbstractTuiAutofocusHandler {\n public setFocus(): void {\n this.element.focus({preventScroll: true});\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAIsB,2BAA2B,CAAA;IAC7C,WACuB,CAAA,EAA2B,EAC3B,OAA4B,EAAA;QAD5B,IAAE,CAAA,EAAA,GAAF,EAAE;QACF,IAAO,CAAA,OAAA,GA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= i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNgControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
13
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiNgControl, isStandalone: true, selector: "[tuiControl]", exportAs: ["ngControl"], ngImport: i0 }); }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiNgControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
13
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiNgControl, isStandalone: true, selector: "[tuiControl]", exportAs: ["ngControl"], ngImport: i0 }); }
14
14
  }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNgControl, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiNgControl, decorators: [{
16
16
  type: Directive,
17
17
  args: [{
18
- standalone: true,
19
18
  selector: '[tuiControl]',
20
19
  exportAs: 'ngControl',
21
20
  }]
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-control.mjs","sources":["../../../projects/cdk/directives/control/control.directive.ts","../../../projects/cdk/directives/control/taiga-ui-cdk-directives-control.ts"],"sourcesContent":["import {Directive, inject} from '@angular/core';\nimport {type AbstractControl, NgControl} from '@angular/forms';\n\n@Directive({\n standalone: true,\n selector: '[tuiControl]',\n exportAs: 'ngControl',\n})\nexport class TuiNgControl {\n private readonly ngControl = inject(NgControl);\n\n public get control(): AbstractControl {\n return this.ngControl.control!;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,YAAY,CAAA;AALzB,IAAA,WAAA,GAAA;AAMqB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAKjD;AAHG,IAAA,IAAW,OAAO,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,OAAQ;;+GAJzB,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBALxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,WAAW;AACxB,iBAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-control.mjs","sources":["../../../projects/cdk/directives/control/control.directive.ts","../../../projects/cdk/directives/control/taiga-ui-cdk-directives-control.ts"],"sourcesContent":["import {Directive, inject} from '@angular/core';\nimport {type AbstractControl, NgControl} from '@angular/forms';\n\n@Directive({\n selector: '[tuiControl]',\n exportAs: 'ngControl',\n})\nexport class TuiNgControl {\n private readonly ngControl = inject(NgControl);\n\n public get control(): AbstractControl {\n return this.ngControl.control!;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,YAAY,CAAA;AAJzB,IAAA,WAAA,GAAA;AAKqB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAKjD;AAHG,IAAA,IAAW,OAAO,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,OAAQ;;+GAJzB,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,WAAW;AACxB,iBAAA;;;ACND;;AAEG;;;;"}
@@ -1,35 +1,32 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Input, Directive } from '@angular/core';
2
+ import { inject, input, Directive } from '@angular/core';
3
3
  import { WA_WINDOW } from '@ng-web-apis/common';
4
- import { tuiGetSelectedText } from '@taiga-ui/cdk/utils';
4
+ import { tuiGetSelectedText } from '@taiga-ui/cdk/utils/dom';
5
5
  import { identity } from 'rxjs';
6
6
 
7
7
  class TuiCopyProcessor {
8
8
  constructor() {
9
9
  this.win = inject(WA_WINDOW);
10
- this.tuiCopyProcessor = identity;
10
+ this.tuiCopyProcessor = input(identity);
11
11
  }
12
12
  onCopy(event) {
13
13
  const text = tuiGetSelectedText(this.win);
14
14
  if (text) {
15
- event.clipboardData?.setData('text/plain', this.tuiCopyProcessor(text));
15
+ event.clipboardData?.setData('text/plain', this.tuiCopyProcessor()(text));
16
16
  }
17
17
  }
18
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCopyProcessor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
19
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiCopyProcessor, isStandalone: true, selector: "[tuiCopyProcessor]", inputs: { tuiCopyProcessor: "tuiCopyProcessor" }, host: { listeners: { "copy.prevent": "onCopy($event)" } }, ngImport: i0 }); }
18
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCopyProcessor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
19
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiCopyProcessor, isStandalone: true, selector: "[tuiCopyProcessor]", inputs: { tuiCopyProcessor: { classPropertyName: "tuiCopyProcessor", publicName: "tuiCopyProcessor", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "copy.prevent": "onCopy($event)" } }, ngImport: i0 }); }
20
20
  }
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCopyProcessor, decorators: [{
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCopyProcessor, decorators: [{
22
22
  type: Directive,
23
23
  args: [{
24
- standalone: true,
25
24
  selector: '[tuiCopyProcessor]',
26
25
  host: {
27
26
  '(copy.prevent)': 'onCopy($event)',
28
27
  },
29
28
  }]
30
- }], propDecorators: { tuiCopyProcessor: [{
31
- type: Input
32
- }] } });
29
+ }] });
33
30
 
34
31
  /**
35
32
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-copy-processor.mjs","sources":["../../../projects/cdk/directives/copy-processor/copy-processor.directive.ts","../../../projects/cdk/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.ts"],"sourcesContent":["import {Directive, inject, Input} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiGetSelectedText} from '@taiga-ui/cdk/utils';\nimport {identity} from 'rxjs';\n\n@Directive({\n standalone: true,\n selector: '[tuiCopyProcessor]',\n host: {\n '(copy.prevent)': 'onCopy($event)',\n },\n})\nexport class TuiCopyProcessor {\n private readonly win = inject(WA_WINDOW);\n\n @Input()\n public tuiCopyProcessor: TuiStringHandler<string> = identity;\n\n protected onCopy(event: ClipboardEvent): void {\n const text = tuiGetSelectedText(this.win);\n\n if (text) {\n event.clipboardData?.setData('text/plain', this.tuiCopyProcessor(text));\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAaa,gBAAgB,CAAA;AAP7B,IAAA,WAAA,GAAA;AAQqB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC;QAGjC,IAAgB,CAAA,gBAAA,GAA6B,QAAQ;AAS/D;AAPa,IAAA,MAAM,CAAC,KAAqB,EAAA;QAClC,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC;QAEzC,IAAI,IAAI,EAAE;AACN,YAAA,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;;;+GAVtE,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAP5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,IAAI,EAAE;AACF,wBAAA,gBAAgB,EAAE,gBAAgB;AACrC,qBAAA;AACJ,iBAAA;8BAKU,gBAAgB,EAAA,CAAA;sBADtB;;;AChBL;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-copy-processor.mjs","sources":["../../../projects/cdk/directives/copy-processor/copy-processor.directive.ts","../../../projects/cdk/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.ts"],"sourcesContent":["import {Directive, inject, input} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiGetSelectedText} from '@taiga-ui/cdk/utils/dom';\nimport {identity} from 'rxjs';\n\n@Directive({\n selector: '[tuiCopyProcessor]',\n host: {\n '(copy.prevent)': 'onCopy($event)',\n },\n})\nexport class TuiCopyProcessor {\n private readonly win = inject(WA_WINDOW);\n\n public readonly tuiCopyProcessor = input<TuiStringHandler<string>>(identity);\n\n protected onCopy(event: ClipboardEvent): void {\n const text = tuiGetSelectedText(this.win);\n\n if (text) {\n event.clipboardData?.setData('text/plain', this.tuiCopyProcessor()(text));\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAYa,gBAAgB,CAAA;AAN7B,IAAA,WAAA,GAAA;AAOqB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC;AAExB,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAA2B,QAAQ,CAAC;AAS/E;AAPa,IAAA,MAAM,CAAC,KAAqB,EAAA;QAClC,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC;QAEzC,IAAI,IAAI,EAAE;AACN,YAAA,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,CAAC;;;+GATxE,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,IAAI,EAAE;AACF,wBAAA,gBAAgB,EAAE,gBAAgB;AACrC,qBAAA;AACJ,iBAAA;;;ACXD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, Directive } from '@angular/core';
3
- import { tuiInjectElement } from '@taiga-ui/cdk/utils';
3
+ import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
4
4
 
5
5
  class TuiElement {
6
6
  constructor() {
@@ -21,13 +21,12 @@ class TuiElement {
21
21
  */
22
22
  return new ElementRef(this.nativeElement);
23
23
  }
24
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiElement, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
25
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiElement, isStandalone: true, selector: "[tuiElement]", exportAs: ["elementRef"], ngImport: i0 }); }
24
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiElement, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
25
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiElement, isStandalone: true, selector: "[tuiElement]", exportAs: ["elementRef"], ngImport: i0 }); }
26
26
  }
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiElement, decorators: [{
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiElement, decorators: [{
28
28
  type: Directive,
29
29
  args: [{
30
- standalone: true,
31
30
  selector: '[tuiElement]',
32
31
  exportAs: 'elementRef',
33
32
  }]
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-element.mjs","sources":["../../../projects/cdk/directives/element/element.directive.ts","../../../projects/cdk/directives/element/taiga-ui-cdk-directives-element.ts"],"sourcesContent":["import {Directive, ElementRef} from '@angular/core';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils';\n\n@Directive({\n standalone: true,\n selector: '[tuiElement]',\n exportAs: 'elementRef',\n})\nexport class TuiElement<T extends Element = HTMLElement> implements ElementRef<T> {\n public nativeElement = tuiInjectElement<T>();\n\n constructor() {\n /**\n * @note:\n * Typically, when your constructor is invoked with new,\n * an object is created, its constructor is assigned to\n * the invoked constructor and the object is then assigned\n * to this before executing any operations specified\n * in your constructor method.\n *\n * ERROR TypeError: Class constructor ElementRef cannot be invoked without 'new'\n * https://github.com/taiga-family/taiga-ui/issues/3072\n *\n * This way we can instantiate object creation\n * without additional prototype chain for possible fix bug.\n */\n return new ElementRef<T>(this.nativeElement);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,UAAU,CAAA;AAGnB,IAAA,WAAA,GAAA;QAFO,IAAa,CAAA,aAAA,GAAG,gBAAgB,EAAK;AAGxC;;;;;;;;;;;;;AAaG;AACH,QAAA,OAAO,IAAI,UAAU,CAAI,IAAI,CAAC,aAAa,CAAC;;+GAlBvC,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBALtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACzB,iBAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-element.mjs","sources":["../../../projects/cdk/directives/element/element.directive.ts","../../../projects/cdk/directives/element/taiga-ui-cdk-directives-element.ts"],"sourcesContent":["import {Directive, ElementRef} from '@angular/core';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\n\n@Directive({\n selector: '[tuiElement]',\n exportAs: 'elementRef',\n})\nexport class TuiElement<T extends Element = HTMLElement> implements ElementRef<T> {\n public nativeElement = tuiInjectElement<T>();\n\n constructor() {\n /**\n * @note:\n * Typically, when your constructor is invoked with new,\n * an object is created, its constructor is assigned to\n * the invoked constructor and the object is then assigned\n * to this before executing any operations specified\n * in your constructor method.\n *\n * ERROR TypeError: Class constructor ElementRef cannot be invoked without 'new'\n * https://github.com/taiga-family/taiga-ui/issues/3072\n *\n * This way we can instantiate object creation\n * without additional prototype chain for possible fix bug.\n */\n return new ElementRef<T>(this.nativeElement);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,UAAU,CAAA;AAGnB,IAAA,WAAA,GAAA;QAFO,IAAa,CAAA,aAAA,GAAG,gBAAgB,EAAK;AAGxC;;;;;;;;;;;;;AAaG;AACH,QAAA,OAAO,IAAI,UAAU,CAAI,IAAI,CAAC,aAAa,CAAC;;+GAlBvC,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACzB,iBAAA;;;ACND;;AAEG;;;;"}
@@ -36,23 +36,20 @@ class TuiFocusTrap {
36
36
  onFocusIn(node) {
37
37
  const { firstElementChild } = this.el;
38
38
  if (!tuiContainsOrAfter(this.el, node) && firstElementChild) {
39
- tuiGetClosestFocusable({
40
- initial: firstElementChild,
41
- root: this.el,
42
- })?.focus();
39
+ tuiGetClosestFocusable({ initial: firstElementChild, root: this.el })?.focus();
43
40
  }
44
41
  }
45
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFocusTrap, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
46
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiFocusTrap, isStandalone: true, selector: "[tuiFocusTrap]", host: { attributes: { "tabIndex": "0" }, listeners: { "window:focusin.zoneless": "initialized && onFocusIn($event.target)" } }, ngImport: i0 }); }
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiFocusTrap, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
43
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiFocusTrap, isStandalone: true, selector: "[tuiFocusTrap]", host: { attributes: { "tabIndex": "0" }, listeners: { "window:focusin.zoneless": "initialized && onFocusIn($event.target)", "pointerdown": "$event.currentTarget?.removeAttribute(\"tabindex\")" } }, ngImport: i0 }); }
47
44
  }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFocusTrap, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiFocusTrap, decorators: [{
49
46
  type: Directive,
50
47
  args: [{
51
- standalone: true,
52
48
  selector: '[tuiFocusTrap]',
53
49
  host: {
54
50
  tabIndex: '0',
55
51
  '(window:focusin.zoneless)': 'initialized && onFocusIn($event.target)',
52
+ '(pointerdown)': '$event.currentTarget?.removeAttribute("tabindex")',
56
53
  },
57
54
  }]
58
55
  }], ctorParameters: () => [] });
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-focus-trap.mjs","sources":["../../../projects/cdk/directives/focus-trap/focus-trap.directive.ts","../../../projects/cdk/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {Directive, inject, type OnDestroy} from '@angular/core';\nimport {\n tuiContainsOrAfter,\n tuiInjectElement,\n tuiIsHTMLElement,\n} from '@taiga-ui/cdk/utils/dom';\nimport {tuiGetClosestFocusable, tuiGetFocused} from '@taiga-ui/cdk/utils/focus';\n\n@Directive({\n standalone: true,\n selector: '[tuiFocusTrap]',\n host: {\n tabIndex: '0',\n '(window:focusin.zoneless)': 'initialized && onFocusIn($event.target)',\n },\n})\nexport class TuiFocusTrap implements OnDestroy {\n private readonly doc = inject(DOCUMENT);\n private readonly el = tuiInjectElement();\n private activeElement: Element | null = null;\n protected initialized = false;\n\n constructor() {\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 Promise.resolve().then(() => {\n /**\n * The same event can synchronously close already opened focus trap and open another one.\n * All focus traps have microtask inside its `ngOnDestroy` –\n * they should be resolved before enabling of new focus trap.\n * Don't enable any new event listeners before `initialized` is equal to `true`!\n */\n this.initialized = true;\n this.activeElement = tuiGetFocused(this.doc);\n this.el.focus();\n });\n }\n\n public ngOnDestroy(): void {\n this.initialized = false;\n\n if (tuiIsHTMLElement(this.activeElement)) {\n this.activeElement.focus();\n }\n }\n\n protected onFocusIn(node: Node): void {\n const {firstElementChild} = this.el;\n\n if (!tuiContainsOrAfter(this.el, node) && firstElementChild) {\n tuiGetClosestFocusable({\n initial: firstElementChild,\n root: this.el,\n })?.focus();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAiBa,YAAY,CAAA;AAMrB,IAAA,WAAA,GAAA;AALiB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;QACtB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;QAChC,IAAa,CAAA,aAAA,GAAmB,IAAI;QAClC,IAAW,CAAA,WAAA,GAAG,KAAK;AAGzB;;;;AAIG;AACH,QAAA,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAK;AACxB;;;;;AAKG;AACH,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI;YACvB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC;AAC5C,YAAA,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;AACnB,SAAC,CAAC;;IAGC,WAAW,GAAA;AACd,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK;AAExB,QAAA,IAAI,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;AACtC,YAAA,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;;;AAIxB,IAAA,SAAS,CAAC,IAAU,EAAA;AAC1B,QAAA,MAAM,EAAC,iBAAiB,EAAC,GAAG,IAAI,CAAC,EAAE;AAEnC,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,iBAAiB,EAAE;AACzD,YAAA,sBAAsB,CAAC;AACnB,gBAAA,OAAO,EAAE,iBAAiB;gBAC1B,IAAI,EAAE,IAAI,CAAC,EAAE;aAChB,CAAC,EAAE,KAAK,EAAE;;;+GAxCV,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,GAAA,EAAA,EAAA,SAAA,EAAA,EAAA,yBAAA,EAAA,yCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBARxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE;AACF,wBAAA,QAAQ,EAAE,GAAG;AACb,wBAAA,2BAA2B,EAAE,yCAAyC;AACzE,qBAAA;AACJ,iBAAA;;;AChBD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-focus-trap.mjs","sources":["../../../projects/cdk/directives/focus-trap/focus-trap.directive.ts","../../../projects/cdk/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {Directive, inject, type OnDestroy} from '@angular/core';\nimport {\n tuiContainsOrAfter,\n tuiInjectElement,\n tuiIsHTMLElement,\n} from '@taiga-ui/cdk/utils/dom';\nimport {tuiGetClosestFocusable, tuiGetFocused} from '@taiga-ui/cdk/utils/focus';\n\n@Directive({\n selector: '[tuiFocusTrap]',\n host: {\n tabIndex: '0',\n '(window:focusin.zoneless)': 'initialized && onFocusIn($event.target)',\n '(pointerdown)': '$event.currentTarget?.removeAttribute(\"tabindex\")',\n },\n})\nexport class TuiFocusTrap implements OnDestroy {\n private readonly doc = inject(DOCUMENT);\n private readonly el = tuiInjectElement();\n private activeElement: Element | null = null;\n protected initialized = false;\n\n constructor() {\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 Promise.resolve().then(() => {\n /**\n * The same event can synchronously close already opened focus trap and open another one.\n * All focus traps have microtask inside its `ngOnDestroy` –\n * they should be resolved before enabling of new focus trap.\n * Don't enable any new event listeners before `initialized` is equal to `true`!\n */\n this.initialized = true;\n this.activeElement = tuiGetFocused(this.doc);\n this.el.focus();\n });\n }\n\n public ngOnDestroy(): void {\n this.initialized = false;\n\n if (tuiIsHTMLElement(this.activeElement)) {\n this.activeElement.focus();\n }\n }\n\n protected onFocusIn(node: Node): void {\n const {firstElementChild} = this.el;\n\n if (!tuiContainsOrAfter(this.el, node) && firstElementChild) {\n tuiGetClosestFocusable({initial: firstElementChild, root: this.el})?.focus();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAiBa,YAAY,CAAA;AAMrB,IAAA,WAAA,GAAA;AALiB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;QACtB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;QAChC,IAAa,CAAA,aAAA,GAAmB,IAAI;QAClC,IAAW,CAAA,WAAA,GAAG,KAAK;AAGzB;;;;AAIG;AACH,QAAA,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAK;AACxB;;;;;AAKG;AACH,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI;YACvB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC;AAC5C,YAAA,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;AACnB,SAAC,CAAC;;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_FUNCTION);
17
17
  }
18
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFontSize, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
19
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiFontSize, isStandalone: true, ngImport: i0 }); }
18
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiFontSize, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
19
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiFontSize, isStandalone: true, ngImport: i0 }); }
20
20
  }
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFontSize, decorators: [{
22
- type: Directive,
23
- args: [{
24
- standalone: true,
25
- }]
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiFontSize, decorators: [{
22
+ type: Directive
26
23
  }] });
27
24
 
28
25
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-font-size.mjs","sources":["../../../projects/cdk/directives/font-size/font-size.directive.ts","../../../projects/cdk/directives/font-size/taiga-ui-cdk-directives-font-size.ts"],"sourcesContent":["import {isPlatformBrowser} from '@angular/common';\nimport {DestroyRef, Directive, inject, InjectionToken, PLATFORM_ID} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\nimport {EMPTY_FUNCTION} from '@taiga-ui/cdk/constants';\nimport {tuiFontSizeWatcher} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport const TUI_FONT_SIZE_HANDLER = new InjectionToken<(size: number) => void>(\n ngDevMode ? 'TUI_FONT_SIZE_HANDLER' : '',\n);\n\n@Directive({\n standalone: true,\n})\nexport class TuiFontSize {\n private readonly handler = inject(TUI_FONT_SIZE_HANDLER, {optional: true});\n protected readonly nothing = inject(DestroyRef).onDestroy(\n this.handler &&\n isPlatformBrowser(inject(PLATFORM_ID)) &&\n typeof ResizeObserver !== 'undefined'\n ? tuiFontSizeWatcher(this.handler, inject(WA_WINDOW))\n : EMPTY_FUNCTION,\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMa,MAAA,qBAAqB,GAAG,IAAI,cAAc,CACnD,SAAS,GAAG,uBAAuB,GAAG,EAAE;MAM/B,WAAW,CAAA;AAHxB,IAAA,WAAA,GAAA;QAIqB,IAAO,CAAA,OAAA,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;QACvD,IAAO,CAAA,OAAA,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CACrD,IAAI,CAAC,OAAO;AACR,YAAA,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACtC,OAAO,cAAc,KAAK;cACxB,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC;cAClD,cAAc,CACvB;AACJ;+GATY,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AACnB,iBAAA;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-font-size.mjs","sources":["../../../projects/cdk/directives/font-size/font-size.directive.ts","../../../projects/cdk/directives/font-size/taiga-ui-cdk-directives-font-size.ts"],"sourcesContent":["import {isPlatformBrowser} from '@angular/common';\nimport {DestroyRef, Directive, inject, InjectionToken, PLATFORM_ID} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\nimport {EMPTY_FUNCTION} from '@taiga-ui/cdk/constants';\nimport {tuiFontSizeWatcher} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport const TUI_FONT_SIZE_HANDLER = new InjectionToken<(size: number) => void>(\n ngDevMode ? 'TUI_FONT_SIZE_HANDLER' : '',\n);\n\n@Directive()\nexport class TuiFontSize {\n private readonly handler = inject(TUI_FONT_SIZE_HANDLER, {optional: true});\n protected readonly nothing = inject(DestroyRef).onDestroy(\n this.handler &&\n isPlatformBrowser(inject(PLATFORM_ID)) &&\n typeof ResizeObserver !== 'undefined'\n ? tuiFontSizeWatcher(this.handler, inject(WA_WINDOW))\n : EMPTY_FUNCTION,\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMa,MAAA,qBAAqB,GAAG,IAAI,cAAc,CACnD,SAAS,GAAG,uBAAuB,GAAG,EAAE;MAI/B,WAAW,CAAA;AADxB,IAAA,WAAA,GAAA;QAEqB,IAAO,CAAA,OAAA,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;QACvD,IAAO,CAAA,OAAA,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CACrD,IAAI,CAAC,OAAO;AACR,YAAA,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACtC,OAAO,cAAc,KAAK;cACxB,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC;cAClD,cAAc,CACvB;AACJ;+GATY,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBADvB;;;ACVD;;AAEG;;;;"}
@@ -10,13 +10,12 @@ class TuiHighDpi {
10
10
  this.ref = inject(WA_WINDOW).devicePixelRatio > 1 &&
11
11
  inject(ViewContainerRef).createEmbeddedView(inject(TemplateRef));
12
12
  }
13
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHighDpi, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
14
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHighDpi, isStandalone: true, selector: "[tuiHighDpi]", ngImport: i0 }); }
13
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiHighDpi, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
14
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiHighDpi, isStandalone: true, selector: "[tuiHighDpi]", ngImport: i0 }); }
15
15
  }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHighDpi, decorators: [{
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiHighDpi, decorators: [{
17
17
  type: Directive,
18
18
  args: [{
19
- standalone: true,
20
19
  selector: '[tuiHighDpi]',
21
20
  }]
22
21
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-high-dpi.mjs","sources":["../../../projects/cdk/directives/high-dpi/high-dpi.directive.ts","../../../projects/cdk/directives/high-dpi/taiga-ui-cdk-directives-high-dpi.ts"],"sourcesContent":["import {Directive, inject, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\n\n/**\n * Only adds current content if user has High DPI display\n */\n@Directive({\n standalone: true,\n selector: '[tuiHighDpi]',\n})\nexport class TuiHighDpi {\n protected readonly ref =\n inject(WA_WINDOW).devicePixelRatio > 1 &&\n inject(ViewContainerRef).createEmbeddedView(inject(TemplateRef));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;AAEG;MAKU,UAAU,CAAA;AAJvB,IAAA,WAAA,GAAA;QAKuB,IAAG,CAAA,GAAA,GAClB,MAAM,CAAC,SAAS,CAAC,CAAC,gBAAgB,GAAG,CAAC;YACtC,MAAM,CAAC,gBAAgB,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACvE;+GAJY,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;AAC3B,iBAAA;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-high-dpi.mjs","sources":["../../../projects/cdk/directives/high-dpi/high-dpi.directive.ts","../../../projects/cdk/directives/high-dpi/taiga-ui-cdk-directives-high-dpi.ts"],"sourcesContent":["import {Directive, inject, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {WA_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 TuiHighDpi {\n protected readonly ref =\n inject(WA_WINDOW).devicePixelRatio > 1 &&\n inject(ViewContainerRef).createEmbeddedView(inject(TemplateRef));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;AAEG;MAIU,UAAU,CAAA;AAHvB,IAAA,WAAA,GAAA;QAIuB,IAAG,CAAA,GAAA,GAClB,MAAM,CAAC,SAAS,CAAC,CAAC,gBAAgB,GAAG,CAAC;YACtC,MAAM,CAAC,gBAAgB,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACvE;+GAJY,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAHtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,cAAc;AAC3B,iBAAA;;;ACRD;;AAEG;;;;"}