@taiga-ui/cdk 3.54.0 → 3.55.0-canary.f5fbcc5

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 (125) hide show
  1. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +2 -2
  2. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-components-scroll-controls.umd.js +10 -10
  4. package/bundles/taiga-ui-cdk-components-scroll-controls.umd.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-constants.umd.js +14 -14
  6. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-date-time.umd.js +2 -4
  8. package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-decorators.umd.js +12 -12
  10. package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
  11. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +4 -16
  12. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  13. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js +1 -4
  14. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
  15. package/bundles/taiga-ui-cdk-directives-media.umd.js +1 -2
  16. package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
  17. package/bundles/taiga-ui-cdk-directives-platform.umd.js +4 -1
  18. package/bundles/taiga-ui-cdk-directives-platform.umd.js.map +1 -1
  19. package/bundles/taiga-ui-cdk-services.umd.js +10 -10
  20. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  21. package/bundles/taiga-ui-cdk-tokens.umd.js +23 -23
  22. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  23. package/bundles/taiga-ui-cdk-utils-color.umd.js +12 -12
  24. package/bundles/taiga-ui-cdk-utils-color.umd.js.map +1 -1
  25. package/bundles/taiga-ui-cdk-utils-dom.umd.js +5 -5
  26. package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
  27. package/bundles/taiga-ui-cdk-utils-math.umd.js +16 -16
  28. package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
  29. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +3 -3
  30. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  31. package/bundles/taiga-ui-cdk-utils-svg.umd.js +33 -24
  32. package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
  33. package/constants/used-icons.d.ts +1 -1
  34. package/constants/version.d.ts +1 -1
  35. package/constants/version.js +1 -1
  36. package/esm2015/components/dialog-host/dialog-host.component.js +3 -3
  37. package/esm2015/components/scroll-controls/scrollbar.directive.js +7 -7
  38. package/esm2015/constants/empty.js +9 -9
  39. package/esm2015/constants/matcher.js +4 -4
  40. package/esm2015/constants/used-icons.js +3 -3
  41. package/esm2015/constants/version.js +2 -2
  42. package/esm2015/date-time/day-range.js +2 -4
  43. package/esm2015/date-time/day.js +2 -2
  44. package/esm2015/decorators/default-prop.js +10 -10
  45. package/esm2015/decorators/required-setter.js +4 -4
  46. package/esm2015/directives/auto-focus/autofocus.options.js +1 -2
  47. package/esm2015/directives/auto-focus/handlers/ios.handler.js +3 -4
  48. package/esm2015/directives/focus-trap/focus-trap.directive.js +2 -5
  49. package/esm2015/directives/media/media.directive.js +2 -3
  50. package/esm2015/directives/platform/platform.directive.js +6 -3
  51. package/esm2015/services/scroll.service.js +11 -11
  52. package/esm2015/tokens/active-element.js +14 -14
  53. package/esm2015/utils/color/hex-to-rgba.js +9 -9
  54. package/esm2015/utils/color/hsv-to-rgb.js +5 -5
  55. package/esm2015/utils/dom/can-scroll.js +6 -6
  56. package/esm2015/utils/math/round.js +13 -13
  57. package/esm2015/utils/miscellaneous/clean-object.js +4 -4
  58. package/esm2015/utils/svg/svg-linear-gradient-processor.js +34 -25
  59. package/fesm2015/taiga-ui-cdk-components-dialog-host.js +2 -2
  60. package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  61. package/fesm2015/taiga-ui-cdk-components-scroll-controls.js +6 -6
  62. package/fesm2015/taiga-ui-cdk-components-scroll-controls.js.map +1 -1
  63. package/fesm2015/taiga-ui-cdk-constants.js +14 -14
  64. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  65. package/fesm2015/taiga-ui-cdk-date-time.js +2 -4
  66. package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
  67. package/fesm2015/taiga-ui-cdk-decorators.js +12 -12
  68. package/fesm2015/taiga-ui-cdk-decorators.js.map +1 -1
  69. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +2 -3
  70. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  71. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js +1 -4
  72. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
  73. package/fesm2015/taiga-ui-cdk-directives-media.js +1 -2
  74. package/fesm2015/taiga-ui-cdk-directives-media.js.map +1 -1
  75. package/fesm2015/taiga-ui-cdk-directives-platform.js +5 -2
  76. package/fesm2015/taiga-ui-cdk-directives-platform.js.map +1 -1
  77. package/fesm2015/taiga-ui-cdk-services.js +10 -10
  78. package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
  79. package/fesm2015/taiga-ui-cdk-tokens.js +15 -15
  80. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  81. package/fesm2015/taiga-ui-cdk-utils-color.js +12 -12
  82. package/fesm2015/taiga-ui-cdk-utils-color.js.map +1 -1
  83. package/fesm2015/taiga-ui-cdk-utils-dom.js +5 -5
  84. package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
  85. package/fesm2015/taiga-ui-cdk-utils-math.js +12 -12
  86. package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
  87. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +3 -3
  88. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  89. package/fesm2015/taiga-ui-cdk-utils-svg.js +33 -24
  90. package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
  91. package/package.json +68 -68
  92. package/schematics/ng-add/index.js +10 -10
  93. package/schematics/ng-add/steps/add-taiga-modules.js +36 -36
  94. package/schematics/ng-add/steps/wrap-with-tui-root.js +21 -21
  95. package/schematics/ng-update/steps/rename-types.js +8 -8
  96. package/schematics/ng-update/steps/replace-enums.js +8 -8
  97. package/schematics/ng-update/steps/replace-services.js +8 -8
  98. package/schematics/ng-update/steps/show-warnings.js +4 -4
  99. package/schematics/ng-update/utils/templates/template-comments.d.ts +1 -2
  100. package/schematics/ng-update/v3/index.js +17 -17
  101. package/schematics/ng-update/v3/steps/migrate-date-time.js +92 -92
  102. package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +35 -35
  103. package/schematics/ng-update/v3/steps/migrate-progress.d.ts +4 -0
  104. package/schematics/ng-update/v3/steps/migrate-progress.js +20 -20
  105. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +44 -46
  106. package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +28 -29
  107. package/schematics/ng-update/v3/steps/migrate-templates.js +37 -36
  108. package/schematics/ng-update/v3/steps/migrate-textfield-controller.js +21 -21
  109. package/schematics/ng-update/v3/steps/miscellaneous.js +32 -32
  110. package/schematics/ng-update/v3/steps/replace-functions.js +18 -18
  111. package/schematics/ng-update/v3-30/index.js +3 -4
  112. package/schematics/ng-update/v3-35/index.js +3 -4
  113. package/schematics/ng-update/v3-36/index.js +0 -1
  114. package/schematics/ng-update/v3-40/index.js +11 -13
  115. package/schematics/ng-update/v3-5/index.js +0 -1
  116. package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +17 -17
  117. package/schematics/ng-update/v4/index.js +12 -12
  118. package/schematics/ng-update/v4/steps/migrate-templates.js +3 -3
  119. package/schematics/ng-update/v4/steps/restore-tui-mapper.js +6 -6
  120. package/schematics/ng-update/v4/steps/restore-tui-matcher.js +6 -6
  121. package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +24 -24
  122. package/schematics/ng-update/v4/steps/utils/replace-substrings.js +2 -2
  123. package/schematics/utils/angular-json-manipulations.js +8 -9
  124. package/schematics/utils/templates/get-component-templates.js +8 -8
  125. package/utils/svg/svg-linear-gradient-processor.d.ts +6 -1
@@ -5,38 +5,6 @@ const ng_morph_1 = require("ng-morph");
5
5
  const colored_log_1 = require("../../../utils/colored-log");
6
6
  const get_named_import_references_1 = require("../../../utils/get-named-import-references");
7
7
  const insert_todo_1 = require("../../../utils/insert-todo");
8
- function miscellaneousMigrations(options) {
9
- !options[`skip-logs`] &&
10
- colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} miscellaneous migrating...`);
11
- replaceEnumProperty({
12
- enumName: `TuiCurrency`,
13
- from: `HongKong_dollar`,
14
- to: `HongKongDollar`,
15
- });
16
- replaceEnumProperty({
17
- enumName: `TuiCurrencyCode`,
18
- from: `HongKong_dollar`,
19
- to: `HongKongDollar`,
20
- });
21
- replaceEnumProperty({
22
- enumName: `TuiCreditCardAutofillName`,
23
- /**
24
- * Do not mark `mounth` as incorrect.
25
- * cspell:ignore mounth
26
- */
27
- from: `CcExp_mounth`,
28
- to: `CcExpMonth`,
29
- });
30
- replaceEnumProperty({
31
- enumName: `TuiCreditCardAutofillName`,
32
- from: `CcExp_year`,
33
- to: `CcExpYear`,
34
- });
35
- addWarningToMethod(`TuiDirectiveStylesService`, `addStyle`, `addStyle method has been removed. Use components approach`);
36
- !options[`skip-logs`] &&
37
- colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} miscellaneous migrated \n`);
38
- }
39
- exports.miscellaneousMigrations = miscellaneousMigrations;
40
8
  function addWarningToMethod(className, method, message) {
41
9
  const references = get_named_import_references_1.getNamedImportReferences(className);
42
10
  references.forEach(ref => {
@@ -79,3 +47,35 @@ function checkMethod(node, method, message) {
79
47
  }
80
48
  });
81
49
  }
50
+ function miscellaneousMigrations(options) {
51
+ !options[`skip-logs`] &&
52
+ colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} miscellaneous migrating...`);
53
+ replaceEnumProperty({
54
+ enumName: `TuiCurrency`,
55
+ from: `HongKong_dollar`,
56
+ to: `HongKongDollar`,
57
+ });
58
+ replaceEnumProperty({
59
+ enumName: `TuiCurrencyCode`,
60
+ from: `HongKong_dollar`,
61
+ to: `HongKongDollar`,
62
+ });
63
+ replaceEnumProperty({
64
+ enumName: `TuiCreditCardAutofillName`,
65
+ /**
66
+ * Do not mark `mounth` as incorrect.
67
+ * cspell:ignore mounth
68
+ */
69
+ from: `CcExp_mounth`,
70
+ to: `CcExpMonth`,
71
+ });
72
+ replaceEnumProperty({
73
+ enumName: `TuiCreditCardAutofillName`,
74
+ from: `CcExp_year`,
75
+ to: `CcExpYear`,
76
+ });
77
+ addWarningToMethod(`TuiDirectiveStylesService`, `addStyle`, `addStyle method has been removed. Use components approach`);
78
+ !options[`skip-logs`] &&
79
+ colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} miscellaneous migrated \n`);
80
+ }
81
+ exports.miscellaneousMigrations = miscellaneousMigrations;
@@ -6,24 +6,6 @@ const colored_log_1 = require("../../../utils/colored-log");
6
6
  const get_named_import_references_1 = require("../../../utils/get-named-import-references");
7
7
  const import_manipulations_1 = require("../../../utils/import-manipulations");
8
8
  const deprecated_functions_1 = require("../constants/deprecated-functions");
9
- function replaceFunctions(options) {
10
- !options[`skip-logs`] &&
11
- colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} functions replacing...`);
12
- replacePadStart(get_named_import_references_1.getNamedImportReferences(`padStart`, `@taiga-ui/cdk`));
13
- replaceFallbackValue(get_named_import_references_1.getNamedImportReferences(`fallbackValue`, `@taiga-ui/cdk`));
14
- replaceCustomEvent(get_named_import_references_1.getNamedImportReferences(`tuiCustomEvent`, `@taiga-ui/cdk`));
15
- replaceClosestElement(get_named_import_references_1.getNamedImportReferences(`getClosestElement`, `@taiga-ui/cdk`));
16
- replaceNativeFocused([
17
- ...get_named_import_references_1.getNamedImportReferences(`tuiSetNativeFocused`, `@taiga-ui/cdk`),
18
- ...get_named_import_references_1.getNamedImportReferences(`setNativeFocused`, `@taiga-ui/cdk`),
19
- ]);
20
- replaceDeprecatedFunction();
21
- modifyFormatNumberArgs();
22
- modifyClosestFocusable();
23
- !options[`skip-logs`] &&
24
- colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} functions replaced \n`);
25
- }
26
- exports.replaceFunctions = replaceFunctions;
27
9
  function replaceDeprecatedFunction() {
28
10
  deprecated_functions_1.DEPRECATED_FUNCTIONS.forEach(({ from, to, moduleSpecifier }) => {
29
11
  get_named_import_references_1.getNamedImportReferences(from, moduleSpecifier).forEach(ref => {
@@ -136,3 +118,21 @@ function modifyClosestFocusable() {
136
118
  }
137
119
  });
138
120
  }
121
+ function replaceFunctions(options) {
122
+ !options[`skip-logs`] &&
123
+ colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} functions replacing...`);
124
+ replacePadStart(get_named_import_references_1.getNamedImportReferences(`padStart`, `@taiga-ui/cdk`));
125
+ replaceFallbackValue(get_named_import_references_1.getNamedImportReferences(`fallbackValue`, `@taiga-ui/cdk`));
126
+ replaceCustomEvent(get_named_import_references_1.getNamedImportReferences(`tuiCustomEvent`, `@taiga-ui/cdk`));
127
+ replaceClosestElement(get_named_import_references_1.getNamedImportReferences(`getClosestElement`, `@taiga-ui/cdk`));
128
+ replaceNativeFocused([
129
+ ...get_named_import_references_1.getNamedImportReferences(`tuiSetNativeFocused`, `@taiga-ui/cdk`),
130
+ ...get_named_import_references_1.getNamedImportReferences(`setNativeFocused`, `@taiga-ui/cdk`),
131
+ ]);
132
+ replaceDeprecatedFunction();
133
+ modifyFormatNumberArgs();
134
+ modifyClosestFocusable();
135
+ !options[`skip-logs`] &&
136
+ colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} functions replaced \n`);
137
+ }
138
+ exports.replaceFunctions = replaceFunctions;
@@ -8,7 +8,9 @@ const get_file_system_1 = require("../utils/get-file-system");
8
8
  const replace_text_1 = require("../utils/replace-text");
9
9
  const constants_1 = require("./constants/constants");
10
10
  const icons_1 = require("./constants/icons");
11
- // eslint-disable-next-line @typescript-eslint/naming-convention
11
+ function hasProprietaryIcons(tree) {
12
+ return !!ng_morph_1.getPackageJsonDependency(tree, `@taiga-ui/proprietary-icons`);
13
+ }
12
14
  function updateToV3_30(options) {
13
15
  return (tree, _) => {
14
16
  if (!hasProprietaryIcons(tree)) {
@@ -28,6 +30,3 @@ function updateToV3_30(options) {
28
30
  };
29
31
  }
30
32
  exports.updateToV3_30 = updateToV3_30;
31
- function hasProprietaryIcons(tree) {
32
- return !!ng_morph_1.getPackageJsonDependency(tree, `@taiga-ui/proprietary-icons`);
33
- }
@@ -8,7 +8,9 @@ const get_file_system_1 = require("../utils/get-file-system");
8
8
  const replace_text_1 = require("../utils/replace-text");
9
9
  const constants_1 = require("./constants/constants");
10
10
  const icons_1 = require("./constants/icons");
11
- // eslint-disable-next-line @typescript-eslint/naming-convention
11
+ function hasProprietaryIcons(tree) {
12
+ return !!ng_morph_1.getPackageJsonDependency(tree, `@taiga-ui/proprietary-icons`);
13
+ }
12
14
  function updateToV3_35(options) {
13
15
  return (tree, _) => {
14
16
  if (!hasProprietaryIcons(tree)) {
@@ -28,6 +30,3 @@ function updateToV3_35(options) {
28
30
  };
29
31
  }
30
32
  exports.updateToV3_35 = updateToV3_35;
31
- function hasProprietaryIcons(tree) {
32
- return !!ng_morph_1.getPackageJsonDependency(tree, `@taiga-ui/proprietary-icons`);
33
- }
@@ -10,7 +10,6 @@ const replace_text_1 = require("../utils/replace-text");
10
10
  const OLD_PACKAGE = `@taiga-ui/addon-editor`;
11
11
  const NEW_PACKAGE = `@tinkoff/tui-editor`;
12
12
  const NEW_PACKAGE_VERSION = `^1.0.1`;
13
- // eslint-disable-next-line @typescript-eslint/naming-convention
14
13
  function updateToV3_36(options) {
15
14
  return (tree, context) => {
16
15
  if (!ng_morph_1.getPackageJsonDependency(tree, OLD_PACKAGE)) {
@@ -11,21 +11,10 @@ const template_resource_1 = require("../../utils/templates/template-resource");
11
11
  const get_file_system_1 = require("../utils/get-file-system");
12
12
  const replace_text_1 = require("../utils/replace-text");
13
13
  const replace_tag_1 = require("../utils/templates/replace-tag");
14
- // eslint-disable-next-line @typescript-eslint/naming-convention
15
- function updateToV3_40(options) {
16
- return (tree, _) => {
17
- const fileSystem = get_file_system_1.getFileSystem(tree);
18
- replaceTextareaTag(options, fileSystem);
19
- replaceTextareaReferenceTypes(options, fileSystem);
20
- !options[`skip-logs`] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
21
- };
22
- }
23
- exports.updateToV3_40 = updateToV3_40;
24
14
  function replaceTextareaTag(options, fileSystem) {
25
15
  !options[`skip-logs`] &&
26
16
  colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing <tui-text-area /> to <tui-textarea />`);
27
- const templateResources = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
28
- for (const resource of templateResources) {
17
+ get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES).forEach(resource => {
29
18
  const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
30
19
  const elements = elements_1.findElementsByTagName(template, `tui-text-area`);
31
20
  const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
@@ -35,7 +24,7 @@ function replaceTextareaTag(options, fileSystem) {
35
24
  replace_tag_1.replaceTag(recorder, sourceCodeLocation, `tui-text-area`, `tui-textarea`);
36
25
  }
37
26
  });
38
- }
27
+ });
39
28
  fileSystem.commitEdits();
40
29
  ng_morph_1.saveActiveProject();
41
30
  ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, project_root_1.projectRoot(), constants_1.ALL_FILES));
@@ -61,3 +50,12 @@ function replaceTextareaReferenceTypes(options, fileSystem) {
61
50
  ng_morph_1.saveActiveProject();
62
51
  ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, project_root_1.projectRoot(), constants_1.ALL_FILES));
63
52
  }
53
+ function updateToV3_40(options) {
54
+ return (tree, _) => {
55
+ const fileSystem = get_file_system_1.getFileSystem(tree);
56
+ replaceTextareaTag(options, fileSystem);
57
+ replaceTextareaReferenceTypes(options, fileSystem);
58
+ !options[`skip-logs`] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
59
+ };
60
+ }
61
+ exports.updateToV3_40 = updateToV3_40;
@@ -6,7 +6,6 @@ const versions_1 = require("../../ng-add/constants/versions");
6
6
  const colored_log_1 = require("../../utils/colored-log");
7
7
  const get_file_system_1 = require("../utils/get-file-system");
8
8
  const migrate_expand_templates_1 = require("./steps/migrate-expand-templates");
9
- // eslint-disable-next-line @typescript-eslint/naming-convention
10
9
  function updateToV3_5(options) {
11
10
  return (tree, _) => {
12
11
  const fileSystem = get_file_system_1.getFileSystem(tree);
@@ -7,23 +7,6 @@ const progress_1 = require("../../../utils/progress");
7
7
  const elements_1 = require("../../../utils/templates/elements");
8
8
  const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
9
9
  const template_resource_1 = require("../../../utils/templates/template-resource");
10
- function migrateExpandTemplates(fileSystem, options) {
11
- !options[`skip-logs`] &&
12
- colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating templates...`);
13
- const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
14
- const progressLog = progress_1.setupProgressLogger({
15
- total: componentWithTemplatesPaths.length,
16
- });
17
- componentWithTemplatesPaths.forEach(resource => {
18
- const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
19
- const recorder = fileSystem.edit(path);
20
- !options[`skip-logs`] && progressLog(`expand migration`, true);
21
- migrateExpand({ resource, fileSystem, recorder });
22
- });
23
- !options[`skip-logs`] &&
24
- colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} templates migrated \n`);
25
- }
26
- exports.migrateExpandTemplates = migrateExpandTemplates;
27
10
  function migrateExpand({ resource, recorder, fileSystem, }) {
28
11
  const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
29
12
  const templateOffset = template_resource_1.getTemplateOffset(resource);
@@ -42,3 +25,20 @@ function migrateExpand({ resource, recorder, fileSystem, }) {
42
25
  recorder.insertRight(insertTo + templateOffset - 1, ` tuiExpandContent`);
43
26
  });
44
27
  }
28
+ function migrateExpandTemplates(fileSystem, options) {
29
+ !options[`skip-logs`] &&
30
+ colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating templates...`);
31
+ const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
32
+ const progressLog = progress_1.setupProgressLogger({
33
+ total: componentWithTemplatesPaths.length,
34
+ });
35
+ componentWithTemplatesPaths.forEach(resource => {
36
+ const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
37
+ const recorder = fileSystem.edit(path);
38
+ !options[`skip-logs`] && progressLog(`expand migration`, true);
39
+ migrateExpand({ resource, fileSystem, recorder });
40
+ });
41
+ !options[`skip-logs`] &&
42
+ colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} templates migrated \n`);
43
+ }
44
+ exports.migrateExpandTemplates = migrateExpandTemplates;
@@ -12,6 +12,18 @@ const project_root_1 = require("../../utils/project-root");
12
12
  const replace_identifier_1 = require("../steps/replace-identifier");
13
13
  const steps_1 = require("./steps");
14
14
  const identifiers_to_replace_1 = require("./steps/constants/identifiers-to-replace");
15
+ function main(options) {
16
+ return (tree, _context) => {
17
+ const project = ng_morph_1.createProject(tree, project_root_1.projectRoot(), constants_1.ALL_FILES);
18
+ const fileSystem = project.getFileSystem().fs;
19
+ replace_identifier_1.replaceIdentifiers(options, identifiers_to_replace_1.IDENTIFIERS_TO_REPLACE);
20
+ steps_1.restoreTuiMapper(options);
21
+ steps_1.restoreTuiMatcher(options);
22
+ steps_1.migrateTemplates(fileSystem, options);
23
+ fileSystem.commitEdits();
24
+ ng_morph_1.saveActiveProject();
25
+ };
26
+ }
15
27
  function updateToV4(options) {
16
28
  const t0 = perf_hooks_1.performance.now();
17
29
  !options[`skip-logs`] &&
@@ -26,15 +38,3 @@ function updateToV4(options) {
26
38
  ]);
27
39
  }
28
40
  exports.updateToV4 = updateToV4;
29
- function main(options) {
30
- return (tree, _context) => {
31
- const project = ng_morph_1.createProject(tree, project_root_1.projectRoot(), constants_1.ALL_FILES);
32
- const fileSystem = project.getFileSystem().fs;
33
- replace_identifier_1.replaceIdentifiers(options, identifiers_to_replace_1.IDENTIFIERS_TO_REPLACE);
34
- steps_1.restoreTuiMapper(options);
35
- steps_1.restoreTuiMatcher(options);
36
- steps_1.migrateTemplates(fileSystem, options);
37
- fileSystem.commitEdits();
38
- ng_morph_1.saveActiveProject();
39
- };
40
- }
@@ -10,6 +10,9 @@ 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
+ function getAction({ action, requiredData, }) {
14
+ return ({ resource, fileSystem, recorder, }) => action({ resource, fileSystem, recorder, data: requiredData });
15
+ }
13
16
  function migrateTemplates(fileSystem, options) {
14
17
  !options[`skip-logs`] &&
15
18
  colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating templates...`);
@@ -45,6 +48,3 @@ function migrateTemplates(fileSystem, options) {
45
48
  colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} templates migrated \n`);
46
49
  }
47
50
  exports.migrateTemplates = migrateTemplates;
48
- function getAction({ action, requiredData, }) {
49
- return ({ resource, fileSystem, recorder, }) => action({ resource, fileSystem, recorder, data: requiredData });
50
- }
@@ -5,12 +5,6 @@ const ng_morph_1 = require("ng-morph");
5
5
  const colored_log_1 = require("../../../utils/colored-log");
6
6
  const get_named_import_references_1 = require("../../../utils/get-named-import-references");
7
7
  const replace_identifier_1 = require("../../steps/replace-identifier");
8
- function restoreTuiMapper(options) {
9
- updateTuiMapper(options);
10
- renameTuiTypedMapper(options);
11
- !options[`skip-logs`] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
12
- }
13
- exports.restoreTuiMapper = restoreTuiMapper;
14
8
  function updateTuiMapper(options) {
15
9
  !options[`skip-logs`] &&
16
10
  colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} updating TuiMapper typing to the typed version`);
@@ -38,3 +32,9 @@ function renameTuiTypedMapper(options) {
38
32
  to: { name: `TuiMapper`, moduleSpecifier: `@taiga-ui/cdk` },
39
33
  });
40
34
  }
35
+ function restoreTuiMapper(options) {
36
+ updateTuiMapper(options);
37
+ renameTuiTypedMapper(options);
38
+ !options[`skip-logs`] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
39
+ }
40
+ exports.restoreTuiMapper = restoreTuiMapper;
@@ -5,12 +5,6 @@ const ng_morph_1 = require("ng-morph");
5
5
  const colored_log_1 = require("../../../utils/colored-log");
6
6
  const get_named_import_references_1 = require("../../../utils/get-named-import-references");
7
7
  const replace_identifier_1 = require("../../steps/replace-identifier");
8
- function restoreTuiMatcher(options) {
9
- updateTuiMatcher(options);
10
- renameTuiTypedMatcher(options);
11
- !options[`skip-logs`] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
12
- }
13
- exports.restoreTuiMatcher = restoreTuiMatcher;
14
8
  function updateTuiMatcher(options) {
15
9
  !options[`skip-logs`] &&
16
10
  colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} updating TuiMatcher typing to the typed version`);
@@ -38,3 +32,9 @@ function renameTuiTypedMatcher(options) {
38
32
  to: { name: `TuiMatcher`, moduleSpecifier: `@taiga-ui/cdk` },
39
33
  });
40
34
  }
35
+ function restoreTuiMatcher(options) {
36
+ updateTuiMatcher(options);
37
+ renameTuiTypedMatcher(options);
38
+ !options[`skip-logs`] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
39
+ }
40
+ exports.restoreTuiMatcher = restoreTuiMatcher;
@@ -4,6 +4,30 @@ 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
6
  const template_resource_1 = require("../../../../utils/templates/template-resource");
7
+ function addModules(componentPath, modules) {
8
+ modules.forEach(({ moduleName, moduleSpecifier }) => {
9
+ add_import_to_closest_module_1.addImportToClosestModule(componentPath, moduleName, moduleSpecifier);
10
+ });
11
+ }
12
+ function removeAttrs(attrs, sourceCodeLocation, recorder, templateOffset) {
13
+ attrs.forEach(attr => {
14
+ var _a;
15
+ const attrOffset = (_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[attr.name];
16
+ if (attrOffset) {
17
+ const { startOffset, endOffset } = attrOffset;
18
+ recorder.remove(templateOffset + startOffset - 1, endOffset - startOffset + 1);
19
+ }
20
+ });
21
+ }
22
+ function getFallbackValue(textValue, fallbackValue) {
23
+ if (textValue) {
24
+ return `(${textValue} | tuiInitials)`;
25
+ }
26
+ return textValue ? `(${textValue} | tuiInitials)` : fallbackValue || ``;
27
+ }
28
+ function normalizeAttrValue(attrName, attrValue) {
29
+ return attrName.startsWith(`[`) ? attrValue : `'${attrValue}'`;
30
+ }
7
31
  function migrateAvatar({ resource, recorder, fileSystem, }) {
8
32
  const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
9
33
  const templateOffset = template_resource_1.getTemplateOffset(resource);
@@ -49,27 +73,3 @@ function migrateAvatar({ resource, recorder, fileSystem, }) {
49
73
  });
50
74
  }
51
75
  exports.migrateAvatar = migrateAvatar;
52
- function addModules(componentPath, modules) {
53
- modules.forEach(({ moduleName, moduleSpecifier }) => {
54
- add_import_to_closest_module_1.addImportToClosestModule(componentPath, moduleName, moduleSpecifier);
55
- });
56
- }
57
- function removeAttrs(attrs, sourceCodeLocation, recorder, templateOffset) {
58
- attrs.forEach(attr => {
59
- var _a;
60
- const attrOffset = (_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[attr.name];
61
- if (attrOffset) {
62
- const { startOffset, endOffset } = attrOffset;
63
- recorder.remove(templateOffset + startOffset - 1, endOffset - startOffset + 1);
64
- }
65
- });
66
- }
67
- function getFallbackValue(textValue, fallbackValue) {
68
- if (textValue) {
69
- return `(${textValue} | tuiInitials)`;
70
- }
71
- return textValue ? `(${textValue} | tuiInitials)` : fallbackValue || ``;
72
- }
73
- function normalizeAttrValue(attrName, attrValue) {
74
- return attrName.startsWith(`[`) ? attrValue : `'${attrValue}'`;
75
- }
@@ -9,11 +9,11 @@ function replaceSubstring(text, replacement) {
9
9
  function replaceSubstrings(text, replacements) {
10
10
  let transformed = text;
11
11
  let acc = 0;
12
- for (const replacement of replacements) {
12
+ replacements.forEach(replacement => {
13
13
  replacement.start += acc;
14
14
  transformed = replaceSubstring(transformed, replacement);
15
15
  acc += replacement.to.length - replacement.from.length;
16
- }
16
+ });
17
17
  return transformed;
18
18
  }
19
19
  exports.replaceSubstrings = replaceSubstrings;
@@ -9,6 +9,14 @@ const is_string_1 = require("../../utils/miscellaneous/is-string");
9
9
  const versions_1 = require("../ng-add/constants/versions");
10
10
  const get_project_target_options_1 = require("./get-project-target-options");
11
11
  const get_projects_1 = require("./get-projects");
12
+ function hasTaigaIcons(assets) {
13
+ return !!(assets === null || assets === void 0 ? void 0 : assets.find(asset => {
14
+ var _a;
15
+ return is_string_1.tuiIsString(asset)
16
+ ? asset.includes(`taiga-ui`)
17
+ : (_a = asset === null || asset === void 0 ? void 0 : asset.input) === null || _a === void 0 ? void 0 : _a.includes(`taiga-ui`);
18
+ }));
19
+ }
12
20
  function isInvalidAngularJson(tree) {
13
21
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
22
  return (workspace_1.getWorkspace(tree)
@@ -23,16 +31,7 @@ function isInvalidAngularJson(tree) {
23
31
  });
24
32
  }
25
33
  exports.isInvalidAngularJson = isInvalidAngularJson;
26
- function hasTaigaIcons(assets) {
27
- return !!(assets === null || assets === void 0 ? void 0 : assets.find(asset => {
28
- var _a;
29
- return is_string_1.tuiIsString(asset)
30
- ? asset.includes(`taiga-ui`)
31
- : (_a = asset === null || asset === void 0 ? void 0 : asset.input) === null || _a === void 0 ? void 0 : _a.includes(`taiga-ui`);
32
- }));
33
- }
34
34
  function addStylesToAngularJson(options, context, taigaStyles, filter, stylesToReplace, tree) {
35
- // eslint-disable-next-line @typescript-eslint/naming-convention
36
35
  const MANUAL_MIGRATION_TIPS = `Add styles ${taigaStyles.join(`,`)} to angular.json manually.`;
37
36
  return workspace_1.updateWorkspace(workspace => {
38
37
  const projects = get_projects_1.getProjects(options, workspace);
@@ -4,14 +4,6 @@ exports.getComponentTemplates = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ng_morph_1 = require("ng-morph");
6
6
  const path = tslib_1.__importStar(require("path"));
7
- function getComponentTemplates(pattern, query) {
8
- return ng_morph_1.getClasses(pattern, query)
9
- .map(declaration => declaration.getDecorator(`Component`))
10
- .filter((decorator) => !!decorator)
11
- .map(decoratorToTemplateResource)
12
- .filter((x) => Boolean(x));
13
- }
14
- exports.getComponentTemplates = getComponentTemplates;
15
7
  function decoratorToTemplateResource(decorator) {
16
8
  var _a, _b, _c;
17
9
  const [metadata] = decorator.getArguments();
@@ -37,3 +29,11 @@ function decoratorToTemplateResource(decorator) {
37
29
  function getFullTemplatePath(templatePath, componentPath) {
38
30
  return path.join(componentPath.dir, templatePath.dir, templatePath.name + templatePath.ext);
39
31
  }
32
+ function getComponentTemplates(pattern, query) {
33
+ return ng_morph_1.getClasses(pattern, query)
34
+ .map(declaration => declaration.getDecorator(`Component`))
35
+ .filter((decorator) => !!decorator)
36
+ .map(decoratorToTemplateResource)
37
+ .filter((x) => Boolean(x));
38
+ }
39
+ exports.getComponentTemplates = getComponentTemplates;
@@ -13,4 +13,9 @@ import { TuiSafeHtml } from '@taiga-ui/cdk/interfaces';
13
13
  * Documentation: https://www.w3.org/TR/SVG11/pservers.html
14
14
  *
15
15
  */
16
- export declare function tuiSvgLinearGradientProcessor(svg: TuiSafeHtml, salt?: number | string, fallback?: string): TuiSafeHtml;
16
+ export declare function tuiSvgLinearGradientProcessor(svg: TuiSafeHtml, salt?: number | string,
17
+ /**
18
+ * TODO: remove in v4.0
19
+ * @deprecated
20
+ */
21
+ fallback?: string): TuiSafeHtml;