@taiga-ui/cdk 4.52.0-canary.216e347 → 4.52.0-canary.217a686

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 (846) hide show
  1. package/README.md +1 -1
  2. package/classes/control.d.ts +3 -5
  3. package/classes/index.d.ts +0 -1
  4. package/constants/handlers.d.ts +2 -0
  5. package/constants/index.d.ts +0 -1
  6. package/constants/used-icons.d.ts +2 -2
  7. package/constants/version.d.ts +1 -1
  8. package/constants/version.js +1 -1
  9. package/date-time/date-fillers.d.ts +5 -5
  10. package/date-time/date-time.d.ts +1 -1
  11. package/date-time/day-range.d.ts +1 -1
  12. package/date-time/day.d.ts +4 -4
  13. package/date-time/time.d.ts +2 -2
  14. package/date-time/types.d.ts +1 -12
  15. package/directives/active-zone/active-zone.directive.d.ts +4 -5
  16. package/directives/animated/animated.directive.d.ts +1 -4
  17. package/directives/animated/index.d.ts +0 -1
  18. package/directives/auto-focus/autofocus.directive.d.ts +2 -3
  19. package/directives/auto-focus/autofocus.options.d.ts +2 -2
  20. package/directives/copy-processor/copy-processor.directive.d.ts +2 -2
  21. package/directives/hovered/hovered.directive.d.ts +1 -2
  22. package/directives/index.d.ts +1 -6
  23. package/directives/media/media.directive.d.ts +8 -12
  24. package/directives/native-validator/native-validator.directive.d.ts +2 -2
  25. package/directives/obscured/obscured.directive.d.ts +4 -4
  26. package/directives/pan/pan.directive.d.ts +1 -2
  27. package/directives/platform/platform.directive.d.ts +2 -2
  28. package/directives/resizer/resizer.directive.d.ts +3 -4
  29. package/directives/swipe/swipe.directive.d.ts +1 -2
  30. package/directives/transitioned/transitioned.directive.d.ts +1 -0
  31. package/directives/value-changes/value-changes.directive.d.ts +2 -2
  32. package/directives/with-styles/index.d.ts +1 -0
  33. package/directives/with-styles/with-styles.directive.d.ts +10 -0
  34. package/fesm2022/taiga-ui-cdk-classes.mjs +9 -93
  35. package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
  36. package/fesm2022/taiga-ui-cdk-constants.mjs +17 -29
  37. package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
  38. package/fesm2022/taiga-ui-cdk-date-time.mjs +36 -25
  39. package/fesm2022/taiga-ui-cdk-date-time.mjs.map +1 -1
  40. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +28 -37
  41. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
  42. package/fesm2022/taiga-ui-cdk-directives-animated.mjs +39 -85
  43. package/fesm2022/taiga-ui-cdk-directives-animated.mjs.map +1 -1
  44. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +13 -15
  45. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
  46. package/fesm2022/taiga-ui-cdk-directives-control.mjs +3 -4
  47. package/fesm2022/taiga-ui-cdk-directives-control.mjs.map +1 -1
  48. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs +8 -11
  49. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs.map +1 -1
  50. package/fesm2022/taiga-ui-cdk-directives-element.mjs +5 -6
  51. package/fesm2022/taiga-ui-cdk-directives-element.mjs.map +1 -1
  52. package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs +13 -24
  53. package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs.map +1 -1
  54. package/fesm2022/taiga-ui-cdk-directives-font-size.mjs +4 -7
  55. package/fesm2022/taiga-ui-cdk-directives-font-size.mjs.map +1 -1
  56. package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs +3 -4
  57. package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs.map +1 -1
  58. package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +12 -15
  59. package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
  60. package/fesm2022/taiga-ui-cdk-directives-item.mjs +3 -4
  61. package/fesm2022/taiga-ui-cdk-directives-item.mjs.map +1 -1
  62. package/fesm2022/taiga-ui-cdk-directives-media.mjs +33 -58
  63. package/fesm2022/taiga-ui-cdk-directives-media.mjs.map +1 -1
  64. package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs +9 -11
  65. package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs.map +1 -1
  66. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +14 -20
  67. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
  68. package/fesm2022/taiga-ui-cdk-directives-pan.mjs +11 -13
  69. package/fesm2022/taiga-ui-cdk-directives-pan.mjs.map +1 -1
  70. package/fesm2022/taiga-ui-cdk-directives-platform.mjs +9 -12
  71. package/fesm2022/taiga-ui-cdk-directives-platform.mjs.map +1 -1
  72. package/fesm2022/taiga-ui-cdk-directives-resizer.mjs +19 -23
  73. package/fesm2022/taiga-ui-cdk-directives-resizer.mjs.map +1 -1
  74. package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +11 -13
  75. package/fesm2022/taiga-ui-cdk-directives-swipe.mjs.map +1 -1
  76. package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs +9 -16
  77. package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs.map +1 -1
  78. package/fesm2022/taiga-ui-cdk-directives-validator.mjs +4 -5
  79. package/fesm2022/taiga-ui-cdk-directives-validator.mjs.map +1 -1
  80. package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +8 -9
  81. package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs.map +1 -1
  82. package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs +5 -5
  83. package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs.map +1 -1
  84. package/fesm2022/taiga-ui-cdk-directives-with-styles.mjs +29 -0
  85. package/fesm2022/taiga-ui-cdk-directives-with-styles.mjs.map +1 -0
  86. package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +9 -9
  87. package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
  88. package/fesm2022/taiga-ui-cdk-directives.mjs +1 -6
  89. package/fesm2022/taiga-ui-cdk-directives.mjs.map +1 -1
  90. package/fesm2022/taiga-ui-cdk-observables.mjs +10 -28
  91. package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
  92. package/fesm2022/taiga-ui-cdk-pipes-filter.mjs +3 -4
  93. package/fesm2022/taiga-ui-cdk-pipes-filter.mjs.map +1 -1
  94. package/fesm2022/taiga-ui-cdk-pipes-mapper.mjs +3 -4
  95. package/fesm2022/taiga-ui-cdk-pipes-mapper.mjs.map +1 -1
  96. package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs +5 -5
  97. package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs.map +1 -1
  98. package/fesm2022/taiga-ui-cdk-pipes.mjs +0 -6
  99. package/fesm2022/taiga-ui-cdk-pipes.mjs.map +1 -1
  100. package/fesm2022/taiga-ui-cdk-portals.mjs +126 -0
  101. package/fesm2022/taiga-ui-cdk-portals.mjs.map +1 -0
  102. package/fesm2022/taiga-ui-cdk-tokens.mjs +20 -52
  103. package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
  104. package/fesm2022/taiga-ui-cdk-utils-browser.mjs +3 -26
  105. package/fesm2022/taiga-ui-cdk-utils-browser.mjs.map +1 -1
  106. package/fesm2022/taiga-ui-cdk-utils-di.mjs +46 -6
  107. package/fesm2022/taiga-ui-cdk-utils-di.mjs.map +1 -1
  108. package/fesm2022/taiga-ui-cdk-utils-dom.mjs +16 -96
  109. package/fesm2022/taiga-ui-cdk-utils-dom.mjs.map +1 -1
  110. package/fesm2022/taiga-ui-cdk-utils-focus.mjs +27 -44
  111. package/fesm2022/taiga-ui-cdk-utils-focus.mjs.map +1 -1
  112. package/fesm2022/taiga-ui-cdk-utils-math.mjs +1 -12
  113. package/fesm2022/taiga-ui-cdk-utils-math.mjs.map +1 -1
  114. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +47 -114
  115. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
  116. package/fesm2022/taiga-ui-cdk-utils.mjs +0 -1
  117. package/fesm2022/taiga-ui-cdk-utils.mjs.map +1 -1
  118. package/fesm2022/taiga-ui-cdk.mjs +1 -1
  119. package/index.d.ts +1 -1
  120. package/observables/index.d.ts +0 -2
  121. package/package.json +37 -195
  122. package/pipes/index.d.ts +0 -6
  123. package/pipes/obfuscate/obfuscate.options.d.ts +2 -2
  124. package/portals/directive.d.ts +11 -0
  125. package/portals/index.d.ts +4 -0
  126. package/portals/portal.d.ts +24 -0
  127. package/portals/portals.d.ts +12 -0
  128. package/portals/service.d.ts +15 -0
  129. package/schematics/collection.json +2 -1
  130. package/schematics/constants/file-globs.js +1 -1
  131. package/schematics/constants/file-globs.js.map +1 -1
  132. package/schematics/index.d.ts +1 -0
  133. package/schematics/index.js +1 -0
  134. package/schematics/index.js.map +1 -1
  135. package/schematics/migrate-tui-let/index.js +5 -4
  136. package/schematics/migrate-tui-let/index.js.map +1 -1
  137. package/schematics/migrate-tui-let/schema.json +7 -0
  138. package/schematics/ng-add/constants/versions.d.ts +1 -1
  139. package/schematics/ng-add/index.js +1 -2
  140. package/schematics/ng-add/index.js.map +1 -1
  141. package/schematics/ng-add/setup-project.js +1 -1
  142. package/schematics/ng-add/setup-project.js.map +1 -1
  143. package/schematics/ng-add/steps/add-taiga-icons.js +2 -3
  144. package/schematics/ng-add/steps/add-taiga-icons.js.map +1 -1
  145. package/schematics/ng-add/steps/add-taiga-modules.js +1 -17
  146. package/schematics/ng-add/steps/add-taiga-modules.js.map +1 -1
  147. package/schematics/ng-add/steps/add-taiga-styles.js +1 -2
  148. package/schematics/ng-add/steps/add-taiga-styles.js.map +1 -1
  149. package/schematics/ng-add/steps/wrap-with-tui-root.js +1 -2
  150. package/schematics/ng-add/steps/wrap-with-tui-root.js.map +1 -1
  151. package/schematics/ng-update/interfaces/html-comment.d.ts +1 -1
  152. package/schematics/ng-update/interfaces/removable-input.d.ts +1 -1
  153. package/schematics/ng-update/interfaces/replacement-attribute-to-directive.d.ts +1 -1
  154. package/schematics/ng-update/interfaces/replacement-attribute-value.d.ts +1 -1
  155. package/schematics/ng-update/interfaces/replacement-attribute.d.ts +1 -1
  156. package/schematics/ng-update/interfaces/replacement-tag.d.ts +1 -1
  157. package/schematics/ng-update/steps/icons/replace-imports.js +1 -2
  158. package/schematics/ng-update/steps/icons/replace-imports.js.map +1 -1
  159. package/schematics/ng-update/steps/rename-types.js +1 -2
  160. package/schematics/ng-update/steps/rename-types.js.map +1 -1
  161. package/schematics/ng-update/steps/replace-deep-import.js +1 -2
  162. package/schematics/ng-update/steps/replace-deep-import.js.map +1 -1
  163. package/schematics/ng-update/steps/replace-enums.js +1 -2
  164. package/schematics/ng-update/steps/replace-enums.js.map +1 -1
  165. package/schematics/ng-update/steps/replace-identifier.js +2 -3
  166. package/schematics/ng-update/steps/replace-identifier.js.map +1 -1
  167. package/schematics/ng-update/steps/replace-package-name.js +1 -2
  168. package/schematics/ng-update/steps/replace-package-name.js.map +1 -1
  169. package/schematics/ng-update/steps/replace-services.js +1 -2
  170. package/schematics/ng-update/steps/replace-services.js.map +1 -1
  171. package/schematics/ng-update/steps/show-warnings.js +1 -2
  172. package/schematics/ng-update/steps/show-warnings.js.map +1 -1
  173. package/schematics/ng-update/utils/get-file-system.js +1 -2
  174. package/schematics/ng-update/utils/get-file-system.js.map +1 -1
  175. package/schematics/ng-update/{v4/steps → utils}/replace-functions.d.ts +1 -1
  176. package/schematics/ng-update/{v4/steps → utils}/replace-functions.js +2 -3
  177. package/schematics/ng-update/utils/replace-functions.js.map +1 -0
  178. package/schematics/ng-update/utils/replace-text.js +1 -2
  179. package/schematics/ng-update/utils/replace-text.js.map +1 -1
  180. package/schematics/ng-update/utils/templates/remove-inputs.js +1 -2
  181. package/schematics/ng-update/utils/templates/remove-inputs.js.map +1 -1
  182. package/schematics/ng-update/utils/templates/replace-attr-values.js +1 -2
  183. package/schematics/ng-update/utils/templates/replace-attr-values.js.map +1 -1
  184. package/schematics/ng-update/utils/templates/replace-attrs-by-directives.js +1 -2
  185. package/schematics/ng-update/utils/templates/replace-attrs-by-directives.js.map +1 -1
  186. package/schematics/ng-update/utils/templates/replace-attrs.js +1 -2
  187. package/schematics/ng-update/utils/templates/replace-attrs.js.map +1 -1
  188. package/schematics/ng-update/utils/templates/replace-tag.js +1 -2
  189. package/schematics/ng-update/utils/templates/replace-tag.js.map +1 -1
  190. package/schematics/ng-update/utils/templates/replace-tags.js +1 -2
  191. package/schematics/ng-update/utils/templates/replace-tags.js.map +1 -1
  192. package/schematics/ng-update/utils/templates/template-comments.js +1 -2
  193. package/schematics/ng-update/utils/templates/template-comments.js.map +1 -1
  194. package/schematics/ng-update/v4/index.js +2 -3
  195. package/schematics/ng-update/v4/index.js.map +1 -1
  196. package/schematics/ng-update/v4/migrate-addon-doc/index.js +1 -2
  197. package/schematics/ng-update/v4/migrate-addon-doc/index.js.map +1 -1
  198. package/schematics/ng-update/v4/migrate-css-vars/index.js +1 -2
  199. package/schematics/ng-update/v4/migrate-css-vars/index.js.map +1 -1
  200. package/schematics/ng-update/v4/migrate-css-vars/palette.d.ts +4 -4
  201. package/schematics/ng-update/v4/migrate-css-vars/palette.js +4 -4
  202. package/schematics/ng-update/v4/migrate-css-vars/palette.js.map +1 -1
  203. package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.d.ts +0 -1
  204. package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +2 -3
  205. package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js.map +1 -1
  206. package/schematics/ng-update/v4/migrate-icons/index.js +1 -2
  207. package/schematics/ng-update/v4/migrate-icons/index.js.map +1 -1
  208. package/schematics/ng-update/v4/migrate-icons/rename-icons.d.ts +0 -1
  209. package/schematics/ng-update/v4/migrate-icons/rename-icons.js +1 -2
  210. package/schematics/ng-update/v4/migrate-icons/rename-icons.js.map +1 -1
  211. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.d.ts +0 -1
  212. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.js +1 -2
  213. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.js.map +1 -1
  214. package/schematics/ng-update/v4/steps/constants/migration-warnings.js +1 -1
  215. package/schematics/ng-update/v4/steps/constants/migration-warnings.js.map +1 -1
  216. package/schematics/ng-update/v4/steps/drop-universal-mock.js +1 -2
  217. package/schematics/ng-update/v4/steps/drop-universal-mock.js.map +1 -1
  218. package/schematics/ng-update/v4/steps/migrate-alert-service.js +1 -2
  219. package/schematics/ng-update/v4/steps/migrate-alert-service.js.map +1 -1
  220. package/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.js +1 -2
  221. package/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.js.map +1 -1
  222. package/schematics/ng-update/v4/steps/migrate-destroy-service.js +1 -2
  223. package/schematics/ng-update/v4/steps/migrate-destroy-service.js.map +1 -1
  224. package/schematics/ng-update/v4/steps/migrate-editor.d.ts +0 -1
  225. package/schematics/ng-update/v4/steps/migrate-editor.js +2 -2
  226. package/schematics/ng-update/v4/steps/migrate-editor.js.map +1 -1
  227. package/schematics/ng-update/v4/steps/migrate-legacy-mask.js +1 -2
  228. package/schematics/ng-update/v4/steps/migrate-legacy-mask.js.map +1 -1
  229. package/schematics/ng-update/v4/steps/migrate-month-context.js +1 -2
  230. package/schematics/ng-update/v4/steps/migrate-month-context.js.map +1 -1
  231. package/schematics/ng-update/v4/steps/migrate-number-format-settings.js +1 -2
  232. package/schematics/ng-update/v4/steps/migrate-number-format-settings.js.map +1 -1
  233. package/schematics/ng-update/v4/steps/migrate-option-providers.js +1 -2
  234. package/schematics/ng-update/v4/steps/migrate-option-providers.js.map +1 -1
  235. package/schematics/ng-update/v4/steps/migrate-proprietary.d.ts +0 -1
  236. package/schematics/ng-update/v4/steps/migrate-proprietary.js +2 -3
  237. package/schematics/ng-update/v4/steps/migrate-proprietary.js.map +1 -1
  238. package/schematics/ng-update/v4/steps/migrate-providers-from.js +1 -2
  239. package/schematics/ng-update/v4/steps/migrate-providers-from.js.map +1 -1
  240. package/schematics/ng-update/v4/steps/migrate-root.js +1 -2
  241. package/schematics/ng-update/v4/steps/migrate-root.js.map +1 -1
  242. package/schematics/ng-update/v4/steps/migrate-templates.d.ts +2 -2
  243. package/schematics/ng-update/v4/steps/migrate-templates.js +2 -3
  244. package/schematics/ng-update/v4/steps/migrate-templates.js.map +1 -1
  245. package/schematics/ng-update/v4/steps/remove-duplicates.js +1 -2
  246. package/schematics/ng-update/v4/steps/remove-duplicates.js.map +1 -1
  247. package/schematics/ng-update/v4/steps/restore-tui-mapper.js +2 -3
  248. package/schematics/ng-update/v4/steps/restore-tui-mapper.js.map +1 -1
  249. package/schematics/ng-update/v4/steps/restore-tui-matcher.js +2 -3
  250. package/schematics/ng-update/v4/steps/restore-tui-matcher.js.map +1 -1
  251. package/schematics/ng-update/v4/steps/styles/index.d.ts +0 -1
  252. package/schematics/ng-update/v4/steps/styles/index.js +2 -2
  253. package/schematics/ng-update/v4/steps/styles/index.js.map +1 -1
  254. package/schematics/ng-update/v4/steps/styles/migrate-legacy-mixins.js +1 -2
  255. package/schematics/ng-update/v4/steps/styles/migrate-legacy-mixins.js.map +1 -1
  256. package/schematics/ng-update/v4/steps/styles/migrate-less-scss-constants.js +1 -2
  257. package/schematics/ng-update/v4/steps/styles/migrate-less-scss-constants.js.map +1 -1
  258. package/schematics/ng-update/v4/steps/styles/migrate-mixins.js +1 -2
  259. package/schematics/ng-update/v4/steps/styles/migrate-mixins.js.map +1 -1
  260. package/schematics/ng-update/v4/steps/styles/migrate-shadow-mixins.js +1 -2
  261. package/schematics/ng-update/v4/steps/styles/migrate-shadow-mixins.js.map +1 -1
  262. package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js +2 -3
  263. package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js.map +1 -1
  264. package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.js +14 -15
  265. package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.js.map +1 -1
  266. package/schematics/ng-update/v4/steps/templates/dropdown-ref-comment.js +1 -2
  267. package/schematics/ng-update/v4/steps/templates/dropdown-ref-comment.js.map +1 -1
  268. package/schematics/ng-update/v4/steps/templates/migrate-active-zone.js +1 -2
  269. package/schematics/ng-update/v4/steps/templates/migrate-active-zone.js.map +1 -1
  270. package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +1 -2
  271. package/schematics/ng-update/v4/steps/templates/migrate-avatar.js.map +1 -1
  272. package/schematics/ng-update/v4/steps/templates/migrate-axes.js +1 -2
  273. package/schematics/ng-update/v4/steps/templates/migrate-axes.js.map +1 -1
  274. package/schematics/ng-update/v4/steps/templates/migrate-badge.js +1 -2
  275. package/schematics/ng-update/v4/steps/templates/migrate-badge.js.map +1 -1
  276. package/schematics/ng-update/v4/steps/templates/migrate-badged-content.js +1 -2
  277. package/schematics/ng-update/v4/steps/templates/migrate-badged-content.js.map +1 -1
  278. package/schematics/ng-update/v4/steps/templates/migrate-blocked.js +1 -2
  279. package/schematics/ng-update/v4/steps/templates/migrate-blocked.js.map +1 -1
  280. package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.js +1 -2
  281. package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.js.map +1 -1
  282. package/schematics/ng-update/v4/steps/templates/migrate-expandable.js +1 -2
  283. package/schematics/ng-update/v4/steps/templates/migrate-expandable.js.map +1 -1
  284. package/schematics/ng-update/v4/steps/templates/migrate-filter-pipe.js +1 -2
  285. package/schematics/ng-update/v4/steps/templates/migrate-filter-pipe.js.map +1 -1
  286. package/schematics/ng-update/v4/steps/templates/migrate-focusable.js +1 -2
  287. package/schematics/ng-update/v4/steps/templates/migrate-focusable.js.map +1 -1
  288. package/schematics/ng-update/v4/steps/templates/migrate-label.js +1 -2
  289. package/schematics/ng-update/v4/steps/templates/migrate-label.js.map +1 -1
  290. package/schematics/ng-update/v4/steps/templates/migrate-labeled.js +1 -2
  291. package/schematics/ng-update/v4/steps/templates/migrate-labeled.js.map +1 -1
  292. package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.js +1 -2
  293. package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.js.map +1 -1
  294. package/schematics/ng-update/v4/steps/templates/migrate-money.js +1 -2
  295. package/schematics/ng-update/v4/steps/templates/migrate-money.js.map +1 -1
  296. package/schematics/ng-update/v4/steps/templates/migrate-notification.js +1 -2
  297. package/schematics/ng-update/v4/steps/templates/migrate-notification.js.map +1 -1
  298. package/schematics/ng-update/v4/steps/templates/migrate-number-precision.js +1 -2
  299. package/schematics/ng-update/v4/steps/templates/migrate-number-precision.js.map +1 -1
  300. package/schematics/ng-update/v4/steps/templates/migrate-overscroll.js +1 -2
  301. package/schematics/ng-update/v4/steps/templates/migrate-overscroll.js.map +1 -1
  302. package/schematics/ng-update/v4/steps/templates/migrate-prevent-default.js +1 -2
  303. package/schematics/ng-update/v4/steps/templates/migrate-prevent-default.js.map +1 -1
  304. package/schematics/ng-update/v4/steps/templates/migrate-progress-segmented.js +1 -2
  305. package/schematics/ng-update/v4/steps/templates/migrate-progress-segmented.js.map +1 -1
  306. package/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.js +1 -2
  307. package/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.js.map +1 -1
  308. package/schematics/ng-update/v4/steps/templates/toggles/common.js +4 -5
  309. package/schematics/ng-update/v4/steps/templates/toggles/common.js.map +1 -1
  310. package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js +1 -2
  311. package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js.map +1 -1
  312. package/schematics/ng-update/v4/steps/templates/toggles/migrate-radio.js +1 -2
  313. package/schematics/ng-update/v4/steps/templates/toggles/migrate-radio.js.map +1 -1
  314. package/schematics/ng-update/v4/steps/templates/toggles/migrate-toggle.js +1 -2
  315. package/schematics/ng-update/v4/steps/templates/toggles/migrate-toggle.js.map +1 -1
  316. package/schematics/ng-update/v4/steps/update-packages.d.ts +0 -1
  317. package/schematics/ng-update/v4/steps/update-packages.js +2 -2
  318. package/schematics/ng-update/v4/steps/update-packages.js.map +1 -1
  319. package/schematics/ng-update/v4/steps/utils/clean-object.js +1 -2
  320. package/schematics/ng-update/v4/steps/utils/clean-object.js.map +1 -1
  321. package/schematics/ng-update/v4/steps/utils/normalize-attr-value.js +1 -2
  322. package/schematics/ng-update/v4/steps/utils/normalize-attr-value.js.map +1 -1
  323. package/schematics/ng-update/v4/steps/utils/remove-attrs.js +1 -2
  324. package/schematics/ng-update/v4/steps/utils/remove-attrs.js.map +1 -1
  325. package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.js.map +1 -1
  326. package/schematics/ng-update/v4/steps/utils/replace-substrings.js +1 -2
  327. package/schematics/ng-update/v4/steps/utils/replace-substrings.js.map +1 -1
  328. package/schematics/ng-update/v4/tests/migrate-destroy-service/utils.js +1 -2
  329. package/schematics/ng-update/v4/tests/migrate-destroy-service/utils.js.map +1 -1
  330. package/schematics/ng-update/v5/index.js +15 -2
  331. package/schematics/ng-update/v5/index.js.map +1 -1
  332. package/schematics/ng-update/v5/steps/constants/attrs-to-replace.d.ts +2 -0
  333. package/schematics/ng-update/v5/steps/constants/attrs-to-replace.js +22 -0
  334. package/schematics/ng-update/v5/steps/constants/attrs-to-replace.js.map +1 -0
  335. package/schematics/ng-update/v5/steps/constants/functions.d.ts +2 -0
  336. package/schematics/ng-update/v5/steps/constants/functions.js +67 -0
  337. package/schematics/ng-update/v5/steps/constants/functions.js.map +1 -0
  338. package/schematics/ng-update/v5/steps/constants/html-comments.d.ts +2 -0
  339. package/schematics/ng-update/v5/steps/constants/html-comments.js +11 -0
  340. package/schematics/ng-update/v5/steps/constants/html-comments.js.map +1 -0
  341. package/schematics/ng-update/v5/steps/constants/identifiers-to-replace.d.ts +2 -0
  342. package/schematics/ng-update/v5/steps/constants/identifiers-to-replace.js +22 -0
  343. package/schematics/ng-update/v5/steps/constants/identifiers-to-replace.js.map +1 -0
  344. package/schematics/ng-update/v5/steps/migrate-css-variables.d.ts +3 -0
  345. package/schematics/ng-update/v5/steps/migrate-css-variables.js +30 -0
  346. package/schematics/ng-update/v5/steps/migrate-css-variables.js.map +1 -0
  347. package/schematics/ng-update/v5/steps/migrate-templates.d.ts +17 -0
  348. package/schematics/ng-update/v5/steps/migrate-templates.js +48 -0
  349. package/schematics/ng-update/v5/steps/migrate-templates.js.map +1 -0
  350. package/schematics/ng-update/v5/steps/migrate-tokens/migrate-tokens.js +1 -2
  351. package/schematics/ng-update/v5/steps/migrate-tokens/migrate-tokens.js.map +1 -1
  352. package/schematics/ng-update/v5/steps/migrate-tokens/update-tsconfig.js +1 -2
  353. package/schematics/ng-update/v5/steps/migrate-tokens/update-tsconfig.js.map +1 -1
  354. package/schematics/ng-update/v5/steps/templates/migrate-avatar.d.ts +8 -0
  355. package/schematics/ng-update/v5/steps/templates/migrate-avatar.js +111 -0
  356. package/schematics/ng-update/v5/steps/templates/migrate-avatar.js.map +1 -0
  357. package/schematics/ng-update/v5/steps/templates/migrate-input-year.d.ts +8 -0
  358. package/schematics/ng-update/v5/steps/templates/migrate-input-year.js +52 -0
  359. package/schematics/ng-update/v5/steps/templates/migrate-input-year.js.map +1 -0
  360. package/schematics/ng-update/v5/steps/templates/migrate-notification.d.ts +8 -0
  361. package/schematics/ng-update/v5/steps/templates/migrate-notification.js +45 -0
  362. package/schematics/ng-update/v5/steps/templates/migrate-notification.js.map +1 -0
  363. package/schematics/ng-update/v5/tests/migrate-tokens/utils.js +1 -2
  364. package/schematics/ng-update/v5/tests/migrate-tokens/utils.js.map +1 -1
  365. package/schematics/utils/add-import-to-closest-module.js +2 -3
  366. package/schematics/utils/add-import-to-closest-module.js.map +1 -1
  367. package/schematics/utils/add-unique-import.js +1 -2
  368. package/schematics/utils/add-unique-import.js.map +1 -1
  369. package/schematics/utils/angular-json-manipulations.js +2 -5
  370. package/schematics/utils/angular-json-manipulations.js.map +1 -1
  371. package/schematics/utils/create-angular-json.js +1 -2
  372. package/schematics/utils/create-angular-json.js.map +1 -1
  373. package/schematics/utils/get-component-from-identifier.js +1 -2
  374. package/schematics/utils/get-component-from-identifier.js.map +1 -1
  375. package/schematics/utils/get-execution-time.js +1 -2
  376. package/schematics/utils/get-execution-time.js.map +1 -1
  377. package/schematics/utils/get-named-import-references.js +1 -2
  378. package/schematics/utils/get-named-import-references.js.map +1 -1
  379. package/schematics/utils/get-project-target-options.js +1 -2
  380. package/schematics/utils/get-project-target-options.js.map +1 -1
  381. package/schematics/utils/get-projects.js +1 -2
  382. package/schematics/utils/get-projects.js.map +1 -1
  383. package/schematics/utils/get-standalone-bootstrap-function.d.ts +1 -1
  384. package/schematics/utils/get-standalone-bootstrap-function.js +2 -5
  385. package/schematics/utils/get-standalone-bootstrap-function.js.map +1 -1
  386. package/schematics/utils/import-manipulations.js +2 -3
  387. package/schematics/utils/import-manipulations.js.map +1 -1
  388. package/schematics/utils/insert-todo.js +2 -2
  389. package/schematics/utils/insert-todo.js.map +1 -1
  390. package/schematics/utils/is-ci.js +1 -2
  391. package/schematics/utils/is-ci.js.map +1 -1
  392. package/schematics/utils/make-angular-json-with-assets.js +1 -2
  393. package/schematics/utils/make-angular-json-with-assets.js.map +1 -1
  394. package/schematics/utils/progress.js +1 -2
  395. package/schematics/utils/progress.js.map +1 -1
  396. package/schematics/utils/push-to-array-property.js +1 -2
  397. package/schematics/utils/push-to-array-property.js.map +1 -1
  398. package/schematics/utils/remove-module.js +2 -3
  399. package/schematics/utils/remove-module.js.map +1 -1
  400. package/schematics/utils/run-migration.d.ts +14 -0
  401. package/schematics/utils/run-migration.js +27 -0
  402. package/schematics/utils/run-migration.js.map +1 -0
  403. package/schematics/utils/templates/elements.d.ts +4 -1
  404. package/schematics/utils/templates/elements.js +15 -24
  405. package/schematics/utils/templates/elements.js.map +1 -1
  406. package/schematics/utils/templates/get-component-templates.js +1 -2
  407. package/schematics/utils/templates/get-component-templates.js.map +1 -1
  408. package/schematics/utils/templates/inputs.js +2 -3
  409. package/schematics/utils/templates/inputs.js.map +1 -1
  410. package/schematics/utils/templates/ng-component-input-manipulations.d.ts +3 -3
  411. package/schematics/utils/templates/ng-component-input-manipulations.js +6 -9
  412. package/schematics/utils/templates/ng-component-input-manipulations.js.map +1 -1
  413. package/schematics/utils/templates/template-resource.js +3 -4
  414. package/schematics/utils/templates/template-resource.js.map +1 -1
  415. package/tokens/environment.d.ts +5 -13
  416. package/tokens/index.d.ts +0 -2
  417. package/tokens/removed-element.d.ts +0 -3
  418. package/types/index.d.ts +0 -2
  419. package/utils/browser/index.d.ts +0 -2
  420. package/utils/di/create-options.d.ts +2 -2
  421. package/utils/di/index.d.ts +3 -0
  422. package/utils/di/provide-options.d.ts +2 -0
  423. package/utils/dom/get-element-obscurers.d.ts +1 -1
  424. package/utils/dom/index.d.ts +0 -6
  425. package/utils/focus/get-closest-focusable.d.ts +1 -6
  426. package/utils/focus/{get-native-focused.d.ts → get-focused.d.ts} +1 -1
  427. package/utils/focus/index.d.ts +4 -6
  428. package/utils/focus/{is-native-keyboard-focusable.d.ts → is-focusable.d.ts} +1 -1
  429. package/utils/focus/{is-native-focused-in.d.ts → is-focused-in.d.ts} +1 -1
  430. package/utils/focus/{is-native-focused.d.ts → is-focused.d.ts} +1 -1
  431. package/utils/index.d.ts +0 -1
  432. package/utils/math/index.d.ts +0 -2
  433. package/utils/miscellaneous/generate-id.d.ts +1 -0
  434. package/utils/miscellaneous/index.d.ts +3 -11
  435. package/utils/miscellaneous/is-string.js +1 -2
  436. package/utils/miscellaneous/is-string.js.map +1 -1
  437. package/utils/miscellaneous/sanitize-text.d.ts +23 -0
  438. package/utils/miscellaneous/set-signal.d.ts +2 -0
  439. package/classes/portals.d.ts +0 -33
  440. package/constants/allow-signal-writes.d.ts +0 -2
  441. package/directives/animated/animated-parent.directive.d.ts +0 -10
  442. package/directives/click-outside/click-outside.directive.d.ts +0 -14
  443. package/directives/click-outside/index.d.ts +0 -1
  444. package/directives/droppable/droppable.directive.d.ts +0 -8
  445. package/directives/droppable/index.d.ts +0 -1
  446. package/directives/for/for.directive.d.ts +0 -12
  447. package/directives/for/index.d.ts +0 -1
  448. package/directives/let/index.d.ts +0 -2
  449. package/directives/let/let-context.d.ts +0 -11
  450. package/directives/let/let.directive.d.ts +0 -19
  451. package/directives/popover/index.d.ts +0 -1
  452. package/directives/popover/popover.directive.d.ts +0 -14
  453. package/directives/repeat-times/index.d.ts +0 -1
  454. package/directives/repeat-times/repeat-times.directive.d.ts +0 -22
  455. package/esm2022/classes/control.mjs +0 -96
  456. package/esm2022/classes/index.mjs +0 -5
  457. package/esm2022/classes/portals.mjs +0 -77
  458. package/esm2022/classes/taiga-ui-cdk-classes.mjs +0 -5
  459. package/esm2022/classes/validation-error.mjs +0 -7
  460. package/esm2022/classes/value-transformer.mjs +0 -25
  461. package/esm2022/constants/allow-signal-writes.mjs +0 -3
  462. package/esm2022/constants/empty.mjs +0 -25
  463. package/esm2022/constants/handlers.mjs +0 -11
  464. package/esm2022/constants/index.mjs +0 -10
  465. package/esm2022/constants/matchers.mjs +0 -26
  466. package/esm2022/constants/regexp.mjs +0 -4
  467. package/esm2022/constants/svg-node-filter.mjs +0 -8
  468. package/esm2022/constants/taiga-ui-cdk-constants.mjs +0 -5
  469. package/esm2022/constants/unicode-chars.mjs +0 -64
  470. package/esm2022/constants/used-icons.mjs +0 -76
  471. package/esm2022/constants/version.mjs +0 -2
  472. package/esm2022/date-time/date-clamp.mjs +0 -10
  473. package/esm2022/date-time/date-fillers.mjs +0 -15
  474. package/esm2022/date-time/date-time.mjs +0 -20
  475. package/esm2022/date-time/day-of-week.mjs +0 -10
  476. package/esm2022/date-time/day-range.mjs +0 -84
  477. package/esm2022/date-time/day.mjs +0 -294
  478. package/esm2022/date-time/days.const.mjs +0 -6
  479. package/esm2022/date-time/index.mjs +0 -13
  480. package/esm2022/date-time/month-number.mjs +0 -15
  481. package/esm2022/date-time/month-range.mjs +0 -27
  482. package/esm2022/date-time/month.mjs +0 -152
  483. package/esm2022/date-time/taiga-ui-cdk-date-time.mjs +0 -5
  484. package/esm2022/date-time/time.mjs +0 -161
  485. package/esm2022/date-time/types.mjs +0 -2
  486. package/esm2022/date-time/year.mjs +0 -111
  487. package/esm2022/directives/active-zone/active-zone.directive.mjs +0 -74
  488. package/esm2022/directives/active-zone/index.mjs +0 -2
  489. package/esm2022/directives/active-zone/taiga-ui-cdk-directives-active-zone.mjs +0 -5
  490. package/esm2022/directives/animated/animated-parent.directive.mjs +0 -39
  491. package/esm2022/directives/animated/animated.directive.mjs +0 -81
  492. package/esm2022/directives/animated/index.mjs +0 -3
  493. package/esm2022/directives/animated/taiga-ui-cdk-directives-animated.mjs +0 -5
  494. package/esm2022/directives/auto-focus/autofocus.directive.mjs +0 -46
  495. package/esm2022/directives/auto-focus/autofocus.options.mjs +0 -31
  496. package/esm2022/directives/auto-focus/handlers/abstract.handler.mjs +0 -17
  497. package/esm2022/directives/auto-focus/handlers/default.handler.mjs +0 -21
  498. package/esm2022/directives/auto-focus/handlers/ios.handler.mjs +0 -125
  499. package/esm2022/directives/auto-focus/handlers/sync.handler.mjs +0 -7
  500. package/esm2022/directives/auto-focus/index.mjs +0 -7
  501. package/esm2022/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.mjs +0 -5
  502. package/esm2022/directives/click-outside/click-outside.directive.mjs +0 -33
  503. package/esm2022/directives/click-outside/index.mjs +0 -2
  504. package/esm2022/directives/click-outside/taiga-ui-cdk-directives-click-outside.mjs +0 -5
  505. package/esm2022/directives/control/control.directive.mjs +0 -23
  506. package/esm2022/directives/control/index.mjs +0 -2
  507. package/esm2022/directives/control/taiga-ui-cdk-directives-control.mjs +0 -5
  508. package/esm2022/directives/copy-processor/copy-processor.directive.mjs +0 -33
  509. package/esm2022/directives/copy-processor/index.mjs +0 -2
  510. package/esm2022/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.mjs +0 -5
  511. package/esm2022/directives/droppable/droppable.directive.mjs +0 -31
  512. package/esm2022/directives/droppable/index.mjs +0 -2
  513. package/esm2022/directives/droppable/taiga-ui-cdk-directives-droppable.mjs +0 -5
  514. package/esm2022/directives/element/element.directive.mjs +0 -35
  515. package/esm2022/directives/element/index.mjs +0 -2
  516. package/esm2022/directives/element/taiga-ui-cdk-directives-element.mjs +0 -5
  517. package/esm2022/directives/focus-trap/focus-trap.directive.mjs +0 -67
  518. package/esm2022/directives/focus-trap/index.mjs +0 -2
  519. package/esm2022/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.mjs +0 -5
  520. package/esm2022/directives/font-size/font-size.directive.mjs +0 -27
  521. package/esm2022/directives/font-size/index.mjs +0 -2
  522. package/esm2022/directives/font-size/taiga-ui-cdk-directives-font-size.mjs +0 -5
  523. package/esm2022/directives/for/for.directive.mjs +0 -34
  524. package/esm2022/directives/for/index.mjs +0 -2
  525. package/esm2022/directives/for/taiga-ui-cdk-directives-for.mjs +0 -5
  526. package/esm2022/directives/high-dpi/high-dpi.directive.mjs +0 -23
  527. package/esm2022/directives/high-dpi/index.mjs +0 -2
  528. package/esm2022/directives/high-dpi/taiga-ui-cdk-directives-high-dpi.mjs +0 -5
  529. package/esm2022/directives/hovered/hovered.directive.mjs +0 -22
  530. package/esm2022/directives/hovered/hovered.service.mjs +0 -35
  531. package/esm2022/directives/hovered/index.mjs +0 -3
  532. package/esm2022/directives/hovered/taiga-ui-cdk-directives-hovered.mjs +0 -5
  533. package/esm2022/directives/index.mjs +0 -30
  534. package/esm2022/directives/item/index.mjs +0 -2
  535. package/esm2022/directives/item/item.directive.mjs +0 -18
  536. package/esm2022/directives/item/taiga-ui-cdk-directives-item.mjs +0 -5
  537. package/esm2022/directives/let/index.mjs +0 -3
  538. package/esm2022/directives/let/let-context.mjs +0 -15
  539. package/esm2022/directives/let/let.directive.mjs +0 -34
  540. package/esm2022/directives/let/taiga-ui-cdk-directives-let.mjs +0 -5
  541. package/esm2022/directives/media/index.mjs +0 -2
  542. package/esm2022/directives/media/media.directive.mjs +0 -89
  543. package/esm2022/directives/media/taiga-ui-cdk-directives-media.mjs +0 -5
  544. package/esm2022/directives/native-validator/index.mjs +0 -2
  545. package/esm2022/directives/native-validator/native-validator.directive.mjs +0 -43
  546. package/esm2022/directives/native-validator/taiga-ui-cdk-directives-native-validator.mjs +0 -5
  547. package/esm2022/directives/obscured/index.mjs +0 -3
  548. package/esm2022/directives/obscured/obscured.directive.mjs +0 -36
  549. package/esm2022/directives/obscured/obscured.service.mjs +0 -24
  550. package/esm2022/directives/obscured/taiga-ui-cdk-directives-obscured.mjs +0 -5
  551. package/esm2022/directives/pan/index.mjs +0 -3
  552. package/esm2022/directives/pan/pan.directive.mjs +0 -22
  553. package/esm2022/directives/pan/pan.service.mjs +0 -28
  554. package/esm2022/directives/pan/taiga-ui-cdk-directives-pan.mjs +0 -5
  555. package/esm2022/directives/platform/index.mjs +0 -2
  556. package/esm2022/directives/platform/platform.directive.mjs +0 -35
  557. package/esm2022/directives/platform/taiga-ui-cdk-directives-platform.mjs +0 -5
  558. package/esm2022/directives/popover/index.mjs +0 -2
  559. package/esm2022/directives/popover/popover.directive.mjs +0 -26
  560. package/esm2022/directives/popover/taiga-ui-cdk-directives-popover.mjs +0 -5
  561. package/esm2022/directives/repeat-times/index.mjs +0 -2
  562. package/esm2022/directives/repeat-times/repeat-times.directive.mjs +0 -55
  563. package/esm2022/directives/repeat-times/taiga-ui-cdk-directives-repeat-times.mjs +0 -5
  564. package/esm2022/directives/resizer/index.mjs +0 -3
  565. package/esm2022/directives/resizer/resizable.directive.mjs +0 -16
  566. package/esm2022/directives/resizer/resizer.directive.mjs +0 -83
  567. package/esm2022/directives/resizer/taiga-ui-cdk-directives-resizer.mjs +0 -5
  568. package/esm2022/directives/swipe/index.mjs +0 -4
  569. package/esm2022/directives/swipe/swipe.directive.mjs +0 -22
  570. package/esm2022/directives/swipe/swipe.options.mjs +0 -8
  571. package/esm2022/directives/swipe/swipe.service.mjs +0 -50
  572. package/esm2022/directives/swipe/swipe.types.mjs +0 -2
  573. package/esm2022/directives/swipe/taiga-ui-cdk-directives-swipe.mjs +0 -5
  574. package/esm2022/directives/taiga-ui-cdk-directives.mjs +0 -5
  575. package/esm2022/directives/transitioned/index.mjs +0 -2
  576. package/esm2022/directives/transitioned/taiga-ui-cdk-directives-transitioned.mjs +0 -5
  577. package/esm2022/directives/transitioned/transitioned.directive.mjs +0 -27
  578. package/esm2022/directives/validator/index.mjs +0 -2
  579. package/esm2022/directives/validator/taiga-ui-cdk-directives-validator.mjs +0 -5
  580. package/esm2022/directives/validator/validator.directive.mjs +0 -30
  581. package/esm2022/directives/value-changes/index.mjs +0 -2
  582. package/esm2022/directives/value-changes/taiga-ui-cdk-directives-value-changes.mjs +0 -5
  583. package/esm2022/directives/value-changes/value-changes.directive.mjs +0 -28
  584. package/esm2022/directives/visual-viewport/index.mjs +0 -2
  585. package/esm2022/directives/visual-viewport/taiga-ui-cdk-directives-visual-viewport.mjs +0 -5
  586. package/esm2022/directives/visual-viewport/visual-viewport.directive.mjs +0 -34
  587. package/esm2022/directives/zoom/index.mjs +0 -4
  588. package/esm2022/directives/zoom/taiga-ui-cdk-directives-zoom.mjs +0 -5
  589. package/esm2022/directives/zoom/zoom.directive.mjs +0 -24
  590. package/esm2022/directives/zoom/zoom.options.mjs +0 -10
  591. package/esm2022/directives/zoom/zoom.service.mjs +0 -46
  592. package/esm2022/directives/zoom/zoom.types.mjs +0 -2
  593. package/esm2022/index.mjs +0 -10
  594. package/esm2022/observables/close-watcher.mjs +0 -22
  595. package/esm2022/observables/control-value.mjs +0 -8
  596. package/esm2022/observables/drag-and-drop-from.mjs +0 -14
  597. package/esm2022/observables/events.mjs +0 -8
  598. package/esm2022/observables/if-map.mjs +0 -5
  599. package/esm2022/observables/index.mjs +0 -14
  600. package/esm2022/observables/must-be-present.mjs +0 -17
  601. package/esm2022/observables/query-list-observable.mjs +0 -9
  602. package/esm2022/observables/scroll-from.mjs +0 -10
  603. package/esm2022/observables/taiga-ui-cdk-observables.mjs +0 -5
  604. package/esm2022/observables/take-until-destroyed.mjs +0 -9
  605. package/esm2022/observables/typed-from-event.mjs +0 -9
  606. package/esm2022/observables/untracked-scheduler.mjs +0 -11
  607. package/esm2022/observables/watch.mjs +0 -6
  608. package/esm2022/observables/zone.mjs +0 -34
  609. package/esm2022/pipes/animation/animation.pipe.mjs +0 -27
  610. package/esm2022/pipes/animation/index.mjs +0 -2
  611. package/esm2022/pipes/animation/taiga-ui-cdk-pipes-animation.mjs +0 -5
  612. package/esm2022/pipes/filter/filter.pipe.mjs +0 -25
  613. package/esm2022/pipes/filter/index.mjs +0 -2
  614. package/esm2022/pipes/filter/taiga-ui-cdk-pipes-filter.mjs +0 -5
  615. package/esm2022/pipes/index.mjs +0 -10
  616. package/esm2022/pipes/is-present/index.mjs +0 -2
  617. package/esm2022/pipes/is-present/is-present.pipe.mjs +0 -19
  618. package/esm2022/pipes/is-present/taiga-ui-cdk-pipes-is-present.mjs +0 -5
  619. package/esm2022/pipes/keys/index.mjs +0 -2
  620. package/esm2022/pipes/keys/keys.pipe.mjs +0 -18
  621. package/esm2022/pipes/keys/taiga-ui-cdk-pipes-keys.mjs +0 -5
  622. package/esm2022/pipes/mapper/index.mjs +0 -2
  623. package/esm2022/pipes/mapper/mapper.pipe.mjs +0 -25
  624. package/esm2022/pipes/mapper/taiga-ui-cdk-pipes-mapper.mjs +0 -5
  625. package/esm2022/pipes/obfuscate/index.mjs +0 -3
  626. package/esm2022/pipes/obfuscate/obfuscate.options.mjs +0 -10
  627. package/esm2022/pipes/obfuscate/obfuscate.pipe.mjs +0 -44
  628. package/esm2022/pipes/obfuscate/taiga-ui-cdk-pipes-obfuscate.mjs +0 -5
  629. package/esm2022/pipes/repeat-times/index.mjs +0 -19
  630. package/esm2022/pipes/repeat-times/taiga-ui-cdk-pipes-repeat-times.mjs +0 -5
  631. package/esm2022/pipes/replace/index.mjs +0 -2
  632. package/esm2022/pipes/replace/replace.pipe.mjs +0 -20
  633. package/esm2022/pipes/replace/taiga-ui-cdk-pipes-replace.mjs +0 -5
  634. package/esm2022/pipes/taiga-ui-cdk-pipes.mjs +0 -5
  635. package/esm2022/pipes/to-array/index.mjs +0 -2
  636. package/esm2022/pipes/to-array/taiga-ui-cdk-pipes-to-array.mjs +0 -5
  637. package/esm2022/pipes/to-array/to-array.pipe.mjs +0 -18
  638. package/esm2022/services/id.service.mjs +0 -21
  639. package/esm2022/services/index.mjs +0 -5
  640. package/esm2022/services/popover.service.mjs +0 -45
  641. package/esm2022/services/scroll.service.mjs +0 -58
  642. package/esm2022/services/taiga-ui-cdk-services.mjs +0 -5
  643. package/esm2022/services/theme-color.service.mjs +0 -33
  644. package/esm2022/taiga-ui-cdk.mjs +0 -5
  645. package/esm2022/tokens/active-element.mjs +0 -56
  646. package/esm2022/tokens/base-href.mjs +0 -6
  647. package/esm2022/tokens/environment.mjs +0 -64
  648. package/esm2022/tokens/fallback-value.mjs +0 -11
  649. package/esm2022/tokens/index.mjs +0 -8
  650. package/esm2022/tokens/range.mjs +0 -9
  651. package/esm2022/tokens/removed-element.mjs +0 -20
  652. package/esm2022/tokens/taiga-ui-cdk-tokens.mjs +0 -5
  653. package/esm2022/tokens/window-size.mjs +0 -28
  654. package/esm2022/types/context.mjs +0 -2
  655. package/esm2022/types/handler.mjs +0 -2
  656. package/esm2022/types/index.mjs +0 -2
  657. package/esm2022/types/loose-union.mjs +0 -2
  658. package/esm2022/types/mapper.mjs +0 -2
  659. package/esm2022/types/matcher.mjs +0 -2
  660. package/esm2022/types/rounding.mjs +0 -2
  661. package/esm2022/types/safe-html.mjs +0 -2
  662. package/esm2022/types/taiga-ui-cdk-types.mjs +0 -5
  663. package/esm2022/types/values-of.mjs +0 -2
  664. package/esm2022/utils/browser/index.mjs +0 -6
  665. package/esm2022/utils/browser/is-apple.mjs +0 -14
  666. package/esm2022/utils/browser/is-edge.mjs +0 -4
  667. package/esm2022/utils/browser/is-firefox.mjs +0 -4
  668. package/esm2022/utils/browser/is-ios.mjs +0 -7
  669. package/esm2022/utils/browser/is-safari.mjs +0 -12
  670. package/esm2022/utils/browser/taiga-ui-cdk-utils-browser.mjs +0 -5
  671. package/esm2022/utils/color/get-gradient-data.mjs +0 -6
  672. package/esm2022/utils/color/hex-to-rgb.mjs +0 -12
  673. package/esm2022/utils/color/hex-to-rgba.mjs +0 -29
  674. package/esm2022/utils/color/hsv-to-rgb.mjs +0 -11
  675. package/esm2022/utils/color/index.mjs +0 -10
  676. package/esm2022/utils/color/parse-color.mjs +0 -27
  677. package/esm2022/utils/color/parse-gradient.mjs +0 -70
  678. package/esm2022/utils/color/rgb-to-hex.mjs +0 -4
  679. package/esm2022/utils/color/rgb-to-hsv.mjs +0 -8
  680. package/esm2022/utils/color/rgba-to-hex.mjs +0 -23
  681. package/esm2022/utils/color/taiga-ui-cdk-utils-color.mjs +0 -5
  682. package/esm2022/utils/di/create-options.mjs +0 -10
  683. package/esm2022/utils/di/index.mjs +0 -3
  684. package/esm2022/utils/di/taiga-ui-cdk-utils-di.mjs +0 -5
  685. package/esm2022/utils/dom/contains-or-after.mjs +0 -10
  686. package/esm2022/utils/dom/element-checks.mjs +0 -20
  687. package/esm2022/utils/dom/event-checks.mjs +0 -4
  688. package/esm2022/utils/dom/get-actual-target.mjs +0 -7
  689. package/esm2022/utils/dom/get-clipboard-data-text.mjs +0 -11
  690. package/esm2022/utils/dom/get-document-or-shadow-root.mjs +0 -6
  691. package/esm2022/utils/dom/get-element-obscurers.mjs +0 -44
  692. package/esm2022/utils/dom/get-element-offset.mjs +0 -20
  693. package/esm2022/utils/dom/get-element-point.mjs +0 -6
  694. package/esm2022/utils/dom/get-selected-text.mjs +0 -15
  695. package/esm2022/utils/dom/index.mjs +0 -20
  696. package/esm2022/utils/dom/inject-element.mjs +0 -5
  697. package/esm2022/utils/dom/is-current-target.mjs +0 -4
  698. package/esm2022/utils/dom/is-element-editable.mjs +0 -6
  699. package/esm2022/utils/dom/is-inside-iframe.mjs +0 -7
  700. package/esm2022/utils/dom/is-node-in.mjs +0 -14
  701. package/esm2022/utils/dom/point-to-client-rect.mjs +0 -17
  702. package/esm2022/utils/dom/retarget-boundary-crossing.mjs +0 -16
  703. package/esm2022/utils/dom/taiga-ui-cdk-utils-dom.mjs +0 -5
  704. package/esm2022/utils/dom/value-binding.mjs +0 -29
  705. package/esm2022/utils/dom/value.mjs +0 -78
  706. package/esm2022/utils/focus/blur-native-focused.mjs +0 -12
  707. package/esm2022/utils/focus/focused-in.mjs +0 -8
  708. package/esm2022/utils/focus/get-closest-focusable.mjs +0 -26
  709. package/esm2022/utils/focus/get-native-focused.mjs +0 -16
  710. package/esm2022/utils/focus/index.mjs +0 -10
  711. package/esm2022/utils/focus/is-native-focused-in.mjs +0 -12
  712. package/esm2022/utils/focus/is-native-focused.mjs +0 -15
  713. package/esm2022/utils/focus/is-native-keyboard-focusable.mjs +0 -33
  714. package/esm2022/utils/focus/is-native-mouse-focusable.mjs +0 -7
  715. package/esm2022/utils/focus/move-focus.mjs +0 -19
  716. package/esm2022/utils/focus/taiga-ui-cdk-utils-focus.mjs +0 -5
  717. package/esm2022/utils/index.mjs +0 -8
  718. package/esm2022/utils/math/clamp.mjs +0 -16
  719. package/esm2022/utils/math/in-range.mjs +0 -9
  720. package/esm2022/utils/math/index.mjs +0 -11
  721. package/esm2022/utils/math/normalize-to-int-number.mjs +0 -22
  722. package/esm2022/utils/math/quantize.mjs +0 -15
  723. package/esm2022/utils/math/round-with.mjs +0 -14
  724. package/esm2022/utils/math/round.mjs +0 -42
  725. package/esm2022/utils/math/sum.mjs +0 -7
  726. package/esm2022/utils/math/taiga-ui-cdk-utils-math.mjs +0 -5
  727. package/esm2022/utils/math/to-int.mjs +0 -4
  728. package/esm2022/utils/math/to-integer.mjs +0 -4
  729. package/esm2022/utils/math/to-radians.mjs +0 -7
  730. package/esm2022/utils/miscellaneous/array-remove.mjs +0 -4
  731. package/esm2022/utils/miscellaneous/array-shallow-equals.mjs +0 -4
  732. package/esm2022/utils/miscellaneous/array-toggle.mjs +0 -8
  733. package/esm2022/utils/miscellaneous/change-date-separator.mjs +0 -3
  734. package/esm2022/utils/miscellaneous/count-filled-controls.mjs +0 -13
  735. package/esm2022/utils/miscellaneous/create-token.mjs +0 -16
  736. package/esm2022/utils/miscellaneous/default-sort.mjs +0 -11
  737. package/esm2022/utils/miscellaneous/directive-binding.mjs +0 -26
  738. package/esm2022/utils/miscellaneous/directive-listener.mjs +0 -8
  739. package/esm2022/utils/miscellaneous/distance-between-touches.mjs +0 -4
  740. package/esm2022/utils/miscellaneous/ease-in-out-quad.mjs +0 -7
  741. package/esm2022/utils/miscellaneous/flat-length.mjs +0 -9
  742. package/esm2022/utils/miscellaneous/font-size-watcher.mjs +0 -30
  743. package/esm2022/utils/miscellaneous/get-original-array-from-query-list.mjs +0 -15
  744. package/esm2022/utils/miscellaneous/index.mjs +0 -31
  745. package/esm2022/utils/miscellaneous/is-control-empty.mjs +0 -4
  746. package/esm2022/utils/miscellaneous/is-falsy.mjs +0 -4
  747. package/esm2022/utils/miscellaneous/is-number.mjs +0 -4
  748. package/esm2022/utils/miscellaneous/is-object.mjs +0 -4
  749. package/esm2022/utils/miscellaneous/is-present.mjs +0 -4
  750. package/esm2022/utils/miscellaneous/is-string.mjs +0 -4
  751. package/esm2022/utils/miscellaneous/is-valid-url.mjs +0 -13
  752. package/esm2022/utils/miscellaneous/mark-control-as-touched-and-validate.mjs +0 -16
  753. package/esm2022/utils/miscellaneous/nullable-same.mjs +0 -18
  754. package/esm2022/utils/miscellaneous/obfuscate.mjs +0 -53
  755. package/esm2022/utils/miscellaneous/provide-options.mjs +0 -14
  756. package/esm2022/utils/miscellaneous/provide.mjs +0 -4
  757. package/esm2022/utils/miscellaneous/pure.mjs +0 -83
  758. package/esm2022/utils/miscellaneous/px.mjs +0 -9
  759. package/esm2022/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.mjs +0 -5
  760. package/esm2022/utils/miscellaneous/uniq-by.mjs +0 -6
  761. package/esm2022/utils/miscellaneous/with-styles.mjs +0 -17
  762. package/esm2022/utils/taiga-ui-cdk-utils.mjs +0 -5
  763. package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +0 -39
  764. package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +0 -1
  765. package/fesm2022/taiga-ui-cdk-directives-droppable.mjs +0 -37
  766. package/fesm2022/taiga-ui-cdk-directives-droppable.mjs.map +0 -1
  767. package/fesm2022/taiga-ui-cdk-directives-for.mjs +0 -40
  768. package/fesm2022/taiga-ui-cdk-directives-for.mjs.map +0 -1
  769. package/fesm2022/taiga-ui-cdk-directives-let.mjs +0 -54
  770. package/fesm2022/taiga-ui-cdk-directives-let.mjs.map +0 -1
  771. package/fesm2022/taiga-ui-cdk-directives-popover.mjs +0 -32
  772. package/fesm2022/taiga-ui-cdk-directives-popover.mjs.map +0 -1
  773. package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs +0 -61
  774. package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs.map +0 -1
  775. package/fesm2022/taiga-ui-cdk-pipes-animation.mjs +0 -33
  776. package/fesm2022/taiga-ui-cdk-pipes-animation.mjs.map +0 -1
  777. package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs +0 -25
  778. package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs.map +0 -1
  779. package/fesm2022/taiga-ui-cdk-pipes-keys.mjs +0 -24
  780. package/fesm2022/taiga-ui-cdk-pipes-keys.mjs.map +0 -1
  781. package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs +0 -25
  782. package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs.map +0 -1
  783. package/fesm2022/taiga-ui-cdk-pipes-replace.mjs +0 -26
  784. package/fesm2022/taiga-ui-cdk-pipes-replace.mjs.map +0 -1
  785. package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs +0 -24
  786. package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs.map +0 -1
  787. package/fesm2022/taiga-ui-cdk-services.mjs +0 -152
  788. package/fesm2022/taiga-ui-cdk-services.mjs.map +0 -1
  789. package/fesm2022/taiga-ui-cdk-utils-color.mjs +0 -195
  790. package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +0 -1
  791. package/observables/must-be-present.d.ts +0 -5
  792. package/observables/query-list-observable.d.ts +0 -6
  793. package/pipes/animation/animation.pipe.d.ts +0 -13
  794. package/pipes/animation/index.d.ts +0 -1
  795. package/pipes/is-present/index.d.ts +0 -1
  796. package/pipes/is-present/is-present.pipe.d.ts +0 -7
  797. package/pipes/keys/index.d.ts +0 -1
  798. package/pipes/keys/keys.pipe.d.ts +0 -7
  799. package/pipes/repeat-times/index.d.ts +0 -7
  800. package/pipes/replace/index.d.ts +0 -1
  801. package/pipes/replace/replace.pipe.d.ts +0 -7
  802. package/pipes/to-array/index.d.ts +0 -1
  803. package/pipes/to-array/to-array.pipe.d.ts +0 -7
  804. package/schematics/ng-update/v4/steps/replace-functions.js.map +0 -1
  805. package/services/id.service.d.ts +0 -8
  806. package/services/index.d.ts +0 -4
  807. package/services/popover.service.d.ts +0 -25
  808. package/services/scroll.service.d.ts +0 -13
  809. package/services/theme-color.service.d.ts +0 -18
  810. package/tokens/base-href.d.ts +0 -2
  811. package/tokens/range.d.ts +0 -5
  812. package/types/safe-html.d.ts +0 -2
  813. package/types/values-of.d.ts +0 -1
  814. package/utils/browser/is-apple.d.ts +0 -11
  815. package/utils/browser/is-ios.d.ts +0 -6
  816. package/utils/color/get-gradient-data.d.ts +0 -1
  817. package/utils/color/hex-to-rgb.d.ts +0 -1
  818. package/utils/color/hex-to-rgba.d.ts +0 -3
  819. package/utils/color/hsv-to-rgb.d.ts +0 -4
  820. package/utils/color/index.d.ts +0 -9
  821. package/utils/color/parse-color.d.ts +0 -1
  822. package/utils/color/parse-gradient.d.ts +0 -10
  823. package/utils/color/rgb-to-hex.d.ts +0 -1
  824. package/utils/color/rgb-to-hsv.d.ts +0 -1
  825. package/utils/color/rgba-to-hex.d.ts +0 -2
  826. package/utils/dom/get-element-point.d.ts +0 -2
  827. package/utils/dom/is-current-target.d.ts +0 -1
  828. package/utils/dom/is-inside-iframe.d.ts +0 -4
  829. package/utils/dom/is-node-in.d.ts +0 -8
  830. package/utils/dom/retarget-boundary-crossing.d.ts +0 -1
  831. package/utils/dom/value-binding.d.ts +0 -3
  832. package/utils/focus/blur-native-focused.d.ts +0 -4
  833. package/utils/focus/is-native-mouse-focusable.d.ts +0 -1
  834. package/utils/math/to-integer.d.ts +0 -1
  835. package/utils/math/to-radians.d.ts +0 -4
  836. package/utils/miscellaneous/change-date-separator.d.ts +0 -1
  837. package/utils/miscellaneous/create-token.d.ts +0 -9
  838. package/utils/miscellaneous/directive-listener.d.ts +0 -9
  839. package/utils/miscellaneous/flat-length.d.ts +0 -6
  840. package/utils/miscellaneous/get-original-array-from-query-list.d.ts +0 -8
  841. package/utils/miscellaneous/is-falsy.d.ts +0 -1
  842. package/utils/miscellaneous/is-valid-url.d.ts +0 -4
  843. package/utils/miscellaneous/provide-options.d.ts +0 -2
  844. package/utils/miscellaneous/uniq-by.d.ts +0 -1
  845. /package/utils/{miscellaneous → di}/directive-binding.d.ts +0 -0
  846. /package/utils/{miscellaneous → di}/provide.d.ts +0 -0
@@ -1,19 +1,3 @@
1
- import { isIos } from '@ng-web-apis/platform';
2
-
3
- /**
4
- * @description:
5
- * All Chrome / Chromium-based browsers will return MacIntel on macOS,
6
- * no matter what the hardware architecture is. See the source code here:
7
- * https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/frame/navigator_id.cc;l=64;drc=703d3c472cf27470dad21a3f2c8972aca3732cd6
8
- * But maybe in future years, it will be changed to MacM1
9
- *
10
- * Documentation:
11
- * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform
12
- */
13
- function tuiIsApple(navigator) {
14
- return navigator.platform.startsWith('Mac') || navigator.platform === 'iPhone';
15
- }
16
-
17
1
  function tuiIsEdge(userAgent) {
18
2
  return userAgent.toLowerCase().includes('edge');
19
3
  }
@@ -22,21 +6,14 @@ function tuiIsFirefox(userAgent) {
22
6
  return userAgent.toLowerCase().includes('firefox');
23
7
  }
24
8
 
25
- /**
26
- * @deprecated: drop in v5, use import {isApple} from '@ng-web-apis/platform';
27
- * @param navigator
28
- */
29
- const tuiIsIos = isIos;
30
-
31
9
  // TODO: Drop change to Document in v5
32
10
  function tuiIsSafari({ ownerDocument: doc }) {
33
11
  const win = doc?.defaultView;
34
12
  const isMacOsSafari = win.safari !== undefined &&
35
13
  win.safari?.pushNotification?.toString() === '[object SafariRemoteNotification]';
36
- const isIosSafari = (win.navigator?.vendor?.includes('Apple') &&
14
+ const isIosSafari = win.navigator?.vendor?.includes('Apple') &&
37
15
  !win.navigator?.userAgent?.includes('CriOS') &&
38
- !win.navigator?.userAgent?.includes('FxiOS')) ??
39
- false;
16
+ !win.navigator?.userAgent?.includes('FxiOS');
40
17
  return isMacOsSafari || isIosSafari;
41
18
  }
42
19
 
@@ -44,5 +21,5 @@ function tuiIsSafari({ ownerDocument: doc }) {
44
21
  * Generated bundle index. Do not edit.
45
22
  */
46
23
 
47
- export { tuiIsApple, tuiIsEdge, tuiIsFirefox, tuiIsIos, tuiIsSafari };
24
+ export { tuiIsEdge, tuiIsFirefox, tuiIsSafari };
48
25
  //# sourceMappingURL=taiga-ui-cdk-utils-browser.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-utils-browser.mjs","sources":["../../../projects/cdk/utils/browser/is-apple.ts","../../../projects/cdk/utils/browser/is-edge.ts","../../../projects/cdk/utils/browser/is-firefox.ts","../../../projects/cdk/utils/browser/is-ios.ts","../../../projects/cdk/utils/browser/is-safari.ts","../../../projects/cdk/utils/browser/taiga-ui-cdk-utils-browser.ts"],"sourcesContent":["/**\n * @description:\n * All Chrome / Chromium-based browsers will return MacIntel on macOS,\n * no matter what the hardware architecture is. See the source code here:\n * https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/frame/navigator_id.cc;l=64;drc=703d3c472cf27470dad21a3f2c8972aca3732cd6\n * But maybe in future years, it will be changed to MacM1\n *\n * Documentation:\n * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform\n */\nexport function tuiIsApple(navigator: Navigator): boolean {\n return navigator.platform.startsWith('Mac') || navigator.platform === 'iPhone';\n}\n","export function tuiIsEdge(userAgent: string): boolean {\n return userAgent.toLowerCase().includes('edge');\n}\n","export function tuiIsFirefox(userAgent: string): boolean {\n return userAgent.toLowerCase().includes('firefox');\n}\n","import {isIos} from '@ng-web-apis/platform';\n\n/**\n * @deprecated: drop in v5, use import {isApple} from '@ng-web-apis/platform';\n * @param navigator\n */\nexport const tuiIsIos = isIos;\n","// TODO: Drop change to Document in v5\nexport function tuiIsSafari({ownerDocument: doc}: Element): boolean {\n const win = doc?.defaultView as unknown as Window & {safari?: any};\n\n const isMacOsSafari =\n win.safari !== undefined &&\n win.safari?.pushNotification?.toString() === '[object SafariRemoteNotification]';\n\n const isIosSafari =\n (win.navigator?.vendor?.includes('Apple') &&\n !win.navigator?.userAgent?.includes('CriOS') &&\n !win.navigator?.userAgent?.includes('FxiOS')) ??\n false;\n\n return isMacOsSafari || isIosSafari;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;AASG;AACG,SAAU,UAAU,CAAC,SAAoB,EAAA;AAC3C,IAAA,OAAO,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACnF;;ACZM,SAAU,SAAS,CAAC,SAAiB,EAAA;IACvC,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpD;;ACFM,SAAU,YAAY,CAAC,SAAiB,EAAA;IAC1C,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACvD;;ACAA;;;AAGG;AACI,MAAM,QAAQ,GAAG;;ACNxB;SACgB,WAAW,CAAC,EAAC,aAAa,EAAE,GAAG,EAAU,EAAA;AACrD,IAAA,MAAM,GAAG,GAAG,GAAG,EAAE,WAAiD,CAAC;AAEnE,IAAA,MAAM,aAAa,GACf,GAAG,CAAC,MAAM,KAAK,SAAS;QACxB,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,mCAAmC,CAAC;AAErF,IAAA,MAAM,WAAW,GACb,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;QACrC,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC;QAC5C,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC;AAChD,QAAA,KAAK,CAAC;IAEV,OAAO,aAAa,IAAI,WAAW,CAAC;AACxC;;ACfA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-utils-browser.mjs","sources":["../../../projects/cdk/utils/browser/is-edge.ts","../../../projects/cdk/utils/browser/is-firefox.ts","../../../projects/cdk/utils/browser/is-safari.ts","../../../projects/cdk/utils/browser/taiga-ui-cdk-utils-browser.ts"],"sourcesContent":["export function tuiIsEdge(userAgent: string): boolean {\n return userAgent.toLowerCase().includes('edge');\n}\n","export function tuiIsFirefox(userAgent: string): boolean {\n return userAgent.toLowerCase().includes('firefox');\n}\n","// TODO: Drop change to Document in v5\nexport function tuiIsSafari({ownerDocument: doc}: Element): boolean {\n const win = doc?.defaultView as unknown as Window & {safari?: any};\n\n const isMacOsSafari =\n win.safari !== undefined &&\n win.safari?.pushNotification?.toString() === '[object SafariRemoteNotification]';\n\n const isIosSafari =\n win.navigator?.vendor?.includes('Apple') &&\n !win.navigator?.userAgent?.includes('CriOS') &&\n !win.navigator?.userAgent?.includes('FxiOS');\n\n return isMacOsSafari || isIosSafari;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAM,SAAU,SAAS,CAAC,SAAiB,EAAA;IACvC,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;AACnD;;ACFM,SAAU,YAAY,CAAC,SAAiB,EAAA;IAC1C,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;AACtD;;ACFA;SACgB,WAAW,CAAC,EAAC,aAAa,EAAE,GAAG,EAAU,EAAA;AACrD,IAAA,MAAM,GAAG,GAAG,GAAG,EAAE,WAAiD;AAElE,IAAA,MAAM,aAAa,GACf,GAAG,CAAC,MAAM,KAAK,SAAS;QACxB,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,mCAAmC;IAEpF,MAAM,WAAW,GACb,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;QACxC,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC;QAC5C,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC;IAEhD,OAAO,aAAa,IAAI,WAAW;AACvC;;ACdA;;AAEG;;;;"}
@@ -1,19 +1,59 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { tuiProvideOptions } from '@taiga-ui/cdk/utils/miscellaneous';
1
+ import { inject, InjectionToken, isSignal, signal, effect } from '@angular/core';
2
+ import { tuiSetSignal } from '@taiga-ui/cdk/utils/miscellaneous';
3
+
4
+ function tuiProvideOptions(provide, options, fallback) {
5
+ return {
6
+ provide,
7
+ useFactory: () => ({
8
+ ...(inject(provide, { optional: true, skipSelf: true }) || fallback),
9
+ ...(inject(options, { optional: true }) ||
10
+ (typeof options === 'function' ? options() : options)),
11
+ }),
12
+ };
13
+ }
3
14
 
4
- // TODO: Drop ProviderToken in v.5
5
15
  function tuiCreateOptions(defaults) {
6
- const token = new InjectionToken(ngDevMode ? 'token' : '', {
16
+ const token = new InjectionToken(ngDevMode ? 'Options token' : '', {
7
17
  factory: () => defaults,
8
18
  });
9
19
  return [token, (options) => tuiProvideOptions(token, options, defaults)];
10
20
  }
11
21
 
12
- // TODO: Move all DI utils into this entry point in v.5
22
+ // TODO: Consider {} as default options instead
23
+ function tuiDirectiveBinding(token, key, initial, options = { self: true }) {
24
+ const result = isSignal(initial) ? initial : signal(initial);
25
+ const directive = inject(token, options);
26
+ const output = directive?.[`${key.toString()}Change`];
27
+ if (!directive) {
28
+ return result;
29
+ }
30
+ // TODO: Figure out why effects are executed all the time and not just when result changes (check with Angular 18)
31
+ let previous;
32
+ effect(() => {
33
+ const value = result();
34
+ if (previous === value) {
35
+ return;
36
+ }
37
+ if (isSignal(directive[key])) {
38
+ tuiSetSignal(directive[key], value);
39
+ }
40
+ else {
41
+ directive[key] = value;
42
+ }
43
+ directive.ngOnChanges?.({});
44
+ output?.emit?.(value);
45
+ previous = value;
46
+ });
47
+ return result;
48
+ }
49
+
50
+ function tuiProvide(provide, useExisting, multi = false) {
51
+ return { provide, useExisting, multi };
52
+ }
13
53
 
14
54
  /**
15
55
  * Generated bundle index. Do not edit.
16
56
  */
17
57
 
18
- export { tuiCreateOptions };
58
+ export { tuiCreateOptions, tuiDirectiveBinding, tuiProvide, tuiProvideOptions };
19
59
  //# sourceMappingURL=taiga-ui-cdk-utils-di.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-utils-di.mjs","sources":["../../../projects/cdk/utils/di/create-options.ts","../../../projects/cdk/utils/di/index.ts","../../../projects/cdk/utils/di/taiga-ui-cdk-utils-di.ts"],"sourcesContent":["import {type FactoryProvider, InjectionToken, type ProviderToken} from '@angular/core';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\n\n// TODO: Drop ProviderToken in v.5\nexport function tuiCreateOptions<T>(\n defaults: T,\n): [\n token: InjectionToken<T>,\n provider: (\n item: Partial<T> | ProviderToken<Partial<T>> | (() => Partial<T>),\n ) => FactoryProvider,\n] {\n const token = new InjectionToken(ngDevMode ? 'token' : '', {\n factory: () => defaults,\n });\n\n return [token, (options) => tuiProvideOptions(token, options, defaults)];\n}\n","// TODO: Move all DI utils into this entry point in v.5\nexport * from './create-options';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGA;AACM,SAAU,gBAAgB,CAC5B,QAAW,EAAA;AAOX,IAAA,MAAM,KAAK,GAAG,IAAI,cAAc,CAAC,SAAS,GAAG,OAAO,GAAG,EAAE,EAAE;AACvD,QAAA,OAAO,EAAE,MAAM,QAAQ;AAC1B,KAAA,CAAC,CAAC;AAEH,IAAA,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,KAAK,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7E;;ACjBA;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-utils-di.mjs","sources":["../../../projects/cdk/utils/di/provide-options.ts","../../../projects/cdk/utils/di/create-options.ts","../../../projects/cdk/utils/di/directive-binding.ts","../../../projects/cdk/utils/di/provide.ts","../../../projects/cdk/utils/di/taiga-ui-cdk-utils-di.ts"],"sourcesContent":["import {type FactoryProvider, inject, type InjectionToken} from '@angular/core';\n\nexport function tuiProvideOptions<T>(\n provide: InjectionToken<T>,\n options: Partial<T> | (() => Partial<T>),\n fallback: T,\n): FactoryProvider {\n return {\n provide,\n useFactory: (): T => ({\n ...(inject(provide, {optional: true, skipSelf: true}) || fallback),\n ...(inject(options as any, {optional: true}) ||\n (typeof options === 'function' ? options() : options)),\n }),\n };\n}\n","import {type FactoryProvider, InjectionToken} from '@angular/core';\n\nimport {tuiProvideOptions} from './provide-options';\n\nexport function tuiCreateOptions<T>(\n defaults: T,\n): [\n token: InjectionToken<T>,\n provider: (item: Partial<T> | (() => Partial<T>)) => FactoryProvider,\n] {\n const token = new InjectionToken(ngDevMode ? 'Options token' : '', {\n factory: () => defaults,\n });\n\n return [token, (options) => tuiProvideOptions(token, options, defaults)];\n}\n","import {\n effect,\n inject,\n type InjectOptions,\n isSignal,\n type ProviderToken,\n type Signal,\n signal,\n type WritableSignal,\n} from '@angular/core';\nimport {tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\n\ntype SignalLikeTypeOf<T> = T extends Signal<infer R> ? R : T;\n\ntype SignalLike<T> = Signal<T> | T;\n\n// TODO: Consider {} as default options instead\nexport function tuiDirectiveBinding<\n T,\n G extends keyof T,\n I extends SignalLike<SignalLikeTypeOf<T[G]>>,\n>(\n token: ProviderToken<T>,\n key: G,\n initial: I,\n options: InjectOptions = {self: true},\n): I extends Signal<any> ? I : WritableSignal<I> {\n const result: any = isSignal(initial) ? initial : signal(initial);\n const directive: any = inject(token, options);\n const output = directive?.[`${key.toString()}Change`];\n\n if (!directive) {\n return result;\n }\n\n // TODO: Figure out why effects are executed all the time and not just when result changes (check with Angular 18)\n let previous: any;\n\n effect(() => {\n const value: any = result();\n\n if (previous === value) {\n return;\n }\n\n if (isSignal(directive[key])) {\n tuiSetSignal(directive[key] as any, value);\n } else {\n directive[key] = value;\n }\n\n directive.ngOnChanges?.({});\n output?.emit?.(value);\n previous = value;\n });\n\n return result;\n}\n","import {type ExistingProvider, type ProviderToken} from '@angular/core';\n\nexport function tuiProvide<T>(\n provide: ProviderToken<T>,\n useExisting: ProviderToken<T>,\n): ExistingProvider;\nexport function tuiProvide<T>(\n provide: ProviderToken<T | T[]>,\n useExisting: ProviderToken<T>,\n multi: boolean,\n): ExistingProvider;\nexport function tuiProvide<T>(\n provide: ProviderToken<T>,\n useExisting: ProviderToken<T>,\n multi = false,\n): ExistingProvider {\n return {provide, useExisting, multi};\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;SAEgB,iBAAiB,CAC7B,OAA0B,EAC1B,OAAwC,EACxC,QAAW,EAAA;IAEX,OAAO;QACH,OAAO;AACP,QAAA,UAAU,EA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AC,GAAG,CAAC,CAAC,EAAE;YAC1B,YAAY,CAAC,SAAS,CAAC,GAAG,CAAQ,EAAE,KAAK,CAAC;;aACvC;AACH,YAAA,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK;;AAG1B,QAAA,SAAS,CAAC,WAAW,GAAG,EAAE,CAAC;AAC3B,QAAA,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC;QACrB,QAAQ,GAAG,KAAK;AACpB,KAAC,CAAC;AAEF,IAAA,OAAO,MAAM;AACjB;;AC9CM,SAAU,UAAU,CACtB,OAAyB,EACzB,WAA6B,EAC7B,KAAK,GAAG,KAAK,EAAA;AAEb,IAAA,OAAO,EAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC;AACxC;;ACjBA;;AAEG;;;;"}
@@ -1,11 +1,10 @@
1
- import { tuiClamp } from '@taiga-ui/cdk/utils/math';
2
1
  import { tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
3
2
  import { inject, ElementRef, PLATFORM_ID, isSignal, signal, untracked, DestroyRef, effect, INJECTOR } from '@angular/core';
4
3
  import { coerceElement } from '@angular/cdk/coercion';
5
4
  import { isPlatformBrowser } from '@angular/common';
6
5
  import { WA_WINDOW } from '@ng-web-apis/common';
7
- import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
8
6
 
7
+ /* eslint-disable no-bitwise */
9
8
  function tuiContainsOrAfter(current, node) {
10
9
  try {
11
10
  return (current.contains(node) ||
@@ -73,33 +72,26 @@ function tuiGetDocumentOrShadowRoot(node) {
73
72
  * ```
74
73
  */
75
74
  function tuiGetElementObscures(element) {
76
- const { ownerDocument } = element;
77
- if (!ownerDocument?.defaultView || !element.getBoundingClientRect) {
75
+ if (!element.getBoundingClientRect) {
78
76
  return null;
79
77
  }
80
- const { innerWidth, innerHeight } = ownerDocument.defaultView;
81
- const doc = tuiGetDocumentOrShadowRoot(element);
82
- const rect = element.getBoundingClientRect();
83
- if (rect.width === 0 && rect.height === 0) {
78
+ const { left, right, top, bottom, width, height } = element.getBoundingClientRect();
79
+ if (width === 0 && height === 0) {
84
80
  return null;
85
81
  }
86
- const left = tuiClamp(Math.round(rect.left) + 2, 0, innerWidth);
87
- const top = tuiClamp(Math.round(rect.top) + 2, 0, innerHeight);
88
- const right = tuiClamp(Math.round(rect.right) - 2, 0, innerWidth);
89
- const bottom = tuiClamp(Math.round(rect.bottom) - 2, 0, innerHeight);
90
- const horizontalMiddle = tuiClamp(Math.round(rect.left + rect.width / 2), 0, innerWidth);
91
- const verticalMiddle = tuiClamp(Math.round(rect.top + rect.height / 2), 0, innerHeight);
82
+ const doc = tuiGetDocumentOrShadowRoot(element);
83
+ const horizontalMiddle = Math.round(left + width / 2);
84
+ const verticalMiddle = Math.round(top + height / 2);
92
85
  const elements = [
93
- doc.elementFromPoint(horizontalMiddle, top),
94
- doc.elementFromPoint(horizontalMiddle, bottom),
95
- doc.elementFromPoint(left, verticalMiddle),
96
- doc.elementFromPoint(right, verticalMiddle),
97
- ];
98
- const nonNull = elements.filter(tuiIsPresent);
99
- if (!nonNull.length) {
86
+ doc.elementFromPoint(horizontalMiddle, Math.round(top) + 2),
87
+ doc.elementFromPoint(horizontalMiddle, Math.round(bottom) - 2),
88
+ doc.elementFromPoint(Math.round(left) + 2, verticalMiddle),
89
+ doc.elementFromPoint(Math.round(right) - 2, verticalMiddle),
90
+ ].filter(tuiIsPresent);
91
+ if (!elements.length) {
100
92
  return [];
101
93
  }
102
- const filtered = nonNull.filter((el) => !element.contains(el) && !el.contains(element));
94
+ const filtered = elements.filter((el) => !element.contains(el) && !el.contains(element));
103
95
  return filtered.length === 4
104
96
  ? filtered
105
97
  : null;
@@ -124,11 +116,6 @@ function tuiGetElementOffset(host, element) {
124
116
  return { offsetTop, offsetLeft };
125
117
  }
126
118
 
127
- function tuiGetElementPoint(x, y, element) {
128
- const { left, top, width, height } = element.getBoundingClientRect();
129
- return [tuiClamp(x - left, 0, width) / width, tuiClamp(y - top, 0, height) / height];
130
- }
131
-
132
119
  /**
133
120
  * @description:
134
121
  * cross browser way to get selected text
@@ -147,35 +134,11 @@ function tuiInjectElement() {
147
134
  return inject(ElementRef).nativeElement;
148
135
  }
149
136
 
150
- function tuiIsCurrentTarget({ target, currentTarget }) {
151
- return target === currentTarget;
152
- }
153
-
154
137
  function tuiIsElementEditable(element) {
155
138
  return ((tuiIsTextfield(element) && !element.readOnly && element.inputMode !== 'none') ||
156
139
  Boolean(element.isContentEditable));
157
140
  }
158
141
 
159
- /**
160
- * Checks if an app is running inside <iframe /> tag
161
- */
162
- function tuiIsInsideIframe(win) {
163
- return win.parent !== win;
164
- }
165
-
166
- /**
167
- * Checks if node is inside a specific selector
168
- *
169
- * @param node
170
- * @param selector
171
- * @return true if node is inside a particular selector
172
- */
173
- function tuiIsNodeIn(node, selector) {
174
- return tuiIsTextNode(node)
175
- ? !!node.parentElement?.closest(selector)
176
- : tuiIsElement(node) && !!node.closest(selector);
177
- }
178
-
179
142
  function tuiPointToClientRect(x = 0, y = 0) {
180
143
  const rect = {
181
144
  x,
@@ -193,22 +156,6 @@ function tuiPointToClientRect(x = 0, y = 0) {
193
156
  };
194
157
  }
195
158
 
196
- function tuiRetargetedBoundaryCrossing(event) {
197
- // firefox
198
- if ('explicitOriginalTarget' in event) {
199
- return event?.explicitOriginalTarget !== event.target;
200
- }
201
- // chrome
202
- if ('pointerId' in event) {
203
- return event.pointerId === -1;
204
- }
205
- // safari
206
- if ('detail' in event && 'webkitForce' in event) {
207
- return event?.detail === 0;
208
- }
209
- return false;
210
- }
211
-
212
159
  function tuiValue(input, injector = inject(INJECTOR)) {
213
160
  const win = injector.get(WA_WINDOW);
214
161
  if (!win.tuiInputPatched && isPlatformBrowser(injector.get(PLATFORM_ID))) {
@@ -219,7 +166,7 @@ function tuiValue(input, injector = inject(INJECTOR)) {
219
166
  }
220
167
  let element = isSignal(input) ? undefined : coerceElement(input);
221
168
  let cleanup = () => { };
222
- const options = { injector, ...TUI_ALLOW_SIGNAL_WRITES };
169
+ const options = { injector };
223
170
  const value = signal(element?.value || '');
224
171
  const process = (el) => {
225
172
  const update = () => untracked(() => value.set(el.value));
@@ -282,36 +229,9 @@ function patch(prototype) {
282
229
  });
283
230
  }
284
231
 
285
- /**
286
- * Host binding `host: {'[value]': 'yourSignal()'}` is not an option for our textfields –
287
- * they use {@link TuiTextfieldDirective} as a host directive.
288
- * `TuiTextfieldDirective` has host binding which depends on native input's value.
289
- * Host bindings of the host directives are re-calculated BEFORE component's ones –
290
- * native input's value should be updated SYNCHRONOUSLY before next change detection iteration.
291
- * @deprecated
292
- */
293
- function tuiValueBinding(value = signal(tuiInjectElement().value || '')) {
294
- const el = tuiInjectElement();
295
- effect(() => {
296
- if (el.value === value()) {
297
- return;
298
- }
299
- const { selectionStart, selectionEnd } = el;
300
- el.value = value();
301
- if (el.matches(':focus')) {
302
- /**
303
- * After programmatic updates of input's value, caret is automatically placed at the end –
304
- * revert to the previous position
305
- */
306
- el.setSelectionRange(selectionStart, selectionEnd);
307
- }
308
- });
309
- return value;
310
- }
311
-
312
232
  /**
313
233
  * Generated bundle index. Do not edit.
314
234
  */
315
235
 
316
- export { tuiContainsOrAfter, tuiGetActualTarget, tuiGetClipboardDataText, tuiGetDocumentOrShadowRoot, tuiGetElementObscures, tuiGetElementOffset, tuiGetElementPoint, tuiGetSelectedText, tuiInjectElement, tuiIsCurrentTarget, tuiIsElement, tuiIsElementEditable, tuiIsHTMLElement, tuiIsInput, tuiIsInputEvent, tuiIsInsideIframe, tuiIsNodeIn, tuiIsTextNode, tuiIsTextarea, tuiIsTextfield, tuiPointToClientRect, tuiRetargetedBoundaryCrossing, tuiValue, tuiValueBinding };
236
+ export { tuiContainsOrAfter, tuiGetActualTarget, tuiGetClipboardDataText, tuiGetDocumentOrShadowRoot, tuiGetElementObscures, tuiGetElementOffset, tuiGetSelectedText, tuiInjectElement, tuiIsElement, tuiIsElementEditable, tuiIsHTMLElement, tuiIsInput, tuiIsInputEvent, tuiIsTextNode, tuiIsTextarea, tuiIsTextfield, tuiPointToClientRect, tuiValue };
317
237
  //# sourceMappingURL=taiga-ui-cdk-utils-dom.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-utils-dom.mjs","sources":["../../../projects/cdk/utils/dom/contains-or-after.ts","../../../projects/cdk/utils/dom/element-checks.ts","../../../projects/cdk/utils/dom/event-checks.ts","../../../projects/cdk/utils/dom/get-actual-target.ts","../../../projects/cdk/utils/dom/get-clipboard-data-text.ts","../../../projects/cdk/utils/dom/get-document-or-shadow-root.ts","../../../projects/cdk/utils/dom/get-element-obscurers.ts","../../../projects/cdk/utils/dom/get-element-offset.ts","../../../projects/cdk/utils/dom/get-element-point.ts","../../../projects/cdk/utils/dom/get-selected-text.ts","../../../projects/cdk/utils/dom/inject-element.ts","../../../projects/cdk/utils/dom/is-current-target.ts","../../../projects/cdk/utils/dom/is-element-editable.ts","../../../projects/cdk/utils/dom/is-inside-iframe.ts","../../../projects/cdk/utils/dom/is-node-in.ts","../../../projects/cdk/utils/dom/point-to-client-rect.ts","../../../projects/cdk/utils/dom/retarget-boundary-crossing.ts","../../../projects/cdk/utils/dom/value.ts","../../../projects/cdk/utils/dom/value-binding.ts","../../../projects/cdk/utils/dom/taiga-ui-cdk-utils-dom.ts"],"sourcesContent":["export function tuiContainsOrAfter(current: Node, node: Node): boolean {\n try {\n return (\n current.contains(node) ||\n !!(node.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_PRECEDING)\n );\n } catch {\n return false;\n }\n}\n","export function tuiIsInput(element: Element): element is HTMLInputElement {\n return element.matches('input');\n}\n\nexport function tuiIsTextarea(element: Element): element is HTMLTextAreaElement {\n return element.matches('textarea');\n}\n\nexport function tuiIsTextfield(\n element: Element,\n): element is HTMLInputElement | HTMLTextAreaElement {\n return tuiIsInput(element) || tuiIsTextarea(element);\n}\n\nexport function tuiIsElement(\n node?: Element | EventTarget | Node | null,\n): node is Element {\n return !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;\n}\n\nexport function tuiIsHTMLElement(node: unknown): node is HTMLElement {\n const defaultView = (node as Element | undefined)?.ownerDocument.defaultView;\n\n return !!node && !!defaultView && node instanceof defaultView.HTMLElement;\n}\n\nexport function tuiIsTextNode(node: Node): node is Text {\n return node.nodeType === Node.TEXT_NODE;\n}\n","export function tuiIsInputEvent(event: Event): event is InputEvent {\n return 'data' in event && 'inputType' in event;\n}\n","/**\n * Gets actual target from open Shadow DOM if event happened within it\n */\nexport function tuiGetActualTarget(event: Event): Node {\n return event.composedPath()[0] as Node;\n}\n","const DEFAULT_FORMAT = 'text/plain';\n\n/**\n * Gets text from data of clipboardEvent, it also works in IE and Edge browsers\n */\nexport function tuiGetClipboardDataText(\n event: ClipboardEvent,\n format: string = DEFAULT_FORMAT,\n): string {\n return 'clipboardData' in event && event.clipboardData !== null\n ? event.clipboardData.getData(format) ||\n event.clipboardData.getData(DEFAULT_FORMAT)\n : (event as any).target.ownerDocument.defaultView.clipboardData.getData('text');\n}\n","export function tuiGetDocumentOrShadowRoot(node: Node): DocumentOrShadowRoot {\n return 'getRootNode' in node && node.isConnected\n ? (node.getRootNode() as Document)\n : (node.ownerDocument as DocumentOrShadowRoot);\n}\n","import {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {tuiIsPresent} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {tuiGetDocumentOrShadowRoot} from './get-document-or-shadow-root';\n\n/**\n * Returns array of Elements covering edges of given element or null if at least one edge middle point is visible\n *\n * CAUTION: Empty array means element if offscreen i.e. covered by no elements, rather than not covered\n * ```ts\n * function tuiGetElementObscures(element: Element): readonly [Element, Element, Element, Element] | [] | null\n * ```\n */\nexport function tuiGetElementObscures(\n element: Element,\n): readonly [Element, Element, Element, Element] | [] | null {\n const {ownerDocument} = element;\n\n if (!ownerDocument?.defaultView || !element.getBoundingClientRect) {\n return null;\n }\n\n const {innerWidth, innerHeight} = ownerDocument.defaultView;\n const doc = tuiGetDocumentOrShadowRoot(element);\n const rect = element.getBoundingClientRect();\n\n if (rect.width === 0 && rect.height === 0) {\n return null;\n }\n\n const left = tuiClamp(Math.round(rect.left) + 2, 0, innerWidth);\n const top = tuiClamp(Math.round(rect.top) + 2, 0, innerHeight);\n const right = tuiClamp(Math.round(rect.right) - 2, 0, innerWidth);\n const bottom = tuiClamp(Math.round(rect.bottom) - 2, 0, innerHeight);\n const horizontalMiddle = tuiClamp(\n Math.round(rect.left + rect.width / 2),\n 0,\n innerWidth,\n );\n const verticalMiddle = tuiClamp(\n Math.round(rect.top + rect.height / 2),\n 0,\n innerHeight,\n );\n const elements = [\n doc.elementFromPoint(horizontalMiddle, top),\n doc.elementFromPoint(horizontalMiddle, bottom),\n doc.elementFromPoint(left, verticalMiddle),\n doc.elementFromPoint(right, verticalMiddle),\n ];\n const nonNull = elements.filter(tuiIsPresent);\n\n if (!nonNull.length) {\n return [];\n }\n\n const filtered = nonNull.filter(\n (el) => !element.contains(el) && !el.contains(element),\n );\n\n return filtered.length === 4\n ? (filtered as [Element, Element, Element, Element])\n : null;\n}\n","/// <reference types=\"@taiga-ui/tsconfig/ng-dev-mode\" />\n\nimport {tuiIsHTMLElement} from './element-checks';\n\n/**\n * Calculates offset for an element relative to it's parent several levels above\n *\n * @param host parent element\n * @param element\n * @return object with offsetTop and offsetLeft number properties\n */\nexport function tuiGetElementOffset(\n host: Element,\n element: HTMLElement,\n): {offsetLeft: number; offsetTop: number} {\n ngDevMode && console.assert(host.contains(element), 'Host must contain element');\n\n let {offsetTop, offsetLeft, offsetParent} = element;\n\n while (tuiIsHTMLElement(offsetParent) && offsetParent !== host) {\n offsetTop += offsetParent.offsetTop;\n offsetLeft += offsetParent.offsetLeft;\n offsetParent = offsetParent.offsetParent;\n }\n\n return {offsetTop, offsetLeft};\n}\n","import {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {type TuiPoint} from '@taiga-ui/core/types';\n\nexport function tuiGetElementPoint(x: number, y: number, element: HTMLElement): TuiPoint {\n const {left, top, width, height} = element.getBoundingClientRect();\n\n return [tuiClamp(x - left, 0, width) / width, tuiClamp(y - top, 0, height) / height];\n}\n","import {tuiIsTextfield} from './element-checks';\n\n/**\n * @description:\n * cross browser way to get selected text\n *\n * History:\n * BUG - window.getSelection() fails when text selected in a form field\n * https://bugzilla.mozilla.org/show_bug.cgi?id=85686\n */\nexport function tuiGetSelectedText({getSelection, document}: Window): string | null {\n return document.activeElement && tuiIsTextfield(document.activeElement)\n ? document.activeElement.value.slice(\n document.activeElement.selectionStart || 0,\n document.activeElement.selectionEnd || 0,\n )\n : getSelection()?.toString() || null;\n}\n","import {ElementRef, inject} from '@angular/core';\n\nexport function tuiInjectElement<T = HTMLElement>(): T {\n return inject(ElementRef).nativeElement;\n}\n","export function tuiIsCurrentTarget({target, currentTarget}: Event): boolean {\n return target === currentTarget;\n}\n","import {tuiIsTextfield} from './element-checks';\n\nexport function tuiIsElementEditable(element: HTMLElement): boolean {\n return (\n (tuiIsTextfield(element) && !element.readOnly && element.inputMode !== 'none') ||\n Boolean(element.isContentEditable as unknown as string)\n );\n}\n","/**\n * Checks if an app is running inside <iframe /> tag\n */\nexport function tuiIsInsideIframe(win: Window): boolean {\n return win.parent !== win;\n}\n","import {tuiIsElement, tuiIsTextNode} from './element-checks';\n\n/**\n * Checks if node is inside a specific selector\n *\n * @param node\n * @param selector\n * @return true if node is inside a particular selector\n */\nexport function tuiIsNodeIn(node: Node, selector: string): boolean {\n return tuiIsTextNode(node)\n ? !!node.parentElement?.closest(selector)\n : tuiIsElement(node) && !!node.closest(selector);\n}\n","export function tuiPointToClientRect(x = 0, y = 0): DOMRect {\n const rect = {\n x,\n y,\n left: x,\n right: x,\n top: y,\n bottom: y,\n width: 0,\n height: 0,\n } as const;\n\n return {\n ...rect,\n toJSON: () => rect,\n };\n}\n","export function tuiRetargetedBoundaryCrossing(event: Event): boolean {\n // firefox\n if ('explicitOriginalTarget' in event) {\n return event?.explicitOriginalTarget !== event.target;\n }\n\n // chrome\n if ('pointerId' in event) {\n return event.pointerId === -1;\n }\n\n // safari\n if ('detail' in event && 'webkitForce' in event) {\n return event?.detail === 0;\n }\n\n return false;\n}\n","import {coerceElement} from '@angular/cdk/coercion';\nimport {isPlatformBrowser} from '@angular/common';\nimport {\n DestroyRef,\n effect,\n type ElementRef,\n inject,\n INJECTOR,\n isSignal,\n PLATFORM_ID,\n type Signal,\n signal,\n untracked,\n type WritableSignal,\n} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\n\ntype WithValue = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n\nexport function tuiValue(\n input:\n | ElementRef<WithValue>\n | Signal<ElementRef<WithValue> | undefined>\n | Signal<WithValue | undefined>\n | WithValue,\n injector = inject(INJECTOR),\n): WritableSignal<string> {\n const win = injector.get<any>(WA_WINDOW);\n\n if (!win.tuiInputPatched && isPlatformBrowser(injector.get(PLATFORM_ID))) {\n win.tuiInputPatched = true;\n\n patch(win.HTMLInputElement.prototype);\n patch(win.HTMLTextAreaElement.prototype);\n patch(win.HTMLSelectElement.prototype);\n }\n\n let element = isSignal(input) ? undefined : coerceElement(input);\n let cleanup = (): void => {};\n\n const options = {injector, ...TUI_ALLOW_SIGNAL_WRITES};\n const value = signal(element?.value || '');\n const process = (el: WithValue): (() => void) => {\n const update = (): void => untracked(() => value.set(el.value));\n\n el.addEventListener('input', update, {capture: true});\n el.addEventListener('tui-input', update, {capture: true});\n\n return (): void => {\n el.removeEventListener('input', update, {capture: true});\n el.removeEventListener('tui-input', update, {capture: true});\n };\n };\n\n injector.get(DestroyRef).onDestroy(() => cleanup());\n\n if (isSignal(input)) {\n effect(() => {\n element = coerceElement(input());\n cleanup();\n\n if (element && !element.matches('select[multiple]')) {\n value.set(element.value);\n cleanup = process(element);\n }\n }, options);\n } else if (element && !element.matches('select[multiple]')) {\n cleanup = process(element);\n }\n\n effect(() => {\n const v = value();\n\n /**\n * select[multiple] elements have value of first selected option,\n * but there could be more, setting value resets other selected options\n */\n if (element?.matches('select[multiple]')) {\n return;\n }\n\n if (element?.matches(':focus') && 'selectionStart' in element) {\n const {selectionStart, selectionEnd} = element;\n\n /**\n * After programmatic updates of input's value, caret is automatically placed at the end –\n * revert to the previous position\n */\n element.value = v;\n element.setSelectionRange(selectionStart, selectionEnd);\n } else if (element) {\n element.value = v;\n }\n }, options);\n\n return value;\n}\n\nfunction patch(prototype: WithValue): void {\n const {set} = Object.getOwnPropertyDescriptor(prototype, 'value')!;\n\n Object.defineProperty(prototype, 'value', {\n set(this: WithValue, detail: string) {\n const value = this.value;\n const event = new CustomEvent('tui-input', {detail, bubbles: true});\n\n set!.call(this, detail);\n\n if (value !== detail) {\n this.dispatchEvent(event);\n }\n },\n });\n}\n","import {effect, type Signal, signal, type WritableSignal} from '@angular/core';\n\nimport {tuiInjectElement} from './inject-element';\n\nexport function tuiValueBinding(value?: WritableSignal<string>): WritableSignal<string>;\nexport function tuiValueBinding(value?: Signal<string>): Signal<string>;\n\n/**\n * Host binding `host: {'[value]': 'yourSignal()'}` is not an option for our textfields –\n * they use {@link TuiTextfieldDirective} as a host directive.\n * `TuiTextfieldDirective` has host binding which depends on native input's value.\n * Host bindings of the host directives are re-calculated BEFORE component's ones –\n * native input's value should be updated SYNCHRONOUSLY before next change detection iteration.\n * @deprecated\n */\nexport function tuiValueBinding(\n value: Signal<string> = signal(tuiInjectElement<HTMLInputElement>().value || ''),\n): Signal<string> {\n const el = tuiInjectElement<HTMLInputElement>();\n\n effect(() => {\n if (el.value === value()) {\n return;\n }\n\n const {selectionStart, selectionEnd} = el;\n\n el.value = value();\n\n if (el.matches(':focus')) {\n /**\n * After programmatic updates of input's value, caret is automatically placed at the end –\n * revert to the previous position\n */\n el.setSelectionRange(selectionStart, selectionEnd);\n }\n });\n\n return value;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAgB,SAAA,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or-after.ts","../../../projects/cdk/utils/dom/element-checks.ts","../../../projects/cdk/utils/dom/event-checks.ts","../../../projects/cdk/utils/dom/get-actual-target.ts","../../../projects/cdk/utils/dom/get-clipboard-data-text.ts","../../../projects/cdk/utils/dom/get-document-or-shadow-root.ts","../../../projects/cdk/utils/dom/get-element-obscurers.ts","../../../projects/cdk/utils/dom/get-element-offset.ts","../../../projects/cdk/utils/dom/get-selected-text.ts","../../../projects/cdk/utils/dom/inject-element.ts","../../../projects/cdk/utils/dom/is-element-editable.ts","../../../projects/cdk/utils/dom/point-to-client-rect.ts","../../../projects/cdk/utils/dom/value.ts","../../../projects/cdk/utils/dom/taiga-ui-cdk-utils-dom.ts"],"sourcesContent":["/* eslint-disable no-bitwise */\nexport function tuiContainsOrAfter(current: Node, node: Node): boolean {\n try {\n return (\n current.contains(node) ||\n !!(node.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_PRECEDING)\n );\n } catch {\n return false;\n }\n}\n","export function tuiIsInput(element: Element): element is HTMLInputElement {\n return element.matches('input');\n}\n\nexport function tuiIsTextarea(element: Element): element is HTMLTextAreaElement {\n return element.matches('textarea');\n}\n\nexport function tuiIsTextfield(\n element: Element,\n): element is HTMLInputElement | HTMLTextAreaElement {\n return tuiIsInput(element) || tuiIsTextarea(element);\n}\n\nexport function tuiIsElement(\n node?: Element | EventTarget | Node | null,\n): node is Element {\n return !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;\n}\n\nexport function tuiIsHTMLElement(node: unknown): node is HTMLElement {\n const defaultView = (node as Element | undefined)?.ownerDocument.defaultView;\n\n return !!node && !!defaultView && node instanceof defaultView.HTMLElement;\n}\n\nexport function tuiIsTextNode(node: Node): node is Text {\n return node.nodeType === Node.TEXT_NODE;\n}\n","export function tuiIsInputEvent(event: Event): event is InputEvent {\n return 'data' in event && 'inputType' in event;\n}\n","/**\n * Gets actual target from open Shadow DOM if event happened within it\n */\nexport function tuiGetActualTarget(event: Event): Node {\n return event.composedPath()[0] as Node;\n}\n","const DEFAULT_FORMAT = 'text/plain';\n\n/**\n * Gets text from data of clipboardEvent, it also works in IE and Edge browsers\n */\nexport function tuiGetClipboardDataText(\n event: ClipboardEvent,\n format: string = DEFAULT_FORMAT,\n): string {\n return 'clipboardData' in event && event.clipboardData !== null\n ? event.clipboardData.getData(format) ||\n event.clipboardData.getData(DEFAULT_FORMAT)\n : (event as any).target.ownerDocument.defaultView.clipboardData.getData('text');\n}\n","export function tuiGetDocumentOrShadowRoot(node: Node): DocumentOrShadowRoot {\n return 'getRootNode' in node && node.isConnected\n ? (node.getRootNode() as Document)\n : (node.ownerDocument as DocumentOrShadowRoot);\n}\n","import {tuiIsPresent} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {tuiGetDocumentOrShadowRoot} from './get-document-or-shadow-root';\n\n/**\n * Returns array of Elements covering edges of given element or null if at least one edge middle point is visible\n *\n * CAUTION: Empty array means element if offscreen i.e. covered by no elements, rather than not covered\n * ```ts\n * function tuiGetElementObscures(element: Element): readonly [Element, Element, Element, Element] | [] | null\n * ```\n */\nexport function tuiGetElementObscures(element: Element): readonly Element[] | null {\n if (!element.getBoundingClientRect) {\n return null;\n }\n\n const {left, right, top, bottom, width, height} = element.getBoundingClientRect();\n\n if (width === 0 && height === 0) {\n return null;\n }\n\n const doc = tuiGetDocumentOrShadowRoot(element);\n const horizontalMiddle = Math.round(left + width / 2);\n const verticalMiddle = Math.round(top + height / 2);\n const elements = [\n doc.elementFromPoint(horizontalMiddle, Math.round(top) + 2),\n doc.elementFromPoint(horizontalMiddle, Math.round(bottom) - 2),\n doc.elementFromPoint(Math.round(left) + 2, verticalMiddle),\n doc.elementFromPoint(Math.round(right) - 2, verticalMiddle),\n ].filter(tuiIsPresent);\n\n if (!elements.length) {\n return [];\n }\n\n const filtered = elements.filter(\n (el) => !element.contains(el) && !el.contains(element),\n );\n\n return filtered.length === 4\n ? (filtered as [Element, Element, Element, Element])\n : null;\n}\n","/// <reference types=\"@taiga-ui/tsconfig/ng-dev-mode\" />\n\nimport {tuiIsHTMLElement} from './element-checks';\n\n/**\n * Calculates offset for an element relative to it's parent several levels above\n *\n * @param host parent element\n * @param element\n * @return object with offsetTop and offsetLeft number properties\n */\nexport function tuiGetElementOffset(\n host: Element,\n element: HTMLElement,\n): {offsetLeft: number; offsetTop: number} {\n ngDevMode && console.assert(host.contains(element), 'Host must contain element');\n\n let {offsetTop, offsetLeft, offsetParent} = element;\n\n while (tuiIsHTMLElement(offsetParent) && offsetParent !== host) {\n offsetTop += offsetParent.offsetTop;\n offsetLeft += offsetParent.offsetLeft;\n offsetParent = offsetParent.offsetParent;\n }\n\n return {offsetTop, offsetLeft};\n}\n","import {tuiIsTextfield} from './element-checks';\n\n/**\n * @description:\n * cross browser way to get selected text\n *\n * History:\n * BUG - window.getSelection() fails when text selected in a form field\n * https://bugzilla.mozilla.org/show_bug.cgi?id=85686\n */\nexport function tuiGetSelectedText({getSelection, document}: Window): string | null {\n return document.activeElement && tuiIsTextfield(document.activeElement)\n ? document.activeElement.value.slice(\n document.activeElement.selectionStart || 0,\n document.activeElement.selectionEnd || 0,\n )\n : getSelection()?.toString() || null;\n}\n","import {ElementRef, inject} from '@angular/core';\n\nexport function tuiInjectElement<T = HTMLElement>(): T {\n return inject(ElementRef).nativeElement;\n}\n","import {tuiIsTextfield} from './element-checks';\n\nexport function tuiIsElementEditable(element: HTMLElement): boolean {\n return (\n (tuiIsTextfield(element) && !element.readOnly && element.inputMode !== 'none') ||\n Boolean(element.isContentEditable as unknown as string)\n );\n}\n","export function tuiPointToClientRect(x = 0, y = 0): DOMRect {\n const rect = {\n x,\n y,\n left: x,\n right: x,\n top: y,\n bottom: y,\n width: 0,\n height: 0,\n } as const;\n\n return {\n ...rect,\n toJSON: () => rect,\n };\n}\n","import {coerceElement} from '@angular/cdk/coercion';\nimport {isPlatformBrowser} from '@angular/common';\nimport {\n DestroyRef,\n effect,\n type ElementRef,\n inject,\n INJECTOR,\n isSignal,\n PLATFORM_ID,\n type Signal,\n signal,\n untracked,\n type WritableSignal,\n} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\n\ntype WithValue = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n\nexport function tuiValue(\n input:\n | ElementRef<WithValue>\n | Signal<ElementRef<WithValue> | undefined>\n | Signal<WithValue | undefined>\n | WithValue,\n injector = inject(INJECTOR),\n): WritableSignal<string> {\n const win = injector.get<any>(WA_WINDOW);\n\n if (!win.tuiInputPatched && isPlatformBrowser(injector.get(PLATFORM_ID))) {\n win.tuiInputPatched = true;\n\n patch(win.HTMLInputElement.prototype);\n patch(win.HTMLTextAreaElement.prototype);\n patch(win.HTMLSelectElement.prototype);\n }\n\n let element = isSignal(input) ? undefined : coerceElement(input);\n let cleanup = (): void => {};\n\n const options = {injector};\n const value = signal(element?.value || '');\n const process = (el: WithValue): (() => void) => {\n const update = (): void => untracked(() => value.set(el.value));\n\n el.addEventListener('input', update, {capture: true});\n el.addEventListener('tui-input', update, {capture: true});\n\n return (): void => {\n el.removeEventListener('input', update, {capture: true});\n el.removeEventListener('tui-input', update, {capture: true});\n };\n };\n\n injector.get(DestroyRef).onDestroy(() => cleanup());\n\n if (isSignal(input)) {\n effect(() => {\n element = coerceElement(input());\n cleanup();\n\n if (element && !element.matches('select[multiple]')) {\n value.set(element.value);\n cleanup = process(element);\n }\n }, options);\n } else if (element && !element.matches('select[multiple]')) {\n cleanup = process(element);\n }\n\n effect(() => {\n const v = value();\n\n /**\n * select[multiple] elements have value of first selected option,\n * but there could be more, setting value resets other selected options\n */\n if (element?.matches('select[multiple]')) {\n return;\n }\n\n if (element?.matches(':focus') && 'selectionStart' in element) {\n const {selectionStart, selectionEnd} = element;\n\n /**\n * After programmatic updates of input's value, caret is automatically placed at the end –\n * revert to the previous position\n */\n element.value = v;\n element.setSelectionRange(selectionStart, selectionEnd);\n } else if (element) {\n element.value = v;\n }\n }, options);\n\n return value;\n}\n\nfunction patch(prototype: WithValue): void {\n const {set} = Object.getOwnPropertyDescriptor(prototype, 'value')!;\n\n Object.defineProperty(prototype, 'value', {\n set(this: WithValue, detail: string) {\n const value = this.value;\n const event = new CustomEvent('tui-input', {detail, bubbles: true});\n\n set!.call(this, detail);\n\n if (value !== detail) {\n this.dispatchEvent(event);\n }\n },\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACgB,SAAA,kBAAkB,CAAC,OAAa,EAAE,IAAU,EAAA;AACxD,IAAA,IAAI;AACA,QAAA,QACI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;AACtB,YAAA,CAAC,EAAE,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,2BAA2B,CAAC;;AAElF,IAAA,MAAM;AACJ,QAAA,OAAO,KAAK;;AAEpB;;ACVM,SAAU,UAAU,CAAC,OAAgB,EAAA;AACvC,IAAA,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;AACnC;AAEM,SAAU,aAAa,CAAC,OAAgB,EAAA;AAC1C,IAAA,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;AACtC;AAEM,SAAU,cAAc,CAC1B,OAAgB,EAAA;IAEhB,OAAO,UAAU,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC;AACxD;AAEM,SAAU,YAAY,CACxB,IAA0C,EAAA;AAE1C,IAAA,OAAO,CAAC,CAAC,IAAI,IAAI,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY;AAC9E;AAEM,SAAU,gBAAgB,CAAC,IAAa,EAAA;AAC1C,IAAA,MAAM,WAAW,GAAI,IAA4B,EAAE,aAAa,CAAC,WAAW;AAE5E,IAAA,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,YAAY,WAAW,CAAC,WAAW;AAC7E;AAEM,SAAU,aAAa,CAAC,IAAU,EAAA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AAA,OAAO,CAAC,KAAK,GAAG,CAAC;;KAExB,EAAE,OAAO,CAAC;AAEX,IAAA,OAAO,KAAK;AAChB;AAEA,SAAS,KAAK,CAAC,SAAoB,EAAA;AAC/B,IAAA,MAAM,EAAC,GAAG,EAAC,GAAG,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,OAAO,CAAE;AAElE,IAAA,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE;AACtC,QAAA,GAAG,CAAkB,MAAc,EAAA;AAC/B,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK;AACxB,YAAA,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,WAAW,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;AAEnE,YAAA,GAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;AAEvB,YAAA,IAAI,KAAK,KAAK,MAAM,EAAE;AAClB,gBAAA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;;SAEhC;AACJ,KAAA,CAAC;AACN;;ACjHA;;AAEG;;;;"}
@@ -1,34 +1,8 @@
1
- import { tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
2
1
  import { toSignal } from '@angular/core/rxjs-interop';
3
2
  import { TUI_TRUE_HANDLER, TUI_FALSE_HANDLER, svgNodeFilter } from '@taiga-ui/cdk/constants';
4
3
  import { tuiUntrackedScheduler } from '@taiga-ui/cdk/observables';
5
4
  import { merge, fromEvent, map, observeOn } from 'rxjs';
6
-
7
- /**
8
- * Returns current active element, including shadow dom
9
- *
10
- * @return element or null
11
- */
12
- function tuiGetNativeFocused({ activeElement }) {
13
- if (!activeElement?.shadowRoot) {
14
- return activeElement;
15
- }
16
- let element = activeElement.shadowRoot.activeElement;
17
- while (element?.shadowRoot) {
18
- element = element.shadowRoot.activeElement;
19
- }
20
- return element;
21
- }
22
-
23
- /**
24
- * Finds and blurs current active element, including shadow DOM
25
- */
26
- function tuiBlurNativeFocused(doc) {
27
- const activeElement = tuiGetNativeFocused(doc);
28
- if (tuiIsHTMLElement(activeElement)) {
29
- activeElement.blur();
30
- }
31
- }
5
+ import { tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
32
6
 
33
7
  function tuiFocusedIn(node) {
34
8
  return toSignal(merge(fromEvent(node, 'focus', { capture: true }).pipe(map(TUI_TRUE_HANDLER)), fromEvent(node, 'blur', { capture: true }).pipe(map(TUI_FALSE_HANDLER))).pipe(observeOn(tuiUntrackedScheduler)), { initialValue: false });
@@ -40,8 +14,8 @@ function tuiFocusedIn(node) {
40
14
  * be focused, for example element can have display: none applied to it or any other
41
15
  * circumstances could prevent actual focus.
42
16
  */
43
- function tuiIsNativeKeyboardFocusable(element) {
44
- if (element.hasAttribute('disabled') || element.getAttribute('tabIndex') === '-1') {
17
+ function tuiIsFocusable(element) {
18
+ if (element.matches(':disabled') || element.getAttribute('tabIndex') === '-1') {
45
19
  return false;
46
20
  }
47
21
  if ((tuiIsHTMLElement(element) && element.isContentEditable) ||
@@ -66,34 +40,43 @@ function tuiIsNativeKeyboardFocusable(element) {
66
40
  }
67
41
  }
68
42
 
69
- function tuiIsNativeMouseFocusable(element) {
70
- return (!element.hasAttribute('disabled') &&
71
- (element.getAttribute('tabIndex') === '-1' ||
72
- tuiIsNativeKeyboardFocusable(element)));
73
- }
74
-
75
43
  /**
76
44
  * @description:
77
45
  * Finds the closest element that can be focused with a keyboard or mouse in theory
78
46
  */
79
- function tuiGetClosestFocusable({ initial, root, previous = false, keyboard = true, }) {
47
+ function tuiGetClosestFocusable({ initial, root, previous = false, }) {
80
48
  if (!root.ownerDocument) {
81
49
  return null;
82
50
  }
83
- const check = keyboard ? tuiIsNativeKeyboardFocusable : tuiIsNativeMouseFocusable;
84
51
  const treeWalker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, svgNodeFilter);
85
52
  treeWalker.currentNode = initial;
86
53
  do {
87
54
  if (tuiIsHTMLElement(treeWalker.currentNode)) {
88
55
  initial = treeWalker.currentNode;
89
56
  }
90
- if (tuiIsHTMLElement(initial) && check(initial)) {
57
+ if (tuiIsHTMLElement(initial) && tuiIsFocusable(initial)) {
91
58
  return initial;
92
59
  }
93
60
  } while (previous ? treeWalker.previousNode() : treeWalker.nextNode());
94
61
  return null;
95
62
  }
96
63
 
64
+ /**
65
+ * Returns current active element, including shadow dom
66
+ *
67
+ * @return element or null
68
+ */
69
+ function tuiGetFocused({ activeElement }) {
70
+ if (!activeElement?.shadowRoot) {
71
+ return activeElement;
72
+ }
73
+ let element = activeElement.shadowRoot.activeElement;
74
+ while (element?.shadowRoot) {
75
+ element = element.shadowRoot.activeElement;
76
+ }
77
+ return element;
78
+ }
79
+
97
80
  /**
98
81
  * Checks if element is focused.
99
82
  *
@@ -102,9 +85,9 @@ function tuiGetClosestFocusable({ initial, root, previous = false, keyboard = tr
102
85
  * @param node or null (as a common return value of DOM nodes walking)
103
86
  * @return true if focused
104
87
  */
105
- function tuiIsNativeFocused(node) {
88
+ function tuiIsFocused(node) {
106
89
  return (!!node?.ownerDocument &&
107
- tuiGetNativeFocused(node.ownerDocument) === node &&
90
+ tuiGetFocused(node.ownerDocument) === node &&
108
91
  node.ownerDocument.hasFocus());
109
92
  }
110
93
 
@@ -114,8 +97,8 @@ function tuiIsNativeFocused(node) {
114
97
  * @param node
115
98
  * @return true if focused node is contained within element
116
99
  */
117
- function tuiIsNativeFocusedIn(node) {
118
- const focused = node?.ownerDocument && tuiGetNativeFocused(node.ownerDocument);
100
+ function tuiIsFocusedIn(node) {
101
+ const focused = node?.ownerDocument && tuiGetFocused(node.ownerDocument);
119
102
  return !!focused && node.contains(focused) && node.ownerDocument?.hasFocus();
120
103
  }
121
104
 
@@ -130,7 +113,7 @@ function tuiMoveFocus(currentIndex, elements, step) {
130
113
  currentIndex += step;
131
114
  while (currentIndex >= 0 && currentIndex < elements.length) {
132
115
  elements[currentIndex]?.focus();
133
- if (tuiIsNativeFocused(elements[currentIndex])) {
116
+ if (tuiIsFocused(elements[currentIndex])) {
134
117
  return;
135
118
  }
136
119
  currentIndex += step;
@@ -141,5 +124,5 @@ function tuiMoveFocus(currentIndex, elements, step) {
141
124
  * Generated bundle index. Do not edit.
142
125
  */
143
126
 
144
- export { tuiBlurNativeFocused, tuiFocusedIn, tuiGetClosestFocusable, tuiGetNativeFocused, tuiIsNativeFocused, tuiIsNativeFocusedIn, tuiIsNativeKeyboardFocusable, tuiIsNativeMouseFocusable, tuiMoveFocus };
127
+ export { tuiFocusedIn, tuiGetClosestFocusable, tuiGetFocused, tuiIsFocusable, tuiIsFocused, tuiIsFocusedIn, tuiMoveFocus };
145
128
  //# sourceMappingURL=taiga-ui-cdk-utils-focus.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-utils-focus.mjs","sources":["../../../projects/cdk/utils/focus/get-native-focused.ts","../../../projects/cdk/utils/focus/blur-native-focused.ts","../../../projects/cdk/utils/focus/focused-in.ts","../../../projects/cdk/utils/focus/is-native-keyboard-focusable.ts","../../../projects/cdk/utils/focus/is-native-mouse-focusable.ts","../../../projects/cdk/utils/focus/get-closest-focusable.ts","../../../projects/cdk/utils/focus/is-native-focused.ts","../../../projects/cdk/utils/focus/is-native-focused-in.ts","../../../projects/cdk/utils/focus/move-focus.ts","../../../projects/cdk/utils/focus/taiga-ui-cdk-utils-focus.ts"],"sourcesContent":["/**\n * Returns current active element, including shadow dom\n *\n * @return element or null\n */\nexport function tuiGetNativeFocused({activeElement}: Document): Element | null {\n if (!activeElement?.shadowRoot) {\n return activeElement;\n }\n\n let element = activeElement.shadowRoot.activeElement;\n\n while (element?.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n","import {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {tuiGetNativeFocused} from './get-native-focused';\n\n/**\n * Finds and blurs current active element, including shadow DOM\n */\nexport function tuiBlurNativeFocused(doc: Document): void {\n const activeElement = tuiGetNativeFocused(doc);\n\n if (tuiIsHTMLElement(activeElement)) {\n activeElement.blur();\n }\n}\n","import {type Signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TUI_FALSE_HANDLER, TUI_TRUE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {tuiUntrackedScheduler} from '@taiga-ui/cdk/observables';\nimport {fromEvent, map, merge, observeOn} from 'rxjs';\n\nexport function tuiFocusedIn(node: Node): Signal<boolean> {\n return toSignal(\n merge(\n fromEvent(node, 'focus', {capture: true}).pipe(map(TUI_TRUE_HANDLER)),\n fromEvent(node, 'blur', {capture: true}).pipe(map(TUI_FALSE_HANDLER)),\n ).pipe(observeOn(tuiUntrackedScheduler)),\n {initialValue: false},\n );\n}\n","import {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\n/**\n * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to\n * only target natural focus order. Not checking the possibility of an element to\n * be focused, for example element can have display: none applied to it or any other\n * circumstances could prevent actual focus.\n */\nexport function tuiIsNativeKeyboardFocusable(element: Element): boolean {\n if (element.hasAttribute('disabled') || element.getAttribute('tabIndex') === '-1') {\n return false;\n }\n\n if (\n (tuiIsHTMLElement(element) && element.isContentEditable) ||\n element.getAttribute('tabIndex') === '0'\n ) {\n return true;\n }\n\n switch (element.tagName) {\n case 'A':\n case 'LINK':\n return element.hasAttribute('href');\n case 'AUDIO':\n case 'VIDEO':\n return element.hasAttribute('controls');\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA':\n return true;\n case 'INPUT':\n return element.getAttribute('type') !== 'hidden';\n default:\n return false;\n }\n}\n","import {tuiIsNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\nexport function tuiIsNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute('disabled') &&\n (element.getAttribute('tabIndex') === '-1' ||\n tuiIsNativeKeyboardFocusable(element))\n );\n}\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {tuiIsNativeKeyboardFocusable} from './is-native-keyboard-focusable';\nimport {tuiIsNativeMouseFocusable} from './is-native-mouse-focusable';\n\nexport interface TuiGetClosestFocusableOptions {\n /**\n * @description:\n * current HTML element\n */\n initial: Element;\n\n /**\n * @description:\n * determine if only keyboard focus is of interest\n */\n keyboard?: boolean;\n\n /**\n * @description:\n * should it look backwards instead (find item that will be focused with Shift + Tab)\n */\n previous?: boolean;\n\n /**\n * @description:\n * top Node limiting the search area\n */\n root: Node;\n}\n\n/**\n * @description:\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n */\nexport function tuiGetClosestFocusable({\n initial,\n root,\n previous = false,\n keyboard = true,\n}: TuiGetClosestFocusableOptions): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const check = keyboard ? tuiIsNativeKeyboardFocusable : tuiIsNativeMouseFocusable;\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n );\n\n treeWalker.currentNode = initial;\n\n do {\n if (tuiIsHTMLElement(treeWalker.currentNode)) {\n initial = treeWalker.currentNode;\n }\n\n if (tuiIsHTMLElement(initial) && check(initial)) {\n return initial;\n }\n } while (previous ? treeWalker.previousNode() : treeWalker.nextNode());\n\n return null;\n}\n","import {tuiGetNativeFocused} from './get-native-focused';\n\n/**\n * Checks if element is focused.\n *\n * Could return true even after blur since element remains focused if you switch away from a browser tab.\n *\n * @param node or null (as a common return value of DOM nodes walking)\n * @return true if focused\n */\nexport function tuiIsNativeFocused(node?: Node | null): boolean {\n return (\n !!node?.ownerDocument &&\n tuiGetNativeFocused(node.ownerDocument) === node &&\n node.ownerDocument.hasFocus()\n );\n}\n","import {tuiGetNativeFocused} from './get-native-focused';\n\n/**\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\nexport function tuiIsNativeFocusedIn(node?: Node | null): boolean {\n const focused = node?.ownerDocument && tuiGetNativeFocused(node.ownerDocument);\n\n return !!focused && node.contains(focused) && node.ownerDocument?.hasFocus();\n}\n","import {tuiIsNativeFocused} from './is-native-focused';\n\n/**\n * Utility method for moving focus in a list of elements\n *\n * @param currentIndex currently focused index\n * @param elements array of focusable elements\n * @param step a step to move focus by, typically -1 or 1\n */\nexport function tuiMoveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n elements[currentIndex]?.focus();\n\n if (tuiIsNativeFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;AAIG;AACa,SAAA,mBAAmB,CAAC,EAAC,aAAa,EAAW,EAAA;AACzD,IAAA,IAAI,CAAC,aAAa,EAAE,UAAU,EAAE;AAC5B,QAAA,OAAO,aAAa,CAAC;AACxB,KAAA;AAED,IAAA,IAAI,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;IAErD,OAAO,OAAO,EAAE,UAAU,EAAE;AACxB,QAAA,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;AAC9C,KAAA;AAED,IAAA,OAAO,OAAO,CAAC;AACnB;;ACbA;;AAEG;AACG,SAAU,oBAAoB,CAAC,GAAa,EAAA;AAC9C,IAAA,MAAM,aAAa,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAE/C,IAAA,IAAI,gBAAgB,CAAC,aAAa,CAAC,EAAE;QACjC,aAAa,CAAC,IAAI,EAAE,CAAC;AACxB,KAAA;AACL;;ACPM,SAAU,YAAY,CAAC,IAAU,EAAA;AACnC,IAAA,OAAO,QAAQ,CACX,KAAK,CACD,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CA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,oBAAoB,CAAC,IAAkB,EAAA;AACnD,IAAA,MAAM,OAAO,GAAG,IAAI,EAAE,aAAa,IAAI,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAE/E,IAAA,OAAO,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC;AACjF;;ACVA;;;;;;AAMG;SACa,YAAY,CACxB,YAAoB,EACpB,QAAgC,EAChC,IAAY,EAAA;IAEZ,YAAY,IAAI,IAAI,CAAC;IAErB,OAAO,YAAY,IAAI,CAAC,IAAI,YAAY,GAAG,QAAQ,CAAC,MAAM,EAAE;AACxD,QAAA,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;AAEhC,QAAA,IAAI,kBAAkB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE;YAC5C,OAAO;AACV,SAAA;QAED,YAAY,IAAI,IAAI,CAAC;AACxB,KAAA;AACL;;ACzBA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-utils-focus.mjs","sources":["../../../projects/cdk/utils/focus/focused-in.ts","../../../projects/cdk/utils/focus/is-focusable.ts","../../../projects/cdk/utils/focus/get-closest-focusable.ts","../../../projects/cdk/utils/focus/get-focused.ts","../../../projects/cdk/utils/focus/is-focused.ts","../../../projects/cdk/utils/focus/is-focused-in.ts","../../../projects/cdk/utils/focus/move-focus.ts","../../../projects/cdk/utils/focus/taiga-ui-cdk-utils-focus.ts"],"sourcesContent":["import {type Signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TUI_FALSE_HANDLER, TUI_TRUE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {tuiUntrackedScheduler} from '@taiga-ui/cdk/observables';\nimport {fromEvent, map, merge, observeOn} from 'rxjs';\n\nexport function tuiFocusedIn(node: Node): Signal<boolean> {\n return toSignal(\n merge(\n fromEvent(node, 'focus', {capture: true}).pipe(map(TUI_TRUE_HANDLER)),\n fromEvent(node, 'blur', {capture: true}).pipe(map(TUI_FALSE_HANDLER)),\n ).pipe(observeOn(tuiUntrackedScheduler)),\n {initialValue: false},\n );\n}\n","import {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\n/**\n * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to\n * only target natural focus order. Not checking the possibility of an element to\n * be focused, for example element can have display: none applied to it or any other\n * circumstances could prevent actual focus.\n */\nexport function tuiIsFocusable(element: Element): boolean {\n if (element.matches(':disabled') || element.getAttribute('tabIndex') === '-1') {\n return false;\n }\n\n if (\n (tuiIsHTMLElement(element) && element.isContentEditable) ||\n element.getAttribute('tabIndex') === '0'\n ) {\n return true;\n }\n\n switch (element.tagName) {\n case 'A':\n case 'LINK':\n return element.hasAttribute('href');\n case 'AUDIO':\n case 'VIDEO':\n return element.hasAttribute('controls');\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA':\n return true;\n case 'INPUT':\n return element.getAttribute('type') !== 'hidden';\n default:\n return false;\n }\n}\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {tuiIsFocusable} from './is-focusable';\n\nexport interface TuiGetClosestFocusableOptions {\n /**\n * @description:\n * current HTML element\n */\n initial: Element;\n\n /**\n * @description:\n * should it look backwards instead (find item that will be focused with Shift + Tab)\n */\n previous?: boolean;\n\n /**\n * @description:\n * top Node limiting the search area\n */\n root: Node;\n}\n\n/**\n * @description:\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n */\nexport function tuiGetClosestFocusable({\n initial,\n root,\n previous = false,\n}: TuiGetClosestFocusableOptions): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n );\n\n treeWalker.currentNode = initial;\n\n do {\n if (tuiIsHTMLElement(treeWalker.currentNode)) {\n initial = treeWalker.currentNode;\n }\n\n if (tuiIsHTMLElement(initial) && tuiIsFocusable(initial)) {\n return initial;\n }\n } while (previous ? treeWalker.previousNode() : treeWalker.nextNode());\n\n return null;\n}\n","/**\n * Returns current active element, including shadow dom\n *\n * @return element or null\n */\nexport function tuiGetFocused({activeElement}: Document): Element | null {\n if (!activeElement?.shadowRoot) {\n return activeElement;\n }\n\n let element = activeElement.shadowRoot.activeElement;\n\n while (element?.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n","import {tuiGetFocused} from './get-focused';\n\n/**\n * Checks if element is focused.\n *\n * Could return true even after blur since element remains focused if you switch away from a browser tab.\n *\n * @param node or null (as a common return value of DOM nodes walking)\n * @return true if focused\n */\nexport function tuiIsFocused(node?: Node | null): boolean {\n return (\n !!node?.ownerDocument &&\n tuiGetFocused(node.ownerDocument) === node &&\n node.ownerDocument.hasFocus()\n );\n}\n","import {tuiGetFocused} from './get-focused';\n\n/**\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\nexport function tuiIsFocusedIn(node?: Node | null): boolean {\n const focused = node?.ownerDocument && tuiGetFocused(node.ownerDocument);\n\n return !!focused && node.contains(focused) && node.ownerDocument?.hasFocus();\n}\n","import {tuiIsFocused} from './is-focused';\n\n/**\n * Utility method for moving focus in a list of elements\n *\n * @param currentIndex currently focused index\n * @param elements array of focusable elements\n * @param step a step to move focus by, typically -1 or 1\n */\nexport function tuiMoveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n elements[currentIndex]?.focus();\n\n if (tuiIsFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMM,SAAU,YAAY,CAAC,IAAU,EAAA;AACnC,IA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