@ngxi/eva 0.12.0-beta.11 → 0.12.0-beta.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.
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
- import { inject, ElementRef, Renderer2, input, computed, effect, Directive } from "@angular/core";
2
+ import { inject, input, computed, Directive } from "@angular/core";
3
+ import { DomSanitizer } from "@angular/platform-browser";
3
4
  const evaActivityFill = {
4
5
  "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"/>',
5
6
  "width": 24,
@@ -2940,10 +2941,19 @@ const evaWifiOutline = {
2940
2941
  "height": 24,
2941
2942
  "viewBox": "0 0 24 24"
2942
2943
  };
2944
+ function __decorate(decorators, target, key, desc) {
2945
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2946
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2947
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2948
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2949
+ }
2950
+ typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
2951
+ var e = new Error(message);
2952
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
2953
+ };
2943
2954
  class Ngxi {
2944
2955
  constructor() {
2945
- this.el = inject(ElementRef);
2946
- this.renderer = inject(Renderer2);
2956
+ this.sanitizer = inject(DomSanitizer);
2947
2957
  this.icon = input(null);
2948
2958
  this.width = input();
2949
2959
  this.height = input();
@@ -2951,19 +2961,16 @@ class Ngxi {
2951
2961
  this.resolvedWidth = computed(() => this.width() ?? this.icon()?.width);
2952
2962
  this.resolvedHeight = computed(() => this.height() ?? this.icon()?.height);
2953
2963
  this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox);
2954
- this.setBody = effect(() => {
2955
- const icon = this.icon();
2956
- this.renderer.setProperty(this.el.nativeElement, "innerHTML", icon?.body ?? "");
2957
- });
2964
+ this.resolvedBody = computed(() => this.sanitizer.bypassSecurityTrustHtml(this.icon()?.body ?? ""));
2958
2965
  }
2959
2966
  static {
2960
- this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2967
+ this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2961
2968
  }
2962
2969
  static {
2963
- this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", 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 });
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 });
2964
2971
  }
2965
2972
  }
2966
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Ngxi, decorators: [{
2973
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, decorators: [{
2967
2974
  type: Directive,
2968
2975
  args: [{
2969
2976
  standalone: true,
@@ -2972,24 +2979,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
2972
2979
  "role": "img",
2973
2980
  "[attr.width]": "resolvedWidth()",
2974
2981
  "[attr.height]": "resolvedHeight()",
2975
- "[attr.viewBox]": "resolvedViewBox()"
2982
+ "[attr.viewBox]": "resolvedViewBox()",
2983
+ "[innerHTML]": "resolvedBody()"
2976
2984
  }
2977
2985
  }]
2978
2986
  }] });
2979
- class NgxiEva {
2987
+ let NgxiEva = class NgxiEva2 {
2980
2988
  constructor() {
2981
2989
  this.ngxiEva = input.required();
2982
2990
  }
2983
- static {
2984
- this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxiEva, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2985
- }
2986
- static {
2987
- this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: NgxiEva, isStandalone: true, selector: "svg[ngxiEva]", inputs: { ngxiEva: { classPropertyName: "ngxiEva", publicName: "ngxiEva", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: Ngxi, inputs: ["icon", "ngxiEva", "width", "width", "height", "height", "viewBox", "viewBox"] }], ngImport: i0 });
2988
- }
2989
- }
2990
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxiEva, decorators: [{
2991
- type: Directive,
2992
- args: [{
2991
+ };
2992
+ NgxiEva = __decorate([
2993
+ Directive({
2993
2994
  standalone: true,
2994
2995
  selector: "svg[ngxiEva]",
2995
2996
  hostDirectives: [
@@ -2998,8 +2999,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
2998
2999
  inputs: ["icon:ngxiEva", "width", "height", "viewBox"]
2999
3000
  }
3000
3001
  ]
3001
- }]
3002
- }] });
3002
+ })
3003
+ ], NgxiEva);
3003
3004
  export {
3004
3005
  NgxiEva,
3005
3006
  evaActivityFill,