@taiga-ui/cdk 3.45.0 → 3.46.0-canary.0ec50ee

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 (79) hide show
  1. package/bundles/taiga-ui-cdk-constants.umd.js +1 -1
  2. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +8 -15
  4. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-tokens.umd.js +6 -0
  6. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  7. package/constants/version.d.ts +1 -1
  8. package/constants/version.js +1 -1
  9. package/esm2015/constants/version.js +2 -2
  10. package/esm2015/directives/active-zone/active-zone.directive.js +9 -16
  11. package/esm2015/tokens/base-href.js +5 -0
  12. package/esm2015/tokens/ensure-base-href.js +4 -1
  13. package/esm2015/tokens/index.js +2 -1
  14. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  15. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  16. package/fesm2015/taiga-ui-cdk-directives-active-zone.js +8 -15
  17. package/fesm2015/taiga-ui-cdk-directives-active-zone.js.map +1 -1
  18. package/fesm2015/taiga-ui-cdk-tokens.js +6 -1
  19. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  20. package/package.json +4 -4
  21. package/tokens/base-href.d.ts +1 -0
  22. package/tokens/ensure-base-href.d.ts +3 -0
  23. package/tokens/index.d.ts +1 -0
  24. package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.d.ts +0 -1
  25. package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.js +0 -381
  26. package/schematics/ng-add/tests/schematic-ng-add.spec.d.ts +0 -1
  27. package/schematics/ng-add/tests/schematic-ng-add.spec.js +0 -270
  28. package/schematics/ng-update/v3/tests/schematic-date-time.spec.d.ts +0 -1
  29. package/schematics/ng-update/v3/tests/schematic-date-time.spec.js +0 -117
  30. package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.d.ts +0 -1
  31. package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.js +0 -102
  32. package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.d.ts +0 -1
  33. package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.js +0 -107
  34. package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.d.ts +0 -1
  35. package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.js +0 -113
  36. package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.d.ts +0 -1
  37. package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.js +0 -380
  38. package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.d.ts +0 -1
  39. package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.js +0 -119
  40. package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.d.ts +0 -1
  41. package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.js +0 -123
  42. package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.d.ts +0 -1
  43. package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.js +0 -81
  44. package/schematics/ng-update/v3/tests/schematic-rename-types.spec.d.ts +0 -1
  45. package/schematics/ng-update/v3/tests/schematic-rename-types.spec.js +0 -157
  46. package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.d.ts +0 -1
  47. package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.js +0 -135
  48. package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.d.ts +0 -1
  49. package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.js +0 -53
  50. package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.d.ts +0 -1
  51. package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.js +0 -835
  52. package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.d.ts +0 -1
  53. package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.js +0 -68
  54. package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.d.ts +0 -1
  55. package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.js +0 -195
  56. package/schematics/ng-update/v3/tests/schematic-replace-html.spec.d.ts +0 -1
  57. package/schematics/ng-update/v3/tests/schematic-replace-html.spec.js +0 -611
  58. package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.d.ts +0 -1
  59. package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.js +0 -100
  60. package/schematics/ng-update/v3/tests/schematic-replace-services.spec.d.ts +0 -1
  61. package/schematics/ng-update/v3/tests/schematic-replace-services.spec.js +0 -102
  62. package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.d.ts +0 -1
  63. package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.js +0 -286
  64. package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.d.ts +0 -1
  65. package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.js +0 -141
  66. package/schematics/ng-update/v3/tests/schematic-warnings.spec.d.ts +0 -1
  67. package/schematics/ng-update/v3/tests/schematic-warnings.spec.js +0 -104
  68. package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.d.ts +0 -1
  69. package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.js +0 -87
  70. package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.d.ts +0 -1
  71. package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.js +0 -101
  72. package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.d.ts +0 -1
  73. package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.js +0 -117
  74. package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.d.ts +0 -1
  75. package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.js +0 -90
  76. package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.d.ts +0 -1
  77. package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.js +0 -74
  78. package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.d.ts +0 -1
  79. package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.js +0 -72
@@ -1,87 +0,0 @@
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
- }
@@ -1,101 +0,0 @@
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
- }
@@ -1,117 +0,0 @@
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
- }
@@ -1,90 +0,0 @@
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
- }
@@ -1,74 +0,0 @@
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
- }
@@ -1,72 +0,0 @@
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
- }