@arsedizioni/ars-utils 21.2.1 → 21.2.102
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/arsedizioni-ars-utils-clipper.ui.mjs +780 -799
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.mjs +63 -98
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-support.ui.mjs +6 -9
- package/fesm2022/arsedizioni-ars-utils-support.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.application.mjs +49 -97
- package/fesm2022/arsedizioni-ars-utils-ui.application.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.mjs +160 -256
- package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +6 -9
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-clipper.common.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +15 -20
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-core.d.ts +37 -49
- package/types/arsedizioni-ars-utils-core.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-evolution.common.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-help.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-support.common.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-support.ui.d.ts +3 -4
- package/types/arsedizioni-ars-utils-support.ui.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-tinymce.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.application.d.ts +50 -73
- package/types/arsedizioni-ars-utils-ui.application.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.d.ts +76 -104
- package/types/arsedizioni-ars-utils-ui.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.oauth.d.ts +3 -4
- package/types/arsedizioni-ars-utils-ui.oauth.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils.d.ts.map +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, ChangeDetectionStrategy, Component, output, inject, signal, NgModule, input,
|
|
2
|
+
import { Injectable, ChangeDetectionStrategy, Component, output, inject, signal, NgModule, input, computed, forwardRef, ViewChildren, ChangeDetectorRef } from '@angular/core';
|
|
3
3
|
import { SafeHtmlPipe, SystemUtils, ArsCoreModule, PasswordValidatorDirective, EqualsValidatorDirective } from '@arsedizioni/ars-utils/core';
|
|
4
4
|
import { MatPaginatorIntl } from '@angular/material/paginator';
|
|
5
5
|
import { Overlay } from '@angular/cdk/overlay';
|
|
@@ -43,7 +43,7 @@ class PaginatorIntl extends MatPaginatorIntl {
|
|
|
43
43
|
return '0 di calcolo...';
|
|
44
44
|
}
|
|
45
45
|
if (length === 0 || pageSize === 0) {
|
|
46
|
-
return
|
|
46
|
+
return `0 di ${length}`;
|
|
47
47
|
}
|
|
48
48
|
length = Math.max(length, 0);
|
|
49
49
|
const startIndex = page * pageSize;
|
|
@@ -51,7 +51,7 @@ class PaginatorIntl extends MatPaginatorIntl {
|
|
|
51
51
|
const endIndex = startIndex < length
|
|
52
52
|
? Math.min(startIndex + pageSize, length)
|
|
53
53
|
: startIndex + pageSize;
|
|
54
|
-
return startIndex + 1
|
|
54
|
+
return `${startIndex + 1} - ${endIndex} di ${length}`;
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PaginatorIntl, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -66,6 +66,7 @@ class BusyDialogComponent {
|
|
|
66
66
|
this.type = 'bar';
|
|
67
67
|
this.progress = 0;
|
|
68
68
|
this.progressMode = 'indeterminate';
|
|
69
|
+
this.message = '';
|
|
69
70
|
}
|
|
70
71
|
/**
|
|
71
72
|
* Update busy dialog
|
|
@@ -82,12 +83,7 @@ class BusyDialogComponent {
|
|
|
82
83
|
this.type = type;
|
|
83
84
|
}
|
|
84
85
|
this.progress = progress;
|
|
85
|
-
|
|
86
|
-
this.progressMode = 'determinate';
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
this.progressMode = progressMode;
|
|
90
|
-
}
|
|
86
|
+
this.progressMode = this.progress > 0 ? 'determinate' : progressMode;
|
|
91
87
|
}
|
|
92
88
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BusyDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
93
89
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: BusyDialogComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "Bind": SystemUtils.generateUUID() } }, ngImport: i0, template: "@if(type === 'hourglass') {\r\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div><mat-icon class=\"mat-icon-spinner\">hourglass</mat-icon></div>\r\n @if (message) {\r\n <div [innerHTML]=\"message | safeHtml\" class=\"busy-message\"></div>\r\n }\r\n</div>\r\n} @else if (type === 'wait') {\r\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div><mat-icon class=\"mat-icon-spinner\">hourglass</mat-icon></div>\r\n</div>\r\n} @else {\r\n<div class=\"busy-panel\">\r\n <div fxLayout=\"column\" fxFill>\r\n @if (message) {\r\n <div [innerHTML]=\"message | safeHtml\" class=\"busy-message\"></div>\r\n }\r\n @if (type === 'bar') {\r\n <div>\r\n <mat-progress-bar [mode]=\"progressMode || 'indeterminate'\" [value]=\"progress\"\r\n style=\"margin:15px auto 0 auto; max-width: 350px;\"></mat-progress-bar>\r\n </div>\r\n } @else if (type === 'spinner') {\r\n <div>\r\n <mat-progress-spinner [mode]=\"progressMode || 'indeterminate'\" diameter=\"70\" [value]=\"progress\"\r\n style=\"margin:15px auto 0 auto;\"></mat-progress-spinner>\r\n </div>\r\n }\r\n @if (progress > 0) {\r\n <div>\r\n <span style=\"font-size: smaller;\"><b>{{progress}}%</b></span>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n}", styles: [".dialog-info{font-size:x-small;font-weight:700;text-align:right;padding:10px}.dialog-info-green,.dialog-info-ok{color:var(--ars-color-ok, #388E3C)}.dialog-info-red,.dialog-info-error{color:var(--mat-form-field-error-text-color, #a80710)}.dialog-header{padding-bottom:20px}.dialog-close{margin-right:5px;margin-top:0}.dialog-menu{margin-left:10px;margin-top:10px}.dialog-title{padding:0 24px}.section-title{font-size:large;font-weight:600;padding-top:10px;padding-bottom:8px}.center{text-align:center}.wide{min-width:100%!important;max-width:100%!important;width:100%!important}.fill{min-width:100%!important;max-width:100%!important;width:100%!important;min-height:100%!important;max-height:100%!important;height:100%!important}.scroll-auto{overflow:auto;height:100%}.scroll-hidden{overflow:hidden;height:100%}b{font-weight:700}.large{font-size:large!important}.smaller{font-size:smaller!important}.small{font-size:small!important;line-height:16px!important}.small-icon-button{width:1.5rem!important;height:1.5rem!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center}.small-icon-button .mat-mdc-button-touch-target{width:1.5rem!important;height:1.5rem!important}.x-small{font-size:x-small!important;line-height:14px!important}.bold{font-weight:700}.uppercase{text-transform:uppercase!important}.lowercase{text-transform:lowercase!important}.truncated{min-width:0;max-width:100%}@supports (-webkit-line-clamp: 2){.truncated{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.truncated span,.truncated div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@supports (-webkit-line-clamp: 2){.truncated span,.truncated div{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.clipped{min-width:0;max-width:100%}.clipped span,.clipped div{white-space:nowrap;overflow:hidden;text-overflow:clip}.accent{color:var(--ars-color-accent, #7894ae)!important}.primary{color:var(--ars-color-primary, #00a293)!important}.secondary{color:var(--ars-color-secondary, #4a635f)!important}.error{color:var(--ars-color-error, #ff5449)!important}.success{color:var(--ars-color-ok, #388E3C)!important}.warning{color:var(--ars-color-warning, #FFC107)!important}.text{color:var(--ars-color-text, #191c1b)!important}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;background-color:var(--ars-color-overlay, rgba(255, 255, 255, .75))}.drawer-content{padding-top:10px}.drawer .title-container,.drawer-small .title-container{padding:20px 5px 20px 0}.drawer .title-container-with-loader,.drawer-small .title-container-with-loader{padding:14px 5px 20px 0}.drawer .title,.drawer-small .title{font-size:19.2px!important;font-weight:600;padding-left:15px;min-width:150px;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.drawer .accordion-panel,.drawer-small .accordion-panel{background-color:transparent!important}.drawer .accordion-header,.drawer-small .accordion-header{padding-left:10px;padding-right:10px;border-radius:var(--mat-expansion-container-shape)}.drawer .mat-expansion-panel-body,.drawer-small .mat-expansion-panel-body{padding-left:10px!important;padding-right:10px!important;padding-bottom:20px!important}@media screen and (min-width:0px)and (max-width:430px){.drawer,.drawer-small{border-radius:0!important;min-width:100%!important;max-width:100%!important}}@media screen and (min-width:431px){.drawer{min-width:420px!important;max-width:420px!important}.drawer .title{min-width:200px}.drawer .mat-expansion-panel-body{padding-left:15px!important;padding-right:15px!important;padding-bottom:20px!important}.drawer-small{min-width:360px!important;max-width:360px!important}}.drawer-with-loader{padding-top:0!important}.drawer-transparent{background-color:transparent}.fade-in{animation:fadein .5s linear}@keyframes fadein{0%{opacity:0}to{opacity:1}}.bright{filter:brightness(.7)!important}@media(prefers-color-scheme:dark){.dialog-info-green,.dialog-info-ok{color:var(--ars-color-ok, #4CAF50)}.dialog-info-red,.dialog-info-error{color:var(--mat-form-field-error-text-color, #ff5449)}b,.bold{font-weight:600}.bright{filter:brightness(1.5)!important}}.busy-message{font-size:larger;font-weight:600;padding-top:15px;padding-bottom:15px;text-align:center}.busy-panel{background-color:var(--mat-dialog-container-color);border-radius:var(--mat-dialog-container-shape, 24px);box-shadow:0 4px 8px #0003,0 6px 20px #00000030;padding:24px;min-width:250px;margin:12px}.busy-panel .busy-message{font-size:larger;font-weight:600;padding-bottom:15px;text-align:center}.busy-backdrop{background-color:#0000006b!important}.mat-icon-spinner{animation:matIconSpinnerKeyFrames 3s linear infinite;font-size:5em;width:1em;height:1em}@keyframes matIconSpinnerKeyFrames{0%{transform:rotate(360deg)}to{transform:rotate(0)}}\n"], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i1.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -101,38 +97,26 @@ class ConfirmDialogComponent {
|
|
|
101
97
|
constructor() {
|
|
102
98
|
this.choosen = output();
|
|
103
99
|
this.dialogRef = inject((MatDialogRef));
|
|
104
|
-
this.dialogData = inject(MAT_DIALOG_DATA)
|
|
100
|
+
this.dialogData = inject(MAT_DIALOG_DATA) ?? { title: 'Conferma', okCaption: 'Si', cancelCaption: 'No', message: '' };
|
|
105
101
|
}
|
|
106
102
|
ngOnInit() {
|
|
107
103
|
if (this.dialogData) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (!this.dialogData.okCaption) {
|
|
112
|
-
this.dialogData.okCaption = "Si";
|
|
113
|
-
}
|
|
114
|
-
if (!this.dialogData.cancelCaption) {
|
|
115
|
-
this.dialogData.cancelCaption = "No";
|
|
116
|
-
}
|
|
104
|
+
this.dialogData.title ??= 'Conferma';
|
|
105
|
+
this.dialogData.okCaption ??= 'Si';
|
|
106
|
+
this.dialogData.cancelCaption ??= 'No';
|
|
117
107
|
}
|
|
118
108
|
}
|
|
119
|
-
/**
|
|
120
|
-
* Done
|
|
121
|
-
*/
|
|
109
|
+
/** Done */
|
|
122
110
|
ok() {
|
|
123
111
|
this.choosen.emit({ result: 'ok', options: this.dialogData.options });
|
|
124
112
|
this.dialogRef.close();
|
|
125
113
|
}
|
|
126
|
-
/**
|
|
127
|
-
* Cancelled
|
|
128
|
-
*/
|
|
114
|
+
/** Cancelled */
|
|
129
115
|
cancel() {
|
|
130
116
|
this.choosen.emit({ result: 'cancel' });
|
|
131
117
|
this.dialogRef.close();
|
|
132
118
|
}
|
|
133
|
-
/**
|
|
134
|
-
* Other action
|
|
135
|
-
*/
|
|
119
|
+
/** Other action */
|
|
136
120
|
other() {
|
|
137
121
|
this.choosen.emit({ result: 'other' });
|
|
138
122
|
this.dialogRef.close();
|
|
@@ -142,15 +126,15 @@ class ConfirmDialogComponent {
|
|
|
142
126
|
}
|
|
143
127
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
|
144
128
|
type: Component,
|
|
145
|
-
args: [{ host: { 'Bind': SystemUtils.generateUUID() }, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatDialogTitle, MatDialogContent, MatDialogClose, FlexModule, MatCheckboxModule, FormsModule,
|
|
146
|
-
|
|
129
|
+
args: [{ host: { 'Bind': SystemUtils.generateUUID() }, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatDialogTitle, MatDialogContent, MatDialogClose, FlexModule, MatCheckboxModule, FormsModule,
|
|
130
|
+
MatDialogActions, MatButtonModule, SafeHtmlPipe], template: "<h2 mat-dialog-title [innerHTML]=\"dialogData.title | safeHtml\"></h2>\r\n<mat-dialog-content class=\"dialog-content\">\r\n <div fxLayout=\"column\" fxLayoutGap=\"24px\" fxFill>\r\n <div fxFlex=\"*\">\r\n @if (dialogData.message) {\r\n <div [innerHtml]=\"dialogData.message | safeHtml\"></div>\r\n }\r\n </div>\r\n @if (dialogData.details) {\r\n <div class=\"details-box\">\r\n <p class=\"x-small uppercase secondary\">Dettaglio:</p>\r\n <div class=\"small details\">\r\n <div [innerHtml]=\"dialogData.details\"></div>\r\n </div>\r\n </div>\r\n }\r\n @if (dialogData.options) {\r\n <div>\r\n @for (o of dialogData.options; track $index; let i = $index) {\r\n <div>\r\n <mat-checkbox (change)=\"o.selected = $event.checked\" [checked]=\"o.selected === true\">\r\n {{o.description}}\r\n </mat-checkbox>\r\n </div>\r\n }\r\n </div>\r\n }\r\n <br>\r\n </div>\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxLayoutAlign=\"start center\" fxFill>\r\n <div fxFlex=\"30\">\r\n @if (dialogData.otherCaption) {\r\n <button mat-flat-button (click)=\"other()\" \r\n [mat-dialog-close]=\"true\">{{dialogData.otherCaption}}</button>\r\n }\r\n </div>\r\n <div fxFlex=\"70\" fxLayoutAlign=\"end\">\r\n <button mat-flat-button (click)=\"ok()\" \r\n [mat-dialog-close]=\"true\">{{dialogData.okCaption}}</button>\r\n <button mat-stroked-button [mat-dialog-close]=\"true\" (click)=\"cancel()\">{{dialogData.cancelCaption}}</button>\r\n </div>\r\n </div>\r\n</mat-dialog-actions>", styles: [".dialog-info{font-size:x-small;font-weight:700;text-align:right;padding:10px}.dialog-info-green,.dialog-info-ok{color:var(--ars-color-ok, #388E3C)}.dialog-info-red,.dialog-info-error{color:var(--mat-form-field-error-text-color, #a80710)}.dialog-header{padding-bottom:20px}.dialog-close{margin-right:5px;margin-top:0}.dialog-menu{margin-left:10px;margin-top:10px}.dialog-title{padding:0 24px}.section-title{font-size:large;font-weight:600;padding-top:10px;padding-bottom:8px}.center{text-align:center}.wide{min-width:100%!important;max-width:100%!important;width:100%!important}.fill{min-width:100%!important;max-width:100%!important;width:100%!important;min-height:100%!important;max-height:100%!important;height:100%!important}.scroll-auto{overflow:auto;height:100%}.scroll-hidden{overflow:hidden;height:100%}b{font-weight:700}.large{font-size:large!important}.smaller{font-size:smaller!important}.small{font-size:small!important;line-height:16px!important}.small-icon-button{width:1.5rem!important;height:1.5rem!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center}.small-icon-button .mat-mdc-button-touch-target{width:1.5rem!important;height:1.5rem!important}.x-small{font-size:x-small!important;line-height:14px!important}.bold{font-weight:700}.uppercase{text-transform:uppercase!important}.lowercase{text-transform:lowercase!important}.truncated{min-width:0;max-width:100%}@supports (-webkit-line-clamp: 2){.truncated{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.truncated span,.truncated div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@supports (-webkit-line-clamp: 2){.truncated span,.truncated div{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.clipped{min-width:0;max-width:100%}.clipped span,.clipped div{white-space:nowrap;overflow:hidden;text-overflow:clip}.accent{color:var(--ars-color-accent, #7894ae)!important}.primary{color:var(--ars-color-primary, #00a293)!important}.secondary{color:var(--ars-color-secondary, #4a635f)!important}.error{color:var(--ars-color-error, #ff5449)!important}.success{color:var(--ars-color-ok, #388E3C)!important}.warning{color:var(--ars-color-warning, #FFC107)!important}.text{color:var(--ars-color-text, #191c1b)!important}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;background-color:var(--ars-color-overlay, rgba(255, 255, 255, .75))}.drawer-content{padding-top:10px}.drawer .title-container,.drawer-small .title-container{padding:20px 5px 20px 0}.drawer .title-container-with-loader,.drawer-small .title-container-with-loader{padding:14px 5px 20px 0}.drawer .title,.drawer-small .title{font-size:19.2px!important;font-weight:600;padding-left:15px;min-width:150px;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.drawer .accordion-panel,.drawer-small .accordion-panel{background-color:transparent!important}.drawer .accordion-header,.drawer-small .accordion-header{padding-left:10px;padding-right:10px;border-radius:var(--mat-expansion-container-shape)}.drawer .mat-expansion-panel-body,.drawer-small .mat-expansion-panel-body{padding-left:10px!important;padding-right:10px!important;padding-bottom:20px!important}@media screen and (min-width:0px)and (max-width:430px){.drawer,.drawer-small{border-radius:0!important;min-width:100%!important;max-width:100%!important}}@media screen and (min-width:431px){.drawer{min-width:420px!important;max-width:420px!important}.drawer .title{min-width:200px}.drawer .mat-expansion-panel-body{padding-left:15px!important;padding-right:15px!important;padding-bottom:20px!important}.drawer-small{min-width:360px!important;max-width:360px!important}}.drawer-with-loader{padding-top:0!important}.drawer-transparent{background-color:transparent}.fade-in{animation:fadein .5s linear}@keyframes fadein{0%{opacity:0}to{opacity:1}}.bright{filter:brightness(.7)!important}@media(prefers-color-scheme:dark){.dialog-info-green,.dialog-info-ok{color:var(--ars-color-ok, #4CAF50)}.dialog-info-red,.dialog-info-error{color:var(--mat-form-field-error-text-color, #ff5449)}b,.bold{font-weight:600}.bright{filter:brightness(1.5)!important}}.dialog-content{padding:0 24px 24px!important}.details-box{border-top:1px solid var(--ars-color-divider, #757d87)}.details{background-color:var(--ars-item-hover-background-color, #eaecef);border-radius:5px;max-height:350px;padding:8px 12px;overflow:auto}\n"] }]
|
|
147
131
|
}], propDecorators: { choosen: [{ type: i0.Output, args: ["choosen"] }] } });
|
|
148
132
|
|
|
149
133
|
class InfoDialogComponent {
|
|
150
134
|
constructor() {
|
|
151
135
|
this.dialogService = inject(DialogService);
|
|
152
136
|
this.dialogRef = inject((MatDialogRef));
|
|
153
|
-
this.dialogData = inject(MAT_DIALOG_DATA)
|
|
137
|
+
this.dialogData = inject(MAT_DIALOG_DATA) ?? { appearance: 'fill', title: 'Informazioni', message: '' };
|
|
154
138
|
}
|
|
155
139
|
ngOnInit() {
|
|
156
140
|
this.setData(this.dialogData);
|
|
@@ -162,13 +146,9 @@ class InfoDialogComponent {
|
|
|
162
146
|
setData(data) {
|
|
163
147
|
this.dialogData = data;
|
|
164
148
|
if (this.dialogData) {
|
|
165
|
-
|
|
166
|
-
this.dialogData.title = "Informazioni";
|
|
167
|
-
}
|
|
149
|
+
this.dialogData.title ??= 'Informazioni';
|
|
168
150
|
if (this.dialogData.dismissAfter) {
|
|
169
|
-
setTimeout(() =>
|
|
170
|
-
this.dialogRef.close();
|
|
171
|
-
}, this.dialogData.dismissAfter);
|
|
151
|
+
setTimeout(() => this.dialogRef.close(), this.dialogData.dismissAfter);
|
|
172
152
|
}
|
|
173
153
|
}
|
|
174
154
|
}
|
|
@@ -177,13 +157,11 @@ class InfoDialogComponent {
|
|
|
177
157
|
* @param url : the url to navigate to
|
|
178
158
|
*/
|
|
179
159
|
navigate(url) {
|
|
180
|
-
|
|
181
|
-
this.dialogData.onNavigate(url);
|
|
182
|
-
}
|
|
160
|
+
this.dialogData.onNavigate?.(url);
|
|
183
161
|
}
|
|
184
162
|
/**
|
|
185
|
-
|
|
186
|
-
|
|
163
|
+
* Copy to clipboard
|
|
164
|
+
*/
|
|
187
165
|
async copy() {
|
|
188
166
|
const elem = document.getElementById('info-dialog-content');
|
|
189
167
|
if (!elem)
|
|
@@ -201,10 +179,10 @@ class InfoDialogComponent {
|
|
|
201
179
|
window.focus();
|
|
202
180
|
await navigator.clipboard.write(data);
|
|
203
181
|
}, 0);
|
|
204
|
-
this.dialogService.toast(
|
|
182
|
+
this.dialogService.toast('Copiato negli appunti.');
|
|
205
183
|
}
|
|
206
184
|
catch (err) {
|
|
207
|
-
this.dialogService.toast(
|
|
185
|
+
this.dialogService.toast(`Errore copiando negli appunti: ${err}`);
|
|
208
186
|
}
|
|
209
187
|
}
|
|
210
188
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: InfoDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -218,11 +196,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
218
196
|
class ToastComponent {
|
|
219
197
|
constructor() {
|
|
220
198
|
this.action = output();
|
|
221
|
-
this.dialogData = inject(MAT_SNACK_BAR_DATA)
|
|
199
|
+
this.dialogData = inject(MAT_SNACK_BAR_DATA) ?? {};
|
|
222
200
|
}
|
|
223
|
-
/**
|
|
224
|
-
* Do action
|
|
225
|
-
*/
|
|
201
|
+
/** Do action */
|
|
226
202
|
do() {
|
|
227
203
|
this.action.emit();
|
|
228
204
|
}
|
|
@@ -263,37 +239,26 @@ class DeleteDialogComponent {
|
|
|
263
239
|
constructor() {
|
|
264
240
|
this.choosen = output();
|
|
265
241
|
this.dialogRef = inject((MatDialogRef));
|
|
266
|
-
this.dialogData = inject(MAT_DIALOG_DATA)
|
|
242
|
+
this.dialogData = inject(MAT_DIALOG_DATA) ?? { title: 'Attenzione', confirmMode: DeleteDialogConfirmMode.None, okCaption: 'Si', cancelCaption: 'No', message: '' };
|
|
267
243
|
this.confirmed = signal(this.dialogData.confirmMode !== DeleteDialogConfirmMode.Simple, ...(ngDevMode ? [{ debugName: "confirmed" }] : []));
|
|
268
|
-
this.confirmValue = undefined;
|
|
269
244
|
}
|
|
270
245
|
ngOnInit() {
|
|
271
246
|
if (this.dialogData) {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if (!this.dialogData.okCaption) {
|
|
276
|
-
this.dialogData.okCaption = "Si";
|
|
277
|
-
}
|
|
278
|
-
if (!this.dialogData.cancelCaption) {
|
|
279
|
-
this.dialogData.cancelCaption = "No";
|
|
280
|
-
}
|
|
247
|
+
this.dialogData.title ??= 'Attenzione';
|
|
248
|
+
this.dialogData.okCaption ??= 'Si';
|
|
249
|
+
this.dialogData.cancelCaption ??= 'No';
|
|
281
250
|
if (!this.dialogData.confirmMode) {
|
|
282
251
|
this.dialogData.confirmMode = DeleteDialogConfirmMode.None;
|
|
283
252
|
this.confirmed.set(true);
|
|
284
253
|
}
|
|
285
254
|
}
|
|
286
255
|
}
|
|
287
|
-
/**
|
|
288
|
-
* Done
|
|
289
|
-
*/
|
|
256
|
+
/** Done */
|
|
290
257
|
ok() {
|
|
291
258
|
this.choosen.emit({ result: 'ok' });
|
|
292
259
|
this.dialogRef.close();
|
|
293
260
|
}
|
|
294
|
-
/**
|
|
295
|
-
* Cancelled
|
|
296
|
-
*/
|
|
261
|
+
/** Cancelled */
|
|
297
262
|
cancel() {
|
|
298
263
|
this.choosen.emit({ result: 'cancel' });
|
|
299
264
|
this.dialogRef.close();
|
|
@@ -303,21 +268,18 @@ class DeleteDialogComponent {
|
|
|
303
268
|
}
|
|
304
269
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DeleteDialogComponent, decorators: [{
|
|
305
270
|
type: Component,
|
|
306
|
-
args: [{ host: { 'Bind': SystemUtils.generateUUID() }, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatDialogTitle, MatDialogContent, MatDialogClose, FlexModule, MatCheckboxModule, FormsModule,
|
|
307
|
-
|
|
308
|
-
SafeHtmlPipe], template: "<h2 mat-dialog-title [innerHTML]=\"dialogData.title | safeHtml\"></h2>\r\n<mat-dialog-content class=\"dialog-content\">\r\n <form name=\"form\" #f=\"ngForm\" novalidate>\r\n <div fxLayout=\"column\" fxLayoutGap=\"24px\" fxFill>\r\n <div fxFlex=\"*\">\r\n @if (dialogData.message) {\r\n <div [innerHtml]=\"dialogData.message | safeHtml\"></div>\r\n }\r\n </div>\r\n @if (dialogData.details) {\r\n <div class=\"details-box\">\r\n <p class=\"x-small uppercase secondary\">Dettaglio:</p>\r\n <div class=\"small details\">\r\n <div [innerHtml]=\"dialogData.details\"></div>\r\n </div>\r\n </div>\r\n }\r\n @if (dialogData.confirmMode === 1) {\r\n <div>\r\n <mat-checkbox (change)=\"confirmed.set($event.checked)\" [checked]=\"confirmed()\">\r\n Confermo la cancellazione\r\n </mat-checkbox>\r\n </div>\r\n } @else if (dialogData.confirmMode === 2) {\r\n <p>Per confermare la cancellazione digita la parola <i><b>elimina</b></i>.</p>\r\n <mat-form-field style=\"width: 200px\" [appearance]=\"dialogData.appearance\">\r\n <mat-label>Conferma</mat-label>\r\n <input matInput #field_confirm=\"ngModel\" [(ngModel)]=\"confirmValue\" name=\"field_confirm\" required \r\n [attr.aria-label]=\"'Digita la parola -elimina-'\">\r\n @if (field_confirm.invalid) {\r\n <mat-error>Digita la parola \"elimina\"</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n <br>\r\n </div>\r\n </form>\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxLayoutAlign=\"end center\" fxFill>\r\n <button mat-flat-button (click)=\"ok()\" \r\n [disabled]=\"f.form.invalid || (confirmValue && confirmValue.toLowerCase() !== 'elimina') || !confirmed()\"\r\n [mat-dialog-close]=\"true\">{{dialogData.okCaption}}</button>\r\n <button mat-stroked-button [mat-dialog-close]=\"true\"\r\n (click)=\"cancel()\">{{dialogData.cancelCaption}}</button>\r\n\r\n </div>\r\n</mat-dialog-actions>", styles: [".dialog-info{font-size:x-small;font-weight:700;text-align:right;padding:10px}.dialog-info-green,.dialog-info-ok{color:var(--ars-color-ok, #388E3C)}.dialog-info-red,.dialog-info-error{color:var(--mat-form-field-error-text-color, #a80710)}.dialog-header{padding-bottom:20px}.dialog-close{margin-right:5px;margin-top:0}.dialog-menu{margin-left:10px;margin-top:10px}.dialog-title{padding:0 24px}.section-title{font-size:large;font-weight:600;padding-top:10px;padding-bottom:8px}.center{text-align:center}.wide{min-width:100%!important;max-width:100%!important;width:100%!important}.fill{min-width:100%!important;max-width:100%!important;width:100%!important;min-height:100%!important;max-height:100%!important;height:100%!important}.scroll-auto{overflow:auto;height:100%}.scroll-hidden{overflow:hidden;height:100%}b{font-weight:700}.large{font-size:large!important}.smaller{font-size:smaller!important}.small{font-size:small!important;line-height:16px!important}.small-icon-button{width:1.5rem!important;height:1.5rem!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center}.small-icon-button .mat-mdc-button-touch-target{width:1.5rem!important;height:1.5rem!important}.x-small{font-size:x-small!important;line-height:14px!important}.bold{font-weight:700}.uppercase{text-transform:uppercase!important}.lowercase{text-transform:lowercase!important}.truncated{min-width:0;max-width:100%}@supports (-webkit-line-clamp: 2){.truncated{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.truncated span,.truncated div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@supports (-webkit-line-clamp: 2){.truncated span,.truncated div{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.clipped{min-width:0;max-width:100%}.clipped span,.clipped div{white-space:nowrap;overflow:hidden;text-overflow:clip}.accent{color:var(--ars-color-accent, #7894ae)!important}.primary{color:var(--ars-color-primary, #00a293)!important}.secondary{color:var(--ars-color-secondary, #4a635f)!important}.error{color:var(--ars-color-error, #ff5449)!important}.success{color:var(--ars-color-ok, #388E3C)!important}.warning{color:var(--ars-color-warning, #FFC107)!important}.text{color:var(--ars-color-text, #191c1b)!important}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;background-color:var(--ars-color-overlay, rgba(255, 255, 255, .75))}.drawer-content{padding-top:10px}.drawer .title-container,.drawer-small .title-container{padding:20px 5px 20px 0}.drawer .title-container-with-loader,.drawer-small .title-container-with-loader{padding:14px 5px 20px 0}.drawer .title,.drawer-small .title{font-size:19.2px!important;font-weight:600;padding-left:15px;min-width:150px;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.drawer .accordion-panel,.drawer-small .accordion-panel{background-color:transparent!important}.drawer .accordion-header,.drawer-small .accordion-header{padding-left:10px;padding-right:10px;border-radius:var(--mat-expansion-container-shape)}.drawer .mat-expansion-panel-body,.drawer-small .mat-expansion-panel-body{padding-left:10px!important;padding-right:10px!important;padding-bottom:20px!important}@media screen and (min-width:0px)and (max-width:430px){.drawer,.drawer-small{border-radius:0!important;min-width:100%!important;max-width:100%!important}}@media screen and (min-width:431px){.drawer{min-width:420px!important;max-width:420px!important}.drawer .title{min-width:200px}.drawer .mat-expansion-panel-body{padding-left:15px!important;padding-right:15px!important;padding-bottom:20px!important}.drawer-small{min-width:360px!important;max-width:360px!important}}.drawer-with-loader{padding-top:0!important}.drawer-transparent{background-color:transparent}.fade-in{animation:fadein .5s linear}@keyframes fadein{0%{opacity:0}to{opacity:1}}.bright{filter:brightness(.7)!important}@media(prefers-color-scheme:dark){.dialog-info-green,.dialog-info-ok{color:var(--ars-color-ok, #4CAF50)}.dialog-info-red,.dialog-info-error{color:var(--mat-form-field-error-text-color, #ff5449)}b,.bold{font-weight:600}.bright{filter:brightness(1.5)!important}}.dialog-content{padding:0 24px 24px!important}.details-box{border-top:1px solid var(--ars-color-divider, #757d87)}.details{background-color:var(--ars-item-hover-background-color, #eaecef);border-radius:5px;max-height:350px;padding:8px 12px;overflow:auto}\n"] }]
|
|
271
|
+
args: [{ host: { 'Bind': SystemUtils.generateUUID() }, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatDialogTitle, MatDialogContent, MatDialogClose, FlexModule, MatCheckboxModule, FormsModule,
|
|
272
|
+
MatDialogActions, MatButtonModule, MatFormFieldModule, MatInputModule, SafeHtmlPipe], template: "<h2 mat-dialog-title [innerHTML]=\"dialogData.title | safeHtml\"></h2>\r\n<mat-dialog-content class=\"dialog-content\">\r\n <form name=\"form\" #f=\"ngForm\" novalidate>\r\n <div fxLayout=\"column\" fxLayoutGap=\"24px\" fxFill>\r\n <div fxFlex=\"*\">\r\n @if (dialogData.message) {\r\n <div [innerHtml]=\"dialogData.message | safeHtml\"></div>\r\n }\r\n </div>\r\n @if (dialogData.details) {\r\n <div class=\"details-box\">\r\n <p class=\"x-small uppercase secondary\">Dettaglio:</p>\r\n <div class=\"small details\">\r\n <div [innerHtml]=\"dialogData.details\"></div>\r\n </div>\r\n </div>\r\n }\r\n @if (dialogData.confirmMode === 1) {\r\n <div>\r\n <mat-checkbox (change)=\"confirmed.set($event.checked)\" [checked]=\"confirmed()\">\r\n Confermo la cancellazione\r\n </mat-checkbox>\r\n </div>\r\n } @else if (dialogData.confirmMode === 2) {\r\n <p>Per confermare la cancellazione digita la parola <i><b>elimina</b></i>.</p>\r\n <mat-form-field style=\"width: 200px\" [appearance]=\"dialogData.appearance\">\r\n <mat-label>Conferma</mat-label>\r\n <input matInput #field_confirm=\"ngModel\" [(ngModel)]=\"confirmValue\" name=\"field_confirm\" required \r\n [attr.aria-label]=\"'Digita la parola -elimina-'\">\r\n @if (field_confirm.invalid) {\r\n <mat-error>Digita la parola \"elimina\"</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n <br>\r\n </div>\r\n </form>\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxLayoutAlign=\"end center\" fxFill>\r\n <button mat-flat-button (click)=\"ok()\" \r\n [disabled]=\"f.form.invalid || (confirmValue && confirmValue.toLowerCase() !== 'elimina') || !confirmed()\"\r\n [mat-dialog-close]=\"true\">{{dialogData.okCaption}}</button>\r\n <button mat-stroked-button [mat-dialog-close]=\"true\"\r\n (click)=\"cancel()\">{{dialogData.cancelCaption}}</button>\r\n\r\n </div>\r\n</mat-dialog-actions>", styles: [".dialog-info{font-size:x-small;font-weight:700;text-align:right;padding:10px}.dialog-info-green,.dialog-info-ok{color:var(--ars-color-ok, #388E3C)}.dialog-info-red,.dialog-info-error{color:var(--mat-form-field-error-text-color, #a80710)}.dialog-header{padding-bottom:20px}.dialog-close{margin-right:5px;margin-top:0}.dialog-menu{margin-left:10px;margin-top:10px}.dialog-title{padding:0 24px}.section-title{font-size:large;font-weight:600;padding-top:10px;padding-bottom:8px}.center{text-align:center}.wide{min-width:100%!important;max-width:100%!important;width:100%!important}.fill{min-width:100%!important;max-width:100%!important;width:100%!important;min-height:100%!important;max-height:100%!important;height:100%!important}.scroll-auto{overflow:auto;height:100%}.scroll-hidden{overflow:hidden;height:100%}b{font-weight:700}.large{font-size:large!important}.smaller{font-size:smaller!important}.small{font-size:small!important;line-height:16px!important}.small-icon-button{width:1.5rem!important;height:1.5rem!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center}.small-icon-button .mat-mdc-button-touch-target{width:1.5rem!important;height:1.5rem!important}.x-small{font-size:x-small!important;line-height:14px!important}.bold{font-weight:700}.uppercase{text-transform:uppercase!important}.lowercase{text-transform:lowercase!important}.truncated{min-width:0;max-width:100%}@supports (-webkit-line-clamp: 2){.truncated{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.truncated span,.truncated div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@supports (-webkit-line-clamp: 2){.truncated span,.truncated div{overflow:hidden;text-overflow:ellipsis;white-space:initial;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.clipped{min-width:0;max-width:100%}.clipped span,.clipped div{white-space:nowrap;overflow:hidden;text-overflow:clip}.accent{color:var(--ars-color-accent, #7894ae)!important}.primary{color:var(--ars-color-primary, #00a293)!important}.secondary{color:var(--ars-color-secondary, #4a635f)!important}.error{color:var(--ars-color-error, #ff5449)!important}.success{color:var(--ars-color-ok, #388E3C)!important}.warning{color:var(--ars-color-warning, #FFC107)!important}.text{color:var(--ars-color-text, #191c1b)!important}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;background-color:var(--ars-color-overlay, rgba(255, 255, 255, .75))}.drawer-content{padding-top:10px}.drawer .title-container,.drawer-small .title-container{padding:20px 5px 20px 0}.drawer .title-container-with-loader,.drawer-small .title-container-with-loader{padding:14px 5px 20px 0}.drawer .title,.drawer-small .title{font-size:19.2px!important;font-weight:600;padding-left:15px;min-width:150px;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.drawer .accordion-panel,.drawer-small .accordion-panel{background-color:transparent!important}.drawer .accordion-header,.drawer-small .accordion-header{padding-left:10px;padding-right:10px;border-radius:var(--mat-expansion-container-shape)}.drawer .mat-expansion-panel-body,.drawer-small .mat-expansion-panel-body{padding-left:10px!important;padding-right:10px!important;padding-bottom:20px!important}@media screen and (min-width:0px)and (max-width:430px){.drawer,.drawer-small{border-radius:0!important;min-width:100%!important;max-width:100%!important}}@media screen and (min-width:431px){.drawer{min-width:420px!important;max-width:420px!important}.drawer .title{min-width:200px}.drawer .mat-expansion-panel-body{padding-left:15px!important;padding-right:15px!important;padding-bottom:20px!important}.drawer-small{min-width:360px!important;max-width:360px!important}}.drawer-with-loader{padding-top:0!important}.drawer-transparent{background-color:transparent}.fade-in{animation:fadein .5s linear}@keyframes fadein{0%{opacity:0}to{opacity:1}}.bright{filter:brightness(.7)!important}@media(prefers-color-scheme:dark){.dialog-info-green,.dialog-info-ok{color:var(--ars-color-ok, #4CAF50)}.dialog-info-red,.dialog-info-error{color:var(--mat-form-field-error-text-color, #ff5449)}b,.bold{font-weight:600}.bright{filter:brightness(1.5)!important}}.dialog-content{padding:0 24px 24px!important}.details-box{border-top:1px solid var(--ars-color-divider, #757d87)}.details{background-color:var(--ars-item-hover-background-color, #eaecef);border-radius:5px;max-height:350px;padding:8px 12px;overflow:auto}\n"] }]
|
|
309
273
|
}], propDecorators: { choosen: [{ type: i0.Output, args: ["choosen"] }] } });
|
|
310
274
|
|
|
311
275
|
class BusyTimer {
|
|
312
|
-
constructor(dialogService, due = 100, message =
|
|
276
|
+
constructor(dialogService, due = 100, message = 'Operazione in corso...') {
|
|
313
277
|
this.dialogService = dialogService;
|
|
314
|
-
this.
|
|
278
|
+
this.subscription = timer(due).pipe(tap(() => this.dialogService.busy(message))).subscribe();
|
|
315
279
|
}
|
|
316
|
-
/**
|
|
317
|
-
* Dispose object
|
|
318
|
-
*/
|
|
280
|
+
/** Dispose object */
|
|
319
281
|
clear() {
|
|
320
|
-
this.
|
|
282
|
+
this.subscription.unsubscribe();
|
|
321
283
|
this.dialogService.clearBusy();
|
|
322
284
|
}
|
|
323
285
|
}
|
|
@@ -336,14 +298,15 @@ class DialogService extends UIService {
|
|
|
336
298
|
if (!this.poppingState) {
|
|
337
299
|
const count = this.dialog.openDialogs.length;
|
|
338
300
|
if (count > 0) {
|
|
339
|
-
// Disable pop
|
|
301
|
+
// Disable pop state if needed
|
|
340
302
|
this.popState = false;
|
|
341
303
|
// Close dialog
|
|
342
304
|
this.dialog.openDialogs[count - 1].close();
|
|
343
305
|
}
|
|
344
306
|
}
|
|
345
|
-
else
|
|
307
|
+
else {
|
|
346
308
|
this.poppingState = false;
|
|
309
|
+
}
|
|
347
310
|
});
|
|
348
311
|
}
|
|
349
312
|
/**
|
|
@@ -364,15 +327,13 @@ class DialogService extends UIService {
|
|
|
364
327
|
* Close all dialogs
|
|
365
328
|
*/
|
|
366
329
|
closeAll() {
|
|
367
|
-
this.dialog.
|
|
368
|
-
n.close();
|
|
369
|
-
});
|
|
330
|
+
this.dialog.closeAll();
|
|
370
331
|
}
|
|
371
332
|
/**
|
|
372
333
|
* Open a dialog
|
|
373
334
|
* @param component : the component
|
|
374
335
|
* @param config : the config
|
|
375
|
-
* @returns
|
|
336
|
+
* @returns the dialog object, or null when not running in a browser
|
|
376
337
|
*/
|
|
377
338
|
open(component, config) {
|
|
378
339
|
if (!SystemUtils.isBrowser())
|
|
@@ -381,22 +342,18 @@ class DialogService extends UIService {
|
|
|
381
342
|
return this.openDialog(component, config);
|
|
382
343
|
}
|
|
383
344
|
/**
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
345
|
+
* Open a dialog
|
|
346
|
+
* @param component : the component
|
|
347
|
+
* @param config : the config
|
|
348
|
+
* @returns the dialog object
|
|
349
|
+
*/
|
|
389
350
|
openDialog(component, config) {
|
|
390
351
|
// We will take care of navigation
|
|
391
352
|
config.closeOnNavigation = false;
|
|
392
|
-
|
|
393
|
-
d.afterOpened().subscribe(() =>
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
d.beforeClosed().subscribe(() => {
|
|
397
|
-
this.popDialog(d.id);
|
|
398
|
-
});
|
|
399
|
-
d.afterClosed().subscribe(() => {
|
|
353
|
+
const d = this.dialog.open(component, config);
|
|
354
|
+
d.afterOpened().pipe(first()).subscribe(() => this.pushDialog(d.id));
|
|
355
|
+
d.beforeClosed().pipe(first()).subscribe(() => this.popDialog(d.id));
|
|
356
|
+
d.afterClosed().pipe(first()).subscribe(() => {
|
|
400
357
|
// Final cleanup of middle objects
|
|
401
358
|
this.errorDialogRef = undefined;
|
|
402
359
|
});
|
|
@@ -410,11 +367,11 @@ class DialogService extends UIService {
|
|
|
410
367
|
outerHeight(element) {
|
|
411
368
|
if (!SystemUtils.isBrowser())
|
|
412
369
|
return 0;
|
|
413
|
-
const height = element.offsetHeight
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
.
|
|
417
|
-
|
|
370
|
+
const height = element.offsetHeight;
|
|
371
|
+
const style = window.getComputedStyle(element);
|
|
372
|
+
return ['top', 'bottom']
|
|
373
|
+
.map(side => parseInt(style.getPropertyValue(`margin-${side}`), 10))
|
|
374
|
+
.reduce((total, margin) => total + margin, height);
|
|
418
375
|
}
|
|
419
376
|
/**
|
|
420
377
|
* Return current dialog height
|
|
@@ -437,10 +394,7 @@ class DialogService extends UIService {
|
|
|
437
394
|
getCurrentDialogScrollableHeight(fixedPartsClassName, minimalHeight) {
|
|
438
395
|
if (!SystemUtils.isBrowser())
|
|
439
396
|
return 0;
|
|
440
|
-
let h = this.getCurrentDialogHeight();
|
|
441
|
-
if (h < minimalHeight) {
|
|
442
|
-
h = minimalHeight;
|
|
443
|
-
}
|
|
397
|
+
let h = Math.max(this.getCurrentDialogHeight(), minimalHeight);
|
|
444
398
|
if (fixedPartsClassName) {
|
|
445
399
|
fixedPartsClassName.forEach(n => {
|
|
446
400
|
const elems = document.getElementsByClassName(n);
|
|
@@ -454,14 +408,14 @@ class DialogService extends UIService {
|
|
|
454
408
|
return h;
|
|
455
409
|
}
|
|
456
410
|
/**
|
|
457
|
-
* Push a dialog
|
|
411
|
+
* Push a dialog into the browser history
|
|
458
412
|
*/
|
|
459
413
|
pushDialog(id) {
|
|
460
414
|
if (!SystemUtils.isBrowser())
|
|
461
415
|
return;
|
|
462
|
-
|
|
463
|
-
history.pushState({ index
|
|
464
|
-
this.popHistory.push({ id
|
|
416
|
+
const index = history.length;
|
|
417
|
+
history.pushState({ index }, '', location.href + '#');
|
|
418
|
+
this.popHistory.push({ id, value: index });
|
|
465
419
|
}
|
|
466
420
|
/**
|
|
467
421
|
* Pop a dialog from the history
|
|
@@ -473,13 +427,10 @@ class DialogService extends UIService {
|
|
|
473
427
|
this.poppingState = true;
|
|
474
428
|
let popped = 1;
|
|
475
429
|
if (id) {
|
|
476
|
-
const p = this.popHistory.findIndex(
|
|
477
|
-
if (p
|
|
430
|
+
const p = this.popHistory.findIndex(n => n.id === id);
|
|
431
|
+
if (p !== -1) {
|
|
478
432
|
popped = this.popHistory[p].value - (history.state?.index ?? 0);
|
|
479
|
-
|
|
480
|
-
popped++;
|
|
481
|
-
else
|
|
482
|
-
popped = 1;
|
|
433
|
+
popped = popped ? popped + 1 : 1;
|
|
483
434
|
this.popHistory.splice(p, 1);
|
|
484
435
|
}
|
|
485
436
|
const url = location.href;
|
|
@@ -570,30 +521,30 @@ class DialogService extends UIService {
|
|
|
570
521
|
return new BusyTimer(this, due, message);
|
|
571
522
|
}
|
|
572
523
|
/**
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
524
|
+
* Display a busy indeterminate dialog as hourglass
|
|
525
|
+
* @param message : new message
|
|
526
|
+
* @param action : action to do during the execution (optional)
|
|
527
|
+
* @returns true if a new popup has been opened
|
|
528
|
+
*/
|
|
578
529
|
busyHourglass(message, action) {
|
|
579
530
|
return this.setBusy(message, undefined, undefined, 'hourglass', action);
|
|
580
531
|
}
|
|
581
532
|
/**
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
533
|
+
* Display a busy spinner dialog
|
|
534
|
+
* @param message : new message
|
|
535
|
+
* @param progress : new progress
|
|
536
|
+
* @param progressMode : new mode (default = 'indeterminate')
|
|
537
|
+
* @param action : action to do during the execution (optional)
|
|
538
|
+
* @returns true if a new popup has been opened
|
|
539
|
+
*/
|
|
589
540
|
busySpinner(message, progress = -1, progressMode = 'indeterminate', action) {
|
|
590
541
|
return this.setBusy(message, progress, progressMode, 'spinner', action);
|
|
591
542
|
}
|
|
592
543
|
/**
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
544
|
+
* Display a wait spinner
|
|
545
|
+
* @param action : action to do during the execution (optional)
|
|
546
|
+
* @returns true if a new popup has been opened
|
|
547
|
+
*/
|
|
597
548
|
wait(action) {
|
|
598
549
|
return this.setBusy(undefined, undefined, undefined, 'wait', action);
|
|
599
550
|
}
|
|
@@ -614,17 +565,17 @@ class DialogService extends UIService {
|
|
|
614
565
|
autoFocus: true,
|
|
615
566
|
restoreFocus: false,
|
|
616
567
|
data: {
|
|
617
|
-
message
|
|
618
|
-
title
|
|
619
|
-
okCaption
|
|
620
|
-
dismissAfter
|
|
621
|
-
details
|
|
622
|
-
onNavigate
|
|
568
|
+
message,
|
|
569
|
+
title,
|
|
570
|
+
okCaption,
|
|
571
|
+
dismissAfter,
|
|
572
|
+
details,
|
|
573
|
+
onNavigate,
|
|
623
574
|
appearance: 'fill'
|
|
624
575
|
},
|
|
625
576
|
closeOnNavigation: false,
|
|
626
577
|
minWidth: '375px',
|
|
627
|
-
maxWidth: width
|
|
578
|
+
maxWidth: `${width}px`,
|
|
628
579
|
width: '100%'
|
|
629
580
|
});
|
|
630
581
|
}
|
|
@@ -642,11 +593,11 @@ class DialogService extends UIService {
|
|
|
642
593
|
if (this.errorDialogRef) {
|
|
643
594
|
// Just change current error
|
|
644
595
|
this.errorDialogRef.componentInstance.setData({
|
|
645
|
-
message
|
|
646
|
-
title
|
|
596
|
+
message,
|
|
597
|
+
title,
|
|
647
598
|
details: log,
|
|
648
|
-
okCaption
|
|
649
|
-
dismissAfter
|
|
599
|
+
okCaption,
|
|
600
|
+
dismissAfter
|
|
650
601
|
});
|
|
651
602
|
return this.errorDialogRef;
|
|
652
603
|
}
|
|
@@ -655,16 +606,16 @@ class DialogService extends UIService {
|
|
|
655
606
|
autoFocus: true,
|
|
656
607
|
restoreFocus: false,
|
|
657
608
|
data: {
|
|
658
|
-
message
|
|
659
|
-
title
|
|
609
|
+
message,
|
|
610
|
+
title,
|
|
660
611
|
details: log,
|
|
661
|
-
okCaption
|
|
662
|
-
dismissAfter
|
|
612
|
+
okCaption,
|
|
613
|
+
dismissAfter,
|
|
663
614
|
appearance: 'fill'
|
|
664
615
|
},
|
|
665
616
|
closeOnNavigation: false,
|
|
666
617
|
minWidth: '375px',
|
|
667
|
-
maxWidth: width
|
|
618
|
+
maxWidth: `${width}px`,
|
|
668
619
|
width: '100%'
|
|
669
620
|
});
|
|
670
621
|
return this.errorDialogRef;
|
|
@@ -680,17 +631,11 @@ class DialogService extends UIService {
|
|
|
680
631
|
this.clearBusy();
|
|
681
632
|
if (duration === -1)
|
|
682
633
|
duration = 2000; // default
|
|
683
|
-
|
|
684
|
-
duration
|
|
685
|
-
data: {
|
|
686
|
-
message: message,
|
|
687
|
-
icon: icon,
|
|
688
|
-
actionCaption: actionCaption
|
|
689
|
-
}
|
|
690
|
-
});
|
|
691
|
-
toastRef.instance.action.subscribe(() => {
|
|
692
|
-
toastRef.dismiss();
|
|
634
|
+
const toastRef = this.snackBar.openFromComponent(ToastComponent, {
|
|
635
|
+
duration,
|
|
636
|
+
data: { message, icon, actionCaption }
|
|
693
637
|
});
|
|
638
|
+
toastRef.instance.action.subscribe(() => toastRef.dismiss());
|
|
694
639
|
return toastRef;
|
|
695
640
|
}
|
|
696
641
|
/**
|
|
@@ -702,6 +647,7 @@ class DialogService extends UIService {
|
|
|
702
647
|
* @param otherCaption : other button caption
|
|
703
648
|
* @param options: check box options
|
|
704
649
|
* @param width: the preferred width
|
|
650
|
+
* @param details: optional details
|
|
705
651
|
*/
|
|
706
652
|
confirm(message, title = 'Conferma', okCaption = 'Si', cancelCaption = 'No', otherCaption, options, width = 500, details) {
|
|
707
653
|
return this.open(ConfirmDialogComponent, {
|
|
@@ -709,51 +655,50 @@ class DialogService extends UIService {
|
|
|
709
655
|
autoFocus: true,
|
|
710
656
|
restoreFocus: false,
|
|
711
657
|
data: {
|
|
712
|
-
message
|
|
713
|
-
title
|
|
714
|
-
okCaption
|
|
715
|
-
cancelCaption
|
|
716
|
-
otherCaption
|
|
717
|
-
options
|
|
718
|
-
details
|
|
658
|
+
message,
|
|
659
|
+
title,
|
|
660
|
+
okCaption,
|
|
661
|
+
cancelCaption,
|
|
662
|
+
otherCaption,
|
|
663
|
+
options,
|
|
664
|
+
details,
|
|
719
665
|
appearance: 'fill'
|
|
720
666
|
},
|
|
721
667
|
closeOnNavigation: false,
|
|
722
668
|
disableClose: true,
|
|
723
669
|
minWidth: '375px',
|
|
724
|
-
maxWidth: width
|
|
670
|
+
maxWidth: `${width}px`,
|
|
725
671
|
width: '100%'
|
|
726
672
|
});
|
|
727
673
|
}
|
|
728
674
|
/**
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
*/
|
|
675
|
+
* Display a delete dialog
|
|
676
|
+
* @param message : html message
|
|
677
|
+
* @param title : dialog title
|
|
678
|
+
* @param confirmMode : the confirm mode
|
|
679
|
+
* @param okCaption : ok button caption
|
|
680
|
+
* @param cancelCaption : cancel button caption
|
|
681
|
+
* @param width: the preferred width
|
|
682
|
+
* @param details: optional details
|
|
683
|
+
*/
|
|
739
684
|
delete(message, title = 'Attenzione', confirmMode = DeleteDialogConfirmMode.None, okCaption = 'Si', cancelCaption = 'No', width = 500, details) {
|
|
740
685
|
return this.open(DeleteDialogComponent, {
|
|
741
686
|
ariaLabel: 'attenzione',
|
|
742
687
|
autoFocus: true,
|
|
743
688
|
restoreFocus: false,
|
|
744
689
|
data: {
|
|
745
|
-
message
|
|
746
|
-
title
|
|
747
|
-
confirmMode
|
|
748
|
-
okCaption
|
|
749
|
-
cancelCaption
|
|
750
|
-
details
|
|
690
|
+
message,
|
|
691
|
+
title,
|
|
692
|
+
confirmMode,
|
|
693
|
+
okCaption,
|
|
694
|
+
cancelCaption,
|
|
695
|
+
details,
|
|
751
696
|
appearance: 'fill'
|
|
752
697
|
},
|
|
753
698
|
closeOnNavigation: false,
|
|
754
699
|
disableClose: true,
|
|
755
700
|
minWidth: '375px',
|
|
756
|
-
maxWidth: width
|
|
701
|
+
maxWidth: `${width}px`,
|
|
757
702
|
width: '100%'
|
|
758
703
|
});
|
|
759
704
|
}
|
|
@@ -781,52 +726,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
781
726
|
}]
|
|
782
727
|
}] });
|
|
783
728
|
|
|
729
|
+
const DEFAULT_STRENGTH = { score: 0, label: '', color: '', suggestions: [], isValid: false };
|
|
784
730
|
class PasswordStrengthComponent {
|
|
785
731
|
constructor() {
|
|
786
732
|
this.password = input('', ...(ngDevMode ? [{ debugName: "password" }] : []));
|
|
787
|
-
this.strength =
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
color: '',
|
|
791
|
-
suggestions: [],
|
|
792
|
-
isValid: false
|
|
733
|
+
this.strength = computed(() => {
|
|
734
|
+
const pwd = this.password();
|
|
735
|
+
return pwd ? SystemUtils.calculatePasswordStrength(pwd) : DEFAULT_STRENGTH;
|
|
793
736
|
}, ...(ngDevMode ? [{ debugName: "strength" }] : []));
|
|
794
|
-
this.scoreClass =
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
if (strength.score <= 2) {
|
|
807
|
-
this.scoreClass.set("score-2");
|
|
808
|
-
}
|
|
809
|
-
else if (strength.score <= 3) {
|
|
810
|
-
this.scoreClass.set("score-3");
|
|
811
|
-
}
|
|
812
|
-
else if (strength.score <= 4) {
|
|
813
|
-
this.scoreClass.set("score-4");
|
|
814
|
-
}
|
|
815
|
-
else if (strength.score <= 5) {
|
|
816
|
-
this.scoreClass.set("score-5");
|
|
817
|
-
}
|
|
818
|
-
else {
|
|
819
|
-
this.scoreClass.set("score-6");
|
|
820
|
-
}
|
|
821
|
-
}
|
|
737
|
+
this.scoreClass = computed(() => {
|
|
738
|
+
const score = this.strength().score;
|
|
739
|
+
if (score <= 2)
|
|
740
|
+
return 'score-2';
|
|
741
|
+
if (score <= 3)
|
|
742
|
+
return 'score-3';
|
|
743
|
+
if (score <= 4)
|
|
744
|
+
return 'score-4';
|
|
745
|
+
if (score <= 5)
|
|
746
|
+
return 'score-5';
|
|
747
|
+
return 'score-6';
|
|
748
|
+
}, ...(ngDevMode ? [{ debugName: "scoreClass" }] : []));
|
|
822
749
|
}
|
|
823
750
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PasswordStrengthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
824
751
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: PasswordStrengthComponent, isStandalone: true, selector: "password-strength", inputs: { password: { classPropertyName: "password", publicName: "password", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"wide x-small bold\" style=\"white-space: nowrap; padding-top:4px\" [matTooltip]=\"strength().suggestions?.join('\\n ')\">\r\n <span [class]=\"scoreClass()\">{{strength().label}}</span>\r\n</div>", styles: [".score-2{color:#f44336!important;font-weight:700}.score-3{color:#ff9800!important;font-weight:700}.score-4{color:#ffc107!important;font-weight:700}.score-5{color:#8bc34a!important;font-weight:700}.score-6{color:#4caf50!important;font-weight:700}.x-small{font-size:x-small}\n"], dependencies: [{ kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
825
752
|
}
|
|
826
753
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PasswordStrengthComponent, decorators: [{
|
|
827
754
|
type: Component,
|
|
828
|
-
args: [{ selector:
|
|
829
|
-
}],
|
|
755
|
+
args: [{ selector: 'password-strength', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatTooltipModule], template: "<div class=\"wide x-small bold\" style=\"white-space: nowrap; padding-top:4px\" [matTooltip]=\"strength().suggestions?.join('\\n ')\">\r\n <span [class]=\"scoreClass()\">{{strength().label}}</span>\r\n</div>", styles: [".score-2{color:#f44336!important;font-weight:700}.score-3{color:#ff9800!important;font-weight:700}.score-4{color:#ffc107!important;font-weight:700}.score-5{color:#8bc34a!important;font-weight:700}.score-6{color:#4caf50!important;font-weight:700}.x-small{font-size:x-small}\n"] }]
|
|
756
|
+
}], propDecorators: { password: [{ type: i0.Input, args: [{ isSignal: true, alias: "password", required: false }] }] } });
|
|
830
757
|
|
|
831
758
|
class OtpInputComponent {
|
|
832
759
|
constructor() {
|
|
@@ -886,12 +813,7 @@ class OtpInputComponent {
|
|
|
886
813
|
digits.forEach((d, i) => (arr[i] = d));
|
|
887
814
|
this.otpArray.set(arr);
|
|
888
815
|
this.updateModel();
|
|
889
|
-
|
|
890
|
-
this.focusField(digits.length);
|
|
891
|
-
}
|
|
892
|
-
else {
|
|
893
|
-
this.focusField(5);
|
|
894
|
-
}
|
|
816
|
+
this.focusField(Math.min(digits.length, 5));
|
|
895
817
|
}
|
|
896
818
|
}
|
|
897
819
|
focusField(index) {
|
|
@@ -932,24 +854,16 @@ class CredentialsDialogComponent {
|
|
|
932
854
|
this.done = output();
|
|
933
855
|
this.recoveringPassword = output();
|
|
934
856
|
this.changeDetector = inject(ChangeDetectorRef);
|
|
935
|
-
this.dialogData = inject(MAT_DIALOG_DATA)
|
|
857
|
+
this.dialogData = inject(MAT_DIALOG_DATA) ?? { mode: 'email', appearance: 'fill', title: 'Credenziali', okCaption: 'Salva' };
|
|
936
858
|
this.item = {};
|
|
937
859
|
this.showPassword = false;
|
|
938
860
|
}
|
|
939
861
|
ngOnInit() {
|
|
940
862
|
if (this.dialogData) {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
this.dialogData.title = "Informazioni";
|
|
946
|
-
}
|
|
947
|
-
if (!this.dialogData.okCaption) {
|
|
948
|
-
this.dialogData.okCaption = "Salva";
|
|
949
|
-
}
|
|
950
|
-
if (!this.dialogData.mode) {
|
|
951
|
-
this.dialogData.mode = 'email';
|
|
952
|
-
}
|
|
863
|
+
this.dialogData.appearance ??= 'fill';
|
|
864
|
+
this.dialogData.title ??= 'Informazioni';
|
|
865
|
+
this.dialogData.okCaption ??= 'Salva';
|
|
866
|
+
this.dialogData.mode ??= 'email';
|
|
953
867
|
if (this.dialogData.mode === 'otp' && !this.dialogData.message) {
|
|
954
868
|
this.dialogData.message = '<div class="small">Inserisci il codice di verifica di 6 cifre che ti abbiamo inviato ora per email<br><span class="x-small">(controlla anche la posta indesiderata)</span>.</div>';
|
|
955
869
|
}
|
|
@@ -970,15 +884,11 @@ class CredentialsDialogComponent {
|
|
|
970
884
|
}
|
|
971
885
|
this.changeDetector.markForCheck();
|
|
972
886
|
}
|
|
973
|
-
/**
|
|
974
|
-
* Done
|
|
975
|
-
*/
|
|
887
|
+
/** Done */
|
|
976
888
|
ok() {
|
|
977
889
|
this.done.emit(this.item);
|
|
978
890
|
}
|
|
979
|
-
/**
|
|
980
|
-
* Recover password
|
|
981
|
-
*/
|
|
891
|
+
/** Recover password */
|
|
982
892
|
recoverPassword() {
|
|
983
893
|
this.recoveringPassword.emit(this.item);
|
|
984
894
|
if (this.dialogData.recoverPasswordUrl) {
|
|
@@ -1011,15 +921,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
1011
921
|
class RecoverPasswordDialogComponent {
|
|
1012
922
|
constructor() {
|
|
1013
923
|
this.done = output();
|
|
1014
|
-
this.dialogData = inject(MAT_DIALOG_DATA)
|
|
924
|
+
this.dialogData = inject(MAT_DIALOG_DATA) ?? { appearance: 'fill' };
|
|
1015
925
|
this.item = {
|
|
1016
|
-
email:
|
|
926
|
+
email: '',
|
|
1017
927
|
recaptcha: false
|
|
1018
928
|
};
|
|
1019
929
|
}
|
|
1020
|
-
/**
|
|
1021
|
-
* Done
|
|
1022
|
-
*/
|
|
930
|
+
/** Done */
|
|
1023
931
|
ok() {
|
|
1024
932
|
this.done.emit(this.item);
|
|
1025
933
|
}
|
|
@@ -1046,7 +954,7 @@ class ResetPasswordDialogComponent {
|
|
|
1046
954
|
this.done = output();
|
|
1047
955
|
this.dialogService = inject(DialogService);
|
|
1048
956
|
this.dialogRef = inject((MatDialogRef));
|
|
1049
|
-
this.dialogData = inject(MAT_DIALOG_DATA)
|
|
957
|
+
this.dialogData = inject(MAT_DIALOG_DATA) ?? { mode: 1, appearance: 'fill' };
|
|
1050
958
|
this.item = {};
|
|
1051
959
|
this.showOldPassword = false;
|
|
1052
960
|
this.showPassword = false;
|
|
@@ -1059,34 +967,30 @@ class ResetPasswordDialogComponent {
|
|
|
1059
967
|
}
|
|
1060
968
|
if (this.dialogData.mode <= 2 && !this.dialogData.userId) {
|
|
1061
969
|
this.dialogRef.close();
|
|
1062
|
-
this.dialogService.error(
|
|
970
|
+
this.dialogService.error('Utente non specificato.');
|
|
1063
971
|
return;
|
|
1064
972
|
}
|
|
1065
973
|
else if (this.dialogData.mode === 3 && !this.dialogData.userEmail) {
|
|
1066
974
|
this.dialogRef.close();
|
|
1067
|
-
this.dialogService.error(
|
|
975
|
+
this.dialogService.error('Email utente non specificata.');
|
|
1068
976
|
return;
|
|
1069
977
|
}
|
|
1070
978
|
this.item.userEmail = this.dialogData.userEmail;
|
|
1071
979
|
this.item.userId = this.dialogData.userId;
|
|
1072
980
|
}
|
|
1073
981
|
else {
|
|
1074
|
-
this.dialogService.error(
|
|
982
|
+
this.dialogService.error('Modalità non riconosciuta.');
|
|
1075
983
|
this.dialogRef.close();
|
|
1076
984
|
return;
|
|
1077
985
|
}
|
|
1078
986
|
}
|
|
1079
|
-
/**
|
|
1080
|
-
* Done
|
|
1081
|
-
*/
|
|
987
|
+
/** Done */
|
|
1082
988
|
ok() {
|
|
1083
989
|
this.done.emit(this.item);
|
|
1084
990
|
}
|
|
1085
|
-
/**
|
|
1086
|
-
* Generate a password
|
|
1087
|
-
*/
|
|
991
|
+
/** Generate a password */
|
|
1088
992
|
generatePassword() {
|
|
1089
|
-
|
|
993
|
+
const password = SystemUtils.generatePassword();
|
|
1090
994
|
this.item.password = password;
|
|
1091
995
|
this.item.password2 = password;
|
|
1092
996
|
}
|