@taiga-ui/cdk 2.40.0 → 2.42.0
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/abstract/dialog.service.d.ts +2 -2
- package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-abstract.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js +281 -0
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -0
- package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js +16 -0
- package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js.map +1 -0
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +1 -1
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +1 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-components.umd.js +12 -4
- package/bundles/taiga-ui-cdk-components.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +1 -5
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +2 -2
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-zoom.umd.js +1 -1
- package/bundles/taiga-ui-cdk-directives-zoom.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.js +3 -5
- package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.js +9 -8
- package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-services.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +15 -4
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
- package/components/alert-host/alert-host.component.d.ts +9 -0
- package/components/alert-host/alert-host.module.d.ts +2 -0
- package/components/alert-host/index.d.ts +2 -0
- package/components/alert-host/package.json +13 -0
- package/components/alert-host/taiga-ui-cdk-components-alert-host.d.ts +4 -0
- package/components/alert-host/taiga-ui-cdk-components-alert-host.metadata.json +1 -0
- package/components/dialog-host/taiga-ui-cdk-components-dialog-host.metadata.json +1 -1
- package/components/dropdown-host/taiga-ui-cdk-components-dropdown-host.metadata.json +1 -1
- package/components/index.d.ts +1 -0
- package/components/taiga-ui-cdk-components.metadata.json +1 -1
- package/constants/taiga-ui-cdk-constants.metadata.json +1 -1
- package/directives/zoom/taiga-ui-cdk-directives-zoom.metadata.json +1 -1
- package/esm2015/abstract/dialog.service.js +1 -1
- package/esm2015/components/alert-host/alert-host.component.js +38 -0
- package/esm2015/components/alert-host/alert-host.module.js +16 -0
- package/esm2015/components/alert-host/index.js +3 -0
- package/esm2015/components/alert-host/taiga-ui-cdk-components-alert-host.js +5 -0
- package/esm2015/components/dialog-host/dialog-host.component.js +2 -2
- package/esm2015/components/dropdown-host/dropdown-host.component.js +2 -2
- package/esm2015/components/index.js +2 -1
- package/esm2015/constants/parent-animation.js +2 -6
- package/esm2015/directives/overscroll/overscroll.directive.js +3 -3
- package/esm2015/directives/zoom/zoom.directive.js +2 -2
- package/esm2015/interfaces/aria-dialog-context.js +1 -1
- package/esm2015/observables/focus-visible-observable.js +3 -3
- package/esm2015/observables/prevent-default.js +2 -4
- package/esm2015/observables/zone-free.js +2 -2
- package/esm2015/services/pan.service.js +4 -2
- package/esm2015/services/resize.service.js +2 -2
- package/esm2015/services/scroll.service.js +3 -3
- package/esm2015/services/static-request.service.js +2 -2
- package/esm2015/services/zoom.service.js +3 -4
- package/esm2015/tokens/active-element.js +7 -3
- package/esm2015/tokens/alerts.js +5 -0
- package/esm2015/tokens/dialogs.js +4 -2
- package/esm2015/tokens/index.js +2 -1
- package/esm2015/tokens/window-height.js +2 -2
- package/esm5/abstract/dialog.service.js +1 -1
- package/esm5/components/alert-host/alert-host.component.js +42 -0
- package/esm5/components/alert-host/alert-host.module.js +19 -0
- package/esm5/components/alert-host/index.js +3 -0
- package/esm5/components/alert-host/taiga-ui-cdk-components-alert-host.js +5 -0
- package/esm5/components/dialog-host/dialog-host.component.js +2 -2
- package/esm5/components/dropdown-host/dropdown-host.component.js +2 -2
- package/esm5/components/index.js +2 -1
- package/esm5/constants/parent-animation.js +2 -6
- package/esm5/directives/overscroll/overscroll.directive.js +3 -3
- package/esm5/directives/zoom/zoom.directive.js +2 -2
- package/esm5/interfaces/aria-dialog-context.js +1 -1
- package/esm5/observables/focus-visible-observable.js +3 -3
- package/esm5/observables/prevent-default.js +2 -4
- package/esm5/observables/zone-free.js +1 -1
- package/esm5/services/pan.service.js +4 -2
- package/esm5/services/resize.service.js +2 -2
- package/esm5/services/scroll.service.js +3 -3
- package/esm5/services/static-request.service.js +2 -2
- package/esm5/services/zoom.service.js +3 -4
- package/esm5/tokens/active-element.js +7 -3
- package/esm5/tokens/alerts.js +5 -0
- package/esm5/tokens/dialogs.js +4 -2
- package/esm5/tokens/index.js +2 -1
- package/esm5/tokens/window-height.js +2 -2
- package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-alert-host.js +56 -0
- package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -0
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js +1 -1
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-dropdown-host.js +1 -1
- package/fesm2015/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components.js +1 -0
- package/fesm2015/taiga-ui-cdk-components.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +1 -5
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-overscroll.js +2 -2
- package/fesm2015/taiga-ui-cdk-directives-overscroll.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-zoom.js +1 -1
- package/fesm2015/taiga-ui-cdk-directives-zoom.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-observables.js +4 -6
- package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-services.js +9 -8
- package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +15 -5
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm5/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm5/taiga-ui-cdk-components-alert-host.js +63 -0
- package/fesm5/taiga-ui-cdk-components-alert-host.js.map +1 -0
- package/fesm5/taiga-ui-cdk-components-dialog-host.js +1 -1
- package/fesm5/taiga-ui-cdk-components-dialog-host.js.map +1 -1
- package/fesm5/taiga-ui-cdk-components-dropdown-host.js +1 -1
- package/fesm5/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
- package/fesm5/taiga-ui-cdk-components.js +1 -0
- package/fesm5/taiga-ui-cdk-components.js.map +1 -1
- package/fesm5/taiga-ui-cdk-constants.js +1 -5
- package/fesm5/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm5/taiga-ui-cdk-directives-overscroll.js +2 -2
- package/fesm5/taiga-ui-cdk-directives-overscroll.js.map +1 -1
- package/fesm5/taiga-ui-cdk-directives-zoom.js +1 -1
- package/fesm5/taiga-ui-cdk-directives-zoom.js.map +1 -1
- package/fesm5/taiga-ui-cdk-observables.js +3 -5
- package/fesm5/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm5/taiga-ui-cdk-services.js +9 -8
- package/fesm5/taiga-ui-cdk-services.js.map +1 -1
- package/fesm5/taiga-ui-cdk-tokens.js +15 -5
- package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
- package/interfaces/aria-dialog-context.d.ts +2 -2
- package/package.json +4 -4
- package/schematics/migration.json +1 -1
- package/schematics/ng-add/constants/packages.d.ts +0 -1
- package/schematics/ng-add/constants/packages.js +0 -10
- package/schematics/ng-add/steps/add-taiga-modules.js +3 -27
- package/schematics/ng-update/constants/consts.d.ts +12 -0
- package/schematics/ng-update/constants/consts.js +45 -0
- package/schematics/ng-update/constants/enums.d.ts +7 -0
- package/schematics/ng-update/constants/enums.js +174 -0
- package/schematics/ng-update/constants/types.d.ts +7 -0
- package/schematics/ng-update/constants/types.js +19 -0
- package/schematics/ng-update/index.d.ts +2 -2
- package/schematics/ng-update/index.js +12 -1
- package/schematics/ng-update/steps/rename-types.d.ts +1 -0
- package/schematics/ng-update/steps/rename-types.js +27 -0
- package/schematics/ng-update/steps/replace-const.d.ts +3 -0
- package/schematics/ng-update/steps/replace-const.js +25 -0
- package/schematics/ng-update/steps/replace-deep-import.d.ts +1 -0
- package/schematics/ng-update/steps/replace-deep-import.js +12 -0
- package/schematics/ng-update/steps/replace-enums.d.ts +1 -0
- package/schematics/ng-update/steps/replace-enums.js +40 -0
- package/schematics/utils/add-unique-import.d.ts +1 -0
- package/schematics/utils/add-unique-import.js +29 -0
- package/schematics/utils/get-named-import-references.d.ts +2 -0
- package/schematics/utils/get-named-import-references.js +14 -0
- package/schematics/utils/remove-import.d.ts +2 -0
- package/schematics/utils/remove-import.js +11 -0
- package/tokens/alerts.d.ts +4 -0
- package/tokens/index.d.ts +1 -0
- package/tokens/taiga-ui-cdk-tokens.metadata.json +1 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENUMS_TO_REPLACE = [
|
|
4
|
+
{
|
|
5
|
+
name: 'TuiTextAlign',
|
|
6
|
+
replaceValues: {
|
|
7
|
+
Left: 'left',
|
|
8
|
+
Right: 'right',
|
|
9
|
+
Center: 'center',
|
|
10
|
+
},
|
|
11
|
+
keepAsType: false,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'TuiLineType',
|
|
15
|
+
replaceValues: {
|
|
16
|
+
Solid: 'solid',
|
|
17
|
+
Dashed: 'dashed',
|
|
18
|
+
Dotted: 'dotted',
|
|
19
|
+
None: 'none',
|
|
20
|
+
Hidden: 'hidden',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'TuiMoneySign',
|
|
25
|
+
replaceValues: {
|
|
26
|
+
NegativeOnly: 'negative-only',
|
|
27
|
+
Always: 'always',
|
|
28
|
+
Never: 'never',
|
|
29
|
+
ForceNegative: 'force-negative',
|
|
30
|
+
ForcePositive: 'force-positive',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'TuiDecimal',
|
|
35
|
+
replaceValues: {
|
|
36
|
+
NotZero: 'not-zero',
|
|
37
|
+
Always: 'always',
|
|
38
|
+
Never: 'never',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'TuiInputType',
|
|
43
|
+
replaceValues: {
|
|
44
|
+
Text: 'text',
|
|
45
|
+
Tel: 'tel',
|
|
46
|
+
Email: 'email',
|
|
47
|
+
Url: 'url',
|
|
48
|
+
Password: 'password',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'TuiOverscrollMode',
|
|
53
|
+
replaceValues: {
|
|
54
|
+
All: 'all',
|
|
55
|
+
Scroll: 'scroll',
|
|
56
|
+
None: 'none',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'TuiStepState',
|
|
61
|
+
replaceValues: {
|
|
62
|
+
Normal: 'normal',
|
|
63
|
+
Error: 'error',
|
|
64
|
+
Pass: 'pass',
|
|
65
|
+
},
|
|
66
|
+
keepAsType: false,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'TuiStatus',
|
|
70
|
+
replaceValues: {
|
|
71
|
+
Default: 'default',
|
|
72
|
+
Primary: 'primary',
|
|
73
|
+
Custom: 'custom',
|
|
74
|
+
Success: 'success',
|
|
75
|
+
Error: 'error',
|
|
76
|
+
Warning: 'warning',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'TuiMarkerIconMode',
|
|
81
|
+
replaceValues: {
|
|
82
|
+
Link: 'link',
|
|
83
|
+
Primary: 'primary',
|
|
84
|
+
Warning: 'warning',
|
|
85
|
+
White: 'white',
|
|
86
|
+
Secondary: 'secondary',
|
|
87
|
+
Success: 'success',
|
|
88
|
+
Error: 'error',
|
|
89
|
+
OnDark: 'onDark',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'TuiDropdownPosition',
|
|
94
|
+
replaceValues: {
|
|
95
|
+
Selection: 'selection',
|
|
96
|
+
Word: 'word',
|
|
97
|
+
Tag: 'tag',
|
|
98
|
+
},
|
|
99
|
+
keepAsType: false,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'TuiBorders',
|
|
103
|
+
replaceValues: {
|
|
104
|
+
All: 'all',
|
|
105
|
+
TopBottom: 'top-bottom',
|
|
106
|
+
},
|
|
107
|
+
keepAsType: false,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'TuiButtonShape',
|
|
111
|
+
replaceValues: {
|
|
112
|
+
Square: 'square',
|
|
113
|
+
Rounded: 'rounded',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'TuiDropdownWidth',
|
|
118
|
+
replaceValues: {
|
|
119
|
+
Fixed: 'fixed',
|
|
120
|
+
Min: 'min',
|
|
121
|
+
Auto: 'auto',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'TuiHintMode',
|
|
126
|
+
replaceValues: {
|
|
127
|
+
Error: 'error',
|
|
128
|
+
OnDark: 'onDark',
|
|
129
|
+
Overflow: 'overflow',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'TuiLinkMode',
|
|
134
|
+
replaceValues: {
|
|
135
|
+
Positive: 'positive',
|
|
136
|
+
Negative: 'negative',
|
|
137
|
+
},
|
|
138
|
+
keepAsType: false,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'TuiOrientation',
|
|
142
|
+
replaceValues: {
|
|
143
|
+
Vertical: 'vertical',
|
|
144
|
+
Horizontal: 'horizontal',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'TuiSupportColor',
|
|
149
|
+
replaceValues: {
|
|
150
|
+
Mustard: 'support-01',
|
|
151
|
+
Texas: 'support-02',
|
|
152
|
+
Tan: 'support-03',
|
|
153
|
+
Salmon: 'support-04',
|
|
154
|
+
Sienna: 'support-05',
|
|
155
|
+
Bittersweet: 'support-06',
|
|
156
|
+
Pinkie: 'support-07',
|
|
157
|
+
Charm: 'support-08',
|
|
158
|
+
Amethist: 'support-09',
|
|
159
|
+
Helio: 'support-10',
|
|
160
|
+
Lilac: 'support-11',
|
|
161
|
+
Malibu: 'support-12',
|
|
162
|
+
Havelock: 'support-13',
|
|
163
|
+
Picton: 'support-14',
|
|
164
|
+
Mint: 'support-15',
|
|
165
|
+
Fountain: 'support-16',
|
|
166
|
+
Puertorico: 'support-17',
|
|
167
|
+
Bay: 'support-18',
|
|
168
|
+
Forest: 'support-19',
|
|
169
|
+
York: 'support-20',
|
|
170
|
+
Feijoa: 'support-21',
|
|
171
|
+
},
|
|
172
|
+
keepAsType: false,
|
|
173
|
+
},
|
|
174
|
+
];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TYPES_TO_RENAME = [
|
|
4
|
+
{
|
|
5
|
+
from: 'ButtonOptions',
|
|
6
|
+
to: 'TuiButtonOptions',
|
|
7
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
from: 'RadioOptions',
|
|
11
|
+
to: 'TuiRadioOptions',
|
|
12
|
+
moduleSpecifier: ['@taiga-ui/kit'],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
from: 'CodeEditor',
|
|
16
|
+
to: 'TuiCodeEditor',
|
|
17
|
+
moduleSpecifier: ['@taiga-ui/addon-doc'],
|
|
18
|
+
},
|
|
19
|
+
];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
2
|
import { Schema } from '../ng-add/schema';
|
|
3
|
-
export declare function updateToV3(_: Schema):
|
|
3
|
+
export declare function updateToV3(_: Schema): Rule;
|
|
@@ -9,10 +9,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const ng_morph_1 = require("ng-morph");
|
|
12
13
|
const versions_1 = require("../ng-add/constants/versions");
|
|
14
|
+
const replace_enums_1 = require("./steps/replace-enums");
|
|
15
|
+
const rename_types_1 = require("./steps/rename-types");
|
|
16
|
+
const replace_const_1 = require("./steps/replace-const");
|
|
17
|
+
const replace_deep_import_1 = require("./steps/replace-deep-import");
|
|
13
18
|
function updateToV3(_) {
|
|
14
|
-
return (
|
|
19
|
+
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
15
20
|
context.logger.info(`taiga packages will be updated to ${versions_1.TAIGA_VERSION}`);
|
|
21
|
+
ng_morph_1.setActiveProject(ng_morph_1.createProject(tree, '/', '**/**'));
|
|
22
|
+
replace_deep_import_1.replaceDeepImports();
|
|
23
|
+
replace_enums_1.replaceEnums();
|
|
24
|
+
rename_types_1.renameTypes();
|
|
25
|
+
replace_const_1.replaceConsts();
|
|
26
|
+
ng_morph_1.saveActiveProject();
|
|
16
27
|
});
|
|
17
28
|
}
|
|
18
29
|
exports.updateToV3 = updateToV3;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renameTypes(): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
|
5
|
+
const types_1 = require("../constants/types");
|
|
6
|
+
function renameTypes() {
|
|
7
|
+
types_1.TYPES_TO_RENAME.forEach(({ from, to, moduleSpecifier }) => {
|
|
8
|
+
renameType(from, to, moduleSpecifier);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
exports.renameTypes = renameTypes;
|
|
12
|
+
function renameType(from, to, moduleSpecifier) {
|
|
13
|
+
const references = get_named_import_references_1.getNamedImportReferences(from, moduleSpecifier);
|
|
14
|
+
for (let ref of references) {
|
|
15
|
+
const parent = ref.getParent();
|
|
16
|
+
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
|
17
|
+
const namedImport = parent
|
|
18
|
+
.getImportDeclaration()
|
|
19
|
+
.getNamedImports()
|
|
20
|
+
.find(specifier => specifier.getName() === from);
|
|
21
|
+
namedImport === null || namedImport === void 0 ? void 0 : namedImport.replaceWithText(to);
|
|
22
|
+
}
|
|
23
|
+
else if (ng_morph_1.Node.isTypeReferenceNode(parent)) {
|
|
24
|
+
parent.replaceWithText(to);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
|
5
|
+
const remove_import_1 = require("../../utils/remove-import");
|
|
6
|
+
const add_unique_import_1 = require("../../utils/add-unique-import");
|
|
7
|
+
const consts_1 = require("../constants/consts");
|
|
8
|
+
function replaceConsts() {
|
|
9
|
+
consts_1.CONSTS_TO_REPLACE.forEach(constToReplace => replaceConst(constToReplace));
|
|
10
|
+
}
|
|
11
|
+
exports.replaceConsts = replaceConsts;
|
|
12
|
+
function replaceConst({ from, to }) {
|
|
13
|
+
const references = get_named_import_references_1.getNamedImportReferences(from.name, from.moduleSpecifier);
|
|
14
|
+
for (let ref of references) {
|
|
15
|
+
const parent = ref.getParent();
|
|
16
|
+
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
|
17
|
+
remove_import_1.removeImport(parent);
|
|
18
|
+
add_unique_import_1.addUniqueImport(parent.getSourceFile().getFilePath(), to.namedImport || to.name, to.moduleSpecifier);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
ref === null || ref === void 0 ? void 0 : ref.replaceWithText(to.name);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.replaceConst = replaceConst;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function replaceDeepImports(): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ng_morph_1 = require("ng-morph");
|
|
4
|
+
const DEEP_REGEX = /(@taiga-ui\/\w+)\/.*/;
|
|
5
|
+
function replaceDeepImports() {
|
|
6
|
+
const deepImports = ng_morph_1.getImports('**/**').filter(imp => DEEP_REGEX.test(imp.getModuleSpecifier().getLiteralValue()));
|
|
7
|
+
ng_morph_1.editImports(deepImports, deepImport => {
|
|
8
|
+
const specifier = deepImport.moduleSpecifier.replace(DEEP_REGEX, '$1');
|
|
9
|
+
return { moduleSpecifier: specifier };
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.replaceDeepImports = replaceDeepImports;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function replaceEnums(): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ng_morph_1 = require("ng-morph");
|
|
4
|
+
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
|
5
|
+
const enums_1 = require("../constants/enums");
|
|
6
|
+
const remove_import_1 = require("../../utils/remove-import");
|
|
7
|
+
function replaceEnums() {
|
|
8
|
+
enums_1.ENUMS_TO_REPLACE.forEach(({ name, replaceValues, keepAsType }) => {
|
|
9
|
+
replaceEnumWithString(name, replaceValues, keepAsType);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.replaceEnums = replaceEnums;
|
|
13
|
+
function replaceEnumWithString(enumName, replaceValues, keepAsType = true) {
|
|
14
|
+
const references = get_named_import_references_1.getNamedImportReferences(enumName);
|
|
15
|
+
for (let ref of references) {
|
|
16
|
+
const parent = ref.getParent();
|
|
17
|
+
if (ng_morph_1.Node.isImportSpecifier(parent) && !(keepAsType && containTypeRef(parent))) {
|
|
18
|
+
remove_import_1.removeImport(parent);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (ng_morph_1.Node.isTypeReferenceNode(parent) && !keepAsType) {
|
|
22
|
+
const declaration = parent.getParent();
|
|
23
|
+
declaration.removeType();
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (!ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const key = Object.keys(replaceValues).find(key => parent.getName() === key);
|
|
30
|
+
if (key) {
|
|
31
|
+
parent.replaceWithText(`'${replaceValues[key]}'`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function containTypeRef(node) {
|
|
36
|
+
return node
|
|
37
|
+
.getNameNode()
|
|
38
|
+
.findReferencesAsNodes()
|
|
39
|
+
.some(ref => ng_morph_1.Node.isTypeReferenceNode(ref.getParent()));
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addUniqueImport(filePath: string, namedImport: string, moduleSpecifier: string): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ng_morph_1 = require("ng-morph");
|
|
4
|
+
function addUniqueImport(filePath, namedImport, moduleSpecifier) {
|
|
5
|
+
const existingNamedImport = ng_morph_1.getImports(filePath, {
|
|
6
|
+
namedImports: namedImport,
|
|
7
|
+
moduleSpecifier,
|
|
8
|
+
});
|
|
9
|
+
if (existingNamedImport.length) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const existingDeclaration = ng_morph_1.getImports(filePath, {
|
|
13
|
+
moduleSpecifier,
|
|
14
|
+
});
|
|
15
|
+
if (existingDeclaration.length) {
|
|
16
|
+
const modules = existingDeclaration[0]
|
|
17
|
+
.getNamedImports()
|
|
18
|
+
.map(namedImport => namedImport.getText());
|
|
19
|
+
ng_morph_1.editImports(existingDeclaration, () => ({
|
|
20
|
+
namedImports: [...modules, namedImport],
|
|
21
|
+
}));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
ng_morph_1.addImports(filePath, {
|
|
25
|
+
moduleSpecifier: moduleSpecifier,
|
|
26
|
+
namedImports: [namedImport],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.addUniqueImport = addUniqueImport;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ng_morph_1 = require("ng-morph");
|
|
4
|
+
function getNamedImportReferences(namedImport, moduleSpecifier = '**/**') {
|
|
5
|
+
const importDeclarations = ng_morph_1.getImports('**/**', {
|
|
6
|
+
namedImports: [namedImport],
|
|
7
|
+
moduleSpecifier: moduleSpecifier,
|
|
8
|
+
});
|
|
9
|
+
const namedImports = importDeclarations.map(declaration => { var _a; return (_a = declaration
|
|
10
|
+
.getNamedImports()
|
|
11
|
+
.find(specifier => specifier.getName() === namedImport)) === null || _a === void 0 ? void 0 : _a.getNameNode(); });
|
|
12
|
+
return ng_morph_1.arrayFlat(namedImports.map(specifier => (specifier === null || specifier === void 0 ? void 0 : specifier.findReferencesAsNodes()) || []));
|
|
13
|
+
}
|
|
14
|
+
exports.getNamedImportReferences = getNamedImportReferences;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function removeImport(specifier) {
|
|
4
|
+
if (specifier.getImportDeclaration().getNamedImports().length === 1) {
|
|
5
|
+
specifier.getImportDeclaration().remove();
|
|
6
|
+
}
|
|
7
|
+
else {
|
|
8
|
+
specifier.remove();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.removeImport = removeImport;
|
package/tokens/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TUI_ACTIVE_ELEMENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":22,"character":38},"arguments":["Active element on the document for ActiveZone",{"__symbolic":"error","message":"Lambda not supported","line":25,"character":17,"module":"./active-element"}]},"TUI_DEFAULT_RENDERER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":40},"arguments":["A Renderer2 for global services",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":17,"module":"./default-renderer"}]},"TUI_DIALOGS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":31},"arguments":["A stream of dialogs"]},"TUI_FOCUSABLE_ITEM_ACCESSOR":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":8},"arguments":["A component that can be focused"]},"TUI_IS_ANDROID":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":34},"arguments":["Mobile browser that is not iOS (technically includes Windows Phone, Blackberry etc.)",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":17,"module":"./is-android"}]},"WindowWithCypress":{"__symbolic":"interface"},"TUI_IS_CYPRESS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":10,"character":34},"arguments":["Detect if app is running under Cypress",{"__symbolic":"error","message":"Lambda not supported","line":13,"character":17,"module":"./is-cypress"}]},"TUI_IS_IOS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":30},"arguments":["iOS browser detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":13,"module":"./is-ios"}]},"TUI_IS_MOBILE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":33},"arguments":["Mobile browser detection",{"__symbolic":"error","message":"Lambda not supported","line":10,"character":13,"module":"./is-mobile"}]},"TUI_REMOVED_ELEMENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":39},"arguments":["Element currently being removed by AnimationEngine",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":17,"module":"./removed-element"}]},"TUI_SANITIZER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":33},"arguments":["A custom Sanitizer to sanitize source before inlining"]},"TUI_SWIPE_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":37},"arguments":["Swipe options",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./swipe-options"}]},"TUI_TAKE_ONLY_TRUSTED_EVENTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":8},"arguments":["This token need for override behavior the `pressedObservable` function",{"__symbolic":"error","message":"Lambda not supported","line":12,"character":21,"module":"./take-only-trusted-events"}]},"TUI_TOUCH_SUPPORTED":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":39},"arguments":["Touch support detection",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./touch-supported"}]},"TUI_WINDOW_HEIGHT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":37},"arguments":["Window height accounting for disappearing address bar",{"__symbolic":"error","message":"Lambda not supported","line":9,"character":17,"module":"./window-height"}]},"TUI_ZOOM_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":36},"arguments":["Zoom options",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./zoom-options"}]}},"origins":{"TUI_ACTIVE_ELEMENT":"./active-element","TUI_DEFAULT_RENDERER":"./default-renderer","TUI_DIALOGS":"./dialogs","TUI_FOCUSABLE_ITEM_ACCESSOR":"./focusable-item-accessor","TUI_IS_ANDROID":"./is-android","WindowWithCypress":"./is-cypress","TUI_IS_CYPRESS":"./is-cypress","TUI_IS_IOS":"./is-ios","TUI_IS_MOBILE":"./is-mobile","TUI_REMOVED_ELEMENT":"./removed-element","TUI_SANITIZER":"./sanitizer","TUI_SWIPE_OPTIONS":"./swipe-options","TUI_TAKE_ONLY_TRUSTED_EVENTS":"./take-only-trusted-events","TUI_TOUCH_SUPPORTED":"./touch-supported","TUI_WINDOW_HEIGHT":"./window-height","TUI_ZOOM_OPTIONS":"./zoom-options"},"importAs":"@taiga-ui/cdk/tokens"}
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"TUI_ACTIVE_ELEMENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":22,"character":38},"arguments":["Active element on the document for ActiveZone",{"__symbolic":"error","message":"Lambda not supported","line":25,"character":17,"module":"./active-element"}]},"TUI_ALERTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":30},"arguments":["A stream of alerts",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":13,"module":"./alerts"}]},"TUI_DEFAULT_RENDERER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":40},"arguments":["A Renderer2 for global services",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":17,"module":"./default-renderer"}]},"TUI_DIALOGS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":31},"arguments":["A stream of dialogs",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":13,"module":"./dialogs"}]},"TUI_FOCUSABLE_ITEM_ACCESSOR":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":8},"arguments":["A component that can be focused"]},"TUI_IS_ANDROID":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":34},"arguments":["Mobile browser that is not iOS (technically includes Windows Phone, Blackberry etc.)",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":17,"module":"./is-android"}]},"WindowWithCypress":{"__symbolic":"interface"},"TUI_IS_CYPRESS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":10,"character":34},"arguments":["Detect if app is running under Cypress",{"__symbolic":"error","message":"Lambda not supported","line":13,"character":17,"module":"./is-cypress"}]},"TUI_IS_IOS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":30},"arguments":["iOS browser detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":13,"module":"./is-ios"}]},"TUI_IS_MOBILE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":33},"arguments":["Mobile browser detection",{"__symbolic":"error","message":"Lambda not supported","line":10,"character":13,"module":"./is-mobile"}]},"TUI_REMOVED_ELEMENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":39},"arguments":["Element currently being removed by AnimationEngine",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":17,"module":"./removed-element"}]},"TUI_SANITIZER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":33},"arguments":["A custom Sanitizer to sanitize source before inlining"]},"TUI_SWIPE_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":37},"arguments":["Swipe options",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./swipe-options"}]},"TUI_TAKE_ONLY_TRUSTED_EVENTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":8},"arguments":["This token need for override behavior the `pressedObservable` function",{"__symbolic":"error","message":"Lambda not supported","line":12,"character":21,"module":"./take-only-trusted-events"}]},"TUI_TOUCH_SUPPORTED":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":39},"arguments":["Touch support detection",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./touch-supported"}]},"TUI_WINDOW_HEIGHT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":37},"arguments":["Window height accounting for disappearing address bar",{"__symbolic":"error","message":"Lambda not supported","line":9,"character":17,"module":"./window-height"}]},"TUI_ZOOM_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":36},"arguments":["Zoom options",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./zoom-options"}]}},"origins":{"TUI_ACTIVE_ELEMENT":"./active-element","TUI_ALERTS":"./alerts","TUI_DEFAULT_RENDERER":"./default-renderer","TUI_DIALOGS":"./dialogs","TUI_FOCUSABLE_ITEM_ACCESSOR":"./focusable-item-accessor","TUI_IS_ANDROID":"./is-android","WindowWithCypress":"./is-cypress","TUI_IS_CYPRESS":"./is-cypress","TUI_IS_IOS":"./is-ios","TUI_IS_MOBILE":"./is-mobile","TUI_REMOVED_ELEMENT":"./removed-element","TUI_SANITIZER":"./sanitizer","TUI_SWIPE_OPTIONS":"./swipe-options","TUI_TAKE_ONLY_TRUSTED_EVENTS":"./take-only-trusted-events","TUI_TOUCH_SUPPORTED":"./touch-supported","TUI_WINDOW_HEIGHT":"./window-height","TUI_ZOOM_OPTIONS":"./zoom-options"},"importAs":"@taiga-ui/cdk/tokens"}
|