ngx-view-builder 0.1.3 → 0.1.4
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/fesm2022/{ngx-view-builder-avatar-element-B8Nh4G0m.mjs → ngx-view-builder-avatar-element-C0EXsHCI.mjs} +2 -2
- package/fesm2022/{ngx-view-builder-avatar-element-B8Nh4G0m.mjs.map → ngx-view-builder-avatar-element-C0EXsHCI.mjs.map} +1 -1
- package/fesm2022/{ngx-view-builder-breadcrumbs-element-DZmo2VAq.mjs → ngx-view-builder-breadcrumbs-element-BihMIpWr.mjs} +2 -2
- package/fesm2022/{ngx-view-builder-breadcrumbs-element-BaJoW3s7.mjs.map → ngx-view-builder-breadcrumbs-element-BihMIpWr.mjs.map} +1 -1
- package/fesm2022/{ngx-view-builder-icon-element-Bu2EWVKX.mjs → ngx-view-builder-icon-element-CSKRNSAU.mjs} +2 -2
- package/fesm2022/{ngx-view-builder-icon-element-Bu2EWVKX.mjs.map → ngx-view-builder-icon-element-CSKRNSAU.mjs.map} +1 -1
- package/fesm2022/{ngx-view-builder-ngx-view-builder-_VdHLdIW.mjs → ngx-view-builder-ngx-view-builder-CYvIsFw-.mjs} +6 -6
- package/fesm2022/{ngx-view-builder-ngx-view-builder-_VdHLdIW.mjs.map → ngx-view-builder-ngx-view-builder-CYvIsFw-.mjs.map} +1 -1
- package/fesm2022/{ngx-view-builder-toast-element-B1DxJdDY.mjs → ngx-view-builder-toast-element-CclIxegL.mjs} +2 -2
- package/fesm2022/{ngx-view-builder-toast-element-DQ8mU1zc.mjs.map → ngx-view-builder-toast-element-CclIxegL.mjs.map} +1 -1
- package/fesm2022/ngx-view-builder.mjs +1 -1
- package/package.json +3 -1
- package/fesm2022/ngx-view-builder-avatar-element-B_Cx5xnx.mjs +0 -77
- package/fesm2022/ngx-view-builder-avatar-element-B_Cx5xnx.mjs.map +0 -1
- package/fesm2022/ngx-view-builder-breadcrumbs-element-BaJoW3s7.mjs +0 -249
- package/fesm2022/ngx-view-builder-breadcrumbs-element-DZmo2VAq.mjs.map +0 -1
- package/fesm2022/ngx-view-builder-icon-element-DFW1jVp8.mjs +0 -63
- package/fesm2022/ngx-view-builder-icon-element-DFW1jVp8.mjs.map +0 -1
- package/fesm2022/ngx-view-builder-ngx-view-builder-C9rZ5zQM.mjs +0 -90260
- package/fesm2022/ngx-view-builder-ngx-view-builder-C9rZ5zQM.mjs.map +0 -1
- package/fesm2022/ngx-view-builder-toast-element-B1DxJdDY.mjs.map +0 -1
- package/fesm2022/ngx-view-builder-toast-element-DQ8mU1zc.mjs +0 -188
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { NgClass, NgStyle } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
-
import { E as ElementActionService, a as ElementWrapper, N as NvbIcon } from './ngx-view-builder-ngx-view-builder-_VdHLdIW.mjs';
|
|
5
|
-
|
|
6
|
-
class IconElement {
|
|
7
|
-
model = input.required(...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
8
|
-
elementActionService = inject(ElementActionService);
|
|
9
|
-
iconName = computed(() => {
|
|
10
|
-
const value = String(this.model()?.iconName ?? '').trim();
|
|
11
|
-
return value || 'star';
|
|
12
|
-
}, ...(ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []));
|
|
13
|
-
iconStyle = computed(() => {
|
|
14
|
-
const size = this.resolveSize(this.model()?.iconSize, 24);
|
|
15
|
-
const color = String(this.model()?.iconColor ?? '').trim();
|
|
16
|
-
return {
|
|
17
|
-
width: `${size + 18}px`,
|
|
18
|
-
height: `${size + 18}px`,
|
|
19
|
-
color: color || 'var(--color-neutral-700)',
|
|
20
|
-
'font-size': `${size}px`,
|
|
21
|
-
};
|
|
22
|
-
}, ...(ngDevMode ? [{ debugName: "iconStyle" }] : /* istanbul ignore next */ []));
|
|
23
|
-
previewStyle = computed(() => {
|
|
24
|
-
const size = this.resolveSize(this.model()?.previewSize, 64);
|
|
25
|
-
const color = String(this.model()?.iconColor ?? '').trim();
|
|
26
|
-
return {
|
|
27
|
-
width: `${size + 20}px`,
|
|
28
|
-
height: `${size + 20}px`,
|
|
29
|
-
color: color || 'var(--color-neutral-700)',
|
|
30
|
-
'font-size': `${size}px`,
|
|
31
|
-
};
|
|
32
|
-
}, ...(ngDevMode ? [{ debugName: "previewStyle" }] : /* istanbul ignore next */ []));
|
|
33
|
-
onIconClick(event) {
|
|
34
|
-
event.preventDefault();
|
|
35
|
-
event.stopPropagation();
|
|
36
|
-
const runtimeContext = {
|
|
37
|
-
value: this.iconName(),
|
|
38
|
-
item: null,
|
|
39
|
-
row: null,
|
|
40
|
-
};
|
|
41
|
-
const elementName = String(this.model().name ?? '').trim();
|
|
42
|
-
if (elementName) {
|
|
43
|
-
runtimeContext[elementName] = this.iconName();
|
|
44
|
-
}
|
|
45
|
-
void this.elementActionService.runActions(this.model(), this.model().events ?? [], 'click', runtimeContext);
|
|
46
|
-
}
|
|
47
|
-
resolveSize(value, fallback) {
|
|
48
|
-
const parsed = Number(value);
|
|
49
|
-
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
50
|
-
return fallback;
|
|
51
|
-
}
|
|
52
|
-
return Math.floor(parsed);
|
|
53
|
-
}
|
|
54
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: IconElement, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
55
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: IconElement, isStandalone: true, selector: "icon-element", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<element-wrapper [model]=\"model()\">\r\n <section class=\"nvb-icon-wrap\" data-testid=\"icon-root\">\r\n <button\r\n type=\"button\"\r\n class=\"nvb-icon\"\r\n [ngClass]=\"{ 'nvb-icon--filled': model().filled }\"\r\n [ngStyle]=\"iconStyle()\"\r\n (click)=\"onIconClick($event)\"\r\n >\r\n <nvb-icon [name]=\"iconName()\"></nvb-icon>\r\n </button>\r\n\r\n @if (model().showPreview) {\r\n <div class=\"nvb-icon__preview\" [ngStyle]=\"previewStyle()\">\r\n <nvb-icon [name]=\"iconName()\"></nvb-icon>\r\n </div>\r\n }\r\n </section>\r\n</element-wrapper>\r\n", styles: [":host{display:block;width:100%}.nvb-icon-wrap{width:100%;display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap}.nvb-icon,.nvb-icon__preview{border:1px solid var(--color-neutral-300);background:var(--color-neutral-000);border-radius:10px;display:inline-flex;align-items:center;justify-content:center}.nvb-icon{cursor:pointer;min-width:42px;min-height:42px;padding:0}.nvb-icon span,.nvb-icon__preview span{line-height:1}.nvb-icon--filled span{font-variation-settings:\"FILL\" 1,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}\n"], dependencies: [{ kind: "component", type: ElementWrapper, selector: "element-wrapper", inputs: ["model", "controlIdInput", "labelForInput", "groupRole", "showTextWrapperInput"], exportAs: ["elementWrapper"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: NvbIcon, selector: "nvb-icon", inputs: ["name", "svg", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
56
|
-
}
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: IconElement, decorators: [{
|
|
58
|
-
type: Component,
|
|
59
|
-
args: [{ selector: 'icon-element', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ElementWrapper, NgClass, NgStyle, NvbIcon], template: "<element-wrapper [model]=\"model()\">\r\n <section class=\"nvb-icon-wrap\" data-testid=\"icon-root\">\r\n <button\r\n type=\"button\"\r\n class=\"nvb-icon\"\r\n [ngClass]=\"{ 'nvb-icon--filled': model().filled }\"\r\n [ngStyle]=\"iconStyle()\"\r\n (click)=\"onIconClick($event)\"\r\n >\r\n <nvb-icon [name]=\"iconName()\"></nvb-icon>\r\n </button>\r\n\r\n @if (model().showPreview) {\r\n <div class=\"nvb-icon__preview\" [ngStyle]=\"previewStyle()\">\r\n <nvb-icon [name]=\"iconName()\"></nvb-icon>\r\n </div>\r\n }\r\n </section>\r\n</element-wrapper>\r\n", styles: [":host{display:block;width:100%}.nvb-icon-wrap{width:100%;display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap}.nvb-icon,.nvb-icon__preview{border:1px solid var(--color-neutral-300);background:var(--color-neutral-000);border-radius:10px;display:inline-flex;align-items:center;justify-content:center}.nvb-icon{cursor:pointer;min-width:42px;min-height:42px;padding:0}.nvb-icon span,.nvb-icon__preview span{line-height:1}.nvb-icon--filled span{font-variation-settings:\"FILL\" 1,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}\n"] }]
|
|
60
|
-
}], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: true }] }] } });
|
|
61
|
-
|
|
62
|
-
export { IconElement };
|
|
63
|
-
//# sourceMappingURL=ngx-view-builder-icon-element-DFW1jVp8.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-view-builder-icon-element-DFW1jVp8.mjs","sources":["../../../projects/ngx-view-builder/src/lib/core/shared/elements/icon-element/icon-element.ts","../../../projects/ngx-view-builder/src/lib/core/shared/elements/icon-element/icon-element.html"],"sourcesContent":["import { NgClass, NgStyle } from '@angular/common';\r\nimport { Component, computed, inject, input, ChangeDetectionStrategy } from '@angular/core';\r\nimport { ElementWrapper } from '../../components/element-wrapper/element-wrapper';\r\nimport { NvbIcon } from '../../components/nvb-icon/nvb-icon';\r\nimport { IconModel } from '../../models/elements/icon.model';\r\nimport { ElementActionService } from '../../services/element-action.service';\r\n\r\n@Component({\r\n selector: 'icon-element',\r\n\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [ElementWrapper, NgClass, NgStyle, NvbIcon],\r\n templateUrl: './icon-element.html',\r\n\r\n styleUrl: './icon-element.scss',\r\n})\r\nexport class IconElement {\r\n model = input.required<IconModel>();\r\n\r\n private elementActionService = inject(ElementActionService);\r\n\r\n iconName = computed(() => {\r\n const value = String(this.model()?.iconName ?? '').trim();\r\n\r\n return value || 'star';\r\n });\r\n\r\n iconStyle = computed<Record<string, string>>(() => {\r\n const size = this.resolveSize(this.model()?.iconSize, 24);\r\n\r\n const color = String(this.model()?.iconColor ?? '').trim();\r\n\r\n return {\r\n width: `${size + 18}px`,\r\n\r\n height: `${size + 18}px`,\r\n\r\n color: color || 'var(--color-neutral-700)',\r\n\r\n 'font-size': `${size}px`,\r\n };\r\n });\r\n\r\n previewStyle = computed<Record<string, string>>(() => {\r\n const size = this.resolveSize(this.model()?.previewSize, 64);\r\n\r\n const color = String(this.model()?.iconColor ?? '').trim();\r\n\r\n return {\r\n width: `${size + 20}px`,\r\n\r\n height: `${size + 20}px`,\r\n\r\n color: color || 'var(--color-neutral-700)',\r\n\r\n 'font-size': `${size}px`,\r\n };\r\n });\r\n\r\n onIconClick(event: MouseEvent): void {\r\n event.preventDefault();\r\n\r\n event.stopPropagation();\r\n\r\n const runtimeContext: Record<string, unknown> = {\r\n value: this.iconName(),\r\n\r\n item: null,\r\n\r\n row: null,\r\n };\r\n\r\n const elementName = String(this.model().name ?? '').trim();\r\n\r\n if (elementName) {\r\n runtimeContext[elementName] = this.iconName();\r\n }\r\n\r\n void this.elementActionService.runActions(\r\n this.model(),\r\n\r\n this.model().events ?? [],\r\n\r\n 'click',\r\n\r\n runtimeContext,\r\n );\r\n }\r\n\r\n private resolveSize(value: unknown, fallback: number): number {\r\n const parsed = Number(value);\r\n\r\n if (!Number.isFinite(parsed) || parsed <= 0) {\r\n return fallback;\r\n }\r\n\r\n return Math.floor(parsed);\r\n }\r\n}\r\n","<element-wrapper [model]=\"model()\">\r\n <section class=\"nvb-icon-wrap\" data-testid=\"icon-root\">\r\n <button\r\n type=\"button\"\r\n class=\"nvb-icon\"\r\n [ngClass]=\"{ 'nvb-icon--filled': model().filled }\"\r\n [ngStyle]=\"iconStyle()\"\r\n (click)=\"onIconClick($event)\"\r\n >\r\n <nvb-icon [name]=\"iconName()\"></nvb-icon>\r\n </button>\r\n\r\n @if (model().showPreview) {\r\n <div class=\"nvb-icon__preview\" [ngStyle]=\"previewStyle()\">\r\n <nvb-icon [name]=\"iconName()\"></nvb-icon>\r\n </div>\r\n }\r\n </section>\r\n</element-wrapper>\r\n"],"names":[],"mappings":";;;;;MAgBa,WAAW,CAAA;AACtB,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAa;AAE3B,IAAA,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAE3D,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAK;AACvB,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;QAEzD,OAAO,KAAK,IAAI,MAAM;AACxB,IAAA,CAAC,+EAAC;AAEF,IAAA,SAAS,GAAG,QAAQ,CAAyB,MAAK;AAChD,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC;AAEzD,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;QAE1D,OAAO;AACL,YAAA,KAAK,EAAE,CAAA,EAAG,IAAI,GAAG,EAAE,CAAA,EAAA,CAAI;AAEvB,YAAA,MAAM,EAAE,CAAA,EAAG,IAAI,GAAG,EAAE,CAAA,EAAA,CAAI;YAExB,KAAK,EAAE,KAAK,IAAI,0BAA0B;YAE1C,WAAW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