@taiga-ui/cdk 4.0.0-rc.4 → 4.0.0-rc.5

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.
@@ -1 +1 @@
1
- export declare const TUI_VERSION = "4.0.0-rc.4";
1
+ export declare const TUI_VERSION = "4.0.0-rc.5";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TUI_VERSION = void 0;
4
- exports.TUI_VERSION = '4.0.0-rc.4';
4
+ exports.TUI_VERSION = '4.0.0-rc.5';
@@ -1,2 +1,2 @@
1
- export const TUI_VERSION = '4.0.0-rc.4';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2Nkay9jb25zdGFudHMvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxXQUFXLEdBQUcsWUFBWSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IFRVSV9WRVJTSU9OID0gJzQuMC4wLXJjLjQnO1xuIl19
1
+ export const TUI_VERSION = '4.0.0-rc.5';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2Nkay9jb25zdGFudHMvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxXQUFXLEdBQUcsWUFBWSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IFRVSV9WRVJTSU9OID0gJzQuMC4wLXJjLjUnO1xuIl19
@@ -192,7 +192,7 @@ const TUI_USED_ICONS = [
192
192
  '@tui.clock',
193
193
  ];
194
194
 
195
- const TUI_VERSION = '4.0.0-rc.4';
195
+ const TUI_VERSION = '4.0.0-rc.5';
196
196
 
197
197
  /**
198
198
  * Generated bundle index. Do not edit.
@@ -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 `&minus;`. 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.4';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
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 `&minus;`. 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.5';\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.4",
3
+ "version": "4.0.0-rc.5",
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",
@@ -14,9 +14,10 @@ export interface ReplacementIdentifierMulti extends Pick<ReplacementIdentifier,
14
14
  readonly moduleSpecifier: string;
15
15
  readonly name: string;
16
16
  readonly namedImport?: string;
17
+ readonly spreadInModule?: boolean;
17
18
  }> | {
18
19
  readonly moduleSpecifier: string;
19
20
  readonly name: string;
20
- readonly namedImport?: string;
21
+ readonly spreadInModule?: boolean;
21
22
  };
22
23
  }
@@ -17,6 +17,7 @@ exports.replaceIdentifiers = replaceIdentifiers;
17
17
  function replaceIdentifier({ from, to }) {
18
18
  const references = (0, get_named_import_references_1.getNamedImportReferences)(from.name, from.moduleSpecifier);
19
19
  references.forEach((ref) => {
20
+ var _a;
20
21
  if (ref.wasForgotten()) {
21
22
  return;
22
23
  }
@@ -26,7 +27,10 @@ function replaceIdentifier({ from, to }) {
26
27
  addImports(to, parent.getSourceFile().getFilePath());
27
28
  }
28
29
  else {
29
- ref === null || ref === void 0 ? void 0 : ref.replaceWithText(Array.isArray(to) ? to.map(({ name }) => name).join(', ') : to.name);
30
+ const decorator = ref.getParentWhile((node) => node.getKindName() !== 'Decorator');
31
+ const inModule = ((_a = decorator === null || decorator === void 0 ? void 0 : decorator.getFirstChildIfKind(ng_morph_1.ts.SyntaxKind.Identifier)) === null || _a === void 0 ? void 0 : _a.getText()) ===
32
+ 'NgModule';
33
+ ref.replaceWithText(getReplacementText(to, !!inModule));
30
34
  }
31
35
  });
32
36
  }
@@ -36,5 +40,11 @@ function addImports(identifier, filePath) {
36
40
  ? identifier.forEach(({ name, namedImport, moduleSpecifier }) => {
37
41
  (0, add_unique_import_1.addUniqueImport)(filePath, namedImport || name, moduleSpecifier);
38
42
  })
39
- : (0, add_unique_import_1.addUniqueImport)(filePath, identifier.namedImport || identifier.name, identifier.moduleSpecifier);
43
+ : (0, add_unique_import_1.addUniqueImport)(filePath, identifier.name, identifier.moduleSpecifier);
44
+ }
45
+ function getReplacementText(to, inModule) {
46
+ const res = Array.isArray(to) ? to : [to];
47
+ return res
48
+ .map(({ name, spreadInModule }) => spreadInModule && inModule ? `...${name}` : name)
49
+ .join(', ');
40
50
  }
@@ -9,16 +9,21 @@ 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 steps_1 = require("../steps");
12
+ const replace_services_1 = require("../steps/replace-services");
12
13
  const get_file_system_1 = require("../utils/get-file-system");
13
14
  const enums_1 = require("../v4/steps/constants/enums");
14
15
  const steps_2 = require("./steps");
15
16
  const constants_1 = require("./steps/constants");
16
17
  const modules_to_replace_1 = require("./steps/constants/modules-to-replace");
17
18
  const types_1 = require("./steps/constants/types");
19
+ const migrate_root_1 = require("./steps/migrate-root");
18
20
  const replace_modules_with_providers_1 = require("./steps/utils/replace-modules-with-providers");
19
21
  function main(options) {
20
22
  return (tree, context) => {
21
23
  const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
24
+ (0, steps_1.replaceEnums)(options, enums_1.ENUMS_TO_REPLACE);
25
+ (0, migrate_root_1.migrateRoot)(fileSystem, options);
26
+ (0, replace_services_1.replaceServices)(options, constants_1.SERVICES_TO_REPLACE);
22
27
  (0, steps_1.replaceIdentifiers)(options, constants_1.IDENTIFIERS_TO_REPLACE);
23
28
  (0, steps_1.removeModules)(options, constants_1.MODULES_TO_REMOVE);
24
29
  (0, replace_modules_with_providers_1.replaceModulesWithProviders)(options, modules_to_replace_1.MODULES_TO_REPLACE_WITH_PROVIDERS);
@@ -29,7 +34,6 @@ function main(options) {
29
34
  (0, steps_2.migrateDestroyService)(options);
30
35
  (0, steps_2.migrateOptionProviders)(options);
31
36
  (0, steps_2.migrateAllCountryIsoCodes)(options);
32
- (0, steps_1.replaceEnums)(options, enums_1.ENUMS_TO_REPLACE);
33
37
  (0, steps_2.migrateTemplates)(fileSystem, options);
34
38
  (0, steps_1.showWarnings)(context, constants_1.MIGRATION_WARNINGS);
35
39
  fileSystem.commitEdits();
@@ -17,6 +17,14 @@ const CHANGED_ICONS = [
17
17
  { from: 'tuiIconDragLarge', to: ' @tui.grip-vertical' },
18
18
  { from: 'tuiIconGrid', to: '@tui.layout-grid' },
19
19
  { from: 'tuiIconGridLarge', to: '@tui.layout-grid' },
20
+ { from: 'tuiIconTool', to: '@tui.wrench' },
21
+ { from: 'tuiIconUnlock', to: '@tui.lock-open' },
22
+ { from: 'tuiIconMessageCircle', to: '@tui.message-circle' },
23
+ { from: 'tuiIconSliders', to: '@tui.sliders-vertical' },
24
+ { from: 'tuiIconPlusSquare', to: '@tui.square-plus' },
25
+ { from: 'tuiIconAlertTriangle', to: '@tui.triangle-alert' },
26
+ { from: 'tuiIconUploadCloud', to: '@tui.cloud-upload' },
27
+ { from: 'tuiIconDownloadCloud', to: '@tui.cloud-download' },
20
28
  ];
21
29
  function renameIcons(pattern = constants_1.ALL_FILES) {
22
30
  const sourceFiles = (0, ng_morph_1.getSourceFiles)(pattern);
@@ -254,10 +254,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
254
254
  from: { name: 'TuiUnmaskHandlerModule', moduleSpecifier: '@taiga-ui/kit' },
255
255
  to: { name: 'TuiUnmaskHandler', moduleSpecifier: '@taiga-ui/kit' },
256
256
  },
257
- {
258
- from: { name: 'TuiDialogFormService', moduleSpecifier: '@taiga-ui/kit' },
259
- to: { name: 'TuiConfirmService', moduleSpecifier: '@taiga-ui/kit' },
260
- },
261
257
  {
262
258
  from: { name: 'TuiSortCountriesPipeModule', moduleSpecifier: '@taiga-ui/kit' },
263
259
  to: { name: 'TuiSortCountriesPipe', moduleSpecifier: '@taiga-ui/kit' },
@@ -359,6 +355,10 @@ exports.IDENTIFIERS_TO_REPLACE = [
359
355
  from: { name: 'TuiCheckboxModule', moduleSpecifier: '@taiga-ui/experimental' },
360
356
  to: { name: 'TuiCheckbox', moduleSpecifier: '@taiga-ui/kit' },
361
357
  },
358
+ {
359
+ from: { name: 'TuiCheckboxModule', moduleSpecifier: '@taiga-ui/kit' },
360
+ to: { name: 'TuiCheckbox', moduleSpecifier: '@taiga-ui/kit' },
361
+ },
362
362
  {
363
363
  from: { name: 'TuiSwipeActionsModule', moduleSpecifier: '@taiga-ui/experimental' },
364
364
  to: [
@@ -372,7 +372,7 @@ exports.IDENTIFIERS_TO_REPLACE = [
372
372
  },
373
373
  {
374
374
  from: { name: 'TuiAvatarModule', moduleSpecifier: '@taiga-ui/experimental' },
375
- to: { name: 'TuiAvatarModule', moduleSpecifier: '@taiga-ui/kit' },
375
+ to: { name: 'TuiAvatar', moduleSpecifier: '@taiga-ui/kit' },
376
376
  },
377
377
  {
378
378
  from: { name: 'TuiToggleModule', moduleSpecifier: '@taiga-ui/experimental' },
@@ -456,13 +456,17 @@ exports.IDENTIFIERS_TO_REPLACE = [
456
456
  to: { name: 'TUI_SCROLL_REF', moduleSpecifier: '@taiga-ui/core' },
457
457
  },
458
458
  {
459
- from: { name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/cdk' },
459
+ from: { name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/core' },
460
460
  to: { name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/legacy' },
461
461
  },
462
462
  {
463
463
  from: { name: 'TuiScrollbarModule', moduleSpecifier: '@taiga-ui/core' },
464
464
  to: { name: 'TuiScrollbar', moduleSpecifier: '@taiga-ui/core' },
465
465
  },
466
+ {
467
+ from: { name: 'TuiScrollbarComponent', moduleSpecifier: '@taiga-ui/core' },
468
+ to: { name: 'TuiScrollbar', moduleSpecifier: '@taiga-ui/core' },
469
+ },
466
470
  {
467
471
  from: { name: 'TuiGroupModule', moduleSpecifier: '@taiga-ui/core' },
468
472
  to: { name: 'TuiGroup', moduleSpecifier: '@taiga-ui/core' },
@@ -657,10 +661,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
657
661
  from: { name: 'TuiSvgModule', moduleSpecifier: '@taiga-ui/core' },
658
662
  to: { name: 'TuiSvgComponent', moduleSpecifier: '@taiga-ui/legacy' },
659
663
  },
660
- {
661
- from: { name: 'TuiRootModule', moduleSpecifier: '@taiga-ui/core' },
662
- to: { name: 'TuiRoot', moduleSpecifier: '@taiga-ui/core' },
663
- },
664
664
  {
665
665
  from: { name: 'TuiCellModule', moduleSpecifier: '@taiga-ui/experimental' },
666
666
  to: { name: 'TuiCell', moduleSpecifier: '@taiga-ui/layout' },
@@ -737,13 +737,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
737
737
  moduleSpecifier: '@taiga-ui/core',
738
738
  },
739
739
  },
740
- {
741
- from: { name: 'TuiAlertModule', moduleSpecifier: '@taiga-ui/core' },
742
- to: {
743
- name: 'TuiAlert',
744
- moduleSpecifier: '@taiga-ui/core',
745
- },
746
- },
747
740
  {
748
741
  from: { name: 'TuiButtonModule', moduleSpecifier: '@taiga-ui/experimental' },
749
742
  to: {
@@ -875,16 +868,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
875
868
  moduleSpecifier: '@taiga-ui/proprietary',
876
869
  },
877
870
  },
878
- {
879
- from: {
880
- name: 'TuiProprietaryRoot2023Module',
881
- moduleSpecifier: '@taiga-ui/proprietary-core',
882
- },
883
- to: {
884
- name: 'TuiProprietaryRoot2023Component',
885
- moduleSpecifier: '@taiga-ui/proprietary',
886
- },
887
- },
888
871
  {
889
872
  from: {
890
873
  name: 'TuiSignalModule',
@@ -1104,7 +1087,7 @@ exports.IDENTIFIERS_TO_REPLACE = [
1104
1087
  },
1105
1088
  to: {
1106
1089
  name: 'TuiArrowComponent',
1107
- moduleSpecifier: '@taiga-ui/kit',
1090
+ moduleSpecifier: '@taiga-ui/legacy',
1108
1091
  },
1109
1092
  },
1110
1093
  {
@@ -1167,6 +1150,16 @@ exports.IDENTIFIERS_TO_REPLACE = [
1167
1150
  moduleSpecifier: '@taiga-ui/addon-doc',
1168
1151
  },
1169
1152
  },
1153
+ {
1154
+ from: {
1155
+ name: 'TuiPromptData',
1156
+ moduleSpecifier: '@taiga-ui/kit',
1157
+ },
1158
+ to: {
1159
+ name: 'TuiConfirmData',
1160
+ moduleSpecifier: '@taiga-ui/kit',
1161
+ },
1162
+ },
1170
1163
  {
1171
1164
  from: {
1172
1165
  name: 'TuiAppBarModule',
@@ -1222,11 +1215,51 @@ exports.IDENTIFIERS_TO_REPLACE = [
1222
1215
  name: 'TuiTabBarModule',
1223
1216
  moduleSpecifier: '@taiga-ui/addon-mobile',
1224
1217
  },
1218
+ to: {
1219
+ name: 'TuiTabBar',
1220
+ moduleSpecifier: '@taiga-ui/addon-mobile',
1221
+ },
1222
+ },
1223
+ {
1224
+ from: {
1225
+ name: 'TuiSidebarModule',
1226
+ moduleSpecifier: '@taiga-ui/addon-mobile',
1227
+ },
1225
1228
  to: {
1226
1229
  name: 'TuiSidebar',
1227
1230
  moduleSpecifier: '@taiga-ui/addon-mobile',
1228
1231
  },
1229
1232
  },
1233
+ {
1234
+ from: {
1235
+ name: 'TuiProgressModule',
1236
+ moduleSpecifier: '@taiga-ui/kit',
1237
+ },
1238
+ to: {
1239
+ name: 'TuiProgress',
1240
+ moduleSpecifier: '@taiga-ui/kit',
1241
+ },
1242
+ },
1243
+ {
1244
+ from: {
1245
+ name: 'TuiRadioListModule',
1246
+ moduleSpecifier: '@taiga-ui/kit',
1247
+ },
1248
+ to: {
1249
+ name: 'TuiRadioList',
1250
+ moduleSpecifier: '@taiga-ui/kit',
1251
+ },
1252
+ },
1253
+ {
1254
+ from: {
1255
+ name: 'TuiInputFilesModule',
1256
+ moduleSpecifier: '@taiga-ui/kit',
1257
+ },
1258
+ to: {
1259
+ name: 'TuiInputFiles',
1260
+ moduleSpecifier: '@taiga-ui/kit',
1261
+ },
1262
+ },
1230
1263
  {
1231
1264
  from: {
1232
1265
  name: 'TuiScrollIntoViewLinkModule',
@@ -1257,6 +1290,26 @@ exports.IDENTIFIERS_TO_REPLACE = [
1257
1290
  moduleSpecifier: '@taiga-ui/kit',
1258
1291
  },
1259
1292
  },
1293
+ {
1294
+ from: {
1295
+ name: 'TuiPreviewDialogService',
1296
+ moduleSpecifier: '@taiga-ui/addon-preview',
1297
+ },
1298
+ to: {
1299
+ name: 'TuiPreviewDialogService',
1300
+ moduleSpecifier: '@taiga-ui/kit',
1301
+ },
1302
+ },
1303
+ {
1304
+ from: {
1305
+ name: 'PolymorpheusModule',
1306
+ moduleSpecifier: '@tinkoff/ng-polymorpheus',
1307
+ },
1308
+ to: [
1309
+ { name: 'PolymorpheusTemplate', moduleSpecifier: '@taiga-ui/polymorpheus' },
1310
+ { name: 'PolymorpheusOutlet', moduleSpecifier: '@taiga-ui/polymorpheus' },
1311
+ ],
1312
+ },
1260
1313
  {
1261
1314
  from: {
1262
1315
  name: 'tuiDefaultSort',
@@ -6,4 +6,5 @@ export * from './identifiers-to-replace';
6
6
  export * from './inputs-to-remove';
7
7
  export * from './migration-warnings';
8
8
  export * from './modules-to-remove';
9
+ export * from './services';
9
10
  export * from './tags-to-replace';
@@ -9,4 +9,5 @@ tslib_1.__exportStar(require("./identifiers-to-replace"), exports);
9
9
  tslib_1.__exportStar(require("./inputs-to-remove"), exports);
10
10
  tslib_1.__exportStar(require("./migration-warnings"), exports);
11
11
  tslib_1.__exportStar(require("./modules-to-remove"), exports);
12
+ tslib_1.__exportStar(require("./services"), exports);
12
13
  tslib_1.__exportStar(require("./tags-to-replace"), exports);
@@ -1,12 +1,13 @@
1
- interface ModuleToReplace {
1
+ export interface ProviderToReplace {
2
+ name: string;
3
+ providerSpecifier: string;
4
+ isFunction?: boolean;
5
+ }
6
+ export interface ModuleToReplace {
2
7
  from: {
3
8
  name: string;
4
9
  moduleSpecifier: string;
5
10
  };
6
- to: {
7
- name: string;
8
- providerSpecifier: string;
9
- };
11
+ to: ProviderToReplace | ProviderToReplace[];
10
12
  }
11
13
  export declare const MODULES_TO_REPLACE_WITH_PROVIDERS: ModuleToReplace[];
12
- export {};
@@ -10,6 +10,7 @@ exports.MODULES_TO_REPLACE_WITH_PROVIDERS = [
10
10
  to: {
11
11
  name: 'tuiProvideMobileCalendar',
12
12
  providerSpecifier: '@taiga-ui/addon-mobile',
13
+ isFunction: true,
13
14
  },
14
15
  },
15
16
  ];
@@ -0,0 +1,2 @@
1
+ import type { ReplacementService } from '../../../interfaces';
2
+ export declare const SERVICES_TO_REPLACE: ReplacementService[];
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SERVICES_TO_REPLACE = void 0;
4
+ exports.SERVICES_TO_REPLACE = [
5
+ {
6
+ from: { name: 'TuiDialogFormService', moduleSpecifier: '@taiga-ui/kit' },
7
+ to: { name: 'TuiConfirmService', moduleSpecifier: '@taiga-ui/kit' },
8
+ replaceMethods: [
9
+ {
10
+ from: 'withPrompt',
11
+ to: 'withConfirm',
12
+ },
13
+ ],
14
+ },
15
+ ];
@@ -0,0 +1,3 @@
1
+ import { type DevkitFileSystem } from 'ng-morph';
2
+ import type { TuiSchema } from '../../../ng-add/schema';
3
+ export declare function migrateRoot(fileSystem: DevkitFileSystem, options: TuiSchema): void;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateRoot = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ const add_unique_import_1 = require("../../../utils/add-unique-import");
6
+ const colored_log_1 = require("../../../utils/colored-log");
7
+ const get_named_import_references_1 = require("../../../utils/get-named-import-references");
8
+ const import_manipulations_1 = require("../../../utils/import-manipulations");
9
+ function migrateRoot(fileSystem, options) {
10
+ !options['skip-logs'] &&
11
+ (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} updating TuiRoot`);
12
+ const refs = [
13
+ ...(0, get_named_import_references_1.getNamedImportReferences)('TuiRootModule', '@taiga-ui/core'),
14
+ ...(0, get_named_import_references_1.getNamedImportReferences)('TuiProprietaryRootModule', '@taiga-ui/proprietary-core'),
15
+ ...(0, get_named_import_references_1.getNamedImportReferences)('TuiProprietaryRoot2023Module', '@taiga-ui/proprietary-core'),
16
+ ];
17
+ for (const ref of refs) {
18
+ if (ref.wasForgotten()) {
19
+ return;
20
+ }
21
+ const parent = ref.getParent();
22
+ if (ng_morph_1.Node.isImportSpecifier(parent)) {
23
+ (0, import_manipulations_1.removeImport)(parent);
24
+ (0, add_unique_import_1.addUniqueImport)(parent.getSourceFile().getFilePath(), 'TuiRoot', '@taiga-ui/core');
25
+ }
26
+ else {
27
+ replaceRootIdentifier(ref, fileSystem);
28
+ }
29
+ }
30
+ }
31
+ exports.migrateRoot = migrateRoot;
32
+ function replaceRootIdentifier(ref, fileSystem) {
33
+ const callExpression = ref.getParentWhile(ng_morph_1.Node.isCallExpression);
34
+ if (callExpression &&
35
+ callExpression.getExpression().getText() === 'importProvidersFrom') {
36
+ ref.replaceWithText('');
37
+ addProviders(callExpression, fileSystem);
38
+ }
39
+ else {
40
+ ref.replaceWithText('TuiRoot');
41
+ }
42
+ }
43
+ function addProviders(callExpression, fileSystem) {
44
+ const array = callExpression.getParentWhile(ng_morph_1.Node.isArrayLiteralExpression);
45
+ if (!array) {
46
+ return;
47
+ }
48
+ array.addElement('NG_EVENT_PLUGINS');
49
+ (0, add_unique_import_1.addUniqueImport)(array.getSourceFile().getFilePath(), 'NG_EVENT_PLUGINS', '@taiga-ui/event-plugins');
50
+ (0, ng_morph_1.getActiveProject)();
51
+ const proprietary = (0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, '@taiga-ui/proprietary-core');
52
+ if (proprietary) {
53
+ array.addElement('TBANK_PROVIDERS');
54
+ (0, add_unique_import_1.addUniqueImport)(array.getSourceFile().getFilePath(), 'TBANK_PROVIDERS', '@taiga-ui/proprietary');
55
+ }
56
+ }
@@ -28,14 +28,14 @@ function migrateLabeled({ resource, recorder, fileSystem, }) {
28
28
  'tui-radio-labeled',
29
29
  ]);
30
30
  elements.forEach(({ sourceCodeLocation, tagName }) => {
31
- var _a, _b, _c, _d, _e, _f;
31
+ var _a, _b, _c, _d;
32
32
  if (!sourceCodeLocation) {
33
33
  return;
34
34
  }
35
35
  (0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, tagName === 'tui-checkbox-labeled' ? 'TuiCheckbox' : 'TuiRadio', '@taiga-ui/kit');
36
- recorder.insertRight(templateOffset + ((_b = (_a = sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) !== null && _b !== void 0 ? _b : 1) - 1, '<label tuiLabel>');
37
- recorder.insertRight(templateOffset + ((_d = (_c = sourceCodeLocation.endTag) === null || _c === void 0 ? void 0 : _c.startOffset) !== null && _d !== void 0 ? _d : 1) - 1, '\n</label>');
38
- recorder.remove(templateOffset + ((_f = (_e = sourceCodeLocation.endTag) === null || _e === void 0 ? void 0 : _e.startOffset) !== null && _f !== void 0 ? _f : 0), tagName === 'tui-checkbox-labeled'
36
+ recorder.insertRight(templateOffset + (((_a = sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) || 1) - 1, '<label tuiLabel>');
37
+ recorder.insertRight(templateOffset + (((_b = sourceCodeLocation.endTag) === null || _b === void 0 ? void 0 : _b.startOffset) || 1) - 1, '\n</label>');
38
+ recorder.remove(templateOffset + ((_d = (_c = sourceCodeLocation.endTag) === null || _c === void 0 ? void 0 : _c.startOffset) !== null && _d !== void 0 ? _d : 0), tagName === 'tui-checkbox-labeled'
39
39
  ? '<tui-checkbox-labeled/>'.length
40
40
  : '<tui-radio-labeled/>'.length);
41
41
  });
@@ -25,5 +25,11 @@ function updatePackages({ tree }, _) {
25
25
  name: '@taiga-ui/editor',
26
26
  version: '^2.0.0',
27
27
  }, tree);
28
+ if (!(0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/event-plugins')) {
29
+ (0, ng_morph_1.addPackageJsonDependency)(tree, {
30
+ name: '@taiga-ui/event-plugins',
31
+ version: '^4.0.1',
32
+ });
33
+ }
28
34
  }
29
35
  exports.updatePackages = updatePackages;
@@ -1,13 +1,3 @@
1
1
  import type { TuiSchema } from '../../../../ng-add/schema';
2
- interface ModuleToReplace {
3
- from: {
4
- name: string;
5
- moduleSpecifier: string;
6
- };
7
- to: {
8
- name: string;
9
- providerSpecifier: string;
10
- };
11
- }
2
+ import type { ModuleToReplace } from '../constants/modules-to-replace';
12
3
  export declare const replaceModulesWithProviders: (options: TuiSchema, list: ModuleToReplace[]) => void;
13
- export {};
@@ -16,6 +16,7 @@ const replaceModulesWithProviders = (options, list) => {
16
16
  exports.replaceModulesWithProviders = replaceModulesWithProviders;
17
17
  function replaceModule({ from, to }) {
18
18
  const references = (0, get_named_import_references_1.getNamedImportReferences)(from.name, from.moduleSpecifier);
19
+ const toReplace = Array.isArray(to) ? to : [to];
19
20
  references.forEach((ref) => {
20
21
  if (ref.wasForgotten()) {
21
22
  return;
@@ -23,11 +24,14 @@ function replaceModule({ from, to }) {
23
24
  const parent = ref.getParent();
24
25
  if (ng_morph_1.Node.isImportSpecifier(parent)) {
25
26
  (0, import_manipulations_1.removeImport)(parent);
26
- addImport(to, parent.getSourceFile().getFilePath());
27
+ toReplace.forEach((provider) => addImport(provider, parent.getSourceFile().getFilePath()));
27
28
  }
28
29
  else if (ng_morph_1.Node.isArrayLiteralExpression(parent)) {
29
- parent.removeElement(ref.getChildIndex());
30
- addProvider(to, parent.getSourceFile().getFilePath());
30
+ const index = parent
31
+ .getElements()
32
+ .findIndex((el) => el.getText() === from.name);
33
+ parent.removeElement(index);
34
+ toReplace.forEach((provider) => addProvider(provider, parent.getSourceFile().getFilePath()));
31
35
  }
32
36
  });
33
37
  }
@@ -35,7 +39,7 @@ function addImport(identifier, filePath) {
35
39
  (0, add_unique_import_1.addUniqueImport)(filePath, identifier.name, identifier.providerSpecifier);
36
40
  }
37
41
  function addProvider(identifier, filePath) {
38
- const provider = `${identifier.name}()`;
42
+ const provider = `${identifier.name}${identifier.isFunction ? '()' : ''}`;
39
43
  const componentClass = (0, ng_morph_1.getNgComponents)(filePath)[0];
40
44
  if (componentClass) {
41
45
  (0, ng_morph_1.addProviderToComponent)(componentClass, provider);