@ngxi/lucide 0.12.20 → 0.12.22

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, PLATFORM_ID, ElementRef, Renderer2, input, computed, effect, SecurityContext, Directive } from "@angular/core";
3
- import { isPlatformServer } from "@angular/common";
2
+ import { inject, input, computed, Directive } from "@angular/core";
4
3
  import { DomSanitizer } from "@angular/platform-browser";
5
4
  const lucideAArrowDown = {
6
5
  "body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m14 12l4 4l4-4m-4 4V7M2 16l4.039-9.69a.5.5 0 0 1 .923 0L11 16m-7.696-3h6.392"/>',
@@ -11176,44 +11175,21 @@ const lucideXSquare = {
11176
11175
  };
11177
11176
  class Ngxi {
11178
11177
  constructor() {
11179
- this.platformId = inject(PLATFORM_ID);
11180
- this.el = inject(ElementRef);
11181
- this.renderer = inject(Renderer2);
11182
11178
  this.sanitizer = inject(DomSanitizer);
11183
- this.icon = input(null, ...[]);
11179
+ this.icon = input(...[]);
11184
11180
  this.width = input(...[]);
11185
11181
  this.height = input(...[]);
11186
11182
  this.viewBox = input(...[]);
11187
11183
  this.resolvedWidth = computed(() => this.width() ?? this.icon()?.width, ...[]);
11188
11184
  this.resolvedHeight = computed(() => this.height() ?? this.icon()?.height, ...[]);
11189
11185
  this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox, ...[]);
11190
- this.setBody = effect(() => {
11191
- const icon = this.icon();
11192
- if (!icon) {
11193
- this.renderer.setProperty(this.el.nativeElement, "innerHTML", "");
11194
- return;
11195
- }
11196
- const sanitizedBody = this.sanitizer.sanitize(SecurityContext.HTML, icon.body);
11197
- if (isPlatformServer(this.platformId)) {
11198
- this.renderer.setProperty(this.el.nativeElement, "innerHTML", sanitizedBody);
11199
- this.renderer.setAttribute(this.el.nativeElement, "data-ngxi-ssr", "");
11200
- return;
11201
- }
11202
- if (this.el.nativeElement.hasAttribute("data-ngxi-ssr")) {
11203
- if (this.el.nativeElement.innerHTML.trim() === sanitizedBody?.trim()) {
11204
- this.renderer.removeAttribute(this.el.nativeElement, "data-ngxi-ssr");
11205
- return;
11206
- }
11207
- this.renderer.removeAttribute(this.el.nativeElement, "data-ngxi-ssr");
11208
- }
11209
- this.renderer.setProperty(this.el.nativeElement, "innerHTML", sanitizedBody);
11210
- }, ...[]);
11186
+ this.safeSVG = computed(() => this.sanitizer.bypassSecurityTrustHtml(this.icon()?.body ?? ""), ...[]);
11211
11187
  }
11212
11188
  static {
11213
11189
  this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
11214
11190
  }
11215
11191
  static {
11216
- this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.2", 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 });
11192
+ this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.2", 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": "safeSVG()" } }, ngImport: i0 });
11217
11193
  }
11218
11194
  }
11219
11195
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: Ngxi, decorators: [{
@@ -11225,7 +11201,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.2", ngImpor
11225
11201
  "role": "img",
11226
11202
  "[attr.width]": "resolvedWidth()",
11227
11203
  "[attr.height]": "resolvedHeight()",
11228
- "[attr.viewBox]": "resolvedViewBox()"
11204
+ "[attr.viewBox]": "resolvedViewBox()",
11205
+ "[innerHTML]": "safeSVG()"
11229
11206
  }
11230
11207
  }]
11231
11208
  }] });