@taiga-ui/cdk 3.0.0-rc.0 → 3.0.0-rc.3

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 (479) hide show
  1. package/abstract/control.d.ts +2 -1
  2. package/abstract/dialog.service.d.ts +1 -1
  3. package/abstract/portal-host.d.ts +5 -3
  4. package/abstract/portal-service.d.ts +3 -2
  5. package/abstract/theme-switcher.d.ts +0 -1
  6. package/bundles/taiga-ui-cdk-abstract.umd.js +25 -16
  7. package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
  8. package/bundles/taiga-ui-cdk-classes.umd.js +0 -8
  9. package/bundles/taiga-ui-cdk-classes.umd.js.map +1 -1
  10. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +0 -1
  11. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
  12. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +3 -1
  13. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
  14. package/bundles/taiga-ui-cdk-constants.umd.js +18 -1
  15. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  16. package/bundles/taiga-ui-cdk-date-time.umd.js +3 -29
  17. package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
  18. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +5 -6
  19. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  20. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +8 -9
  21. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  22. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js +1 -1
  23. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
  24. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js +0 -1
  25. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js.map +1 -1
  26. package/bundles/taiga-ui-cdk-directives-drag.umd.js +1 -1
  27. package/bundles/taiga-ui-cdk-directives-drag.umd.js.map +1 -1
  28. package/bundles/taiga-ui-cdk-directives-droppable.umd.js +5 -6
  29. package/bundles/taiga-ui-cdk-directives-droppable.umd.js.map +1 -1
  30. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js +11 -9
  31. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
  32. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js +0 -1
  33. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js.map +1 -1
  34. package/bundles/taiga-ui-cdk-directives-focused.umd.js +1 -1
  35. package/bundles/taiga-ui-cdk-directives-focused.umd.js.map +1 -1
  36. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js +0 -1
  37. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js.map +1 -1
  38. package/bundles/taiga-ui-cdk-directives-hovered.umd.js +7 -10
  39. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  40. package/bundles/taiga-ui-cdk-directives-media.umd.js +4 -11
  41. package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
  42. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +10 -12
  43. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
  44. package/bundles/taiga-ui-cdk-directives-pan.umd.js +0 -1
  45. package/bundles/taiga-ui-cdk-directives-pan.umd.js.map +1 -1
  46. package/bundles/taiga-ui-cdk-directives-pressed.umd.js +1 -1
  47. package/bundles/taiga-ui-cdk-directives-pressed.umd.js.map +1 -1
  48. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js +1 -2
  49. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js.map +1 -1
  50. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js +1 -1
  51. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js.map +1 -1
  52. package/bundles/taiga-ui-cdk-directives-resize.umd.js +0 -1
  53. package/bundles/taiga-ui-cdk-directives-resize.umd.js.map +1 -1
  54. package/bundles/taiga-ui-cdk-directives-swipe.umd.js +0 -1
  55. package/bundles/taiga-ui-cdk-directives-swipe.umd.js.map +1 -1
  56. package/bundles/taiga-ui-cdk-directives-zoom.umd.js +0 -1
  57. package/bundles/taiga-ui-cdk-directives-zoom.umd.js.map +1 -1
  58. package/bundles/taiga-ui-cdk-observables.umd.js +20 -76
  59. package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
  60. package/bundles/taiga-ui-cdk-pipes-keys.umd.js +68 -0
  61. package/bundles/taiga-ui-cdk-pipes-keys.umd.js.map +1 -0
  62. package/bundles/taiga-ui-cdk-pipes.umd.js +10 -4
  63. package/bundles/taiga-ui-cdk-pipes.umd.js.map +1 -1
  64. package/bundles/taiga-ui-cdk-services.umd.js +37 -72
  65. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  66. package/bundles/taiga-ui-cdk-tokens.umd.js +46 -20
  67. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  68. package/bundles/taiga-ui-cdk-utils-browser.umd.js +3 -26
  69. package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
  70. package/bundles/taiga-ui-cdk-utils-color.umd.js +81 -0
  71. package/bundles/taiga-ui-cdk-utils-color.umd.js.map +1 -0
  72. package/bundles/taiga-ui-cdk-utils-dom.umd.js +57 -87
  73. package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
  74. package/bundles/taiga-ui-cdk-utils-focus.umd.js +24 -67
  75. package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
  76. package/bundles/taiga-ui-cdk-utils-format.umd.js +0 -1
  77. package/bundles/taiga-ui-cdk-utils-format.umd.js.map +1 -1
  78. package/bundles/taiga-ui-cdk-utils-math.umd.js +8 -48
  79. package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
  80. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +349 -84
  81. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  82. package/bundles/taiga-ui-cdk-utils-os.umd.js +5 -21
  83. package/bundles/taiga-ui-cdk-utils-os.umd.js.map +1 -1
  84. package/bundles/taiga-ui-cdk-utils-svg.umd.js +1 -5
  85. package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
  86. package/bundles/taiga-ui-cdk-utils.umd.js +10 -4
  87. package/bundles/taiga-ui-cdk-utils.umd.js.map +1 -1
  88. package/classes/assert.d.ts +0 -3
  89. package/constants/browser.d.ts +4 -0
  90. package/constants/index.d.ts +1 -0
  91. package/constants/unicode-chars.d.ts +8 -0
  92. package/constants/version.d.ts +1 -0
  93. package/constants/version.js +4 -0
  94. package/date-time/day-range.d.ts +0 -5
  95. package/date-time/day.d.ts +1 -2
  96. package/date-time/month.d.ts +1 -2
  97. package/date-time/year.d.ts +1 -1
  98. package/directives/auto-focus/autofocus.directive.d.ts +2 -2
  99. package/directives/focus-visible/focus-visible.directive.d.ts +0 -1
  100. package/directives/high-dpi/high-dpi.directive.d.ts +0 -1
  101. package/directives/media/media.directive.d.ts +0 -2
  102. package/directives/overscroll/overscroll.directive.d.ts +0 -1
  103. package/directives/prevent-default/prevent-default.directive.d.ts +0 -1
  104. package/esm2015/abstract/control.js +7 -1
  105. package/esm2015/abstract/dialog.service.js +1 -1
  106. package/esm2015/abstract/portal-host.js +18 -15
  107. package/esm2015/abstract/portal-service.js +4 -4
  108. package/esm2015/abstract/theme-switcher.js +1 -2
  109. package/esm2015/classes/assert.js +1 -8
  110. package/esm2015/components/dialog-host/dialog-host.component.js +1 -2
  111. package/esm2015/components/dropdown-host/dropdown-host.component.js +4 -2
  112. package/esm2015/constants/browser.js +5 -1
  113. package/esm2015/constants/index.js +2 -1
  114. package/esm2015/constants/parent-animation.js +2 -2
  115. package/esm2015/constants/unicode-chars.js +9 -1
  116. package/esm2015/constants/version.js +2 -0
  117. package/esm2015/date-time/day-range.js +1 -6
  118. package/esm2015/date-time/day.js +2 -9
  119. package/esm2015/date-time/month.js +2 -8
  120. package/esm2015/date-time/year.js +2 -6
  121. package/esm2015/directives/active-zone/active-zone.directive.js +3 -6
  122. package/esm2015/directives/auto-focus/autofocus.directive.js +6 -5
  123. package/esm2015/directives/auto-focus/handlers/ios.handler.js +1 -2
  124. package/esm2015/directives/autofilled/autofilled-style.component.js +1 -1
  125. package/esm2015/directives/copy-processor/copy-processor.directive.js +1 -2
  126. package/esm2015/directives/drag/drag.directive.js +3 -3
  127. package/esm2015/directives/droppable/droppable.directive.js +7 -8
  128. package/esm2015/directives/focus-trap/focus-trap.directive.js +14 -12
  129. package/esm2015/directives/focus-visible/focus-visible.directive.js +1 -2
  130. package/esm2015/directives/focused/focused.directive.js +3 -3
  131. package/esm2015/directives/high-dpi/high-dpi.directive.js +1 -2
  132. package/esm2015/directives/hovered/hovered.service.js +5 -8
  133. package/esm2015/directives/media/media.directive.js +5 -10
  134. package/esm2015/directives/overscroll/overscroll.directive.js +13 -15
  135. package/esm2015/directives/pan/pan.directive.js +1 -2
  136. package/esm2015/directives/pressed/pressed.directive.js +3 -3
  137. package/esm2015/directives/prevent-default/prevent-default.directive.js +3 -4
  138. package/esm2015/directives/repeat-times/repeat-times.directive.js +3 -3
  139. package/esm2015/directives/resize/resize.directive.js +1 -2
  140. package/esm2015/directives/swipe/swipe.directive.js +1 -2
  141. package/esm2015/directives/zoom/zoom.directive.js +1 -2
  142. package/esm2015/observables/drag-and-drop-from.js +6 -11
  143. package/esm2015/observables/focus-visible-observable.js +7 -12
  144. package/esm2015/observables/items-query-list-observable.js +4 -7
  145. package/esm2015/observables/mouse-drag-finish-from.js +4 -7
  146. package/esm2015/observables/must-be-present.js +4 -9
  147. package/esm2015/observables/pressed-observable.js +5 -10
  148. package/esm2015/observables/prevent-default.js +2 -7
  149. package/esm2015/observables/stop-propagation.js +2 -7
  150. package/esm2015/observables/typed-from-event.js +2 -7
  151. package/esm2015/observables/watch.js +2 -7
  152. package/esm2015/pipes/index.js +2 -1
  153. package/esm2015/pipes/keys/index.js +3 -0
  154. package/esm2015/pipes/keys/keys.module.js +16 -0
  155. package/esm2015/pipes/keys/keys.pipe.js +14 -0
  156. package/esm2015/pipes/keys/taiga-ui-cdk-pipes-keys.js +5 -0
  157. package/esm2015/services/directive-styles.service.js +3 -26
  158. package/esm2015/services/focus-visible.service.js +3 -4
  159. package/esm2015/services/obscured.service.js +3 -5
  160. package/esm2015/services/pan.service.js +6 -9
  161. package/esm2015/services/parents-scroll.service.js +3 -5
  162. package/esm2015/services/resize.service.js +1 -2
  163. package/esm2015/services/scroll.service.js +4 -5
  164. package/esm2015/services/swipe.service.js +6 -9
  165. package/esm2015/services/zoom.service.js +8 -9
  166. package/esm2015/tokens/active-element.js +16 -16
  167. package/esm2015/tokens/alerts.js +8 -1
  168. package/esm2015/tokens/dialogs.js +8 -1
  169. package/esm2015/tokens/focusable-item-accessor.js +7 -1
  170. package/esm2015/tokens/index.js +2 -2
  171. package/esm2015/tokens/is-apple.js +3 -3
  172. package/esm2015/tokens/is-cypress.js +1 -1
  173. package/esm2015/tokens/is-ios.js +3 -3
  174. package/esm2015/tokens/range.js +8 -0
  175. package/esm2015/tokens/window-height.js +3 -3
  176. package/esm2015/utils/browser/index.js +1 -2
  177. package/esm2015/utils/browser/is-edge.js +2 -7
  178. package/esm2015/utils/browser/is-firefox.js +2 -7
  179. package/esm2015/utils/browser/is-safari.js +2 -7
  180. package/esm2015/utils/color/hex-to-rgb.js +12 -0
  181. package/esm2015/utils/color/hsv-to-rgb.js +11 -0
  182. package/esm2015/utils/color/index.js +6 -0
  183. package/esm2015/utils/color/parse-color.js +27 -0
  184. package/esm2015/utils/color/rgb-to-hex.js +4 -0
  185. package/esm2015/utils/color/rgb-to-hsv.js +7 -0
  186. package/esm2015/utils/color/taiga-ui-cdk-utils-color.js +5 -0
  187. package/esm2015/utils/dom/can-scroll.js +2 -7
  188. package/esm2015/utils/dom/contains-or-after.js +2 -7
  189. package/esm2015/utils/dom/element-checks.js +21 -0
  190. package/esm2015/utils/dom/get-actual-target.js +2 -5
  191. package/esm2015/utils/dom/get-clipboard-data-text.js +2 -5
  192. package/esm2015/utils/dom/get-document-or-shadow-root.js +2 -7
  193. package/esm2015/utils/dom/get-element-obscurers.js +14 -17
  194. package/esm2015/utils/dom/get-element-offset.js +4 -7
  195. package/esm2015/utils/dom/get-scroll-parent.js +3 -6
  196. package/esm2015/utils/dom/get-selected-text.js +3 -3
  197. package/esm2015/utils/dom/index.js +3 -2
  198. package/esm2015/utils/dom/is-current-target.js +2 -7
  199. package/esm2015/utils/dom/is-element-editable.js +5 -0
  200. package/esm2015/utils/dom/is-inside-iframe.js +2 -5
  201. package/esm2015/utils/dom/is-node-in.js +5 -7
  202. package/esm2015/utils/focus/blur-native-focused.js +4 -7
  203. package/esm2015/utils/focus/get-closest-focusable.js +26 -0
  204. package/esm2015/utils/focus/get-native-focused.js +3 -3
  205. package/esm2015/utils/focus/index.js +2 -3
  206. package/esm2015/utils/focus/is-native-focused-in.js +1 -2
  207. package/esm2015/utils/focus/is-native-focused.js +1 -2
  208. package/esm2015/utils/focus/is-native-keyboard-focusable.js +3 -3
  209. package/esm2015/utils/focus/is-native-mouse-focusable.js +1 -4
  210. package/esm2015/utils/focus/move-focus.js +2 -4
  211. package/esm2015/utils/focus/set-native-mouse-focused.js +8 -7
  212. package/esm2015/utils/format/px.js +1 -2
  213. package/esm2015/utils/index.js +2 -1
  214. package/esm2015/utils/math/clamp.js +2 -5
  215. package/esm2015/utils/math/quantize.js +2 -5
  216. package/esm2015/utils/math/round.js +4 -19
  217. package/esm2015/utils/math/sum.js +2 -5
  218. package/esm2015/utils/math/to-int.js +2 -7
  219. package/esm2015/utils/math/to-radians.js +2 -5
  220. package/esm2015/utils/miscellaneous/array-remove.js +4 -0
  221. package/esm2015/utils/miscellaneous/array-toggle.js +6 -0
  222. package/esm2015/utils/miscellaneous/distance-between-touches.js +2 -7
  223. package/esm2015/utils/miscellaneous/ease-in-out-quad.js +2 -7
  224. package/esm2015/utils/miscellaneous/flat-length.js +2 -5
  225. package/esm2015/utils/miscellaneous/get-original-array-from-query-list.js +2 -5
  226. package/esm2015/utils/miscellaneous/get-swipe-direction.js +2 -7
  227. package/esm2015/utils/miscellaneous/index.js +3 -3
  228. package/esm2015/utils/miscellaneous/is-number.js +2 -7
  229. package/esm2015/utils/miscellaneous/is-present.js +2 -7
  230. package/esm2015/utils/miscellaneous/mark-control-as-touched-and-validate.js +4 -9
  231. package/esm2015/utils/miscellaneous/uniq-by.js +2 -7
  232. package/esm2015/utils/os/is-apple-platform.js +2 -5
  233. package/esm2015/utils/os/is-apple.js +4 -9
  234. package/esm2015/utils/os/is-ios.js +4 -9
  235. package/esm2015/utils/svg/svg-linear-gradient-processor.js +2 -5
  236. package/fesm2015/taiga-ui-cdk-abstract.js +26 -18
  237. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  238. package/fesm2015/taiga-ui-cdk-classes.js +1 -8
  239. package/fesm2015/taiga-ui-cdk-classes.js.map +1 -1
  240. package/fesm2015/taiga-ui-cdk-components-dialog-host.js +0 -1
  241. package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  242. package/fesm2015/taiga-ui-cdk-components-dropdown-host.js +3 -1
  243. package/fesm2015/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
  244. package/fesm2015/taiga-ui-cdk-constants.js +16 -2
  245. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  246. package/fesm2015/taiga-ui-cdk-date-time.js +4 -26
  247. package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
  248. package/fesm2015/taiga-ui-cdk-directives-active-zone.js +2 -5
  249. package/fesm2015/taiga-ui-cdk-directives-active-zone.js.map +1 -1
  250. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +5 -5
  251. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  252. package/fesm2015/taiga-ui-cdk-directives-autofilled.js +1 -1
  253. package/fesm2015/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  254. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js +0 -1
  255. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js.map +1 -1
  256. package/fesm2015/taiga-ui-cdk-directives-drag.js +2 -2
  257. package/fesm2015/taiga-ui-cdk-directives-drag.js.map +1 -1
  258. package/fesm2015/taiga-ui-cdk-directives-droppable.js +6 -7
  259. package/fesm2015/taiga-ui-cdk-directives-droppable.js.map +1 -1
  260. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js +13 -11
  261. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
  262. package/fesm2015/taiga-ui-cdk-directives-focus-visible.js +0 -1
  263. package/fesm2015/taiga-ui-cdk-directives-focus-visible.js.map +1 -1
  264. package/fesm2015/taiga-ui-cdk-directives-focused.js +2 -2
  265. package/fesm2015/taiga-ui-cdk-directives-focused.js.map +1 -1
  266. package/fesm2015/taiga-ui-cdk-directives-high-dpi.js +0 -1
  267. package/fesm2015/taiga-ui-cdk-directives-high-dpi.js.map +1 -1
  268. package/fesm2015/taiga-ui-cdk-directives-hovered.js +4 -7
  269. package/fesm2015/taiga-ui-cdk-directives-hovered.js.map +1 -1
  270. package/fesm2015/taiga-ui-cdk-directives-media.js +5 -10
  271. package/fesm2015/taiga-ui-cdk-directives-media.js.map +1 -1
  272. package/fesm2015/taiga-ui-cdk-directives-overscroll.js +12 -14
  273. package/fesm2015/taiga-ui-cdk-directives-overscroll.js.map +1 -1
  274. package/fesm2015/taiga-ui-cdk-directives-pan.js +0 -1
  275. package/fesm2015/taiga-ui-cdk-directives-pan.js.map +1 -1
  276. package/fesm2015/taiga-ui-cdk-directives-pressed.js +2 -2
  277. package/fesm2015/taiga-ui-cdk-directives-pressed.js.map +1 -1
  278. package/fesm2015/taiga-ui-cdk-directives-prevent-default.js +2 -3
  279. package/fesm2015/taiga-ui-cdk-directives-prevent-default.js.map +1 -1
  280. package/fesm2015/taiga-ui-cdk-directives-repeat-times.js +2 -2
  281. package/fesm2015/taiga-ui-cdk-directives-repeat-times.js.map +1 -1
  282. package/fesm2015/taiga-ui-cdk-directives-resize.js +0 -1
  283. package/fesm2015/taiga-ui-cdk-directives-resize.js.map +1 -1
  284. package/fesm2015/taiga-ui-cdk-directives-swipe.js +0 -1
  285. package/fesm2015/taiga-ui-cdk-directives-swipe.js.map +1 -1
  286. package/fesm2015/taiga-ui-cdk-directives-zoom.js +0 -1
  287. package/fesm2015/taiga-ui-cdk-directives-zoom.js.map +1 -1
  288. package/fesm2015/taiga-ui-cdk-observables.js +21 -67
  289. package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
  290. package/fesm2015/taiga-ui-cdk-pipes-keys.js +34 -0
  291. package/fesm2015/taiga-ui-cdk-pipes-keys.js.map +1 -0
  292. package/fesm2015/taiga-ui-cdk-pipes.js +1 -0
  293. package/fesm2015/taiga-ui-cdk-pipes.js.map +1 -1
  294. package/fesm2015/taiga-ui-cdk-services.js +25 -60
  295. package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
  296. package/fesm2015/taiga-ui-cdk-tokens.js +46 -23
  297. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  298. package/fesm2015/taiga-ui-cdk-utils-browser.js +4 -23
  299. package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
  300. package/fesm2015/taiga-ui-cdk-utils-color.js +67 -0
  301. package/fesm2015/taiga-ui-cdk-utils-color.js.map +1 -0
  302. package/fesm2015/taiga-ui-cdk-utils-dom.js +53 -78
  303. package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
  304. package/fesm2015/taiga-ui-cdk-utils-focus.js +21 -57
  305. package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
  306. package/fesm2015/taiga-ui-cdk-utils-format.js +0 -1
  307. package/fesm2015/taiga-ui-cdk-utils-format.js.map +1 -1
  308. package/fesm2015/taiga-ui-cdk-utils-math.js +9 -41
  309. package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
  310. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +21 -73
  311. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  312. package/fesm2015/taiga-ui-cdk-utils-os.js +6 -19
  313. package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -1
  314. package/fesm2015/taiga-ui-cdk-utils-svg.js +2 -5
  315. package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
  316. package/fesm2015/taiga-ui-cdk-utils.js +1 -0
  317. package/fesm2015/taiga-ui-cdk-utils.js.map +1 -1
  318. package/observables/drag-and-drop-from.d.ts +1 -5
  319. package/observables/focus-visible-observable.d.ts +1 -5
  320. package/observables/items-query-list-observable.d.ts +1 -3
  321. package/observables/mouse-drag-finish-from.d.ts +1 -3
  322. package/observables/must-be-present.d.ts +1 -5
  323. package/observables/pressed-observable.d.ts +1 -5
  324. package/observables/prevent-default.d.ts +1 -5
  325. package/observables/stop-propagation.d.ts +1 -5
  326. package/observables/typed-from-event.d.ts +5 -21
  327. package/observables/watch.d.ts +1 -5
  328. package/package.json +7 -3
  329. package/pipes/index.d.ts +1 -0
  330. package/pipes/keys/index.d.ts +2 -0
  331. package/pipes/keys/keys.module.d.ts +7 -0
  332. package/pipes/keys/keys.pipe.d.ts +7 -0
  333. package/pipes/keys/package.json +10 -0
  334. package/pipes/keys/taiga-ui-cdk-pipes-keys.d.ts +5 -0
  335. package/schematics/collection.json +6 -0
  336. package/schematics/constants/file-globs.d.ts +2 -0
  337. package/schematics/constants/file-globs.js +11 -0
  338. package/schematics/constants/index.d.ts +1 -0
  339. package/schematics/constants/index.js +4 -0
  340. package/schematics/constants/taiga-styles.d.ts +2 -1
  341. package/schematics/constants/taiga-styles.js +3 -2
  342. package/schematics/ng-add/constants/versions.js +2 -2
  343. package/schematics/ng-add/index.js +6 -0
  344. package/schematics/ng-add/schema.d.ts +8 -0
  345. package/schematics/ng-add/schema.json +9 -0
  346. package/schematics/ng-add/steps/add-taiga-icons.js +5 -3
  347. package/schematics/ng-add/steps/add-taiga-modules.js +4 -0
  348. package/schematics/ng-add/steps/add-taiga-styles.js +6 -3
  349. package/schematics/ng-add/steps/wrap-with-tui-root.js +3 -0
  350. package/schematics/ng-update/constants/breakpoints.d.ts +82 -0
  351. package/schematics/ng-update/constants/breakpoints.js +34 -0
  352. package/schematics/ng-update/constants/consts.d.ts +1 -1
  353. package/schematics/ng-update/constants/consts.js +170 -0
  354. package/schematics/ng-update/constants/deprecated-functions.js +1 -36
  355. package/schematics/ng-update/constants/services.js +1 -1
  356. package/schematics/ng-update/constants/templates.d.ts +16 -0
  357. package/schematics/ng-update/constants/templates.js +261 -1
  358. package/schematics/ng-update/constants/warnings.js +10 -0
  359. package/schematics/ng-update/index.js +21 -10
  360. package/schematics/ng-update/schema.json +13 -0
  361. package/schematics/ng-update/steps/migrate-date-time.js +45 -1
  362. package/schematics/ng-update/steps/migrate-progress.d.ts +1 -1
  363. package/schematics/ng-update/steps/migrate-progress.js +2 -1
  364. package/schematics/ng-update/steps/migrate-sliders/index.d.ts +1 -1
  365. package/schematics/ng-update/steps/migrate-sliders/index.js +2 -0
  366. package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.d.ts +1 -1
  367. package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.js +4 -3
  368. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.d.ts +1 -1
  369. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +3 -2
  370. package/schematics/ng-update/steps/migrate-taiga-proprietary-icons.d.ts +3 -0
  371. package/schematics/ng-update/steps/migrate-taiga-proprietary-icons.js +51 -0
  372. package/schematics/ng-update/steps/migrate-templates.d.ts +1 -1
  373. package/schematics/ng-update/steps/migrate-templates.js +77 -5
  374. package/schematics/ng-update/steps/replace-deep-import.js +2 -1
  375. package/schematics/ng-update/steps/replace-enums.js +2 -1
  376. package/schematics/ng-update/steps/replace-functions.js +42 -2
  377. package/schematics/ng-update/steps/replace-styles.d.ts +1 -0
  378. package/schematics/ng-update/steps/replace-styles.js +18 -0
  379. package/schematics/ng-update/steps/show-warnings.js +2 -1
  380. package/schematics/utils/add-import-to-closest-module.d.ts +1 -0
  381. package/schematics/utils/add-import-to-closest-module.js +18 -0
  382. package/schematics/utils/add-styles.d.ts +6 -2
  383. package/schematics/utils/add-styles.js +32 -4
  384. package/schematics/utils/angular/ng-component.d.ts +1 -2
  385. package/schematics/utils/angular/ng-module.d.ts +1 -2
  386. package/schematics/utils/angular/ng-module.js +2 -1
  387. package/schematics/utils/colored-log.d.ts +1 -0
  388. package/schematics/utils/colored-log.js +5 -1
  389. package/schematics/utils/get-execution-time.d.ts +1 -0
  390. package/schematics/utils/get-execution-time.js +8 -0
  391. package/schematics/utils/get-named-import-references.js +2 -1
  392. package/schematics/utils/get-project.d.ts +1 -1
  393. package/schematics/utils/get-project.js +0 -4
  394. package/schematics/utils/insert-todo.d.ts +1 -0
  395. package/schematics/utils/insert-todo.js +3 -2
  396. package/schematics/utils/progress.d.ts +1 -0
  397. package/schematics/utils/progress.js +13 -0
  398. package/schematics/utils/templates/get-component-templates.d.ts +1 -2
  399. package/schematics/utils/templates/get-component-templates.js +1 -1
  400. package/schematics/utils/templates/ng-component-input-manipulations.js +2 -12
  401. package/schematics/utils/templates/template-resource.d.ts +1 -1
  402. package/services/directive-styles.service.d.ts +2 -9
  403. package/services/focus-visible.service.d.ts +0 -1
  404. package/services/pan.service.d.ts +0 -3
  405. package/services/swipe.service.d.ts +0 -3
  406. package/tokens/alerts.d.ts +2 -1
  407. package/tokens/dialogs.d.ts +2 -1
  408. package/tokens/focusable-item-accessor.d.ts +2 -1
  409. package/tokens/index.d.ts +1 -1
  410. package/tokens/is-cypress.d.ts +0 -3
  411. package/tokens/range.d.ts +2 -0
  412. package/utils/browser/index.d.ts +0 -1
  413. package/utils/browser/is-edge.d.ts +1 -5
  414. package/utils/browser/is-firefox.d.ts +1 -5
  415. package/utils/browser/is-safari.d.ts +1 -5
  416. package/utils/color/hex-to-rgb.d.ts +1 -0
  417. package/utils/color/hsv-to-rgb.d.ts +4 -0
  418. package/utils/color/index.d.ts +5 -0
  419. package/utils/color/package.json +10 -0
  420. package/utils/color/parse-color.d.ts +1 -0
  421. package/utils/color/rgb-to-hex.d.ts +1 -0
  422. package/utils/color/rgb-to-hsv.d.ts +1 -0
  423. package/utils/color/taiga-ui-cdk-utils-color.d.ts +5 -0
  424. package/utils/dom/can-scroll.d.ts +1 -5
  425. package/utils/dom/contains-or-after.d.ts +1 -5
  426. package/utils/dom/element-checks.d.ts +6 -0
  427. package/utils/dom/get-actual-target.d.ts +1 -3
  428. package/utils/dom/get-clipboard-data-text.d.ts +1 -3
  429. package/utils/dom/get-document-or-shadow-root.d.ts +1 -5
  430. package/utils/dom/get-element-obscurers.d.ts +1 -3
  431. package/utils/dom/get-element-offset.d.ts +1 -3
  432. package/utils/dom/get-scroll-parent.d.ts +1 -3
  433. package/utils/dom/index.d.ts +2 -1
  434. package/utils/dom/is-current-target.d.ts +1 -5
  435. package/utils/dom/is-element-editable.d.ts +1 -0
  436. package/utils/dom/is-inside-iframe.d.ts +1 -3
  437. package/utils/dom/is-node-in.d.ts +1 -3
  438. package/utils/focus/blur-native-focused.d.ts +1 -3
  439. package/utils/focus/get-closest-focusable.d.ts +27 -0
  440. package/utils/focus/index.d.ts +1 -2
  441. package/utils/focus/is-native-mouse-focusable.d.ts +0 -2
  442. package/utils/focus/set-native-mouse-focused.d.ts +1 -3
  443. package/utils/index.d.ts +1 -0
  444. package/utils/math/clamp.d.ts +1 -3
  445. package/utils/math/quantize.d.ts +1 -3
  446. package/utils/math/round.d.ts +3 -15
  447. package/utils/math/sum.d.ts +1 -3
  448. package/utils/math/to-int.d.ts +1 -5
  449. package/utils/math/to-radians.d.ts +1 -3
  450. package/utils/miscellaneous/array-remove.d.ts +1 -0
  451. package/utils/miscellaneous/array-toggle.d.ts +1 -0
  452. package/utils/miscellaneous/distance-between-touches.d.ts +1 -5
  453. package/utils/miscellaneous/ease-in-out-quad.d.ts +1 -5
  454. package/utils/miscellaneous/flat-length.d.ts +1 -3
  455. package/utils/miscellaneous/get-original-array-from-query-list.d.ts +1 -3
  456. package/utils/miscellaneous/get-swipe-direction.d.ts +1 -5
  457. package/utils/miscellaneous/index.d.ts +2 -2
  458. package/utils/miscellaneous/is-number.d.ts +1 -5
  459. package/utils/miscellaneous/is-present.d.ts +1 -5
  460. package/utils/miscellaneous/mark-control-as-touched-and-validate.d.ts +1 -5
  461. package/utils/miscellaneous/uniq-by.d.ts +1 -5
  462. package/utils/os/is-apple-platform.d.ts +1 -3
  463. package/utils/os/is-apple.d.ts +1 -5
  464. package/utils/os/is-ios.d.ts +1 -5
  465. package/utils/svg/svg-linear-gradient-processor.d.ts +1 -3
  466. package/esm2015/tokens/sanitizer.js +0 -4
  467. package/esm2015/utils/browser/is-ie.js +0 -4
  468. package/esm2015/utils/dom/is-form-field.js +0 -8
  469. package/esm2015/utils/focus/get-closest-keyboard-focusable.js +0 -34
  470. package/esm2015/utils/focus/set-native-focused.js +0 -19
  471. package/esm2015/utils/miscellaneous/identity.js +0 -8
  472. package/esm2015/utils/miscellaneous/is-element-editable.js +0 -12
  473. package/tokens/sanitizer.d.ts +0 -2
  474. package/utils/browser/is-ie.d.ts +0 -1
  475. package/utils/dom/is-form-field.d.ts +0 -1
  476. package/utils/focus/get-closest-keyboard-focusable.d.ts +0 -10
  477. package/utils/focus/set-native-focused.d.ts +0 -10
  478. package/utils/miscellaneous/identity.d.ts +0 -4
  479. package/utils/miscellaneous/is-element-editable.d.ts +0 -5
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "taiga-ui-ng-update-v3",
4
+ "title": "Taiga UI ng-update v3",
5
+ "type": "object",
6
+ "properties": {
7
+ "skip-deep-imports": {
8
+ "description": "Ignore deep imports replacements",
9
+ "type": "boolean",
10
+ "default": false
11
+ }
12
+ }
13
+ }
@@ -5,14 +5,19 @@ const ng_morph_1 = require("ng-morph");
5
5
  const get_named_import_references_1 = require("../../utils/get-named-import-references");
6
6
  const insert_todo_1 = require("../../utils/insert-todo");
7
7
  const colored_log_1 = require("../../utils/colored-log");
8
+ const get_execution_time_1 = require("../../utils/get-execution-time");
8
9
  function dateTimeMigrations() {
9
10
  colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating taiga date/time...`);
11
+ let start = performance.now();
10
12
  migrateProperty({
11
13
  namedImport: 'TuiDay',
12
14
  moduleSpecifier: '@taiga-ui/cdk',
13
15
  from: 'formattedDay',
14
16
  callback: node => node.replaceWithText(node.getText().replace('formattedDay', 'getFormattedDay("DMY", ".")')),
15
17
  });
18
+ colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDay.formattedDay ` +
19
+ `(${get_execution_time_1.getExecutionTime(start, performance.now())})`);
20
+ start = performance.now();
16
21
  migrateProperty({
17
22
  namedImport: 'TuiDayRange',
18
23
  moduleSpecifier: '@taiga-ui/cdk',
@@ -21,6 +26,9 @@ function dateTimeMigrations() {
21
26
  .getText()
22
27
  .replace('formattedDayRange', 'getFormattedDayRange("DMY", ".")')),
23
28
  });
29
+ colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.formattedDayRange ` +
30
+ `(${get_execution_time_1.getExecutionTime(start, performance.now())})`);
31
+ start = performance.now();
24
32
  migrateProperty({
25
33
  namedImport: 'TuiDayRange',
26
34
  moduleSpecifier: '@taiga-ui/cdk',
@@ -32,6 +40,8 @@ function dateTimeMigrations() {
32
40
  }
33
41
  },
34
42
  });
43
+ colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.normalizeParse ` +
44
+ `(${get_execution_time_1.getExecutionTime(start, performance.now())})`);
35
45
  [
36
46
  {
37
47
  namedImport: 'TuiMonthRange',
@@ -69,12 +79,15 @@ function dateTimeMigrations() {
69
79
  message: 'weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/Tinkoff/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
70
80
  },
71
81
  ].forEach(({ namedImport, field, message }) => {
82
+ start = performance.now();
72
83
  migrateProperty({
73
84
  namedImport,
74
85
  moduleSpecifier: '@taiga-ui/cdk',
75
86
  from: field,
76
87
  callback: node => insertTodoBeforeNode(node, message),
77
88
  });
89
+ colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}${namedImport}.${field} ` +
90
+ `(${get_execution_time_1.getExecutionTime(start, performance.now())})`);
78
91
  });
79
92
  colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} date/time migrated \n`);
80
93
  }
@@ -118,12 +131,39 @@ function replaceIdentifier(node, from, callback) {
118
131
  }
119
132
  }
120
133
  function replaceIdentifierReferences(identifier, from, callback) {
121
- identifier.findReferencesAsNodes().forEach(ref => {
134
+ identifier
135
+ .findReferencesAsNodes()
136
+ /**
137
+ * `findReferencesAsNodes` has strange behavior.
138
+ * Imagine schematics run on the following file:
139
+ * ```
140
+ * class Dummy {
141
+ * var = 5;
142
+ * method1() {
143
+ * const {var} = this; // (1)
144
+ * return var; // (2)
145
+ * }
146
+ * method2() {
147
+ * const {var} = this; // (3)
148
+ * }
149
+ * }
150
+ * ```
151
+ * If `identifier` is equal to `var` from `method1` (1),
152
+ * then `identifier.findReferencesAsNodes` will return array with 2 references: (2) and (3).
153
+ */
154
+ .filter(ref => !areBothObjectDestructuring(ref, identifier))
155
+ .forEach(ref => {
156
+ if (ref.wasForgotten()) {
157
+ return;
158
+ }
122
159
  let parent = ref.getParent();
123
160
  if ((parent === null || parent === void 0 ? void 0 : parent.getText()) === `this.${identifier.getText()}` ||
124
161
  (parent === null || parent === void 0 ? void 0 : parent.getText()) === identifier.getText()) {
125
162
  replaceIdentifier(parent, from, callback);
126
163
  }
164
+ if (parent === null || parent === void 0 ? void 0 : parent.wasForgotten()) {
165
+ return;
166
+ }
127
167
  if (parent === null || parent === void 0 ? void 0 : parent.getText().startsWith('this')) {
128
168
  parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
129
169
  }
@@ -154,3 +194,7 @@ function insertTodoBeforeNode(node, message) {
154
194
  insert_todo_1.insertTodo(identifier, message);
155
195
  }
156
196
  }
197
+ function areBothObjectDestructuring(ref, identifier) {
198
+ return Boolean(identifier.getFirstAncestorByKind(ng_morph_1.SyntaxKind.BindingElement) &&
199
+ ref.getFirstAncestorByKind(ng_morph_1.SyntaxKind.BindingElement));
200
+ }
@@ -1,3 +1,3 @@
1
- import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
1
+ import { DevkitFileSystem } from 'ng-morph';
2
2
  export declare const DEPRECATED_PROGRESS_PIPES_REG: RegExp;
3
3
  export declare function migrateProgress(fileSystem: DevkitFileSystem): void;
@@ -6,11 +6,12 @@ const get_component_templates_1 = require("../../utils/templates/get-component-t
6
6
  const elements_1 = require("../../utils/templates/elements");
7
7
  const template_resource_1 = require("../../utils/templates/template-resource");
8
8
  const colored_log_1 = require("../../utils/colored-log");
9
+ const constants_1 = require("../../constants");
9
10
  exports.DEPRECATED_PROGRESS_PIPES_REG = /\s*\|\s*tuiProgressColorSegments(Async\s*\|\s*async)?/gi;
10
11
  const PROPERTY_FOR_DEPRECATED_PIPES = '[color]';
11
12
  function migrateProgress(fileSystem) {
12
13
  colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating progress bars...`);
13
- const templateResources = get_component_templates_1.getComponentTemplates('**/**');
14
+ const templateResources = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
14
15
  for (const templateResource of templateResources) {
15
16
  replaceProgressColorSegmentsPipe(templateResource, fileSystem);
16
17
  }
@@ -1,2 +1,2 @@
1
- import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
1
+ import { DevkitFileSystem } from 'ng-morph';
2
2
  export declare function migrateSliders(fileSystem: DevkitFileSystem): void;
@@ -6,7 +6,9 @@ const migrate_input_range_1 = require("./migrate-input-range");
6
6
  const colored_log_1 = require("../../../utils/colored-log");
7
7
  function migrateSliders(fileSystem) {
8
8
  colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating sliders...`);
9
+ colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}InputSlider...`);
9
10
  migrate_input_slider_1.migrateInputSlider(fileSystem);
11
+ colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}InputRange...`);
10
12
  migrate_input_range_1.migrateInputRange(fileSystem);
11
13
  colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} sliders migrated \n`);
12
14
  }
@@ -1,2 +1,2 @@
1
- import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
1
+ import { DevkitFileSystem } from 'ng-morph';
2
2
  export declare function migrateInputRange(fileSystem: DevkitFileSystem): void;
@@ -6,10 +6,11 @@ const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-
6
6
  const ng_morph_1 = require("ng-morph");
7
7
  const ng_component_1 = require("../../../utils/angular/ng-component");
8
8
  const add_unique_import_1 = require("../../../utils/add-unique-import");
9
+ const constants_1 = require("../../../constants");
9
10
  const MIN_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationInputRangeMinLabel';
10
11
  const MAX_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationInputRangeMaxLabel';
11
12
  function migrateInputRange(fileSystem) {
12
- const templateResources = get_component_templates_1.getComponentTemplates('**/**');
13
+ const templateResources = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
13
14
  const COMPONENTS_WITH_MIN_LABELS = new Set();
14
15
  const COMPONENTS_WITH_MAX_LABELS = new Set();
15
16
  for (const templateResource of templateResources) {
@@ -17,7 +18,7 @@ function migrateInputRange(fileSystem) {
17
18
  replaceMaxLabel(templateResource, fileSystem, COMPONENTS_WITH_MAX_LABELS);
18
19
  }
19
20
  save(fileSystem);
20
- for (const componentPath of COMPONENTS_WITH_MIN_LABELS) {
21
+ for (const componentPath of Array.from(COMPONENTS_WITH_MIN_LABELS)) {
21
22
  addMinMaxLabelMethod(componentPath, MIN_LABELS_MIGRATION_METHOD_NAME, [
22
23
  'const currentValue = context.$implicit;',
23
24
  'const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input-range',
@@ -26,7 +27,7 @@ function migrateInputRange(fileSystem) {
26
27
  'return String(currentValue);',
27
28
  ]);
28
29
  }
29
- for (const componentPath of COMPONENTS_WITH_MAX_LABELS) {
30
+ for (const componentPath of Array.from(COMPONENTS_WITH_MAX_LABELS)) {
30
31
  addMinMaxLabelMethod(componentPath, MAX_LABELS_MIGRATION_METHOD_NAME, [
31
32
  'const currentValue = context.$implicit;',
32
33
  'const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input',
@@ -1,2 +1,2 @@
1
- import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
1
+ import { DevkitFileSystem } from 'ng-morph';
2
2
  export declare function migrateInputSlider(fileSystem: DevkitFileSystem): void;
@@ -7,8 +7,9 @@ const ng_component_1 = require("../../../utils/angular/ng-component");
7
7
  const add_unique_import_1 = require("../../../utils/add-unique-import");
8
8
  const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
9
9
  const elements_1 = require("../../../utils/templates/elements");
10
+ const constants_1 = require("../../../constants");
10
11
  function migrateInputSlider(fileSystem) {
11
- const templateResources = get_component_templates_1.getComponentTemplates('**/**');
12
+ const templateResources = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
12
13
  const COMPONENTS_WITH_MIN_MAX_LABELS = new Set();
13
14
  for (const templateResource of templateResources) {
14
15
  replaceMinMaxLabels(templateResource, fileSystem, COMPONENTS_WITH_MIN_MAX_LABELS);
@@ -20,7 +21,7 @@ function migrateInputSlider(fileSystem) {
20
21
  fileSystem.commitEdits();
21
22
  ng_morph_1.saveActiveProject();
22
23
  ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, '/', '**/**'));
23
- for (const componentPath of COMPONENTS_WITH_MIN_MAX_LABELS) {
24
+ for (const componentPath of Array.from(COMPONENTS_WITH_MIN_MAX_LABELS)) {
24
25
  addMinMaxLabelMethod(componentPath);
25
26
  }
26
27
  }
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { Schema } from '../../ng-add/schema';
3
+ export declare function migrateTaigaProprietaryIcons(options: Schema): Rule;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateTaigaProprietaryIcons = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const workspace_1 = require("@schematics/angular/utility/workspace");
6
+ const get_project_target_options_1 = require("../../utils/get-project-target-options");
7
+ const get_project_1 = require("../../utils/get-project");
8
+ const ng_morph_1 = require("ng-morph");
9
+ const PROPRIETARY_TDS_ICON_ASSETS = {
10
+ glob: '**/*',
11
+ input: 'node_modules/@taiga-ui/proprietary-tds-icons/src',
12
+ output: 'assets/taiga-ui/icons',
13
+ };
14
+ function migrateTaigaProprietaryIcons(options) {
15
+ return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
16
+ var _a;
17
+ let proprietaryIcons = null;
18
+ try {
19
+ proprietaryIcons =
20
+ ((_a = ng_morph_1.getPackageJsonDependency(tree, '@taiga-ui/proprietary-icons')) === null || _a === void 0 ? void 0 : _a.version) ||
21
+ null;
22
+ }
23
+ catch (_b) {
24
+ // noop
25
+ }
26
+ return ng_morph_1.getSourceFiles('**/angular.json').length > 0
27
+ ? workspace_1.updateWorkspace(workspace => {
28
+ if (proprietaryIcons === null) {
29
+ return;
30
+ }
31
+ const project = get_project_1.getProject(options, workspace);
32
+ if (!project) {
33
+ context.logger.warn(`[WARNING]: Target project not found. Add ${JSON.stringify(PROPRIETARY_TDS_ICON_ASSETS, null, 4)} to angular.json manually`);
34
+ return;
35
+ }
36
+ const targetOptions = get_project_target_options_1.getProjectTargetOptions(project, 'build');
37
+ if (Array.isArray(targetOptions === null || targetOptions === void 0 ? void 0 : targetOptions.assets)) {
38
+ const hasIcons = targetOptions.assets.find(asset => {
39
+ var _a;
40
+ return (_a = asset) === null || _a === void 0 ? void 0 : _a.input.includes('@taiga-ui/proprietary-tds-icons/src');
41
+ });
42
+ if (hasIcons) {
43
+ return;
44
+ }
45
+ targetOptions.assets.push(PROPRIETARY_TDS_ICON_ASSETS);
46
+ }
47
+ })
48
+ : () => { };
49
+ });
50
+ }
51
+ exports.migrateTaigaProprietaryIcons = migrateTaigaProprietaryIcons;
@@ -1,2 +1,2 @@
1
- import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
1
+ import { DevkitFileSystem } from 'ng-morph';
2
2
  export declare function migrateTemplates(fileSystem: DevkitFileSystem): void;
@@ -4,17 +4,21 @@ exports.migrateTemplates = void 0;
4
4
  const get_component_templates_1 = require("../../utils/templates/get-component-templates");
5
5
  const templates_1 = require("../constants/templates");
6
6
  const elements_1 = require("../../utils/templates/elements");
7
+ const ng_morph_1 = require("ng-morph");
7
8
  const ng_component_input_manipulations_1 = require("../../utils/templates/ng-component-input-manipulations");
8
9
  const template_resource_1 = require("../../utils/templates/template-resource");
9
- const ng_morph_1 = require("ng-morph");
10
10
  const ng_component_1 = require("../../utils/angular/ng-component");
11
11
  const add_unique_import_1 = require("../../utils/add-unique-import");
12
12
  const colored_log_1 = require("../../utils/colored-log");
13
+ const constants_1 = require("../../constants");
13
14
  const replace_tag_1 = require("../../utils/replace-tag");
15
+ const progress_1 = require("../../utils/progress");
14
16
  const migrate_polymorpheus_1 = require("./migrate-polymorpheus");
17
+ const add_import_to_closest_module_1 = require("../../utils/add-import-to-closest-module");
18
+ const insert_todo_1 = require("../../utils/insert-todo");
15
19
  function migrateTemplates(fileSystem) {
16
20
  colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating templates...`);
17
- const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates('**/**');
21
+ const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
18
22
  const actions = [
19
23
  replaceTags,
20
24
  replaceAttrs,
@@ -26,11 +30,18 @@ function migrateTemplates(fileSystem) {
26
30
  migrateTuiHideSelectedPipe,
27
31
  removeInputs,
28
32
  migrate_polymorpheus_1.migratePolymorpheus,
33
+ replaceInputValues,
34
+ migrateBinaryAttributes,
35
+ addWarningForFormatNumberPipe,
29
36
  ];
30
- componentWithTemplatesPaths.forEach(resource => {
37
+ componentWithTemplatesPaths.forEach((resource, templateIndex, templates) => {
31
38
  const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
32
39
  const recorder = fileSystem.edit(path);
33
- actions.forEach(action => {
40
+ const isLastTemplate = templateIndex === templates.length - 1;
41
+ actions.forEach((action, actionIndex) => {
42
+ const isLastAction = actionIndex === actions.length - 1;
43
+ const progressLog = `${templateIndex + 1} / ${templates.length} (${action.name}...)`;
44
+ progress_1.printProgress(`${colored_log_1.SMALL_TAB_SYMBOL.repeat(2)}${progressLog}`, isLastTemplate && isLastAction);
34
45
  action({ resource, fileSystem, recorder });
35
46
  });
36
47
  });
@@ -87,7 +98,7 @@ function addHTMLCommentTags({ resource, recorder, fileSystem, }) {
87
98
  .filter(el => el.tagName === tag)
88
99
  .map(el => { var _a; return (((_a = el.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.startOffset) || 0) + templateOffset; });
89
100
  elementStartOffsets.forEach(offset => {
90
- recorder.insertRight(offset, `<!-- TODO: (Taiga UI migration) ${comment} -->\n`);
101
+ recorder.insertRight(offset, `<!-- ${insert_todo_1.TODO_MARK} ${comment} -->\n`);
91
102
  });
92
103
  });
93
104
  }
@@ -132,6 +143,9 @@ function replaceFieldError({ resource, recorder, fileSystem, }) {
132
143
  const input = `[error]="${orderVal !== null && orderVal !== void 0 ? orderVal : '[]'} | tuiFieldError | async"`;
133
144
  replace_tag_1.replaceTag(recorder, element.sourceCodeLocation, 'tui-field-error', 'tui-error', templateOffset, [input]);
134
145
  });
146
+ if (elements.length) {
147
+ add_import_to_closest_module_1.addImportToClosestModule(resource.componentPath, 'TuiErrorModule', '@taiga-ui/core');
148
+ }
135
149
  }
136
150
  function addEditorProviders({ resource, fileSystem, }) {
137
151
  const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
@@ -167,6 +181,64 @@ function migrateTuiHideSelectedPipe({ resource, fileSystem, recorder, }) {
167
181
  recorder.insertRight(valueOffset, newValue);
168
182
  });
169
183
  }
184
+ function migrateBinaryAttributes({ resource, fileSystem, recorder, }) {
185
+ const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
186
+ const templateOffset = template_resource_1.getTemplateOffset(resource);
187
+ templates_1.TRUTHY_BOOLEAN_INPUT_TO_HTML_BINARY_ATTRIBUTE.forEach(attrName => {
188
+ const elements = elements_1.findElementsInTemplateByFn(template, el => {
189
+ var _a;
190
+ return (_a = el.attrs) === null || _a === void 0 ? void 0 : _a.some(attr => attr.value === 'true' && attr.name.includes(attrName.toLowerCase()));
191
+ });
192
+ elements.forEach(el => {
193
+ var _a;
194
+ const attrLocations = (_a = el.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs;
195
+ if (!attrLocations) {
196
+ return;
197
+ }
198
+ const { startOffset, endOffset } = attrLocations[`[${attrName.toLowerCase()}]`] ||
199
+ attrLocations[attrName.toLowerCase()];
200
+ recorder.remove(templateOffset + startOffset, endOffset - startOffset);
201
+ recorder.insertRight(templateOffset + startOffset, attrName);
202
+ });
203
+ });
204
+ }
205
+ function addWarningForFormatNumberPipe({ resource, fileSystem, recorder, }) {
206
+ const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
207
+ const templateOffset = template_resource_1.getTemplateOffset(resource);
208
+ if (template.match(/\|\s*tuiFormatNumber\s*:\s/gi)) {
209
+ recorder.insertLeft(templateOffset && templateOffset + 1, `<!-- ${insert_todo_1.TODO_MARK} tuiFormatNumber pipe has new API. See https://taiga-ui.dev/pipes/format-number -->`);
210
+ }
211
+ }
212
+ function replaceInputValues({ resource, recorder, fileSystem, }) {
213
+ const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
214
+ const templateOffset = template_resource_1.getTemplateOffset(resource);
215
+ const ATTR_VALUES = [
216
+ {
217
+ attrName: 'tuiHintDirection',
218
+ values: [
219
+ { from: 'bottom-middle', to: 'bottom' },
220
+ { from: 'top-middle', to: 'top' },
221
+ ],
222
+ },
223
+ ];
224
+ ATTR_VALUES.forEach(({ attrName, values }) => {
225
+ const elements = [...elements_1.findElementsWithAttribute(template, attrName)];
226
+ elements.forEach(element => {
227
+ const { name, value } = element.attrs.find(attr => attr.name === attrName.toLowerCase()) || {};
228
+ if (!name || !value) {
229
+ return;
230
+ }
231
+ values.forEach(({ from, to }) => {
232
+ var _a, _b;
233
+ if (value === from) {
234
+ const { startOffset, endOffset } = ((_b = (_a = element.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b[name]) || { startOffset: 0, endOffset: 0 };
235
+ recorder.remove(templateOffset + startOffset, endOffset - startOffset);
236
+ recorder.insertRight(templateOffset + startOffset, `${attrName}="${to}"`);
237
+ }
238
+ });
239
+ });
240
+ });
241
+ }
170
242
  function removeInputs({ resource, fileSystem, recorder, }) {
171
243
  const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
172
244
  const templateOffset = template_resource_1.getTemplateOffset(resource);
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.replaceDeepImports = void 0;
4
4
  const ng_morph_1 = require("ng-morph");
5
5
  const colored_log_1 = require("../../utils/colored-log");
6
+ const constants_1 = require("../../constants");
6
7
  const DEEP_REGEX = /(@taiga-ui\/\w+)\/.*/;
7
8
  function replaceDeepImports() {
8
9
  colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing deep imports...`);
9
- const deepImports = ng_morph_1.getImports('**/**').filter(imp => DEEP_REGEX.test(imp.getModuleSpecifier().getLiteralValue()));
10
+ const deepImports = ng_morph_1.getImports(constants_1.ALL_TS_FILES).filter(imp => DEEP_REGEX.test(imp.getModuleSpecifier().getLiteralValue()));
10
11
  ng_morph_1.editImports(deepImports, deepImport => {
11
12
  const specifier = deepImport.moduleSpecifier.replace(DEEP_REGEX, '$1');
12
13
  return { moduleSpecifier: specifier };
@@ -13,6 +13,7 @@ function replaceEnums() {
13
13
  }
14
14
  exports.replaceEnums = replaceEnums;
15
15
  function replaceEnumWithString(enumName, replaceValues, keepAsType = true) {
16
+ var _a;
16
17
  const references = get_named_import_references_1.getNamedImportReferences(enumName);
17
18
  for (let ref of references) {
18
19
  const parent = ref.getParent();
@@ -22,7 +23,7 @@ function replaceEnumWithString(enumName, replaceValues, keepAsType = true) {
22
23
  }
23
24
  if (ng_morph_1.Node.isTypeReferenceNode(parent) && !keepAsType) {
24
25
  const declaration = parent.getParent();
25
- declaration.removeType();
26
+ (_a = declaration.removeType) === null || _a === void 0 ? void 0 : _a.call(declaration);
26
27
  continue;
27
28
  }
28
29
  if (!ng_morph_1.Node.isPropertyAccessExpression(parent)) {
@@ -13,15 +13,20 @@ function replaceFunctions() {
13
13
  replaceCustomEvent(get_named_import_references_1.getNamedImportReferences('tuiCustomEvent', '@taiga-ui/cdk'));
14
14
  replaceClosestElement(get_named_import_references_1.getNamedImportReferences('getClosestElement', '@taiga-ui/cdk'));
15
15
  replaceDeprecatedFunction();
16
+ modifyFormatNumberArgs();
17
+ modifyClosestFocusable();
16
18
  colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} functions replaced \n`);
17
19
  }
18
20
  exports.replaceFunctions = replaceFunctions;
19
21
  function replaceDeprecatedFunction() {
20
22
  deprecated_functions_1.DEPRECATED_FUNCTIONS.forEach(({ from, to, moduleSpecifier }) => {
21
23
  get_named_import_references_1.getNamedImportReferences(from, moduleSpecifier).forEach(ref => {
24
+ if (ref.wasForgotten()) {
25
+ return;
26
+ }
22
27
  const parent = ref.getParent();
23
28
  if (ng_morph_1.Node.isImportSpecifier(parent) || ng_morph_1.Node.isCallExpression(parent)) {
24
- parent === null || parent === void 0 ? void 0 : parent.replaceWithText(parent === null || parent === void 0 ? void 0 : parent.getFullText().trim().replace(from, to !== null && to !== void 0 ? to : from));
29
+ parent === null || parent === void 0 ? void 0 : parent.replaceWithText(parent === null || parent === void 0 ? void 0 : parent.getText({ includeJsDocComments: false }).trim().replace(from, to !== null && to !== void 0 ? to : from));
25
30
  }
26
31
  });
27
32
  });
@@ -47,7 +52,11 @@ function replaceClosestElement(references) {
47
52
  }
48
53
  else if (ng_morph_1.Node.isCallExpression(parent)) {
49
54
  const [firstArg, secondArg] = parent.getArguments();
50
- parent.replaceWithText(`${firstArg.getText()}.closest(${secondArg.getText()})`);
55
+ const firstArgText = firstArg.getText();
56
+ const element = firstArgText.includes(' as ') // e.g, `getClosestElement(el as Element, ...)`
57
+ ? `(${firstArgText})`
58
+ : firstArgText;
59
+ parent.replaceWithText(`${element}.closest(${secondArg.getText()})`);
51
60
  }
52
61
  });
53
62
  }
@@ -75,3 +84,34 @@ function replaceFallbackValue(references) {
75
84
  }
76
85
  });
77
86
  }
87
+ function modifyFormatNumberArgs() {
88
+ [
89
+ ...get_named_import_references_1.getNamedImportReferences('formatNumber', '@taiga-ui/core'),
90
+ ...get_named_import_references_1.getNamedImportReferences('tuiFormatNumber', '@taiga-ui/core'),
91
+ ]
92
+ .map(ref => ref.getParent())
93
+ .filter(ng_morph_1.Node.isCallExpression)
94
+ .forEach(fn => {
95
+ const args = fn.getArguments();
96
+ if (args.length > 1) {
97
+ const [value, decimalLimit = `Infinity`, decimalSeparator = `','`, thousandSeparator = `'\u00A0'`, zeroPadding = true,] = args.map(arg => arg.getText());
98
+ const notNullDecimalLimit = decimalLimit === `null` ? `Infinity` : decimalLimit;
99
+ const conditionalDecimalLimit = !Number.isNaN(+notNullDecimalLimit)
100
+ ? notNullDecimalLimit
101
+ : `${decimalLimit} === null ? Infinity : ${decimalLimit}`;
102
+ fn.replaceWithText(`tuiFormatNumber(${value}, {decimalLimit: ${conditionalDecimalLimit}, decimalSeparator: ${decimalSeparator}, thousandSeparator: ${thousandSeparator}, zeroPadding: ${zeroPadding}})`);
103
+ }
104
+ });
105
+ }
106
+ function modifyClosestFocusable() {
107
+ get_named_import_references_1.getNamedImportReferences('tuiGetClosestFocusable', '@taiga-ui/cdk')
108
+ .map(ref => ref.getParent())
109
+ .filter(ng_morph_1.Node.isCallExpression)
110
+ .forEach(fn => {
111
+ const args = fn.getArguments();
112
+ if (args.length > 1) {
113
+ const [initial, prev = false, root, keyboard = true] = args.map(arg => arg.getText());
114
+ fn.replaceWithText(`tuiGetClosestFocusable({initial: ${initial}, root: ${root}, previous: ${prev}, keyboard: ${keyboard}})`);
115
+ }
116
+ });
117
+ }
@@ -0,0 +1 @@
1
+ export declare function replaceStyles(): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceStyles = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ const breakpoints_1 = require("../constants/breakpoints");
6
+ function replaceStyles() {
7
+ var _a;
8
+ (_a = ng_morph_1.getActiveProject()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/**.less').forEach(sourceFile => {
9
+ let fullText = sourceFile.getFullText();
10
+ if (fullText.includes(`taiga-ui-local`)) {
11
+ breakpoints_1.DEPRECATED_BREAKPOINTS.forEach(({ from, to }) => {
12
+ fullText = fullText.replaceAll(new RegExp(`(?<=@media.*)(${from})(?=[\\s,{])`, 'g'), to);
13
+ });
14
+ }
15
+ sourceFile.replaceWithText(fullText.replace(`@import '~@taiga-ui/core/styles/taiga-ui-global';`, `@import '~@taiga-ui/styles/taiga-ui-global';`));
16
+ });
17
+ }
18
+ exports.replaceStyles = replaceStyles;
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.showWarnings = void 0;
4
4
  const ng_morph_1 = require("ng-morph");
5
5
  const warnings_1 = require("../constants/warnings");
6
+ const constants_1 = require("../../constants");
6
7
  function showWarnings(context) {
7
8
  warnings_1.MIGRATION_WARNINGS.forEach(warning => showWarning(warning, context));
8
9
  }
9
10
  exports.showWarnings = showWarnings;
10
11
  function showWarning({ name, message, moduleSpecifier = '**/**' }, { logger }) {
11
- const references = ng_morph_1.getImports('**/**', {
12
+ const references = ng_morph_1.getImports(constants_1.ALL_TS_FILES, {
12
13
  moduleSpecifier,
13
14
  namedImports: [name],
14
15
  })
@@ -0,0 +1 @@
1
+ export declare function addImportToClosestModule(componentPath: string, moduleName: string, moduleSpecifier: string): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addImportToClosestModule = void 0;
4
+ const ng_component_1 = require("./angular/ng-component");
5
+ const ng_module_1 = require("./angular/ng-module");
6
+ const ng_morph_1 = require("ng-morph");
7
+ const add_unique_import_1 = require("./add-unique-import");
8
+ function addImportToClosestModule(componentPath, moduleName, moduleSpecifier) {
9
+ const [ngComponent] = ng_component_1.getNgComponents(componentPath);
10
+ const ngModule = ngComponent ? ng_module_1.findNgModule(ngComponent) : null;
11
+ if (ngModule) {
12
+ ng_morph_1.addImportToNgModule(ngModule, moduleName, {
13
+ unique: true,
14
+ });
15
+ add_unique_import_1.addUniqueImport(ngModule.getSourceFile().getFilePath(), moduleName, moduleSpecifier);
16
+ }
17
+ }
18
+ exports.addImportToClosestModule = addImportToClosestModule;
@@ -1,3 +1,7 @@
1
1
  import { Schema } from '../ng-add/schema';
2
- import { Rule } from '@angular-devkit/schematics';
3
- export declare function addStylesToAngularJson(options: Schema, taigaStyles: string[]): Rule;
2
+ import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
3
+ import { JsonArray } from '@angular-devkit/core';
4
+ export declare function addStylesToAngularJson(options: Schema, context: SchematicContext, taigaStyles: string[], filter?: (styles: JsonArray | undefined) => boolean, stylesToReplace?: {
5
+ from: string;
6
+ to: string[];
7
+ }, tree?: Tree): Rule;
@@ -4,14 +4,42 @@ exports.addStylesToAngularJson = void 0;
4
4
  const get_project_1 = require("./get-project");
5
5
  const get_project_target_options_1 = require("./get-project-target-options");
6
6
  const workspace_1 = require("@schematics/angular/utility/workspace");
7
- function addStylesToAngularJson(options, taigaStyles) {
7
+ const ng_morph_1 = require("ng-morph");
8
+ const versions_1 = require("../ng-add/constants/versions");
9
+ const tasks_1 = require("@angular-devkit/schematics/tasks");
10
+ function addStylesToAngularJson(options, context, taigaStyles, filter, stylesToReplace, tree) {
8
11
  return workspace_1.updateWorkspace(workspace => {
9
12
  const project = get_project_1.getProject(options, workspace);
13
+ if (!project) {
14
+ context.logger.warn(`[WARNING]: Target project not found. Add styles ${taigaStyles.join(',')} to angular.json manually.`);
15
+ return;
16
+ }
10
17
  const targetOptions = get_project_target_options_1.getProjectTargetOptions(project, 'build');
11
18
  const styles = targetOptions.styles;
12
- targetOptions.styles = styles
13
- ? Array.from(new Set([...taigaStyles, ...styles]))
14
- : taigaStyles;
19
+ if (filter && filter(styles)) {
20
+ return;
21
+ }
22
+ if (!styles) {
23
+ targetOptions.styles = taigaStyles;
24
+ return;
25
+ }
26
+ if (tree &&
27
+ stylesToReplace &&
28
+ styles.find(style => style === stylesToReplace.from)) {
29
+ targetOptions.styles = Array.from(new Set([
30
+ ...taigaStyles,
31
+ ...stylesToReplace.to,
32
+ ...styles.filter(style => style !== stylesToReplace.from),
33
+ ]));
34
+ ng_morph_1.addPackageJsonDependency(tree, {
35
+ name: `@taiga-ui/styles`,
36
+ version: versions_1.TAIGA_VERSION,
37
+ });
38
+ context.addTask(new tasks_1.NodePackageInstallTask());
39
+ }
40
+ else {
41
+ targetOptions.styles = Array.from(new Set([...taigaStyles, ...styles]));
42
+ }
15
43
  });
16
44
  }
17
45
  exports.addStylesToAngularJson = addStylesToAngularJson;
@@ -1,3 +1,2 @@
1
- import { ClassDeclaration, Pattern, Query } from 'ng-morph';
2
- import { StructureType } from 'ng-morph/utils/types/structure-type';
1
+ import { ClassDeclaration, Pattern, Query, StructureType } from 'ng-morph';
3
2
  export declare function getNgComponents(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];