@ngxi/lucide 0.12.0-beta.3 → 0.12.0-beta.6

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 lucideAArrowDown = {
5
4
  "body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.5 13h6M2 16l4.5-9l4.5 9m7-9v9m-4-4l4 4l4-4"/>',
6
5
  "width": 24,
@@ -10987,19 +10986,10 @@ const lucideXSquare = {
10987
10986
  "height": 24,
10988
10987
  "viewBox": "0 0 24 24"
10989
10988
  };
10990
- function __decorate(decorators, target, key, desc) {
10991
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10992
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10993
- 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;
10994
- return c > 3 && r && Object.defineProperty(target, key, r), r;
10995
- }
10996
- typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
10997
- var e = new Error(message);
10998
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
10999
- };
11000
10989
  class Ngxi {
11001
10990
  constructor() {
11002
- this.sanitizer = inject(DomSanitizer);
10991
+ this.el = inject(ElementRef);
10992
+ this.renderer = inject(Renderer2);
11003
10993
  this.icon = input(null);
11004
10994
  this.width = input();
11005
10995
  this.height = input();
@@ -11007,13 +10997,16 @@ class Ngxi {
11007
10997
  this.resolvedWidth = computed(() => this.width() ?? this.icon()?.width);
11008
10998
  this.resolvedHeight = computed(() => this.height() ?? this.icon()?.height);
11009
10999
  this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox);
11010
- this.resolvedBody = computed(() => this.sanitizer.bypassSecurityTrustHtml(this.icon()?.body ?? ""));
11000
+ this.setBody = effect(() => {
11001
+ const icon = this.icon();
11002
+ this.renderer.setProperty(this.el.nativeElement, "innerHTML", icon?.body ?? "");
11003
+ });
11011
11004
  }
11012
11005
  static {
11013
11006
  this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
11014
11007
  }
11015
11008
  static {
11016
- 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 });
11009
+ 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 });
11017
11010
  }
11018
11011
  }
11019
11012
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, decorators: [{
@@ -11025,18 +11018,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
11025
11018
  "role": "img",
11026
11019
  "[attr.width]": "resolvedWidth()",
11027
11020
  "[attr.height]": "resolvedHeight()",
11028
- "[attr.viewBox]": "resolvedViewBox()",
11029
- "[innerHTML]": "resolvedBody()"
11021
+ "[attr.viewBox]": "resolvedViewBox()"
11030
11022
  }
11031
11023
  }]
11032
11024
  }] });
11033
- let NgxiLucide = class NgxiLucide2 {
11025
+ class NgxiLucide {
11034
11026
  constructor() {
11035
11027
  this.ngxiLucide = input.required();
11036
11028
  }
11037
- };
11038
- NgxiLucide = __decorate([
11039
- Directive({
11029
+ static {
11030
+ this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: NgxiLucide, deps: [], target: i0.ɵɵFactoryTarget.Directive });
11031
+ }
11032
+ static {
11033
+ this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.4", type: NgxiLucide, isStandalone: true, selector: "svg[ngxiLucide]", inputs: { ngxiLucide: { classPropertyName: "ngxiLucide", publicName: "ngxiLucide", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: Ngxi, inputs: ["icon", "ngxiLucide", "width", "width", "height", "height", "viewBox", "viewBox"] }], ngImport: i0 });
11034
+ }
11035
+ }
11036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: NgxiLucide, decorators: [{
11037
+ type: Directive,
11038
+ args: [{
11040
11039
  standalone: true,
11041
11040
  selector: "svg[ngxiLucide]",
11042
11041
  hostDirectives: [
@@ -11045,8 +11044,8 @@ NgxiLucide = __decorate([
11045
11044
  inputs: ["icon:ngxiLucide", "width", "height", "viewBox"]
11046
11045
  }
11047
11046
  ]
11048
- })
11049
- ], NgxiLucide);
11047
+ }]
11048
+ }] });
11050
11049
  export {
11051
11050
  NgxiLucide,
11052
11051
  lucideAArrowDown,