@taiga-ui/cdk 4.8.1-canary.f683230 → 4.9.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/classes/control.d.ts +1 -2
- package/constants/used-icons.d.ts +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2022/classes/control.mjs +3 -4
- package/esm2022/constants/used-icons.mjs +2 -2
- package/esm2022/constants/version.mjs +2 -2
- package/esm2022/observables/zone.mjs +2 -3
- package/esm2022/pipes/index.mjs +2 -1
- package/esm2022/pipes/repeat-times/index.mjs +19 -0
- package/esm2022/pipes/repeat-times/taiga-ui-cdk-pipes-repeat-times.mjs +5 -0
- package/esm2022/tokens/window-size.mjs +23 -24
- package/esm2022/utils/miscellaneous/is-valid-url.mjs +7 -5
- package/fesm2022/taiga-ui-cdk-classes.mjs +2 -3
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs +25 -0
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs.map +1 -0
- package/fesm2022/taiga-ui-cdk-pipes.mjs +1 -0
- package/fesm2022/taiga-ui-cdk-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-tokens.mjs +21 -23
- package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +6 -4
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
- package/observables/zone.d.ts +1 -1
- package/package.json +368 -362
- package/pipes/index.d.ts +1 -0
- package/pipes/repeat-times/index.d.ts +7 -0
- package/schematics/index.d.ts +0 -1
- package/schematics/index.js +0 -1
- package/schematics/ng-update/steps/icons/replace-imports.js +1 -2
- package/schematics/ng-update/steps/remove-module.js +2 -3
- package/schematics/ng-update/steps/rename-types.js +2 -3
- package/schematics/ng-update/steps/replace-deep-import.js +2 -3
- package/schematics/ng-update/steps/replace-enums.js +2 -3
- package/schematics/ng-update/steps/replace-identifier.js +2 -3
- package/schematics/ng-update/steps/replace-services.js +3 -4
- package/schematics/ng-update/v4/index.js +5 -3
- package/schematics/ng-update/v4/migrate-addon-doc/index.js +2 -3
- package/schematics/ng-update/v4/migrate-css-vars/index.js +2 -3
- package/schematics/ng-update/v4/migrate-css-vars/palette.js +7 -7
- package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +11 -2
- package/schematics/ng-update/v4/migrate-icons/index.js +2 -3
- package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +9 -0
- package/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.js +5 -0
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +0 -9
- package/schematics/ng-update/v4/steps/constants/functions.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/functions.js +10 -0
- package/schematics/ng-update/v4/steps/drop-universal-mock.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-alert-service.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-destroy-service.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-editor.d.ts +2 -2
- package/schematics/ng-update/v4/steps/migrate-editor.js +6 -9
- package/schematics/ng-update/v4/steps/migrate-legacy-mask.js +4 -5
- package/schematics/ng-update/v4/steps/migrate-month-context.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-number-format-settings.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-option-providers.js +3 -4
- package/schematics/ng-update/v4/steps/migrate-proprietary.js +1 -2
- package/schematics/ng-update/v4/steps/migrate-providers-from.js +1 -2
- package/schematics/ng-update/v4/steps/migrate-root.d.ts +1 -1
- package/schematics/ng-update/v4/steps/migrate-root.js +1 -2
- package/schematics/ng-update/v4/steps/migrate-templates.js +3 -3
- package/schematics/ng-update/v4/steps/remove-duplicates.js +2 -3
- package/schematics/ng-update/v4/steps/replace-functions.d.ts +2 -0
- package/schematics/ng-update/v4/steps/replace-functions.js +19 -0
- package/schematics/ng-update/v4/steps/restore-tui-mapper.js +3 -4
- package/schematics/ng-update/v4/steps/restore-tui-matcher.js +3 -4
- package/schematics/ng-update/v4/steps/templates/migrate-label.js +16 -6
- package/schematics/ng-update/v4/steps/update-packages.js +1 -2
- package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.js +2 -3
- package/schematics/utils/progress.js +3 -3
- package/tokens/window-size.d.ts +1 -2
- package/utils/miscellaneous/is-valid-url.d.ts +3 -0
- package/schematics/utils/colored-log.d.ts +0 -11
- package/schematics/utils/colored-log.js +0 -29
package/pipes/index.d.ts
CHANGED
@@ -2,5 +2,6 @@ export * from '@taiga-ui/cdk/pipes/filter';
|
|
2
2
|
export * from '@taiga-ui/cdk/pipes/is-present';
|
3
3
|
export * from '@taiga-ui/cdk/pipes/keys';
|
4
4
|
export * from '@taiga-ui/cdk/pipes/mapper';
|
5
|
+
export * from '@taiga-ui/cdk/pipes/repeat-times';
|
5
6
|
export * from '@taiga-ui/cdk/pipes/replace';
|
6
7
|
export * from '@taiga-ui/cdk/pipes/to-array';
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { PipeTransform } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class TuiRepeatTimesPipe implements PipeTransform {
|
4
|
+
transform(n: number): number[];
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TuiRepeatTimesPipe, never>;
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TuiRepeatTimesPipe, "tuiRepeatTimes", true>;
|
7
|
+
}
|
package/schematics/index.d.ts
CHANGED
@@ -7,7 +7,6 @@ export * from './ng-add/schema';
|
|
7
7
|
export * from './utils/add-import-to-closest-module';
|
8
8
|
export * from './utils/add-unique-import';
|
9
9
|
export * from './utils/angular-json-manipulations';
|
10
|
-
export * from './utils/colored-log';
|
11
10
|
export * from './utils/create-angular-json';
|
12
11
|
export * from './utils/get-component-from-identifier';
|
13
12
|
export * from './utils/get-execution-time';
|
package/schematics/index.js
CHANGED
@@ -10,7 +10,6 @@ tslib_1.__exportStar(require("./ng-add/schema"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./utils/add-import-to-closest-module"), exports);
|
11
11
|
tslib_1.__exportStar(require("./utils/add-unique-import"), exports);
|
12
12
|
tslib_1.__exportStar(require("./utils/angular-json-manipulations"), exports);
|
13
|
-
tslib_1.__exportStar(require("./utils/colored-log"), exports);
|
14
13
|
tslib_1.__exportStar(require("./utils/create-angular-json"), exports);
|
15
14
|
tslib_1.__exportStar(require("./utils/get-component-from-identifier"), exports);
|
16
15
|
tslib_1.__exportStar(require("./utils/get-execution-time"), exports);
|
@@ -4,7 +4,6 @@ exports.replaceImports = void 0;
|
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const constants_1 = require("../../../constants");
|
6
6
|
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
7
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
8
7
|
const import_manipulations_1 = require("../../../utils/import-manipulations");
|
9
8
|
const progress_1 = require("../../../utils/progress");
|
10
9
|
function replaceImports(replaceable, options) {
|
@@ -30,6 +29,6 @@ function replaceImports(replaceable, options) {
|
|
30
29
|
!options['skip-logs'] && progressLog('replacing imports...', true);
|
31
30
|
});
|
32
31
|
!options['skip-logs'] &&
|
33
|
-
(0,
|
32
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} imports replaced \n`);
|
34
33
|
}
|
35
34
|
exports.replaceImports = replaceImports;
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.removeModule = exports.removeModules = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
|
-
const colored_log_1 = require("../../utils/colored-log");
|
6
5
|
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
7
6
|
const import_manipulations_1 = require("../../utils/import-manipulations");
|
8
7
|
function removeModules(options, modules) {
|
9
8
|
!options['skip-logs'] &&
|
10
|
-
(0,
|
9
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} removing modules...`);
|
11
10
|
modules.forEach(({ name, moduleSpecifier }) => removeModule(name, moduleSpecifier));
|
12
11
|
!options['skip-logs'] &&
|
13
|
-
(0,
|
12
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} modules removed \n`);
|
14
13
|
}
|
15
14
|
exports.removeModules = removeModules;
|
16
15
|
function removeModule(name, moduleSpecifier) {
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renameTypes = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const add_unique_import_1 = require("../../utils/add-unique-import");
|
6
|
-
const colored_log_1 = require("../../utils/colored-log");
|
7
6
|
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
8
7
|
const import_manipulations_1 = require("../../utils/import-manipulations");
|
9
8
|
function renameType({ from, to, moduleSpecifier, preserveGenerics = false, removeImport = false, newImports = [], }) {
|
@@ -45,9 +44,9 @@ function addGeneric(typeName, generics) {
|
|
45
44
|
}
|
46
45
|
function renameTypes(options, types) {
|
47
46
|
!options['skip-logs'] &&
|
48
|
-
(0,
|
47
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} renaming types...`);
|
49
48
|
types.forEach(renameType);
|
50
49
|
!options['skip-logs'] &&
|
51
|
-
(0,
|
50
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} types renamed \n`);
|
52
51
|
}
|
53
52
|
exports.renameTypes = renameTypes;
|
@@ -3,20 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.replaceDeepImports = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const constants_1 = require("../../constants");
|
6
|
-
const colored_log_1 = require("../../utils/colored-log");
|
7
6
|
const DEEP_REGEX = /(@taiga-ui\/\w+)\/.*/;
|
8
7
|
function replaceDeepImports(options) {
|
9
8
|
if (options['skip-deep-imports']) {
|
10
9
|
return;
|
11
10
|
}
|
12
11
|
!options['skip-logs'] &&
|
13
|
-
(0,
|
12
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} replacing deep imports...`);
|
14
13
|
const deepImports = (0, ng_morph_1.getImports)(constants_1.ALL_TS_FILES).filter((imp) => DEEP_REGEX.test(imp.getModuleSpecifier().getLiteralValue()));
|
15
14
|
(0, ng_morph_1.editImports)(deepImports, (deepImport) => {
|
16
15
|
const specifier = deepImport.moduleSpecifier.replace(DEEP_REGEX, '$1');
|
17
16
|
return { moduleSpecifier: specifier };
|
18
17
|
});
|
19
18
|
!options['skip-logs'] &&
|
20
|
-
(0,
|
19
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} deep imports replaced \n`);
|
21
20
|
}
|
22
21
|
exports.replaceDeepImports = replaceDeepImports;
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.replaceEnums = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
|
-
const colored_log_1 = require("../../utils/colored-log");
|
6
5
|
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
7
6
|
const import_manipulations_1 = require("../../utils/import-manipulations");
|
8
7
|
function replaceEnumWithString(enumName, replaceValues, keepAsType = true) {
|
@@ -39,9 +38,9 @@ function containTypeRef(node) {
|
|
39
38
|
}
|
40
39
|
function replaceEnums(options, enums) {
|
41
40
|
!options['skip-logs'] &&
|
42
|
-
(0,
|
41
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} replacing enums imports...`);
|
43
42
|
enums.forEach(({ name, replaceValues, keepAsType }) => replaceEnumWithString(name, replaceValues, keepAsType));
|
44
43
|
!options['skip-logs'] &&
|
45
|
-
(0,
|
44
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} enums replaced \n`);
|
46
45
|
}
|
47
46
|
exports.replaceEnums = replaceEnums;
|
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.replaceIdentifier = exports.replaceIdentifiers = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const add_unique_import_1 = require("../../utils/add-unique-import");
|
6
|
-
const colored_log_1 = require("../../utils/colored-log");
|
7
6
|
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
8
7
|
const import_manipulations_1 = require("../../utils/import-manipulations");
|
9
8
|
const progress_1 = require("../../utils/progress");
|
10
9
|
function replaceIdentifiers(options, constants) {
|
11
10
|
!options['skip-logs'] &&
|
12
|
-
(0,
|
11
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} replacing identifiers...`);
|
13
12
|
const progressLog = (0, progress_1.setupProgressLogger)({
|
14
13
|
total: constants.length,
|
15
14
|
});
|
@@ -21,7 +20,7 @@ function replaceIdentifiers(options, constants) {
|
|
21
20
|
.join(', '));
|
22
21
|
});
|
23
22
|
!options['skip-logs'] &&
|
24
|
-
(0,
|
23
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} identifiers replaced \n`);
|
25
24
|
}
|
26
25
|
exports.replaceIdentifiers = replaceIdentifiers;
|
27
26
|
function replaceIdentifier({ from, to }) {
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.replaceServices = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const add_unique_import_1 = require("../../utils/add-unique-import");
|
6
|
-
const colored_log_1 = require("../../utils/colored-log");
|
7
6
|
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
8
7
|
const import_manipulations_1 = require("../../utils/import-manipulations");
|
9
8
|
function replaceService({ from, to, replaceMethods }, options) {
|
10
9
|
!options['skip-logs'] &&
|
11
|
-
(0,
|
10
|
+
(0, ng_morph_1.processLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.PROCESSING_SYMBOL}replacing ${from.name}...`);
|
12
11
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(from.name, from.moduleSpecifier);
|
13
12
|
references.forEach((ref) => {
|
14
13
|
if (ref.wasForgotten()) {
|
@@ -52,9 +51,9 @@ function replaceProperty(node, properties) {
|
|
52
51
|
}
|
53
52
|
function replaceServices(options, services) {
|
54
53
|
!options['skip-logs'] &&
|
55
|
-
(0,
|
54
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} replacing services...`);
|
56
55
|
services.forEach((service) => replaceService(service, options));
|
57
56
|
!options['skip-logs'] &&
|
58
|
-
(0,
|
57
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} services replaced \n`);
|
59
58
|
}
|
60
59
|
exports.replaceServices = replaceServices;
|
@@ -6,7 +6,6 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
7
7
|
const ng_morph_1 = require("ng-morph");
|
8
8
|
const versions_1 = require("../../ng-add/constants/versions");
|
9
|
-
const colored_log_1 = require("../../utils/colored-log");
|
10
9
|
const get_execution_time_1 = require("../../utils/get-execution-time");
|
11
10
|
const steps_1 = require("../steps");
|
12
11
|
const replace_services_1 = require("../steps/replace-services");
|
@@ -14,16 +13,19 @@ const get_file_system_1 = require("../utils/get-file-system");
|
|
14
13
|
const enums_1 = require("../v4/steps/constants/enums");
|
15
14
|
const steps_2 = require("./steps");
|
16
15
|
const constants_1 = require("./steps/constants");
|
16
|
+
const functions_1 = require("./steps/constants/functions");
|
17
17
|
const modules_to_replace_1 = require("./steps/constants/modules-to-replace");
|
18
18
|
const types_1 = require("./steps/constants/types");
|
19
19
|
const drop_universal_mock_1 = require("./steps/drop-universal-mock");
|
20
20
|
const migrate_editor_1 = require("./steps/migrate-editor");
|
21
21
|
const migrate_providers_from_1 = require("./steps/migrate-providers-from");
|
22
22
|
const migrate_root_1 = require("./steps/migrate-root");
|
23
|
+
const replace_functions_1 = require("./steps/replace-functions");
|
23
24
|
const replace_modules_with_providers_1 = require("./steps/utils/replace-modules-with-providers");
|
24
25
|
function main(options) {
|
25
26
|
return (tree, context) => {
|
26
27
|
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
28
|
+
(0, replace_functions_1.replaceFunctions)(functions_1.REPLACE_FUNCTIONS);
|
27
29
|
(0, migrate_providers_from_1.migrateImportProvidersFrom)(options);
|
28
30
|
(0, migrate_editor_1.migrateEditor)(fileSystem, options);
|
29
31
|
(0, steps_1.replaceEnums)(options, enums_1.ENUMS_TO_REPLACE);
|
@@ -60,13 +62,13 @@ function main(options) {
|
|
60
62
|
function updateToV4(options) {
|
61
63
|
const t0 = node_perf_hooks_1.performance.now();
|
62
64
|
!options['skip-logs'] &&
|
63
|
-
(0,
|
65
|
+
(0, ng_morph_1.titleLog)(`\n\n${ng_morph_1.START_SYMBOL} Your packages will be updated to @taiga-ui/*@${versions_1.TAIGA_VERSION}\n`);
|
64
66
|
return (0, schematics_1.chain)([
|
65
67
|
main(options),
|
66
68
|
() => {
|
67
69
|
const executionTime = (0, get_execution_time_1.getExecutionTime)(t0, node_perf_hooks_1.performance.now());
|
68
70
|
!options['skip-logs'] &&
|
69
|
-
(0,
|
71
|
+
(0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} We migrated packages to @taiga-ui/*@${versions_1.TAIGA_VERSION} in ${executionTime}. \n`);
|
70
72
|
},
|
71
73
|
]);
|
72
74
|
}
|
@@ -4,7 +4,6 @@ exports.migrateAddonDoc = void 0;
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
5
5
|
const ng_morph_1 = require("ng-morph");
|
6
6
|
const file_globs_1 = require("../../../constants/file-globs");
|
7
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
8
7
|
const steps_1 = require("../../steps");
|
9
8
|
const remove_module_1 = require("../../steps/remove-module");
|
10
9
|
const get_file_system_1 = require("../../utils/get-file-system");
|
@@ -17,7 +16,7 @@ function migrateAddonDoc(options) {
|
|
17
16
|
return;
|
18
17
|
}
|
19
18
|
!options['skip-logs'] &&
|
20
|
-
(0,
|
19
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} replacing...`);
|
21
20
|
(0, remove_module_1.removeModules)(options, [
|
22
21
|
{
|
23
22
|
name: 'tuiGenerateRoutes',
|
@@ -45,7 +44,7 @@ function migrateAddonDoc(options) {
|
|
45
44
|
fileSystem.commitEdits();
|
46
45
|
(0, ng_morph_1.saveActiveProject)();
|
47
46
|
!options['skip-logs'] &&
|
48
|
-
(0,
|
47
|
+
(0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} addon-doc successfully migrated \n`);
|
49
48
|
},
|
50
49
|
]);
|
51
50
|
}
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateCssVars = void 0;
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
5
5
|
const ng_morph_1 = require("ng-morph");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
const get_file_system_1 = require("../../utils/get-file-system");
|
8
7
|
const rename_css_vars_1 = require("./rename-css-vars");
|
9
8
|
function migrateCssVars(options) {
|
@@ -11,12 +10,12 @@ function migrateCssVars(options) {
|
|
11
10
|
(tree, _) => {
|
12
11
|
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
13
12
|
!options['skip-logs'] &&
|
14
|
-
(0,
|
13
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} replacing css vars...`);
|
15
14
|
(0, rename_css_vars_1.renameCssVars)();
|
16
15
|
fileSystem.commitEdits();
|
17
16
|
(0, ng_morph_1.saveActiveProject)();
|
18
17
|
!options['skip-logs'] &&
|
19
|
-
(0,
|
18
|
+
(0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} Css vars successfully migrated \n`);
|
20
19
|
},
|
21
20
|
]);
|
22
21
|
}
|
@@ -85,13 +85,13 @@ exports.DEPRECATED_VARS = {
|
|
85
85
|
'--tui-positive-night-hover': '--tui-status-positive',
|
86
86
|
'--tui-negative-night': '--tui-status-negative',
|
87
87
|
'--tui-negative-night-hover': '--tui-status-negative',
|
88
|
-
'--tui-shadow': '
|
89
|
-
'--tui-shadow-hover': '
|
90
|
-
'--tui-shadow-dropdown': '
|
91
|
-
'--tui-shadow-modal': '
|
92
|
-
'--tui-shadow-sidebar': '
|
93
|
-
'--tui-shadow-navigation': '
|
94
|
-
'--tui-shadow-sheet': '
|
88
|
+
'--tui-shadow': '--tui-shadow-small',
|
89
|
+
'--tui-shadow-hover': '--tui-shadow-small-hover',
|
90
|
+
'--tui-shadow-dropdown': '--tui-shadow-medium',
|
91
|
+
'--tui-shadow-modal': '--tui-shadow-popup',
|
92
|
+
'--tui-shadow-sidebar': '--tui-shadow-medium',
|
93
|
+
'--tui-shadow-navigation': '--tui-shadow-small',
|
94
|
+
'--tui-shadow-sheet': '--tui-shadow-popup',
|
95
95
|
};
|
96
96
|
// warning: order is important
|
97
97
|
exports.DEPRECATED_NUMERIC_VARS = {
|
@@ -16,14 +16,23 @@ function renameCssVars(pattern = constants_1.ALL_FILES) {
|
|
16
16
|
text = text.replaceAll(wordRegex, `$1// ${palette_1.NIGHT_VAR_COMMENT}\n`);
|
17
17
|
});
|
18
18
|
}
|
19
|
+
const placeholders = {};
|
20
|
+
Object.keys(palette_1.DEPRECATED_VARS).forEach((key, index) => {
|
21
|
+
placeholders[key] = `__PLACEHOLDER_${index}__`;
|
22
|
+
});
|
19
23
|
Object.entries(palette_1.DEPRECATED_VARS)
|
20
24
|
.sort(([prev], [next]) => (prev.length < next.length ? 1 : -1))
|
21
25
|
.map(([from, to]) => ({
|
22
26
|
from: new RegExp(`${from}`, 'g'),
|
23
27
|
to,
|
24
28
|
}))
|
25
|
-
.forEach(({ from
|
26
|
-
text = text.
|
29
|
+
.forEach(({ from }) => {
|
30
|
+
text = text.replace(from, (matched) => { var _a; return (_a = placeholders[matched]) !== null && _a !== void 0 ? _a : ''; });
|
31
|
+
});
|
32
|
+
const placeholderPattern = new RegExp(Object.values(placeholders).join('|'), 'g');
|
33
|
+
text = text.replaceAll(placeholderPattern, (matched) => {
|
34
|
+
const originalKey = Object.keys(placeholders).find((key) => placeholders[key] === matched);
|
35
|
+
return palette_1.DEPRECATED_VARS[originalKey];
|
27
36
|
});
|
28
37
|
Object.entries(palette_1.DEPRECATED_NUMERIC_VARS)
|
29
38
|
.map(([from, to]) => ({
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateIcons = void 0;
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
5
5
|
const ng_morph_1 = require("ng-morph");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
const get_file_system_1 = require("../../utils/get-file-system");
|
8
7
|
const rename_icons_1 = require("./rename-icons");
|
9
8
|
const rename_proprietary_icons_1 = require("./rename-proprietary-icons");
|
@@ -12,7 +11,7 @@ function migrateIcons(options) {
|
|
12
11
|
(tree, context) => {
|
13
12
|
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
14
13
|
!options['skip-logs'] &&
|
15
|
-
(0,
|
14
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} replacing icons...`);
|
16
15
|
if (hasProprietaryIcons(tree)) {
|
17
16
|
(0, rename_proprietary_icons_1.renameProprietaryIcons)(context);
|
18
17
|
}
|
@@ -22,7 +21,7 @@ function migrateIcons(options) {
|
|
22
21
|
fileSystem.commitEdits();
|
23
22
|
(0, ng_morph_1.saveActiveProject)();
|
24
23
|
!options['skip-logs'] &&
|
25
|
-
(0,
|
24
|
+
(0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} Icons successfully migrated \n`);
|
26
25
|
},
|
27
26
|
]);
|
28
27
|
}
|
@@ -60,4 +60,13 @@ exports.ATTRS_TO_DIRECTIVE_REPLACE = [
|
|
60
60
|
filterFn: (el) => (0, elements_1.hasElementAttribute)(el, 'tuiButton') ||
|
61
61
|
(0, elements_1.hasElementAttribute)(el, 'tuiIconButton'),
|
62
62
|
},
|
63
|
+
{
|
64
|
+
componentSelector: ['*'],
|
65
|
+
inputProperty: 'pseudoFocus',
|
66
|
+
directive: 'tuiAppearanceFocus',
|
67
|
+
directiveModule: {
|
68
|
+
name: 'TuiAppearance',
|
69
|
+
moduleSpecifier: '@taiga-ui/core',
|
70
|
+
},
|
71
|
+
},
|
63
72
|
];
|
@@ -34,6 +34,11 @@ exports.ATTR_WITH_VALUES_TO_REPLACE = [
|
|
34
34
|
newAttrName: 'tuiHintAppearance',
|
35
35
|
valueReplacer: [{ from: 'onDark', to: 'dark' }],
|
36
36
|
},
|
37
|
+
{
|
38
|
+
attrNames: ['appearance'],
|
39
|
+
newAttrName: 'appearance',
|
40
|
+
valueReplacer: [{ from: 'secondary-destructive', to: 'destructive' }],
|
41
|
+
},
|
37
42
|
{
|
38
43
|
attrNames: ['[pseudoActive]'],
|
39
44
|
newAttrName: '[tuiAppearanceState]',
|
@@ -292,15 +292,6 @@ exports.ATTRS_TO_REPLACE = [
|
|
292
292
|
},
|
293
293
|
to: { attrName: '[appearance]' },
|
294
294
|
},
|
295
|
-
{
|
296
|
-
from: {
|
297
|
-
attrName: '[pseudoFocus]',
|
298
|
-
withTagNames: ['*'],
|
299
|
-
},
|
300
|
-
to: {
|
301
|
-
attrName: '[tuiAppearanceFocus]',
|
302
|
-
},
|
303
|
-
},
|
304
295
|
{
|
305
296
|
from: {
|
306
297
|
attrName: '*tuiRow',
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.REPLACE_FUNCTIONS = void 0;
|
4
|
+
exports.REPLACE_FUNCTIONS = [
|
5
|
+
{
|
6
|
+
from: 'tuiDocLanguageSwitcher',
|
7
|
+
to: 'tuiLanguageSwitcher',
|
8
|
+
moduleSpecifier: ['@taiga-ui/i18n'],
|
9
|
+
},
|
10
|
+
];
|
@@ -3,18 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dropUniversalMock = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const file_globs_1 = require("../../../constants/file-globs");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
function dropUniversalMock(options) {
|
8
7
|
const moduleSpecifier = '@ng-web-apis/universal/mocks';
|
9
8
|
const imports = (0, ng_morph_1.getImports)(file_globs_1.ALL_TS_FILES, { moduleSpecifier });
|
10
9
|
if (imports.length) {
|
11
10
|
!options['skip-logs'] &&
|
12
|
-
(0,
|
11
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} drop "${moduleSpecifier}" import`);
|
13
12
|
const match = new RegExp(`import\\s+[\\'\\"\`]${moduleSpecifier}[\\'\\"\`];`, 'g');
|
14
13
|
imports.forEach((declaration) => declaration
|
15
14
|
.getSourceFile()
|
16
15
|
.replaceWithText(declaration.getSourceFile().getFullText().replaceAll(match, '')));
|
17
|
-
!options['skip-logs'] && (0,
|
16
|
+
!options['skip-logs'] && (0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} successfully migrated \n`);
|
18
17
|
}
|
19
18
|
}
|
20
19
|
exports.dropUniversalMock = dropUniversalMock;
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateAlertService = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
6
5
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
6
|
const OPTIONS_MIGRATIONS = {
|
8
7
|
autoClose: (property) => {
|
@@ -33,7 +32,7 @@ const OPTIONS_MIGRATIONS = {
|
|
33
32
|
};
|
34
33
|
function migrateAlertService(options) {
|
35
34
|
!options['skip-logs'] &&
|
36
|
-
(0,
|
35
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} replacing inject(TuiAlertService).open({autoClose: boolean})...`);
|
37
36
|
const alertServiceRefs = (0, get_named_import_references_1.getNamedImportReferences)('TuiAlertService', '@taiga-ui/core');
|
38
37
|
// inject(TuiAlertService).open(...)
|
39
38
|
const viaDirectInjects = alertServiceRefs.map((x) => x.getFirstAncestor((node) => node.isKind(ng_morph_1.SyntaxKind.CallExpression) &&
|
@@ -92,7 +91,7 @@ function migrateAlertService(options) {
|
|
92
91
|
});
|
93
92
|
});
|
94
93
|
!options['skip-logs'] &&
|
95
|
-
(0,
|
94
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} "true => 3_000" & "false => 0" were replaced \n`);
|
96
95
|
}
|
97
96
|
exports.migrateAlertService = migrateAlertService;
|
98
97
|
function toAlertServiceOpenCallExpression(node) {
|
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateAllCountryIsoCodes = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
8
7
|
function migrateAllCountryIsoCodes(options) {
|
9
8
|
!options['skip-logs'] &&
|
10
|
-
(0,
|
9
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} migrating Object.values(TuiCountryIsoCode)...`);
|
11
10
|
const references = (0, get_named_import_references_1.getNamedImportReferences)('TuiCountryIsoCode', '@taiga-ui/i18n');
|
12
11
|
references.forEach((ref) => {
|
13
12
|
if (ref.wasForgotten()) {
|
@@ -19,6 +18,6 @@ function migrateAllCountryIsoCodes(options) {
|
|
19
18
|
possibleObjectValues.replaceWithText('getCountries()');
|
20
19
|
}
|
21
20
|
});
|
22
|
-
!options['skip-logs'] && (0,
|
21
|
+
!options['skip-logs'] && (0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} successfully migrated \n`);
|
23
22
|
}
|
24
23
|
exports.migrateAllCountryIsoCodes = migrateAllCountryIsoCodes;
|
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateDestroyService = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
8
7
|
const import_manipulations_1 = require("../../../utils/import-manipulations");
|
9
8
|
const insert_todo_1 = require("../../../utils/insert-todo");
|
10
9
|
function migrateDestroyService(options) {
|
11
10
|
!options['skip-logs'] &&
|
12
|
-
(0,
|
11
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} migrating TuiDestroyService => takeUntilDestroyed ...`);
|
13
12
|
const references = (0, get_named_import_references_1.getNamedImportReferences)('TuiDestroyService', '@taiga-ui/cdk');
|
14
13
|
const nodesForComments = [];
|
15
14
|
references.forEach((ref) => {
|
@@ -115,7 +114,7 @@ function migrateDestroyService(options) {
|
|
115
114
|
identifier &&
|
116
115
|
(0, insert_todo_1.insertTodo)(identifier, 'use takeUntilDestroyed (https://angular.io/api/core/rxjs-interop/takeUntilDestroyed) instead of legacy TuiDestroyService');
|
117
116
|
});
|
118
|
-
!options['skip-logs'] && (0,
|
117
|
+
!options['skip-logs'] && (0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} successfully migrated \n`);
|
119
118
|
}
|
120
119
|
exports.migrateDestroyService = migrateDestroyService;
|
121
120
|
function findTakeUntil(node, maxDepth = 10) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference lib="es2021" />
|
2
|
-
import {
|
2
|
+
import type { DevkitFileSystem } from 'ng-morph';
|
3
3
|
import type { TuiSchema } from '../../../ng-add/schema';
|
4
|
-
export declare const TUI_EDITOR_VERSION = "^4.
|
4
|
+
export declare const TUI_EDITOR_VERSION = "^4.11.0";
|
5
5
|
export declare function migrateEditor(fileSystem: DevkitFileSystem, options: TuiSchema): void;
|
@@ -1,14 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateEditor = exports.TUI_EDITOR_VERSION = void 0;
|
4
|
-
/// <reference lib="es2021" />
|
5
4
|
const ng_morph_1 = require("ng-morph");
|
6
|
-
const ng_morph_2 = require("ng-morph");
|
7
5
|
const file_globs_1 = require("../../../constants/file-globs");
|
8
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
9
6
|
const replace_identifier_1 = require("../../steps/replace-identifier");
|
10
7
|
const replace_package_name_1 = require("../../steps/replace-package-name");
|
11
|
-
exports.TUI_EDITOR_VERSION = '^4.
|
8
|
+
exports.TUI_EDITOR_VERSION = '^4.11.0';
|
12
9
|
function migrateEditor(fileSystem, options) {
|
13
10
|
const moduleSpecifier = ['@tinkoff/tui-editor', '@taiga-ui/addon-editor'];
|
14
11
|
const hasEditor = moduleSpecifier.every((pkg) => !(0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, pkg));
|
@@ -16,7 +13,7 @@ function migrateEditor(fileSystem, options) {
|
|
16
13
|
return;
|
17
14
|
}
|
18
15
|
!options['skip-logs'] &&
|
19
|
-
(0,
|
16
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} migrating editor...`);
|
20
17
|
(0, replace_identifier_1.replaceIdentifiers)(options, [
|
21
18
|
{
|
22
19
|
from: { name: 'TuiEditorModule', moduleSpecifier },
|
@@ -67,12 +64,12 @@ function migrateEditor(fileSystem, options) {
|
|
67
64
|
to: { name: 'TuiInputColorModule', moduleSpecifier: '@taiga-ui/legacy' },
|
68
65
|
},
|
69
66
|
]);
|
70
|
-
(0,
|
67
|
+
(0, ng_morph_1.getSourceFiles)(file_globs_1.ALL_TS_FILES).forEach((sourceFile) => sourceFile.replaceWithText(sourceFile
|
71
68
|
.getFullText()
|
72
69
|
.replaceAll(/import\(['"`](@tinkoff|@taiga-ui)\/(tui-editor|addon-editor)\/(.*)['"`]\)/g, "import('@taiga-ui/editor')")));
|
73
|
-
(0,
|
70
|
+
(0, ng_morph_1.saveActiveProject)();
|
74
71
|
moduleSpecifier.forEach((pkg) => (0, replace_package_name_1.replacePackageName)(pkg, { name: '@taiga-ui/editor', version: exports.TUI_EDITOR_VERSION }, fileSystem.tree));
|
75
|
-
(0,
|
76
|
-
!options['skip-logs'] && (0,
|
72
|
+
(0, ng_morph_1.saveActiveProject)();
|
73
|
+
!options['skip-logs'] && (0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} successfully migrated \n`);
|
77
74
|
}
|
78
75
|
exports.migrateEditor = migrateEditor;
|
@@ -3,20 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateLegacyMask = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
8
7
|
const import_manipulations_1 = require("../../../utils/import-manipulations");
|
9
8
|
function migrateLegacyMask(options) {
|
10
9
|
!options['skip-logs'] &&
|
11
|
-
(0,
|
10
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} migrating legacy mask utils...`);
|
12
11
|
migrateTuiMaskedMoneyValueIsEmpty(options);
|
13
12
|
migrateTuiMaskedNumberStringToNumber(options);
|
14
|
-
!options['skip-logs'] && (0,
|
13
|
+
!options['skip-logs'] && (0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} successfully migrated \n`);
|
15
14
|
}
|
16
15
|
exports.migrateLegacyMask = migrateLegacyMask;
|
17
16
|
function migrateTuiMaskedMoneyValueIsEmpty(options) {
|
18
17
|
!options['skip-logs'] &&
|
19
|
-
(0,
|
18
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} tuiMaskedMoneyValueIsEmpty`);
|
20
19
|
const references = (0, get_named_import_references_1.getNamedImportReferences)('tuiMaskedMoneyValueIsEmpty', '@taiga-ui/core');
|
21
20
|
references.forEach((ref) => {
|
22
21
|
if (ref.wasForgotten()) {
|
@@ -35,7 +34,7 @@ function migrateTuiMaskedMoneyValueIsEmpty(options) {
|
|
35
34
|
}
|
36
35
|
function migrateTuiMaskedNumberStringToNumber(options) {
|
37
36
|
!options['skip-logs'] &&
|
38
|
-
(0,
|
37
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} tuiMaskedNumberStringToNumber`);
|
39
38
|
const references = (0, get_named_import_references_1.getNamedImportReferences)('tuiMaskedNumberStringToNumber', '@taiga-ui/core');
|
40
39
|
references.forEach((ref) => {
|
41
40
|
if (ref.wasForgotten()) {
|