@ngxi/cbi 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 cbi02tv = {
5
4
  "body": '<path fill="currentColor" d="m16.5 8.261l2.121 6.123h1.467L22 8.261h-1.074l-1.571 4.768l-1.546-4.768zm-5.475 0h4.898v.897h-1.781l-.052 5.226h-1.231V9.158h-1.834zm-1.242 7.478v-.42H8.7c.435-.427 1-.946 1-1.511a.733.733 0 0 0-.835-.779a1.8 1.8 0 0 0-.791.191l.043.443a1.15 1.15 0 0 1 .614-.214c.217 0 .436.114.436.359c0 .488-.905 1.244-1.153 1.485v.446zM2 11.411a3.063 3.063 0 1 0 6.124 0a2.97 2.97 0 0 0-3.057-3.15A2.97 2.97 0 0 0 2 11.411m1.18 0a2.055 2.055 0 0 1 1.887-2.253a2.054 2.054 0 0 1 1.876 2.253a2.016 2.016 0 0 1-1.876 2.253a2.02 2.02 0 0 1-1.887-2.253"/>',
6
5
  "width": 24,
@@ -8893,7 +8892,8 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
8893
8892
  };
8894
8893
  class Ngxi {
8895
8894
  constructor() {
8896
- this.sanitizer = inject(DomSanitizer);
8895
+ this.el = inject(ElementRef);
8896
+ this.renderer = inject(Renderer2);
8897
8897
  this.icon = input(null);
8898
8898
  this.width = input();
8899
8899
  this.height = input();
@@ -8901,13 +8901,16 @@ class Ngxi {
8901
8901
  this.resolvedWidth = computed(() => this.width() ?? this.icon()?.width);
8902
8902
  this.resolvedHeight = computed(() => this.height() ?? this.icon()?.height);
8903
8903
  this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox);
8904
- this.resolvedBody = computed(() => this.sanitizer.bypassSecurityTrustHtml(this.icon()?.body ?? ""));
8904
+ this.setBody = effect(() => {
8905
+ const icon = this.icon();
8906
+ this.renderer.setProperty(this.el.nativeElement, "innerHTML", icon?.body ?? "");
8907
+ });
8905
8908
  }
8906
8909
  static {
8907
8910
  this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
8908
8911
  }
8909
8912
  static {
8910
- 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 });
8913
+ 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 });
8911
8914
  }
8912
8915
  }
8913
8916
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, decorators: [{
@@ -8919,8 +8922,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
8919
8922
  "role": "img",
8920
8923
  "[attr.width]": "resolvedWidth()",
8921
8924
  "[attr.height]": "resolvedHeight()",
8922
- "[attr.viewBox]": "resolvedViewBox()",
8923
- "[innerHTML]": "resolvedBody()"
8925
+ "[attr.viewBox]": "resolvedViewBox()"
8924
8926
  }
8925
8927
  }]
8926
8928
  }] });