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

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 +69 -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
package/package.json CHANGED
@@ -1,70 +1,71 @@
1
1
  {
2
- "name": "@taiga-ui/cdk",
3
- "version": "3.54.0",
4
- "description": "Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance",
5
- "keywords": [
6
- "angular",
7
- "cdk",
8
- "component",
9
- "development",
10
- "kit",
11
- "service",
12
- "directive"
13
- ],
14
- "homepage": "https://github.com/taiga-family/taiga-ui",
15
- "repository": "https://github.com/taiga-family/taiga-ui",
16
- "license": "Apache-2.0",
17
- "dependencies": {
18
- "@ng-web-apis/common": "3.0.6",
19
- "@ng-web-apis/mutation-observer": "3.0.6",
20
- "@ng-web-apis/resize-observer": "3.0.6",
21
- "@tinkoff/ng-event-plugins": "3.1.0",
22
- "@tinkoff/ng-polymorpheus": "4.2.0",
23
- "tslib": "2.6.2"
24
- },
25
- "peerDependencies": {
26
- "@angular/animations": ">=12.0.0",
27
- "@angular/common": ">=12.0.0",
28
- "@angular/core": ">=12.0.0",
29
- "@angular/forms": ">=12.0.0",
30
- "rxjs": ">=6.0.0"
31
- },
32
- "optionalDependencies": {
33
- "ng-morph": "4.0.0",
34
- "parse5": "6.0.1"
35
- },
36
- "ng-update": {
37
- "migrations": "./schematics/migration.json",
38
- "packageGroup": [
39
- "@taiga-ui/i18n",
40
- "@taiga-ui/cdk",
41
- "@taiga-ui/core",
42
- "@taiga-ui/kit",
43
- "@taiga-ui/styles",
44
- "@taiga-ui/testing",
45
- "@taiga-ui/addon-doc",
46
- "@taiga-ui/addon-charts",
47
- "@taiga-ui/addon-commerce",
48
- "@taiga-ui/icons",
49
- "@taiga-ui/addon-preview",
50
- "@taiga-ui/addon-tablebars",
51
- "@taiga-ui/addon-table",
52
- "@taiga-ui/addon-mobile",
53
- "@taiga-ui/layout",
54
- "@taiga-ui/proprietary-banking",
55
- "@taiga-ui/proprietary-core",
56
- "@taiga-ui/proprietary-icons",
57
- "@taiga-ui/proprietary-navigation",
58
- "@taiga-ui/proprietary-tds-icons",
59
- "@taiga-ui/proprietary-tds-palette"
60
- ]
61
- },
62
- "schematics": "./schematics/collection.json",
63
- "main": "bundles/taiga-ui-cdk.umd.js",
64
- "module": "fesm2015/taiga-ui-cdk.js",
65
- "es2015": "fesm2015/taiga-ui-cdk.js",
66
- "esm2015": "esm2015/taiga-ui-cdk.js",
67
- "fesm2015": "fesm2015/taiga-ui-cdk.js",
68
- "typings": "taiga-ui-cdk.d.ts",
69
- "sideEffects": false
2
+ "name": "@taiga-ui/cdk",
3
+ "version": "3.55.0-canary.6883895",
4
+ "description": "Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance",
5
+ "keywords": [
6
+ "angular",
7
+ "cdk",
8
+ "component",
9
+ "development",
10
+ "kit",
11
+ "service",
12
+ "directive"
13
+ ],
14
+ "homepage": "https://github.com/taiga-family/taiga-ui",
15
+ "repository": "https://github.com/taiga-family/taiga-ui",
16
+ "license": "Apache-2.0",
17
+ "dependencies": {
18
+ "@ng-web-apis/common": "3.0.6",
19
+ "@ng-web-apis/mutation-observer": "3.0.6",
20
+ "@ng-web-apis/resize-observer": "3.0.6",
21
+ "@tinkoff/ng-event-plugins": "3.1.0",
22
+ "@tinkoff/ng-polymorpheus": "4.2.0",
23
+ "tslib": "2.6.2"
24
+ },
25
+ "peerDependencies": {
26
+ "@angular/animations": ">=12.0.0",
27
+ "@angular/common": ">=12.0.0",
28
+ "@angular/core": ">=12.0.0",
29
+ "@angular/forms": ">=12.0.0",
30
+ "rxjs": ">=6.0.0"
31
+ },
32
+ "optionalDependencies": {
33
+ "ng-morph": "4.0.3",
34
+ "parse5": "6.0.1"
35
+ },
36
+ "ng-update": {
37
+ "migrations": "./schematics/migration.json",
38
+ "packageGroup": [
39
+ "@taiga-ui/i18n",
40
+ "@taiga-ui/cdk",
41
+ "@taiga-ui/core",
42
+ "@taiga-ui/kit",
43
+ "@taiga-ui/styles",
44
+ "@taiga-ui/testing",
45
+ "@taiga-ui/addon-doc",
46
+ "@taiga-ui/addon-charts",
47
+ "@taiga-ui/addon-commerce",
48
+ "@taiga-ui/icons",
49
+ "@taiga-ui/addon-preview",
50
+ "@taiga-ui/addon-tablebars",
51
+ "@taiga-ui/addon-table",
52
+ "@taiga-ui/addon-mobile",
53
+ "@taiga-ui/layout",
54
+ "@taiga-ui/experimental",
55
+ "@taiga-ui/proprietary-banking",
56
+ "@taiga-ui/proprietary-core",
57
+ "@taiga-ui/proprietary-icons",
58
+ "@taiga-ui/proprietary-navigation",
59
+ "@taiga-ui/proprietary-tds-icons",
60
+ "@taiga-ui/proprietary-tds-palette"
61
+ ]
62
+ },
63
+ "schematics": "./schematics/collection.json",
64
+ "main": "bundles/taiga-ui-cdk.umd.js",
65
+ "module": "fesm2015/taiga-ui-cdk.js",
66
+ "es2015": "fesm2015/taiga-ui-cdk.js",
67
+ "esm2015": "esm2015/taiga-ui-cdk.js",
68
+ "fesm2015": "fesm2015/taiga-ui-cdk.js",
69
+ "typings": "taiga-ui-cdk.d.ts",
70
+ "sideEffects": false
70
71
  }
@@ -5,16 +5,6 @@ const tasks_1 = require("@angular-devkit/schematics/tasks");
5
5
  const ng_morph_1 = require("ng-morph");
6
6
  const packages_1 = require("./constants/packages");
7
7
  const versions_1 = require("./constants/versions");
8
- function ngAdd(options) {
9
- return (tree, context) => {
10
- context.logger.info(`The main packages will be installed - ${packages_1.MAIN_PACKAGES}`);
11
- addDependencies(tree, options);
12
- context.addTask(new tasks_1.NodePackageInstallTask(), [
13
- context.addTask(new tasks_1.RunSchematicTask(`ng-add-setup-project`, options)),
14
- ]);
15
- };
16
- }
17
- exports.ngAdd = ngAdd;
18
8
  function addDependencies(tree, options) {
19
9
  const packages = [...packages_1.MAIN_PACKAGES, ...options.addons];
20
10
  packages.forEach(pack => {
@@ -74,3 +64,13 @@ function removeTaigaSchematicsPackage(tree) {
74
64
  // noop
75
65
  }
76
66
  }
67
+ function ngAdd(options) {
68
+ return (tree, context) => {
69
+ context.logger.info(`The main packages will be installed - ${packages_1.MAIN_PACKAGES}`);
70
+ addDependencies(tree, options);
71
+ context.addTask(new tasks_1.NodePackageInstallTask(), [
72
+ context.addTask(new tasks_1.RunSchematicTask(`ng-add-setup-project`, options)),
73
+ ]);
74
+ };
75
+ }
76
+ exports.ngAdd = ngAdd;
@@ -13,38 +13,6 @@ const get_projects_1 = require("../../utils/get-projects");
13
13
  const get_standalone_bootstrap_function_1 = require("../../utils/get-standalone-bootstrap-function");
14
14
  const push_to_array_property_1 = require("../../utils/push-to-array-property");
15
15
  const modules_1 = require("../constants/modules");
16
- function addTaigaModules(options) {
17
- return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
18
- const workspace = yield workspace_1.getWorkspace(tree);
19
- const project = get_projects_1.getProjects(options, workspace)[0];
20
- if (!project) {
21
- context.logger.warn(`[WARNING]: Target project not found in current workspace`);
22
- return;
23
- }
24
- const buildOptions = get_project_target_options_1.getProjectTargetOptions(project, `build`);
25
- const mainFilePath = (buildOptions.main || buildOptions.browser);
26
- if (!mainFilePath) {
27
- context.logger.error(`[ERROR]: Could not find the project main file`);
28
- return;
29
- }
30
- ng_morph_1.setActiveProject(ng_morph_1.createProject(tree, `/`, constants_1.ALL_FILES));
31
- const bootstrapFunction = get_standalone_bootstrap_function_1.getStandaloneBootstrapFunction(mainFilePath);
32
- if (bootstrapFunction) {
33
- addTuiEntitiesToStandalone({
34
- bootstrapFunction,
35
- options,
36
- context,
37
- });
38
- }
39
- else {
40
- const mainClass = ng_morph_1.getMainModule(mainFilePath);
41
- addTuiModules({ mainClass, options, context });
42
- addExtraTuiProvidersToRootComponent({ mainClass, options });
43
- }
44
- ng_morph_1.saveActiveProject();
45
- });
46
- }
47
- exports.addTaigaModules = addTaigaModules;
48
16
  function addTuiModules({ mainClass, options, context, }) {
49
17
  const modules = getModules(options, [modules_1.BROWSER_ANIMATION_MODULE]);
50
18
  const mainModulePath = mainClass.getSourceFile().getFilePath();
@@ -86,7 +54,7 @@ function addRootTuiProvidersToBootstrapFn(bootstrapOptions) {
86
54
  .getElements()
87
55
  .find(el => ng_morph_1.Node.isCallExpression(el) &&
88
56
  el.getExpression().getText() === `importProvidersFrom`);
89
- const providerAnimation = initializer
57
+ const provideAnimations = initializer
90
58
  .getElements()
91
59
  .find(el => ng_morph_1.Node.isCallExpression(el) &&
92
60
  el.getExpression().getText() === `provideAnimations`);
@@ -101,12 +69,12 @@ function addRootTuiProvidersToBootstrapFn(bootstrapOptions) {
101
69
  else {
102
70
  push_to_array_property_1.pushToObjectArrayProperty(bootstrapOptions, `providers`, `importProvidersFrom(TuiRootModule)`);
103
71
  }
104
- if (!providerAnimation) {
72
+ if (!provideAnimations) {
105
73
  modules.push({
106
- name: `providerAnimation`,
74
+ name: `provideAnimations`,
107
75
  packageName: `@angular/platform-browser/animations`,
108
76
  });
109
- push_to_array_property_1.pushToObjectArrayProperty(bootstrapOptions, `providers`, `providerAnimation()`, {
77
+ push_to_array_property_1.pushToObjectArrayProperty(bootstrapOptions, `providers`, `provideAnimations()`, {
110
78
  index: 0,
111
79
  });
112
80
  }
@@ -138,3 +106,35 @@ function getOptionsObject(options) {
138
106
  const definition = options.getDefinitionNodes()[0];
139
107
  return definition.getChildrenOfKind(ng_morph_1.SyntaxKind.ObjectLiteralExpression)[0];
140
108
  }
109
+ function addTaigaModules(options) {
110
+ return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
111
+ const workspace = yield workspace_1.getWorkspace(tree);
112
+ const project = get_projects_1.getProjects(options, workspace)[0];
113
+ if (!project) {
114
+ context.logger.warn(`[WARNING]: Target project not found in current workspace`);
115
+ return;
116
+ }
117
+ const buildOptions = get_project_target_options_1.getProjectTargetOptions(project, `build`);
118
+ const mainFilePath = (buildOptions.main || buildOptions.browser);
119
+ if (!mainFilePath) {
120
+ context.logger.error(`[ERROR]: Could not find the project main file`);
121
+ return;
122
+ }
123
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(tree, `/`, constants_1.ALL_FILES));
124
+ const bootstrapFunction = get_standalone_bootstrap_function_1.getStandaloneBootstrapFunction(mainFilePath);
125
+ if (bootstrapFunction) {
126
+ addTuiEntitiesToStandalone({
127
+ bootstrapFunction,
128
+ options,
129
+ context,
130
+ });
131
+ }
132
+ else {
133
+ const mainClass = ng_morph_1.getMainModule(mainFilePath);
134
+ addTuiModules({ mainClass, options, context });
135
+ addExtraTuiProvidersToRootComponent({ mainClass, options });
136
+ }
137
+ ng_morph_1.saveActiveProject();
138
+ });
139
+ }
140
+ exports.addTaigaModules = addTaigaModules;
@@ -9,27 +9,6 @@ const get_component_from_identifier_1 = require("../../utils/get-component-from-
9
9
  const get_project_target_options_1 = require("../../utils/get-project-target-options");
10
10
  const get_projects_1 = require("../../utils/get-projects");
11
11
  const get_standalone_bootstrap_function_1 = require("../../utils/get-standalone-bootstrap-function");
12
- function wrapWithTuiRootComponent(options) {
13
- return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
14
- const workspace = yield workspace_1.getWorkspace(tree);
15
- const project = get_projects_1.getProjects(options, workspace)[0];
16
- if (!project) {
17
- return;
18
- }
19
- const buildOptions = get_project_target_options_1.getProjectTargetOptions(project, `build`);
20
- ng_morph_1.setActiveProject(ng_morph_1.createProject(tree, `/`, constants_1.ALL_FILES));
21
- const appTemplatePath = getAppTemplatePath(buildOptions.main);
22
- ng_morph_1.saveActiveProject();
23
- if (!appTemplatePath) {
24
- context.logger.error(`Could not find the default main template file for this project.`);
25
- context.logger.info(`Consider manually wrapping content of your app with tui-root`);
26
- context.logger.info(`More information at https://taiga-ui.dev/getting-started`);
27
- return;
28
- }
29
- addTuiRootComponent(appTemplatePath, context, tree);
30
- });
31
- }
32
- exports.wrapWithTuiRootComponent = wrapWithTuiRootComponent;
33
12
  function addTuiRootComponent(filePath, context, tree) {
34
13
  const buffer = tree.read(filePath);
35
14
  if (!buffer) {
@@ -87,3 +66,24 @@ function getTemplateInitializer(classDeclaration, decoratorName, propertyName) {
87
66
  }
88
67
  return property.getInitializer();
89
68
  }
69
+ function wrapWithTuiRootComponent(options) {
70
+ return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
71
+ const workspace = yield workspace_1.getWorkspace(tree);
72
+ const project = get_projects_1.getProjects(options, workspace)[0];
73
+ if (!project) {
74
+ return;
75
+ }
76
+ const buildOptions = get_project_target_options_1.getProjectTargetOptions(project, `build`);
77
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(tree, `/`, constants_1.ALL_FILES));
78
+ const appTemplatePath = getAppTemplatePath(buildOptions.main);
79
+ ng_morph_1.saveActiveProject();
80
+ if (!appTemplatePath) {
81
+ context.logger.error(`Could not find the default main template file for this project.`);
82
+ context.logger.info(`Consider manually wrapping content of your app with tui-root`);
83
+ context.logger.info(`More information at https://taiga-ui.dev/getting-started`);
84
+ return;
85
+ }
86
+ addTuiRootComponent(appTemplatePath, context, tree);
87
+ });
88
+ }
89
+ exports.wrapWithTuiRootComponent = wrapWithTuiRootComponent;
@@ -5,14 +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 import_manipulations_1 = require("../../utils/import-manipulations");
8
- function renameTypes(options, types) {
9
- !options[`skip-logs`] &&
10
- colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} renaming types...`);
11
- types.forEach(({ from, to, moduleSpecifier, preserveGenerics }) => renameType(from, to, moduleSpecifier, preserveGenerics));
12
- !options[`skip-logs`] &&
13
- colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} types renamed \n`);
14
- }
15
- exports.renameTypes = renameTypes;
16
8
  function renameType(from, to, moduleSpecifier, preserveGenerics = false) {
17
9
  const references = get_named_import_references_1.getNamedImportReferences(from, moduleSpecifier);
18
10
  references.forEach(ref => {
@@ -47,3 +39,11 @@ function addGeneric(typeName, generics) {
47
39
  const genericType = typeArgs.length ? `<${typeArgs.join(`, `)}>` : ``;
48
40
  return typeName + genericType;
49
41
  }
42
+ function renameTypes(options, types) {
43
+ !options[`skip-logs`] &&
44
+ colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} renaming types...`);
45
+ types.forEach(({ from, to, moduleSpecifier, preserveGenerics }) => renameType(from, to, moduleSpecifier, preserveGenerics));
46
+ !options[`skip-logs`] &&
47
+ colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} types renamed \n`);
48
+ }
49
+ exports.renameTypes = renameTypes;
@@ -5,14 +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 import_manipulations_1 = require("../../utils/import-manipulations");
8
- function replaceEnums(options, enums) {
9
- !options[`skip-logs`] &&
10
- colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing enums imports...`);
11
- enums.forEach(({ name, replaceValues, keepAsType }) => replaceEnumWithString(name, replaceValues, keepAsType));
12
- !options[`skip-logs`] &&
13
- colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} enums replaced \n`);
14
- }
15
- exports.replaceEnums = replaceEnums;
16
8
  function replaceEnumWithString(enumName, replaceValues, keepAsType = true) {
17
9
  var _a;
18
10
  const references = get_named_import_references_1.getNamedImportReferences(enumName);
@@ -45,3 +37,11 @@ function containTypeRef(node) {
45
37
  .findReferencesAsNodes()
46
38
  .some(ref => ng_morph_1.Node.isTypeReference(ref.getParent()));
47
39
  }
40
+ function replaceEnums(options, enums) {
41
+ !options[`skip-logs`] &&
42
+ colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing enums imports...`);
43
+ enums.forEach(({ name, replaceValues, keepAsType }) => replaceEnumWithString(name, replaceValues, keepAsType));
44
+ !options[`skip-logs`] &&
45
+ colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} enums replaced \n`);
46
+ }
47
+ exports.replaceEnums = replaceEnums;
@@ -6,14 +6,6 @@ const add_unique_import_1 = require("../../utils/add-unique-import");
6
6
  const colored_log_1 = require("../../utils/colored-log");
7
7
  const get_named_import_references_1 = require("../../utils/get-named-import-references");
8
8
  const import_manipulations_1 = require("../../utils/import-manipulations");
9
- function replaceServices(options, services) {
10
- !options[`skip-logs`] &&
11
- colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing services...`);
12
- services.forEach(service => replaceService(service, options));
13
- !options[`skip-logs`] &&
14
- colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} services replaced \n`);
15
- }
16
- exports.replaceServices = replaceServices;
17
9
  function replaceService({ from, to, replaceMethods }, options) {
18
10
  !options[`skip-logs`] &&
19
11
  colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}replacing ${from.name}...`);
@@ -58,3 +50,11 @@ function replaceProperty(node, properties) {
58
50
  }
59
51
  });
60
52
  }
53
+ function replaceServices(options, services) {
54
+ !options[`skip-logs`] &&
55
+ colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing services...`);
56
+ services.forEach(service => replaceService(service, options));
57
+ !options[`skip-logs`] &&
58
+ colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} services replaced \n`);
59
+ }
60
+ exports.replaceServices = replaceServices;
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.showWarnings = void 0;
4
4
  const ng_morph_1 = require("ng-morph");
5
5
  const constants_1 = require("../../constants");
6
- function showWarnings(context, warnings) {
7
- warnings.forEach(warning => showWarning(warning, context));
8
- }
9
- exports.showWarnings = showWarnings;
10
6
  function showWarning({ name, message, moduleSpecifier = `**/**` }, { logger }) {
11
7
  const references = ng_morph_1.getImports(constants_1.ALL_TS_FILES, {
12
8
  moduleSpecifier,
@@ -37,3 +33,7 @@ function showWarning({ name, message, moduleSpecifier = `**/**` }, { logger }) {
37
33
  sourceFile.insertText(startLinePos, `// TODO: (Taiga UI migration) ${message}\n`);
38
34
  });
39
35
  }
36
+ function showWarnings(context, warnings) {
37
+ warnings.forEach(warning => showWarning(warning, context));
38
+ }
39
+ exports.showWarnings = showWarnings;
@@ -1,7 +1,6 @@
1
1
  import { UpdateRecorder } from '@angular-devkit/schematics';
2
2
  import { DevkitFileSystem } from 'ng-morph';
3
- import { TemplateResource } from '../../interfaces';
4
- import { HtmlComment } from '../../interfaces';
3
+ import { HtmlComment, TemplateResource } from '../../interfaces';
5
4
  export declare function addHTMLCommentTags({ resource, recorder, fileSystem, data, }: {
6
5
  fileSystem: DevkitFileSystem;
7
6
  recorder: UpdateRecorder;
@@ -32,23 +32,6 @@ const migrate_templates_1 = require("./steps/migrate-templates");
32
32
  const miscellaneous_1 = require("./steps/miscellaneous");
33
33
  const replace_functions_1 = require("./steps/replace-functions");
34
34
  const replace_styles_1 = require("./steps/replace-styles");
35
- function updateToV3(options) {
36
- const t0 = perf_hooks_1.performance.now();
37
- !options[`skip-logs`] &&
38
- colored_log_1.titleLog(`\n\n${colored_log_1.START_SYMBOL} Your packages will be updated to @taiga-ui/*@${versions_1.TAIGA_VERSION}\n`);
39
- return schematics_1.chain([
40
- main(options),
41
- addTaigaStyles(options),
42
- migrate_taiga_proprietary_icons_1.migrateTaigaProprietaryIcons(options),
43
- showNormalizeWarning(),
44
- () => {
45
- const executionTime = get_execution_time_1.getExecutionTime(t0, perf_hooks_1.performance.now());
46
- !options[`skip-logs`] &&
47
- colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} We migrated packages to @taiga-ui/*@${versions_1.TAIGA_VERSION} in ${executionTime}. \n`);
48
- },
49
- ]);
50
- }
51
- exports.updateToV3 = updateToV3;
52
35
  function main(options) {
53
36
  return (tree, context) => {
54
37
  const fileSystem = get_file_system_1.getFileSystem(tree);
@@ -104,3 +87,20 @@ function showNormalizeWarning() {
104
87
  }
105
88
  };
106
89
  }
90
+ function updateToV3(options) {
91
+ const t0 = perf_hooks_1.performance.now();
92
+ !options[`skip-logs`] &&
93
+ colored_log_1.titleLog(`\n\n${colored_log_1.START_SYMBOL} Your packages will be updated to @taiga-ui/*@${versions_1.TAIGA_VERSION}\n`);
94
+ return schematics_1.chain([
95
+ main(options),
96
+ addTaigaStyles(options),
97
+ migrate_taiga_proprietary_icons_1.migrateTaigaProprietaryIcons(options),
98
+ showNormalizeWarning(),
99
+ () => {
100
+ const executionTime = get_execution_time_1.getExecutionTime(t0, perf_hooks_1.performance.now());
101
+ !options[`skip-logs`] &&
102
+ colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} We migrated packages to @taiga-ui/*@${versions_1.TAIGA_VERSION} in ${executionTime}. \n`);
103
+ },
104
+ ]);
105
+ }
106
+ exports.updateToV3 = updateToV3;