@taiga-ui/cdk 4.0.0-rc.7 → 4.0.0-rc.8
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/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2022/constants/version.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-constants.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/package.json +2 -3
- package/schematics/ng-update/steps/replace-identifier.js +2 -3
- package/schematics/ng-update/v4/index.js +1 -0
- package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.js +3 -3
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +26 -3
- package/schematics/ng-update/v4/steps/constants/html-comments.js +5 -0
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +63 -22
- package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +1 -0
- package/schematics/ng-update/v4/steps/constants/migration-warnings.js +10 -0
- package/schematics/ng-update/v4/steps/constants/modules-to-remove.js +4 -0
- package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +3 -2
- package/schematics/ng-update/v4/steps/constants/types.js +17 -0
- package/schematics/ng-update/v4/steps/index.d.ts +2 -1
- package/schematics/ng-update/v4/steps/index.js +2 -1
- package/schematics/ng-update/v4/steps/migrate-alert-service.d.ts +2 -0
- package/schematics/ng-update/v4/steps/migrate-alert-service.js +88 -0
- package/schematics/ng-update/v4/steps/migrate-templates.js +5 -0
- package/schematics/ng-update/v4/steps/{migrate-styles.js → styles/index.js} +2 -0
- package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.d.ts +1 -0
- package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js +20 -0
- package/schematics/ng-update/v4/steps/templates/index.d.ts +3 -0
- package/schematics/ng-update/v4/steps/templates/index.js +3 -0
- package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +10 -5
- package/schematics/ng-update/v4/steps/templates/migrate-axes.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-axes.js +26 -0
- package/schematics/ng-update/v4/steps/templates/migrate-badge.js +7 -6
- package/schematics/ng-update/v4/steps/templates/migrate-blocked.js +2 -1
- package/schematics/ng-update/v4/steps/templates/migrate-expandable.js +3 -2
- package/schematics/ng-update/v4/steps/templates/migrate-focusable.js +7 -4
- package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.js +45 -0
- package/schematics/ng-update/v4/steps/templates/migrate-notification.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-notification.js +46 -0
- package/schematics/ng-update/v4/steps/templates/migrate-number-precision.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-number-precision.js +36 -0
- package/schematics/ng-update/v4/steps/templates/migrate-overscroll.js +4 -6
- package/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.js +2 -1
- package/schematics/ng-update/v4/steps/templates/toggles/common.js +3 -2
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js +2 -1
- package/schematics/ng-update/v4/steps/update-packages.js +13 -4
- package/schematics/utils/templates/elements.js +2 -1
- package/schematics/utils/templates/inputs.js +2 -1
- /package/schematics/ng-update/v4/steps/{migrate-styles.d.ts → styles/index.d.ts} +0 -0
package/constants/version.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export declare const TUI_VERSION = "4.0.0-rc.
|
1
|
+
export declare const TUI_VERSION = "4.0.0-rc.8";
|
package/constants/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const TUI_VERSION = '4.0.0-rc.
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
export const TUI_VERSION = '4.0.0-rc.8';
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2Nkay9jb25zdGFudHMvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxXQUFXLEdBQUcsWUFBWSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IFRVSV9WRVJTSU9OID0gJzQuMC4wLXJjLjgnO1xuIl19
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-constants.mjs","sources":["../../../projects/cdk/constants/empty.ts","../../../projects/cdk/constants/handlers.ts","../../../projects/cdk/constants/matchers.ts","../../../projects/cdk/constants/regexp.ts","../../../projects/cdk/constants/svg-node-filter.ts","../../../projects/cdk/constants/unicode-chars.ts","../../../projects/cdk/constants/used-icons.ts","../../../projects/cdk/constants/version.ts","../../../projects/cdk/constants/taiga-ui-cdk-constants.ts"],"sourcesContent":["import {QueryList} from '@angular/core';\n\nconst rect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n x: 0,\n y: 0,\n} as const;\n\n/**\n * For type safety when using @ContentChildren and @ViewChildren\n *\n * NOTE: Be careful subscribing to 'changes'\n */\nexport const EMPTY_QUERY = new QueryList<any>();\nexport const EMPTY_ARRAY: [] = [];\nexport const EMPTY_FUNCTION: (...args: any[]) => void = () => {};\nexport const EMPTY_CLIENT_RECT: DOMRect = {\n ...rect,\n toJSON: () => rect,\n};\n","/**\n * Handler that always returns `false`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const TUI_FALSE_HANDLER = (): false => false;\n\n/**\n * Handler that always returns `true`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const TUI_TRUE_HANDLER = (): true => true;\n","import type {TuiHandler, TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\nfunction bothEmpty(item1: unknown, item2: unknown): boolean {\n return Array.isArray(item1) && Array.isArray(item2) && !item1.length && !item2.length;\n}\n\n/**\n * Default handler for matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_DEFAULT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = String,\n): boolean => stringify(item).toLowerCase().includes(search.toLowerCase());\n\n/**\n * Default handler for strict matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_STRICT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = String,\n): boolean => stringify(item).toLowerCase() === search.toLowerCase();\n\n/**\n * Default handler to match equality of two elements\n * ATTENTION: considers two empty arrays equal\n *\n * @param item1 first element\n * @param item2 second element\n */\nexport const TUI_DEFAULT_IDENTITY_MATCHER: TuiIdentityMatcher<unknown> = (item1, item2) =>\n item1 === item2 || bothEmpty(item1, item2);\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\n","export const svgNodeFilter: Exclude<NodeFilter, (node: Node) => number> = {\n acceptNode(node: Node): number {\n return 'ownerSVGElement' in node\n ? NodeFilter.FILTER_REJECT\n : NodeFilter.FILTER_ACCEPT;\n },\n};\n","/**\n * {@link https://unicode-table.com/en/00A0/ Non-breaking space}.\n */\nexport const CHAR_NO_BREAK_SPACE = '\\u00A0';\n\n/**\n * {@link https://unicode-table.com/en/2013/ EN dash}\n * is used to indicate a range of numbers or a span of time.\n * @example 2006–2022\n * ___\n * Don't confuse with {@link CHAR_EM_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EN_DASH = '\\u2013';\n\n/**\n * {@link https://unicode-table.com/en/2014/ EM dash}\n * is used to mark a break in a sentence.\n * @example Taiga UI — powerful set of open source components for Angular\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EM_DASH = '\\u2014';\n\n/**\n * {@link https://unicode-table.com/en/00AB/ Left-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_LAQUO = '\\u00AB';\n\n/**\n * {@link https://unicode-table.com/en/00BB/ Right-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_RAQUO = '\\u00BB';\n\n/**\n * {@link https://unicode-table.com/en/002D/ Hyphen (minus sign)}\n * is used to combine words.\n * @example well-behaved\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_EM_DASH}!\n */\nexport const CHAR_HYPHEN = '\\u002D';\n\n/**\n * {@link https://unicode-table.com/en/2212/ Minus}\n * is used as math operator symbol or before negative digits.\n * ---\n * Can be used as `−`. Don't confuse with {@link CHAR_HYPHEN}\n */\nexport const CHAR_MINUS = '\\u2212';\n\n/**\n * {@link https://unicode-table.com/en/002B/ Plus}\n */\nexport const CHAR_PLUS = '\\u002B';\n\n/**\n * {@link https://unicode-table.com/en/2022/ Bullet}.\n */\nexport const CHAR_BULLET = '\\u2022';\n\n/**\n * {@link https://unicode-table.com/en/2026/ Suspension points}.\n */\nexport const CHAR_ELLIPSIS = '\\u2026';\n\n/**\n * {@link https://unicode-table.com/en/00A4/ Suspension points}.\n */\nexport const CHAR_CURRENCY_SIGN = '\\u00A4';\n\n/**\n * {@link https://unicode-table.com/en/200b/ Suspension points}.\n */\nexport const CHAR_ZERO_WIDTH_SPACE = '\\u200B';\n","/**\n * @description:\n * AUTOGENERATED\n *\n * Array of icons used in taiga-ui components\n */\nexport const TUI_USED_ICONS = [\n '@tui.mir',\n '@tui.visa',\n '@tui.electron',\n '@tui.mastercard',\n '@tui.maestro',\n '@tui.amex',\n '@tui.diners-club',\n '@tui.discover',\n '@tui.humo',\n '@tui.jcb',\n '@tui.ru-pay',\n '@tui.union-pay',\n '@tui.uzcard',\n '@tui.verve',\n '@tui.search',\n '@tui.sun',\n '@tui.moon',\n '@tui.code',\n '@tui.menu',\n '@tui.copy',\n '@tui.check',\n '@tui.link',\n '@tui.eye-off',\n '@tui.eye',\n '@tui.grip-vertical',\n '@tui.chevron-up',\n '@tui.chevron-down',\n '@tui.chevrons-up-down',\n '@tui.info',\n '@tui.circle-check',\n '@tui.circle-x',\n '@tui.circle-alert',\n '@tui.circle-help',\n '@tui.x',\n '@tui.chevron-right',\n '@tui.chevron-left',\n '@tui.calendar',\n '@tui.minus',\n '@tui.file',\n '@tui.trash',\n '@tui.star',\n '@tui.rotate-ccw-square',\n '@tui.arrow-left',\n '@tui.arrow-right',\n '@tui.plus',\n '@tui.minimize',\n '@tui.clock',\n] as const;\n","export const TUI_VERSION = '4.0.0-rc.
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-constants.mjs","sources":["../../../projects/cdk/constants/empty.ts","../../../projects/cdk/constants/handlers.ts","../../../projects/cdk/constants/matchers.ts","../../../projects/cdk/constants/regexp.ts","../../../projects/cdk/constants/svg-node-filter.ts","../../../projects/cdk/constants/unicode-chars.ts","../../../projects/cdk/constants/used-icons.ts","../../../projects/cdk/constants/version.ts","../../../projects/cdk/constants/taiga-ui-cdk-constants.ts"],"sourcesContent":["import {QueryList} from '@angular/core';\n\nconst rect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n x: 0,\n y: 0,\n} as const;\n\n/**\n * For type safety when using @ContentChildren and @ViewChildren\n *\n * NOTE: Be careful subscribing to 'changes'\n */\nexport const EMPTY_QUERY = new QueryList<any>();\nexport const EMPTY_ARRAY: [] = [];\nexport const EMPTY_FUNCTION: (...args: any[]) => void = () => {};\nexport const EMPTY_CLIENT_RECT: DOMRect = {\n ...rect,\n toJSON: () => rect,\n};\n","/**\n * Handler that always returns `false`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const TUI_FALSE_HANDLER = (): false => false;\n\n/**\n * Handler that always returns `true`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const TUI_TRUE_HANDLER = (): true => true;\n","import type {TuiHandler, TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\nfunction bothEmpty(item1: unknown, item2: unknown): boolean {\n return Array.isArray(item1) && Array.isArray(item2) && !item1.length && !item2.length;\n}\n\n/**\n * Default handler for matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_DEFAULT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = String,\n): boolean => stringify(item).toLowerCase().includes(search.toLowerCase());\n\n/**\n * Default handler for strict matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_STRICT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = String,\n): boolean => stringify(item).toLowerCase() === search.toLowerCase();\n\n/**\n * Default handler to match equality of two elements\n * ATTENTION: considers two empty arrays equal\n *\n * @param item1 first element\n * @param item2 second element\n */\nexport const TUI_DEFAULT_IDENTITY_MATCHER: TuiIdentityMatcher<unknown> = (item1, item2) =>\n item1 === item2 || bothEmpty(item1, item2);\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\n","export const svgNodeFilter: Exclude<NodeFilter, (node: Node) => number> = {\n acceptNode(node: Node): number {\n return 'ownerSVGElement' in node\n ? NodeFilter.FILTER_REJECT\n : NodeFilter.FILTER_ACCEPT;\n },\n};\n","/**\n * {@link https://unicode-table.com/en/00A0/ Non-breaking space}.\n */\nexport const CHAR_NO_BREAK_SPACE = '\\u00A0';\n\n/**\n * {@link https://unicode-table.com/en/2013/ EN dash}\n * is used to indicate a range of numbers or a span of time.\n * @example 2006–2022\n * ___\n * Don't confuse with {@link CHAR_EM_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EN_DASH = '\\u2013';\n\n/**\n * {@link https://unicode-table.com/en/2014/ EM dash}\n * is used to mark a break in a sentence.\n * @example Taiga UI — powerful set of open source components for Angular\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EM_DASH = '\\u2014';\n\n/**\n * {@link https://unicode-table.com/en/00AB/ Left-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_LAQUO = '\\u00AB';\n\n/**\n * {@link https://unicode-table.com/en/00BB/ Right-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_RAQUO = '\\u00BB';\n\n/**\n * {@link https://unicode-table.com/en/002D/ Hyphen (minus sign)}\n * is used to combine words.\n * @example well-behaved\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_EM_DASH}!\n */\nexport const CHAR_HYPHEN = '\\u002D';\n\n/**\n * {@link https://unicode-table.com/en/2212/ Minus}\n * is used as math operator symbol or before negative digits.\n * ---\n * Can be used as `−`. Don't confuse with {@link CHAR_HYPHEN}\n */\nexport const CHAR_MINUS = '\\u2212';\n\n/**\n * {@link https://unicode-table.com/en/002B/ Plus}\n */\nexport const CHAR_PLUS = '\\u002B';\n\n/**\n * {@link https://unicode-table.com/en/2022/ Bullet}.\n */\nexport const CHAR_BULLET = '\\u2022';\n\n/**\n * {@link https://unicode-table.com/en/2026/ Suspension points}.\n */\nexport const CHAR_ELLIPSIS = '\\u2026';\n\n/**\n * {@link https://unicode-table.com/en/00A4/ Suspension points}.\n */\nexport const CHAR_CURRENCY_SIGN = '\\u00A4';\n\n/**\n * {@link https://unicode-table.com/en/200b/ Suspension points}.\n */\nexport const CHAR_ZERO_WIDTH_SPACE = '\\u200B';\n","/**\n * @description:\n * AUTOGENERATED\n *\n * Array of icons used in taiga-ui components\n */\nexport const TUI_USED_ICONS = [\n '@tui.mir',\n '@tui.visa',\n '@tui.electron',\n '@tui.mastercard',\n '@tui.maestro',\n '@tui.amex',\n '@tui.diners-club',\n '@tui.discover',\n '@tui.humo',\n '@tui.jcb',\n '@tui.ru-pay',\n '@tui.union-pay',\n '@tui.uzcard',\n '@tui.verve',\n '@tui.search',\n '@tui.sun',\n '@tui.moon',\n '@tui.code',\n '@tui.menu',\n '@tui.copy',\n '@tui.check',\n '@tui.link',\n '@tui.eye-off',\n '@tui.eye',\n '@tui.grip-vertical',\n '@tui.chevron-up',\n '@tui.chevron-down',\n '@tui.chevrons-up-down',\n '@tui.info',\n '@tui.circle-check',\n '@tui.circle-x',\n '@tui.circle-alert',\n '@tui.circle-help',\n '@tui.x',\n '@tui.chevron-right',\n '@tui.chevron-left',\n '@tui.calendar',\n '@tui.minus',\n '@tui.file',\n '@tui.trash',\n '@tui.star',\n '@tui.rotate-ccw-square',\n '@tui.arrow-left',\n '@tui.arrow-right',\n '@tui.plus',\n '@tui.minimize',\n '@tui.clock',\n] as const;\n","export const TUI_VERSION = '4.0.0-rc.8';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@taiga-ui/cdk",
|
3
|
-
"version": "4.0.0-rc.
|
3
|
+
"version": "4.0.0-rc.8",
|
4
4
|
"description": "Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance",
|
5
5
|
"keywords": [
|
6
6
|
"angular",
|
@@ -55,8 +55,7 @@
|
|
55
55
|
"@taiga-ui/layout",
|
56
56
|
"@taiga-ui/experimental",
|
57
57
|
"@taiga-ui/proprietary",
|
58
|
-
"@taiga-ui/legacy"
|
59
|
-
"ng-morph"
|
58
|
+
"@taiga-ui/legacy"
|
60
59
|
]
|
61
60
|
},
|
62
61
|
"schematics": "./schematics/collection.json",
|
@@ -13,10 +13,9 @@ function replaceIdentifiers(options, constants) {
|
|
13
13
|
const progressLog = (0, progress_1.setupProgressLogger)({
|
14
14
|
total: constants.length,
|
15
15
|
});
|
16
|
-
constants.forEach((item
|
16
|
+
constants.forEach((item) => {
|
17
17
|
replaceIdentifier(item);
|
18
|
-
|
19
|
-
!options['skip-logs'] && progressLog(item.from.name, last);
|
18
|
+
!options['skip-logs'] && progressLog(item.from.name);
|
20
19
|
});
|
21
20
|
!options['skip-logs'] &&
|
22
21
|
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} identifiers replaced \n`);
|
@@ -34,6 +34,7 @@ function main(options) {
|
|
34
34
|
(0, steps_2.migrateDestroyService)(options);
|
35
35
|
(0, steps_2.migrateOptionProviders)(options);
|
36
36
|
(0, steps_2.migrateAllCountryIsoCodes)(options);
|
37
|
+
(0, steps_2.migrateAlertService)(options);
|
37
38
|
(0, ng_morph_1.saveActiveProject)();
|
38
39
|
(0, steps_2.migrateTemplates)(fileSystem, options);
|
39
40
|
(0, steps_1.showWarnings)(context, constants_1.MIGRATION_WARNINGS);
|
@@ -8,7 +8,7 @@ function renameProprietaryIcons(pattern = constants_1.ALL_FILES) {
|
|
8
8
|
const sourceFiles = (0, ng_morph_1.getSourceFiles)(pattern);
|
9
9
|
sourceFiles.forEach((file) => {
|
10
10
|
let text = file.getFullText();
|
11
|
-
const regex =
|
11
|
+
const regex = /['"`]tuiIcon(?!Button\b)[A-Z][a-zA-Z0-9]*\b/g;
|
12
12
|
text = text.replaceAll(regex, (match) => convertString(match));
|
13
13
|
file.replaceWithText(text);
|
14
14
|
});
|
@@ -16,7 +16,7 @@ function renameProprietaryIcons(pattern = constants_1.ALL_FILES) {
|
|
16
16
|
exports.renameProprietaryIcons = renameProprietaryIcons;
|
17
17
|
function convertString(input) {
|
18
18
|
const result = input
|
19
|
-
.replace(
|
19
|
+
.replace(/['"`]tuiIconTds/, '')
|
20
20
|
.replace(/SmallPragmatic$/, '')
|
21
21
|
.replace(/MediumPragmatic$/, '')
|
22
22
|
.replace(/Small$/, '')
|
@@ -30,7 +30,7 @@ function convertString(input) {
|
|
30
30
|
.toLowerCase();
|
31
31
|
const pack = extractPackName(input);
|
32
32
|
const subfolder = extractSubfolder(input);
|
33
|
-
return
|
33
|
+
return `${input.slice(0, 1)}@tui.${pack}${subfolder ? `.${subfolder}` : ''}.${result.startsWith('-') ? result.slice(1) : result}`;
|
34
34
|
}
|
35
35
|
function extractPackName(input) {
|
36
36
|
if (input.endsWith('Pragmatic')) {
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.ATTRS_TO_REPLACE = void 0;
|
4
4
|
const elements_1 = require("../../../../utils/templates/elements");
|
5
|
+
const inputs_1 = require("../../../../utils/templates/inputs");
|
5
6
|
exports.ATTRS_TO_REPLACE = [
|
6
7
|
{
|
7
8
|
from: {
|
@@ -59,6 +60,13 @@ exports.ATTRS_TO_REPLACE = [
|
|
59
60
|
},
|
60
61
|
to: { attrName: '[value]' },
|
61
62
|
},
|
63
|
+
{
|
64
|
+
from: {
|
65
|
+
attrName: '(removed)',
|
66
|
+
withTagNames: ['tui-file'],
|
67
|
+
},
|
68
|
+
to: { attrName: '(remove)' },
|
69
|
+
},
|
62
70
|
{
|
63
71
|
from: {
|
64
72
|
attrName: '[rounded]',
|
@@ -213,8 +221,7 @@ exports.ATTRS_TO_REPLACE = [
|
|
213
221
|
filterFn: (element) => {
|
214
222
|
var _a;
|
215
223
|
return !(0, elements_1.hasElementAttribute)(element, 'iconAlign') ||
|
216
|
-
((_a = element.attrs
|
217
|
-
'right';
|
224
|
+
((_a = (0, inputs_1.findAttr)(element.attrs, 'iconAlign')) === null || _a === void 0 ? void 0 : _a.value) === 'right';
|
218
225
|
},
|
219
226
|
},
|
220
227
|
to: { attrName: 'iconEnd' },
|
@@ -223,7 +230,7 @@ exports.ATTRS_TO_REPLACE = [
|
|
223
230
|
from: {
|
224
231
|
attrName: 'icon',
|
225
232
|
withAttrsNames: ['tuiLink'],
|
226
|
-
filterFn: (element) => { var _a; return ((_a = element.attrs
|
233
|
+
filterFn: (element) => { var _a; return ((_a = (0, inputs_1.findAttr)(element.attrs, 'iconAlign')) === null || _a === void 0 ? void 0 : _a.value) === 'left'; },
|
227
234
|
},
|
228
235
|
to: { attrName: 'iconStart' },
|
229
236
|
},
|
@@ -241,4 +248,20 @@ exports.ATTRS_TO_REPLACE = [
|
|
241
248
|
},
|
242
249
|
to: { attrName: 'tuiTextfieldLegacy' },
|
243
250
|
},
|
251
|
+
{
|
252
|
+
from: {
|
253
|
+
attrName: 'status',
|
254
|
+
withTagNames: ['tui-notification'],
|
255
|
+
withAttrsNames: ['tuiNotification'],
|
256
|
+
},
|
257
|
+
to: { attrName: 'appearance' },
|
258
|
+
},
|
259
|
+
{
|
260
|
+
from: {
|
261
|
+
attrName: '[status]',
|
262
|
+
withTagNames: ['tui-notification'],
|
263
|
+
withAttrsNames: ['tuiNotification'],
|
264
|
+
},
|
265
|
+
to: { attrName: '[appearance]' },
|
266
|
+
},
|
244
267
|
];
|
@@ -47,4 +47,9 @@ exports.HTML_COMMENTS = [
|
|
47
47
|
withAttrs: [],
|
48
48
|
comment: 'TuiThemeNight has been removed. Please use tuiTheme attribute to set theme https://taiga-ui.dev/directives/theme',
|
49
49
|
},
|
50
|
+
{
|
51
|
+
tag: 'tui-input-files',
|
52
|
+
withAttrs: [],
|
53
|
+
comment: 'Native input inside is now required and the wrapper has changed from <tui-input-files to <label tuiInputFiles, control moved to native input. See interactive example https://taiga-ui.dev/components/input-files',
|
54
|
+
},
|
50
55
|
];
|
@@ -86,10 +86,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
86
86
|
from: { name: 'TuiNotificationModule', moduleSpecifier: '@taiga-ui/core' },
|
87
87
|
to: { name: 'TuiNotification', moduleSpecifier: '@taiga-ui/core' },
|
88
88
|
},
|
89
|
-
{
|
90
|
-
from: { name: 'TuiNotificationT', moduleSpecifier: '@taiga-ui/core' },
|
91
|
-
to: { name: 'TuiNotificationStatus', moduleSpecifier: '@taiga-ui/core' },
|
92
|
-
},
|
93
89
|
{
|
94
90
|
from: { name: 'TuiFormatPhonePipe', moduleSpecifier: '@taiga-ui/core' },
|
95
91
|
to: { name: 'TuiFormatPhonePipe', moduleSpecifier: '@taiga-ui/legacy' },
|
@@ -236,6 +232,10 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
236
232
|
from: { name: 'TuiLineClampModule', moduleSpecifier: '@taiga-ui/kit' },
|
237
233
|
to: { name: 'TuiLineClamp', moduleSpecifier: '@taiga-ui/kit' },
|
238
234
|
},
|
235
|
+
{
|
236
|
+
from: { name: 'TuiLineClampComponent', moduleSpecifier: '@taiga-ui/kit' },
|
237
|
+
to: { name: 'TuiLineClamp', moduleSpecifier: '@taiga-ui/kit' },
|
238
|
+
},
|
239
239
|
{
|
240
240
|
from: { name: 'TuiRangeModule', moduleSpecifier: '@taiga-ui/kit' },
|
241
241
|
to: { name: 'TuiRange', moduleSpecifier: '@taiga-ui/kit' },
|
@@ -792,15 +792,12 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
792
792
|
to: { name: 'TuiLink', moduleSpecifier: '@taiga-ui/core' },
|
793
793
|
},
|
794
794
|
{
|
795
|
-
from: { name: '
|
796
|
-
to: { name: '
|
795
|
+
from: { name: 'TuiLinkComponent', moduleSpecifier: '@taiga-ui/core' },
|
796
|
+
to: { name: 'TuiLink', moduleSpecifier: '@taiga-ui/core' },
|
797
797
|
},
|
798
798
|
{
|
799
|
-
from: { name: '
|
800
|
-
to: {
|
801
|
-
name: 'TuiButton',
|
802
|
-
moduleSpecifier: '@taiga-ui/core',
|
803
|
-
},
|
799
|
+
from: { name: 'TuiInteractiveStateT', moduleSpecifier: '@taiga-ui/core' },
|
800
|
+
to: { name: 'TuiInteractiveState', moduleSpecifier: '@taiga-ui/core' },
|
804
801
|
},
|
805
802
|
{
|
806
803
|
from: { name: 'TUI_ARROW', moduleSpecifier: '@taiga-ui/kit' },
|
@@ -816,6 +813,20 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
816
813
|
moduleSpecifier: '@taiga-ui/legacy',
|
817
814
|
},
|
818
815
|
},
|
816
|
+
{
|
817
|
+
from: { name: 'TuiDialog', moduleSpecifier: '@taiga-ui/cdk' },
|
818
|
+
to: {
|
819
|
+
name: 'TuiPopover',
|
820
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
821
|
+
},
|
822
|
+
},
|
823
|
+
{
|
824
|
+
from: { name: 'TuiBaseDialogContext', moduleSpecifier: '@taiga-ui/cdk' },
|
825
|
+
to: {
|
826
|
+
name: 'TuiPopoverContext',
|
827
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
828
|
+
},
|
829
|
+
},
|
819
830
|
{
|
820
831
|
from: { name: 'TuiDialogModule', moduleSpecifier: '@taiga-ui/core' },
|
821
832
|
to: {
|
@@ -823,6 +834,20 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
823
834
|
moduleSpecifier: '@taiga-ui/core',
|
824
835
|
},
|
825
836
|
},
|
837
|
+
{
|
838
|
+
from: { name: 'TuiButtonModule', moduleSpecifier: '@taiga-ui/core' },
|
839
|
+
to: {
|
840
|
+
name: 'TuiButton',
|
841
|
+
moduleSpecifier: '@taiga-ui/core',
|
842
|
+
},
|
843
|
+
},
|
844
|
+
{
|
845
|
+
from: { name: 'TuiButtonComponent', moduleSpecifier: '@taiga-ui/core' },
|
846
|
+
to: {
|
847
|
+
name: 'TuiButton',
|
848
|
+
moduleSpecifier: '@taiga-ui/core',
|
849
|
+
},
|
850
|
+
},
|
826
851
|
{
|
827
852
|
from: { name: 'TuiButtonModule', moduleSpecifier: '@taiga-ui/experimental' },
|
828
853
|
to: {
|
@@ -1015,16 +1040,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1015
1040
|
moduleSpecifier: '@taiga-ui/proprietary',
|
1016
1041
|
},
|
1017
1042
|
},
|
1018
|
-
{
|
1019
|
-
from: {
|
1020
|
-
name: 'TuiIllustrationsModule',
|
1021
|
-
moduleSpecifier: '@taiga-ui/proprietary-icons',
|
1022
|
-
},
|
1023
|
-
to: {
|
1024
|
-
name: 'TuiIllustrationModePipe',
|
1025
|
-
moduleSpecifier: '@taiga-ui/proprietary',
|
1026
|
-
},
|
1027
|
-
},
|
1028
1043
|
{
|
1029
1044
|
from: {
|
1030
1045
|
name: 'ProductsNavigationModule',
|
@@ -1391,8 +1406,9 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1391
1406
|
moduleSpecifier: '@taiga-ui/kit',
|
1392
1407
|
},
|
1393
1408
|
to: {
|
1394
|
-
name: '
|
1409
|
+
name: 'TuiFiles',
|
1395
1410
|
moduleSpecifier: '@taiga-ui/kit',
|
1411
|
+
spreadInModule: true,
|
1396
1412
|
},
|
1397
1413
|
},
|
1398
1414
|
{
|
@@ -1473,6 +1489,7 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1473
1489
|
to: {
|
1474
1490
|
name: 'TuiProprietaryNavigation',
|
1475
1491
|
moduleSpecifier: '@taiga-ui/proprietary',
|
1492
|
+
spreadInModule: true,
|
1476
1493
|
},
|
1477
1494
|
},
|
1478
1495
|
{
|
@@ -1845,6 +1862,16 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1845
1862
|
moduleSpecifier: '@taiga-ui/legacy',
|
1846
1863
|
},
|
1847
1864
|
},
|
1865
|
+
{
|
1866
|
+
from: {
|
1867
|
+
name: 'TuiInputComponent',
|
1868
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1869
|
+
},
|
1870
|
+
to: {
|
1871
|
+
name: 'TuiInputComponent',
|
1872
|
+
moduleSpecifier: '@taiga-ui/legacy',
|
1873
|
+
},
|
1874
|
+
},
|
1848
1875
|
{
|
1849
1876
|
from: {
|
1850
1877
|
name: 'TuiInputCopyModule',
|
@@ -2495,6 +2522,16 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
2495
2522
|
moduleSpecifier: '@taiga-ui/core',
|
2496
2523
|
},
|
2497
2524
|
},
|
2525
|
+
{
|
2526
|
+
from: {
|
2527
|
+
name: 'TuiLabelComponent',
|
2528
|
+
moduleSpecifier: '@taiga-ui/core',
|
2529
|
+
},
|
2530
|
+
to: {
|
2531
|
+
name: 'TuiLabel',
|
2532
|
+
moduleSpecifier: '@taiga-ui/core',
|
2533
|
+
},
|
2534
|
+
},
|
2498
2535
|
{
|
2499
2536
|
from: {
|
2500
2537
|
name: 'ResizeObserverModule',
|
@@ -2601,4 +2638,8 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
2601
2638
|
from: { name: 'ANIMATION_FRAME', moduleSpecifier: '@ng-web-apis/common' },
|
2602
2639
|
to: { name: 'WA_ANIMATION_FRAME', moduleSpecifier: '@ng-web-apis/common' },
|
2603
2640
|
},
|
2641
|
+
{
|
2642
|
+
from: { name: 'MaskitoModule', moduleSpecifier: '@maskito/angular' },
|
2643
|
+
to: { name: 'MaskitoDirective', moduleSpecifier: '@maskito/angular' },
|
2644
|
+
},
|
2604
2645
|
];
|
@@ -7,6 +7,7 @@ exports.INPUTS_TO_REMOVE = [
|
|
7
7
|
{ inputName: 'showLoader', tags: ['tui-toggle'] },
|
8
8
|
{ inputName: 'singleColor', tags: ['tui-toggle'] },
|
9
9
|
{ inputName: 'hoverable', tags: ['tui-badge'] },
|
10
|
+
{ inputName: 'singleColor', tags: ['tui-money'] },
|
10
11
|
{
|
11
12
|
inputName: 'iconAlign',
|
12
13
|
tags: ['button', 'a'],
|
@@ -147,4 +147,14 @@ exports.MIGRATION_WARNINGS = [
|
|
147
147
|
moduleSpecifier: '@taiga-ui/kit',
|
148
148
|
message: 'TUI_ARROW is deprecated, Use tuiChevron directive instead. See example https://taiga-ui.dev/components/data-list#links',
|
149
149
|
},
|
150
|
+
{
|
151
|
+
name: 'TuiMoneyComponent',
|
152
|
+
moduleSpecifier: '@taiga-ui/addon-commerce',
|
153
|
+
message: 'TuiMoneyComponent is deprecated, Use tuiAmount pipe instead. See example https://taiga-ui.dev/pipes/amount',
|
154
|
+
},
|
155
|
+
{
|
156
|
+
name: 'TuiIllustrationsModule',
|
157
|
+
moduleSpecifier: '@taiga-ui/proprietary-icons',
|
158
|
+
message: 'Import TuiIconPipe and use <img [src]="icon | tuiIcon" /> instead. See https://taiga-ui.tcsbank.ru/icons',
|
159
|
+
},
|
150
160
|
];
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TAGS_TO_REPLACE = void 0;
|
4
|
+
const elements_1 = require("../../../../utils/templates/elements");
|
4
5
|
exports.TAGS_TO_REPLACE = [
|
5
6
|
{ from: 'tui-card', to: 'tui-thumbnail-card' },
|
6
7
|
{ from: 'tui-text-area', to: 'tui-textarea' },
|
@@ -9,13 +10,13 @@ exports.TAGS_TO_REPLACE = [
|
|
9
10
|
from: 'tui-input-count',
|
10
11
|
to: 'tui-input-number',
|
11
12
|
addAttributes: ['decimal="never"'],
|
12
|
-
filterFn: (element) =>
|
13
|
+
filterFn: (element) => (0, elements_1.hasElementAttribute)(element, 'step'),
|
13
14
|
},
|
14
15
|
{
|
15
16
|
from: 'tui-input-count',
|
16
17
|
to: 'tui-input-number',
|
17
18
|
addAttributes: ['decimal="never"', '[step]="1"'],
|
18
|
-
filterFn: (element) =>
|
19
|
+
filterFn: (element) => !(0, elements_1.hasElementAttribute)(element, 'step'),
|
19
20
|
},
|
20
21
|
{
|
21
22
|
from: 'tui-money',
|
@@ -17,4 +17,21 @@ exports.TYPES_TO_RENAME = [
|
|
17
17
|
moduleSpecifier: ['@taiga-ui/core'],
|
18
18
|
removeImport: true,
|
19
19
|
},
|
20
|
+
{
|
21
|
+
from: 'TuiIllustrationName',
|
22
|
+
moduleSpecifier: ['@taiga-ui/proprietary-icons'],
|
23
|
+
to: 'string',
|
24
|
+
removeImport: true,
|
25
|
+
},
|
26
|
+
{
|
27
|
+
from: 'TuiNotificationT',
|
28
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
29
|
+
to: 'string',
|
30
|
+
removeImport: true,
|
31
|
+
},
|
32
|
+
{
|
33
|
+
from: 'TuiOperationIcon',
|
34
|
+
moduleSpecifier: ['@taiga-ui/proprietary-banking'],
|
35
|
+
to: 'TuiFeedItemIcon',
|
36
|
+
},
|
20
37
|
];
|
@@ -1,10 +1,11 @@
|
|
1
|
+
export * from './migrate-alert-service';
|
1
2
|
export * from './migrate-all-country-iso-codes';
|
2
3
|
export * from './migrate-destroy-service';
|
3
4
|
export * from './migrate-legacy-mask';
|
4
5
|
export * from './migrate-option-providers';
|
5
6
|
export * from './migrate-proprietary';
|
6
|
-
export * from './migrate-styles';
|
7
7
|
export * from './migrate-templates';
|
8
8
|
export * from './restore-tui-mapper';
|
9
9
|
export * from './restore-tui-matcher';
|
10
|
+
export * from './styles';
|
10
11
|
export * from './update-packages';
|
@@ -1,13 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./migrate-alert-service"), exports);
|
4
5
|
tslib_1.__exportStar(require("./migrate-all-country-iso-codes"), exports);
|
5
6
|
tslib_1.__exportStar(require("./migrate-destroy-service"), exports);
|
6
7
|
tslib_1.__exportStar(require("./migrate-legacy-mask"), exports);
|
7
8
|
tslib_1.__exportStar(require("./migrate-option-providers"), exports);
|
8
9
|
tslib_1.__exportStar(require("./migrate-proprietary"), exports);
|
9
|
-
tslib_1.__exportStar(require("./migrate-styles"), exports);
|
10
10
|
tslib_1.__exportStar(require("./migrate-templates"), exports);
|
11
11
|
tslib_1.__exportStar(require("./restore-tui-mapper"), exports);
|
12
12
|
tslib_1.__exportStar(require("./restore-tui-matcher"), exports);
|
13
|
+
tslib_1.__exportStar(require("./styles"), exports);
|
13
14
|
tslib_1.__exportStar(require("./update-packages"), exports);
|
@@ -0,0 +1,88 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateAlertService = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const colored_log_1 = require("../../../utils/colored-log");
|
6
|
+
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
|
+
const OPTIONS_MIGRATIONS = {
|
8
|
+
autoClose: (property) => {
|
9
|
+
const [propertyKey, propertyValue] = property.getText().split(/\s?:\s?/);
|
10
|
+
switch (propertyValue) {
|
11
|
+
case 'true':
|
12
|
+
return property.replaceWithText(`${propertyKey}: 3_000`);
|
13
|
+
case 'false':
|
14
|
+
return property.replaceWithText(`${propertyKey}: 0`);
|
15
|
+
default:
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
},
|
19
|
+
defaultAutoCloseTime: (property) => property.replaceWithText(property.getText().replace('defaultAutoCloseTime', 'autoClose')),
|
20
|
+
status: (property) => property.replaceWithText(property.getText().replace('status', 'appearance')),
|
21
|
+
hasCloseButton: (property) => property.replaceWithText(property.getText().replace('hasCloseButton', 'closeable')),
|
22
|
+
hasIcon: (property) => {
|
23
|
+
const [, propertyValue] = property.getText().split(/\s?:\s?/);
|
24
|
+
switch (propertyValue) {
|
25
|
+
case 'false':
|
26
|
+
return property.replaceWithText("icon: ''");
|
27
|
+
case 'true':
|
28
|
+
return property.remove();
|
29
|
+
default:
|
30
|
+
return property.replaceWithText(`// TODO: (Taiga UI migration) "hasIcon" is deleted. Use "icon: ''" to hide icon. Use "icon: TUI_NOTIFICATION_DEFAULT_OPTIONS['icon']" to show it.\n${property.getText()}`);
|
31
|
+
}
|
32
|
+
},
|
33
|
+
};
|
34
|
+
function migrateAlertService(options) {
|
35
|
+
!options['skip-logs'] &&
|
36
|
+
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing inject(TuiAlertService).open({autoClose: boolean})...`);
|
37
|
+
const alertServiceRefs = (0, get_named_import_references_1.getNamedImportReferences)('TuiAlertService', '@taiga-ui/core');
|
38
|
+
// inject(TuiAlertService).open(...)
|
39
|
+
const viaDirectInjects = alertServiceRefs.map((x) => x.getFirstAncestor((node) => node.isKind(ng_morph_1.SyntaxKind.CallExpression) &&
|
40
|
+
node.getFullText().includes('inject(TuiAlertService') &&
|
41
|
+
node.getFullText().includes('.open(')));
|
42
|
+
// readonly alertService = inject(TuiAlertService);
|
43
|
+
const viaClassProperty = alertServiceRefs
|
44
|
+
.map((x) => {
|
45
|
+
var _a;
|
46
|
+
return (_a = x
|
47
|
+
.getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyDeclaration)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes();
|
48
|
+
})
|
49
|
+
.flat()
|
50
|
+
.map(toAlertServiceOpenCallExpression);
|
51
|
+
// constructor(private readonly legacyWayService: TuiAlertService) {}
|
52
|
+
const viaConstructorParam = alertServiceRefs
|
53
|
+
.map((x) => { var _a; return (_a = x.getFirstAncestorByKind(ng_morph_1.SyntaxKind.Parameter)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes(); })
|
54
|
+
.flat()
|
55
|
+
.map(toAlertServiceOpenCallExpression);
|
56
|
+
[...viaDirectInjects, ...viaClassProperty, ...viaConstructorParam].forEach((callExpression) => {
|
57
|
+
if (!callExpression || callExpression.wasForgotten()) {
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
const [, arg] = callExpression.getArguments();
|
61
|
+
const options = (arg === null || arg === void 0 ? void 0 : arg.isKind(ng_morph_1.SyntaxKind.PropertyAccessExpression))
|
62
|
+
? findOptionsInitializer(arg)
|
63
|
+
: arg;
|
64
|
+
if (!(options === null || options === void 0 ? void 0 : options.isKind(ng_morph_1.SyntaxKind.ObjectLiteralExpression))) {
|
65
|
+
return;
|
66
|
+
}
|
67
|
+
Object.entries(OPTIONS_MIGRATIONS).forEach(([propertyName, migration]) => {
|
68
|
+
const property = options.getProperty(propertyName);
|
69
|
+
if (property) {
|
70
|
+
migration(property);
|
71
|
+
}
|
72
|
+
});
|
73
|
+
});
|
74
|
+
!options['skip-logs'] &&
|
75
|
+
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} "true => 3_000" & "false => 0" were replaced \n`);
|
76
|
+
}
|
77
|
+
exports.migrateAlertService = migrateAlertService;
|
78
|
+
function toAlertServiceOpenCallExpression(node) {
|
79
|
+
return node === null || node === void 0 ? void 0 : node.getFirstAncestor((x) => x.isKind(ng_morph_1.SyntaxKind.CallExpression) && x.getFullText().includes('.open('));
|
80
|
+
}
|
81
|
+
function findOptionsInitializer(ref) {
|
82
|
+
var _a;
|
83
|
+
return (_a = ref === null || ref === void 0 ? void 0 : ref.getFirstChildByKind(ng_morph_1.SyntaxKind.Identifier)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes().map((n) => {
|
84
|
+
var _a;
|
85
|
+
return (_a = n
|
86
|
+
.getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyDeclaration)) === null || _a === void 0 ? void 0 : _a.getFirstChildByKind(ng_morph_1.SyntaxKind.ObjectLiteralExpression);
|
87
|
+
}).find(Boolean);
|
88
|
+
}
|
@@ -11,6 +11,7 @@ const replace_attrs_by_directives_1 = require("../../utils/templates/replace-att
|
|
11
11
|
const constants_2 = require("./constants");
|
12
12
|
const templates_2 = require("./templates");
|
13
13
|
const migrate_blocked_1 = require("./templates/migrate-blocked");
|
14
|
+
const migrate_number_precision_1 = require("./templates/migrate-number-precision");
|
14
15
|
function getAction({ action, requiredData, }) {
|
15
16
|
return ({ resource, fileSystem, recorder, }) => action({ resource, fileSystem, recorder, data: requiredData });
|
16
17
|
}
|
@@ -28,6 +29,7 @@ function migrateTemplates(fileSystem, options) {
|
|
28
29
|
getAction({ action: templates_1.replaceAttrs, requiredData: constants_2.ATTRS_TO_REPLACE }),
|
29
30
|
getAction({ action: templates_1.replaceAttrValues, requiredData: constants_2.ATTR_WITH_VALUES_TO_REPLACE }),
|
30
31
|
getAction({ action: templates_1.removeInputs, requiredData: constants_2.INPUTS_TO_REMOVE }),
|
32
|
+
templates_2.migrateAxes,
|
31
33
|
templates_2.migrateBadge,
|
32
34
|
templates_2.migrateCheckbox,
|
33
35
|
templates_2.migrateFocusable,
|
@@ -37,6 +39,7 @@ function migrateTemplates(fileSystem, options) {
|
|
37
39
|
templates_2.migrateExpandable,
|
38
40
|
templates_2.migrateBadgedContent,
|
39
41
|
templates_2.migratePreventDefault,
|
42
|
+
templates_2.migrateMobileTabs,
|
40
43
|
templates_2.migrateMoney,
|
41
44
|
templates_2.migrateLabeled,
|
42
45
|
migrate_blocked_1.migrateBlocked,
|
@@ -45,6 +48,8 @@ function migrateTemplates(fileSystem, options) {
|
|
45
48
|
templates_2.migrateOverscroll,
|
46
49
|
templates_2.migrateButtonAppearance,
|
47
50
|
templates_2.migrateLabel,
|
51
|
+
migrate_number_precision_1.migrateNumberPrecision,
|
52
|
+
templates_2.migrateNotification,
|
48
53
|
];
|
49
54
|
const progressLog = (0, progress_1.setupProgressLogger)({
|
50
55
|
total: componentWithTemplatesPaths.length,
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateStyles = exports.TUI_RATING_WARNING = void 0;
|
4
4
|
/// <reference lib="es2021" />
|
5
5
|
const ng_morph_1 = require("ng-morph");
|
6
|
+
const migrate_space_mixins_1 = require("./migrate-space-mixins");
|
6
7
|
exports.TUI_RATING_WARNING = '// TODO: (Taiga UI migration): use css to customize rating gap and size. See https://taiga-ui.dev/components/rating#basic';
|
7
8
|
function migrateStyles() {
|
8
9
|
var _a;
|
@@ -19,6 +20,7 @@ function migrateStyles() {
|
|
19
20
|
.replaceAll('@taiga-ui/proprietary-core/styles/theme-tinkoff-mobile-2023', '@taiga-ui/proprietary/styles/tbank-theme-mobile.less')
|
20
21
|
.replaceAll('@taiga-ui/proprietary-core/styles/theme-tinkoff-mobile', '@taiga-ui/proprietary/styles/tbank-theme-mobile.less')
|
21
22
|
.replaceAll('@taiga-ui/proprietary-core/styles/theme-tinkoff', '@taiga-ui/proprietary/styles/tbank-theme');
|
23
|
+
fullText = (0, migrate_space_mixins_1.migrateSpaceMixins)(fullText);
|
22
24
|
sourceFile.replaceWithText(fullText);
|
23
25
|
});
|
24
26
|
(0, ng_morph_1.saveActiveProject)();
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function migrateSpaceMixins(fileContent: string): string;
|