@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,68 +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
- describe(`ng-update`, () => {
12
- let host;
13
- let runner;
14
- beforeEach(() => {
15
- host = new testing_1.UnitTestTree(new schematics_1.HostTree());
16
- runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
17
- ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
18
- createMainFiles();
19
- ng_morph_1.saveActiveProject();
20
- });
21
- it(`should replaces enums with strings and removes imports`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
22
- const tree = yield runner
23
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
24
- .toPromise();
25
- expect(tree.readContent(`test/app/app.component.ts`)).toEqual(`import {Component} from '@angular/core';
26
- import {some} from '@taiga-ui/cdk';
27
- import {TuiLineType} from '@taiga-ui/cdk';
28
- const lineType: TuiLineType = 'solid';
29
-
30
- @Component({templateUrl: './app.template.html'})
31
- export class AppComponent {
32
- some = 'left';
33
- some2 = 'string';
34
- some3 = () => {
35
- if(this.some2 === 'right') {
36
- return
37
- }
38
- }
39
- decimal = 'never';
40
- }`);
41
- }));
42
- afterEach(() => {
43
- ng_morph_1.resetActiveProject();
44
- });
45
- });
46
- function createMainFiles() {
47
- ng_morph_1.createSourceFile(`test/app/app.component.ts`, `import {Component} from '@angular/core';
48
- import {TuiTextAlign, some} from '@taiga-ui/cdk';
49
- import {TuiLineType} from '@taiga-ui/cdk';
50
- import {TuiDecimal} from '@taiga-ui/core';
51
-
52
- const lineType: TuiLineType = TuiLineType.Solid;
53
-
54
- @Component({templateUrl: './app.template.html'})
55
- export class AppComponent {
56
- some: TuiTextAlign = TuiTextAlign.Left;
57
- some2 = 'string';
58
- some3 = () => {
59
- if(this.some2 === TuiTextAlign.Right) {
60
- return
61
- }
62
- }
63
- decimal = TuiDecimal.Never;
64
- }`);
65
- ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
66
- create_angular_json_1.createAngularJson();
67
- ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
68
- }
@@ -1,195 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /* eslint-disable no-irregular-whitespace,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 {Component} from '@angular/core';
12
- import { tuiGetClosestFocusable } from '@taiga-ui/cdk';
13
- import {
14
- TUI_NUMBER_FORMAT,
15
- tuiFormatNumber,
16
- TuiNumberFormatSettings,
17
- } from '@taiga-ui/core';
18
-
19
- element.focus();
20
- element.focus();
21
- element.focus();
22
- element.blur();
23
- element.focus({preventScroll: true});
24
-
25
- tuiFormatNumber(1000);
26
- tuiFormatNumber(1.234, {decimalLimit: 2, decimalSeparator: ',', thousandSeparator: ' ', zeroPadding: true});
27
- tuiFormatNumber(123.45, {decimalLimit: 3, decimalSeparator: '.', thousandSeparator: ' ', zeroPadding: true});
28
- tuiFormatNumber(12345.67, {decimalLimit: 4, decimalSeparator: ',', thousandSeparator: '.', zeroPadding: true});
29
- tuiFormatNumber(27, {decimalLimit: 5, decimalSeparator: ',', thousandSeparator: '.', zeroPadding: false});
30
-
31
- tuiGetClosestFocusable({initial: el, root: el, previous: false, keyboard: false});
32
- tuiGetClosestFocusable({initial: host, root: root, previous: previous, keyboard: true});
33
- tuiGetClosestFocusable({initial: button, root: wrapper, previous: prev, keyboard: true});
34
- tuiGetClosestFocusable({initial: host, root: host, previous: true, keyboard: true});
35
-
36
- const dynamicDecimalLimit = Math.random() > 0.5;
37
- const decimalSeparatorVariable = ',';
38
- const thousandSeparatorVariable = '_';
39
- const zeroPaddingVariable = false;
40
- tuiFormatNumber(42, {decimalLimit: dynamicDecimalLimit === null ? Infinity : dynamicDecimalLimit, decimalSeparator: decimalSeparatorVariable, thousandSeparator: thousandSeparatorVariable, zeroPadding: zeroPaddingVariable});
41
-
42
- @Component({templateUrl: './app.template.html'})
43
- export class AppComponent extends AbstractTuiController {
44
- some = number ?? 5;
45
-
46
- get formattedNumber(): number {
47
- return tuiFormatNumber(Math.floor(rawNumber), {decimalLimit: Infinity, decimalSeparator: this.numberFormat.decimalSeparator, thousandSeparator: this.numberFormat.thousandSeparator, zeroPadding: true});
48
- }
49
-
50
- method(): void {
51
- return someFn(b ?? "some");
52
- }
53
-
54
- get formattedDayPart(): string {
55
- this.some = '1000'.padStart(10, " ");
56
- return String(this.day).padStart(2, '0');
57
- }
58
-
59
- test(): void {
60
- tuiGetClosestFocusable({initial: this.host, root: this.elementRef.nativeElement, previous: false, keyboard: true});
61
- tuiGetClosestFocusable({initial: wrapper, root: this.elementRef.nativeElement, previous: true, keyboard: false});
62
- const focusable = tuiGetClosestFocusable({initial: this.elementRef.nativeElement, root: this.elementRef.nativeElement, previous: false, keyboard: true});
63
- const focusable = tuiGetClosestFocusable({initial: initial, root: this.wrapper.nativeElement, previous: !first, keyboard: true});
64
- }
65
-
66
- constructor(@Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings) {}
67
-
68
- private hasClosest(suitableNode: any, selector: string): void {
69
- const element = (suitableNode as Element).closest(selector);
70
- return Boolean(element);
71
- }
72
- }
73
-
74
- expect(element.closest('div')).toEqual(div);
75
-
76
- const event = new CustomEvent("hello", {
77
- bubbles: true,
78
- cancelable: true,
79
- detail: true,
80
- });
81
- `;
82
- const BEFORE = `import {Component} from '@angular/core';
83
- import { fallbackValue, tuiCustomEvent, getClosestElement, padStart, tuiGetClosestFocusable, tuiSetNativeFocused, setNativeFocused } from '@taiga-ui/cdk';
84
- import {
85
- TUI_NUMBER_FORMAT,
86
- tuiFormatNumber,
87
- TuiNumberFormatSettings,
88
- } from '@taiga-ui/core';
89
-
90
- setNativeFocused(element);
91
- tuiSetNativeFocused(element);
92
- tuiSetNativeFocused(element, true);
93
- tuiSetNativeFocused(element, false);
94
- tuiSetNativeFocused(element, true, true);
95
-
96
- tuiFormatNumber(1000);
97
- tuiFormatNumber(1.234, 2);
98
- tuiFormatNumber(123.45, 3, '.');
99
- tuiFormatNumber(12345.67, 4, ',', '.');
100
- tuiFormatNumber(27, 5, ',', '.', false);
101
-
102
- tuiGetClosestFocusable(el, false, el, false);
103
- tuiGetClosestFocusable(host, previous, root);
104
- tuiGetClosestFocusable(button, prev, wrapper);
105
- tuiGetClosestFocusable(host, true, host, true);
106
-
107
- const dynamicDecimalLimit = Math.random() > 0.5;
108
- const decimalSeparatorVariable = ',';
109
- const thousandSeparatorVariable = '_';
110
- const zeroPaddingVariable = false;
111
- tuiFormatNumber(42, dynamicDecimalLimit, decimalSeparatorVariable, thousandSeparatorVariable, zeroPaddingVariable);
112
-
113
- @Component({templateUrl: './app.template.html'})
114
- export class AppComponent extends AbstractTuiController {
115
- some = fallbackValue(number, 5);
116
-
117
- get formattedNumber(): number {
118
- return tuiFormatNumber(
119
- Math.floor(rawNumber),
120
- null,
121
- this.numberFormat.decimalSeparator,
122
- this.numberFormat.thousandSeparator,
123
- );
124
- }
125
-
126
- method(): void {
127
- return someFn(fallbackValue<string>(b, "some"));
128
- }
129
-
130
- get formattedDayPart(): string {
131
- this.some = padStart('1000', 10);
132
- return padStart(String(this.day), 2, '0');
133
- }
134
-
135
- test(): void {
136
- tuiGetClosestFocusable(this.host, false, this.elementRef.nativeElement);
137
- tuiGetClosestFocusable(wrapper, true, this.elementRef.nativeElement, false);
138
- const focusable = tuiGetClosestFocusable(
139
- this.elementRef.nativeElement,
140
- false,
141
- this.elementRef.nativeElement,
142
- );
143
- const focusable = tuiGetClosestFocusable(
144
- initial,
145
- !first,
146
- this.wrapper.nativeElement,
147
- );
148
- }
149
-
150
- constructor(@Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings) {}
151
-
152
- private hasClosest(suitableNode: any, selector: string): void {
153
- const element = getClosestElement(suitableNode as Element, selector);
154
- return Boolean(element);
155
- }
156
- }
157
-
158
- expect(getClosestElement(element, 'div')).toEqual(div);
159
-
160
- const event = tuiCustomEvent(
161
- "hello",
162
- {
163
- bubbles: true,
164
- cancelable: true,
165
- detail: true,
166
- },
167
- document,
168
- );
169
- `;
170
- describe(`replace functions (depth of file structure = 1)`, () => {
171
- let host;
172
- let runner;
173
- beforeEach(() => {
174
- host = new testing_1.UnitTestTree(new schematics_1.HostTree());
175
- runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
176
- ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
177
- createMainFiles();
178
- ng_morph_1.saveActiveProject();
179
- });
180
- it(`should replace functions`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
181
- const tree = yield runner
182
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
183
- .toPromise();
184
- expect(tree.readContent(`test/app.component.ts`)).toEqual(AFTER);
185
- }));
186
- afterEach(() => {
187
- ng_morph_1.resetActiveProject();
188
- });
189
- });
190
- function createMainFiles() {
191
- ng_morph_1.createSourceFile(`test/app.component.ts`, BEFORE);
192
- ng_morph_1.createSourceFile(`test/app.template.html`, `<app></app>`);
193
- create_angular_json_1.createAngularJson();
194
- ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
195
- }