@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.
- package/bundles/taiga-ui-cdk-abstract.umd.js +4 -1
- package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +86 -123
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +6 -10
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2015/abstract/interactive.js +5 -2
- package/esm2015/constants/version.js +2 -2
- package/esm2015/tokens/active-element.js +38 -40
- package/esm2015/tokens/default-renderer.js +6 -6
- package/esm2015/tokens/ensure-base-href.js +12 -13
- package/esm2015/tokens/is-android.js +4 -5
- package/esm2015/tokens/is-apple.js +4 -6
- package/esm2015/tokens/is-chromium.js +4 -5
- package/esm2015/tokens/is-cypress.js +4 -5
- package/esm2015/tokens/is-e2e.js +4 -5
- package/esm2015/tokens/is-firefox.js +6 -7
- package/esm2015/tokens/is-ios.js +4 -6
- package/esm2015/tokens/is-mobile.js +5 -6
- package/esm2015/tokens/is-playwright.js +3 -5
- package/esm2015/tokens/is-stackblitz.js +4 -5
- package/esm2015/tokens/is-webkit.js +6 -7
- package/esm2015/tokens/range.js +4 -5
- package/esm2015/tokens/removed-element.js +13 -14
- package/esm2015/tokens/take-only-trusted-events.js +3 -5
- package/esm2015/tokens/touch-supported.js +4 -5
- package/esm2015/tokens/window-height.js +4 -5
- package/esm2015/utils/miscellaneous/create-options.js +3 -5
- package/esm2015/utils/miscellaneous/create-token.js +2 -4
- package/fesm2015/taiga-ui-cdk-abstract.js +5 -2
- package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +79 -116
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +6 -10
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.d.ts +1 -0
- package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.js +381 -0
- package/schematics/ng-add/tests/schematic-ng-add.spec.d.ts +1 -0
- package/schematics/ng-add/tests/schematic-ng-add.spec.js +270 -0
- package/schematics/ng-update/v3/tests/schematic-date-time.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-date-time.spec.js +117 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.js +102 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.js +107 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.js +113 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.js +380 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.js +119 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.js +123 -0
- package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.js +81 -0
- package/schematics/ng-update/v3/tests/schematic-rename-types.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-rename-types.spec.js +157 -0
- package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.js +135 -0
- package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.js +53 -0
- package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.js +835 -0
- package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.js +68 -0
- package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.js +195 -0
- package/schematics/ng-update/v3/tests/schematic-replace-html.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-replace-html.spec.js +611 -0
- package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.js +100 -0
- package/schematics/ng-update/v3/tests/schematic-replace-services.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-replace-services.spec.js +102 -0
- package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.js +286 -0
- package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.js +141 -0
- package/schematics/ng-update/v3/tests/schematic-warnings.spec.d.ts +1 -0
- package/schematics/ng-update/v3/tests/schematic-warnings.spec.js +104 -0
- package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.d.ts +1 -0
- package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.js +87 -0
- package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.d.ts +1 -0
- package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.js +101 -0
- package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.d.ts +1 -0
- package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.js +117 -0
- package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.d.ts +1 -0
- package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.js +90 -0
- package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.d.ts +1 -0
- package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.js +74 -0
- package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.d.ts +1 -0
- package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.js +72 -0
- package/tokens/active-element.d.ts +1 -2
- package/tokens/default-renderer.d.ts +2 -2
- package/tokens/ensure-base-href.d.ts +1 -2
- package/tokens/is-android.d.ts +1 -2
- package/tokens/is-apple.d.ts +1 -2
- package/tokens/is-chromium.d.ts +1 -2
- package/tokens/is-cypress.d.ts +1 -2
- package/tokens/is-e2e.d.ts +1 -2
- package/tokens/is-firefox.d.ts +1 -2
- package/tokens/is-ios.d.ts +1 -2
- package/tokens/is-mobile.d.ts +1 -2
- package/tokens/is-playwright.d.ts +1 -2
- package/tokens/is-stackblitz.d.ts +1 -2
- package/tokens/is-webkit.d.ts +1 -2
- package/tokens/range.d.ts +1 -2
- package/tokens/removed-element.d.ts +1 -3
- package/tokens/take-only-trusted-events.d.ts +1 -2
- package/tokens/touch-supported.d.ts +1 -2
- package/tokens/window-height.d.ts +1 -3
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -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 BEFORE = `import { Component } from '@angular/core';
|
12
|
+
import { TuiPortalService } from '@taiga-ui/cdk';
|
13
|
+
import { PreviewDialogService } from '@taiga-ui/addon-preview';
|
14
|
+
import { TuiNotificationsService } from '@taiga-ui/core';
|
15
|
+
import { TuiCodeEditor } from '@taiga-ui/addon-doc';
|
16
|
+
|
17
|
+
function etc(service: TuiNotificationsService) {
|
18
|
+
service
|
19
|
+
.show().subscribe();
|
20
|
+
|
21
|
+
let open = getService().show();
|
22
|
+
}
|
23
|
+
|
24
|
+
function getService(): TuiNotificationsService {
|
25
|
+
return new TuiNotificationsService();
|
26
|
+
}
|
27
|
+
|
28
|
+
@Component({templateUrl: './app.template.html'})
|
29
|
+
export class AppComponent {
|
30
|
+
constructor(
|
31
|
+
@Inject(TuiPortalService) portalService: TuiPortalService,
|
32
|
+
@Inject(TuiNotificationsService) private notificationService: TuiNotificationsService,
|
33
|
+
@Inject(PreviewDialogService) private preview: PreviewDialogService,
|
34
|
+
@Inject(TUI_DOC_CODE_EDITOR) private editor: TuiCodeEditor
|
35
|
+
) {
|
36
|
+
notificationService.show(arg, arg2);
|
37
|
+
}
|
38
|
+
|
39
|
+
method(): void {
|
40
|
+
this.notificationService.show(arg, arg2).subscribe();
|
41
|
+
this.editor.open(arg1, arg2);
|
42
|
+
}
|
43
|
+
}`;
|
44
|
+
const AFTER = `import { TuiPreviewDialogService } from "@taiga-ui/addon-preview";
|
45
|
+
import { TuiCodeEditor } from "@taiga-ui/addon-doc";
|
46
|
+
import { TuiAlertService } from "@taiga-ui/core";
|
47
|
+
import { TuiDropdownPortalService } from "@taiga-ui/cdk";
|
48
|
+
import { Component } from '@angular/core';
|
49
|
+
|
50
|
+
function etc(service: TuiAlertService) {
|
51
|
+
service
|
52
|
+
.open().subscribe();
|
53
|
+
|
54
|
+
let open = getService().open();
|
55
|
+
}
|
56
|
+
|
57
|
+
function getService(): TuiAlertService {
|
58
|
+
return new TuiAlertService();
|
59
|
+
}
|
60
|
+
|
61
|
+
@Component({templateUrl: './app.template.html'})
|
62
|
+
export class AppComponent {
|
63
|
+
constructor(
|
64
|
+
@Inject(TuiDropdownPortalService) portalService: TuiDropdownPortalService,
|
65
|
+
@Inject(TuiAlertService) private notificationService: TuiAlertService,
|
66
|
+
@Inject(TuiPreviewDialogService) private preview: TuiPreviewDialogService,
|
67
|
+
@Inject(TUI_DOC_CODE_EDITOR) private editor: TuiCodeEditor
|
68
|
+
) {
|
69
|
+
notificationService.open(arg, arg2);
|
70
|
+
}
|
71
|
+
|
72
|
+
method(): void {
|
73
|
+
this.notificationService.open(arg, arg2).subscribe();
|
74
|
+
this.editor.edit(arg1, arg2);
|
75
|
+
}
|
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 replace services`, () => 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/app.component.ts`)).toEqual(AFTER);
|
92
|
+
}));
|
93
|
+
afterEach(() => {
|
94
|
+
ng_morph_1.resetActiveProject();
|
95
|
+
});
|
96
|
+
});
|
97
|
+
function createMainFiles() {
|
98
|
+
ng_morph_1.createSourceFile(`test/app/app.component.ts`, BEFORE);
|
99
|
+
ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
|
100
|
+
create_angular_json_1.createAngularJson();
|
101
|
+
ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
|
102
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,286 @@
|
|
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 replace_styles_1 = require("../steps/replace-styles");
|
11
|
+
const collectionPath = path_1.join(__dirname, `../../../migration.json`);
|
12
|
+
const BEFORE_GLOBAL_STYLE = `
|
13
|
+
@import '~@taiga-ui/core/styles/taiga-ui-fonts';
|
14
|
+
@import '~@taiga-ui/core/styles/taiga-ui-global';
|
15
|
+
@import '~@taiga-ui/core/styles/taiga-ui-global.less';
|
16
|
+
@import '~@taiga-ui/proprietary-core/styles/tinkoff-fonts';
|
17
|
+
@import '~@taiga-ui/proprietary-core/styles/theme-tinkoff-v2';
|
18
|
+
@import '~@taiga-ui/proprietary-core/styles/theme-tinkoff-mobile';
|
19
|
+
`;
|
20
|
+
const AFTER_GLOBAL_STYLE = `
|
21
|
+
@import '@taiga-ui/core/styles/taiga-ui-fonts.less';
|
22
|
+
${replace_styles_1.TUI_WARNING_NORMALIZE}
|
23
|
+
@import '@taiga-ui/styles/taiga-ui-global.less';
|
24
|
+
${replace_styles_1.TUI_WARNING_NORMALIZE}
|
25
|
+
@import '@taiga-ui/styles/taiga-ui-global.less';
|
26
|
+
@import '@taiga-ui/proprietary-core/styles/tinkoff-fonts.less';
|
27
|
+
@import '@taiga-ui/proprietary-core/styles/theme-tinkoff-v2.less';
|
28
|
+
@import '@taiga-ui/proprietary-core/styles/theme-tinkoff-mobile.less';
|
29
|
+
`;
|
30
|
+
const BEFORE_LOCAL_STYLE = `
|
31
|
+
@import '~@taiga-ui/core/styles/taiga-ui-local';
|
32
|
+
|
33
|
+
tui-wrapper[data-appearance='textfield'] {
|
34
|
+
background: var(--tui-secondary);
|
35
|
+
color: var(--tui-text-01);
|
36
|
+
box-shadow: none;
|
37
|
+
|
38
|
+
&[data-state='hovered'] {
|
39
|
+
background: var(--tui-secondary);
|
40
|
+
|
41
|
+
&:after {
|
42
|
+
color: var(--tui-accent-hover);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
&[data-state='pressed'] {
|
47
|
+
background: var(--tui-secondary-hover);
|
48
|
+
|
49
|
+
&:after {
|
50
|
+
color: var(--tui-accent-active);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
.legacy-breakpoints {
|
56
|
+
@media @mobile {
|
57
|
+
color: red;
|
58
|
+
}
|
59
|
+
@media @mobile-min {
|
60
|
+
color: red;
|
61
|
+
}
|
62
|
+
@media @mobile-interval {
|
63
|
+
color: red;
|
64
|
+
}
|
65
|
+
@media @tablet-s {
|
66
|
+
color: red;
|
67
|
+
}
|
68
|
+
@media @tablet-s-min {
|
69
|
+
color: red;
|
70
|
+
}
|
71
|
+
@media @tablet-s-interval {
|
72
|
+
color: red;
|
73
|
+
}
|
74
|
+
@media @tablet {
|
75
|
+
color: red;
|
76
|
+
}
|
77
|
+
@media @tablet-min {
|
78
|
+
color: red;
|
79
|
+
}
|
80
|
+
@media @tablet-interval {
|
81
|
+
color: red;
|
82
|
+
}
|
83
|
+
@media @desktop {
|
84
|
+
color: red;
|
85
|
+
}
|
86
|
+
@media @desktop-min {
|
87
|
+
color: red;
|
88
|
+
}
|
89
|
+
@media @desktop-interval {
|
90
|
+
color: red;
|
91
|
+
}
|
92
|
+
@media @desktop-lg-min {
|
93
|
+
color: red;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
.actual-breakpoints {
|
98
|
+
@media @mobile-m {
|
99
|
+
color: red;
|
100
|
+
}
|
101
|
+
@media @mobile-m-min {
|
102
|
+
color: red;
|
103
|
+
}
|
104
|
+
@media @mobile-m-interval {
|
105
|
+
color: red;
|
106
|
+
}
|
107
|
+
@media @tablet-lg {
|
108
|
+
color: red;
|
109
|
+
}
|
110
|
+
@media @tablet-lg-min {
|
111
|
+
color: red;
|
112
|
+
}
|
113
|
+
@media @tablet-lg-interval {
|
114
|
+
color: red;
|
115
|
+
}
|
116
|
+
@media @desktop-s {
|
117
|
+
color: red;
|
118
|
+
}
|
119
|
+
@media @desktop-s-min {
|
120
|
+
color: red;
|
121
|
+
}
|
122
|
+
@media @desktop-s-interval {
|
123
|
+
color: red;
|
124
|
+
}
|
125
|
+
@media @desktop-m-min {
|
126
|
+
color: red;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
.negative-media {
|
131
|
+
@media not @mobile-m {
|
132
|
+
color: green;
|
133
|
+
}
|
134
|
+
|
135
|
+
@media not @desktop {
|
136
|
+
color: green;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
`;
|
140
|
+
const AFTER_LOCAL_STYLE = `
|
141
|
+
@import '@taiga-ui/core/styles/taiga-ui-local.less';
|
142
|
+
|
143
|
+
${replace_styles_1.TUI_WARNING_WRAPPER_MIXINS}
|
144
|
+
[tuiWrapper][data-appearance='textfield'] {
|
145
|
+
background: var(--tui-secondary);
|
146
|
+
color: var(--tui-text-01);
|
147
|
+
box-shadow: none;
|
148
|
+
|
149
|
+
&[data-state='hover'] {
|
150
|
+
background: var(--tui-secondary);
|
151
|
+
|
152
|
+
&:after {
|
153
|
+
color: var(--tui-accent-hover);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
&[data-state='active'] {
|
158
|
+
background: var(--tui-secondary-hover);
|
159
|
+
|
160
|
+
&:after {
|
161
|
+
color: var(--tui-accent-active);
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
.legacy-breakpoints {
|
167
|
+
@media @tui-mobile {
|
168
|
+
color: red;
|
169
|
+
}
|
170
|
+
@media @tui-mobile-min {
|
171
|
+
color: red;
|
172
|
+
}
|
173
|
+
@media @tui-mobile-interval {
|
174
|
+
color: red;
|
175
|
+
}
|
176
|
+
@media @tui-mobile {
|
177
|
+
color: red;
|
178
|
+
}
|
179
|
+
@media @tui-mobile-min {
|
180
|
+
color: red;
|
181
|
+
}
|
182
|
+
@media @tui-mobile-interval {
|
183
|
+
color: red;
|
184
|
+
}
|
185
|
+
@media @tui-tablet {
|
186
|
+
color: red;
|
187
|
+
}
|
188
|
+
@media @tui-tablet-min {
|
189
|
+
color: red;
|
190
|
+
}
|
191
|
+
@media @tui-tablet-interval {
|
192
|
+
color: red;
|
193
|
+
}
|
194
|
+
@media @tui-desktop {
|
195
|
+
color: red;
|
196
|
+
}
|
197
|
+
@media @tui-desktop-min {
|
198
|
+
color: red;
|
199
|
+
}
|
200
|
+
@media @tui-desktop-interval {
|
201
|
+
color: red;
|
202
|
+
}
|
203
|
+
@media @tui-desktop-lg-min {
|
204
|
+
color: red;
|
205
|
+
}
|
206
|
+
}
|
207
|
+
|
208
|
+
.actual-breakpoints {
|
209
|
+
@media @tui-mobile {
|
210
|
+
color: red;
|
211
|
+
}
|
212
|
+
@media @tui-mobile-min {
|
213
|
+
color: red;
|
214
|
+
}
|
215
|
+
@media @tui-mobile-interval {
|
216
|
+
color: red;
|
217
|
+
}
|
218
|
+
@media @tui-tablet {
|
219
|
+
color: red;
|
220
|
+
}
|
221
|
+
@media @tui-tablet-min {
|
222
|
+
color: red;
|
223
|
+
}
|
224
|
+
@media @tui-tablet-interval {
|
225
|
+
color: red;
|
226
|
+
}
|
227
|
+
@media @tui-desktop {
|
228
|
+
color: red;
|
229
|
+
}
|
230
|
+
@media @tui-desktop-min {
|
231
|
+
color: red;
|
232
|
+
}
|
233
|
+
@media @tui-desktop-interval {
|
234
|
+
color: red;
|
235
|
+
}
|
236
|
+
@media @tui-desktop-lg-min {
|
237
|
+
color: red;
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
241
|
+
.negative-media {
|
242
|
+
@media not @tui-mobile {
|
243
|
+
color: green;
|
244
|
+
}
|
245
|
+
|
246
|
+
@media not @tui-desktop {
|
247
|
+
color: green;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
`;
|
251
|
+
describe(`replace styles`, () => {
|
252
|
+
let host;
|
253
|
+
let runner;
|
254
|
+
beforeEach(() => {
|
255
|
+
host = new testing_1.UnitTestTree(new schematics_1.HostTree());
|
256
|
+
runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
|
257
|
+
ng_morph_1.setActiveProject(ng_morph_1.createProject(host, `/`, `**/**`));
|
258
|
+
createMainFiles();
|
259
|
+
ng_morph_1.saveActiveProject();
|
260
|
+
});
|
261
|
+
it(`should replace with new global styles`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
262
|
+
const tree = yield runner
|
263
|
+
.runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
|
264
|
+
.toPromise();
|
265
|
+
expect(tree.readContent(`test/style.less`)).toBe(AFTER_GLOBAL_STYLE);
|
266
|
+
expect(tree.readContent(`test/app/app.template.less`)).toBe(AFTER_LOCAL_STYLE);
|
267
|
+
}));
|
268
|
+
afterEach(() => {
|
269
|
+
ng_morph_1.resetActiveProject();
|
270
|
+
});
|
271
|
+
});
|
272
|
+
function createMainFiles() {
|
273
|
+
ng_morph_1.createSourceFile(`test/app/app.component.ts`, `
|
274
|
+
@Component({
|
275
|
+
templateUrl: './app.template.html',
|
276
|
+
styleUrls: ['./app.template.less']
|
277
|
+
})
|
278
|
+
export class AppComponent {
|
279
|
+
}
|
280
|
+
`);
|
281
|
+
ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
|
282
|
+
ng_morph_1.createSourceFile(`test/style.less`, BEFORE_GLOBAL_STYLE);
|
283
|
+
ng_morph_1.createSourceFile(`test/app/app.template.less`, BEFORE_LOCAL_STYLE);
|
284
|
+
create_angular_json_1.createAngularJson();
|
285
|
+
ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
|
286
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,141 @@
|
|
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 = `
|
12
|
+
@Component({templateUrl: './test.template.html'})
|
13
|
+
export class TestComponent {}
|
14
|
+
`;
|
15
|
+
const TEMPLATE_BEFORE = `
|
16
|
+
<tui-input
|
17
|
+
formControlName="testValue"
|
18
|
+
icon="icon"
|
19
|
+
tuiTextfieldExampleText="House"
|
20
|
+
tuiHintContent="Write a number"
|
21
|
+
class="tui-group__inherit-item"
|
22
|
+
>
|
23
|
+
House
|
24
|
+
</tui-input>
|
25
|
+
|
26
|
+
<tui-input-tag [icon]="icon" iconAlign="left"></tui-input-tag>
|
27
|
+
|
28
|
+
<tui-input
|
29
|
+
formControlName="testValue"
|
30
|
+
icon="icon"
|
31
|
+
iconAlign="right"
|
32
|
+
tuiHintContent="Write a number"
|
33
|
+
class="tui-group__inherit-item"
|
34
|
+
>
|
35
|
+
House
|
36
|
+
</tui-input>
|
37
|
+
|
38
|
+
<tui-primitive-textfield
|
39
|
+
class="textfield"
|
40
|
+
iconAlign="right"
|
41
|
+
[iconContent]="icon"
|
42
|
+
>
|
43
|
+
</tui-primitive-textfield>
|
44
|
+
`;
|
45
|
+
const TEMPLATE_AFTER = `
|
46
|
+
<tui-input
|
47
|
+
formControlName="testValue"
|
48
|
+
tuiTextfieldIconLeft="icon"
|
49
|
+
${``}
|
50
|
+
tuiHintContent="Write a number"
|
51
|
+
class="tui-group__inherit-item"
|
52
|
+
>
|
53
|
+
House
|
54
|
+
<input tuiTextfield placeholder="House"/> </tui-input>
|
55
|
+
|
56
|
+
<tui-input-tag [tuiTextfieldIconLeft]="icon" ></tui-input-tag>
|
57
|
+
|
58
|
+
<tui-input
|
59
|
+
formControlName="testValue"
|
60
|
+
tuiTextfieldIcon="icon"
|
61
|
+
${``}
|
62
|
+
tuiHintContent="Write a number"
|
63
|
+
class="tui-group__inherit-item"
|
64
|
+
>
|
65
|
+
House
|
66
|
+
</tui-input>
|
67
|
+
|
68
|
+
<tui-primitive-textfield
|
69
|
+
class="textfield"
|
70
|
+
${``}
|
71
|
+
[tuiTextfieldIcon]="icon"
|
72
|
+
>
|
73
|
+
</tui-primitive-textfield>
|
74
|
+
`;
|
75
|
+
const MODULE_BEFORE = `import {CommonModule} from '@angular/common';
|
76
|
+
import {NgModule} from '@angular/core';
|
77
|
+
|
78
|
+
import {TestComponent} from './test.component';
|
79
|
+
|
80
|
+
@NgModule({
|
81
|
+
imports: [
|
82
|
+
CommonModule,
|
83
|
+
],
|
84
|
+
declarations: [
|
85
|
+
TestComponent,
|
86
|
+
],
|
87
|
+
exports: [TestComponent],
|
88
|
+
})
|
89
|
+
export class ExampleModule {}
|
90
|
+
`;
|
91
|
+
const MODULE_AFTER = `import { TuiTextfieldControllerModule } from "@taiga-ui/core";
|
92
|
+
import {CommonModule} from '@angular/common';
|
93
|
+
import {NgModule} from '@angular/core';
|
94
|
+
|
95
|
+
import {TestComponent} from './test.component';
|
96
|
+
|
97
|
+
@NgModule({
|
98
|
+
imports: [
|
99
|
+
CommonModule,
|
100
|
+
TuiTextfieldControllerModule
|
101
|
+
],
|
102
|
+
declarations: [
|
103
|
+
TestComponent,
|
104
|
+
],
|
105
|
+
exports: [TestComponent],
|
106
|
+
})
|
107
|
+
export class ExampleModule {}
|
108
|
+
`;
|
109
|
+
describe(`ng-update`, () => {
|
110
|
+
let host;
|
111
|
+
let runner;
|
112
|
+
beforeEach(() => {
|
113
|
+
host = new testing_1.UnitTestTree(new schematics_1.HostTree());
|
114
|
+
runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
|
115
|
+
ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
|
116
|
+
createMainFiles();
|
117
|
+
ng_morph_1.saveActiveProject();
|
118
|
+
});
|
119
|
+
it(`should edit templates`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
120
|
+
const tree = yield runner
|
121
|
+
.runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
|
122
|
+
.toPromise();
|
123
|
+
expect(tree.readContent(`test/app/test.template.html`)).toEqual(TEMPLATE_AFTER);
|
124
|
+
}));
|
125
|
+
it(`should add directive to module`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
126
|
+
const tree = yield runner
|
127
|
+
.runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
|
128
|
+
.toPromise();
|
129
|
+
expect(tree.readContent(`test/app/test.module.ts`)).toEqual(MODULE_AFTER);
|
130
|
+
}));
|
131
|
+
afterEach(() => {
|
132
|
+
ng_morph_1.resetActiveProject();
|
133
|
+
});
|
134
|
+
});
|
135
|
+
function createMainFiles() {
|
136
|
+
ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT);
|
137
|
+
ng_morph_1.createSourceFile(`test/app/test.template.html`, TEMPLATE_BEFORE);
|
138
|
+
ng_morph_1.createSourceFile(`test/app/test.module.ts`, MODULE_BEFORE);
|
139
|
+
create_angular_json_1.createAngularJson();
|
140
|
+
ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
|
141
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,104 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
5
|
+
const testing_1 = require("@angular-devkit/schematics/testing");
|
6
|
+
const ng_morph_1 = require("ng-morph");
|
7
|
+
const path_1 = require("path");
|
8
|
+
const create_angular_json_1 = require("../../../utils/create-angular-json");
|
9
|
+
const warnings_1 = require("../constants/warnings");
|
10
|
+
const replace_styles_1 = require("../steps/replace-styles");
|
11
|
+
const collectionPath = path_1.join(__dirname, `../../../migration.json`);
|
12
|
+
const BEFORE = `
|
13
|
+
import {TUI_MOBILE_AWARE, COUNTRIES_MASKS} from '@taiga-ui/kit';
|
14
|
+
import {
|
15
|
+
DumbEntity,
|
16
|
+
DUMB_CONSTANT,
|
17
|
+
awesomeFunction,
|
18
|
+
TUI_LAST_DAY,
|
19
|
+
TUI_DATE_FILLER,
|
20
|
+
MEGA_CONSTANT,
|
21
|
+
anotherAwesomeFunction
|
22
|
+
MagicClass,
|
23
|
+
} from '@taiga-ui/cdk';
|
24
|
+
import {DumbEntity, TUI_DATE_RANGE_FILLER, MEGA_CONSTANT, MagicClass} from '@taiga-ui/cdk';
|
25
|
+
import {COUNTRIES} from '@taiga-ui/kit/components/input-phone-international';
|
26
|
+
|
27
|
+
const lol = TUI_DATE_FILLER;
|
28
|
+
const kek = TUI_MOBILE_AWARE;
|
29
|
+
const variable1 = TUI_DATE_RANGE_FILLER;
|
30
|
+
@Component({templateUrl: './app.template.html'})
|
31
|
+
export class AppComponent {
|
32
|
+
aware = TUI_MOBILE_AWARE;
|
33
|
+
}
|
34
|
+
`;
|
35
|
+
const AFTER = `
|
36
|
+
// TODO: (Taiga UI migration) TUI_MOBILE_AWARE has been deleted in 3.0, please use TuiMobileTabsDirective from @taiga-ui/addon-mobile
|
37
|
+
// TODO: (Taiga UI migration) Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code
|
38
|
+
import {TUI_MOBILE_AWARE, COUNTRIES_MASKS} from '@taiga-ui/kit';
|
39
|
+
import {
|
40
|
+
DumbEntity,
|
41
|
+
DUMB_CONSTANT,
|
42
|
+
awesomeFunction,
|
43
|
+
TUI_LAST_DAY,
|
44
|
+
// TODO: (Taiga UI migration) TUI_DATE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date
|
45
|
+
TUI_DATE_FILLER,
|
46
|
+
MEGA_CONSTANT,
|
47
|
+
anotherAwesomeFunction
|
48
|
+
MagicClass,
|
49
|
+
} from '@taiga-ui/cdk';
|
50
|
+
// TODO: (Taiga UI migration) TUI_DATE_RANGE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date-range
|
51
|
+
import {DumbEntity, TUI_DATE_RANGE_FILLER, MEGA_CONSTANT, MagicClass} from '@taiga-ui/cdk';
|
52
|
+
// TODO: (Taiga UI migration) Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code. Use DI-token TUI_COUNTRIES to get localized country name by its iso code
|
53
|
+
import { COUNTRIES } from '@taiga-ui/kit';
|
54
|
+
|
55
|
+
const lol = TUI_DATE_FILLER;
|
56
|
+
const kek = TUI_MOBILE_AWARE;
|
57
|
+
const variable1 = TUI_DATE_RANGE_FILLER;
|
58
|
+
@Component({templateUrl: './app.template.html'})
|
59
|
+
export class AppComponent {
|
60
|
+
aware = TUI_MOBILE_AWARE;
|
61
|
+
}
|
62
|
+
`;
|
63
|
+
describe(`ng-update`, () => {
|
64
|
+
let host;
|
65
|
+
let runner;
|
66
|
+
let logs;
|
67
|
+
let logSubscription;
|
68
|
+
beforeEach(() => {
|
69
|
+
logs = [];
|
70
|
+
host = new testing_1.UnitTestTree(new schematics_1.HostTree());
|
71
|
+
runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
|
72
|
+
logSubscription = runner.logger.subscribe(log => logs.push(log));
|
73
|
+
ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
|
74
|
+
createMainFiles();
|
75
|
+
ng_morph_1.saveActiveProject();
|
76
|
+
});
|
77
|
+
it(`should show warnings`, () => 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
|
+
const expectedLogs = logs
|
82
|
+
.filter(log => log.level === `warn`)
|
83
|
+
.map(log => log.message);
|
84
|
+
expect(expectedLogs).toEqual([
|
85
|
+
`[WARNING] in /test/app/app.component.ts: ${warnings_1.MIGRATION_WARNINGS[0].message}`,
|
86
|
+
`[WARNING] in /test/app/app.component.ts: ${warnings_1.MIGRATION_WARNINGS[1].message}`,
|
87
|
+
`[WARNING] in /test/app/app.component.ts: ${warnings_1.MIGRATION_WARNINGS[2].message}`,
|
88
|
+
`[WARNING] in /test/app/app.component.ts: ${warnings_1.MIGRATION_WARNINGS[4].message}`,
|
89
|
+
`[WARNING] in /test/app/app.component.ts: ${warnings_1.MIGRATION_WARNINGS[5].message}`,
|
90
|
+
replace_styles_1.TUI_WARNING_NORMALIZE,
|
91
|
+
]);
|
92
|
+
expect(tree.readContent(`test/app/app.component.ts`)).toBe(AFTER);
|
93
|
+
}));
|
94
|
+
afterEach(() => {
|
95
|
+
ng_morph_1.resetActiveProject();
|
96
|
+
logSubscription.unsubscribe();
|
97
|
+
});
|
98
|
+
});
|
99
|
+
function createMainFiles() {
|
100
|
+
ng_morph_1.createSourceFile(`test/app/app.component.ts`, BEFORE);
|
101
|
+
ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
|
102
|
+
create_angular_json_1.createAngularJsonWithAssets();
|
103
|
+
ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
|
104
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|