@taiga-ui/cdk 4.0.0-alpha.0 → 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 (199) hide show
  1. package/classes/index.d.ts +0 -1
  2. package/constants/used-icons.d.ts +1 -1
  3. package/constants/version.d.ts +1 -1
  4. package/constants/version.js +1 -1
  5. package/esm2022/classes/index.mjs +1 -2
  6. package/esm2022/constants/used-icons.mjs +9 -1
  7. package/esm2022/constants/version.mjs +2 -2
  8. package/esm2022/directives/auto-focus/autofocus.options.mjs +3 -3
  9. package/esm2022/directives/copy-processor/copy-processor.directive.mjs +3 -3
  10. package/esm2022/directives/high-dpi/high-dpi.directive.mjs +3 -3
  11. package/esm2022/directives/obscured/obscured.service.mjs +3 -3
  12. package/esm2022/services/index.mjs +2 -2
  13. package/esm2022/services/scroll.service.mjs +4 -4
  14. package/esm2022/services/theme-color.service.mjs +30 -0
  15. package/esm2022/tokens/active-element.mjs +3 -3
  16. package/esm2022/tokens/environment.mjs +15 -7
  17. package/esm2022/tokens/removed-element.mjs +3 -3
  18. package/esm2022/tokens/window-size.mjs +3 -3
  19. package/esm2022/utils/focus/focused-in.mjs +7 -0
  20. package/esm2022/utils/focus/index.mjs +2 -1
  21. package/fesm2022/taiga-ui-cdk-classes.mjs +1 -15
  22. package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
  23. package/fesm2022/taiga-ui-cdk-constants.mjs +9 -1
  24. package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
  25. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +2 -2
  26. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
  27. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs +2 -2
  28. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs.map +1 -1
  29. package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs +2 -2
  30. package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs.map +1 -1
  31. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +2 -2
  32. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
  33. package/fesm2022/taiga-ui-cdk-services.mjs +22 -25
  34. package/fesm2022/taiga-ui-cdk-services.mjs.map +1 -1
  35. package/fesm2022/taiga-ui-cdk-tokens.mjs +19 -12
  36. package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
  37. package/fesm2022/taiga-ui-cdk-utils-focus.mjs +8 -2
  38. package/fesm2022/taiga-ui-cdk-utils-focus.mjs.map +1 -1
  39. package/package.json +356 -67
  40. package/schematics/ng-update/interfaces/html-comment.d.ts +3 -2
  41. package/schematics/ng-update/interfaces/replacement-attribute-value.d.ts +6 -2
  42. package/schematics/ng-update/interfaces/replacement-identifier.d.ts +4 -10
  43. package/schematics/ng-update/interfaces/replacement-type.d.ts +4 -0
  44. package/schematics/ng-update/steps/rename-types.js +6 -2
  45. package/schematics/ng-update/steps/replace-identifier.js +30 -8
  46. package/schematics/ng-update/steps/replace-package-name.js +4 -5
  47. package/schematics/ng-update/utils/templates/replace-attr-values.js +39 -10
  48. package/schematics/ng-update/utils/templates/template-comments.js +7 -1
  49. package/schematics/ng-update/v4/index.js +9 -1
  50. package/schematics/ng-update/v4/migrate-icons/index.js +2 -2
  51. package/schematics/ng-update/v4/migrate-icons/rename-icons.js +13 -5
  52. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.d.ts +2 -1
  53. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.js +19 -6
  54. package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +3 -2
  55. package/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.js +44 -3
  56. package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +107 -21
  57. package/schematics/ng-update/v4/steps/constants/html-comments.js +9 -0
  58. package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +552 -213
  59. package/schematics/ng-update/v4/steps/constants/index.d.ts +1 -0
  60. package/schematics/ng-update/v4/steps/constants/index.js +1 -0
  61. package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +1 -0
  62. package/schematics/ng-update/v4/steps/constants/migration-warnings.js +20 -0
  63. package/schematics/ng-update/v4/steps/constants/modules-to-remove.js +20 -0
  64. package/schematics/ng-update/v4/steps/constants/modules-to-replace.d.ts +7 -6
  65. package/schematics/ng-update/v4/steps/constants/modules-to-replace.js +1 -0
  66. package/schematics/ng-update/v4/steps/constants/services.d.ts +2 -0
  67. package/schematics/ng-update/v4/steps/constants/services.js +15 -0
  68. package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +14 -2
  69. package/schematics/ng-update/v4/steps/constants/types.js +33 -1
  70. package/schematics/ng-update/v4/steps/index.d.ts +4 -1
  71. package/schematics/ng-update/v4/steps/index.js +4 -1
  72. package/schematics/ng-update/v4/steps/migrate-alert-service.d.ts +2 -0
  73. package/schematics/ng-update/v4/steps/migrate-alert-service.js +110 -0
  74. package/schematics/ng-update/v4/steps/migrate-month-context.d.ts +2 -0
  75. package/schematics/ng-update/v4/steps/migrate-month-context.js +39 -0
  76. package/schematics/ng-update/v4/steps/migrate-number-format-settings.d.ts +2 -0
  77. package/schematics/ng-update/v4/steps/migrate-number-format-settings.js +64 -0
  78. package/schematics/ng-update/v4/steps/migrate-root.d.ts +3 -0
  79. package/schematics/ng-update/v4/steps/migrate-root.js +61 -0
  80. package/schematics/ng-update/v4/steps/migrate-templates.js +10 -2
  81. package/schematics/ng-update/v4/steps/styles/index.js +38 -0
  82. package/schematics/ng-update/v4/steps/styles/migrate-less-scss-constants.d.ts +1 -0
  83. package/schematics/ng-update/v4/steps/styles/migrate-less-scss-constants.js +13 -0
  84. package/schematics/ng-update/v4/steps/styles/migrate-scrollbar-behavior.d.ts +1 -0
  85. package/schematics/ng-update/v4/steps/styles/migrate-scrollbar-behavior.js +10 -0
  86. package/schematics/ng-update/v4/steps/styles/migrate-shadow-mixins.d.ts +1 -0
  87. package/schematics/ng-update/v4/steps/styles/migrate-shadow-mixins.js +23 -0
  88. package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.d.ts +1 -0
  89. package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js +20 -0
  90. package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.d.ts +1 -0
  91. package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.js +54 -0
  92. package/schematics/ng-update/v4/steps/templates/index.d.ts +6 -0
  93. package/schematics/ng-update/v4/steps/templates/index.js +6 -0
  94. package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +10 -5
  95. package/schematics/ng-update/{v3/steps/migrate-polymorpheus.d.ts → v4/steps/templates/migrate-axes.d.ts} +2 -2
  96. package/schematics/ng-update/v4/steps/templates/migrate-axes.js +26 -0
  97. package/schematics/ng-update/v4/steps/templates/migrate-badge.js +15 -6
  98. package/schematics/ng-update/v4/steps/templates/migrate-badged-content.js +1 -1
  99. package/schematics/ng-update/{v3/steps/migrate-textfield-controller.d.ts → v4/steps/templates/migrate-blocked.d.ts} +2 -2
  100. package/schematics/ng-update/v4/steps/templates/migrate-blocked.js +35 -0
  101. package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.d.ts +8 -0
  102. package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.js +41 -0
  103. package/schematics/ng-update/v4/steps/templates/migrate-expandable.js +3 -2
  104. package/schematics/ng-update/v4/steps/templates/migrate-focusable.js +7 -4
  105. package/schematics/ng-update/v4/steps/templates/migrate-label.d.ts +8 -0
  106. package/schematics/ng-update/v4/steps/templates/migrate-label.js +39 -0
  107. package/schematics/ng-update/v4/steps/templates/migrate-labeled.js +5 -7
  108. package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.d.ts +8 -0
  109. package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.js +45 -0
  110. package/schematics/ng-update/v4/steps/templates/migrate-notification.d.ts +8 -0
  111. package/schematics/ng-update/v4/steps/templates/migrate-notification.js +64 -0
  112. package/schematics/ng-update/v4/steps/templates/migrate-number-precision.d.ts +8 -0
  113. package/schematics/ng-update/v4/steps/templates/migrate-number-precision.js +36 -0
  114. package/schematics/ng-update/v4/steps/templates/migrate-overscroll.js +4 -6
  115. package/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.js +2 -1
  116. package/schematics/ng-update/v4/steps/templates/toggles/common.js +3 -2
  117. package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js +36 -0
  118. package/schematics/ng-update/v4/steps/update-packages.js +21 -8
  119. package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.d.ts +1 -11
  120. package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.js +8 -4
  121. package/schematics/utils/get-named-import-references.js +4 -2
  122. package/schematics/utils/templates/elements.js +2 -1
  123. package/schematics/utils/templates/inputs.js +2 -1
  124. package/services/index.d.ts +1 -1
  125. package/services/theme-color.service.d.ts +16 -0
  126. package/tokens/environment.d.ts +1 -0
  127. package/utils/focus/focused-in.d.ts +2 -0
  128. package/utils/focus/index.d.ts +1 -0
  129. package/classes/controller.d.ts +0 -9
  130. package/esm2022/classes/controller.mjs +0 -18
  131. package/esm2022/services/static-request.service.mjs +0 -33
  132. package/schematics/ng-update/v3/constants/breakpoints.d.ts +0 -82
  133. package/schematics/ng-update/v3/constants/breakpoints.js +0 -34
  134. package/schematics/ng-update/v3/constants/constants.d.ts +0 -2
  135. package/schematics/ng-update/v3/constants/constants.js +0 -466
  136. package/schematics/ng-update/v3/constants/deprecated-functions.d.ts +0 -2
  137. package/schematics/ng-update/v3/constants/deprecated-functions.js +0 -680
  138. package/schematics/ng-update/v3/constants/enums.d.ts +0 -2
  139. package/schematics/ng-update/v3/constants/enums.js +0 -284
  140. package/schematics/ng-update/v3/constants/modules.d.ts +0 -2
  141. package/schematics/ng-update/v3/constants/modules.js +0 -9
  142. package/schematics/ng-update/v3/constants/services.d.ts +0 -2
  143. package/schematics/ng-update/v3/constants/services.js +0 -53
  144. package/schematics/ng-update/v3/constants/templates.d.ts +0 -57
  145. package/schematics/ng-update/v3/constants/templates.js +0 -744
  146. package/schematics/ng-update/v3/constants/tui-interactive-selectors.d.ts +0 -1
  147. package/schematics/ng-update/v3/constants/tui-interactive-selectors.js +0 -55
  148. package/schematics/ng-update/v3/constants/types.d.ts +0 -2
  149. package/schematics/ng-update/v3/constants/types.js +0 -156
  150. package/schematics/ng-update/v3/constants/warnings.d.ts +0 -2
  151. package/schematics/ng-update/v3/constants/warnings.js +0 -111
  152. package/schematics/ng-update/v3/index.d.ts +0 -3
  153. package/schematics/ng-update/v3/index.js +0 -105
  154. package/schematics/ng-update/v3/schema.json +0 -13
  155. package/schematics/ng-update/v3/steps/migrate-date-time.d.ts +0 -2
  156. package/schematics/ng-update/v3/steps/migrate-date-time.js +0 -207
  157. package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +0 -78
  158. package/schematics/ng-update/v3/steps/migrate-progress.d.ts +0 -8
  159. package/schematics/ng-update/v3/steps/migrate-progress.js +0 -49
  160. package/schematics/ng-update/v3/steps/migrate-sliders/index.d.ts +0 -3
  161. package/schematics/ng-update/v3/steps/migrate-sliders/index.js +0 -19
  162. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.d.ts +0 -3
  163. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +0 -103
  164. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.d.ts +0 -3
  165. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +0 -90
  166. package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.d.ts +0 -3
  167. package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.js +0 -70
  168. package/schematics/ng-update/v3/steps/migrate-templates.d.ts +0 -4
  169. package/schematics/ng-update/v3/steps/migrate-templates.js +0 -216
  170. package/schematics/ng-update/v3/steps/migrate-textfield-controller.js +0 -98
  171. package/schematics/ng-update/v3/steps/miscellaneous.d.ts +0 -2
  172. package/schematics/ng-update/v3/steps/miscellaneous.js +0 -81
  173. package/schematics/ng-update/v3/steps/replace-functions.d.ts +0 -2
  174. package/schematics/ng-update/v3/steps/replace-functions.js +0 -138
  175. package/schematics/ng-update/v3/steps/replace-styles.d.ts +0 -3
  176. package/schematics/ng-update/v3/steps/replace-styles.js +0 -33
  177. package/schematics/ng-update/v3-30/constants/constants.d.ts +0 -2
  178. package/schematics/ng-update/v3-30/constants/constants.js +0 -8
  179. package/schematics/ng-update/v3-30/constants/icons.d.ts +0 -4
  180. package/schematics/ng-update/v3-30/constants/icons.js +0 -993
  181. package/schematics/ng-update/v3-30/index.d.ts +0 -3
  182. package/schematics/ng-update/v3-30/index.js +0 -33
  183. package/schematics/ng-update/v3-35/constants/constants.d.ts +0 -2
  184. package/schematics/ng-update/v3-35/constants/constants.js +0 -8
  185. package/schematics/ng-update/v3-35/constants/icons.d.ts +0 -4
  186. package/schematics/ng-update/v3-35/constants/icons.js +0 -2537
  187. package/schematics/ng-update/v3-35/index.d.ts +0 -3
  188. package/schematics/ng-update/v3-35/index.js +0 -33
  189. package/schematics/ng-update/v3-36/index.d.ts +0 -3
  190. package/schematics/ng-update/v3-36/index.js +0 -23
  191. package/schematics/ng-update/v3-40/index.d.ts +0 -3
  192. package/schematics/ng-update/v3-40/index.js +0 -62
  193. package/schematics/ng-update/v3-5/index.d.ts +0 -3
  194. package/schematics/ng-update/v3-5/index.js +0 -20
  195. package/schematics/ng-update/v3-5/steps/migrate-expand-templates.d.ts +0 -3
  196. package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +0 -44
  197. package/schematics/ng-update/v4/steps/migrate-styles.js +0 -20
  198. package/services/static-request.service.d.ts +0 -8
  199. /package/schematics/ng-update/v4/steps/{migrate-styles.d.ts → styles/index.d.ts} +0 -0
@@ -6,4 +6,5 @@ export * from './identifiers-to-replace';
6
6
  export * from './inputs-to-remove';
7
7
  export * from './migration-warnings';
8
8
  export * from './modules-to-remove';
9
+ export * from './services';
9
10
  export * from './tags-to-replace';
@@ -9,4 +9,5 @@ tslib_1.__exportStar(require("./identifiers-to-replace"), exports);
9
9
  tslib_1.__exportStar(require("./inputs-to-remove"), exports);
10
10
  tslib_1.__exportStar(require("./migration-warnings"), exports);
11
11
  tslib_1.__exportStar(require("./modules-to-remove"), exports);
12
+ tslib_1.__exportStar(require("./services"), exports);
12
13
  tslib_1.__exportStar(require("./tags-to-replace"), exports);
@@ -7,6 +7,7 @@ exports.INPUTS_TO_REMOVE = [
7
7
  { inputName: 'showLoader', tags: ['tui-toggle'] },
8
8
  { inputName: 'singleColor', tags: ['tui-toggle'] },
9
9
  { inputName: 'hoverable', tags: ['tui-badge'] },
10
+ { inputName: 'singleColor', tags: ['tui-money'] },
10
11
  {
11
12
  inputName: 'iconAlign',
12
13
  tags: ['button', 'a'],
@@ -147,4 +147,24 @@ exports.MIGRATION_WARNINGS = [
147
147
  moduleSpecifier: '@taiga-ui/kit',
148
148
  message: 'TUI_ARROW is deprecated, Use tuiChevron directive instead. See example https://taiga-ui.dev/components/data-list#links',
149
149
  },
150
+ {
151
+ name: 'TuiMoneyComponent',
152
+ moduleSpecifier: '@taiga-ui/addon-commerce',
153
+ message: 'TuiMoneyComponent is deprecated, Use tuiAmount pipe instead. See example https://taiga-ui.dev/pipes/amount',
154
+ },
155
+ {
156
+ name: 'TuiIllustrationsModule',
157
+ moduleSpecifier: '@taiga-ui/proprietary-icons',
158
+ message: 'TuiIllustrationsModule was deleted. Import TuiIconPipe and use <img [src]="icon | tuiIcon" /> instead. See https://taiga-ui.tcsbank.ru/icons',
159
+ },
160
+ {
161
+ name: 'TuiIllustrationsPipe',
162
+ moduleSpecifier: '@taiga-ui/proprietary-icons',
163
+ message: 'TuiIllustrationsPipe was deleted. Import TuiIconPipe and use <img [src]="icon | tuiIcon" /> instead. See https://taiga-ui.tcsbank.ru/icons',
164
+ },
165
+ {
166
+ name: 'TuiIllustrationModePipe',
167
+ moduleSpecifier: '@taiga-ui/proprietary-icons',
168
+ message: 'TuiIllustrationModePipe was deleted. Import TuiIconPipe and use <img [src]="icon | tuiIcon" /> instead. See https://taiga-ui.tcsbank.ru/icons',
169
+ },
150
170
  ];
@@ -14,6 +14,18 @@ exports.MODULES_TO_REMOVE = [
14
14
  name: 'TuiFocusableModule',
15
15
  moduleSpecifier: '@taiga-ui/cdk',
16
16
  },
17
+ {
18
+ name: 'TuiPromptDialogModule',
19
+ moduleSpecifier: '@taiga-ui/proprietary-core',
20
+ },
21
+ {
22
+ name: 'TuiPromptModule',
23
+ moduleSpecifier: '@taiga-ui/kit',
24
+ },
25
+ {
26
+ name: 'TuiThemeTinkoff2023NightModule',
27
+ moduleSpecifier: '@taiga-ui/proprietary-core',
28
+ },
17
29
  {
18
30
  name: 'TuiOverscrollModule',
19
31
  moduleSpecifier: '@taiga-ui/cdk',
@@ -26,4 +38,12 @@ exports.MODULES_TO_REMOVE = [
26
38
  name: 'TuiModeModule',
27
39
  moduleSpecifier: '@taiga-ui/core',
28
40
  },
41
+ {
42
+ name: 'TuiIconsModule',
43
+ moduleSpecifier: '@taiga-ui/experimental',
44
+ },
45
+ {
46
+ name: 'TuiMobileTabsModule',
47
+ moduleSpecifier: '@taiga-ui/addon-mobile',
48
+ },
29
49
  ];
@@ -1,12 +1,13 @@
1
- interface ModuleToReplace {
1
+ export interface ProviderToReplace {
2
+ name: string;
3
+ providerSpecifier: string;
4
+ isFunction?: boolean;
5
+ }
6
+ export interface ModuleToReplace {
2
7
  from: {
3
8
  name: string;
4
9
  moduleSpecifier: string;
5
10
  };
6
- to: {
7
- name: string;
8
- providerSpecifier: string;
9
- };
11
+ to: ProviderToReplace | ProviderToReplace[];
10
12
  }
11
13
  export declare const MODULES_TO_REPLACE_WITH_PROVIDERS: ModuleToReplace[];
12
- export {};
@@ -10,6 +10,7 @@ exports.MODULES_TO_REPLACE_WITH_PROVIDERS = [
10
10
  to: {
11
11
  name: 'tuiProvideMobileCalendar',
12
12
  providerSpecifier: '@taiga-ui/addon-mobile',
13
+ isFunction: true,
13
14
  },
14
15
  },
15
16
  ];
@@ -0,0 +1,2 @@
1
+ import type { ReplacementService } from '../../../interfaces';
2
+ export declare const SERVICES_TO_REPLACE: ReplacementService[];
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SERVICES_TO_REPLACE = void 0;
4
+ exports.SERVICES_TO_REPLACE = [
5
+ {
6
+ from: { name: 'TuiDialogFormService', moduleSpecifier: '@taiga-ui/kit' },
7
+ to: { name: 'TuiConfirmService', moduleSpecifier: '@taiga-ui/kit' },
8
+ replaceMethods: [
9
+ {
10
+ from: 'withPrompt',
11
+ to: 'withConfirm',
12
+ },
13
+ ],
14
+ },
15
+ ];
@@ -1,20 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TAGS_TO_REPLACE = void 0;
4
+ const elements_1 = require("../../../../utils/templates/elements");
4
5
  exports.TAGS_TO_REPLACE = [
5
6
  { from: 'tui-card', to: 'tui-thumbnail-card' },
6
7
  { from: 'tui-text-area', to: 'tui-textarea' },
8
+ { from: 'tui-svg', to: 'tui-icon' },
7
9
  {
8
10
  from: 'tui-input-count',
9
11
  to: 'tui-input-number',
10
12
  addAttributes: ['decimal="never"'],
11
- filterFn: (element) => element.attrs.some((attr) => attr.name === '[step]'),
13
+ filterFn: (element) => (0, elements_1.hasElementAttribute)(element, 'step'),
12
14
  },
13
15
  {
14
16
  from: 'tui-input-count',
15
17
  to: 'tui-input-number',
16
18
  addAttributes: ['decimal="never"', '[step]="1"'],
17
- filterFn: (element) => element.attrs.every((attr) => attr.name !== '[step]'),
19
+ filterFn: (element) => !(0, elements_1.hasElementAttribute)(element, 'step'),
18
20
  },
19
21
  {
20
22
  from: 'tui-money',
@@ -30,6 +32,16 @@ exports.TAGS_TO_REPLACE = [
30
32
  to: 'input',
31
33
  addAttributes: ['tuiRadio', 'type="radio"'],
32
34
  },
35
+ {
36
+ from: 'tui-checkbox-block',
37
+ to: 'input',
38
+ addAttributes: ['tuiCheckbox', 'type="checkbox"'],
39
+ },
40
+ {
41
+ from: 'tui-radio-block',
42
+ to: 'input',
43
+ addAttributes: ['tuiRadio', 'type="radio"'],
44
+ },
33
45
  {
34
46
  from: 'tui-hosted-dropdown',
35
47
  to: 'div',
@@ -4,9 +4,12 @@ exports.TYPES_TO_RENAME = void 0;
4
4
  exports.TYPES_TO_RENAME = [
5
5
  {
6
6
  from: 'TuiDocExample',
7
- to: 'Record<string, string | Promise<unknown>>',
7
+ to: 'Record<string, TuiRawLoaderContent>',
8
8
  moduleSpecifier: ['@taiga-ui/addon-doc'],
9
9
  removeImport: true,
10
+ newImports: [
11
+ { name: 'TuiRawLoaderContent', moduleSpecifier: '@taiga-ui/addon-doc' },
12
+ ],
10
13
  },
11
14
  {
12
15
  from: 'TuiBrightness',
@@ -14,4 +17,33 @@ exports.TYPES_TO_RENAME = [
14
17
  moduleSpecifier: ['@taiga-ui/core'],
15
18
  removeImport: true,
16
19
  },
20
+ {
21
+ from: 'TuiIllustrationName',
22
+ moduleSpecifier: ['@taiga-ui/proprietary-icons'],
23
+ to: 'string',
24
+ removeImport: true,
25
+ },
26
+ {
27
+ from: 'TuiIllustrationCategory',
28
+ moduleSpecifier: ['@taiga-ui/proprietary-icons'],
29
+ to: 'string',
30
+ removeImport: true,
31
+ },
32
+ {
33
+ from: 'TuiNotificationT',
34
+ moduleSpecifier: ['@taiga-ui/core'],
35
+ to: 'string',
36
+ removeImport: true,
37
+ },
38
+ {
39
+ from: 'TuiMarkerIconMode',
40
+ moduleSpecifier: ['@taiga-ui/kit'],
41
+ to: 'string',
42
+ removeImport: true,
43
+ },
44
+ {
45
+ from: 'TuiOperationIcon',
46
+ moduleSpecifier: ['@taiga-ui/proprietary-banking'],
47
+ to: 'TuiFeedItemIcon',
48
+ },
17
49
  ];
@@ -1,10 +1,13 @@
1
+ export * from './migrate-alert-service';
1
2
  export * from './migrate-all-country-iso-codes';
2
3
  export * from './migrate-destroy-service';
3
4
  export * from './migrate-legacy-mask';
5
+ export * from './migrate-month-context';
6
+ export * from './migrate-number-format-settings';
4
7
  export * from './migrate-option-providers';
5
8
  export * from './migrate-proprietary';
6
- export * from './migrate-styles';
7
9
  export * from './migrate-templates';
8
10
  export * from './restore-tui-mapper';
9
11
  export * from './restore-tui-matcher';
12
+ export * from './styles';
10
13
  export * from './update-packages';
@@ -1,13 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./migrate-alert-service"), exports);
4
5
  tslib_1.__exportStar(require("./migrate-all-country-iso-codes"), exports);
5
6
  tslib_1.__exportStar(require("./migrate-destroy-service"), exports);
6
7
  tslib_1.__exportStar(require("./migrate-legacy-mask"), exports);
8
+ tslib_1.__exportStar(require("./migrate-month-context"), exports);
9
+ tslib_1.__exportStar(require("./migrate-number-format-settings"), exports);
7
10
  tslib_1.__exportStar(require("./migrate-option-providers"), exports);
8
11
  tslib_1.__exportStar(require("./migrate-proprietary"), exports);
9
- tslib_1.__exportStar(require("./migrate-styles"), exports);
10
12
  tslib_1.__exportStar(require("./migrate-templates"), exports);
11
13
  tslib_1.__exportStar(require("./restore-tui-mapper"), exports);
12
14
  tslib_1.__exportStar(require("./restore-tui-matcher"), exports);
15
+ tslib_1.__exportStar(require("./styles"), exports);
13
16
  tslib_1.__exportStar(require("./update-packages"), exports);
@@ -0,0 +1,2 @@
1
+ import type { TuiSchema } from '../../../ng-add/schema';
2
+ export declare function migrateAlertService(options: TuiSchema): void;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateAlertService = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ const colored_log_1 = require("../../../utils/colored-log");
6
+ const get_named_import_references_1 = require("../../../utils/get-named-import-references");
7
+ const OPTIONS_MIGRATIONS = {
8
+ autoClose: (property) => {
9
+ const [propertyKey, propertyValue] = property.getText().split(/\s?:\s?/);
10
+ switch (propertyValue) {
11
+ case 'true':
12
+ return property.replaceWithText(`${propertyKey}: 3_000`);
13
+ case 'false':
14
+ return property.replaceWithText(`${propertyKey}: 0`);
15
+ default:
16
+ return null;
17
+ }
18
+ },
19
+ defaultAutoCloseTime: (property) => property.replaceWithText(property.getText().replace('defaultAutoCloseTime', 'autoClose')),
20
+ status: (property) => property.replaceWithText(property.getText().replace('status', 'appearance')),
21
+ hasCloseButton: (property) => property.replaceWithText(property.getText().replace('hasCloseButton', 'closeable')),
22
+ hasIcon: (property) => {
23
+ const [, propertyValue] = property.getText().split(/\s?:\s?/);
24
+ switch (propertyValue) {
25
+ case 'false':
26
+ return property.replaceWithText("icon: ''");
27
+ case 'true':
28
+ return property.remove();
29
+ default:
30
+ return property.replaceWithText(`// TODO: (Taiga UI migration) "hasIcon" is deleted. Use "icon: ''" to hide icon. Use "icon: TUI_NOTIFICATION_DEFAULT_OPTIONS['icon']" to show it.\n${property.getText()}`);
31
+ }
32
+ },
33
+ };
34
+ function migrateAlertService(options) {
35
+ !options['skip-logs'] &&
36
+ (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing inject(TuiAlertService).open({autoClose: boolean})...`);
37
+ const alertServiceRefs = (0, get_named_import_references_1.getNamedImportReferences)('TuiAlertService', '@taiga-ui/core');
38
+ // inject(TuiAlertService).open(...)
39
+ const viaDirectInjects = alertServiceRefs.map((x) => x.getFirstAncestor((node) => node.isKind(ng_morph_1.SyntaxKind.CallExpression) &&
40
+ node.getFullText().includes('inject(TuiAlertService') &&
41
+ node.getFullText().includes('.open')));
42
+ // readonly alertService = inject(TuiAlertService);
43
+ const viaClassProperty = alertServiceRefs
44
+ .map((x) => {
45
+ var _a;
46
+ return (_a = x
47
+ .getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyDeclaration)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes();
48
+ })
49
+ .flat()
50
+ .map(toAlertServiceOpenCallExpression);
51
+ // constructor(private readonly legacyWayService: TuiAlertService) {}
52
+ const viaConstructorParam = alertServiceRefs
53
+ .map((x) => { var _a; return (_a = x.getFirstAncestorByKind(ng_morph_1.SyntaxKind.Parameter)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes(); })
54
+ .flat()
55
+ .map(toAlertServiceOpenCallExpression);
56
+ const inlineAlertOptions = [
57
+ ...viaDirectInjects,
58
+ ...viaClassProperty,
59
+ ...viaConstructorParam,
60
+ ]
61
+ .map((callExpression) => {
62
+ if (!callExpression || callExpression.wasForgotten()) {
63
+ return;
64
+ }
65
+ const [, arg] = callExpression.getArguments();
66
+ return (arg === null || arg === void 0 ? void 0 : arg.isKind(ng_morph_1.SyntaxKind.PropertyAccessExpression))
67
+ ? findOptionsInitializer(arg)
68
+ : arg;
69
+ })
70
+ .filter(ng_morph_1.Node.isObjectLiteralExpression);
71
+ const standaloneAlertOptions = (0, get_named_import_references_1.getNamedImportReferences)('TuiAlertOptions', '@taiga-ui/core')
72
+ .map((n) => {
73
+ const type = n.getFirstAncestorByKind(ng_morph_1.SyntaxKind.TypeReference);
74
+ const siblings = [
75
+ ...((type === null || type === void 0 ? void 0 : type.getPreviousSiblings()) || []),
76
+ ...((type === null || type === void 0 ? void 0 : type.getNextSiblings()) || []),
77
+ ];
78
+ return siblings.find(ng_morph_1.Node.isObjectLiteralExpression);
79
+ })
80
+ .filter((x) => !!x);
81
+ [...inlineAlertOptions, ...standaloneAlertOptions].forEach((options) => {
82
+ Object.entries(OPTIONS_MIGRATIONS).forEach(([propertyName, migration]) => {
83
+ const property = options.getProperty(propertyName);
84
+ if (!property) {
85
+ return;
86
+ }
87
+ const isShorthandPropertyAssignment = ng_morph_1.Node.isShorthandPropertyAssignment(property) &&
88
+ !property.hasObjectAssignmentInitializer();
89
+ const previousPropertyText = property.getText();
90
+ migration(property);
91
+ if (isShorthandPropertyAssignment && !property.wasForgotten()) {
92
+ property.replaceWithText(`${property.getText()}: ${previousPropertyText}`);
93
+ }
94
+ });
95
+ });
96
+ !options['skip-logs'] &&
97
+ (0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} "true => 3_000" & "false => 0" were replaced \n`);
98
+ }
99
+ exports.migrateAlertService = migrateAlertService;
100
+ function toAlertServiceOpenCallExpression(node) {
101
+ return node === null || node === void 0 ? void 0 : node.getFirstAncestor((x) => x.isKind(ng_morph_1.SyntaxKind.CallExpression) && x.getFullText().includes('.open'));
102
+ }
103
+ function findOptionsInitializer(ref) {
104
+ var _a;
105
+ return (_a = ref === null || ref === void 0 ? void 0 : ref.getFirstChildByKind(ng_morph_1.SyntaxKind.Identifier)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes().map((n) => {
106
+ var _a;
107
+ return (_a = n
108
+ .getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyDeclaration)) === null || _a === void 0 ? void 0 : _a.getFirstChildByKind(ng_morph_1.SyntaxKind.ObjectLiteralExpression);
109
+ }).find(Boolean);
110
+ }
@@ -0,0 +1,2 @@
1
+ import type { TuiSchema } from '../../../ng-add/schema';
2
+ export declare function migrateMonthContext(options: TuiSchema): void;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateMonthContext = 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 migrateMonthContext(options) {
10
+ !options['skip-logs'] &&
11
+ (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating TuiBooleanHandlerWithContext<TuiMonth, TuiMonthContext> ...`);
12
+ const monthContextRefs = (0, get_named_import_references_1.getNamedImportReferences)('TuiMonthContext', '@taiga-ui/kit');
13
+ monthContextRefs
14
+ .map((n) => n.getFirstAncestorByKind(ng_morph_1.SyntaxKind.TypeReference))
15
+ .forEach((ref) => {
16
+ if (!ref || ref.wasForgotten()) {
17
+ return;
18
+ }
19
+ const booleanHandlerWithContext = ref.getFirstAncestor((node) => node.isKind(ng_morph_1.SyntaxKind.TypeReference) &&
20
+ !!node
21
+ .getText()
22
+ .match(/TuiBooleanHandlerWithContext<\s*TuiMonth\s*,\s*TuiMonthContext\s*>/));
23
+ if (!booleanHandlerWithContext) {
24
+ return;
25
+ }
26
+ booleanHandlerWithContext.replaceWithText('TuiBooleanHandler<TuiMonth>');
27
+ (0, add_unique_import_1.addUniqueImport)(booleanHandlerWithContext.getSourceFile().getFilePath(), 'TuiBooleanHandler', '@taiga-ui/cdk');
28
+ });
29
+ [
30
+ ...monthContextRefs,
31
+ ...(0, get_named_import_references_1.getNamedImportReferences)('TuiBooleanHandlerWithContext', '@taiga-ui/kit'),
32
+ ]
33
+ .map((node) => !node.wasForgotten() &&
34
+ node.getFirstAncestorByKind(ng_morph_1.SyntaxKind.ImportSpecifier))
35
+ .filter((x) => !!x)
36
+ .forEach(import_manipulations_1.removeImport);
37
+ !options['skip-logs'] && (0, colored_log_1.titleLog)(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
38
+ }
39
+ exports.migrateMonthContext = migrateMonthContext;
@@ -0,0 +1,2 @@
1
+ import type { TuiSchema } from '../../../ng-add/schema';
2
+ export declare function migrateNumberFormatSettings(options: TuiSchema): void;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateNumberFormatSettings = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ const colored_log_1 = require("../../../utils/colored-log");
6
+ const get_named_import_references_1 = require("../../../utils/get-named-import-references");
7
+ const OPTIONS_MIGRATIONS = {
8
+ decimalLimit: (property) => property.replaceWithText(property.getText().replace('decimalLimit', 'precision')),
9
+ decimal: (property) => {
10
+ const [, propertyValue] = property.getText().split(/\s?:\s?/);
11
+ property.replaceWithText(propertyValue.match(/^['"`]never['"`]$/)
12
+ ? 'precision: 0'
13
+ : property.getText().replace('decimal', 'decimalMode'));
14
+ },
15
+ zeroPadding: (property) => {
16
+ const [, propertyValue] = property.getText().split(/\s?:\s?/);
17
+ if (propertyValue === 'true') {
18
+ property.replaceWithText('decimalMode: "always"');
19
+ }
20
+ else {
21
+ property.replaceWithText(`// TODO: (Taiga UI migration) "zeroPadding" is deleted. Use "decimalMode" instead https://taiga-ui.dev/pipes/format-number/API \n${property.getText()}`);
22
+ }
23
+ },
24
+ };
25
+ function migrateNumberFormatSettings(options) {
26
+ !options['skip-logs'] &&
27
+ (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating TuiNumberFormatSettings...`);
28
+ const asFunctionArgument = [
29
+ ...(0, get_named_import_references_1.getNamedImportReferences)('tuiFormatNumber', '@taiga-ui/core'),
30
+ ...(0, get_named_import_references_1.getNamedImportReferences)('tuiNumberFormatProvider', '@taiga-ui/core'),
31
+ ].map((n) => {
32
+ var _a;
33
+ return (_a = n
34
+ .getFirstAncestorByKind(ng_morph_1.SyntaxKind.CallExpression)) === null || _a === void 0 ? void 0 : _a.getFirstDescendantByKind(ng_morph_1.SyntaxKind.ObjectLiteralExpression);
35
+ });
36
+ const asStandaloneSettingsObject = (0, get_named_import_references_1.getNamedImportReferences)('TuiNumberFormatSettings', '@taiga-ui/core').map((n) => {
37
+ const type = n.getFirstAncestorByKind(ng_morph_1.SyntaxKind.TypeReference);
38
+ const siblings = [
39
+ ...((type === null || type === void 0 ? void 0 : type.getPreviousSiblings()) || []),
40
+ ...((type === null || type === void 0 ? void 0 : type.getNextSiblings()) || []),
41
+ ];
42
+ return siblings.find(ng_morph_1.Node.isObjectLiteralExpression);
43
+ });
44
+ [...asFunctionArgument, ...asStandaloneSettingsObject]
45
+ .filter(ng_morph_1.Node.isObjectLiteralExpression)
46
+ .forEach((options) => {
47
+ Object.entries(OPTIONS_MIGRATIONS).forEach(([propertyName, migration]) => {
48
+ const property = options.getProperty(propertyName);
49
+ if (!property) {
50
+ return;
51
+ }
52
+ const isShorthandPropertyAssignment = ng_morph_1.Node.isShorthandPropertyAssignment(property) &&
53
+ !property.hasObjectAssignmentInitializer();
54
+ const previousPropertyText = property.getText();
55
+ migration(property);
56
+ if (isShorthandPropertyAssignment && !property.wasForgotten()) {
57
+ property.replaceWithText(`${property.getText()}: ${previousPropertyText}`);
58
+ }
59
+ });
60
+ });
61
+ !options['skip-logs'] &&
62
+ (0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} migration of TuiNumberFormatSettings completes \n`);
63
+ }
64
+ exports.migrateNumberFormatSettings = migrateNumberFormatSettings;
@@ -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,7 +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_overscroll_1 = require("./templates/migrate-overscroll");
13
+ const migrate_blocked_1 = require("./templates/migrate-blocked");
14
+ const migrate_number_precision_1 = require("./templates/migrate-number-precision");
14
15
  function getAction({ action, requiredData, }) {
15
16
  return ({ resource, fileSystem, recorder, }) => action({ resource, fileSystem, recorder, data: requiredData });
16
17
  }
@@ -28,6 +29,7 @@ function migrateTemplates(fileSystem, options) {
28
29
  getAction({ action: templates_1.replaceAttrs, requiredData: constants_2.ATTRS_TO_REPLACE }),
29
30
  getAction({ action: templates_1.replaceAttrValues, requiredData: constants_2.ATTR_WITH_VALUES_TO_REPLACE }),
30
31
  getAction({ action: templates_1.removeInputs, requiredData: constants_2.INPUTS_TO_REMOVE }),
32
+ templates_2.migrateAxes,
31
33
  templates_2.migrateBadge,
32
34
  templates_2.migrateCheckbox,
33
35
  templates_2.migrateFocusable,
@@ -37,11 +39,17 @@ function migrateTemplates(fileSystem, options) {
37
39
  templates_2.migrateExpandable,
38
40
  templates_2.migrateBadgedContent,
39
41
  templates_2.migratePreventDefault,
42
+ templates_2.migrateMobileTabs,
40
43
  templates_2.migrateMoney,
41
44
  templates_2.migrateLabeled,
45
+ migrate_blocked_1.migrateBlocked,
42
46
  templates_2.migrateProgressSegmented,
43
47
  templates_2.migrateThumbnailCard,
44
- migrate_overscroll_1.migrateOverscroll,
48
+ templates_2.migrateOverscroll,
49
+ templates_2.migrateButtonAppearance,
50
+ templates_2.migrateLabel,
51
+ migrate_number_precision_1.migrateNumberPrecision,
52
+ templates_2.migrateNotification,
45
53
  ];
46
54
  const progressLog = (0, progress_1.setupProgressLogger)({
47
55
  total: componentWithTemplatesPaths.length,
@@ -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;