@progress/kendo-angular-treeview 24.0.0-develop.1 → 24.0.0-develop.2

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.
@@ -3,29 +3,6 @@
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
- };
29
6
  Object.defineProperty(exports, "__esModule", { value: true });
30
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;
31
8
  exports.hasKendoInTemplate = hasKendoInTemplate;
@@ -35,8 +12,12 @@ exports.makePattern = makePattern;
35
12
  exports.writeInstructionMarker = writeInstructionMarker;
36
13
  exports.isApiChangeTarget = isApiChangeTarget;
37
14
  exports.isRenderingChangeTarget = isRenderingChangeTarget;
38
- const fs = __importStar(require("node:fs"));
39
- const path = __importStar(require("node:path"));
15
+ exports.executeCodemodTest = executeCodemodTest;
16
+ const tslib_1 = require("tslib");
17
+ /// <reference types="node" />
18
+ const fs = tslib_1.__importStar(require("fs"));
19
+ const os = tslib_1.__importStar(require("os"));
20
+ const path = tslib_1.__importStar(require("path"));
40
21
  exports.blockTextElements = {
41
22
  script: true,
42
23
  noscript: true,
@@ -320,12 +301,12 @@ const attributeRemoval = (templateContent, tagName, attributeName, propertyToRem
320
301
  // If no propertyToRemove is specified, remove the entire attribute
321
302
  if (!propertyToRemove) {
322
303
  // Remove bound attributes [attribute]="value"
323
- const boundAttributePattern = new RegExp(`(\\s+)\\[${escapedAttr}\\]\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)`, 'gi');
304
+ const boundAttributePattern = new RegExp(`(<${escapedTag}[^>]*?)\\s+\\[${escapedAttr}\\]\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)([^>]*?>)`, 'gi');
324
305
  // Remove static attributes attribute="value"
325
- const staticAttributePattern = new RegExp(`(\\s+)${escapedAttr}\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)`, 'gi');
326
- // Apply removals
327
- let result = templateContent.replace(boundAttributePattern, '');
328
- result = result.replace(staticAttributePattern, '');
306
+ const staticAttributePattern = new RegExp(`(<${escapedTag}[^>]*?)\\s+${escapedAttr}\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)([^>]*?>)`, 'gi');
307
+ // Apply removals - keep tag prefix and suffix, remove the attribute
308
+ let result = templateContent.replace(boundAttributePattern, '$1$3');
309
+ result = result.replace(staticAttributePattern, '$1$3');
329
310
  return result;
330
311
  }
331
312
  // Remove specific property from object literal attributes
@@ -1428,3 +1409,45 @@ function isRenderingChangeTarget(filePath) {
1428
1409
  const ext = path.extname(filePath);
1429
1410
  return ext === '.ts' || ext === '.html' || ext === '.css' || ext === '.scss' || ext === '.sass' || ext === '.less';
1430
1411
  }
1412
+ /**
1413
+ * Executes a codemod transformation and compares the result with expected output
1414
+ *
1415
+ * @param codemod - The codemod function to execute
1416
+ * @param testDir - Directory containing the test files (__dirname from test file)
1417
+ * @param exampleFileName - Name of the input file (default: 'example.ts')
1418
+ * @param expectedFileName - Name of the expected output file (default: 'expected.ts')
1419
+ * @returns Object containing the transformation result and expected content
1420
+ */
1421
+ function executeCodemodTest(codemod, testDir, exampleFileName = 'example.ts', expectedFileName = 'expected.ts') {
1422
+ const exampleFile = path.join(testDir, exampleFileName);
1423
+ const expectedFile = path.join(testDir, expectedFileName);
1424
+ const sourceCode = fs.readFileSync(exampleFile, 'utf-8');
1425
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codemod-test-'));
1426
+ const tmpFile = path.join(tmpDir, path.basename(exampleFile));
1427
+ fs.writeFileSync(tmpFile, sourceCode, 'utf-8');
1428
+ try {
1429
+ const fileInfo = {
1430
+ path: tmpFile,
1431
+ source: sourceCode
1432
+ };
1433
+ const jscodeshift = require('jscodeshift').withParser('tsx');
1434
+ const api = {
1435
+ jscodeshift,
1436
+ j: jscodeshift
1437
+ };
1438
+ const result = codemod(fileInfo, api);
1439
+ const expectedContent = fs.readFileSync(expectedFile, 'utf-8').trim();
1440
+ return {
1441
+ result: result?.trim(),
1442
+ expected: expectedContent,
1443
+ sourceCode,
1444
+ transformedSuccessfully: result !== undefined
1445
+ };
1446
+ }
1447
+ finally {
1448
+ try {
1449
+ fs.rmSync(tmpDir, { recursive: true });
1450
+ }
1451
+ catch { }
1452
+ }
1453
+ }
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.aiInstructions = exports.aiInstructionsStateClasses = exports.aiInstructionsPositionClasses = void 0;
8
8
  exports.default = default_1;
9
- const utils_1 = require("../utils");
9
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
10
10
  exports.aiInstructionsPositionClasses = `k-treeview-top / k-treeview-mid / k-treeview-bot — position-based classes replaced with k-treeview-item-content.
11
11
  Before: <div class="k-treeview-top"> / <div class="k-treeview-mid"> / <div class="k-treeview-bot">
12
12
  After: <div class="k-treeview-item-content">
@@ -22,16 +22,16 @@ ${exports.aiInstructionsPositionClasses}
22
22
 
23
23
  ${exports.aiInstructionsStateClasses}`;
24
24
  const classesPositionClasses = ['k-treeview-top', 'k-treeview-mid', 'k-treeview-bot'];
25
- const patternPositionClasses = (0, utils_1.makePattern)(classesPositionClasses);
25
+ const patternPositionClasses = (0, codemods_1.makePattern)(classesPositionClasses);
26
26
  const classesStateClasses = ['k-treeview-leaf'];
27
- const patternStateClasses = (0, utils_1.makePattern)(classesStateClasses);
27
+ const patternStateClasses = (0, codemods_1.makePattern)(classesStateClasses);
28
28
  function default_1(fileInfo) {
29
- if ((0, utils_1.isRenderingChangeTarget)(fileInfo.path)) {
29
+ if ((0, codemods_1.isRenderingChangeTarget)(fileInfo.path)) {
30
30
  if (patternPositionClasses.test(fileInfo.source)) {
31
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsPositionClasses, __filename, fileInfo.path);
31
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsPositionClasses, __filename, fileInfo.path);
32
32
  }
33
33
  if (patternStateClasses.test(fileInfo.source)) {
34
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsStateClasses, __filename, fileInfo.path);
34
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsStateClasses, __filename, fileInfo.path);
35
35
  }
36
36
  }
37
37
  return fileInfo.source;
@@ -28,8 +28,8 @@ const packageMetadata = {
28
28
  productName: 'Kendo UI for Angular',
29
29
  productCode: 'KENDOUIANGULAR',
30
30
  productCodes: ['KENDOUIANGULAR'],
31
- publishDate: 1776779035,
32
- version: '24.0.0-develop.1',
31
+ publishDate: 1776936136,
32
+ version: '24.0.0-develop.2',
33
33
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
34
34
  };
35
35
 
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1776779035,
11
- "version": "24.0.0-develop.1",
10
+ "publishDate": 1776936136,
11
+ "version": "24.0.0-develop.2",
12
12
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-treeview",
3
- "version": "24.0.0-develop.1",
3
+ "version": "24.0.0-develop.2",
4
4
  "description": "Kendo UI TreeView for Angular",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -34,7 +34,7 @@
34
34
  "package": {
35
35
  "productName": "Kendo UI for Angular",
36
36
  "productCode": "KENDOUIANGULAR",
37
- "publishDate": 1776779035,
37
+ "publishDate": 1776936136,
38
38
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
39
39
  }
40
40
  },
@@ -44,15 +44,15 @@
44
44
  "@angular/core": "19 - 21",
45
45
  "@angular/platform-browser": "19 - 21",
46
46
  "@progress/kendo-licensing": "^1.11.0",
47
- "@progress/kendo-angular-common": "24.0.0-develop.1",
48
- "@progress/kendo-angular-inputs": "24.0.0-develop.1",
49
- "@progress/kendo-angular-icons": "24.0.0-develop.1",
50
- "@progress/kendo-angular-l10n": "24.0.0-develop.1",
47
+ "@progress/kendo-angular-common": "24.0.0-develop.2",
48
+ "@progress/kendo-angular-inputs": "24.0.0-develop.2",
49
+ "@progress/kendo-angular-icons": "24.0.0-develop.2",
50
+ "@progress/kendo-angular-l10n": "24.0.0-develop.2",
51
51
  "rxjs": "^6.5.3 || ^7.0.0"
52
52
  },
53
53
  "dependencies": {
54
54
  "tslib": "^2.3.1",
55
- "@progress/kendo-angular-schematics": "24.0.0-develop.1",
55
+ "@progress/kendo-angular-schematics": "24.0.0-develop.2",
56
56
  "@progress/kendo-common": "^1.0.1",
57
57
  "@progress/kendo-draggable": "^3.0.2"
58
58
  },
@@ -9,10 +9,10 @@ const schematics_1 = require("@angular-devkit/schematics");
9
9
  function default_1(options) {
10
10
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'TreeViewModule', package: 'treeview', peerDependencies: {
11
11
  // Peers of kendo-angular-inputs
12
- '@progress/kendo-angular-buttons': '24.0.0-develop.1',
13
- '@progress/kendo-angular-dialog': '24.0.0-develop.1',
14
- '@progress/kendo-angular-intl': '24.0.0-develop.1',
15
- '@progress/kendo-angular-popup': '24.0.0-develop.1',
12
+ '@progress/kendo-angular-buttons': '24.0.0-develop.2',
13
+ '@progress/kendo-angular-dialog': '24.0.0-develop.2',
14
+ '@progress/kendo-angular-intl': '24.0.0-develop.2',
15
+ '@progress/kendo-angular-popup': '24.0.0-develop.2',
16
16
  '@progress/kendo-drawing': '^1.9.3',
17
17
  // Peer dependency of icons
18
18
  '@progress/kendo-svg-icons': '^4.0.0'