@taiga-ui/cdk 3.44.0-canary.b3de48e → 3.44.1-canary.aa80e1e

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 (117) 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-tokens.umd.js +86 -123
  6. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +6 -10
  8. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  9. package/constants/version.d.ts +1 -1
  10. package/constants/version.js +1 -1
  11. package/esm2015/abstract/interactive.js +5 -2
  12. package/esm2015/constants/version.js +2 -2
  13. package/esm2015/tokens/active-element.js +38 -40
  14. package/esm2015/tokens/default-renderer.js +6 -6
  15. package/esm2015/tokens/ensure-base-href.js +12 -13
  16. package/esm2015/tokens/is-android.js +4 -5
  17. package/esm2015/tokens/is-apple.js +4 -6
  18. package/esm2015/tokens/is-chromium.js +4 -5
  19. package/esm2015/tokens/is-cypress.js +4 -5
  20. package/esm2015/tokens/is-e2e.js +4 -5
  21. package/esm2015/tokens/is-firefox.js +6 -7
  22. package/esm2015/tokens/is-ios.js +4 -6
  23. package/esm2015/tokens/is-mobile.js +5 -6
  24. package/esm2015/tokens/is-playwright.js +3 -5
  25. package/esm2015/tokens/is-stackblitz.js +4 -5
  26. package/esm2015/tokens/is-webkit.js +6 -7
  27. package/esm2015/tokens/range.js +4 -5
  28. package/esm2015/tokens/removed-element.js +13 -14
  29. package/esm2015/tokens/take-only-trusted-events.js +3 -5
  30. package/esm2015/tokens/touch-supported.js +4 -5
  31. package/esm2015/tokens/window-height.js +4 -5
  32. package/esm2015/utils/miscellaneous/create-options.js +3 -5
  33. package/esm2015/utils/miscellaneous/create-token.js +2 -4
  34. package/fesm2015/taiga-ui-cdk-abstract.js +5 -2
  35. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  36. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  37. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  38. package/fesm2015/taiga-ui-cdk-tokens.js +79 -116
  39. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  40. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +6 -10
  41. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  42. package/package.json +1 -1
  43. package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.d.ts +1 -0
  44. package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.js +381 -0
  45. package/schematics/ng-add/tests/schematic-ng-add.spec.d.ts +1 -0
  46. package/schematics/ng-add/tests/schematic-ng-add.spec.js +270 -0
  47. package/schematics/ng-update/v3/tests/schematic-date-time.spec.d.ts +1 -0
  48. package/schematics/ng-update/v3/tests/schematic-date-time.spec.js +117 -0
  49. package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.d.ts +1 -0
  50. package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.js +102 -0
  51. package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.d.ts +1 -0
  52. package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.js +107 -0
  53. package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.d.ts +1 -0
  54. package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.js +113 -0
  55. package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.d.ts +1 -0
  56. package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.js +380 -0
  57. package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.d.ts +1 -0
  58. package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.js +119 -0
  59. package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.d.ts +1 -0
  60. package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.js +123 -0
  61. package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.d.ts +1 -0
  62. package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.js +81 -0
  63. package/schematics/ng-update/v3/tests/schematic-rename-types.spec.d.ts +1 -0
  64. package/schematics/ng-update/v3/tests/schematic-rename-types.spec.js +157 -0
  65. package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.d.ts +1 -0
  66. package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.js +135 -0
  67. package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.d.ts +1 -0
  68. package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.js +53 -0
  69. package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.d.ts +1 -0
  70. package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.js +835 -0
  71. package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.d.ts +1 -0
  72. package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.js +68 -0
  73. package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.d.ts +1 -0
  74. package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.js +195 -0
  75. package/schematics/ng-update/v3/tests/schematic-replace-html.spec.d.ts +1 -0
  76. package/schematics/ng-update/v3/tests/schematic-replace-html.spec.js +611 -0
  77. package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.d.ts +1 -0
  78. package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.js +100 -0
  79. package/schematics/ng-update/v3/tests/schematic-replace-services.spec.d.ts +1 -0
  80. package/schematics/ng-update/v3/tests/schematic-replace-services.spec.js +102 -0
  81. package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.d.ts +1 -0
  82. package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.js +286 -0
  83. package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.d.ts +1 -0
  84. package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.js +141 -0
  85. package/schematics/ng-update/v3/tests/schematic-warnings.spec.d.ts +1 -0
  86. package/schematics/ng-update/v3/tests/schematic-warnings.spec.js +104 -0
  87. package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.d.ts +1 -0
  88. package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.js +87 -0
  89. package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.d.ts +1 -0
  90. package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.js +101 -0
  91. package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.d.ts +1 -0
  92. package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.js +117 -0
  93. package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.d.ts +1 -0
  94. package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.js +90 -0
  95. package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.d.ts +1 -0
  96. package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.js +74 -0
  97. package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.d.ts +1 -0
  98. package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.js +72 -0
  99. package/tokens/active-element.d.ts +1 -2
  100. package/tokens/default-renderer.d.ts +2 -2
  101. package/tokens/ensure-base-href.d.ts +1 -2
  102. package/tokens/is-android.d.ts +1 -2
  103. package/tokens/is-apple.d.ts +1 -2
  104. package/tokens/is-chromium.d.ts +1 -2
  105. package/tokens/is-cypress.d.ts +1 -2
  106. package/tokens/is-e2e.d.ts +1 -2
  107. package/tokens/is-firefox.d.ts +1 -2
  108. package/tokens/is-ios.d.ts +1 -2
  109. package/tokens/is-mobile.d.ts +1 -2
  110. package/tokens/is-playwright.d.ts +1 -2
  111. package/tokens/is-stackblitz.d.ts +1 -2
  112. package/tokens/is-webkit.d.ts +1 -2
  113. package/tokens/range.d.ts +1 -2
  114. package/tokens/removed-element.d.ts +1 -3
  115. package/tokens/take-only-trusted-events.d.ts +1 -2
  116. package/tokens/touch-supported.d.ts +1 -2
  117. package/tokens/window-height.d.ts +1 -3
@@ -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 BEFORE = `import {Component} from '@angular/core';
12
+ import {TuiDay, TuiMonth, TuiDayRange} from '@taiga-ui/cdk';
13
+
14
+ const day = new TuiDay(0, 0, 10).formattedDay;
15
+
16
+ @Component({templateUrl: './app.template.html'})
17
+ export class AppComponent {
18
+ some = new TuiDay();
19
+ formatted = new TuiDay().formattedDay;
20
+
21
+ range = new TuiDayRange(this.some, this.some);
22
+ formattedRange = this.range.formattedDayRange;
23
+ normalized = TuiDayRange.normalizeParse(a, b, c);
24
+
25
+ other: TuiDay = getTuiDay();
26
+ value: TuiMonth | null = null;
27
+
28
+ show(): void {
29
+ const kek = this.some;
30
+ kek.formattedDay;
31
+ this.some.formattedDay;
32
+
33
+ this.other.formattedDay;
34
+
35
+ this.other.getDayFromMonthRowCol(1, 2, 3);
36
+
37
+ return this.value.formattedMonth;
38
+ }
39
+
40
+ dummyFn1() {
41
+ const {value, var1} = this;
42
+
43
+ return value.notDeprecatedProperty;
44
+ }
45
+
46
+ dummyFn2() {
47
+ const {value, var2} = this;
48
+ }
49
+ }`;
50
+ const AFTER = `import {Component} from '@angular/core';
51
+ import {TuiDay, TuiMonth, TuiDayRange} from '@taiga-ui/cdk';
52
+
53
+ const day = new TuiDay(0, 0, 10).getFormattedDay("DMY", ".");
54
+
55
+ @Component({templateUrl: './app.template.html'})
56
+ export class AppComponent {
57
+ some = new TuiDay();
58
+ formatted = new TuiDay().getFormattedDay("DMY", ".");
59
+
60
+ range = new TuiDayRange(this.some, this.some);
61
+ formattedRange = this.range.getFormattedDayRange("DMY", ".");
62
+ normalized = TuiDayRange.normalizeParse(a, "DMY");
63
+
64
+ other: TuiDay = getTuiDay();
65
+ value: TuiMonth | null = null;
66
+
67
+ show(): void {
68
+ const kek = this.some;
69
+ kek.getFormattedDay("DMY", ".");
70
+ this.some.getFormattedDay("DMY", ".");
71
+
72
+ this.other.getFormattedDay("DMY", ".");
73
+
74
+ // TODO: (Taiga UI migration) getDayFromMonthRowCol has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet
75
+ this.other.getDayFromMonthRowCol(1, 2, 3);
76
+
77
+ // TODO: (Taiga UI migration) formattedMonth has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit
78
+ return this.value.formattedMonth;
79
+ }
80
+
81
+ dummyFn1() {
82
+ const {value, var1} = this;
83
+
84
+ return value.notDeprecatedProperty;
85
+ }
86
+
87
+ dummyFn2() {
88
+ const {value, var2} = this;
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(`date-time migrations`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
102
+ const tree = yield runner
103
+ .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
104
+ .toPromise();
105
+ expect(tree.readContent(`test/app/app.component.ts`)).toEqual(AFTER);
106
+ }));
107
+ afterEach(() => {
108
+ ng_morph_1.resetActiveProject();
109
+ });
110
+ });
111
+ function createMainFiles() {
112
+ ng_morph_1.createSourceFile(`test/app/app.component.ts`, BEFORE);
113
+ ng_morph_1.createSourceFile(`test/app/mock.ts`, `export class TuiDay {}`);
114
+ ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
115
+ create_angular_json_1.createAngularJson();
116
+ ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
117
+ }
@@ -0,0 +1,102 @@
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
+ <button
17
+ tuiButton
18
+ tuiHintDirection="bottom-middle"
19
+ tuiHintMode="onDark"
20
+ tuiPointerHint="Wow! How exciting!"
21
+ ></button>
22
+
23
+ <button
24
+ tuiButton
25
+ type="button"
26
+ [tuiManualHint]="template"
27
+ [tuiManualHintShow]="hintShown"
28
+ (click)="toggleHint()"
29
+ >
30
+ Hint
31
+ </button>
32
+
33
+ <tui-bar-chart
34
+ class="chart"
35
+ [value]="value"
36
+ [hintContent]="hint"
37
+ [hintMode]="appearance"
38
+ ></tui-bar-chart>
39
+
40
+ <tui-tooltip
41
+ describeId="example3"
42
+ mode="onDark"
43
+ content="some tooltip content"
44
+ ></tui-tooltip>
45
+ `;
46
+ const TEMPLATE_AFTER = `
47
+ <button
48
+ tuiButton
49
+ tuiHintDirection="bottom"
50
+ tuiHintAppearance="onDark"
51
+ tuiHintPointer tuiHint="Wow! How exciting!"
52
+ ></button>
53
+
54
+ <button
55
+ tuiButton
56
+ type="button"
57
+ [tuiHint]="template"
58
+ [tuiHintManual]="hintShown"
59
+ (click)="toggleHint()"
60
+ >
61
+ Hint
62
+ </button>
63
+
64
+ <tui-bar-chart
65
+ class="chart"
66
+ [value]="value"
67
+ [tuiHintContent]="hint"
68
+ [tuiHintAppearance]="appearance"
69
+ ></tui-bar-chart>
70
+
71
+ <tui-tooltip
72
+ describeId="example3"
73
+ appearance="onDark"
74
+ content="some tooltip content"
75
+ ></tui-tooltip>
76
+ `;
77
+ describe(`ng-update`, () => {
78
+ let host;
79
+ let runner;
80
+ beforeEach(() => {
81
+ host = new testing_1.UnitTestTree(new schematics_1.HostTree());
82
+ runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
83
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
84
+ createMainFiles();
85
+ ng_morph_1.saveActiveProject();
86
+ });
87
+ it(`should migrate polymorpheus`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
88
+ const tree = yield runner
89
+ .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
90
+ .toPromise();
91
+ expect(tree.readContent(`test/app/test.template.html`)).toEqual(TEMPLATE_AFTER);
92
+ }));
93
+ afterEach(() => {
94
+ ng_morph_1.resetActiveProject();
95
+ });
96
+ });
97
+ function createMainFiles() {
98
+ ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT_WITH_TEMPLATE_URL);
99
+ ng_morph_1.createSourceFile(`test/app/test.template.html`, TEMPLATE_BEFORE);
100
+ create_angular_json_1.createAngularJson();
101
+ ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
102
+ }
@@ -0,0 +1,107 @@
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
+ <div
17
+ polymorpheus-outlet
18
+ [content]="content"
19
+ [context]="myContext"
20
+ ></div>
21
+
22
+ <div
23
+ polymorpheus-outlet
24
+ [content]="content"
25
+ [context]="context"
26
+ >
27
+ <ng-template let-hapicaCamelCase>
28
+ <div>{{ hapicaCamelCase }}</div>
29
+ </ng-template>
30
+ </div>
31
+
32
+ <div
33
+ *ngIf="icon"
34
+ polymorpheus-outlet
35
+ class="t-icon-outlet"
36
+ [content]="icon"
37
+ >
38
+ <ng-template let-icon>
39
+ <tui-svg
40
+ automation-id="tui-input-card-grouped__icon"
41
+ class="t-card"
42
+ [src]="icon"
43
+ ></tui-svg>
44
+ </ng-template>
45
+ </div>
46
+ `;
47
+ const TEMPLATE_AFTER = `
48
+ <div
49
+ ${``}
50
+ ${``}
51
+ ${``}
52
+ >
53
+ <ng-container *polymorpheusOutlet="content as text; context: myContext">
54
+ {{ text }}
55
+ </ng-container></div>
56
+
57
+ <div
58
+ ${``}
59
+ ${``}
60
+ ${``}
61
+ >
62
+ <ng-container *polymorpheusOutlet="content as hapicaCamelCase; context: context" >
63
+ <div>{{ hapicaCamelCase }}</div>
64
+ </ng-container>
65
+ </div>
66
+
67
+ <div
68
+ *ngIf="icon"
69
+ ${``}
70
+ class="t-icon-outlet"
71
+ ${``}
72
+ >
73
+ <ng-container *polymorpheusOutlet="icon as icon" >
74
+ <tui-svg
75
+ automation-id="tui-input-card-grouped__icon"
76
+ class="t-card"
77
+ [src]="icon"
78
+ ></tui-svg>
79
+ </ng-container>
80
+ </div>
81
+ `;
82
+ describe(`ng-update`, () => {
83
+ let host;
84
+ let runner;
85
+ beforeEach(() => {
86
+ host = new testing_1.UnitTestTree(new schematics_1.HostTree());
87
+ runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
88
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
89
+ createMainFiles();
90
+ ng_morph_1.saveActiveProject();
91
+ });
92
+ it(`should migrate polymorpheus`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
93
+ const tree = yield runner
94
+ .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
95
+ .toPromise();
96
+ expect(tree.readContent(`test/app/test.template.html`)).toEqual(TEMPLATE_AFTER);
97
+ }));
98
+ afterEach(() => {
99
+ ng_morph_1.resetActiveProject();
100
+ });
101
+ });
102
+ function createMainFiles() {
103
+ ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT_WITH_TEMPLATE_URL);
104
+ ng_morph_1.createSourceFile(`test/app/test.template.html`, TEMPLATE_BEFORE);
105
+ create_angular_json_1.createAngularJson();
106
+ ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
107
+ }
@@ -0,0 +1,113 @@
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 migrate_progress_1 = require("../steps/migrate-progress");
11
+ const collectionPath = path_1.join(__dirname, `../../../migration.json`);
12
+ const APP_COMPONENT = `
13
+ @Component({templateUrl: './app.template.html'})
14
+ export class AppComponent {
15
+ readonly complexGradient = 'linear-gradient(to right, var(--tui-support-02), var(--tui-support-14), var(--tui-support-12))';
16
+ }
17
+ `;
18
+ const TEMPLATE_BEFORE = `
19
+ <progress
20
+ tuiProgressBar
21
+ class="progress"
22
+ [value]="slowValue$ | async"
23
+ [max]="colors.length"
24
+ [color]="colors | tuiProgressColorSegments"
25
+ ></progress>
26
+
27
+ <progress tuiProgressBar [max]="100" [value]="40" [color]="colors | tuiProgressColorSegmentsAsync | async"></progress>
28
+
29
+ <progress
30
+ tuiProgressBar
31
+ max="100"
32
+ [color]="complexGradient"
33
+ [value]="fastValue$ | async"
34
+ ></progress>
35
+
36
+ <progress
37
+ tuiProgressBar
38
+ [tuiProgressColorSegments]="colors"
39
+ [value]="fastValue$ | async"
40
+ ></progress>
41
+ `;
42
+ const TEMPLATE_AFTER = `
43
+ <progress
44
+ tuiProgressBar
45
+ class="progress"
46
+ [value]="slowValue$ | async"
47
+ [max]="colors.length"
48
+ [tuiProgressColorSegments]="colors"
49
+ ></progress>
50
+
51
+ <progress tuiProgressBar [max]="100" [value]="40" [tuiProgressColorSegments]="colors"></progress>
52
+
53
+ <progress
54
+ tuiProgressBar
55
+ max="100"
56
+ [color]="complexGradient"
57
+ [value]="fastValue$ | async"
58
+ ></progress>
59
+
60
+ <progress
61
+ tuiProgressBar
62
+ [tuiProgressColorSegments]="colors"
63
+ [value]="fastValue$ | async"
64
+ ></progress>
65
+ `;
66
+ describe(`migrate progress`, () => {
67
+ let host;
68
+ let runner;
69
+ beforeEach(() => {
70
+ host = new testing_1.UnitTestTree(new schematics_1.HostTree());
71
+ runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
72
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
73
+ createMainFiles();
74
+ ng_morph_1.saveActiveProject();
75
+ });
76
+ describe(`migration works`, () => {
77
+ it(`html`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
78
+ const tree = yield runner
79
+ .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
80
+ .toPromise();
81
+ expect(tree.readContent(`test/app-with-progress/app.template.html`)).toBe(TEMPLATE_AFTER);
82
+ }));
83
+ });
84
+ describe(`DEPRECATED_PROGRESS_PIPES_REG`, () => {
85
+ it(`colors | tuiProgressColorSegments`, () => {
86
+ expect(`[tuiProgressColorSegments]="colors | tuiProgressColorSegments"`.replace(migrate_progress_1.DEPRECATED_PROGRESS_PIPES_REG, ``)).toBe(`[tuiProgressColorSegments]="colors"`);
87
+ });
88
+ it(`colors|tuiProgressColorSegments`, () => {
89
+ expect(`[tuiProgressColorSegments]="colors|tuiProgressColorSegments"`.replace(migrate_progress_1.DEPRECATED_PROGRESS_PIPES_REG, ``)).toBe(`[tuiProgressColorSegments]="colors"`);
90
+ });
91
+ it(`colors | tuiProgressColorSegments | customPipe`, () => {
92
+ expect(`[tuiProgressColorSegments]="colors | customPipe | tuiProgressColorSegments"`.replace(migrate_progress_1.DEPRECATED_PROGRESS_PIPES_REG, ``)).toBe(`[tuiProgressColorSegments]="colors | customPipe"`);
93
+ });
94
+ it(`colors | tuiProgressColorSegmentsAsync | async`, () => {
95
+ expect(`[tuiProgressColorSegments]="colors | tuiProgressColorSegmentsAsync | async"`.replace(migrate_progress_1.DEPRECATED_PROGRESS_PIPES_REG, ``)).toBe(`[tuiProgressColorSegments]="colors"`);
96
+ });
97
+ it(`colors|tuiProgressColorSegmentsAsync|async`, () => {
98
+ expect(`[tuiProgressColorSegments]="colors | tuiProgressColorSegmentsAsync | async"`.replace(migrate_progress_1.DEPRECATED_PROGRESS_PIPES_REG, ``)).toBe(`[tuiProgressColorSegments]="colors"`);
99
+ });
100
+ it(`colors | customPipe | tuiProgressColorSegmentsAsync | async`, () => {
101
+ expect(`[tuiProgressColorSegments]="colors | customPipe | tuiProgressColorSegmentsAsync | async"`.replace(migrate_progress_1.DEPRECATED_PROGRESS_PIPES_REG, ``)).toBe(`[tuiProgressColorSegments]="colors | customPipe"`);
102
+ });
103
+ });
104
+ afterEach(() => {
105
+ ng_morph_1.resetActiveProject();
106
+ });
107
+ });
108
+ function createMainFiles() {
109
+ ng_morph_1.createSourceFile(`test/app-with-progress/app.component.ts`, APP_COMPONENT);
110
+ ng_morph_1.createSourceFile(`test/app-with-progress/app.template.html`, TEMPLATE_BEFORE);
111
+ create_angular_json_1.createAngularJson();
112
+ ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
113
+ }