@taiga-ui/cdk 2.46.0 → 2.49.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 (348) 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 +62 -20
  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 +50 -20
  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 +50 -20
  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-constants.umd.js +28 -1
  24. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  25. package/bundles/taiga-ui-cdk-constants.umd.min.js +1 -1
  26. package/bundles/taiga-ui-cdk-constants.umd.min.js.map +1 -1
  27. package/bundles/taiga-ui-cdk-date-time.umd.js +50 -20
  28. package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
  29. package/bundles/taiga-ui-cdk-date-time.umd.min.js +1 -15
  30. package/bundles/taiga-ui-cdk-date-time.umd.min.js.map +1 -1
  31. package/bundles/taiga-ui-cdk-decorators.umd.js +50 -20
  32. package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
  33. package/bundles/taiga-ui-cdk-decorators.umd.min.js +1 -15
  34. package/bundles/taiga-ui-cdk-decorators.umd.min.js.map +1 -1
  35. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +50 -20
  36. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  37. package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js +1 -15
  38. package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js.map +1 -1
  39. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +146 -55
  40. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  41. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js +1 -15
  42. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js.map +1 -1
  43. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js +50 -20
  44. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
  45. package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js +1 -15
  46. package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js.map +1 -1
  47. package/bundles/taiga-ui-cdk-directives-checked.umd.js +50 -20
  48. package/bundles/taiga-ui-cdk-directives-checked.umd.js.map +1 -1
  49. package/bundles/taiga-ui-cdk-directives-checked.umd.min.js +1 -15
  50. package/bundles/taiga-ui-cdk-directives-checked.umd.min.js.map +1 -1
  51. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js +50 -20
  52. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js.map +1 -1
  53. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js +1 -15
  54. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js.map +1 -1
  55. package/bundles/taiga-ui-cdk-directives-drag.umd.js +50 -20
  56. package/bundles/taiga-ui-cdk-directives-drag.umd.js.map +1 -1
  57. package/bundles/taiga-ui-cdk-directives-drag.umd.min.js +1 -15
  58. package/bundles/taiga-ui-cdk-directives-drag.umd.min.js.map +1 -1
  59. package/bundles/taiga-ui-cdk-directives-droppable.umd.js +50 -20
  60. package/bundles/taiga-ui-cdk-directives-droppable.umd.js.map +1 -1
  61. package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js +1 -15
  62. package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js.map +1 -1
  63. package/bundles/taiga-ui-cdk-directives-element.umd.js +50 -20
  64. package/bundles/taiga-ui-cdk-directives-element.umd.js.map +1 -1
  65. package/bundles/taiga-ui-cdk-directives-element.umd.min.js +1 -15
  66. package/bundles/taiga-ui-cdk-directives-element.umd.min.js.map +1 -1
  67. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js +50 -20
  68. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
  69. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js +1 -15
  70. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js.map +1 -1
  71. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js +50 -20
  72. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js.map +1 -1
  73. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js +1 -15
  74. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js.map +1 -1
  75. package/bundles/taiga-ui-cdk-directives-focusable.umd.js +50 -20
  76. package/bundles/taiga-ui-cdk-directives-focusable.umd.js.map +1 -1
  77. package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js +1 -15
  78. package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js.map +1 -1
  79. package/bundles/taiga-ui-cdk-directives-focused.umd.js +50 -20
  80. package/bundles/taiga-ui-cdk-directives-focused.umd.js.map +1 -1
  81. package/bundles/taiga-ui-cdk-directives-focused.umd.min.js +1 -15
  82. package/bundles/taiga-ui-cdk-directives-focused.umd.min.js.map +1 -1
  83. package/bundles/taiga-ui-cdk-directives-for-async.umd.js +325 -0
  84. package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -0
  85. package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js +2 -0
  86. package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js.map +1 -0
  87. package/bundles/taiga-ui-cdk-directives-for.umd.js +50 -20
  88. package/bundles/taiga-ui-cdk-directives-for.umd.js.map +1 -1
  89. package/bundles/taiga-ui-cdk-directives-for.umd.min.js +1 -15
  90. package/bundles/taiga-ui-cdk-directives-for.umd.min.js.map +1 -1
  91. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js +50 -20
  92. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js.map +1 -1
  93. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js +1 -15
  94. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js.map +1 -1
  95. package/bundles/taiga-ui-cdk-directives-hovered.umd.js +50 -20
  96. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  97. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js +1 -15
  98. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js.map +1 -1
  99. package/bundles/taiga-ui-cdk-directives-input-mode.umd.js +50 -20
  100. package/bundles/taiga-ui-cdk-directives-input-mode.umd.js.map +1 -1
  101. package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js +1 -15
  102. package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js.map +1 -1
  103. package/bundles/taiga-ui-cdk-directives-item.umd.js +50 -20
  104. package/bundles/taiga-ui-cdk-directives-item.umd.js.map +1 -1
  105. package/bundles/taiga-ui-cdk-directives-item.umd.min.js +1 -15
  106. package/bundles/taiga-ui-cdk-directives-item.umd.min.js.map +1 -1
  107. package/bundles/taiga-ui-cdk-directives-let.umd.js +50 -20
  108. package/bundles/taiga-ui-cdk-directives-let.umd.js.map +1 -1
  109. package/bundles/taiga-ui-cdk-directives-let.umd.min.js +1 -15
  110. package/bundles/taiga-ui-cdk-directives-let.umd.min.js.map +1 -1
  111. package/bundles/taiga-ui-cdk-directives-media.umd.js +50 -20
  112. package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
  113. package/bundles/taiga-ui-cdk-directives-media.umd.min.js +1 -15
  114. package/bundles/taiga-ui-cdk-directives-media.umd.min.js.map +1 -1
  115. package/bundles/taiga-ui-cdk-directives-obscured.umd.js +50 -20
  116. package/bundles/taiga-ui-cdk-directives-obscured.umd.js.map +1 -1
  117. package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js +1 -15
  118. package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js.map +1 -1
  119. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +50 -20
  120. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
  121. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js +1 -15
  122. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js.map +1 -1
  123. package/bundles/taiga-ui-cdk-directives-pan.umd.js +50 -20
  124. package/bundles/taiga-ui-cdk-directives-pan.umd.js.map +1 -1
  125. package/bundles/taiga-ui-cdk-directives-pan.umd.min.js +1 -15
  126. package/bundles/taiga-ui-cdk-directives-pan.umd.min.js.map +1 -1
  127. package/bundles/taiga-ui-cdk-directives-portal.umd.js +50 -20
  128. package/bundles/taiga-ui-cdk-directives-portal.umd.js.map +1 -1
  129. package/bundles/taiga-ui-cdk-directives-portal.umd.min.js +1 -15
  130. package/bundles/taiga-ui-cdk-directives-portal.umd.min.js.map +1 -1
  131. package/bundles/taiga-ui-cdk-directives-pressed.umd.js +50 -20
  132. package/bundles/taiga-ui-cdk-directives-pressed.umd.js.map +1 -1
  133. package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js +1 -15
  134. package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js.map +1 -1
  135. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js +50 -20
  136. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js.map +1 -1
  137. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js +1 -15
  138. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js.map +1 -1
  139. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js +50 -20
  140. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js.map +1 -1
  141. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js +1 -15
  142. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js.map +1 -1
  143. package/bundles/taiga-ui-cdk-directives-resize.umd.js +50 -20
  144. package/bundles/taiga-ui-cdk-directives-resize.umd.js.map +1 -1
  145. package/bundles/taiga-ui-cdk-directives-resize.umd.min.js +1 -15
  146. package/bundles/taiga-ui-cdk-directives-resize.umd.min.js.map +1 -1
  147. package/bundles/taiga-ui-cdk-directives-swipe.umd.js +50 -20
  148. package/bundles/taiga-ui-cdk-directives-swipe.umd.js.map +1 -1
  149. package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js +1 -15
  150. package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js.map +1 -1
  151. package/bundles/taiga-ui-cdk-directives-validator.umd.js +50 -20
  152. package/bundles/taiga-ui-cdk-directives-validator.umd.js.map +1 -1
  153. package/bundles/taiga-ui-cdk-directives-validator.umd.min.js +1 -15
  154. package/bundles/taiga-ui-cdk-directives-validator.umd.min.js.map +1 -1
  155. package/bundles/taiga-ui-cdk-directives-zoom.umd.js +50 -20
  156. package/bundles/taiga-ui-cdk-directives-zoom.umd.js.map +1 -1
  157. package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js +1 -15
  158. package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js.map +1 -1
  159. package/bundles/taiga-ui-cdk-directives.umd.js +12 -4
  160. package/bundles/taiga-ui-cdk-directives.umd.js.map +1 -1
  161. package/bundles/taiga-ui-cdk-directives.umd.min.js +1 -1
  162. package/bundles/taiga-ui-cdk-enums.umd.js +12 -0
  163. package/bundles/taiga-ui-cdk-enums.umd.js.map +1 -1
  164. package/bundles/taiga-ui-cdk-enums.umd.min.js +1 -1
  165. package/bundles/taiga-ui-cdk-enums.umd.min.js.map +1 -1
  166. package/bundles/taiga-ui-cdk-exceptions.umd.js +50 -20
  167. package/bundles/taiga-ui-cdk-exceptions.umd.js.map +1 -1
  168. package/bundles/taiga-ui-cdk-exceptions.umd.min.js +1 -15
  169. package/bundles/taiga-ui-cdk-exceptions.umd.min.js.map +1 -1
  170. package/bundles/taiga-ui-cdk-pipes-filter.umd.js +50 -20
  171. package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
  172. package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js +1 -15
  173. package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js.map +1 -1
  174. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +50 -20
  175. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
  176. package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js +1 -15
  177. package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js.map +1 -1
  178. package/bundles/taiga-ui-cdk-services.umd.js +50 -20
  179. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  180. package/bundles/taiga-ui-cdk-services.umd.min.js +1 -15
  181. package/bundles/taiga-ui-cdk-services.umd.min.js.map +1 -1
  182. package/bundles/taiga-ui-cdk-tokens.umd.js +68 -20
  183. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  184. package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -15
  185. package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
  186. package/bundles/taiga-ui-cdk-utils-browser.umd.js +2 -2
  187. package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
  188. package/bundles/taiga-ui-cdk-utils-browser.umd.min.js +1 -1
  189. package/bundles/taiga-ui-cdk-utils-browser.umd.min.js.map +1 -1
  190. package/bundles/taiga-ui-cdk-utils-focus.umd.js +1 -1
  191. package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
  192. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js +1 -1
  193. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js.map +1 -1
  194. package/bundles/taiga-ui-cdk-utils-os.umd.js +17 -3
  195. package/bundles/taiga-ui-cdk-utils-os.umd.js.map +1 -1
  196. package/bundles/taiga-ui-cdk-utils-os.umd.min.js +1 -1
  197. package/bundles/taiga-ui-cdk-utils-os.umd.min.js.map +1 -1
  198. package/bundles/taiga-ui-cdk-utils-svg.umd.js +50 -20
  199. package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
  200. package/bundles/taiga-ui-cdk-utils-svg.umd.min.js +1 -15
  201. package/bundles/taiga-ui-cdk-utils-svg.umd.min.js.map +1 -1
  202. package/constants/taiga-ui-cdk-constants.metadata.json +1 -1
  203. package/constants/unicode-chars.d.ts +25 -1
  204. package/directives/auto-focus/autofocus.options.d.ts +1 -1
  205. package/directives/auto-focus/handlers/ios.handler.d.ts +26 -1
  206. package/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.metadata.json +1 -1
  207. package/directives/for-async/for-async.directive.d.ts +13 -0
  208. package/directives/for-async/for-async.module.d.ts +5 -0
  209. package/directives/for-async/index.d.ts +2 -0
  210. package/directives/for-async/package.json +13 -0
  211. package/directives/for-async/taiga-ui-cdk-directives-for-async.d.ts +4 -0
  212. package/directives/for-async/taiga-ui-cdk-directives-for-async.metadata.json +1 -0
  213. package/directives/index.d.ts +1 -0
  214. package/directives/taiga-ui-cdk-directives.metadata.json +1 -1
  215. package/enums/autocomplete.d.ts +10 -0
  216. package/enums/taiga-ui-cdk-enums.metadata.json +1 -1
  217. package/esm2015/abstract/controller.js +7 -1
  218. package/esm2015/constants/unicode-chars.js +26 -2
  219. package/esm2015/directives/auto-focus/autofocus.options.js +7 -6
  220. package/esm2015/directives/auto-focus/handlers/ios.handler.js +80 -29
  221. package/esm2015/directives/for-async/for-async.directive.js +48 -0
  222. package/esm2015/directives/for-async/for-async.module.js +16 -0
  223. package/esm2015/directives/for-async/index.js +3 -0
  224. package/esm2015/directives/for-async/taiga-ui-cdk-directives-for-async.js +5 -0
  225. package/esm2015/directives/index.js +2 -1
  226. package/esm2015/enums/autocomplete.js +12 -1
  227. package/esm2015/tokens/index.js +4 -1
  228. package/esm2015/tokens/is-chromium.js +6 -0
  229. package/esm2015/tokens/is-firefox.js +9 -0
  230. package/esm2015/tokens/is-webkit.js +6 -0
  231. package/esm2015/utils/browser/is-edge-older-than.js +2 -2
  232. package/esm2015/utils/browser/is-safari.js +2 -2
  233. package/esm2015/utils/focus/get-native-focused.js +2 -2
  234. package/esm2015/utils/os/index.js +2 -1
  235. package/esm2015/utils/os/is-apple-platform.js +14 -0
  236. package/esm2015/utils/os/is-ios.js +4 -4
  237. package/esm5/abstract/controller.js +14 -1
  238. package/esm5/constants/unicode-chars.js +26 -2
  239. package/esm5/directives/auto-focus/autofocus.options.js +7 -6
  240. package/esm5/directives/auto-focus/handlers/ios.handler.js +92 -30
  241. package/esm5/directives/for-async/for-async.directive.js +53 -0
  242. package/esm5/directives/for-async/for-async.module.js +19 -0
  243. package/esm5/directives/for-async/index.js +3 -0
  244. package/esm5/directives/for-async/taiga-ui-cdk-directives-for-async.js +5 -0
  245. package/esm5/directives/index.js +2 -1
  246. package/esm5/enums/autocomplete.js +12 -1
  247. package/esm5/tokens/index.js +4 -1
  248. package/esm5/tokens/is-chromium.js +6 -0
  249. package/esm5/tokens/is-firefox.js +9 -0
  250. package/esm5/tokens/is-webkit.js +6 -0
  251. package/esm5/utils/browser/is-edge-older-than.js +2 -2
  252. package/esm5/utils/browser/is-safari.js +2 -2
  253. package/esm5/utils/focus/get-native-focused.js +2 -2
  254. package/esm5/utils/os/index.js +2 -1
  255. package/esm5/utils/os/is-apple-platform.js +14 -0
  256. package/esm5/utils/os/is-ios.js +4 -4
  257. package/fesm2015/taiga-ui-cdk-abstract.js +7 -1
  258. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  259. package/fesm2015/taiga-ui-cdk-constants.js +26 -2
  260. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  261. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +84 -33
  262. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  263. package/fesm2015/taiga-ui-cdk-directives-for-async.js +66 -0
  264. package/fesm2015/taiga-ui-cdk-directives-for-async.js.map +1 -0
  265. package/fesm2015/taiga-ui-cdk-directives.js +1 -0
  266. package/fesm2015/taiga-ui-cdk-directives.js.map +1 -1
  267. package/fesm2015/taiga-ui-cdk-enums.js +11 -0
  268. package/fesm2015/taiga-ui-cdk-enums.js.map +1 -1
  269. package/fesm2015/taiga-ui-cdk-tokens.js +16 -1
  270. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  271. package/fesm2015/taiga-ui-cdk-utils-browser.js +2 -2
  272. package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
  273. package/fesm2015/taiga-ui-cdk-utils-focus.js +1 -1
  274. package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
  275. package/fesm2015/taiga-ui-cdk-utils-os.js +17 -4
  276. package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -1
  277. package/fesm5/taiga-ui-cdk-abstract.js +12 -1
  278. package/fesm5/taiga-ui-cdk-abstract.js.map +1 -1
  279. package/fesm5/taiga-ui-cdk-constants.js +26 -2
  280. package/fesm5/taiga-ui-cdk-constants.js.map +1 -1
  281. package/fesm5/taiga-ui-cdk-directives-auto-focus.js +96 -34
  282. package/fesm5/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  283. package/fesm5/taiga-ui-cdk-directives-for-async.js +74 -0
  284. package/fesm5/taiga-ui-cdk-directives-for-async.js.map +1 -0
  285. package/fesm5/taiga-ui-cdk-directives.js +1 -0
  286. package/fesm5/taiga-ui-cdk-directives.js.map +1 -1
  287. package/fesm5/taiga-ui-cdk-enums.js +11 -0
  288. package/fesm5/taiga-ui-cdk-enums.js.map +1 -1
  289. package/fesm5/taiga-ui-cdk-tokens.js +16 -1
  290. package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
  291. package/fesm5/taiga-ui-cdk-utils-browser.js +2 -2
  292. package/fesm5/taiga-ui-cdk-utils-browser.js.map +1 -1
  293. package/fesm5/taiga-ui-cdk-utils-focus.js +1 -1
  294. package/fesm5/taiga-ui-cdk-utils-focus.js.map +1 -1
  295. package/fesm5/taiga-ui-cdk-utils-os.js +17 -4
  296. package/fesm5/taiga-ui-cdk-utils-os.js.map +1 -1
  297. package/package.json +4 -1
  298. package/schematics/ng-update/constants/consts.d.ts +7 -7
  299. package/schematics/ng-update/constants/consts.js +38 -0
  300. package/schematics/ng-update/constants/enums.d.ts +3 -3
  301. package/schematics/ng-update/constants/enums.js +22 -0
  302. package/schematics/ng-update/constants/services.d.ts +8 -0
  303. package/schematics/ng-update/constants/services.js +43 -0
  304. package/schematics/ng-update/constants/templates.d.ts +17 -0
  305. package/schematics/ng-update/constants/templates.js +44 -0
  306. package/schematics/ng-update/constants/types.d.ts +4 -3
  307. package/schematics/ng-update/constants/types.js +60 -0
  308. package/schematics/ng-update/constants/warnings.d.ts +6 -0
  309. package/schematics/ng-update/constants/warnings.js +45 -0
  310. package/schematics/ng-update/index.js +8 -0
  311. package/schematics/ng-update/interfaces/template-resourse.d.ts +8 -0
  312. package/schematics/ng-update/interfaces/template-resourse.js +2 -0
  313. package/schematics/ng-update/steps/migrate-sliders/index.d.ts +2 -0
  314. package/schematics/ng-update/steps/migrate-sliders/index.js +7 -0
  315. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.d.ts +2 -0
  316. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +24 -0
  317. package/schematics/ng-update/steps/migrate-templates.d.ts +2 -0
  318. package/schematics/ng-update/steps/migrate-templates.js +57 -0
  319. package/schematics/ng-update/steps/rename-types.js +27 -11
  320. package/schematics/ng-update/steps/replace-const.js +2 -2
  321. package/schematics/ng-update/steps/replace-enums.js +2 -2
  322. package/schematics/ng-update/steps/replace-services.d.ts +1 -0
  323. package/schematics/ng-update/steps/replace-services.js +51 -0
  324. package/schematics/ng-update/steps/show-warnings.d.ts +2 -0
  325. package/schematics/ng-update/steps/show-warnings.js +35 -0
  326. package/schematics/utils/angular/ng-component.d.ts +3 -0
  327. package/schematics/utils/angular/ng-component.js +7 -0
  328. package/schematics/utils/angular/ng-module.d.ts +7 -0
  329. package/schematics/utils/angular/ng-module.js +21 -0
  330. package/schematics/utils/{remove-import.d.ts → import-manipulations.d.ts} +1 -0
  331. package/schematics/utils/import-manipulations.js +19 -0
  332. package/schematics/utils/templates/elements.d.ts +2 -0
  333. package/schematics/utils/templates/elements.js +21 -0
  334. package/schematics/utils/templates/get-component-templates.d.ts +4 -0
  335. package/schematics/utils/templates/get-component-templates.js +36 -0
  336. package/schematics/utils/templates/ng-component-input-manipulations.d.ts +45 -0
  337. package/schematics/utils/templates/ng-component-input-manipulations.js +78 -0
  338. package/schematics/utils/templates/template-resource.d.ts +5 -0
  339. package/schematics/utils/templates/template-resource.js +21 -0
  340. package/tokens/index.d.ts +3 -0
  341. package/tokens/is-chromium.d.ts +2 -0
  342. package/tokens/is-firefox.d.ts +2 -0
  343. package/tokens/is-webkit.d.ts +2 -0
  344. package/tokens/taiga-ui-cdk-tokens.metadata.json +1 -1
  345. package/utils/os/index.d.ts +1 -0
  346. package/utils/os/is-apple-platform.d.ts +11 -0
  347. package/utils/os/taiga-ui-cdk-utils-os.metadata.json +1 -1
  348. package/schematics/utils/remove-import.js +0 -11
@@ -1,7 +1,7 @@
1
1
  interface ReplacementEnum {
2
- name: string;
3
- replaceValues: Record<string, string>;
4
- keepAsType?: boolean;
2
+ readonly name: string;
3
+ readonly replaceValues: Record<string, string>;
4
+ readonly keepAsType?: boolean;
5
5
  }
6
6
  export declare const ENUMS_TO_REPLACE: ReplacementEnum[];
7
7
  export {};
@@ -56,6 +56,19 @@ exports.ENUMS_TO_REPLACE = [
56
56
  None: 'none',
57
57
  },
58
58
  },
59
+ {
60
+ name: 'TuiInputMode',
61
+ replaceValues: {
62
+ None: 'none',
63
+ Text: 'text',
64
+ Decimal: 'decimal',
65
+ Numeric: 'numeric',
66
+ Tel: 'tel',
67
+ Email: 'email',
68
+ Url: 'url',
69
+ Search: 'search',
70
+ },
71
+ },
59
72
  {
60
73
  name: 'TuiStepState',
61
74
  replaceValues: {
@@ -171,4 +184,13 @@ exports.ENUMS_TO_REPLACE = [
171
184
  },
172
185
  keepAsType: false,
173
186
  },
187
+ {
188
+ name: 'TuiTouchMode',
189
+ replaceValues: {
190
+ Transform: 'transform',
191
+ Opacity: 'opacity',
192
+ Background: 'background',
193
+ },
194
+ keepAsType: true,
195
+ },
174
196
  ];
@@ -0,0 +1,8 @@
1
+ import { ReplacementConst } from './consts';
2
+ export interface ReplacementService extends ReplacementConst {
3
+ readonly replaceMethods?: {
4
+ from: string;
5
+ to: string;
6
+ }[];
7
+ }
8
+ export declare const SERVICES_TO_REPLACE: ReplacementService[];
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SERVICES_TO_REPLACE = [
4
+ {
5
+ from: {
6
+ name: 'TuiPortalService',
7
+ },
8
+ to: {
9
+ name: 'TuiDropdownPortalService',
10
+ moduleSpecifier: '@taiga-ui/cdk',
11
+ },
12
+ },
13
+ {
14
+ from: {
15
+ name: 'TuiNotificationsService',
16
+ },
17
+ to: {
18
+ name: 'TuiAlertService',
19
+ moduleSpecifier: '@taiga-ui/cdk',
20
+ },
21
+ replaceMethods: [
22
+ {
23
+ from: 'show',
24
+ to: 'open',
25
+ },
26
+ ],
27
+ },
28
+ {
29
+ from: {
30
+ name: 'TuiCodeEditor',
31
+ },
32
+ to: {
33
+ name: 'TuiCodeEditor',
34
+ moduleSpecifier: '@taiga-ui/addon-doc',
35
+ },
36
+ replaceMethods: [
37
+ {
38
+ from: 'open',
39
+ to: 'edit',
40
+ },
41
+ ],
42
+ },
43
+ ];
@@ -0,0 +1,17 @@
1
+ export interface ReplacementAttributes {
2
+ readonly from: {
3
+ readonly attrName: string;
4
+ readonly withTagNames?: string[];
5
+ readonly withAttrsNames?: string[];
6
+ };
7
+ readonly to: {
8
+ readonly attrName: string;
9
+ };
10
+ }
11
+ export interface ReplacementTags {
12
+ readonly from: string;
13
+ readonly to: string;
14
+ readonly addAttributes: string[];
15
+ }
16
+ export declare const ATTRS_TO_REPLACE: ReplacementAttributes[];
17
+ export declare const TAGS_TO_REPLACE: ReplacementTags[];
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ATTRS_TO_REPLACE = [
4
+ {
5
+ from: { attrName: 'tuiResizableColumn', withAttrsNames: ['tuiResizableColumn'] },
6
+ to: { attrName: 'tuiTh [resizable]="true"' },
7
+ },
8
+ {
9
+ from: { attrName: 'new', withTagNames: ['tui-editor'] },
10
+ to: { attrName: '' },
11
+ },
12
+ {
13
+ from: {
14
+ attrName: '[hovered]',
15
+ withTagNames: ['tui-wrapper'],
16
+ withAttrsNames: ['tuiWrapper'],
17
+ },
18
+ to: {
19
+ attrName: '[hover]',
20
+ },
21
+ },
22
+ {
23
+ from: {
24
+ attrName: '[pressed]',
25
+ withTagNames: ['tui-wrapper'],
26
+ withAttrsNames: ['tuiWrapper'],
27
+ },
28
+ to: {
29
+ attrName: '[active]',
30
+ },
31
+ },
32
+ ];
33
+ exports.TAGS_TO_REPLACE = [
34
+ {
35
+ from: 'tui-group',
36
+ to: 'div',
37
+ addAttributes: ['tuiGroup'],
38
+ },
39
+ {
40
+ from: 'tui-wrapper',
41
+ to: 'div',
42
+ addAttributes: ['tuiWrapper'],
43
+ },
44
+ ];
@@ -1,7 +1,8 @@
1
1
  interface TypeToRename {
2
- from: string;
3
- to: string;
4
- moduleSpecifier?: string | string[];
2
+ readonly from: string;
3
+ readonly to?: string;
4
+ readonly moduleSpecifier?: string | string[];
5
+ readonly preserveGenerics?: boolean;
5
6
  }
6
7
  export declare const TYPES_TO_RENAME: readonly TypeToRename[];
7
8
  export {};
@@ -6,6 +6,26 @@ exports.TYPES_TO_RENAME = [
6
6
  to: 'TuiButtonOptions',
7
7
  moduleSpecifier: ['@taiga-ui/core'],
8
8
  },
9
+ {
10
+ from: 'InputCountOptions',
11
+ to: 'TuiInputCountOptions',
12
+ moduleSpecifier: ['@taiga-ui/kit'],
13
+ },
14
+ {
15
+ from: 'InputPasswordOptions',
16
+ to: 'TuiInputPasswordOptions',
17
+ moduleSpecifier: ['@taiga-ui/kit'],
18
+ },
19
+ {
20
+ from: 'InputTimeOptions',
21
+ to: 'TuiInputTimeOptions',
22
+ moduleSpecifier: ['@taiga-ui/kit'],
23
+ },
24
+ {
25
+ from: 'ToggleOptions',
26
+ to: 'TuiToggleOptions',
27
+ moduleSpecifier: ['@taiga-ui/cdk'],
28
+ },
9
29
  {
10
30
  from: 'RadioOptions',
11
31
  to: 'TuiRadioOptions',
@@ -16,4 +36,44 @@ exports.TYPES_TO_RENAME = [
16
36
  to: 'TuiCodeEditor',
17
37
  moduleSpecifier: ['@taiga-ui/addon-doc'],
18
38
  },
39
+ {
40
+ from: 'WithDateMaskPipeConfig',
41
+ },
42
+ {
43
+ from: 'TuiBreadCrumbsItem',
44
+ },
45
+ {
46
+ from: 'CheckboxOptions',
47
+ to: 'TuiCheckboxOptions',
48
+ moduleSpecifier: ['@taiga-ui/core'],
49
+ },
50
+ {
51
+ from: 'NotificationTokenOptions',
52
+ to: 'TuiNotificationDefaultOptions',
53
+ moduleSpecifier: ['@taiga-ui/core'],
54
+ },
55
+ {
56
+ from: 'TuiNotificationAutoClose',
57
+ to: 'TuiAlertAutoClose',
58
+ moduleSpecifier: ['@taiga-ui/core'],
59
+ },
60
+ {
61
+ from: 'TuiNotificationOptions',
62
+ to: 'TuiAlertOptions<any>',
63
+ moduleSpecifier: ['@taiga-ui/core'],
64
+ },
65
+ {
66
+ from: 'TuiNotificationOptionsWithData',
67
+ to: 'TuiAlertOptions',
68
+ moduleSpecifier: ['@taiga-ui/core'],
69
+ preserveGenerics: true,
70
+ },
71
+ {
72
+ from: 'Country',
73
+ },
74
+ {
75
+ from: 'NumberFormatSettings',
76
+ to: 'TuiNumberFormatSettings',
77
+ moduleSpecifier: ['@taiga-ui/core'],
78
+ },
19
79
  ];
@@ -0,0 +1,6 @@
1
+ export interface MigrationWarning {
2
+ readonly name: string;
3
+ readonly moduleSpecifier?: string;
4
+ readonly message: string;
5
+ }
6
+ export declare const MIGRATION_WARNINGS: readonly MigrationWarning[];
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MIGRATION_WARNINGS = [
4
+ {
5
+ name: 'TUI_MOBILE_AWARE',
6
+ message: 'TUI_MOBILE_AWARE has been deleted in 3.0, please use TuiMobileTabsDirective from @taiga-ui/addon-mobile',
7
+ },
8
+ {
9
+ name: 'TUI_DATE_FILLER',
10
+ message: 'TUI_DATE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date',
11
+ },
12
+ {
13
+ name: 'TUI_DATE_RANGE_FILLER',
14
+ message: 'TUI_DATE_RANGE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date-range',
15
+ },
16
+ {
17
+ name: 'TUI_SHEET_OFFSET',
18
+ message: 'TUI_SHEET_OFFSET has been deleted in 3.0, please use option argument for each Sheet. Read more: https://taiga-ui.dev/components/sheet',
19
+ },
20
+ {
21
+ name: 'COUNTRIES',
22
+ moduleSpecifier: '@taiga-ui/kit',
23
+ message: 'Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code. Use DI-token TUI_COUNTRIES to get localized country name by its iso code',
24
+ },
25
+ {
26
+ name: 'COUNTRIES_MASKS',
27
+ moduleSpecifier: '@taiga-ui/kit',
28
+ message: 'Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code',
29
+ },
30
+ {
31
+ name: 'TuiTableModeModule',
32
+ moduleSpecifier: '@taiga-ui/core',
33
+ message: 'TuiTableModeModule has been deleted in 3.0, please use @taiga-ui/addon-table',
34
+ },
35
+ {
36
+ name: 'TuiColorModule',
37
+ moduleSpecifier: '@taiga-ui/core',
38
+ message: 'TuiColorModule has been deleted in 3.0, please use CSS custom properties',
39
+ },
40
+ {
41
+ name: 'TuiPluralizePipeModule',
42
+ moduleSpecifier: '@taiga-ui/core',
43
+ message: 'TuiPluralizePipeModule has been deleted in 3.0, please use use Angular built-in pipe https://angular.io/api/common/I18nPluralPipe ',
44
+ },
45
+ ];
@@ -7,6 +7,10 @@ const replace_enums_1 = require("./steps/replace-enums");
7
7
  const rename_types_1 = require("./steps/rename-types");
8
8
  const replace_const_1 = require("./steps/replace-const");
9
9
  const replace_deep_import_1 = require("./steps/replace-deep-import");
10
+ const show_warnings_1 = require("./steps/show-warnings");
11
+ const replace_services_1 = require("./steps/replace-services");
12
+ const migrate_templates_1 = require("./steps/migrate-templates");
13
+ const migrate_sliders_1 = require("./steps/migrate-sliders");
10
14
  function updateToV3(_) {
11
15
  return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
12
16
  context.logger.info(`taiga packages will be updated to ${versions_1.TAIGA_VERSION}`);
@@ -15,6 +19,10 @@ function updateToV3(_) {
15
19
  replace_enums_1.replaceEnums();
16
20
  rename_types_1.renameTypes();
17
21
  replace_const_1.replaceConsts();
22
+ replace_services_1.replaceServices();
23
+ show_warnings_1.showWarnings(context);
24
+ migrate_templates_1.migrateTemplates(tree);
25
+ migrate_sliders_1.migrateSliders(tree);
18
26
  ng_morph_1.saveActiveProject();
19
27
  });
20
28
  }
@@ -0,0 +1,8 @@
1
+ export declare type TemplateResource = {
2
+ readonly template: string;
3
+ readonly componentPath: string;
4
+ readonly offset: number;
5
+ } | {
6
+ readonly templatePath: string;
7
+ componentPath: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ export declare function migrateSliders(tree: Tree): void;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const migrate_input_slider_1 = require("./migrate-input-slider");
4
+ function migrateSliders(tree) {
5
+ migrate_input_slider_1.migrateInputSlider(tree);
6
+ }
7
+ exports.migrateSliders = migrateSliders;
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ export declare function migrateInputSlider(tree: Tree): void;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
4
+ const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
5
+ const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
6
+ function migrateInputSlider(tree) {
7
+ const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
8
+ const templateResources = get_component_templates_1.getComponentTemplates('**/**');
9
+ for (const templateResource of templateResources) {
10
+ ng_component_input_manipulations_1.replaceInputPropertyByDirective({
11
+ templateResource,
12
+ fileSystem,
13
+ componentSelector: 'tui-input-slider',
14
+ inputProperty: 'secondary',
15
+ directive: 'tuiTextfieldCustomContent',
16
+ directiveModule: {
17
+ name: 'TuiTextfieldControllerModule',
18
+ moduleSpecifier: '@taiga-ui/core',
19
+ },
20
+ });
21
+ }
22
+ fileSystem.commitEdits();
23
+ }
24
+ exports.migrateInputSlider = migrateInputSlider;
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ export declare function migrateTemplates(tree: Tree): void;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const get_component_templates_1 = require("../../utils/templates/get-component-templates");
4
+ const templates_1 = require("../constants/templates");
5
+ const schematics_1 = require("@angular/cdk/schematics");
6
+ const elements_1 = require("../../utils/templates/elements");
7
+ const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
8
+ const START_TAG_OFFSET = 1;
9
+ const END_TAG_OFFSET = 2;
10
+ function migrateTemplates(tree) {
11
+ const templateResources = get_component_templates_1.getComponentTemplates('**/**');
12
+ const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
13
+ templateResources.forEach((resource) => {
14
+ if ('template' in resource) {
15
+ const template = resource.template;
16
+ const path = fileSystem.resolve(resource.componentPath);
17
+ const recorder = fileSystem.edit(path);
18
+ processTemplateUrl(template, recorder, resource.offset);
19
+ }
20
+ else {
21
+ const path = fileSystem.resolve(resource.templatePath);
22
+ const template = fileSystem.read(path);
23
+ const recorder = fileSystem.edit(path);
24
+ processTemplateUrl(template, recorder);
25
+ }
26
+ fileSystem.commitEdits();
27
+ });
28
+ }
29
+ exports.migrateTemplates = migrateTemplates;
30
+ function processTemplateUrl(template, recorder, templateOffset = 0) {
31
+ templates_1.ATTRS_TO_REPLACE.forEach(({ from, to }) => {
32
+ const offsets = [
33
+ ...schematics_1.findAttributeOnElementWithTag(template, from.attrName, from.withTagNames || []),
34
+ ...schematics_1.findAttributeOnElementWithAttrs(template, from.attrName, from.withAttrsNames || []),
35
+ ];
36
+ offsets.forEach(offset => {
37
+ recorder.remove(offset + templateOffset, from.attrName.length + (to.attrName.length ? 0 : 1));
38
+ recorder.insertRight(offset + templateOffset, to.attrName);
39
+ });
40
+ });
41
+ templates_1.TAGS_TO_REPLACE.forEach(({ from, to, addAttributes }) => {
42
+ const elements = elements_1.findElementsByTagName(template, from);
43
+ elements.forEach(({ sourceCodeLocation }) => {
44
+ var _a;
45
+ if (sourceCodeLocation) {
46
+ const startTagOffset = sourceCodeLocation.startTag.startOffset;
47
+ const endTagOffset = (_a = sourceCodeLocation.endTag) === null || _a === void 0 ? void 0 : _a.startOffset;
48
+ if (endTagOffset) {
49
+ recorder.remove(endTagOffset + templateOffset + END_TAG_OFFSET, from.length);
50
+ recorder.insertRight(endTagOffset + templateOffset + END_TAG_OFFSET, to);
51
+ }
52
+ recorder.remove(startTagOffset + templateOffset + START_TAG_OFFSET, from.length);
53
+ recorder.insertRight(startTagOffset + templateOffset + START_TAG_OFFSET, `${to} ${addAttributes.join(' ')}`);
54
+ }
55
+ });
56
+ });
57
+ }
@@ -1,27 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const get_named_import_references_1 = require("../../utils/get-named-import-references");
4
3
  const ng_morph_1 = require("ng-morph");
4
+ const get_named_import_references_1 = require("../../utils/get-named-import-references");
5
5
  const types_1 = require("../constants/types");
6
+ const import_manipulations_1 = require("../../utils/import-manipulations");
6
7
  function renameTypes() {
7
- types_1.TYPES_TO_RENAME.forEach(({ from, to, moduleSpecifier }) => {
8
- renameType(from, to, moduleSpecifier);
8
+ types_1.TYPES_TO_RENAME.forEach(({ from, to, moduleSpecifier, preserveGenerics }) => {
9
+ renameType(from, to, moduleSpecifier, preserveGenerics);
9
10
  });
10
11
  }
11
12
  exports.renameTypes = renameTypes;
12
- function renameType(from, to, moduleSpecifier) {
13
+ function renameType(from, to, moduleSpecifier, preserveGenerics = false) {
13
14
  const references = get_named_import_references_1.getNamedImportReferences(from, moduleSpecifier);
14
- for (let ref of references) {
15
+ references.forEach(ref => {
15
16
  const parent = ref.getParent();
16
17
  if (ng_morph_1.Node.isImportSpecifier(parent)) {
17
- const namedImport = parent
18
- .getImportDeclaration()
19
- .getNamedImports()
20
- .find(specifier => specifier.getName() === from);
21
- namedImport === null || namedImport === void 0 ? void 0 : namedImport.replaceWithText(to);
18
+ processImport(parent, from, to);
22
19
  }
23
20
  else if (ng_morph_1.Node.isTypeReferenceNode(parent)) {
24
- parent.replaceWithText(to);
21
+ const targetType = preserveGenerics && to ? addGeneric(to, parent.getTypeArguments()) : to;
22
+ parent.replaceWithText(targetType || 'any');
25
23
  }
24
+ });
25
+ }
26
+ function processImport(node, from, to) {
27
+ const filePath = node.getSourceFile().getFilePath();
28
+ const targetImportAlreadyExists = Boolean(ng_morph_1.getImports(filePath, { namedImports: to }).length);
29
+ if (to && !targetImportAlreadyExists) {
30
+ import_manipulations_1.renameImport(node, removeGeneric(to), removeGeneric(from));
26
31
  }
32
+ else {
33
+ import_manipulations_1.removeImport(node);
34
+ }
35
+ }
36
+ function removeGeneric(type) {
37
+ return type.replace(/<.*>$/gi, '');
38
+ }
39
+ function addGeneric(typeName, generics) {
40
+ const typeArgs = generics.map(t => t.getType().getText());
41
+ const genericType = typeArgs.length ? `<${typeArgs.join(', ')}>` : '';
42
+ return typeName + genericType;
27
43
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const get_named_import_references_1 = require("../../utils/get-named-import-references");
4
4
  const ng_morph_1 = require("ng-morph");
5
- const remove_import_1 = require("../../utils/remove-import");
5
+ const import_manipulations_1 = require("../../utils/import-manipulations");
6
6
  const add_unique_import_1 = require("../../utils/add-unique-import");
7
7
  const consts_1 = require("../constants/consts");
8
8
  function replaceConsts() {
@@ -14,7 +14,7 @@ function replaceConst({ from, to }) {
14
14
  for (let ref of references) {
15
15
  const parent = ref.getParent();
16
16
  if (ng_morph_1.Node.isImportSpecifier(parent)) {
17
- remove_import_1.removeImport(parent);
17
+ import_manipulations_1.removeImport(parent);
18
18
  add_unique_import_1.addUniqueImport(parent.getSourceFile().getFilePath(), to.namedImport || to.name, to.moduleSpecifier);
19
19
  }
20
20
  else {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const ng_morph_1 = require("ng-morph");
4
4
  const get_named_import_references_1 = require("../../utils/get-named-import-references");
5
5
  const enums_1 = require("../constants/enums");
6
- const remove_import_1 = require("../../utils/remove-import");
6
+ const import_manipulations_1 = require("../../utils/import-manipulations");
7
7
  function replaceEnums() {
8
8
  enums_1.ENUMS_TO_REPLACE.forEach(({ name, replaceValues, keepAsType }) => {
9
9
  replaceEnumWithString(name, replaceValues, keepAsType);
@@ -15,7 +15,7 @@ function replaceEnumWithString(enumName, replaceValues, keepAsType = true) {
15
15
  for (let ref of references) {
16
16
  const parent = ref.getParent();
17
17
  if (ng_morph_1.Node.isImportSpecifier(parent) && !(keepAsType && containTypeRef(parent))) {
18
- remove_import_1.removeImport(parent);
18
+ import_manipulations_1.removeImport(parent);
19
19
  continue;
20
20
  }
21
21
  if (ng_morph_1.Node.isTypeReferenceNode(parent) && !keepAsType) {
@@ -0,0 +1 @@
1
+ export declare function replaceServices(): void;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const services_1 = require("../constants/services");
4
+ const get_named_import_references_1 = require("../../utils/get-named-import-references");
5
+ const ng_morph_1 = require("ng-morph");
6
+ const import_manipulations_1 = require("../../utils/import-manipulations");
7
+ const add_unique_import_1 = require("../../utils/add-unique-import");
8
+ function replaceServices() {
9
+ services_1.SERVICES_TO_REPLACE.forEach(service => replaceService(service));
10
+ }
11
+ exports.replaceServices = replaceServices;
12
+ function replaceService({ from, to, replaceMethods }) {
13
+ const references = get_named_import_references_1.getNamedImportReferences(from.name, from.moduleSpecifier);
14
+ references.forEach(ref => {
15
+ const parent = ref.getParent();
16
+ if (ng_morph_1.Node.isImportSpecifier(parent)) {
17
+ import_manipulations_1.removeImport(parent);
18
+ add_unique_import_1.addUniqueImport(parent.getSourceFile().getFilePath(), to.namedImport || to.name, to.moduleSpecifier);
19
+ return;
20
+ }
21
+ if (ng_morph_1.Node.isTypeReferenceNode(parent) && (replaceMethods === null || replaceMethods === void 0 ? void 0 : replaceMethods.length)) {
22
+ replaceProperties(parent, replaceMethods);
23
+ }
24
+ ref.replaceWithText(to.name);
25
+ });
26
+ }
27
+ function replaceProperties(parent, replaceProperties) {
28
+ const statement = parent.getParent();
29
+ const identifier = statement.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)[0];
30
+ identifier.findReferencesAsNodes().forEach(ref => {
31
+ let parent = ref.getParent();
32
+ if ((ng_morph_1.Node.isPropertyAccessExpression(parent) &&
33
+ parent.getText().startsWith('this.')) ||
34
+ ng_morph_1.Node.isCallExpression(parent)) {
35
+ parent = parent.getParentIfKind(ng_morph_1.SyntaxKind.PropertyAccessExpression);
36
+ }
37
+ if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
38
+ replaceProperty(parent, replaceProperties);
39
+ return;
40
+ }
41
+ });
42
+ }
43
+ function replaceProperty(node, properties) {
44
+ const identifiers = node.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier);
45
+ identifiers.forEach(identifier => {
46
+ const property = properties === null || properties === void 0 ? void 0 : properties.find(property => property.from === identifier.getText());
47
+ if (property) {
48
+ identifier.replaceWithText(property.to);
49
+ }
50
+ });
51
+ }
@@ -0,0 +1,2 @@
1
+ import { SchematicContext } from '@angular-devkit/schematics';
2
+ export declare function showWarnings(context: SchematicContext): void;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ng_morph_1 = require("ng-morph");
4
+ const warnings_1 = require("../constants/warnings");
5
+ function showWarnings(context) {
6
+ warnings_1.MIGRATION_WARNINGS.forEach(warning => showWarning(warning, context));
7
+ }
8
+ exports.showWarnings = showWarnings;
9
+ function showWarning({ name, message, moduleSpecifier = '**/**' }, { logger }) {
10
+ const references = ng_morph_1.getImports('**/**', {
11
+ moduleSpecifier,
12
+ namedImports: [name],
13
+ })
14
+ .map(i => { var _a; return (_a = i
15
+ .getNamedImports()
16
+ .find(namedImport => namedImport.getName() === name)) === null || _a === void 0 ? void 0 : _a.getNameNode(); })
17
+ .filter((namedImport) => Boolean(namedImport));
18
+ const referencesMeta = references.map(ref => {
19
+ const sourceFile = ref.getSourceFile();
20
+ return {
21
+ sourceFile,
22
+ filePath: sourceFile.getFilePath().toString(),
23
+ startLinePos: ref.getStartLinePos(),
24
+ };
25
+ });
26
+ /**
27
+ * We have to twice iterate array with refs because otherwise we get error:
28
+ * > Attempted to get information from a node that was removed or forgotten.
29
+ * See this {@link https://ts-morph.com/manipulation/#strongwarningstrong warning}
30
+ */
31
+ referencesMeta.forEach(({ sourceFile, filePath, startLinePos }) => {
32
+ logger.warn(`[WARNING] in ${filePath}: ${message}`);
33
+ sourceFile.insertText(startLinePos, `// TODO: ${message}\n`);
34
+ });
35
+ }
@@ -0,0 +1,3 @@
1
+ import { ClassDeclaration, Pattern, Query } from 'ng-morph';
2
+ import { StructureType } from 'ng-morph/utils/types/structure-type';
3
+ export declare function getNgComponents(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ng_morph_1 = require("ng-morph");
4
+ function getNgComponents(pattern, query) {
5
+ return ng_morph_1.getClasses(pattern, query).filter(declaration => !!declaration.getDecorator('Component'));
6
+ }
7
+ exports.getNgComponents = getNgComponents;
@@ -0,0 +1,7 @@
1
+ import { ClassDeclaration, Pattern, Query } from 'ng-morph';
2
+ import { StructureType } from 'ng-morph/utils/types/structure-type';
3
+ export declare function getNgModules(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
4
+ /**
5
+ * Find NgModule where the component was declared.
6
+ */
7
+ export declare function findNgModule(ngComponent: ClassDeclaration): ClassDeclaration | null;