@progress/kendo-angular-listbox 23.4.0-develop.2 → 23.4.0-develop.3

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 CHANGED
@@ -3,11 +3,40 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  "use strict";
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
6
29
  Object.defineProperty(exports, "__esModule", { value: true });
7
30
  exports.tsInterfaceTransformer = exports.tsPropertyValueTransformer = exports.tsPropertyTransformer = exports.tsComponentPropertyRemoval = exports.attributeRemoval = exports.attributeValueUpdate = exports.attributeNameValueUpdate = exports.attributeNameUpdate = exports.eventUpdate = exports.htmlTransformer = exports.blockTextElements = void 0;
8
31
  exports.hasKendoInTemplate = hasKendoInTemplate;
9
32
  exports.isImportedFromPackage = isImportedFromPackage;
10
33
  exports.tsPropertyRemoval = tsPropertyRemoval;
34
+ exports.makePattern = makePattern;
35
+ exports.writeInstructionMarker = writeInstructionMarker;
36
+ exports.isApiChangeTarget = isApiChangeTarget;
37
+ exports.isRenderingChangeTarget = isRenderingChangeTarget;
38
+ const path = __importStar(require("node:path"));
39
+ const fs = __importStar(require("node:fs"));
11
40
  exports.blockTextElements = {
12
41
  script: true,
13
42
  noscript: true,
@@ -575,7 +604,7 @@ const tsComponentPropertyRemoval = (source, root, j, packageName, componentType,
575
604
  localVariables.add(path.node.id.name);
576
605
  }
577
606
  });
578
- // Find array variables of type componentType[]
607
+ // Find array variables of type componentType[]
579
608
  // This handles cases like: const arr: ChatComponent[] = [...]; arr[0].property = value;
580
609
  const arrayVariables = new Set();
581
610
  root.find(j.VariableDeclarator).forEach((path) => {
@@ -1366,3 +1395,36 @@ function isComponentTypeMatch(root, j, node, componentType) {
1366
1395
  }
1367
1396
  return false;
1368
1397
  }
1398
+ // Matches CSS class names in CSS selectors (.foo) and as whitespace/quote-delimited
1399
+ // tokens within attribute values, covering both single-class ("foo") and multi-class ("foo bar") cases.
1400
+ function makePattern(classes) {
1401
+ return new RegExp(classes.map(c => String.raw `\.${c}\b|(?<=["'\s])${c}(?=["'\s])`).join('|'));
1402
+ }
1403
+ function writeInstructionMarker(instruction, codemodFilename, affectedFile) {
1404
+ // Write to node_modules/.kendo/migration/<basename(codemodFilename)>
1405
+ // kendo-cli reads the marker by looking up basename(codemod.file) in that directory
1406
+ const markerDir = path.join(process.cwd(), 'node_modules', '.kendo', 'migration');
1407
+ const markerPath = path.join(markerDir, path.basename(codemodFilename));
1408
+ try {
1409
+ fs.mkdirSync(markerDir, { recursive: true });
1410
+ const existing = fs.existsSync(markerPath) ? fs.readFileSync(markerPath, 'utf8') : '';
1411
+ let content = existing;
1412
+ if (!existing.includes(instruction)) {
1413
+ content += instruction + '\n';
1414
+ }
1415
+ const fileLine = ` - ${path.relative(process.cwd(), affectedFile)}`;
1416
+ if (!content.includes(fileLine)) {
1417
+ content += fileLine + '\n';
1418
+ }
1419
+ fs.writeFileSync(markerPath, content);
1420
+ }
1421
+ catch { /* suppress error */ }
1422
+ }
1423
+ function isApiChangeTarget(filePath) {
1424
+ const ext = path.extname(filePath);
1425
+ return ext === '.ts' || ext === '.html';
1426
+ }
1427
+ function isRenderingChangeTarget(filePath) {
1428
+ const ext = path.extname(filePath);
1429
+ return ext === '.ts' || ext === '.html' || ext === '.css' || ext === '.scss' || ext === '.sass' || ext === '.less';
1430
+ }
@@ -4,6 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  "use strict";
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.aiInstructions = void 0;
7
8
  exports.default = default_1;
8
9
  function default_1(fileInfo, api) {
9
10
  const filePath = fileInfo.path;
@@ -123,3 +124,18 @@ const tsSelectedIndexTransformer = (source, root, j, componentType) => {
123
124
  });
124
125
  }
125
126
  };
127
+ exports.aiInstructions = `The ListBox 'selectedIndex' property (type: number) has been replaced with 'selectedIndices' (type: number[]).
128
+
129
+ The codemod automatically migrates read accesses on typed 'ListBoxComponent' instances — replacing '.selectedIndex' with '.selectedIndices[0]'. However, the following cases require manual updates:
130
+
131
+ 1. Write assignments — setting the selected index must now use an array:
132
+ Before: this.listbox.selectedIndex = 2;
133
+ After: this.listbox.selectedIndices = [2];
134
+
135
+ 2. HTML template bindings — two-way and property bindings must be updated manually:
136
+ Before: [(selectedIndex)]="myIndex"
137
+ After: [(selectedIndices)]="myIndices" // myIndices is number[]
138
+
139
+ 3. Untyped or dynamically resolved component instances — the codemod may not detect these.
140
+
141
+ Action: Search for remaining 'selectedIndex' usages on ListBox components and update them to use 'selectedIndices' as an array.`;
@@ -24,8 +24,8 @@ const packageMetadata = {
24
24
  productName: 'Kendo UI for Angular',
25
25
  productCode: 'KENDOUIANGULAR',
26
26
  productCodes: ['KENDOUIANGULAR'],
27
- publishDate: 1776172323,
28
- version: '23.4.0-develop.2',
27
+ publishDate: 1776175597,
28
+ version: '23.4.0-develop.3',
29
29
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
30
30
  };
31
31
 
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1776172323,
11
- "version": "23.4.0-develop.2",
10
+ "publishDate": 1776175597,
11
+ "version": "23.4.0-develop.3",
12
12
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-listbox",
3
- "version": "23.4.0-develop.2",
3
+ "version": "23.4.0-develop.3",
4
4
  "description": "Kendo UI for Angular ListBox",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -26,17 +26,17 @@
26
26
  {
27
27
  "description": "Migrate selectedIndex to selectedIndices for ListBox component.",
28
28
  "file": "codemods/v21/listbox-selectedindex.js",
29
- "prompt": "true"
29
+ "prompt": "false"
30
30
  },
31
31
  {
32
32
  "description": "Migrate actionClick to action for ListBox component.",
33
33
  "file": "codemods/v21/listbox-actionclick.js",
34
- "prompt": "true"
34
+ "prompt": "false"
35
35
  },
36
36
  {
37
37
  "description": "Migrate Toolbar interface name to ListBoxToolbarConfig.",
38
38
  "file": "codemods/v21/listbox-toolbar.js",
39
- "prompt": "true"
39
+ "prompt": "false"
40
40
  }
41
41
  ]
42
42
  }
@@ -44,7 +44,7 @@
44
44
  "package": {
45
45
  "productName": "Kendo UI for Angular",
46
46
  "productCode": "KENDOUIANGULAR",
47
- "publishDate": 1776172323,
47
+ "publishDate": 1776175597,
48
48
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"
49
49
  }
50
50
  },
@@ -54,14 +54,14 @@
54
54
  "@angular/core": "19 - 21",
55
55
  "@angular/platform-browser": "19 - 21",
56
56
  "@progress/kendo-licensing": "^1.10.0",
57
- "@progress/kendo-angular-buttons": "23.4.0-develop.2",
58
- "@progress/kendo-angular-common": "23.4.0-develop.2",
59
- "@progress/kendo-angular-popup": "23.4.0-develop.2",
57
+ "@progress/kendo-angular-buttons": "23.4.0-develop.3",
58
+ "@progress/kendo-angular-common": "23.4.0-develop.3",
59
+ "@progress/kendo-angular-popup": "23.4.0-develop.3",
60
60
  "rxjs": "^6.5.3 || ^7.0.0"
61
61
  },
62
62
  "dependencies": {
63
63
  "tslib": "^2.3.1",
64
- "@progress/kendo-angular-schematics": "23.4.0-develop.2",
64
+ "@progress/kendo-angular-schematics": "23.4.0-develop.3",
65
65
  "@progress/kendo-common": "^1.0.1"
66
66
  },
67
67
  "schematics": "./schematics/collection.json",
@@ -11,11 +11,11 @@ function default_1(options) {
11
11
  // Additional dependencies to install.
12
12
  // See https://github.com/telerik/kendo-schematics/issues/28
13
13
  peerDependencies: {
14
- '@progress/kendo-angular-buttons': '23.4.0-develop.2',
15
- '@progress/kendo-angular-common': '23.4.0-develop.2',
16
- '@progress/kendo-angular-l10n': '23.4.0-develop.2',
14
+ '@progress/kendo-angular-buttons': '23.4.0-develop.3',
15
+ '@progress/kendo-angular-common': '23.4.0-develop.3',
16
+ '@progress/kendo-angular-l10n': '23.4.0-develop.3',
17
17
  // Peer of kendo-angular-buttons
18
- '@progress/kendo-angular-popup': '23.4.0-develop.2'
18
+ '@progress/kendo-angular-popup': '23.4.0-develop.3'
19
19
  } });
20
20
  return (0, schematics_1.externalSchematic)('@progress/kendo-angular-schematics', 'ng-add', finalOptions);
21
21
  }