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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/classes/control.d.ts +1 -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/directives/auto-focus/autofocus.options.d.ts +1 -1
  6. package/directives/for/for.directive.d.ts +3 -3
  7. package/directives/platform/platform.directive.d.ts +1 -1
  8. package/directives/value-changes/value-changes.directive.d.ts +3 -3
  9. package/esm2022/classes/control.mjs +2 -2
  10. package/esm2022/constants/used-icons.mjs +6 -6
  11. package/esm2022/constants/version.mjs +2 -2
  12. package/esm2022/directives/active-zone/active-zone.directive.mjs +2 -2
  13. package/esm2022/directives/auto-focus/handlers/ios.handler.mjs +3 -3
  14. package/esm2022/directives/click-outside/click-outside.directive.mjs +2 -2
  15. package/esm2022/directives/droppable/droppable.directive.mjs +3 -3
  16. package/esm2022/directives/for/for.directive.mjs +6 -6
  17. package/esm2022/directives/hovered/hovered.service.mjs +2 -2
  18. package/esm2022/directives/obscured/obscured.directive.mjs +2 -2
  19. package/esm2022/directives/obscured/obscured.service.mjs +2 -2
  20. package/esm2022/directives/pan/pan.service.mjs +2 -2
  21. package/esm2022/directives/platform/platform.directive.mjs +6 -6
  22. package/esm2022/directives/swipe/swipe.service.mjs +2 -2
  23. package/esm2022/directives/value-changes/value-changes.directive.mjs +6 -6
  24. package/esm2022/directives/zoom/zoom.service.mjs +4 -4
  25. package/esm2022/observables/control-value.mjs +2 -2
  26. package/esm2022/observables/drag-and-drop-from.mjs +2 -2
  27. package/esm2022/observables/events.mjs +3 -3
  28. package/esm2022/observables/if-map.mjs +2 -2
  29. package/esm2022/observables/must-be-present.mjs +2 -2
  30. package/esm2022/observables/zone.mjs +4 -4
  31. package/esm2022/pipes/filter/filter.pipe.mjs +2 -2
  32. package/esm2022/services/popover.service.mjs +3 -3
  33. package/esm2022/services/scroll.service.mjs +2 -2
  34. package/esm2022/services/static-request.service.mjs +1 -1
  35. package/esm2022/tokens/active-element.mjs +3 -3
  36. package/esm2022/tokens/removed-element.mjs +2 -2
  37. package/esm2022/utils/color/get-gradient-data.mjs +6 -0
  38. package/esm2022/utils/color/hex-to-rgb.mjs +2 -2
  39. package/esm2022/utils/color/index.mjs +3 -1
  40. package/esm2022/utils/color/parse-color.mjs +3 -3
  41. package/esm2022/utils/color/parse-gradient.mjs +70 -0
  42. package/esm2022/utils/color/rgb-to-hex.mjs +2 -2
  43. package/esm2022/utils/dom/get-element-obscurers.mjs +2 -2
  44. package/esm2022/utils/dom/get-element-point.mjs +6 -0
  45. package/esm2022/utils/dom/index.mjs +2 -1
  46. package/esm2022/utils/miscellaneous/mark-control-as-touched-and-validate.mjs +3 -3
  47. package/esm2022/utils/miscellaneous/with-styles.mjs +2 -2
  48. package/fesm2022/taiga-ui-cdk-classes.mjs +1 -1
  49. package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
  50. package/fesm2022/taiga-ui-cdk-constants.mjs +6 -6
  51. package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
  52. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +1 -1
  53. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
  54. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +2 -2
  55. package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
  56. package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +1 -1
  57. package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +1 -1
  58. package/fesm2022/taiga-ui-cdk-directives-droppable.mjs +2 -2
  59. package/fesm2022/taiga-ui-cdk-directives-droppable.mjs.map +1 -1
  60. package/fesm2022/taiga-ui-cdk-directives-for.mjs +5 -5
  61. package/fesm2022/taiga-ui-cdk-directives-for.mjs.map +1 -1
  62. package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +1 -1
  63. package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
  64. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +2 -2
  65. package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
  66. package/fesm2022/taiga-ui-cdk-directives-pan.mjs +1 -1
  67. package/fesm2022/taiga-ui-cdk-directives-pan.mjs.map +1 -1
  68. package/fesm2022/taiga-ui-cdk-directives-platform.mjs +5 -5
  69. package/fesm2022/taiga-ui-cdk-directives-platform.mjs.map +1 -1
  70. package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +1 -1
  71. package/fesm2022/taiga-ui-cdk-directives-swipe.mjs.map +1 -1
  72. package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +5 -5
  73. package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs.map +1 -1
  74. package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +3 -3
  75. package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
  76. package/fesm2022/taiga-ui-cdk-observables.mjs +9 -9
  77. package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
  78. package/fesm2022/taiga-ui-cdk-pipes-filter.mjs +1 -1
  79. package/fesm2022/taiga-ui-cdk-pipes-filter.mjs.map +1 -1
  80. package/fesm2022/taiga-ui-cdk-services.mjs +3 -3
  81. package/fesm2022/taiga-ui-cdk-services.mjs.map +1 -1
  82. package/fesm2022/taiga-ui-cdk-tokens.mjs +3 -3
  83. package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
  84. package/fesm2022/taiga-ui-cdk-utils-color.mjs +80 -5
  85. package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +1 -1
  86. package/fesm2022/taiga-ui-cdk-utils-dom.mjs +7 -2
  87. package/fesm2022/taiga-ui-cdk-utils-dom.mjs.map +1 -1
  88. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +3 -3
  89. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
  90. package/package.json +67 -357
  91. package/schematics/migration.json +3 -3
  92. package/schematics/ng-add/constants/modules.d.ts +0 -1
  93. package/schematics/ng-add/constants/modules.js +1 -11
  94. package/schematics/ng-add/constants/versions.d.ts +0 -1
  95. package/schematics/ng-add/constants/versions.js +1 -2
  96. package/schematics/ng-add/index.js +1 -7
  97. package/schematics/ng-add/schema.d.ts +0 -1
  98. package/schematics/ng-add/schema.json +0 -27
  99. package/schematics/ng-add/steps/add-taiga-icons.js +1 -1
  100. package/schematics/ng-add/steps/add-taiga-modules.js +7 -22
  101. package/schematics/ng-update/interfaces/replacement-type.d.ts +1 -0
  102. package/schematics/ng-update/steps/icons/replace-imports.js +5 -5
  103. package/schematics/ng-update/steps/index.d.ts +1 -0
  104. package/schematics/ng-update/steps/index.js +1 -0
  105. package/schematics/ng-update/steps/remove-module.js +2 -2
  106. package/schematics/ng-update/steps/rename-types.js +7 -7
  107. package/schematics/ng-update/steps/replace-deep-import.js +2 -2
  108. package/schematics/ng-update/steps/replace-enums.js +2 -2
  109. package/schematics/ng-update/steps/replace-identifier.js +1 -1
  110. package/schematics/ng-update/steps/replace-package-name.d.ts +5 -0
  111. package/schematics/ng-update/steps/replace-package-name.js +19 -0
  112. package/schematics/ng-update/steps/replace-services.js +5 -5
  113. package/schematics/ng-update/steps/show-warnings.js +4 -4
  114. package/schematics/ng-update/utils/replace-text.js +1 -1
  115. package/schematics/ng-update/utils/templates/replace-attr-values.js +3 -3
  116. package/schematics/ng-update/utils/templates/replace-attrs.js +1 -1
  117. package/schematics/ng-update/utils/templates/template-comments.js +4 -2
  118. package/schematics/ng-update/v3/constants/templates.js +9 -9
  119. package/schematics/ng-update/v3/index.js +1 -1
  120. package/schematics/ng-update/v3/steps/migrate-date-time.js +10 -10
  121. package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +8 -8
  122. package/schematics/ng-update/v3/steps/migrate-progress.js +4 -4
  123. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +3 -3
  124. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +4 -4
  125. package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.js +2 -2
  126. package/schematics/ng-update/v3/steps/migrate-templates.js +16 -16
  127. package/schematics/ng-update/v3/steps/migrate-textfield-controller.js +8 -8
  128. package/schematics/ng-update/v3/steps/miscellaneous.js +5 -5
  129. package/schematics/ng-update/v3/steps/replace-functions.js +12 -12
  130. package/schematics/ng-update/v3/steps/replace-styles.js +2 -2
  131. package/schematics/ng-update/v3-36/index.js +7 -17
  132. package/schematics/ng-update/v3-40/index.js +1 -1
  133. package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +4 -4
  134. package/schematics/ng-update/v4/index.js +11 -6
  135. package/schematics/ng-update/v4/migrate-css-vars/palette.d.ts +11 -2
  136. package/schematics/ng-update/v4/migrate-css-vars/palette.js +18 -8
  137. package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +10 -2
  138. package/schematics/ng-update/v4/migrate-icons/index.js +8 -6
  139. package/schematics/ng-update/v4/migrate-icons/rename-icons.js +2 -2
  140. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.d.ts +2 -0
  141. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.js +66 -0
  142. package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +3 -3
  143. package/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.js +9 -1
  144. package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +10 -9
  145. package/schematics/ng-update/v4/steps/constants/enums.js +31 -0
  146. package/schematics/ng-update/v4/steps/constants/html-comments.js +10 -0
  147. package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +884 -123
  148. package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +1 -1
  149. package/schematics/ng-update/v4/steps/constants/migration-warnings.js +5 -0
  150. package/schematics/ng-update/v4/steps/constants/modules-to-remove.js +12 -0
  151. package/schematics/ng-update/v4/steps/constants/modules-to-replace.d.ts +12 -0
  152. package/schematics/ng-update/v4/steps/constants/modules-to-replace.js +15 -0
  153. package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +5 -4
  154. package/schematics/ng-update/v4/steps/constants/types.d.ts +2 -0
  155. package/schematics/ng-update/v4/steps/constants/types.js +17 -0
  156. package/schematics/ng-update/v4/steps/index.d.ts +4 -0
  157. package/schematics/ng-update/v4/steps/index.js +4 -0
  158. package/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.js +1 -1
  159. package/schematics/ng-update/v4/steps/migrate-destroy-service.js +7 -4
  160. package/schematics/ng-update/v4/steps/migrate-legacy-mask.js +2 -2
  161. package/schematics/ng-update/v4/steps/migrate-option-providers.js +6 -3
  162. package/schematics/ng-update/v4/steps/migrate-proprietary.js +3 -3
  163. package/schematics/ng-update/v4/steps/migrate-styles.js +1 -1
  164. package/schematics/ng-update/v4/steps/migrate-templates.js +3 -1
  165. package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +24 -6
  166. package/schematics/ng-update/v4/steps/templates/migrate-badge.js +4 -4
  167. package/schematics/ng-update/v4/steps/templates/migrate-expandable.js +2 -2
  168. package/schematics/ng-update/v4/steps/templates/migrate-focusable.js +1 -1
  169. package/schematics/ng-update/v4/steps/templates/migrate-labeled.js +1 -3
  170. package/schematics/ng-update/v4/steps/templates/migrate-money.js +1 -1
  171. package/schematics/ng-update/v4/steps/templates/migrate-overscroll.d.ts +8 -0
  172. package/schematics/ng-update/v4/steps/templates/migrate-overscroll.js +29 -0
  173. package/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.js +1 -1
  174. package/schematics/ng-update/v4/steps/templates/toggles/common.d.ts +1 -1
  175. package/schematics/ng-update/v4/steps/templates/toggles/common.js +3 -3
  176. package/schematics/ng-update/v4/steps/update-packages.d.ts +4 -0
  177. package/schematics/ng-update/v4/steps/update-packages.js +31 -0
  178. package/schematics/ng-update/v4/steps/utils/remove-attrs.js +1 -1
  179. package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.d.ts +13 -0
  180. package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.js +47 -0
  181. package/schematics/ng-update/v4/steps/utils/replace-substrings.js +1 -1
  182. package/schematics/ng-update/v4/tests/migrate-destroy-service/utils.js +1 -0
  183. package/schematics/utils/add-unique-import.js +1 -1
  184. package/schematics/utils/angular-json-manipulations.js +4 -4
  185. package/schematics/utils/get-named-import-references.js +4 -4
  186. package/schematics/utils/get-standalone-bootstrap-function.js +2 -2
  187. package/schematics/utils/import-manipulations.js +1 -1
  188. package/schematics/utils/push-to-array-property.js +1 -1
  189. package/schematics/utils/templates/elements.d.ts +5 -0
  190. package/schematics/utils/templates/elements.js +26 -13
  191. package/schematics/utils/templates/get-component-templates.js +1 -1
  192. package/schematics/utils/templates/inputs.js +1 -1
  193. package/schematics/utils/templates/ng-component-input-manipulations.js +5 -5
  194. package/utils/color/get-gradient-data.d.ts +1 -0
  195. package/utils/color/index.d.ts +2 -0
  196. package/utils/color/parse-gradient.d.ts +10 -0
  197. package/utils/dom/get-element-point.d.ts +2 -0
  198. package/utils/dom/index.d.ts +1 -0
@@ -10,6 +10,6 @@ exports.INPUTS_TO_REMOVE = [
10
10
  {
11
11
  inputName: 'iconAlign',
12
12
  tags: ['button', 'a'],
13
- filterFn: el => (0, elements_1.hasElementAttribute)(el, 'tuiLink'),
13
+ filterFn: (el) => (0, elements_1.hasElementAttribute)(el, 'tuiLink'),
14
14
  },
15
15
  ];
@@ -142,4 +142,9 @@ exports.MIGRATION_WARNINGS = [
142
142
  moduleSpecifier: '@taiga-ui/kit',
143
143
  message: 'TUI_INPUT_NUMBER_OPTIONS "precision" and "decimal" have been moved to TUI_FORMAT_NUMBER_OPTIONS. See https://taiga-ui.dev/components/input-number#options ',
144
144
  },
145
+ {
146
+ name: 'TUI_ARROW',
147
+ moduleSpecifier: '@taiga-ui/kit',
148
+ message: 'TUI_ARROW is deprecated, Use tuiChevron directive instead. See example https://taiga-ui.dev/components/data-list#links',
149
+ },
145
150
  ];
@@ -14,4 +14,16 @@ exports.MODULES_TO_REMOVE = [
14
14
  name: 'TuiFocusableModule',
15
15
  moduleSpecifier: '@taiga-ui/cdk',
16
16
  },
17
+ {
18
+ name: 'TuiOverscrollModule',
19
+ moduleSpecifier: '@taiga-ui/cdk',
20
+ },
21
+ {
22
+ name: 'TuiThemeNightModule',
23
+ moduleSpecifier: '@taiga-ui/core',
24
+ },
25
+ {
26
+ name: 'TuiModeModule',
27
+ moduleSpecifier: '@taiga-ui/core',
28
+ },
17
29
  ];
@@ -0,0 +1,12 @@
1
+ interface ModuleToReplace {
2
+ from: {
3
+ name: string;
4
+ moduleSpecifier: string;
5
+ };
6
+ to: {
7
+ name: string;
8
+ providerSpecifier: string;
9
+ };
10
+ }
11
+ export declare const MODULES_TO_REPLACE_WITH_PROVIDERS: ModuleToReplace[];
12
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MODULES_TO_REPLACE_WITH_PROVIDERS = void 0;
4
+ exports.MODULES_TO_REPLACE_WITH_PROVIDERS = [
5
+ {
6
+ from: {
7
+ name: 'TuiMobileCalendarDialogModule',
8
+ moduleSpecifier: '@taiga-ui/addon-mobile',
9
+ },
10
+ to: {
11
+ name: 'tuiProvideMobileCalendar',
12
+ providerSpecifier: '@taiga-ui/addon-mobile',
13
+ },
14
+ },
15
+ ];
@@ -8,13 +8,13 @@ exports.TAGS_TO_REPLACE = [
8
8
  from: 'tui-input-count',
9
9
  to: 'tui-input-number',
10
10
  addAttributes: ['decimal="never"'],
11
- filterFn: element => element.attrs.some(attr => attr.name === '[step]'),
11
+ filterFn: (element) => element.attrs.some((attr) => attr.name === '[step]'),
12
12
  },
13
13
  {
14
14
  from: 'tui-input-count',
15
15
  to: 'tui-input-number',
16
16
  addAttributes: ['decimal="never"', '[step]="1"'],
17
- filterFn: element => element.attrs.every(attr => attr.name !== '[step]'),
17
+ filterFn: (element) => element.attrs.every((attr) => attr.name !== '[step]'),
18
18
  },
19
19
  {
20
20
  from: 'tui-money',
@@ -33,12 +33,12 @@ exports.TAGS_TO_REPLACE = [
33
33
  {
34
34
  from: 'tui-hosted-dropdown',
35
35
  to: 'div',
36
- filterFn: el => el.attrs.some(attr => attr.name === '[open]' || attr.name === '[(open)]'),
36
+ filterFn: (el) => el.attrs.some((attr) => attr.name === '[open]' || attr.name === '[(open)]'),
37
37
  },
38
38
  {
39
39
  from: 'tui-hosted-dropdown',
40
40
  to: 'div',
41
- filterFn: el => el.attrs.every(attr => attr.name !== '[open]' && attr.name !== '[(open)]'),
41
+ filterFn: (el) => el.attrs.every((attr) => attr.name !== '[open]' && attr.name !== '[(open)]'),
42
42
  addAttributes: ['tuiDropdownOpen'],
43
43
  },
44
44
  {
@@ -50,4 +50,5 @@ exports.TAGS_TO_REPLACE = [
50
50
  from: 'tui-marker-icon',
51
51
  to: 'tui-avatar',
52
52
  },
53
+ { from: 'tui-input-card-grouped', to: 'tui-input-card-group' },
53
54
  ];
@@ -0,0 +1,2 @@
1
+ import type { ReplacementType } from '../../../interfaces';
2
+ export declare const TYPES_TO_RENAME: readonly ReplacementType[];
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TYPES_TO_RENAME = void 0;
4
+ exports.TYPES_TO_RENAME = [
5
+ {
6
+ from: 'TuiDocExample',
7
+ to: 'Record<string, string | Promise<unknown>>',
8
+ moduleSpecifier: ['@taiga-ui/addon-doc'],
9
+ removeImport: true,
10
+ },
11
+ {
12
+ from: 'TuiBrightness',
13
+ to: "'onDark' | 'onLight'",
14
+ moduleSpecifier: ['@taiga-ui/core'],
15
+ removeImport: true,
16
+ },
17
+ ];
@@ -1,6 +1,10 @@
1
1
  export * from './migrate-all-country-iso-codes';
2
2
  export * from './migrate-destroy-service';
3
3
  export * from './migrate-legacy-mask';
4
+ export * from './migrate-option-providers';
5
+ export * from './migrate-proprietary';
6
+ export * from './migrate-styles';
4
7
  export * from './migrate-templates';
5
8
  export * from './restore-tui-mapper';
6
9
  export * from './restore-tui-matcher';
10
+ export * from './update-packages';
@@ -4,6 +4,10 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./migrate-all-country-iso-codes"), exports);
5
5
  tslib_1.__exportStar(require("./migrate-destroy-service"), exports);
6
6
  tslib_1.__exportStar(require("./migrate-legacy-mask"), exports);
7
+ tslib_1.__exportStar(require("./migrate-option-providers"), exports);
8
+ tslib_1.__exportStar(require("./migrate-proprietary"), exports);
9
+ tslib_1.__exportStar(require("./migrate-styles"), exports);
7
10
  tslib_1.__exportStar(require("./migrate-templates"), exports);
8
11
  tslib_1.__exportStar(require("./restore-tui-mapper"), exports);
9
12
  tslib_1.__exportStar(require("./restore-tui-matcher"), exports);
13
+ tslib_1.__exportStar(require("./update-packages"), exports);
@@ -9,7 +9,7 @@ function migrateAllCountryIsoCodes(options) {
9
9
  !options['skip-logs'] &&
10
10
  (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating Object.values(TuiCountryIsoCode)...`);
11
11
  const references = (0, get_named_import_references_1.getNamedImportReferences)('TuiCountryIsoCode', '@taiga-ui/i18n');
12
- references.forEach(ref => {
12
+ references.forEach((ref) => {
13
13
  if (ref.wasForgotten()) {
14
14
  return;
15
15
  }
@@ -12,7 +12,7 @@ function migrateDestroyService(options) {
12
12
  (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating TuiDestroyService => takeUntilDestroyed ...`);
13
13
  const references = (0, get_named_import_references_1.getNamedImportReferences)('TuiDestroyService', '@taiga-ui/cdk');
14
14
  const nodesForComments = [];
15
- references.forEach(ref => {
15
+ references.forEach((ref) => {
16
16
  var _a;
17
17
  if (ref.wasForgotten()) {
18
18
  return;
@@ -30,7 +30,7 @@ function migrateDestroyService(options) {
30
30
  // providers: [TuiDestroyService]
31
31
  const index = parent
32
32
  .getElements()
33
- .findIndex(el => el.getText() === 'TuiDestroyService');
33
+ .findIndex((el) => el.getText() === 'TuiDestroyService');
34
34
  parent.removeElement(index);
35
35
  }
36
36
  else if (ng_morph_1.Node.isTypeReference(parent)) {
@@ -67,7 +67,7 @@ function migrateDestroyService(options) {
67
67
  else {
68
68
  nodesForComments.push(ref);
69
69
  }
70
- destroyObservableUsages.forEach(node => {
70
+ destroyObservableUsages.forEach((node) => {
71
71
  const possibleTakeUntil = findTakeUntil(node);
72
72
  if (!possibleTakeUntil) {
73
73
  return;
@@ -103,7 +103,7 @@ function migrateDestroyService(options) {
103
103
  * ---
104
104
  * @see https://ts-morph.com/manipulation/#strongwarningstrong
105
105
  */
106
- nodesForComments.forEach(ref => {
106
+ nodesForComments.forEach((ref) => {
107
107
  if (ref.wasForgotten()) {
108
108
  return;
109
109
  }
@@ -117,6 +117,9 @@ function migrateDestroyService(options) {
117
117
  }
118
118
  exports.migrateDestroyService = migrateDestroyService;
119
119
  function findTakeUntil(node, maxDepth = 10) {
120
+ if (node.wasForgotten()) {
121
+ return null;
122
+ }
120
123
  if (ng_morph_1.Node.isCallExpression(node) && node.getText().includes('takeUntil(')) {
121
124
  return node;
122
125
  }
@@ -18,7 +18,7 @@ function migrateTuiMaskedMoneyValueIsEmpty(options) {
18
18
  !options['skip-logs'] &&
19
19
  (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} tuiMaskedMoneyValueIsEmpty`);
20
20
  const references = (0, get_named_import_references_1.getNamedImportReferences)('tuiMaskedMoneyValueIsEmpty', '@taiga-ui/core');
21
- references.forEach(ref => {
21
+ references.forEach((ref) => {
22
22
  if (ref.wasForgotten()) {
23
23
  return;
24
24
  }
@@ -37,7 +37,7 @@ function migrateTuiMaskedNumberStringToNumber(options) {
37
37
  !options['skip-logs'] &&
38
38
  (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} tuiMaskedNumberStringToNumber`);
39
39
  const references = (0, get_named_import_references_1.getNamedImportReferences)('tuiMaskedNumberStringToNumber', '@taiga-ui/core');
40
- references.forEach(ref => {
40
+ references.forEach((ref) => {
41
41
  if (ref.wasForgotten()) {
42
42
  return;
43
43
  }
@@ -15,8 +15,11 @@ exports.migrateOptionProviders = migrateOptionProviders;
15
15
  function migrateInputNumberOptions(options) {
16
16
  !options['skip-logs'] &&
17
17
  (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} tuiInputNumberOptionsProvider`);
18
- const references = (0, get_named_import_references_1.getNamedImportReferences)('tuiInputNumberOptionsProvider', '@taiga-ui/kit');
19
- references.forEach(ref => {
18
+ const references = [
19
+ ...(0, get_named_import_references_1.getNamedImportReferences)('tuiInputNumberOptionsProvider', '@taiga-ui/kit'),
20
+ ...(0, get_named_import_references_1.getNamedImportReferences)('tuiInputNumberOptionsProvider', '@taiga-ui/legacy'),
21
+ ];
22
+ references.forEach((ref) => {
20
23
  if (ref.wasForgotten()) {
21
24
  return;
22
25
  }
@@ -30,7 +33,7 @@ function migrateInputNumberOptions(options) {
30
33
  const decimal = value.getProperty('decimal');
31
34
  [precision, decimal]
32
35
  .filter((property) => !!property)
33
- .forEach(property => property.remove());
36
+ .forEach((property) => property.remove());
34
37
  if (precision || decimal) {
35
38
  (0, insert_todo_1.insertTodo)(parent, '"precision" and "decimal" options have been moved to FormatNumberOptions. See https://taiga-ui.dev/components/input-number#options');
36
39
  }
@@ -24,7 +24,7 @@ function migrateProprietary(fileSystem, options) {
24
24
  exports.migrateProprietary = migrateProprietary;
25
25
  function replaceScopePackages() {
26
26
  var _a;
27
- (_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/**.{ts,less,scss}').forEach(sourceFile => {
27
+ (_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/**.{ts,less,scss}').forEach((sourceFile) => {
28
28
  let fullText = sourceFile.getFullText();
29
29
  fullText = fullText
30
30
  .replaceAll('@taiga-ui/proprietary-core', '@taiga-ui/proprietary')
@@ -38,7 +38,7 @@ function replaceScopePackages() {
38
38
  }
39
39
  function replaceProprietaryIconPath() {
40
40
  var _a;
41
- (_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/{angular,project}.json').forEach(sourceFile => {
41
+ (_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/{angular,project}.json').forEach((sourceFile) => {
42
42
  let fullText = sourceFile.getFullText();
43
43
  fullText = fullText
44
44
  .replaceAll('node_modules/@taiga-ui/proprietary-icons/src', '@taiga-ui/proprietary/design-tokens/icons/src')
@@ -56,7 +56,7 @@ function removeProprietaryPackages(fileSystem) {
56
56
  '@taiga-ui/proprietary-icons',
57
57
  '@taiga-ui/proprietary-tds-icons',
58
58
  '@taiga-ui/proprietary-tds-palette',
59
- ].forEach(name => (0, ng_morph_1.removePackageJsonDependency)(fileSystem.tree, name));
59
+ ].forEach((name) => (0, ng_morph_1.removePackageJsonDependency)(fileSystem.tree, name));
60
60
  (0, ng_morph_1.addPackageJsonDependency)(fileSystem.tree, {
61
61
  name: '@taiga-ui/proprietary',
62
62
  version: version_1.TUI_VERSION,
@@ -6,7 +6,7 @@ const ng_morph_1 = require("ng-morph");
6
6
  exports.TUI_RATING_WARNING = '// TODO: (Taiga UI migration): use css to customize rating gap and size. See https://taiga-ui.dev/components/rating#basic';
7
7
  function migrateStyles() {
8
8
  var _a;
9
- (_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/**.{less,sass,scss,css}').forEach(sourceFile => {
9
+ (_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/**.{less,sass,scss,css}').forEach((sourceFile) => {
10
10
  let fullText = sourceFile.getFullText();
11
11
  fullText = fullText
12
12
  // eslint-disable-next-line
@@ -10,6 +10,7 @@ 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
14
  function getAction({ action, requiredData, }) {
14
15
  return ({ resource, fileSystem, recorder, }) => action({ resource, fileSystem, recorder, data: requiredData });
15
16
  }
@@ -40,11 +41,12 @@ function migrateTemplates(fileSystem, options) {
40
41
  templates_2.migrateLabeled,
41
42
  templates_2.migrateProgressSegmented,
42
43
  templates_2.migrateThumbnailCard,
44
+ migrate_overscroll_1.migrateOverscroll,
43
45
  ];
44
46
  const progressLog = (0, progress_1.setupProgressLogger)({
45
47
  total: componentWithTemplatesPaths.length,
46
48
  });
47
- componentWithTemplatesPaths.forEach(resource => {
49
+ componentWithTemplatesPaths.forEach((resource) => {
48
50
  const path = fileSystem.resolve((0, template_resource_1.getPathFromTemplateResource)(resource));
49
51
  const recorder = fileSystem.edit(path);
50
52
  actions.forEach((action, actionIndex) => {
@@ -3,8 +3,19 @@ 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);
@@ -22,13 +33,20 @@ function normalizeAttrValue(attrName, attrValue) {
22
33
  function migrateAvatar({ resource, recorder, fileSystem, }) {
23
34
  const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
24
35
  const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
25
- const elements = (0, elements_1.findElementsByTagName)(template, 'tui-avatar');
26
- elements.forEach(({ attrs, sourceCodeLocation }) => {
36
+ const avatarElements = (0, elements_1.findElementsByTagName)(template, 'tui-avatar');
37
+ const markerIconElements = (0, elements_1.findElementsByTagName)(template, 'tui-marker-icon');
38
+ [...avatarElements, ...markerIconElements].forEach(({ attrs, sourceCodeLocation }) => {
39
+ if (!sourceCodeLocation) {
40
+ return;
41
+ }
42
+ (0, common_1.replaceSizeAttr)(attrs, sourceCodeLocation, recorder, templateOffset, sizeMap);
43
+ });
44
+ avatarElements.forEach(({ attrs, sourceCodeLocation }) => {
27
45
  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');
46
+ const avatarUrlAttr = (0, inputs_1.findAttr)(attrs, 'avatarurl');
47
+ const fallbackAttr = (0, inputs_1.findAttr)(attrs, 'fallback');
48
+ const textAttr = (0, inputs_1.findAttr)(attrs, 'text');
49
+ const roundedAttr = (0, inputs_1.findAttr)(attrs, 'rounded');
32
50
  if ((!avatarUrlAttr && !textAttr) || !sourceCodeLocation) {
33
51
  return;
34
52
  }
@@ -11,13 +11,13 @@ function migrateBadge({ resource, recorder, fileSystem, }) {
11
11
  if (!sourceCodeLocation) {
12
12
  return;
13
13
  }
14
- const valueAttr = attrs.find(attr => attr.name === '[value]' || attr.name === 'value');
14
+ const valueAttr = attrs.find((attr) => attr.name === '[value]' || attr.name === 'value');
15
15
  // migration for icon-only badges
16
16
  if (!valueAttr) {
17
17
  addTodo(recorder, sourceCodeLocation, templateOffset);
18
18
  return;
19
19
  }
20
- const svg = childNodes === null || childNodes === void 0 ? void 0 : childNodes.find(node => node.nodeName === 'tui-svg');
20
+ const svg = childNodes === null || childNodes === void 0 ? void 0 : childNodes.find((node) => node.nodeName === 'tui-svg');
21
21
  if (svg) {
22
22
  migrateIcon({ svg, sourceCodeLocation, recorder, templateOffset });
23
23
  }
@@ -32,13 +32,13 @@ function migrateBadge({ resource, recorder, fileSystem, }) {
32
32
  exports.migrateBadge = migrateBadge;
33
33
  function migrateIcon({ svg, sourceCodeLocation, recorder, templateOffset, }) {
34
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');
35
+ const src = (_a = svg.attrs) === null || _a === void 0 ? void 0 : _a.find((attr) => attr.name === 'src');
36
36
  const srcValue = src === null || src === void 0 ? void 0 : src.value;
37
37
  if (!srcValue) {
38
38
  return;
39
39
  }
40
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}"`);
41
+ recorder.insertRight(insertTo, `${(src === null || src === void 0 ? void 0 : src.name) === 'src' ? 'iconStart' : '[iconStart]'}="${srcValue}"`);
42
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
43
  (((_e = svg.sourceCodeLocation) === null || _e === void 0 ? void 0 : _e.startOffset) || 0));
44
44
  }
@@ -9,7 +9,7 @@ function migrateExpandable({ resource, recorder, fileSystem, }) {
9
9
  const elements = (0, elements_1.findElementsWithAttributeOnTag)(template, ['[expandable]'], ['tui-input-tag', 'tui-multi-select', 'tui-input-date']);
10
10
  elements.forEach(({ attrs, sourceCodeLocation }) => {
11
11
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
12
- const expandableAttr = attrs.find(attr => attr.name === '[expandable]');
12
+ const expandableAttr = attrs.find((attr) => attr.name === '[expandable]');
13
13
  if (!expandableAttr) {
14
14
  return;
15
15
  }
@@ -17,7 +17,7 @@ function migrateExpandable({ resource, recorder, fileSystem, }) {
17
17
  const expandableStart = (_c = (_b = (_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[expandableAttr.name]) === null || _b === void 0 ? void 0 : _b.startOffset) !== null && _c !== void 0 ? _c : 0;
18
18
  const expandableEnd = (_f = (_e = (_d = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _d === void 0 ? void 0 : _d[expandableAttr.name]) === null || _e === void 0 ? void 0 : _e.endOffset) !== null && _f !== void 0 ? _f : 0;
19
19
  if (expandableValue === 'false') {
20
- const rowsAttr = attrs.find(attr => attr.name === '[rows]');
20
+ const rowsAttr = attrs.find((attr) => attr.name === '[rows]');
21
21
  const insertTo = ((_h = (_g = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startTag) === null || _g === void 0 ? void 0 : _g.endOffset) !== null && _h !== void 0 ? _h : 0) - 1;
22
22
  recorder.insertRight(templateOffset + insertTo, rowsAttr ? '' : '[rows]="1"');
23
23
  }
@@ -13,7 +13,7 @@ function migrateFocusable({ resource, recorder, fileSystem, }) {
13
13
  if (!sourceCodeLocation) {
14
14
  return;
15
15
  }
16
- const focusableAttr = attrs.find(attr => attr.name === LEGACY_ATTRIBUTE_NAME);
16
+ const focusableAttr = attrs.find((attr) => attr.name === LEGACY_ATTRIBUTE_NAME);
17
17
  const attributeLocation = (_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[LEGACY_ATTRIBUTE_NAME];
18
18
  if (!focusableAttr || !attributeLocation) {
19
19
  return;
@@ -32,9 +32,7 @@ function migrateLabeled({ resource, recorder, fileSystem, }) {
32
32
  if (!sourceCodeLocation) {
33
33
  return;
34
34
  }
35
- (0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, tagName === 'tui-checkbox-labeled'
36
- ? 'TuiCheckboxComponent'
37
- : 'TuiRadioComponent', '@taiga-ui/kit');
35
+ (0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, tagName === 'tui-checkbox-labeled' ? 'TuiCheckbox' : 'TuiRadio', '@taiga-ui/kit');
38
36
  recorder.insertRight(templateOffset + ((_b = (_a = sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) !== null && _b !== void 0 ? _b : 1) - 1, '<label tuiLabel>');
39
37
  recorder.insertRight(templateOffset + ((_d = (_c = sourceCodeLocation.endTag) === null || _c === void 0 ? void 0 : _c.startOffset) !== null && _d !== void 0 ? _d : 1) - 1, '\n</label>');
40
38
  recorder.remove(templateOffset + ((_f = (_e = sourceCodeLocation.endTag) === null || _e === void 0 ? void 0 : _e.startOffset) !== null && _f !== void 0 ? _f : 0), tagName === 'tui-checkbox-labeled'
@@ -33,7 +33,7 @@ function migrateMoney({ resource, recorder, fileSystem, }) {
33
33
  if (decimalAttr || precisionAttr) {
34
34
  (0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, 'TuiNumberFormat', '@taiga-ui/core');
35
35
  const format = JSON.stringify((0, clean_object_1.cleanObject)({
36
- decimal: decimalAttr === null || decimalAttr === void 0 ? void 0 : decimalAttr.value,
36
+ decimalMode: decimalAttr === null || decimalAttr === void 0 ? void 0 : decimalAttr.value,
37
37
  precision: precisionAttr === null || precisionAttr === void 0 ? void 0 : precisionAttr.value,
38
38
  }));
39
39
  const formatPart = `[tuiNumberFormat]='${format}'`;
@@ -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 migrateOverscroll({ resource, recorder, fileSystem, }: {
5
+ fileSystem: DevkitFileSystem;
6
+ recorder: UpdateRecorder;
7
+ resource: TemplateResource;
8
+ }): void;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateOverscroll = 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 overscrollAttrName = 'tuiOverscroll';
8
+ const overscrollAttrNameDict = {
9
+ [overscrollAttrName.toLowerCase()]: true,
10
+ [`[${overscrollAttrName.toLowerCase()}]`]: true,
11
+ };
12
+ function migrateOverscroll({ resource, recorder, fileSystem, }) {
13
+ const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
14
+ const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
15
+ const elements = (0, elements_1.findElementsWithDirective)(template, overscrollAttrName).filter(({ sourceCodeLocation }) => !!sourceCodeLocation);
16
+ if (!elements.length) {
17
+ return;
18
+ }
19
+ elements.forEach(({ attrs, sourceCodeLocation }) => {
20
+ const attrsToRemove = attrs.filter(({ name }) => overscrollAttrNameDict[name]);
21
+ (0, remove_attrs_1.removeAttrs)(attrsToRemove, sourceCodeLocation, recorder, templateOffset);
22
+ });
23
+ addTodo(recorder, elements[0].sourceCodeLocation, templateOffset);
24
+ }
25
+ exports.migrateOverscroll = migrateOverscroll;
26
+ function addTodo(recorder, sourceCodeLocation, templateOffset) {
27
+ var _a, _b;
28
+ recorder.insertRight(templateOffset + ((_b = (_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) !== null && _b !== void 0 ? _b : 0), '<!-- Taiga migration TODO: use "overscroll-behavior" ccs property instead of "tuiOverscroll" directive -->\n');
29
+ }
@@ -11,7 +11,7 @@ function migrateThumbnailCard({ resource, recorder, fileSystem, }) {
11
11
  if (!sourceCodeLocation) {
12
12
  return;
13
13
  }
14
- const valueAttr = attrs.find(attr => attr.name === '[cardnumber]' || attr.name === 'cardnumber');
14
+ const valueAttr = attrs.find((attr) => attr.name === '[cardnumber]' || attr.name === 'cardnumber');
15
15
  if (!valueAttr) {
16
16
  return;
17
17
  }
@@ -5,6 +5,6 @@ export declare function replaceOpenTag(sourceCodeLocation: ElementLocation, reco
5
5
  directive: string;
6
6
  type: string;
7
7
  }): void;
8
- export declare function replaceSizeAttr(attrs: Attribute[], sourceCodeLocation: ElementLocation, recorder: UpdateRecorder, templateOffset: number): void;
8
+ export declare function replaceSizeAttr(attrs: Attribute[], sourceCodeLocation: ElementLocation, recorder: UpdateRecorder, templateOffset: number, map?: Record<string, string>): void;
9
9
  export declare function removeClosingTag(sourceCodeLocation: ElementLocation, recorder: UpdateRecorder, templateOffset: number): void;
10
10
  export declare function closeStartTag({ startTag, endTag }: ElementLocation, recorder: UpdateRecorder, templateOffset: number): void;
@@ -15,16 +15,16 @@ function replaceOpenTag(sourceCodeLocation, recorder, templateOffset, { tag, dir
15
15
  recorder.insertRight(templateOffset + startTag.startOffset, `<input\n${spaces}${directive}\n${spaces}type="${type}"`);
16
16
  }
17
17
  exports.replaceOpenTag = replaceOpenTag;
18
- function replaceSizeAttr(attrs, sourceCodeLocation, recorder, templateOffset) {
18
+ function replaceSizeAttr(attrs, sourceCodeLocation, recorder, templateOffset, map = sizeMap) {
19
19
  var _a;
20
- const sizeAttr = attrs.find(attr => attr.name === 'size');
20
+ const sizeAttr = attrs.find((attr) => attr.name === 'size');
21
21
  if (sizeAttr) {
22
22
  const { startOffset, endOffset } = ((_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[sizeAttr.name]) || {
23
23
  startOffset: 0,
24
24
  endOffset: 0,
25
25
  };
26
26
  recorder.remove(templateOffset + startOffset, endOffset - startOffset);
27
- recorder.insertRight(templateOffset + startOffset, `size="${sizeMap[sizeAttr.value] || sizeAttr.value}"`);
27
+ recorder.insertRight(templateOffset + startOffset, `size="${map[sizeAttr.value] || sizeAttr.value}"`);
28
28
  }
29
29
  }
30
30
  exports.replaceSizeAttr = replaceSizeAttr;
@@ -0,0 +1,4 @@
1
+ /// <reference lib="es2021" />
2
+ import type { DevkitFileSystem } from 'ng-morph';
3
+ import type { TuiSchema } from '../../../ng-add/schema';
4
+ export declare function updatePackages({ tree }: DevkitFileSystem, _: TuiSchema): void;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updatePackages = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const ng_morph_1 = require("ng-morph");
6
+ const version_1 = require("../../../../constants/version");
7
+ const package_json_1 = tslib_1.__importDefault(require("../../../../package.json"));
8
+ const steps_1 = require("../../steps");
9
+ function updatePackages({ tree }, _) {
10
+ const packagesToRemove = ['@taiga-ui/addon-tablebars', '@taiga-ui/addon-preview'];
11
+ packagesToRemove.forEach((pkg) => {
12
+ (0, ng_morph_1.removePackageJsonDependency)(tree, pkg);
13
+ });
14
+ (0, ng_morph_1.addPackageJsonDependency)(tree, {
15
+ name: '@taiga-ui/legacy',
16
+ version: version_1.TUI_VERSION,
17
+ });
18
+ (0, steps_1.replacePackageName)('@tinkoff/ng-polymorpheus', {
19
+ name: '@taiga-ui/polymorpheus',
20
+ version: package_json_1.default.peerDependencies['@taiga-ui/polymorpheus'],
21
+ }, tree);
22
+ (0, steps_1.replacePackageName)('@tinkoff/ng-event-plugins', {
23
+ name: '@taiga-ui/event-plugins',
24
+ version: package_json_1.default.peerDependencies['@taiga-ui/event-plugins'],
25
+ }, tree);
26
+ (0, steps_1.replacePackageName)('@tinkoff/tui-editor', {
27
+ name: '@taiga-ui/editor',
28
+ version: '^2.0.0',
29
+ }, tree);
30
+ }
31
+ exports.updatePackages = updatePackages;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.removeAttrs = void 0;
4
4
  function removeAttrs(attrs, sourceCodeLocation, recorder, templateOffset) {
5
- attrs.forEach(attr => {
5
+ attrs.forEach((attr) => {
6
6
  var _a;
7
7
  const attrOffset = (_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[attr.name];
8
8
  if (attrOffset) {
@@ -0,0 +1,13 @@
1
+ import type { TuiSchema } from '../../../../ng-add/schema';
2
+ interface ModuleToReplace {
3
+ from: {
4
+ name: string;
5
+ moduleSpecifier: string;
6
+ };
7
+ to: {
8
+ name: string;
9
+ providerSpecifier: string;
10
+ };
11
+ }
12
+ export declare const replaceModulesWithProviders: (options: TuiSchema, list: ModuleToReplace[]) => void;
13
+ export {};