@ngxi/eva 0.12.0-beta.3 → 0.12.0-beta.5

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.
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
- import { inject, input, computed, Directive } from "@angular/core";
3
- import { DomSanitizer } from "@angular/platform-browser";
2
+ import { inject, ElementRef, Renderer2, input, computed, effect, Directive } from "@angular/core";
4
3
  const evaActivityFill = {
5
4
  "body": '<path fill="currentColor" d="M14.33 20h-.21a2 2 0 0 1-1.76-1.58L9.68 6l-2.76 6.4A1 1 0 0 1 6 13H3a1 1 0 0 1 0-2h2.34l2.51-5.79a2 2 0 0 1 3.79.38L14.32 18l2.76-6.38A1 1 0 0 1 18 11h3a1 1 0 0 1 0 2h-2.34l-2.51 5.79A2 2 0 0 1 14.33 20"/>',
6
5
  "width": 24,
@@ -2953,7 +2952,8 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
2953
2952
  };
2954
2953
  class Ngxi {
2955
2954
  constructor() {
2956
- this.sanitizer = inject(DomSanitizer);
2955
+ this.el = inject(ElementRef);
2956
+ this.renderer = inject(Renderer2);
2957
2957
  this.icon = input(null);
2958
2958
  this.width = input();
2959
2959
  this.height = input();
@@ -2961,13 +2961,16 @@ class Ngxi {
2961
2961
  this.resolvedWidth = computed(() => this.width() ?? this.icon()?.width);
2962
2962
  this.resolvedHeight = computed(() => this.height() ?? this.icon()?.height);
2963
2963
  this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox);
2964
- this.resolvedBody = computed(() => this.sanitizer.bypassSecurityTrustHtml(this.icon()?.body ?? ""));
2964
+ this.setBody = effect(() => {
2965
+ const icon = this.icon();
2966
+ this.renderer.setProperty(this.el.nativeElement, "innerHTML", icon?.body ?? "");
2967
+ });
2965
2968
  }
2966
2969
  static {
2967
2970
  this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2968
2971
  }
2969
2972
  static {
2970
- this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.4", type: Ngxi, isStandalone: true, selector: "svg[ngxi]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, viewBox: { classPropertyName: "viewBox", publicName: "viewBox", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "img" }, properties: { "attr.width": "resolvedWidth()", "attr.height": "resolvedHeight()", "attr.viewBox": "resolvedViewBox()", "innerHTML": "resolvedBody()" } }, ngImport: i0 });
2973
+ this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.4", type: Ngxi, isStandalone: true, selector: "svg[ngxi]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, viewBox: { classPropertyName: "viewBox", publicName: "viewBox", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "img" }, properties: { "attr.width": "resolvedWidth()", "attr.height": "resolvedHeight()", "attr.viewBox": "resolvedViewBox()" } }, ngImport: i0 });
2971
2974
  }
2972
2975
  }
2973
2976
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, decorators: [{
@@ -2979,8 +2982,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2979
2982
  "role": "img",
2980
2983
  "[attr.width]": "resolvedWidth()",
2981
2984
  "[attr.height]": "resolvedHeight()",
2982
- "[attr.viewBox]": "resolvedViewBox()",
2983
- "[innerHTML]": "resolvedBody()"
2985
+ "[attr.viewBox]": "resolvedViewBox()"
2984
2986
  }
2985
2987
  }]
2986
2988
  }] });