@taiga-ui/cdk 4.0.0-rc.1 → 4.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/classes/control.d.ts +1 -1
- package/constants/used-icons.d.ts +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/directives/auto-focus/autofocus.options.d.ts +1 -1
- package/directives/for/for.directive.d.ts +3 -3
- package/directives/platform/platform.directive.d.ts +1 -1
- package/directives/value-changes/value-changes.directive.d.ts +3 -3
- package/esm2022/classes/control.mjs +2 -2
- package/esm2022/constants/used-icons.mjs +6 -6
- package/esm2022/constants/version.mjs +2 -2
- package/esm2022/directives/active-zone/active-zone.directive.mjs +2 -2
- package/esm2022/directives/auto-focus/handlers/ios.handler.mjs +3 -3
- package/esm2022/directives/click-outside/click-outside.directive.mjs +2 -2
- package/esm2022/directives/droppable/droppable.directive.mjs +3 -3
- package/esm2022/directives/for/for.directive.mjs +6 -6
- package/esm2022/directives/hovered/hovered.service.mjs +2 -2
- package/esm2022/directives/obscured/obscured.directive.mjs +2 -2
- package/esm2022/directives/obscured/obscured.service.mjs +2 -2
- package/esm2022/directives/pan/pan.service.mjs +2 -2
- package/esm2022/directives/platform/platform.directive.mjs +6 -6
- package/esm2022/directives/swipe/swipe.service.mjs +2 -2
- package/esm2022/directives/value-changes/value-changes.directive.mjs +6 -6
- package/esm2022/directives/zoom/zoom.service.mjs +4 -4
- package/esm2022/observables/control-value.mjs +2 -2
- package/esm2022/observables/drag-and-drop-from.mjs +2 -2
- package/esm2022/observables/events.mjs +3 -3
- package/esm2022/observables/if-map.mjs +2 -2
- package/esm2022/observables/must-be-present.mjs +2 -2
- package/esm2022/observables/zone.mjs +4 -4
- package/esm2022/pipes/filter/filter.pipe.mjs +2 -2
- package/esm2022/services/popover.service.mjs +3 -3
- package/esm2022/services/scroll.service.mjs +2 -2
- package/esm2022/services/static-request.service.mjs +1 -1
- package/esm2022/tokens/active-element.mjs +3 -3
- package/esm2022/tokens/removed-element.mjs +2 -2
- package/esm2022/utils/color/get-gradient-data.mjs +6 -0
- package/esm2022/utils/color/hex-to-rgb.mjs +2 -2
- package/esm2022/utils/color/index.mjs +3 -1
- package/esm2022/utils/color/parse-color.mjs +3 -3
- package/esm2022/utils/color/parse-gradient.mjs +70 -0
- package/esm2022/utils/color/rgb-to-hex.mjs +2 -2
- package/esm2022/utils/dom/get-element-obscurers.mjs +2 -2
- package/esm2022/utils/dom/get-element-point.mjs +6 -0
- package/esm2022/utils/dom/index.mjs +2 -1
- package/esm2022/utils/miscellaneous/mark-control-as-touched-and-validate.mjs +3 -3
- package/esm2022/utils/miscellaneous/with-styles.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-classes.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +6 -6
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-for.mjs +5 -5
- package/fesm2022/taiga-ui-cdk-directives-for.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-platform.mjs +5 -5
- package/fesm2022/taiga-ui-cdk-directives-platform.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +5 -5
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-observables.mjs +9 -9
- package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-filter.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-services.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-tokens.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-color.mjs +80 -5
- package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs +7 -2
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
- package/package.json +67 -357
- package/schematics/migration.json +3 -3
- package/schematics/ng-add/constants/modules.d.ts +0 -1
- package/schematics/ng-add/constants/modules.js +1 -11
- package/schematics/ng-add/constants/versions.d.ts +0 -1
- package/schematics/ng-add/constants/versions.js +1 -2
- package/schematics/ng-add/index.js +1 -7
- package/schematics/ng-add/schema.d.ts +0 -1
- package/schematics/ng-add/schema.json +0 -27
- package/schematics/ng-add/steps/add-taiga-icons.js +1 -1
- package/schematics/ng-add/steps/add-taiga-modules.js +7 -22
- package/schematics/ng-update/interfaces/replacement-type.d.ts +1 -0
- package/schematics/ng-update/steps/icons/replace-imports.js +5 -5
- package/schematics/ng-update/steps/index.d.ts +1 -0
- package/schematics/ng-update/steps/index.js +1 -0
- package/schematics/ng-update/steps/remove-module.js +2 -2
- package/schematics/ng-update/steps/rename-types.js +7 -7
- package/schematics/ng-update/steps/replace-deep-import.js +2 -2
- package/schematics/ng-update/steps/replace-enums.js +2 -2
- package/schematics/ng-update/steps/replace-identifier.js +1 -1
- package/schematics/ng-update/steps/replace-package-name.d.ts +5 -0
- package/schematics/ng-update/steps/replace-package-name.js +19 -0
- package/schematics/ng-update/steps/replace-services.js +5 -5
- package/schematics/ng-update/steps/show-warnings.js +4 -4
- package/schematics/ng-update/utils/replace-text.js +1 -1
- package/schematics/ng-update/utils/templates/replace-attr-values.js +3 -3
- package/schematics/ng-update/utils/templates/replace-attrs.js +1 -1
- package/schematics/ng-update/utils/templates/template-comments.js +4 -2
- package/schematics/ng-update/v3/constants/templates.js +9 -9
- package/schematics/ng-update/v3/index.js +1 -1
- package/schematics/ng-update/v3/steps/migrate-date-time.js +10 -10
- package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +8 -8
- package/schematics/ng-update/v3/steps/migrate-progress.js +4 -4
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +3 -3
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +4 -4
- package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.js +2 -2
- package/schematics/ng-update/v3/steps/migrate-templates.js +16 -16
- package/schematics/ng-update/v3/steps/migrate-textfield-controller.js +8 -8
- package/schematics/ng-update/v3/steps/miscellaneous.js +5 -5
- package/schematics/ng-update/v3/steps/replace-functions.js +12 -12
- package/schematics/ng-update/v3/steps/replace-styles.js +2 -2
- package/schematics/ng-update/v3-36/index.js +7 -17
- package/schematics/ng-update/v3-40/index.js +1 -1
- package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +4 -4
- package/schematics/ng-update/v4/index.js +11 -6
- package/schematics/ng-update/v4/migrate-css-vars/palette.d.ts +11 -2
- package/schematics/ng-update/v4/migrate-css-vars/palette.js +18 -8
- package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +10 -2
- package/schematics/ng-update/v4/migrate-icons/index.js +8 -6
- package/schematics/ng-update/v4/migrate-icons/rename-icons.js +2 -2
- package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.d.ts +2 -0
- package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.js +66 -0
- package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +3 -3
- package/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.js +9 -1
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +10 -9
- package/schematics/ng-update/v4/steps/constants/enums.js +31 -0
- package/schematics/ng-update/v4/steps/constants/html-comments.js +10 -0
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +884 -123
- package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +1 -1
- package/schematics/ng-update/v4/steps/constants/migration-warnings.js +5 -0
- package/schematics/ng-update/v4/steps/constants/modules-to-remove.js +12 -0
- package/schematics/ng-update/v4/steps/constants/modules-to-replace.d.ts +12 -0
- package/schematics/ng-update/v4/steps/constants/modules-to-replace.js +15 -0
- package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +5 -4
- package/schematics/ng-update/v4/steps/constants/types.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/types.js +17 -0
- package/schematics/ng-update/v4/steps/index.d.ts +4 -0
- package/schematics/ng-update/v4/steps/index.js +4 -0
- package/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.js +1 -1
- package/schematics/ng-update/v4/steps/migrate-destroy-service.js +7 -4
- package/schematics/ng-update/v4/steps/migrate-legacy-mask.js +2 -2
- package/schematics/ng-update/v4/steps/migrate-option-providers.js +6 -3
- package/schematics/ng-update/v4/steps/migrate-proprietary.js +3 -3
- package/schematics/ng-update/v4/steps/migrate-styles.js +1 -1
- package/schematics/ng-update/v4/steps/migrate-templates.js +3 -1
- package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +24 -6
- package/schematics/ng-update/v4/steps/templates/migrate-badge.js +4 -4
- package/schematics/ng-update/v4/steps/templates/migrate-expandable.js +2 -2
- package/schematics/ng-update/v4/steps/templates/migrate-focusable.js +1 -1
- package/schematics/ng-update/v4/steps/templates/migrate-labeled.js +1 -3
- package/schematics/ng-update/v4/steps/templates/migrate-money.js +1 -1
- package/schematics/ng-update/v4/steps/templates/migrate-overscroll.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-overscroll.js +29 -0
- package/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.js +1 -1
- package/schematics/ng-update/v4/steps/templates/toggles/common.d.ts +1 -1
- package/schematics/ng-update/v4/steps/templates/toggles/common.js +3 -3
- package/schematics/ng-update/v4/steps/update-packages.d.ts +4 -0
- package/schematics/ng-update/v4/steps/update-packages.js +31 -0
- package/schematics/ng-update/v4/steps/utils/remove-attrs.js +1 -1
- package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.d.ts +13 -0
- package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.js +47 -0
- package/schematics/ng-update/v4/steps/utils/replace-substrings.js +1 -1
- package/schematics/ng-update/v4/tests/migrate-destroy-service/utils.js +1 -0
- package/schematics/utils/add-unique-import.js +1 -1
- package/schematics/utils/angular-json-manipulations.js +4 -4
- package/schematics/utils/get-named-import-references.js +4 -4
- package/schematics/utils/get-standalone-bootstrap-function.js +2 -2
- package/schematics/utils/import-manipulations.js +1 -1
- package/schematics/utils/push-to-array-property.js +1 -1
- package/schematics/utils/templates/elements.d.ts +5 -0
- package/schematics/utils/templates/elements.js +26 -13
- package/schematics/utils/templates/get-component-templates.js +1 -1
- package/schematics/utils/templates/inputs.js +1 -1
- package/schematics/utils/templates/ng-component-input-manipulations.js +5 -5
- package/utils/color/get-gradient-data.d.ts +1 -0
- package/utils/color/index.d.ts +2 -0
- package/utils/color/parse-gradient.d.ts +10 -0
- package/utils/dom/get-element-point.d.ts +2 -0
- package/utils/dom/index.d.ts +1 -0
@@ -7,7 +7,7 @@ const packages_1 = require("./constants/packages");
|
|
7
7
|
const versions_1 = require("./constants/versions");
|
8
8
|
function addDependencies(tree, options) {
|
9
9
|
const packages = [...packages_1.MAIN_PACKAGES, ...options.addons];
|
10
|
-
packages.forEach(pack => {
|
10
|
+
packages.forEach((pack) => {
|
11
11
|
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
12
12
|
name: `@taiga-ui/${pack}`,
|
13
13
|
version: versions_1.TAIGA_VERSION,
|
@@ -20,12 +20,6 @@ function addDependencies(tree, options) {
|
|
20
20
|
version: versions_1.TAIGA_VERSION,
|
21
21
|
});
|
22
22
|
}
|
23
|
-
if (options.addSanitizer) {
|
24
|
-
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
25
|
-
name: '@taiga-ui/dompurify',
|
26
|
-
version: versions_1.NG_DOMPURIFY_VERSION,
|
27
|
-
});
|
28
|
-
}
|
29
23
|
if (packages.includes('addon-table') || packages.includes('addon-mobile')) {
|
30
24
|
addAngularCdkDep(tree);
|
31
25
|
}
|
@@ -20,33 +20,6 @@
|
|
20
20
|
"type": "confirmation"
|
21
21
|
}
|
22
22
|
},
|
23
|
-
"addDialogsModule": {
|
24
|
-
"description": "Setting up dialog module",
|
25
|
-
"type": "boolean",
|
26
|
-
"default": true,
|
27
|
-
"x-prompt": {
|
28
|
-
"message": "Do you want to use Taiga UI dialogs?",
|
29
|
-
"type": "confirmation"
|
30
|
-
}
|
31
|
-
},
|
32
|
-
"addSanitizer": {
|
33
|
-
"description": "Setting up TUI_SANITIZER",
|
34
|
-
"type": "boolean",
|
35
|
-
"default": true,
|
36
|
-
"x-prompt": {
|
37
|
-
"message": "Do you plan on using custom SVGs/icons or TUI editor? If `Yes` we will include ng-dompurify as sanitizer, read more: https://taiga-ui.dev/icons/bundled#sanitizer",
|
38
|
-
"type": "confirmation"
|
39
|
-
}
|
40
|
-
},
|
41
|
-
"addAlertModule": {
|
42
|
-
"description": "Setting up alerts module",
|
43
|
-
"type": "boolean",
|
44
|
-
"default": true,
|
45
|
-
"x-prompt": {
|
46
|
-
"message": "Do you want to use Taiga UI alerts?",
|
47
|
-
"type": "confirmation"
|
48
|
-
}
|
49
|
-
},
|
50
23
|
"addons": {
|
51
24
|
"description": "Setting up additional packages",
|
52
25
|
"type": "array",
|
@@ -14,7 +14,7 @@ function addTaigaIcons(options) {
|
|
14
14
|
}
|
15
15
|
exports.addTaigaIcons = addTaigaIcons;
|
16
16
|
function addTaigaAssetsToAngularJson(options) {
|
17
|
-
return (0, workspace_1.updateWorkspace)(workspace => {
|
17
|
+
return (0, workspace_1.updateWorkspace)((workspace) => {
|
18
18
|
const project = (0, get_projects_1.getProjects)(options, workspace)[0];
|
19
19
|
if (project) {
|
20
20
|
const targetOptions = (0, get_project_target_options_1.getProjectTargetOptions)(project, 'build');
|
@@ -15,26 +15,11 @@ const modules_1 = require("../constants/modules");
|
|
15
15
|
function addTuiModules({ mainClass, context, }) {
|
16
16
|
const modules = getModules([modules_1.BROWSER_ANIMATION_MODULE]);
|
17
17
|
const mainModulePath = mainClass.getSourceFile().getFilePath();
|
18
|
-
modules.forEach(module => {
|
18
|
+
modules.forEach((module) => {
|
19
19
|
(0, ng_morph_1.addImportToNgModule)(mainClass, module.name, { unique: true });
|
20
20
|
(0, add_unique_import_1.addUniqueImport)(mainModulePath, module.name, module.packageName);
|
21
21
|
});
|
22
|
-
context.logger.info(`${modules.map(module => module.name)} was added to ${mainModulePath}`);
|
23
|
-
}
|
24
|
-
function addExtraTuiProvidersToRootComponent({ mainClass, options, standalone = false, }) {
|
25
|
-
if (!options.addSanitizer) {
|
26
|
-
return;
|
27
|
-
}
|
28
|
-
const provider = '{provide: TUI_SANITIZER, useClass: NgDompurifySanitizer}';
|
29
|
-
if (standalone) {
|
30
|
-
(0, ng_morph_1.addProviderToComponent)(mainClass, provider, { unique: true });
|
31
|
-
}
|
32
|
-
else {
|
33
|
-
(0, ng_morph_1.addProviderToNgModule)(mainClass, provider, { unique: true });
|
34
|
-
}
|
35
|
-
modules_1.SANITIZER_MODULES.forEach(module => {
|
36
|
-
(0, add_unique_import_1.addUniqueImport)(mainClass.getSourceFile().getFilePath(), module.name, module.packageName);
|
37
|
-
});
|
22
|
+
context.logger.info(`${modules.map((module) => module.name)} was added to ${mainModulePath}`);
|
38
23
|
}
|
39
24
|
function addTuiEntitiesToStandalone({ bootstrapFunction, options, context, }) {
|
40
25
|
const [rootComponentIdentifier, bootstrapOptions = bootstrapFunction.addArgument('{providers}: []'),] = bootstrapFunction.getArguments();
|
@@ -43,7 +28,6 @@ function addTuiEntitiesToStandalone({ bootstrapFunction, options, context, }) {
|
|
43
28
|
if (mainClass) {
|
44
29
|
addMainModuleToRootComponent({ mainClass, options, context });
|
45
30
|
addRootTuiProvidersToBootstrapFn(optionsObject);
|
46
|
-
addExtraTuiProvidersToRootComponent({ mainClass, options, standalone: true });
|
47
31
|
}
|
48
32
|
}
|
49
33
|
function addRootTuiProvidersToBootstrapFn(bootstrapOptions) {
|
@@ -51,11 +35,12 @@ function addRootTuiProvidersToBootstrapFn(bootstrapOptions) {
|
|
51
35
|
const initializer = property.getInitializer();
|
52
36
|
const provideAnimations = initializer
|
53
37
|
.getElements()
|
54
|
-
.find(el => ng_morph_1.Node.isCallExpression(el) &&
|
38
|
+
.find((el) => ng_morph_1.Node.isCallExpression(el) &&
|
55
39
|
el.getExpression().getText() === 'provideAnimations');
|
56
40
|
(0, push_to_array_property_1.pushToObjectArrayProperty)(bootstrapOptions, 'providers', 'NG_EVENT_PLUGINS');
|
41
|
+
const modules = [];
|
57
42
|
if (!provideAnimations) {
|
58
|
-
|
43
|
+
modules.push({
|
59
44
|
name: 'provideAnimations',
|
60
45
|
packageName: '@angular/platform-browser/animations',
|
61
46
|
});
|
@@ -63,7 +48,8 @@ function addRootTuiProvidersToBootstrapFn(bootstrapOptions) {
|
|
63
48
|
index: 0,
|
64
49
|
});
|
65
50
|
}
|
66
|
-
|
51
|
+
modules.push({ name: 'NG_EVENT_PLUGINS', packageName: '@taiga-ui/event-plugins' });
|
52
|
+
modules.forEach(({ name, packageName }) => {
|
67
53
|
(0, add_unique_import_1.addUniqueImport)(bootstrapOptions.getSourceFile().getFilePath(), name, packageName);
|
68
54
|
});
|
69
55
|
}
|
@@ -112,7 +98,6 @@ function addTaigaModules(options) {
|
|
112
98
|
else {
|
113
99
|
const mainClass = (0, ng_morph_1.getMainModule)(mainFilePath);
|
114
100
|
addTuiModules({ mainClass, options, context });
|
115
|
-
addExtraTuiProvidersToRootComponent({ mainClass, options });
|
116
101
|
}
|
117
102
|
(0, ng_morph_1.saveActiveProject)();
|
118
103
|
});
|
@@ -13,15 +13,15 @@ function replaceImports(replaceable, options) {
|
|
13
13
|
total: replaceable.length,
|
14
14
|
});
|
15
15
|
replaceable.forEach(({ from, to }) => {
|
16
|
-
const importDeclarations = allImports.filter(declaration => !declaration.wasForgotten() &&
|
16
|
+
const importDeclarations = allImports.filter((declaration) => !declaration.wasForgotten() &&
|
17
17
|
declaration.getModuleSpecifierValue() === from.moduleSpecifier &&
|
18
18
|
declaration
|
19
19
|
.getNamedImports()
|
20
|
-
.some(specifier => specifier.getName() === from.name));
|
21
|
-
const namedImports = importDeclarations.map(declaration => declaration
|
20
|
+
.some((specifier) => specifier.getName() === from.name));
|
21
|
+
const namedImports = importDeclarations.map((declaration) => declaration
|
22
22
|
.getNamedImports()
|
23
|
-
.find(specifier => specifier.getName() === from.name));
|
24
|
-
namedImports.forEach(namedImport => {
|
23
|
+
.find((specifier) => specifier.getName() === from.name));
|
24
|
+
namedImports.forEach((namedImport) => {
|
25
25
|
if (ng_morph_1.Node.isImportSpecifier(namedImport) && !namedImport.wasForgotten()) {
|
26
26
|
(0, import_manipulations_1.removeImport)(namedImport);
|
27
27
|
(0, add_unique_import_1.addUniqueImport)(namedImport.getSourceFile().getFilePath(), to.namedImport || to.name, to.moduleSpecifier);
|
@@ -6,4 +6,5 @@ tslib_1.__exportStar(require("./rename-types"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./replace-deep-import"), exports);
|
7
7
|
tslib_1.__exportStar(require("./replace-enums"), exports);
|
8
8
|
tslib_1.__exportStar(require("./replace-identifier"), exports);
|
9
|
+
tslib_1.__exportStar(require("./replace-package-name"), exports);
|
9
10
|
tslib_1.__exportStar(require("./show-warnings"), exports);
|
@@ -15,7 +15,7 @@ function removeModules(options, modules) {
|
|
15
15
|
exports.removeModules = removeModules;
|
16
16
|
function removeModule(name, moduleSpecifier) {
|
17
17
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(name, moduleSpecifier);
|
18
|
-
references.forEach(ref => {
|
18
|
+
references.forEach((ref) => {
|
19
19
|
if (ref.wasForgotten()) {
|
20
20
|
return;
|
21
21
|
}
|
@@ -24,7 +24,7 @@ function removeModule(name, moduleSpecifier) {
|
|
24
24
|
(0, import_manipulations_1.removeImport)(parent);
|
25
25
|
}
|
26
26
|
else if (ng_morph_1.Node.isArrayLiteralExpression(parent)) {
|
27
|
-
const index = parent.getElements().findIndex(el => el.getText() === name);
|
27
|
+
const index = parent.getElements().findIndex((el) => el.getText() === name);
|
28
28
|
parent.removeElement(index);
|
29
29
|
}
|
30
30
|
});
|
@@ -5,15 +5,15 @@ 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 renameType(from, to, moduleSpecifier, preserveGenerics = false) {
|
8
|
+
function renameType(from, to, moduleSpecifier, preserveGenerics = false, removeImport = false) {
|
9
9
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(from, moduleSpecifier);
|
10
|
-
references.forEach(ref => {
|
10
|
+
references.forEach((ref) => {
|
11
11
|
if (ref.wasForgotten()) {
|
12
12
|
return;
|
13
13
|
}
|
14
14
|
const parent = ref.getParent();
|
15
15
|
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
16
|
-
processImport(parent, from, to);
|
16
|
+
processImport(parent, from, to, removeImport);
|
17
17
|
}
|
18
18
|
else if (ng_morph_1.Node.isTypeReference(parent)) {
|
19
19
|
const targetType = preserveGenerics && to ? addGeneric(to, parent.getTypeArguments()) : to;
|
@@ -21,10 +21,10 @@ function renameType(from, to, moduleSpecifier, preserveGenerics = false) {
|
|
21
21
|
}
|
22
22
|
});
|
23
23
|
}
|
24
|
-
function processImport(node, from, to) {
|
24
|
+
function processImport(node, from, to, remove) {
|
25
25
|
const filePath = node.getSourceFile().getFilePath();
|
26
26
|
const targetImportAlreadyExists = Boolean((0, ng_morph_1.getImports)(filePath, { namedImports: to }).length);
|
27
|
-
if (to && !targetImportAlreadyExists) {
|
27
|
+
if (to && !targetImportAlreadyExists && !remove) {
|
28
28
|
(0, import_manipulations_1.renameImport)(node, removeGeneric(to), removeGeneric(from));
|
29
29
|
}
|
30
30
|
else {
|
@@ -35,14 +35,14 @@ function removeGeneric(type) {
|
|
35
35
|
return type.replaceAll(/<.*>$/gi, '');
|
36
36
|
}
|
37
37
|
function addGeneric(typeName, generics) {
|
38
|
-
const typeArgs = generics.map(t => t.getType().getText());
|
38
|
+
const typeArgs = generics.map((t) => t.getType().getText());
|
39
39
|
const genericType = typeArgs.length ? `<${typeArgs.join(', ')}>` : '';
|
40
40
|
return typeName + genericType;
|
41
41
|
}
|
42
42
|
function renameTypes(options, types) {
|
43
43
|
!options['skip-logs'] &&
|
44
44
|
(0, 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));
|
45
|
+
types.forEach(({ from, to, moduleSpecifier, preserveGenerics, removeImport }) => renameType(from, to, moduleSpecifier, preserveGenerics, removeImport));
|
46
46
|
!options['skip-logs'] &&
|
47
47
|
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} types renamed \n`);
|
48
48
|
}
|
@@ -11,8 +11,8 @@ function replaceDeepImports(options) {
|
|
11
11
|
}
|
12
12
|
!options['skip-logs'] &&
|
13
13
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing deep imports...`);
|
14
|
-
const deepImports = (0, ng_morph_1.getImports)(constants_1.ALL_TS_FILES).filter(imp => DEEP_REGEX.test(imp.getModuleSpecifier().getLiteralValue()));
|
15
|
-
(0, ng_morph_1.editImports)(deepImports, deepImport => {
|
14
|
+
const deepImports = (0, ng_morph_1.getImports)(constants_1.ALL_TS_FILES).filter((imp) => DEEP_REGEX.test(imp.getModuleSpecifier().getLiteralValue()));
|
15
|
+
(0, ng_morph_1.editImports)(deepImports, (deepImport) => {
|
16
16
|
const specifier = deepImport.moduleSpecifier.replace(DEEP_REGEX, '$1');
|
17
17
|
return { moduleSpecifier: specifier };
|
18
18
|
});
|
@@ -25,7 +25,7 @@ function replaceEnumWithString(enumName, replaceValues, keepAsType = true) {
|
|
25
25
|
if (!ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
26
26
|
continue;
|
27
27
|
}
|
28
|
-
const key = Object.keys(replaceValues).find(key => parent.getName() === key);
|
28
|
+
const key = Object.keys(replaceValues).find((key) => parent.getName() === key);
|
29
29
|
if (key) {
|
30
30
|
parent.replaceWithText(`'${replaceValues[key]}'`);
|
31
31
|
}
|
@@ -35,7 +35,7 @@ function containTypeRef(node) {
|
|
35
35
|
return node
|
36
36
|
.getNameNode()
|
37
37
|
.findReferencesAsNodes()
|
38
|
-
.some(ref => ng_morph_1.Node.isTypeReference(ref.getParent()));
|
38
|
+
.some((ref) => ng_morph_1.Node.isTypeReference(ref.getParent()));
|
39
39
|
}
|
40
40
|
function replaceEnums(options, enums) {
|
41
41
|
!options['skip-logs'] &&
|
@@ -16,7 +16,7 @@ function replaceIdentifiers(options, constants) {
|
|
16
16
|
exports.replaceIdentifiers = replaceIdentifiers;
|
17
17
|
function replaceIdentifier({ from, to }) {
|
18
18
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(from.name, from.moduleSpecifier);
|
19
|
-
references.forEach(ref => {
|
19
|
+
references.forEach((ref) => {
|
20
20
|
if (ref.wasForgotten()) {
|
21
21
|
return;
|
22
22
|
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.replacePackageName = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const constants_1 = require("../../constants");
|
6
|
+
const get_file_system_1 = require("../utils/get-file-system");
|
7
|
+
const replace_text_1 = require("../utils/replace-text");
|
8
|
+
function replacePackageName(oldPackage, newPackage, tree) {
|
9
|
+
if (!(0, ng_morph_1.getPackageJsonDependency)(tree, oldPackage)) {
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
13
|
+
(0, replace_text_1.replaceText)([{ from: oldPackage, to: newPackage.name }], constants_1.ALL_TS_FILES);
|
14
|
+
(0, ng_morph_1.removePackageJsonDependency)(tree, oldPackage);
|
15
|
+
(0, ng_morph_1.addPackageJsonDependency)(tree, newPackage);
|
16
|
+
fileSystem.commitEdits();
|
17
|
+
(0, ng_morph_1.saveActiveProject)();
|
18
|
+
}
|
19
|
+
exports.replacePackageName = replacePackageName;
|
@@ -10,7 +10,7 @@ function replaceService({ from, to, replaceMethods }, options) {
|
|
10
10
|
!options['skip-logs'] &&
|
11
11
|
(0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}replacing ${from.name}...`);
|
12
12
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(from.name, from.moduleSpecifier);
|
13
|
-
references.forEach(ref => {
|
13
|
+
references.forEach((ref) => {
|
14
14
|
if (ref.wasForgotten()) {
|
15
15
|
return;
|
16
16
|
}
|
@@ -29,7 +29,7 @@ function replaceService({ from, to, replaceMethods }, options) {
|
|
29
29
|
function replaceProperties(parent, replaceProperties) {
|
30
30
|
const statement = parent.getParent();
|
31
31
|
const identifier = statement.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)[0];
|
32
|
-
identifier === null || identifier === void 0 ? void 0 : identifier.findReferencesAsNodes().forEach(ref => {
|
32
|
+
identifier === null || identifier === void 0 ? void 0 : identifier.findReferencesAsNodes().forEach((ref) => {
|
33
33
|
let parent = ref.getParent();
|
34
34
|
if ((ng_morph_1.Node.isPropertyAccessExpression(parent) &&
|
35
35
|
parent.getText().startsWith('this.')) ||
|
@@ -43,8 +43,8 @@ function replaceProperties(parent, replaceProperties) {
|
|
43
43
|
}
|
44
44
|
function replaceProperty(node, properties) {
|
45
45
|
const identifiers = node.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier);
|
46
|
-
identifiers.forEach(identifier => {
|
47
|
-
const property = properties === null || properties === void 0 ? void 0 : properties.find(property => property.from === identifier.getText());
|
46
|
+
identifiers.forEach((identifier) => {
|
47
|
+
const property = properties === null || properties === void 0 ? void 0 : properties.find((property) => property.from === identifier.getText());
|
48
48
|
if (property) {
|
49
49
|
identifier.replaceWithText(property.to);
|
50
50
|
}
|
@@ -53,7 +53,7 @@ function replaceProperty(node, properties) {
|
|
53
53
|
function replaceServices(options, services) {
|
54
54
|
!options['skip-logs'] &&
|
55
55
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing services...`);
|
56
|
-
services.forEach(service => replaceService(service, options));
|
56
|
+
services.forEach((service) => replaceService(service, options));
|
57
57
|
!options['skip-logs'] &&
|
58
58
|
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} services replaced \n`);
|
59
59
|
}
|
@@ -8,14 +8,14 @@ function showWarning({ name, message, moduleSpecifier = '**/**' }, { logger }) {
|
|
8
8
|
moduleSpecifier,
|
9
9
|
namedImports: [name],
|
10
10
|
})
|
11
|
-
.map(i => {
|
11
|
+
.map((i) => {
|
12
12
|
var _a;
|
13
13
|
return (_a = i
|
14
14
|
.getNamedImports()
|
15
|
-
.find(namedImport => namedImport.getName() === name)) === null || _a === void 0 ? void 0 : _a.getNameNode();
|
15
|
+
.find((namedImport) => namedImport.getName() === name)) === null || _a === void 0 ? void 0 : _a.getNameNode();
|
16
16
|
})
|
17
17
|
.filter((namedImport) => Boolean(namedImport));
|
18
|
-
const referencesMeta = references.map(ref => {
|
18
|
+
const referencesMeta = references.map((ref) => {
|
19
19
|
const sourceFile = ref.getSourceFile();
|
20
20
|
return {
|
21
21
|
sourceFile,
|
@@ -34,6 +34,6 @@ function showWarning({ name, message, moduleSpecifier = '**/**' }, { logger }) {
|
|
34
34
|
});
|
35
35
|
}
|
36
36
|
function showWarnings(context, warnings) {
|
37
|
-
warnings.forEach(warning => showWarning(warning, context));
|
37
|
+
warnings.forEach((warning) => showWarning(warning, context));
|
38
38
|
}
|
39
39
|
exports.showWarnings = showWarnings;
|
@@ -5,7 +5,7 @@ const ng_morph_1 = require("ng-morph");
|
|
5
5
|
const constants_1 = require("../../constants");
|
6
6
|
function replaceText(replaceable, pattern = constants_1.ALL_FILES) {
|
7
7
|
const sourceFiles = (0, ng_morph_1.getSourceFiles)(pattern);
|
8
|
-
sourceFiles.forEach(file => {
|
8
|
+
sourceFiles.forEach((file) => {
|
9
9
|
let text = file.getFullText();
|
10
10
|
replaceable.forEach(({ from, to }) => {
|
11
11
|
const regexp = new RegExp(from, 'g');
|
@@ -10,12 +10,12 @@ function replaceAttrValues({ resource, recorder, fileSystem, data, }) {
|
|
10
10
|
const elements = [
|
11
11
|
...(0, elements_1.findElementsWithAttributeOnTag)(template, attrNames, withTagNames, filterFn),
|
12
12
|
];
|
13
|
-
elements.forEach(element => {
|
14
|
-
const { name, value } = element.attrs.find(attr => attrNames.map(name => name.toLowerCase()).includes(attr.name)) || {};
|
13
|
+
elements.forEach((element) => {
|
14
|
+
const { name, value } = element.attrs.find((attr) => attrNames.map((name) => name.toLowerCase()).includes(attr.name)) || {};
|
15
15
|
if (!name || !value) {
|
16
16
|
return;
|
17
17
|
}
|
18
|
-
const attributeName = attrNames.find(attrName => attrName.toLowerCase() === name);
|
18
|
+
const attributeName = attrNames.find((attrName) => attrName.toLowerCase() === name);
|
19
19
|
values.forEach(({ from, to }) => {
|
20
20
|
var _a, _b;
|
21
21
|
if (value === from) {
|
@@ -11,7 +11,7 @@ function replaceAttrs({ resource, recorder, fileSystem, data, }) {
|
|
11
11
|
...(0, elements_1.findAttributeOnElementWithTag)(template, from.attrName, from.withTagNames || [], from.filterFn),
|
12
12
|
...(0, elements_1.findAttributeOnElementWithAttrs)(template, from.attrName, from.withAttrsNames || [], from.filterFn),
|
13
13
|
];
|
14
|
-
offsets.forEach(offset => {
|
14
|
+
offsets.forEach((offset) => {
|
15
15
|
recorder.remove(offset + templateOffset, from.attrName.length);
|
16
16
|
recorder.insertRight(offset + templateOffset, to.attrName);
|
17
17
|
});
|
@@ -10,9 +10,11 @@ function addHTMLCommentTags({ resource, recorder, fileSystem, data, }) {
|
|
10
10
|
data.forEach(({ comment, tag, withAttrs }) => {
|
11
11
|
const elementStartOffsets = [
|
12
12
|
...(0, elements_1.findElementsWithAttributeOnTag)(template, withAttrs, [tag]),
|
13
|
-
...(
|
13
|
+
...(withAttrs.length
|
14
|
+
? (0, elements_1.findElementsWithAttributeOnTag)(template, withAttrs.map((attr) => `[${attr}]`), [tag])
|
15
|
+
: []),
|
14
16
|
].map(({ sourceCodeLocation }) => ((sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startOffset) || 0) + templateOffset);
|
15
|
-
elementStartOffsets.forEach(offset => {
|
17
|
+
elementStartOffsets.forEach((offset) => {
|
16
18
|
recorder.insertLeft(offset, `<!-- ${insert_todo_1.TODO_MARK} ${comment} -->\n`);
|
17
19
|
});
|
18
20
|
});
|
@@ -580,7 +580,7 @@ exports.ATTR_TO_DIRECTIVE = [
|
|
580
580
|
name: 'TuiTextfieldControllerModule',
|
581
581
|
moduleSpecifier: '@taiga-ui/core',
|
582
582
|
},
|
583
|
-
filterFn: element => { var _a; return ((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'right'; },
|
583
|
+
filterFn: (element) => { var _a; return ((_a = element.attrs.find((attr) => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'right'; },
|
584
584
|
},
|
585
585
|
{
|
586
586
|
componentSelector: 'tui-input',
|
@@ -590,10 +590,10 @@ exports.ATTR_TO_DIRECTIVE = [
|
|
590
590
|
name: 'TuiTextfieldControllerModule',
|
591
591
|
moduleSpecifier: '@taiga-ui/core',
|
592
592
|
},
|
593
|
-
filterFn: element => {
|
593
|
+
filterFn: (element) => {
|
594
594
|
var _a;
|
595
595
|
return !(0, elements_1.hasElementAttribute)(element, 'iconAlign') ||
|
596
|
-
((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left';
|
596
|
+
((_a = element.attrs.find((attr) => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left';
|
597
597
|
},
|
598
598
|
},
|
599
599
|
{
|
@@ -604,10 +604,10 @@ exports.ATTR_TO_DIRECTIVE = [
|
|
604
604
|
name: 'TuiTextfieldControllerModule',
|
605
605
|
moduleSpecifier: '@taiga-ui/core',
|
606
606
|
},
|
607
|
-
filterFn: element => {
|
607
|
+
filterFn: (element) => {
|
608
608
|
var _a;
|
609
609
|
return !(0, elements_1.hasElementAttribute)(element, 'iconAlign') ||
|
610
|
-
((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'right';
|
610
|
+
((_a = element.attrs.find((attr) => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'right';
|
611
611
|
},
|
612
612
|
},
|
613
613
|
{
|
@@ -618,7 +618,7 @@ exports.ATTR_TO_DIRECTIVE = [
|
|
618
618
|
name: 'TuiTextfieldControllerModule',
|
619
619
|
moduleSpecifier: '@taiga-ui/core',
|
620
620
|
},
|
621
|
-
filterFn: element => { var _a; return ((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left'; },
|
621
|
+
filterFn: (element) => { var _a; return ((_a = element.attrs.find((attr) => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left'; },
|
622
622
|
},
|
623
623
|
{
|
624
624
|
componentSelector: 'tui-input-tag',
|
@@ -628,10 +628,10 @@ exports.ATTR_TO_DIRECTIVE = [
|
|
628
628
|
name: 'TuiTextfieldControllerModule',
|
629
629
|
moduleSpecifier: '@taiga-ui/core',
|
630
630
|
},
|
631
|
-
filterFn: element => {
|
631
|
+
filterFn: (element) => {
|
632
632
|
var _a;
|
633
633
|
return !(0, elements_1.hasElementAttribute)(element, 'iconAlign') ||
|
634
|
-
((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'right';
|
634
|
+
((_a = element.attrs.find((attr) => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'right';
|
635
635
|
},
|
636
636
|
},
|
637
637
|
{
|
@@ -642,7 +642,7 @@ exports.ATTR_TO_DIRECTIVE = [
|
|
642
642
|
name: 'TuiTextfieldControllerModule',
|
643
643
|
moduleSpecifier: '@taiga-ui/core',
|
644
644
|
},
|
645
|
-
filterFn: element => { var _a; return ((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left'; },
|
645
|
+
filterFn: (element) => { var _a; return ((_a = element.attrs.find((attr) => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left'; },
|
646
646
|
},
|
647
647
|
{
|
648
648
|
componentSelector: '*',
|
@@ -70,7 +70,7 @@ function addTaigaStyles(options) {
|
|
70
70
|
`– Manually replace "${taiga_styles_1.TAIGA_GLOBAL_OLD_STYLE}" with "${taiga_styles_1.TAIGA_GLOBAL_NEW_STYLE}" inside "styles" of angular.json (don't forget to install "@taiga-ui/styles")`);
|
71
71
|
return;
|
72
72
|
}
|
73
|
-
return (0, angular_json_manipulations_1.addStylesToAngularJson)(options, context, taigaStyles, existingStyles => !!(existingStyles === null || existingStyles === void 0 ? void 0 : existingStyles.some(style => typeof style === 'string' && style.includes('tinkoff-theme'))), stylesToReplace, tree);
|
73
|
+
return (0, angular_json_manipulations_1.addStylesToAngularJson)(options, context, taigaStyles, (existingStyles) => !!(existingStyles === null || existingStyles === void 0 ? void 0 : existingStyles.some((style) => typeof style === 'string' && style.includes('tinkoff-theme'))), stylesToReplace, tree);
|
74
74
|
});
|
75
75
|
}
|
76
76
|
function showNormalizeWarning() {
|
@@ -9,7 +9,7 @@ const get_named_import_references_1 = require("../../../utils/get-named-import-r
|
|
9
9
|
const insert_todo_1 = require("../../../utils/insert-todo");
|
10
10
|
function migrateProperty({ namedImport, moduleSpecifier, from, callback, }) {
|
11
11
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(namedImport, moduleSpecifier);
|
12
|
-
references.forEach(ref => {
|
12
|
+
references.forEach((ref) => {
|
13
13
|
if (ref.wasForgotten()) {
|
14
14
|
return;
|
15
15
|
}
|
@@ -19,7 +19,7 @@ function migrateProperty({ namedImport, moduleSpecifier, from, callback, }) {
|
|
19
19
|
}
|
20
20
|
if (ng_morph_1.Node.isNewExpression(parent)) {
|
21
21
|
const accessExpression = parent.getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyAccessExpression);
|
22
|
-
const searched = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier).find(identifier => identifier.getText() === from);
|
22
|
+
const searched = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier).find((identifier) => identifier.getText() === from);
|
23
23
|
if (searched && accessExpression) {
|
24
24
|
callback(accessExpression);
|
25
25
|
return;
|
@@ -28,7 +28,7 @@ function migrateProperty({ namedImport, moduleSpecifier, from, callback, }) {
|
|
28
28
|
if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
29
29
|
const searched = parent
|
30
30
|
.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)
|
31
|
-
.find(identifier => identifier.getText() === from);
|
31
|
+
.find((identifier) => identifier.getText() === from);
|
32
32
|
if (searched && !parent.wasForgotten()) {
|
33
33
|
callback(parent);
|
34
34
|
return;
|
@@ -66,8 +66,8 @@ function replaceIdentifierReferences(identifier, from, callback) {
|
|
66
66
|
* If `identifier` is equal to `var` from `method1` (1),
|
67
67
|
* then `identifier.findReferencesAsNodes` will return array with 2 references: (2) and (3).
|
68
68
|
*/
|
69
|
-
.filter(ref => !areBothObjectDestructuring(ref, identifier))
|
70
|
-
.forEach(ref => {
|
69
|
+
.filter((ref) => !areBothObjectDestructuring(ref, identifier))
|
70
|
+
.forEach((ref) => {
|
71
71
|
if (ref.wasForgotten()) {
|
72
72
|
return;
|
73
73
|
}
|
@@ -85,7 +85,7 @@ function replaceIdentifierReferences(identifier, from, callback) {
|
|
85
85
|
if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
86
86
|
const searched = parent
|
87
87
|
.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)
|
88
|
-
.find(identifier => identifier.getText() === from);
|
88
|
+
.find((identifier) => identifier.getText() === from);
|
89
89
|
if (searched) {
|
90
90
|
callback(parent);
|
91
91
|
}
|
@@ -121,7 +121,7 @@ function dateTimeMigrations(options) {
|
|
121
121
|
namedImport: 'TuiDay',
|
122
122
|
moduleSpecifier: '@taiga-ui/cdk',
|
123
123
|
from: 'formattedDay',
|
124
|
-
callback: node => node.replaceWithText(node.getText().replace('formattedDay', 'getFormattedDay("DMY", ".")')),
|
124
|
+
callback: (node) => node.replaceWithText(node.getText().replace('formattedDay', 'getFormattedDay("DMY", ".")')),
|
125
125
|
});
|
126
126
|
!options['skip-logs'] &&
|
127
127
|
(0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDay.formattedDay ` +
|
@@ -131,7 +131,7 @@ function dateTimeMigrations(options) {
|
|
131
131
|
namedImport: 'TuiDayRange',
|
132
132
|
moduleSpecifier: '@taiga-ui/cdk',
|
133
133
|
from: 'formattedDayRange',
|
134
|
-
callback: node => node.replaceWithText(node
|
134
|
+
callback: (node) => node.replaceWithText(node
|
135
135
|
.getText()
|
136
136
|
.replace('formattedDayRange', 'getFormattedDayRange("DMY", ".")')),
|
137
137
|
});
|
@@ -143,7 +143,7 @@ function dateTimeMigrations(options) {
|
|
143
143
|
namedImport: 'TuiDayRange',
|
144
144
|
moduleSpecifier: '@taiga-ui/cdk',
|
145
145
|
from: 'normalizeParse',
|
146
|
-
callback: node => {
|
146
|
+
callback: (node) => {
|
147
147
|
const parent = node.getParent();
|
148
148
|
if (ng_morph_1.Node.isCallExpression(parent)) {
|
149
149
|
changeNormalizeArgs(parent);
|
@@ -195,7 +195,7 @@ function dateTimeMigrations(options) {
|
|
195
195
|
namedImport,
|
196
196
|
moduleSpecifier: '@taiga-ui/cdk',
|
197
197
|
from: field,
|
198
|
-
callback: node => insertTodoBeforeNode(node, message),
|
198
|
+
callback: (node) => insertTodoBeforeNode(node, message),
|
199
199
|
});
|
200
200
|
!options['skip-logs'] &&
|
201
201
|
(0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}${namedImport}.${field} ` +
|