@progress/kendo-angular-scheduler 24.0.0-develop.9 → 24.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/libs/common/src/codemods/utils.js +53 -18
- package/codemods/libs/scheduler/codemods/v24/scheduler-rendering-changes.js +88 -0
- package/fesm2022/progress-kendo-angular-scheduler.mjs +312 -209
- package/loading.component.d.ts +1 -9
- package/package-metadata.mjs +2 -2
- package/package.json +23 -16
- package/scheduler.component.d.ts +4 -5
- package/schematics/ngAdd/index.js +3 -3
- package/toolbar/navigation.component.d.ts +0 -1
- package/toolbar/view-selector.component.d.ts +16 -0
- package/views/agenda/agenda-view-list.component.d.ts +2 -2
- package/views/common/base-view.d.ts +2 -0
- package/views/day-time/day-time-view-item.component.d.ts +4 -4
- package/views/day-time/day-time-view.component.d.ts +3 -0
- package/views/month/month-view-item.component.d.ts +2 -2
- package/views/month/month-view-renderer.component.d.ts +1 -0
- package/views/multi-day/multi-day-view-renderer.component.d.ts +1 -0
- package/views/timeline/timeline-multi-day-view.component.d.ts +1 -1
- package/views/utils.d.ts +2 -0
- package/views/view-items/base-view-item.d.ts +2 -2
- package/views/year/year-view-internal.component.d.ts +2 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
"use strict";
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.tsInterfaceTransformer = exports.tsPropertyValueTransformer = exports.tsPropertyTransformer = exports.tsComponentPropertyRemoval = exports.attributeRemoval = exports.attributeValueUpdate = exports.attributeNameValueUpdate = exports.attributeNameUpdate = exports.eventUpdate = exports.htmlTransformer = exports.blockTextElements = void 0;
|
|
7
|
+
exports.tsInterfaceTransformer = exports.tsPropertyValueTransformer = exports.tsPropertyTransformer = exports.tsComponentPropertyRemoval = exports.attributeConditionalRemoval = exports.attributeRemoval = exports.attributeValueUpdate = exports.attributeNameValueUpdate = exports.attributeNameUpdate = exports.eventUpdate = exports.htmlTransformer = exports.blockTextElements = void 0;
|
|
8
8
|
exports.hasKendoInTemplate = hasKendoInTemplate;
|
|
9
9
|
exports.isImportedFromPackage = isImportedFromPackage;
|
|
10
10
|
exports.tsPropertyRemoval = tsPropertyRemoval;
|
|
@@ -345,6 +345,34 @@ const attributeRemoval = (templateContent, tagName, attributeName, propertyToRem
|
|
|
345
345
|
});
|
|
346
346
|
};
|
|
347
347
|
exports.attributeRemoval = attributeRemoval;
|
|
348
|
+
/**
|
|
349
|
+
* Removes an attribute from a tag only when its value matches one of the specified values.
|
|
350
|
+
* Handles both static (`attr="value"`) and bound (`[attr]="'value'"`) forms.
|
|
351
|
+
*
|
|
352
|
+
* @param templateContent - The template string content to transform
|
|
353
|
+
* @param tagName - The HTML tag name to target (e.g., 'kendo-button')
|
|
354
|
+
* @param attributeName - The attribute name to conditionally remove
|
|
355
|
+
* @param values - The attribute values that trigger removal
|
|
356
|
+
* @returns The transformed template content
|
|
357
|
+
*/
|
|
358
|
+
const attributeConditionalRemoval = (templateContent, tagName, attributeName, values) => {
|
|
359
|
+
const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
360
|
+
const escapedTag = escapeRegex(tagName);
|
|
361
|
+
const escapedAttr = escapeRegex(attributeName);
|
|
362
|
+
// Remove bound attributes [attribute]="value"
|
|
363
|
+
const boundAttributePattern = new RegExp(`(<${escapedTag}[^>]*?)\\s+\\[${escapedAttr}\\]\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)([^>]*?>)`, 'gi');
|
|
364
|
+
// Remove static attributes attribute="value"
|
|
365
|
+
const staticAttributePattern = new RegExp(`(<${escapedTag}[^>]*?)\\s+${escapedAttr}\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)([^>]*?>)`, 'gi');
|
|
366
|
+
// Strip outer and inner quotes to extract the raw value for comparison
|
|
367
|
+
const matchesValue = (raw) => {
|
|
368
|
+
const inner = raw.replace(/^["']|["']$/g, '').replace(/^['"]|['"]$/g, '');
|
|
369
|
+
return values.includes(inner);
|
|
370
|
+
};
|
|
371
|
+
let result = templateContent.replace(boundAttributePattern, (match, prefix, value, suffix) => matchesValue(value) ? prefix + suffix : match);
|
|
372
|
+
result = result.replace(staticAttributePattern, (match, prefix, value, suffix) => matchesValue(value) ? prefix + suffix : match);
|
|
373
|
+
return result;
|
|
374
|
+
};
|
|
375
|
+
exports.attributeConditionalRemoval = attributeConditionalRemoval;
|
|
348
376
|
function tsPropertyRemoval(source, rootSource, j, packageName, typeName, propertyName) {
|
|
349
377
|
if (source.includes(typeName)) {
|
|
350
378
|
if (!isImportedFromPackage(rootSource, j, packageName, typeName)) {
|
|
@@ -441,8 +469,31 @@ function tsPropertyRemoval(source, rootSource, j, packageName, typeName, propert
|
|
|
441
469
|
}
|
|
442
470
|
}
|
|
443
471
|
});
|
|
444
|
-
// Handle return statements with object literals
|
|
472
|
+
// Handle return statements with object literals, but only when the enclosing
|
|
473
|
+
// function's declared return type matches typeName. This prevents removing
|
|
474
|
+
// unrelated propertyName keys from object literals returned in other functions.
|
|
475
|
+
const enclosingFunctionReturnsType = (nodePath) => {
|
|
476
|
+
let current = nodePath.parent;
|
|
477
|
+
while (current) {
|
|
478
|
+
const node = current.node;
|
|
479
|
+
if (node.type === 'FunctionDeclaration' ||
|
|
480
|
+
node.type === 'FunctionExpression' ||
|
|
481
|
+
node.type === 'ArrowFunctionExpression' ||
|
|
482
|
+
node.type === 'ClassMethod' ||
|
|
483
|
+
node.type === 'ObjectMethod') {
|
|
484
|
+
return !!(node.returnType &&
|
|
485
|
+
node.returnType.typeAnnotation?.type === 'TSTypeReference' &&
|
|
486
|
+
node.returnType.typeAnnotation.typeName?.type === 'Identifier' &&
|
|
487
|
+
node.returnType.typeAnnotation.typeName.name === typeName);
|
|
488
|
+
}
|
|
489
|
+
current = current.parent;
|
|
490
|
+
}
|
|
491
|
+
return false;
|
|
492
|
+
};
|
|
445
493
|
rootSource.find(j.ReturnStatement).forEach((path) => {
|
|
494
|
+
if (!enclosingFunctionReturnsType(path)) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
446
497
|
if (path.node.argument && path.node.argument.type === 'ObjectExpression') {
|
|
447
498
|
const properties = path.node.argument.properties;
|
|
448
499
|
const propIndex = properties.findIndex((p) => p.type === 'ObjectProperty' &&
|
|
@@ -491,22 +542,6 @@ function tsPropertyRemoval(source, rootSource, j, packageName, typeName, propert
|
|
|
491
542
|
statement.remove();
|
|
492
543
|
}
|
|
493
544
|
});
|
|
494
|
-
// Handle nested member expressions like chatConfig.chat.modelFields.pinnedByField
|
|
495
|
-
rootSource
|
|
496
|
-
.find(j.AssignmentExpression, {
|
|
497
|
-
left: {
|
|
498
|
-
type: 'MemberExpression',
|
|
499
|
-
object: {
|
|
500
|
-
type: 'MemberExpression',
|
|
501
|
-
},
|
|
502
|
-
property: {
|
|
503
|
-
name: propertyName,
|
|
504
|
-
},
|
|
505
|
-
},
|
|
506
|
-
})
|
|
507
|
-
.forEach((path) => {
|
|
508
|
-
j(path).closest(j.ExpressionStatement).remove();
|
|
509
|
-
});
|
|
510
545
|
return rootSource;
|
|
511
546
|
}
|
|
512
547
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.aiInstructions = exports.aiInstructionsLoadingMask = exports.aiInstructionsNavNext = exports.aiInstructionsNavPrev = exports.aiInstructionsSchedulerNavigation = exports.aiInstructionsToolbarGroup = exports.aiInstructionsNavToday = exports.aiInstructionsHeadingCell = exports.aiInstructionsSchedulerViewsButton = exports.aiInstructionsToolbarButtonGroup = void 0;
|
|
8
|
+
exports.default = default_1;
|
|
9
|
+
const codemods_1 = require("@progress/kendo-angular-common/codemods");
|
|
10
|
+
exports.aiInstructionsToolbarButtonGroup = `k-toolbar-button-group — removed.
|
|
11
|
+
The Scheduler's toolbar view selector now uses SegmentedControl instead of buttons.
|
|
12
|
+
Remove any CSS rules or test assertions targeting .k-toolbar-button-group.`;
|
|
13
|
+
exports.aiInstructionsSchedulerViewsButton = `.k-scheduler-views .k-button — replaced with .k-scheduler-views .k-segmented-control-button.
|
|
14
|
+
Update selectors from .k-scheduler-views .k-button to .k-scheduler-views .k-segmented-control-button.`;
|
|
15
|
+
exports.aiInstructionsHeadingCell = `k-heading-cell — removed.
|
|
16
|
+
Remove any CSS rules or test assertions targeting .k-heading-cell.`;
|
|
17
|
+
exports.aiInstructionsNavToday = `k-nav-today — removed and replaced with k-group-start.
|
|
18
|
+
Replace .k-nav-today selectors with .k-group-start in your styles and tests.`;
|
|
19
|
+
exports.aiInstructionsToolbarGroup = `k-toolbar-group — removed.
|
|
20
|
+
Remove any CSS rules or test assertions targeting .k-toolbar-group.`;
|
|
21
|
+
exports.aiInstructionsSchedulerNavigation = `k-scheduler-navigation — removed from the footer.
|
|
22
|
+
Remove any CSS rules or test assertions targeting .k-scheduler-navigation in the footer context.`;
|
|
23
|
+
exports.aiInstructionsNavPrev = `k-nav-prev — removed.
|
|
24
|
+
Remove any CSS rules or test assertions targeting .k-nav-prev.`;
|
|
25
|
+
exports.aiInstructionsNavNext = `k-nav-next — replaced with k-group-end.
|
|
26
|
+
Replace .k-nav-next selectors with .k-group-end in your styles and tests.`;
|
|
27
|
+
exports.aiInstructionsLoadingMask = `k-loading-mask — now rendered conditionally.
|
|
28
|
+
The .k-loading-mask element is no longer always present in the DOM. Update any selectors or tests that assume it is always rendered.`;
|
|
29
|
+
exports.aiInstructions = `Review your stylesheets, test files, and any code that references these Scheduler classes:
|
|
30
|
+
|
|
31
|
+
${exports.aiInstructionsToolbarButtonGroup}
|
|
32
|
+
|
|
33
|
+
${exports.aiInstructionsSchedulerViewsButton}
|
|
34
|
+
|
|
35
|
+
${exports.aiInstructionsHeadingCell}
|
|
36
|
+
|
|
37
|
+
${exports.aiInstructionsNavToday}
|
|
38
|
+
|
|
39
|
+
${exports.aiInstructionsToolbarGroup}
|
|
40
|
+
|
|
41
|
+
${exports.aiInstructionsSchedulerNavigation}
|
|
42
|
+
|
|
43
|
+
${exports.aiInstructionsNavPrev}
|
|
44
|
+
|
|
45
|
+
${exports.aiInstructionsNavNext}
|
|
46
|
+
|
|
47
|
+
${exports.aiInstructionsLoadingMask}`;
|
|
48
|
+
const patternToolbarButtonGroup = (0, codemods_1.makePattern)(['k-toolbar-button-group']);
|
|
49
|
+
const patternSchedulerViewsButton = (0, codemods_1.makePattern)(['k-scheduler-views']);
|
|
50
|
+
const patternHeadingCell = (0, codemods_1.makePattern)(['k-heading-cell']);
|
|
51
|
+
const patternNavToday = (0, codemods_1.makePattern)(['k-nav-today']);
|
|
52
|
+
const patternToolbarGroup = (0, codemods_1.makePattern)(['k-toolbar-group']);
|
|
53
|
+
const patternSchedulerNavigation = (0, codemods_1.makePattern)(['k-scheduler-navigation']);
|
|
54
|
+
const patternNavPrev = (0, codemods_1.makePattern)(['k-nav-prev']);
|
|
55
|
+
const patternNavNext = (0, codemods_1.makePattern)(['k-nav-next']);
|
|
56
|
+
const patternLoadingMask = (0, codemods_1.makePattern)(['k-loading-mask']);
|
|
57
|
+
function default_1(fileInfo) {
|
|
58
|
+
if ((0, codemods_1.isRenderingChangeTarget)(fileInfo.path)) {
|
|
59
|
+
if (patternToolbarButtonGroup.test(fileInfo.source)) {
|
|
60
|
+
(0, codemods_1.writeInstructionMarker)(exports.aiInstructionsToolbarButtonGroup, __filename, fileInfo.path);
|
|
61
|
+
}
|
|
62
|
+
if (patternSchedulerViewsButton.test(fileInfo.source)) {
|
|
63
|
+
(0, codemods_1.writeInstructionMarker)(exports.aiInstructionsSchedulerViewsButton, __filename, fileInfo.path);
|
|
64
|
+
}
|
|
65
|
+
if (patternHeadingCell.test(fileInfo.source)) {
|
|
66
|
+
(0, codemods_1.writeInstructionMarker)(exports.aiInstructionsHeadingCell, __filename, fileInfo.path);
|
|
67
|
+
}
|
|
68
|
+
if (patternNavToday.test(fileInfo.source)) {
|
|
69
|
+
(0, codemods_1.writeInstructionMarker)(exports.aiInstructionsNavToday, __filename, fileInfo.path);
|
|
70
|
+
}
|
|
71
|
+
if (patternToolbarGroup.test(fileInfo.source)) {
|
|
72
|
+
(0, codemods_1.writeInstructionMarker)(exports.aiInstructionsToolbarGroup, __filename, fileInfo.path);
|
|
73
|
+
}
|
|
74
|
+
if (patternSchedulerNavigation.test(fileInfo.source)) {
|
|
75
|
+
(0, codemods_1.writeInstructionMarker)(exports.aiInstructionsSchedulerNavigation, __filename, fileInfo.path);
|
|
76
|
+
}
|
|
77
|
+
if (patternNavPrev.test(fileInfo.source)) {
|
|
78
|
+
(0, codemods_1.writeInstructionMarker)(exports.aiInstructionsNavPrev, __filename, fileInfo.path);
|
|
79
|
+
}
|
|
80
|
+
if (patternNavNext.test(fileInfo.source)) {
|
|
81
|
+
(0, codemods_1.writeInstructionMarker)(exports.aiInstructionsNavNext, __filename, fileInfo.path);
|
|
82
|
+
}
|
|
83
|
+
if (patternLoadingMask.test(fileInfo.source)) {
|
|
84
|
+
(0, codemods_1.writeInstructionMarker)(exports.aiInstructionsLoadingMask, __filename, fileInfo.path);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return fileInfo.source;
|
|
88
|
+
}
|