@taiga-ui/cdk 3.45.0 → 3.46.0-canary.c975242

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,611 +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_WITHOUT_ANY_TEMPLATE = `
12
- @Component({ selector: 'i-am-invalid-component' })
13
- class ComponentWithoutTemplate {}
14
- `;
15
- const COMPONENT_WITH_TEMPLATE_URL = `
16
- @Component({templateUrl: './test.template.html'})
17
- export class TestComponent {}
18
- `;
19
- const COMPONENT_WITH_TEMPLATE_URL_AFTER = `import { TUI_EDITOR_EXTENSIONS, defaultEditorExtensions } from "@taiga-ui/addon-editor";
20
-
21
- @Component({templateUrl: './test.template.html',
22
- providers: [{
23
- provide: TUI_EDITOR_EXTENSIONS,
24
- useValue: defaultEditorExtensions
25
- }]
26
- })
27
- export class TestComponent {}
28
- `;
29
- const TEMPLATE_BEFORE = `
30
- <tui-table-bars-host ngProjectAs="tuiOverNotifications"></tui-table-bars-host>
31
- <tui-tooltip direction="top-middle"></tui-tooltip>
32
- <tui-svg
33
- src="tuiIconSettingsLarge"
34
- class="icon"
35
- [tuiDropdownContext]="iconInfo"
36
- ></tui-svg>
37
- <button
38
- tuiButton
39
- type="button"
40
- iconRight="tuiIconChevronDown"
41
- [tuiDropdownContent]="dropdownContent"
42
- [tuiDropdown]="open"
43
- [tuiDropdownSided]="true"
44
- (click)="onClick()"
45
- >
46
- Choose
47
- </button>
48
- <ng-template #dropdownContent>
49
- <div class="dropdown">But there is nothing to choose...</div>
50
- </ng-template>
51
-
52
- <tui-hosted-dropdown
53
- tuiDropdownAlign="right"
54
- [tuiDropdownSided]="false"
55
- [content]="dropdown"
56
- [(open)]="open"
57
- >
58
- <button
59
- tuiButton
60
- type="button"
61
- appearance="flat"
62
- [iconRight]="icon"
63
- >
64
- Button
65
- </button>
66
- </tui-hosted-dropdown>
67
-
68
- <tui-hosted-dropdown
69
- tuiDropdownAlign="right"
70
- [tuiDropdownSided]="true"
71
- [content]="dropdown"
72
- [(open)]="open"
73
- >
74
- <button
75
- tuiButton
76
- type="button"
77
- appearance="flat"
78
- [iconRight]="icon"
79
- >
80
- Button
81
- </button>
82
- </tui-hosted-dropdown>
83
-
84
- <label
85
- tuiLabel
86
- label="Step"
87
- ></label>
88
-
89
- <tui-field-error formControlName="control"></tui-field-error>
90
- <tui-field-error formControlName="control" [order]="order"></tui-field-error>
91
-
92
- <p>Formatted number: {{ 10500.33 | tuiFormatNumber: 4:'.':'_':false }}</p>
93
-
94
- <table>
95
- <thead>
96
- <tr tuiThGroup>
97
- <th
98
- tuiResizableColumn
99
- >
100
- Name
101
- </th>
102
- <th tuiTh>Balance</th>
103
- </tr>
104
- </thead>
105
- </table>
106
- <tui-editor new [formControl]="control">
107
- <ng-container ngProjectAs="tools">
108
- <smiles-tool tuiToolbarTool></smiles-tool>
109
- </ng-container>
110
- </tui-editor>
111
- <tui-editor [formControl]="control"></tui-editor>
112
- <tui-group class="some_class">
113
- <div class="content"></div>
114
- </tui-group>
115
-
116
- <tui-wrapper
117
- [appearance]="appearance"
118
- [disabled]="computedDisabled"
119
- [focused]="computedFocusVisible"
120
- [hovered]="computedHovered"
121
- [pressed]="computedPressed"
122
- [invalid]="computedInvalid"
123
- >any</tui-wrapper>
124
-
125
- <tui-primitive-textfield
126
- (autofilledChange)="onAutofilledChange($event)">
127
- </tui-primitive-textfield>
128
-
129
- <div tuiWrapper
130
- [hover]="computedHovered"
131
- >any</div>
132
-
133
- <tui-select (hoveredChange)="onHoverChange(event$)"></tui-select>
134
- <button tuiButton (pressedChange)="onPressChange($event)"></button>
135
- <tui-breadcrumbs [items]="items$ | async">
136
- </tui-breadcrumbs>
137
-
138
- <a
139
- *ngFor="let item of pages"
140
- tuiLink
141
- [routerLink]="item.route"
142
- [scrollIntoView]="isActive(item)">
143
- {{ item.name }}
144
- </a>
145
-
146
- <div
147
- *ngFor="let item of pages"
148
- tuiLink
149
- [routerLink]="item.route"
150
- [scrollIntoView]="isActive(item)">
151
- {{ item.name }}
152
- </div>
153
-
154
- <etc
155
- *ngFor="let item of pages"
156
- tuiLink
157
- [routerLink]="item.route"
158
- [scrollIntoView]="isActive(item)">
159
- {{ item.name }}
160
- </etc>
161
-
162
- <tui-multi-select
163
- #component
164
- [formControl]="testValue"
165
- (searchChange)="onSearchChange($event)"
166
- >
167
- Rock Star Frontend Developers
168
- <tui-data-list-wrapper
169
- *tuiDataList
170
- [items]="items$ | async | tuiHideSelected : component"
171
- [itemContent]="itemContent"
172
- ></tui-data-list-wrapper>
173
- </tui-multi-select>
174
-
175
- <tui-multi-select #component [(ngModel)]="value">
176
- <tui-data-list *tuiDataList>
177
- <tui-opt-group
178
- tuiMultiSelectGroup
179
- label="Jedi"
180
- >
181
- <button
182
- *ngFor="let item of jedi"
183
- tuiOption
184
- [value]="item"
185
- >
186
- {{item}}
187
- </button>
188
- </tui-opt-group>
189
- <tui-opt-group label="Sith">
190
- <button
191
- *ngFor="let item of sith | tuiHideSelected:component"
192
- tuiOption
193
- [value]="item"
194
- >
195
- {{item}}
196
- </button>
197
- </tui-opt-group>
198
- </tui-data-list>
199
- </tui-multi-select>
200
-
201
- <tui-tabs-with-more
202
- [itemsLimit]="3"
203
- [(activeItemIndex)]="activeItemIndex"
204
- >
205
- <button *tuiTab tuiTab>Maps</button>
206
- <button
207
- *tuiTab
208
- tuiTab
209
- >
210
- Calls
211
- </button>
212
- </tui-tabs-with-more>
213
-
214
- <tui-breadcrumbs>
215
- <ng-container *ngFor="let item of items">
216
- <a
217
- *tuiBreadcrumb
218
- tuiLink
219
- [routerLink]="item.routerLink"
220
- >
221
- {{ item.caption }}
222
- </a>
223
- </ng-container>
224
- </tui-breadcrumbs>
225
-
226
- <tui-hosted-dropdown
227
- tuiDropdownAlign="left"
228
- tuiDropdownSided
229
- [content]="dropdown"
230
- [(open)]="open"
231
- >
232
- <button
233
- tuiButton
234
- type="button"
235
- appearance="flat"
236
- [iconRight]="icon"
237
- >
238
- Button
239
- </button>
240
- </tui-hosted-dropdown>
241
- `;
242
- const TEMPLATE_AFTER = `<!-- TODO: (Taiga UI migration) tuiFormatNumber pipe has new API. See https://taiga-ui.dev/pipes/format-number -->
243
- <tui-table-bars-host ngProjectAs="tuiOverAlerts"></tui-table-bars-host>
244
- <tui-tooltip direction="top"></tui-tooltip>
245
- <tui-svg
246
- src="tuiIconSettingsLarge"
247
- class="icon"
248
- tuiDropdownContext [tuiDropdown]="iconInfo"
249
- ></tui-svg>
250
- <button
251
- tuiButton
252
- type="button"
253
- iconRight="tuiIconChevronDown"
254
- [tuiDropdown]="dropdownContent"
255
- [tuiDropdownManual]="open"
256
- [tuiDropdownSided]="true"
257
- (click)="onClick()"
258
- >
259
- Choose
260
- </button>
261
- <ng-template #dropdownContent>
262
- <div class="dropdown">But there is nothing to choose...</div>
263
- </ng-template>
264
-
265
- <tui-hosted-dropdown
266
- tuiDropdownAlign="right"
267
- [sided]="false"
268
- [content]="dropdown"
269
- [(open)]="open"
270
- >
271
- <button
272
- tuiButton
273
- type="button"
274
- appearance="flat"
275
- [iconRight]="icon"
276
- >
277
- Button
278
- </button>
279
- </tui-hosted-dropdown>
280
-
281
- <tui-hosted-dropdown
282
- tuiDropdownAlign="right"
283
- [sided]="true"
284
- [content]="dropdown"
285
- [(open)]="open"
286
- >
287
- <button
288
- tuiButton
289
- type="button"
290
- appearance="flat"
291
- [iconRight]="icon"
292
- >
293
- Button
294
- </button>
295
- </tui-hosted-dropdown>
296
-
297
- <label
298
- ${``}
299
- tuiLabel="Step"
300
- ></label>
301
-
302
- <tui-error [error]="[] | tuiFieldError | async" formControlName="control"></tui-error>
303
- <tui-error [error]="order | tuiFieldError | async" formControlName="control"></tui-error>
304
-
305
- <p>Formatted number: {{ 10500.33 | tuiFormatNumber: 4:'.':'_':false }}</p>
306
-
307
- <table>
308
- <thead>
309
- <tr tuiThGroup>
310
- <th
311
- tuiTh [resizable]="true"
312
- >
313
- Name
314
- </th>
315
- <th tuiTh>Balance</th>
316
- </tr>
317
- </thead>
318
- </table>
319
- <tui-editor [formControl]="control">
320
- <ng-container ngProjectAs="tools">
321
- <smiles-tool tuiItem></smiles-tool>
322
- </ng-container>
323
- </tui-editor>
324
- <tui-editor [formControl]="control"></tui-editor>
325
- <div tuiGroup class="some_class">
326
- <div class="content"></div>
327
- </div>
328
-
329
- <div tuiWrapper
330
- [appearance]="appearance"
331
- [disabled]="computedDisabled"
332
- [focus]="computedFocusVisible"
333
- [hover]="computedHovered"
334
- [active]="computedPressed"
335
- [invalid]="computedInvalid"
336
- >any</div>
337
-
338
- <tui-primitive-textfield
339
- (tuiAutofilledChange)="onAutofilledChange($event)">
340
- </tui-primitive-textfield>
341
-
342
- <div tuiWrapper
343
- [hover]="computedHovered"
344
- >any</div>
345
-
346
- <tui-select (tuiHoveredChange)="onHoverChange(event$)"></tui-select>
347
- <button tuiButton (tuiPressedChange)="onPressChange($event)"></button>
348
- <tui-breadcrumbs>
349
- <ng-container *ngFor="let item of items$ | async">
350
- <a
351
- *tuiItem
352
- tuiLink
353
- [routerLink]="item.routerLink"
354
- >
355
- {{ item.caption }}
356
- </a>
357
- </ng-container>
358
- </tui-breadcrumbs>
359
-
360
- <a
361
- *ngFor="let item of pages"
362
- tuiLink
363
- [routerLink]="item.route"
364
- [tuiScrollIntoViewLink]="isActive(item)">
365
- {{ item.name }}
366
- </a>
367
-
368
- <div
369
- *ngFor="let item of pages"
370
- tuiLink
371
- [routerLink]="item.route"
372
- [tuiScrollIntoViewLink]="isActive(item)">
373
- {{ item.name }}
374
- </div>
375
-
376
- <etc
377
- *ngFor="let item of pages"
378
- tuiLink
379
- [routerLink]="item.route"
380
- [tuiScrollIntoViewLink]="isActive(item)">
381
- {{ item.name }}
382
- </etc>
383
-
384
- <tui-multi-select
385
- #component
386
- [formControl]="testValue"
387
- (searchChange)="onSearchChange($event)"
388
- >
389
- Rock Star Frontend Developers
390
- <tui-data-list-wrapper
391
- *tuiDataList
392
- [items]="items$ | async | tuiHideSelected"
393
- [itemContent]="itemContent"
394
- ></tui-data-list-wrapper>
395
- </tui-multi-select>
396
-
397
- <tui-multi-select #component [(ngModel)]="value">
398
- <tui-data-list *tuiDataList>
399
- <tui-opt-group
400
- tuiMultiSelectGroup
401
- label="Jedi"
402
- >
403
- <button
404
- *ngFor="let item of jedi"
405
- tuiOption
406
- [value]="item"
407
- >
408
- {{item}}
409
- </button>
410
- </tui-opt-group>
411
- <tui-opt-group label="Sith">
412
- <button
413
- *ngFor="let item of sith | tuiHideSelected"
414
- tuiOption
415
- [value]="item"
416
- >
417
- {{item}}
418
- </button>
419
- </tui-opt-group>
420
- </tui-data-list>
421
- </tui-multi-select>
422
-
423
- <tui-tabs-with-more
424
- [itemsLimit]="3"
425
- [(activeItemIndex)]="activeItemIndex"
426
- >
427
- <button *tuiItem tuiTab>Maps</button>
428
- <button
429
- *tuiItem
430
- tuiTab
431
- >
432
- Calls
433
- </button>
434
- </tui-tabs-with-more>
435
-
436
- <tui-breadcrumbs>
437
- <ng-container *ngFor="let item of items">
438
- <a
439
- *tuiItem
440
- tuiLink
441
- [routerLink]="item.routerLink"
442
- >
443
- {{ item.caption }}
444
- </a>
445
- </ng-container>
446
- </tui-breadcrumbs>
447
-
448
- <tui-hosted-dropdown
449
- tuiDropdownAlign="left"
450
- [sided]="true"
451
- [content]="dropdown"
452
- [(open)]="open"
453
- >
454
- <button
455
- tuiButton
456
- type="button"
457
- appearance="flat"
458
- [iconRight]="icon"
459
- >
460
- Button
461
- </button>
462
- </tui-hosted-dropdown>
463
- `;
464
- const COMPONENT_BEFORE = `
465
- @Component({template: '<tui-group><div [data-value]="27.3333 | tuiFormatNumber: 2"></div></tui-group>'})
466
- export class TestComponentInline {
467
- aware = TUI_MOBILE_AWARE;
468
- }
469
- `;
470
- const COMPONENT_AFTER = `
471
- @Component({template: '<!-- TODO: (Taiga UI migration) tuiFormatNumber pipe has new API. See https://taiga-ui.dev/pipes/format-number --><div tuiGroup><div [data-value]="27.3333 | tuiFormatNumber: 2"></div></div>'})
472
- export class TestComponentInline {
473
- aware = TUI_MOBILE_AWARE;
474
- }
475
- `;
476
- const MODULE_BEFORE = `
477
- import {CommonModule} from '@angular/common';
478
- import {NgModule} from '@angular/core';
479
- import {TuiFieldErrorModule} from "@taiga-ui/kit";
480
- import {ScrollIntoViewModule} from "@taiga-ui/addon-doc";
481
-
482
- import {TestComponentInline} from './test-inline.component';
483
- import {TestComponent} from './test.component';
484
-
485
- @NgModule({
486
- imports: [
487
- CommonModule,
488
- TuiFieldErrorModule,
489
- ScrollIntoViewModule
490
- ],
491
- declarations: [
492
- TestComponent,
493
- TestComponentInline
494
- ],
495
- exports: [TestComponent],
496
- })
497
- export class ExampleModule {}
498
- `;
499
- const MODULE_AFTER = `import { TuiErrorModule } from "@taiga-ui/core";
500
- import { TuiAutofilledModule, TuiPressedModule, TuiHoveredModule } from "@taiga-ui/cdk";
501
- import { TuiFieldErrorPipeModule } from "@taiga-ui/kit";
502
-
503
- import {CommonModule} from '@angular/common';
504
- import {NgModule} from '@angular/core';
505
- import { TuiScrollIntoViewLinkModule } from "@taiga-ui/addon-doc";
506
-
507
- import {TestComponentInline} from './test-inline.component';
508
- import {TestComponent} from './test.component';
509
-
510
- @NgModule({
511
- imports: [
512
- CommonModule,
513
- TuiFieldErrorPipeModule,
514
- TuiAutofilledModule,
515
- TuiPressedModule,
516
- TuiHoveredModule,
517
- TuiScrollIntoViewLinkModule,
518
- TuiErrorModule
519
- ],
520
- declarations: [
521
- TestComponent,
522
- TestComponentInline
523
- ],
524
- exports: [TestComponent],
525
- })
526
- export class ExampleModule {}
527
- `;
528
- describe(`ng-update`, () => {
529
- let host;
530
- let runner;
531
- beforeEach(() => {
532
- host = new testing_1.UnitTestTree(new schematics_1.HostTree());
533
- runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
534
- ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
535
- createMainFiles();
536
- ng_morph_1.saveActiveProject();
537
- });
538
- it(`should edit templates`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
539
- const tree = yield runner
540
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
541
- .toPromise();
542
- expect(tree.readContent(`test/app/test.template.html`)).toEqual(TEMPLATE_AFTER);
543
- }));
544
- it(`should edit components`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
545
- const tree = yield runner
546
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
547
- .toPromise();
548
- expect(tree.readContent(`test/app/test.component.ts`)).toEqual(COMPONENT_WITH_TEMPLATE_URL_AFTER);
549
- }));
550
- it(`should add directive to module`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
551
- const tree = yield runner
552
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
553
- .toPromise();
554
- expect(tree.readContent(`test/app/test.module.ts`)).toEqual(MODULE_AFTER);
555
- }));
556
- it(`should edit inline templates`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
557
- const tree = yield runner
558
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
559
- .toPromise();
560
- expect(tree.readContent(`test/app/test-inline.component.ts`)).toEqual(COMPONENT_AFTER);
561
- }));
562
- it(`should NOT throw error if component without any template`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
563
- const tree = yield runner
564
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
565
- .toPromise();
566
- expect(tree.readContent(`test/app/no-template.component.ts`)).toEqual(COMPONENT_WITHOUT_ANY_TEMPLATE);
567
- }));
568
- it(`should add font style in angular.json`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
569
- const tree = yield runner
570
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
571
- .toPromise();
572
- expect(tree.readContent(`angular.json`)).toEqual(`
573
- {
574
- "version": 1,
575
- "defaultProject": "demo",
576
- "projects": {
577
- "demo": {
578
- "architect": {
579
- "build": {
580
- "options": {
581
- "main": "test/main.ts",
582
- "assets": [
583
- {
584
- "glob": "**/*",
585
- "input": "node_modules/@taiga-ui/icons/src",
586
- "output": "assets/taiga-ui/icons"
587
- }
588
- ],
589
- "styles": [
590
- "node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less"
591
- ]
592
- }
593
- }
594
- }
595
- }
596
- }
597
- }`);
598
- }));
599
- afterEach(() => {
600
- ng_morph_1.resetActiveProject();
601
- });
602
- });
603
- function createMainFiles() {
604
- ng_morph_1.createSourceFile(`test/app/no-template.component.ts`, COMPONENT_WITHOUT_ANY_TEMPLATE);
605
- ng_morph_1.createSourceFile(`test/app/test.component.ts`, COMPONENT_WITH_TEMPLATE_URL);
606
- ng_morph_1.createSourceFile(`test/app/test.template.html`, TEMPLATE_BEFORE);
607
- ng_morph_1.createSourceFile(`test/app/test-inline.component.ts`, COMPONENT_BEFORE);
608
- ng_morph_1.createSourceFile(`test/app/test.module.ts`, MODULE_BEFORE);
609
- create_angular_json_1.createAngularJsonWithAssets();
610
- ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
611
- }
@@ -1,100 +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 AFTER = `import { TuiAccountModule, TuiAccountComponent, TuiAccount, tuiAccountDelegate, TuiAccountDelegateComponent, CURRENCY_ICONS, TUI_ACCOUNT_PROJECTOR } from "@taiga-ui/proprietary-banking";
12
-
13
- @Component({
14
- selector: 'tui-account-example-1',
15
- template: '',
16
- })
17
- export class TuiAccountExample1 extends TuiAccountComponent {
18
- readonly accountDelegate = tuiAccountDelegate;
19
- readonly accounts: TuiAccount[] = [];
20
- account = new FormControl(this.accounts[0]);
21
-
22
- constructor(
23
- @Inject(TUI_ACCOUNT_PROJECTOR)
24
- readonly mapper: TuiMapper<T, TuiAccount>,
25
- ) {}
26
-
27
- getIcon({icon, currency = TuiCurrency.Ruble}: TuiAccount): PolymorpheusContent {
28
- return icon ?? CURRENCY_ICONS[String(currency)] ?? \`tuiIconCurrencyDefaultMarker\`;
29
- }
30
- }
31
-
32
- @NgModule({
33
- imports: [TuiAccountModule],
34
- declarations: [TuiAccountExample1],
35
- entryComponents: [TuiAccountDelegateComponent]
36
- })
37
- export class ExampleTuiAccountModule {}
38
- `;
39
- const BEFORE = `import {
40
- TuiAccountModule,
41
- TuiAccountComponent,
42
- TuiAccount,
43
- tuiAccountDelegate,
44
- TuiAccountDelegateComponent,
45
- CURRENCY_ICONS,
46
- TUI_ACCOUNT_PROJECTOR
47
- } from '@taiga-ui/proprietary-core';
48
-
49
- @Component({
50
- selector: 'tui-account-example-1',
51
- template: '',
52
- })
53
- export class TuiAccountExample1 extends TuiAccountComponent {
54
- readonly accountDelegate = tuiAccountDelegate;
55
- readonly accounts: TuiAccount[] = [];
56
- account = new FormControl(this.accounts[0]);
57
-
58
- constructor(
59
- @Inject(TUI_ACCOUNT_PROJECTOR)
60
- readonly mapper: TuiMapper<T, TuiAccount>,
61
- ) {}
62
-
63
- getIcon({icon, currency = TuiCurrency.Ruble}: TuiAccount): PolymorpheusContent {
64
- return icon ?? CURRENCY_ICONS[String(currency)] ?? \`tuiIconCurrencyDefaultMarker\`;
65
- }
66
- }
67
-
68
- @NgModule({
69
- imports: [TuiAccountModule],
70
- declarations: [TuiAccountExample1],
71
- entryComponents: [TuiAccountDelegateComponent]
72
- })
73
- export class ExampleTuiAccountModule {}
74
- `;
75
- describe(`ng-update proprietary constants`, () => {
76
- let host;
77
- let runner;
78
- beforeEach(() => {
79
- host = new testing_1.UnitTestTree(new schematics_1.HostTree());
80
- runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
81
- ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
82
- createMainFiles();
83
- ng_morph_1.saveActiveProject();
84
- });
85
- it(`should replace proprietary constants`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
86
- const tree = yield runner
87
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
88
- .toPromise();
89
- expect(tree.readContent(`test/app/app.component.ts`)).toEqual(AFTER);
90
- }));
91
- afterEach(() => {
92
- ng_morph_1.resetActiveProject();
93
- });
94
- });
95
- function createMainFiles() {
96
- ng_morph_1.createSourceFile(`test/app/app.component.ts`, BEFORE);
97
- ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
98
- create_angular_json_1.createAngularJson();
99
- ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
100
- }