@ngxi/eva 0.12.19 → 0.12.21
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 +20 -39
- package/dist/index.js.map +1 -1
- package/dist/lib/eva.d.ts +1 -0
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { inject,
|
|
3
|
-
import {
|
|
2
|
+
import { inject, input, computed, Directive } from "@angular/core";
|
|
3
|
+
import { DomSanitizer } from "@angular/platform-browser";
|
|
4
4
|
const evaActivityFill = {
|
|
5
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"/>',
|
|
6
6
|
"width": 24,
|
|
@@ -2943,44 +2943,24 @@ const evaWifiOutline = {
|
|
|
2943
2943
|
};
|
|
2944
2944
|
class Ngxi {
|
|
2945
2945
|
constructor() {
|
|
2946
|
-
this.
|
|
2947
|
-
this.
|
|
2948
|
-
this.
|
|
2949
|
-
this.
|
|
2950
|
-
this.
|
|
2951
|
-
this.
|
|
2952
|
-
this.
|
|
2953
|
-
this.
|
|
2954
|
-
this.
|
|
2955
|
-
this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox);
|
|
2956
|
-
this.setBody = effect(() => {
|
|
2957
|
-
const icon = this.icon();
|
|
2958
|
-
if (!icon) {
|
|
2959
|
-
this.renderer.setProperty(this.el.nativeElement, "innerHTML", "");
|
|
2960
|
-
return;
|
|
2961
|
-
}
|
|
2962
|
-
if (isPlatformServer(this.platform)) {
|
|
2963
|
-
this.el.nativeElement.innerHTML = icon.body;
|
|
2964
|
-
this.el.nativeElement.setAttribute("data-ngxi-ssr", "");
|
|
2965
|
-
return;
|
|
2966
|
-
}
|
|
2967
|
-
if (this.el.nativeElement.hasAttribute("data-ngxi-ssr")) {
|
|
2968
|
-
this.el.nativeElement.removeAttribute("data-ngxi-ssr");
|
|
2969
|
-
if (this.el.nativeElement.innerHTML === icon.body) {
|
|
2970
|
-
return;
|
|
2971
|
-
}
|
|
2972
|
-
}
|
|
2973
|
-
this.renderer.setProperty(this.el.nativeElement, "innerHTML", icon.body);
|
|
2974
|
-
});
|
|
2946
|
+
this.sanitizer = inject(DomSanitizer);
|
|
2947
|
+
this.icon = input(...[]);
|
|
2948
|
+
this.width = input(...[]);
|
|
2949
|
+
this.height = input(...[]);
|
|
2950
|
+
this.viewBox = input(...[]);
|
|
2951
|
+
this.resolvedWidth = computed(() => this.width() ?? this.icon()?.width, ...[]);
|
|
2952
|
+
this.resolvedHeight = computed(() => this.height() ?? this.icon()?.height, ...[]);
|
|
2953
|
+
this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox, ...[]);
|
|
2954
|
+
this.safeSVG = computed(() => this.sanitizer.bypassSecurityTrustHtml(this.icon()?.body ?? ""), ...[]);
|
|
2975
2955
|
}
|
|
2976
2956
|
static {
|
|
2977
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2957
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2978
2958
|
}
|
|
2979
2959
|
static {
|
|
2980
|
-
this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
2960
|
+
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 });
|
|
2981
2961
|
}
|
|
2982
2962
|
}
|
|
2983
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: Ngxi, decorators: [{
|
|
2984
2964
|
type: Directive,
|
|
2985
2965
|
args: [{
|
|
2986
2966
|
standalone: true,
|
|
@@ -2989,22 +2969,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2989
2969
|
"role": "img",
|
|
2990
2970
|
"[attr.width]": "resolvedWidth()",
|
|
2991
2971
|
"[attr.height]": "resolvedHeight()",
|
|
2992
|
-
"[attr.viewBox]": "resolvedViewBox()"
|
|
2972
|
+
"[attr.viewBox]": "resolvedViewBox()",
|
|
2973
|
+
"[innerHTML]": "safeSVG()"
|
|
2993
2974
|
}
|
|
2994
2975
|
}]
|
|
2995
2976
|
}] });
|
|
2996
2977
|
class NgxiEva {
|
|
2997
2978
|
constructor() {
|
|
2998
|
-
this.ngxiEva = input.required();
|
|
2979
|
+
this.ngxiEva = input.required(...[]);
|
|
2999
2980
|
}
|
|
3000
2981
|
static {
|
|
3001
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2982
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: NgxiEva, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3002
2983
|
}
|
|
3003
2984
|
static {
|
|
3004
|
-
this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
2985
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.2", 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 });
|
|
3005
2986
|
}
|
|
3006
2987
|
}
|
|
3007
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2988
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: NgxiEva, decorators: [{
|
|
3008
2989
|
type: Directive,
|
|
3009
2990
|
args: [{
|
|
3010
2991
|
standalone: true,
|