@taiga-ui/cdk 3.54.0-canary.e1ba43c → 3.55.0
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.
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +2 -2
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-scroll-controls.umd.js +10 -10
- package/bundles/taiga-ui-cdk-components-scroll-controls.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +75 -75
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-date-time.umd.js +2 -4
- package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-decorators.umd.js +12 -12
- package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.js +10 -10
- package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +23 -23
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-color.umd.js +12 -12
- package/bundles/taiga-ui-cdk-utils-color.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-dom.umd.js +5 -5
- package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-math.umd.js +16 -16
- package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +3 -3
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-svg.umd.js +23 -23
- package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2015/components/dialog-host/dialog-host.component.js +3 -3
- package/esm2015/components/scroll-controls/scrollbar.directive.js +7 -7
- package/esm2015/constants/empty.js +9 -9
- package/esm2015/constants/matcher.js +4 -4
- package/esm2015/constants/used-icons.js +64 -64
- package/esm2015/constants/version.js +2 -2
- package/esm2015/date-time/day-range.js +2 -4
- package/esm2015/date-time/day.js +2 -2
- package/esm2015/decorators/default-prop.js +10 -10
- package/esm2015/decorators/required-setter.js +4 -4
- package/esm2015/services/scroll.service.js +11 -11
- package/esm2015/tokens/active-element.js +14 -14
- package/esm2015/utils/color/hex-to-rgba.js +9 -9
- package/esm2015/utils/color/hsv-to-rgb.js +5 -5
- package/esm2015/utils/dom/can-scroll.js +6 -6
- package/esm2015/utils/math/round.js +13 -13
- package/esm2015/utils/miscellaneous/clean-object.js +4 -4
- package/esm2015/utils/svg/svg-linear-gradient-processor.js +24 -24
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js +2 -2
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-scroll-controls.js +6 -6
- package/fesm2015/taiga-ui-cdk-components-scroll-controls.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +75 -75
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-date-time.js +2 -4
- package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-decorators.js +12 -12
- package/fesm2015/taiga-ui-cdk-decorators.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-services.js +10 -10
- package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +15 -15
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-color.js +12 -12
- package/fesm2015/taiga-ui-cdk-utils-color.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-dom.js +5 -5
- package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-math.js +12 -12
- package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +3 -3
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-svg.js +23 -23
- package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
- package/package.json +68 -68
- package/schematics/ng-add/index.js +10 -10
- package/schematics/ng-add/steps/add-taiga-modules.js +32 -32
- package/schematics/ng-add/steps/wrap-with-tui-root.js +21 -21
- package/schematics/ng-update/steps/rename-types.js +8 -8
- package/schematics/ng-update/steps/replace-enums.js +8 -8
- package/schematics/ng-update/steps/replace-services.js +8 -8
- package/schematics/ng-update/steps/show-warnings.js +4 -4
- package/schematics/ng-update/v3/index.js +17 -17
- package/schematics/ng-update/v3/steps/migrate-date-time.js +92 -92
- package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +35 -35
- package/schematics/ng-update/v3/steps/migrate-progress.d.ts +4 -0
- package/schematics/ng-update/v3/steps/migrate-progress.js +15 -13
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +44 -44
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +28 -28
- package/schematics/ng-update/v3/steps/migrate-templates.js +37 -36
- package/schematics/ng-update/v3/steps/migrate-textfield-controller.js +21 -21
- package/schematics/ng-update/v3/steps/miscellaneous.js +32 -32
- package/schematics/ng-update/v3/steps/replace-functions.js +18 -18
- package/schematics/ng-update/v3-30/index.js +3 -3
- package/schematics/ng-update/v3-35/index.js +3 -3
- package/schematics/ng-update/v3-40/index.js +9 -9
- package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +17 -17
- package/schematics/ng-update/v4/index.js +12 -12
- package/schematics/ng-update/v4/steps/migrate-templates.js +3 -3
- package/schematics/ng-update/v4/steps/restore-tui-mapper.js +6 -6
- package/schematics/ng-update/v4/steps/restore-tui-matcher.js +6 -6
- package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +24 -24
- package/schematics/utils/angular-json-manipulations.js +8 -8
- package/schematics/utils/templates/get-component-templates.js +8 -8
@@ -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();
|
@@ -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;
|
@@ -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;
|
@@ -7,98 +7,6 @@ const colored_log_1 = require("../../../utils/colored-log");
|
|
7
7
|
const get_execution_time_1 = require("../../../utils/get-execution-time");
|
8
8
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
9
9
|
const insert_todo_1 = require("../../../utils/insert-todo");
|
10
|
-
function dateTimeMigrations(options) {
|
11
|
-
!options[`skip-logs`] &&
|
12
|
-
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating taiga date/time...`);
|
13
|
-
let start = perf_hooks_1.performance.now();
|
14
|
-
migrateProperty({
|
15
|
-
namedImport: `TuiDay`,
|
16
|
-
moduleSpecifier: `@taiga-ui/cdk`,
|
17
|
-
from: `formattedDay`,
|
18
|
-
callback: node => node.replaceWithText(node.getText().replace(`formattedDay`, `getFormattedDay("DMY", ".")`)),
|
19
|
-
});
|
20
|
-
!options[`skip-logs`] &&
|
21
|
-
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDay.formattedDay ` +
|
22
|
-
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
23
|
-
start = perf_hooks_1.performance.now();
|
24
|
-
migrateProperty({
|
25
|
-
namedImport: `TuiDayRange`,
|
26
|
-
moduleSpecifier: `@taiga-ui/cdk`,
|
27
|
-
from: `formattedDayRange`,
|
28
|
-
callback: node => node.replaceWithText(node
|
29
|
-
.getText()
|
30
|
-
.replace(`formattedDayRange`, `getFormattedDayRange("DMY", ".")`)),
|
31
|
-
});
|
32
|
-
!options[`skip-logs`] &&
|
33
|
-
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.formattedDayRange ` +
|
34
|
-
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
35
|
-
start = perf_hooks_1.performance.now();
|
36
|
-
migrateProperty({
|
37
|
-
namedImport: `TuiDayRange`,
|
38
|
-
moduleSpecifier: `@taiga-ui/cdk`,
|
39
|
-
from: `normalizeParse`,
|
40
|
-
callback: node => {
|
41
|
-
const parent = node.getParent();
|
42
|
-
if (ng_morph_1.Node.isCallExpression(parent)) {
|
43
|
-
changeNormalizeArgs(parent);
|
44
|
-
}
|
45
|
-
},
|
46
|
-
});
|
47
|
-
!options[`skip-logs`] &&
|
48
|
-
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.normalizeParse ` +
|
49
|
-
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
50
|
-
[
|
51
|
-
{
|
52
|
-
namedImport: `TuiMonthRange`,
|
53
|
-
field: `formattedMonthRange`,
|
54
|
-
message: `formattedMonthRange has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit`,
|
55
|
-
},
|
56
|
-
{
|
57
|
-
namedImport: `TuiMonth`,
|
58
|
-
field: `formattedMonth`,
|
59
|
-
message: `formattedMonth has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit`,
|
60
|
-
},
|
61
|
-
{
|
62
|
-
namedImport: `TuiDay`,
|
63
|
-
field: `getDayFromMonthRowCol`,
|
64
|
-
message: `getDayFromMonthRowCol has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
65
|
-
},
|
66
|
-
{
|
67
|
-
namedImport: `TuiMonth`,
|
68
|
-
field: `monthStartDaysOffset`,
|
69
|
-
message: `monthStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
70
|
-
},
|
71
|
-
{
|
72
|
-
namedImport: `TuiMonth`,
|
73
|
-
field: `weeksRowsCount`,
|
74
|
-
message: `weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
75
|
-
},
|
76
|
-
{
|
77
|
-
namedImport: `TuiYear`,
|
78
|
-
field: `getYearStartDaysOffset`,
|
79
|
-
message: `getYearStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
80
|
-
},
|
81
|
-
{
|
82
|
-
namedImport: `TuiYear`,
|
83
|
-
field: `weeksRowsCount`,
|
84
|
-
message: `weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
85
|
-
},
|
86
|
-
].forEach(({ namedImport, field, message }) => {
|
87
|
-
start = perf_hooks_1.performance.now();
|
88
|
-
migrateProperty({
|
89
|
-
namedImport,
|
90
|
-
moduleSpecifier: `@taiga-ui/cdk`,
|
91
|
-
from: field,
|
92
|
-
callback: node => insertTodoBeforeNode(node, message),
|
93
|
-
});
|
94
|
-
!options[`skip-logs`] &&
|
95
|
-
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}${namedImport}.${field} ` +
|
96
|
-
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
97
|
-
});
|
98
|
-
!options[`skip-logs`] &&
|
99
|
-
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} date/time migrated \n`);
|
100
|
-
}
|
101
|
-
exports.dateTimeMigrations = dateTimeMigrations;
|
102
10
|
function migrateProperty({ namedImport, moduleSpecifier, from, callback, }) {
|
103
11
|
const references = get_named_import_references_1.getNamedImportReferences(namedImport, moduleSpecifier);
|
104
12
|
references.forEach(ref => {
|
@@ -205,3 +113,95 @@ function areBothObjectDestructuring(ref, identifier) {
|
|
205
113
|
return Boolean(identifier.getFirstAncestorByKind(ng_morph_1.SyntaxKind.BindingElement) &&
|
206
114
|
ref.getFirstAncestorByKind(ng_morph_1.SyntaxKind.BindingElement));
|
207
115
|
}
|
116
|
+
function dateTimeMigrations(options) {
|
117
|
+
!options[`skip-logs`] &&
|
118
|
+
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating taiga date/time...`);
|
119
|
+
let start = perf_hooks_1.performance.now();
|
120
|
+
migrateProperty({
|
121
|
+
namedImport: `TuiDay`,
|
122
|
+
moduleSpecifier: `@taiga-ui/cdk`,
|
123
|
+
from: `formattedDay`,
|
124
|
+
callback: node => node.replaceWithText(node.getText().replace(`formattedDay`, `getFormattedDay("DMY", ".")`)),
|
125
|
+
});
|
126
|
+
!options[`skip-logs`] &&
|
127
|
+
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDay.formattedDay ` +
|
128
|
+
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
129
|
+
start = perf_hooks_1.performance.now();
|
130
|
+
migrateProperty({
|
131
|
+
namedImport: `TuiDayRange`,
|
132
|
+
moduleSpecifier: `@taiga-ui/cdk`,
|
133
|
+
from: `formattedDayRange`,
|
134
|
+
callback: node => node.replaceWithText(node
|
135
|
+
.getText()
|
136
|
+
.replace(`formattedDayRange`, `getFormattedDayRange("DMY", ".")`)),
|
137
|
+
});
|
138
|
+
!options[`skip-logs`] &&
|
139
|
+
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.formattedDayRange ` +
|
140
|
+
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
141
|
+
start = perf_hooks_1.performance.now();
|
142
|
+
migrateProperty({
|
143
|
+
namedImport: `TuiDayRange`,
|
144
|
+
moduleSpecifier: `@taiga-ui/cdk`,
|
145
|
+
from: `normalizeParse`,
|
146
|
+
callback: node => {
|
147
|
+
const parent = node.getParent();
|
148
|
+
if (ng_morph_1.Node.isCallExpression(parent)) {
|
149
|
+
changeNormalizeArgs(parent);
|
150
|
+
}
|
151
|
+
},
|
152
|
+
});
|
153
|
+
!options[`skip-logs`] &&
|
154
|
+
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.normalizeParse ` +
|
155
|
+
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
156
|
+
[
|
157
|
+
{
|
158
|
+
namedImport: `TuiMonthRange`,
|
159
|
+
field: `formattedMonthRange`,
|
160
|
+
message: `formattedMonthRange has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit`,
|
161
|
+
},
|
162
|
+
{
|
163
|
+
namedImport: `TuiMonth`,
|
164
|
+
field: `formattedMonth`,
|
165
|
+
message: `formattedMonth has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit`,
|
166
|
+
},
|
167
|
+
{
|
168
|
+
namedImport: `TuiDay`,
|
169
|
+
field: `getDayFromMonthRowCol`,
|
170
|
+
message: `getDayFromMonthRowCol has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
171
|
+
},
|
172
|
+
{
|
173
|
+
namedImport: `TuiMonth`,
|
174
|
+
field: `monthStartDaysOffset`,
|
175
|
+
message: `monthStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
176
|
+
},
|
177
|
+
{
|
178
|
+
namedImport: `TuiMonth`,
|
179
|
+
field: `weeksRowsCount`,
|
180
|
+
message: `weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
181
|
+
},
|
182
|
+
{
|
183
|
+
namedImport: `TuiYear`,
|
184
|
+
field: `getYearStartDaysOffset`,
|
185
|
+
message: `getYearStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
186
|
+
},
|
187
|
+
{
|
188
|
+
namedImport: `TuiYear`,
|
189
|
+
field: `weeksRowsCount`,
|
190
|
+
message: `weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet`,
|
191
|
+
},
|
192
|
+
].forEach(({ namedImport, field, message }) => {
|
193
|
+
start = perf_hooks_1.performance.now();
|
194
|
+
migrateProperty({
|
195
|
+
namedImport,
|
196
|
+
moduleSpecifier: `@taiga-ui/cdk`,
|
197
|
+
from: field,
|
198
|
+
callback: node => insertTodoBeforeNode(node, message),
|
199
|
+
});
|
200
|
+
!options[`skip-logs`] &&
|
201
|
+
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}${namedImport}.${field} ` +
|
202
|
+
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
203
|
+
});
|
204
|
+
!options[`skip-logs`] &&
|
205
|
+
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} date/time migrated \n`);
|
206
|
+
}
|
207
|
+
exports.dateTimeMigrations = dateTimeMigrations;
|
@@ -5,41 +5,6 @@ const elements_1 = require("../../../utils/templates/elements");
|
|
5
5
|
const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
|
6
6
|
const template_resource_1 = require("../../../utils/templates/template-resource");
|
7
7
|
const replace_tag_1 = require("../../utils/templates/replace-tag");
|
8
|
-
function migratePolymorpheus({ resource, fileSystem, recorder, }) {
|
9
|
-
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
10
|
-
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
11
|
-
const elements = elements_1.findElementsWithAttribute(template, `polymorpheus-outlet`);
|
12
|
-
elements.forEach(element => {
|
13
|
-
var _a, _b;
|
14
|
-
const contentVal = (_a = element.attrs.find(attr => attr.name === `[content]`)) === null || _a === void 0 ? void 0 : _a.value;
|
15
|
-
const contextVal = (_b = element.attrs.find(attr => attr.name === `[context]`)) === null || _b === void 0 ? void 0 : _b.value;
|
16
|
-
const defaultTemplateEl = elements_1.findElementsByFn(element.childNodes, el => el.tagName === `ng-template`)[0];
|
17
|
-
if (!contentVal) {
|
18
|
-
return;
|
19
|
-
}
|
20
|
-
if (defaultTemplateEl) {
|
21
|
-
insertPolymorpheusWithDefault({
|
22
|
-
template,
|
23
|
-
defaultTemplateEl,
|
24
|
-
recorder,
|
25
|
-
templateOffset,
|
26
|
-
contentVal,
|
27
|
-
contextVal,
|
28
|
-
});
|
29
|
-
}
|
30
|
-
else {
|
31
|
-
insertPolymorpheus({
|
32
|
-
element,
|
33
|
-
contentVal,
|
34
|
-
contextVal,
|
35
|
-
recorder,
|
36
|
-
templateOffset,
|
37
|
-
});
|
38
|
-
}
|
39
|
-
});
|
40
|
-
removeOldInputs(recorder, template, templateOffset);
|
41
|
-
}
|
42
|
-
exports.migratePolymorpheus = migratePolymorpheus;
|
43
8
|
function insertPolymorpheus({ element, contentVal, contextVal, recorder, templateOffset, }) {
|
44
9
|
var _a, _b;
|
45
10
|
const content = `
|
@@ -76,3 +41,38 @@ function insertPolymorpheusWithDefault({ template, defaultTemplateEl, recorder,
|
|
76
41
|
templateOffset, templateVar.name.length);
|
77
42
|
}
|
78
43
|
}
|
44
|
+
function migratePolymorpheus({ resource, fileSystem, recorder, }) {
|
45
|
+
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
46
|
+
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
47
|
+
const elements = elements_1.findElementsWithAttribute(template, `polymorpheus-outlet`);
|
48
|
+
elements.forEach(element => {
|
49
|
+
var _a, _b;
|
50
|
+
const contentVal = (_a = element.attrs.find(attr => attr.name === `[content]`)) === null || _a === void 0 ? void 0 : _a.value;
|
51
|
+
const contextVal = (_b = element.attrs.find(attr => attr.name === `[context]`)) === null || _b === void 0 ? void 0 : _b.value;
|
52
|
+
const defaultTemplateEl = elements_1.findElementsByFn(element.childNodes, el => el.tagName === `ng-template`)[0];
|
53
|
+
if (!contentVal) {
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
if (defaultTemplateEl) {
|
57
|
+
insertPolymorpheusWithDefault({
|
58
|
+
template,
|
59
|
+
defaultTemplateEl,
|
60
|
+
recorder,
|
61
|
+
templateOffset,
|
62
|
+
contentVal,
|
63
|
+
contextVal,
|
64
|
+
});
|
65
|
+
}
|
66
|
+
else {
|
67
|
+
insertPolymorpheus({
|
68
|
+
element,
|
69
|
+
contentVal,
|
70
|
+
contextVal,
|
71
|
+
recorder,
|
72
|
+
templateOffset,
|
73
|
+
});
|
74
|
+
}
|
75
|
+
});
|
76
|
+
removeOldInputs(recorder, template, templateOffset);
|
77
|
+
}
|
78
|
+
exports.migratePolymorpheus = migratePolymorpheus;
|
@@ -1,4 +1,8 @@
|
|
1
1
|
import { DevkitFileSystem } from 'ng-morph';
|
2
|
+
import { Element } from 'parse5';
|
2
3
|
import { TuiSchema } from '../../../ng-add/schema';
|
4
|
+
import { TemplateResource } from '../../interfaces/template-resource';
|
3
5
|
export declare const DEPRECATED_PROGRESS_PIPES_REG: RegExp;
|
6
|
+
export declare function replaceProgressColorSegmentsPipe(templateResource: TemplateResource, fileSystem: DevkitFileSystem): void;
|
7
|
+
export declare function isProgressWithDeprecatedPipe(element: Element): boolean;
|
4
8
|
export declare function migrateProgress(fileSystem: DevkitFileSystem, options: TuiSchema): void;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.migrateProgress = exports.DEPRECATED_PROGRESS_PIPES_REG = void 0;
|
3
|
+
exports.migrateProgress = exports.isProgressWithDeprecatedPipe = exports.replaceProgressColorSegmentsPipe = exports.DEPRECATED_PROGRESS_PIPES_REG = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const constants_1 = require("../../../constants");
|
6
6
|
const colored_log_1 = require("../../../utils/colored-log");
|
@@ -8,21 +8,10 @@ const project_root_1 = require("../../../utils/project-root");
|
|
8
8
|
const elements_1 = require("../../../utils/templates/elements");
|
9
9
|
const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
|
10
10
|
const template_resource_1 = require("../../../utils/templates/template-resource");
|
11
|
+
const PROPERTY_FOR_DEPRECATED_PIPES = `[color]`;
|
11
12
|
exports.DEPRECATED_PROGRESS_PIPES_REG =
|
12
13
|
// eslint-disable-next-line unicorn/no-unsafe-regex
|
13
14
|
/\s*\|\s*tuiProgressColorSegments(Async\s*\|\s*async)?/gi;
|
14
|
-
const PROPERTY_FOR_DEPRECATED_PIPES = `[color]`;
|
15
|
-
function migrateProgress(fileSystem, options) {
|
16
|
-
!options[`skip-logs`] &&
|
17
|
-
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating progress bars...`);
|
18
|
-
get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES).forEach(templateResource => replaceProgressColorSegmentsPipe(templateResource, fileSystem));
|
19
|
-
fileSystem.commitEdits();
|
20
|
-
ng_morph_1.saveActiveProject();
|
21
|
-
ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, project_root_1.projectRoot(), constants_1.ALL_FILES));
|
22
|
-
!options[`skip-logs`] &&
|
23
|
-
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} progress bars migrated \n`);
|
24
|
-
}
|
25
|
-
exports.migrateProgress = migrateProgress;
|
26
15
|
function replaceProgressColorSegmentsPipe(templateResource, fileSystem) {
|
27
16
|
const template = template_resource_1.getTemplateFromTemplateResource(templateResource, fileSystem);
|
28
17
|
const templateOffset = template_resource_1.getTemplateOffset(templateResource);
|
@@ -42,8 +31,21 @@ function replaceProgressColorSegmentsPipe(templateResource, fileSystem) {
|
|
42
31
|
}
|
43
32
|
});
|
44
33
|
}
|
34
|
+
exports.replaceProgressColorSegmentsPipe = replaceProgressColorSegmentsPipe;
|
45
35
|
function isProgressWithDeprecatedPipe(element) {
|
46
36
|
return (element.tagName === `progress` &&
|
47
37
|
element.attrs.some(attr => attr.name === PROPERTY_FOR_DEPRECATED_PIPES &&
|
48
38
|
attr.value.match(exports.DEPRECATED_PROGRESS_PIPES_REG)));
|
49
39
|
}
|
40
|
+
exports.isProgressWithDeprecatedPipe = isProgressWithDeprecatedPipe;
|
41
|
+
function migrateProgress(fileSystem, options) {
|
42
|
+
!options[`skip-logs`] &&
|
43
|
+
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating progress bars...`);
|
44
|
+
get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES).forEach(templateResource => replaceProgressColorSegmentsPipe(templateResource, fileSystem));
|
45
|
+
fileSystem.commitEdits();
|
46
|
+
ng_morph_1.saveActiveProject();
|
47
|
+
ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, project_root_1.projectRoot(), constants_1.ALL_FILES));
|
48
|
+
!options[`skip-logs`] &&
|
49
|
+
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} progress bars migrated \n`);
|
50
|
+
}
|
51
|
+
exports.migrateProgress = migrateProgress;
|