@taiga-ui/cdk 2.44.0 → 2.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/bundles/taiga-ui-cdk-abstract.umd.js +51 -21
  2. package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-abstract.umd.min.js +1 -15
  4. package/bundles/taiga-ui-cdk-abstract.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-coercion.umd.js +1 -1
  6. package/bundles/taiga-ui-cdk-coercion.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-coercion.umd.min.js.map +1 -1
  8. package/bundles/taiga-ui-cdk-components-alert-host.umd.js +50 -20
  9. package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
  10. package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js +1 -15
  11. package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js.map +1 -1
  12. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +54 -24
  13. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
  14. package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js +1 -15
  15. package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js.map +1 -1
  16. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +50 -20
  17. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
  18. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js +1 -15
  19. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js.map +1 -1
  20. package/bundles/taiga-ui-cdk-components-portal-host.umd.js +51 -21
  21. package/bundles/taiga-ui-cdk-components-portal-host.umd.js.map +1 -1
  22. package/bundles/taiga-ui-cdk-components-portal-host.umd.min.js +1 -15
  23. package/bundles/taiga-ui-cdk-components-portal-host.umd.min.js.map +1 -1
  24. package/bundles/taiga-ui-cdk-date-time.umd.js +79 -29
  25. package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
  26. package/bundles/taiga-ui-cdk-date-time.umd.min.js +1 -15
  27. package/bundles/taiga-ui-cdk-date-time.umd.min.js.map +1 -1
  28. package/bundles/taiga-ui-cdk-decorators.umd.js +50 -20
  29. package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
  30. package/bundles/taiga-ui-cdk-decorators.umd.min.js +1 -15
  31. package/bundles/taiga-ui-cdk-decorators.umd.min.js.map +1 -1
  32. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +50 -20
  33. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  34. package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js +1 -15
  35. package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js.map +1 -1
  36. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +182 -70
  37. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  38. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js +1 -15
  39. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js.map +1 -1
  40. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js +91 -42
  41. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
  42. package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js +1 -15
  43. package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js.map +1 -1
  44. package/bundles/taiga-ui-cdk-directives-checked.umd.js +50 -20
  45. package/bundles/taiga-ui-cdk-directives-checked.umd.js.map +1 -1
  46. package/bundles/taiga-ui-cdk-directives-checked.umd.min.js +1 -15
  47. package/bundles/taiga-ui-cdk-directives-checked.umd.min.js.map +1 -1
  48. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js +50 -20
  49. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js.map +1 -1
  50. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js +1 -15
  51. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js.map +1 -1
  52. package/bundles/taiga-ui-cdk-directives-drag.umd.js +50 -20
  53. package/bundles/taiga-ui-cdk-directives-drag.umd.js.map +1 -1
  54. package/bundles/taiga-ui-cdk-directives-drag.umd.min.js +1 -15
  55. package/bundles/taiga-ui-cdk-directives-drag.umd.min.js.map +1 -1
  56. package/bundles/taiga-ui-cdk-directives-droppable.umd.js +50 -20
  57. package/bundles/taiga-ui-cdk-directives-droppable.umd.js.map +1 -1
  58. package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js +1 -15
  59. package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js.map +1 -1
  60. package/bundles/taiga-ui-cdk-directives-element.umd.js +50 -20
  61. package/bundles/taiga-ui-cdk-directives-element.umd.js.map +1 -1
  62. package/bundles/taiga-ui-cdk-directives-element.umd.min.js +1 -15
  63. package/bundles/taiga-ui-cdk-directives-element.umd.min.js.map +1 -1
  64. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js +53 -21
  65. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
  66. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js +1 -15
  67. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js.map +1 -1
  68. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js +50 -20
  69. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js.map +1 -1
  70. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js +1 -15
  71. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js.map +1 -1
  72. package/bundles/taiga-ui-cdk-directives-focusable.umd.js +50 -20
  73. package/bundles/taiga-ui-cdk-directives-focusable.umd.js.map +1 -1
  74. package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js +1 -15
  75. package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js.map +1 -1
  76. package/bundles/taiga-ui-cdk-directives-focused.umd.js +50 -20
  77. package/bundles/taiga-ui-cdk-directives-focused.umd.js.map +1 -1
  78. package/bundles/taiga-ui-cdk-directives-focused.umd.min.js +1 -15
  79. package/bundles/taiga-ui-cdk-directives-focused.umd.min.js.map +1 -1
  80. package/bundles/taiga-ui-cdk-directives-for-async.umd.js +324 -0
  81. package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -0
  82. package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js +2 -0
  83. package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js.map +1 -0
  84. package/bundles/taiga-ui-cdk-directives-for.umd.js +50 -20
  85. package/bundles/taiga-ui-cdk-directives-for.umd.js.map +1 -1
  86. package/bundles/taiga-ui-cdk-directives-for.umd.min.js +1 -15
  87. package/bundles/taiga-ui-cdk-directives-for.umd.min.js.map +1 -1
  88. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js +50 -20
  89. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js.map +1 -1
  90. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js +1 -15
  91. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js.map +1 -1
  92. package/bundles/taiga-ui-cdk-directives-hovered.umd.js +50 -20
  93. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  94. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js +1 -15
  95. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js.map +1 -1
  96. package/bundles/taiga-ui-cdk-directives-input-mode.umd.js +50 -20
  97. package/bundles/taiga-ui-cdk-directives-input-mode.umd.js.map +1 -1
  98. package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js +1 -15
  99. package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js.map +1 -1
  100. package/bundles/taiga-ui-cdk-directives-item.umd.js +51 -21
  101. package/bundles/taiga-ui-cdk-directives-item.umd.js.map +1 -1
  102. package/bundles/taiga-ui-cdk-directives-item.umd.min.js +1 -15
  103. package/bundles/taiga-ui-cdk-directives-item.umd.min.js.map +1 -1
  104. package/bundles/taiga-ui-cdk-directives-let.umd.js +50 -20
  105. package/bundles/taiga-ui-cdk-directives-let.umd.js.map +1 -1
  106. package/bundles/taiga-ui-cdk-directives-let.umd.min.js +1 -15
  107. package/bundles/taiga-ui-cdk-directives-let.umd.min.js.map +1 -1
  108. package/bundles/taiga-ui-cdk-directives-media.umd.js +51 -20
  109. package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
  110. package/bundles/taiga-ui-cdk-directives-media.umd.min.js +1 -15
  111. package/bundles/taiga-ui-cdk-directives-media.umd.min.js.map +1 -1
  112. package/bundles/taiga-ui-cdk-directives-obscured.umd.js +50 -20
  113. package/bundles/taiga-ui-cdk-directives-obscured.umd.js.map +1 -1
  114. package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js +1 -15
  115. package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js.map +1 -1
  116. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +50 -20
  117. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
  118. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js +1 -15
  119. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js.map +1 -1
  120. package/bundles/taiga-ui-cdk-directives-pan.umd.js +50 -20
  121. package/bundles/taiga-ui-cdk-directives-pan.umd.js.map +1 -1
  122. package/bundles/taiga-ui-cdk-directives-pan.umd.min.js +1 -15
  123. package/bundles/taiga-ui-cdk-directives-pan.umd.min.js.map +1 -1
  124. package/bundles/taiga-ui-cdk-directives-portal.umd.js +50 -20
  125. package/bundles/taiga-ui-cdk-directives-portal.umd.js.map +1 -1
  126. package/bundles/taiga-ui-cdk-directives-portal.umd.min.js +1 -15
  127. package/bundles/taiga-ui-cdk-directives-portal.umd.min.js.map +1 -1
  128. package/bundles/taiga-ui-cdk-directives-pressed.umd.js +50 -20
  129. package/bundles/taiga-ui-cdk-directives-pressed.umd.js.map +1 -1
  130. package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js +1 -15
  131. package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js.map +1 -1
  132. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js +50 -20
  133. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js.map +1 -1
  134. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js +1 -15
  135. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js.map +1 -1
  136. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js +50 -20
  137. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js.map +1 -1
  138. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js +1 -15
  139. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js.map +1 -1
  140. package/bundles/taiga-ui-cdk-directives-resize.umd.js +50 -20
  141. package/bundles/taiga-ui-cdk-directives-resize.umd.js.map +1 -1
  142. package/bundles/taiga-ui-cdk-directives-resize.umd.min.js +1 -15
  143. package/bundles/taiga-ui-cdk-directives-resize.umd.min.js.map +1 -1
  144. package/bundles/taiga-ui-cdk-directives-swipe.umd.js +50 -20
  145. package/bundles/taiga-ui-cdk-directives-swipe.umd.js.map +1 -1
  146. package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js +1 -15
  147. package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js.map +1 -1
  148. package/bundles/taiga-ui-cdk-directives-validator.umd.js +50 -20
  149. package/bundles/taiga-ui-cdk-directives-validator.umd.js.map +1 -1
  150. package/bundles/taiga-ui-cdk-directives-validator.umd.min.js +1 -15
  151. package/bundles/taiga-ui-cdk-directives-validator.umd.min.js.map +1 -1
  152. package/bundles/taiga-ui-cdk-directives-zoom.umd.js +50 -20
  153. package/bundles/taiga-ui-cdk-directives-zoom.umd.js.map +1 -1
  154. package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js +1 -15
  155. package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js.map +1 -1
  156. package/bundles/taiga-ui-cdk-directives.umd.js +12 -4
  157. package/bundles/taiga-ui-cdk-directives.umd.js.map +1 -1
  158. package/bundles/taiga-ui-cdk-directives.umd.min.js +1 -1
  159. package/bundles/taiga-ui-cdk-exceptions.umd.js +50 -20
  160. package/bundles/taiga-ui-cdk-exceptions.umd.js.map +1 -1
  161. package/bundles/taiga-ui-cdk-exceptions.umd.min.js +1 -15
  162. package/bundles/taiga-ui-cdk-exceptions.umd.min.js.map +1 -1
  163. package/bundles/taiga-ui-cdk-observables.umd.js +1 -1
  164. package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
  165. package/bundles/taiga-ui-cdk-observables.umd.min.js.map +1 -1
  166. package/bundles/taiga-ui-cdk-pipes-filter.umd.js +50 -20
  167. package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
  168. package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js +1 -15
  169. package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js.map +1 -1
  170. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +50 -20
  171. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
  172. package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js +1 -15
  173. package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js.map +1 -1
  174. package/bundles/taiga-ui-cdk-services.umd.js +50 -20
  175. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  176. package/bundles/taiga-ui-cdk-services.umd.min.js +1 -15
  177. package/bundles/taiga-ui-cdk-services.umd.min.js.map +1 -1
  178. package/bundles/taiga-ui-cdk-tokens.umd.js +55 -27
  179. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  180. package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -15
  181. package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
  182. package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
  183. package/bundles/taiga-ui-cdk-utils-browser.umd.min.js.map +1 -1
  184. package/bundles/taiga-ui-cdk-utils-focus.umd.js +2 -0
  185. package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
  186. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js.map +1 -1
  187. package/bundles/taiga-ui-cdk-utils-os.umd.js +39 -0
  188. package/bundles/taiga-ui-cdk-utils-os.umd.js.map +1 -0
  189. package/bundles/taiga-ui-cdk-utils-os.umd.min.js +2 -0
  190. package/bundles/taiga-ui-cdk-utils-os.umd.min.js.map +1 -0
  191. package/bundles/taiga-ui-cdk-utils-svg.umd.js +289 -0
  192. package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -0
  193. package/bundles/taiga-ui-cdk-utils-svg.umd.min.js +2 -0
  194. package/bundles/taiga-ui-cdk-utils-svg.umd.min.js.map +1 -0
  195. package/bundles/taiga-ui-cdk-utils.umd.js +20 -4
  196. package/bundles/taiga-ui-cdk-utils.umd.js.map +1 -1
  197. package/bundles/taiga-ui-cdk-utils.umd.min.js +1 -1
  198. package/coercion/taiga-ui-cdk-coercion.metadata.json +1 -1
  199. package/components/alert-host/alert-host.component.d.ts +2 -2
  200. package/components/alert-host/taiga-ui-cdk-components-alert-host.metadata.json +1 -1
  201. package/components/dialog-host/dialog-host.component.d.ts +1 -1
  202. package/components/dialog-host/taiga-ui-cdk-components-dialog-host.metadata.json +1 -1
  203. package/components/portal-host/portal.service.d.ts +1 -1
  204. package/date-time/date-fillers.d.ts +0 -2
  205. package/date-time/day-range.d.ts +1 -2
  206. package/date-time/day.d.ts +0 -1
  207. package/date-time/month-range.d.ts +0 -1
  208. package/date-time/month.d.ts +1 -1
  209. package/date-time/taiga-ui-cdk-date-time.metadata.json +1 -1
  210. package/date-time/time.d.ts +7 -0
  211. package/date-time/year.d.ts +7 -0
  212. package/directives/auto-focus/autofocus.directive.d.ts +4 -13
  213. package/directives/auto-focus/autofocus.options.d.ts +13 -0
  214. package/directives/auto-focus/handlers/abstract.handler.d.ts +11 -0
  215. package/directives/auto-focus/handlers/default.handler.d.ts +9 -0
  216. package/directives/auto-focus/handlers/ios.handler.d.ts +10 -0
  217. package/directives/auto-focus/index.d.ts +4 -0
  218. package/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.metadata.json +1 -1
  219. package/directives/autofilled/autofilled-style.component.d.ts +2 -0
  220. package/directives/autofilled/autofilled.directive.d.ts +5 -4
  221. package/directives/autofilled/index.d.ts +1 -0
  222. package/directives/autofilled/taiga-ui-cdk-directives-autofilled.metadata.json +1 -1
  223. package/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.metadata.json +1 -1
  224. package/directives/for-async/for-async.directive.d.ts +13 -0
  225. package/directives/for-async/for-async.module.d.ts +5 -0
  226. package/directives/for-async/index.d.ts +2 -0
  227. package/directives/for-async/package.json +13 -0
  228. package/directives/for-async/taiga-ui-cdk-directives-for-async.d.ts +4 -0
  229. package/directives/for-async/taiga-ui-cdk-directives-for-async.metadata.json +1 -0
  230. package/directives/index.d.ts +1 -0
  231. package/directives/item/item.directive.d.ts +1 -1
  232. package/directives/media/taiga-ui-cdk-directives-media.metadata.json +1 -1
  233. package/directives/taiga-ui-cdk-directives.metadata.json +1 -1
  234. package/esm2015/abstract/interactive.js +2 -2
  235. package/esm2015/coercion/coerce-boolean-property.js +2 -2
  236. package/esm2015/components/alert-host/alert-host.component.js +1 -1
  237. package/esm2015/components/dialog-host/dialog-host.component.js +5 -5
  238. package/esm2015/components/portal-host/portal.service.js +2 -2
  239. package/esm2015/date-time/date-fillers.js +1 -3
  240. package/esm2015/date-time/day-range.js +2 -2
  241. package/esm2015/date-time/day.js +2 -3
  242. package/esm2015/date-time/month-range.js +1 -2
  243. package/esm2015/date-time/month.js +5 -3
  244. package/esm2015/date-time/time.js +12 -1
  245. package/esm2015/date-time/year.js +13 -2
  246. package/esm2015/directives/auto-focus/autofocus.directive.js +11 -87
  247. package/esm2015/directives/auto-focus/autofocus.options.js +27 -0
  248. package/esm2015/directives/auto-focus/handlers/abstract.handler.js +25 -0
  249. package/esm2015/directives/auto-focus/handlers/default.handler.js +39 -0
  250. package/esm2015/directives/auto-focus/handlers/ios.handler.js +70 -0
  251. package/esm2015/directives/auto-focus/index.js +5 -1
  252. package/esm2015/directives/autofilled/autofilled-style.component.js +13 -0
  253. package/esm2015/directives/autofilled/autofilled.directive.js +23 -37
  254. package/esm2015/directives/autofilled/autofilled.module.js +4 -2
  255. package/esm2015/directives/autofilled/index.js +2 -1
  256. package/esm2015/directives/focus-trap/focus-trap.directive.js +4 -2
  257. package/esm2015/directives/for-async/for-async.directive.js +48 -0
  258. package/esm2015/directives/for-async/for-async.module.js +16 -0
  259. package/esm2015/directives/for-async/index.js +3 -0
  260. package/esm2015/directives/for-async/taiga-ui-cdk-directives-for-async.js +5 -0
  261. package/esm2015/directives/index.js +2 -1
  262. package/esm2015/directives/item/item.directive.js +2 -2
  263. package/esm2015/directives/media/media.directive.js +2 -1
  264. package/esm2015/observables/replay-control-value-changes.js +2 -2
  265. package/esm2015/services/parents-scroll.service.js +1 -1
  266. package/esm2015/tokens/index.js +2 -1
  267. package/esm2015/tokens/is-apple.js +5 -0
  268. package/esm2015/tokens/is-ios.js +4 -6
  269. package/esm2015/tokens/is-mobile.js +2 -2
  270. package/esm2015/utils/browser/index.js +2 -2
  271. package/esm2015/utils/browser/{is-IE.js → is-ie.js} +1 -1
  272. package/esm2015/utils/focus/set-native-focused.js +3 -1
  273. package/esm2015/utils/index.js +3 -1
  274. package/esm2015/utils/os/index.js +4 -0
  275. package/esm2015/utils/os/is-apple-platform.js +14 -0
  276. package/esm2015/utils/os/is-apple.js +6 -0
  277. package/esm2015/utils/os/is-ios.js +7 -0
  278. package/esm2015/utils/os/taiga-ui-cdk-utils-os.js +5 -0
  279. package/esm2015/utils/svg/index.js +2 -0
  280. package/esm2015/utils/svg/svg-linear-gradient-processor.js +26 -0
  281. package/esm2015/utils/svg/taiga-ui-cdk-utils-svg.js +5 -0
  282. package/esm5/abstract/interactive.js +2 -2
  283. package/esm5/coercion/coerce-boolean-property.js +2 -2
  284. package/esm5/components/alert-host/alert-host.component.js +1 -1
  285. package/esm5/components/dialog-host/dialog-host.component.js +5 -5
  286. package/esm5/components/portal-host/portal.service.js +2 -2
  287. package/esm5/date-time/date-fillers.js +1 -3
  288. package/esm5/date-time/day-range.js +2 -2
  289. package/esm5/date-time/day.js +2 -3
  290. package/esm5/date-time/month-range.js +1 -2
  291. package/esm5/date-time/month.js +5 -3
  292. package/esm5/date-time/time.js +12 -1
  293. package/esm5/date-time/year.js +13 -2
  294. package/esm5/directives/auto-focus/autofocus.directive.js +11 -97
  295. package/esm5/directives/auto-focus/autofocus.options.js +27 -0
  296. package/esm5/directives/auto-focus/handlers/abstract.handler.js +34 -0
  297. package/esm5/directives/auto-focus/handlers/default.handler.js +43 -0
  298. package/esm5/directives/auto-focus/handlers/ios.handler.js +75 -0
  299. package/esm5/directives/auto-focus/index.js +5 -1
  300. package/esm5/directives/autofilled/autofilled-style.component.js +16 -0
  301. package/esm5/directives/autofilled/autofilled.directive.js +24 -21
  302. package/esm5/directives/autofilled/autofilled.module.js +4 -2
  303. package/esm5/directives/autofilled/index.js +2 -1
  304. package/esm5/directives/focus-trap/focus-trap.directive.js +4 -2
  305. package/esm5/directives/for-async/for-async.directive.js +52 -0
  306. package/esm5/directives/for-async/for-async.module.js +19 -0
  307. package/esm5/directives/for-async/index.js +3 -0
  308. package/esm5/directives/for-async/taiga-ui-cdk-directives-for-async.js +5 -0
  309. package/esm5/directives/index.js +2 -1
  310. package/esm5/directives/item/item.directive.js +2 -2
  311. package/esm5/directives/media/media.directive.js +2 -1
  312. package/esm5/observables/replay-control-value-changes.js +2 -2
  313. package/esm5/services/parents-scroll.service.js +1 -1
  314. package/esm5/tokens/index.js +2 -1
  315. package/esm5/tokens/is-apple.js +5 -0
  316. package/esm5/tokens/is-ios.js +4 -8
  317. package/esm5/tokens/is-mobile.js +2 -2
  318. package/esm5/utils/browser/index.js +2 -2
  319. package/esm5/utils/browser/{is-IE.js → is-ie.js} +1 -1
  320. package/esm5/utils/focus/set-native-focused.js +3 -1
  321. package/esm5/utils/index.js +3 -1
  322. package/esm5/utils/os/index.js +4 -0
  323. package/esm5/utils/os/is-apple-platform.js +14 -0
  324. package/esm5/utils/os/is-apple.js +6 -0
  325. package/esm5/utils/os/is-ios.js +7 -0
  326. package/esm5/utils/os/taiga-ui-cdk-utils-os.js +5 -0
  327. package/esm5/utils/svg/index.js +2 -0
  328. package/esm5/utils/svg/svg-linear-gradient-processor.js +29 -0
  329. package/esm5/utils/svg/taiga-ui-cdk-utils-svg.js +5 -0
  330. package/fesm2015/taiga-ui-cdk-abstract.js +1 -1
  331. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  332. package/fesm2015/taiga-ui-cdk-coercion.js +1 -1
  333. package/fesm2015/taiga-ui-cdk-coercion.js.map +1 -1
  334. package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
  335. package/fesm2015/taiga-ui-cdk-components-dialog-host.js +4 -4
  336. package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  337. package/fesm2015/taiga-ui-cdk-components-portal-host.js +1 -1
  338. package/fesm2015/taiga-ui-cdk-components-portal-host.js.map +1 -1
  339. package/fesm2015/taiga-ui-cdk-date-time.js +29 -9
  340. package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
  341. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +113 -46
  342. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  343. package/fesm2015/taiga-ui-cdk-directives-autofilled.js +33 -37
  344. package/fesm2015/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  345. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js +3 -1
  346. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
  347. package/fesm2015/taiga-ui-cdk-directives-for-async.js +66 -0
  348. package/fesm2015/taiga-ui-cdk-directives-for-async.js.map +1 -0
  349. package/fesm2015/taiga-ui-cdk-directives-item.js +1 -1
  350. package/fesm2015/taiga-ui-cdk-directives-item.js.map +1 -1
  351. package/fesm2015/taiga-ui-cdk-directives-media.js +1 -0
  352. package/fesm2015/taiga-ui-cdk-directives-media.js.map +1 -1
  353. package/fesm2015/taiga-ui-cdk-directives.js +1 -0
  354. package/fesm2015/taiga-ui-cdk-directives.js.map +1 -1
  355. package/fesm2015/taiga-ui-cdk-observables.js +1 -1
  356. package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
  357. package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
  358. package/fesm2015/taiga-ui-cdk-tokens.js +7 -8
  359. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  360. package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
  361. package/fesm2015/taiga-ui-cdk-utils-focus.js +2 -0
  362. package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
  363. package/fesm2015/taiga-ui-cdk-utils-os.js +31 -0
  364. package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -0
  365. package/fesm2015/taiga-ui-cdk-utils-svg.js +32 -0
  366. package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -0
  367. package/fesm2015/taiga-ui-cdk-utils.js +2 -0
  368. package/fesm2015/taiga-ui-cdk-utils.js.map +1 -1
  369. package/fesm5/taiga-ui-cdk-abstract.js +1 -1
  370. package/fesm5/taiga-ui-cdk-abstract.js.map +1 -1
  371. package/fesm5/taiga-ui-cdk-coercion.js +1 -1
  372. package/fesm5/taiga-ui-cdk-coercion.js.map +1 -1
  373. package/fesm5/taiga-ui-cdk-components-alert-host.js.map +1 -1
  374. package/fesm5/taiga-ui-cdk-components-dialog-host.js +4 -4
  375. package/fesm5/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  376. package/fesm5/taiga-ui-cdk-components-portal-host.js +1 -1
  377. package/fesm5/taiga-ui-cdk-components-portal-host.js.map +1 -1
  378. package/fesm5/taiga-ui-cdk-date-time.js +29 -9
  379. package/fesm5/taiga-ui-cdk-date-time.js.map +1 -1
  380. package/fesm5/taiga-ui-cdk-directives-auto-focus.js +126 -51
  381. package/fesm5/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  382. package/fesm5/taiga-ui-cdk-directives-autofilled.js +38 -22
  383. package/fesm5/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  384. package/fesm5/taiga-ui-cdk-directives-focus-trap.js +3 -1
  385. package/fesm5/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
  386. package/fesm5/taiga-ui-cdk-directives-for-async.js +73 -0
  387. package/fesm5/taiga-ui-cdk-directives-for-async.js.map +1 -0
  388. package/fesm5/taiga-ui-cdk-directives-item.js +1 -1
  389. package/fesm5/taiga-ui-cdk-directives-item.js.map +1 -1
  390. package/fesm5/taiga-ui-cdk-directives-media.js +1 -0
  391. package/fesm5/taiga-ui-cdk-directives-media.js.map +1 -1
  392. package/fesm5/taiga-ui-cdk-directives.js +1 -0
  393. package/fesm5/taiga-ui-cdk-directives.js.map +1 -1
  394. package/fesm5/taiga-ui-cdk-observables.js +1 -1
  395. package/fesm5/taiga-ui-cdk-observables.js.map +1 -1
  396. package/fesm5/taiga-ui-cdk-services.js.map +1 -1
  397. package/fesm5/taiga-ui-cdk-tokens.js +7 -10
  398. package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
  399. package/fesm5/taiga-ui-cdk-utils-browser.js.map +1 -1
  400. package/fesm5/taiga-ui-cdk-utils-focus.js +2 -0
  401. package/fesm5/taiga-ui-cdk-utils-focus.js.map +1 -1
  402. package/fesm5/taiga-ui-cdk-utils-os.js +31 -0
  403. package/fesm5/taiga-ui-cdk-utils-os.js.map +1 -0
  404. package/fesm5/taiga-ui-cdk-utils-svg.js +36 -0
  405. package/fesm5/taiga-ui-cdk-utils-svg.js.map +1 -0
  406. package/fesm5/taiga-ui-cdk-utils.js +2 -0
  407. package/fesm5/taiga-ui-cdk-utils.js.map +1 -1
  408. package/observables/replay-control-value-changes.d.ts +1 -1
  409. package/package.json +1 -1
  410. package/schematics/ng-add/constants/modules.d.ts +1 -1
  411. package/schematics/ng-add/constants/modules.js +2 -2
  412. package/schematics/ng-add/schema.d.ts +1 -1
  413. package/schematics/ng-add/schema.json +3 -3
  414. package/schematics/ng-add/steps/add-taiga-modules.js +1 -1
  415. package/schematics/ng-update/constants/consts.d.ts +7 -7
  416. package/schematics/ng-update/constants/enums.d.ts +3 -3
  417. package/schematics/ng-update/constants/types.d.ts +3 -3
  418. package/schematics/ng-update/constants/types.js +26 -0
  419. package/schematics/ng-update/constants/warnings.d.ts +6 -0
  420. package/schematics/ng-update/constants/warnings.js +8 -0
  421. package/schematics/ng-update/index.js +2 -0
  422. package/schematics/ng-update/steps/rename-types.js +16 -9
  423. package/schematics/ng-update/steps/show-warnings.d.ts +2 -0
  424. package/schematics/ng-update/steps/show-warnings.js +18 -0
  425. package/tokens/index.d.ts +1 -0
  426. package/tokens/is-apple.d.ts +2 -0
  427. package/tokens/taiga-ui-cdk-tokens.metadata.json +1 -1
  428. package/utils/browser/index.d.ts +1 -1
  429. package/utils/browser/{is-IE.d.ts → is-ie.d.ts} +0 -0
  430. package/utils/browser/taiga-ui-cdk-utils-browser.metadata.json +1 -1
  431. package/utils/focus/set-native-focused.d.ts +2 -0
  432. package/utils/index.d.ts +2 -0
  433. package/utils/os/index.d.ts +3 -0
  434. package/utils/os/is-apple-platform.d.ts +11 -0
  435. package/utils/os/is-apple.d.ts +1 -0
  436. package/utils/os/is-ios.d.ts +1 -0
  437. package/utils/os/package.json +13 -0
  438. package/utils/os/taiga-ui-cdk-utils-os.d.ts +4 -0
  439. package/utils/os/taiga-ui-cdk-utils-os.metadata.json +1 -0
  440. package/utils/svg/index.d.ts +1 -0
  441. package/utils/svg/package.json +13 -0
  442. package/utils/svg/svg-linear-gradient-processor.d.ts +15 -0
  443. package/utils/svg/taiga-ui-cdk-utils-svg.d.ts +4 -0
  444. package/utils/svg/taiga-ui-cdk-utils-svg.metadata.json +1 -0
  445. package/utils/taiga-ui-cdk-utils.metadata.json +1 -1
@@ -1,43 +1,17 @@
1
- import { __decorate, __param } from 'tslib';
2
- import { Optional, Self, Inject, NgZone, ElementRef, Renderer2, Input, Directive, NgModule } from '@angular/core';
1
+ import { __decorate, __extends, __param } from 'tslib';
2
+ import { ElementRef, Directive, Optional, Self, Inject, Renderer2, NgZone, InjectionToken, inject, Input, NgModule } from '@angular/core';
3
3
  import { ANIMATION_FRAME } from '@ng-web-apis/common';
4
+ import { TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_APPLE } from '@taiga-ui/cdk/tokens';
4
5
  import { POLLING_TIME } from '@taiga-ui/cdk/constants';
5
- import { TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_IOS } from '@taiga-ui/cdk/tokens';
6
- import { setNativeFocused } from '@taiga-ui/cdk/utils/focus';
7
6
  import { race, timer, Observable } from 'rxjs';
8
7
  import { throttleTime, map, skipWhile, take } from 'rxjs/operators';
9
8
 
10
- var TIMEOUT = 1000;
11
- var NG_ANIMATION_SELECTOR = '.ng-animating';
12
- // TODO: in 3.0 change input name to tuiAutoFocus and handle empty string
13
- // TODO: refactor on this whole thing in 3.0
14
- var TuiAutoFocusDirective = /** @class */ (function () {
15
- function TuiAutoFocusDirective(tuiFocusableComponent, isIos, animationFrame$, ngZone, elementRef, renderer) {
9
+ var AbstractTuiAutofocusHandler = /** @class */ (function () {
10
+ function AbstractTuiAutofocusHandler(tuiFocusableComponent, elementRef) {
16
11
  this.tuiFocusableComponent = tuiFocusableComponent;
17
- this.isIos = isIos;
18
- this.animationFrame$ = animationFrame$;
19
- this.ngZone = ngZone;
20
12
  this.elementRef = elementRef;
21
- this.renderer = renderer;
22
- this.autoFocus = true;
23
13
  }
24
- TuiAutoFocusDirective.prototype.ngAfterViewInit = function () {
25
- var _this = this;
26
- if (!this.autoFocus) {
27
- return;
28
- }
29
- if (this.isTextFieldElement) {
30
- if (this.isIos) {
31
- this.ngZone.runOutsideAngular(function () { return _this.iosWebkitAutofocus(); });
32
- }
33
- else {
34
- race(timer(TIMEOUT), this.animationFrame$.pipe(throttleTime(POLLING_TIME), map(function () { return _this.element.closest(NG_ANIMATION_SELECTOR); }), skipWhile(Boolean), take(1))).subscribe(function () { return setNativeFocused(_this.element); });
35
- }
36
- return;
37
- }
38
- setNativeFocused(this.element);
39
- };
40
- Object.defineProperty(TuiAutoFocusDirective.prototype, "element", {
14
+ Object.defineProperty(AbstractTuiAutofocusHandler.prototype, "element", {
41
15
  get: function () {
42
16
  var _a;
43
17
  return (((_a = this.tuiFocusableComponent) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) ||
@@ -46,24 +20,85 @@ var TuiAutoFocusDirective = /** @class */ (function () {
46
20
  enumerable: true,
47
21
  configurable: true
48
22
  });
49
- Object.defineProperty(TuiAutoFocusDirective.prototype, "isTextFieldElement", {
23
+ Object.defineProperty(AbstractTuiAutofocusHandler.prototype, "isTextFieldElement", {
50
24
  get: function () {
51
25
  return this.element.matches('input, textarea');
52
26
  },
53
27
  enumerable: true,
54
28
  configurable: true
55
29
  });
56
- TuiAutoFocusDirective.prototype.iosWebkitAutofocus = function () {
30
+ AbstractTuiAutofocusHandler.ctorParameters = function () { return [
31
+ { type: undefined },
32
+ { type: ElementRef }
33
+ ]; };
34
+ AbstractTuiAutofocusHandler = __decorate([
35
+ Directive()
36
+ ], AbstractTuiAutofocusHandler);
37
+ return AbstractTuiAutofocusHandler;
38
+ }());
39
+
40
+ var TIMEOUT = 1000;
41
+ var NG_ANIMATION_SELECTOR = '.ng-animating';
42
+ var TuiDefaultAutofocusHandler = /** @class */ (function (_super) {
43
+ __extends(TuiDefaultAutofocusHandler, _super);
44
+ function TuiDefaultAutofocusHandler(tuiFocusableComponent, elementRef, animationFrame$) {
45
+ var _this = _super.call(this, tuiFocusableComponent, elementRef) || this;
46
+ _this.animationFrame$ = animationFrame$;
47
+ return _this;
48
+ }
49
+ TuiDefaultAutofocusHandler.prototype.setFocus = function () {
50
+ var _this = this;
51
+ if (this.isTextFieldElement) {
52
+ race(timer(TIMEOUT), this.animationFrame$.pipe(throttleTime(POLLING_TIME), map(function () { return _this.element.closest(NG_ANIMATION_SELECTOR); }), skipWhile(Boolean), take(1))).subscribe(function () { return _this.element.focus(); });
53
+ }
54
+ else {
55
+ this.element.focus();
56
+ }
57
+ };
58
+ TuiDefaultAutofocusHandler.ctorParameters = function () { return [
59
+ { type: undefined, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [TUI_FOCUSABLE_ITEM_ACCESSOR,] }] },
60
+ { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
61
+ { type: Observable, decorators: [{ type: Inject, args: [ANIMATION_FRAME,] }] }
62
+ ]; };
63
+ TuiDefaultAutofocusHandler = __decorate([
64
+ Directive(),
65
+ __param(0, Optional()),
66
+ __param(0, Self()),
67
+ __param(0, Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)),
68
+ __param(1, Inject(ElementRef)),
69
+ __param(2, Inject(ANIMATION_FRAME))
70
+ ], TuiDefaultAutofocusHandler);
71
+ return TuiDefaultAutofocusHandler;
72
+ }(AbstractTuiAutofocusHandler));
73
+
74
+ var TuiIosAutofocusHandler = /** @class */ (function (_super) {
75
+ __extends(TuiIosAutofocusHandler, _super);
76
+ function TuiIosAutofocusHandler(tuiFocusableComponent, elementRef, renderer, ngZone) {
77
+ var _this = _super.call(this, tuiFocusableComponent, elementRef) || this;
78
+ _this.renderer = renderer;
79
+ _this.ngZone = ngZone;
80
+ return _this;
81
+ }
82
+ TuiIosAutofocusHandler.prototype.setFocus = function () {
83
+ var _this = this;
84
+ if (this.isTextFieldElement) {
85
+ this.ngZone.runOutsideAngular(function () { return _this.iosWebkitAutofocus(); });
86
+ }
87
+ else {
88
+ this.element.focus();
89
+ }
90
+ };
91
+ TuiIosAutofocusHandler.prototype.iosWebkitAutofocus = function () {
57
92
  var _this = this;
58
93
  var _a;
59
94
  var fakeInput = this.renderer.createElement('input');
60
95
  fakeInput.style.position = 'absolute';
61
96
  fakeInput.style.opacity = '0';
62
97
  fakeInput.style.height = '0';
63
- var blurHandler = function () { return setNativeFocused(fakeInput); };
98
+ var blurHandler = function () { return fakeInput.focus(); };
64
99
  var focusHandler = function () {
65
100
  setTimeout(function () {
66
- setNativeFocused(_this.element);
101
+ _this.element.focus();
67
102
  /**
68
103
  * @note:
69
104
  * We can't remove the element immediately, because it breaks flow
@@ -86,15 +121,61 @@ var TuiAutoFocusDirective = /** @class */ (function () {
86
121
  fakeInput.addEventListener('blur', blurHandler, { once: true });
87
122
  fakeInput.addEventListener('focus', focusHandler);
88
123
  (_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.appendChild(fakeInput);
89
- setNativeFocused(fakeInput);
124
+ fakeInput.focus();
90
125
  };
91
- TuiAutoFocusDirective.ctorParameters = function () { return [
126
+ TuiIosAutofocusHandler.ctorParameters = function () { return [
92
127
  { type: undefined, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [TUI_FOCUSABLE_ITEM_ACCESSOR,] }] },
93
- { type: Boolean, decorators: [{ type: Inject, args: [TUI_IS_IOS,] }] },
94
- { type: Observable, decorators: [{ type: Inject, args: [ANIMATION_FRAME,] }] },
95
- { type: NgZone, decorators: [{ type: Inject, args: [NgZone,] }] },
96
128
  { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
97
- { type: Renderer2, decorators: [{ type: Inject, args: [Renderer2,] }] }
129
+ { type: Renderer2, decorators: [{ type: Inject, args: [Renderer2,] }] },
130
+ { type: NgZone, decorators: [{ type: Inject, args: [NgZone,] }] }
131
+ ]; };
132
+ TuiIosAutofocusHandler = __decorate([
133
+ Directive(),
134
+ __param(0, Optional()),
135
+ __param(0, Self()),
136
+ __param(0, Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)),
137
+ __param(1, Inject(ElementRef)),
138
+ __param(2, Inject(Renderer2)),
139
+ __param(3, Inject(NgZone))
140
+ ], TuiIosAutofocusHandler);
141
+ return TuiIosAutofocusHandler;
142
+ }(AbstractTuiAutofocusHandler));
143
+
144
+ var TUI_AUTOFOCUS_HANDLER = new InjectionToken('Autofocusing handler');
145
+ // TODO: 3.0 remove in ivy compilation
146
+ function tuiAutofocusHandlerFactory(tuiFocusableComponent, elementRef, animationFrame$, renderer, ngZone) {
147
+ return inject(TUI_IS_APPLE)
148
+ ? new TuiIosAutofocusHandler(tuiFocusableComponent, elementRef, renderer, ngZone)
149
+ : new TuiDefaultAutofocusHandler(tuiFocusableComponent, elementRef, animationFrame$);
150
+ }
151
+ var TUI_AUTOFOCUS_PROVIDERS = [
152
+ {
153
+ provide: TUI_AUTOFOCUS_HANDLER,
154
+ // TODO: replace to useClass in v3.0
155
+ useFactory: tuiAutofocusHandlerFactory,
156
+ deps: [
157
+ [new Optional(), new Self(), TUI_FOCUSABLE_ITEM_ACCESSOR],
158
+ ElementRef,
159
+ ANIMATION_FRAME,
160
+ Renderer2,
161
+ NgZone,
162
+ ],
163
+ },
164
+ ];
165
+
166
+ // TODO: 3.0 change input name to tuiAutoFocus and handle empty string
167
+ var TuiAutoFocusDirective = /** @class */ (function () {
168
+ function TuiAutoFocusDirective(handler) {
169
+ this.handler = handler;
170
+ this.autoFocus = true;
171
+ }
172
+ TuiAutoFocusDirective.prototype.ngAfterViewInit = function () {
173
+ if (this.autoFocus) {
174
+ this.handler.setFocus();
175
+ }
176
+ };
177
+ TuiAutoFocusDirective.ctorParameters = function () { return [
178
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_AUTOFOCUS_HANDLER,] }] }
98
179
  ]; };
99
180
  __decorate([
100
181
  Input()
@@ -102,15 +183,9 @@ var TuiAutoFocusDirective = /** @class */ (function () {
102
183
  TuiAutoFocusDirective = __decorate([
103
184
  Directive({
104
185
  selector: '[tuiAutoFocus]',
186
+ providers: TUI_AUTOFOCUS_PROVIDERS,
105
187
  }),
106
- __param(0, Optional()),
107
- __param(0, Self()),
108
- __param(0, Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)),
109
- __param(1, Inject(TUI_IS_IOS)),
110
- __param(2, Inject(ANIMATION_FRAME)),
111
- __param(3, Inject(NgZone)),
112
- __param(4, Inject(ElementRef)),
113
- __param(5, Inject(Renderer2))
188
+ __param(0, Inject(TUI_AUTOFOCUS_HANDLER))
114
189
  ], TuiAutoFocusDirective);
115
190
  return TuiAutoFocusDirective;
116
191
  }());
@@ -131,5 +206,5 @@ var TuiAutoFocusModule = /** @class */ (function () {
131
206
  * Generated bundle index. Do not edit.
132
207
  */
133
208
 
134
- export { TuiAutoFocusDirective, TuiAutoFocusModule };
209
+ export { AbstractTuiAutofocusHandler, TUI_AUTOFOCUS_HANDLER, TUI_AUTOFOCUS_PROVIDERS, TuiAutoFocusDirective, TuiAutoFocusModule, TuiDefaultAutofocusHandler, TuiIosAutofocusHandler, tuiAutofocusHandlerFactory };
135
210
  //# sourceMappingURL=taiga-ui-cdk-directives-auto-focus.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-auto-focus.js","sources":["ng://@taiga-ui/cdk/directives/auto-focus/autofocus.directive.ts","ng://@taiga-ui/cdk/directives/auto-focus/autofocus.module.ts","ng://@taiga-ui/cdk/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.ts"],"sourcesContent":["import {\n AfterViewInit,\n Directive,\n ElementRef,\n Inject,\n Input,\n NgZone,\n Optional,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {setNativeFocused} from '@taiga-ui/cdk/utils/focus';\nimport {Observable, race, timer} from 'rxjs';\nimport {map, skipWhile, take, throttleTime} from 'rxjs/operators';\n\nconst TIMEOUT = 1000;\nconst NG_ANIMATION_SELECTOR = '.ng-animating';\n\n// TODO: in 3.0 change input name to tuiAutoFocus and handle empty string\n// TODO: refactor on this whole thing in 3.0\n@Directive({\n selector: '[tuiAutoFocus]',\n})\nexport class TuiAutoFocusDirective implements AfterViewInit {\n @Input()\n autoFocus = true;\n\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n private readonly tuiFocusableComponent: TuiFocusableElementAccessor | null,\n @Inject(TUI_IS_IOS) private readonly isIos: boolean,\n @Inject(ANIMATION_FRAME) private readonly animationFrame$: Observable<number>,\n @Inject(NgZone)\n private readonly ngZone: NgZone,\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2)\n private readonly renderer: Renderer2,\n ) {}\n\n ngAfterViewInit(): void {\n if (!this.autoFocus) {\n return;\n }\n\n if (this.isTextFieldElement) {\n if (this.isIos) {\n this.ngZone.runOutsideAngular(() => this.iosWebkitAutofocus());\n } else {\n race(\n timer(TIMEOUT),\n this.animationFrame$.pipe(\n throttleTime(POLLING_TIME),\n map(() => this.element.closest(NG_ANIMATION_SELECTOR)),\n skipWhile(Boolean),\n take(1),\n ),\n ).subscribe(() => setNativeFocused(this.element));\n }\n\n return;\n }\n\n setNativeFocused(this.element);\n }\n\n private get element(): TuiNativeFocusableElement {\n return (\n this.tuiFocusableComponent?.nativeFocusableElement ||\n this.elementRef.nativeElement\n );\n }\n\n private get isTextFieldElement(): boolean {\n return this.element.matches('input, textarea');\n }\n\n private iosWebkitAutofocus(): void {\n const fakeInput: HTMLElement = this.renderer.createElement('input');\n\n fakeInput.style.position = 'absolute';\n fakeInput.style.opacity = '0';\n fakeInput.style.height = '0';\n\n const blurHandler = (): void => setNativeFocused(fakeInput);\n const focusHandler = (): void => {\n setTimeout(() => {\n setNativeFocused(this.element);\n\n /**\n * @note:\n * We can't remove the element immediately, because it breaks flow\n */\n setTimeout(() => {\n fakeInput.removeEventListener('blur', blurHandler);\n fakeInput.removeEventListener('focus', focusHandler);\n fakeInput.remove();\n });\n });\n };\n\n /**\n * @note: ping-pong eager strategy hack\n * After creating an element and bringing it into DOM,\n * the browser automatically focuses on the invisible element.\n * And then, after focus is triggered, we try to focus on target element, and if we managed to refocus,\n * then we try to focus again on an invisible element, so that the keyboard slowly appears.\n * This ping pong allows the keyboard to not overlap the modal window.\n */\n fakeInput.addEventListener('blur', blurHandler, {once: true});\n fakeInput.addEventListener('focus', focusHandler);\n\n this.element.parentElement?.appendChild(fakeInput);\n\n setNativeFocused(fakeInput);\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiAutoFocusDirective} from './autofocus.directive';\n\n@NgModule({\n declarations: [TuiAutoFocusDirective],\n exports: [TuiAutoFocusDirective],\n})\nexport class TuiAutoFocusModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAsBA,IAAM,OAAO,GAAG,IAAI,CAAC;AACrB,IAAM,qBAAqB,GAAG,eAAe,CAAC;AAE9C;AACA;;IAQI,+BAIqB,qBAAyD,EACrC,KAAc,EACT,eAAmC,EAE5D,MAAc,EAEd,UAAmC,EAEnC,QAAmB;QARnB,0BAAqB,GAArB,qBAAqB,CAAoC;QACrC,UAAK,GAAL,KAAK,CAAS;QACT,oBAAe,GAAf,eAAe,CAAoB;QAE5D,WAAM,GAAN,MAAM,CAAQ;QAEd,eAAU,GAAV,UAAU,CAAyB;QAEnC,aAAQ,GAAR,QAAQ,CAAW;QAdxC,cAAS,GAAG,IAAI,CAAC;KAeb;IAEJ,+CAAe,GAAf;QAAA,iBAwBC;QAvBG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACjB,OAAO;SACV;QAED,IAAI,IAAI,CAAC,kBAAkB,EAAE;YACzB,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,cAAM,OAAA,KAAI,CAAC,kBAAkB,EAAE,GAAA,CAAC,CAAC;aAClE;iBAAM;gBACH,IAAI,CACA,KAAK,CAAC,OA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CAAC;OACW,kBAAkB,CAAG;IAAD,yBAAC;CAAlC;;ACRA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-auto-focus.js","sources":["ng://@taiga-ui/cdk/directives/auto-focus/handlers/abstract.handler.ts","ng://@taiga-ui/cdk/directives/auto-focus/handlers/default.handler.ts","ng://@taiga-ui/cdk/directives/auto-focus/handlers/ios.handler.ts","ng://@taiga-ui/cdk/directives/auto-focus/autofocus.options.ts","ng://@taiga-ui/cdk/directives/auto-focus/autofocus.directive.ts","ng://@taiga-ui/cdk/directives/auto-focus/autofocus.module.ts","ng://@taiga-ui/cdk/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.ts"],"sourcesContent":["import {Directive, ElementRef} from '@angular/core';\nimport {\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk/interfaces';\n\nimport {TuiAutofocusHandler} from '../autofocus.options';\n\n@Directive()\nexport abstract class AbstractTuiAutofocusHandler implements TuiAutofocusHandler {\n protected constructor(\n protected readonly tuiFocusableComponent: TuiFocusableElementAccessor | null,\n protected readonly elementRef: ElementRef<HTMLElement>,\n ) {}\n\n protected get element(): TuiNativeFocusableElement {\n return (\n this.tuiFocusableComponent?.nativeFocusableElement ||\n this.elementRef.nativeElement\n );\n }\n\n protected get isTextFieldElement(): boolean {\n return this.element.matches('input, textarea');\n }\n\n abstract setFocus(): void;\n}\n","import {Directive, ElementRef, Inject, Optional, Self} from '@angular/core';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\nimport {Observable, race, timer} from 'rxjs';\nimport {map, skipWhile, take, throttleTime} from 'rxjs/operators';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TIMEOUT = 1000;\nconst NG_ANIMATION_SELECTOR = '.ng-animating';\n\n@Directive()\nexport class TuiDefaultAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n tuiFocusableComponent: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) elementRef: ElementRef<HTMLElement>,\n @Inject(ANIMATION_FRAME) private readonly animationFrame$: Observable<number>,\n ) {\n super(tuiFocusableComponent, elementRef);\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n race(\n timer(TIMEOUT),\n this.animationFrame$.pipe(\n throttleTime(POLLING_TIME),\n map(() => this.element.closest(NG_ANIMATION_SELECTOR)),\n skipWhile(Boolean),\n take(1),\n ),\n ).subscribe(() => this.element.focus());\n } else {\n this.element.focus();\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n Inject,\n NgZone,\n Optional,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\n@Directive()\nexport class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n tuiFocusableComponent: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2)\n private readonly renderer: Renderer2,\n @Inject(NgZone)\n private readonly ngZone: NgZone,\n ) {\n super(tuiFocusableComponent, elementRef);\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n this.ngZone.runOutsideAngular(() => this.iosWebkitAutofocus());\n } else {\n this.element.focus();\n }\n }\n\n private iosWebkitAutofocus(): void {\n const fakeInput: HTMLElement = this.renderer.createElement('input');\n\n fakeInput.style.position = 'absolute';\n fakeInput.style.opacity = '0';\n fakeInput.style.height = '0';\n\n const blurHandler = (): void => fakeInput.focus();\n const focusHandler = (): void => {\n setTimeout(() => {\n this.element.focus();\n\n /**\n * @note:\n * We can't remove the element immediately, because it breaks flow\n */\n setTimeout(() => {\n fakeInput.removeEventListener('blur', blurHandler);\n fakeInput.removeEventListener('focus', focusHandler);\n fakeInput.remove();\n });\n });\n };\n\n /**\n * @note: ping-pong eager strategy hack\n * After creating an element and bringing it into DOM,\n * the browser automatically focuses on the invisible element.\n * And then, after focus is triggered, we try to focus on target element, and if we managed to refocus,\n * then we try to focus again on an invisible element, so that the keyboard slowly appears.\n * This ping pong allows the keyboard to not overlap the modal window.\n */\n fakeInput.addEventListener('blur', blurHandler, {once: true});\n fakeInput.addEventListener('focus', focusHandler);\n\n this.element.parentElement?.appendChild(fakeInput);\n\n fakeInput.focus();\n }\n}\n","import {\n ElementRef,\n inject,\n InjectionToken,\n NgZone,\n Optional,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_APPLE} from '@taiga-ui/cdk/tokens';\nimport {Observable} from 'rxjs';\n\nimport {TuiDefaultAutofocusHandler} from './handlers/default.handler';\nimport {TuiIosAutofocusHandler} from './handlers/ios.handler';\n\nexport interface TuiAutofocusHandler {\n setFocus(): void;\n}\n\nexport const TUI_AUTOFOCUS_HANDLER = new InjectionToken<TuiAutofocusHandler>(\n 'Autofocusing handler',\n);\n\n// TODO: 3.0 remove in ivy compilation\nexport function tuiAutofocusHandlerFactory(\n tuiFocusableComponent: TuiFocusableElementAccessor | null,\n elementRef: ElementRef<HTMLElement>,\n animationFrame$: Observable<number>,\n renderer: Renderer2,\n ngZone: NgZone,\n): TuiAutofocusHandler {\n return inject(TUI_IS_APPLE)\n ? new TuiIosAutofocusHandler(tuiFocusableComponent, elementRef, renderer, ngZone)\n : new TuiDefaultAutofocusHandler(\n tuiFocusableComponent,\n elementRef,\n animationFrame$,\n );\n}\n\nexport const TUI_AUTOFOCUS_PROVIDERS = [\n {\n provide: TUI_AUTOFOCUS_HANDLER,\n // TODO: replace to useClass in v3.0\n useFactory: tuiAutofocusHandlerFactory,\n deps: [\n [new Optional(), new Self(), TUI_FOCUSABLE_ITEM_ACCESSOR],\n ElementRef,\n ANIMATION_FRAME,\n Renderer2,\n NgZone,\n ],\n },\n];\n","import {AfterViewInit, Directive, Inject, Input} from '@angular/core';\n\nimport {\n TUI_AUTOFOCUS_HANDLER,\n TUI_AUTOFOCUS_PROVIDERS,\n TuiAutofocusHandler,\n} from './autofocus.options';\n\n// TODO: 3.0 change input name to tuiAutoFocus and handle empty string\n@Directive({\n selector: '[tuiAutoFocus]',\n providers: TUI_AUTOFOCUS_PROVIDERS,\n})\nexport class TuiAutoFocusDirective implements AfterViewInit {\n @Input()\n autoFocus = true;\n\n constructor(\n @Inject(TUI_AUTOFOCUS_HANDLER) private readonly handler: TuiAutofocusHandler,\n ) {}\n\n ngAfterViewInit(): void {\n if (this.autoFocus) {\n this.handler.setFocus();\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiAutoFocusDirective} from './autofocus.directive';\n\n@NgModule({\n declarations: [TuiAutoFocusDirective],\n exports: [TuiAutoFocusDirective],\n})\nexport class TuiAutoFocusModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAUI,qCACuB,qBAAyD,EACzD,UAAmC;QADnC,0BAAqB,GAArB,qBAAqB,CAAoC;QACzD,eAAU,GAAV,UAAU,CAAyB;KACtD;IAEJ,sBAAc,gDAAO;aAArB;;YACI,QACI,OAAA,IAAI,CAAC,qBAAqB,0CAAE,sBAAsB;gBAClD,IAAI,CAAC,UAAU,CAAC,aAAa,EAC/B;SACL;;;OAAA;IAED,sBAAc,2DAAkB;aAAhC;YACI,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CA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D,UAAU;YACV,eAAe;YACf,SAAS;YACT,MAAM;SACT;KACJ;;;AC9CL;;IASI,+BACoD,OAA4B;QAA5B,YAAO,GAAP,OAAO,CAAqB;QAHhF,cAAS,GAAG,IAAI,CAAC;KAIb;IAEJ,+CAAe,GAAf;QACI,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;SAC3B;KACJ;;gDAPI,MAAM,SAAC,qBAAqB;;IAHjC;QADC,KAAK,EAAE;4DACS;IAFR,qBAAqB;QAJjC,SAAS,CAAC;YACP,QAAQ,EAAE,gBAAgB;YAC1B,SAAS,EAAE,uBAAuB;SACrC,CAAC;QAMO,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;OALzB,qBAAqB,CAajC;IAAD,4BAAC;CAbD;;;ICLA;KAAkC;IAArB,kBAAkB;QAJ9B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;YACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;SACnC,CAAC;OACW,kBAAkB,CAAG;IAAD,yBAAC;CAAlC;;ACRA;;;;;;"}
@@ -1,38 +1,53 @@
1
1
  import { __decorate, __param } from 'tslib';
2
- import { ElementRef, Inject, Output, Directive, NgModule } from '@angular/core';
3
- import { typedFromEvent } from '@taiga-ui/cdk/observables';
2
+ import { Component, ViewEncapsulation, EventEmitter, Inject, HostBinding, Output, HostListener, Directive, NgModule } from '@angular/core';
4
3
  import { TuiDirectiveStylesService } from '@taiga-ui/cdk/services';
5
- import { map, skip } from 'rxjs/operators';
6
4
 
7
- var ON = 'tuiAutofillOn';
8
- var OFF = 'tuiAutofillOff';
9
- var STYLE = "\n@keyframes " + ON + " {\n from {\n content: '1';\n }\n\n to {\n content: '2';\n }\n}\n\n@keyframes " + OFF + " {\n from {\n content: '2';\n }\n\n to {\n content: '1';\n }\n}";
10
- // @dynamic
5
+ var TuiAutofilledStyleComponent = /** @class */ (function () {
6
+ function TuiAutofilledStyleComponent() {
7
+ }
8
+ TuiAutofilledStyleComponent = __decorate([
9
+ Component({
10
+ template: '',
11
+ encapsulation: ViewEncapsulation.None,
12
+ styles: [".tui-autofill,.tui-autofill input{transition:box-shadow 10ms}.tui-autofill input::-webkit-credit-card-auto-fill-button,.tui-autofill::-webkit-credit-card-auto-fill-button{pointer-events:none;background-color:transparent!important;-webkit-mask-image:none!important}"]
13
+ })
14
+ ], TuiAutofilledStyleComponent);
15
+ return TuiAutofilledStyleComponent;
16
+ }());
17
+
11
18
  var TuiAutofilledDirective = /** @class */ (function () {
12
- function TuiAutofilledDirective(elementRef, directiveStyles) {
13
- this.elementRef = elementRef;
14
- this.tuiAutofilledChange = typedFromEvent(this.elementRef.nativeElement, 'animationstart').pipe(map(function (_a) {
15
- var animationName = _a.animationName;
16
- return animationName === ON;
17
- }), skip(1));
18
- directiveStyles.addStyle(STYLE, 'TuiAutofilledDirective');
19
+ function TuiAutofilledDirective(directiveStyles) {
20
+ this.autofilled = false;
21
+ this.tuiAutofilledChange = new EventEmitter();
22
+ directiveStyles.addComponent(TuiAutofilledStyleComponent);
19
23
  }
24
+ TuiAutofilledDirective.prototype.transitionStartHandler = function (_a) {
25
+ var propertyName = _a.propertyName, target = _a.target;
26
+ var _b;
27
+ var matchedAutofill = propertyName.includes('box-shadow') && ((_b = target) === null || _b === void 0 ? void 0 : _b.matches('input'));
28
+ if (matchedAutofill) {
29
+ this.autofilled = !this.autofilled;
30
+ this.tuiAutofilledChange.emit(this.autofilled);
31
+ }
32
+ };
20
33
  TuiAutofilledDirective.ctorParameters = function () { return [
21
- { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
22
34
  { type: TuiDirectiveStylesService, decorators: [{ type: Inject, args: [TuiDirectiveStylesService,] }] }
23
35
  ]; };
36
+ __decorate([
37
+ HostBinding('class._autofilled')
38
+ ], TuiAutofilledDirective.prototype, "autofilled", void 0);
24
39
  __decorate([
25
40
  Output()
26
41
  ], TuiAutofilledDirective.prototype, "tuiAutofilledChange", void 0);
42
+ __decorate([
43
+ HostListener('transitionstart', ['$event'])
44
+ ], TuiAutofilledDirective.prototype, "transitionStartHandler", null);
27
45
  TuiAutofilledDirective = __decorate([
28
46
  Directive({
29
47
  selector: '[tuiAutofilledChange]',
30
- host: {
31
- class: 'tui-autofill',
32
- },
48
+ host: { class: 'tui-autofill' },
33
49
  }),
34
- __param(0, Inject(ElementRef)),
35
- __param(1, Inject(TuiDirectiveStylesService))
50
+ __param(0, Inject(TuiDirectiveStylesService))
36
51
  ], TuiAutofilledDirective);
37
52
  return TuiAutofilledDirective;
38
53
  }());
@@ -42,8 +57,9 @@ var TuiAutofilledModule = /** @class */ (function () {
42
57
  }
43
58
  TuiAutofilledModule = __decorate([
44
59
  NgModule({
45
- declarations: [TuiAutofilledDirective],
46
60
  exports: [TuiAutofilledDirective],
61
+ entryComponents: [TuiAutofilledStyleComponent],
62
+ declarations: [TuiAutofilledDirective, TuiAutofilledStyleComponent],
47
63
  })
48
64
  ], TuiAutofilledModule);
49
65
  return TuiAutofilledModule;
@@ -53,5 +69,5 @@ var TuiAutofilledModule = /** @class */ (function () {
53
69
  * Generated bundle index. Do not edit.
54
70
  */
55
71
 
56
- export { TuiAutofilledDirective, TuiAutofilledModule };
72
+ export { TuiAutofilledDirective, TuiAutofilledModule, TuiAutofilledStyleComponent };
57
73
  //# sourceMappingURL=taiga-ui-cdk-directives-autofilled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-autofilled.js","sources":["ng://@taiga-ui/cdk/directives/autofilled/autofilled.directive.ts","ng://@taiga-ui/cdk/directives/autofilled/autofilled.module.ts","ng://@taiga-ui/cdk/directives/autofilled/taiga-ui-cdk-directives-autofilled.ts"],"sourcesContent":["import {Directive, ElementRef, Inject, Output} from '@angular/core';\nimport {typedFromEvent} from '@taiga-ui/cdk/observables';\nimport {TuiDirectiveStylesService} from '@taiga-ui/cdk/services';\nimport {map, skip} from 'rxjs/operators';\n\nconst ON = 'tuiAutofillOn';\nconst OFF = 'tuiAutofillOff';\nconst STYLE = `\n@keyframes ${ON} {\n from {\n content: '1';\n }\n\n to {\n content: '2';\n }\n}\n\n@keyframes ${OFF} {\n from {\n content: '2';\n }\n\n to {\n content: '1';\n }\n}`;\n\n// @dynamic\n@Directive({\n selector: '[tuiAutofilledChange]',\n host: {\n class: 'tui-autofill',\n },\n})\nexport class TuiAutofilledDirective {\n @Output()\n readonly tuiAutofilledChange = typedFromEvent(\n this.elementRef.nativeElement,\n 'animationstart',\n ).pipe(\n map(({animationName}) => animationName === ON),\n skip(1),\n );\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLInputElement>,\n @Inject(TuiDirectiveStylesService)\n directiveStyles: TuiDirectiveStylesService,\n ) {\n directiveStyles.addStyle(STYLE, 'TuiAutofilledDirective');\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiAutofilledDirective} from './autofilled.directive';\n\n@NgModule({\n declarations: [TuiAutofilledDirective],\n exports: [TuiAutofilledDirective],\n})\nexport class TuiAutofilledModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAKA,IAAM,EAAE,GAAG,eAAe,CAAC;AAC3B,IAAM,GAAG,GAAG,gBAAgB,CAAC;AAC7B,IAAM,KAAK,GAAG,kBACD,EAAE,gHAUF,GAAG,8FAQd,CAAC;AAEH;;IAiBI,gCACyC,UAAwC,EAE7E,eAA0C;QAFL,eAAU,GAAV,UAAU,CAA8B;QATxE,wBAAmB,GAAG,cAAc,CACzC,IAAI,CAAC,UAAU,CAAC,aAAa,EAC7B,gBAAgB,CACnB,CAAC,IAAI,CACF,GAAG,CAAC,UAAC,EAAe;gBAAd,gCAAa;YAAM,OAAA,aAAa,KAAK,EAAE;SAAA,CAAC,EAC9C,IAAI,CAAC,CAAC,CAAC,CACV,CAAC;QAOE,eAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;KAC7D;;gBALoD,UAAU,uBAA1D,MAAM,SAAC,UAAU;gBAED,yBAAyB,uBADzC,MAAM,SAAC,yBAAyB;;IAVrC;QADC,MAAM,EAAE;uEAOP;IARO,sBAAsB;QANlC,SAAS,CAAC;YACP,QAAQ,EAAE,uBAAuB;YACjC,IAAI,EAAE;gBACF,KAAK,EAAE,cAAc;aACxB;SACJ,CAAC;QAYO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;QAClB,WAAA,MAAM,CAAC,yBAAyB,CAAC,CAAA;OAZ7B,sBAAsB,CAiBlC;IAAD,6BAAC;CAjBD;;;IC3BA;KAAmC;IAAtB,mBAAmB;QAJ/B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,sBAAsB,CAAC;YACtC,OAAO,EAAE,CAAC,sBAAsB,CAAC;SACpC,CAAC;OACW,mBAAmB,CAAG;IAAD,0BAAC;CAAnC;;ACRA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-autofilled.js","sources":["ng://@taiga-ui/cdk/directives/autofilled/autofilled-style.component.ts","ng://@taiga-ui/cdk/directives/autofilled/autofilled.directive.ts","ng://@taiga-ui/cdk/directives/autofilled/autofilled.module.ts","ng://@taiga-ui/cdk/directives/autofilled/taiga-ui-cdk-directives-autofilled.ts"],"sourcesContent":["import {Component, ViewEncapsulation} from '@angular/core';\n\n@Component({\n template: '',\n styleUrls: ['./autofilled.style.less'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class TuiAutofilledStyleComponent {}\n","import {\n Directive,\n EventEmitter,\n HostBinding,\n HostListener,\n Inject,\n Output,\n} from '@angular/core';\nimport {TuiDirectiveStylesService} from '@taiga-ui/cdk/services';\n\nimport {TuiAutofilledStyleComponent} from './autofilled-style.component';\n\n@Directive({\n selector: '[tuiAutofilledChange]',\n host: {class: 'tui-autofill'},\n})\nexport class TuiAutofilledDirective {\n @HostBinding('class._autofilled')\n autofilled = false;\n\n @Output()\n readonly tuiAutofilledChange = new EventEmitter<boolean>();\n\n constructor(\n @Inject(TuiDirectiveStylesService) directiveStyles: TuiDirectiveStylesService,\n ) {\n directiveStyles.addComponent(TuiAutofilledStyleComponent);\n }\n\n @HostListener('transitionstart', ['$event'])\n transitionStartHandler({propertyName, target}: TransitionEvent): void {\n const matchedAutofill =\n propertyName.includes('box-shadow') && (target as Element)?.matches('input');\n\n if (matchedAutofill) {\n this.autofilled = !this.autofilled;\n this.tuiAutofilledChange.emit(this.autofilled);\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiAutofilledDirective} from './autofilled.directive';\nimport {TuiAutofilledStyleComponent} from './autofilled-style.component';\n\n@NgModule({\n exports: [TuiAutofilledDirective],\n entryComponents: [TuiAutofilledStyleComponent],\n declarations: [TuiAutofilledDirective, TuiAutofilledStyleComponent],\n})\nexport class TuiAutofilledModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;IAOA;KAA2C;IAA9B,2BAA2B;QALvC,SAAS,CAAC;YACP,QAAQ,EAAE,EAAE;YAEZ,aAAa,EAAE,iBAAiB,CAAC,IAAI;;SACxC,CAAC;OACW,2BAA2B,CAAG;IAAD,kCAAC;CAA3C;;;ICgBI,gCACuC,eAA0C;QANjF,eAAU,GAAG,KAAK,CAAC;QAGV,wBAAmB,GAAG,IAAI,YAAY,EAAW,CAAC;QAKvD,eAAe,CAAC,YAAY,CAAC,2BAA2B,CAAC,CAAC;KAC7D;IAGD,uDAAsB,GAAtB,UAAuB,EAAuC;YAAtC,8BAAY,EAAE,kBAAM;;QACxC,IAAM,eAAe,GACjB,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAK,MAAkB,0CAAE,OAAO,CAAC,OAAO,EAAC,CAAC;QAEjF,IAAI,eAAe,EAAE;YACjB,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;YACnC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAClD;KACJ;;gBAduD,yBAAyB,uBAA5E,MAAM,SAAC,yBAAyB;;IANrC;QADC,WAAW,CAAC,mBAAmB,CAAC;8DACd;IAGnB;QADC,MAAM,EAAE;uEACkD;IAS3D;QADC,YAAY,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,CAAC;wEAS3C;IAtBQ,sBAAsB;QAJlC,SAAS,CAAC;YACP,QAAQ,EAAE,uBAAuB;YACjC,IAAI,EAAE,EAAC,KAAK,EAAE,cAAc,EAAC;SAChC,CAAC;QASO,WAAA,MAAM,CAAC,yBAAyB,CAAC,CAAA;OAR7B,sBAAsB,CAuBlC;IAAD,6BAAC;CAvBD;;;ICNA;KAAmC;IAAtB,mBAAmB;QAL/B,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,sBAAsB,CAAC;YACjC,eAAe,EAAE,CAAC,2BAA2B,CAAC;YAC9C,YAAY,EAAE,CAAC,sBAAsB,EAAE,2BAA2B,CAAC;SACtE,CAAC;OACW,mBAAmB,CAAG;IAAD,0BAAC;CAAnC;;ACVA;;;;;;"}
@@ -13,10 +13,11 @@ var TuiFocusTrapDirective = /** @class */ (function () {
13
13
  this.renderer = renderer;
14
14
  this.activeElement = getNativeFocused(this.documentRef);
15
15
  /**
16
- * This would cause currently focused element to lose focus
16
+ * This would cause currently focused element to lose focus,
17
17
  * but it might cause ExpressionChanged error due to potential HostBinding.
18
18
  * Microtask keeps it in the same frame but allows change detection to run
19
19
  */
20
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
20
21
  Promise.resolve().then(function () {
21
22
  setNativeFocused(_this.elementRef.nativeElement);
22
23
  });
@@ -42,6 +43,7 @@ var TuiFocusTrapDirective = /** @class */ (function () {
42
43
  * so we need to delay it but stay in the same sync cycle,
43
44
  * therefore using Promise instead of setTimeout
44
45
  */
46
+ // eslint-disable-next-line
45
47
  Promise.resolve().then(function () {
46
48
  // TODO: iframe warning
47
49
  if (_this.activeElement instanceof HTMLElement) {
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-focus-trap.js","sources":["ng://@taiga-ui/cdk/directives/focus-trap/focus-trap.directive.ts","ng://@taiga-ui/cdk/directives/focus-trap/focus-trap.module.ts","ng://@taiga-ui/cdk/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n HostListener,\n Inject,\n OnDestroy,\n Renderer2,\n} from '@angular/core';\nimport {containsOrAfter} from '@taiga-ui/cdk/utils/dom';\nimport {\n blurNativeFocused,\n getClosestFocusable,\n getNativeFocused,\n setNativeFocused,\n} from '@taiga-ui/cdk/utils/focus';\n\n// @dynamic\n@Directive({\n selector: '[tuiFocusTrap]',\n host: {\n tabIndex: '0',\n },\n})\nexport class TuiFocusTrapDirective implements OnDestroy {\n private readonly activeElement = getNativeFocused(this.documentRef);\n\n constructor(\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n ) {\n /**\n * This would cause currently focused element to lose focus\n * but it might cause ExpressionChanged error due to potential HostBinding.\n * Microtask keeps it in the same frame but allows change detection to run\n */\n Promise.resolve().then(() => {\n setNativeFocused(this.elementRef.nativeElement);\n });\n }\n\n @HostListener('blur')\n onBlur(): void {\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'tabIndex');\n }\n\n @HostListener('window:focusin.silent', ['$event.target'])\n onFocusIn(node: Node): void {\n if (containsOrAfter(this.elementRef.nativeElement, node)) {\n return;\n }\n\n const focusable = getClosestFocusable(\n this.elementRef.nativeElement,\n false,\n this.elementRef.nativeElement,\n );\n\n if (focusable) {\n setNativeFocused(focusable);\n }\n }\n\n ngOnDestroy(): void {\n blurNativeFocused(this.documentRef);\n\n /**\n * HostListeners are triggered even after ngOnDestroy\n * {@link https://github.com/angular/angular/issues/38100}\n * so we need to delay it but stay in the same sync cycle,\n * therefore using Promise instead of setTimeout\n */\n Promise.resolve().then(() => {\n // TODO: iframe warning\n if (this.activeElement instanceof HTMLElement) {\n setNativeFocused(this.activeElement);\n }\n });\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFocusTrapDirective} from './focus-trap.directive';\n\n@NgModule({\n declarations: [TuiFocusTrapDirective],\n exports: [TuiFocusTrapDirective],\n})\nexport class TuiFocusTrapModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAiBA;;IAUI,+BACuC,WAAqB,EAEvC,UAAmC,EAChB,QAAmB;QAJ3D,iBAcC;QAbsC,gBAAW,GAAX,WAAW,CAAU;QAEvC,eAAU,GAAV,UAAU,CAAyB;QAChB,aAAQ,GAAR,QAAQ,CAAW;QAN1C,kBAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;;;;;;QAahE,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;YACnB,gBAAgB,CAAC,KAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;SACnD,CAAC,CAAC;KACN;IAGD,sCAAM,GAAN;QACI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;KAC5E;IAGD,yCAAS,GAAT,UAAU,IAAU;QAChB,IAAI,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;YACtD,OAAO;SACV;QAED,IAAM,SAAS,GAAG,mBAAmB,CACjC,IAAI,CAAC,UAAU,CAAC,aAAa,EAC7B,KAAK,EACL,IAAI,CAAC,UAAU,CAAC,aAAa,CAChC,CAAC;QAEF,IAAI,SAAS,EAAE;YACX,gBAAgB,CAAC,SAAS,CAAC,CAAC;SAC/B;KACJ;IAED,2CAAW,GAAX;QAAA,iBAeC;QAdG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;;;;;;;QAQpC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;;YAEnB,IAAI,KAAI,CAAC,aAAa,YAAY,WAAW,EAAE;gBAC3C,gBAAgB,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC;aACxC;SACJ,CAAC,CAAC;KACN;;gBApDmD,QAAQ,uBAAvD,MAAM,SAAC,QAAQ;gBAEa,UAAU,uBADtC,MAAM,SAAC,UAAU;gBAE4B,SAAS,uBAAtD,MAAM,SAAC,SAAS;;IAarB;QADC,YAAY,CAAC,MAAM,CAAC;uDAGpB;IAGD;QADC,YAAY,CAAC,uBAAuB,EAAE,CAAC,eAAe,CAAC,CAAC;0DAexD;IAvCQ,qBAAqB;QANjC,SAAS,CAAC;YACP,QAAQ,EAAE,gBAAgB;YAC1B,IAAI,EAAE;gBACF,QAAQ,EAAE,GAAG;aAChB;SACJ,CAAC;QAKO,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;QAChB,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;QAElB,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;OAPb,qBAAqB,CAyDjC;IAAD,4BAAC;CAzDD;;;IChBA;KAAkC;IAArB,kBAAkB;QAJ9B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;YACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;SACnC,CAAC;OACW,kBAAkB,CAAG;IAAD,yBAAC;CAAlC;;ACRA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-focus-trap.js","sources":["ng://@taiga-ui/cdk/directives/focus-trap/focus-trap.directive.ts","ng://@taiga-ui/cdk/directives/focus-trap/focus-trap.module.ts","ng://@taiga-ui/cdk/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n HostListener,\n Inject,\n OnDestroy,\n Renderer2,\n} from '@angular/core';\nimport {containsOrAfter} from '@taiga-ui/cdk/utils/dom';\nimport {\n blurNativeFocused,\n getClosestFocusable,\n getNativeFocused,\n setNativeFocused,\n} from '@taiga-ui/cdk/utils/focus';\n\n// @dynamic\n@Directive({\n selector: '[tuiFocusTrap]',\n host: {\n tabIndex: '0',\n },\n})\nexport class TuiFocusTrapDirective implements OnDestroy {\n private readonly activeElement = getNativeFocused(this.documentRef);\n\n constructor(\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n ) {\n /**\n * This would cause currently focused element to lose focus,\n * but it might cause ExpressionChanged error due to potential HostBinding.\n * Microtask keeps it in the same frame but allows change detection to run\n */\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.resolve().then(() => {\n setNativeFocused(this.elementRef.nativeElement);\n });\n }\n\n @HostListener('blur')\n onBlur(): void {\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'tabIndex');\n }\n\n @HostListener('window:focusin.silent', ['$event.target'])\n onFocusIn(node: Node): void {\n if (containsOrAfter(this.elementRef.nativeElement, node)) {\n return;\n }\n\n const focusable = getClosestFocusable(\n this.elementRef.nativeElement,\n false,\n this.elementRef.nativeElement,\n );\n\n if (focusable) {\n setNativeFocused(focusable);\n }\n }\n\n ngOnDestroy(): void {\n blurNativeFocused(this.documentRef);\n\n /**\n * HostListeners are triggered even after ngOnDestroy\n * {@link https://github.com/angular/angular/issues/38100}\n * so we need to delay it but stay in the same sync cycle,\n * therefore using Promise instead of setTimeout\n */\n // eslint-disable-next-line\n Promise.resolve().then(() => {\n // TODO: iframe warning\n if (this.activeElement instanceof HTMLElement) {\n setNativeFocused(this.activeElement);\n }\n });\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFocusTrapDirective} from './focus-trap.directive';\n\n@NgModule({\n declarations: [TuiFocusTrapDirective],\n exports: [TuiFocusTrapDirective],\n})\nexport class TuiFocusTrapModule {}\n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AM,SAAC,UAAU;gBAE4B,SAAS,uBAAtD,MAAM,SAAC,SAAS;;IAcrB;QADC,YAAY,CAAC,MAAM,CAAC;uDAGpB;IAGD;QADC,YAAY,CAAC,uBAAuB,EAAE,CAAC,eAAe,CAAC,CAAC;0DAexD;IAxCQ,qBAAqB;QANjC,SAAS,CAAC;YACP,QAAQ,EAAE,gBAAgB;YAC1B,IAAI,EAAE;gBACF,QAAQ,EAAE,GAAG;aAChB;SACJ,CAAC;QAKO,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;QAChB,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;QAElB,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;OAPb,qBAAqB,CA2DjC;IAAD,4BAAC;CA3DD;;;IChBA;KAAkC;IAArB,kBAAkB;QAJ9B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;YACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;SACnC,CAAC;OACW,kBAAkB,CAAG;IAAD,yBAAC;CAAlC;;ACRA;;;;;;"}
@@ -0,0 +1,73 @@
1
+ import { __decorate, __param } from 'tslib';
2
+ import { ViewContainerRef, Inject, TemplateRef, Input, Directive, NgModule } from '@angular/core';
3
+ import { Subject, from, of } from 'rxjs';
4
+ import { concatMap, delay, takeUntil } from 'rxjs/operators';
5
+
6
+ var TuiForAsyncDirective = /** @class */ (function () {
7
+ function TuiForAsyncDirective(view, template) {
8
+ this.view = view;
9
+ this.template = template;
10
+ this.destroy$ = new Subject();
11
+ this.tuiForAsyncTimeout = 10;
12
+ }
13
+ TuiForAsyncDirective.prototype.ngOnChanges = function () {
14
+ this.clearViewForOldNodes();
15
+ this.createAsyncViewForNewNodes();
16
+ };
17
+ TuiForAsyncDirective.prototype.ngOnDestroy = function () {
18
+ this.clearViewForOldNodes();
19
+ this.destroy$.complete();
20
+ };
21
+ TuiForAsyncDirective.prototype.createAsyncViewForNewNodes = function () {
22
+ var _this = this;
23
+ from(this.tuiForAsyncOf || [])
24
+ .pipe(concatMap(function (item) { return of(item).pipe(delay(_this.tuiForAsyncTimeout)); }), takeUntil(this.destroy$))
25
+ .subscribe(function (item) {
26
+ return _this.view
27
+ .createEmbeddedView(_this.template, { $implicit: item })
28
+ .detectChanges();
29
+ });
30
+ };
31
+ TuiForAsyncDirective.prototype.clearViewForOldNodes = function () {
32
+ this.destroy$.next();
33
+ this.view.clear();
34
+ };
35
+ TuiForAsyncDirective.ctorParameters = function () { return [
36
+ { type: ViewContainerRef, decorators: [{ type: Inject, args: [ViewContainerRef,] }] },
37
+ { type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
38
+ ]; };
39
+ __decorate([
40
+ Input()
41
+ ], TuiForAsyncDirective.prototype, "tuiForAsyncOf", void 0);
42
+ __decorate([
43
+ Input()
44
+ ], TuiForAsyncDirective.prototype, "tuiForAsyncTimeout", void 0);
45
+ TuiForAsyncDirective = __decorate([
46
+ Directive({ selector: '[tuiForAsync][tuiForAsyncOf]' }),
47
+ __param(0, Inject(ViewContainerRef)),
48
+ __param(1, Inject(TemplateRef))
49
+ ], TuiForAsyncDirective);
50
+ return TuiForAsyncDirective;
51
+ }());
52
+
53
+ /**
54
+ * @experimental
55
+ */
56
+ var TuiForAsyncModule = /** @class */ (function () {
57
+ function TuiForAsyncModule() {
58
+ }
59
+ TuiForAsyncModule = __decorate([
60
+ NgModule({
61
+ declarations: [TuiForAsyncDirective],
62
+ exports: [TuiForAsyncDirective],
63
+ })
64
+ ], TuiForAsyncModule);
65
+ return TuiForAsyncModule;
66
+ }());
67
+
68
+ /**
69
+ * Generated bundle index. Do not edit.
70
+ */
71
+
72
+ export { TuiForAsyncDirective, TuiForAsyncModule };
73
+ //# sourceMappingURL=taiga-ui-cdk-directives-for-async.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taiga-ui-cdk-directives-for-async.js","sources":["ng://@taiga-ui/cdk/directives/for-async/for-async.directive.ts","ng://@taiga-ui/cdk/directives/for-async/for-async.module.ts","ng://@taiga-ui/cdk/directives/for-async/taiga-ui-cdk-directives-for-async.ts"],"sourcesContent":["import {\n Directive,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport {from, of, Subject} from 'rxjs';\nimport {concatMap, delay, takeUntil} from 'rxjs/operators';\n\n@Directive({selector: '[tuiForAsync][tuiForAsyncOf]'})\nexport class TuiForAsyncDirective<T> implements OnChanges, OnDestroy {\n private readonly destroy$ = new Subject<void>();\n\n @Input()\n tuiForAsyncOf: readonly T[] | undefined | null;\n\n @Input()\n tuiForAsyncTimeout = 10;\n\n constructor(\n @Inject(ViewContainerRef) private readonly view: ViewContainerRef,\n @Inject(TemplateRef) private readonly template: TemplateRef<unknown>,\n ) {}\n\n ngOnChanges(): void {\n this.clearViewForOldNodes();\n this.createAsyncViewForNewNodes();\n }\n\n ngOnDestroy(): void {\n this.clearViewForOldNodes();\n this.destroy$.complete();\n }\n\n private createAsyncViewForNewNodes(): void {\n from(this.tuiForAsyncOf || [])\n .pipe(\n concatMap(item => of(item).pipe(delay(this.tuiForAsyncTimeout))),\n takeUntil(this.destroy$),\n )\n .subscribe(item =>\n this.view\n .createEmbeddedView(this.template, {$implicit: item})\n .detectChanges(),\n );\n }\n\n private clearViewForOldNodes(): void {\n this.destroy$.next();\n this.view.clear();\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiForAsyncDirective} from './for-async.directive';\n\n/**\n * @experimental\n */\n@NgModule({\n declarations: [TuiForAsyncDirective],\n exports: [TuiForAsyncDirective],\n})\nexport class TuiForAsyncModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;IAsBI,8BAC+C,IAAsB,EAC3B,QAA8B;QADzB,SAAI,GAAJ,IAAI,CAAkB;QAC3B,aAAQ,GAAR,QAAQ,CAAsB;QAVvD,aAAQ,GAAG,IAAI,OAAO,EAAQ,CAAC;QAMhD,uBAAk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iB;QAJ7B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,oBAAoB,CAAC;YACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;SAClC,CAAC;OACW,iBAAiB,CAAG;IAAD,wBAAC;CAAjC;;ACXA;;;;;;"}
@@ -3,7 +3,7 @@ import { Directive, NgModule } from '@angular/core';
3
3
 
4
4
  /**
5
5
  * Blank directive to query for {@link TemplateRef}
6
- * TODO: Migrate everything to this directive
6
+ * TODO: 3.0 Migrate everything to this directive
7
7
  */
8
8
  var TuiItemDirective = /** @class */ (function () {
9
9
  function TuiItemDirective() {
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-item.js","sources":["ng://@taiga-ui/cdk/directives/item/item.directive.ts","ng://@taiga-ui/cdk/directives/item/item.module.ts","ng://@taiga-ui/cdk/directives/item/taiga-ui-cdk-directives-item.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n/**\n * Blank directive to query for {@link TemplateRef}\n * TODO: Migrate everything to this directive\n */\n@Directive({\n selector: 'ng-template[tuiItem]',\n})\nexport class TuiItemDirective {}\n","import {NgModule} from '@angular/core';\n\nimport {TuiItemDirective} from './item.directive';\n\n@NgModule({\n declarations: [TuiItemDirective],\n exports: [TuiItemDirective],\n})\nexport class TuiItemModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;;;IAOA;KAAgC;IAAnB,gBAAgB;QAH5B,SAAS,CAAC;YACP,QAAQ,EAAE,sBAAsB;SACnC,CAAC;OACW,gBAAgB,CAAG;IAAD,uBAAC;CAAhC;;;ICDA;KAA6B;IAAhB,aAAa;QAJzB,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,gBAAgB,CAAC;YAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC9B,CAAC;OACW,aAAa,CAAG;IAAD,oBAAC;CAA7B;;ACRA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-item.js","sources":["ng://@taiga-ui/cdk/directives/item/item.directive.ts","ng://@taiga-ui/cdk/directives/item/item.module.ts","ng://@taiga-ui/cdk/directives/item/taiga-ui-cdk-directives-item.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n/**\n * Blank directive to query for {@link TemplateRef}\n * TODO: 3.0 Migrate everything to this directive\n */\n@Directive({\n selector: 'ng-template[tuiItem]',\n})\nexport class TuiItemDirective {}\n","import {NgModule} from '@angular/core';\n\nimport {TuiItemDirective} from './item.directive';\n\n@NgModule({\n declarations: [TuiItemDirective],\n exports: [TuiItemDirective],\n})\nexport class TuiItemModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;;;IAOA;KAAgC;IAAnB,gBAAgB;QAH5B,SAAS,CAAC;YACP,QAAQ,EAAE,sBAAsB;SACnC,CAAC;OACW,gBAAgB,CAAG;IAAD,uBAAC;CAAhC;;;ICDA;KAA6B;IAAhB,aAAa;QAJzB,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,gBAAgB,CAAC;YAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC9B,CAAC;OACW,aAAa,CAAG;IAAD,oBAAC;CAA7B;;ACRA;;;;;;"}
@@ -45,6 +45,7 @@ var TuiMediaDirective = /** @class */ (function () {
45
45
  this.elementRef.nativeElement.pause();
46
46
  }
47
47
  else {
48
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
48
49
  this.elementRef.nativeElement.play();
49
50
  this.updatePlaybackRate(this.playbackRate);
50
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-media.js","sources":["ng://@taiga-ui/cdk/directives/media/media.directive.ts","ng://@taiga-ui/cdk/directives/media/media.module.ts","ng://@taiga-ui/cdk/directives/media/taiga-ui-cdk-directives-media.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n} from '@angular/core';\nimport {tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk/decorators';\n\nexport function nonNegativeFiniteAssertion(value: number): boolean {\n return isFinite(value) && value >= 0;\n}\n\nexport function volumeAssertion(volume: number): boolean {\n return isFinite(volume) && volume >= 0 && volume <= 1;\n}\n\n@Directive({\n selector: 'video[tuiMedia], audio[tuiMedia]',\n exportAs: 'tuiMedia',\n})\nexport class TuiMediaDirective {\n private playbackRate = 1;\n\n @Input()\n @HostBinding('volume')\n @tuiDefaultProp(volumeAssertion)\n volume = 1;\n\n @Input('playbackRate')\n @tuiRequiredSetter(nonNegativeFiniteAssertion)\n set playbackRateSetter(playbackRate: number) {\n this.updatePlaybackRate(playbackRate);\n }\n\n @Input()\n @tuiRequiredSetter(nonNegativeFiniteAssertion)\n set currentTime(currentTime: number) {\n if (Math.abs(currentTime - this.currentTime) > 0.05) {\n this.elementRef.nativeElement.currentTime = currentTime;\n }\n }\n\n @Input()\n set paused(paused: boolean) {\n if (paused) {\n this.elementRef.nativeElement.pause();\n } else {\n this.elementRef.nativeElement.play();\n this.updatePlaybackRate(this.playbackRate);\n }\n }\n\n @Output()\n readonly currentTimeChange = new EventEmitter<number>();\n\n @Output()\n readonly pausedChange = new EventEmitter<boolean>();\n\n @Output()\n readonly volumeChange = new EventEmitter<number>();\n\n constructor(\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLMediaElement>,\n ) {}\n\n get paused(): boolean {\n return this.elementRef.nativeElement.paused;\n }\n\n get currentTime(): number {\n return this.elementRef.nativeElement.currentTime;\n }\n\n // @bad TODO: Make sure no other events can affect this like network issues etc.\n @HostListener('ended', ['true'])\n @HostListener('pause', ['true'])\n @HostListener('play', ['false'])\n onPausedChange(paused: boolean): void {\n this.pausedChange.emit(paused);\n this.updatePlaybackRate(this.playbackRate);\n }\n\n @HostListener('volumechange')\n onVolumeChange(): void {\n this.volume = this.elementRef.nativeElement.volume;\n this.volumeChange.emit(this.volume);\n }\n\n @HostListener('timeupdate')\n @HostListener('seeking')\n @HostListener('seeked')\n onCurrentTimeChange(): void {\n this.currentTimeChange.emit(this.currentTime);\n }\n\n @HostListener('durationchange')\n changeDetectionTrigger(): void {\n // @bad TODO: consider if other events need to trigger CD\n }\n\n private updatePlaybackRate(playbackRate: number): void {\n this.playbackRate = playbackRate;\n this.elementRef.nativeElement.playbackRate = this.playbackRate;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiMediaDirective} from './media.directive';\n\n@NgModule({\n declarations: [TuiMediaDirective],\n exports: [TuiMediaDirective],\n})\nexport class TuiMediaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;SAYgB,0BAA0B,CAAC,KAAa;IACpD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACzC,CAAC;SAEe,eAAe,CAAC,MAAc;IAC1C,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC;AAC1D,CAAC;;IA+CG,2BAEqB,UAAwC;QAAxC,eAAU,GAAV,UAAU,CAA8B;QA1CrD,iBAAY,GAAG,CAAC,CAAC;QAKzB,WAAM,GAAG,CAAC,CAAC;QA2BF,sBAAiB,GAAG,IAAI,YAAY,EAAU,CAAC;QAG/C,iBAAY,GAAG,IAAI,YAAY,EAAW,CAAC;QAG3C,iBAAY,GAAG,IAAI,YAAY,EAAU,CAAC;KAK/C;IAlCJ,sBAAI,iDAAkB;aAAtB,UAAuB,YAAoB;YACvC,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;SACzC;;;OAAA;IAID,sBAAI,0CAAW;aAkCf;YACI,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC;SACpD;aApCD,UAAgB,WAAmB;YAC/B,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,E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KAAK,CAAC,cAAc,CAAC;QACrB,iBAAiB,CAAC,0BAA0B,CAAC;+DAG7C;IAID;QAFC,KAAK,EAAE;QACP,iBAAiB,CAAC,0BAA0B,CAAC;wDAK7C;IAGD;QADC,KAAK,EAAE;mDAQP;IAGD;QADC,MAAM,EAAE;gEAC+C;IAGxD;QADC,MAAM,EAAE;2DAC2C;IAGpD;QADC,MAAM,EAAE;2DAC0C;IAmBnD;QAHC,YAAY,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;QAC/B,YAAY,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;QAC/B,YAAY,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;2DAI/B;IAGD;QADC,YAAY,CAAC,cAAc,CAAC;2DAI5B;IAKD;QAHC,YAAY,CAAC,YAAY,CAAC;QAC1B,YAAY,CAAC,SAAS,CAAC;QACvB,YAAY,CAAC,QAAQ,CAAC;gEAGtB;IAGD;QADC,YAAY,CAAC,gBAAgB,CAAC;mEAG9B;IA/EQ,iBAAiB;QAJ7B,SAAS,CAAC;YACP,QAAQ,EAAE,kCAAkC;YAC5C,QAAQ,EAAE,UAAU;SACvB,CAAC;QA2CO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;OA1Cd,iBAAiB,CAqF7B;IAAD,wBAAC;CArFD;;;IChBA;KAA8B;IAAjB,cAAc;QAJ1B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,iBAAiB,CAAC;YACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;SAC/B,CAAC;OACW,cAAc,CAAG;IAAD,qBAAC;CAA9B;;ACRA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-media.js","sources":["ng://@taiga-ui/cdk/directives/media/media.directive.ts","ng://@taiga-ui/cdk/directives/media/media.module.ts","ng://@taiga-ui/cdk/directives/media/taiga-ui-cdk-directives-media.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n} from '@angular/core';\nimport {tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk/decorators';\n\nexport function nonNegativeFiniteAssertion(value: number): boolean {\n return isFinite(value) && value >= 0;\n}\n\nexport function volumeAssertion(volume: number): boolean {\n return isFinite(volume) && volume >= 0 && volume <= 1;\n}\n\n@Directive({\n selector: 'video[tuiMedia], audio[tuiMedia]',\n exportAs: 'tuiMedia',\n})\nexport class TuiMediaDirective {\n private playbackRate = 1;\n\n @Input()\n @HostBinding('volume')\n @tuiDefaultProp(volumeAssertion)\n volume = 1;\n\n @Input('playbackRate')\n @tuiRequiredSetter(nonNegativeFiniteAssertion)\n set playbackRateSetter(playbackRate: number) {\n this.updatePlaybackRate(playbackRate);\n }\n\n @Input()\n @tuiRequiredSetter(nonNegativeFiniteAssertion)\n set currentTime(currentTime: number) {\n if (Math.abs(currentTime - this.currentTime) > 0.05) {\n this.elementRef.nativeElement.currentTime = currentTime;\n }\n }\n\n @Input()\n set paused(paused: boolean) {\n if (paused) {\n this.elementRef.nativeElement.pause();\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.elementRef.nativeElement.play();\n this.updatePlaybackRate(this.playbackRate);\n }\n }\n\n @Output()\n readonly currentTimeChange = new EventEmitter<number>();\n\n @Output()\n readonly pausedChange = new EventEmitter<boolean>();\n\n @Output()\n readonly volumeChange = new EventEmitter<number>();\n\n constructor(\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLMediaElement>,\n ) {}\n\n get paused(): boolean {\n return this.elementRef.nativeElement.paused;\n }\n\n get currentTime(): number {\n return this.elementRef.nativeElement.currentTime;\n }\n\n // @bad TODO: Make sure no other events can affect this like network issues etc.\n @HostListener('ended', ['true'])\n @HostListener('pause', ['true'])\n @HostListener('play', ['false'])\n onPausedChange(paused: boolean): void {\n this.pausedChange.emit(paused);\n this.updatePlaybackRate(this.playbackRate);\n }\n\n @HostListener('volumechange')\n onVolumeChange(): void {\n this.volume = this.elementRef.nativeElement.volume;\n this.volumeChange.emit(this.volume);\n }\n\n @HostListener('timeupdate')\n @HostListener('seeking')\n @HostListener('seeked')\n onCurrentTimeChange(): void {\n this.currentTimeChange.emit(this.currentTime);\n }\n\n @HostListener('durationchange')\n changeDetectionTrigger(): void {\n // @bad TODO: consider if other events need to trigger CD\n }\n\n private updatePlaybackRate(playbackRate: number): void {\n this.playbackRate = playbackRate;\n this.elementRef.nativeElement.playbackRate = this.playbackRate;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiMediaDirective} from './media.directive';\n\n@NgModule({\n declarations: [TuiMediaDirective],\n exports: [TuiMediaDirective],\n})\nexport class TuiMediaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;SAYgB,0BAA0B,CAAC,KAAa;IACpD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACzC,CAAC;SAEe,eAAe,CAAC,MAAc;IAC1C,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC;AAC1D,CAAC;;IAgDG,2BAEqB,UAAwC;QAAxC,eAAU,GAAV,UAAU,CAA8B;QA3CrD,iBAAY,GAAG,CAAC,CAAC;QAKzB,WAAM,GAAG,CAAC,CAAC;QA4BF,sBAAiB,GAAG,IAAI,YAAY,EAAU,CAAC;QAG/C,iBAAY,GAAG,IAAI,YAAY,EAAW,CAAC;QAG3C,iBAAY,GAAG,IAAI,YAAY,EAAU,CAAC;KAK/C;IAnCJ,sBAAI,iDAAkB;aAAtB,UAAuB,YAAoB;YACvC,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;SACzC;;;OAAA;IAID,sBAAI,0CAAW;aAmCf;YACI,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC;SACpD;aArCD,UAAgB,WAAmB;YAC/B,IAAI,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,WAAW,CAAC,QAAQ,CAAC;QACrB,cAAc,CAAC,eAAe,CAAC;qDACrB;IAIX;QAFC,KAAK,CAAC,cAAc,CAAC;QACrB,iBAAiB,CAAC,0BAA0B,CAAC;+DAG7C;IAID;QAFC,KAAK,EAAE;QACP,iBAAiB,CAAC,0BAA0B,CAAC;wDAK7C;IAGD;QADC,KAAK,EAAE;mDASP;IAGD;QADC,MAAM,EAAE;gEAC+C;IAGxD;QADC,MAAM,EAAE;2DAC2C;IAGpD;QADC,MAAM,EAAE;2DAC0C;IAmBnD;QAHC,YAAY,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;QAC/B,YAAY,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;QAC/B,YAAY,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;2DAI/B;IAGD;QADC,YAAY,CAAC,cAAc,CAAC;2DAI5B;IAKD;QAHC,YAAY,CAAC,YAAY,CAAC;QAC1B,YAAY,CAAC,SAAS,CAAC;QACvB,YAAY,CAAC,QAAQ,CAAC;gEAGtB;IAGD;QADC,YAAY,CAAC,gBAAgB,CAAC;mEAG9B;IAhFQ,iBAAiB;QAJ7B,SAAS,CAAC;YACP,QAAQ,EAAE,kCAAkC;YAC5C,QAAQ,EAAE,UAAU;SACvB,CAAC;QA4CO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;OA3Cd,iBAAiB,CAsF7B;IAAD,wBAAC;CAtFD;;;IChBA;KAA8B;IAAjB,cAAc;QAJ1B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,iBAAiB,CAAC;YACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;SAC/B,CAAC;OACW,cAAc,CAAG;IAAD,qBAAC;CAA9B;;ACRA;;;;;;"}
@@ -10,6 +10,7 @@ export * from '@taiga-ui/cdk/directives/focus-visible';
10
10
  export * from '@taiga-ui/cdk/directives/focusable';
11
11
  export * from '@taiga-ui/cdk/directives/focused';
12
12
  export * from '@taiga-ui/cdk/directives/for';
13
+ export * from '@taiga-ui/cdk/directives/for-async';
13
14
  export * from '@taiga-ui/cdk/directives/high-dpi';
14
15
  export * from '@taiga-ui/cdk/directives/hovered';
15
16
  export * from '@taiga-ui/cdk/directives/input-mode';
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives.js","sources":["ng://@taiga-ui/cdk/directives/taiga-ui-cdk-directives.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives.js","sources":["ng://@taiga-ui/cdk/directives/taiga-ui-cdk-directives.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;"}
@@ -105,7 +105,7 @@ function preventDefault() {
105
105
 
106
106
  /**
107
107
  * Turns AbstractControl/Abstract-control-directive valueChanges into ReplaySubject(1)
108
- * TODO: rename function in 3.0. The name should be shorter.
108
+ * TODO: 3.0 name should be shorter.
109
109
  */
110
110
  function tuiReplayedValueChangesFrom(control) {
111
111
  return new Observable(function (subscriber) {