uni-app-fe 0.1.3 → 0.1.5
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/uni-app-fe-component.mjs +1 -1
- package/fesm2022/uni-app-fe-component.mjs.map +1 -1
- package/fesm2022/uni-app-fe-manager.mjs +1 -1
- package/fesm2022/uni-app-fe-manager.mjs.map +1 -1
- package/fesm2022/uni-app-fe-pipe.mjs +11 -2
- package/fesm2022/uni-app-fe-pipe.mjs.map +1 -1
- package/fesm2022/uni-app-fe-service.mjs +4 -1
- package/fesm2022/uni-app-fe-service.mjs.map +1 -1
- package/fesm2022/uni-app-fe.mjs +2 -927
- package/fesm2022/uni-app-fe.mjs.map +1 -1
- package/package.json +4 -2
- package/types/uni-app-fe-component.d.ts +1 -1
- package/types/uni-app-fe-pipe.d.ts +11 -2
- package/types/uni-app-fe-service.d.ts +1 -1
- package/types/uni-app-fe.d.ts +2 -333
package/fesm2022/uni-app-fe.mjs
CHANGED
|
@@ -1,936 +1,11 @@
|
|
|
1
|
-
import * as i1 from '@angular/common';
|
|
2
|
-
import { CommonModule, NgOptimizedImage, DatePipe, registerLocaleData } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { input, ChangeDetectionStrategy, Component, output, inject, computed, ElementRef, signal, HostListener, Pipe, Injectable } from '@angular/core';
|
|
5
|
-
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
|
6
|
-
import { faTriangleExclamation, faCircleInfo, faBell, faLanguage, faMoon, faSun, faArrowRightFromBracket, faArrowRightToBracket, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
7
|
-
import { UniTranslatePipe as UniTranslatePipe$1 } from 'uni-app-fe/pipe';
|
|
8
|
-
import * as i1$1 from 'devextreme-angular/ui/button';
|
|
9
|
-
import { DxButtonModule } from 'devextreme-angular/ui/button';
|
|
10
|
-
import * as i1$2 from 'devextreme-angular/ui/tooltip';
|
|
11
|
-
import { DxTooltipModule } from 'devextreme-angular/ui/tooltip';
|
|
12
|
-
import * as i2 from 'devextreme-angular/core';
|
|
13
|
-
import { UniToastManager } from 'uni-manager/toast';
|
|
14
|
-
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
15
|
-
import * as i3 from 'devextreme-angular/ui/select-box';
|
|
16
|
-
import { DxSelectBoxModule } from 'devextreme-angular/ui/select-box';
|
|
17
|
-
import * as i4 from 'devextreme-angular/ui/switch';
|
|
18
|
-
import { DxSwitchModule } from 'devextreme-angular/ui/switch';
|
|
19
|
-
import { UniLocaleManager } from 'uni-manager/locale';
|
|
20
|
-
import { UniLoaderService as UniLoaderService$1 } from 'uni-app-fe/service';
|
|
21
|
-
import localeEsCl from '@angular/common/locales/es-CL';
|
|
22
|
-
import localeIt from '@angular/common/locales/it';
|
|
23
|
-
import { config } from 'devextreme-angular/common';
|
|
24
|
-
import { locale, loadMessages } from 'devextreme-angular/common/core/localization';
|
|
25
|
-
import esMessages from 'devextreme/localization/messages/es.json';
|
|
26
|
-
import itMessages from 'devextreme/localization/messages/it.json';
|
|
27
|
-
import { firstValueFrom } from 'rxjs/internal/firstValueFrom';
|
|
28
|
-
import { UniHttpManager } from 'uni-manager/http';
|
|
29
|
-
import { icon } from '@fortawesome/fontawesome-svg-core';
|
|
30
|
-
import { UniTypeStringManager, UniTypeNumberManager } from 'uni-manager/type';
|
|
31
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
32
|
-
import LoadPanel from 'devextreme/ui/load_panel';
|
|
33
|
-
import { custom } from 'devextreme/ui/dialog';
|
|
34
|
-
import Popup from 'devextreme/ui/popup';
|
|
35
|
-
import notify from 'devextreme/ui/notify';
|
|
36
|
-
|
|
37
|
-
class UniBannerAlert {
|
|
38
|
-
constructor() {
|
|
39
|
-
/* Icons */
|
|
40
|
-
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
41
|
-
this.lblTitle = input.required(...(ngDevMode ? [{ debugName: "lblTitle" }] : /* istanbul ignore next */ []));
|
|
42
|
-
this.lblDescription = input.required(...(ngDevMode ? [{ debugName: "lblDescription" }] : /* istanbul ignore next */ []));
|
|
43
|
-
this.icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
44
|
-
/* Icons */
|
|
45
|
-
this.ICON_WARNING = faTriangleExclamation;
|
|
46
|
-
}
|
|
47
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniBannerAlert, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
48
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniBannerAlert, isStandalone: true, selector: "uni-banner-alert", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, lblTitle: { classPropertyName: "lblTitle", publicName: "lblTitle", isSignal: true, isRequired: true, transformFunction: null }, lblDescription: { classPropertyName: "lblDescription", publicName: "lblDescription", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\r\n class=\"flex w-full flex-col gap-6 rounded-2xl border-2 p-4 text-center shadow-lg backdrop-blur-md\"\r\n [ngClass]=\"{\r\n 'bg-amber-500/25 border-amber-500 dark:text-amber-100 text-amber-500': type() === 'warning',\r\n 'bg-rose-500/25 border-rose-500 dark:text-rose-200 text-rose-500': type() === 'error'\r\n }\">\r\n <div class=\"flex flex-col items-center gap-4\">\r\n <h1 class=\"text-lg! font-semibold\">{{ lblTitle() | translate }}</h1>\r\n @if(icon(); as icon) {\r\n <fa-icon class=\"text-5xl\" [icon]=\"icon\"></fa-icon>\r\n }\r\n <p class=\"text-sm leading-relaxed text-white!\">{{ lblDescription() | translate }}</p>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "pipe", type: UniTranslatePipe$1, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
49
|
-
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniBannerAlert, decorators: [{
|
|
51
|
-
type: Component,
|
|
52
|
-
args: [{ selector: 'uni-banner-alert', imports: [CommonModule, FaIconComponent, UniTranslatePipe$1], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"flex w-full flex-col gap-6 rounded-2xl border-2 p-4 text-center shadow-lg backdrop-blur-md\"\r\n [ngClass]=\"{\r\n 'bg-amber-500/25 border-amber-500 dark:text-amber-100 text-amber-500': type() === 'warning',\r\n 'bg-rose-500/25 border-rose-500 dark:text-rose-200 text-rose-500': type() === 'error'\r\n }\">\r\n <div class=\"flex flex-col items-center gap-4\">\r\n <h1 class=\"text-lg! font-semibold\">{{ lblTitle() | translate }}</h1>\r\n @if(icon(); as icon) {\r\n <fa-icon class=\"text-5xl\" [icon]=\"icon\"></fa-icon>\r\n }\r\n <p class=\"text-sm leading-relaxed text-white!\">{{ lblDescription() | translate }}</p>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
53
|
-
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], lblTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "lblTitle", required: true }] }], lblDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "lblDescription", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }] } });
|
|
54
|
-
|
|
55
|
-
class UniHeader {
|
|
56
|
-
constructor() {
|
|
57
|
-
/* Input */
|
|
58
|
-
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
59
|
-
this.version = input.required(...(ngDevMode ? [{ debugName: "version" }] : /* istanbul ignore next */ []));
|
|
60
|
-
this.pathBrandLogo = input.required(...(ngDevMode ? [{ debugName: "pathBrandLogo" }] : /* istanbul ignore next */ []));
|
|
61
|
-
this.pathAppLogo = input(...(ngDevMode ? [undefined, { debugName: "pathAppLogo" }] : /* istanbul ignore next */ []));
|
|
62
|
-
this.sideMenu = input(false, ...(ngDevMode ? [{ debugName: "sideMenu" }] : /* istanbul ignore next */ []));
|
|
63
|
-
/* Output */
|
|
64
|
-
this.evtToggleMenu = output();
|
|
65
|
-
}
|
|
66
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
67
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniHeader, isStandalone: true, selector: "uni-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, version: { classPropertyName: "version", publicName: "version", isSignal: true, isRequired: true, transformFunction: null }, pathBrandLogo: { classPropertyName: "pathBrandLogo", publicName: "pathBrandLogo", isSignal: true, isRequired: true, transformFunction: null }, pathAppLogo: { classPropertyName: "pathAppLogo", publicName: "pathAppLogo", isSignal: true, isRequired: false, transformFunction: null }, sideMenu: { classPropertyName: "sideMenu", publicName: "sideMenu", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { evtToggleMenu: "evtToggleMenu" }, ngImport: i0, template: "<div\r\n class=\"dark:bg-theme-dark-800 flex h-16 items-center gap-4 overflow-hidden rounded-xl bg-blue-300 px-4 py-3 text-white\">\r\n <!-- App logo -->\r\n @if (pathAppLogo(); as pathAppLogo) {\r\n <img\r\n [ngSrc]=\"pathAppLogo\"\r\n width=\"40\"\r\n height=\"40\"\r\n priority\r\n class=\"aspect-square h-full w-auto\"\r\n alt=\"App logo\" />\r\n }\r\n\r\n <!-- Info -->\r\n <div class=\"flex flex-1 flex-col overflow-hidden\">\r\n <p class=\"truncate text-xl font-semibold uppercase leading-tight\">{{ title() }}</p>\r\n <p class=\"text-xs opacity-75\">{{ version() }}</p>\r\n </div>\r\n\r\n <div class=\"flex h-full items-center gap-2\">\r\n <!-- Brand Logo -->\r\n <div class=\"2xs:block relative hidden h-full w-24\">\r\n <img\r\n [ngSrc]=\"pathBrandLogo()\"\r\n fill\r\n priority\r\n class=\"object-contain object-right\"\r\n alt=\"Brand logo\" />\r\n </div>\r\n\r\n <!-- Button menu -->\r\n @if (sideMenu()) {\r\n <dx-button class=\"shadow-none!\" [icon]=\"'menu'\" (onClick)=\"evtToggleMenu.emit(true)\">\r\n </dx-button>\r\n }\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}:host ::ng-deep .dx-button{height:24px;min-width:24px;background-color:transparent}:host ::ng-deep .dx-button .dx-icon{font-size:24px;color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: DxButtonModule }, { kind: "component", type: i1$1.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
68
|
-
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniHeader, decorators: [{
|
|
70
|
-
type: Component,
|
|
71
|
-
args: [{ selector: 'uni-header', standalone: true, imports: [DxButtonModule, NgOptimizedImage], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"dark:bg-theme-dark-800 flex h-16 items-center gap-4 overflow-hidden rounded-xl bg-blue-300 px-4 py-3 text-white\">\r\n <!-- App logo -->\r\n @if (pathAppLogo(); as pathAppLogo) {\r\n <img\r\n [ngSrc]=\"pathAppLogo\"\r\n width=\"40\"\r\n height=\"40\"\r\n priority\r\n class=\"aspect-square h-full w-auto\"\r\n alt=\"App logo\" />\r\n }\r\n\r\n <!-- Info -->\r\n <div class=\"flex flex-1 flex-col overflow-hidden\">\r\n <p class=\"truncate text-xl font-semibold uppercase leading-tight\">{{ title() }}</p>\r\n <p class=\"text-xs opacity-75\">{{ version() }}</p>\r\n </div>\r\n\r\n <div class=\"flex h-full items-center gap-2\">\r\n <!-- Brand Logo -->\r\n <div class=\"2xs:block relative hidden h-full w-24\">\r\n <img\r\n [ngSrc]=\"pathBrandLogo()\"\r\n fill\r\n priority\r\n class=\"object-contain object-right\"\r\n alt=\"Brand logo\" />\r\n </div>\r\n\r\n <!-- Button menu -->\r\n @if (sideMenu()) {\r\n <dx-button class=\"shadow-none!\" [icon]=\"'menu'\" (onClick)=\"evtToggleMenu.emit(true)\">\r\n </dx-button>\r\n }\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}:host ::ng-deep .dx-button{height:24px;min-width:24px;background-color:transparent}:host ::ng-deep .dx-button .dx-icon{font-size:24px;color:#fff}\n"] }]
|
|
72
|
-
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], version: [{ type: i0.Input, args: [{ isSignal: true, alias: "version", required: true }] }], pathBrandLogo: [{ type: i0.Input, args: [{ isSignal: true, alias: "pathBrandLogo", required: true }] }], pathAppLogo: [{ type: i0.Input, args: [{ isSignal: true, alias: "pathAppLogo", required: false }] }], sideMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideMenu", required: false }] }], evtToggleMenu: [{ type: i0.Output, args: ["evtToggleMenu"] }] } });
|
|
73
|
-
|
|
74
|
-
class UniItemFieldWithHightContrast {
|
|
75
|
-
constructor() {
|
|
76
|
-
/* Input */
|
|
77
|
-
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
78
|
-
this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
79
|
-
}
|
|
80
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniItemFieldWithHightContrast, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
81
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniItemFieldWithHightContrast, isStandalone: true, selector: "uni-item-field-with-hight-contrast", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-col items-start\">\r\n <span class=\"max-w-full min-w-0 truncate text-lg text-nowrap text-gray-500 dark:text-gray-300\">\r\n {{ label() | translate }}\r\n </span>\r\n <span #tooltipTarget class=\"max-w-full min-w-0 cursor-help truncate text-3xl font-semibold\">\r\n {{ value() || '-' }}\r\n </span>\r\n</div>\r\n\r\n<dx-tooltip\r\n [target]=\"tooltipTarget\"\r\n showEvent=\"mouseenter\"\r\n hideEvent=\"mouseleave\"\r\n [hideOnOutsideClick]=\"false\">\r\n <div *dxTemplate=\"let data = data; of: 'content'\">{{ value() || '-' }}</div>\r\n</dx-tooltip>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: DxTooltipModule }, { kind: "component", type: i1$2.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "container", "contentTemplate", "deferRendering", "disabled", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "containerChange", "contentTemplateChange", "deferRenderingChange", "disabledChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "directive", type: i2.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "pipe", type: UniTranslatePipe$1, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
82
|
-
}
|
|
83
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniItemFieldWithHightContrast, decorators: [{
|
|
84
|
-
type: Component,
|
|
85
|
-
args: [{ selector: 'uni-item-field-with-hight-contrast', imports: [DxTooltipModule, UniTranslatePipe$1], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col items-start\">\r\n <span class=\"max-w-full min-w-0 truncate text-lg text-nowrap text-gray-500 dark:text-gray-300\">\r\n {{ label() | translate }}\r\n </span>\r\n <span #tooltipTarget class=\"max-w-full min-w-0 cursor-help truncate text-3xl font-semibold\">\r\n {{ value() || '-' }}\r\n </span>\r\n</div>\r\n\r\n<dx-tooltip\r\n [target]=\"tooltipTarget\"\r\n showEvent=\"mouseenter\"\r\n hideEvent=\"mouseleave\"\r\n [hideOnOutsideClick]=\"false\">\r\n <div *dxTemplate=\"let data = data; of: 'content'\">{{ value() || '-' }}</div>\r\n</dx-tooltip>\r\n", styles: [":host{display:block}\n"] }]
|
|
86
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
87
|
-
|
|
88
|
-
class UniItemField {
|
|
89
|
-
constructor() {
|
|
90
|
-
/* Pipe */
|
|
91
|
-
this.datePipe = inject(DatePipe);
|
|
92
|
-
/* Input */
|
|
93
|
-
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
94
|
-
this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
95
|
-
this.udm = input(...(ngDevMode ? [undefined, { debugName: "udm" }] : /* istanbul ignore next */ []));
|
|
96
|
-
this.dateFormat = input('longDate', ...(ngDevMode ? [{ debugName: "dateFormat" }] : /* istanbul ignore next */ []));
|
|
97
|
-
/* Variable */
|
|
98
|
-
this.valueFormatted = computed(() => {
|
|
99
|
-
const value = this.value();
|
|
100
|
-
if (!value)
|
|
101
|
-
return '';
|
|
102
|
-
if ((value instanceof Date && !Number.isNaN(value.getTime())) ||
|
|
103
|
-
(typeof value === 'string' && this.isValidDateString(value))) {
|
|
104
|
-
return this.datePipe.transform(new Date(value), this.dateFormat());
|
|
105
|
-
}
|
|
106
|
-
return `${value}${this.udm() ?? ''}`;
|
|
107
|
-
}, ...(ngDevMode ? [{ debugName: "valueFormatted" }] : /* istanbul ignore next */ []));
|
|
108
|
-
}
|
|
109
|
-
/* ---------------- Methods: event ---------------- */
|
|
110
|
-
async onCopyValue() {
|
|
111
|
-
const value = this.valueFormatted();
|
|
112
|
-
if (!value)
|
|
113
|
-
return;
|
|
114
|
-
// Controllo se l'API è disponibile e il contesto è sicuro (HTTPS/Localhost)
|
|
115
|
-
if (navigator.clipboard && globalThis.isSecureContext) {
|
|
116
|
-
await navigator.clipboard.writeText(value);
|
|
117
|
-
UniToastManager.show({ label: 'ValueCopied' });
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/* ---------------- Methods: utils ---------------- */
|
|
121
|
-
isValidDateString(value) {
|
|
122
|
-
if (typeof value !== 'string')
|
|
123
|
-
return false;
|
|
124
|
-
// ISO 8601 (con o senza timezone)
|
|
125
|
-
const isoRegex = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?$/;
|
|
126
|
-
if (!isoRegex.test(value))
|
|
127
|
-
return false;
|
|
128
|
-
const date = new Date(value);
|
|
129
|
-
return !Number.isNaN(date.getTime());
|
|
130
|
-
}
|
|
131
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniItemField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
132
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniItemField, isStandalone: true, selector: "uni-item-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, udm: { classPropertyName: "udm", publicName: "udm", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null } }, providers: [DatePipe], ngImport: i0, template: "<li class=\"flex items-center gap-2 text-sm!\">\r\n <span class=\"text-nowrap text-gray-500 dark:text-gray-300\"> {{ label() | translate }}: </span>\r\n <span\r\n #tooltipTarget\r\n [ngClass]=\"{'text-gray-500/50 dark:text-gray-300/50': !valueFormatted() }\"\r\n class=\"max-w-full min-w-0 cursor-help truncate font-semibold transition duration-100 ease-in-out hover:opacity-75 active:scale-95\"\r\n (click)=\"onCopyValue()\">\r\n {{ valueFormatted() || '-' }}\r\n </span>\r\n</li>\r\n\r\n<dx-tooltip\r\n [target]=\"tooltipTarget\"\r\n showEvent=\"mouseenter\"\r\n hideEvent=\"mouseleave\"\r\n [hideOnOutsideClick]=\"false\">\r\n <div *dxTemplate=\"let data = data; of: 'content'\">{{ valueFormatted() || '-' }}</div>\r\n</dx-tooltip>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: DxTooltipModule }, { kind: "component", type: i1$2.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "container", "contentTemplate", "deferRendering", "disabled", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "containerChange", "contentTemplateChange", "deferRenderingChange", "disabledChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "directive", type: i2.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "pipe", type: UniTranslatePipe$1, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
133
|
-
}
|
|
134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniItemField, decorators: [{
|
|
135
|
-
type: Component,
|
|
136
|
-
args: [{ selector: 'uni-item-field', imports: [CommonModule, DxTooltipModule, UniTranslatePipe$1], providers: [DatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<li class=\"flex items-center gap-2 text-sm!\">\r\n <span class=\"text-nowrap text-gray-500 dark:text-gray-300\"> {{ label() | translate }}: </span>\r\n <span\r\n #tooltipTarget\r\n [ngClass]=\"{'text-gray-500/50 dark:text-gray-300/50': !valueFormatted() }\"\r\n class=\"max-w-full min-w-0 cursor-help truncate font-semibold transition duration-100 ease-in-out hover:opacity-75 active:scale-95\"\r\n (click)=\"onCopyValue()\">\r\n {{ valueFormatted() || '-' }}\r\n </span>\r\n</li>\r\n\r\n<dx-tooltip\r\n [target]=\"tooltipTarget\"\r\n showEvent=\"mouseenter\"\r\n hideEvent=\"mouseleave\"\r\n [hideOnOutsideClick]=\"false\">\r\n <div *dxTemplate=\"let data = data; of: 'content'\">{{ valueFormatted() || '-' }}</div>\r\n</dx-tooltip>\r\n", styles: [":host{display:block}\n"] }]
|
|
137
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], udm: [{ type: i0.Input, args: [{ isSignal: true, alias: "udm", required: false }] }], dateFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFormat", required: false }] }] } });
|
|
138
|
-
|
|
139
|
-
class UniItemFieldWithLensTooltip {
|
|
140
|
-
constructor() {
|
|
141
|
-
/* Input */
|
|
142
|
-
this.id = input.required(...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
143
|
-
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
144
|
-
this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
145
|
-
/* Icon */
|
|
146
|
-
this.ICON_INFO = faCircleInfo;
|
|
147
|
-
}
|
|
148
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniItemFieldWithLensTooltip, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
149
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniItemFieldWithLensTooltip, isStandalone: true, selector: "uni-item-field-with-lens-tooltip", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex items-center gap-1\">\r\n <uni-item-field [label]=\"label()\" [value]=\"value()\" />\r\n\r\n <div #tooltipInfoTarget>\r\n <fa-icon\r\n class=\"text-theme-200 cursor-help rounded px-1 text-xs! transition duration-150 ease-in-out hover:opacity-75\"\r\n [icon]=\"ICON_INFO\">\r\n </fa-icon>\r\n </div>\r\n\r\n <dx-tooltip\r\n [target]=\"tooltipInfoTarget\"\r\n showEvent=\"mouseenter\"\r\n hideEvent=\"mouseleave\"\r\n [hideOnOutsideClick]=\"false\">\r\n <div *dxTemplate=\"let data = data; of: 'content'\">\r\n <ng-content></ng-content>\r\n </div>\r\n </dx-tooltip>\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: DxTooltipModule }, { kind: "component", type: i1$2.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "container", "contentTemplate", "deferRendering", "disabled", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "containerChange", "contentTemplateChange", "deferRenderingChange", "disabledChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "directive", type: i2.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "component", type: UniItemField, selector: "uni-item-field", inputs: ["label", "value", "udm", "dateFormat"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
150
|
-
}
|
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniItemFieldWithLensTooltip, decorators: [{
|
|
152
|
-
type: Component,
|
|
153
|
-
args: [{ selector: 'uni-item-field-with-lens-tooltip', imports: [DxTooltipModule, FaIconComponent, UniItemField], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex items-center gap-1\">\r\n <uni-item-field [label]=\"label()\" [value]=\"value()\" />\r\n\r\n <div #tooltipInfoTarget>\r\n <fa-icon\r\n class=\"text-theme-200 cursor-help rounded px-1 text-xs! transition duration-150 ease-in-out hover:opacity-75\"\r\n [icon]=\"ICON_INFO\">\r\n </fa-icon>\r\n </div>\r\n\r\n <dx-tooltip\r\n [target]=\"tooltipInfoTarget\"\r\n showEvent=\"mouseenter\"\r\n hideEvent=\"mouseleave\"\r\n [hideOnOutsideClick]=\"false\">\r\n <div *dxTemplate=\"let data = data; of: 'content'\">\r\n <ng-content></ng-content>\r\n </div>\r\n </dx-tooltip>\r\n</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
154
|
-
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
155
|
-
|
|
156
|
-
var LedStatus;
|
|
157
|
-
(function (LedStatus) {
|
|
158
|
-
LedStatus[LedStatus["OK"] = 0] = "OK";
|
|
159
|
-
LedStatus[LedStatus["WARNING"] = 1] = "WARNING";
|
|
160
|
-
LedStatus[LedStatus["ERROR"] = 2] = "ERROR";
|
|
161
|
-
})(LedStatus || (LedStatus = {}));
|
|
162
|
-
|
|
163
|
-
class UniLed {
|
|
164
|
-
constructor() {
|
|
165
|
-
/* Inputs */
|
|
166
|
-
this.description = input.required(...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
167
|
-
this.status = input.required(...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
168
|
-
/* Enum */
|
|
169
|
-
this.LED_STATUS = LedStatus;
|
|
170
|
-
}
|
|
171
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniLed, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
172
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniLed, isStandalone: true, selector: "uni-led", inputs: { description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: true, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex items-center gap-1\">\r\n <div\r\n class=\"led\"\r\n [ngClass]=\"{\r\n ok: status() === true || status() === LED_STATUS.OK,\r\n warning: status() === LED_STATUS.WARNING,\r\n error: status() === false || status() === LED_STATUS.ERROR,\r\n }\"></div>\r\n <p class=\"truncate text-sm\">{{ description() }}</p>\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [":host{display:block}.led{width:16px;height:16px;border-radius:50%;margin:8px;display:inline-block;position:relative;box-shadow:inset 0 0 5px #000}.led.error:before{content:\"\";position:absolute;top:-4px;left:-4px;width:24px;height:24px;border-radius:50%;border:3px solid;animation:ring 2s infinite}.led.ok{background-color:#4caf50;border-color:#4caf5099}.led.warning{background-color:#ca8a04;border-color:#ca8a0499}.led.error{background-color:#f44336;border-color:#f4433699}.led.error:before{border-color:#f4433699}@keyframes ring{0%{transform:scale(1);opacity:1}to{transform:scale(1.5);opacity:0}}@media(max-resolution:1dppx){.led{width:12px;height:12px;box-shadow:inset 0 0 3px #000}.led.error:before{top:-3px;left:-3px;width:18px;height:18px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
173
|
-
}
|
|
174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniLed, decorators: [{
|
|
175
|
-
type: Component,
|
|
176
|
-
args: [{ selector: 'uni-led', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex items-center gap-1\">\r\n <div\r\n class=\"led\"\r\n [ngClass]=\"{\r\n ok: status() === true || status() === LED_STATUS.OK,\r\n warning: status() === LED_STATUS.WARNING,\r\n error: status() === false || status() === LED_STATUS.ERROR,\r\n }\"></div>\r\n <p class=\"truncate text-sm\">{{ description() }}</p>\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [":host{display:block}.led{width:16px;height:16px;border-radius:50%;margin:8px;display:inline-block;position:relative;box-shadow:inset 0 0 5px #000}.led.error:before{content:\"\";position:absolute;top:-4px;left:-4px;width:24px;height:24px;border-radius:50%;border:3px solid;animation:ring 2s infinite}.led.ok{background-color:#4caf50;border-color:#4caf5099}.led.warning{background-color:#ca8a04;border-color:#ca8a0499}.led.error{background-color:#f44336;border-color:#f4433699}.led.error:before{border-color:#f4433699}@keyframes ring{0%{transform:scale(1);opacity:1}to{transform:scale(1.5);opacity:0}}@media(max-resolution:1dppx){.led{width:12px;height:12px;box-shadow:inset 0 0 3px #000}.led.error:before{top:-3px;left:-3px;width:18px;height:18px}}\n"] }]
|
|
177
|
-
}], propDecorators: { description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: true }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: true }] }] } });
|
|
178
|
-
|
|
179
|
-
class UniSideMenu {
|
|
180
|
-
constructor() {
|
|
181
|
-
/* Service */
|
|
182
|
-
this.elementRef = inject(ElementRef);
|
|
183
|
-
this.uniLoader = inject(UniLoaderService$1);
|
|
184
|
-
/* Input */
|
|
185
|
-
this.pathUnitecLogo = input.required(...(ngDevMode ? [{ debugName: "pathUnitecLogo" }] : /* istanbul ignore next */ []));
|
|
186
|
-
this.menuItems = input([], ...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
|
|
187
|
-
this.menuInteractions = input([], ...(ngDevMode ? [{ debugName: "menuInteractions" }] : /* istanbul ignore next */ []));
|
|
188
|
-
/* Output */
|
|
189
|
-
this.evtToggleMenu = output();
|
|
190
|
-
/* Variables */
|
|
191
|
-
this.locale = UniLocaleManager.locale;
|
|
192
|
-
this.localesSupported = UniLocaleManager.localesSupported;
|
|
193
|
-
this.darkMode = signal(!localStorage.getItem('uni-theme') || localStorage.getItem('uni-theme') === 'dark', ...(ngDevMode ? [{ debugName: "darkMode" }] : /* istanbul ignore next */ []));
|
|
194
|
-
/* Icons */
|
|
195
|
-
this.ICON = {
|
|
196
|
-
USER: faUser,
|
|
197
|
-
LOGIN: faArrowRightToBracket,
|
|
198
|
-
LOGOUT: faArrowRightFromBracket,
|
|
199
|
-
LIGHT_MODE: faSun,
|
|
200
|
-
DARK_MODE: faMoon,
|
|
201
|
-
LANGUAGE: faLanguage,
|
|
202
|
-
NOTIFICATION: faBell,
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
/* ---------------------- Host listener ---------------------- */
|
|
206
|
-
onClickOutside(event) {
|
|
207
|
-
const target = event.target;
|
|
208
|
-
// Controlla se il click è avvenuto dentro il menu principale
|
|
209
|
-
const clickedInsideMenu = this.elementRef.nativeElement.contains(target);
|
|
210
|
-
// Controlla se il click è avvenuto dentro un popup/dropdown aperto
|
|
211
|
-
const clickedInsideOverlay = !!target.closest('.dx-overlay-wrapper, .dx-dropdowneditor-overlay');
|
|
212
|
-
// Se il click è fuori da entrambi, allora chiude il menu
|
|
213
|
-
if (!clickedInsideMenu && !clickedInsideOverlay) {
|
|
214
|
-
this.evtToggleMenu.emit(false);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
/* ---------------------- Methods ---------------------- */
|
|
218
|
-
updateTheme(e) {
|
|
219
|
-
this.uniLoader.show();
|
|
220
|
-
localStorage.setItem('uni-theme', e.value ? 'dark' : 'light');
|
|
221
|
-
globalThis.location.reload();
|
|
222
|
-
}
|
|
223
|
-
updateLocale(e) {
|
|
224
|
-
this.uniLoader.show();
|
|
225
|
-
localStorage.setItem('uni-locale', e.value);
|
|
226
|
-
globalThis.location.reload();
|
|
227
|
-
}
|
|
228
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSideMenu, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
229
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniSideMenu, isStandalone: true, selector: "uni-side-menu", inputs: { pathUnitecLogo: { classPropertyName: "pathUnitecLogo", publicName: "pathUnitecLogo", isSignal: true, isRequired: true, transformFunction: null }, menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: false, transformFunction: null }, menuInteractions: { classPropertyName: "menuInteractions", publicName: "menuInteractions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { evtToggleMenu: "evtToggleMenu" }, host: { listeners: { "document:click": "onClickOutside($event)" } }, ngImport: i0, template: "<aside\r\n class=\"dark:bg-theme-dark-800 dark:border-theme-dark-900 flex h-screen w-[80vw] max-w-75 flex-col gap-6 overflow-hidden rounded-l border-b-2 border-l-2 border-blue-400/33 bg-blue-300 p-4 shadow-2xl\">\r\n <!-- Header: User/Close -->\r\n <div class=\"flex h-8 w-full shrink-0 items-center\">\r\n <dx-button class=\"ml-auto rounded-full!\" [icon]=\"'close'\" (onClick)=\"evtToggleMenu.emit(false)\">\r\n </dx-button>\r\n </div>\r\n\r\n <div class=\"custom-scrollbar flex flex-1 flex-col overflow-x-hidden overflow-y-auto pr-1\">\r\n <!-- Sezione Menu Principale -->\r\n @if (menuItems().length) {\r\n <ul class=\"flex flex-col gap-1.5\">\r\n @for (item of menuItems(); track item.id) { @if (item.visible !== false) {\r\n <li>\r\n <a\r\n class=\"group flex h-12 items-center gap-3 rounded-lg px-3 text-white! transition-colors dark:text-gray-300!\"\r\n [ngClass]=\"{\r\n 'dark:hover:bg-theme-dark-700 hover:bg-blue-400': !item.badge && !item.disabled,\r\n 'hover:bg-red-500/50': item.badge && !item.disabled,\r\n 'pointer-events-none opacity-30 grayscale': item.disabled,\r\n }\"\r\n [routerLink]=\"item.disabled ? null : item.path\"\r\n [routerLinkActive]=\"item.badge ?\r\n 'bg-red-500/60 *:text-white! *:font-semibold!' :\r\n 'bg-blue-400/75 dark:bg-theme-dark-700 *:text-white! *:font-semibold!'\r\n \"\r\n (click)=\"evtToggleMenu.emit(false)\">\r\n <fa-icon [icon]=\"item.icon\" class=\"w-6 text-center text-lg\"></fa-icon>\r\n <span class=\"flex-1 truncate font-medium\">{{ item.label }}</span>\r\n @if (item.badge) {\r\n <div\r\n class=\"flex size-6 animate-pulse items-center justify-center rounded bg-red-500 shadow-lg\">\r\n <fa-icon class=\"text-xs\" [icon]=\"ICON.NOTIFICATION\"></fa-icon>\r\n </div>\r\n }\r\n </a>\r\n </li>\r\n } }\r\n </ul>\r\n }\r\n\r\n <!-- Sezione Interazioni Dinamiche -->\r\n @if (menuInteractions().length) {\r\n <hr class=\"dark:border-theme-dark-900 my-6 border-blue-400/30\" />\r\n <ul class=\"flex flex-col gap-2 text-white\">\r\n @for (item of menuInteractions(); track item.id) { @if (item.data.type === 'button') {\r\n <li>\r\n <button\r\n type=\"button\"\r\n class=\"flex h-12 w-full items-center gap-3 rounded-lg px-3 transition-all active:scale-95\"\r\n [class]=\"item.class\"\r\n (click)=\"item.data.onClick()\">\r\n <fa-icon class=\"w-6\" [icon]=\"item.data.icon\"></fa-icon>\r\n <span class=\"flex-1 truncate text-left font-medium\">{{ item.label }}</span>\r\n </button>\r\n </li>\r\n } @else if (item.data.type === 'select') {\r\n <li\r\n class=\"dark:bg-theme-dark-700 flex flex-col gap-1 rounded-lg bg-blue-400/75 p-3 shadow-sm\">\r\n <span class=\"text-xs font-bold uppercase opacity-60\">{{ item.label }}</span>\r\n <dx-select-box\r\n class=\"w-full\"\r\n valueExpr=\"id\"\r\n displayExpr=\"description\"\r\n [items]=\"item.data.combos\"\r\n [value]=\"item.data.value\"\r\n stylingMode=\"underlined\"\r\n (onValueChanged)=\"item.data.onValueChanged($event)\">\r\n </dx-select-box>\r\n </li>\r\n } }\r\n </ul>\r\n }\r\n\r\n <!-- Settings Statici -->\r\n <hr class=\"dark:border-theme-dark-900 my-6 border-blue-400/30\" />\r\n <div class=\"flex flex-col gap-3\">\r\n <div\r\n class=\"dark:bg-theme-dark-700 flex h-14 items-center justify-between rounded-lg bg-blue-400/75 px-4 text-white shadow-sm\">\r\n <div class=\"flex items-center gap-3\">\r\n <fa-icon [icon]=\"darkMode() ? ICON.DARK_MODE : ICON.LIGHT_MODE\"></fa-icon>\r\n <span class=\"truncate\">{{ 'DarkMode' | translate }}</span>\r\n </div>\r\n <dx-switch [value]=\"darkMode()\" (onValueChanged)=\"updateTheme($event)\"></dx-switch>\r\n </div>\r\n\r\n <div\r\n class=\"dark:bg-theme-dark-700 flex h-14 items-center justify-between rounded-lg bg-blue-400/75 px-4 text-white shadow-sm\">\r\n <div class=\"flex items-center gap-3\">\r\n <fa-icon [icon]=\"ICON.LANGUAGE\"></fa-icon>\r\n <span class=\"truncate\">{{ 'Language' | translate }}</span>\r\n </div>\r\n <dx-select-box\r\n class=\"w-24\"\r\n [items]=\"localesSupported\"\r\n [value]=\"locale\"\r\n stylingMode=\"underlined\"\r\n (onValueChanged)=\"updateLocale($event)\">\r\n </dx-select-box>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Footer Logo -->\r\n <div class=\"mt-auto border-t border-white/20 pt-4\">\r\n <img\r\n class=\"ml-auto opacity-90 transition-opacity hover:opacity-100\"\r\n [ngSrc]=\"pathUnitecLogo()\"\r\n priority\r\n alt=\"Brand logo\"\r\n height=\"32\"\r\n width=\"88\" />\r\n </div>\r\n</aside>\r\n", styles: [":host{position:fixed;top:0;right:0;z-index:999}:host ::ng-deep input.dx-texteditor-input{padding:2px 0!important;color:#fff!important}:host ::ng-deep .dx-dropdowneditor-icon{color:#fff}:host ::ng-deep .dx-texteditor.dx-editor-underlined:after{border-color:#fff!important}:host ::ng-deep dx-select-box .dx-placeholder:before{padding-block:0px!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "ngmodule", type: DxButtonModule }, { kind: "component", type: i1$1.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "ngmodule", type: DxSelectBoxModule }, { kind: "component", type: i3.DxSelectBoxComponent, selector: "dx-select-box", inputs: ["acceptCustomValue", "accessKey", "activeStateEnabled", "buttons", "customItemCreateEvent", "dataSource", "deferRendering", "disabled", "displayExpr", "displayValue", "dropDownButtonTemplate", "dropDownOptions", "elementAttr", "fieldAddons", "fieldTemplate", "focusStateEnabled", "grouped", "groupTemplate", "height", "hint", "hoverStateEnabled", "inputAttr", "isDirty", "isValid", "items", "itemTemplate", "label", "labelMode", "maxLength", "minSearchLength", "name", "noDataText", "opened", "openOnFieldClick", "placeholder", "readOnly", "rtlEnabled", "searchEnabled", "searchExpr", "searchMode", "searchTimeout", "selectedItem", "showClearButton", "showDataBeforeSearch", "showDropDownButton", "showSelectionControls", "spellcheck", "stylingMode", "tabIndex", "text", "useItemTextAsTitle", "validationError", "validationErrors", "validationMessageMode", "validationMessagePosition", "validationStatus", "value", "valueChangeEvent", "valueExpr", "visible", "width", "wrapItemText"], outputs: ["onChange", "onClosed", "onContentReady", "onCopy", "onCustomItemCreating", "onCut", "onDisposing", "onEnterKey", "onFocusIn", "onFocusOut", "onInitialized", "onInput", "onItemClick", "onKeyDown", "onKeyUp", "onOpened", "onOptionChanged", "onPaste", "onSelectionChanged", "onValueChanged", "acceptCustomValueChange", "accessKeyChange", "activeStateEnabledChange", "buttonsChange", "customItemCreateEventChange", "dataSourceChange", "deferRenderingChange", "disabledChange", "displayExprChange", "displayValueChange", "dropDownButtonTemplateChange", "dropDownOptionsChange", "elementAttrChange", "fieldAddonsChange", "fieldTemplateChange", "focusStateEnabledChange", "groupedChange", "groupTemplateChange", "heightChange", "hintChange", "hoverStateEnabledChange", "inputAttrChange", "isDirtyChange", "isValidChange", "itemsChange", "itemTemplateChange", "labelChange", "labelModeChange", "maxLengthChange", "minSearchLengthChange", "nameChange", "noDataTextChange", "openedChange", "openOnFieldClickChange", "placeholderChange", "readOnlyChange", "rtlEnabledChange", "searchEnabledChange", "searchExprChange", "searchModeChange", "searchTimeoutChange", "selectedItemChange", "showClearButtonChange", "showDataBeforeSearchChange", "showDropDownButtonChange", "showSelectionControlsChange", "spellcheckChange", "stylingModeChange", "tabIndexChange", "textChange", "useItemTextAsTitleChange", "validationErrorChange", "validationErrorsChange", "validationMessageModeChange", "validationMessagePositionChange", "validationStatusChange", "valueChange", "valueChangeEventChange", "valueExprChange", "visibleChange", "widthChange", "wrapItemTextChange", "onBlur"] }, { kind: "ngmodule", type: DxSwitchModule }, { kind: "component", type: i4.DxSwitchComponent, selector: "dx-switch", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "isDirty", "isValid", "name", "readOnly", "rtlEnabled", "switchedOffText", "switchedOnText", "tabIndex", "validationError", "validationErrors", "validationMessageMode", "validationMessagePosition", "validationStatus", "value", "visible", "width"], outputs: ["onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "onValueChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "isDirtyChange", "isValidChange", "nameChange", "readOnlyChange", "rtlEnabledChange", "switchedOffTextChange", "switchedOnTextChange", "tabIndexChange", "validationErrorChange", "validationErrorsChange", "validationMessageModeChange", "validationMessagePositionChange", "validationStatusChange", "valueChange", "visibleChange", "widthChange", "onBlur"] }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "pipe", type: UniTranslatePipe$1, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
230
|
-
}
|
|
231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSideMenu, decorators: [{
|
|
232
|
-
type: Component,
|
|
233
|
-
args: [{ selector: 'uni-side-menu', standalone: true, imports: [
|
|
234
|
-
CommonModule,
|
|
235
|
-
RouterLink,
|
|
236
|
-
RouterLinkActive,
|
|
237
|
-
DxButtonModule,
|
|
238
|
-
DxSelectBoxModule,
|
|
239
|
-
DxSwitchModule,
|
|
240
|
-
UniTranslatePipe$1,
|
|
241
|
-
FaIconComponent,
|
|
242
|
-
NgOptimizedImage,
|
|
243
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<aside\r\n class=\"dark:bg-theme-dark-800 dark:border-theme-dark-900 flex h-screen w-[80vw] max-w-75 flex-col gap-6 overflow-hidden rounded-l border-b-2 border-l-2 border-blue-400/33 bg-blue-300 p-4 shadow-2xl\">\r\n <!-- Header: User/Close -->\r\n <div class=\"flex h-8 w-full shrink-0 items-center\">\r\n <dx-button class=\"ml-auto rounded-full!\" [icon]=\"'close'\" (onClick)=\"evtToggleMenu.emit(false)\">\r\n </dx-button>\r\n </div>\r\n\r\n <div class=\"custom-scrollbar flex flex-1 flex-col overflow-x-hidden overflow-y-auto pr-1\">\r\n <!-- Sezione Menu Principale -->\r\n @if (menuItems().length) {\r\n <ul class=\"flex flex-col gap-1.5\">\r\n @for (item of menuItems(); track item.id) { @if (item.visible !== false) {\r\n <li>\r\n <a\r\n class=\"group flex h-12 items-center gap-3 rounded-lg px-3 text-white! transition-colors dark:text-gray-300!\"\r\n [ngClass]=\"{\r\n 'dark:hover:bg-theme-dark-700 hover:bg-blue-400': !item.badge && !item.disabled,\r\n 'hover:bg-red-500/50': item.badge && !item.disabled,\r\n 'pointer-events-none opacity-30 grayscale': item.disabled,\r\n }\"\r\n [routerLink]=\"item.disabled ? null : item.path\"\r\n [routerLinkActive]=\"item.badge ?\r\n 'bg-red-500/60 *:text-white! *:font-semibold!' :\r\n 'bg-blue-400/75 dark:bg-theme-dark-700 *:text-white! *:font-semibold!'\r\n \"\r\n (click)=\"evtToggleMenu.emit(false)\">\r\n <fa-icon [icon]=\"item.icon\" class=\"w-6 text-center text-lg\"></fa-icon>\r\n <span class=\"flex-1 truncate font-medium\">{{ item.label }}</span>\r\n @if (item.badge) {\r\n <div\r\n class=\"flex size-6 animate-pulse items-center justify-center rounded bg-red-500 shadow-lg\">\r\n <fa-icon class=\"text-xs\" [icon]=\"ICON.NOTIFICATION\"></fa-icon>\r\n </div>\r\n }\r\n </a>\r\n </li>\r\n } }\r\n </ul>\r\n }\r\n\r\n <!-- Sezione Interazioni Dinamiche -->\r\n @if (menuInteractions().length) {\r\n <hr class=\"dark:border-theme-dark-900 my-6 border-blue-400/30\" />\r\n <ul class=\"flex flex-col gap-2 text-white\">\r\n @for (item of menuInteractions(); track item.id) { @if (item.data.type === 'button') {\r\n <li>\r\n <button\r\n type=\"button\"\r\n class=\"flex h-12 w-full items-center gap-3 rounded-lg px-3 transition-all active:scale-95\"\r\n [class]=\"item.class\"\r\n (click)=\"item.data.onClick()\">\r\n <fa-icon class=\"w-6\" [icon]=\"item.data.icon\"></fa-icon>\r\n <span class=\"flex-1 truncate text-left font-medium\">{{ item.label }}</span>\r\n </button>\r\n </li>\r\n } @else if (item.data.type === 'select') {\r\n <li\r\n class=\"dark:bg-theme-dark-700 flex flex-col gap-1 rounded-lg bg-blue-400/75 p-3 shadow-sm\">\r\n <span class=\"text-xs font-bold uppercase opacity-60\">{{ item.label }}</span>\r\n <dx-select-box\r\n class=\"w-full\"\r\n valueExpr=\"id\"\r\n displayExpr=\"description\"\r\n [items]=\"item.data.combos\"\r\n [value]=\"item.data.value\"\r\n stylingMode=\"underlined\"\r\n (onValueChanged)=\"item.data.onValueChanged($event)\">\r\n </dx-select-box>\r\n </li>\r\n } }\r\n </ul>\r\n }\r\n\r\n <!-- Settings Statici -->\r\n <hr class=\"dark:border-theme-dark-900 my-6 border-blue-400/30\" />\r\n <div class=\"flex flex-col gap-3\">\r\n <div\r\n class=\"dark:bg-theme-dark-700 flex h-14 items-center justify-between rounded-lg bg-blue-400/75 px-4 text-white shadow-sm\">\r\n <div class=\"flex items-center gap-3\">\r\n <fa-icon [icon]=\"darkMode() ? ICON.DARK_MODE : ICON.LIGHT_MODE\"></fa-icon>\r\n <span class=\"truncate\">{{ 'DarkMode' | translate }}</span>\r\n </div>\r\n <dx-switch [value]=\"darkMode()\" (onValueChanged)=\"updateTheme($event)\"></dx-switch>\r\n </div>\r\n\r\n <div\r\n class=\"dark:bg-theme-dark-700 flex h-14 items-center justify-between rounded-lg bg-blue-400/75 px-4 text-white shadow-sm\">\r\n <div class=\"flex items-center gap-3\">\r\n <fa-icon [icon]=\"ICON.LANGUAGE\"></fa-icon>\r\n <span class=\"truncate\">{{ 'Language' | translate }}</span>\r\n </div>\r\n <dx-select-box\r\n class=\"w-24\"\r\n [items]=\"localesSupported\"\r\n [value]=\"locale\"\r\n stylingMode=\"underlined\"\r\n (onValueChanged)=\"updateLocale($event)\">\r\n </dx-select-box>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Footer Logo -->\r\n <div class=\"mt-auto border-t border-white/20 pt-4\">\r\n <img\r\n class=\"ml-auto opacity-90 transition-opacity hover:opacity-100\"\r\n [ngSrc]=\"pathUnitecLogo()\"\r\n priority\r\n alt=\"Brand logo\"\r\n height=\"32\"\r\n width=\"88\" />\r\n </div>\r\n</aside>\r\n", styles: [":host{position:fixed;top:0;right:0;z-index:999}:host ::ng-deep input.dx-texteditor-input{padding:2px 0!important;color:#fff!important}:host ::ng-deep .dx-dropdowneditor-icon{color:#fff}:host ::ng-deep .dx-texteditor.dx-editor-underlined:after{border-color:#fff!important}:host ::ng-deep dx-select-box .dx-placeholder:before{padding-block:0px!important}\n"] }]
|
|
244
|
-
}], propDecorators: { pathUnitecLogo: [{ type: i0.Input, args: [{ isSignal: true, alias: "pathUnitecLogo", required: true }] }], menuItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuItems", required: false }] }], menuInteractions: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuInteractions", required: false }] }], evtToggleMenu: [{ type: i0.Output, args: ["evtToggleMenu"] }], onClickOutside: [{
|
|
245
|
-
type: HostListener,
|
|
246
|
-
args: ['document:click', ['$event']]
|
|
247
|
-
}] } });
|
|
248
|
-
|
|
249
|
-
class UniLocaleManagerAngular {
|
|
250
|
-
/* ------------------------------------------------------------------------------- */
|
|
251
|
-
/* ----------------------------------- Config ------------------------------------ */
|
|
252
|
-
/* ------------------------------------------------------------------------------- */
|
|
253
|
-
/**
|
|
254
|
-
* Registra i dati specifici del locale nel framework Angular.
|
|
255
|
-
* Necessario per garantire che le pipe built-in (es. DatePipe, CurrencyPipe) operino secondo le convenzioni del paese corrente.
|
|
256
|
-
*/
|
|
257
|
-
static setLocaleAngular(currentLocale) {
|
|
258
|
-
if (!currentLocale)
|
|
259
|
-
return;
|
|
260
|
-
/* Imposta i dati del locale corrente in Angular necessari per le pipe */
|
|
261
|
-
if (currentLocale === 'it-IT') {
|
|
262
|
-
registerLocaleData(localeIt, 'it-IT');
|
|
263
|
-
}
|
|
264
|
-
else if (currentLocale === 'es-CL') {
|
|
265
|
-
registerLocaleData(localeEsCl, 'es-CL');
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Inizializza la localizzazione specifica per i componenti DevExtreme.
|
|
270
|
-
* Imposta il locale per le formattazioni native dei widget e carica i file di messaggi JSON per la traduzione dei testi di sistema.
|
|
271
|
-
*/
|
|
272
|
-
static setLocaleDevextreme(currentLocale) {
|
|
273
|
-
if (!currentLocale)
|
|
274
|
-
return;
|
|
275
|
-
/* Imposta la lingua */
|
|
276
|
-
locale(currentLocale);
|
|
277
|
-
/* Forza la valuta a mano in base alla stringa esatta */
|
|
278
|
-
if (currentLocale === 'it-IT') {
|
|
279
|
-
config({ defaultCurrency: 'EUR' });
|
|
280
|
-
}
|
|
281
|
-
else if (currentLocale === 'es-CL') {
|
|
282
|
-
config({ defaultCurrency: 'CLP' });
|
|
283
|
-
}
|
|
284
|
-
/* Carica i messaggi di traduzione */
|
|
285
|
-
switch (UniLocaleManager.language) {
|
|
286
|
-
case 'it': {
|
|
287
|
-
loadMessages(itMessages);
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
case 'es': {
|
|
291
|
-
loadMessages(esMessages);
|
|
292
|
-
break;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
/* ------------------------------------------------------------------------------- */
|
|
297
|
-
/* ------------------------------------ Http ------------------------------------- */
|
|
298
|
-
/* ------------------------------------------------------------------------------- */
|
|
299
|
-
/**
|
|
300
|
-
* Recupera il dizionario delle traduzioni dal server remoto in base al locale corrente.
|
|
301
|
-
* Una volta completata la chiamata HTTP, aggiorna automaticamente lo store interno
|
|
302
|
-
* tramite il metodo setTranslations.
|
|
303
|
-
*/
|
|
304
|
-
static async fetchTranslation(currentLocale) {
|
|
305
|
-
if (!currentLocale)
|
|
306
|
-
return;
|
|
307
|
-
const res = await firstValueFrom(UniHttpManager.read$({
|
|
308
|
-
ref: 'locale',
|
|
309
|
-
path: `/Locale/${currentLocale}`,
|
|
310
|
-
}));
|
|
311
|
-
UniLocaleManager.setLocalesSupported(res?.localesSupported);
|
|
312
|
-
UniLocaleManager.setTranslations(Object.fromEntries(Object.entries(res?.translations ?? {}).map((x) => [x[0].toLowerCase(), x[1]])));
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
class FaIconTransformPipe {
|
|
317
|
-
transform(iconDefinition) {
|
|
318
|
-
return icon(iconDefinition).html[0];
|
|
319
|
-
}
|
|
320
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: FaIconTransformPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
321
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: FaIconTransformPipe, isStandalone: true, name: "icon_transform" }); }
|
|
322
|
-
}
|
|
323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: FaIconTransformPipe, decorators: [{
|
|
324
|
-
type: Pipe,
|
|
325
|
-
args: [{
|
|
326
|
-
name: 'icon_transform',
|
|
327
|
-
standalone: true,
|
|
328
|
-
}]
|
|
329
|
-
}] });
|
|
330
|
-
|
|
331
|
-
class UniCapitalizePipe {
|
|
332
|
-
transform(key) {
|
|
333
|
-
if (!key)
|
|
334
|
-
return '';
|
|
335
|
-
return UniTypeStringManager.toCapitalize(key);
|
|
336
|
-
}
|
|
337
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniCapitalizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
338
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniCapitalizePipe, isStandalone: true, name: "capitalize" }); }
|
|
339
|
-
}
|
|
340
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniCapitalizePipe, decorators: [{
|
|
341
|
-
type: Pipe,
|
|
342
|
-
args: [{
|
|
343
|
-
name: 'capitalize',
|
|
344
|
-
standalone: true,
|
|
345
|
-
}]
|
|
346
|
-
}] });
|
|
347
|
-
|
|
348
|
-
class UniControlValidityPipe {
|
|
349
|
-
transform(errors) {
|
|
350
|
-
if (!errors || errors.length === 0)
|
|
351
|
-
return [];
|
|
352
|
-
return errors.map((error) => {
|
|
353
|
-
return {
|
|
354
|
-
type: error.kind,
|
|
355
|
-
message: UniLocaleManager.translate(UniTypeStringManager.toLabelize(error.kind)),
|
|
356
|
-
};
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniControlValidityPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
360
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniControlValidityPipe, isStandalone: true, name: "control_validity" }); }
|
|
361
|
-
}
|
|
362
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniControlValidityPipe, decorators: [{
|
|
363
|
-
type: Pipe,
|
|
364
|
-
args: [{
|
|
365
|
-
name: 'control_validity',
|
|
366
|
-
standalone: true,
|
|
367
|
-
}]
|
|
368
|
-
}] });
|
|
369
|
-
|
|
370
|
-
class UniGetComboPipe {
|
|
371
|
-
transform(id, combos) {
|
|
372
|
-
if (!id)
|
|
373
|
-
return undefined;
|
|
374
|
-
return combos?.find((x) => x.id === id);
|
|
375
|
-
}
|
|
376
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniGetComboPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
377
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniGetComboPipe, isStandalone: true, name: "get_combo" }); }
|
|
378
|
-
}
|
|
379
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniGetComboPipe, decorators: [{
|
|
380
|
-
type: Pipe,
|
|
381
|
-
args: [{
|
|
382
|
-
name: 'get_combo',
|
|
383
|
-
standalone: true,
|
|
384
|
-
}]
|
|
385
|
-
}] });
|
|
386
|
-
|
|
387
|
-
class UniLabelizePipe {
|
|
388
|
-
transform(key, prefix = 'lbl', isToLabelize) {
|
|
389
|
-
if (!key)
|
|
390
|
-
return '';
|
|
391
|
-
if (isToLabelize === false)
|
|
392
|
-
return key;
|
|
393
|
-
return UniTypeStringManager.toLabelize(key, prefix);
|
|
394
|
-
}
|
|
395
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniLabelizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
396
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniLabelizePipe, isStandalone: true, name: "labelize" }); }
|
|
397
|
-
}
|
|
398
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniLabelizePipe, decorators: [{
|
|
399
|
-
type: Pipe,
|
|
400
|
-
args: [{
|
|
401
|
-
name: 'labelize',
|
|
402
|
-
standalone: true,
|
|
403
|
-
}]
|
|
404
|
-
}] });
|
|
405
|
-
|
|
406
|
-
class UniPadPipe {
|
|
407
|
-
transform(value, count, character = '0') {
|
|
408
|
-
if (!value)
|
|
409
|
-
return '';
|
|
410
|
-
return UniTypeNumberManager.toPad(value, count, character);
|
|
411
|
-
}
|
|
412
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniPadPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
413
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniPadPipe, isStandalone: true, name: "pad" }); }
|
|
414
|
-
}
|
|
415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniPadPipe, decorators: [{
|
|
416
|
-
type: Pipe,
|
|
417
|
-
args: [{
|
|
418
|
-
name: 'pad',
|
|
419
|
-
standalone: true,
|
|
420
|
-
}]
|
|
421
|
-
}] });
|
|
422
|
-
|
|
423
|
-
class UniReplacePipe {
|
|
424
|
-
transform(key, values) {
|
|
425
|
-
if (!key)
|
|
426
|
-
return '';
|
|
427
|
-
let fixedKey = key.trim();
|
|
428
|
-
for (const value of values) {
|
|
429
|
-
fixedKey = fixedKey.replaceAll(value.searchValue, value.replaceValue ?? '');
|
|
430
|
-
}
|
|
431
|
-
return fixedKey;
|
|
432
|
-
}
|
|
433
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniReplacePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
434
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniReplacePipe, isStandalone: true, name: "replace" }); }
|
|
435
|
-
}
|
|
436
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniReplacePipe, decorators: [{
|
|
437
|
-
type: Pipe,
|
|
438
|
-
args: [{
|
|
439
|
-
name: 'replace',
|
|
440
|
-
standalone: true,
|
|
441
|
-
}]
|
|
442
|
-
}] });
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* Pipe per traduzioni che supportano Markdown-like syntax e HTML.
|
|
446
|
-
* Uso: {{ 'KEY' | translate_html: { prefix: 'btn', params: { name: 'Mario' } } }}
|
|
447
|
-
*/
|
|
448
|
-
class UniTranslateHtmlPipe {
|
|
449
|
-
constructor() {
|
|
450
|
-
/* Service */
|
|
451
|
-
this.sanitizer = inject(DomSanitizer);
|
|
452
|
-
/* Constant */
|
|
453
|
-
this.MARKDOWN_RULES = [
|
|
454
|
-
{ regex: /\*\*(.*?)\*\*/g, replacement: '<b>$1</b>' }, // Grassetto
|
|
455
|
-
{ regex: /\*(.*?)\*/g, replacement: '<i>$1</i>' }, // Corsivo
|
|
456
|
-
{ regex: /`(.*?)`/g, replacement: '<code>$1</code>' }, // Codice
|
|
457
|
-
{ regex: /\[(.*?)\]\((.*?)\)/g, replacement: '<a href="$2" target="_blank">$1</a>' }, // Link
|
|
458
|
-
{ regex: /==(.*?)==/g, replacement: '<mark>$1</mark>' }, // Evidenziato
|
|
459
|
-
{ regex: /\{(\w+)\|(\w+)\}/g, replacement: '<span style="color: $2">$1</span>' }, // Colore
|
|
460
|
-
];
|
|
461
|
-
}
|
|
462
|
-
transform(key, options) {
|
|
463
|
-
if (!key)
|
|
464
|
-
return '';
|
|
465
|
-
if (options?.isToTranslate === false)
|
|
466
|
-
return key;
|
|
467
|
-
let translation = UniLocaleManager.translate(key, options?.prefix ?? 'lbl', options?.params);
|
|
468
|
-
for (const rule of this.MARKDOWN_RULES) {
|
|
469
|
-
translation = translation.replace(rule.regex, rule.replacement);
|
|
470
|
-
}
|
|
471
|
-
return this.sanitizer.bypassSecurityTrustHtml(translation);
|
|
472
|
-
}
|
|
473
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTranslateHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
474
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniTranslateHtmlPipe, isStandalone: true, name: "translate_html" }); }
|
|
475
|
-
}
|
|
476
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTranslateHtmlPipe, decorators: [{
|
|
477
|
-
type: Pipe,
|
|
478
|
-
args: [{
|
|
479
|
-
name: 'translate_html',
|
|
480
|
-
standalone: true,
|
|
481
|
-
}]
|
|
482
|
-
}] });
|
|
483
|
-
|
|
484
|
-
class UniTranslateInlineParametersPipe {
|
|
485
|
-
transform(key, splitChar, options) {
|
|
486
|
-
if (!key)
|
|
487
|
-
return '';
|
|
488
|
-
if (options?.isToTranslate === false)
|
|
489
|
-
return key;
|
|
490
|
-
return UniLocaleManager.translateInlineParams(key, splitChar);
|
|
491
|
-
}
|
|
492
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTranslateInlineParametersPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
493
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniTranslateInlineParametersPipe, isStandalone: true, name: "translate_inline_parameters" }); }
|
|
494
|
-
}
|
|
495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTranslateInlineParametersPipe, decorators: [{
|
|
496
|
-
type: Pipe,
|
|
497
|
-
args: [{
|
|
498
|
-
name: 'translate_inline_parameters',
|
|
499
|
-
standalone: true,
|
|
500
|
-
}]
|
|
501
|
-
}] });
|
|
502
|
-
|
|
503
|
-
class UniTranslatePipe {
|
|
504
|
-
transform(key, options) {
|
|
505
|
-
if (!key)
|
|
506
|
-
return '';
|
|
507
|
-
if (options?.isToTranslate === false)
|
|
508
|
-
return key;
|
|
509
|
-
return UniLocaleManager.translate(key, options?.prefix ?? 'lbl', options?.params);
|
|
510
|
-
}
|
|
511
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTranslatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
512
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniTranslatePipe, isStandalone: true, name: "translate" }); }
|
|
513
|
-
}
|
|
514
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTranslatePipe, decorators: [{
|
|
515
|
-
type: Pipe,
|
|
516
|
-
args: [{
|
|
517
|
-
name: 'translate',
|
|
518
|
-
standalone: true,
|
|
519
|
-
}]
|
|
520
|
-
}] });
|
|
521
|
-
|
|
522
|
-
class UniTruncateNumberPipe {
|
|
523
|
-
transform(value, decimalDigits = 0, maxIntegerDigits) {
|
|
524
|
-
if (value === null || value === undefined || Number.isNaN(value)) {
|
|
525
|
-
return '';
|
|
526
|
-
}
|
|
527
|
-
return UniTypeNumberManager.toTruncateAndAdUdm(value, decimalDigits, maxIntegerDigits);
|
|
528
|
-
}
|
|
529
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTruncateNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
530
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniTruncateNumberPipe, isStandalone: true, name: "truncate_number" }); }
|
|
531
|
-
}
|
|
532
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTruncateNumberPipe, decorators: [{
|
|
533
|
-
type: Pipe,
|
|
534
|
-
args: [{
|
|
535
|
-
name: 'truncate_number',
|
|
536
|
-
standalone: true,
|
|
537
|
-
}]
|
|
538
|
-
}] });
|
|
539
|
-
|
|
540
|
-
class UniLoaderService {
|
|
541
|
-
constructor() {
|
|
542
|
-
const container = document.querySelector('body');
|
|
543
|
-
const content = document.createElement('div');
|
|
544
|
-
container.append(content);
|
|
545
|
-
this.loadPanel = new LoadPanel(content, {
|
|
546
|
-
showIndicator: true,
|
|
547
|
-
showPane: true,
|
|
548
|
-
shading: true,
|
|
549
|
-
shadingColor: 'rgba(0,0,0,0.4)',
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
/* ------------------------------------- Methods ------------------------------------- */
|
|
553
|
-
show() {
|
|
554
|
-
this.loadPanel.show();
|
|
555
|
-
}
|
|
556
|
-
hide() {
|
|
557
|
-
this.loadPanel.hide();
|
|
558
|
-
}
|
|
559
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
560
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniLoaderService, providedIn: 'root' }); }
|
|
561
|
-
}
|
|
562
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniLoaderService, decorators: [{
|
|
563
|
-
type: Injectable,
|
|
564
|
-
args: [{
|
|
565
|
-
providedIn: 'root',
|
|
566
|
-
}]
|
|
567
|
-
}], ctorParameters: () => [] });
|
|
568
|
-
|
|
569
|
-
class UniPopupService {
|
|
570
|
-
constructor() {
|
|
571
|
-
/* Variables */
|
|
572
|
-
this.instances = new Map();
|
|
573
|
-
}
|
|
574
|
-
/* -------------------------------- Methods: popup -------------------------------- */
|
|
575
|
-
async createPopupConfirm(args) {
|
|
576
|
-
const { message, html, onConfirm, lblTitle, maxWidth } = args;
|
|
577
|
-
// Creazione del contenuto come stringa HTML
|
|
578
|
-
const messageHtml = html ??
|
|
579
|
-
`
|
|
580
|
-
<div style="
|
|
581
|
-
white-space: pre-line;
|
|
582
|
-
word-break: break-all;
|
|
583
|
-
padding: 0rem 1rem 1rem 1rem;
|
|
584
|
-
max-width: ${typeof maxWidth === 'number' ? maxWidth + 'px' : '800px'};
|
|
585
|
-
">
|
|
586
|
-
${message ?? ''}
|
|
587
|
-
</div>
|
|
588
|
-
`;
|
|
589
|
-
await custom({
|
|
590
|
-
title: lblTitle && UniLocaleManager.translate(lblTitle),
|
|
591
|
-
dragEnabled: false,
|
|
592
|
-
showTitle: !!lblTitle,
|
|
593
|
-
messageHtml,
|
|
594
|
-
buttons: [
|
|
595
|
-
{ text: UniLocaleManager.translate('Confirm', 'btn'), onClick: onConfirm },
|
|
596
|
-
{ text: UniLocaleManager.translate('Cancel', 'btn'), onClick: undefined },
|
|
597
|
-
],
|
|
598
|
-
}).show();
|
|
599
|
-
}
|
|
600
|
-
async createPopup(id, args) {
|
|
601
|
-
/* Recupera args */
|
|
602
|
-
const { type, message, html, title, detail, closable } = args;
|
|
603
|
-
/* Pulsanti: dettaglio (errore o altro) */
|
|
604
|
-
const toolbarItems = [];
|
|
605
|
-
if (detail) {
|
|
606
|
-
const detailsButtons = this.createDetailsButtons(id, message ?? html, html !== undefined, detail);
|
|
607
|
-
toolbarItems.push(...detailsButtons);
|
|
608
|
-
}
|
|
609
|
-
/* Aggiunge pulsante per la chiusura del popup (possibile poi solo da qui) */
|
|
610
|
-
if (closable !== false) {
|
|
611
|
-
const closeButton = this.createCloseButton(id);
|
|
612
|
-
toolbarItems.push(closeButton);
|
|
613
|
-
}
|
|
614
|
-
/* Crea popup passando esplicitamente l'informazione sul formato del contenuto */
|
|
615
|
-
const instance = await this.createPopupInstance(id, {
|
|
616
|
-
type,
|
|
617
|
-
title,
|
|
618
|
-
content: message ?? html,
|
|
619
|
-
isContentHtml: !!html,
|
|
620
|
-
toolbarItems,
|
|
621
|
-
});
|
|
622
|
-
return instance;
|
|
623
|
-
}
|
|
624
|
-
async createPopupError(id = undefined, args) {
|
|
625
|
-
/* Recupera args */
|
|
626
|
-
const { title, message, detail, closable } = args;
|
|
627
|
-
/* Crea popup */
|
|
628
|
-
const instance = await this.createPopup(id ?? `popup-${Date.now()}`, {
|
|
629
|
-
type: 'error',
|
|
630
|
-
title: title ?? UniLocaleManager.translate('ErrorFrontend'),
|
|
631
|
-
message,
|
|
632
|
-
detail,
|
|
633
|
-
closable,
|
|
634
|
-
});
|
|
635
|
-
return instance;
|
|
636
|
-
}
|
|
637
|
-
async createPopupErrorHttp(args) {
|
|
638
|
-
/* Recupera args */
|
|
639
|
-
const { ref, err } = args;
|
|
640
|
-
/* Creazione id */
|
|
641
|
-
const id = `popup-${ref ?? Date.now()}`;
|
|
642
|
-
/* Message detail */
|
|
643
|
-
const { status, statusText, message, error: errorResponse } = err;
|
|
644
|
-
let errorDetail = `[${status} - ${statusText}]: ${message}`;
|
|
645
|
-
if (errorResponse) {
|
|
646
|
-
try {
|
|
647
|
-
if (errorResponse instanceof Blob) {
|
|
648
|
-
errorDetail += `\n ${await errorResponse.text()}`;
|
|
649
|
-
}
|
|
650
|
-
else if (typeof errorResponse === 'string') {
|
|
651
|
-
errorDetail += `\n ${errorResponse}`;
|
|
652
|
-
}
|
|
653
|
-
else if (typeof errorResponse === 'object') {
|
|
654
|
-
errorDetail += `\n ${JSON.stringify(errorResponse, undefined, 2)}`;
|
|
655
|
-
}
|
|
656
|
-
else {
|
|
657
|
-
errorDetail += `\n ${String(errorResponse)}`;
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
catch (error) {
|
|
661
|
-
errorDetail += `\n Error processing the error message: ${error}`;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
/* Crea popup */
|
|
665
|
-
const instance = this.createPopupError(id, {
|
|
666
|
-
title: UniLocaleManager.translate(`ErrorBackend`),
|
|
667
|
-
message: UniLocaleManager.translate(`error${err.status}`),
|
|
668
|
-
detail: {
|
|
669
|
-
message: errorDetail,
|
|
670
|
-
messageToCopy: JSON.stringify(err),
|
|
671
|
-
},
|
|
672
|
-
closable: true,
|
|
673
|
-
});
|
|
674
|
-
return instance;
|
|
675
|
-
}
|
|
676
|
-
async createPopupErrorCustom(args) {
|
|
677
|
-
/* Recupera args */
|
|
678
|
-
const { ref, label, interpolationParameters } = args;
|
|
679
|
-
/* Creazione id */
|
|
680
|
-
const id = `popup-${ref ?? Date.now()}`;
|
|
681
|
-
/* Crea popup */
|
|
682
|
-
const instance = this.createPopupError(id, {
|
|
683
|
-
title: UniLocaleManager.translate('ErrorBackendCustom'),
|
|
684
|
-
message: UniLocaleManager.translate(label, 'lbl', interpolationParameters),
|
|
685
|
-
closable: true,
|
|
686
|
-
});
|
|
687
|
-
return instance;
|
|
688
|
-
}
|
|
689
|
-
async updateContentPopup(id, content) {
|
|
690
|
-
/* Recupero popup */
|
|
691
|
-
const popup = this.instances.get(id);
|
|
692
|
-
if (!popup) {
|
|
693
|
-
throw new Error(`Popup not found (id: ${id}`);
|
|
694
|
-
}
|
|
695
|
-
/* Recupero elemento html del popup */
|
|
696
|
-
const element = popup.content().firstElementChild;
|
|
697
|
-
if (!element)
|
|
698
|
-
return;
|
|
699
|
-
/* Selezione del metodo di rendering e del layout in base alla proprietà definita */
|
|
700
|
-
if (content.html === undefined) {
|
|
701
|
-
this.setContentCenter(element, content.message);
|
|
702
|
-
}
|
|
703
|
-
else {
|
|
704
|
-
this.setContent(element, content.html, true);
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
async closePopup(id) {
|
|
708
|
-
/* Recupero popup */
|
|
709
|
-
const popup = this.instances.get(id);
|
|
710
|
-
if (!popup) {
|
|
711
|
-
throw new Error(`Popup not found (id: ${id}`);
|
|
712
|
-
}
|
|
713
|
-
/* Esecuzione del processo di chiusura asincrona del componente DevExtreme */
|
|
714
|
-
await popup.hide();
|
|
715
|
-
}
|
|
716
|
-
/* -------------------------------- Methods: instance -------------------------------- */
|
|
717
|
-
async createPopupInstance(id, args) {
|
|
718
|
-
/* Recupera argomenti */
|
|
719
|
-
const { type, title, content, isContentHtml, toolbarItems = [] } = args;
|
|
720
|
-
/* Evita doppia istanza con lo stesso id */
|
|
721
|
-
const popup = this.instances.get(id);
|
|
722
|
-
if (popup) {
|
|
723
|
-
popup.show();
|
|
724
|
-
return popup;
|
|
725
|
-
}
|
|
726
|
-
/* Crea container del popup */
|
|
727
|
-
const container = document.createElement('div');
|
|
728
|
-
document.body.append(container);
|
|
729
|
-
/* Crea popup */
|
|
730
|
-
const instance = new Popup(container, {
|
|
731
|
-
title: title ?? '',
|
|
732
|
-
showTitle: !!title,
|
|
733
|
-
deferRendering: false,
|
|
734
|
-
maxHeight: 500,
|
|
735
|
-
maxWidth: 1000,
|
|
736
|
-
dragEnabled: false,
|
|
737
|
-
showCloseButton: false,
|
|
738
|
-
hideOnOutsideClick: false,
|
|
739
|
-
shading: true,
|
|
740
|
-
wrapperAttr: {
|
|
741
|
-
id,
|
|
742
|
-
class: `uni-popup-${type ?? 'info'}`,
|
|
743
|
-
},
|
|
744
|
-
toolbarItems,
|
|
745
|
-
contentTemplate: () => {
|
|
746
|
-
const element = document.createElement('div');
|
|
747
|
-
element.style.whiteSpace = 'pre-line';
|
|
748
|
-
element.style.wordBreak = 'break-all';
|
|
749
|
-
element.style.height = '100%';
|
|
750
|
-
// Sceglie il metodo di iniezione e lo stile corretto in base al tipo di contenuto
|
|
751
|
-
if (isContentHtml) {
|
|
752
|
-
this.setContent(element, content, true);
|
|
753
|
-
}
|
|
754
|
-
else {
|
|
755
|
-
this.setContentCenter(element, content);
|
|
756
|
-
}
|
|
757
|
-
return element;
|
|
758
|
-
},
|
|
759
|
-
onHidden: async () => {
|
|
760
|
-
// Rimozione del riferimento dalla mappa per prevenire interazioni concorrenti
|
|
761
|
-
this.instances.delete(id);
|
|
762
|
-
// Rilascio delle risorse allocate dal widget al termine dell'animazione di uscita
|
|
763
|
-
instance.dispose();
|
|
764
|
-
// Rimozione definitiva dell'elemento HTML dal Document Object Model (DOM)
|
|
765
|
-
instance.element()?.remove();
|
|
766
|
-
},
|
|
767
|
-
});
|
|
768
|
-
/* Mostra popup */
|
|
769
|
-
this.instances.set(id, instance);
|
|
770
|
-
await instance.show();
|
|
771
|
-
return instance;
|
|
772
|
-
}
|
|
773
|
-
/* -------------------------------- Methods: utils -------------------------------- */
|
|
774
|
-
createCloseButton(id) {
|
|
775
|
-
return {
|
|
776
|
-
widget: 'dxButton',
|
|
777
|
-
toolbar: 'bottom',
|
|
778
|
-
location: 'after',
|
|
779
|
-
options: {
|
|
780
|
-
type: 'normal',
|
|
781
|
-
icon: 'close',
|
|
782
|
-
text: UniLocaleManager.translate('Close', 'btn'),
|
|
783
|
-
stylingMode: 'contained',
|
|
784
|
-
onClick: () => this.closePopup(id),
|
|
785
|
-
},
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
createDetailsButtons(id, content, isContentHtml, detail) {
|
|
789
|
-
// Variabile di stato per i dettagli
|
|
790
|
-
let inShow = false;
|
|
791
|
-
/* Pulsanti: 'dettagli' e 'indietro */
|
|
792
|
-
const items = [
|
|
793
|
-
{
|
|
794
|
-
widget: 'dxButton',
|
|
795
|
-
toolbar: 'bottom',
|
|
796
|
-
location: 'before',
|
|
797
|
-
options: {
|
|
798
|
-
type: 'normal',
|
|
799
|
-
icon: 'find',
|
|
800
|
-
text: UniLocaleManager.translate('Details', 'btn'),
|
|
801
|
-
stylingMode: 'contained',
|
|
802
|
-
onClick: async (e) => {
|
|
803
|
-
const popup = this.instances.get(id);
|
|
804
|
-
if (!popup) {
|
|
805
|
-
throw new Error(`Popup not found (id: ${id}`);
|
|
806
|
-
}
|
|
807
|
-
const element = popup.content().firstElementChild;
|
|
808
|
-
if (!element)
|
|
809
|
-
return;
|
|
810
|
-
inShow = !inShow;
|
|
811
|
-
if (inShow) {
|
|
812
|
-
this.setContent(element, detail.message, false);
|
|
813
|
-
}
|
|
814
|
-
else {
|
|
815
|
-
// Sceglie il metodo di iniezione e lo stile corretto in base al tipo di contenuto
|
|
816
|
-
if (isContentHtml) {
|
|
817
|
-
this.setContent(element, content, true);
|
|
818
|
-
}
|
|
819
|
-
else {
|
|
820
|
-
this.setContentCenter(element, content);
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
e.component.option({
|
|
824
|
-
text: UniLocaleManager.translate(inShow ? 'Back' : 'Details', 'btn'),
|
|
825
|
-
icon: inShow ? 'back' : 'find',
|
|
826
|
-
});
|
|
827
|
-
},
|
|
828
|
-
},
|
|
829
|
-
},
|
|
830
|
-
{
|
|
831
|
-
widget: 'dxButton',
|
|
832
|
-
toolbar: 'bottom',
|
|
833
|
-
location: 'before',
|
|
834
|
-
options: {
|
|
835
|
-
type: 'normal',
|
|
836
|
-
icon: 'refresh',
|
|
837
|
-
text: UniLocaleManager.translate('Refresh', 'btn'),
|
|
838
|
-
stylingMode: 'contained',
|
|
839
|
-
onClick: () => location.reload(),
|
|
840
|
-
},
|
|
841
|
-
},
|
|
842
|
-
];
|
|
843
|
-
/* Pulsanti: 'copiare dettagli' */
|
|
844
|
-
if (detail.messageToCopy) {
|
|
845
|
-
items.push({
|
|
846
|
-
visible: globalThis.isSecureContext,
|
|
847
|
-
widget: 'dxButton',
|
|
848
|
-
toolbar: 'bottom',
|
|
849
|
-
location: 'after',
|
|
850
|
-
options: {
|
|
851
|
-
type: 'normal',
|
|
852
|
-
icon: 'copy',
|
|
853
|
-
text: UniLocaleManager.translate('Copy', 'btn'),
|
|
854
|
-
stylingMode: 'contained',
|
|
855
|
-
onClick: () => navigator?.clipboard?.writeText(detail.messageToCopy),
|
|
856
|
-
},
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
|
-
return items;
|
|
860
|
-
}
|
|
861
|
-
setContent(element, content, isContentHtml) {
|
|
862
|
-
if (isContentHtml) {
|
|
863
|
-
element.innerHTML = content;
|
|
864
|
-
}
|
|
865
|
-
else {
|
|
866
|
-
element.textContent = content;
|
|
867
|
-
}
|
|
868
|
-
element.style.display = 'block';
|
|
869
|
-
element.style.textAlign = 'left';
|
|
870
|
-
element.style.alignItems = ''; // Reset flexbox
|
|
871
|
-
element.style.justifyContent = ''; // Reset flexbox
|
|
872
|
-
}
|
|
873
|
-
setContentCenter(element, content) {
|
|
874
|
-
element.textContent = content;
|
|
875
|
-
element.style.display = 'flex';
|
|
876
|
-
element.style.alignItems = 'center';
|
|
877
|
-
element.style.justifyContent = 'center';
|
|
878
|
-
element.style.textAlign = 'center';
|
|
879
|
-
}
|
|
880
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniPopupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
881
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniPopupService, providedIn: 'root' }); }
|
|
882
|
-
}
|
|
883
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniPopupService, decorators: [{
|
|
884
|
-
type: Injectable,
|
|
885
|
-
args: [{
|
|
886
|
-
providedIn: 'root',
|
|
887
|
-
}]
|
|
888
|
-
}] });
|
|
889
|
-
|
|
890
|
-
class UniToastService {
|
|
891
|
-
success(message, config) {
|
|
892
|
-
this.show(message, 'success', config);
|
|
893
|
-
}
|
|
894
|
-
info(message, config) {
|
|
895
|
-
this.show(message, 'info', config);
|
|
896
|
-
}
|
|
897
|
-
warning(message, config) {
|
|
898
|
-
this.show(message, 'warning', config);
|
|
899
|
-
}
|
|
900
|
-
error(message, config) {
|
|
901
|
-
this.show(message, 'error', config);
|
|
902
|
-
}
|
|
903
|
-
/* ----------------------- Metodi: utils ----------------------- */
|
|
904
|
-
show(message, type, config) {
|
|
905
|
-
notify({
|
|
906
|
-
message,
|
|
907
|
-
type,
|
|
908
|
-
height: 50,
|
|
909
|
-
width: 400,
|
|
910
|
-
displayTime: config?.duration ?? 4000,
|
|
911
|
-
animation: {
|
|
912
|
-
show: { type: 'fade', duration: 400, from: 0, to: 1 },
|
|
913
|
-
hide: { type: 'fade', duration: 300, from: 1, to: 0 },
|
|
914
|
-
},
|
|
915
|
-
}, { position: 'bottom center', direction: 'up-push' });
|
|
916
|
-
}
|
|
917
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
918
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniToastService, providedIn: 'root' }); }
|
|
919
|
-
}
|
|
920
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniToastService, decorators: [{
|
|
921
|
-
type: Injectable,
|
|
922
|
-
args: [{
|
|
923
|
-
providedIn: 'root',
|
|
924
|
-
}]
|
|
925
|
-
}] });
|
|
926
|
-
|
|
927
1
|
/*
|
|
928
2
|
* Public API Surface of uni-app-fe
|
|
929
3
|
*/
|
|
4
|
+
const libraryName = 'uni-app-fe';
|
|
930
5
|
|
|
931
6
|
/**
|
|
932
7
|
* Generated bundle index. Do not edit.
|
|
933
8
|
*/
|
|
934
9
|
|
|
935
|
-
export {
|
|
10
|
+
export { libraryName };
|
|
936
11
|
//# sourceMappingURL=uni-app-fe.mjs.map
|