@taiga-ui/cdk 3.52.0 → 3.53.0-canary.0974e5c

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.
Files changed (127) hide show
  1. package/bundles/taiga-ui-cdk-components-alert-host.umd.js +1 -1
  2. package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-constants.umd.js +1 -1
  4. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js +1 -1
  6. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-directives-for-async.umd.js +6 -1
  8. package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-pipes-filter.umd.js +1 -1
  10. package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
  11. package/bundles/taiga-ui-cdk-pipes-keys.umd.js +1 -1
  12. package/bundles/taiga-ui-cdk-pipes-keys.umd.js.map +1 -1
  13. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +1 -1
  14. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
  15. package/bundles/taiga-ui-cdk-pipes-replace.umd.js +1 -1
  16. package/bundles/taiga-ui-cdk-pipes-replace.umd.js.map +1 -1
  17. package/constants/version.d.ts +1 -1
  18. package/constants/version.js +1 -1
  19. package/directives/for-async/for-async.directive.d.ts +4 -0
  20. package/directives/for-async/for-async.module.d.ts +2 -1
  21. package/esm2015/components/alert-host/alert-host.component.js +2 -2
  22. package/esm2015/constants/version.js +2 -2
  23. package/esm2015/directives/autofilled/autofilled.module.js +2 -2
  24. package/esm2015/directives/for-async/for-async.directive.js +5 -1
  25. package/esm2015/directives/for-async/for-async.module.js +3 -2
  26. package/esm2015/pipes/filter/filter.module.js +2 -2
  27. package/esm2015/pipes/keys/keys.module.js +2 -2
  28. package/esm2015/pipes/mapper/mapper.module.js +2 -2
  29. package/esm2015/pipes/replace/replace.module.js +2 -2
  30. package/fesm2015/taiga-ui-cdk-components-alert-host.js +2 -2
  31. package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
  32. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  33. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  34. package/fesm2015/taiga-ui-cdk-directives-autofilled.js +1 -1
  35. package/fesm2015/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  36. package/fesm2015/taiga-ui-cdk-directives-for-async.js +6 -1
  37. package/fesm2015/taiga-ui-cdk-directives-for-async.js.map +1 -1
  38. package/fesm2015/taiga-ui-cdk-pipes-filter.js +1 -1
  39. package/fesm2015/taiga-ui-cdk-pipes-filter.js.map +1 -1
  40. package/fesm2015/taiga-ui-cdk-pipes-keys.js +1 -1
  41. package/fesm2015/taiga-ui-cdk-pipes-keys.js.map +1 -1
  42. package/fesm2015/taiga-ui-cdk-pipes-mapper.js +1 -1
  43. package/fesm2015/taiga-ui-cdk-pipes-mapper.js.map +1 -1
  44. package/fesm2015/taiga-ui-cdk-pipes-replace.js +1 -1
  45. package/fesm2015/taiga-ui-cdk-pipes-replace.js.map +1 -1
  46. package/package.json +4 -6
  47. package/schematics/ng-update/interfaces/html-comment.d.ts +5 -0
  48. package/schematics/ng-update/interfaces/index.d.ts +14 -0
  49. package/schematics/ng-update/interfaces/index.js +17 -0
  50. package/schematics/ng-update/{v3/interfaces/attribute-to-directive.d.ts → interfaces/replacement-attribute-to-directive.d.ts} +1 -1
  51. package/schematics/ng-update/interfaces/{replaceable-attribute-value.d.ts → replacement-attribute-value.d.ts} +1 -1
  52. package/schematics/ng-update/interfaces/{replaceable-attribute.d.ts → replacement-attribute.d.ts} +1 -1
  53. package/schematics/ng-update/interfaces/{replacement-const.d.ts → replacement-identifier.d.ts} +1 -1
  54. package/schematics/ng-update/interfaces/replacement-service.d.ts +2 -2
  55. package/schematics/ng-update/interfaces/{replaceable-tag.d.ts → replacement-tag.d.ts} +1 -1
  56. package/schematics/ng-update/interfaces/{type-to-rename.d.ts → replacement-type.d.ts} +1 -1
  57. package/schematics/ng-update/interfaces/replacement-type.js +2 -0
  58. package/schematics/ng-update/steps/icons/replace-imports.d.ts +2 -2
  59. package/schematics/ng-update/steps/rename-types.d.ts +2 -2
  60. package/schematics/ng-update/steps/replace-identifier.d.ts +3 -3
  61. package/schematics/ng-update/steps/replace-identifier.js +5 -5
  62. package/schematics/ng-update/utils/templates/index.d.ts +6 -0
  63. package/schematics/ng-update/utils/templates/index.js +9 -0
  64. package/schematics/ng-update/utils/templates/remove-inputs.d.ts +2 -2
  65. package/schematics/ng-update/utils/templates/remove-inputs.js +2 -2
  66. package/schematics/ng-update/utils/templates/replace-attr-values.d.ts +3 -3
  67. package/schematics/ng-update/utils/templates/replace-attr-values.js +2 -2
  68. package/schematics/ng-update/utils/templates/replace-attrs-by-directives.d.ts +7 -0
  69. package/schematics/ng-update/utils/templates/replace-attrs-by-directives.js +18 -0
  70. package/schematics/ng-update/utils/templates/replace-attrs.d.ts +10 -0
  71. package/schematics/ng-update/utils/templates/replace-attrs.js +20 -0
  72. package/schematics/ng-update/utils/templates/replace-tags.d.ts +3 -3
  73. package/schematics/ng-update/utils/templates/replace-tags.js +2 -2
  74. package/schematics/ng-update/utils/templates/template-comments.d.ts +10 -0
  75. package/schematics/ng-update/utils/templates/template-comments.js +20 -0
  76. package/schematics/ng-update/v3/constants/constants.d.ts +2 -2
  77. package/schematics/ng-update/v3/constants/deprecated-functions.d.ts +2 -2
  78. package/schematics/ng-update/v3/constants/templates.d.ts +8 -8
  79. package/schematics/ng-update/v3/constants/types.d.ts +2 -2
  80. package/schematics/ng-update/v3/index.js +1 -1
  81. package/schematics/ng-update/v3/steps/migrate-templates.js +11 -16
  82. package/schematics/ng-update/v3-30/constants/constants.d.ts +2 -2
  83. package/schematics/ng-update/v3-35/constants/constants.d.ts +2 -2
  84. package/schematics/ng-update/v4/index.js +7 -6
  85. package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.d.ts +2 -0
  86. package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +40 -0
  87. package/schematics/ng-update/v4/steps/constants/attrs-to-replace.d.ts +2 -0
  88. package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +47 -0
  89. package/schematics/ng-update/v4/steps/constants/html-comments.d.ts +2 -0
  90. package/schematics/ng-update/v4/steps/constants/html-comments.js +10 -0
  91. package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.d.ts +2 -0
  92. package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +44 -0
  93. package/schematics/ng-update/v4/steps/constants/index.d.ts +6 -0
  94. package/schematics/ng-update/v4/steps/constants/index.js +9 -0
  95. package/schematics/ng-update/v4/steps/constants/inputs-to-remove.d.ts +2 -0
  96. package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +8 -0
  97. package/schematics/ng-update/v4/steps/constants/tags-to-replace.d.ts +2 -0
  98. package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +7 -0
  99. package/schematics/ng-update/v4/steps/index.d.ts +3 -0
  100. package/schematics/ng-update/v4/steps/index.js +6 -0
  101. package/schematics/ng-update/v4/steps/migrate-templates.d.ts +3 -0
  102. package/schematics/ng-update/v4/steps/migrate-templates.js +49 -0
  103. package/schematics/ng-update/v4/steps/templates/index.d.ts +2 -0
  104. package/schematics/ng-update/v4/steps/templates/index.js +5 -0
  105. package/schematics/ng-update/v4/steps/templates/migrate-badge.d.ts +8 -0
  106. package/schematics/ng-update/v4/steps/templates/migrate-badge.js +29 -0
  107. package/schematics/ng-update/v4/steps/templates/toggles/common.d.ts +10 -0
  108. package/schematics/ng-update/v4/steps/templates/toggles/common.js +40 -0
  109. package/schematics/ng-update/v4/steps/templates/toggles/index.d.ts +3 -0
  110. package/schematics/ng-update/v4/steps/templates/toggles/index.js +6 -0
  111. package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.d.ts +8 -0
  112. package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js +25 -0
  113. package/schematics/ng-update/v4/steps/templates/toggles/migrate-radio.d.ts +8 -0
  114. package/schematics/ng-update/v4/steps/templates/toggles/migrate-radio.js +25 -0
  115. package/schematics/ng-update/v4/steps/templates/toggles/migrate-toggle.d.ts +8 -0
  116. package/schematics/ng-update/v4/steps/templates/toggles/migrate-toggle.js +25 -0
  117. package/schematics/utils/add-import-to-closest-module.js +11 -1
  118. package/schematics/utils/angular/is-standalone-component.d.ts +2 -0
  119. package/schematics/utils/angular/is-standalone-component.js +22 -0
  120. package/schematics/ng-update/v4/steps/replace-thumbnail-card.d.ts +0 -4
  121. package/schematics/ng-update/v4/steps/replace-thumbnail-card.js +0 -86
  122. /package/schematics/ng-update/interfaces/{replaceable-attribute-value.js → html-comment.js} +0 -0
  123. /package/schematics/ng-update/interfaces/{replaceable-attribute.js → replacement-attribute-to-directive.js} +0 -0
  124. /package/schematics/ng-update/interfaces/{replaceable-tag.js → replacement-attribute-value.js} +0 -0
  125. /package/schematics/ng-update/interfaces/{replacement-const.js → replacement-attribute.js} +0 -0
  126. /package/schematics/ng-update/interfaces/{type-to-rename.js → replacement-identifier.js} +0 -0
  127. /package/schematics/ng-update/{v3/interfaces/attribute-to-directive.js → interfaces/replacement-tag.js} +0 -0
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStandaloneComponent = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ // TODO: add to ng-morph
6
+ function isStandaloneComponent(component) {
7
+ var _a;
8
+ const decorator = component.getDecorator(`Component`);
9
+ if (!decorator) {
10
+ return false;
11
+ }
12
+ const [metadata] = decorator.getArguments();
13
+ if (!ng_morph_1.Node.isObjectLiteralExpression(metadata)) {
14
+ return false;
15
+ }
16
+ const property = metadata.getProperty(`standalone`);
17
+ if (!ng_morph_1.Node.isPropertyAssignment(property)) {
18
+ return false;
19
+ }
20
+ return ((_a = property.getInitializer()) === null || _a === void 0 ? void 0 : _a.getText()) === `true`;
21
+ }
22
+ exports.isStandaloneComponent = isStandaloneComponent;
@@ -1,4 +0,0 @@
1
- import { DevkitFileSystem } from 'ng-morph';
2
- import { TuiSchema } from '../../../ng-add/schema';
3
- export declare function replaceThumbnailCard(options: TuiSchema, fileSystem: DevkitFileSystem): void;
4
- export declare function replaceReferenceTypes(options: TuiSchema): void;
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.replaceReferenceTypes = exports.replaceThumbnailCard = void 0;
4
- const constants_1 = require("../../../constants");
5
- const colored_log_1 = require("../../../utils/colored-log");
6
- const elements_1 = require("../../../utils/templates/elements");
7
- const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
8
- const template_resource_1 = require("../../../utils/templates/template-resource");
9
- const replace_identifier_1 = require("../../steps/replace-identifier");
10
- const remove_inputs_1 = require("../../utils/templates/remove-inputs");
11
- const replace_tags_1 = require("../../utils/templates/replace-tags");
12
- function replaceThumbnailCard(options, fileSystem) {
13
- replaceCardTemplate(options, fileSystem);
14
- replaceReferenceTypes(options);
15
- !options[`skip-logs`] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
16
- }
17
- exports.replaceThumbnailCard = replaceThumbnailCard;
18
- function replaceCardTemplate(options, fileSystem) {
19
- !options[`skip-logs`] &&
20
- colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing <tui-card /> to <tui-thumbnail-card />`);
21
- const templateResources = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
22
- for (const resource of templateResources) {
23
- const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
24
- const templateOffset = template_resource_1.getTemplateOffset(resource);
25
- const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
26
- const recorder = fileSystem.edit(path);
27
- replace_tags_1.replaceTags({
28
- resource,
29
- recorder,
30
- fileSystem,
31
- replaceableItems: [{ from: `tui-card`, to: `tui-thumbnail-card` }],
32
- });
33
- replaceCardInputs({ template, recorder, templateOffset });
34
- remove_inputs_1.removeInputs({
35
- resource,
36
- recorder,
37
- fileSystem,
38
- replaceableItems: [
39
- { inputName: `active`, tags: [`tui-card`, `tui-thumbnail-card`] },
40
- ],
41
- });
42
- }
43
- }
44
- function replaceCardInputs({ template, recorder, templateOffset, }) {
45
- const attrsToReplace = [
46
- {
47
- from: {
48
- attrName: `brandLogo`,
49
- withTagNames: [`tui-card`, `tui-thumbnail-card`],
50
- },
51
- to: { attrName: `iconLeft` },
52
- },
53
- {
54
- from: {
55
- attrName: `[brandLogo]`,
56
- withTagNames: [`tui-card`, `tui-thumbnail-card`],
57
- },
58
- to: { attrName: `[iconLeft]` },
59
- },
60
- ];
61
- for (const { from, to } of attrsToReplace) {
62
- const offsets = [
63
- ...elements_1.findAttributeOnElementWithTag(template, from.attrName, from.withTagNames || []),
64
- ];
65
- offsets.forEach(offset => {
66
- recorder.remove(offset + templateOffset, from.attrName.length);
67
- recorder.insertRight(offset + templateOffset, to.attrName);
68
- });
69
- }
70
- }
71
- function replaceReferenceTypes(options) {
72
- !options[`skip-logs`] &&
73
- colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing TuiCard(Module|Component) to TuiThumbnailCard(Module|Component)`);
74
- replace_identifier_1.replaceIdentifier({
75
- from: { name: `TuiCardModule`, moduleSpecifier: `@taiga-ui/addon-commerce` },
76
- to: { name: `TuiThumbnailCardModule`, moduleSpecifier: `@taiga-ui/addon-commerce` },
77
- });
78
- replace_identifier_1.replaceIdentifier({
79
- from: { name: `TuiCardComponent`, moduleSpecifier: `@taiga-ui/addon-commerce` },
80
- to: {
81
- name: `TuiThumbnailCardComponent`,
82
- moduleSpecifier: `@taiga-ui/addon-commerce`,
83
- },
84
- });
85
- }
86
- exports.replaceReferenceTypes = replaceReferenceTypes;