@taiga-ui/cdk 3.52.0 → 3.53.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-constants.umd.js +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-for-async.umd.js +6 -1
- package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/directives/for-async/for-async.directive.d.ts +4 -0
- package/directives/for-async/for-async.module.d.ts +2 -1
- package/esm2015/constants/version.js +2 -2
- package/esm2015/directives/for-async/for-async.directive.js +5 -1
- package/esm2015/directives/for-async/for-async.module.js +3 -2
- package/fesm2015/taiga-ui-cdk-constants.js +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-for-async.js +6 -1
- package/fesm2015/taiga-ui-cdk-directives-for-async.js.map +1 -1
- package/package.json +4 -6
- package/schematics/ng-update/interfaces/html-comment.d.ts +5 -0
- package/schematics/ng-update/interfaces/index.d.ts +14 -0
- package/schematics/ng-update/interfaces/index.js +17 -0
- package/schematics/ng-update/{v3/interfaces/attribute-to-directive.d.ts → interfaces/replacement-attribute-to-directive.d.ts} +1 -1
- package/schematics/ng-update/interfaces/{replaceable-attribute-value.d.ts → replacement-attribute-value.d.ts} +1 -1
- package/schematics/ng-update/interfaces/{replaceable-attribute.d.ts → replacement-attribute.d.ts} +1 -1
- package/schematics/ng-update/interfaces/{replacement-const.d.ts → replacement-identifier.d.ts} +1 -1
- package/schematics/ng-update/interfaces/replacement-service.d.ts +2 -2
- package/schematics/ng-update/interfaces/{replaceable-tag.d.ts → replacement-tag.d.ts} +1 -1
- package/schematics/ng-update/interfaces/{type-to-rename.d.ts → replacement-type.d.ts} +1 -1
- package/schematics/ng-update/interfaces/replacement-type.js +2 -0
- package/schematics/ng-update/steps/icons/replace-imports.d.ts +2 -2
- package/schematics/ng-update/steps/rename-types.d.ts +2 -2
- package/schematics/ng-update/steps/replace-identifier.d.ts +3 -3
- package/schematics/ng-update/steps/replace-identifier.js +5 -5
- package/schematics/ng-update/utils/templates/index.d.ts +6 -0
- package/schematics/ng-update/utils/templates/index.js +9 -0
- package/schematics/ng-update/utils/templates/remove-inputs.d.ts +2 -2
- package/schematics/ng-update/utils/templates/remove-inputs.js +2 -2
- package/schematics/ng-update/utils/templates/replace-attr-values.d.ts +3 -3
- package/schematics/ng-update/utils/templates/replace-attr-values.js +2 -2
- package/schematics/ng-update/utils/templates/replace-attrs-by-directives.d.ts +7 -0
- package/schematics/ng-update/utils/templates/replace-attrs-by-directives.js +18 -0
- package/schematics/ng-update/utils/templates/replace-attrs.d.ts +10 -0
- package/schematics/ng-update/utils/templates/replace-attrs.js +20 -0
- package/schematics/ng-update/utils/templates/replace-tags.d.ts +3 -3
- package/schematics/ng-update/utils/templates/replace-tags.js +2 -2
- package/schematics/ng-update/utils/templates/template-comments.d.ts +10 -0
- package/schematics/ng-update/utils/templates/template-comments.js +20 -0
- package/schematics/ng-update/v3/constants/constants.d.ts +2 -2
- package/schematics/ng-update/v3/constants/deprecated-functions.d.ts +2 -2
- package/schematics/ng-update/v3/constants/templates.d.ts +8 -8
- package/schematics/ng-update/v3/constants/types.d.ts +2 -2
- package/schematics/ng-update/v3/index.js +1 -1
- package/schematics/ng-update/v3/steps/migrate-templates.js +11 -16
- package/schematics/ng-update/v3-30/constants/constants.d.ts +2 -2
- package/schematics/ng-update/v3-35/constants/constants.d.ts +2 -2
- package/schematics/ng-update/v4/index.js +7 -6
- package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +40 -0
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +47 -0
- package/schematics/ng-update/v4/steps/constants/html-comments.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/html-comments.js +10 -0
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +44 -0
- package/schematics/ng-update/v4/steps/constants/index.d.ts +6 -0
- package/schematics/ng-update/v4/steps/constants/index.js +9 -0
- package/schematics/ng-update/v4/steps/constants/inputs-to-remove.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +8 -0
- package/schematics/ng-update/v4/steps/constants/tags-to-replace.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +7 -0
- package/schematics/ng-update/v4/steps/index.d.ts +3 -0
- package/schematics/ng-update/v4/steps/index.js +6 -0
- package/schematics/ng-update/v4/steps/migrate-templates.d.ts +3 -0
- package/schematics/ng-update/v4/steps/migrate-templates.js +49 -0
- package/schematics/ng-update/v4/steps/templates/index.d.ts +2 -0
- package/schematics/ng-update/v4/steps/templates/index.js +5 -0
- package/schematics/ng-update/v4/steps/templates/migrate-badge.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-badge.js +29 -0
- package/schematics/ng-update/v4/steps/templates/toggles/common.d.ts +10 -0
- package/schematics/ng-update/v4/steps/templates/toggles/common.js +40 -0
- package/schematics/ng-update/v4/steps/templates/toggles/index.d.ts +3 -0
- package/schematics/ng-update/v4/steps/templates/toggles/index.js +6 -0
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js +25 -0
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-radio.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-radio.js +25 -0
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-toggle.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-toggle.js +25 -0
- package/schematics/utils/add-import-to-closest-module.js +11 -1
- package/schematics/utils/angular/is-standalone-component.d.ts +2 -0
- package/schematics/utils/angular/is-standalone-component.js +22 -0
- package/schematics/ng-update/v4/steps/replace-thumbnail-card.d.ts +0 -4
- package/schematics/ng-update/v4/steps/replace-thumbnail-card.js +0 -86
- /package/schematics/ng-update/interfaces/{replaceable-attribute-value.js → html-comment.js} +0 -0
- /package/schematics/ng-update/interfaces/{replaceable-attribute.js → replacement-attribute-to-directive.js} +0 -0
- /package/schematics/ng-update/interfaces/{replaceable-tag.js → replacement-attribute-value.js} +0 -0
- /package/schematics/ng-update/interfaces/{replacement-const.js → replacement-attribute.js} +0 -0
- /package/schematics/ng-update/interfaces/{type-to-rename.js → replacement-identifier.js} +0 -0
- /package/schematics/ng-update/{v3/interfaces/attribute-to-directive.js → interfaces/replacement-tag.js} +0 -0
@@ -1,3 +1,3 @@
|
|
1
1
|
import { TuiSchema } from '../../../ng-add/schema';
|
2
|
-
import {
|
3
|
-
export declare function replaceImports(replaceable:
|
2
|
+
import { ReplacementIdentifier } from '../../interfaces/replacement-identifier';
|
3
|
+
export declare function replaceImports(replaceable: ReplacementIdentifier[], options: TuiSchema): void;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { TuiSchema } from '../../ng-add/schema';
|
2
|
-
import {
|
3
|
-
export declare function renameTypes(options: TuiSchema, types: readonly
|
2
|
+
import { ReplacementType } from '../interfaces/replacement-type';
|
3
|
+
export declare function renameTypes(options: TuiSchema, types: readonly ReplacementType[]): void;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { TuiSchema } from '../../ng-add/schema';
|
2
|
-
import {
|
3
|
-
export declare function
|
4
|
-
export declare function replaceIdentifier({ from, to }:
|
2
|
+
import { ReplacementIdentifier } from '../interfaces/replacement-identifier';
|
3
|
+
export declare function replaceIdentifiers(options: TuiSchema, constants: readonly ReplacementIdentifier[]): void;
|
4
|
+
export declare function replaceIdentifier({ from, to }: ReplacementIdentifier): void;
|
@@ -1,19 +1,19 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.replaceIdentifier = exports.
|
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
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
|
9
|
+
function replaceIdentifiers(options, constants) {
|
10
10
|
!options[`skip-logs`] &&
|
11
|
-
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing
|
11
|
+
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing identifiers...`);
|
12
12
|
constants.forEach(constToReplace => replaceIdentifier(constToReplace));
|
13
13
|
!options[`skip-logs`] &&
|
14
|
-
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL}
|
14
|
+
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} identifiers replaced \n`);
|
15
15
|
}
|
16
|
-
exports.
|
16
|
+
exports.replaceIdentifiers = replaceIdentifiers;
|
17
17
|
function replaceIdentifier({ from, to }) {
|
18
18
|
const references = get_named_import_references_1.getNamedImportReferences(from.name, from.moduleSpecifier);
|
19
19
|
references.forEach(ref => {
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./remove-inputs"), exports);
|
5
|
+
tslib_1.__exportStar(require("./replace-attr-values"), exports);
|
6
|
+
tslib_1.__exportStar(require("./replace-attrs"), exports);
|
7
|
+
tslib_1.__exportStar(require("./replace-tag"), exports);
|
8
|
+
tslib_1.__exportStar(require("./replace-tags"), exports);
|
9
|
+
tslib_1.__exportStar(require("./template-comments"), exports);
|
@@ -2,9 +2,9 @@ import { UpdateRecorder } from '@angular-devkit/schematics';
|
|
2
2
|
import { DevkitFileSystem } from 'ng-morph';
|
3
3
|
import { RemovableInput } from '../../interfaces/removable-input';
|
4
4
|
import { TemplateResource } from '../../interfaces/template-resource';
|
5
|
-
export declare function removeInputs({ resource, recorder, fileSystem,
|
5
|
+
export declare function removeInputs({ resource, recorder, fileSystem, data, }: {
|
6
6
|
fileSystem: DevkitFileSystem;
|
7
7
|
recorder: UpdateRecorder;
|
8
|
-
|
8
|
+
data: readonly RemovableInput[];
|
9
9
|
resource: TemplateResource;
|
10
10
|
}): void;
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.removeInputs = void 0;
|
4
4
|
const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
|
5
5
|
const template_resource_1 = require("../../../utils/templates/template-resource");
|
6
|
-
function removeInputs({ resource, recorder, fileSystem,
|
6
|
+
function removeInputs({ resource, recorder, fileSystem, data, }) {
|
7
7
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
8
8
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
9
|
-
|
9
|
+
data.forEach(({ inputName, tags }) => {
|
10
10
|
const offsets = [
|
11
11
|
...ng_component_input_manipulations_1.getInputPropertyOffsets(template, inputName, tags),
|
12
12
|
...ng_component_input_manipulations_1.getInputPropertyOffsets(template, `[${inputName}]`, tags),
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { UpdateRecorder } from '@angular-devkit/schematics';
|
2
2
|
import { DevkitFileSystem } from 'ng-morph';
|
3
|
-
import {
|
3
|
+
import { ReplacementAttributeValue } from '../../interfaces/replacement-attribute-value';
|
4
4
|
import { TemplateResource } from '../../interfaces/template-resource';
|
5
|
-
export declare function replaceAttrValues({ resource, recorder, fileSystem,
|
5
|
+
export declare function replaceAttrValues({ resource, recorder, fileSystem, data, }: {
|
6
6
|
fileSystem: DevkitFileSystem;
|
7
7
|
recorder: UpdateRecorder;
|
8
|
-
|
8
|
+
data: ReplacementAttributeValue[];
|
9
9
|
resource: TemplateResource;
|
10
10
|
}): void;
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.replaceAttrValues = void 0;
|
4
4
|
const elements_1 = require("../../../utils/templates/elements");
|
5
5
|
const template_resource_1 = require("../../../utils/templates/template-resource");
|
6
|
-
function replaceAttrValues({ resource, recorder, fileSystem,
|
6
|
+
function replaceAttrValues({ resource, recorder, fileSystem, data, }) {
|
7
7
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
8
8
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
9
|
-
|
9
|
+
data.forEach(({ attrNames, values, withTagNames }) => {
|
10
10
|
const elements = [
|
11
11
|
...elements_1.findElementsWithAttributeOnTag(template, attrNames, withTagNames),
|
12
12
|
];
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { DevkitFileSystem } from 'ng-morph';
|
2
|
+
import { ReplacementAttributeToDirective, TemplateResource } from '../../interfaces';
|
3
|
+
export declare function replaceAttrsByDirective({ resource, fileSystem, data, }: {
|
4
|
+
fileSystem: DevkitFileSystem;
|
5
|
+
resource: TemplateResource;
|
6
|
+
data: ReplacementAttributeToDirective[];
|
7
|
+
}): void;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.replaceAttrsByDirective = void 0;
|
4
|
+
const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
|
5
|
+
function replaceAttrsByDirective({ resource, fileSystem, data, }) {
|
6
|
+
data.forEach(({ componentSelector, directiveModule, directive, inputProperty, filterFn }) => {
|
7
|
+
ng_component_input_manipulations_1.replaceInputPropertyByDirective({
|
8
|
+
componentSelector,
|
9
|
+
directiveModule,
|
10
|
+
directive,
|
11
|
+
inputProperty,
|
12
|
+
fileSystem,
|
13
|
+
templateResource: resource,
|
14
|
+
filterFn,
|
15
|
+
});
|
16
|
+
});
|
17
|
+
}
|
18
|
+
exports.replaceAttrsByDirective = replaceAttrsByDirective;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { UpdateRecorder } from '@angular-devkit/schematics';
|
2
|
+
import { DevkitFileSystem } from 'ng-morph';
|
3
|
+
import { ReplacementAttribute } from '../../interfaces/replacement-attribute';
|
4
|
+
import { TemplateResource } from '../../interfaces/template-resource';
|
5
|
+
export declare function replaceAttrs({ resource, recorder, fileSystem, data, }: {
|
6
|
+
fileSystem: DevkitFileSystem;
|
7
|
+
recorder: UpdateRecorder;
|
8
|
+
resource: TemplateResource;
|
9
|
+
data: readonly ReplacementAttribute[];
|
10
|
+
}): void;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.replaceAttrs = void 0;
|
4
|
+
const elements_1 = require("../../../utils/templates/elements");
|
5
|
+
const template_resource_1 = require("../../../utils/templates/template-resource");
|
6
|
+
function replaceAttrs({ resource, recorder, fileSystem, data, }) {
|
7
|
+
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
8
|
+
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
9
|
+
data.forEach(({ from, to }) => {
|
10
|
+
const offsets = [
|
11
|
+
...elements_1.findAttributeOnElementWithTag(template, from.attrName, from.withTagNames || [], from.filterFn),
|
12
|
+
...elements_1.findAttributeOnElementWithAttrs(template, from.attrName, from.withAttrsNames || [], from.filterFn),
|
13
|
+
];
|
14
|
+
offsets.forEach(offset => {
|
15
|
+
recorder.remove(offset + templateOffset, from.attrName.length);
|
16
|
+
recorder.insertRight(offset + templateOffset, to.attrName);
|
17
|
+
});
|
18
|
+
});
|
19
|
+
}
|
20
|
+
exports.replaceAttrs = replaceAttrs;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { UpdateRecorder } from '@angular-devkit/schematics';
|
2
2
|
import { DevkitFileSystem } from 'ng-morph';
|
3
|
-
import {
|
3
|
+
import { ReplacementTag } from '../../interfaces/replacement-tag';
|
4
4
|
import { TemplateResource } from '../../interfaces/template-resource';
|
5
|
-
export declare function replaceTags({ resource, recorder, fileSystem,
|
5
|
+
export declare function replaceTags({ resource, recorder, fileSystem, data, }: {
|
6
6
|
fileSystem: DevkitFileSystem;
|
7
7
|
recorder: UpdateRecorder;
|
8
|
-
|
8
|
+
data: readonly ReplacementTag[];
|
9
9
|
resource: TemplateResource;
|
10
10
|
}): void;
|
@@ -4,10 +4,10 @@ exports.replaceTags = void 0;
|
|
4
4
|
const elements_1 = require("../../../utils/templates/elements");
|
5
5
|
const template_resource_1 = require("../../../utils/templates/template-resource");
|
6
6
|
const replace_tag_1 = require("./replace-tag");
|
7
|
-
function replaceTags({ resource, recorder, fileSystem,
|
7
|
+
function replaceTags({ resource, recorder, fileSystem, data, }) {
|
8
8
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
9
9
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
10
|
-
|
10
|
+
data.forEach(({ from, to, addAttributes }) => {
|
11
11
|
const elements = elements_1.findElementsByTagName(template, from);
|
12
12
|
elements.forEach(({ sourceCodeLocation }) => {
|
13
13
|
if (sourceCodeLocation) {
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { UpdateRecorder } from '@angular-devkit/schematics';
|
2
|
+
import { DevkitFileSystem } from 'ng-morph';
|
3
|
+
import { TemplateResource } from '../../interfaces';
|
4
|
+
import { HtmlComment } from '../../interfaces';
|
5
|
+
export declare function addHTMLCommentTags({ resource, recorder, fileSystem, data, }: {
|
6
|
+
fileSystem: DevkitFileSystem;
|
7
|
+
recorder: UpdateRecorder;
|
8
|
+
data: readonly HtmlComment[];
|
9
|
+
resource: TemplateResource;
|
10
|
+
}): void;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.addHTMLCommentTags = void 0;
|
4
|
+
const insert_todo_1 = require("../../../utils/insert-todo");
|
5
|
+
const elements_1 = require("../../../utils/templates/elements");
|
6
|
+
const template_resource_1 = require("../../../utils/templates/template-resource");
|
7
|
+
function addHTMLCommentTags({ resource, recorder, fileSystem, data, }) {
|
8
|
+
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
9
|
+
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
10
|
+
data.forEach(({ comment, tag, withAttrs }) => {
|
11
|
+
const elementStartOffsets = [
|
12
|
+
...elements_1.findElementsWithAttributeOnTag(template, withAttrs, [tag]),
|
13
|
+
...elements_1.findElementsWithAttributeOnTag(template, withAttrs.map(attr => `[${attr}]`), [tag]),
|
14
|
+
].map(({ sourceCodeLocation }) => ((sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startOffset) || 0) + templateOffset);
|
15
|
+
elementStartOffsets.forEach(offset => {
|
16
|
+
recorder.insertRight(offset, `<!-- ${insert_todo_1.TODO_MARK} ${comment} -->\n`);
|
17
|
+
});
|
18
|
+
});
|
19
|
+
}
|
20
|
+
exports.addHTMLCommentTags = addHTMLCommentTags;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export declare const CONSTANTS_TO_REPLACE:
|
1
|
+
import { ReplacementIdentifier } from '../../interfaces/replacement-identifier';
|
2
|
+
export declare const CONSTANTS_TO_REPLACE: ReplacementIdentifier[];
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export declare const DEPRECATED_FUNCTIONS: readonly
|
1
|
+
import { ReplacementType } from '../../interfaces/replacement-type';
|
2
|
+
export declare const DEPRECATED_FUNCTIONS: readonly ReplacementType[];
|
@@ -1,12 +1,12 @@
|
|
1
|
+
import { ReplacementAttributeToDirective } from '../../interfaces';
|
1
2
|
import { RemovableInput } from '../../interfaces/removable-input';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
|
6
|
-
export declare const ATTRS_TO_REPLACE: ReplaceableAttribute[];
|
3
|
+
import { ReplacementAttribute } from '../../interfaces/replacement-attribute';
|
4
|
+
import { ReplacementAttributeValue } from '../../interfaces/replacement-attribute-value';
|
5
|
+
import { ReplacementTag } from '../../interfaces/replacement-tag';
|
6
|
+
export declare const ATTRS_TO_REPLACE: ReplacementAttribute[];
|
7
7
|
export declare const INPUTS_TO_REMOVE: RemovableInput[];
|
8
|
-
export declare const TAGS_TO_REPLACE:
|
9
|
-
export declare const ATTR_TO_DIRECTIVE:
|
8
|
+
export declare const TAGS_TO_REPLACE: ReplacementTag[];
|
9
|
+
export declare const ATTR_TO_DIRECTIVE: ReplacementAttributeToDirective[];
|
10
10
|
/**
|
11
11
|
* @example `<div [someDirective]="true" />` => `<div someDirective />`
|
12
12
|
*
|
@@ -54,4 +54,4 @@ export declare const TEMPLATE_COMMENTS: readonly [{
|
|
54
54
|
readonly withAttr: "lastIndex";
|
55
55
|
readonly comment: "Use property [length] instead. See example: https://taiga-ui.dev/components/preview";
|
56
56
|
}];
|
57
|
-
export declare const REPLACE_ATTR_VALUE:
|
57
|
+
export declare const REPLACE_ATTR_VALUE: ReplacementAttributeValue[];
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export declare const TYPES_TO_RENAME: readonly
|
1
|
+
import { ReplacementType } from '../../interfaces/replacement-type';
|
2
|
+
export declare const TYPES_TO_RENAME: readonly ReplacementType[];
|
@@ -55,7 +55,7 @@ function main(options) {
|
|
55
55
|
replace_deep_import_1.replaceDeepImports(options);
|
56
56
|
replace_enums_1.replaceEnums(options, enums_1.ENUMS_TO_REPLACE);
|
57
57
|
rename_types_1.renameTypes(options, types_1.TYPES_TO_RENAME);
|
58
|
-
replace_identifier_1.
|
58
|
+
replace_identifier_1.replaceIdentifiers(options, constants_1.CONSTANTS_TO_REPLACE);
|
59
59
|
replace_services_1.replaceServices(options, services_1.SERVICES_TO_REPLACE);
|
60
60
|
replace_styles_1.replaceStyles();
|
61
61
|
show_warnings_1.showWarnings(context, warnings_1.MIGRATION_WARNINGS);
|
@@ -15,6 +15,7 @@ const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-
|
|
15
15
|
const template_resource_1 = require("../../../utils/templates/template-resource");
|
16
16
|
const remove_inputs_1 = require("../../utils/templates/remove-inputs");
|
17
17
|
const replace_attr_values_1 = require("../../utils/templates/replace-attr-values");
|
18
|
+
const replace_attrs_1 = require("../../utils/templates/replace-attrs");
|
18
19
|
const replace_tag_1 = require("../../utils/templates/replace-tag");
|
19
20
|
const replace_tags_1 = require("../../utils/templates/replace-tags");
|
20
21
|
const templates_1 = require("../constants/templates");
|
@@ -26,7 +27,7 @@ function migrateTemplates(fileSystem, options) {
|
|
26
27
|
const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
|
27
28
|
const actions = [
|
28
29
|
replaceV3Tags,
|
29
|
-
|
30
|
+
replaceV3Attrs,
|
30
31
|
replaceAttrsByDirective,
|
31
32
|
replaceBreadcrumbs,
|
32
33
|
replaceFieldError,
|
@@ -69,22 +70,16 @@ function replaceAttrsByDirective({ resource, fileSystem, }) {
|
|
69
70
|
});
|
70
71
|
});
|
71
72
|
}
|
72
|
-
function
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
...elements_1.findAttributeOnElementWithAttrs(template, from.attrName, from.withAttrsNames || [], from.filterFn),
|
79
|
-
];
|
80
|
-
offsets.forEach(offset => {
|
81
|
-
recorder.remove(offset + templateOffset, from.attrName.length);
|
82
|
-
recorder.insertRight(offset + templateOffset, to.attrName);
|
83
|
-
});
|
73
|
+
function replaceV3Attrs({ resource, recorder, fileSystem, }) {
|
74
|
+
replace_attrs_1.replaceAttrs({
|
75
|
+
resource,
|
76
|
+
recorder,
|
77
|
+
fileSystem,
|
78
|
+
data: templates_1.ATTRS_TO_REPLACE,
|
84
79
|
});
|
85
80
|
}
|
86
81
|
function replaceV3Tags({ resource, recorder, fileSystem, }) {
|
87
|
-
replace_tags_1.replaceTags({ resource, recorder, fileSystem,
|
82
|
+
replace_tags_1.replaceTags({ resource, recorder, fileSystem, data: templates_1.TAGS_TO_REPLACE });
|
88
83
|
}
|
89
84
|
function addHTMLCommentTags({ resource, recorder, fileSystem, }) {
|
90
85
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
@@ -215,9 +210,9 @@ function replaceInputValues({ resource, recorder, fileSystem, }) {
|
|
215
210
|
resource,
|
216
211
|
recorder,
|
217
212
|
fileSystem,
|
218
|
-
|
213
|
+
data: templates_1.REPLACE_ATTR_VALUE,
|
219
214
|
});
|
220
215
|
}
|
221
216
|
function removeV3Inputs({ resource, fileSystem, recorder, }) {
|
222
|
-
remove_inputs_1.removeInputs({ resource, recorder, fileSystem,
|
217
|
+
remove_inputs_1.removeInputs({ resource, recorder, fileSystem, data: templates_1.INPUTS_TO_REMOVE });
|
223
218
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export declare const ICONS_TS:
|
1
|
+
import { ReplacementIdentifier } from '../../interfaces/replacement-identifier';
|
2
|
+
export declare const ICONS_TS: ReplacementIdentifier[];
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export declare const ICONS_TS:
|
1
|
+
import { ReplacementIdentifier } from '../../interfaces/replacement-identifier';
|
2
|
+
export declare const ICONS_TS: ReplacementIdentifier[];
|
@@ -9,9 +9,9 @@ const versions_1 = require("../../ng-add/constants/versions");
|
|
9
9
|
const colored_log_1 = require("../../utils/colored-log");
|
10
10
|
const get_execution_time_1 = require("../../utils/get-execution-time");
|
11
11
|
const project_root_1 = require("../../utils/project-root");
|
12
|
-
const
|
13
|
-
const
|
14
|
-
const
|
12
|
+
const replace_identifier_1 = require("../steps/replace-identifier");
|
13
|
+
const steps_1 = require("./steps");
|
14
|
+
const identifiers_to_replace_1 = require("./steps/constants/identifiers-to-replace");
|
15
15
|
function updateToV4(options) {
|
16
16
|
const t0 = perf_hooks_1.performance.now();
|
17
17
|
!options[`skip-logs`] &&
|
@@ -30,9 +30,10 @@ function main(options) {
|
|
30
30
|
return (tree, _context) => {
|
31
31
|
const project = ng_morph_1.createProject(tree, project_root_1.projectRoot(), constants_1.ALL_FILES);
|
32
32
|
const fileSystem = project.getFileSystem().fs;
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
replace_identifier_1.replaceIdentifiers(options, identifiers_to_replace_1.IDENTIFIERS_TO_REPLACE);
|
34
|
+
steps_1.restoreTuiMapper(options);
|
35
|
+
steps_1.restoreTuiMatcher(options);
|
36
|
+
steps_1.migrateTemplates(fileSystem, options);
|
36
37
|
fileSystem.commitEdits();
|
37
38
|
ng_morph_1.saveActiveProject();
|
38
39
|
};
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ATTRS_TO_DIRECTIVE_REPLACE = void 0;
|
4
|
+
exports.ATTRS_TO_DIRECTIVE_REPLACE = [
|
5
|
+
{
|
6
|
+
componentSelector: [
|
7
|
+
`tui-primitive-textfield`,
|
8
|
+
`tui-input-number`,
|
9
|
+
`tui-input-slider`,
|
10
|
+
],
|
11
|
+
inputProperty: `prefix`,
|
12
|
+
directive: `tuiTextfieldPrefix`,
|
13
|
+
directiveModule: {
|
14
|
+
name: `TuiTextfieldControllerModule`,
|
15
|
+
moduleSpecifier: `@taiga-ui/core`,
|
16
|
+
},
|
17
|
+
},
|
18
|
+
{
|
19
|
+
componentSelector: [
|
20
|
+
`tui-primitive-textfield`,
|
21
|
+
`tui-input-number`,
|
22
|
+
`tui-input-slider`,
|
23
|
+
],
|
24
|
+
inputProperty: `postfix`,
|
25
|
+
directive: `tuiTextfieldPostfix`,
|
26
|
+
directiveModule: {
|
27
|
+
name: `TuiTextfieldControllerModule`,
|
28
|
+
moduleSpecifier: `@taiga-ui/core`,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
{
|
32
|
+
componentSelector: [`tui-primitive-textfield`],
|
33
|
+
inputProperty: `filler`,
|
34
|
+
directive: `tuiTextfieldFiller`,
|
35
|
+
directiveModule: {
|
36
|
+
name: `TuiTextfieldControllerModule`,
|
37
|
+
moduleSpecifier: `@taiga-ui/core`,
|
38
|
+
},
|
39
|
+
},
|
40
|
+
];
|
@@ -0,0 +1,47 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ATTRS_TO_REPLACE = void 0;
|
4
|
+
exports.ATTRS_TO_REPLACE = [
|
5
|
+
{
|
6
|
+
from: {
|
7
|
+
attrName: `brandLogo`,
|
8
|
+
withTagNames: [`tui-card`, `tui-thumbnail-card`],
|
9
|
+
},
|
10
|
+
to: { attrName: `iconLeft` },
|
11
|
+
},
|
12
|
+
{
|
13
|
+
from: {
|
14
|
+
attrName: `[brandLogo]`,
|
15
|
+
withTagNames: [`tui-card`, `tui-thumbnail-card`],
|
16
|
+
},
|
17
|
+
to: { attrName: `[iconLeft]` },
|
18
|
+
},
|
19
|
+
{
|
20
|
+
from: {
|
21
|
+
attrName: `[status]`,
|
22
|
+
withTagNames: [`tui-badge`],
|
23
|
+
},
|
24
|
+
to: { attrName: `[appearance]` },
|
25
|
+
},
|
26
|
+
{
|
27
|
+
from: {
|
28
|
+
attrName: `status`,
|
29
|
+
withTagNames: [`tui-badge`],
|
30
|
+
},
|
31
|
+
to: { attrName: `appearance` },
|
32
|
+
},
|
33
|
+
{
|
34
|
+
from: {
|
35
|
+
attrName: `item`,
|
36
|
+
withTagNames: [`tui-radio`],
|
37
|
+
},
|
38
|
+
to: { attrName: `value` },
|
39
|
+
},
|
40
|
+
{
|
41
|
+
from: {
|
42
|
+
attrName: `[item]`,
|
43
|
+
withTagNames: [`tui-radio`],
|
44
|
+
},
|
45
|
+
to: { attrName: `[value]` },
|
46
|
+
},
|
47
|
+
];
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.HTML_COMMENTS = void 0;
|
4
|
+
exports.HTML_COMMENTS = [
|
5
|
+
{
|
6
|
+
tag: `tui-toggle`,
|
7
|
+
withAttrs: [`singleColor`, `showLoader`],
|
8
|
+
comment: `toggle [singleColor] and [showLoader] inputs have been removed due to design changes`,
|
9
|
+
},
|
10
|
+
];
|
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.IDENTIFIERS_TO_REPLACE = void 0;
|
4
|
+
exports.IDENTIFIERS_TO_REPLACE = [
|
5
|
+
{
|
6
|
+
from: { name: `TuiCardModule`, moduleSpecifier: `@taiga-ui/addon-commerce` },
|
7
|
+
to: { name: `TuiThumbnailCardModule`, moduleSpecifier: `@taiga-ui/addon-commerce` },
|
8
|
+
},
|
9
|
+
{
|
10
|
+
from: { name: `TuiCardComponent`, moduleSpecifier: `@taiga-ui/addon-commerce` },
|
11
|
+
to: {
|
12
|
+
name: `TuiThumbnailCardComponent`,
|
13
|
+
moduleSpecifier: `@taiga-ui/addon-commerce`,
|
14
|
+
},
|
15
|
+
},
|
16
|
+
{
|
17
|
+
from: { name: `TuiBadgeModule`, moduleSpecifier: `@taiga-ui/experimental` },
|
18
|
+
to: { name: `TuiBadgeModule`, moduleSpecifier: `@taiga-ui/kit` },
|
19
|
+
},
|
20
|
+
{
|
21
|
+
from: { name: `TuiCheckboxModule`, moduleSpecifier: `@taiga-ui/experimental` },
|
22
|
+
to: { name: `TuiCheckboxModule`, moduleSpecifier: `@taiga-ui/kit` },
|
23
|
+
},
|
24
|
+
{
|
25
|
+
from: { name: `TuiRadioModule`, moduleSpecifier: `@taiga-ui/experimental` },
|
26
|
+
to: { name: `TuiRadioModule`, moduleSpecifier: `@taiga-ui/kit` },
|
27
|
+
},
|
28
|
+
{
|
29
|
+
from: { name: `TuiToggleModule`, moduleSpecifier: `@taiga-ui/experimental` },
|
30
|
+
to: { name: `TuiToggleModule`, moduleSpecifier: `@taiga-ui/kit` },
|
31
|
+
},
|
32
|
+
{
|
33
|
+
from: { name: `TuiTextAreaModule`, moduleSpecifier: `@taiga-ui/kit` },
|
34
|
+
to: { name: `TuiTextareaModule`, moduleSpecifier: `@taiga-ui/kit` },
|
35
|
+
},
|
36
|
+
{
|
37
|
+
from: { name: `TuiTextAreaDirective`, moduleSpecifier: `@taiga-ui/kit` },
|
38
|
+
to: { name: `TuiTextareaDirective`, moduleSpecifier: `@taiga-ui/kit` },
|
39
|
+
},
|
40
|
+
{
|
41
|
+
from: { name: `TuiTextAreaComponent`, moduleSpecifier: `@taiga-ui/kit` },
|
42
|
+
to: { name: `TuiTextareaComponent`, moduleSpecifier: `@taiga-ui/kit` },
|
43
|
+
},
|
44
|
+
];
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./attr-to-directive-replace"), exports);
|
5
|
+
tslib_1.__exportStar(require("./attrs-to-replace"), exports);
|
6
|
+
tslib_1.__exportStar(require("./html-comments"), exports);
|
7
|
+
tslib_1.__exportStar(require("./identifiers-to-replace"), exports);
|
8
|
+
tslib_1.__exportStar(require("./inputs-to-remove"), exports);
|
9
|
+
tslib_1.__exportStar(require("./tags-to-replace"), exports);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.INPUTS_TO_REMOVE = void 0;
|
4
|
+
exports.INPUTS_TO_REMOVE = [
|
5
|
+
{ inputName: `active`, tags: [`tui-card`, `tui-thumbnail-card`] },
|
6
|
+
{ inputName: `showLoader`, tags: [`tui-toggle`] },
|
7
|
+
{ inputName: `singleColor`, tags: [`tui-toggle`] },
|
8
|
+
];
|