@progress/kendo-angular-common 24.0.0-develop.4 → 24.0.0-develop.40

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.
@@ -9,13 +9,13 @@ import * as i0 from "@angular/core";
9
9
  * ```html
10
10
  * <kendo-textbox>
11
11
  * <ng-template kendoPrefixTemplate>
12
- * <button kendoButton look="clear" icon="image"></button>
12
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
13
13
  * </ng-template>
14
14
  * </kendo-textbox>
15
15
  *
16
16
  * <kendo-multiselect [data]="data" [(ngModel)]="value">
17
17
  * <ng-template kendoPrefixTemplate>
18
- * <button kendoButton look="clear" icon="image"></button>
18
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
19
19
  * </ng-template>
20
20
  * </kendo-multiselect>
21
21
  * ```
@@ -7,15 +7,15 @@ import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Specifies a separator in the content of the [Inputs](https://www.telerik.com/kendo-angular-ui/components/inputs/textbox/adornments#separator) and [DropDowns](https://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/adornments#separator).
9
9
  * @example
10
- * ```ts-no-run
11
- * _@Component({
10
+ * ```ts
11
+ * @Component({
12
12
  * selector: 'my-app',
13
13
  * template: `
14
14
  * <kendo-textbox>
15
15
  * <ng-template kendoSuffixTemplate>
16
- * <button kendoButton look="clear" icon="image"></button>
16
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
17
17
  * <kendo-separator></kendo-separator>
18
- * <button kendoButton look="clear" icon="image"></button>
18
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
19
19
  * </ng-template>
20
20
  * </kendo-textbox>
21
21
  * `
@@ -16,12 +16,12 @@ import * as i0 from "@angular/core";
16
16
  * ```html
17
17
  * <kendo-textbox>
18
18
  * <ng-template kendoSuffixTemplate>
19
- * <button kendoButton look="clear" icon="image"></button>
19
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
20
20
  * </ng-template>
21
21
  * </kendo-textbox>
22
22
  * <kendo-multiselect [data]="data" [(ngModel)]="value">
23
23
  * <ng-template kendoSuffixTemplate>
24
- * <button kendoButton look="clear" icon="image"></button>
24
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
25
25
  * </ng-template>
26
26
  * </kendo-multiselect>
27
27
  * ```
package/codemods/utils.js CHANGED
@@ -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
  }
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
- import { EventEmitter, Output, Input, Directive, Injectable, Component, HostBinding, ViewChild, Optional, isDevMode } from '@angular/core';
6
+ import { EventEmitter, Output, Input, Directive, Injectable, Component, InjectionToken, HostBinding, ViewChild, Optional, isDevMode } from '@angular/core';
7
7
  import { detectDesktopBrowser, detectMobileOS } from '@progress/kendo-common';
8
8
  import { take, auditTime } from 'rxjs/operators';
9
9
  import { Draggable } from '@progress/kendo-draggable';
@@ -840,6 +840,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
840
840
 
841
841
  class KendoInput {
842
842
  }
843
+ /**
844
+ * @hidden
845
+ *
846
+ * Token used by the kendoWebMcp directive to resolve the host component instance.
847
+ * Each supported Kendo component provides itself under this token.
848
+ */
849
+ const KENDO_WEBMCP_HOST = new InjectionToken('KendoWebMcpHost');
843
850
 
844
851
  /**
845
852
  * Enum with key codes.
@@ -1532,13 +1539,13 @@ function getLicenseMessage(meta) {
1532
1539
  * ```html
1533
1540
  * <kendo-textbox>
1534
1541
  * <ng-template kendoPrefixTemplate>
1535
- * <button kendoButton look="clear" icon="image"></button>
1542
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
1536
1543
  * </ng-template>
1537
1544
  * </kendo-textbox>
1538
1545
  *
1539
1546
  * <kendo-multiselect [data]="data" [(ngModel)]="value">
1540
1547
  * <ng-template kendoPrefixTemplate>
1541
- * <button kendoButton look="clear" icon="image"></button>
1548
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
1542
1549
  * </ng-template>
1543
1550
  * </kendo-multiselect>
1544
1551
  * ```
@@ -1587,12 +1594,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
1587
1594
  * ```html
1588
1595
  * <kendo-textbox>
1589
1596
  * <ng-template kendoSuffixTemplate>
1590
- * <button kendoButton look="clear" icon="image"></button>
1597
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
1591
1598
  * </ng-template>
1592
1599
  * </kendo-textbox>
1593
1600
  * <kendo-multiselect [data]="data" [(ngModel)]="value">
1594
1601
  * <ng-template kendoSuffixTemplate>
1595
- * <button kendoButton look="clear" icon="image"></button>
1602
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
1596
1603
  * </ng-template>
1597
1604
  * </kendo-multiselect>
1598
1605
  * ```
@@ -1632,15 +1639,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
1632
1639
  /**
1633
1640
  * Specifies a separator in the content of the [Inputs](https://www.telerik.com/kendo-angular-ui/components/inputs/textbox/adornments#separator) and [DropDowns](https://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/adornments#separator).
1634
1641
  * @example
1635
- * ```ts-no-run
1636
- * _@Component({
1642
+ * ```ts
1643
+ * @Component({
1637
1644
  * selector: 'my-app',
1638
1645
  * template: `
1639
1646
  * <kendo-textbox>
1640
1647
  * <ng-template kendoSuffixTemplate>
1641
- * <button kendoButton look="clear" icon="image"></button>
1648
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
1642
1649
  * <kendo-separator></kendo-separator>
1643
- * <button kendoButton look="clear" icon="image"></button>
1650
+ * <button kendoButton fillMode="clear" [svgIcon]="imageIcon"></button>
1644
1651
  * </ng-template>
1645
1652
  * </kendo-textbox>
1646
1653
  * `
@@ -2162,5 +2169,5 @@ const replaceMessagePlaceholder = (message, name, value) => (message ?? '').repl
2162
2169
  * Generated bundle index. Do not edit.
2163
2170
  */
2164
2171
 
2165
- export { ScrollbarService as BrowserSupportService, DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ScrollbarService, SeparatorComponent, SuffixTemplateDirective, TemplateContextDirective, ToggleButtonTabStopDirective, WatermarkOverlayComponent, anyChanged, applyAttributes, areObjectsEqual, closest, closestBySelector, closestInScope, contains, findElement, findFocusable, findFocusableChild, firefoxMaxHeight, focusableSelector, getLicenseMessage, getter, guid, hasClasses, hasFocusableParent, hasObservers, isChanged, isControlRequired, isDocumentAvailable, isFirefox, isFocusable, isFocusableWithTabKey, isObject, isObjectPresent, isPresent, isSafari, isSet, isString, isVisible, matchesClasses, matchesNodeName, normalizeKeys, parseAttributes, parseCSSClassNames, processCssValue, removeHTMLAttributes, replaceMessagePlaceholder, rtlScrollLeft, rtlScrollPosition, scrollbarWidth, setHTMLAttributes, setter, shouldShowValidationUI, splitStringToArray };
2172
+ export { ScrollbarService as BrowserSupportService, DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KENDO_WEBMCP_HOST, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ScrollbarService, SeparatorComponent, SuffixTemplateDirective, TemplateContextDirective, ToggleButtonTabStopDirective, WatermarkOverlayComponent, anyChanged, applyAttributes, areObjectsEqual, closest, closestBySelector, closestInScope, contains, findElement, findFocusable, findFocusableChild, firefoxMaxHeight, focusableSelector, getLicenseMessage, getter, guid, hasClasses, hasFocusableParent, hasObservers, isChanged, isControlRequired, isDocumentAvailable, isFirefox, isFocusable, isFocusableWithTabKey, isObject, isObjectPresent, isPresent, isSafari, isSet, isString, isVisible, matchesClasses, matchesNodeName, normalizeKeys, parseAttributes, parseCSSClassNames, processCssValue, removeHTMLAttributes, replaceMessagePlaceholder, rtlScrollLeft, rtlScrollPosition, scrollbarWidth, setHTMLAttributes, setter, shouldShowValidationUI, splitStringToArray };
2166
2173
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-common",
3
- "version": "24.0.0-develop.4",
3
+ "version": "24.0.0-develop.40",
4
4
  "description": "Kendo UI for Angular - Utility Package",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -23,7 +23,7 @@
23
23
  "@progress/kendo-common": "^1.0.1",
24
24
  "@progress/kendo-draggable": "^3.0.2",
25
25
  "tslib": "^2.3.1",
26
- "@progress/kendo-angular-schematics": "24.0.0-develop.4"
26
+ "@progress/kendo-angular-schematics": "24.0.0-develop.40"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"
package/tokens.d.ts CHANGED
@@ -2,5 +2,13 @@
2
2
  * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
+ import { InjectionToken } from '@angular/core';
5
6
  export declare class KendoInput {
6
7
  }
8
+ /**
9
+ * @hidden
10
+ *
11
+ * Token used by the kendoWebMcp directive to resolve the host component instance.
12
+ * Each supported Kendo component provides itself under this token.
13
+ */
14
+ export declare const KENDO_WEBMCP_HOST: InjectionToken<any>;