@progress/kendo-angular-pager 23.4.0-develop.4 → 23.4.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.
@@ -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 path = __importStar(require("node:path"));
39
- const fs = __importStar(require("node:fs"));
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,21 +6,21 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.aiInstructions = 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
  const pagerPattern = /<kendo-pager[\s>]/;
11
11
  function default_1(fileInfo, api) {
12
12
  const filePath = fileInfo.path;
13
- if (!(0, utils_1.isApiChangeTarget)(filePath)) {
13
+ if (!(0, codemods_1.isApiChangeTarget)(filePath)) {
14
14
  return fileInfo.source;
15
15
  }
16
16
  if (filePath.endsWith('.html')) {
17
17
  if (pagerPattern.test(fileInfo.source)) {
18
- (0, utils_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
18
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
19
19
  }
20
20
  return fileInfo.source;
21
21
  }
22
22
  let patternDetected = false;
23
- (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => {
23
+ (0, codemods_1.htmlTransformer)(fileInfo, api, (templateContent) => {
24
24
  if (pagerPattern.test(templateContent)) {
25
25
  patternDetected = true;
26
26
  }
@@ -28,9 +28,9 @@ function default_1(fileInfo, api) {
28
28
  });
29
29
  const j = api.jscodeshift;
30
30
  const rootSource = j(fileInfo.source);
31
- const hasPagerImport = (0, utils_1.isImportedFromPackage)(rootSource, j, '@progress/kendo-angular-pager', 'PagerComponent');
31
+ const hasPagerImport = (0, codemods_1.isImportedFromPackage)(rootSource, j, '@progress/kendo-angular-pager', 'PagerComponent');
32
32
  if (patternDetected || hasPagerImport) {
33
- (0, utils_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
33
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
34
34
  }
35
35
  return fileInfo.source;
36
36
  }
@@ -1519,8 +1519,8 @@ const packageMetadata = {
1519
1519
  productName: 'Kendo UI for Angular',
1520
1520
  productCode: 'KENDOUIANGULAR',
1521
1521
  productCodes: ['KENDOUIANGULAR'],
1522
- publishDate: 1776325041,
1523
- version: '23.4.0-develop.4',
1522
+ publishDate: 1777036942,
1523
+ version: '23.4.0',
1524
1524
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
1525
1525
  };
1526
1526
 
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1776325041,
11
- "version": "23.4.0-develop.4",
10
+ "publishDate": 1777036942,
11
+ "version": "23.4.0",
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-pager",
3
- "version": "23.4.0-develop.4",
3
+ "version": "23.4.0",
4
4
  "description": "Kendo UI Angular Pager",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -32,7 +32,7 @@
32
32
  "package": {
33
33
  "productName": "Kendo UI for Angular",
34
34
  "productCode": "KENDOUIANGULAR",
35
- "publishDate": 1776325041,
35
+ "publishDate": 1777036942,
36
36
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
37
37
  }
38
38
  },
@@ -41,17 +41,17 @@
41
41
  "@angular/common": "19 - 21",
42
42
  "@angular/core": "19 - 21",
43
43
  "@angular/platform-browser": "19 - 21",
44
- "@progress/kendo-licensing": "^1.10.0",
45
- "@progress/kendo-angular-common": "23.4.0-develop.4",
46
- "@progress/kendo-angular-dropdowns": "23.4.0-develop.4",
47
- "@progress/kendo-angular-inputs": "23.4.0-develop.4",
48
- "@progress/kendo-angular-icons": "23.4.0-develop.4",
49
- "@progress/kendo-angular-l10n": "23.4.0-develop.4",
44
+ "@progress/kendo-licensing": "^1.11.0",
45
+ "@progress/kendo-angular-common": "23.4.0",
46
+ "@progress/kendo-angular-dropdowns": "23.4.0",
47
+ "@progress/kendo-angular-inputs": "23.4.0",
48
+ "@progress/kendo-angular-icons": "23.4.0",
49
+ "@progress/kendo-angular-l10n": "23.4.0",
50
50
  "rxjs": "^6.5.3 || ^7.0.0"
51
51
  },
52
52
  "dependencies": {
53
53
  "tslib": "^2.3.1",
54
- "@progress/kendo-angular-schematics": "23.4.0-develop.4"
54
+ "@progress/kendo-angular-schematics": "23.4.0"
55
55
  },
56
56
  "schematics": "./schematics/collection.json",
57
57
  "module": "fesm2022/progress-kendo-angular-pager.mjs",
@@ -9,14 +9,14 @@ const schematics_1 = require("@angular-devkit/schematics");
9
9
  function default_1(options) {
10
10
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'PagerModule', package: 'pager', peerDependencies: {
11
11
  // Peers of inputs and dropdowns
12
- '@progress/kendo-angular-treeview': '23.4.0-develop.4',
13
- '@progress/kendo-angular-intl': '23.4.0-develop.4',
14
- '@progress/kendo-angular-navigation': '23.4.0-develop.4',
15
- '@progress/kendo-angular-popup': '23.4.0-develop.4',
12
+ '@progress/kendo-angular-treeview': '23.4.0',
13
+ '@progress/kendo-angular-intl': '23.4.0',
14
+ '@progress/kendo-angular-navigation': '23.4.0',
15
+ '@progress/kendo-angular-popup': '23.4.0',
16
16
  '@progress/kendo-drawing': '^1.5.12',
17
17
  // peer dependency of kendo-angular-inputs
18
- '@progress/kendo-angular-buttons': '23.4.0-develop.4',
19
- '@progress/kendo-angular-dialog': '23.4.0-develop.4',
18
+ '@progress/kendo-angular-buttons': '23.4.0',
19
+ '@progress/kendo-angular-dialog': '23.4.0',
20
20
  // Peer dependency of icons
21
21
  '@progress/kendo-svg-icons': '^4.0.0'
22
22
  } });