@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
@@ -0,0 +1,3 @@
1
+ import { type DevkitFileSystem } from 'ng-morph';
2
+ import type { TuiSchema } from '../../../ng-add/schema';
3
+ export declare function migrateRoot(fileSystem: DevkitFileSystem, options: TuiSchema): void;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateRoot = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ const add_unique_import_1 = require("../../../utils/add-unique-import");
6
+ const colored_log_1 = require("../../../utils/colored-log");
7
+ const get_named_import_references_1 = require("../../../utils/get-named-import-references");
8
+ const import_manipulations_1 = require("../../../utils/import-manipulations");
9
+ function migrateRoot(fileSystem, options) {
10
+ !options['skip-logs'] &&
11
+ (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} updating TuiRoot`);
12
+ const refs = [
13
+ ...(0, get_named_import_references_1.getNamedImportReferences)('TuiRootModule', '@taiga-ui/core'),
14
+ ...(0, get_named_import_references_1.getNamedImportReferences)('TuiProprietaryRootModule', '@taiga-ui/proprietary-core'),
15
+ ...(0, get_named_import_references_1.getNamedImportReferences)('TuiProprietaryRoot2023Module', '@taiga-ui/proprietary-core'),
16
+ ];
17
+ for (const ref of refs) {
18
+ if (ref.wasForgotten()) {
19
+ return;
20
+ }
21
+ const parent = ref.getParent();
22
+ if (ng_morph_1.Node.isImportSpecifier(parent)) {
23
+ (0, import_manipulations_1.removeImport)(parent);
24
+ (0, add_unique_import_1.addUniqueImport)(parent.getSourceFile().getFilePath(), 'TuiRoot', '@taiga-ui/core');
25
+ }
26
+ else {
27
+ replaceRootIdentifier(ref, fileSystem);
28
+ }
29
+ }
30
+ }
31
+ exports.migrateRoot = migrateRoot;
32
+ function replaceRootIdentifier(ref, fileSystem) {
33
+ const callExpression = ref.getParentWhile(ng_morph_1.Node.isCallExpression);
34
+ if (callExpression &&
35
+ callExpression.getExpression().getText() === 'importProvidersFrom') {
36
+ const node = callExpression
37
+ .getArguments()
38
+ .find((arg) => arg.getText() === ref.getText());
39
+ if (node) {
40
+ callExpression.removeArgument(node);
41
+ addProviders(callExpression, fileSystem);
42
+ }
43
+ }
44
+ else {
45
+ ref.replaceWithText('TuiRoot');
46
+ }
47
+ }
48
+ function addProviders(callExpression, fileSystem) {
49
+ const array = callExpression.getParentWhile(ng_morph_1.Node.isArrayLiteralExpression);
50
+ if (!array) {
51
+ return;
52
+ }
53
+ array.addElement('NG_EVENT_PLUGINS');
54
+ (0, add_unique_import_1.addUniqueImport)(array.getSourceFile().getFilePath(), 'NG_EVENT_PLUGINS', '@taiga-ui/event-plugins');
55
+ (0, ng_morph_1.getActiveProject)();
56
+ const proprietary = (0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, '@taiga-ui/proprietary-core');
57
+ if (proprietary) {
58
+ array.addElement('TBANK_PROVIDERS');
59
+ (0, add_unique_import_1.addUniqueImport)(array.getSourceFile().getFilePath(), 'TBANK_PROVIDERS', '@taiga-ui/proprietary');
60
+ }
61
+ }
@@ -10,6 +10,8 @@ const templates_1 = require("../../utils/templates");
10
10
  const replace_attrs_by_directives_1 = require("../../utils/templates/replace-attrs-by-directives");
11
11
  const constants_2 = require("./constants");
12
12
  const templates_2 = require("./templates");
13
+ const migrate_blocked_1 = require("./templates/migrate-blocked");
14
+ const migrate_number_precision_1 = require("./templates/migrate-number-precision");
13
15
  function getAction({ action, requiredData, }) {
14
16
  return ({ resource, fileSystem, recorder, }) => action({ resource, fileSystem, recorder, data: requiredData });
15
17
  }
@@ -27,6 +29,7 @@ function migrateTemplates(fileSystem, options) {
27
29
  getAction({ action: templates_1.replaceAttrs, requiredData: constants_2.ATTRS_TO_REPLACE }),
28
30
  getAction({ action: templates_1.replaceAttrValues, requiredData: constants_2.ATTR_WITH_VALUES_TO_REPLACE }),
29
31
  getAction({ action: templates_1.removeInputs, requiredData: constants_2.INPUTS_TO_REMOVE }),
32
+ templates_2.migrateAxes,
30
33
  templates_2.migrateBadge,
31
34
  templates_2.migrateCheckbox,
32
35
  templates_2.migrateFocusable,
@@ -36,15 +39,22 @@ function migrateTemplates(fileSystem, options) {
36
39
  templates_2.migrateExpandable,
37
40
  templates_2.migrateBadgedContent,
38
41
  templates_2.migratePreventDefault,
42
+ templates_2.migrateMobileTabs,
39
43
  templates_2.migrateMoney,
40
44
  templates_2.migrateLabeled,
45
+ migrate_blocked_1.migrateBlocked,
41
46
  templates_2.migrateProgressSegmented,
42
47
  templates_2.migrateThumbnailCard,
48
+ templates_2.migrateOverscroll,
49
+ templates_2.migrateButtonAppearance,
50
+ templates_2.migrateLabel,
51
+ migrate_number_precision_1.migrateNumberPrecision,
52
+ templates_2.migrateNotification,
43
53
  ];
44
54
  const progressLog = (0, progress_1.setupProgressLogger)({
45
55
  total: componentWithTemplatesPaths.length,
46
56
  });
47
- componentWithTemplatesPaths.forEach(resource => {
57
+ componentWithTemplatesPaths.forEach((resource) => {
48
58
  const path = fileSystem.resolve((0, template_resource_1.getPathFromTemplateResource)(resource));
49
59
  const recorder = fileSystem.edit(path);
50
60
  actions.forEach((action, actionIndex) => {
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateStyles = exports.TUI_RATING_WARNING = void 0;
4
+ /// <reference lib="es2021" />
5
+ const ng_morph_1 = require("ng-morph");
6
+ const migrate_less_scss_constants_1 = require("./migrate-less-scss-constants");
7
+ const migrate_scrollbar_behavior_1 = require("./migrate-scrollbar-behavior");
8
+ const migrate_shadow_mixins_1 = require("./migrate-shadow-mixins");
9
+ const migrate_space_mixins_1 = require("./migrate-space-mixins");
10
+ const migrate_text_mixins_1 = require("./migrate-text-mixins");
11
+ exports.TUI_RATING_WARNING = '// TODO: (Taiga UI migration): use css to customize rating gap and size. See https://taiga-ui.dev/components/rating#basic';
12
+ function migrateStyles() {
13
+ var _a;
14
+ (_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/**.{less,sass,scss,css}').forEach((sourceFile) => {
15
+ let fullText = sourceFile.getFullText();
16
+ fullText = fullText
17
+ // eslint-disable-next-line
18
+ .replace(/^(.*--tui-rating-size.*)$/gm, `${exports.TUI_RATING_WARNING}\n$1`)
19
+ // eslint-disable-next-line
20
+ .replace(/^(.*--tui-rating-gap.*)$/gm, `${exports.TUI_RATING_WARNING}\n$1`)
21
+ .replaceAll('--tui-link-icon-size', '--tui-icon-size')
22
+ .replaceAll('@taiga-ui/proprietary-core/styles/tinkoff-fonts', '@taiga-ui/proprietary/styles/tbank-fonts')
23
+ .replaceAll('@taiga-ui/proprietary-core/styles/theme-tinkoff-2023', '@taiga-ui/proprietary/styles/tbank-theme')
24
+ .replaceAll('@taiga-ui/proprietary-core/styles/theme-tinkoff-mobile-2023', '@taiga-ui/proprietary/styles/tbank-theme-mobile.less')
25
+ .replaceAll('@taiga-ui/proprietary-core/styles/theme-tinkoff-mobile', '@taiga-ui/proprietary/styles/tbank-theme-mobile.less')
26
+ .replaceAll('@taiga-ui/proprietary-core/styles/theme-tinkoff', '@taiga-ui/proprietary/styles/tbank-theme');
27
+ const newFileContent = [
28
+ migrate_space_mixins_1.migrateSpaceMixins,
29
+ migrate_text_mixins_1.migrateTextMixins,
30
+ migrate_shadow_mixins_1.migrateShadowMixins,
31
+ migrate_less_scss_constants_1.migrateLessSCSSConstants,
32
+ migrate_scrollbar_behavior_1.migrateScrollbarBehavior,
33
+ ].reduce((text, migrate) => migrate(text), fullText);
34
+ sourceFile.replaceWithText(newFileContent);
35
+ });
36
+ (0, ng_morph_1.saveActiveProject)();
37
+ }
38
+ exports.migrateStyles = migrateStyles;
@@ -0,0 +1 @@
1
+ export declare function migrateLessSCSSConstants(fileContent: string): string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateLessSCSSConstants = void 0;
4
+ const MAPPING = {
5
+ space: '0.25rem',
6
+ };
7
+ function migrateLessSCSSConstants(fileContent) {
8
+ if (!fileContent.includes('@taiga-ui/core/styles/taiga-ui-local')) {
9
+ return fileContent;
10
+ }
11
+ return fileContent.replaceAll(new RegExp(`[$|@](${Object.keys(MAPPING).join('|')})`, 'g'), (_, variable) => MAPPING[variable]);
12
+ }
13
+ exports.migrateLessSCSSConstants = migrateLessSCSSConstants;
@@ -0,0 +1 @@
1
+ export declare function migrateScrollbarBehavior(fileContent: string): string;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateScrollbarBehavior = void 0;
4
+ function migrateScrollbarBehavior(fileContent) {
5
+ if (!fileContent.includes('@taiga-ui/core/styles/taiga-ui-local')) {
6
+ return fileContent;
7
+ }
8
+ return fileContent.replaceAll('.scroll-behavior()', 'scroll-behavior: var(--tui-scroll-behavior)');
9
+ }
10
+ exports.migrateScrollbarBehavior = migrateScrollbarBehavior;
@@ -0,0 +1 @@
1
+ export declare function migrateShadowMixins(fileContent: string): string;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateShadowMixins = void 0;
4
+ const MAPPING = {
5
+ 'shadow()': 'var(--tui-shadow-small)',
6
+ 'shadow(1)': 'var(--tui-shadow-small)',
7
+ 'shadow(2)': 'var(--tui-shadow-medium)',
8
+ 'shadow(3)': 'var(--tui-shadow-popup)',
9
+ 'shadow(4)': 'var(--tui-shadow-medium)',
10
+ 'shadow(5)': 'var(--tui-shadow-small-hover)',
11
+ 'shadow(6)': 'var(--tui-shadow-small)',
12
+ 'shadow(7)': 'var(--tui-shadow-popup)',
13
+ };
14
+ // .shadow(2);
15
+ // @include shadow(2);
16
+ const MIXIN_RE = /(?:@include\s|\.)(shadow\(\d*\))(\s?!important)?;/g;
17
+ function migrateShadowMixins(fileContent) {
18
+ if (!fileContent.includes('@taiga-ui/core/styles/taiga-ui-local')) {
19
+ return fileContent;
20
+ }
21
+ return fileContent.replaceAll(MIXIN_RE, (_, mixin, important = '') => `box-shadow: ${MAPPING[mixin]}${important};`);
22
+ }
23
+ exports.migrateShadowMixins = migrateShadowMixins;
@@ -0,0 +1 @@
1
+ export declare function migrateSpaceMixins(fileContent: string): string;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateSpaceMixins = void 0;
4
+ const DIRECTION_MAPPING = {
5
+ all: ['margin'],
6
+ top: ['margin-top'],
7
+ bottom: ['margin-bottom'],
8
+ left: ['margin-left'],
9
+ right: ['margin-right'],
10
+ vertical: ['margin-top', 'margin-bottom'],
11
+ horizontal: ['margin-left', 'margin-right'],
12
+ };
13
+ const SPACE = 0.25;
14
+ // .tui-space(top, 4);
15
+ // @include tui-space(top, 4);
16
+ const MIXIN_RE = new RegExp(`(?:@include\\s|\\.)tui-space\\((?<direction>${Object.keys(DIRECTION_MAPPING).join('|')}),\\s?(?<size>-?\\d+)\\)(\\s?!important)?;`, 'g');
17
+ function migrateSpaceMixins(fileContent) {
18
+ return fileContent.replaceAll(MIXIN_RE, (_, direction, size, important = '') => `${DIRECTION_MAPPING[direction].map((property) => `${property}: ${Number(size) * SPACE}rem${important};`).join('\n')}`);
19
+ }
20
+ exports.migrateSpaceMixins = migrateSpaceMixins;
@@ -0,0 +1 @@
1
+ export declare function migrateTextMixins(fileContent: string): string;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateTextMixins = void 0;
4
+ const MAPPING = {
5
+ 'text-h1': ['font: var(--tui-font-heading-1)'],
6
+ 'text-h2': ['font: var(--tui-font-heading-2)'],
7
+ 'text-h3': ['font: var(--tui-font-heading-3)'],
8
+ 'text-h4': ['font: var(--tui-font-heading-4)'],
9
+ 'text-h5': ['font: var(--tui-font-heading-5)'],
10
+ 'text-h6': ['font: var(--tui-font-heading-6)'],
11
+ 'text-body-xl-bold': ['font: var(--tui-font-text-xl)', 'font-weight: bold'],
12
+ 'text-body-xl': ['font: var(--tui-font-text-xl)'],
13
+ 'text-body-xs': ['font: var(--tui-font-text-xs)'],
14
+ 'text-caption-l-bold': [
15
+ 'font-size: 0.8125rem',
16
+ 'font-weight: bold',
17
+ 'font-family: var(--tui-font-text)',
18
+ 'letter-spacing: 0.0625rem',
19
+ 'text-transform: uppercase',
20
+ ],
21
+ 'text-caption-l': [
22
+ 'font-size: 0.8125rem',
23
+ 'font-weight: normal',
24
+ 'font-family: var(--tui-font-text)',
25
+ 'letter-spacing: 0.0625rem',
26
+ 'text-transform: uppercase',
27
+ ],
28
+ 'text-caption-bold': [
29
+ 'font-size: 0.6875rem',
30
+ 'font-weight: bold',
31
+ 'font-family: var(--tui-font-text)',
32
+ 'letter-spacing: 0.0625rem',
33
+ 'text-transform: uppercase',
34
+ ],
35
+ 'text-caption': [
36
+ 'font-size: 0.6875rem',
37
+ 'font-weight: normal',
38
+ 'font-family: var(--tui-font-text)',
39
+ 'letter-spacing: 0.0625rem',
40
+ 'text-transform: uppercase',
41
+ ],
42
+ };
43
+ // .tui-text-h1();
44
+ // @include tui-text-h1();
45
+ const MIXIN_RE = /(?:@include\s|\.)(text-[\w-]+)\(([\w-,\s]+)?\)(\s?!important)?;/g;
46
+ function migrateTextMixins(fileContent) {
47
+ if (!fileContent.includes('@taiga-ui/core/styles/taiga-ui-local')) {
48
+ return fileContent;
49
+ }
50
+ return fileContent.replaceAll(MIXIN_RE, (originalString, mixinName, important = '') => MAPPING[mixinName]
51
+ ? `${MAPPING[mixinName].map((newValue) => `${newValue}${important};`).join('\n')}`
52
+ : `${originalString} // TODO: this mixin was deleted. Replace it with inline styles. Find it source code in https://github.com/taiga-family/taiga-ui/blob/v3.x/projects/core/styles/mixins/text.less`);
53
+ }
54
+ exports.migrateTextMixins = migrateTextMixins;
@@ -1,10 +1,16 @@
1
1
  export * from './migrate-avatar';
2
+ export * from './migrate-axes';
2
3
  export * from './migrate-badge';
3
4
  export * from './migrate-badged-content';
5
+ export * from './migrate-button-appearance';
4
6
  export * from './migrate-expandable';
5
7
  export * from './migrate-focusable';
8
+ export * from './migrate-label';
6
9
  export * from './migrate-labeled';
10
+ export * from './migrate-mobile-tabs';
7
11
  export * from './migrate-money';
12
+ export * from './migrate-notification';
13
+ export * from './migrate-overscroll';
8
14
  export * from './migrate-prevent-default';
9
15
  export * from './migrate-progress-segmented';
10
16
  export * from './migrate-thumbnail-card';
@@ -2,12 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./migrate-avatar"), exports);
5
+ tslib_1.__exportStar(require("./migrate-axes"), exports);
5
6
  tslib_1.__exportStar(require("./migrate-badge"), exports);
6
7
  tslib_1.__exportStar(require("./migrate-badged-content"), exports);
8
+ tslib_1.__exportStar(require("./migrate-button-appearance"), exports);
7
9
  tslib_1.__exportStar(require("./migrate-expandable"), exports);
8
10
  tslib_1.__exportStar(require("./migrate-focusable"), exports);
11
+ tslib_1.__exportStar(require("./migrate-label"), exports);
9
12
  tslib_1.__exportStar(require("./migrate-labeled"), exports);
13
+ tslib_1.__exportStar(require("./migrate-mobile-tabs"), exports);
10
14
  tslib_1.__exportStar(require("./migrate-money"), exports);
15
+ tslib_1.__exportStar(require("./migrate-notification"), exports);
16
+ tslib_1.__exportStar(require("./migrate-overscroll"), exports);
11
17
  tslib_1.__exportStar(require("./migrate-prevent-default"), exports);
12
18
  tslib_1.__exportStar(require("./migrate-progress-segmented"), exports);
13
19
  tslib_1.__exportStar(require("./migrate-thumbnail-card"), exports);
@@ -3,17 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrateAvatar = void 0;
4
4
  const add_import_to_closest_module_1 = require("../../../../utils/add-import-to-closest-module");
5
5
  const elements_1 = require("../../../../utils/templates/elements");
6
+ const inputs_1 = require("../../../../utils/templates/inputs");
6
7
  const template_resource_1 = require("../../../../utils/templates/template-resource");
7
8
  const remove_attrs_1 = require("../utils/remove-attrs");
9
+ const common_1 = require("./toggles/common");
10
+ const sizeMap = {
11
+ xxs: 'xs',
12
+ xs: 's',
13
+ s: 'm',
14
+ m: 'l',
15
+ l: 'xl',
16
+ xl: 'xxl',
17
+ xxl: 'xxl',
18
+ };
8
19
  function addModules(componentPath, modules) {
9
20
  modules.forEach(({ moduleName, moduleSpecifier }) => {
10
21
  (0, add_import_to_closest_module_1.addImportToClosestModule)(componentPath, moduleName, moduleSpecifier);
11
22
  });
12
23
  }
13
24
  function getFallbackValue(textValue, fallbackValue) {
14
- if (textValue) {
15
- return `(${textValue} | tuiInitials)`;
16
- }
17
25
  return textValue ? `(${textValue} | tuiInitials)` : fallbackValue || '';
18
26
  }
19
27
  function normalizeAttrValue(attrName, attrValue) {
@@ -22,13 +30,21 @@ function normalizeAttrValue(attrName, attrValue) {
22
30
  function migrateAvatar({ resource, recorder, fileSystem, }) {
23
31
  const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
24
32
  const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
25
- const elements = (0, elements_1.findElementsByTagName)(template, 'tui-avatar');
26
- elements.forEach(({ attrs, sourceCodeLocation }) => {
33
+ const avatarElements = (0, elements_1.findElementsByTagName)(template, 'tui-avatar');
34
+ const markerIconElements = (0, elements_1.findElementsByTagName)(template, 'tui-marker-icon');
35
+ [...avatarElements, ...markerIconElements].forEach(({ attrs, sourceCodeLocation }) => {
36
+ if (!sourceCodeLocation) {
37
+ return;
38
+ }
39
+ (0, common_1.replaceSizeAttr)(attrs, sourceCodeLocation, recorder, templateOffset, sizeMap);
40
+ });
41
+ avatarElements.forEach(({ attrs, sourceCodeLocation }) => {
27
42
  var _a, _b;
28
- const avatarUrlAttr = attrs.find(attr => attr.name === '[avatarurl]' || attr.name === 'avatarurl');
29
- const fallbackAttr = attrs.find(attr => attr.name === '[fallback]' || attr.name === 'fallback');
30
- const textAttr = attrs.find(attr => attr.name === '[text]' || attr.name === 'text');
31
- const roundedAttr = attrs.find(attr => attr.name === '[rounded]' || attr.name === 'rounded');
43
+ const avatarUrlAttr = (0, inputs_1.findAttr)(attrs, 'avatarurl');
44
+ const fallbackAttr = (0, inputs_1.findAttr)(attrs, 'fallback');
45
+ const textAttr = (0, inputs_1.findAttr)(attrs, 'text');
46
+ const roundedAttr = (0, inputs_1.findAttr)(attrs, 'rounded');
47
+ const autoColorAttr = (0, inputs_1.findAttr)(attrs, 'autoColor');
32
48
  if ((!avatarUrlAttr && !textAttr) || !sourceCodeLocation) {
33
49
  return;
34
50
  }
@@ -37,6 +53,8 @@ function migrateAvatar({ resource, recorder, fileSystem, }) {
37
53
  const textAttrValue = (textAttr === null || textAttr === void 0 ? void 0 : textAttr.value) && normalizeAttrValue(textAttr.name, textAttr.value);
38
54
  const fallbackAttrValue = (fallbackAttr === null || fallbackAttr === void 0 ? void 0 : fallbackAttr.value) &&
39
55
  normalizeAttrValue(fallbackAttr.name, fallbackAttr.value);
56
+ const autoColorValue = (autoColorAttr === null || autoColorAttr === void 0 ? void 0 : autoColorAttr.value) &&
57
+ normalizeAttrValue(autoColorAttr.name, autoColorAttr.value);
40
58
  const insertTo = ((_b = (_a = sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) !== null && _b !== void 0 ? _b : 0) + '<tui-avatar'.length;
41
59
  if (!insertTo) {
42
60
  return;
@@ -48,8 +66,13 @@ function migrateAvatar({ resource, recorder, fileSystem, }) {
48
66
  const fallbackSrc = urlAttrValue && fallbackValue
49
67
  ? `| tuiFallbackSrc : ${fallbackValue} | async`
50
68
  : '';
51
- recorder.insertRight(insertTo + templateOffset, ` [src]="${mainSrc}${fallbackSrc ? ` ${fallbackSrc}` : ''}"${!roundedAttr ? ' [round]="false"' : ''}`);
52
- const attrsToRemove = [avatarUrlAttr, textAttr, fallbackAttr].filter((attr) => attr !== undefined);
69
+ recorder.insertRight(insertTo + templateOffset, ` [src]="${mainSrc}${fallbackSrc ? ` ${fallbackSrc}` : ''}"${!roundedAttr ? ' [round]="false"' : ''}${autoColorValue === 'true' ? ` [style.background]="${textAttrValue} | tuiAutoColor"` : ''}`);
70
+ const attrsToRemove = [
71
+ avatarUrlAttr,
72
+ textAttr,
73
+ fallbackAttr,
74
+ autoColorAttr,
75
+ ].filter((attr) => attr !== undefined);
53
76
  const fallbackModule = !!((avatarUrlAttr && textAttrValue) || fallbackAttr);
54
77
  const initialsModule = !!textAttrValue;
55
78
  const modules = [
@@ -1,7 +1,7 @@
1
1
  import type { UpdateRecorder } from '@angular-devkit/schematics';
2
2
  import type { DevkitFileSystem } from 'ng-morph';
3
- import type { TemplateResource } from '../../interfaces/template-resource';
4
- export declare function migratePolymorpheus({ resource, fileSystem, recorder, }: {
3
+ import type { TemplateResource } from '../../../interfaces';
4
+ export declare function migrateAxes({ resource, recorder, fileSystem, }: {
5
5
  fileSystem: DevkitFileSystem;
6
6
  recorder: UpdateRecorder;
7
7
  resource: TemplateResource;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateAxes = void 0;
4
+ const elements_1 = require("../../../../utils/templates/elements");
5
+ const template_resource_1 = require("../../../../utils/templates/template-resource");
6
+ const remove_attrs_1 = require("../utils/remove-attrs");
7
+ const AXES_TAG_NAME = 'tui-axes';
8
+ const AXES_NEW_ATTRIBUTE = 'new';
9
+ function migrateAxes({ resource, recorder, fileSystem, }) {
10
+ const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
11
+ const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
12
+ const elements = (0, elements_1.findElementsByTagName)(template, AXES_TAG_NAME);
13
+ elements.forEach(({ attrs, sourceCodeLocation }) => {
14
+ const axesNewAttr = attrs.find((attr) => attr.name === AXES_NEW_ATTRIBUTE);
15
+ if (!sourceCodeLocation) {
16
+ return;
17
+ }
18
+ if (axesNewAttr) {
19
+ (0, remove_attrs_1.removeAttrs)([axesNewAttr], sourceCodeLocation, recorder, templateOffset);
20
+ }
21
+ else {
22
+ recorder.insertLeft(sourceCodeLocation.startOffset + templateOffset, '<!-- TODO: (Taiga UI migration) labels positioning on x axes were updated. Add empty string to axisXLabels array. See https://taiga-ui.dev/charts/axes -->\n');
23
+ }
24
+ });
25
+ }
26
+ exports.migrateAxes = migrateAxes;
@@ -2,7 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrateBadge = void 0;
4
4
  const elements_1 = require("../../../../utils/templates/elements");
5
+ const inputs_1 = require("../../../../utils/templates/inputs");
5
6
  const template_resource_1 = require("../../../../utils/templates/template-resource");
7
+ const common_1 = require("./toggles/common");
8
+ const badgeSizeMap = {
9
+ xs: 's',
10
+ s: 'm',
11
+ m: 'l',
12
+ l: 'xl',
13
+ };
6
14
  function migrateBadge({ resource, recorder, fileSystem, }) {
7
15
  const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
8
16
  const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
@@ -11,13 +19,14 @@ function migrateBadge({ resource, recorder, fileSystem, }) {
11
19
  if (!sourceCodeLocation) {
12
20
  return;
13
21
  }
14
- const valueAttr = attrs.find(attr => attr.name === '[value]' || attr.name === 'value');
22
+ (0, common_1.replaceSizeAttr)(attrs, sourceCodeLocation, recorder, templateOffset, badgeSizeMap);
23
+ const valueAttr = (0, inputs_1.findAttr)(attrs, 'value');
15
24
  // migration for icon-only badges
16
25
  if (!valueAttr) {
17
26
  addTodo(recorder, sourceCodeLocation, templateOffset);
18
27
  return;
19
28
  }
20
- const svg = childNodes === null || childNodes === void 0 ? void 0 : childNodes.find(node => node.nodeName === 'tui-svg');
29
+ const svg = childNodes === null || childNodes === void 0 ? void 0 : childNodes.find((node) => node.nodeName === 'tui-svg');
21
30
  if (svg) {
22
31
  migrateIcon({ svg, sourceCodeLocation, recorder, templateOffset });
23
32
  }
@@ -31,16 +40,16 @@ function migrateBadge({ resource, recorder, fileSystem, }) {
31
40
  }
32
41
  exports.migrateBadge = migrateBadge;
33
42
  function migrateIcon({ svg, sourceCodeLocation, recorder, templateOffset, }) {
34
- var _a, _b, _c, _d, _e;
35
- const src = (_a = svg.attrs) === null || _a === void 0 ? void 0 : _a.find(attr => attr.name === 'src');
43
+ var _a, _b, _c, _d;
44
+ const src = (0, inputs_1.findAttr)(svg.attrs, 'src');
36
45
  const srcValue = src === null || src === void 0 ? void 0 : src.value;
37
46
  if (!srcValue) {
38
47
  return;
39
48
  }
40
- const insertTo = templateOffset + (((_b = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startTag) === null || _b === void 0 ? void 0 : _b.endOffset) || 0) - 1;
41
- recorder.insertRight(insertTo, `${(src === null || src === void 0 ? void 0 : src.name) === 'src' ? 'iconLeft' : '[iconLeft]'}="${srcValue}"`);
42
- recorder.remove(((_c = svg.sourceCodeLocation) === null || _c === void 0 ? void 0 : _c.startOffset) || 0, (((_d = svg.sourceCodeLocation) === null || _d === void 0 ? void 0 : _d.endOffset) || 0) -
43
- (((_e = svg.sourceCodeLocation) === null || _e === void 0 ? void 0 : _e.startOffset) || 0));
49
+ const insertTo = templateOffset + (((_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.endOffset) || 0) - 1;
50
+ recorder.insertRight(insertTo, `${(src === null || src === void 0 ? void 0 : src.name) === 'src' ? 'iconStart' : '[iconStart]'}="${srcValue}"`);
51
+ recorder.remove(((_b = svg.sourceCodeLocation) === null || _b === void 0 ? void 0 : _b.startOffset) || 0, (((_c = svg.sourceCodeLocation) === null || _c === void 0 ? void 0 : _c.endOffset) || 0) -
52
+ (((_d = svg.sourceCodeLocation) === null || _d === void 0 ? void 0 : _d.startOffset) || 0));
44
53
  }
45
54
  function migrateBadgeValue({ valueAttr, sourceCodeLocation, recorder, templateOffset, }) {
46
55
  var _a, _b, _c, _d, _e;
@@ -59,7 +59,7 @@ function migrateBadgedContent({ resource, recorder, fileSystem, }) {
59
59
  });
60
60
  if (!rounded || rounded.value === 'true') {
61
61
  const insertTo = (_b = (_a = sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.endOffset) !== null && _b !== void 0 ? _b : 0;
62
- recorder.insertRight(insertTo + templateOffset - 1, '[style.--tui-radius.%]="50"');
62
+ recorder.insertRight(insertTo + templateOffset - 1, ' [style.--tui-radius.%]="50"');
63
63
  }
64
64
  const attrsToRemove = [
65
65
  colorBottomAttr,
@@ -1,7 +1,7 @@
1
1
  import type { UpdateRecorder } from '@angular-devkit/schematics';
2
2
  import type { DevkitFileSystem } from 'ng-morph';
3
- import type { TemplateResource } from '../../interfaces/template-resource';
4
- export declare function migrateTextfieldController({ resource, fileSystem, recorder, }: {
3
+ import type { TemplateResource } from '../../../interfaces';
4
+ export declare function migrateBlocked({ resource, recorder, fileSystem, }: {
5
5
  fileSystem: DevkitFileSystem;
6
6
  recorder: UpdateRecorder;
7
7
  resource: TemplateResource;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateBlocked = void 0;
4
+ const elements_1 = require("../../../../utils/templates/elements");
5
+ const inputs_1 = require("../../../../utils/templates/inputs");
6
+ const template_resource_1 = require("../../../../utils/templates/template-resource");
7
+ function migrateBlocked({ resource, recorder, fileSystem, }) {
8
+ const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
9
+ const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
10
+ const elements = (0, elements_1.findElementsByTagNames)(template, [
11
+ 'tui-checkbox-block',
12
+ 'tui-radio-block',
13
+ ]);
14
+ elements.forEach(({ sourceCodeLocation, tagName, attrs }) => {
15
+ var _a, _b, _c, _d;
16
+ if (!sourceCodeLocation) {
17
+ return;
18
+ }
19
+ const [, hideIconAttrLocation] = Object.entries(sourceCodeLocation.attrs || {}).find(([name]) => name.includes('hideCheckbox'.toLowerCase()) ||
20
+ name.includes('hideRadio'.toLowerCase())) || [];
21
+ const [, sizeAttrLocation] = Object.entries(sourceCodeLocation.attrs || {}).find(([name]) => name.includes('size')) || [];
22
+ const sizeAttr = (0, inputs_1.findAttr)(attrs, 'size');
23
+ const newBlockAttr = `tuiBlock${sizeAttr ? `="${sizeAttr.value === 'xs' ? 's' : sizeAttr.value}"` : ''}`;
24
+ recorder.insertRight(templateOffset + (((_a = sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) || 1) - 1, `<label ${newBlockAttr}${hideIconAttrLocation ? ' appearance=""' : ''}>`);
25
+ recorder.remove(templateOffset + ((_c = (_b = sourceCodeLocation.endTag) === null || _b === void 0 ? void 0 : _b.startOffset) !== null && _c !== void 0 ? _c : 0), `<${tagName}/>`.length);
26
+ recorder.insertRight(templateOffset + (((_d = sourceCodeLocation.endTag) === null || _d === void 0 ? void 0 : _d.startOffset) || 1), '</label>');
27
+ if (hideIconAttrLocation) {
28
+ recorder.remove(templateOffset + hideIconAttrLocation.startOffset, hideIconAttrLocation.endOffset - hideIconAttrLocation.startOffset);
29
+ }
30
+ if (sizeAttrLocation) {
31
+ recorder.remove(templateOffset + sizeAttrLocation.startOffset, sizeAttrLocation.endOffset - sizeAttrLocation.startOffset);
32
+ }
33
+ });
34
+ }
35
+ exports.migrateBlocked = migrateBlocked;
@@ -0,0 +1,8 @@
1
+ import type { UpdateRecorder } from '@angular-devkit/schematics';
2
+ import type { DevkitFileSystem } from 'ng-morph';
3
+ import type { TemplateResource } from '../../../interfaces';
4
+ export declare function migrateButtonAppearance({ resource, recorder, fileSystem, }: {
5
+ fileSystem: DevkitFileSystem;
6
+ recorder: UpdateRecorder;
7
+ resource: TemplateResource;
8
+ }): void;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateButtonAppearance = void 0;
4
+ const elements_1 = require("../../../../utils/templates/elements");
5
+ const template_resource_1 = require("../../../../utils/templates/template-resource");
6
+ const remove_attrs_1 = require("../utils/remove-attrs");
7
+ const tuiButtonSelectors = ['tuiButton', 'tuiIconButton'];
8
+ const appearanceInputName = 'appearance';
9
+ const appearanceInputNameDict = {
10
+ [appearanceInputName]: true,
11
+ [`[${appearanceInputName}]`]: true,
12
+ };
13
+ function migrateButtonAppearance({ resource, recorder, fileSystem, }) {
14
+ const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
15
+ const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
16
+ const elements = tuiButtonSelectors.flatMap((selector) => (0, elements_1.findElementsWithDirective)(template, selector).filter(({ sourceCodeLocation, attrs }) => !!sourceCodeLocation &&
17
+ attrs.some(({ name }) => appearanceInputNameDict[name])));
18
+ if (!elements.length) {
19
+ return;
20
+ }
21
+ const whiteBlockValue = 'whiteblock-active';
22
+ elements.forEach(({ attrs, sourceCodeLocation }) => {
23
+ var _a;
24
+ const whiteBlockActiveAttr = attrs.find(({ value, name }) => appearanceInputNameDict[name] &&
25
+ (value === whiteBlockValue || value === `'${whiteBlockValue}'`));
26
+ if (whiteBlockActiveAttr) {
27
+ (0, remove_attrs_1.removeAttrs)([whiteBlockActiveAttr], sourceCodeLocation, recorder, templateOffset);
28
+ const { startOffset } = ((_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[whiteBlockActiveAttr.name]) || { startOffset: 0, endOffset: 0 };
29
+ recorder.insertLeft(startOffset + templateOffset, ` ${appearanceInputName}="whiteblock"`);
30
+ recorder.insertLeft(startOffset + templateOffset, ' data-mode="checked"');
31
+ }
32
+ });
33
+ const elementWithConditionAppearance = elements.find(({ attrs }) => attrs.some(({ name, value }) => name === `[${appearanceInputName}]` && !value.trim().startsWith("'")));
34
+ if (elementWithConditionAppearance) {
35
+ addTodo(recorder, templateOffset);
36
+ }
37
+ }
38
+ exports.migrateButtonAppearance = migrateButtonAppearance;
39
+ function addTodo(recorder, templateOffset) {
40
+ recorder.insertRight(templateOffset, '<!-- Taiga migration TODO: tuiButton "whiteblock-active" appearance is no longer available. Use \'appearance="whiteblock" data-mode="checked"\' -->\n');
41
+ }