@taiga-ui/cdk 4.0.0-rc.1 → 4.0.0-rc.10

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 (316) hide show
  1. package/classes/control.d.ts +1 -1
  2. package/classes/index.d.ts +0 -1
  3. package/constants/used-icons.d.ts +1 -1
  4. package/constants/version.d.ts +1 -1
  5. package/constants/version.js +1 -1
  6. package/directives/auto-focus/autofocus.options.d.ts +1 -1
  7. package/directives/for/for.directive.d.ts +3 -3
  8. package/directives/platform/platform.directive.d.ts +1 -1
  9. package/directives/value-changes/value-changes.directive.d.ts +3 -3
  10. package/esm2022/classes/control.mjs +2 -2
  11. package/esm2022/classes/index.mjs +1 -2
  12. package/esm2022/constants/used-icons.mjs +14 -6
  13. package/esm2022/constants/version.mjs +2 -2
  14. package/esm2022/directives/active-zone/active-zone.directive.mjs +2 -2
  15. package/esm2022/directives/auto-focus/autofocus.options.mjs +3 -3
  16. package/esm2022/directives/auto-focus/handlers/ios.handler.mjs +3 -3
  17. package/esm2022/directives/click-outside/click-outside.directive.mjs +2 -2
  18. package/esm2022/directives/copy-processor/copy-processor.directive.mjs +3 -3
  19. package/esm2022/directives/droppable/droppable.directive.mjs +3 -3
  20. package/esm2022/directives/for/for.directive.mjs +6 -6
  21. package/esm2022/directives/high-dpi/high-dpi.directive.mjs +3 -3
  22. package/esm2022/directives/hovered/hovered.service.mjs +2 -2
  23. package/esm2022/directives/obscured/obscured.directive.mjs +2 -2
  24. package/esm2022/directives/obscured/obscured.service.mjs +4 -4
  25. package/esm2022/directives/pan/pan.service.mjs +2 -2
  26. package/esm2022/directives/platform/platform.directive.mjs +6 -6
  27. package/esm2022/directives/swipe/swipe.service.mjs +2 -2
  28. package/esm2022/directives/value-changes/value-changes.directive.mjs +6 -6
  29. package/esm2022/directives/zoom/zoom.service.mjs +4 -4
  30. package/esm2022/observables/control-value.mjs +2 -2
  31. package/esm2022/observables/drag-and-drop-from.mjs +2 -2
  32. package/esm2022/observables/events.mjs +3 -3
  33. package/esm2022/observables/if-map.mjs +2 -2
  34. package/esm2022/observables/must-be-present.mjs +2 -2
  35. package/esm2022/observables/zone.mjs +4 -4
  36. package/esm2022/pipes/filter/filter.pipe.mjs +2 -2
  37. package/esm2022/services/index.mjs +2 -2
  38. package/esm2022/services/popover.service.mjs +3 -3
  39. package/esm2022/services/scroll.service.mjs +5 -5
  40. package/esm2022/services/theme-color.service.mjs +30 -0
  41. package/esm2022/tokens/active-element.mjs +5 -5
  42. package/esm2022/tokens/environment.mjs +15 -7
  43. package/esm2022/tokens/removed-element.mjs +4 -4
  44. package/esm2022/tokens/window-size.mjs +3 -3
  45. package/esm2022/utils/color/get-gradient-data.mjs +6 -0
  46. package/esm2022/utils/color/hex-to-rgb.mjs +2 -2
  47. package/esm2022/utils/color/index.mjs +3 -1
  48. package/esm2022/utils/color/parse-color.mjs +3 -3
  49. package/esm2022/utils/color/parse-gradient.mjs +70 -0
  50. package/esm2022/utils/color/rgb-to-hex.mjs +2 -2
  51. package/esm2022/utils/dom/get-element-obscurers.mjs +2 -2
  52. package/esm2022/utils/dom/get-element-point.mjs +6 -0
  53. package/esm2022/utils/dom/index.mjs +2 -1
  54. package/esm2022/utils/focus/focused-in.mjs +7 -0
  55. package/esm2022/utils/focus/index.mjs +2 -1
  56. package/esm2022/utils/miscellaneous/mark-control-as-touched-and-validate.mjs +3 -3
  57. package/esm2022/utils/miscellaneous/with-styles.mjs +2 -2
  58. package/fesm2022/taiga-ui-cdk-classes.mjs +2 -16
  59. package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
  60. package/fesm2022/taiga-ui-cdk-constants.mjs +14 -6
  61. package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
  62. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +1 -1
  63. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
  64. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +4 -4
  65. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
  66. package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +1 -1
  67. package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +1 -1
  68. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs +2 -2
  69. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs.map +1 -1
  70. package/fesm2022/taiga-ui-cdk-directives-droppable.mjs +2 -2
  71. package/fesm2022/taiga-ui-cdk-directives-droppable.mjs.map +1 -1
  72. package/fesm2022/taiga-ui-cdk-directives-for.mjs +5 -5
  73. package/fesm2022/taiga-ui-cdk-directives-for.mjs.map +1 -1
  74. package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs +2 -2
  75. package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs.map +1 -1
  76. package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +1 -1
  77. package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
  78. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +4 -4
  79. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
  80. package/fesm2022/taiga-ui-cdk-directives-pan.mjs +1 -1
  81. package/fesm2022/taiga-ui-cdk-directives-pan.mjs.map +1 -1
  82. package/fesm2022/taiga-ui-cdk-directives-platform.mjs +5 -5
  83. package/fesm2022/taiga-ui-cdk-directives-platform.mjs.map +1 -1
  84. package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +1 -1
  85. package/fesm2022/taiga-ui-cdk-directives-swipe.mjs.map +1 -1
  86. package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +5 -5
  87. package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs.map +1 -1
  88. package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +3 -3
  89. package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
  90. package/fesm2022/taiga-ui-cdk-observables.mjs +9 -9
  91. package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
  92. package/fesm2022/taiga-ui-cdk-pipes-filter.mjs +1 -1
  93. package/fesm2022/taiga-ui-cdk-pipes-filter.mjs.map +1 -1
  94. package/fesm2022/taiga-ui-cdk-services.mjs +25 -28
  95. package/fesm2022/taiga-ui-cdk-services.mjs.map +1 -1
  96. package/fesm2022/taiga-ui-cdk-tokens.mjs +22 -15
  97. package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
  98. package/fesm2022/taiga-ui-cdk-utils-color.mjs +80 -5
  99. package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +1 -1
  100. package/fesm2022/taiga-ui-cdk-utils-dom.mjs +7 -2
  101. package/fesm2022/taiga-ui-cdk-utils-dom.mjs.map +1 -1
  102. package/fesm2022/taiga-ui-cdk-utils-focus.mjs +8 -2
  103. package/fesm2022/taiga-ui-cdk-utils-focus.mjs.map +1 -1
  104. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +3 -3
  105. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
  106. package/package.json +7 -8
  107. package/schematics/migration.json +3 -3
  108. package/schematics/ng-add/constants/modules.d.ts +0 -1
  109. package/schematics/ng-add/constants/modules.js +1 -11
  110. package/schematics/ng-add/constants/versions.d.ts +0 -1
  111. package/schematics/ng-add/constants/versions.js +1 -2
  112. package/schematics/ng-add/index.js +1 -7
  113. package/schematics/ng-add/schema.d.ts +0 -1
  114. package/schematics/ng-add/schema.json +0 -27
  115. package/schematics/ng-add/steps/add-taiga-icons.js +1 -1
  116. package/schematics/ng-add/steps/add-taiga-modules.js +7 -22
  117. package/schematics/ng-update/interfaces/html-comment.d.ts +3 -2
  118. package/schematics/ng-update/interfaces/replacement-attribute-value.d.ts +6 -2
  119. package/schematics/ng-update/interfaces/replacement-identifier.d.ts +4 -10
  120. package/schematics/ng-update/interfaces/replacement-type.d.ts +5 -0
  121. package/schematics/ng-update/steps/icons/replace-imports.js +5 -5
  122. package/schematics/ng-update/steps/index.d.ts +1 -0
  123. package/schematics/ng-update/steps/index.js +1 -0
  124. package/schematics/ng-update/steps/remove-module.js +2 -2
  125. package/schematics/ng-update/steps/rename-types.js +11 -7
  126. package/schematics/ng-update/steps/replace-deep-import.js +2 -2
  127. package/schematics/ng-update/steps/replace-enums.js +2 -2
  128. package/schematics/ng-update/steps/replace-identifier.js +31 -9
  129. package/schematics/ng-update/steps/replace-package-name.d.ts +5 -0
  130. package/schematics/ng-update/steps/replace-package-name.js +18 -0
  131. package/schematics/ng-update/steps/replace-services.js +5 -5
  132. package/schematics/ng-update/steps/show-warnings.js +4 -4
  133. package/schematics/ng-update/utils/replace-text.js +1 -1
  134. package/schematics/ng-update/utils/templates/replace-attr-values.js +41 -12
  135. package/schematics/ng-update/utils/templates/replace-attrs.js +1 -1
  136. package/schematics/ng-update/utils/templates/template-comments.js +11 -3
  137. package/schematics/ng-update/v4/index.js +20 -7
  138. package/schematics/ng-update/v4/migrate-css-vars/palette.d.ts +11 -2
  139. package/schematics/ng-update/v4/migrate-css-vars/palette.js +18 -8
  140. package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +10 -2
  141. package/schematics/ng-update/v4/migrate-icons/index.js +9 -7
  142. package/schematics/ng-update/v4/migrate-icons/rename-icons.js +15 -7
  143. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.d.ts +3 -0
  144. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.js +79 -0
  145. package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +5 -4
  146. package/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.js +51 -2
  147. package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +114 -27
  148. package/schematics/ng-update/v4/steps/constants/enums.js +31 -0
  149. package/schematics/ng-update/v4/steps/constants/html-comments.js +19 -0
  150. package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +1388 -288
  151. package/schematics/ng-update/v4/steps/constants/index.d.ts +1 -0
  152. package/schematics/ng-update/v4/steps/constants/index.js +1 -0
  153. package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +2 -1
  154. package/schematics/ng-update/v4/steps/constants/migration-warnings.js +25 -0
  155. package/schematics/ng-update/v4/steps/constants/modules-to-remove.js +32 -0
  156. package/schematics/ng-update/v4/steps/constants/modules-to-replace.d.ts +13 -0
  157. package/schematics/ng-update/v4/steps/constants/modules-to-replace.js +16 -0
  158. package/schematics/ng-update/v4/steps/constants/services.d.ts +2 -0
  159. package/schematics/ng-update/v4/steps/constants/services.js +15 -0
  160. package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +17 -4
  161. package/schematics/ng-update/v4/steps/constants/types.d.ts +2 -0
  162. package/schematics/ng-update/v4/steps/constants/types.js +49 -0
  163. package/schematics/ng-update/v4/steps/index.d.ts +7 -0
  164. package/schematics/ng-update/v4/steps/index.js +7 -0
  165. package/schematics/ng-update/v4/steps/migrate-alert-service.d.ts +2 -0
  166. package/schematics/ng-update/v4/steps/migrate-alert-service.js +110 -0
  167. package/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.js +1 -1
  168. package/schematics/ng-update/v4/steps/migrate-destroy-service.js +7 -4
  169. package/schematics/ng-update/v4/steps/migrate-legacy-mask.js +2 -2
  170. package/schematics/ng-update/v4/steps/migrate-month-context.d.ts +2 -0
  171. package/schematics/ng-update/v4/steps/migrate-month-context.js +39 -0
  172. package/schematics/ng-update/v4/steps/migrate-number-format-settings.d.ts +2 -0
  173. package/schematics/ng-update/v4/steps/migrate-number-format-settings.js +64 -0
  174. package/schematics/ng-update/v4/steps/migrate-option-providers.js +6 -3
  175. package/schematics/ng-update/v4/steps/migrate-proprietary.js +3 -3
  176. package/schematics/ng-update/v4/steps/migrate-root.d.ts +3 -0
  177. package/schematics/ng-update/v4/steps/migrate-root.js +61 -0
  178. package/schematics/ng-update/v4/steps/migrate-templates.js +11 -1
  179. package/schematics/ng-update/v4/steps/styles/index.js +38 -0
  180. package/schematics/ng-update/v4/steps/styles/migrate-less-scss-constants.d.ts +1 -0
  181. package/schematics/ng-update/v4/steps/styles/migrate-less-scss-constants.js +13 -0
  182. package/schematics/ng-update/v4/steps/styles/migrate-scrollbar-behavior.d.ts +1 -0
  183. package/schematics/ng-update/v4/steps/styles/migrate-scrollbar-behavior.js +10 -0
  184. package/schematics/ng-update/v4/steps/styles/migrate-shadow-mixins.d.ts +1 -0
  185. package/schematics/ng-update/v4/steps/styles/migrate-shadow-mixins.js +23 -0
  186. package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.d.ts +1 -0
  187. package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js +20 -0
  188. package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.d.ts +1 -0
  189. package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.js +54 -0
  190. package/schematics/ng-update/v4/steps/templates/index.d.ts +6 -0
  191. package/schematics/ng-update/v4/steps/templates/index.js +6 -0
  192. package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +34 -11
  193. package/schematics/ng-update/{v3/steps/migrate-polymorpheus.d.ts → v4/steps/templates/migrate-axes.d.ts} +2 -2
  194. package/schematics/ng-update/v4/steps/templates/migrate-axes.js +26 -0
  195. package/schematics/ng-update/v4/steps/templates/migrate-badge.js +17 -8
  196. package/schematics/ng-update/v4/steps/templates/migrate-badged-content.js +1 -1
  197. package/schematics/ng-update/{v3/steps/migrate-textfield-controller.d.ts → v4/steps/templates/migrate-blocked.d.ts} +2 -2
  198. package/schematics/ng-update/v4/steps/templates/migrate-blocked.js +35 -0
  199. package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.d.ts +8 -0
  200. package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.js +41 -0
  201. package/schematics/ng-update/v4/steps/templates/migrate-expandable.js +3 -2
  202. package/schematics/ng-update/v4/steps/templates/migrate-focusable.js +7 -4
  203. package/schematics/ng-update/v4/steps/templates/migrate-label.d.ts +8 -0
  204. package/schematics/ng-update/v4/steps/templates/migrate-label.js +39 -0
  205. package/schematics/ng-update/v4/steps/templates/migrate-labeled.js +6 -10
  206. package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.d.ts +8 -0
  207. package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.js +45 -0
  208. package/schematics/ng-update/v4/steps/templates/migrate-money.js +1 -1
  209. package/schematics/ng-update/v4/steps/templates/migrate-notification.d.ts +8 -0
  210. package/schematics/ng-update/v4/steps/templates/migrate-notification.js +64 -0
  211. package/schematics/ng-update/v4/steps/templates/migrate-number-precision.d.ts +8 -0
  212. package/schematics/ng-update/v4/steps/templates/migrate-number-precision.js +36 -0
  213. package/schematics/ng-update/v4/steps/templates/migrate-overscroll.d.ts +8 -0
  214. package/schematics/ng-update/v4/steps/templates/migrate-overscroll.js +27 -0
  215. package/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.js +2 -1
  216. package/schematics/ng-update/v4/steps/templates/toggles/common.d.ts +1 -1
  217. package/schematics/ng-update/v4/steps/templates/toggles/common.js +4 -3
  218. package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js +36 -0
  219. package/schematics/ng-update/{v3/steps/migrate-templates.d.ts → v4/steps/update-packages.d.ts} +1 -1
  220. package/schematics/ng-update/v4/steps/update-packages.js +44 -0
  221. package/schematics/ng-update/v4/steps/utils/remove-attrs.js +1 -1
  222. package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.d.ts +3 -0
  223. package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.js +51 -0
  224. package/schematics/ng-update/v4/steps/utils/replace-substrings.js +1 -1
  225. package/schematics/ng-update/v4/tests/migrate-destroy-service/utils.js +1 -0
  226. package/schematics/utils/add-unique-import.js +1 -1
  227. package/schematics/utils/angular-json-manipulations.js +4 -4
  228. package/schematics/utils/get-named-import-references.js +8 -6
  229. package/schematics/utils/get-standalone-bootstrap-function.js +2 -2
  230. package/schematics/utils/import-manipulations.js +1 -1
  231. package/schematics/utils/push-to-array-property.js +1 -1
  232. package/schematics/utils/templates/elements.d.ts +5 -0
  233. package/schematics/utils/templates/elements.js +27 -13
  234. package/schematics/utils/templates/get-component-templates.js +1 -1
  235. package/schematics/utils/templates/inputs.js +2 -1
  236. package/schematics/utils/templates/ng-component-input-manipulations.js +5 -5
  237. package/services/index.d.ts +1 -1
  238. package/services/theme-color.service.d.ts +16 -0
  239. package/tokens/environment.d.ts +1 -0
  240. package/utils/color/get-gradient-data.d.ts +1 -0
  241. package/utils/color/index.d.ts +2 -0
  242. package/utils/color/parse-gradient.d.ts +10 -0
  243. package/utils/dom/get-element-point.d.ts +2 -0
  244. package/utils/dom/index.d.ts +1 -0
  245. package/utils/focus/focused-in.d.ts +2 -0
  246. package/utils/focus/index.d.ts +1 -0
  247. package/classes/controller.d.ts +0 -9
  248. package/esm2022/classes/controller.mjs +0 -18
  249. package/esm2022/services/static-request.service.mjs +0 -33
  250. package/schematics/ng-update/v3/constants/breakpoints.d.ts +0 -82
  251. package/schematics/ng-update/v3/constants/breakpoints.js +0 -34
  252. package/schematics/ng-update/v3/constants/constants.d.ts +0 -2
  253. package/schematics/ng-update/v3/constants/constants.js +0 -466
  254. package/schematics/ng-update/v3/constants/deprecated-functions.d.ts +0 -2
  255. package/schematics/ng-update/v3/constants/deprecated-functions.js +0 -680
  256. package/schematics/ng-update/v3/constants/enums.d.ts +0 -2
  257. package/schematics/ng-update/v3/constants/enums.js +0 -284
  258. package/schematics/ng-update/v3/constants/modules.d.ts +0 -2
  259. package/schematics/ng-update/v3/constants/modules.js +0 -9
  260. package/schematics/ng-update/v3/constants/services.d.ts +0 -2
  261. package/schematics/ng-update/v3/constants/services.js +0 -53
  262. package/schematics/ng-update/v3/constants/templates.d.ts +0 -57
  263. package/schematics/ng-update/v3/constants/templates.js +0 -744
  264. package/schematics/ng-update/v3/constants/tui-interactive-selectors.d.ts +0 -1
  265. package/schematics/ng-update/v3/constants/tui-interactive-selectors.js +0 -55
  266. package/schematics/ng-update/v3/constants/types.d.ts +0 -2
  267. package/schematics/ng-update/v3/constants/types.js +0 -156
  268. package/schematics/ng-update/v3/constants/warnings.d.ts +0 -2
  269. package/schematics/ng-update/v3/constants/warnings.js +0 -111
  270. package/schematics/ng-update/v3/index.d.ts +0 -3
  271. package/schematics/ng-update/v3/index.js +0 -105
  272. package/schematics/ng-update/v3/schema.json +0 -13
  273. package/schematics/ng-update/v3/steps/migrate-date-time.d.ts +0 -2
  274. package/schematics/ng-update/v3/steps/migrate-date-time.js +0 -207
  275. package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +0 -78
  276. package/schematics/ng-update/v3/steps/migrate-progress.d.ts +0 -8
  277. package/schematics/ng-update/v3/steps/migrate-progress.js +0 -49
  278. package/schematics/ng-update/v3/steps/migrate-sliders/index.d.ts +0 -3
  279. package/schematics/ng-update/v3/steps/migrate-sliders/index.js +0 -19
  280. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.d.ts +0 -3
  281. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +0 -103
  282. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.d.ts +0 -3
  283. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +0 -90
  284. package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.d.ts +0 -3
  285. package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.js +0 -70
  286. package/schematics/ng-update/v3/steps/migrate-templates.js +0 -216
  287. package/schematics/ng-update/v3/steps/migrate-textfield-controller.js +0 -98
  288. package/schematics/ng-update/v3/steps/miscellaneous.d.ts +0 -2
  289. package/schematics/ng-update/v3/steps/miscellaneous.js +0 -81
  290. package/schematics/ng-update/v3/steps/replace-functions.d.ts +0 -2
  291. package/schematics/ng-update/v3/steps/replace-functions.js +0 -138
  292. package/schematics/ng-update/v3/steps/replace-styles.d.ts +0 -3
  293. package/schematics/ng-update/v3/steps/replace-styles.js +0 -33
  294. package/schematics/ng-update/v3-30/constants/constants.d.ts +0 -2
  295. package/schematics/ng-update/v3-30/constants/constants.js +0 -8
  296. package/schematics/ng-update/v3-30/constants/icons.d.ts +0 -4
  297. package/schematics/ng-update/v3-30/constants/icons.js +0 -993
  298. package/schematics/ng-update/v3-30/index.d.ts +0 -3
  299. package/schematics/ng-update/v3-30/index.js +0 -33
  300. package/schematics/ng-update/v3-35/constants/constants.d.ts +0 -2
  301. package/schematics/ng-update/v3-35/constants/constants.js +0 -8
  302. package/schematics/ng-update/v3-35/constants/icons.d.ts +0 -4
  303. package/schematics/ng-update/v3-35/constants/icons.js +0 -2537
  304. package/schematics/ng-update/v3-35/index.d.ts +0 -3
  305. package/schematics/ng-update/v3-35/index.js +0 -33
  306. package/schematics/ng-update/v3-36/index.d.ts +0 -3
  307. package/schematics/ng-update/v3-36/index.js +0 -33
  308. package/schematics/ng-update/v3-40/index.d.ts +0 -3
  309. package/schematics/ng-update/v3-40/index.js +0 -62
  310. package/schematics/ng-update/v3-5/index.d.ts +0 -3
  311. package/schematics/ng-update/v3-5/index.js +0 -20
  312. package/schematics/ng-update/v3-5/steps/migrate-expand-templates.d.ts +0 -3
  313. package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +0 -44
  314. package/schematics/ng-update/v4/steps/migrate-styles.js +0 -20
  315. package/services/static-request.service.d.ts +0 -8
  316. /package/schematics/ng-update/v4/steps/{migrate-styles.d.ts → styles/index.d.ts} +0 -0
@@ -1 +0,0 @@
1
- export declare const TUI_INTERACTIVE_SELECTORS: string[];
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TUI_INTERACTIVE_SELECTORS = void 0;
4
- exports.TUI_INTERACTIVE_SELECTORS = [
5
- 'tui-primitive-textfield',
6
- 'tui-spin-button',
7
- 'tui-action',
8
- 'tui-input-range',
9
- 'tui-pagination',
10
- 'tui-accordion-item',
11
- 'tui-button',
12
- 'tuiButton',
13
- 'tuiIconButton',
14
- 'tui-toggle',
15
- 'tuiSlider',
16
- 'tui-slider',
17
- 'tui-rating',
18
- 'tui-input-card',
19
- 'tui-input-cvc',
20
- 'tui-input-expire',
21
- 'tui-editor',
22
- 'tui-input-color',
23
- 'tui-input-copy',
24
- 'tui-input-count',
25
- 'tui-input-date-time',
26
- 'tui-input-inline',
27
- 'tui-input-password',
28
- 'tui-input-phone-international',
29
- 'tui-input-phone',
30
- 'tui-input-range',
31
- 'tui-input-slider',
32
- 'tui-input',
33
- 'tui-range',
34
- 'tui-text-area',
35
- 'tui-radio-block',
36
- 'tui-radio-labeled',
37
- 'tui-radio-list',
38
- 'tui-radio',
39
- 'tui-select',
40
- 'tui-input-card-grouped',
41
- 'tui-checkbox-block',
42
- 'tui-checkbox-labeled',
43
- 'tui-combo-box',
44
- 'tui-input-date-range',
45
- 'tui-input-file',
46
- 'tui-input-files',
47
- 'tui-input-month-range',
48
- 'tui-input-month',
49
- 'tui-input-number',
50
- 'tui-input-time',
51
- 'tui-input-time',
52
- 'tui-multi-select',
53
- 'tui-filter',
54
- 'tui-input-tag',
55
- ];
@@ -1,2 +0,0 @@
1
- import type { ReplacementType } from '../../interfaces/replacement-type';
2
- export declare const TYPES_TO_RENAME: readonly ReplacementType[];
@@ -1,156 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TYPES_TO_RENAME = void 0;
4
- exports.TYPES_TO_RENAME = [
5
- {
6
- from: 'ButtonOptions',
7
- to: 'TuiButtonOptions',
8
- moduleSpecifier: ['@taiga-ui/core'],
9
- },
10
- {
11
- from: 'InputCountOptions',
12
- to: 'TuiInputCountOptions',
13
- moduleSpecifier: ['@taiga-ui/kit'],
14
- },
15
- {
16
- from: 'InputPasswordOptions',
17
- to: 'TuiInputPasswordOptions',
18
- moduleSpecifier: ['@taiga-ui/kit'],
19
- },
20
- {
21
- from: 'InputTimeOptions',
22
- to: 'TuiInputTimeOptions',
23
- moduleSpecifier: ['@taiga-ui/kit'],
24
- },
25
- {
26
- from: 'ToggleOptions',
27
- to: 'TuiToggleOptions',
28
- moduleSpecifier: ['@taiga-ui/cdk'],
29
- },
30
- {
31
- from: 'RadioOptions',
32
- to: 'TuiRadioOptions',
33
- moduleSpecifier: ['@taiga-ui/kit'],
34
- },
35
- {
36
- from: 'CodeEditor',
37
- to: 'TuiCodeEditor',
38
- moduleSpecifier: ['@taiga-ui/addon-doc'],
39
- },
40
- {
41
- from: 'WithDateMaskPipeConfig',
42
- },
43
- {
44
- from: 'TuiBreadCrumbsItem',
45
- },
46
- {
47
- from: 'CheckboxOptions',
48
- to: 'TuiCheckboxOptions',
49
- moduleSpecifier: ['@taiga-ui/core'],
50
- },
51
- {
52
- from: 'NotificationTokenOptions',
53
- to: 'TuiNotificationDefaultOptions',
54
- moduleSpecifier: ['@taiga-ui/core'],
55
- },
56
- {
57
- from: 'TuiNotificationAutoClose',
58
- to: 'TuiAlertAutoClose',
59
- moduleSpecifier: ['@taiga-ui/core'],
60
- },
61
- {
62
- from: 'TuiNotificationOptions',
63
- to: 'TuiAlertOptions<any>',
64
- moduleSpecifier: ['@taiga-ui/core'],
65
- },
66
- {
67
- from: 'TuiNotificationOptionsWithData',
68
- to: 'TuiAlertOptions',
69
- moduleSpecifier: ['@taiga-ui/core'],
70
- preserveGenerics: true,
71
- },
72
- {
73
- from: 'Country',
74
- moduleSpecifier: ['@taiga-ui/kit'],
75
- },
76
- {
77
- from: 'NumberFormatSettings',
78
- to: 'TuiNumberFormatSettings',
79
- moduleSpecifier: ['@taiga-ui/core'],
80
- },
81
- {
82
- from: 'LanguageCore',
83
- to: 'TuiLanguageCore',
84
- moduleSpecifier: ['@taiga-ui/i18n'],
85
- },
86
- {
87
- from: 'LanguageKit',
88
- to: 'TuiLanguageKit',
89
- moduleSpecifier: ['@taiga-ui/i18n'],
90
- },
91
- {
92
- from: 'LanguageKit',
93
- to: 'TuiLanguageKit',
94
- moduleSpecifier: ['@taiga-ui/i18n'],
95
- },
96
- {
97
- from: 'LanguageCommerce',
98
- to: 'TuiLanguageCommerce',
99
- moduleSpecifier: ['@taiga-ui/i18n'],
100
- },
101
- {
102
- from: 'LanguageTable',
103
- to: 'TuiLanguageTable',
104
- moduleSpecifier: ['@taiga-ui/i18n'],
105
- },
106
- {
107
- from: 'LanguageTable',
108
- to: 'TuiLanguageTable',
109
- moduleSpecifier: ['@taiga-ui/i18n'],
110
- },
111
- {
112
- from: 'LanguageEditor',
113
- to: 'TuiLanguageEditor',
114
- moduleSpecifier: ['@taiga-ui/i18n'],
115
- },
116
- {
117
- from: 'LanguagePreview',
118
- to: 'TuiLanguagePreview',
119
- moduleSpecifier: ['@taiga-ui/i18n'],
120
- },
121
- {
122
- from: 'Language',
123
- to: 'TuiLanguage',
124
- moduleSpecifier: ['@taiga-ui/i18n'],
125
- },
126
- {
127
- from: 'ScrollIntoViewDirective',
128
- to: 'TuiScrollIntoViewLink',
129
- moduleSpecifier: ['@taiga-ui/addon-doc'],
130
- },
131
- {
132
- from: 'CodeComponent',
133
- to: 'TuiCodeComponent',
134
- moduleSpecifier: ['@taiga-ui/addon-doc'],
135
- },
136
- {
137
- from: 'TableBar',
138
- to: 'TuiTableBar',
139
- moduleSpecifier: ['@taiga-ui/addon-tablebars'],
140
- },
141
- {
142
- from: 'InvalidDayException',
143
- to: 'TuiInvalidDayException',
144
- moduleSpecifier: ['@taiga-ui/cdk'],
145
- },
146
- {
147
- from: 'InvalidMonthException',
148
- to: 'TuiInvalidMonthException',
149
- moduleSpecifier: ['@taiga-ui/cdk'],
150
- },
151
- {
152
- from: 'InvalidYearException',
153
- to: 'TuiInvalidYearException',
154
- moduleSpecifier: ['@taiga-ui/cdk'],
155
- },
156
- ];
@@ -1,2 +0,0 @@
1
- import type { MigrationWarning } from '../../interfaces/migration-warning';
2
- export declare const MIGRATION_WARNINGS: readonly MigrationWarning[];
@@ -1,111 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MIGRATION_WARNINGS = void 0;
4
- exports.MIGRATION_WARNINGS = [
5
- {
6
- name: 'TUI_MOBILE_AWARE',
7
- message: 'TUI_MOBILE_AWARE has been deleted in 3.0, please use TuiMobileTabsDirective from @taiga-ui/addon-mobile',
8
- },
9
- {
10
- name: 'TUI_DATE_FILLER',
11
- 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',
12
- },
13
- {
14
- name: 'TUI_DATE_RANGE_FILLER',
15
- 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',
16
- },
17
- {
18
- name: 'TUI_SHEET_OFFSET',
19
- 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',
20
- },
21
- {
22
- name: 'COUNTRIES',
23
- moduleSpecifier: '@taiga-ui/kit',
24
- 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',
25
- },
26
- {
27
- name: 'COUNTRIES_MASKS',
28
- moduleSpecifier: '@taiga-ui/kit',
29
- message: 'Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code',
30
- },
31
- {
32
- name: 'TuiTableModeModule',
33
- moduleSpecifier: '@taiga-ui/core',
34
- message: 'TuiTableModeModule has been deleted in 3.0, please use @taiga-ui/addon-table',
35
- },
36
- {
37
- name: 'TuiColorModule',
38
- moduleSpecifier: '@taiga-ui/core',
39
- message: 'TuiColorModule has been deleted in 3.0, please use CSS custom properties',
40
- },
41
- {
42
- name: 'TuiPluralizePipeModule',
43
- moduleSpecifier: '@taiga-ui/core',
44
- message: 'TuiPluralizePipeModule has been deleted in 3.0, please use Angular built-in pipe https://angular.io/api/common/I18nPluralPipe',
45
- },
46
- {
47
- name: 'TUI_DEFAULT_COLOR_HANDLER',
48
- moduleSpecifier: '@taiga-ui/addon-charts',
49
- message: 'TUI_DEFAULT_COLOR_HANDLER has been deleted in 3.0, please use CSS variables',
50
- },
51
- {
52
- name: 'TuiColorHandler',
53
- moduleSpecifier: '@taiga-ui/addon-charts',
54
- message: 'TuiColorHandler has been deleted in 3.0, please use CSS custom properties',
55
- },
56
- {
57
- name: 'DEFAULT_COLORS',
58
- moduleSpecifier: '@taiga-ui/addon-charts',
59
- message: 'DEFAULT_COLORS has been deleted in 3.0, please use CSS variables',
60
- },
61
- {
62
- name: 'AbstractTuiInteractive',
63
- moduleSpecifier: '@taiga-ui/core',
64
- message: 'pressedChange and hoveredChange outputs have been removed from AbstractTuiInteractive, please use tuiPressedChange and tuiHoveredChange directives instead',
65
- },
66
- {
67
- name: 'AbstractTuiControl',
68
- moduleSpecifier: '@taiga-ui/core',
69
- message: 'pressedChange and hoveredChange outputs have been removed from AbstractTuiInteractive, please use tuiPressedChange and tuiHoveredChange directives instead',
70
- },
71
- {
72
- name: 'AbstractTuiMultipleControl',
73
- moduleSpecifier: '@taiga-ui/core',
74
- message: 'pressedChange and hoveredChange outputs have been removed from AbstractTuiInteractive, please use tuiPressedChange and tuiHoveredChange directives instead',
75
- },
76
- {
77
- name: 'AbstractTuiNullableControl',
78
- moduleSpecifier: '@taiga-ui/core',
79
- message: 'pressedChange and hoveredChange outputs have been removed from AbstractTuiInteractive, please use tuiPressedChange and tuiHoveredChange directives instead',
80
- },
81
- {
82
- name: 'MEDIA',
83
- moduleSpecifier: '@taiga-ui/core',
84
- message: 'MEDIA constant has been deleted in 3.0. Please use TUI_MEDIA token from @taiga-ui/core',
85
- },
86
- {
87
- name: 'colorFallback',
88
- moduleSpecifier: '@taiga-ui/core',
89
- message: 'colorFallback has been deleted in 3.0, please use CSS variables',
90
- },
91
- {
92
- name: 'TuiInputSearchModule',
93
- moduleSpecifier: '@taiga-ui/proprietary-core',
94
- message: 'Use MultiSelect (@taiga-ui/kit) with icon "tuiIconSearch": https://taiga-ui.dev/components/multi-select/API?tuiTextfieldIconLeft=tuiIconSearchLarge',
95
- },
96
- {
97
- name: 'TuiCarouselModule',
98
- moduleSpecifier: '@taiga-ui/proprietary-core',
99
- message: 'Proprietary Carousel is outdated and has different API. Use new version of the same module from @taiga-ui/kit. Also, check new API: https://taiga-ui.dev/components/carousel/API',
100
- },
101
- {
102
- name: 'TUI_EDITOR_STYLES',
103
- moduleSpecifier: '@taiga-ui/addon-editor',
104
- message: 'TUI_EDITOR_STYLES token has been deleted in 3.0, please use global styles to override default editor styles',
105
- },
106
- {
107
- name: 'TuiNotificationContentContext',
108
- moduleSpecifier: '@taiga-ui/core',
109
- message: 'TuiNotificationContentContext has been deleted in 3.0. Please, use TuiDialog<TuiAlertOptions<I>, O> instead of TuiNotificationContentContext<O, I>',
110
- },
111
- ];
@@ -1,3 +0,0 @@
1
- import type { Rule } from '@angular-devkit/schematics';
2
- import type { TuiSchema } from '../../ng-add/schema';
3
- export declare function updateToV3(options: TuiSchema): Rule;
@@ -1,105 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateToV3 = void 0;
4
- const tslib_1 = require("tslib");
5
- const node_perf_hooks_1 = require("node:perf_hooks");
6
- const schematics_1 = require("@angular-devkit/schematics");
7
- const ng_morph_1 = require("ng-morph");
8
- const taiga_styles_1 = require("../../constants/taiga-styles");
9
- const versions_1 = require("../../ng-add/constants/versions");
10
- const angular_json_manipulations_1 = require("../../utils/angular-json-manipulations");
11
- const colored_log_1 = require("../../utils/colored-log");
12
- const get_execution_time_1 = require("../../utils/get-execution-time");
13
- const remove_module_1 = require("../steps/remove-module");
14
- const rename_types_1 = require("../steps/rename-types");
15
- const replace_deep_import_1 = require("../steps/replace-deep-import");
16
- const replace_enums_1 = require("../steps/replace-enums");
17
- const replace_identifier_1 = require("../steps/replace-identifier");
18
- const replace_services_1 = require("../steps/replace-services");
19
- const show_warnings_1 = require("../steps/show-warnings");
20
- const get_file_system_1 = require("../utils/get-file-system");
21
- const constants_1 = require("./constants/constants");
22
- const enums_1 = require("./constants/enums");
23
- const modules_1 = require("./constants/modules");
24
- const services_1 = require("./constants/services");
25
- const types_1 = require("./constants/types");
26
- const warnings_1 = require("./constants/warnings");
27
- const migrate_date_time_1 = require("./steps/migrate-date-time");
28
- const migrate_progress_1 = require("./steps/migrate-progress");
29
- const migrate_sliders_1 = require("./steps/migrate-sliders");
30
- const migrate_taiga_proprietary_icons_1 = require("./steps/migrate-taiga-proprietary-icons");
31
- const migrate_templates_1 = require("./steps/migrate-templates");
32
- const miscellaneous_1 = require("./steps/miscellaneous");
33
- const replace_functions_1 = require("./steps/replace-functions");
34
- const replace_styles_1 = require("./steps/replace-styles");
35
- // TODO: drop in v4.x
36
- function main(options) {
37
- return (tree, context) => {
38
- const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
39
- (0, replace_deep_import_1.replaceDeepImports)(options);
40
- (0, replace_enums_1.replaceEnums)(options, enums_1.ENUMS_TO_REPLACE);
41
- (0, rename_types_1.renameTypes)(options, types_1.TYPES_TO_RENAME);
42
- (0, replace_identifier_1.replaceIdentifiers)(options, constants_1.CONSTANTS_TO_REPLACE);
43
- (0, replace_services_1.replaceServices)(options, services_1.SERVICES_TO_REPLACE);
44
- (0, replace_styles_1.replaceStyles)();
45
- (0, show_warnings_1.showWarnings)(context, warnings_1.MIGRATION_WARNINGS);
46
- (0, migrate_templates_1.migrateTemplates)(fileSystem, options);
47
- fileSystem.commitEdits();
48
- (0, ng_morph_1.saveActiveProject)();
49
- const updatedFileSystem = (0, get_file_system_1.getFileSystem)(tree);
50
- (0, migrate_sliders_1.migrateSliders)(updatedFileSystem, options);
51
- (0, migrate_progress_1.migrateProgress)(updatedFileSystem, options);
52
- (0, remove_module_1.removeModules)(options, modules_1.REMOVED_MODULES);
53
- (0, migrate_date_time_1.dateTimeMigrations)(options);
54
- (0, replace_functions_1.replaceFunctions)(options);
55
- (0, miscellaneous_1.miscellaneousMigrations)(options);
56
- (0, ng_morph_1.saveActiveProject)();
57
- };
58
- }
59
- function addTaigaStyles(options) {
60
- return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
61
- const proprietary = (0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/proprietary-core');
62
- const taigaStyles = proprietary ? [] : [taiga_styles_1.TAIGA_THEME_FONTS];
63
- const stylesToReplace = {
64
- from: taiga_styles_1.TAIGA_GLOBAL_OLD_STYLE,
65
- to: [taiga_styles_1.TAIGA_GLOBAL_NEW_STYLE],
66
- };
67
- if (yield (0, angular_json_manipulations_1.isInvalidAngularJson)(tree)) {
68
- context.logger.warn("[WARNING]: Schematics don't support this version of angular.json.\n" +
69
- `– Add styles ${taigaStyles.join(',')} to angular.json manually.\n` +
70
- `– Manually replace "${taiga_styles_1.TAIGA_GLOBAL_OLD_STYLE}" with "${taiga_styles_1.TAIGA_GLOBAL_NEW_STYLE}" inside "styles" of angular.json (don't forget to install "@taiga-ui/styles")`);
71
- return;
72
- }
73
- return (0, angular_json_manipulations_1.addStylesToAngularJson)(options, context, taigaStyles, existingStyles => !!(existingStyles === null || existingStyles === void 0 ? void 0 : existingStyles.some(style => typeof style === 'string' && style.includes('tinkoff-theme'))), stylesToReplace, tree);
74
- });
75
- }
76
- function showNormalizeWarning() {
77
- return (tree, context) => {
78
- var _a;
79
- try {
80
- if ((_a = (0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/styles')) === null || _a === void 0 ? void 0 : _a.version) {
81
- context.logger.warn(replace_styles_1.TUI_WARNING_NORMALIZE);
82
- }
83
- }
84
- catch (_b) {
85
- // noop
86
- }
87
- };
88
- }
89
- function updateToV3(options) {
90
- const t0 = node_perf_hooks_1.performance.now();
91
- !options['skip-logs'] &&
92
- (0, colored_log_1.titleLog)(`\n\n${colored_log_1.START_SYMBOL} Your packages will be updated to @taiga-ui/*@${versions_1.TAIGA_VERSION}\n`);
93
- return (0, schematics_1.chain)([
94
- main(options),
95
- addTaigaStyles(options),
96
- (0, migrate_taiga_proprietary_icons_1.migrateTaigaProprietaryIcons)(options),
97
- showNormalizeWarning(),
98
- () => {
99
- const executionTime = (0, get_execution_time_1.getExecutionTime)(t0, node_perf_hooks_1.performance.now());
100
- !options['skip-logs'] &&
101
- (0, colored_log_1.titleLog)(`${colored_log_1.FINISH_SYMBOL} We migrated packages to @taiga-ui/*@${versions_1.TAIGA_VERSION} in ${executionTime}. \n`);
102
- },
103
- ]);
104
- }
105
- exports.updateToV3 = updateToV3;
@@ -1,13 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- import type { TuiSchema } from '../../../ng-add/schema';
2
- export declare function dateTimeMigrations(options: TuiSchema): void;
@@ -1,207 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateTimeMigrations = void 0;
4
- const node_perf_hooks_1 = require("node:perf_hooks");
5
- const ng_morph_1 = require("ng-morph");
6
- const colored_log_1 = require("../../../utils/colored-log");
7
- const get_execution_time_1 = require("../../../utils/get-execution-time");
8
- const get_named_import_references_1 = require("../../../utils/get-named-import-references");
9
- const insert_todo_1 = require("../../../utils/insert-todo");
10
- function migrateProperty({ namedImport, moduleSpecifier, from, callback, }) {
11
- const references = (0, get_named_import_references_1.getNamedImportReferences)(namedImport, moduleSpecifier);
12
- references.forEach(ref => {
13
- if (ref.wasForgotten()) {
14
- return;
15
- }
16
- const parent = ref.getParent();
17
- if (!parent) {
18
- return;
19
- }
20
- if (ng_morph_1.Node.isNewExpression(parent)) {
21
- const accessExpression = parent.getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyAccessExpression);
22
- const searched = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier).find(identifier => identifier.getText() === from);
23
- if (searched && accessExpression) {
24
- callback(accessExpression);
25
- return;
26
- }
27
- }
28
- if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
29
- const searched = parent
30
- .getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)
31
- .find(identifier => identifier.getText() === from);
32
- if (searched && !parent.wasForgotten()) {
33
- callback(parent);
34
- return;
35
- }
36
- }
37
- replaceIdentifier(parent, from, callback);
38
- });
39
- }
40
- function replaceIdentifier(node, from, callback) {
41
- const declaration = node.getFirstAncestorByKind(ng_morph_1.SyntaxKind.VariableDeclaration) ||
42
- node.getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyDeclaration);
43
- const identifier = declaration === null || declaration === void 0 ? void 0 : declaration.getFirstDescendantByKind(ng_morph_1.SyntaxKind.Identifier);
44
- if (identifier) {
45
- replaceIdentifierReferences(identifier, from, callback);
46
- }
47
- }
48
- function replaceIdentifierReferences(identifier, from, callback) {
49
- identifier
50
- .findReferencesAsNodes()
51
- /**
52
- * `findReferencesAsNodes` has strange behavior.
53
- * Imagine schematics run on the following file:
54
- * ```
55
- * class Dummy {
56
- * var = 5;
57
- * method1() {
58
- * const {var} = this; // (1)
59
- * return var; // (2)
60
- * }
61
- * method2() {
62
- * const {var} = this; // (3)
63
- * }
64
- * }
65
- * ```
66
- * If `identifier` is equal to `var` from `method1` (1),
67
- * then `identifier.findReferencesAsNodes` will return array with 2 references: (2) and (3).
68
- */
69
- .filter(ref => !areBothObjectDestructuring(ref, identifier))
70
- .forEach(ref => {
71
- if (ref.wasForgotten()) {
72
- return;
73
- }
74
- let parent = ref.getParent();
75
- if ((parent === null || parent === void 0 ? void 0 : parent.getText()) === `this.${identifier.getText()}` ||
76
- (parent === null || parent === void 0 ? void 0 : parent.getText()) === identifier.getText()) {
77
- replaceIdentifier(parent, from, callback);
78
- }
79
- if (parent === null || parent === void 0 ? void 0 : parent.wasForgotten()) {
80
- return;
81
- }
82
- if (parent === null || parent === void 0 ? void 0 : parent.getText().startsWith('this')) {
83
- parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
84
- }
85
- if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
86
- const searched = parent
87
- .getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)
88
- .find(identifier => identifier.getText() === from);
89
- if (searched) {
90
- callback(parent);
91
- }
92
- }
93
- });
94
- }
95
- function changeNormalizeArgs(node) {
96
- const args = node.getArguments();
97
- if (args.length > 2) {
98
- node.removeArgument(2);
99
- node.removeArgument(1);
100
- node.addArgument('"DMY"');
101
- }
102
- else if (args.length === 1) {
103
- node.addArgument('"DMY"');
104
- }
105
- }
106
- function insertTodoBeforeNode(node, message) {
107
- const identifier = node.getFirstDescendantByKind(ng_morph_1.SyntaxKind.Identifier);
108
- if (identifier) {
109
- (0, insert_todo_1.insertTodo)(identifier, message);
110
- }
111
- }
112
- function areBothObjectDestructuring(ref, identifier) {
113
- return Boolean(identifier.getFirstAncestorByKind(ng_morph_1.SyntaxKind.BindingElement) &&
114
- ref.getFirstAncestorByKind(ng_morph_1.SyntaxKind.BindingElement));
115
- }
116
- function dateTimeMigrations(options) {
117
- !options['skip-logs'] &&
118
- (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating taiga date/time...`);
119
- let start = node_perf_hooks_1.performance.now();
120
- migrateProperty({
121
- namedImport: 'TuiDay',
122
- moduleSpecifier: '@taiga-ui/cdk',
123
- from: 'formattedDay',
124
- callback: node => node.replaceWithText(node.getText().replace('formattedDay', 'getFormattedDay("DMY", ".")')),
125
- });
126
- !options['skip-logs'] &&
127
- (0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDay.formattedDay ` +
128
- `(${(0, get_execution_time_1.getExecutionTime)(start, node_perf_hooks_1.performance.now())})`);
129
- start = node_perf_hooks_1.performance.now();
130
- migrateProperty({
131
- namedImport: 'TuiDayRange',
132
- moduleSpecifier: '@taiga-ui/cdk',
133
- from: 'formattedDayRange',
134
- callback: node => node.replaceWithText(node
135
- .getText()
136
- .replace('formattedDayRange', 'getFormattedDayRange("DMY", ".")')),
137
- });
138
- !options['skip-logs'] &&
139
- (0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.formattedDayRange ` +
140
- `(${(0, get_execution_time_1.getExecutionTime)(start, node_perf_hooks_1.performance.now())})`);
141
- start = node_perf_hooks_1.performance.now();
142
- migrateProperty({
143
- namedImport: 'TuiDayRange',
144
- moduleSpecifier: '@taiga-ui/cdk',
145
- from: 'normalizeParse',
146
- callback: node => {
147
- const parent = node.getParent();
148
- if (ng_morph_1.Node.isCallExpression(parent)) {
149
- changeNormalizeArgs(parent);
150
- }
151
- },
152
- });
153
- !options['skip-logs'] &&
154
- (0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.normalizeParse ` +
155
- `(${(0, get_execution_time_1.getExecutionTime)(start, node_perf_hooks_1.performance.now())})`);
156
- [
157
- {
158
- namedImport: 'TuiMonthRange',
159
- field: 'formattedMonthRange',
160
- message: 'formattedMonthRange has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit',
161
- },
162
- {
163
- namedImport: 'TuiMonth',
164
- field: 'formattedMonth',
165
- message: 'formattedMonth has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit',
166
- },
167
- {
168
- namedImport: 'TuiDay',
169
- field: 'getDayFromMonthRowCol',
170
- message: 'getDayFromMonthRowCol has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
171
- },
172
- {
173
- namedImport: 'TuiMonth',
174
- field: 'monthStartDaysOffset',
175
- message: 'monthStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
176
- },
177
- {
178
- namedImport: 'TuiMonth',
179
- field: 'weeksRowsCount',
180
- message: 'weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
181
- },
182
- {
183
- namedImport: 'TuiYear',
184
- field: 'getYearStartDaysOffset',
185
- message: 'getYearStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
186
- },
187
- {
188
- namedImport: 'TuiYear',
189
- field: 'weeksRowsCount',
190
- message: 'weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
191
- },
192
- ].forEach(({ namedImport, field, message }) => {
193
- start = node_perf_hooks_1.performance.now();
194
- migrateProperty({
195
- namedImport,
196
- moduleSpecifier: '@taiga-ui/cdk',
197
- from: field,
198
- callback: node => insertTodoBeforeNode(node, message),
199
- });
200
- !options['skip-logs'] &&
201
- (0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}${namedImport}.${field} ` +
202
- `(${(0, get_execution_time_1.getExecutionTime)(start, node_perf_hooks_1.performance.now())})`);
203
- });
204
- !options['skip-logs'] &&
205
- (0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} date/time migrated \n`);
206
- }
207
- exports.dateTimeMigrations = dateTimeMigrations;