@ngxi/cbi 0.12.0-beta.3 → 0.12.0-beta.7

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,
@@ -8881,19 +8880,10 @@ const cbiTwinlyCurtian = {
8881
8880
  "height": 24,
8882
8881
  "viewBox": "0 0 24 24"
8883
8882
  };
8884
- function __decorate(decorators, target, key, desc) {
8885
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8886
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
8887
- 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;
8888
- return c > 3 && r && Object.defineProperty(target, key, r), r;
8889
- }
8890
- typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
8891
- var e = new Error(message);
8892
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
8893
- };
8894
8883
  class Ngxi {
8895
8884
  constructor() {
8896
- this.sanitizer = inject(DomSanitizer);
8885
+ this.el = inject(ElementRef);
8886
+ this.renderer = inject(Renderer2);
8897
8887
  this.icon = input(null);
8898
8888
  this.width = input();
8899
8889
  this.height = input();
@@ -8901,13 +8891,16 @@ class Ngxi {
8901
8891
  this.resolvedWidth = computed(() => this.width() ?? this.icon()?.width);
8902
8892
  this.resolvedHeight = computed(() => this.height() ?? this.icon()?.height);
8903
8893
  this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox);
8904
- this.resolvedBody = computed(() => this.sanitizer.bypassSecurityTrustHtml(this.icon()?.body ?? ""));
8894
+ this.setBody = effect(() => {
8895
+ const icon = this.icon();
8896
+ this.renderer.setProperty(this.el.nativeElement, "innerHTML", icon?.body ?? "");
8897
+ });
8905
8898
  }
8906
8899
  static {
8907
8900
  this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
8908
8901
  }
8909
8902
  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 });
8903
+ 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
8904
  }
8912
8905
  }
8913
8906
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, decorators: [{
@@ -8919,18 +8912,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
8919
8912
  "role": "img",
8920
8913
  "[attr.width]": "resolvedWidth()",
8921
8914
  "[attr.height]": "resolvedHeight()",
8922
- "[attr.viewBox]": "resolvedViewBox()",
8923
- "[innerHTML]": "resolvedBody()"
8915
+ "[attr.viewBox]": "resolvedViewBox()"
8924
8916
  }
8925
8917
  }]
8926
8918
  }] });
8927
- let NgxiCbi = class NgxiCbi2 {
8919
+ class NgxiCbi {
8928
8920
  constructor() {
8929
8921
  this.ngxiCbi = input.required();
8930
8922
  }
8931
- };
8932
- NgxiCbi = __decorate([
8933
- Directive({
8923
+ static {
8924
+ this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: NgxiCbi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
8925
+ }
8926
+ static {
8927
+ this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.4", type: NgxiCbi, isStandalone: true, selector: "svg[ngxiCbi]", inputs: { ngxiCbi: { classPropertyName: "ngxiCbi", publicName: "ngxiCbi", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: Ngxi, inputs: ["icon", "ngxiCbi", "width", "width", "height", "height", "viewBox", "viewBox"] }], ngImport: i0 });
8928
+ }
8929
+ }
8930
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: NgxiCbi, decorators: [{
8931
+ type: Directive,
8932
+ args: [{
8934
8933
  standalone: true,
8935
8934
  selector: "svg[ngxiCbi]",
8936
8935
  hostDirectives: [
@@ -8939,8 +8938,8 @@ NgxiCbi = __decorate([
8939
8938
  inputs: ["icon:ngxiCbi", "width", "height", "viewBox"]
8940
8939
  }
8941
8940
  ]
8942
- })
8943
- ], NgxiCbi);
8941
+ }]
8942
+ }] });
8944
8943
  export {
8945
8944
  NgxiCbi,
8946
8945
  cbi02tv,