@taiga-ui/cdk 2.45.0 → 2.48.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 (427) hide show
  1. package/abstract/controller.d.ts +6 -0
  2. package/abstract/taiga-ui-cdk-abstract.metadata.json +1 -1
  3. package/bundles/taiga-ui-cdk-abstract.umd.js +63 -21
  4. package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-abstract.umd.min.js +1 -15
  6. package/bundles/taiga-ui-cdk-abstract.umd.min.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-components-alert-host.umd.js +50 -20
  8. package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js +1 -15
  10. package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js.map +1 -1
  11. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +54 -24
  12. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
  13. package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js +1 -15
  14. package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js.map +1 -1
  15. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +50 -20
  16. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
  17. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js +1 -15
  18. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js.map +1 -1
  19. package/bundles/taiga-ui-cdk-components-portal-host.umd.js +51 -21
  20. package/bundles/taiga-ui-cdk-components-portal-host.umd.js.map +1 -1
  21. package/bundles/taiga-ui-cdk-components-portal-host.umd.min.js +1 -15
  22. package/bundles/taiga-ui-cdk-components-portal-host.umd.min.js.map +1 -1
  23. package/bundles/taiga-ui-cdk-date-time.umd.js +54 -29
  24. package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
  25. package/bundles/taiga-ui-cdk-date-time.umd.min.js +1 -15
  26. package/bundles/taiga-ui-cdk-date-time.umd.min.js.map +1 -1
  27. package/bundles/taiga-ui-cdk-decorators.umd.js +50 -20
  28. package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
  29. package/bundles/taiga-ui-cdk-decorators.umd.min.js +1 -15
  30. package/bundles/taiga-ui-cdk-decorators.umd.min.js.map +1 -1
  31. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +50 -20
  32. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  33. package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js +1 -15
  34. package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js.map +1 -1
  35. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +265 -92
  36. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  37. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js +1 -15
  38. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js.map +1 -1
  39. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js +91 -42
  40. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
  41. package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js +1 -15
  42. package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js.map +1 -1
  43. package/bundles/taiga-ui-cdk-directives-checked.umd.js +50 -20
  44. package/bundles/taiga-ui-cdk-directives-checked.umd.js.map +1 -1
  45. package/bundles/taiga-ui-cdk-directives-checked.umd.min.js +1 -15
  46. package/bundles/taiga-ui-cdk-directives-checked.umd.min.js.map +1 -1
  47. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js +50 -20
  48. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js.map +1 -1
  49. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js +1 -15
  50. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js.map +1 -1
  51. package/bundles/taiga-ui-cdk-directives-drag.umd.js +50 -20
  52. package/bundles/taiga-ui-cdk-directives-drag.umd.js.map +1 -1
  53. package/bundles/taiga-ui-cdk-directives-drag.umd.min.js +1 -15
  54. package/bundles/taiga-ui-cdk-directives-drag.umd.min.js.map +1 -1
  55. package/bundles/taiga-ui-cdk-directives-droppable.umd.js +50 -20
  56. package/bundles/taiga-ui-cdk-directives-droppable.umd.js.map +1 -1
  57. package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js +1 -15
  58. package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js.map +1 -1
  59. package/bundles/taiga-ui-cdk-directives-element.umd.js +50 -20
  60. package/bundles/taiga-ui-cdk-directives-element.umd.js.map +1 -1
  61. package/bundles/taiga-ui-cdk-directives-element.umd.min.js +1 -15
  62. package/bundles/taiga-ui-cdk-directives-element.umd.min.js.map +1 -1
  63. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js +50 -20
  64. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
  65. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js +1 -15
  66. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js.map +1 -1
  67. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js +50 -20
  68. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js.map +1 -1
  69. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js +1 -15
  70. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js.map +1 -1
  71. package/bundles/taiga-ui-cdk-directives-focusable.umd.js +50 -20
  72. package/bundles/taiga-ui-cdk-directives-focusable.umd.js.map +1 -1
  73. package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js +1 -15
  74. package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js.map +1 -1
  75. package/bundles/taiga-ui-cdk-directives-focused.umd.js +50 -20
  76. package/bundles/taiga-ui-cdk-directives-focused.umd.js.map +1 -1
  77. package/bundles/taiga-ui-cdk-directives-focused.umd.min.js +1 -15
  78. package/bundles/taiga-ui-cdk-directives-focused.umd.min.js.map +1 -1
  79. package/bundles/taiga-ui-cdk-directives-for-async.umd.js +324 -0
  80. package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -0
  81. package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js +2 -0
  82. package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js.map +1 -0
  83. package/bundles/taiga-ui-cdk-directives-for.umd.js +50 -20
  84. package/bundles/taiga-ui-cdk-directives-for.umd.js.map +1 -1
  85. package/bundles/taiga-ui-cdk-directives-for.umd.min.js +1 -15
  86. package/bundles/taiga-ui-cdk-directives-for.umd.min.js.map +1 -1
  87. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js +50 -20
  88. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js.map +1 -1
  89. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js +1 -15
  90. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js.map +1 -1
  91. package/bundles/taiga-ui-cdk-directives-hovered.umd.js +50 -20
  92. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  93. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js +1 -15
  94. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js.map +1 -1
  95. package/bundles/taiga-ui-cdk-directives-input-mode.umd.js +50 -20
  96. package/bundles/taiga-ui-cdk-directives-input-mode.umd.js.map +1 -1
  97. package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js +1 -15
  98. package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js.map +1 -1
  99. package/bundles/taiga-ui-cdk-directives-item.umd.js +51 -21
  100. package/bundles/taiga-ui-cdk-directives-item.umd.js.map +1 -1
  101. package/bundles/taiga-ui-cdk-directives-item.umd.min.js +1 -15
  102. package/bundles/taiga-ui-cdk-directives-item.umd.min.js.map +1 -1
  103. package/bundles/taiga-ui-cdk-directives-let.umd.js +50 -20
  104. package/bundles/taiga-ui-cdk-directives-let.umd.js.map +1 -1
  105. package/bundles/taiga-ui-cdk-directives-let.umd.min.js +1 -15
  106. package/bundles/taiga-ui-cdk-directives-let.umd.min.js.map +1 -1
  107. package/bundles/taiga-ui-cdk-directives-media.umd.js +50 -20
  108. package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
  109. package/bundles/taiga-ui-cdk-directives-media.umd.min.js +1 -15
  110. package/bundles/taiga-ui-cdk-directives-media.umd.min.js.map +1 -1
  111. package/bundles/taiga-ui-cdk-directives-obscured.umd.js +50 -20
  112. package/bundles/taiga-ui-cdk-directives-obscured.umd.js.map +1 -1
  113. package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js +1 -15
  114. package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js.map +1 -1
  115. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +50 -20
  116. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
  117. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js +1 -15
  118. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js.map +1 -1
  119. package/bundles/taiga-ui-cdk-directives-pan.umd.js +50 -20
  120. package/bundles/taiga-ui-cdk-directives-pan.umd.js.map +1 -1
  121. package/bundles/taiga-ui-cdk-directives-pan.umd.min.js +1 -15
  122. package/bundles/taiga-ui-cdk-directives-pan.umd.min.js.map +1 -1
  123. package/bundles/taiga-ui-cdk-directives-portal.umd.js +50 -20
  124. package/bundles/taiga-ui-cdk-directives-portal.umd.js.map +1 -1
  125. package/bundles/taiga-ui-cdk-directives-portal.umd.min.js +1 -15
  126. package/bundles/taiga-ui-cdk-directives-portal.umd.min.js.map +1 -1
  127. package/bundles/taiga-ui-cdk-directives-pressed.umd.js +50 -20
  128. package/bundles/taiga-ui-cdk-directives-pressed.umd.js.map +1 -1
  129. package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js +1 -15
  130. package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js.map +1 -1
  131. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js +50 -20
  132. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js.map +1 -1
  133. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js +1 -15
  134. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js.map +1 -1
  135. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js +50 -20
  136. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js.map +1 -1
  137. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js +1 -15
  138. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js.map +1 -1
  139. package/bundles/taiga-ui-cdk-directives-resize.umd.js +50 -20
  140. package/bundles/taiga-ui-cdk-directives-resize.umd.js.map +1 -1
  141. package/bundles/taiga-ui-cdk-directives-resize.umd.min.js +1 -15
  142. package/bundles/taiga-ui-cdk-directives-resize.umd.min.js.map +1 -1
  143. package/bundles/taiga-ui-cdk-directives-swipe.umd.js +50 -20
  144. package/bundles/taiga-ui-cdk-directives-swipe.umd.js.map +1 -1
  145. package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js +1 -15
  146. package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js.map +1 -1
  147. package/bundles/taiga-ui-cdk-directives-validator.umd.js +50 -20
  148. package/bundles/taiga-ui-cdk-directives-validator.umd.js.map +1 -1
  149. package/bundles/taiga-ui-cdk-directives-validator.umd.min.js +1 -15
  150. package/bundles/taiga-ui-cdk-directives-validator.umd.min.js.map +1 -1
  151. package/bundles/taiga-ui-cdk-directives-zoom.umd.js +50 -20
  152. package/bundles/taiga-ui-cdk-directives-zoom.umd.js.map +1 -1
  153. package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js +1 -15
  154. package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js.map +1 -1
  155. package/bundles/taiga-ui-cdk-directives.umd.js +12 -4
  156. package/bundles/taiga-ui-cdk-directives.umd.js.map +1 -1
  157. package/bundles/taiga-ui-cdk-directives.umd.min.js +1 -1
  158. package/bundles/taiga-ui-cdk-enums.umd.js +12 -0
  159. package/bundles/taiga-ui-cdk-enums.umd.js.map +1 -1
  160. package/bundles/taiga-ui-cdk-enums.umd.min.js +1 -1
  161. package/bundles/taiga-ui-cdk-enums.umd.min.js.map +1 -1
  162. package/bundles/taiga-ui-cdk-exceptions.umd.js +50 -20
  163. package/bundles/taiga-ui-cdk-exceptions.umd.js.map +1 -1
  164. package/bundles/taiga-ui-cdk-exceptions.umd.min.js +1 -15
  165. package/bundles/taiga-ui-cdk-exceptions.umd.min.js.map +1 -1
  166. package/bundles/taiga-ui-cdk-observables.umd.js +1 -1
  167. package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
  168. package/bundles/taiga-ui-cdk-observables.umd.min.js.map +1 -1
  169. package/bundles/taiga-ui-cdk-pipes-filter.umd.js +50 -20
  170. package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
  171. package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js +1 -15
  172. package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js.map +1 -1
  173. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +50 -20
  174. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
  175. package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js +1 -15
  176. package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js.map +1 -1
  177. package/bundles/taiga-ui-cdk-services.umd.js +50 -20
  178. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  179. package/bundles/taiga-ui-cdk-services.umd.min.js +1 -15
  180. package/bundles/taiga-ui-cdk-services.umd.min.js.map +1 -1
  181. package/bundles/taiga-ui-cdk-tokens.umd.js +54 -26
  182. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  183. package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -15
  184. package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
  185. package/bundles/taiga-ui-cdk-utils-browser.umd.js +2 -2
  186. package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
  187. package/bundles/taiga-ui-cdk-utils-browser.umd.min.js +1 -1
  188. package/bundles/taiga-ui-cdk-utils-browser.umd.min.js.map +1 -1
  189. package/bundles/taiga-ui-cdk-utils-focus.umd.js +3 -1
  190. package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
  191. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js +1 -1
  192. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js.map +1 -1
  193. package/bundles/taiga-ui-cdk-utils-os.umd.js +39 -0
  194. package/bundles/taiga-ui-cdk-utils-os.umd.js.map +1 -0
  195. package/bundles/taiga-ui-cdk-utils-os.umd.min.js +2 -0
  196. package/bundles/taiga-ui-cdk-utils-os.umd.min.js.map +1 -0
  197. package/bundles/taiga-ui-cdk-utils-svg.umd.js +50 -20
  198. package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
  199. package/bundles/taiga-ui-cdk-utils-svg.umd.min.js +1 -15
  200. package/bundles/taiga-ui-cdk-utils-svg.umd.min.js.map +1 -1
  201. package/bundles/taiga-ui-cdk-utils.umd.js +12 -4
  202. package/bundles/taiga-ui-cdk-utils.umd.js.map +1 -1
  203. package/bundles/taiga-ui-cdk-utils.umd.min.js +1 -1
  204. package/components/dialog-host/taiga-ui-cdk-components-dialog-host.metadata.json +1 -1
  205. package/components/portal-host/portal.service.d.ts +1 -1
  206. package/date-time/date-fillers.d.ts +0 -2
  207. package/date-time/day-range.d.ts +1 -2
  208. package/date-time/day.d.ts +0 -1
  209. package/date-time/month-range.d.ts +0 -1
  210. package/date-time/month.d.ts +0 -1
  211. package/date-time/taiga-ui-cdk-date-time.metadata.json +1 -1
  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 +35 -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/for-async/for-async.directive.d.ts +13 -0
  224. package/directives/for-async/for-async.module.d.ts +5 -0
  225. package/directives/for-async/index.d.ts +2 -0
  226. package/directives/for-async/package.json +13 -0
  227. package/directives/for-async/taiga-ui-cdk-directives-for-async.d.ts +4 -0
  228. package/directives/for-async/taiga-ui-cdk-directives-for-async.metadata.json +1 -0
  229. package/directives/index.d.ts +1 -0
  230. package/directives/item/item.directive.d.ts +1 -1
  231. package/directives/taiga-ui-cdk-directives.metadata.json +1 -1
  232. package/enums/autocomplete.d.ts +10 -0
  233. package/enums/taiga-ui-cdk-enums.metadata.json +1 -1
  234. package/esm2015/abstract/controller.js +7 -1
  235. package/esm2015/abstract/interactive.js +2 -2
  236. package/esm2015/components/dialog-host/dialog-host.component.js +5 -5
  237. package/esm2015/components/portal-host/portal.service.js +2 -2
  238. package/esm2015/date-time/date-fillers.js +1 -3
  239. package/esm2015/date-time/day-range.js +2 -2
  240. package/esm2015/date-time/day.js +2 -3
  241. package/esm2015/date-time/month-range.js +1 -2
  242. package/esm2015/date-time/month.js +2 -3
  243. package/esm2015/date-time/year.js +2 -2
  244. package/esm2015/directives/auto-focus/autofocus.directive.js +11 -87
  245. package/esm2015/directives/auto-focus/autofocus.options.js +28 -0
  246. package/esm2015/directives/auto-focus/handlers/abstract.handler.js +25 -0
  247. package/esm2015/directives/auto-focus/handlers/default.handler.js +39 -0
  248. package/esm2015/directives/auto-focus/handlers/ios.handler.js +121 -0
  249. package/esm2015/directives/auto-focus/index.js +5 -1
  250. package/esm2015/directives/autofilled/autofilled-style.component.js +13 -0
  251. package/esm2015/directives/autofilled/autofilled.directive.js +23 -37
  252. package/esm2015/directives/autofilled/autofilled.module.js +4 -2
  253. package/esm2015/directives/autofilled/index.js +2 -1
  254. package/esm2015/directives/for-async/for-async.directive.js +48 -0
  255. package/esm2015/directives/for-async/for-async.module.js +16 -0
  256. package/esm2015/directives/for-async/index.js +3 -0
  257. package/esm2015/directives/for-async/taiga-ui-cdk-directives-for-async.js +5 -0
  258. package/esm2015/directives/index.js +2 -1
  259. package/esm2015/directives/item/item.directive.js +2 -2
  260. package/esm2015/enums/autocomplete.js +12 -1
  261. package/esm2015/observables/replay-control-value-changes.js +2 -2
  262. package/esm2015/tokens/index.js +2 -1
  263. package/esm2015/tokens/is-apple.js +5 -0
  264. package/esm2015/tokens/is-ios.js +4 -6
  265. package/esm2015/utils/browser/index.js +2 -2
  266. package/esm2015/utils/browser/is-edge-older-than.js +2 -2
  267. package/esm2015/utils/browser/{is-IE.js → is-ie.js} +1 -1
  268. package/esm2015/utils/browser/is-safari.js +2 -2
  269. package/esm2015/utils/focus/get-native-focused.js +2 -2
  270. package/esm2015/utils/focus/set-native-focused.js +3 -1
  271. package/esm2015/utils/index.js +2 -1
  272. package/esm2015/utils/os/index.js +4 -0
  273. package/esm2015/utils/os/is-apple-platform.js +14 -0
  274. package/esm2015/utils/os/is-apple.js +6 -0
  275. package/esm2015/utils/os/is-ios.js +7 -0
  276. package/esm2015/utils/os/taiga-ui-cdk-utils-os.js +5 -0
  277. package/esm5/abstract/controller.js +14 -1
  278. package/esm5/abstract/interactive.js +2 -2
  279. package/esm5/components/dialog-host/dialog-host.component.js +5 -5
  280. package/esm5/components/portal-host/portal.service.js +2 -2
  281. package/esm5/date-time/date-fillers.js +1 -3
  282. package/esm5/date-time/day-range.js +2 -2
  283. package/esm5/date-time/day.js +2 -3
  284. package/esm5/date-time/month-range.js +1 -2
  285. package/esm5/date-time/month.js +2 -3
  286. package/esm5/date-time/year.js +2 -2
  287. package/esm5/directives/auto-focus/autofocus.directive.js +11 -97
  288. package/esm5/directives/auto-focus/autofocus.options.js +28 -0
  289. package/esm5/directives/auto-focus/handlers/abstract.handler.js +34 -0
  290. package/esm5/directives/auto-focus/handlers/default.handler.js +43 -0
  291. package/esm5/directives/auto-focus/handlers/ios.handler.js +137 -0
  292. package/esm5/directives/auto-focus/index.js +5 -1
  293. package/esm5/directives/autofilled/autofilled-style.component.js +16 -0
  294. package/esm5/directives/autofilled/autofilled.directive.js +24 -21
  295. package/esm5/directives/autofilled/autofilled.module.js +4 -2
  296. package/esm5/directives/autofilled/index.js +2 -1
  297. package/esm5/directives/for-async/for-async.directive.js +52 -0
  298. package/esm5/directives/for-async/for-async.module.js +19 -0
  299. package/esm5/directives/for-async/index.js +3 -0
  300. package/esm5/directives/for-async/taiga-ui-cdk-directives-for-async.js +5 -0
  301. package/esm5/directives/index.js +2 -1
  302. package/esm5/directives/item/item.directive.js +2 -2
  303. package/esm5/enums/autocomplete.js +12 -1
  304. package/esm5/observables/replay-control-value-changes.js +2 -2
  305. package/esm5/tokens/index.js +2 -1
  306. package/esm5/tokens/is-apple.js +5 -0
  307. package/esm5/tokens/is-ios.js +4 -8
  308. package/esm5/utils/browser/index.js +2 -2
  309. package/esm5/utils/browser/is-edge-older-than.js +2 -2
  310. package/esm5/utils/browser/{is-IE.js → is-ie.js} +1 -1
  311. package/esm5/utils/browser/is-safari.js +2 -2
  312. package/esm5/utils/focus/get-native-focused.js +2 -2
  313. package/esm5/utils/focus/set-native-focused.js +3 -1
  314. package/esm5/utils/index.js +2 -1
  315. package/esm5/utils/os/index.js +4 -0
  316. package/esm5/utils/os/is-apple-platform.js +14 -0
  317. package/esm5/utils/os/is-apple.js +6 -0
  318. package/esm5/utils/os/is-ios.js +7 -0
  319. package/esm5/utils/os/taiga-ui-cdk-utils-os.js +5 -0
  320. package/fesm2015/taiga-ui-cdk-abstract.js +8 -2
  321. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  322. package/fesm2015/taiga-ui-cdk-components-dialog-host.js +4 -4
  323. package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  324. package/fesm2015/taiga-ui-cdk-components-portal-host.js +1 -1
  325. package/fesm2015/taiga-ui-cdk-components-portal-host.js.map +1 -1
  326. package/fesm2015/taiga-ui-cdk-date-time.js +4 -9
  327. package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
  328. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +187 -69
  329. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  330. package/fesm2015/taiga-ui-cdk-directives-autofilled.js +33 -37
  331. package/fesm2015/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  332. package/fesm2015/taiga-ui-cdk-directives-for-async.js +66 -0
  333. package/fesm2015/taiga-ui-cdk-directives-for-async.js.map +1 -0
  334. package/fesm2015/taiga-ui-cdk-directives-item.js +1 -1
  335. package/fesm2015/taiga-ui-cdk-directives-item.js.map +1 -1
  336. package/fesm2015/taiga-ui-cdk-directives.js +1 -0
  337. package/fesm2015/taiga-ui-cdk-directives.js.map +1 -1
  338. package/fesm2015/taiga-ui-cdk-enums.js +11 -0
  339. package/fesm2015/taiga-ui-cdk-enums.js.map +1 -1
  340. package/fesm2015/taiga-ui-cdk-observables.js +1 -1
  341. package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
  342. package/fesm2015/taiga-ui-cdk-tokens.js +6 -7
  343. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  344. package/fesm2015/taiga-ui-cdk-utils-browser.js +2 -2
  345. package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
  346. package/fesm2015/taiga-ui-cdk-utils-focus.js +3 -1
  347. package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
  348. package/fesm2015/taiga-ui-cdk-utils-os.js +31 -0
  349. package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -0
  350. package/fesm2015/taiga-ui-cdk-utils.js +1 -0
  351. package/fesm2015/taiga-ui-cdk-utils.js.map +1 -1
  352. package/fesm5/taiga-ui-cdk-abstract.js +13 -2
  353. package/fesm5/taiga-ui-cdk-abstract.js.map +1 -1
  354. package/fesm5/taiga-ui-cdk-components-dialog-host.js +4 -4
  355. package/fesm5/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  356. package/fesm5/taiga-ui-cdk-components-portal-host.js +1 -1
  357. package/fesm5/taiga-ui-cdk-components-portal-host.js.map +1 -1
  358. package/fesm5/taiga-ui-cdk-date-time.js +4 -9
  359. package/fesm5/taiga-ui-cdk-date-time.js.map +1 -1
  360. package/fesm5/taiga-ui-cdk-directives-auto-focus.js +211 -74
  361. package/fesm5/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  362. package/fesm5/taiga-ui-cdk-directives-autofilled.js +38 -22
  363. package/fesm5/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  364. package/fesm5/taiga-ui-cdk-directives-for-async.js +73 -0
  365. package/fesm5/taiga-ui-cdk-directives-for-async.js.map +1 -0
  366. package/fesm5/taiga-ui-cdk-directives-item.js +1 -1
  367. package/fesm5/taiga-ui-cdk-directives-item.js.map +1 -1
  368. package/fesm5/taiga-ui-cdk-directives.js +1 -0
  369. package/fesm5/taiga-ui-cdk-directives.js.map +1 -1
  370. package/fesm5/taiga-ui-cdk-enums.js +11 -0
  371. package/fesm5/taiga-ui-cdk-enums.js.map +1 -1
  372. package/fesm5/taiga-ui-cdk-observables.js +1 -1
  373. package/fesm5/taiga-ui-cdk-observables.js.map +1 -1
  374. package/fesm5/taiga-ui-cdk-tokens.js +6 -9
  375. package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
  376. package/fesm5/taiga-ui-cdk-utils-browser.js +2 -2
  377. package/fesm5/taiga-ui-cdk-utils-browser.js.map +1 -1
  378. package/fesm5/taiga-ui-cdk-utils-focus.js +3 -1
  379. package/fesm5/taiga-ui-cdk-utils-focus.js.map +1 -1
  380. package/fesm5/taiga-ui-cdk-utils-os.js +31 -0
  381. package/fesm5/taiga-ui-cdk-utils-os.js.map +1 -0
  382. package/fesm5/taiga-ui-cdk-utils.js +1 -0
  383. package/fesm5/taiga-ui-cdk-utils.js.map +1 -1
  384. package/observables/replay-control-value-changes.d.ts +1 -1
  385. package/package.json +1 -1
  386. package/schematics/ng-add/constants/modules.d.ts +1 -1
  387. package/schematics/ng-add/constants/modules.js +2 -2
  388. package/schematics/ng-add/schema.d.ts +1 -1
  389. package/schematics/ng-add/schema.json +3 -3
  390. package/schematics/ng-add/steps/add-taiga-modules.js +1 -1
  391. package/schematics/ng-update/constants/consts.d.ts +7 -7
  392. package/schematics/ng-update/constants/consts.js +28 -0
  393. package/schematics/ng-update/constants/enums.d.ts +3 -3
  394. package/schematics/ng-update/constants/enums.js +22 -0
  395. package/schematics/ng-update/constants/services.d.ts +8 -0
  396. package/schematics/ng-update/constants/services.js +43 -0
  397. package/schematics/ng-update/constants/types.d.ts +4 -3
  398. package/schematics/ng-update/constants/types.js +55 -0
  399. package/schematics/ng-update/constants/warnings.d.ts +6 -0
  400. package/schematics/ng-update/constants/warnings.js +30 -0
  401. package/schematics/ng-update/index.js +4 -0
  402. package/schematics/ng-update/steps/rename-types.js +27 -11
  403. package/schematics/ng-update/steps/replace-const.js +2 -2
  404. package/schematics/ng-update/steps/replace-enums.js +2 -2
  405. package/schematics/ng-update/steps/replace-services.d.ts +1 -0
  406. package/schematics/ng-update/steps/replace-services.js +51 -0
  407. package/schematics/ng-update/steps/show-warnings.d.ts +2 -0
  408. package/schematics/ng-update/steps/show-warnings.js +35 -0
  409. package/schematics/utils/{remove-import.d.ts → import-manipulations.d.ts} +1 -0
  410. package/schematics/utils/import-manipulations.js +19 -0
  411. package/tokens/index.d.ts +1 -0
  412. package/tokens/is-apple.d.ts +2 -0
  413. package/tokens/taiga-ui-cdk-tokens.metadata.json +1 -1
  414. package/utils/browser/index.d.ts +1 -1
  415. package/utils/browser/{is-IE.d.ts → is-ie.d.ts} +0 -0
  416. package/utils/browser/taiga-ui-cdk-utils-browser.metadata.json +1 -1
  417. package/utils/focus/set-native-focused.d.ts +2 -0
  418. package/utils/index.d.ts +1 -0
  419. package/utils/os/index.d.ts +3 -0
  420. package/utils/os/is-apple-platform.d.ts +11 -0
  421. package/utils/os/is-apple.d.ts +1 -0
  422. package/utils/os/is-ios.d.ts +1 -0
  423. package/utils/os/package.json +13 -0
  424. package/utils/os/taiga-ui-cdk-utils-os.d.ts +4 -0
  425. package/utils/os/taiga-ui-cdk-utils-os.metadata.json +1 -0
  426. package/utils/taiga-ui-cdk-utils.metadata.json +1 -1
  427. package/schematics/utils/remove-import.js +0 -11
@@ -1,10 +1,10 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ng-web-apis/common'), require('@taiga-ui/cdk/constants'), require('@taiga-ui/cdk/tokens'), require('@taiga-ui/cdk/utils/focus'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@taiga-ui/cdk/directives/auto-focus', ['exports', '@angular/core', '@ng-web-apis/common', '@taiga-ui/cdk/constants', '@taiga-ui/cdk/tokens', '@taiga-ui/cdk/utils/focus', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = global || self, factory((global['taiga-ui'] = global['taiga-ui'] || {}, global['taiga-ui'].cdk = global['taiga-ui'].cdk || {}, global['taiga-ui'].cdk.directives = global['taiga-ui'].cdk.directives || {}, global['taiga-ui'].cdk.directives['auto-focus'] = {}), global.ng.core, global.common, global['taiga-ui'].cdk.constants, global['taiga-ui'].cdk.tokens, global['taiga-ui'].cdk.utils.focus, global.rxjs, global.rxjs.operators));
5
- }(this, (function (exports, core, common, constants, tokens, focus, rxjs, operators) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ng-web-apis/common'), require('@taiga-ui/cdk/tokens'), require('@taiga-ui/cdk/constants'), require('rxjs'), require('rxjs/operators'), require('@taiga-ui/cdk/utils')) :
3
+ typeof define === 'function' && define.amd ? define('@taiga-ui/cdk/directives/auto-focus', ['exports', '@angular/core', '@ng-web-apis/common', '@taiga-ui/cdk/tokens', '@taiga-ui/cdk/constants', 'rxjs', 'rxjs/operators', '@taiga-ui/cdk/utils'], factory) :
4
+ (global = global || self, factory((global['taiga-ui'] = global['taiga-ui'] || {}, global['taiga-ui'].cdk = global['taiga-ui'].cdk || {}, global['taiga-ui'].cdk.directives = global['taiga-ui'].cdk.directives || {}, global['taiga-ui'].cdk.directives['auto-focus'] = {}), global.ng.core, global.common, global['taiga-ui'].cdk.tokens, global['taiga-ui'].cdk.constants, global.rxjs, global.rxjs.operators, global['taiga-ui'].cdk.utils));
5
+ }(this, (function (exports, core, common, tokens, constants, rxjs, operators, utils) { 'use strict';
6
6
 
7
- /*! *****************************************************************************
7
+ /******************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
9
9
 
10
10
  Permission to use, copy, modify, and/or distribute this software for any
@@ -23,11 +23,13 @@
23
23
  var extendStatics = function(d, b) {
24
24
  extendStatics = Object.setPrototypeOf ||
25
25
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
26
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
27
27
  return extendStatics(d, b);
28
28
  };
29
29
 
30
30
  function __extends(d, b) {
31
+ if (typeof b !== "function" && b !== null)
32
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
31
33
  extendStatics(d, b);
32
34
  function __() { this.constructor = d; }
33
35
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -109,13 +111,20 @@
109
111
  }
110
112
  }
111
113
 
112
- function __createBinding(o, m, k, k2) {
114
+ var __createBinding = Object.create ? (function(o, m, k, k2) {
115
+ if (k2 === undefined) k2 = k;
116
+ var desc = Object.getOwnPropertyDescriptor(m, k);
117
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
118
+ desc = { enumerable: true, get: function() { return m[k]; } };
119
+ }
120
+ Object.defineProperty(o, k2, desc);
121
+ }) : (function(o, m, k, k2) {
113
122
  if (k2 === undefined) k2 = k;
114
123
  o[k2] = m[k];
115
- }
124
+ });
116
125
 
117
- function __exportStar(m, exports) {
118
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
126
+ function __exportStar(m, o) {
127
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
119
128
  }
120
129
 
121
130
  function __values(o) {
@@ -147,19 +156,31 @@
147
156
  return ar;
148
157
  }
149
158
 
159
+ /** @deprecated */
150
160
  function __spread() {
151
161
  for (var ar = [], i = 0; i < arguments.length; i++)
152
162
  ar = ar.concat(__read(arguments[i]));
153
163
  return ar;
154
164
  }
155
165
 
166
+ /** @deprecated */
156
167
  function __spreadArrays() {
157
168
  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
158
169
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
159
170
  for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
160
171
  r[k] = a[j];
161
172
  return r;
162
- };
173
+ }
174
+
175
+ function __spreadArray(to, from, pack) {
176
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
177
+ if (ar || !(i in from)) {
178
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
179
+ ar[i] = from[i];
180
+ }
181
+ }
182
+ return to.concat(ar || Array.prototype.slice.call(from));
183
+ }
163
184
 
164
185
  function __await(v) {
165
186
  return this instanceof __await ? (this.v = v, this) : new __await(v);
@@ -196,11 +217,17 @@
196
217
  return cooked;
197
218
  };
198
219
 
220
+ var __setModuleDefault = Object.create ? (function(o, v) {
221
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
222
+ }) : function(o, v) {
223
+ o["default"] = v;
224
+ };
225
+
199
226
  function __importStar(mod) {
200
227
  if (mod && mod.__esModule) return mod;
201
228
  var result = {};
202
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
203
- result.default = mod;
229
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
230
+ __setModuleDefault(result, mod);
204
231
  return result;
205
232
  }
206
233
 
@@ -208,52 +235,30 @@
208
235
  return (mod && mod.__esModule) ? mod : { default: mod };
209
236
  }
210
237
 
211
- function __classPrivateFieldGet(receiver, privateMap) {
212
- if (!privateMap.has(receiver)) {
213
- throw new TypeError("attempted to get private field on non-instance");
214
- }
215
- return privateMap.get(receiver);
238
+ function __classPrivateFieldGet(receiver, state, kind, f) {
239
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
240
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
241
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
216
242
  }
217
243
 
218
- function __classPrivateFieldSet(receiver, privateMap, value) {
219
- if (!privateMap.has(receiver)) {
220
- throw new TypeError("attempted to set private field on non-instance");
221
- }
222
- privateMap.set(receiver, value);
223
- return value;
244
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
245
+ if (kind === "m") throw new TypeError("Private method is not writable");
246
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
247
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
248
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
249
+ }
250
+
251
+ function __classPrivateFieldIn(state, receiver) {
252
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
253
+ return typeof state === "function" ? receiver === state : state.has(receiver);
224
254
  }
225
255
 
226
- var TIMEOUT = 1000;
227
- var NG_ANIMATION_SELECTOR = '.ng-animating';
228
- // TODO: in 3.0 change input name to tuiAutoFocus and handle empty string
229
- // TODO: refactor on this whole thing in 3.0
230
- var TuiAutoFocusDirective = /** @class */ (function () {
231
- function TuiAutoFocusDirective(tuiFocusableComponent, isIos, animationFrame$, ngZone, elementRef, renderer) {
256
+ var AbstractTuiAutofocusHandler = /** @class */ (function () {
257
+ function AbstractTuiAutofocusHandler(tuiFocusableComponent, elementRef) {
232
258
  this.tuiFocusableComponent = tuiFocusableComponent;
233
- this.isIos = isIos;
234
- this.animationFrame$ = animationFrame$;
235
- this.ngZone = ngZone;
236
259
  this.elementRef = elementRef;
237
- this.renderer = renderer;
238
- this.autoFocus = true;
239
260
  }
240
- TuiAutoFocusDirective.prototype.ngAfterViewInit = function () {
241
- var _this = this;
242
- if (!this.autoFocus) {
243
- return;
244
- }
245
- if (this.isTextFieldElement) {
246
- if (this.isIos) {
247
- this.ngZone.runOutsideAngular(function () { return _this.iosWebkitAutofocus(); });
248
- }
249
- else {
250
- rxjs.race(rxjs.timer(TIMEOUT), this.animationFrame$.pipe(operators.throttleTime(constants.POLLING_TIME), operators.map(function () { return _this.element.closest(NG_ANIMATION_SELECTOR); }), operators.skipWhile(Boolean), operators.take(1))).subscribe(function () { return focus.setNativeFocused(_this.element); });
251
- }
252
- return;
253
- }
254
- focus.setNativeFocused(this.element);
255
- };
256
- Object.defineProperty(TuiAutoFocusDirective.prototype, "element", {
261
+ Object.defineProperty(AbstractTuiAutofocusHandler.prototype, "element", {
257
262
  get: function () {
258
263
  var _a;
259
264
  return (((_a = this.tuiFocusableComponent) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) ||
@@ -262,55 +267,223 @@
262
267
  enumerable: true,
263
268
  configurable: true
264
269
  });
265
- Object.defineProperty(TuiAutoFocusDirective.prototype, "isTextFieldElement", {
270
+ Object.defineProperty(AbstractTuiAutofocusHandler.prototype, "isTextFieldElement", {
266
271
  get: function () {
267
272
  return this.element.matches('input, textarea');
268
273
  },
269
274
  enumerable: true,
270
275
  configurable: true
271
276
  });
272
- TuiAutoFocusDirective.prototype.iosWebkitAutofocus = function () {
277
+ AbstractTuiAutofocusHandler.ctorParameters = function () { return [
278
+ { type: undefined },
279
+ { type: core.ElementRef }
280
+ ]; };
281
+ AbstractTuiAutofocusHandler = __decorate([
282
+ core.Directive()
283
+ ], AbstractTuiAutofocusHandler);
284
+ return AbstractTuiAutofocusHandler;
285
+ }());
286
+
287
+ var TIMEOUT = 1000;
288
+ var NG_ANIMATION_SELECTOR = '.ng-animating';
289
+ var TuiDefaultAutofocusHandler = /** @class */ (function (_super) {
290
+ __extends(TuiDefaultAutofocusHandler, _super);
291
+ function TuiDefaultAutofocusHandler(tuiFocusableComponent, elementRef, animationFrame$) {
292
+ var _this = _super.call(this, tuiFocusableComponent, elementRef) || this;
293
+ _this.animationFrame$ = animationFrame$;
294
+ return _this;
295
+ }
296
+ TuiDefaultAutofocusHandler.prototype.setFocus = function () {
297
+ var _this = this;
298
+ if (this.isTextFieldElement) {
299
+ rxjs.race(rxjs.timer(TIMEOUT), this.animationFrame$.pipe(operators.throttleTime(constants.POLLING_TIME), operators.map(function () { return _this.element.closest(NG_ANIMATION_SELECTOR); }), operators.skipWhile(Boolean), operators.take(1))).subscribe(function () { return _this.element.focus(); });
300
+ }
301
+ else {
302
+ this.element.focus();
303
+ }
304
+ };
305
+ TuiDefaultAutofocusHandler.ctorParameters = function () { return [
306
+ { type: undefined, decorators: [{ type: core.Optional }, { type: core.Self }, { type: core.Inject, args: [tokens.TUI_FOCUSABLE_ITEM_ACCESSOR,] }] },
307
+ { type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] },
308
+ { type: rxjs.Observable, decorators: [{ type: core.Inject, args: [common.ANIMATION_FRAME,] }] }
309
+ ]; };
310
+ TuiDefaultAutofocusHandler = __decorate([
311
+ core.Directive(),
312
+ __param(0, core.Optional()),
313
+ __param(0, core.Self()),
314
+ __param(0, core.Inject(tokens.TUI_FOCUSABLE_ITEM_ACCESSOR)),
315
+ __param(1, core.Inject(core.ElementRef)),
316
+ __param(2, core.Inject(common.ANIMATION_FRAME))
317
+ ], TuiDefaultAutofocusHandler);
318
+ return TuiDefaultAutofocusHandler;
319
+ }(AbstractTuiAutofocusHandler));
320
+
321
+ // @dynamic
322
+ var TuiIosAutofocusHandler = /** @class */ (function (_super) {
323
+ __extends(TuiIosAutofocusHandler, _super);
324
+ function TuiIosAutofocusHandler(tuiFocusableComponent, elementRef, renderer, ngZone, windowRef) {
325
+ var _this = _super.call(this, tuiFocusableComponent, elementRef) || this;
326
+ _this.renderer = renderer;
327
+ _this.ngZone = ngZone;
328
+ _this.windowRef = windowRef;
329
+ _this.patchCssStyles();
330
+ return _this;
331
+ }
332
+ TuiIosAutofocusHandler.prototype.setFocus = function () {
333
+ var _this = this;
334
+ if (this.isTextFieldElement) {
335
+ this.ngZone.runOutsideAngular(function () { return _this.iosWebkitAutofocus(); });
336
+ }
337
+ else {
338
+ this.element.focus();
339
+ }
340
+ };
341
+ TuiIosAutofocusHandler.prototype.iosWebkitAutofocus = function () {
273
342
  var _this = this;
274
343
  var _a;
275
- var fakeInput = this.renderer.createElement('input');
276
- fakeInput.style.position = 'absolute';
277
- fakeInput.style.opacity = '0';
278
- fakeInput.style.height = '0';
279
- var blurHandler = function () { return focus.setNativeFocused(fakeInput); };
344
+ var fakeInput = this.makeFakeInput();
345
+ var duration = this.getDurationTimeBeforeFocus();
346
+ var fakeFocusTimeoutId = 0;
347
+ var elementFocusTimeoutId = 0;
348
+ var blurHandler = function () { return fakeInput.focus({ preventScroll: true }); };
280
349
  var focusHandler = function () {
281
- setTimeout(function () {
282
- focus.setNativeFocused(_this.element);
283
- /**
284
- * @note:
285
- * We can't remove the element immediately, because it breaks flow
286
- */
287
- setTimeout(function () {
288
- fakeInput.removeEventListener('blur', blurHandler);
289
- fakeInput.removeEventListener('focus', focusHandler);
350
+ clearTimeout(fakeFocusTimeoutId);
351
+ fakeFocusTimeoutId = _this.windowRef.setTimeout(function () {
352
+ clearTimeout(elementFocusTimeoutId);
353
+ fakeInput.removeEventListener('blur', blurHandler);
354
+ fakeInput.removeEventListener('focus', focusHandler);
355
+ elementFocusTimeoutId = _this.windowRef.setTimeout(function () {
356
+ _this.element.focus({ preventScroll: false });
290
357
  fakeInput.remove();
291
- });
358
+ }, duration);
292
359
  });
293
360
  };
294
- /**
295
- * @note: ping-pong eager strategy hack
296
- * After creating an element and bringing it into DOM,
297
- * the browser automatically focuses on the invisible element.
298
- * And then, after focus is triggered, we try to focus on target element, and if we managed to refocus,
299
- * then we try to focus again on an invisible element, so that the keyboard slowly appears.
300
- * This ping pong allows the keyboard to not overlap the modal window.
301
- */
302
361
  fakeInput.addEventListener('blur', blurHandler, { once: true });
303
362
  fakeInput.addEventListener('focus', focusHandler);
304
- (_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.appendChild(fakeInput);
305
- focus.setNativeFocused(fakeInput);
363
+ if (this.insideDialog()) {
364
+ this.windowRef.document.body.appendChild(fakeInput);
365
+ }
366
+ else {
367
+ (_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.appendChild(fakeInput);
368
+ }
369
+ fakeInput.focus({ preventScroll: true });
306
370
  };
307
- TuiAutoFocusDirective.ctorParameters = function () { return [
371
+ /**
372
+ * @note:
373
+ * emulate textfield position in layout with cursor
374
+ * before focus to real textfield element
375
+ */
376
+ TuiIosAutofocusHandler.prototype.makeFakeInput = function () {
377
+ var fakeInput = this.renderer.createElement('input');
378
+ var rect = this.element.getBoundingClientRect();
379
+ fakeInput.style.height = utils.px(rect.height);
380
+ fakeInput.style.width = utils.px(rect.width / 2);
381
+ fakeInput.style.position = 'fixed';
382
+ fakeInput.style.opacity = '0';
383
+ fakeInput.style.fontSize = utils.px(16); // disable possible auto zoom
384
+ fakeInput.readOnly = true; // prevent keyboard for fake input
385
+ // @note: emulate position cursor before focus to real textfield element
386
+ fakeInput.style.top = utils.px(rect.top);
387
+ fakeInput.style.left = utils.px(rect.left);
388
+ return fakeInput;
389
+ };
390
+ TuiIosAutofocusHandler.prototype.getDurationTimeBeforeFocus = function () {
391
+ return (parseFloat(this.windowRef
392
+ .getComputedStyle(this.element)
393
+ .getPropertyValue('--tui-duration')) || 0);
394
+ };
395
+ /**
396
+ * @note:
397
+ * unfortunately, in older versions of iOS
398
+ * there is a bug that the fake input cursor
399
+ * will move along with the dialog animation
400
+ * and then that dialog will be shaking
401
+ */
402
+ TuiIosAutofocusHandler.prototype.insideDialog = function () {
403
+ return !!this.element.closest('tui-dialog');
404
+ };
405
+ /**
406
+ * @note:
407
+ * This is necessary so that the viewport isn't recalculated
408
+ * and then the dialogs don't shake.
409
+ *
410
+ * Also, we need to fixed height viewport,
411
+ * so that when focusing the dialogs don't shake
412
+ */
413
+ TuiIosAutofocusHandler.prototype.patchCssStyles = function () {
414
+ var e_1, _a;
415
+ var documentRef = this.windowRef.document;
416
+ try {
417
+ for (var _b = __values([documentRef.documentElement, documentRef.body]), _c = _b.next(); !_c.done; _c = _b.next()) {
418
+ var element = _c.value;
419
+ element.style.setProperty('overflow', 'auto');
420
+ element.style.setProperty('height', '100%');
421
+ }
422
+ }
423
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
424
+ finally {
425
+ try {
426
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
427
+ }
428
+ finally { if (e_1) throw e_1.error; }
429
+ }
430
+ };
431
+ TuiIosAutofocusHandler.ctorParameters = function () { return [
308
432
  { type: undefined, decorators: [{ type: core.Optional }, { type: core.Self }, { type: core.Inject, args: [tokens.TUI_FOCUSABLE_ITEM_ACCESSOR,] }] },
309
- { type: Boolean, decorators: [{ type: core.Inject, args: [tokens.TUI_IS_IOS,] }] },
310
- { type: rxjs.Observable, decorators: [{ type: core.Inject, args: [common.ANIMATION_FRAME,] }] },
311
- { type: core.NgZone, decorators: [{ type: core.Inject, args: [core.NgZone,] }] },
312
433
  { type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] },
313
- { type: core.Renderer2, decorators: [{ type: core.Inject, args: [core.Renderer2,] }] }
434
+ { type: core.Renderer2, decorators: [{ type: core.Inject, args: [core.Renderer2,] }] },
435
+ { type: core.NgZone, decorators: [{ type: core.Inject, args: [core.NgZone,] }] },
436
+ { type: Window, decorators: [{ type: core.Inject, args: [common.WINDOW,] }] }
437
+ ]; };
438
+ TuiIosAutofocusHandler = __decorate([
439
+ core.Directive(),
440
+ __param(0, core.Optional()),
441
+ __param(0, core.Self()),
442
+ __param(0, core.Inject(tokens.TUI_FOCUSABLE_ITEM_ACCESSOR)),
443
+ __param(1, core.Inject(core.ElementRef)),
444
+ __param(2, core.Inject(core.Renderer2)),
445
+ __param(3, core.Inject(core.NgZone)),
446
+ __param(4, core.Inject(common.WINDOW))
447
+ ], TuiIosAutofocusHandler);
448
+ return TuiIosAutofocusHandler;
449
+ }(AbstractTuiAutofocusHandler));
450
+
451
+ var TUI_AUTOFOCUS_HANDLER = new core.InjectionToken('Autofocusing handler');
452
+ // TODO: 3.0 remove in ivy compilation
453
+ function tuiAutofocusHandlerFactory(tuiFocusableComponent, elementRef, animationFrame$, renderer, ngZone, windowRef) {
454
+ return core.inject(tokens.TUI_IS_IOS)
455
+ ? new TuiIosAutofocusHandler(tuiFocusableComponent, elementRef, renderer, ngZone, windowRef)
456
+ : new TuiDefaultAutofocusHandler(tuiFocusableComponent, elementRef, animationFrame$);
457
+ }
458
+ var TUI_AUTOFOCUS_PROVIDERS = [
459
+ {
460
+ provide: TUI_AUTOFOCUS_HANDLER,
461
+ // TODO: replace to useClass in v3.0
462
+ useFactory: tuiAutofocusHandlerFactory,
463
+ deps: [
464
+ [new core.Optional(), new core.Self(), tokens.TUI_FOCUSABLE_ITEM_ACCESSOR],
465
+ core.ElementRef,
466
+ common.ANIMATION_FRAME,
467
+ core.Renderer2,
468
+ core.NgZone,
469
+ common.WINDOW,
470
+ ],
471
+ },
472
+ ];
473
+
474
+ // TODO: 3.0 change input name to tuiAutoFocus and handle empty string
475
+ var TuiAutoFocusDirective = /** @class */ (function () {
476
+ function TuiAutoFocusDirective(handler) {
477
+ this.handler = handler;
478
+ this.autoFocus = true;
479
+ }
480
+ TuiAutoFocusDirective.prototype.ngAfterViewInit = function () {
481
+ if (this.autoFocus) {
482
+ this.handler.setFocus();
483
+ }
484
+ };
485
+ TuiAutoFocusDirective.ctorParameters = function () { return [
486
+ { type: undefined, decorators: [{ type: core.Inject, args: [TUI_AUTOFOCUS_HANDLER,] }] }
314
487
  ]; };
315
488
  __decorate([
316
489
  core.Input()
@@ -318,15 +491,9 @@
318
491
  TuiAutoFocusDirective = __decorate([
319
492
  core.Directive({
320
493
  selector: '[tuiAutoFocus]',
494
+ providers: TUI_AUTOFOCUS_PROVIDERS,
321
495
  }),
322
- __param(0, core.Optional()),
323
- __param(0, core.Self()),
324
- __param(0, core.Inject(tokens.TUI_FOCUSABLE_ITEM_ACCESSOR)),
325
- __param(1, core.Inject(tokens.TUI_IS_IOS)),
326
- __param(2, core.Inject(common.ANIMATION_FRAME)),
327
- __param(3, core.Inject(core.NgZone)),
328
- __param(4, core.Inject(core.ElementRef)),
329
- __param(5, core.Inject(core.Renderer2))
496
+ __param(0, core.Inject(TUI_AUTOFOCUS_HANDLER))
330
497
  ], TuiAutoFocusDirective);
331
498
  return TuiAutoFocusDirective;
332
499
  }());
@@ -343,8 +510,14 @@
343
510
  return TuiAutoFocusModule;
344
511
  }());
345
512
 
513
+ exports.AbstractTuiAutofocusHandler = AbstractTuiAutofocusHandler;
514
+ exports.TUI_AUTOFOCUS_HANDLER = TUI_AUTOFOCUS_HANDLER;
515
+ exports.TUI_AUTOFOCUS_PROVIDERS = TUI_AUTOFOCUS_PROVIDERS;
346
516
  exports.TuiAutoFocusDirective = TuiAutoFocusDirective;
347
517
  exports.TuiAutoFocusModule = TuiAutoFocusModule;
518
+ exports.TuiDefaultAutofocusHandler = TuiDefaultAutofocusHandler;
519
+ exports.TuiIosAutofocusHandler = TuiIosAutofocusHandler;
520
+ exports.tuiAutofocusHandlerFactory = tuiAutofocusHandlerFactory;
348
521
 
349
522
  Object.defineProperty(exports, '__esModule', { value: true });
350
523