@taiga-ui/cdk 3.29.2 → 3.30.0-dev.main-acad351
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js +32 -8
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +33 -11
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
- 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-observables.umd.js +10 -0
- package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.js +3 -1
- package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/components/alert-host/alert-host.component.d.ts +9 -5
- package/components/dialog-host/dialog-host.component.d.ts +8 -5
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2015/components/alert-host/alert-host.component.js +32 -6
- package/esm2015/components/dialog-host/dialog-host.component.js +31 -9
- package/esm2015/constants/version.js +2 -2
- package/esm2015/observables/index.js +2 -1
- package/esm2015/observables/scroll-from.js +10 -0
- package/esm2015/services/parents-scroll.service.js +4 -2
- package/esm2015/tokens/removed-element.js +2 -2
- package/fesm2015/taiga-ui-cdk-components-alert-host.js +31 -5
- package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js +30 -8
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-observables.js +10 -1
- package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-services.js +3 -1
- package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/observables/index.d.ts +1 -0
- package/observables/scroll-from.d.ts +5 -0
- package/package.json +2 -2
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/schema.json +1 -1
- package/schematics/ng-update/utils/templates/replace-attr-values.d.ts +10 -0
- package/schematics/ng-update/utils/templates/replace-attr-values.js +30 -0
- package/schematics/ng-update/v3/constants/templates.d.ts +1 -1
- package/schematics/ng-update/v3/constants/templates.js +3 -3
- package/schematics/ng-update/v3/interfaces/replaceable-attribute-value.d.ts +1 -1
- package/schematics/ng-update/v3/steps/migrate-templates.js +6 -20
- package/schematics/ng-update/v3-30/constants/constants.d.ts +2 -0
- package/schematics/ng-update/v3-30/constants/constants.js +8 -0
- package/schematics/ng-update/v3-30/constants/icons.d.ts +4 -0
- package/schematics/ng-update/v3-30/constants/icons.js +993 -0
- package/schematics/ng-update/v3-30/index.d.ts +3 -0
- package/schematics/ng-update/v3-30/index.js +33 -0
- package/schematics/ng-update/v3-30/steps/replace-text.d.ts +4 -0
- package/schematics/ng-update/v3-30/steps/replace-text.js +19 -0
- package/schematics/utils/templates/elements.d.ts +1 -1
- package/schematics/utils/templates/elements.js +2 -2
- /package/schematics/ng-update/{v3/interfaces → interfaces}/replaceable-attribute.d.ts +0 -0
- /package/schematics/ng-update/{v3/interfaces → interfaces}/replaceable-attribute.js +0 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.updateToV3_30 = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const colored_log_1 = require("../../utils/colored-log");
|
6
|
+
const replace_const_1 = require("../steps/replace-const");
|
7
|
+
const get_file_system_1 = require("../utils/get-file-system");
|
8
|
+
const constants_1 = require("./constants/constants");
|
9
|
+
const icons_1 = require("./constants/icons");
|
10
|
+
const replace_text_1 = require("./steps/replace-text");
|
11
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
12
|
+
function updateToV3_30(options) {
|
13
|
+
return (tree, _) => {
|
14
|
+
if (!hasProprietaryIcons(tree)) {
|
15
|
+
!options[`skip-logs`] &&
|
16
|
+
colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} No migrations required\n`);
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
const fileSystem = get_file_system_1.getFileSystem(tree);
|
20
|
+
replace_const_1.replaceConstants(options, constants_1.ICONS_TS);
|
21
|
+
!options[`skip-logs`] &&
|
22
|
+
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing strings...`);
|
23
|
+
replace_text_1.replaceText(icons_1.ICONS);
|
24
|
+
fileSystem.commitEdits();
|
25
|
+
ng_morph_1.saveActiveProject();
|
26
|
+
!options[`skip-logs`] &&
|
27
|
+
colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} Icons successfully migrated \n`);
|
28
|
+
};
|
29
|
+
}
|
30
|
+
exports.updateToV3_30 = updateToV3_30;
|
31
|
+
function hasProprietaryIcons(tree) {
|
32
|
+
return !!ng_morph_1.getPackageJsonDependency(tree, `@taiga-ui/proprietary-icons`);
|
33
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.replaceText = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const constants_1 = require("../../../constants");
|
6
|
+
function replaceText(replaceable) {
|
7
|
+
const sourceFiles = ng_morph_1.getSourceFiles(constants_1.ALL_FILES);
|
8
|
+
sourceFiles.forEach(file => {
|
9
|
+
let text = file.getFullText();
|
10
|
+
replaceable.forEach(({ from, to }) => {
|
11
|
+
const regexp = new RegExp(from, `g`);
|
12
|
+
if (text.match(regexp)) {
|
13
|
+
text = text.replace(regexp, to);
|
14
|
+
}
|
15
|
+
});
|
16
|
+
file.replaceWithText(text);
|
17
|
+
});
|
18
|
+
}
|
19
|
+
exports.replaceText = replaceText;
|
@@ -13,7 +13,7 @@ export declare function findElementsWithAttribute(html: string, attributeName: s
|
|
13
13
|
* @param html
|
14
14
|
* @param attributeName
|
15
15
|
*/
|
16
|
-
export declare function findElementsWithAttributeOnTag(html: string,
|
16
|
+
export declare function findElementsWithAttributeOnTag(html: string, attributeNames: string[], tagNames?: string[]): Element[];
|
17
17
|
/**
|
18
18
|
* Finds elements with explicit tag names that also contain the specified attribute. Returns the
|
19
19
|
* attribute start offset based on the specified HTML.
|
@@ -49,10 +49,10 @@ exports.findElementsWithAttribute = findElementsWithAttribute;
|
|
49
49
|
* @param html
|
50
50
|
* @param attributeName
|
51
51
|
*/
|
52
|
-
function findElementsWithAttributeOnTag(html,
|
52
|
+
function findElementsWithAttributeOnTag(html, attributeNames, tagNames = []) {
|
53
53
|
return findElementsInTemplateByFn(html, el => {
|
54
54
|
var _a;
|
55
|
-
return ((_a = el.attrs) === null || _a === void 0 ? void 0 : _a.some(attr =>
|
55
|
+
return ((_a = el.attrs) === null || _a === void 0 ? void 0 : _a.some(attr => attributeNames.map(name => name.toLowerCase()).includes(attr.name))) &&
|
56
56
|
(tagNames.includes(el.tagName) || !tagNames.length);
|
57
57
|
});
|
58
58
|
}
|
File without changes
|
File without changes
|