@progress/kendo-angular-toolbar 21.0.0-develop.8 → 21.0.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/codemods/utils.js +485 -324
- package/codemods/v19/toolbar-button-showicon.js +9 -7
- package/codemods/v19/toolbar-button-showtext.js +9 -7
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/toolbar.component.mjs +11 -2
- package/esm2022/tools/toolbar-button.component.mjs +11 -1
- package/fesm2022/progress-kendo-angular-toolbar.mjs +24 -5
- package/package.json +9 -9
package/codemods/utils.js
CHANGED
|
@@ -7,9 +7,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.tsComponentPropertyRemoval = exports.templateAttributeRemoval = exports.htmlAttributeRemoval = exports.htmlAttributeValueTransformer = exports.tsPropertyValueTransformer = exports.templateAttributeValueTransformer = exports.htmlAttributeTransformer = exports.htmlBoundAttributeTransformer = exports.htmlStaticAttributeTransformer = exports.tsPropertyTransformer = exports.templateAttributeTransformer = exports.templateBoundAttributeTransformer = exports.templateStaticAttributeTransformer = void 0;
|
|
10
|
+
exports.tsInterfaceTransformer = exports.tsComponentPropertyRemoval = exports.templateAttributeRemoval = exports.htmlAttributeRemoval = exports.htmlAttributeValueTransformer = exports.tsPropertyValueTransformer = exports.templateAttributeValueTransformer = exports.htmlEventTransformer = exports.htmlAttributeTransformer = exports.htmlBoundAttributeTransformer = exports.htmlStaticAttributeTransformer = exports.tsPropertyTransformer = exports.templateAttributeTransformer = exports.templateBoundAttributeTransformer = exports.templateStaticAttributeTransformer = exports.templateEventTransformer = exports.blockTextElements = void 0;
|
|
11
|
+
exports.hasKendoInTemplate = hasKendoInTemplate;
|
|
11
12
|
exports.tsPropertyRemoval = tsPropertyRemoval;
|
|
12
13
|
const node_html_parser_1 = __importDefault(require("node-html-parser"));
|
|
14
|
+
exports.blockTextElements = {
|
|
15
|
+
script: true,
|
|
16
|
+
noscript: true,
|
|
17
|
+
style: true,
|
|
18
|
+
pre: true,
|
|
19
|
+
};
|
|
20
|
+
function hasKendoInTemplate(source) {
|
|
21
|
+
const kendoPattern = /(<kendo-[^>\s]+|<[^>]*\s+kendo[A-Z][^>\s]*)/g;
|
|
22
|
+
return kendoPattern.test(source);
|
|
23
|
+
}
|
|
24
|
+
const templateEventTransformer = (root, tagName, eventName, newEventName) => {
|
|
25
|
+
const elements = Array.from(root.getElementsByTagName(tagName)) || [];
|
|
26
|
+
for (const element of elements) {
|
|
27
|
+
// Handle event bindings like (actionClick)="handler($event)"
|
|
28
|
+
const eventAttr = element.getAttribute(`(${eventName})`);
|
|
29
|
+
if (eventAttr) {
|
|
30
|
+
element.setAttribute(`(${newEventName})`, eventAttr);
|
|
31
|
+
element.removeAttribute(`(${eventName})`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.templateEventTransformer = templateEventTransformer;
|
|
13
36
|
const templateStaticAttributeTransformer = (root, tagName, attributeName, newAttributeName) => {
|
|
14
37
|
const elements = Array.from(root.getElementsByTagName(tagName)) || [];
|
|
15
38
|
for (const element of elements) {
|
|
@@ -22,13 +45,14 @@ const templateStaticAttributeTransformer = (root, tagName, attributeName, newAtt
|
|
|
22
45
|
}
|
|
23
46
|
};
|
|
24
47
|
exports.templateStaticAttributeTransformer = templateStaticAttributeTransformer;
|
|
25
|
-
const templateBoundAttributeTransformer = (root, tagName, attributeName, newAttributeName) => {
|
|
48
|
+
const templateBoundAttributeTransformer = (root, tagName, attributeName, newAttributeName, valueProperty) => {
|
|
26
49
|
const elements = Array.from(root.getElementsByTagName(tagName)) || [];
|
|
27
50
|
for (const element of elements) {
|
|
28
51
|
// Handle bound attributes like [title]="foo" or [title]="'foo'"
|
|
29
52
|
const boundAttr = element.getAttribute(`[${attributeName}]`);
|
|
30
53
|
if (boundAttr) {
|
|
31
|
-
|
|
54
|
+
const newValue = valueProperty ? `${boundAttr}.${valueProperty}` : boundAttr;
|
|
55
|
+
element.setAttribute(`[${newAttributeName}]`, newValue);
|
|
32
56
|
element.removeAttribute(`[${attributeName}]`);
|
|
33
57
|
}
|
|
34
58
|
}
|
|
@@ -39,94 +63,141 @@ const templateAttributeTransformer = (root, tagName, attributeName, newAttribute
|
|
|
39
63
|
(0, exports.templateStaticAttributeTransformer)(root, tagName, attributeName, newAttributeName);
|
|
40
64
|
};
|
|
41
65
|
exports.templateAttributeTransformer = templateAttributeTransformer;
|
|
42
|
-
const tsPropertyTransformer = (root, j, componentType, propertyName, newPropertyName) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
.find(j.ClassProperty, {
|
|
48
|
-
typeAnnotation: {
|
|
66
|
+
const tsPropertyTransformer = (source, root, j, componentType, propertyName, newPropertyName, valueProperty) => {
|
|
67
|
+
if (source.includes(componentType)) {
|
|
68
|
+
// Find all class properties that are of type DropDownListComponent
|
|
69
|
+
const properties = new Set();
|
|
70
|
+
// Find properties with type annotations
|
|
71
|
+
root.find(j.ClassProperty, {
|
|
49
72
|
typeAnnotation: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
73
|
+
typeAnnotation: {
|
|
74
|
+
typeName: {
|
|
75
|
+
name: componentType,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
}).forEach((path) => {
|
|
80
|
+
if (path.node.key.type === 'Identifier') {
|
|
81
|
+
properties.add(path.node.key.name);
|
|
53
82
|
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
83
|
+
});
|
|
84
|
+
// Find function parameters of type componentType
|
|
85
|
+
const parameters = new Set();
|
|
86
|
+
root.find(j.FunctionDeclaration).forEach((path) => {
|
|
87
|
+
if (path.node.params) {
|
|
88
|
+
path.node.params.forEach((param) => {
|
|
89
|
+
if (param.type === 'Identifier' &&
|
|
90
|
+
param.typeAnnotation &&
|
|
91
|
+
param.typeAnnotation.typeAnnotation?.type === 'TSTypeReference' &&
|
|
92
|
+
param.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
93
|
+
param.typeAnnotation.typeAnnotation.typeName.name === componentType) {
|
|
94
|
+
parameters.add(param.name);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
// Also check method declarations in classes
|
|
100
|
+
root.find(j.ClassMethod).forEach((path) => {
|
|
101
|
+
if (path.node.params) {
|
|
102
|
+
path.node.params.forEach((param) => {
|
|
103
|
+
if (param.type === 'Identifier' &&
|
|
104
|
+
param.typeAnnotation &&
|
|
105
|
+
param.typeAnnotation.typeAnnotation?.type === 'TSTypeReference' &&
|
|
106
|
+
param.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
107
|
+
param.typeAnnotation.typeAnnotation.typeName.name === componentType) {
|
|
108
|
+
parameters.add(param.name);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
// Also check arrow functions
|
|
114
|
+
root.find(j.ArrowFunctionExpression).forEach((path) => {
|
|
115
|
+
if (path.node.params) {
|
|
116
|
+
path.node.params.forEach((param) => {
|
|
117
|
+
if (param.type === 'Identifier' &&
|
|
118
|
+
param.typeAnnotation &&
|
|
119
|
+
param.typeAnnotation.typeAnnotation?.type === 'TSTypeReference' &&
|
|
120
|
+
param.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
121
|
+
param.typeAnnotation.typeAnnotation.typeName.name === componentType) {
|
|
122
|
+
parameters.add(param.name);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
// Find local variable declarations of type componentType
|
|
128
|
+
const localVariables = new Set();
|
|
129
|
+
root.find(j.VariableDeclarator).forEach((path) => {
|
|
130
|
+
if (path.node.id.type === 'Identifier' &&
|
|
131
|
+
path.node.id.typeAnnotation &&
|
|
132
|
+
path.node.id.typeAnnotation.typeAnnotation?.type === 'TSTypeReference' &&
|
|
133
|
+
path.node.id.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
134
|
+
path.node.id.typeAnnotation.typeAnnotation.typeName.name === componentType) {
|
|
135
|
+
localVariables.add(path.node.id.name);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
// Find all member expressions where title property is accessed on any componentType instance
|
|
139
|
+
root.find(j.MemberExpression, {
|
|
140
|
+
property: {
|
|
141
|
+
type: 'Identifier',
|
|
142
|
+
name: propertyName,
|
|
143
|
+
},
|
|
144
|
+
})
|
|
145
|
+
.filter((path) => {
|
|
146
|
+
// Filter to only include accesses on properties that are componentType instances
|
|
147
|
+
if (path.node.object.type === 'MemberExpression' && path.node.object.property.type === 'Identifier') {
|
|
148
|
+
// handle properties of this
|
|
149
|
+
if (path.node.object.object.type === 'ThisExpression' &&
|
|
150
|
+
properties.has(path.node.object.property.name)) {
|
|
151
|
+
return true;
|
|
74
152
|
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
153
|
+
}
|
|
154
|
+
// Handle function parameters and local variables
|
|
155
|
+
if (path.node.object.type === 'Identifier') {
|
|
156
|
+
return parameters.has(path.node.object.name) || localVariables.has(path.node.object.name);
|
|
157
|
+
}
|
|
158
|
+
return false;
|
|
159
|
+
})
|
|
160
|
+
.forEach((path) => {
|
|
161
|
+
// Replace old property name with new property name
|
|
162
|
+
if (path.node.property.type === 'Identifier') {
|
|
163
|
+
path.node.property.name = newPropertyName;
|
|
164
|
+
}
|
|
165
|
+
// If valueProperty is specified and this is part of an assignment,
|
|
166
|
+
// we need to also modify the right-hand side of the assignment
|
|
167
|
+
if (valueProperty) {
|
|
168
|
+
const assignmentExpression = path.parent;
|
|
169
|
+
if (assignmentExpression &&
|
|
170
|
+
assignmentExpression.value &&
|
|
171
|
+
assignmentExpression.value.type === 'AssignmentExpression' &&
|
|
172
|
+
assignmentExpression.value.left === path.node) {
|
|
173
|
+
const rightSide = assignmentExpression.value.right;
|
|
174
|
+
// Case 1: Right side is a member expression (e.g., this.user, obj.user) -> transform to this.user.id, obj.user.id
|
|
175
|
+
// Case 2: Right side is an identifier (e.g., user, foo) -> transform to user.id, foo.id
|
|
176
|
+
if (rightSide.type === 'MemberExpression' || rightSide.type === 'Identifier') {
|
|
177
|
+
const newRightSide = j.memberExpression(rightSide, j.identifier(valueProperty));
|
|
178
|
+
assignmentExpression.value.right = newRightSide;
|
|
179
|
+
}
|
|
180
|
+
// Case 3: Right side is object literal -> extract the valueProperty value
|
|
181
|
+
else if (rightSide.type === 'ObjectExpression') {
|
|
182
|
+
// Find the property that matches valueProperty
|
|
183
|
+
const targetProperty = rightSide.properties.find((prop) => prop.type === 'ObjectProperty' &&
|
|
184
|
+
prop.key &&
|
|
185
|
+
prop.key.type === 'Identifier' &&
|
|
186
|
+
prop.key.name === valueProperty);
|
|
187
|
+
if (targetProperty) {
|
|
188
|
+
// Replace the entire object literal with just the value of the target property
|
|
189
|
+
assignmentExpression.value.right = targetProperty.value;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
90
192
|
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
// Find all member expressions where title property is accessed on any componentType instance
|
|
95
|
-
root
|
|
96
|
-
.find(j.MemberExpression, {
|
|
97
|
-
property: {
|
|
98
|
-
type: 'Identifier',
|
|
99
|
-
name: propertyName
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
.filter(path => {
|
|
103
|
-
// Filter to only include accesses on properties that are componentType instances
|
|
104
|
-
if (path.node.object.type === 'MemberExpression' &&
|
|
105
|
-
path.node.object.property.type === 'Identifier') {
|
|
106
|
-
// handle properties of this
|
|
107
|
-
if (path.node.object.object.type === 'ThisExpression' &&
|
|
108
|
-
properties.has(path.node.object.property.name)) {
|
|
109
|
-
return true;
|
|
110
193
|
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (path.node.object.type === 'Identifier' &&
|
|
114
|
-
parameters.has(path.node.object.name)) {
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
return false;
|
|
118
|
-
})
|
|
119
|
-
.forEach(path => {
|
|
120
|
-
// Replace old property name with new property name
|
|
121
|
-
if (path.node.property.type === 'Identifier') {
|
|
122
|
-
path.node.property.name = newPropertyName;
|
|
123
|
-
}
|
|
124
|
-
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
125
196
|
};
|
|
126
197
|
exports.tsPropertyTransformer = tsPropertyTransformer;
|
|
127
198
|
const htmlStaticAttributeTransformer = (fileInfo, tagName, oldName, newName) => {
|
|
128
199
|
const fileContent = fileInfo.source;
|
|
129
|
-
const root = (0, node_html_parser_1.default)(fileContent);
|
|
200
|
+
const root = (0, node_html_parser_1.default)(fileContent, { comment: true, blockTextElements: exports.blockTextElements });
|
|
130
201
|
let modified = false;
|
|
131
202
|
const elements = Array.from(root.querySelectorAll(tagName));
|
|
132
203
|
for (const element of elements) {
|
|
@@ -143,16 +214,18 @@ const htmlStaticAttributeTransformer = (fileInfo, tagName, oldName, newName) =>
|
|
|
143
214
|
return fileContent;
|
|
144
215
|
};
|
|
145
216
|
exports.htmlStaticAttributeTransformer = htmlStaticAttributeTransformer;
|
|
146
|
-
const htmlBoundAttributeTransformer = (fileInfo, tagName, oldName, newName) => {
|
|
217
|
+
const htmlBoundAttributeTransformer = (fileInfo, tagName, oldName, newName, valueProperty) => {
|
|
147
218
|
const fileContent = fileInfo.source;
|
|
148
|
-
const root = (0, node_html_parser_1.default)(fileContent);
|
|
219
|
+
const root = (0, node_html_parser_1.default)(fileContent, { comment: true, blockTextElements: exports.blockTextElements });
|
|
149
220
|
let modified = false;
|
|
150
221
|
const elements = Array.from(root.querySelectorAll(tagName));
|
|
151
222
|
for (const element of elements) {
|
|
152
223
|
const boundAttr = element.getAttribute(`[${oldName}]`);
|
|
153
224
|
if (boundAttr) {
|
|
154
225
|
element.removeAttribute(`[${oldName}]`);
|
|
155
|
-
|
|
226
|
+
// If valueProperty is provided, append it to the bound value
|
|
227
|
+
const newValue = valueProperty ? `${boundAttr}.${valueProperty}` : boundAttr;
|
|
228
|
+
element.setAttribute(`[${newName}]`, newValue);
|
|
156
229
|
modified = true;
|
|
157
230
|
}
|
|
158
231
|
}
|
|
@@ -168,6 +241,26 @@ const htmlAttributeTransformer = (fileInfo, tagName, oldName, newName) => {
|
|
|
168
241
|
return content;
|
|
169
242
|
};
|
|
170
243
|
exports.htmlAttributeTransformer = htmlAttributeTransformer;
|
|
244
|
+
const htmlEventTransformer = (fileInfo, tagName, oldEventName, newEventName) => {
|
|
245
|
+
const fileContent = fileInfo.source;
|
|
246
|
+
const root = (0, node_html_parser_1.default)(fileContent, { comment: true, blockTextElements: exports.blockTextElements });
|
|
247
|
+
let modified = false;
|
|
248
|
+
const elements = Array.from(root.querySelectorAll(tagName));
|
|
249
|
+
for (const element of elements) {
|
|
250
|
+
// Handle event bindings like (actionClick)="handler($event)"
|
|
251
|
+
const eventAttr = element.getAttribute(`(${oldEventName})`);
|
|
252
|
+
if (eventAttr) {
|
|
253
|
+
element.removeAttribute(`(${oldEventName})`);
|
|
254
|
+
element.setAttribute(`(${newEventName})`, eventAttr);
|
|
255
|
+
modified = true;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (modified) {
|
|
259
|
+
return root.toString();
|
|
260
|
+
}
|
|
261
|
+
return fileContent;
|
|
262
|
+
};
|
|
263
|
+
exports.htmlEventTransformer = htmlEventTransformer;
|
|
171
264
|
const templateAttributeValueTransformer = (root, tagName, attributeName, oldAttributeValue, newAttributeValue) => {
|
|
172
265
|
const elements = Array.from(root.getElementsByTagName(tagName)) || [];
|
|
173
266
|
for (const element of elements) {
|
|
@@ -185,88 +278,67 @@ const templateAttributeValueTransformer = (root, tagName, attributeName, oldAttr
|
|
|
185
278
|
}
|
|
186
279
|
};
|
|
187
280
|
exports.templateAttributeValueTransformer = templateAttributeValueTransformer;
|
|
188
|
-
const tsPropertyValueTransformer = (root, j, typeName, oldValue, newValue) => {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
path.node.typeAnnotation.typeAnnotation.typeName.name === typeName) {
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
return false;
|
|
202
|
-
})
|
|
203
|
-
.forEach(path => {
|
|
204
|
-
// Update the value if it matches the old value
|
|
205
|
-
if (path.node.value &&
|
|
206
|
-
path.node.value.type === 'StringLiteral' &&
|
|
207
|
-
path.node.value.value === oldValue) {
|
|
208
|
-
path.node.value.value = newValue;
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
// First, collect all variables with the specified type
|
|
212
|
-
root
|
|
213
|
-
.find(j.VariableDeclarator)
|
|
214
|
-
.filter(path => {
|
|
215
|
-
if (path.node.id.type === 'Identifier' &&
|
|
216
|
-
path.node.id.typeAnnotation?.typeAnnotation &&
|
|
217
|
-
path.node.id.typeAnnotation.typeAnnotation.type === 'TSTypeReference' &&
|
|
218
|
-
path.node.id.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
219
|
-
path.node.id.typeAnnotation.typeAnnotation.typeName.name === typeName) {
|
|
220
|
-
return true;
|
|
221
|
-
}
|
|
222
|
-
return false;
|
|
223
|
-
})
|
|
224
|
-
.forEach(path => {
|
|
225
|
-
if (path.node.id.type === 'Identifier') {
|
|
226
|
-
// Also update the initial value if it matches
|
|
227
|
-
if (path.node.init &&
|
|
228
|
-
path.node.init.type === 'StringLiteral' &&
|
|
229
|
-
path.node.init.value === oldValue) {
|
|
230
|
-
path.node.init.value = newValue;
|
|
281
|
+
const tsPropertyValueTransformer = (source, root, j, typeName, oldValue, newValue) => {
|
|
282
|
+
if (source.includes(typeName)) {
|
|
283
|
+
root.find(j.ClassProperty)
|
|
284
|
+
.filter((path) => {
|
|
285
|
+
if (path.node.typeAnnotation?.typeAnnotation &&
|
|
286
|
+
path.node.typeAnnotation.typeAnnotation.type === 'TSTypeReference' &&
|
|
287
|
+
path.node.typeAnnotation.typeAnnotation.typeName &&
|
|
288
|
+
path.node.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
289
|
+
path.node.typeAnnotation.typeAnnotation.typeName.name === typeName) {
|
|
290
|
+
return true;
|
|
231
291
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
path
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
292
|
+
return false;
|
|
293
|
+
})
|
|
294
|
+
.forEach((path) => {
|
|
295
|
+
if (path.node.value && path.node.value.type === 'StringLiteral' && path.node.value.value === oldValue) {
|
|
296
|
+
path.node.value.value = newValue;
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
root.find(j.VariableDeclarator)
|
|
300
|
+
.filter((path) => {
|
|
301
|
+
if (path.node.id.type === 'Identifier' &&
|
|
302
|
+
path.node.id.typeAnnotation?.typeAnnotation &&
|
|
303
|
+
path.node.id.typeAnnotation.typeAnnotation.type === 'TSTypeReference' &&
|
|
304
|
+
path.node.id.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
305
|
+
path.node.id.typeAnnotation.typeAnnotation.typeName.name === typeName) {
|
|
306
|
+
return true;
|
|
307
|
+
}
|
|
308
|
+
return false;
|
|
309
|
+
})
|
|
310
|
+
.forEach((path) => {
|
|
311
|
+
if (path.node.id.type === 'Identifier') {
|
|
312
|
+
if (path.node.init && path.node.init.type === 'StringLiteral' && path.node.init.value === oldValue) {
|
|
313
|
+
path.node.init.value = newValue;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
root.find(j.AssignmentExpression)
|
|
318
|
+
.filter((path) => {
|
|
319
|
+
return path.node.right.type === 'StringLiteral' && path.node.right.value === oldValue;
|
|
320
|
+
})
|
|
321
|
+
.forEach((path) => {
|
|
322
|
+
path.node.right.value = newValue;
|
|
323
|
+
});
|
|
324
|
+
root.find(j.JSXAttribute, {
|
|
325
|
+
value: {
|
|
326
|
+
type: 'StringLiteral',
|
|
327
|
+
value: oldValue,
|
|
328
|
+
},
|
|
329
|
+
}).forEach((path) => {
|
|
330
|
+
if (path.node.value?.type === 'StringLiteral') {
|
|
331
|
+
path.node.value.value = newValue;
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
}
|
|
259
335
|
};
|
|
260
336
|
exports.tsPropertyValueTransformer = tsPropertyValueTransformer;
|
|
261
337
|
const htmlAttributeValueTransformer = (fileInfo, tagName, attributeName, oldValue, newValue) => {
|
|
262
|
-
// Read file content from fileInfo
|
|
263
338
|
const fileContent = fileInfo.source;
|
|
264
|
-
|
|
265
|
-
const root = (0, node_html_parser_1.default)(fileContent);
|
|
266
|
-
// Find all elements matching the tagName
|
|
339
|
+
const root = (0, node_html_parser_1.default)(fileContent, { comment: true, blockTextElements: exports.blockTextElements });
|
|
267
340
|
const elements = root.querySelectorAll(tagName);
|
|
268
341
|
let modified = false;
|
|
269
|
-
// Process each element
|
|
270
342
|
for (const element of elements) {
|
|
271
343
|
// Handle static attributes (e.g., showText="overflow")
|
|
272
344
|
const staticAttr = element.getAttribute(attributeName);
|
|
@@ -287,37 +359,35 @@ const htmlAttributeValueTransformer = (fileInfo, tagName, attributeName, oldValu
|
|
|
287
359
|
}
|
|
288
360
|
}
|
|
289
361
|
}
|
|
290
|
-
// Return modified content if changes were made
|
|
291
362
|
if (modified) {
|
|
292
363
|
const updatedContent = root.toString();
|
|
293
364
|
return updatedContent;
|
|
294
365
|
}
|
|
295
|
-
// Return original content if no changes were made or if there was an error
|
|
296
366
|
return fileContent;
|
|
297
367
|
};
|
|
298
368
|
exports.htmlAttributeValueTransformer = htmlAttributeValueTransformer;
|
|
299
369
|
const htmlAttributeRemoval = (fileInfo, tagName, attributeName, propertyToRemove) => {
|
|
300
370
|
const filePath = fileInfo.path;
|
|
301
371
|
const fileContent = fileInfo.source;
|
|
302
|
-
const root = (0, node_html_parser_1.default)(fileContent);
|
|
372
|
+
const root = (0, node_html_parser_1.default)(fileContent, { comment: true, blockTextElements: exports.blockTextElements });
|
|
303
373
|
// Use the same logic as templateAttributeRemoval
|
|
304
374
|
const elements = root.querySelectorAll(tagName);
|
|
305
375
|
for (const element of elements) {
|
|
376
|
+
// If no propertyToRemove is specified, remove the entire attribute
|
|
377
|
+
if (!propertyToRemove) {
|
|
378
|
+
// Remove both bound and static attributes
|
|
379
|
+
element.removeAttribute(`[${attributeName}]`);
|
|
380
|
+
element.removeAttribute(attributeName);
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
306
383
|
// Look for bound attribute (e.g., [scrollable]="...")
|
|
307
384
|
const boundAttr = element.getAttribute(`[${attributeName}]`);
|
|
308
385
|
if (boundAttr) {
|
|
309
|
-
// Check if it's an object literal
|
|
310
386
|
if (boundAttr.trim().startsWith('{') && boundAttr.trim().endsWith('}')) {
|
|
311
|
-
// Process object literal like {mouseScrollSpeed: 10000}
|
|
312
387
|
const objectLiteral = boundAttr.trim();
|
|
313
|
-
// Build a regex that matches the property and its value
|
|
314
|
-
// This handles various formats like {prop: value}, { prop: value }, etc.
|
|
315
388
|
const propRegex = new RegExp(`\\s*${propertyToRemove}\\s*:\\s*[^,}]+\\s*(,\\s*)?`, 'g');
|
|
316
|
-
// Remove the property and any trailing comma
|
|
317
389
|
let newObjectLiteral = objectLiteral.replace(propRegex, '');
|
|
318
|
-
// Fix syntax if we removed the last property with trailing comma
|
|
319
390
|
newObjectLiteral = newObjectLiteral.replace(/,\s*}$/, '}');
|
|
320
|
-
// If the object is now empty, remove the attribute completely
|
|
321
391
|
if (newObjectLiteral === '{}') {
|
|
322
392
|
element.removeAttribute(`[${attributeName}]`);
|
|
323
393
|
}
|
|
@@ -325,44 +395,29 @@ const htmlAttributeRemoval = (fileInfo, tagName, attributeName, propertyToRemove
|
|
|
325
395
|
element.setAttribute(`[${attributeName}]`, newObjectLiteral);
|
|
326
396
|
}
|
|
327
397
|
}
|
|
328
|
-
// Check if it's a variable reference to an object
|
|
329
398
|
else {
|
|
330
|
-
// For variable references, we can't modify them in the template
|
|
331
|
-
// We should warn the user or handle this case specially
|
|
332
399
|
console.warn(`Cannot remove property from variable reference: ${boundAttr} in file ${filePath}`);
|
|
333
400
|
}
|
|
334
401
|
}
|
|
335
402
|
}
|
|
336
|
-
// Return the modified HTML content
|
|
337
403
|
return root.toString();
|
|
338
404
|
};
|
|
339
405
|
exports.htmlAttributeRemoval = htmlAttributeRemoval;
|
|
340
|
-
/**
|
|
341
|
-
* Removes a specified property from an object binding in HTML templates
|
|
342
|
-
*
|
|
343
|
-
* @param root - The HTML root element
|
|
344
|
-
* @param tagName - The tag to search for (e.g., 'kendo-tabstrip')
|
|
345
|
-
* @param attributeName - The attribute containing the object binding (e.g., 'scrollable')
|
|
346
|
-
* @param propertyToRemove - The property to remove from the object (e.g., 'mouseScrollSpeed')
|
|
347
|
-
*/
|
|
348
406
|
const templateAttributeRemoval = (root, tagName, attributeName, propertyToRemove) => {
|
|
349
407
|
const elements = root.querySelectorAll(tagName);
|
|
350
408
|
for (const element of elements) {
|
|
351
|
-
|
|
409
|
+
if (!propertyToRemove) {
|
|
410
|
+
element.removeAttribute(`[${attributeName}]`);
|
|
411
|
+
element.removeAttribute(attributeName);
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
352
414
|
const boundAttr = element.getAttribute(`[${attributeName}]`);
|
|
353
415
|
if (boundAttr) {
|
|
354
|
-
// Check if it's an object literal
|
|
355
416
|
if (boundAttr.trim().startsWith('{') && boundAttr.trim().endsWith('}')) {
|
|
356
|
-
// Process object literal like {mouseScrollSpeed: 10000}
|
|
357
417
|
const objectLiteral = boundAttr.trim();
|
|
358
|
-
// Build a regex that matches the property and its value
|
|
359
|
-
// This handles various formats like {prop: value}, { prop: value }, etc.
|
|
360
418
|
const propRegex = new RegExp(`\\s*${propertyToRemove}\\s*:\\s*[^,}]+\\s*(,\\s*)?`, 'g');
|
|
361
|
-
// Remove the property and any trailing comma
|
|
362
419
|
let newObjectLiteral = objectLiteral.replace(propRegex, '');
|
|
363
|
-
// Fix syntax if we removed the last property with trailing comma
|
|
364
420
|
newObjectLiteral = newObjectLiteral.replace(/,\s*}$/, '}');
|
|
365
|
-
// If the object is now empty, remove the attribute completely
|
|
366
421
|
if (newObjectLiteral === '{}') {
|
|
367
422
|
element.removeAttribute(`[${attributeName}]`);
|
|
368
423
|
}
|
|
@@ -370,181 +425,287 @@ const templateAttributeRemoval = (root, tagName, attributeName, propertyToRemove
|
|
|
370
425
|
element.setAttribute(`[${attributeName}]`, newObjectLiteral);
|
|
371
426
|
}
|
|
372
427
|
}
|
|
373
|
-
// Check if it's a variable reference to an object
|
|
374
428
|
else {
|
|
375
|
-
// For variable references, we can't modify them in the template
|
|
376
|
-
// We should warn the user or handle this case specially
|
|
377
429
|
console.warn(`Cannot remove property from variable reference: ${boundAttr}`);
|
|
378
430
|
}
|
|
379
431
|
}
|
|
380
432
|
}
|
|
381
433
|
};
|
|
382
434
|
exports.templateAttributeRemoval = templateAttributeRemoval;
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
* @param j - The JSCodeshift instance
|
|
388
|
-
* @param typeName - The type to target (e.g., 'TabStripScrollableSettings')
|
|
389
|
-
* @param propertyToRemove - The property to remove (e.g., 'mouseScrollSpeed')
|
|
390
|
-
*/
|
|
391
|
-
function tsPropertyRemoval(rootSource, j, typeName, propertyName) {
|
|
392
|
-
// Find class properties that have the specified type
|
|
393
|
-
rootSource
|
|
394
|
-
.find(j.ClassProperty, {
|
|
395
|
-
typeAnnotation: {
|
|
435
|
+
function tsPropertyRemoval(source, rootSource, j, typeName, propertyName) {
|
|
436
|
+
if (source.includes(typeName)) {
|
|
437
|
+
rootSource
|
|
438
|
+
.find(j.ClassProperty, {
|
|
396
439
|
typeAnnotation: {
|
|
397
|
-
|
|
398
|
-
|
|
440
|
+
typeAnnotation: {
|
|
441
|
+
typeName: {
|
|
442
|
+
name: typeName,
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
},
|
|
446
|
+
})
|
|
447
|
+
.forEach((path) => {
|
|
448
|
+
if (path.node.value && path.node.value.type === 'ObjectExpression') {
|
|
449
|
+
const properties = path.node.value.properties;
|
|
450
|
+
const propIndex = properties.findIndex((p) => p.type === 'ObjectProperty' &&
|
|
451
|
+
p.key &&
|
|
452
|
+
p.key.type === 'Identifier' &&
|
|
453
|
+
p.key.name === propertyName);
|
|
454
|
+
if (propIndex !== -1) {
|
|
455
|
+
if (properties.length === 1) {
|
|
456
|
+
j(path).remove();
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
properties.splice(propIndex, 1);
|
|
460
|
+
}
|
|
399
461
|
}
|
|
400
462
|
}
|
|
463
|
+
});
|
|
464
|
+
rootSource
|
|
465
|
+
.find(j.AssignmentExpression, {
|
|
466
|
+
left: {
|
|
467
|
+
type: 'MemberExpression',
|
|
468
|
+
object: {
|
|
469
|
+
type: 'MemberExpression',
|
|
470
|
+
},
|
|
471
|
+
property: {
|
|
472
|
+
name: propertyName,
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
})
|
|
476
|
+
.forEach((path) => {
|
|
477
|
+
j(path).remove();
|
|
478
|
+
});
|
|
479
|
+
return rootSource;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
const tsComponentPropertyRemoval = (source, root, j, componentType, componentProperty, propertyToRemove) => {
|
|
483
|
+
if (source.includes(componentType)) {
|
|
484
|
+
// If no propertyToRemove is specified, remove the entire componentProperty
|
|
485
|
+
if (!propertyToRemove) {
|
|
486
|
+
// Handle direct property assignments like: foo.scrollable = value;
|
|
487
|
+
root.find(j.AssignmentExpression)
|
|
488
|
+
.filter((path) => {
|
|
489
|
+
const { left } = path.value;
|
|
490
|
+
// Check if this assigns to component.componentProperty
|
|
491
|
+
if (left &&
|
|
492
|
+
left.type === 'MemberExpression' &&
|
|
493
|
+
left.property &&
|
|
494
|
+
left.property.name === componentProperty) {
|
|
495
|
+
// Check if the base object is our component type
|
|
496
|
+
return isComponentTypeMatch(root, j, left.object, componentType);
|
|
497
|
+
}
|
|
498
|
+
return false;
|
|
499
|
+
})
|
|
500
|
+
.forEach((path) => {
|
|
501
|
+
// Remove the entire statement
|
|
502
|
+
j(path).closest(j.ExpressionStatement).remove();
|
|
503
|
+
});
|
|
504
|
+
return root;
|
|
401
505
|
}
|
|
402
|
-
|
|
403
|
-
.
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
506
|
+
// CASE 1: Handle direct property assignments like: foo.scrollable.mouseScrollSpeed = 3000;
|
|
507
|
+
root.find(j.AssignmentExpression)
|
|
508
|
+
.filter((path) => {
|
|
509
|
+
const { left } = path.value;
|
|
510
|
+
// Check if this is a member expression assignment
|
|
511
|
+
if (left && left.type === 'MemberExpression') {
|
|
512
|
+
// Check if we're accessing the property to remove
|
|
513
|
+
if (left.property && left.property.name === propertyToRemove) {
|
|
514
|
+
// Check if we're accessing it from component.componentProperty
|
|
515
|
+
const obj = left.object;
|
|
516
|
+
if (obj &&
|
|
517
|
+
obj.type === 'MemberExpression' &&
|
|
518
|
+
obj.property &&
|
|
519
|
+
obj.property.name === componentProperty) {
|
|
520
|
+
// Now check if the base object is our component type
|
|
521
|
+
return isComponentTypeMatch(root, j, obj.object, componentType);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
return false;
|
|
526
|
+
})
|
|
527
|
+
.forEach((path) => {
|
|
528
|
+
// Remove the entire statement
|
|
529
|
+
j(path).closest(j.ExpressionStatement).remove();
|
|
530
|
+
});
|
|
531
|
+
// CASE 2 & 3: Handle object assignments like: foo.scrollable = { mouseScrollSpeed: 3000, ... };
|
|
532
|
+
root.find(j.AssignmentExpression)
|
|
533
|
+
.filter((path) => {
|
|
534
|
+
const { left, right } = path.value;
|
|
535
|
+
// Check if this assigns to component.componentProperty
|
|
536
|
+
if (left &&
|
|
537
|
+
left.type === 'MemberExpression' &&
|
|
538
|
+
left.property &&
|
|
539
|
+
left.property.name === componentProperty &&
|
|
540
|
+
right &&
|
|
541
|
+
right.type === 'ObjectExpression') {
|
|
542
|
+
// Check if the base object is our component type
|
|
543
|
+
return isComponentTypeMatch(root, j, left.object, componentType);
|
|
544
|
+
}
|
|
545
|
+
return false;
|
|
546
|
+
})
|
|
547
|
+
.forEach((path) => {
|
|
548
|
+
const properties = path.value.right.properties;
|
|
549
|
+
// Find the property we want to remove
|
|
550
|
+
const propIndex = properties.findIndex((p) => p &&
|
|
551
|
+
p.type === 'ObjectProperty' &&
|
|
409
552
|
p.key &&
|
|
410
553
|
p.key.type === 'Identifier' &&
|
|
411
|
-
p.key.name ===
|
|
554
|
+
p.key.name === propertyToRemove);
|
|
412
555
|
if (propIndex !== -1) {
|
|
413
|
-
// If property
|
|
414
|
-
// Case 1: If it's the only property, remove the entire class property
|
|
556
|
+
// Case 2: If it's the only property, remove the entire statement
|
|
415
557
|
if (properties.length === 1) {
|
|
416
|
-
j(path).remove();
|
|
558
|
+
j(path).closest(j.ExpressionStatement).remove();
|
|
417
559
|
}
|
|
418
|
-
// Case
|
|
560
|
+
// Case 3: If there are other properties, just remove this one property
|
|
419
561
|
else {
|
|
420
562
|
properties.splice(propIndex, 1);
|
|
421
563
|
}
|
|
422
564
|
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
rootSource
|
|
427
|
-
.find(j.AssignmentExpression, {
|
|
428
|
-
left: {
|
|
429
|
-
type: 'MemberExpression',
|
|
430
|
-
object: {
|
|
431
|
-
type: 'MemberExpression'
|
|
432
|
-
},
|
|
433
|
-
property: {
|
|
434
|
-
name: propertyName
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
})
|
|
438
|
-
.forEach(path => {
|
|
439
|
-
j(path).remove();
|
|
440
|
-
});
|
|
441
|
-
return rootSource;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Removes assignments to a specific nested property of a component
|
|
445
|
-
*
|
|
446
|
-
* @param root - The AST root
|
|
447
|
-
* @param j - The JSCodeshift instance
|
|
448
|
-
* @param componentType - The component type to target (e.g., 'TabStripComponent')
|
|
449
|
-
* @param componentProperty - The component property (e.g., 'scrollable')
|
|
450
|
-
* @param propertyToRemove - The nested property to remove assignments to (e.g., 'mouseScrollSpeed')
|
|
451
|
-
*/
|
|
452
|
-
const tsComponentPropertyRemoval = (root, j, componentType, componentProperty, propertyToRemove) => {
|
|
453
|
-
// CASE 1: Handle direct property assignments like: foo.scrollable.mouseScrollSpeed = 3000;
|
|
454
|
-
root
|
|
455
|
-
.find(j.AssignmentExpression)
|
|
456
|
-
.filter((path) => {
|
|
457
|
-
const { left } = path.value;
|
|
458
|
-
// Check if this is a member expression assignment
|
|
459
|
-
if (left && left.type === 'MemberExpression') {
|
|
460
|
-
// Check if we're accessing the property to remove
|
|
461
|
-
if (left.property && left.property.name === propertyToRemove) {
|
|
462
|
-
// Check if we're accessing it from component.componentProperty
|
|
463
|
-
const obj = left.object;
|
|
464
|
-
if (obj && obj.type === 'MemberExpression' &&
|
|
465
|
-
obj.property && obj.property.name === componentProperty) {
|
|
466
|
-
// Now check if the base object is our component type
|
|
467
|
-
return isComponentTypeMatch(root, j, obj.object, componentType);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
return false;
|
|
472
|
-
})
|
|
473
|
-
.forEach((path) => {
|
|
474
|
-
// Remove the entire statement
|
|
475
|
-
j(path).closest(j.ExpressionStatement).remove();
|
|
476
|
-
});
|
|
477
|
-
// CASE 2 & 3: Handle object assignments like: foo.scrollable = { mouseScrollSpeed: 3000, ... };
|
|
478
|
-
root
|
|
479
|
-
.find(j.AssignmentExpression)
|
|
480
|
-
.filter((path) => {
|
|
481
|
-
const { left, right } = path.value;
|
|
482
|
-
// Check if this assigns to component.componentProperty
|
|
483
|
-
if (left && left.type === 'MemberExpression' &&
|
|
484
|
-
left.property && left.property.name === componentProperty &&
|
|
485
|
-
right && right.type === 'ObjectExpression') {
|
|
486
|
-
// Check if the base object is our component type
|
|
487
|
-
return isComponentTypeMatch(root, j, left.object, componentType);
|
|
488
|
-
}
|
|
489
|
-
return false;
|
|
490
|
-
})
|
|
491
|
-
.forEach((path) => {
|
|
492
|
-
const properties = path.value.right.properties;
|
|
493
|
-
// Find the property we want to remove
|
|
494
|
-
const propIndex = properties.findIndex((p) => p && p.type === 'ObjectProperty' &&
|
|
495
|
-
p.key && p.key.type === 'Identifier' &&
|
|
496
|
-
p.key.name === propertyToRemove);
|
|
497
|
-
if (propIndex !== -1) {
|
|
498
|
-
// Case 2: If it's the only property, remove the entire statement
|
|
499
|
-
if (properties.length === 1) {
|
|
500
|
-
j(path).closest(j.ExpressionStatement).remove();
|
|
501
|
-
}
|
|
502
|
-
// Case 3: If there are other properties, just remove this one property
|
|
503
|
-
else {
|
|
504
|
-
properties.splice(propIndex, 1);
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
return root;
|
|
565
|
+
});
|
|
566
|
+
return root;
|
|
567
|
+
}
|
|
509
568
|
};
|
|
510
569
|
exports.tsComponentPropertyRemoval = tsComponentPropertyRemoval;
|
|
511
570
|
// Helper function to check if a node is a component of the specified type
|
|
512
571
|
function isComponentTypeMatch(root, j, node, componentType) {
|
|
513
572
|
if (!node)
|
|
514
573
|
return false;
|
|
515
|
-
// Case 1: Direct match for 'this.propertyName'
|
|
516
574
|
if (node.type === 'ThisExpression') {
|
|
517
|
-
return true;
|
|
575
|
+
return true;
|
|
518
576
|
}
|
|
519
|
-
// Case 2: Function parameter
|
|
520
577
|
if (node.type === 'Identifier') {
|
|
521
578
|
const paramName = node.name;
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
param.name === paramName &&
|
|
528
|
-
param.typeAnnotation?.typeAnnotation?.typeName?.name === componentType);
|
|
579
|
+
return root.find(j.Function).some((path) => {
|
|
580
|
+
return (path.node.params &&
|
|
581
|
+
path.node.params.some((param) => param.type === 'Identifier' &&
|
|
582
|
+
param.name === paramName &&
|
|
583
|
+
param.typeAnnotation?.typeAnnotation?.typeName?.name === componentType));
|
|
529
584
|
});
|
|
530
585
|
}
|
|
531
|
-
// Case 3: Member expression (obj.prop)
|
|
532
586
|
if (node.type === 'MemberExpression') {
|
|
533
|
-
// This would need more complex logic to determine if the object is of the right type
|
|
534
|
-
// For now, we can check if it's a property that has been declared with the right type
|
|
535
587
|
if (node.object.type === 'ThisExpression' && node.property.type === 'Identifier') {
|
|
536
588
|
const propName = node.property.name;
|
|
537
|
-
return root
|
|
589
|
+
return (root
|
|
538
590
|
.find(j.ClassProperty, {
|
|
539
591
|
key: { name: propName },
|
|
540
592
|
typeAnnotation: {
|
|
541
593
|
typeAnnotation: {
|
|
542
|
-
typeName: { name: componentType }
|
|
543
|
-
}
|
|
544
|
-
}
|
|
594
|
+
typeName: { name: componentType },
|
|
595
|
+
},
|
|
596
|
+
},
|
|
545
597
|
})
|
|
546
|
-
.size() > 0;
|
|
598
|
+
.size() > 0);
|
|
547
599
|
}
|
|
548
600
|
}
|
|
549
601
|
return false;
|
|
550
602
|
}
|
|
603
|
+
const tsInterfaceTransformer = (fileInfo, rootSource, j, packageName, interfaceName, newName) => {
|
|
604
|
+
const source = fileInfo.source;
|
|
605
|
+
if (source.includes(interfaceName)) {
|
|
606
|
+
let isImportedFromKendoListbox = false;
|
|
607
|
+
rootSource.find(j.ImportDeclaration).forEach((path) => {
|
|
608
|
+
if (path.node.source &&
|
|
609
|
+
path.node.source.value === packageName &&
|
|
610
|
+
path.node.specifiers) {
|
|
611
|
+
path.node.specifiers.forEach((specifier) => {
|
|
612
|
+
if (specifier.type === 'ImportSpecifier' &&
|
|
613
|
+
specifier.imported.type === 'Identifier' &&
|
|
614
|
+
specifier.imported.name === interfaceName) {
|
|
615
|
+
isImportedFromKendoListbox = true;
|
|
616
|
+
specifier.imported.name = newName;
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
if (!isImportedFromKendoListbox) {
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
rootSource.find(j.ClassProperty).forEach((path) => {
|
|
625
|
+
if (path.node.typeAnnotation &&
|
|
626
|
+
path.node.typeAnnotation.typeAnnotation &&
|
|
627
|
+
path.node.typeAnnotation.typeAnnotation.type === 'TSTypeReference' &&
|
|
628
|
+
path.node.typeAnnotation.typeAnnotation.typeName &&
|
|
629
|
+
path.node.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
630
|
+
path.node.typeAnnotation.typeAnnotation.typeName.name === interfaceName) {
|
|
631
|
+
path.node.typeAnnotation.typeAnnotation.typeName.name = newName;
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
rootSource.find(j.VariableDeclarator).forEach((path) => {
|
|
635
|
+
if (path.node.id.type === 'Identifier' &&
|
|
636
|
+
path.node.id.typeAnnotation &&
|
|
637
|
+
path.node.id.typeAnnotation.typeAnnotation &&
|
|
638
|
+
path.node.id.typeAnnotation.typeAnnotation.type === 'TSTypeReference' &&
|
|
639
|
+
path.node.id.typeAnnotation.typeAnnotation.typeName &&
|
|
640
|
+
path.node.id.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
641
|
+
path.node.id.typeAnnotation.typeAnnotation.typeName.name === interfaceName) {
|
|
642
|
+
path.node.id.typeAnnotation.typeAnnotation.typeName.name = newName;
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
rootSource.find(j.FunctionDeclaration).forEach((path) => {
|
|
646
|
+
if (path.node.params) {
|
|
647
|
+
path.node.params.forEach((param) => {
|
|
648
|
+
if (param.type === 'Identifier' &&
|
|
649
|
+
param.typeAnnotation &&
|
|
650
|
+
param.typeAnnotation.typeAnnotation &&
|
|
651
|
+
param.typeAnnotation.typeAnnotation.type === 'TSTypeReference' &&
|
|
652
|
+
param.typeAnnotation.typeAnnotation.typeName &&
|
|
653
|
+
param.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
654
|
+
param.typeAnnotation.typeAnnotation.typeName.name === interfaceName) {
|
|
655
|
+
param.typeAnnotation.typeAnnotation.typeName.name = newName;
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
rootSource.find(j.ArrowFunctionExpression).forEach((path) => {
|
|
661
|
+
if (path.node.params) {
|
|
662
|
+
path.node.params.forEach((param) => {
|
|
663
|
+
if (param.type === 'Identifier' &&
|
|
664
|
+
param.typeAnnotation &&
|
|
665
|
+
param.typeAnnotation.typeAnnotation &&
|
|
666
|
+
param.typeAnnotation.typeAnnotation.type === 'TSTypeReference' &&
|
|
667
|
+
param.typeAnnotation.typeAnnotation.typeName &&
|
|
668
|
+
param.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
669
|
+
param.typeAnnotation.typeAnnotation.typeName.name === interfaceName) {
|
|
670
|
+
param.typeAnnotation.typeAnnotation.typeName.name = newName;
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
rootSource.find(j.ClassMethod).forEach((path) => {
|
|
676
|
+
if (path.node.params) {
|
|
677
|
+
path.node.params.forEach((param) => {
|
|
678
|
+
if (param.type === 'Identifier' &&
|
|
679
|
+
param.typeAnnotation &&
|
|
680
|
+
param.typeAnnotation.typeAnnotation &&
|
|
681
|
+
param.typeAnnotation.typeAnnotation.type === 'TSTypeReference' &&
|
|
682
|
+
param.typeAnnotation.typeAnnotation.typeName &&
|
|
683
|
+
param.typeAnnotation.typeAnnotation.typeName.type === 'Identifier' &&
|
|
684
|
+
param.typeAnnotation.typeAnnotation.typeName.name === interfaceName) {
|
|
685
|
+
param.typeAnnotation.typeAnnotation.typeName.name = newName;
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
rootSource.find(j.Function).forEach((path) => {
|
|
691
|
+
if (path.node.returnType &&
|
|
692
|
+
path.node.returnType.typeAnnotation &&
|
|
693
|
+
path.node.returnType.typeAnnotation.type === 'TSTypeReference' &&
|
|
694
|
+
path.node.returnType.typeAnnotation.typeName &&
|
|
695
|
+
path.node.returnType.typeAnnotation.typeName.type === 'Identifier' &&
|
|
696
|
+
path.node.returnType.typeAnnotation.typeName.name === interfaceName) {
|
|
697
|
+
path.node.returnType.typeAnnotation.typeName.name = newName;
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
rootSource.find(j.TSAsExpression).forEach((path) => {
|
|
701
|
+
if (path.node.typeAnnotation &&
|
|
702
|
+
path.node.typeAnnotation.type === 'TSTypeReference' &&
|
|
703
|
+
path.node.typeAnnotation.typeName &&
|
|
704
|
+
path.node.typeAnnotation.typeName.type === 'Identifier' &&
|
|
705
|
+
path.node.typeAnnotation.typeName.name === interfaceName) {
|
|
706
|
+
path.node.typeAnnotation.typeName.name = newName;
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
exports.tsInterfaceTransformer = tsInterfaceTransformer;
|
|
@@ -34,11 +34,13 @@ const fs = __importStar(require("fs"));
|
|
|
34
34
|
function default_1(fileInfo, api) {
|
|
35
35
|
const filePath = fileInfo.path;
|
|
36
36
|
if (filePath.endsWith('.html')) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
|
|
38
|
+
let updatedContent = fileInfo.source;
|
|
39
|
+
updatedContent = (0, utils_1.htmlAttributeValueTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-toolbar-button', 'showIcon', 'overflow', 'menu');
|
|
40
|
+
updatedContent = (0, utils_1.htmlAttributeValueTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-toolbar-button', 'showIcon', 'both', 'always');
|
|
41
|
+
// Only write to file once after all transformations
|
|
42
|
+
fs.writeFileSync(filePath, updatedContent, 'utf-8');
|
|
43
|
+
}
|
|
42
44
|
return;
|
|
43
45
|
}
|
|
44
46
|
const j = api.jscodeshift;
|
|
@@ -47,7 +49,7 @@ function default_1(fileInfo, api) {
|
|
|
47
49
|
(0, utils_1.templateAttributeValueTransformer)(root, 'kendo-toolbar-button', 'showIcon', 'overflow', 'menu');
|
|
48
50
|
(0, utils_1.templateAttributeValueTransformer)(root, 'kendo-toolbar-button', 'showIcon', 'both', 'always');
|
|
49
51
|
});
|
|
50
|
-
(0, utils_1.tsPropertyValueTransformer)(rootSource, j, 'DisplayMode', 'overflow', 'menu');
|
|
51
|
-
(0, utils_1.tsPropertyValueTransformer)(rootSource, j, 'DisplayMode', 'both', 'always');
|
|
52
|
+
(0, utils_1.tsPropertyValueTransformer)(fileInfo.source, rootSource, j, 'DisplayMode', 'overflow', 'menu');
|
|
53
|
+
(0, utils_1.tsPropertyValueTransformer)(fileInfo.source, rootSource, j, 'DisplayMode', 'both', 'always');
|
|
52
54
|
return rootSource.toSource();
|
|
53
55
|
}
|
|
@@ -34,11 +34,13 @@ const fs = __importStar(require("fs"));
|
|
|
34
34
|
function default_1(fileInfo, api) {
|
|
35
35
|
const filePath = fileInfo.path;
|
|
36
36
|
if (filePath.endsWith('.html')) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
|
|
38
|
+
let updatedContent = fileInfo.source;
|
|
39
|
+
updatedContent = (0, utils_1.htmlAttributeValueTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-toolbar-button', 'showText', 'overflow', 'menu');
|
|
40
|
+
updatedContent = (0, utils_1.htmlAttributeValueTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-toolbar-button', 'showText', 'both', 'always');
|
|
41
|
+
// Only write to file once after all transformations
|
|
42
|
+
fs.writeFileSync(filePath, updatedContent, 'utf-8');
|
|
43
|
+
}
|
|
42
44
|
return;
|
|
43
45
|
}
|
|
44
46
|
const j = api.jscodeshift;
|
|
@@ -47,7 +49,7 @@ function default_1(fileInfo, api) {
|
|
|
47
49
|
(0, utils_1.templateAttributeValueTransformer)(root, 'kendo-toolbar-button', 'showText', 'overflow', 'menu');
|
|
48
50
|
(0, utils_1.templateAttributeValueTransformer)(root, 'kendo-toolbar-button', 'showText', 'both', 'always');
|
|
49
51
|
});
|
|
50
|
-
(0, utils_1.tsPropertyValueTransformer)(rootSource, j, 'DisplayMode', 'overflow', 'menu');
|
|
51
|
-
(0, utils_1.tsPropertyValueTransformer)(rootSource, j, 'DisplayMode', 'both', 'always');
|
|
52
|
+
(0, utils_1.tsPropertyValueTransformer)(fileInfo.source, rootSource, j, 'DisplayMode', 'overflow', 'menu');
|
|
53
|
+
(0, utils_1.tsPropertyValueTransformer)(fileInfo.source, rootSource, j, 'DisplayMode', 'both', 'always');
|
|
52
54
|
return rootSource.toSource();
|
|
53
55
|
}
|
|
@@ -10,7 +10,7 @@ export const packageMetadata = {
|
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCode: 'KENDOUIANGULAR',
|
|
12
12
|
productCodes: ['KENDOUIANGULAR'],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: '21.0.0
|
|
13
|
+
publishDate: 1762934390,
|
|
14
|
+
version: '21.0.0',
|
|
15
15
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
16
16
|
};
|
|
@@ -611,6 +611,11 @@ export class ToolBarComponent {
|
|
|
611
611
|
this.displayAnchor();
|
|
612
612
|
const isImmediateResize = (Date.now() - this.overflowButtonClickedTime) < immediateResizeThreshold;
|
|
613
613
|
if (this.popupOpen && !isImmediateResize) {
|
|
614
|
+
const eventArgs = new PreventableEvent();
|
|
615
|
+
this.close.emit(eventArgs);
|
|
616
|
+
if (eventArgs.isDefaultPrevented()) {
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
614
619
|
this.toggle();
|
|
615
620
|
}
|
|
616
621
|
}
|
|
@@ -790,6 +795,9 @@ export class ToolBarComponent {
|
|
|
790
795
|
this.showOverflowSeparator = isVisible;
|
|
791
796
|
this.cdr.detectChanges();
|
|
792
797
|
}
|
|
798
|
+
if (!isVisible) {
|
|
799
|
+
this.destroyPopup();
|
|
800
|
+
}
|
|
793
801
|
}
|
|
794
802
|
get popupWidth() {
|
|
795
803
|
if (!this.popupSettings || !this.popupSettings.width) {
|
|
@@ -910,6 +918,7 @@ export class ToolBarComponent {
|
|
|
910
918
|
this.popupSubs.unsubscribe();
|
|
911
919
|
this.popupRef.close();
|
|
912
920
|
this.popupRef = null;
|
|
921
|
+
this._open = false;
|
|
913
922
|
}
|
|
914
923
|
}
|
|
915
924
|
handleClasses(value, input) {
|
|
@@ -1194,7 +1203,7 @@ export class ToolBarComponent {
|
|
|
1194
1203
|
[attr.dir]="direction === 'rtl' ? 'rtl' : null"
|
|
1195
1204
|
[attr.aria-labelledby]="overflowBtnId">
|
|
1196
1205
|
<ng-container *ngFor="let tool of overflowTools; let index = index">
|
|
1197
|
-
<ng-template
|
|
1206
|
+
<ng-template
|
|
1198
1207
|
*ngIf="tool.popupTemplate"
|
|
1199
1208
|
kendoToolbarRenderer
|
|
1200
1209
|
[tool]="tool"
|
|
@@ -1410,7 +1419,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1410
1419
|
[attr.dir]="direction === 'rtl' ? 'rtl' : null"
|
|
1411
1420
|
[attr.aria-labelledby]="overflowBtnId">
|
|
1412
1421
|
<ng-container *ngFor="let tool of overflowTools; let index = index">
|
|
1413
|
-
<ng-template
|
|
1422
|
+
<ng-template
|
|
1414
1423
|
*ngIf="tool.popupTemplate"
|
|
1415
1424
|
kendoToolbarRenderer
|
|
1416
1425
|
[tool]="tool"
|
|
@@ -310,7 +310,7 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
312
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolBarButtonComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
313
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
313
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ToolBarButtonComponent, isStandalone: true, selector: "kendo-toolbar-button", inputs: { showText: "showText", showIcon: "showIcon", text: "text", style: "style", className: "className", title: "title", disabled: "disabled", toggleable: "toggleable", look: "look", togglable: "togglable", selected: "selected", fillMode: "fillMode", rounded: "rounded", themeColor: "themeColor", icon: "icon", iconClass: "iconClass", svgIcon: "svgIcon", imageUrl: "imageUrl" }, outputs: { click: "click", pointerdown: "pointerdown", selectedChange: "selectedChange" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonComponent) }], viewQueries: [{ propertyName: "toolbarButtonElement", first: true, predicate: ["toolbarButton"], descendants: true, read: ElementRef }, { propertyName: "sectionButtonElement", first: true, predicate: ["sectionButton"], descendants: true, read: ElementRef }, { propertyName: "overflowButtonElement", first: true, predicate: ["overflowButton"], descendants: true, read: ElementRef }], exportAs: ["kendoToolBarButton"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
314
314
|
<ng-template #toolbarTemplate>
|
|
315
315
|
<kendo-badge-container *ngIf="hasBadgeContainer">
|
|
316
316
|
<button
|
|
@@ -393,6 +393,11 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
393
393
|
[customFontClass]="overflowOptions.iconClass"
|
|
394
394
|
[svgIcon]="overflowOptions.svgIcon"
|
|
395
395
|
></kendo-icon-wrapper>
|
|
396
|
+
@if (overflowOptions.imageUrl) {
|
|
397
|
+
<span class="k-icon k-button-icon">
|
|
398
|
+
<img [src]="overflowOptions.imageUrl" role="presentation" class="k-image" />
|
|
399
|
+
</span>
|
|
400
|
+
}
|
|
396
401
|
<span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
|
|
397
402
|
</span>
|
|
398
403
|
</div>
|
|
@@ -550,6 +555,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
550
555
|
[customFontClass]="overflowOptions.iconClass"
|
|
551
556
|
[svgIcon]="overflowOptions.svgIcon"
|
|
552
557
|
></kendo-icon-wrapper>
|
|
558
|
+
@if (overflowOptions.imageUrl) {
|
|
559
|
+
<span class="k-icon k-button-icon">
|
|
560
|
+
<img [src]="overflowOptions.imageUrl" role="presentation" class="k-image" />
|
|
561
|
+
</span>
|
|
562
|
+
}
|
|
553
563
|
<span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
|
|
554
564
|
</span>
|
|
555
565
|
</div>
|
|
@@ -26,8 +26,8 @@ const packageMetadata = {
|
|
|
26
26
|
productName: 'Kendo UI for Angular',
|
|
27
27
|
productCode: 'KENDOUIANGULAR',
|
|
28
28
|
productCodes: ['KENDOUIANGULAR'],
|
|
29
|
-
publishDate:
|
|
30
|
-
version: '21.0.0
|
|
29
|
+
publishDate: 1762934390,
|
|
30
|
+
version: '21.0.0',
|
|
31
31
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -1688,6 +1688,11 @@ class ToolBarComponent {
|
|
|
1688
1688
|
this.displayAnchor();
|
|
1689
1689
|
const isImmediateResize = (Date.now() - this.overflowButtonClickedTime) < immediateResizeThreshold;
|
|
1690
1690
|
if (this.popupOpen && !isImmediateResize) {
|
|
1691
|
+
const eventArgs = new PreventableEvent();
|
|
1692
|
+
this.close.emit(eventArgs);
|
|
1693
|
+
if (eventArgs.isDefaultPrevented()) {
|
|
1694
|
+
return;
|
|
1695
|
+
}
|
|
1691
1696
|
this.toggle();
|
|
1692
1697
|
}
|
|
1693
1698
|
}
|
|
@@ -1867,6 +1872,9 @@ class ToolBarComponent {
|
|
|
1867
1872
|
this.showOverflowSeparator = isVisible;
|
|
1868
1873
|
this.cdr.detectChanges();
|
|
1869
1874
|
}
|
|
1875
|
+
if (!isVisible) {
|
|
1876
|
+
this.destroyPopup();
|
|
1877
|
+
}
|
|
1870
1878
|
}
|
|
1871
1879
|
get popupWidth() {
|
|
1872
1880
|
if (!this.popupSettings || !this.popupSettings.width) {
|
|
@@ -1987,6 +1995,7 @@ class ToolBarComponent {
|
|
|
1987
1995
|
this.popupSubs.unsubscribe();
|
|
1988
1996
|
this.popupRef.close();
|
|
1989
1997
|
this.popupRef = null;
|
|
1998
|
+
this._open = false;
|
|
1990
1999
|
}
|
|
1991
2000
|
}
|
|
1992
2001
|
handleClasses(value, input) {
|
|
@@ -2271,7 +2280,7 @@ class ToolBarComponent {
|
|
|
2271
2280
|
[attr.dir]="direction === 'rtl' ? 'rtl' : null"
|
|
2272
2281
|
[attr.aria-labelledby]="overflowBtnId">
|
|
2273
2282
|
<ng-container *ngFor="let tool of overflowTools; let index = index">
|
|
2274
|
-
<ng-template
|
|
2283
|
+
<ng-template
|
|
2275
2284
|
*ngIf="tool.popupTemplate"
|
|
2276
2285
|
kendoToolbarRenderer
|
|
2277
2286
|
[tool]="tool"
|
|
@@ -2487,7 +2496,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2487
2496
|
[attr.dir]="direction === 'rtl' ? 'rtl' : null"
|
|
2488
2497
|
[attr.aria-labelledby]="overflowBtnId">
|
|
2489
2498
|
<ng-container *ngFor="let tool of overflowTools; let index = index">
|
|
2490
|
-
<ng-template
|
|
2499
|
+
<ng-template
|
|
2491
2500
|
*ngIf="tool.popupTemplate"
|
|
2492
2501
|
kendoToolbarRenderer
|
|
2493
2502
|
[tool]="tool"
|
|
@@ -2911,7 +2920,7 @@ class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
2911
2920
|
});
|
|
2912
2921
|
}
|
|
2913
2922
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolBarButtonComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
2914
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2923
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ToolBarButtonComponent, isStandalone: true, selector: "kendo-toolbar-button", inputs: { showText: "showText", showIcon: "showIcon", text: "text", style: "style", className: "className", title: "title", disabled: "disabled", toggleable: "toggleable", look: "look", togglable: "togglable", selected: "selected", fillMode: "fillMode", rounded: "rounded", themeColor: "themeColor", icon: "icon", iconClass: "iconClass", svgIcon: "svgIcon", imageUrl: "imageUrl" }, outputs: { click: "click", pointerdown: "pointerdown", selectedChange: "selectedChange" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonComponent) }], viewQueries: [{ propertyName: "toolbarButtonElement", first: true, predicate: ["toolbarButton"], descendants: true, read: ElementRef }, { propertyName: "sectionButtonElement", first: true, predicate: ["sectionButton"], descendants: true, read: ElementRef }, { propertyName: "overflowButtonElement", first: true, predicate: ["overflowButton"], descendants: true, read: ElementRef }], exportAs: ["kendoToolBarButton"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
2915
2924
|
<ng-template #toolbarTemplate>
|
|
2916
2925
|
<kendo-badge-container *ngIf="hasBadgeContainer">
|
|
2917
2926
|
<button
|
|
@@ -2994,6 +3003,11 @@ class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
2994
3003
|
[customFontClass]="overflowOptions.iconClass"
|
|
2995
3004
|
[svgIcon]="overflowOptions.svgIcon"
|
|
2996
3005
|
></kendo-icon-wrapper>
|
|
3006
|
+
@if (overflowOptions.imageUrl) {
|
|
3007
|
+
<span class="k-icon k-button-icon">
|
|
3008
|
+
<img [src]="overflowOptions.imageUrl" role="presentation" class="k-image" />
|
|
3009
|
+
</span>
|
|
3010
|
+
}
|
|
2997
3011
|
<span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
|
|
2998
3012
|
</span>
|
|
2999
3013
|
</div>
|
|
@@ -3151,6 +3165,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3151
3165
|
[customFontClass]="overflowOptions.iconClass"
|
|
3152
3166
|
[svgIcon]="overflowOptions.svgIcon"
|
|
3153
3167
|
></kendo-icon-wrapper>
|
|
3168
|
+
@if (overflowOptions.imageUrl) {
|
|
3169
|
+
<span class="k-icon k-button-icon">
|
|
3170
|
+
<img [src]="overflowOptions.imageUrl" role="presentation" class="k-image" />
|
|
3171
|
+
</span>
|
|
3172
|
+
}
|
|
3154
3173
|
<span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
|
|
3155
3174
|
</span>
|
|
3156
3175
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-toolbar",
|
|
3
|
-
"version": "21.0.0
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Kendo UI Angular Toolbar component - a single UI element that organizes buttons and other navigation elements",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"package": {
|
|
46
46
|
"productName": "Kendo UI for Angular",
|
|
47
47
|
"productCode": "KENDOUIANGULAR",
|
|
48
|
-
"publishDate":
|
|
48
|
+
"publishDate": 1762934390,
|
|
49
49
|
"licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
@@ -55,17 +55,17 @@
|
|
|
55
55
|
"@angular/core": "18 - 20",
|
|
56
56
|
"@angular/platform-browser": "18 - 20",
|
|
57
57
|
"@progress/kendo-licensing": "^1.7.0",
|
|
58
|
-
"@progress/kendo-angular-buttons": "21.0.0
|
|
59
|
-
"@progress/kendo-angular-common": "21.0.0
|
|
60
|
-
"@progress/kendo-angular-l10n": "21.0.0
|
|
61
|
-
"@progress/kendo-angular-icons": "21.0.0
|
|
62
|
-
"@progress/kendo-angular-indicators": "21.0.0
|
|
63
|
-
"@progress/kendo-angular-popup": "21.0.0
|
|
58
|
+
"@progress/kendo-angular-buttons": "21.0.0",
|
|
59
|
+
"@progress/kendo-angular-common": "21.0.0",
|
|
60
|
+
"@progress/kendo-angular-l10n": "21.0.0",
|
|
61
|
+
"@progress/kendo-angular-icons": "21.0.0",
|
|
62
|
+
"@progress/kendo-angular-indicators": "21.0.0",
|
|
63
|
+
"@progress/kendo-angular-popup": "21.0.0",
|
|
64
64
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"tslib": "^2.3.1",
|
|
68
|
-
"@progress/kendo-angular-schematics": "21.0.0
|
|
68
|
+
"@progress/kendo-angular-schematics": "21.0.0",
|
|
69
69
|
"node-html-parser": "^7.0.1"
|
|
70
70
|
},
|
|
71
71
|
"schematics": "./schematics/collection.json",
|