@progress/kendo-angular-listbox 24.0.0-develop.37 → 24.0.0-develop.39

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.
@@ -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
  }
@@ -9,7 +9,7 @@ import { Subscription } from 'rxjs';
9
9
  import { getter } from '@progress/kendo-common';
10
10
  import { chevronUpIcon, chevronDownIcon, chevronRightIcon, chevronLeftIcon, chevronDoubleRightIcon, chevronDoubleLeftIcon, xIcon } from '@progress/kendo-svg-icons';
11
11
  import { ButtonComponent } from '@progress/kendo-angular-buttons';
12
- import { normalizeKeys, Keys, isPresent as isPresent$1, TemplateContextDirective, isChanged, ResizeBatchService } from '@progress/kendo-angular-common';
12
+ import { normalizeKeys, Keys, isPresent as isPresent$1, TemplateContextDirective, KENDO_WEBMCP_HOST, isChanged, ResizeBatchService } from '@progress/kendo-angular-common';
13
13
  import { take } from 'rxjs/operators';
14
14
  import * as i1 from '@progress/kendo-angular-l10n';
15
15
  import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
@@ -25,8 +25,8 @@ const packageMetadata = {
25
25
  productName: 'Kendo UI for Angular',
26
26
  productCode: 'KENDOUIANGULAR',
27
27
  productCodes: ['KENDOUIANGULAR'],
28
- publishDate: 1779188740,
29
- version: '24.0.0-develop.37',
28
+ publishDate: 1779209896,
29
+ version: '24.0.0-develop.39',
30
30
  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'
31
31
  };
32
32
 
@@ -1394,6 +1394,7 @@ class ListBoxComponent {
1394
1394
  provide: L10N_PREFIX,
1395
1395
  useValue: 'kendo.listbox'
1396
1396
  },
1397
+ { provide: KENDO_WEBMCP_HOST, useExisting: forwardRef(() => ListBoxComponent) }
1397
1398
  ], queries: [{ propertyName: "itemTemplate", first: true, predicate: ItemTemplateDirective, descendants: true }, { propertyName: "noDataTemplate", first: true, predicate: NoDataTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "listboxElement", first: true, predicate: ["listbox"], descendants: true }, { propertyName: "toolbarElement", first: true, predicate: ["toolbar"], descendants: true }, { propertyName: "listboxItems", predicate: ["listboxItems"], descendants: true }, { propertyName: "tools", predicate: ["tools"], descendants: true }], ngImport: i0, template: `
1398
1399
  <ng-container kendoListBoxLocalizedMessages
1399
1400
  i18n-moveUp="kendo.listbox.moveUp|The title of the Move Up button"
@@ -1510,6 +1511,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
1510
1511
  provide: L10N_PREFIX,
1511
1512
  useValue: 'kendo.listbox'
1512
1513
  },
1514
+ { provide: KENDO_WEBMCP_HOST, useExisting: forwardRef(() => ListBoxComponent) }
1513
1515
  ],
1514
1516
  template: `
1515
1517
  <ng-container kendoListBoxLocalizedMessages
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1779188740,
11
- "version": "24.0.0-develop.37",
10
+ "publishDate": 1779209896,
11
+ "version": "24.0.0-develop.39",
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": "24.0.0-develop.37",
3
+ "version": "24.0.0-develop.39",
4
4
  "description": "Kendo UI for Angular ListBox",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -41,7 +41,7 @@
41
41
  "package": {
42
42
  "productName": "Kendo UI for Angular",
43
43
  "productCode": "KENDOUIANGULAR",
44
- "publishDate": 1779188740,
44
+ "publishDate": 1779209896,
45
45
  "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"
46
46
  }
47
47
  },
@@ -51,14 +51,14 @@
51
51
  "@angular/core": "19 - 21",
52
52
  "@angular/platform-browser": "19 - 21",
53
53
  "@progress/kendo-licensing": "^1.11.0",
54
- "@progress/kendo-angular-buttons": "24.0.0-develop.37",
55
- "@progress/kendo-angular-common": "24.0.0-develop.37",
56
- "@progress/kendo-angular-popup": "24.0.0-develop.37",
54
+ "@progress/kendo-angular-buttons": "24.0.0-develop.39",
55
+ "@progress/kendo-angular-common": "24.0.0-develop.39",
56
+ "@progress/kendo-angular-popup": "24.0.0-develop.39",
57
57
  "rxjs": "^6.5.3 || ^7.0.0"
58
58
  },
59
59
  "dependencies": {
60
60
  "tslib": "^2.3.1",
61
- "@progress/kendo-angular-schematics": "24.0.0-develop.37",
61
+ "@progress/kendo-angular-schematics": "24.0.0-develop.39",
62
62
  "@progress/kendo-common": "^1.0.1"
63
63
  },
64
64
  "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': '24.0.0-develop.37',
15
- '@progress/kendo-angular-common': '24.0.0-develop.37',
16
- '@progress/kendo-angular-l10n': '24.0.0-develop.37',
14
+ '@progress/kendo-angular-buttons': '24.0.0-develop.39',
15
+ '@progress/kendo-angular-common': '24.0.0-develop.39',
16
+ '@progress/kendo-angular-l10n': '24.0.0-develop.39',
17
17
  // Peer of kendo-angular-buttons
18
- '@progress/kendo-angular-popup': '24.0.0-develop.37'
18
+ '@progress/kendo-angular-popup': '24.0.0-develop.39'
19
19
  } });
20
20
  return (0, schematics_1.externalSchematic)('@progress/kendo-angular-schematics', 'ng-add', finalOptions);
21
21
  }