@progress/kendo-angular-icons 25.0.0-develop.2 → 25.0.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.
@@ -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 { Input, HostBinding, Directive, Component, isDevMode, ChangeDetectionStrategy, Injectable, InjectionToken, Optional, Inject, NgModule } from '@angular/core';
6
+ import { Input, HostBinding, Directive, signal, ChangeDetectionStrategy, Component, computed, isDevMode, Injectable, InjectionToken, Optional, Inject, NgModule } from '@angular/core';
7
7
  import { isDocumentAvailable, areObjectsEqual } from '@progress/kendo-angular-common';
8
8
  import { validatePackage } from '@progress/kendo-licensing';
9
9
  import * as i1_1 from '@angular/platform-browser';
@@ -19,8 +19,8 @@ const packageMetadata = {
19
19
  productName: 'Kendo UI for Angular',
20
20
  productCode: 'KENDOUIANGULAR',
21
21
  productCodes: ['KENDOUIANGULAR'],
22
- publishDate: 1783688442,
23
- version: '25.0.0-develop.2',
22
+ publishDate: 1783692363,
23
+ version: '25.0.0-develop.3',
24
24
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
25
25
  };
26
26
 
@@ -132,34 +132,35 @@ class IconComponent extends IconBaseDirective {
132
132
  */
133
133
  set name(name) {
134
134
  if (isDocumentAvailable()) {
135
- const newName = name !== this._name;
135
+ const newName = name !== this._name();
136
136
  if (newName) {
137
137
  const element = this.element.nativeElement;
138
138
  this.renderer.removeClass(element, `k-i-${this.name}`);
139
139
  this.renderer.addClass(element, `k-i-${name}`);
140
140
  }
141
141
  }
142
- this._name = name;
142
+ this._name.set(name);
143
143
  }
144
144
  get name() {
145
- return this._name;
145
+ return this._name();
146
146
  }
147
- _name;
147
+ _name = signal(undefined, ...(ngDevMode ? [{ debugName: "_name" }] : []));
148
148
  constructor(element, renderer) {
149
149
  super(element, renderer);
150
150
  this.element = element;
151
151
  this.renderer = renderer;
152
152
  }
153
153
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: IconComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
154
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: IconComponent, isStandalone: true, selector: "kendo-icon", inputs: { name: "name" }, host: { properties: { "class.k-icon": "this.hostClass", "class.k-font-icon": "this.hostClass", "attr.aria-hidden": "this.hostAriaHidden" } }, exportAs: ["kendoIcon"], usesInheritance: true, ngImport: i0, template: '', isInline: true });
154
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: IconComponent, isStandalone: true, selector: "kendo-icon", inputs: { name: "name" }, host: { properties: { "class.k-icon": "this.hostClass", "class.k-font-icon": "this.hostClass", "attr.aria-hidden": "this.hostAriaHidden" } }, exportAs: ["kendoIcon"], usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
155
155
  }
156
156
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: IconComponent, decorators: [{
157
157
  type: Component,
158
158
  args: [{
159
- exportAs: 'kendoIcon',
160
159
  selector: 'kendo-icon',
160
+ exportAs: 'kendoIcon',
161
161
  template: '',
162
- standalone: true
162
+ standalone: true,
163
+ changeDetection: ChangeDetectionStrategy.OnPush
163
164
  }]
164
165
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { hostClass: [{
165
166
  type: HostBinding,
@@ -209,19 +210,19 @@ class SVGIconComponent extends IconBaseDirective {
209
210
  set icon(icon) {
210
211
  const element = this.element.nativeElement;
211
212
  const hasDocument = isDocumentAvailable();
212
- const newName = icon?.name && icon.name !== this._icon?.name;
213
- if (this._icon && this._icon.name && newName && hasDocument) {
214
- this.renderer.removeClass(element, `k-svg-i-${this._icon.name}`);
213
+ const newName = icon?.name && icon.name !== this._icon()?.name;
214
+ if (this._icon()?.name && newName && hasDocument) {
215
+ this.renderer.removeClass(element, `k-svg-i-${this._icon().name}`);
215
216
  }
216
- if (!areSame(icon, this._icon)) {
217
- this._icon = icon;
217
+ if (!areSame(icon, this._icon())) {
218
+ this._icon.set(icon);
218
219
  }
219
220
  if (hasDocument && newName) {
220
- this.renderer.addClass(element, `k-svg-i-${this._icon.name}`);
221
+ this.renderer.addClass(element, `k-svg-i-${this._icon().name}`);
221
222
  }
222
223
  }
223
224
  get icon() {
224
- return this._icon;
225
+ return this._icon();
225
226
  }
226
227
  /**
227
228
  * Sets the style variant of the icon.
@@ -229,21 +230,30 @@ class SVGIconComponent extends IconBaseDirective {
229
230
  * > Requires `@progress/kendo-svg-icons` v5 or later for the `variants` property to be available on icons.
230
231
  */
231
232
  set variant(variant) {
232
- this._variant = variant;
233
+ this._variant.set(variant);
233
234
  }
234
235
  get variant() {
235
- return this._variant;
236
+ return this._variant();
236
237
  }
237
238
  get content() {
238
- const variantContent = this.variant && this.icon?.variants?.[this.variant];
239
- const svgContent = variantContent || this.icon.content;
240
- return this.domSanitizer.bypassSecurityTrustHtml(svgContent);
239
+ return this._content();
241
240
  }
242
241
  get visible() {
243
- return this.icon && isDocumentAvailable();
244
- }
245
- _icon;
246
- _variant;
242
+ return this._visible();
243
+ }
244
+ _icon = signal(undefined, ...(ngDevMode ? [{ debugName: "_icon" }] : []));
245
+ _variant = signal(undefined, ...(ngDevMode ? [{ debugName: "_variant" }] : []));
246
+ _content = computed(() => {
247
+ const icon = this._icon();
248
+ if (!icon) {
249
+ return null;
250
+ }
251
+ const variant = this._variant();
252
+ const variantContent = variant && icon.variants?.[variant];
253
+ const svgContent = variantContent || icon.content;
254
+ return this.domSanitizer.bypassSecurityTrustHtml(svgContent);
255
+ }, ...(ngDevMode ? [{ debugName: "_content" }] : []));
256
+ _visible = computed(() => !!this._icon() && isDocumentAvailable(), ...(ngDevMode ? [{ debugName: "_visible" }] : []));
247
257
  constructor(domSanitizer, element, renderer) {
248
258
  super(element, renderer);
249
259
  this.domSanitizer = domSanitizer;
@@ -257,7 +267,7 @@ class SVGIconComponent extends IconBaseDirective {
257
267
  if (!isDevMode()) {
258
268
  return;
259
269
  }
260
- if (!this._icon) {
270
+ if (!this._icon()) {
261
271
  throw new Error(`
262
272
  Invalid configuration.
263
273
  The input [icon] is required for the Kendo UI SVG Icon component for Angular.
@@ -472,31 +482,46 @@ class IconWrapperComponent {
472
482
  * Sets the name for an existing font icon in a Kendo UI theme to render.
473
483
  * Supports all [Kendo UI Icons](https://www.telerik.com/kendo-angular-ui/components/styling/icons#icons-list).
474
484
  */
475
- name;
485
+ set name(value) { this._name.set(value); }
486
+ get name() { return this._name(); }
476
487
  /**
477
488
  * Sets the [SVGIcon](https://www.telerik.com/kendo-angular-ui/components/icons/api/svgicon) to render.
478
489
  */
479
- svgIcon;
490
+ set svgIcon(value) { this._svgIcon.set(value); }
491
+ get svgIcon() { return this._svgIcon(); }
480
492
  /**
481
493
  * Sets an additional class on the internal Icon component.
482
494
  */
483
- innerCssClass = '';
495
+ set innerCssClass(value) { this._innerCssClass.set(value); }
496
+ get innerCssClass() { return this._innerCssClass(); }
484
497
  /**
485
498
  * Sets a custom font icon class using the API of the consuming component.
486
499
  */
487
- customFontClass = '';
500
+ set customFontClass(value) { this._customFontClass.set(value); }
501
+ get customFontClass() { return this._customFontClass(); }
488
502
  /**
489
503
  * Sets the `IconSize` for the icon.
490
504
  */
491
- size;
505
+ set size(value) { this._size.set(value); }
506
+ get size() { return this._size(); }
492
507
  get customClasses() {
493
508
  const classes = [this.customFontClass, this.innerCssClass, this.customFontIconClass].filter(cl => !!cl).join(' ');
494
509
  return classes;
495
510
  }
496
- iconSettings;
511
+ _name = signal(undefined, ...(ngDevMode ? [{ debugName: "_name" }] : []));
512
+ _svgIcon = signal(undefined, ...(ngDevMode ? [{ debugName: "_svgIcon" }] : []));
513
+ _innerCssClass = signal('', ...(ngDevMode ? [{ debugName: "_innerCssClass" }] : []));
514
+ _customFontClass = signal('', ...(ngDevMode ? [{ debugName: "_customFontClass" }] : []));
515
+ _size = signal(undefined, ...(ngDevMode ? [{ debugName: "_size" }] : []));
516
+ // iconSettings is set from a subscription — must be a signal so changes trigger CD in zoneless apps
517
+ _iconSettings = signal(undefined, ...(ngDevMode ? [{ debugName: "_iconSettings" }] : []));
518
+ get iconSettings() { return this._iconSettings(); }
519
+ // Resolves the effective SVG icon: prefer service-provided icon, then fall back to the svgIcon input.
520
+ // Extracted from hasSvgIcon getter to avoid writing to a signal inside a reactive context.
521
+ _resolvedSvgIcon = computed(() => this.iconsService.getSvgIcon(this._name()) || this._svgIcon(), ...(ngDevMode ? [{ debugName: "_resolvedSvgIcon" }] : []));
522
+ get resolvedSvgIcon() { return this._resolvedSvgIcon(); }
497
523
  get hasSvgIcon() {
498
- this.svgIcon = this.iconsService.getSvgIcon(this.name) || this.svgIcon;
499
- if (this.svgIcon) {
524
+ if (this._resolvedSvgIcon()) {
500
525
  return true;
501
526
  }
502
527
  if (isDevMode()) {
@@ -527,7 +552,7 @@ https://www.telerik.com/design-system/docs/foundation/iconography/icon-list/
527
552
  this.iconsService = iconsService;
528
553
  this.element = element;
529
554
  this.subs = iconsService.changes.subscribe(iconSettings => {
530
- this.iconSettings = iconSettings;
555
+ this._iconSettings.set(iconSettings);
531
556
  });
532
557
  }
533
558
  ngOnDestroy() {
@@ -538,7 +563,7 @@ https://www.telerik.com/design-system/docs/foundation/iconography/icon-list/
538
563
  @if (iconSettings?.type === 'svg' && hasSvgIcon) {
539
564
  <kendo-svgicon
540
565
  [ngClass]="innerCssClass"
541
- [icon]="svgIcon"
566
+ [icon]="resolvedSvgIcon"
542
567
  [size]="size || iconSettings?.size"
543
568
  [themeColor]="iconSettings?.themeColor"
544
569
  [flip]="iconSettings?.flip"></kendo-svgicon>
@@ -554,18 +579,18 @@ https://www.telerik.com/design-system/docs/foundation/iconography/icon-list/
554
579
  <span [ngClass]="customClasses"></span>
555
580
  }
556
581
  }
557
- `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "kendo-icon", inputs: ["name"], exportAs: ["kendoIcon"] }, { kind: "component", type: SVGIconComponent, selector: "kendo-svg-icon, kendo-svgicon", inputs: ["icon", "variant"], exportAs: ["kendoSVGIcon"] }] });
582
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "kendo-icon", inputs: ["name"], exportAs: ["kendoIcon"] }, { kind: "component", type: SVGIconComponent, selector: "kendo-svg-icon, kendo-svgicon", inputs: ["icon", "variant"], exportAs: ["kendoSVGIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
558
583
  }
559
584
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: IconWrapperComponent, decorators: [{
560
585
  type: Component,
561
586
  args: [{
562
- exportAs: 'kendoIconWrapper',
563
587
  selector: 'kendo-icon-wrapper',
588
+ exportAs: 'kendoIconWrapper',
564
589
  template: `
565
590
  @if (iconSettings?.type === 'svg' && hasSvgIcon) {
566
591
  <kendo-svgicon
567
592
  [ngClass]="innerCssClass"
568
- [icon]="svgIcon"
593
+ [icon]="resolvedSvgIcon"
569
594
  [size]="size || iconSettings?.size"
570
595
  [themeColor]="iconSettings?.themeColor"
571
596
  [flip]="iconSettings?.flip"></kendo-svgicon>
@@ -583,6 +608,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
583
608
  }
584
609
  `,
585
610
  standalone: true,
611
+ changeDetection: ChangeDetectionStrategy.OnPush,
586
612
  imports: [NgClass, IconComponent, SVGIconComponent]
587
613
  }]
588
614
  }], ctorParameters: () => [{ type: IconsService }, { type: i0.ElementRef }], propDecorators: { hostClass: [{
package/index.d.ts CHANGED
@@ -158,6 +158,8 @@ declare class SVGIconComponent extends IconBaseDirective implements OnInit {
158
158
  get visible(): boolean;
159
159
  private _icon;
160
160
  private _variant;
161
+ private readonly _content;
162
+ private readonly _visible;
161
163
  constructor(domSanitizer: DomSanitizer, element: ElementRef, renderer: Renderer2);
162
164
  ngOnInit(): void;
163
165
  private verifyIconProperty;
@@ -308,25 +310,38 @@ declare class IconWrapperComponent implements OnDestroy {
308
310
  * Sets the name for an existing font icon in a Kendo UI theme to render.
309
311
  * Supports all [Kendo UI Icons](https://www.telerik.com/kendo-angular-ui/components/styling/icons#icons-list).
310
312
  */
311
- name: string;
313
+ set name(value: string);
314
+ get name(): string;
312
315
  /**
313
316
  * Sets the [SVGIcon](https://www.telerik.com/kendo-angular-ui/components/icons/api/svgicon) to render.
314
317
  */
315
- svgIcon: SVGIcon;
318
+ set svgIcon(value: SVGIcon);
319
+ get svgIcon(): SVGIcon;
316
320
  /**
317
321
  * Sets an additional class on the internal Icon component.
318
322
  */
319
- innerCssClass: string;
323
+ set innerCssClass(value: string);
324
+ get innerCssClass(): string;
320
325
  /**
321
326
  * Sets a custom font icon class using the API of the consuming component.
322
327
  */
323
- customFontClass: string;
328
+ set customFontClass(value: string);
329
+ get customFontClass(): string;
324
330
  /**
325
331
  * Sets the `IconSize` for the icon.
326
332
  */
327
- size: IconSize;
333
+ set size(value: IconSize);
334
+ get size(): IconSize;
328
335
  get customClasses(): string;
329
- iconSettings: IconSettings;
336
+ private _name;
337
+ private _svgIcon;
338
+ private _innerCssClass;
339
+ private _customFontClass;
340
+ private _size;
341
+ private _iconSettings;
342
+ get iconSettings(): IconSettings;
343
+ private readonly _resolvedSvgIcon;
344
+ get resolvedSvgIcon(): SVGIcon;
330
345
  get hasSvgIcon(): boolean;
331
346
  get customFontIconClass(): string;
332
347
  private subs;
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1783688442,
11
- "version": "25.0.0-develop.2",
10
+ "publishDate": 1783692363,
11
+ "version": "25.0.0-develop.3",
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-icons",
3
- "version": "25.0.0-develop.2",
3
+ "version": "25.0.0-develop.3",
4
4
  "description": "Kendo UI Angular component starter template",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -31,7 +31,7 @@
31
31
  "package": {
32
32
  "productName": "Kendo UI for Angular",
33
33
  "productCode": "KENDOUIANGULAR",
34
- "publishDate": 1783688442,
34
+ "publishDate": 1783692363,
35
35
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
36
36
  }
37
37
  },
@@ -42,7 +42,7 @@
42
42
  "@angular/platform-browser": "20 - 22",
43
43
  "@progress/kendo-licensing": "^1.11.0",
44
44
  "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
45
- "@progress/kendo-angular-common": "25.0.0-develop.2",
45
+ "@progress/kendo-angular-common": "25.0.0-develop.3",
46
46
  "rxjs": "^6.5.3 || ^7.0.0"
47
47
  },
48
48
  "peerDependenciesMeta": {
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "tslib": "^2.3.1",
55
- "@progress/kendo-angular-schematics": "25.0.0-develop.2"
55
+ "@progress/kendo-angular-schematics": "25.0.0-develop.3"
56
56
  },
57
57
  "schematics": "./schematics/collection.json",
58
58
  "module": "fesm2022/progress-kendo-angular-icons.mjs",