@taiga-ui/cdk 3.44.1 → 3.45.0-canary.1c27922

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 (122) hide show
  1. package/bundles/taiga-ui-cdk-abstract.umd.js +4 -1
  2. package/bundles/taiga-ui-cdk-abstract.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-hovered.umd.js +6 -1
  6. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-tokens.umd.js +86 -123
  8. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +6 -10
  10. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  11. package/constants/version.d.ts +1 -1
  12. package/constants/version.js +1 -1
  13. package/esm2015/abstract/interactive.js +5 -2
  14. package/esm2015/constants/version.js +2 -2
  15. package/esm2015/directives/hovered/hovered.service.js +7 -2
  16. package/esm2015/tokens/active-element.js +38 -40
  17. package/esm2015/tokens/default-renderer.js +6 -6
  18. package/esm2015/tokens/ensure-base-href.js +12 -13
  19. package/esm2015/tokens/is-android.js +4 -5
  20. package/esm2015/tokens/is-apple.js +4 -6
  21. package/esm2015/tokens/is-chromium.js +4 -5
  22. package/esm2015/tokens/is-cypress.js +4 -5
  23. package/esm2015/tokens/is-e2e.js +4 -5
  24. package/esm2015/tokens/is-firefox.js +6 -7
  25. package/esm2015/tokens/is-ios.js +4 -6
  26. package/esm2015/tokens/is-mobile.js +5 -6
  27. package/esm2015/tokens/is-playwright.js +3 -5
  28. package/esm2015/tokens/is-stackblitz.js +4 -5
  29. package/esm2015/tokens/is-webkit.js +6 -7
  30. package/esm2015/tokens/range.js +4 -5
  31. package/esm2015/tokens/removed-element.js +13 -14
  32. package/esm2015/tokens/take-only-trusted-events.js +3 -5
  33. package/esm2015/tokens/touch-supported.js +4 -5
  34. package/esm2015/tokens/window-height.js +4 -5
  35. package/esm2015/utils/miscellaneous/create-options.js +3 -5
  36. package/esm2015/utils/miscellaneous/create-token.js +2 -4
  37. package/fesm2015/taiga-ui-cdk-abstract.js +5 -2
  38. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  39. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  40. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  41. package/fesm2015/taiga-ui-cdk-directives-hovered.js +6 -1
  42. package/fesm2015/taiga-ui-cdk-directives-hovered.js.map +1 -1
  43. package/fesm2015/taiga-ui-cdk-tokens.js +79 -116
  44. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  45. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +6 -10
  46. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  47. package/package.json +1 -1
  48. package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.d.ts +1 -0
  49. package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.js +381 -0
  50. package/schematics/ng-add/tests/schematic-ng-add.spec.d.ts +1 -0
  51. package/schematics/ng-add/tests/schematic-ng-add.spec.js +270 -0
  52. package/schematics/ng-update/v3/tests/schematic-date-time.spec.d.ts +1 -0
  53. package/schematics/ng-update/v3/tests/schematic-date-time.spec.js +117 -0
  54. package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.d.ts +1 -0
  55. package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.js +102 -0
  56. package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.d.ts +1 -0
  57. package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.js +107 -0
  58. package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.d.ts +1 -0
  59. package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.js +113 -0
  60. package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.d.ts +1 -0
  61. package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.js +380 -0
  62. package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.d.ts +1 -0
  63. package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.js +119 -0
  64. package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.d.ts +1 -0
  65. package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.js +123 -0
  66. package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.d.ts +1 -0
  67. package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.js +81 -0
  68. package/schematics/ng-update/v3/tests/schematic-rename-types.spec.d.ts +1 -0
  69. package/schematics/ng-update/v3/tests/schematic-rename-types.spec.js +157 -0
  70. package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.d.ts +1 -0
  71. package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.js +135 -0
  72. package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.d.ts +1 -0
  73. package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.js +53 -0
  74. package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.d.ts +1 -0
  75. package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.js +835 -0
  76. package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.d.ts +1 -0
  77. package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.js +68 -0
  78. package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.d.ts +1 -0
  79. package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.js +195 -0
  80. package/schematics/ng-update/v3/tests/schematic-replace-html.spec.d.ts +1 -0
  81. package/schematics/ng-update/v3/tests/schematic-replace-html.spec.js +611 -0
  82. package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.d.ts +1 -0
  83. package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.js +100 -0
  84. package/schematics/ng-update/v3/tests/schematic-replace-services.spec.d.ts +1 -0
  85. package/schematics/ng-update/v3/tests/schematic-replace-services.spec.js +102 -0
  86. package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.d.ts +1 -0
  87. package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.js +286 -0
  88. package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.d.ts +1 -0
  89. package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.js +141 -0
  90. package/schematics/ng-update/v3/tests/schematic-warnings.spec.d.ts +1 -0
  91. package/schematics/ng-update/v3/tests/schematic-warnings.spec.js +104 -0
  92. package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.d.ts +1 -0
  93. package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.js +87 -0
  94. package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.d.ts +1 -0
  95. package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.js +101 -0
  96. package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.d.ts +1 -0
  97. package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.js +117 -0
  98. package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.d.ts +1 -0
  99. package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.js +90 -0
  100. package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.d.ts +1 -0
  101. package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.js +74 -0
  102. package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.d.ts +1 -0
  103. package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.js +72 -0
  104. package/tokens/active-element.d.ts +1 -2
  105. package/tokens/default-renderer.d.ts +2 -2
  106. package/tokens/ensure-base-href.d.ts +1 -2
  107. package/tokens/is-android.d.ts +1 -2
  108. package/tokens/is-apple.d.ts +1 -2
  109. package/tokens/is-chromium.d.ts +1 -2
  110. package/tokens/is-cypress.d.ts +1 -2
  111. package/tokens/is-e2e.d.ts +1 -2
  112. package/tokens/is-firefox.d.ts +1 -2
  113. package/tokens/is-ios.d.ts +1 -2
  114. package/tokens/is-mobile.d.ts +1 -2
  115. package/tokens/is-playwright.d.ts +1 -2
  116. package/tokens/is-stackblitz.d.ts +1 -2
  117. package/tokens/is-webkit.d.ts +1 -2
  118. package/tokens/range.d.ts +1 -2
  119. package/tokens/removed-element.d.ts +1 -3
  120. package/tokens/take-only-trusted-events.d.ts +1 -2
  121. package/tokens/touch-supported.d.ts +1 -2
  122. package/tokens/window-height.d.ts +1 -3
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /* eslint-disable rxjs/no-topromise */
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ const testing_1 = require("@angular-devkit/schematics/testing");
7
+ const ng_morph_1 = require("ng-morph");
8
+ const path_1 = require("path");
9
+ const create_angular_json_1 = require("../../../utils/create-angular-json");
10
+ const collectionPath = path_1.join(__dirname, `../../../migration.json`);
11
+ const COMPONENT_BEFORE = `
12
+ import { tuiIconEyeClosedMarker, tuiIconCrowdMarker } from '@taiga-ui/proprietary-icons';
13
+
14
+ @Component({templateUrl: './test.template.html'})
15
+ export class TestComponent {
16
+ account = {
17
+ icon: 'tuiIconCrowdMarker',
18
+ color: 'white',
19
+ background: 'var(--tui-support-12)',
20
+ };
21
+
22
+ icon = tuiIconEyeClosedMarker;
23
+ icon2 = tuiIconCrowdMarker;
24
+ }`;
25
+ const COMPONENT_AFTER = `import { tuiIconTdsEyeOffMedium, tuiIconTdsUsersMedium } from "@taiga-ui/proprietary-tds-icons";
26
+
27
+ @Component({templateUrl: './test.template.html'})
28
+ export class TestComponent {
29
+ account = {
30
+ icon: 'tuiIconTdsUsersMedium',
31
+ color: 'white',
32
+ background: 'var(--tui-support-12)',
33
+ };
34
+
35
+ icon = tuiIconTdsEyeOffMedium;
36
+ icon2 = tuiIconTdsUsersMedium;
37
+ }`;
38
+ const TEMPLATE_BEFORE = `
39
+ <tui-marker-icon
40
+ new
41
+ mode="error"
42
+ src="tuiIconErrorMarker"
43
+ [size]="iconSize"
44
+ ></tui-marker-icon>
45
+ <custom-component [customAttr]="tuiIconErrorMarker"></custom-component>
46
+ `;
47
+ const TEMPLATE_AFTER = `
48
+ <tui-marker-icon
49
+ new
50
+ mode="error"
51
+ src="tuiIconTdsCrossMedium"
52
+ [size]="iconSize"
53
+ ></tui-marker-icon>
54
+ <custom-component [customAttr]="tuiIconTdsCrossMedium"></custom-component>
55
+ `;
56
+ describe(`ng-update`, () => {
57
+ let host;
58
+ let runner;
59
+ beforeEach(() => {
60
+ host = new testing_1.UnitTestTree(new schematics_1.HostTree());
61
+ runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
62
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
63
+ createMainFiles();
64
+ ng_morph_1.saveActiveProject();
65
+ });
66
+ it(`should migrate icons in template`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
67
+ const tree = yield runner
68
+ .runSchematicAsync(`updateToV3_30`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
69
+ .toPromise();
70
+ expect(tree.readContent(`test/app/test.template.html`)).toEqual(TEMPLATE_AFTER);
71
+ }));
72
+ it(`should migrate icons in ts files`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
73
+ const tree = yield runner
74
+ .runSchematicAsync(`updateToV3_30`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
75
+ .toPromise();
76
+ expect(tree.readContent(`test/app/test.component.ts`)).toEqual(COMPONENT_AFTER);
77
+ }));
78
+ afterEach(() => {
79
+ ng_morph_1.resetActiveProject();
80
+ });
81
+ });
82
+ function createMainFiles() {
83
+ ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT_BEFORE);
84
+ ng_morph_1.createSourceFile(`test/app/test.template.html`, TEMPLATE_BEFORE);
85
+ create_angular_json_1.createAngularJson();
86
+ ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0", "@taiga-ui/proprietary-icons": "~3.29.0"}}`);
87
+ }
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /* eslint-disable rxjs/no-topromise */
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ const testing_1 = require("@angular-devkit/schematics/testing");
7
+ const ng_morph_1 = require("ng-morph");
8
+ const path_1 = require("path");
9
+ const create_angular_json_1 = require("../../../utils/create-angular-json");
10
+ const collectionPath = path_1.join(__dirname, `../../../migration.json`);
11
+ const COMPONENT_BEFORE = `
12
+ import { tuiIconAlertCircleOutline, tuiIconAlertLarge, tuiIconViewListLarge, tuiIconLinkedLarge } from '@taiga-ui/proprietary-icons';
13
+
14
+ @Component({templateUrl: './test.template.html'})
15
+ export class TestComponent {
16
+ account = {
17
+ icon: 'tuiIconAlertLarge',
18
+ icon2: 'tuiIconViewListLarge',
19
+ icon3: tuiIconLinkedLarge,
20
+ color: 'white',
21
+ background: 'var(--tui-support-12)',
22
+ };
23
+
24
+ icon = tuiIconAlertCircleOutline;
25
+ icon2 = tuiIconAlertLarge;
26
+ icon3 = tuiIconViewListLarge;
27
+ }
28
+ `;
29
+ const COMPONENT_AFTER = `import { tuiIconTdsAlertSmallPragmatic, tuiIconTdsExclamationMediumPragmatic } from "@taiga-ui/proprietary-tds-icons";
30
+
31
+ import { tuiIconViewListLarge, tuiIconLinkedLarge } from '@taiga-ui/proprietary-icons';
32
+
33
+ @Component({templateUrl: './test.template.html'})
34
+ export class TestComponent {
35
+ account = {
36
+ icon: 'tuiIconTdsExclamationMediumPragmatic',
37
+ icon2: 'tuiIconViewListLarge',
38
+ icon3: tuiIconLinkedLarge,
39
+ color: 'white',
40
+ background: 'var(--tui-support-12)',
41
+ };
42
+
43
+ icon = tuiIconTdsAlertSmallPragmatic;
44
+ icon2 = tuiIconTdsExclamationMediumPragmatic;
45
+ icon3 = tuiIconViewListLarge;
46
+ }
47
+ `;
48
+ const TEMPLATE_BEFORE = `
49
+ <tui-marker-icon
50
+ new
51
+ mode="error"
52
+ src="tuiIconAlertLarge"
53
+ [size]="iconSize"
54
+ ></tui-marker-icon>
55
+ <custom-component [customAttr]="tuiIconArrowDown"></custom-component>
56
+ <tui-svg src='tuiIconViewListLarge' />
57
+ <tui-svg src="tuiIconLinkedLarge" />
58
+ `;
59
+ const TEMPLATE_AFTER = `
60
+ <tui-marker-icon
61
+ new
62
+ mode="error"
63
+ src="tuiIconTdsExclamationMediumPragmatic"
64
+ [size]="iconSize"
65
+ ></tui-marker-icon>
66
+ <custom-component [customAttr]="tuiIconTdsArrowDownSmallPragmatic"></custom-component>
67
+ <tui-svg src='tuiIconViewListLarge' />
68
+ <tui-svg src="tuiIconLinkedLarge" />
69
+ `;
70
+ describe(`ng-update`, () => {
71
+ let host;
72
+ let runner;
73
+ beforeEach(() => {
74
+ host = new testing_1.UnitTestTree(new schematics_1.HostTree());
75
+ runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
76
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
77
+ createMainFiles();
78
+ ng_morph_1.saveActiveProject();
79
+ });
80
+ it(`should migrate icons in template`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
81
+ const tree = yield runner
82
+ .runSchematicAsync(`updateToV3_35`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
83
+ .toPromise();
84
+ expect(tree.readContent(`test/app/test.template.html`)).toEqual(TEMPLATE_AFTER);
85
+ }));
86
+ it(`should migrate icons in ts files`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
87
+ const tree = yield runner
88
+ .runSchematicAsync(`updateToV3_35`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
89
+ .toPromise();
90
+ expect(tree.readContent(`test/app/test.component.ts`)).toEqual(COMPONENT_AFTER);
91
+ }));
92
+ afterEach(() => {
93
+ ng_morph_1.resetActiveProject();
94
+ });
95
+ });
96
+ function createMainFiles() {
97
+ ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT_BEFORE);
98
+ ng_morph_1.createSourceFile(`test/app/test.template.html`, TEMPLATE_BEFORE);
99
+ create_angular_json_1.createAngularJson();
100
+ ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0", "@taiga-ui/proprietary-icons": "~3.29.0"}}`);
101
+ }
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /* eslint-disable rxjs/no-topromise */
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ const testing_1 = require("@angular-devkit/schematics/testing");
7
+ const ng_morph_1 = require("ng-morph");
8
+ const path_1 = require("path");
9
+ const create_angular_json_1 = require("../../../utils/create-angular-json");
10
+ const collectionPath = path_1.join(__dirname, `../../../migration.json`);
11
+ const COMPONENT_BEFORE = `import { TUI_EDITOR_EXTENSIONS, TUI_ATTACH_FILES_LOADER } from '@taiga-ui/addon-editor';
12
+
13
+ @Component({
14
+ selector: 'test',
15
+ templateUrl: './test.template.html',
16
+ styleUrls: ['./index.less'],
17
+ providers: [
18
+ {
19
+ provide: TUI_EDITOR_EXTENSIONS,
20
+ useValue: [
21
+ import('@taiga-ui/addon-editor/extensions/starter-kit').then(
22
+ ({StarterKit}) => StarterKit,
23
+ ),
24
+ import('@tiptap/extension-text-style').then(({TextStyle}) => TextStyle),
25
+ import('@taiga-ui/addon-editor/extensions/link').then(
26
+ ({TuiLink}) => TuiLink,
27
+ ),
28
+ import('@taiga-ui/addon-editor/extensions/jump-anchor').then(
29
+ ({TuiJumpAnchor}) => TuiJumpAnchor,
30
+ ),
31
+ import('@taiga-ui/addon-editor/extensions/file-link').then(
32
+ ({TuiFileLink}) => TuiFileLink,
33
+ ),
34
+ ],
35
+ },
36
+ {
37
+ provide: TUI_ATTACH_FILES_LOADER,
38
+ deps: [FileIoService],
39
+ useFactory: fileLoader,
40
+ },
41
+ ],
42
+ })
43
+ export class TestComponent {
44
+ }`;
45
+ const COMPONENT_AFTER = `import { TUI_EDITOR_EXTENSIONS, TUI_ATTACH_FILES_LOADER } from '@tinkoff/tui-editor';
46
+
47
+ @Component({
48
+ selector: 'test',
49
+ templateUrl: './test.template.html',
50
+ styleUrls: ['./index.less'],
51
+ providers: [
52
+ {
53
+ provide: TUI_EDITOR_EXTENSIONS,
54
+ useValue: [
55
+ import('@tinkoff/tui-editor/extensions/starter-kit').then(
56
+ ({StarterKit}) => StarterKit,
57
+ ),
58
+ import('@tiptap/extension-text-style').then(({TextStyle}) => TextStyle),
59
+ import('@tinkoff/tui-editor/extensions/link').then(
60
+ ({TuiLink}) => TuiLink,
61
+ ),
62
+ import('@tinkoff/tui-editor/extensions/jump-anchor').then(
63
+ ({TuiJumpAnchor}) => TuiJumpAnchor,
64
+ ),
65
+ import('@tinkoff/tui-editor/extensions/file-link').then(
66
+ ({TuiFileLink}) => TuiFileLink,
67
+ ),
68
+ ],
69
+ },
70
+ {
71
+ provide: TUI_ATTACH_FILES_LOADER,
72
+ deps: [FileIoService],
73
+ useFactory: fileLoader,
74
+ },
75
+ ],
76
+ })
77
+ export class TestComponent {
78
+ }`;
79
+ const PACKAGE_BEFORE = `{
80
+ "dependencies": {
81
+ "@angular/core": "~13.0.0",
82
+ "@taiga-ui/addon-editor": "3.35.0"
83
+ }
84
+ }`;
85
+ const PACKAGE_AFTER = `{
86
+ "dependencies": {
87
+ "@angular/core": "~13.0.0",
88
+ "@tinkoff/tui-editor": "^1.0.1"
89
+ }
90
+ }`;
91
+ describe(`ng-update`, () => {
92
+ let host;
93
+ let runner;
94
+ beforeEach(() => {
95
+ host = new testing_1.UnitTestTree(new schematics_1.HostTree());
96
+ runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
97
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
98
+ createMainFiles();
99
+ ng_morph_1.saveActiveProject();
100
+ });
101
+ it(`should migrate addon-editor`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
102
+ const tree = yield runner
103
+ .runSchematicAsync(`updateToV3_36`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
104
+ .toPromise();
105
+ expect(tree.readContent(`test/app/test.component.ts`)).toEqual(COMPONENT_AFTER);
106
+ expect(tree.readContent(`package.json`)).toEqual(PACKAGE_AFTER);
107
+ }));
108
+ afterEach(() => {
109
+ ng_morph_1.resetActiveProject();
110
+ });
111
+ });
112
+ function createMainFiles() {
113
+ ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT_BEFORE);
114
+ ng_morph_1.createSourceFile(`test/app/test.template.html`, `<tui-editor></tui-editor>`);
115
+ create_angular_json_1.createAngularJson();
116
+ ng_morph_1.createSourceFile(`package.json`, PACKAGE_BEFORE);
117
+ }
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /* eslint-disable rxjs/no-topromise */
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ const testing_1 = require("@angular-devkit/schematics/testing");
7
+ const ng_morph_1 = require("ng-morph");
8
+ const path_1 = require("path");
9
+ const create_angular_json_1 = require("../../../utils/create-angular-json");
10
+ const collectionPath = path_1.join(__dirname, `../../../migration.json`);
11
+ const COMPONENT_BEFORE = `
12
+ import { TuiTextAreaModule, TuiTextAreaComponent } from '@taiga-ui/kit';
13
+
14
+ @Component({
15
+ standalone: true,
16
+ templateUrl: './test.template.html',
17
+ imports: [TuiTextAreaModule]
18
+ })
19
+ export class TestComponent {
20
+ @ViewChild(TuiTextAreaComponent)
21
+ textArea: TuiTextAreaComponent;
22
+
23
+ @ViewChild(TuiTextAreaDirective)
24
+ directive: TuiTextAreaDirective;
25
+
26
+ ngOnInit() {
27
+ console.log(document.querySelector('[automation-id="tui-text-area__wrapper"]'));
28
+ console.log(document.querySelector('[automation-id="tui-text-area__counter"]'));
29
+ console.log(document.querySelector('[automation-id="tui-text-area__scrollbar"]'));
30
+ }
31
+ }`;
32
+ const COMPONENT_AFTER = `
33
+ import { TuiTextareaModule, TuiTextareaComponent } from '@taiga-ui/kit';
34
+
35
+ @Component({
36
+ standalone: true,
37
+ templateUrl: './test.template.html',
38
+ imports: [TuiTextareaModule]
39
+ })
40
+ export class TestComponent {
41
+ @ViewChild(TuiTextareaComponent)
42
+ textArea: TuiTextareaComponent;
43
+
44
+ @ViewChild(TuiTextareaDirective)
45
+ directive: TuiTextareaDirective;
46
+
47
+ ngOnInit() {
48
+ console.log(document.querySelector('[automation-id="tui-text-area__wrapper"]'));
49
+ console.log(document.querySelector('[automation-id="tui-text-area__counter"]'));
50
+ console.log(document.querySelector('[automation-id="tui-text-area__scrollbar"]'));
51
+ }
52
+ }`;
53
+ const TEMPLATE_BEFORE = `
54
+ <tui-text-area class="tui-text-area"></tui-text-area>
55
+ <tui-text-area class="tui-text-area" />
56
+ `;
57
+ const TEMPLATE_AFTER = `
58
+ <tui-textarea class="tui-text-area"></tui-textarea>
59
+ <tui-textarea class="tui-text-area" />
60
+ `;
61
+ describe(`ng-update`, () => {
62
+ let host;
63
+ let runner;
64
+ beforeEach(() => {
65
+ host = new testing_1.UnitTestTree(new schematics_1.HostTree());
66
+ runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
67
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
68
+ createMainFiles();
69
+ ng_morph_1.saveActiveProject();
70
+ });
71
+ it(`should migrate textarea tag in template`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
72
+ const tree = yield runner
73
+ .runSchematicAsync(`updateToV3_40`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
74
+ .toPromise();
75
+ expect(tree.readContent(`test/app/test.template.html`)).toEqual(TEMPLATE_AFTER);
76
+ }));
77
+ it(`should migrate textarea references in ts files`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
78
+ const tree = yield runner
79
+ .runSchematicAsync(`updateToV3_40`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
80
+ .toPromise();
81
+ expect(tree.readContent(`test/app/test.component.ts`)).toEqual(COMPONENT_AFTER);
82
+ }));
83
+ afterEach(() => ng_morph_1.resetActiveProject());
84
+ });
85
+ function createMainFiles() {
86
+ ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT_BEFORE);
87
+ ng_morph_1.createSourceFile(`test/app/test.template.html`, TEMPLATE_BEFORE);
88
+ create_angular_json_1.createAngularJson();
89
+ ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0", "@taiga-ui/kit": "~3.36.0"}}`);
90
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /* eslint-disable rxjs/no-topromise */
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ const testing_1 = require("@angular-devkit/schematics/testing");
7
+ const ng_morph_1 = require("ng-morph");
8
+ const path_1 = require("path");
9
+ const create_angular_json_1 = require("../../../utils/create-angular-json");
10
+ const collectionPath = path_1.join(__dirname, `../../../migration.json`);
11
+ const COMPONENT_WITH_TEMPLATE_URL = `
12
+ @Component({templateUrl: './test.template.html'})
13
+ export class TestComponent {}
14
+ `;
15
+ const TEMPLATE_BEFORE = `
16
+ <tui-expand>
17
+ <ng-template>
18
+ content
19
+ </ng-template>
20
+ </tui-expand>
21
+
22
+ <tui-expand>
23
+ <ng-template tuiExpandContent>
24
+ content
25
+ </ng-template>
26
+ </tui-expand>
27
+
28
+ <tui-expand>
29
+ <div>eager content</div>
30
+ </tui-expand>
31
+ `;
32
+ const TEMPLATE_AFTER = `
33
+ <tui-expand>
34
+ <ng-template tuiExpandContent>
35
+ content
36
+ </ng-template>
37
+ </tui-expand>
38
+
39
+ <tui-expand>
40
+ <ng-template tuiExpandContent>
41
+ content
42
+ </ng-template>
43
+ </tui-expand>
44
+
45
+ <tui-expand>
46
+ <div>eager content</div>
47
+ </tui-expand>
48
+ `;
49
+ describe(`ng-update`, () => {
50
+ let host;
51
+ let runner;
52
+ beforeEach(() => {
53
+ host = new testing_1.UnitTestTree(new schematics_1.HostTree());
54
+ runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
55
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
56
+ createMainFiles();
57
+ ng_morph_1.saveActiveProject();
58
+ });
59
+ it(`should edit templates`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
60
+ const tree = yield runner
61
+ .runSchematicAsync(`updateToV3_5`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
62
+ .toPromise();
63
+ expect(tree.readContent(`test/app/test.template.html`)).toEqual(TEMPLATE_AFTER);
64
+ }));
65
+ afterEach(() => {
66
+ ng_morph_1.resetActiveProject();
67
+ });
68
+ });
69
+ function createMainFiles() {
70
+ ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT_WITH_TEMPLATE_URL);
71
+ ng_morph_1.createSourceFile(`test/app/test.template.html`, TEMPLATE_BEFORE);
72
+ create_angular_json_1.createAngularJson();
73
+ ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
74
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /* eslint-disable rxjs/no-topromise */
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ const testing_1 = require("@angular-devkit/schematics/testing");
7
+ const ng_morph_1 = require("ng-morph");
8
+ const path_1 = require("path");
9
+ const create_angular_json_1 = require("../../../utils/create-angular-json");
10
+ const collectionPath = path_1.join(__dirname, `../../../migration.json`);
11
+ const COMPONENT_BEFORE = `
12
+ import { TuiCardModule, TuiCardComponent } from '@taiga-ui/addon-commerce';
13
+
14
+ @Component({
15
+ standalone: true,
16
+ templateUrl: './test.template.html',
17
+ imports: [TuiCardModule]
18
+ })
19
+ export class TestComponent {
20
+ @ViewChild(TuiCardComponent)
21
+ card: TuiCardComponent;
22
+ }`;
23
+ const COMPONENT_AFTER = `
24
+ import { TuiThumbnailCardModule, TuiThumbnailCardComponent } from '@taiga-ui/addon-commerce';
25
+
26
+ @Component({
27
+ standalone: true,
28
+ templateUrl: './test.template.html',
29
+ imports: [TuiThumbnailCardModule]
30
+ })
31
+ export class TestComponent {
32
+ @ViewChild(TuiThumbnailCardComponent)
33
+ card: TuiThumbnailCardComponent;
34
+ }`;
35
+ const TEMPLATE_BEFORE = `
36
+ <tui-card class="tui-card"></tui-card>
37
+ <tui-card class="tui-card" />
38
+ `;
39
+ const TEMPLATE_AFTER = `
40
+ <tui-thumbnail-card class="tui-card"></tui-thumbnail-card>
41
+ <tui-thumbnail-card class="tui-card" />
42
+ `;
43
+ describe(`ng-update`, () => {
44
+ let host;
45
+ let runner;
46
+ beforeEach(() => {
47
+ host = new testing_1.UnitTestTree(new schematics_1.HostTree());
48
+ runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
49
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
50
+ createMainFiles();
51
+ ng_morph_1.saveActiveProject();
52
+ });
53
+ it(`should migrate textarea tag in template`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
54
+ const tree = yield runner
55
+ .runSchematicAsync(`updateToV4`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
56
+ .toPromise();
57
+ expect(tree.readContent(`test/app/test.template.html`)).toEqual(TEMPLATE_AFTER);
58
+ }));
59
+ it(`should migrate textarea references in ts files`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
60
+ const tree = yield runner
61
+ .runSchematicAsync(`updateToV4`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
62
+ .toPromise();
63
+ expect(tree.readContent(`test/app/test.component.ts`)).toEqual(COMPONENT_AFTER);
64
+ }));
65
+ afterEach(() => ng_morph_1.resetActiveProject());
66
+ });
67
+ function createMainFiles() {
68
+ ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT_BEFORE);
69
+ ng_morph_1.createSourceFile(`test/app/test.template.html`, TEMPLATE_BEFORE);
70
+ create_angular_json_1.createAngularJson();
71
+ ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0", "@taiga-ui/addon-commerce": "~3.42.0"}}`);
72
+ }
@@ -1,6 +1,5 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  import { Observable } from 'rxjs';
3
2
  /**
4
3
  * Active element on the document for ActiveZone
5
4
  */
6
- export declare const TUI_ACTIVE_ELEMENT: InjectionToken<Observable<EventTarget | null>>;
5
+ export declare const TUI_ACTIVE_ELEMENT: import("@angular/core").InjectionToken<Observable<EventTarget | null>>;
@@ -1,8 +1,8 @@
1
- import { InjectionToken, Renderer2 } from '@angular/core';
1
+ import { Renderer2 } from '@angular/core';
2
2
  /**
3
3
  * A Renderer2 for global services
4
4
  * https://github.com/angular/angular/issues/17824#issuecomment-353239017
5
5
  * @deprecated unnecessary
6
6
  * TODO: remove in 4.0
7
7
  */
8
- export declare const TUI_DEFAULT_RENDERER: InjectionToken<Renderer2>;
8
+ export declare const TUI_DEFAULT_RENDERER: import("@angular/core").InjectionToken<Renderer2>;
@@ -1,2 +1 @@
1
- import { InjectionToken } from '@angular/core';
2
- export declare const TUI_ENSURE_BASE_HREF: InjectionToken<string>;
1
+ export declare const TUI_ENSURE_BASE_HREF: import("@angular/core").InjectionToken<string>;
@@ -1,5 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  /**
3
2
  * Mobile browser that is not iOS (technically includes Windows Phone, Blackberry etc.)
4
3
  */
5
- export declare const TUI_IS_ANDROID: InjectionToken<boolean>;
4
+ export declare const TUI_IS_ANDROID: import("@angular/core").InjectionToken<boolean>;
@@ -1,5 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  /**
3
2
  * Apple(safari/webkit) detection
4
3
  */
5
- export declare const TUI_IS_APPLE: InjectionToken<boolean>;
4
+ export declare const TUI_IS_APPLE: import("@angular/core").InjectionToken<boolean>;
@@ -1,5 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  /**
3
2
  * Chromium browser engine detection
4
3
  */
5
- export declare const TUI_IS_CHROMIUM: InjectionToken<boolean>;
4
+ export declare const TUI_IS_CHROMIUM: import("@angular/core").InjectionToken<boolean>;
@@ -1,6 +1,5 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  /**
3
2
  * Detect if app is running under Cypress
4
3
  * {@link https://docs.cypress.io/faq/questions/using-cypress-faq#Is-there-any-way-to-detect-if-my-app-is-running-under-Cypress Cypress docs}
5
4
  */
6
- export declare const TUI_IS_CYPRESS: InjectionToken<boolean>;
5
+ export declare const TUI_IS_CYPRESS: import("@angular/core").InjectionToken<boolean>;
@@ -1,5 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  /**
3
2
  * Detect if app is running under any of test frameworks
4
3
  */
5
- export declare const TUI_IS_E2E: InjectionToken<boolean>;
4
+ export declare const TUI_IS_E2E: import("@angular/core").InjectionToken<boolean>;
@@ -1,5 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  /**
3
2
  * Firefox browser engine detection
4
3
  */
5
- export declare const TUI_IS_FIREFOX: InjectionToken<boolean>;
4
+ export declare const TUI_IS_FIREFOX: import("@angular/core").InjectionToken<boolean>;
@@ -1,5 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  /**
3
2
  * iOS browser detection
4
3
  */
5
- export declare const TUI_IS_IOS: InjectionToken<boolean>;
4
+ export declare const TUI_IS_IOS: import("@angular/core").InjectionToken<boolean>;
@@ -1,5 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  /**
3
2
  * Mobile browser detection
4
3
  */
5
- export declare const TUI_IS_MOBILE: InjectionToken<boolean>;
4
+ export declare const TUI_IS_MOBILE: import("@angular/core").InjectionToken<boolean>;
@@ -1,5 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  /**
3
2
  * Detect if app is running under Playwright
4
3
  */
5
- export declare const TUI_IS_PLAYWRIGHT: InjectionToken<boolean>;
4
+ export declare const TUI_IS_PLAYWRIGHT: import("@angular/core").InjectionToken<boolean>;
@@ -1,2 +1 @@
1
- import { InjectionToken } from '@angular/core';
2
- export declare const TUI_IS_STACKBLITZ: InjectionToken<boolean>;
1
+ export declare const TUI_IS_STACKBLITZ: import("@angular/core").InjectionToken<boolean>;