@ngxi/streamline-cyber 0.12.0-beta.9 → 0.12.1

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, PLATFORM_ID, ElementRef, Renderer2, input, computed, effect, Directive } from "@angular/core";
3
+ import { isPlatformServer } from "@angular/common";
3
4
  const streamlineCyber3dGlasses = {
4
5
  "body": '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"><path d="m22.5 10.5l-5.75-5H14.5m-14 5l5.75-5H8.5m-8 5l2 9H8l3.5-3.5l3.5 3.5h5.5l2-9m-22 0h22"/><path d="M3.25 12.5h7.25V14L7 17.5H4.5zm16.5 0H12.5V14l3.5 3.5h2.5z"/></g>',
5
6
  "width": 24,
@@ -3002,6 +3003,7 @@ const streamlineCyberWrenchScrewdriver = {
3002
3003
  };
3003
3004
  class Ngxi {
3004
3005
  constructor() {
3006
+ this.platform = inject(PLATFORM_ID);
3005
3007
  this.el = inject(ElementRef);
3006
3008
  this.renderer = inject(Renderer2);
3007
3009
  this.icon = input(null);
@@ -3013,17 +3015,32 @@ class Ngxi {
3013
3015
  this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox);
3014
3016
  this.setBody = effect(() => {
3015
3017
  const icon = this.icon();
3016
- this.renderer.setProperty(this.el.nativeElement, "innerHTML", icon?.body ?? "");
3018
+ if (!icon) {
3019
+ this.renderer.setProperty(this.el.nativeElement, "innerHTML", "");
3020
+ return;
3021
+ }
3022
+ if (isPlatformServer(this.platform)) {
3023
+ this.el.nativeElement.innerHTML = icon.body;
3024
+ this.el.nativeElement.setAttribute("data-ngxi-ssr", "");
3025
+ return;
3026
+ }
3027
+ if (this.el.nativeElement.hasAttribute("data-ngxi-ssr")) {
3028
+ this.el.nativeElement.removeAttribute("data-ngxi-ssr");
3029
+ if (this.el.nativeElement.innerHTML === icon.body) {
3030
+ return;
3031
+ }
3032
+ }
3033
+ this.renderer.setProperty(this.el.nativeElement, "innerHTML", icon.body);
3017
3034
  });
3018
3035
  }
3019
3036
  static {
3020
- this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3037
+ this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3021
3038
  }
3022
3039
  static {
3023
- 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 });
3040
+ 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 });
3024
3041
  }
3025
3042
  }
3026
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: Ngxi, decorators: [{
3043
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Ngxi, decorators: [{
3027
3044
  type: Directive,
3028
3045
  args: [{
3029
3046
  standalone: true,
@@ -3041,13 +3058,13 @@ class NgxiStreamlineCyber {
3041
3058
  this.ngxiStreamlineCyber = input.required();
3042
3059
  }
3043
3060
  static {
3044
- this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: NgxiStreamlineCyber, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3061
+ this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxiStreamlineCyber, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3045
3062
  }
3046
3063
  static {
3047
- this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.4", type: NgxiStreamlineCyber, isStandalone: true, selector: "svg[ngxiStreamlineCyber]", inputs: { ngxiStreamlineCyber: { classPropertyName: "ngxiStreamlineCyber", publicName: "ngxiStreamlineCyber", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: Ngxi, inputs: ["icon", "ngxiStreamlineCyber", "width", "width", "height", "height", "viewBox", "viewBox"] }], ngImport: i0 });
3064
+ this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: NgxiStreamlineCyber, isStandalone: true, selector: "svg[ngxiStreamlineCyber]", inputs: { ngxiStreamlineCyber: { classPropertyName: "ngxiStreamlineCyber", publicName: "ngxiStreamlineCyber", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: Ngxi, inputs: ["icon", "ngxiStreamlineCyber", "width", "width", "height", "height", "viewBox", "viewBox"] }], ngImport: i0 });
3048
3065
  }
3049
3066
  }
3050
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: NgxiStreamlineCyber, decorators: [{
3067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxiStreamlineCyber, decorators: [{
3051
3068
  type: Directive,
3052
3069
  args: [{
3053
3070
  standalone: true,