itc-components-library20 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3622 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, EventEmitter, Output, Input, inject, ViewChild, HostListener, InjectionToken, Inject, Injectable } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i2 from '@fortawesome/angular-fontawesome';
6
+ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
7
+ import { Router } from '@angular/router';
8
+ import * as fas from '@fortawesome/free-solid-svg-icons';
9
+ import { faCircle, faStroopwafel, faChevronLeft, faChevronRight, faCirclePlus, faCircleCheck } from '@fortawesome/free-solid-svg-icons';
10
+ import * as i3 from 'primeng/table';
11
+ import { TableModule } from 'primeng/table';
12
+ import * as i4 from 'primeng/api';
13
+ import { FormsModule } from '@angular/forms';
14
+ import * as i4$1 from 'primeng/dialog';
15
+ import { DialogModule } from 'primeng/dialog';
16
+ import * as i5 from 'primeng/tabs';
17
+ import { TabsModule } from 'primeng/tabs';
18
+ import * as i1$1 from 'primeng/config';
19
+ import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
20
+ import * as AWS from 'aws-sdk';
21
+
22
+ class ItcLibrary20 {
23
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ItcLibrary20, deps: [], target: i0.ɵɵFactoryTarget.Component });
24
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: ItcLibrary20, isStandalone: true, selector: "lib-itc-library20", ngImport: i0, template: `
25
+ <p>
26
+ itc-library20 works!
27
+ </p>
28
+ `, isInline: true, styles: [""] });
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ItcLibrary20, decorators: [{
31
+ type: Component,
32
+ args: [{ selector: 'lib-itc-library20', imports: [], template: `
33
+ <p>
34
+ itc-library20 works!
35
+ </p>
36
+ ` }]
37
+ }] });
38
+
39
+ class PrimaryButton {
40
+ text = 'Primary Button';
41
+ bgColor = 'black';
42
+ isNegative = false; //controllare se è un bottone negative o meno
43
+ icon;
44
+ position = 'left';
45
+ fontWeight = 'normal';
46
+ textColor = 'white';
47
+ border = '1px solid black';
48
+ borderRadius = '5px';
49
+ onClick = new EventEmitter(); // Evento di click per il genitore
50
+ // La funzione onClick emette l'evento cliccato al genitore
51
+ click() {
52
+ this.onClick.emit(); // Emette l'evento al genitore
53
+ }
54
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: PrimaryButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
55
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: PrimaryButton, isStandalone: true, selector: "lib-primary-button", inputs: { text: "text", bgColor: "bgColor", isNegative: "isNegative", icon: "icon", position: "position", fontWeight: "fontWeight", textColor: "textColor", border: "border", borderRadius: "borderRadius" }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<button \r\n [ngClass]=\"{\r\n 'active': !isNegative,\r\n 'inactive': isNegative,\r\n }\"\r\n [ngStyle]=\"{\r\n 'background-color': isNegative ? 'transparent' : bgColor,\r\n 'font-weight': fontWeight,\r\n 'color': textColor,\r\n 'border': border,\r\n 'border-radius': borderRadius\r\n }\"\r\n (click)=\"click()\"\r\n>\r\n @if(position === 'left' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-right: 10px;\"></fa-icon>\r\n }\r\n {{ text }}\r\n @if(position === 'right' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-left: 10px;\"></fa-icon>\r\n }\r\n</button>\r\n", styles: ["button{display:flex;justify-content:center;align-items:center;min-width:210px;height:60px;padding:10px 20px;font-size:20px;border:none;border-radius:5px;cursor:pointer;transition:background-color .3s ease;line-height:1}button.active{background-color:var(--primary-color);color:#fff}button.inactive{background-color:transparent;color:var(--primary-color);border:1px solid var(--primary-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i2.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"] }] });
56
+ }
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: PrimaryButton, decorators: [{
58
+ type: Component,
59
+ args: [{ selector: 'lib-primary-button', imports: [CommonModule, FontAwesomeModule], template: "<button \r\n [ngClass]=\"{\r\n 'active': !isNegative,\r\n 'inactive': isNegative,\r\n }\"\r\n [ngStyle]=\"{\r\n 'background-color': isNegative ? 'transparent' : bgColor,\r\n 'font-weight': fontWeight,\r\n 'color': textColor,\r\n 'border': border,\r\n 'border-radius': borderRadius\r\n }\"\r\n (click)=\"click()\"\r\n>\r\n @if(position === 'left' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-right: 10px;\"></fa-icon>\r\n }\r\n {{ text }}\r\n @if(position === 'right' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-left: 10px;\"></fa-icon>\r\n }\r\n</button>\r\n", styles: ["button{display:flex;justify-content:center;align-items:center;min-width:210px;height:60px;padding:10px 20px;font-size:20px;border:none;border-radius:5px;cursor:pointer;transition:background-color .3s ease;line-height:1}button.active{background-color:var(--primary-color);color:#fff}button.inactive{background-color:transparent;color:var(--primary-color);border:1px solid var(--primary-color)}\n"] }]
60
+ }], propDecorators: { text: [{
61
+ type: Input
62
+ }], bgColor: [{
63
+ type: Input
64
+ }], isNegative: [{
65
+ type: Input
66
+ }], icon: [{
67
+ type: Input
68
+ }], position: [{
69
+ type: Input
70
+ }], fontWeight: [{
71
+ type: Input
72
+ }], textColor: [{
73
+ type: Input
74
+ }], border: [{
75
+ type: Input
76
+ }], borderRadius: [{
77
+ type: Input
78
+ }], onClick: [{
79
+ type: Output
80
+ }] } });
81
+
82
+ class SecondaryButton {
83
+ text = 'secondary button';
84
+ bgColor = 'black';
85
+ textColor = 'white';
86
+ icon;
87
+ position = 'left';
88
+ fontWeight = 'normal';
89
+ borderRadius = '5px';
90
+ border = '';
91
+ onClick = new EventEmitter(); // Evento di click per il genitore
92
+ // La funzione onClick emette l'evento cliccato al genitore
93
+ click() {
94
+ this.onClick.emit(); // Emette l'evento al genitore
95
+ }
96
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SecondaryButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
97
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: SecondaryButton, isStandalone: true, selector: "lib-secondary-button", inputs: { text: "text", bgColor: "bgColor", textColor: "textColor", icon: "icon", position: "position", fontWeight: "fontWeight", borderRadius: "borderRadius", border: "border" }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<button\r\n [ngStyle]=\"{\r\n 'background-color': bgColor,\r\n 'color': textColor,\r\n 'font-weight': fontWeight,\r\n 'border-radius': borderRadius,\r\n 'border': border\r\n }\"\r\n (click)=\"click()\"\r\n>\r\n @if(position === 'left' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-right: 10px;\"></fa-icon>\r\n }\r\n {{ text }}\r\n @if(position === 'right' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-left: 10px;\"></fa-icon>\r\n }\r\n</button>", styles: ["button{display:flex;justify-content:center;align-items:center;min-width:210px;height:35px;padding:10px 20px;font-size:17px;border:none;border-radius:5px;cursor:pointer;transition:background-color .3s ease;line-height:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i2.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"] }] });
98
+ }
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SecondaryButton, decorators: [{
100
+ type: Component,
101
+ args: [{ selector: 'lib-secondary-button', imports: [CommonModule, FontAwesomeModule], template: "<button\r\n [ngStyle]=\"{\r\n 'background-color': bgColor,\r\n 'color': textColor,\r\n 'font-weight': fontWeight,\r\n 'border-radius': borderRadius,\r\n 'border': border\r\n }\"\r\n (click)=\"click()\"\r\n>\r\n @if(position === 'left' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-right: 10px;\"></fa-icon>\r\n }\r\n {{ text }}\r\n @if(position === 'right' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-left: 10px;\"></fa-icon>\r\n }\r\n</button>", styles: ["button{display:flex;justify-content:center;align-items:center;min-width:210px;height:35px;padding:10px 20px;font-size:17px;border:none;border-radius:5px;cursor:pointer;transition:background-color .3s ease;line-height:1}\n"] }]
102
+ }], propDecorators: { text: [{
103
+ type: Input
104
+ }], bgColor: [{
105
+ type: Input
106
+ }], textColor: [{
107
+ type: Input
108
+ }], icon: [{
109
+ type: Input
110
+ }], position: [{
111
+ type: Input
112
+ }], fontWeight: [{
113
+ type: Input
114
+ }], borderRadius: [{
115
+ type: Input
116
+ }], border: [{
117
+ type: Input
118
+ }], onClick: [{
119
+ type: Output
120
+ }] } });
121
+
122
+ class ThirdButton {
123
+ text = 'secondary button';
124
+ bgColor = 'black';
125
+ textColor = 'white';
126
+ icon;
127
+ position = 'left';
128
+ fontWeight = 'normal';
129
+ width = '110px';
130
+ height = '35px';
131
+ borderRadius = '5px';
132
+ border = '';
133
+ disabled = false;
134
+ iconSpin = false;
135
+ fontSize = '17px';
136
+ onClick = new EventEmitter(); // Evento di click per il genitore
137
+ // La funzione onClick emette l'evento cliccato al genitore
138
+ click() {
139
+ if (!this.disabled) {
140
+ this.onClick.emit(); // Emette l'evento al genitore
141
+ }
142
+ }
143
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ThirdButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
144
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: ThirdButton, isStandalone: true, selector: "lib-third-button", inputs: { text: "text", bgColor: "bgColor", textColor: "textColor", icon: "icon", position: "position", fontWeight: "fontWeight", width: "width", height: "height", borderRadius: "borderRadius", border: "border", disabled: "disabled", iconSpin: "iconSpin", fontSize: "fontSize" }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<button\r\n [ngStyle]=\"{\r\n 'background-color': bgColor,\r\n 'color': textColor,\r\n 'font-weight': fontWeight,\r\n 'width': width,\r\n 'height': height,\r\n 'border-radius': borderRadius,\r\n 'border': border,\r\n 'font-size': fontSize\r\n }\"\r\n [disabled]=\"disabled\"\r\n (click)=\"click()\"\r\n>\r\n @if(position === 'left' && icon) {\r\n <fa-icon [icon]=\"icon\" [ngClass]=\"{'fa-spin': iconSpin}\" style=\"margin-right: 10px;\"></fa-icon>\r\n }\r\n {{ text }}\r\n @if(position === 'right' && icon) {\r\n <fa-icon [icon]=\"icon\" [ngClass]=\"{'fa-spin': iconSpin}\" style=\"margin-left: 10px;\"></fa-icon>\r\n }\r\n</button>", styles: ["button{display:flex;justify-content:center;align-items:center;min-width:110px;height:35px;padding:10px 20px;font-size:17px;border:none;border-radius:5px;cursor:pointer;transition:all .3s ease;line-height:1}button:disabled{opacity:.7;cursor:not-allowed;pointer-events:none}button:not(:disabled):hover{filter:brightness(1.05);box-shadow:0 2px 5px #0000001a}button:not(:disabled):active{transform:scale(.98)}.fa-spin{animation:fa-spin 1s infinite linear}@keyframes fa-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i2.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"] }] });
145
+ }
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ThirdButton, decorators: [{
147
+ type: Component,
148
+ args: [{ selector: 'lib-third-button', imports: [CommonModule, FontAwesomeModule], template: "<button\r\n [ngStyle]=\"{\r\n 'background-color': bgColor,\r\n 'color': textColor,\r\n 'font-weight': fontWeight,\r\n 'width': width,\r\n 'height': height,\r\n 'border-radius': borderRadius,\r\n 'border': border,\r\n 'font-size': fontSize\r\n }\"\r\n [disabled]=\"disabled\"\r\n (click)=\"click()\"\r\n>\r\n @if(position === 'left' && icon) {\r\n <fa-icon [icon]=\"icon\" [ngClass]=\"{'fa-spin': iconSpin}\" style=\"margin-right: 10px;\"></fa-icon>\r\n }\r\n {{ text }}\r\n @if(position === 'right' && icon) {\r\n <fa-icon [icon]=\"icon\" [ngClass]=\"{'fa-spin': iconSpin}\" style=\"margin-left: 10px;\"></fa-icon>\r\n }\r\n</button>", styles: ["button{display:flex;justify-content:center;align-items:center;min-width:110px;height:35px;padding:10px 20px;font-size:17px;border:none;border-radius:5px;cursor:pointer;transition:all .3s ease;line-height:1}button:disabled{opacity:.7;cursor:not-allowed;pointer-events:none}button:not(:disabled):hover{filter:brightness(1.05);box-shadow:0 2px 5px #0000001a}button:not(:disabled):active{transform:scale(.98)}.fa-spin{animation:fa-spin 1s infinite linear}@keyframes fa-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
149
+ }], propDecorators: { text: [{
150
+ type: Input
151
+ }], bgColor: [{
152
+ type: Input
153
+ }], textColor: [{
154
+ type: Input
155
+ }], icon: [{
156
+ type: Input
157
+ }], position: [{
158
+ type: Input
159
+ }], fontWeight: [{
160
+ type: Input
161
+ }], width: [{
162
+ type: Input
163
+ }], height: [{
164
+ type: Input
165
+ }], borderRadius: [{
166
+ type: Input
167
+ }], border: [{
168
+ type: Input
169
+ }], disabled: [{
170
+ type: Input
171
+ }], iconSpin: [{
172
+ type: Input
173
+ }], fontSize: [{
174
+ type: Input
175
+ }], onClick: [{
176
+ type: Output
177
+ }] } });
178
+
179
+ class BasicTable {
180
+ router = inject(Router);
181
+ columns = [];
182
+ data = [];
183
+ rows = 1;
184
+ detailRoute = ''; // Route di default
185
+ actions = {}; //azioni per le icone
186
+ first = 0;
187
+ faCircle = faCircle;
188
+ faStroopwafel = faStroopwafel;
189
+ isDateColumn(value) {
190
+ return value instanceof Date && !isNaN(value.getTime());
191
+ }
192
+ // Funzione per verificare se una colonna contiene un'icona
193
+ isIconColumn(columnField) {
194
+ const iconCheck = (value) => {
195
+ if (typeof value === 'string' && /^fa[A-Z]/.test(value))
196
+ return true; //classi css
197
+ if (typeof value === 'object' && value?.iconName)
198
+ return true; //oggetto IconDefinition
199
+ if (typeof value === 'string' && /<i.*class=".*fa.*".*>.*<\/i>/i.test(value))
200
+ return true; //html grezzo
201
+ return false;
202
+ };
203
+ return this.data.some(row => iconCheck(row[columnField]));
204
+ }
205
+ //andare alla pagina specifica del dettaglio salvando l'id nel sessionStorage
206
+ navigateRoute(id) {
207
+ if (id === undefined || id === null) {
208
+ console.error('ID non valido:', id);
209
+ return; // Non fare nulla se l'ID non è valido
210
+ }
211
+ console.log(id);
212
+ sessionStorage.setItem('id', id.toString());
213
+ this.router.navigate([this.detailRoute]);
214
+ }
215
+ pageChange(event) {
216
+ this.first = event.first;
217
+ this.rows = event.rows;
218
+ // console.log(this.first + ', ' + this.rows)
219
+ }
220
+ get tableData() {
221
+ const rowsPerPage = this.rows + this.first;
222
+ const emptyRowsCount = rowsPerPage - this.data.length; // Calcola il numero di righe vuote
223
+ // console.log('Rows Per Page:', rowsPerPage); // Log per vedere il valore di rows
224
+ // console.log('Data Length:', this.data.length); // Log per vedere il numero di righe in data
225
+ // console.log('Empty Rows Count:', emptyRowsCount); // Log per vedere quante righe vuote vengono calcolate
226
+ const emptyRows = Array.from({ length: emptyRowsCount }, () => this.columns.reduce((acc, col) => {
227
+ // Se la colonna è quella per l'icona (ad esempio, 'detail'), assegna un'icona di fallback
228
+ if (this.isIconColumn(col.field)) {
229
+ acc[col.field] = this.faStroopwafel; // Fallback con un'icona vuota o di default
230
+ }
231
+ else {
232
+ acc[col.field] = null; // Altrimenti, metti null per le altre colonne
233
+ }
234
+ return acc;
235
+ }, {}));
236
+ // console.log('Empty Rows:', emptyRows); // Log per vedere le righe vuote generate
237
+ // Combina i dati esistenti con le righe vuote
238
+ return [...this.data, ...emptyRows];
239
+ }
240
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: BasicTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
241
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: BasicTable, isStandalone: true, selector: "lib-basic-table", inputs: { columns: "columns", data: "data", rows: "rows", detailRoute: "detailRoute", actions: "actions" }, ngImport: i0, template: "<div class=\"card\">\r\n <p-table\r\n [columns]=\"columns\"\r\n [value]=\"tableData\"\r\n [paginator]=\"true\"\r\n [rows]=\"rows\"\r\n [first]=\"first\"\r\n (onPage)=\"pageChange($event)\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for(column of columns; track $index) {\r\n <th class=\"column-header\" [ngStyle]=\"{ 'width': column.width }\">\r\n {{ column.header }}\r\n </th>\r\n }\r\n </tr>\r\n </ng-template>\r\n <ng-template\r\n pTemplate=\"body\" \r\n let-rowData \r\n let-columns=\"columns\"\r\n >\r\n <tr>\r\n @for (column of columns; track $index) {\r\n <td class=\"data-container\">\r\n <!-- Verifica il campo data -->\r\n @if (isDateColumn(rowData[column.field])) {\r\n <ng-container>\r\n {{ rowData[column.field] | date: 'dd/MM/yyyy - HH:mm' }}\r\n </ng-container>\r\n }\r\n <!-- Verifica se il campo della colonna \u00E8 uno di quelli che contiene un'icona -->\r\n @else if (isIconColumn(column.field)) {\r\n <ng-container>\r\n <fa-icon \r\n [icon]=\"rowData[column.field]\"\r\n [ngClass]=\"{ \r\n 'invisible-icon': rowData[column.field] === faStroopwafel, \r\n 'default-style': rowData[column.field] !== faStroopwafel \r\n }\"\r\n (click)=\"actions[column.field] ? actions[column.field](rowData) : null\"\r\n ></fa-icon>\r\n </ng-container>\r\n } @else {\r\n {{ rowData[column.field]?.label || rowData[column.field] }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n</div>", styles: [":host ::ng-deep .card{height:100%;width:100%}:is() p-table{height:100%}.column-header,.data-container{text-align:center;padding:0}.column-header{color:var(--primary-blue-color);font-weight:600;padding:1% 0}.data-container{padding:.1% 0;height:50px}.data-container>.default-style{color:var(--primary-blue-color);font-size:30px}fa-icon{cursor:pointer}.invisible-icon{color:transparent}@media screen and (min-resolution: 1.25dppx){.data-container>.default-style{font-size:25px}}@media only screen and (max-width: 1366px){.column-header{font-size:14px}.data-container{font-size:13px;height:47px}.data-container>.default-style{font-size:25px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i2.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: "ngmodule", type: TableModule }, { kind: "component", type: i3.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i4.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
242
+ }
243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: BasicTable, decorators: [{
244
+ type: Component,
245
+ args: [{ selector: 'lib-basic-table', imports: [CommonModule, FontAwesomeModule, TableModule], template: "<div class=\"card\">\r\n <p-table\r\n [columns]=\"columns\"\r\n [value]=\"tableData\"\r\n [paginator]=\"true\"\r\n [rows]=\"rows\"\r\n [first]=\"first\"\r\n (onPage)=\"pageChange($event)\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for(column of columns; track $index) {\r\n <th class=\"column-header\" [ngStyle]=\"{ 'width': column.width }\">\r\n {{ column.header }}\r\n </th>\r\n }\r\n </tr>\r\n </ng-template>\r\n <ng-template\r\n pTemplate=\"body\" \r\n let-rowData \r\n let-columns=\"columns\"\r\n >\r\n <tr>\r\n @for (column of columns; track $index) {\r\n <td class=\"data-container\">\r\n <!-- Verifica il campo data -->\r\n @if (isDateColumn(rowData[column.field])) {\r\n <ng-container>\r\n {{ rowData[column.field] | date: 'dd/MM/yyyy - HH:mm' }}\r\n </ng-container>\r\n }\r\n <!-- Verifica se il campo della colonna \u00E8 uno di quelli che contiene un'icona -->\r\n @else if (isIconColumn(column.field)) {\r\n <ng-container>\r\n <fa-icon \r\n [icon]=\"rowData[column.field]\"\r\n [ngClass]=\"{ \r\n 'invisible-icon': rowData[column.field] === faStroopwafel, \r\n 'default-style': rowData[column.field] !== faStroopwafel \r\n }\"\r\n (click)=\"actions[column.field] ? actions[column.field](rowData) : null\"\r\n ></fa-icon>\r\n </ng-container>\r\n } @else {\r\n {{ rowData[column.field]?.label || rowData[column.field] }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n</div>", styles: [":host ::ng-deep .card{height:100%;width:100%}:is() p-table{height:100%}.column-header,.data-container{text-align:center;padding:0}.column-header{color:var(--primary-blue-color);font-weight:600;padding:1% 0}.data-container{padding:.1% 0;height:50px}.data-container>.default-style{color:var(--primary-blue-color);font-size:30px}fa-icon{cursor:pointer}.invisible-icon{color:transparent}@media screen and (min-resolution: 1.25dppx){.data-container>.default-style{font-size:25px}}@media only screen and (max-width: 1366px){.column-header{font-size:14px}.data-container{font-size:13px;height:47px}.data-container>.default-style{font-size:25px}}\n"] }]
246
+ }], propDecorators: { columns: [{
247
+ type: Input
248
+ }], data: [{
249
+ type: Input
250
+ }], rows: [{
251
+ type: Input
252
+ }], detailRoute: [{
253
+ type: Input
254
+ }], actions: [{
255
+ type: Input
256
+ }] } });
257
+
258
+ class SortableTable {
259
+ router = inject(Router);
260
+ columns = [];
261
+ data = [];
262
+ rows = 1;
263
+ detailRoute = ''; // Route di default
264
+ actions = {}; //azioni per le icone
265
+ colorPicker = () => 'var(--primary-blue-color)';
266
+ selected = [];
267
+ tableCheckbox = '';
268
+ selectionChange = new EventEmitter();
269
+ // @Output() unselect = new EventEmitter<any[]>();
270
+ resetData = new EventEmitter();
271
+ first = 0;
272
+ faCircle = fas.faCircle;
273
+ faStroopwafel = fas.faStroopwafel;
274
+ faMagnifyingGlass = fas.faMagnifyingGlass;
275
+ selectedData = [];
276
+ isDateColumn(value) {
277
+ return value instanceof Date && !isNaN(value.getTime());
278
+ }
279
+ // Funzione per verificare se una colonna contiene un'icona
280
+ isIconColumn(columnField) {
281
+ if (this.isPriorityColumn(columnField)) {
282
+ return true;
283
+ }
284
+ const iconCheck = (value) => {
285
+ if (typeof value === 'string' && value.includes('fa'))
286
+ return true; //classi css
287
+ if (typeof value === 'object' && value?.iconName)
288
+ return true; //oggetto IconDefinition
289
+ if (typeof value === 'string' && /<i.*class=".*fa.*".*>.*<\/i>/i.test(value))
290
+ return true; //html grezzo
291
+ return false;
292
+ };
293
+ return this.data.some(row => iconCheck(row[columnField]));
294
+ }
295
+ //andare alla pagina specifica del dettaglio salvando l'id nel sessionStorage
296
+ navigateRoute(id) {
297
+ if (id === undefined || id === null) {
298
+ console.error('ID non valido:', id);
299
+ return; // Non fare nulla se l'ID non è valido
300
+ }
301
+ console.log(id);
302
+ sessionStorage.setItem('id', id.toString());
303
+ this.router.navigate([this.detailRoute]);
304
+ }
305
+ pageChange(event) {
306
+ this.first = event.first;
307
+ this.rows = event.rows;
308
+ // console.log(this.first + ', ' + this.rows)
309
+ }
310
+ // get tableData(): any[] {
311
+ // const rowsPerPage = this.rows + this.first;
312
+ // const emptyRowsCount = rowsPerPage - this.data.length; // Calcola il numero di righe vuote
313
+ // // console.log('Rows Per Page:', rowsPerPage); // Log per vedere il valore di rows
314
+ // // console.log('Data Length:', this.data.length); // Log per vedere il numero di righe in data
315
+ // // console.log('Empty Rows Count:', emptyRowsCount); // Log per vedere quante righe vuote vengono calcolate
316
+ // const emptyRows = Array.from({ length: emptyRowsCount }, () =>
317
+ // this.columns.reduce((acc: Record<string, any>, col) => {
318
+ // // Se la colonna è quella per l'icona (ad esempio, 'detail'), assegna un'icona di fallback
319
+ // if (this.isIconColumn(col.field)) {
320
+ // acc[col.field] = this.faStroopwafel; // Fallback con un'icona vuota o di default
321
+ // } else {
322
+ // acc[col.field] = null; // Altrimenti, metti null per le altre colonne
323
+ // }
324
+ // return acc;
325
+ // }, {})
326
+ // );
327
+ // // console.log('Empty Rows:', emptyRows); // Log per vedere le righe vuote generate
328
+ // // Combina i dati esistenti con le righe vuote
329
+ // return [...this.data, ...emptyRows];
330
+ // }
331
+ dt;
332
+ initialValue = [];
333
+ isSorted = null;
334
+ currentSortedField = null;
335
+ ngOnInit() {
336
+ this.initialValue = [...this.data];
337
+ }
338
+ customSort(event) {
339
+ if (this.currentSortedField !== event.field) {
340
+ // Se si clicca su una colonna diversa, resetta lo stato e imposta ascendente
341
+ this.currentSortedField = event.field;
342
+ this.isSorted = true;
343
+ this.sortTableData(event);
344
+ }
345
+ else {
346
+ if (this.isSorted == null || this.isSorted === undefined) {
347
+ this.isSorted = true;
348
+ this.sortTableData(event);
349
+ }
350
+ else if (this.isSorted == true) {
351
+ this.isSorted = false;
352
+ this.sortTableData(event);
353
+ }
354
+ else if (this.isSorted == false) {
355
+ this.isSorted = null;
356
+ this.data = [...this.initialValue];
357
+ this.resetData.emit();
358
+ this.dt.reset();
359
+ }
360
+ }
361
+ }
362
+ sortTableData(event) {
363
+ event.data.sort((data1, data2) => {
364
+ let value1 = data1[event.field];
365
+ let value2 = data2[event.field];
366
+ if (event.field === 'priorityIcon') {
367
+ value1 = data1['priority'];
368
+ value2 = data2['priority'];
369
+ }
370
+ let result = null;
371
+ if (value1 == null && value2 != null)
372
+ result = -1;
373
+ else if (value1 != null && value2 == null)
374
+ result = 1;
375
+ else if (value1 == null && value2 == null)
376
+ result = 0;
377
+ else {
378
+ if (this.isPriorityField(event.field)) {
379
+ result = this.comparePriorities(value1, value2);
380
+ }
381
+ else if (typeof value1 === 'string' && typeof value2 === 'string')
382
+ result = value1.localeCompare(value2);
383
+ else
384
+ result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
385
+ }
386
+ return event.order * result;
387
+ });
388
+ }
389
+ isPriorityField(fieldName) {
390
+ if (fieldName.toLowerCase().includes('priority') || fieldName === 'priorityIcon') {
391
+ return true;
392
+ }
393
+ return false;
394
+ }
395
+ isPriorityColumn(columnField) {
396
+ return columnField === 'priority' && this.data.some(row => row['priorityIcon']);
397
+ }
398
+ comparePriorities(priority1, priority2) {
399
+ const priorityOrder = {
400
+ 'P1': 1,
401
+ 'P2': 2,
402
+ 'P3': 3
403
+ };
404
+ const order1 = priorityOrder[priority1] || 999;
405
+ const order2 = priorityOrder[priority2] || 999;
406
+ return order1 - order2;
407
+ }
408
+ onRowSelect() {
409
+ this.selectionChange.emit(this.selectedData);
410
+ // console.log('onrowselect', this.selectedData)
411
+ }
412
+ clearSelection() {
413
+ this.selectedData = [];
414
+ this.selectionChange.emit(this.selectedData);
415
+ // console.log('Selezione tabella resettata');
416
+ }
417
+ hasMagnifyingGlassIcon(field) {
418
+ if (!this.isIconColumn(field)) {
419
+ return false;
420
+ }
421
+ if (this.data && this.data.length > 0) {
422
+ return this.data.some(row => row[field] === this.faMagnifyingGlass);
423
+ }
424
+ return false;
425
+ }
426
+ resetSorting() {
427
+ this.isSorted = null;
428
+ this.currentSortedField = null;
429
+ this.data = [...this.initialValue];
430
+ if (this.dt) {
431
+ this.dt.reset();
432
+ }
433
+ this.resetData.emit();
434
+ }
435
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SortableTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
436
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: SortableTable, isStandalone: true, selector: "lib-sortable-table", inputs: { columns: "columns", data: "data", rows: "rows", detailRoute: "detailRoute", actions: "actions", colorPicker: "colorPicker", selected: "selected", tableCheckbox: "tableCheckbox" }, outputs: { selectionChange: "selectionChange", resetData: "resetData" }, viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }], ngImport: i0, template: "<div class=\"card\">\r\n <p-table\r\n #dt\r\n [columns]=\"columns\"\r\n [value]=\"data\"\r\n [(selection)]=\"selectedData\"\r\n [paginator]=\"true\"\r\n [rows]=\"rows\"\r\n [first]=\"first\"\r\n [customSort]=\"true\"\r\n (onPage)=\"pageChange($event)\"\r\n (sortFunction)=\"customSort($event)\"\r\n (onRowSelect)=\"onRowSelect()\"\r\n (onRowUnselect)=\"onRowSelect()\"\r\n [selectionMode]=\"'multiple'\"\r\n dataKey=\"id\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th style=\"width: 10px\"></th>\r\n @for(column of columns; track $index) {\r\n <th class=\"column-header\" [ngStyle]=\"{ 'width': column.width }\" [pSortableColumn]=\"hasMagnifyingGlassIcon(column.field) ? null : column.field\">\r\n {{ column.header }}\r\n @if(!hasMagnifyingGlassIcon(column.field)) {\r\n <p-sortIcon [field]=\"column.field\"></p-sortIcon>\r\n }\r\n </th>\r\n }\r\n </tr>\r\n </ng-template>\r\n <ng-template\r\n pTemplate=\"body\" \r\n let-rowData \r\n let-columns=\"columns\"\r\n let-selected=\"selected\"\r\n >\r\n <tr [pSelectableRow]=\"rowData\" [attr.data-id]=\"rowData.id\">\r\n <td (click)=\"$event.stopPropagation()\">\r\n <p-tableCheckbox [value]=\"rowData\" [ngClass]=\"tableCheckbox\"/>\r\n </td>\r\n @for (column of columns; track $index) {\r\n <td class=\"data-container\">\r\n <!-- Verifica il campo data -->\r\n @if (isDateColumn(rowData[column.field])) {\r\n <ng-container>\r\n {{ rowData[column.field] | date: 'dd/MM/yyyy - HH:mm' }}\r\n </ng-container>\r\n }\r\n <!-- Gestione speciale per la colonna priority -->\r\n @else if (column.field === 'priority' && rowData['priorityIcon']) {\r\n <ng-container>\r\n <fa-icon\r\n [icon]=\"rowData['priorityIcon']\"\r\n [ngStyle]=\"{ color: colorPicker(rowData, 'priority') }\"\r\n ></fa-icon>\r\n </ng-container>\r\n }\r\n <!-- Verifica se il campo della colonna \u00E8 uno di quelli che contiene un'icona -->\r\n @else if (isIconColumn(column.field)) {\r\n <ng-container>\r\n <fa-icon \r\n [icon]=\"rowData[column.field]\"\r\n [ngClass]=\"{ \r\n 'invisible-icon': rowData[column.field] === faStroopwafel, \r\n 'default-style': rowData[column.field] !== faStroopwafel,\r\n 'color-style': rowData[column.field] === faMagnifyingGlass\r\n }\"\r\n [ngStyle]=\"{ color: colorPicker(rowData, column.field) }\"\r\n (click)=\"$event.stopPropagation(); actions[column.field] ? actions[column.field](rowData) : null\"\r\n ></fa-icon>\r\n </ng-container>\r\n } @else {\r\n {{ rowData[column.field]?.label || rowData[column.field] }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n</div>", styles: [":host ::ng-deep .card{height:100%;width:100%}:is() p-table{height:100%}.column-header,.data-container{text-align:center;padding:0}.column-header{color:var(--primary-blue-color);font-weight:600;padding:1% 0}.data-container{padding:.1% 0;height:50px}.data-container>.default-style{color:var(--primary-blue-color);font-size:30px}.data-container>.color-style,.color-style{color:var(--primary-blue-color)!important}fa-icon{cursor:pointer}.invisible-icon{color:transparent}@media screen and (min-resolution: 1.25dppx){.data-container>.default-style{font-size:25px}}@media only screen and (max-width: 1366px){.column-header{font-size:14px}.data-container{font-size:13px;height:47px}.data-container>.default-style{font-size:25px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i2.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: "ngmodule", type: TableModule }, { kind: "component", type: i3.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i4.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i3.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i3.SelectableRow, selector: "[pSelectableRow]", inputs: ["pSelectableRow", "pSelectableRowIndex", "pSelectableRowDisabled"] }, { kind: "component", type: i3.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i3.TableCheckbox, selector: "p-tableCheckbox", inputs: ["value", "disabled", "required", "index", "inputId", "name", "ariaLabel"] }, { kind: "ngmodule", type: FormsModule }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
437
+ }
438
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SortableTable, decorators: [{
439
+ type: Component,
440
+ args: [{ selector: 'lib-sortable-table', imports: [CommonModule, FontAwesomeModule, TableModule, FormsModule], template: "<div class=\"card\">\r\n <p-table\r\n #dt\r\n [columns]=\"columns\"\r\n [value]=\"data\"\r\n [(selection)]=\"selectedData\"\r\n [paginator]=\"true\"\r\n [rows]=\"rows\"\r\n [first]=\"first\"\r\n [customSort]=\"true\"\r\n (onPage)=\"pageChange($event)\"\r\n (sortFunction)=\"customSort($event)\"\r\n (onRowSelect)=\"onRowSelect()\"\r\n (onRowUnselect)=\"onRowSelect()\"\r\n [selectionMode]=\"'multiple'\"\r\n dataKey=\"id\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th style=\"width: 10px\"></th>\r\n @for(column of columns; track $index) {\r\n <th class=\"column-header\" [ngStyle]=\"{ 'width': column.width }\" [pSortableColumn]=\"hasMagnifyingGlassIcon(column.field) ? null : column.field\">\r\n {{ column.header }}\r\n @if(!hasMagnifyingGlassIcon(column.field)) {\r\n <p-sortIcon [field]=\"column.field\"></p-sortIcon>\r\n }\r\n </th>\r\n }\r\n </tr>\r\n </ng-template>\r\n <ng-template\r\n pTemplate=\"body\" \r\n let-rowData \r\n let-columns=\"columns\"\r\n let-selected=\"selected\"\r\n >\r\n <tr [pSelectableRow]=\"rowData\" [attr.data-id]=\"rowData.id\">\r\n <td (click)=\"$event.stopPropagation()\">\r\n <p-tableCheckbox [value]=\"rowData\" [ngClass]=\"tableCheckbox\"/>\r\n </td>\r\n @for (column of columns; track $index) {\r\n <td class=\"data-container\">\r\n <!-- Verifica il campo data -->\r\n @if (isDateColumn(rowData[column.field])) {\r\n <ng-container>\r\n {{ rowData[column.field] | date: 'dd/MM/yyyy - HH:mm' }}\r\n </ng-container>\r\n }\r\n <!-- Gestione speciale per la colonna priority -->\r\n @else if (column.field === 'priority' && rowData['priorityIcon']) {\r\n <ng-container>\r\n <fa-icon\r\n [icon]=\"rowData['priorityIcon']\"\r\n [ngStyle]=\"{ color: colorPicker(rowData, 'priority') }\"\r\n ></fa-icon>\r\n </ng-container>\r\n }\r\n <!-- Verifica se il campo della colonna \u00E8 uno di quelli che contiene un'icona -->\r\n @else if (isIconColumn(column.field)) {\r\n <ng-container>\r\n <fa-icon \r\n [icon]=\"rowData[column.field]\"\r\n [ngClass]=\"{ \r\n 'invisible-icon': rowData[column.field] === faStroopwafel, \r\n 'default-style': rowData[column.field] !== faStroopwafel,\r\n 'color-style': rowData[column.field] === faMagnifyingGlass\r\n }\"\r\n [ngStyle]=\"{ color: colorPicker(rowData, column.field) }\"\r\n (click)=\"$event.stopPropagation(); actions[column.field] ? actions[column.field](rowData) : null\"\r\n ></fa-icon>\r\n </ng-container>\r\n } @else {\r\n {{ rowData[column.field]?.label || rowData[column.field] }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n</div>", styles: [":host ::ng-deep .card{height:100%;width:100%}:is() p-table{height:100%}.column-header,.data-container{text-align:center;padding:0}.column-header{color:var(--primary-blue-color);font-weight:600;padding:1% 0}.data-container{padding:.1% 0;height:50px}.data-container>.default-style{color:var(--primary-blue-color);font-size:30px}.data-container>.color-style,.color-style{color:var(--primary-blue-color)!important}fa-icon{cursor:pointer}.invisible-icon{color:transparent}@media screen and (min-resolution: 1.25dppx){.data-container>.default-style{font-size:25px}}@media only screen and (max-width: 1366px){.column-header{font-size:14px}.data-container{font-size:13px;height:47px}.data-container>.default-style{font-size:25px}}\n"] }]
441
+ }], propDecorators: { columns: [{
442
+ type: Input
443
+ }], data: [{
444
+ type: Input
445
+ }], rows: [{
446
+ type: Input
447
+ }], detailRoute: [{
448
+ type: Input
449
+ }], actions: [{
450
+ type: Input
451
+ }], colorPicker: [{
452
+ type: Input
453
+ }], selected: [{
454
+ type: Input
455
+ }], tableCheckbox: [{
456
+ type: Input
457
+ }], selectionChange: [{
458
+ type: Output
459
+ }], resetData: [{
460
+ type: Output
461
+ }], dt: [{
462
+ type: ViewChild,
463
+ args: ['dt']
464
+ }] } });
465
+
466
+ class PrimengItalianLocale {
467
+ }
468
+ const PRIMENG_ITALIAN_LOCALE = {
469
+ firstDayOfWeek: 1,
470
+ dayNames: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"],
471
+ dayNamesShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"],
472
+ dayNamesMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa"],
473
+ monthNames: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
474
+ monthNamesShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"],
475
+ today: 'Oggi',
476
+ clear: 'Cancella',
477
+ dateFormat: 'dd/mm/yy',
478
+ weekHeader: 'Sm'
479
+ };
480
+
481
+ var CalendarView;
482
+ (function (CalendarView) {
483
+ CalendarView["Month"] = "month";
484
+ CalendarView["Week"] = "week";
485
+ })(CalendarView || (CalendarView = {}));
486
+ // Costante per il limite massimo della cache
487
+ const MAX_CACHE_SIZE = 100;
488
+ class Calendar {
489
+ cdr;
490
+ primengConfig;
491
+ appointments = [];
492
+ //tab
493
+ items = [];
494
+ //timeslot
495
+ startHour = 0;
496
+ endHour = 24;
497
+ timeInterval = 30;
498
+ dateSelected = new EventEmitter();
499
+ closeModal = new EventEmitter();
500
+ tabChanged = new EventEmitter();
501
+ faChevronLeft = faChevronLeft;
502
+ faChevronRight = faChevronRight;
503
+ faCirclePlus = faCirclePlus;
504
+ faCircleCheck = faCircleCheck;
505
+ viewDate = new Date();
506
+ selectedDate = null;
507
+ blinkDate = null;
508
+ selectedDateString = '';
509
+ selectedStartTime;
510
+ weekDays = ['LUN', 'MAR', 'MER', 'GIO', 'VEN', 'SAB', 'DOM'];
511
+ monthDays = [];
512
+ currentView = CalendarView.Month;
513
+ timeSlots = [];
514
+ weeks = [];
515
+ visibleList = false;
516
+ newAppointment = false;
517
+ //tabmenu
518
+ activeItem; // Per compatibilità con il resto del codice
519
+ activeValue = ''; // Per il nuovo componente Tabs
520
+ //dialog list appointment
521
+ selectedAppointments = [];
522
+ //hover appuntamenti
523
+ hoveredAppointment = null;
524
+ tooltipStyle = {};
525
+ appointmentCache = {};
526
+ monthViewData = null;
527
+ weekViewData = null;
528
+ formattedDateCache = new Map(); // Cache per le date formattate
529
+ cacheKeys = []; // Per implementare LRU (Least Recently Used) cache
530
+ //
531
+ isLoading = false;
532
+ CalendarView = CalendarView;
533
+ constructor(cdr, primengConfig) {
534
+ this.cdr = cdr;
535
+ this.primengConfig = primengConfig;
536
+ this.configuraLingua();
537
+ this.generateTimeSlots();
538
+ this.generateView(this.currentView, this.viewDate);
539
+ this.setDialogWidth();
540
+ }
541
+ configuraLingua() {
542
+ this.primengConfig.setTranslation(PRIMENG_ITALIAN_LOCALE);
543
+ }
544
+ ngOnChanges(changes) {
545
+ let needsRefresh = false;
546
+ if (changes['startHour'] || changes['endHour'] || changes['timeInterval']) {
547
+ this.generateTimeSlots();
548
+ needsRefresh = true;
549
+ }
550
+ if (changes['appointments']) {
551
+ this.invalidateAppointmentCache();
552
+ needsRefresh = true;
553
+ }
554
+ if (needsRefresh) {
555
+ this.generateView(this.currentView, this.viewDate);
556
+ }
557
+ }
558
+ // Metodo per invalidare la cache in modo selettivo
559
+ invalidateAppointmentCache() {
560
+ this.appointmentCache = {};
561
+ this.cacheKeys = [];
562
+ }
563
+ // Metodo per generare la chiave della cache basata sulla data
564
+ formatDateKey(date) {
565
+ return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
566
+ }
567
+ // Metodo per gestire la cache LRU (Least Recently Used)
568
+ cacheAppointmentData(dateKey, data) {
569
+ // Se la chiave è già nella cache, rimuoverla dall'array delle chiavi
570
+ const existingIndex = this.cacheKeys.indexOf(dateKey);
571
+ if (existingIndex > -1) {
572
+ this.cacheKeys.splice(existingIndex, 1);
573
+ }
574
+ // Aggiungi la chiave alla fine (più recente)
575
+ this.cacheKeys.push(dateKey);
576
+ // Imposta i dati nella cache
577
+ this.appointmentCache[dateKey] = data;
578
+ // Se la cache supera la dimensione massima, rimuovi l'elemento meno recente
579
+ if (this.cacheKeys.length > MAX_CACHE_SIZE) {
580
+ const oldestKey = this.cacheKeys.shift();
581
+ if (oldestKey) {
582
+ delete this.appointmentCache[oldestKey];
583
+ }
584
+ }
585
+ }
586
+ precomputeAppointments() {
587
+ // Processa solo i giorni visibili per prestazioni ottimali
588
+ const visibleDays = this.getVisibleDays();
589
+ this.precomputeForDays(visibleDays);
590
+ // Poi elabora i giorni rimanenti in background con un ritardo
591
+ if (this.currentView === CalendarView.Month) {
592
+ setTimeout(() => {
593
+ const allDays = this.weeks.flat();
594
+ const remainingDays = allDays.filter(day => !visibleDays.some(vDay => this.isSameDate(day, vDay)));
595
+ // Elabora in batch di 20 giorni alla volta per evitare di bloccare l'interfaccia
596
+ this.precomputeInBatches(remainingDays, 20);
597
+ }, 200);
598
+ }
599
+ }
600
+ // Precomputa in batch per evitare il blocco dell'interfaccia
601
+ precomputeInBatches(days, batchSize) {
602
+ if (days.length === 0)
603
+ return;
604
+ const batch = days.slice(0, batchSize);
605
+ const remaining = days.slice(batchSize);
606
+ this.precomputeForDays(batch);
607
+ if (remaining.length > 0) {
608
+ setTimeout(() => {
609
+ this.precomputeInBatches(remaining, batchSize);
610
+ }, 0);
611
+ }
612
+ }
613
+ getVisibleDays() {
614
+ // Per la vista mensile, consideriamo solo le settimane più visibili
615
+ if (this.currentView === CalendarView.Month && this.weeks.length > 0) {
616
+ return this.weeks.slice(0, 3).flat();
617
+ }
618
+ return this.monthDays;
619
+ }
620
+ precomputeForDays(days) {
621
+ // Elabora la cache per un gruppo di giorni
622
+ for (const date of days) {
623
+ const dateKey = this.formatDateKey(date);
624
+ // Se già in cache, salta
625
+ if (this.appointmentCache[dateKey])
626
+ continue;
627
+ // Filtra gli appuntamenti per questa data
628
+ const appointmentsForDay = this.appointments.filter(appointment => this.isSameDate(appointment.startDate, date)).sort((a, b) => this.extractTime(a.startDate).localeCompare(this.extractTime(b.startDate)));
629
+ // Mappa appuntamenti per time slot
630
+ const timeSlotMap = {};
631
+ for (const timeSlot of this.timeSlots) {
632
+ timeSlotMap[timeSlot] = this.appointments.filter(appointment => {
633
+ const startTime = this.extractTime(appointment.startDate);
634
+ const endTime = this.extractTime(appointment.endDate);
635
+ return this.isSameDate(appointment.startDate, date) &&
636
+ startTime <= timeSlot &&
637
+ endTime > timeSlot;
638
+ });
639
+ }
640
+ // Memorizza nella cache
641
+ const cacheData = {
642
+ hasAppointments: appointmentsForDay.length > 0,
643
+ appointments: appointmentsForDay,
644
+ firstAppointment: appointmentsForDay.length > 0 ? appointmentsForDay[0] : null,
645
+ timeSlotMap: timeSlotMap
646
+ };
647
+ this.cacheAppointmentData(dateKey, cacheData);
648
+ }
649
+ }
650
+ generateView(view, date) {
651
+ this.isLoading = true;
652
+ // non rigenerare dati già esistenti
653
+ if (view === CalendarView.Month && this.monthViewData &&
654
+ this.monthViewData.month === date.getMonth() &&
655
+ this.monthViewData.year === date.getFullYear()) {
656
+ this.weeks = [...this.monthViewData.weeks];
657
+ this.monthDays = [...this.monthViewData.monthDays];
658
+ this.isLoading = false;
659
+ this.cdr.markForCheck();
660
+ return;
661
+ }
662
+ else if (view === CalendarView.Week && this.weekViewData &&
663
+ this.isSameWeek(this.weekViewData.date, date)) {
664
+ this.monthDays = [...this.weekViewData.monthDays];
665
+ this.isLoading = false;
666
+ this.cdr.markForCheck();
667
+ return;
668
+ }
669
+ switch (view) {
670
+ case CalendarView.Month:
671
+ this.generateMonthView(date);
672
+ this.monthViewData = {
673
+ month: date.getMonth(),
674
+ year: date.getFullYear(),
675
+ weeks: [...this.weeks],
676
+ monthDays: [...this.monthDays]
677
+ };
678
+ break;
679
+ case CalendarView.Week:
680
+ this.generateWeekView(date);
681
+ this.weekViewData = {
682
+ date: new Date(date),
683
+ monthDays: [...this.monthDays]
684
+ };
685
+ break;
686
+ }
687
+ // Calcola gli appuntamenti solo per i giorni visibili inizialmente
688
+ this.precomputeAppointments();
689
+ this.isLoading = false;
690
+ this.cdr.markForCheck();
691
+ }
692
+ // Verifica se due date sono nella stessa settimana
693
+ isSameWeek(date1, date2) {
694
+ const d1 = new Date(date1);
695
+ const d2 = new Date(date2);
696
+ // Ottieni l'inizio settimana per entrambe le date
697
+ const start1 = this.startOfWeek(d1);
698
+ const start2 = this.startOfWeek(d2);
699
+ return start1.getTime() === start2.getTime();
700
+ }
701
+ generateMonthView(date) {
702
+ const start = new Date(date.getFullYear(), date.getMonth(), 1);
703
+ const firstMonday = this.startOfWeek(start);
704
+ this.weeks = [];
705
+ this.monthDays = [];
706
+ let week = [];
707
+ // Itera tutti i giorni necessari per coprire il mese più i giorni fuori mese
708
+ for (let day = 0; day < 42; day++) { // 6 settimane * 7 giorni
709
+ let currentDate = new Date(firstMonday);
710
+ currentDate.setDate(firstMonday.getDate() + day);
711
+ week.push(currentDate);
712
+ this.monthDays.push(currentDate);
713
+ if (week.length === 7) {
714
+ this.weeks.push(week);
715
+ week = [];
716
+ }
717
+ }
718
+ }
719
+ generateWeekView(date) {
720
+ const startOfWeek = this.startOfWeek(date);
721
+ this.monthDays = [];
722
+ for (let day = 0; day < 7; day++) {
723
+ const weekDate = new Date(startOfWeek);
724
+ weekDate.setDate(startOfWeek.getDate() + day);
725
+ this.monthDays.push(weekDate);
726
+ }
727
+ }
728
+ generateTimeSlots() {
729
+ this.timeSlots = [];
730
+ for (let hour = this.startHour; hour <= this.endHour; hour++) {
731
+ // Calcola gli slot in base all'intervallo specificato
732
+ const minuteIntervals = [];
733
+ for (let minute = 0; minute < 60; minute += this.timeInterval) {
734
+ minuteIntervals.push(minute);
735
+ }
736
+ for (let minute of minuteIntervals) {
737
+ // Salta l'ultimo slot se è oltre l'ora finale
738
+ if (hour === this.endHour && minute > 0)
739
+ break;
740
+ const formattedHour = hour < 10 ? `0${hour}` : `${hour}`;
741
+ const formattedMinute = minute === 0 ? '00' : `${minute}`;
742
+ this.timeSlots.push(`${formattedHour}:${formattedMinute}`);
743
+ }
744
+ }
745
+ }
746
+ switchToView(view) {
747
+ if (this.currentView === view)
748
+ return; // Non fare nulla se la vista è già quella corrente
749
+ this.isLoading = true;
750
+ this.currentView = view;
751
+ this.visibleList = false;
752
+ // Usa setTimeout per permettere all'indicatore di caricamento di essere visualizzato
753
+ setTimeout(() => {
754
+ if (view === CalendarView.Week && this.selectedDate) {
755
+ this.viewDate = new Date(this.selectedDate);
756
+ }
757
+ this.generateView(this.currentView, this.viewDate);
758
+ }, 50);
759
+ }
760
+ startOfWeek(date) {
761
+ const start = new Date(date);
762
+ const day = start.getDay();
763
+ const diff = start.getDate() - (day === 0 ? 6 : day - 1);
764
+ return new Date(start.setDate(diff));
765
+ }
766
+ previous() {
767
+ this.isLoading = true;
768
+ setTimeout(() => {
769
+ if (this.currentView === CalendarView.Month) {
770
+ this.viewDate = new Date(this.viewDate.getFullYear(), this.viewDate.getMonth() - 1, 1);
771
+ }
772
+ else {
773
+ const newDate = new Date(this.viewDate);
774
+ newDate.setDate(newDate.getDate() - 7);
775
+ this.viewDate = newDate;
776
+ }
777
+ this.generateView(this.currentView, this.viewDate);
778
+ }, 50);
779
+ }
780
+ next() {
781
+ this.isLoading = true;
782
+ setTimeout(() => {
783
+ if (this.currentView === CalendarView.Month) {
784
+ this.viewDate = new Date(this.viewDate.getFullYear(), this.viewDate.getMonth() + 1, 1);
785
+ }
786
+ else {
787
+ const newDate = new Date(this.viewDate);
788
+ newDate.setDate(newDate.getDate() + 7);
789
+ this.viewDate = newDate;
790
+ }
791
+ this.generateView(this.currentView, this.viewDate);
792
+ }, 50);
793
+ }
794
+ isToday(date) {
795
+ const today = new Date();
796
+ return (date.getDate() === today.getDate() &&
797
+ date.getMonth() === today.getMonth() &&
798
+ date.getFullYear() === today.getFullYear());
799
+ }
800
+ isPastDate(date) {
801
+ const today = new Date();
802
+ today.setHours(0, 0, 0, 0);
803
+ return date < today;
804
+ }
805
+ isPastTime(date, timeSlot) {
806
+ const currentTime = new Date();
807
+ const [hour, minute] = timeSlot.split(':').map((x) => parseInt(x));
808
+ const appointmentTime = new Date(date);
809
+ appointmentTime.setHours(hour, minute, 0, 0);
810
+ return appointmentTime < currentTime;
811
+ }
812
+ hasAppointments(date) {
813
+ const dateKey = this.formatDateKey(date);
814
+ if (this.appointmentCache[dateKey]) {
815
+ return this.appointmentCache[dateKey].hasAppointments;
816
+ }
817
+ // Se non è in cache, calcola e memorizza
818
+ const hasApps = this.getAppointmentsForDate(date, this.timeSlots).length > 0;
819
+ return hasApps;
820
+ }
821
+ isTimeSlotOccupied(date, timeSlot) {
822
+ const dateKey = this.formatDateKey(date);
823
+ if (this.appointmentCache[dateKey] && this.appointmentCache[dateKey].timeSlotMap[timeSlot]) {
824
+ return this.appointmentCache[dateKey].timeSlotMap[timeSlot].length > 0;
825
+ }
826
+ return this.getAppointmentsForDataTime(date, timeSlot).length > 0;
827
+ }
828
+ isCurrentMonth(date) {
829
+ return (date.getMonth() === this.viewDate.getMonth() &&
830
+ date.getFullYear() === this.viewDate.getFullYear());
831
+ }
832
+ isSameDate(date1, date2) {
833
+ if (!date1 || !date2)
834
+ return false;
835
+ const d1 = new Date(date1);
836
+ const d2 = new Date(date2);
837
+ return (d1.getDate() === d2.getDate() &&
838
+ d1.getMonth() === d2.getMonth() &&
839
+ d1.getFullYear() === d2.getFullYear());
840
+ }
841
+ formatDate(date) {
842
+ if (!date)
843
+ return '';
844
+ const dateKey = this.formatDateKey(date);
845
+ if (this.formattedDateCache.has(dateKey)) {
846
+ return this.formattedDateCache.get(dateKey);
847
+ }
848
+ const formatted = date.toLocaleDateString('it-IT', {
849
+ weekday: 'long',
850
+ day: '2-digit',
851
+ month: 'long',
852
+ year: 'numeric'
853
+ });
854
+ this.formattedDateCache.set(dateKey, formatted);
855
+ return formatted;
856
+ }
857
+ extractTime(dateInput) {
858
+ const date = new Date(dateInput);
859
+ if (isNaN(date.getTime())) {
860
+ return '00:00';
861
+ }
862
+ const hours = date.getHours().toString().padStart(2, '0');
863
+ const minutes = date.getMinutes().toString().padStart(2, '0');
864
+ return `${hours}:${minutes}`;
865
+ }
866
+ selectDate(date, startTime) {
867
+ if (!date)
868
+ return;
869
+ const previousDate = this.selectedDate;
870
+ this.selectedDate = date;
871
+ if (this.currentView === CalendarView.Month || this.viewDate.getMonth() !== date.getMonth()) {
872
+ this.viewDate = new Date(date);
873
+ }
874
+ // Usa la cache per gli appuntamenti quando possibile
875
+ const dateKey = this.formatDateKey(date);
876
+ if (this.appointmentCache[dateKey]) {
877
+ this.selectedAppointments = this.appointmentCache[dateKey].appointments;
878
+ }
879
+ else {
880
+ // Se non è in cache, calcola normalmente
881
+ this.selectedAppointments = this.getAppointmentsForDate(date, this.timeSlots);
882
+ }
883
+ this.selectedDateString = this.formatDate(date);
884
+ if (startTime) {
885
+ if (this.isTimeSlotOccupied(date, startTime) || this.isPastTime(date, startTime)) {
886
+ return;
887
+ }
888
+ this.newAppointment = true;
889
+ this.selectedStartTime = startTime;
890
+ this.dateSelected.emit({ date, startTime });
891
+ }
892
+ else {
893
+ if (this.selectedAppointments.length > 1 ||
894
+ (this.selectedAppointments.length === 1 && this.isPastDate(date))) {
895
+ this.visibleList = true;
896
+ this.dateSelected.emit({ date, startTime: '00:00' });
897
+ }
898
+ else {
899
+ this.visibleList = false;
900
+ if (this.currentView !== CalendarView.Week) {
901
+ this.weekViewData = null;
902
+ this.switchToView(CalendarView.Week);
903
+ }
904
+ else if (previousDate && this.isSameDate(previousDate, date)) {
905
+ this.selectedDate = null;
906
+ this.cdr.detectChanges();
907
+ setTimeout(() => {
908
+ this.selectedDate = date;
909
+ this.cdr.detectChanges();
910
+ }, 10);
911
+ }
912
+ }
913
+ }
914
+ }
915
+ getAppointmentsForDate(day, timeSlots) {
916
+ return this.appointments
917
+ .filter((appointment) => this.isSameDate(appointment.startDate, day))
918
+ .map((appointment) => {
919
+ const startTime = this.extractTime(appointment.startDate);
920
+ const endTime = this.extractTime(appointment.endDate);
921
+ return { ...appointment, startTime, endTime };
922
+ });
923
+ }
924
+ getAppointmentDuration(appointment) {
925
+ const startTime = this.extractTime(appointment.startDate);
926
+ const endTime = this.extractTime(appointment.endDate);
927
+ const startIndex = this.timeSlots.findIndex(slot => slot === startTime);
928
+ const endIndex = this.timeSlots.findIndex(slot => slot === endTime);
929
+ if (startIndex === -1 || endIndex === -1)
930
+ return 1;
931
+ return endIndex - startIndex;
932
+ }
933
+ getAppointmentHeightStyle(appointment) {
934
+ const duration = this.getAppointmentDuration(appointment);
935
+ const borderThickness = 6; // spessore del bordo in pixel
936
+ const cellHeight = 50; // altezza di una cella in pixel
937
+ // Se la tabella usa border-collapse: collapse
938
+ const totalBorders = 1; // solo un bordo per ogni confine tra celle
939
+ // Se la tabella usa border-collapse: separate
940
+ // const totalBorders = duration + 1; // ogni cella ha il suo bordo
941
+ const heightInPixels = (duration * cellHeight) - (totalBorders * borderThickness);
942
+ return {
943
+ 'background-color': 'var(--appointment-blue-color)',
944
+ 'height': heightInPixels + 'px',
945
+ 'z-index': '10',
946
+ 'top': 0
947
+ };
948
+ }
949
+ getFirstAppointmentForDate(day, timeSlots) {
950
+ const dateKey = this.formatDateKey(day);
951
+ if (this.appointmentCache[dateKey]) {
952
+ return this.appointmentCache[dateKey].firstAppointment;
953
+ }
954
+ const appointmentsForDay = this.getAppointmentsForDate(day, timeSlots);
955
+ return appointmentsForDay.length > 0 ? appointmentsForDay[0] : null;
956
+ }
957
+ getAppointmentsForDataTime(date, timeSlot) {
958
+ const dateKey = this.formatDateKey(date);
959
+ if (this.appointmentCache[dateKey] && this.appointmentCache[dateKey].timeSlotMap[timeSlot]) {
960
+ return this.appointmentCache[dateKey].timeSlotMap[timeSlot];
961
+ }
962
+ return this.appointments.filter(appointment => {
963
+ const startTime = this.extractTime(appointment.startDate);
964
+ const endTime = this.extractTime(appointment.endDate);
965
+ return this.isSameDate(appointment.startDate, date) &&
966
+ startTime <= timeSlot &&
967
+ endTime > timeSlot;
968
+ });
969
+ }
970
+ formatHourToTimeString(hour) {
971
+ const formattedHour = hour < 10 ? `0${hour}` : `${hour}`;
972
+ return `${formattedHour}:00`;
973
+ }
974
+ toggleNewAppointment() {
975
+ if (this.currentView !== CalendarView.Week) {
976
+ this.weekViewData = null;
977
+ this.switchToView(CalendarView.Week);
978
+ }
979
+ this.selectedStartTime = this.formatHourToTimeString(this.startHour);
980
+ this.newAppointment = true;
981
+ this.dateSelected.emit({ date: this.selectedDate, startTime: this.selectedStartTime });
982
+ }
983
+ closeAppointmentModal() {
984
+ this.closeModal.emit();
985
+ this.newAppointment = false;
986
+ this.cdr.markForCheck();
987
+ }
988
+ onDialogHide() {
989
+ this.closeModal.emit();
990
+ }
991
+ viewToday() {
992
+ this.isLoading = true;
993
+ setTimeout(() => {
994
+ this.viewDate = new Date();
995
+ this.generateView(this.currentView, this.viewDate);
996
+ }, 50);
997
+ }
998
+ // Tooltip
999
+ showTooltip(appointment, event) {
1000
+ this.hoveredAppointment = appointment;
1001
+ this.cdr.detectChanges();
1002
+ //posiziono il tooltip dopo che è stato creato
1003
+ setTimeout(() => {
1004
+ const tooltip = document.querySelector('.tooltip');
1005
+ if (!tooltip)
1006
+ return;
1007
+ //non si mostra finché non è posizionato
1008
+ tooltip.style.opacity = '0';
1009
+ //dove si trova l'appuntamento hoverato
1010
+ const appointmentRect = event.target.getBoundingClientRect();
1011
+ const tooltipWidth = tooltip.offsetWidth;
1012
+ const tooltipHeight = tooltip.offsetHeight;
1013
+ //controlla in che colonna si trova l'appuntamento
1014
+ const cell = event.target.closest('td');
1015
+ if (!cell)
1016
+ return;
1017
+ const cellIndex = cell.cellIndex;
1018
+ //calcolo lo spazio disponibile nelle varie direzioni
1019
+ const viewportWidth = window.innerWidth;
1020
+ const viewportHeight = window.innerHeight;
1021
+ const spaceRight = viewportWidth - appointmentRect.right;
1022
+ const spaceLeft = appointmentRect.left;
1023
+ const spaceAbove = appointmentRect.top;
1024
+ const spaceBelow = viewportHeight - appointmentRect.bottom;
1025
+ let left = 0;
1026
+ let top = 0;
1027
+ if (cellIndex === 1) { //per il lunedì lo posiziono a destra
1028
+ left = appointmentRect.right + 10;
1029
+ top = appointmentRect.top;
1030
+ tooltip.style.transform = 'none';
1031
+ }
1032
+ else if (cellIndex === 7) { //per la domenica lo posiziono a sinistra
1033
+ left = appointmentRect.left - tooltipWidth - 10;
1034
+ top = appointmentRect.top;
1035
+ tooltip.style.transform = 'none';
1036
+ }
1037
+ else { //per le altre colonne lo posiziono dove è più comodo
1038
+ if (spaceRight >= tooltipWidth + 10) { //se c'è spazio lo metto a destra
1039
+ left = appointmentRect.right + 10;
1040
+ top = appointmentRect.top;
1041
+ tooltip.style.transform = 'none';
1042
+ }
1043
+ else if (spaceLeft >= tooltipWidth + 10) { //altrimenti a sinistra
1044
+ left = appointmentRect.left - tooltipWidth - 10;
1045
+ top = appointmentRect.top;
1046
+ tooltip.style.transform = 'none';
1047
+ }
1048
+ else { //se non c'è spazio laterale lo metto sopra o sotto
1049
+ left = appointmentRect.left + (appointmentRect.width / 2);
1050
+ tooltip.style.transform = 'translateX(-50%)';
1051
+ if (spaceAbove >= tooltipHeight + 10) { //sopra se c'è spazio
1052
+ top = appointmentRect.top - tooltipHeight - 10;
1053
+ }
1054
+ else { //sotto
1055
+ top = appointmentRect.bottom + 10;
1056
+ }
1057
+ }
1058
+ }
1059
+ if (left + tooltipWidth > viewportWidth) {
1060
+ left = viewportWidth - tooltipWidth - 10;
1061
+ tooltip.style.transform = 'none';
1062
+ }
1063
+ if (left < 0) {
1064
+ left = 10;
1065
+ tooltip.style.transform = 'none';
1066
+ }
1067
+ if (top + tooltipHeight > viewportHeight) {
1068
+ top = viewportHeight - tooltipHeight - 10;
1069
+ }
1070
+ if (top < 0) {
1071
+ top = 10;
1072
+ }
1073
+ tooltip.style.left = `${left}px`;
1074
+ tooltip.style.top = `${top}px`;
1075
+ //mostrare il tooltip
1076
+ setTimeout(() => {
1077
+ tooltip.style.opacity = '1';
1078
+ }, 10);
1079
+ }, 0);
1080
+ }
1081
+ hideTooltip() {
1082
+ this.hoveredAppointment = null;
1083
+ this.cdr.detectChanges();
1084
+ //nascondo tooltip se rimasto in visualizzazione per errore
1085
+ const tooltip = document.querySelector('.tooltip');
1086
+ if (tooltip) {
1087
+ tooltip.style.opacity = '0';
1088
+ }
1089
+ }
1090
+ // Tab menu
1091
+ // onActiveItemChange(event: MenuItem) {
1092
+ // this.activeItem = event;
1093
+ // this.cdr.markForCheck();
1094
+ // }
1095
+ // onActiveItemChange(value: string) {
1096
+ // this.activeItem = value;
1097
+ // // Trova l'item corrispondente per mantenere compatibilità
1098
+ // const selectedItem = this.items.find(item =>
1099
+ // (item.value && item.value === value) || item.label === value
1100
+ // );
1101
+ // if (selectedItem) {
1102
+ // this.activeItem = selectedItem;
1103
+ // if (selectedItem.label) {
1104
+ // this.tabChanged.emit(selectedItem.label);
1105
+ // }
1106
+ // }
1107
+ // this.cdr.markForCheck();
1108
+ // }
1109
+ onValueChange(value) {
1110
+ const stringValue = String(value);
1111
+ this.activeValue = stringValue;
1112
+ // Trova l'item corrispondente per mantenere compatibilità
1113
+ const selectedItem = this.items.find(item => (item['value'] && item['value'] === value) || item.label === value);
1114
+ if (selectedItem) {
1115
+ this.activeItem = selectedItem; // Mantieni per compatibilità con il resto del codice
1116
+ if (selectedItem.label) {
1117
+ this.tabChanged.emit(selectedItem.label);
1118
+ }
1119
+ }
1120
+ this.cdr.markForCheck();
1121
+ }
1122
+ ngOnInit() {
1123
+ this.primengConfig.setTranslation(PRIMENG_ITALIAN_LOCALE);
1124
+ if (this.items.length > 0) {
1125
+ this.activeValue = this.items[0]['value'] || this.items[0].label || ''; // Per il nuovo Tabs
1126
+ this.activeItem = this.items[0]; // Per compatibilità con il resto del codice
1127
+ }
1128
+ this.generateTimeSlots();
1129
+ this.precomputeAppointments();
1130
+ }
1131
+ dialogWidth = '60%';
1132
+ onResize() {
1133
+ this.setDialogWidth();
1134
+ }
1135
+ setDialogWidth() {
1136
+ this.dialogWidth = window.innerWidth <= 1000 ? '87%' : '60%';
1137
+ }
1138
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Calendar, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.PrimeNG }], target: i0.ɵɵFactoryTarget.Component });
1139
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: Calendar, isStandalone: true, selector: "lib-calendar", inputs: { appointments: "appointments", items: "items", startHour: "startHour", endHour: "endHour", timeInterval: "timeInterval" }, outputs: { dateSelected: "dateSelected", closeModal: "closeModal", tabChanged: "tabChanged" }, host: { listeners: { "window:resize": "onResize()" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"container\">\r\n <div class=\"calendar-container\">\r\n <div class=\"calendar-header\">\r\n @if (currentView === 'week') {\r\n <lib-third-button\r\n text=\"\"\r\n [icon]=\"faChevronLeft\"\r\n [bgColor]=\"'transparent'\"\r\n [textColor]=\"'#2d519f'\"\r\n [width]=\"'40px'\"\r\n [height]=\"'40px'\"\r\n [border]=\"'none'\"\r\n (onClick)=\"switchToView(CalendarView.Month)\"\r\n >\r\n </lib-third-button>\r\n }\r\n <div>\r\n <h2 class=\"calendar-month\">\r\n {{ viewDate | date : \"MMMM\" | titlecase }}\r\n <span>{{ viewDate | date: \"y\" }}</span>\r\n </h2>\r\n </div>\r\n <div class=\"calendar-controls\">\r\n <fa-icon \r\n [icon]=\"faChevronLeft\"\r\n (click)=\"previous()\"\r\n style=\"margin-right: 10px; color: #2d519f;\"\r\n ></fa-icon>\r\n <lib-third-button\r\n text=\"Oggi\"\r\n [bgColor]=\"'transparent'\"\r\n [textColor]=\"'#2d519f'\"\r\n [width]=\"'80px'\"\r\n [height]=\"'40px'\"\r\n [border]=\"'1px solid #2d519f'\"\r\n (onClick)=\"viewToday()\"\r\n >\r\n </lib-third-button>\r\n <fa-icon \r\n [icon]=\"faChevronRight\"\r\n (click)=\"next()\"\r\n style=\"margin-left: 10px; color: #2d519f;\"\r\n ></fa-icon>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Month view -->\r\n @if (currentView === 'month') {\r\n <table\r\n width=\"100%\"\r\n cellspacing=\"0\"\r\n cellpadding=\"0\"\r\n class=\"calendar-view-month\"\r\n >\r\n <thead>\r\n <tr>\r\n @for (day of weekDays; track $index) {\r\n <th>{{ day }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (week of weeks; track $index) {\r\n <tr>\r\n @for (date of week; track $index) {\r\n <td \r\n [class.today]=\"isToday(date)\" \r\n [ngStyle]=\"{ opacity: isCurrentMonth(date) ? '1' : '0.5' }\"\r\n [ngClass]=\"{'past-day': isPastDate(date), 'clickable-past': isPastDate(date) && hasAppointments(date)}\"\r\n >\r\n <div\r\n (click)=\"selectDate(date)\"\r\n class=\"cell-overlay\"\r\n tabindex=\"0\"\r\n ></div>\r\n <div class=\"date\">\r\n {{ date.getDate() }}\r\n </div>\r\n <div class=\"appointments\">\r\n @if (getFirstAppointmentForDate(date, timeSlots)) {\r\n <div\r\n tabindex=\"0\"\r\n class=\"appointment\"\r\n [ngStyle]=\"{ 'background-color': 'var(--appointment-blue-color)' }\"\r\n >\r\n <span>{{ getFirstAppointmentForDate(date, timeSlots)?.name }}</span>\r\n </div>\r\n \r\n @if (getAppointmentsForDate(date, timeSlots).length > 1) {\r\n <div class=\"more-appointments\">\r\n +{{ getAppointmentsForDate(date, timeSlots).length - 1 }} altr{{ getAppointmentsForDate(date, timeSlots).length - 1 > 1 ? 'i' : 'o' }}\r\n </div>\r\n }\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n <p-dialog [header]=\"'Lista appuntamenti per il ' + this.selectedDateString\" [modal]=\"true\" [(visible)]=\"visibleList\" [style]=\"{ width: '35%' }\">\r\n <div class=\"appointment-list\">\r\n @for (appointment of selectedAppointments; track $index) {\r\n <div class=\"appointment-item\">\r\n <span class=\"appointment-time\">{{ extractTime(appointment.startDate) }} - {{ extractTime(appointment.endDate) }}</span>\r\n <span class=\"appointment-name\">{{ appointment.name }}</span> \r\n </div>\r\n }\r\n </div>\r\n @if (!isPastDate(selectedDate!)) {\r\n <div class=\"button-container\">\r\n <lib-third-button\r\n text=\"Aggiungi nuovo\"\r\n [bgColor]=\"'var(--primary-blue-color)'\"\r\n [textColor]=\"'white'\"\r\n [width]=\"'200px'\"\r\n [height]=\"'40px'\"\r\n [fontWeight]=\"'600'\"\r\n [border]=\"'1px solid var(--primary-blue-color)'\"\r\n [icon]=\"faCirclePlus\"\r\n (onClick)=\"toggleNewAppointment()\"\r\n >\r\n </lib-third-button>\r\n </div>\r\n }\r\n </p-dialog>\r\n </tbody>\r\n </table>\r\n }\r\n\r\n <!-- Week view -->\r\n @if (currentView === 'week') {\r\n <table\r\n width=\"100%\"\r\n height=\"100%\"\r\n cellspacing=\"0\"\r\n cellpadding=\"0\"\r\n class=\"calendar-view-week\"\r\n >\r\n <thead>\r\n <tr>\r\n <th></th>\r\n @for (day of weekDays; track $index) {\r\n <th>{{ day }} {{ monthDays[$index].getDate() }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody class=\"contenitore-calendario\">\r\n @for (timeSlot of timeSlots; track $index) {\r\n <tr>\r\n <td [width]=\"10\" class=\"calendar-slot-cell\">\r\n <span>{{ timeSlot }}</span>\r\n </td>\r\n @for (day of weekDays; track $index) {\r\n <td [class.today]=\"isToday(monthDays[$index])\" \r\n [ngClass]=\"\r\n {'blink': selectedDate && isSameDate(monthDays[$index], selectedDate), \r\n 'past-day': isPastDate(monthDays[$index]), \r\n 'clickable-past': isPastDate(monthDays[$index]) && hasAppointments(monthDays[$index]),\r\n 'disabled': isPastTime(monthDays[$index], timeSlot) && !isTimeSlotOccupied(monthDays[$index], timeSlot),\r\n 'occupied': isTimeSlotOccupied(monthDays[$index], timeSlot)\r\n }\"\r\n >\r\n <div \r\n class=\"cell-overlay\"\r\n style=\"z-index: 0;\"\r\n tabindex=\"0\"\r\n [class.occupied]=\"isTimeSlotOccupied(monthDays[$index], timeSlot)\"\r\n (click)=\"!isTimeSlotOccupied(monthDays[$index], timeSlot) && selectDate(monthDays[$index], timeSlot)\"\r\n ></div>\r\n @for (appointment of getAppointmentsForDataTime(monthDays[$index], timeSlot); track $index) {\r\n @if (extractTime(appointment.startDate) === timeSlot) {\r\n <div\r\n tabindex=\"0\"\r\n class=\"appointment\"\r\n [ngStyle]=\"getAppointmentHeightStyle(appointment)\"\r\n (mouseenter)=\"showTooltip(appointment, $event)\"\r\n (mouseleave)=\"hideTooltip()\"\r\n >\r\n <span>{{ appointment.name }}</span>\r\n </div>\r\n @if (hoveredAppointment === appointment) {\r\n <div class=\"tooltip\">\r\n <strong>{{ appointment.name }}</strong>\r\n <br>\r\n <span>Inizio: <span style=\"font-weight: 600;\">{{ extractTime(appointment.startDate) }}</span></span>\r\n <br>\r\n <span>Fine: <span style=\"font-weight: 600;\">{{ extractTime(appointment.endDate) }}</span></span>\r\n <br>\r\n <span>Creato il <span style=\"font-weight: 600;\">{{ appointment.createDate | date: 'dd/MM/yyyy HH:mm' }}</span> da <span style=\"font-weight: 600;\">{{ appointment.accountProfileId }}</span></span>\r\n </div>\r\n }\r\n }\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n <p-dialog [header]=\"'Nuova Prestazione per ' + this.selectedDateString + (this.selectedStartTime !== undefined || '00:00' ? ' alle ore ' + this.selectedStartTime : '')\" [modal]=\"true\" [(visible)]=\"newAppointment\" [style]=\"{ width: dialogWidth, height: '75%' }\" (onHide)=\"onDialogHide()\">\r\n <!-- <p-tabMenu \r\n [model]=\"items\"\r\n [activeItem]=\"activeItem\" \r\n (activeItemChange)=\"onActiveItemChange($event)\" \r\n /> -->\r\n <p-tabs\r\n [value]=\"activeValue || ''\"\r\n (valueChange)=\"onValueChange($event)\"\r\n >\r\n <p-tablist>\r\n @for (item of items; track $index) {\r\n <p-tab\r\n [value]=\"item['value'] || item.label || ''\"\r\n [disabled]=\"item.disabled\"\r\n class=\"flex items-center !gap-2 text-inherit\"\r\n >\r\n @if (item.icon) {\r\n <fa-icon [icon]=\"item.icon\"></fa-icon>\r\n }\r\n <span>{{ item.label }}</span>\r\n </p-tab>\r\n }\r\n </p-tablist>\r\n </p-tabs>\r\n <div class=\"dialog-container\">\r\n <div class=\"list-add-appointment\">\r\n @if (activeItem?.label === 'Appuntamento') {\r\n <div class=\"appointment-list-new-appointment\">\r\n @if (selectedAppointments.length !== 0) {\r\n <div class=\"appointment-title\">Appuntamenti per la giornata</div>\r\n }\r\n @if (selectedAppointments.length === 0) {\r\n <div class=\"appointment-none\">Non ci sono appuntamenti fissati</div>\r\n } @else {\r\n @for (appointment of selectedAppointments; track $index) {\r\n <div class=\"appointment-item\">\r\n <span class=\"appointment-time\">{{ extractTime(appointment.startDate) }} - {{ extractTime(appointment.endDate) }}</span>\r\n <span class=\"appointment-name\">{{ appointment.name }}</span> \r\n </div>\r\n }\r\n }\r\n </div>\r\n <div class=\"add-container\">\r\n <ng-content select=\".custom-input\"></ng-content>\r\n </div>\r\n } @else {\r\n <div class=\"add-prescription\">\r\n <ng-content select=\".custom-prescription\"></ng-content>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"save-button-container\">\r\n <ng-content select=\".save-button\"></ng-content>\r\n </div>\r\n </div>\r\n </p-dialog>\r\n </tbody>\r\n </table>\r\n }\r\n</div>", styles: [":root{--header-height: 42px;--total-weeks: 6}.container{max-width:1140px;margin:auto}.cell-overlay{position:absolute;width:100%;height:100%;z-index:50;cursor:pointer;top:0}.appointment{position:absolute;z-index:10;padding:5px 10px;margin-top:2px;font-size:12px;display:flex;justify-content:center;align-items:center;background:#e6e6fa;margin-left:3px;margin-right:3px;border-radius:5px;cursor:pointer;border:1px solid var(--secondary-blue-color);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:95%}.appointment span{text-align:left;line-height:15px;font-weight:600;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:block;max-width:100%}.more-appointments{font-size:12px;color:#555;cursor:pointer;text-align:center;font-weight:700;position:absolute;bottom:3%;display:flex;justify-content:center;width:100%}.more-appointments:hover{text-decoration:underline}.appointment-item{width:100%;display:flex;color:var(--primary-black-color);font-size:17px}.appointment-time{width:30%;font-weight:600}.appointment-name{width:70%}.tooltip{position:fixed;background:#fff;color:var(--primary-black-color);padding:20px;border-radius:5px;border:1px solid var(--primary-blue-color);box-shadow:0 4px 6px #0000001a;white-space:nowrap;z-index:10000000;min-width:200px;opacity:0;transition:opacity .15s ease-out;pointer-events:none}.tooltip strong{font-size:16px;font-weight:600}.appointment:hover .tooltip{display:block}.button-container{width:100%;display:flex;justify-content:center}.button-container lib-third-button{margin-top:5%}.dialog-container{width:100%;display:flex;flex-direction:column;margin-top:1%}.list-add-appointment{display:flex;width:100%}.appointment-list-new-appointment{width:35%;display:flex;color:var(--primary-black-color);font-size:17px;border-right:2px solid var(--primary-blue-color);flex-direction:column;height:435px;overflow:auto;align-items:center}.appointment-title{width:100%;display:flex;justify-content:center;align-items:flex-end;height:5%;font-size:17px;color:var(--primary-blue-color);font-weight:600}.appointment-none{width:100%;height:95%;display:flex;justify-content:center;align-items:center;font-size:17px;color:var(--primary-grey-color)}.add-container{width:65%;height:440px;overflow:auto;display:flex;flex-direction:column}.add-prescription{width:100%;height:425px;overflow:auto;display:flex;flex-direction:column}:host ::ng-deep .p-tabmenu-nav-content{font-size:17px;margin-top:-1%;margin-bottom:2%}:host ::ng-deep .p-tabmenu .p-tabmenu-nav .p-tabmenuitem.p-highlight .p-menuitem-link{border-color:var(--primary-blue-color);color:var(--primary-blue-color)}:host ::ng-deep .p-tabmenu-nav .p-menuitem-text{font-weight:600!important}:host ::ng-deep .p-tabmenu .p-tabmenu-nav .p-tabmenuitem .p-menuitem-link{color:var(--primary-grey-color)}:host ::ng-deep .p-tablist-tab-list{border-bottom:2px solid lightgray;display:flex;align-items:center;height:100%}:host ::ng-deep .p-tablist{height:50px}:host ::ng-deep .p-tablist-content{height:100%}:host ::ng-deep .p-tab{background-color:transparent;font-size:17px;color:var(--primary-grey-color);border-bottom:2px solid lightgray;height:100%;padding:0 2%;display:flex;align-items:center;border-top:0px solid}:host ::ng-deep .p-tab-active{border-top:0px solid;border-bottom:2px solid var(--primary-blue-color);color:var(--primary-blue-color)}:host ::ng-deep .p-tab-active span{font-weight:600}.save-button-container{display:flex;justify-content:center;margin-top:1%}:host ::ng-deep .p-dialog-header-close{color:var(--primary-red-color)}.calendar-view-month{margin-top:1rem}.calendar-view-month thead th{font-size:22px;font-weight:100;text-align:center;padding-bottom:20px}.calendar-view-month tbody tr td{vertical-align:top;position:relative;height:90px;padding:3px 0}.calendar-view-month tbody tr td.selected{background-color:#bbdefb}.calendar-view-month tbody tr td.today{background-color:#e3f2fd}.past-day .appointment{opacity:.7;pointer-events:auto!important}.past-day:not(.clickable-past) .cell-overlay{pointer-events:none;cursor:not-allowed;background-color:#0000001a}.clickable-past .cell-overlay{pointer-events:auto;cursor:pointer;background-color:#c8c8c878}.disabled,.disabled .cell-overlay{cursor:not-allowed!important;pointer-events:none}.disabled{cursor:not-allowed}.occupied{cursor:default!important}.calendar-view-month tbody tr td .date{text-align:center;font-size:20px;font-weight:100;padding:5px 10px 0}.calendar-view-week{border-collapse:collapse}.calendar-view-week thead th{font-size:22px;font-weight:100;text-align:center;border-bottom:1px solid #ddd}.calendar-view-week .contenitore-calendario{width:100%;overflow:auto;height:550px;position:relative}.contenitore-calendario td{overflow:visible}.calendar-view-week tbody tr td{position:relative;border-right:1px solid #ddd;height:50px;border-bottom:1px solid #ddd;padding:3px 0;width:calc(100% / 7);max-width:119.5px}.calendar-view-week tbody tr td.today{background-color:#e3f2fd}.calendar-view-week tbody tr td.calendar-slot-cell{width:1%;font-size:12px;font-weight:100;border-right:1px solid #ddd;padding-right:5px;vertical-align:top}.calendar-view-week tbody tr td.calendar-slot-cell span{position:relative;top:-12px;background:#fff;width:100%;display:block}.calendar-view-week tbody tr:last-child td{border-bottom:none;border-right:none}.calendar-view-week tbody tr:last-child td.calendar-slot-cell{border-right:none}.calendar-view-week tbody tr:last-child td .cell-overlay{display:none}.calendar-view-day{margin-top:1rem}.calendar-view-day tr:first-child td{border-top:1px solid #ddd}.calendar-view-day tr td{position:relative;border-bottom:1px solid #ddd;height:50px;padding:3px 0}.calendar-view-day tr td.calendar-slot-cell{font-size:12px;font-weight:100;border-right:1px solid #ddd;padding-right:5px;vertical-align:top}.calendar-view-day tr td.calendar-slot-cell span{position:relative;top:-12px;background:#fff;width:100%;display:block}.calendar-view-day tr:last-child td{border-bottom:none}.calendar-view-day tr:last-child td.calendar-slot-cell{border-right:none}.calendar-view-day tr:last-child td .cell-overlay{display:none}.calendar-container{width:100%;height:100%;display:flex;flex-direction:column;align-items:center}.calendar-container .calendar-header{display:flex;align-items:center;justify-content:space-between;width:100%;height:var(--header-height);padding:10px 0}.calendar-container .calendar-header h2{margin:0}.calendar-container .calendar-header .calendar-month{font-weight:700}.calendar-container .calendar-header .calendar-month span{font-weight:100}.calendar-container .calendar-header .calendar-controls{display:flex;justify-content:flex-end;align-items:center}.calendar-container .calendar-header .calendar-controls fa-icon{cursor:pointer}.black-icon{color:#000}.black-icon svg{fill:#000}@keyframes blink{0%{background-color:transparent}50%{background-color:#e3f2fd}to{background-color:transparent}}.blink{animation:blink 1s ease-out 1}@media only screen and (max-width: 1000px){.appointment-item{line-height:1}.appointment-time{width:40%}.appointment-name{width:60%}.calendar-container .calendar-header .calendar-month{line-height:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i2.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: "ngmodule", type: DialogModule }, { kind: "component", type: i4$1.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: ThirdButton, selector: "lib-third-button", inputs: ["text", "bgColor", "textColor", "icon", "position", "fontWeight", "width", "height", "borderRadius", "border", "disabled", "iconSpin", "fontSize"], outputs: ["onClick"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i5.Tabs, selector: "p-tabs", inputs: ["value", "scrollable", "lazy", "selectOnFocus", "showNavigators", "tabindex"], outputs: ["valueChange"] }, { kind: "component", type: i5.TabList, selector: "p-tablist" }, { kind: "component", type: i5.Tab, selector: "p-tab", inputs: ["value", "disabled"], outputs: ["valueChange"] }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
1140
+ }
1141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Calendar, decorators: [{
1142
+ type: Component,
1143
+ args: [{ selector: 'lib-calendar', imports: [CommonModule, FontAwesomeModule, DialogModule, ThirdButton, TabsModule], template: "<div class=\"container\">\r\n <div class=\"calendar-container\">\r\n <div class=\"calendar-header\">\r\n @if (currentView === 'week') {\r\n <lib-third-button\r\n text=\"\"\r\n [icon]=\"faChevronLeft\"\r\n [bgColor]=\"'transparent'\"\r\n [textColor]=\"'#2d519f'\"\r\n [width]=\"'40px'\"\r\n [height]=\"'40px'\"\r\n [border]=\"'none'\"\r\n (onClick)=\"switchToView(CalendarView.Month)\"\r\n >\r\n </lib-third-button>\r\n }\r\n <div>\r\n <h2 class=\"calendar-month\">\r\n {{ viewDate | date : \"MMMM\" | titlecase }}\r\n <span>{{ viewDate | date: \"y\" }}</span>\r\n </h2>\r\n </div>\r\n <div class=\"calendar-controls\">\r\n <fa-icon \r\n [icon]=\"faChevronLeft\"\r\n (click)=\"previous()\"\r\n style=\"margin-right: 10px; color: #2d519f;\"\r\n ></fa-icon>\r\n <lib-third-button\r\n text=\"Oggi\"\r\n [bgColor]=\"'transparent'\"\r\n [textColor]=\"'#2d519f'\"\r\n [width]=\"'80px'\"\r\n [height]=\"'40px'\"\r\n [border]=\"'1px solid #2d519f'\"\r\n (onClick)=\"viewToday()\"\r\n >\r\n </lib-third-button>\r\n <fa-icon \r\n [icon]=\"faChevronRight\"\r\n (click)=\"next()\"\r\n style=\"margin-left: 10px; color: #2d519f;\"\r\n ></fa-icon>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Month view -->\r\n @if (currentView === 'month') {\r\n <table\r\n width=\"100%\"\r\n cellspacing=\"0\"\r\n cellpadding=\"0\"\r\n class=\"calendar-view-month\"\r\n >\r\n <thead>\r\n <tr>\r\n @for (day of weekDays; track $index) {\r\n <th>{{ day }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (week of weeks; track $index) {\r\n <tr>\r\n @for (date of week; track $index) {\r\n <td \r\n [class.today]=\"isToday(date)\" \r\n [ngStyle]=\"{ opacity: isCurrentMonth(date) ? '1' : '0.5' }\"\r\n [ngClass]=\"{'past-day': isPastDate(date), 'clickable-past': isPastDate(date) && hasAppointments(date)}\"\r\n >\r\n <div\r\n (click)=\"selectDate(date)\"\r\n class=\"cell-overlay\"\r\n tabindex=\"0\"\r\n ></div>\r\n <div class=\"date\">\r\n {{ date.getDate() }}\r\n </div>\r\n <div class=\"appointments\">\r\n @if (getFirstAppointmentForDate(date, timeSlots)) {\r\n <div\r\n tabindex=\"0\"\r\n class=\"appointment\"\r\n [ngStyle]=\"{ 'background-color': 'var(--appointment-blue-color)' }\"\r\n >\r\n <span>{{ getFirstAppointmentForDate(date, timeSlots)?.name }}</span>\r\n </div>\r\n \r\n @if (getAppointmentsForDate(date, timeSlots).length > 1) {\r\n <div class=\"more-appointments\">\r\n +{{ getAppointmentsForDate(date, timeSlots).length - 1 }} altr{{ getAppointmentsForDate(date, timeSlots).length - 1 > 1 ? 'i' : 'o' }}\r\n </div>\r\n }\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n <p-dialog [header]=\"'Lista appuntamenti per il ' + this.selectedDateString\" [modal]=\"true\" [(visible)]=\"visibleList\" [style]=\"{ width: '35%' }\">\r\n <div class=\"appointment-list\">\r\n @for (appointment of selectedAppointments; track $index) {\r\n <div class=\"appointment-item\">\r\n <span class=\"appointment-time\">{{ extractTime(appointment.startDate) }} - {{ extractTime(appointment.endDate) }}</span>\r\n <span class=\"appointment-name\">{{ appointment.name }}</span> \r\n </div>\r\n }\r\n </div>\r\n @if (!isPastDate(selectedDate!)) {\r\n <div class=\"button-container\">\r\n <lib-third-button\r\n text=\"Aggiungi nuovo\"\r\n [bgColor]=\"'var(--primary-blue-color)'\"\r\n [textColor]=\"'white'\"\r\n [width]=\"'200px'\"\r\n [height]=\"'40px'\"\r\n [fontWeight]=\"'600'\"\r\n [border]=\"'1px solid var(--primary-blue-color)'\"\r\n [icon]=\"faCirclePlus\"\r\n (onClick)=\"toggleNewAppointment()\"\r\n >\r\n </lib-third-button>\r\n </div>\r\n }\r\n </p-dialog>\r\n </tbody>\r\n </table>\r\n }\r\n\r\n <!-- Week view -->\r\n @if (currentView === 'week') {\r\n <table\r\n width=\"100%\"\r\n height=\"100%\"\r\n cellspacing=\"0\"\r\n cellpadding=\"0\"\r\n class=\"calendar-view-week\"\r\n >\r\n <thead>\r\n <tr>\r\n <th></th>\r\n @for (day of weekDays; track $index) {\r\n <th>{{ day }} {{ monthDays[$index].getDate() }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody class=\"contenitore-calendario\">\r\n @for (timeSlot of timeSlots; track $index) {\r\n <tr>\r\n <td [width]=\"10\" class=\"calendar-slot-cell\">\r\n <span>{{ timeSlot }}</span>\r\n </td>\r\n @for (day of weekDays; track $index) {\r\n <td [class.today]=\"isToday(monthDays[$index])\" \r\n [ngClass]=\"\r\n {'blink': selectedDate && isSameDate(monthDays[$index], selectedDate), \r\n 'past-day': isPastDate(monthDays[$index]), \r\n 'clickable-past': isPastDate(monthDays[$index]) && hasAppointments(monthDays[$index]),\r\n 'disabled': isPastTime(monthDays[$index], timeSlot) && !isTimeSlotOccupied(monthDays[$index], timeSlot),\r\n 'occupied': isTimeSlotOccupied(monthDays[$index], timeSlot)\r\n }\"\r\n >\r\n <div \r\n class=\"cell-overlay\"\r\n style=\"z-index: 0;\"\r\n tabindex=\"0\"\r\n [class.occupied]=\"isTimeSlotOccupied(monthDays[$index], timeSlot)\"\r\n (click)=\"!isTimeSlotOccupied(monthDays[$index], timeSlot) && selectDate(monthDays[$index], timeSlot)\"\r\n ></div>\r\n @for (appointment of getAppointmentsForDataTime(monthDays[$index], timeSlot); track $index) {\r\n @if (extractTime(appointment.startDate) === timeSlot) {\r\n <div\r\n tabindex=\"0\"\r\n class=\"appointment\"\r\n [ngStyle]=\"getAppointmentHeightStyle(appointment)\"\r\n (mouseenter)=\"showTooltip(appointment, $event)\"\r\n (mouseleave)=\"hideTooltip()\"\r\n >\r\n <span>{{ appointment.name }}</span>\r\n </div>\r\n @if (hoveredAppointment === appointment) {\r\n <div class=\"tooltip\">\r\n <strong>{{ appointment.name }}</strong>\r\n <br>\r\n <span>Inizio: <span style=\"font-weight: 600;\">{{ extractTime(appointment.startDate) }}</span></span>\r\n <br>\r\n <span>Fine: <span style=\"font-weight: 600;\">{{ extractTime(appointment.endDate) }}</span></span>\r\n <br>\r\n <span>Creato il <span style=\"font-weight: 600;\">{{ appointment.createDate | date: 'dd/MM/yyyy HH:mm' }}</span> da <span style=\"font-weight: 600;\">{{ appointment.accountProfileId }}</span></span>\r\n </div>\r\n }\r\n }\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n <p-dialog [header]=\"'Nuova Prestazione per ' + this.selectedDateString + (this.selectedStartTime !== undefined || '00:00' ? ' alle ore ' + this.selectedStartTime : '')\" [modal]=\"true\" [(visible)]=\"newAppointment\" [style]=\"{ width: dialogWidth, height: '75%' }\" (onHide)=\"onDialogHide()\">\r\n <!-- <p-tabMenu \r\n [model]=\"items\"\r\n [activeItem]=\"activeItem\" \r\n (activeItemChange)=\"onActiveItemChange($event)\" \r\n /> -->\r\n <p-tabs\r\n [value]=\"activeValue || ''\"\r\n (valueChange)=\"onValueChange($event)\"\r\n >\r\n <p-tablist>\r\n @for (item of items; track $index) {\r\n <p-tab\r\n [value]=\"item['value'] || item.label || ''\"\r\n [disabled]=\"item.disabled\"\r\n class=\"flex items-center !gap-2 text-inherit\"\r\n >\r\n @if (item.icon) {\r\n <fa-icon [icon]=\"item.icon\"></fa-icon>\r\n }\r\n <span>{{ item.label }}</span>\r\n </p-tab>\r\n }\r\n </p-tablist>\r\n </p-tabs>\r\n <div class=\"dialog-container\">\r\n <div class=\"list-add-appointment\">\r\n @if (activeItem?.label === 'Appuntamento') {\r\n <div class=\"appointment-list-new-appointment\">\r\n @if (selectedAppointments.length !== 0) {\r\n <div class=\"appointment-title\">Appuntamenti per la giornata</div>\r\n }\r\n @if (selectedAppointments.length === 0) {\r\n <div class=\"appointment-none\">Non ci sono appuntamenti fissati</div>\r\n } @else {\r\n @for (appointment of selectedAppointments; track $index) {\r\n <div class=\"appointment-item\">\r\n <span class=\"appointment-time\">{{ extractTime(appointment.startDate) }} - {{ extractTime(appointment.endDate) }}</span>\r\n <span class=\"appointment-name\">{{ appointment.name }}</span> \r\n </div>\r\n }\r\n }\r\n </div>\r\n <div class=\"add-container\">\r\n <ng-content select=\".custom-input\"></ng-content>\r\n </div>\r\n } @else {\r\n <div class=\"add-prescription\">\r\n <ng-content select=\".custom-prescription\"></ng-content>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"save-button-container\">\r\n <ng-content select=\".save-button\"></ng-content>\r\n </div>\r\n </div>\r\n </p-dialog>\r\n </tbody>\r\n </table>\r\n }\r\n</div>", styles: [":root{--header-height: 42px;--total-weeks: 6}.container{max-width:1140px;margin:auto}.cell-overlay{position:absolute;width:100%;height:100%;z-index:50;cursor:pointer;top:0}.appointment{position:absolute;z-index:10;padding:5px 10px;margin-top:2px;font-size:12px;display:flex;justify-content:center;align-items:center;background:#e6e6fa;margin-left:3px;margin-right:3px;border-radius:5px;cursor:pointer;border:1px solid var(--secondary-blue-color);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:95%}.appointment span{text-align:left;line-height:15px;font-weight:600;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:block;max-width:100%}.more-appointments{font-size:12px;color:#555;cursor:pointer;text-align:center;font-weight:700;position:absolute;bottom:3%;display:flex;justify-content:center;width:100%}.more-appointments:hover{text-decoration:underline}.appointment-item{width:100%;display:flex;color:var(--primary-black-color);font-size:17px}.appointment-time{width:30%;font-weight:600}.appointment-name{width:70%}.tooltip{position:fixed;background:#fff;color:var(--primary-black-color);padding:20px;border-radius:5px;border:1px solid var(--primary-blue-color);box-shadow:0 4px 6px #0000001a;white-space:nowrap;z-index:10000000;min-width:200px;opacity:0;transition:opacity .15s ease-out;pointer-events:none}.tooltip strong{font-size:16px;font-weight:600}.appointment:hover .tooltip{display:block}.button-container{width:100%;display:flex;justify-content:center}.button-container lib-third-button{margin-top:5%}.dialog-container{width:100%;display:flex;flex-direction:column;margin-top:1%}.list-add-appointment{display:flex;width:100%}.appointment-list-new-appointment{width:35%;display:flex;color:var(--primary-black-color);font-size:17px;border-right:2px solid var(--primary-blue-color);flex-direction:column;height:435px;overflow:auto;align-items:center}.appointment-title{width:100%;display:flex;justify-content:center;align-items:flex-end;height:5%;font-size:17px;color:var(--primary-blue-color);font-weight:600}.appointment-none{width:100%;height:95%;display:flex;justify-content:center;align-items:center;font-size:17px;color:var(--primary-grey-color)}.add-container{width:65%;height:440px;overflow:auto;display:flex;flex-direction:column}.add-prescription{width:100%;height:425px;overflow:auto;display:flex;flex-direction:column}:host ::ng-deep .p-tabmenu-nav-content{font-size:17px;margin-top:-1%;margin-bottom:2%}:host ::ng-deep .p-tabmenu .p-tabmenu-nav .p-tabmenuitem.p-highlight .p-menuitem-link{border-color:var(--primary-blue-color);color:var(--primary-blue-color)}:host ::ng-deep .p-tabmenu-nav .p-menuitem-text{font-weight:600!important}:host ::ng-deep .p-tabmenu .p-tabmenu-nav .p-tabmenuitem .p-menuitem-link{color:var(--primary-grey-color)}:host ::ng-deep .p-tablist-tab-list{border-bottom:2px solid lightgray;display:flex;align-items:center;height:100%}:host ::ng-deep .p-tablist{height:50px}:host ::ng-deep .p-tablist-content{height:100%}:host ::ng-deep .p-tab{background-color:transparent;font-size:17px;color:var(--primary-grey-color);border-bottom:2px solid lightgray;height:100%;padding:0 2%;display:flex;align-items:center;border-top:0px solid}:host ::ng-deep .p-tab-active{border-top:0px solid;border-bottom:2px solid var(--primary-blue-color);color:var(--primary-blue-color)}:host ::ng-deep .p-tab-active span{font-weight:600}.save-button-container{display:flex;justify-content:center;margin-top:1%}:host ::ng-deep .p-dialog-header-close{color:var(--primary-red-color)}.calendar-view-month{margin-top:1rem}.calendar-view-month thead th{font-size:22px;font-weight:100;text-align:center;padding-bottom:20px}.calendar-view-month tbody tr td{vertical-align:top;position:relative;height:90px;padding:3px 0}.calendar-view-month tbody tr td.selected{background-color:#bbdefb}.calendar-view-month tbody tr td.today{background-color:#e3f2fd}.past-day .appointment{opacity:.7;pointer-events:auto!important}.past-day:not(.clickable-past) .cell-overlay{pointer-events:none;cursor:not-allowed;background-color:#0000001a}.clickable-past .cell-overlay{pointer-events:auto;cursor:pointer;background-color:#c8c8c878}.disabled,.disabled .cell-overlay{cursor:not-allowed!important;pointer-events:none}.disabled{cursor:not-allowed}.occupied{cursor:default!important}.calendar-view-month tbody tr td .date{text-align:center;font-size:20px;font-weight:100;padding:5px 10px 0}.calendar-view-week{border-collapse:collapse}.calendar-view-week thead th{font-size:22px;font-weight:100;text-align:center;border-bottom:1px solid #ddd}.calendar-view-week .contenitore-calendario{width:100%;overflow:auto;height:550px;position:relative}.contenitore-calendario td{overflow:visible}.calendar-view-week tbody tr td{position:relative;border-right:1px solid #ddd;height:50px;border-bottom:1px solid #ddd;padding:3px 0;width:calc(100% / 7);max-width:119.5px}.calendar-view-week tbody tr td.today{background-color:#e3f2fd}.calendar-view-week tbody tr td.calendar-slot-cell{width:1%;font-size:12px;font-weight:100;border-right:1px solid #ddd;padding-right:5px;vertical-align:top}.calendar-view-week tbody tr td.calendar-slot-cell span{position:relative;top:-12px;background:#fff;width:100%;display:block}.calendar-view-week tbody tr:last-child td{border-bottom:none;border-right:none}.calendar-view-week tbody tr:last-child td.calendar-slot-cell{border-right:none}.calendar-view-week tbody tr:last-child td .cell-overlay{display:none}.calendar-view-day{margin-top:1rem}.calendar-view-day tr:first-child td{border-top:1px solid #ddd}.calendar-view-day tr td{position:relative;border-bottom:1px solid #ddd;height:50px;padding:3px 0}.calendar-view-day tr td.calendar-slot-cell{font-size:12px;font-weight:100;border-right:1px solid #ddd;padding-right:5px;vertical-align:top}.calendar-view-day tr td.calendar-slot-cell span{position:relative;top:-12px;background:#fff;width:100%;display:block}.calendar-view-day tr:last-child td{border-bottom:none}.calendar-view-day tr:last-child td.calendar-slot-cell{border-right:none}.calendar-view-day tr:last-child td .cell-overlay{display:none}.calendar-container{width:100%;height:100%;display:flex;flex-direction:column;align-items:center}.calendar-container .calendar-header{display:flex;align-items:center;justify-content:space-between;width:100%;height:var(--header-height);padding:10px 0}.calendar-container .calendar-header h2{margin:0}.calendar-container .calendar-header .calendar-month{font-weight:700}.calendar-container .calendar-header .calendar-month span{font-weight:100}.calendar-container .calendar-header .calendar-controls{display:flex;justify-content:flex-end;align-items:center}.calendar-container .calendar-header .calendar-controls fa-icon{cursor:pointer}.black-icon{color:#000}.black-icon svg{fill:#000}@keyframes blink{0%{background-color:transparent}50%{background-color:#e3f2fd}to{background-color:transparent}}.blink{animation:blink 1s ease-out 1}@media only screen and (max-width: 1000px){.appointment-item{line-height:1}.appointment-time{width:40%}.appointment-name{width:60%}.calendar-container .calendar-header .calendar-month{line-height:1}}\n"] }]
1144
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$1.PrimeNG }], propDecorators: { appointments: [{
1145
+ type: Input
1146
+ }], items: [{
1147
+ type: Input
1148
+ }], startHour: [{
1149
+ type: Input
1150
+ }], endHour: [{
1151
+ type: Input
1152
+ }], timeInterval: [{
1153
+ type: Input
1154
+ }], dateSelected: [{
1155
+ type: Output
1156
+ }], closeModal: [{
1157
+ type: Output
1158
+ }], tabChanged: [{
1159
+ type: Output
1160
+ }], onResize: [{
1161
+ type: HostListener,
1162
+ args: ['window:resize']
1163
+ }] } });
1164
+
1165
+ class Message {
1166
+ text = 'Messaggio di test';
1167
+ date = '12/03/2025 10:00';
1168
+ from = 'Test';
1169
+ bgColor = 'gainsboro';
1170
+ textColor = 'black';
1171
+ fontWeight = 'normal';
1172
+ width = '335px';
1173
+ minHeight = '100px';
1174
+ borderRadius = '5px';
1175
+ border = '';
1176
+ padding = '1% 2%';
1177
+ viewed;
1178
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Message, deps: [], target: i0.ɵɵFactoryTarget.Component });
1179
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: Message, isStandalone: true, selector: "lib-message", inputs: { text: "text", date: "date", from: "from", bgColor: "bgColor", textColor: "textColor", fontWeight: "fontWeight", width: "width", minHeight: "minHeight", borderRadius: "borderRadius", border: "border", padding: "padding", viewed: "viewed" }, ngImport: i0, template: "<!-- <button\r\n [ngStyle]=\"{\r\n 'background-color': bgColor,\r\n 'color': textColor,\r\n 'font-weight': fontWeight,\r\n 'width': width,\r\n 'height': height,\r\n 'border-radius': borderRadius,\r\n 'border': border\r\n }\"\r\n (click)=\"click()\"\r\n>\r\n @if(position === 'left' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-right: 10px;\"></fa-icon>\r\n }\r\n {{ text }}\r\n @if(position === 'right' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-left: 10px;\"></fa-icon>\r\n }\r\n</button> -->\r\n\r\n<div\r\n [ngStyle]=\"{\r\n 'background-color': bgColor,\r\n 'text': text,\r\n 'color': textColor,\r\n 'font-weight': fontWeight,\r\n 'width': width,\r\n 'min-height': minHeight,\r\n 'border-radius': borderRadius,\r\n 'border': border,\r\n 'padding': padding, \r\n }\"\r\n style=\"display: flex; flex-direction: column; justify-content: space-between\"\r\n> \r\n<div>\r\n <b>{{ from }}</b>\r\n <br>\r\n {{ text }}\r\n <br>\r\n</div>\r\n<div style=\"justify-content: end; display: flex;\">\r\n {{date}} <fa-icon [icon]=\"viewed\" style=\"margin-left: 10px;\"></fa-icon>\r\n</div>\r\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i2.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"] }] });
1180
+ }
1181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Message, decorators: [{
1182
+ type: Component,
1183
+ args: [{ selector: 'lib-message', imports: [CommonModule, FontAwesomeModule], template: "<!-- <button\r\n [ngStyle]=\"{\r\n 'background-color': bgColor,\r\n 'color': textColor,\r\n 'font-weight': fontWeight,\r\n 'width': width,\r\n 'height': height,\r\n 'border-radius': borderRadius,\r\n 'border': border\r\n }\"\r\n (click)=\"click()\"\r\n>\r\n @if(position === 'left' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-right: 10px;\"></fa-icon>\r\n }\r\n {{ text }}\r\n @if(position === 'right' && icon) {\r\n <fa-icon [icon]=\"icon\" style=\"margin-left: 10px;\"></fa-icon>\r\n }\r\n</button> -->\r\n\r\n<div\r\n [ngStyle]=\"{\r\n 'background-color': bgColor,\r\n 'text': text,\r\n 'color': textColor,\r\n 'font-weight': fontWeight,\r\n 'width': width,\r\n 'min-height': minHeight,\r\n 'border-radius': borderRadius,\r\n 'border': border,\r\n 'padding': padding, \r\n }\"\r\n style=\"display: flex; flex-direction: column; justify-content: space-between\"\r\n> \r\n<div>\r\n <b>{{ from }}</b>\r\n <br>\r\n {{ text }}\r\n <br>\r\n</div>\r\n<div style=\"justify-content: end; display: flex;\">\r\n {{date}} <fa-icon [icon]=\"viewed\" style=\"margin-left: 10px;\"></fa-icon>\r\n</div>\r\n</div>" }]
1184
+ }], propDecorators: { text: [{
1185
+ type: Input
1186
+ }], date: [{
1187
+ type: Input
1188
+ }], from: [{
1189
+ type: Input
1190
+ }], bgColor: [{
1191
+ type: Input
1192
+ }], textColor: [{
1193
+ type: Input
1194
+ }], fontWeight: [{
1195
+ type: Input
1196
+ }], width: [{
1197
+ type: Input
1198
+ }], minHeight: [{
1199
+ type: Input
1200
+ }], borderRadius: [{
1201
+ type: Input
1202
+ }], border: [{
1203
+ type: Input
1204
+ }], padding: [{
1205
+ type: Input
1206
+ }], viewed: [{
1207
+ type: Input
1208
+ }] } });
1209
+
1210
+ const API_CONFIG = new InjectionToken('API_CONFIG');
1211
+
1212
+ class ApiSurveyService {
1213
+ gateway;
1214
+ endpoint;
1215
+ constructor(gateway) {
1216
+ this.gateway = gateway;
1217
+ this.endpoint = `${this.gateway}/Survey/`;
1218
+ }
1219
+ http = inject(HttpClient);
1220
+ //###############
1221
+ //##### GET #####
1222
+ //###############
1223
+ //funzioni per la ricerca dei tipi di domanda in base al parametro
1224
+ getQuestionByParameters(typeSurvey, stepNumber) {
1225
+ const params = new HttpParams().set('typeSurvey', typeSurvey).set('stepNumber', stepNumber);
1226
+ return this.http.get(`${this.endpoint}Question`, {
1227
+ params: params,
1228
+ });
1229
+ }
1230
+ getQuestionByTypeSurvey(typeSurvey) {
1231
+ const params = new HttpParams().set('typeSurvey', typeSurvey);
1232
+ return this.http.get(`${this.endpoint}Question`, {
1233
+ params: params,
1234
+ });
1235
+ }
1236
+ getQuestionByQuestionId(questionId) {
1237
+ const params = new HttpParams().set('questionId', questionId);
1238
+ return this.http.get(`${this.endpoint}Question`, {
1239
+ params: params,
1240
+ });
1241
+ }
1242
+ getStepByTypeSurvey(typeSurvey) {
1243
+ const params = new HttpParams().set('typeSurvey', typeSurvey);
1244
+ return this.http.get(`${this.endpoint}Step`, {
1245
+ params: params,
1246
+ });
1247
+ }
1248
+ getStepByStepNumber(stepNumber) {
1249
+ const params = new HttpParams().set('stepNumber', stepNumber);
1250
+ return this.http.get(`${this.endpoint}Step`, {
1251
+ params: params,
1252
+ });
1253
+ }
1254
+ getSurveys() {
1255
+ return this.http.get(`${this.endpoint}`);
1256
+ }
1257
+ getSurvey(patientId, surveyType, surveyId, lastSurvey) {
1258
+ const params = new HttpParams().set('patientId', patientId).set('surveyType', surveyType).set('surveyId', surveyId).set('lastSurvey', lastSurvey);
1259
+ return this.http.get(`${this.endpoint}`, {
1260
+ params: params,
1261
+ });
1262
+ }
1263
+ getSurveyById(surveyId) {
1264
+ const params = new HttpParams().set('surveyId', surveyId);
1265
+ return this.http.get(`${this.endpoint}`, {
1266
+ params: params,
1267
+ });
1268
+ }
1269
+ getLastSurvey(patientId, surveyType, lastSurvey) {
1270
+ const params = new HttpParams().set('patientId', patientId).set('surveyType', surveyType).set('lastSurvey', lastSurvey);
1271
+ return this.http.get(`${this.endpoint}Survey`, {
1272
+ params: params,
1273
+ });
1274
+ }
1275
+ // getSurveyByPatientId(patientId: string): Observable<IPatientSurveyResponse[]> {
1276
+ // const params = new HttpParams().set('patientId', patientId);
1277
+ // return this.http.get<IPatientSurveyResponse[]>(`${this.endpoint}Survey`, {
1278
+ // params: params,
1279
+ // });
1280
+ // }
1281
+ // getSurveyBySurveyType(surveyType: number): Observable<IPatientSurveyResponse[]> {
1282
+ // const params = new HttpParams().set('surveyType', surveyType);
1283
+ // return this.http.get<IPatientSurveyResponse[]>(`${this.endpoint}Survey`, {
1284
+ // params: params,
1285
+ // });
1286
+ // }
1287
+ // getLastSurvey(lastSurvey: bool): Observable<IPatientSurveyResponse[]> {
1288
+ // const params = new HttpParams().set('lastSurvey', lastSurvey);
1289
+ // return this.http.get<IPatientSurveyResponse[]>(`${this.endpoint}Survey`, {
1290
+ // params: params,
1291
+ // });
1292
+ // }
1293
+ //##############
1294
+ //#### POST ####
1295
+ //##############
1296
+ postSurvey(patientSurveyRequest) {
1297
+ return this.http.post(`${this.endpoint}`, patientSurveyRequest);
1298
+ }
1299
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiSurveyService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
1300
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiSurveyService, providedIn: 'root' });
1301
+ }
1302
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiSurveyService, decorators: [{
1303
+ type: Injectable,
1304
+ args: [{
1305
+ providedIn: 'root'
1306
+ }]
1307
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1308
+ type: Inject,
1309
+ args: [API_CONFIG]
1310
+ }] }] });
1311
+
1312
+ class SurveyRadio {
1313
+ apiSurvey = inject(ApiSurveyService);
1314
+ question;
1315
+ typeSurvey = 0;
1316
+ patientSurvey = "";
1317
+ patientId;
1318
+ questionAnswer = new EventEmitter();
1319
+ filteredSurvey = {};
1320
+ //variabile per l'emitter, composta da id domanda e id risposta
1321
+ questionAnswerObject = {};
1322
+ ngOnInit() {
1323
+ if (this.patientSurvey != null && this.patientSurvey != "") {
1324
+ this.searchSurvey(this.patientSurvey);
1325
+ }
1326
+ }
1327
+ selectedValue(idQuestion, idAnswer) {
1328
+ this.questionAnswerObject.idQuestion = idQuestion,
1329
+ this.questionAnswerObject.idAnswer = idAnswer,
1330
+ this.questionAnswerObject.idTypeSurvey = this.typeSurvey,
1331
+ this.questionAnswer.emit(this.questionAnswerObject);
1332
+ }
1333
+ searchSurvey(surveyId) {
1334
+ // console.log("res2: ", this.filteredSurvey)
1335
+ // console.log("params2: ", surveyId)
1336
+ this.apiSurvey.getSurveyById(surveyId).subscribe((res) => {
1337
+ // console.log("res: ", this.filteredSurvey)
1338
+ // console.log("params: ", surveyId)
1339
+ this.filteredSurvey = res;
1340
+ });
1341
+ }
1342
+ getMatchingAnswer(surveyId, answerId) {
1343
+ // console.log("resultArray: ", surveyId + answerId)
1344
+ // this.question?.answers.forEach(answer => {
1345
+ // if (answer.id == answerId){
1346
+ // return true
1347
+ // }
1348
+ // return false
1349
+ // });
1350
+ return this.question.answers.some((item) => item.id === answerId);
1351
+ }
1352
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SurveyRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
1353
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: SurveyRadio, isStandalone: true, selector: "lib-survey-radio", inputs: { question: "question", typeSurvey: "typeSurvey", patientSurvey: "patientSurvey", patientId: "patientId" }, outputs: { questionAnswer: "questionAnswer" }, ngImport: i0, template: "<div class=\"survey-component group-radio\">\r\n <div class=\"group-radio-description\">\r\n <label>{{question?.text}}</label>\r\n </div>\r\n <div class=\"group-radio-radioList\"> \r\n @for (answer of question?.answers; track answer.id) {\r\n @if(patientSurvey != \"\"){\r\n @if (getMatchingAnswer(patientSurvey, answer.id)) {\r\n <input type=\"radio\" checked [name]=\"question?.text\" class=\"radio-value survey-control\" (change)=\"selectedValue(question?.id, answer?.id)\">\r\n <label>{{answer.text}}</label> \r\n } @else {\r\n <input type=\"radio\" [name]=\"question?.text\" class=\"radio-value survey-control\" (change)=\"selectedValue(question?.id, answer?.id)\">\r\n <label>{{answer.text}}</label> \r\n }\r\n } @else {\r\n <input type=\"radio\" [name]=\"question?.text\" class=\"radio-value survey-control\" (change)=\"selectedValue(question?.id, answer?.id)\">\r\n <label>{{answer.text}}</label> \r\n }\r\n }\r\n </div>\r\n</div>", styles: [".group-radio{width:100%;display:flex;align-items:center;padding:0 1%}.group-radio-description{width:64%;line-height:1}.group-radio{display:flex;justify-content:space-between;margin:1% 0}.group-radio label{align-self:center;width:24%}.group-radio-radioList{display:flex;width:30%}input[type=radio]{appearance:none;-webkit-appearance:none;width:12px;height:12px;border:1.8px solid var(--primary-blue-color);border-radius:50%;background-color:transparent;cursor:pointer;margin-right:4px;align-self:center}input[type=radio]:checked{background:var(--primary-blue-color);position:relative}input[type=radio]:checked:after{content:\"\";position:absolute;width:4px;height:4px;border-radius:50%;background-color:#fff;top:50%;left:50%;transform:translate(-50%,-50%)}\n"] });
1354
+ }
1355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SurveyRadio, decorators: [{
1356
+ type: Component,
1357
+ args: [{ selector: 'lib-survey-radio', imports: [], template: "<div class=\"survey-component group-radio\">\r\n <div class=\"group-radio-description\">\r\n <label>{{question?.text}}</label>\r\n </div>\r\n <div class=\"group-radio-radioList\"> \r\n @for (answer of question?.answers; track answer.id) {\r\n @if(patientSurvey != \"\"){\r\n @if (getMatchingAnswer(patientSurvey, answer.id)) {\r\n <input type=\"radio\" checked [name]=\"question?.text\" class=\"radio-value survey-control\" (change)=\"selectedValue(question?.id, answer?.id)\">\r\n <label>{{answer.text}}</label> \r\n } @else {\r\n <input type=\"radio\" [name]=\"question?.text\" class=\"radio-value survey-control\" (change)=\"selectedValue(question?.id, answer?.id)\">\r\n <label>{{answer.text}}</label> \r\n }\r\n } @else {\r\n <input type=\"radio\" [name]=\"question?.text\" class=\"radio-value survey-control\" (change)=\"selectedValue(question?.id, answer?.id)\">\r\n <label>{{answer.text}}</label> \r\n }\r\n }\r\n </div>\r\n</div>", styles: [".group-radio{width:100%;display:flex;align-items:center;padding:0 1%}.group-radio-description{width:64%;line-height:1}.group-radio{display:flex;justify-content:space-between;margin:1% 0}.group-radio label{align-self:center;width:24%}.group-radio-radioList{display:flex;width:30%}input[type=radio]{appearance:none;-webkit-appearance:none;width:12px;height:12px;border:1.8px solid var(--primary-blue-color);border-radius:50%;background-color:transparent;cursor:pointer;margin-right:4px;align-self:center}input[type=radio]:checked{background:var(--primary-blue-color);position:relative}input[type=radio]:checked:after{content:\"\";position:absolute;width:4px;height:4px;border-radius:50%;background-color:#fff;top:50%;left:50%;transform:translate(-50%,-50%)}\n"] }]
1358
+ }], propDecorators: { question: [{
1359
+ type: Input
1360
+ }], typeSurvey: [{
1361
+ type: Input
1362
+ }], patientSurvey: [{
1363
+ type: Input
1364
+ }], patientId: [{
1365
+ type: Input
1366
+ }], questionAnswer: [{
1367
+ type: Output
1368
+ }] } });
1369
+
1370
+ class SurveyText {
1371
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SurveyText, deps: [], target: i0.ɵɵFactoryTarget.Component });
1372
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: SurveyText, isStandalone: true, selector: "lib-survey-text", ngImport: i0, template: "<p>survey-text works!</p>\r\n", styles: [""] });
1373
+ }
1374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SurveyText, decorators: [{
1375
+ type: Component,
1376
+ args: [{ selector: 'lib-survey-text', imports: [], template: "<p>survey-text works!</p>\r\n" }]
1377
+ }] });
1378
+
1379
+ class SurveyLabel {
1380
+ question;
1381
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SurveyLabel, deps: [], target: i0.ɵɵFactoryTarget.Component });
1382
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: SurveyLabel, isStandalone: true, selector: "lib-survey-label", inputs: { question: "question" }, ngImport: i0, template: "<div class=\"label\">\r\n <label>{{question?.text}}</label>\r\n</div>", styles: [".label{width:100%;display:flex;align-items:center;padding:0 1%;background-color:var(--primary-blue-color);color:#fff;font-weight:600}\n"] });
1383
+ }
1384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SurveyLabel, decorators: [{
1385
+ type: Component,
1386
+ args: [{ selector: 'lib-survey-label', imports: [], template: "<div class=\"label\">\r\n <label>{{question?.text}}</label>\r\n</div>", styles: [".label{width:100%;display:flex;align-items:center;padding:0 1%;background-color:var(--primary-blue-color);color:#fff;font-weight:600}\n"] }]
1387
+ }], propDecorators: { question: [{
1388
+ type: Input
1389
+ }] } });
1390
+
1391
+ class SurveyValuebox {
1392
+ apiSurvey = inject(ApiSurveyService);
1393
+ question;
1394
+ typeSurvey = 0;
1395
+ indexQuestion = 0;
1396
+ patientSurvey = '';
1397
+ patientId;
1398
+ sumOutput = new EventEmitter();
1399
+ questionAnswer = new EventEmitter();
1400
+ filteredSurvey = {};
1401
+ sum = 0;
1402
+ //variabile che indica che sarà un oggetto in cui le chiavi saranno numeri, i valori associati ad ogni chiave sara number o stringa,
1403
+ //quindi ogni key avrà cosi un suo valore
1404
+ selectedValues = {};
1405
+ //variabile per l'emitter, composta da id domanda e id risposta
1406
+ questionAnswerObject = {};
1407
+ sumValue(valueSelected, groupIndex, idQuestion, idAnswer) {
1408
+ const radioGroup = document.querySelectorAll('input[type="radio"].radio-value');
1409
+ this.sum = 0; // Resetta la somma
1410
+ radioGroup.forEach((radio) => {
1411
+ if (radio.checked) {
1412
+ this.sum += parseInt(radio.value);
1413
+ }
1414
+ });
1415
+ this.selectedValues[groupIndex] = valueSelected;
1416
+ this.sumOutput.emit(this.sum);
1417
+ this.questionAnswerObject.idQuestion = idQuestion,
1418
+ this.questionAnswerObject.idAnswer = idAnswer,
1419
+ this.questionAnswerObject.idTypeSurvey = this.typeSurvey,
1420
+ this.questionAnswer.emit(this.questionAnswerObject);
1421
+ }
1422
+ ngOnInit() {
1423
+ if (this.patientSurvey != null && this.patientSurvey != '') {
1424
+ this.searchSurvey(this.patientSurvey);
1425
+ }
1426
+ }
1427
+ searchSurvey(surveyId) {
1428
+ this.apiSurvey.getSurveyById(surveyId).subscribe((res) => {
1429
+ this.filteredSurvey = res;
1430
+ // console.log('Dati ricevuti:', res);
1431
+ this.initializeSelectedValues();
1432
+ });
1433
+ }
1434
+ getMatchingAnswer(answerId) {
1435
+ if (!this.filteredSurvey || !answerId || Object.keys(this.filteredSurvey).length === 0) {
1436
+ return false;
1437
+ }
1438
+ ;
1439
+ if (this.filteredSurvey.results && Array.isArray(this.filteredSurvey.results)) {
1440
+ return this.filteredSurvey.results.some((result) => {
1441
+ if (result.question && result.question.id === this.question?.id) {
1442
+ return result.answer && result.answer.id === answerId;
1443
+ }
1444
+ return false;
1445
+ });
1446
+ }
1447
+ return false;
1448
+ }
1449
+ initializeSelectedValues() {
1450
+ // console.log('=== INIZIO initializeSelectedValues ===');
1451
+ if (this.filteredSurvey && this.filteredSurvey.results) {
1452
+ this.filteredSurvey.results.forEach((result, index) => {
1453
+ // console.log(`--- Result ${index} ---`);
1454
+ // console.log('result.question.id:', result.question?.id);
1455
+ // console.log('this.question?.id:', this.question?.id);
1456
+ if (result.question && result.question.id === this.question?.id) {
1457
+ // console.log('✅ DOMANDA TROVATA!');
1458
+ // console.log('result.value:', result.value);
1459
+ // Il valore è direttamente in result.value, non in result.answer.value
1460
+ if (result.value !== undefined && result.value !== null) {
1461
+ this.selectedValues[this.indexQuestion] = result.value;
1462
+ // console.log('✅ Valore inizializzato:', this.selectedValues[this.indexQuestion]);
1463
+ }
1464
+ else {
1465
+ console.log('❌ result.value è undefined o null');
1466
+ }
1467
+ }
1468
+ });
1469
+ }
1470
+ // console.log('selectedValues finale:', this.selectedValues);
1471
+ }
1472
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SurveyValuebox, deps: [], target: i0.ɵɵFactoryTarget.Component });
1473
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: SurveyValuebox, isStandalone: true, selector: "lib-survey-valuebox", inputs: { question: "question", typeSurvey: "typeSurvey", indexQuestion: "indexQuestion", patientSurvey: "patientSurvey", patientId: "patientId" }, outputs: { sumOutput: "sumOutput", questionAnswer: "questionAnswer" }, ngImport: i0, template: "<p>survey-valuebox works!</p>\r\n<!-- <div class=\"survey-container\">\r\n <div class=\"survey-question\">\r\n {{question?.text}}\r\n </div>\r\n <div class=\"survey-answer-container group-radio\">\r\n <div class=\"survey-answer-list\">\r\n @for (answer of question?.answers; track $index) {\r\n <div class=\"survey-answer-group\">\r\n <div class=\"survey-answer\">\r\n <input type=\"radio\" [name]=\"question?.text\" value=\"{{answer.value}}\" class=\"radio-value survey-control\" (change)=\"sumValue(answer.value, indexQuestion, question?.id, answer?.id)\">\r\n <label>{{answer.text}}</label>\r\n </div>\r\n </div>\r\n } \r\n </div>\r\n <div class=\"survey-answer-value\">\r\n <span>{{ selectedValues[indexQuestion] !== undefined ? selectedValues[indexQuestion] : '--' }}</span>\r\n </div> \r\n </div>\r\n</div> -->\r\n\r\n<div class=\"survey-container\">\r\n <div class=\"survey-question\">\r\n {{ question?.text }}\r\n </div>\r\n <div class=\"survey-answer-container group-radio\">\r\n <div class=\"survey-answer-list\">\r\n @for (answer of question?.answers; track answer.id) {\r\n <div class=\"survey-answer-group\">\r\n <div class=\"survey-answer\">\r\n @if (patientSurvey && patientSurvey !== '') {\r\n @if (getMatchingAnswer(answer.id)) {\r\n <input type=\"radio\" checked [name]=\"question?.text\" value=\"{{answer.value}}\" class=\"radio-value survey-control\" (change)=\"sumValue(answer.value, indexQuestion, question?.id, answer?.id)\">\r\n <label>{{ answer.text }}</label>\r\n } @else {\r\n <input type=\"radio\" [name]=\"question?.text\" value=\"{{answer.value}}\" class=\"radio-value survey-control\" (change)=\"sumValue(answer.value, indexQuestion, question?.id, answer?. id)\">\r\n <label>{{ answer.text }}</label>\r\n }\r\n } @else {\r\n <input type=\"radio\" [name]=\"question?.text\" value=\"{{answer.value}}\" class=\"radio-value survey-control\" (change)=\"sumValue(answer.value, indexQuestion, question?.id, answer?.id)\">\r\n <label>{{ answer.text }}</label>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"survey-answer-value\">\r\n <span>{{ selectedValues[indexQuestion] !== undefined ? selectedValues[indexQuestion] : '--' }}</span>\r\n </div>\r\n </div>\r\n</div>", styles: [".survey-container{min-height:100%;width:100%;position:relative;display:flex;flex-direction:column}.survey-question{background-color:var(--primary-blue-color);color:#fff;min-height:3rem;display:flex;align-items:center;padding:10px 1%}.survey-answer-container{flex:1;width:100%;display:flex}.survey-answer-list{width:85%;display:flex;flex-direction:column;flex:1}.survey-answer{display:flex;min-height:fit-content;padding:10px 0;word-break:break-word}.survey-answer label{font-size:large;align-self:center;margin-left:10px}.survey-answer-value{align-items:center;width:15%;background-color:var(--primary-bg);display:flex;justify-content:center}.survey-answer-value span{font-size:xx-large}input[type=radio]{appearance:none;-webkit-appearance:none;width:12px;height:12px;border:1.8px solid var(--primary-blue-color);border-radius:50%;background-color:transparent;cursor:pointer;margin-right:4px;align-self:center;flex:0 0 12px!important}input[type=radio]:checked{background:var(--primary-blue-color);position:relative}input[type=radio]:checked:after{content:\"\";position:absolute;width:4px;height:4px;border-radius:50%;background-color:#fff;top:50%;left:50%;transform:translate(-50%,-50%)}\n"] });
1474
+ }
1475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: SurveyValuebox, decorators: [{
1476
+ type: Component,
1477
+ args: [{ selector: 'lib-survey-valuebox', imports: [], template: "<p>survey-valuebox works!</p>\r\n<!-- <div class=\"survey-container\">\r\n <div class=\"survey-question\">\r\n {{question?.text}}\r\n </div>\r\n <div class=\"survey-answer-container group-radio\">\r\n <div class=\"survey-answer-list\">\r\n @for (answer of question?.answers; track $index) {\r\n <div class=\"survey-answer-group\">\r\n <div class=\"survey-answer\">\r\n <input type=\"radio\" [name]=\"question?.text\" value=\"{{answer.value}}\" class=\"radio-value survey-control\" (change)=\"sumValue(answer.value, indexQuestion, question?.id, answer?.id)\">\r\n <label>{{answer.text}}</label>\r\n </div>\r\n </div>\r\n } \r\n </div>\r\n <div class=\"survey-answer-value\">\r\n <span>{{ selectedValues[indexQuestion] !== undefined ? selectedValues[indexQuestion] : '--' }}</span>\r\n </div> \r\n </div>\r\n</div> -->\r\n\r\n<div class=\"survey-container\">\r\n <div class=\"survey-question\">\r\n {{ question?.text }}\r\n </div>\r\n <div class=\"survey-answer-container group-radio\">\r\n <div class=\"survey-answer-list\">\r\n @for (answer of question?.answers; track answer.id) {\r\n <div class=\"survey-answer-group\">\r\n <div class=\"survey-answer\">\r\n @if (patientSurvey && patientSurvey !== '') {\r\n @if (getMatchingAnswer(answer.id)) {\r\n <input type=\"radio\" checked [name]=\"question?.text\" value=\"{{answer.value}}\" class=\"radio-value survey-control\" (change)=\"sumValue(answer.value, indexQuestion, question?.id, answer?.id)\">\r\n <label>{{ answer.text }}</label>\r\n } @else {\r\n <input type=\"radio\" [name]=\"question?.text\" value=\"{{answer.value}}\" class=\"radio-value survey-control\" (change)=\"sumValue(answer.value, indexQuestion, question?.id, answer?. id)\">\r\n <label>{{ answer.text }}</label>\r\n }\r\n } @else {\r\n <input type=\"radio\" [name]=\"question?.text\" value=\"{{answer.value}}\" class=\"radio-value survey-control\" (change)=\"sumValue(answer.value, indexQuestion, question?.id, answer?.id)\">\r\n <label>{{ answer.text }}</label>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"survey-answer-value\">\r\n <span>{{ selectedValues[indexQuestion] !== undefined ? selectedValues[indexQuestion] : '--' }}</span>\r\n </div>\r\n </div>\r\n</div>", styles: [".survey-container{min-height:100%;width:100%;position:relative;display:flex;flex-direction:column}.survey-question{background-color:var(--primary-blue-color);color:#fff;min-height:3rem;display:flex;align-items:center;padding:10px 1%}.survey-answer-container{flex:1;width:100%;display:flex}.survey-answer-list{width:85%;display:flex;flex-direction:column;flex:1}.survey-answer{display:flex;min-height:fit-content;padding:10px 0;word-break:break-word}.survey-answer label{font-size:large;align-self:center;margin-left:10px}.survey-answer-value{align-items:center;width:15%;background-color:var(--primary-bg);display:flex;justify-content:center}.survey-answer-value span{font-size:xx-large}input[type=radio]{appearance:none;-webkit-appearance:none;width:12px;height:12px;border:1.8px solid var(--primary-blue-color);border-radius:50%;background-color:transparent;cursor:pointer;margin-right:4px;align-self:center;flex:0 0 12px!important}input[type=radio]:checked{background:var(--primary-blue-color);position:relative}input[type=radio]:checked:after{content:\"\";position:absolute;width:4px;height:4px;border-radius:50%;background-color:#fff;top:50%;left:50%;transform:translate(-50%,-50%)}\n"] }]
1478
+ }], propDecorators: { question: [{
1479
+ type: Input
1480
+ }], typeSurvey: [{
1481
+ type: Input
1482
+ }], indexQuestion: [{
1483
+ type: Input
1484
+ }], patientSurvey: [{
1485
+ type: Input
1486
+ }], patientId: [{
1487
+ type: Input
1488
+ }], sumOutput: [{
1489
+ type: Output
1490
+ }], questionAnswer: [{
1491
+ type: Output
1492
+ }] } });
1493
+
1494
+ class Survey {
1495
+ questionList = [];
1496
+ typeSurvey = 0;
1497
+ patientSurvey = "";
1498
+ sumOutput = new EventEmitter();
1499
+ questionAnswer = new EventEmitter();
1500
+ ngOnInit() {
1501
+ }
1502
+ onSumOutputReceived(sum) {
1503
+ this.sumOutput.emit(sum);
1504
+ }
1505
+ onQuestionAnswerReceived(object) {
1506
+ this.questionAnswer.emit(object);
1507
+ }
1508
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Survey, deps: [], target: i0.ɵɵFactoryTarget.Component });
1509
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: Survey, isStandalone: true, selector: "lib-survey", inputs: { questionList: "questionList", typeSurvey: "typeSurvey", patientSurvey: "patientSurvey" }, outputs: { sumOutput: "sumOutput", questionAnswer: "questionAnswer" }, ngImport: i0, template: "<div class=\"survey-container\">\r\n @for (question of questionList; track $index) {\r\n <div [ngStyle]=\"{backgroundColor: $index % 2 === 0 ? '#F1F6FE' : 'white'}\">\r\n @switch (question.typeQuestion.id) {\r\n @case (1){\r\n\r\n }\r\n @case (2){\r\n <lib-survey-text></lib-survey-text>\r\n }\r\n @case (3){\r\n \r\n }\r\n @case (4){\r\n \r\n }\r\n @case (5){\r\n <lib-survey-label [question]=\"question\" style=\"width: 100%; height: 3rem; display: flex;\"></lib-survey-label>\r\n }\r\n @case (6){\r\n \r\n }\r\n @case (7){ \r\n <lib-survey-radio [question]=\"question\" [typeSurvey]=\"typeSurvey\" [patientSurvey]=\"patientSurvey\" (questionAnswer)=\"onQuestionAnswerReceived($event)\" style=\"width: 100%; height: 3rem; display: flex;\"></lib-survey-radio>\r\n }\r\n @case (8){\r\n \r\n }\r\n @case (9){\r\n \r\n }\r\n @case (10){\r\n <lib-survey-valuebox [question]=\"question\" [typeSurvey]=\"typeSurvey\" [indexQuestion]=\"$index\" (sumOutput)=\"onSumOutputReceived($event)\" (questionAnswer)=\"onQuestionAnswerReceived($event)\"></lib-survey-valuebox>\r\n \r\n }\r\n }\r\n </div>\r\n } \r\n</div>\r\n", styles: [".survey-container{height:100%;overflow-y:auto;width:100%}lib-survey-valuebox{width:100%;height:auto;display:flex;position:relative;flex-grow:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: SurveyRadio, selector: "lib-survey-radio", inputs: ["question", "typeSurvey", "patientSurvey", "patientId"], outputs: ["questionAnswer"] }, { kind: "component", type: SurveyText, selector: "lib-survey-text" }, { kind: "component", type: SurveyLabel, selector: "lib-survey-label", inputs: ["question"] }, { kind: "component", type: SurveyValuebox, selector: "lib-survey-valuebox", inputs: ["question", "typeSurvey", "indexQuestion", "patientSurvey", "patientId"], outputs: ["sumOutput", "questionAnswer"] }] });
1510
+ }
1511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Survey, decorators: [{
1512
+ type: Component,
1513
+ args: [{ selector: 'lib-survey', imports: [CommonModule, SurveyRadio, SurveyText, SurveyLabel, SurveyValuebox], template: "<div class=\"survey-container\">\r\n @for (question of questionList; track $index) {\r\n <div [ngStyle]=\"{backgroundColor: $index % 2 === 0 ? '#F1F6FE' : 'white'}\">\r\n @switch (question.typeQuestion.id) {\r\n @case (1){\r\n\r\n }\r\n @case (2){\r\n <lib-survey-text></lib-survey-text>\r\n }\r\n @case (3){\r\n \r\n }\r\n @case (4){\r\n \r\n }\r\n @case (5){\r\n <lib-survey-label [question]=\"question\" style=\"width: 100%; height: 3rem; display: flex;\"></lib-survey-label>\r\n }\r\n @case (6){\r\n \r\n }\r\n @case (7){ \r\n <lib-survey-radio [question]=\"question\" [typeSurvey]=\"typeSurvey\" [patientSurvey]=\"patientSurvey\" (questionAnswer)=\"onQuestionAnswerReceived($event)\" style=\"width: 100%; height: 3rem; display: flex;\"></lib-survey-radio>\r\n }\r\n @case (8){\r\n \r\n }\r\n @case (9){\r\n \r\n }\r\n @case (10){\r\n <lib-survey-valuebox [question]=\"question\" [typeSurvey]=\"typeSurvey\" [indexQuestion]=\"$index\" (sumOutput)=\"onSumOutputReceived($event)\" (questionAnswer)=\"onQuestionAnswerReceived($event)\"></lib-survey-valuebox>\r\n \r\n }\r\n }\r\n </div>\r\n } \r\n</div>\r\n", styles: [".survey-container{height:100%;overflow-y:auto;width:100%}lib-survey-valuebox{width:100%;height:auto;display:flex;position:relative;flex-grow:1}\n"] }]
1514
+ }], propDecorators: { questionList: [{
1515
+ type: Input
1516
+ }], typeSurvey: [{
1517
+ type: Input
1518
+ }], patientSurvey: [{
1519
+ type: Input
1520
+ }], sumOutput: [{
1521
+ type: Output
1522
+ }], questionAnswer: [{
1523
+ type: Output
1524
+ }] } });
1525
+
1526
+ class Minio {
1527
+ config;
1528
+ s3;
1529
+ bucketName;
1530
+ accessKeyId;
1531
+ secretAccessKey;
1532
+ endpoint;
1533
+ constructor(config) {
1534
+ this.config = config;
1535
+ this.bucketName = config.bucketName;
1536
+ this.accessKeyId = config.accessKeyId;
1537
+ this.secretAccessKey = config.secretAccessKey;
1538
+ this.endpoint = config.endpoint;
1539
+ // Configurazione delle credenziali di minio
1540
+ AWS.config.update({
1541
+ accessKeyId: this.accessKeyId,
1542
+ secretAccessKey: this.secretAccessKey,
1543
+ region: 'us-east-1', //regione di default, aws sdk gli serve
1544
+ signatureVersion: 'v4' // versione di firma v4, serve a minio
1545
+ });
1546
+ // Configura l'endpoint di minio
1547
+ this.s3 = new AWS.S3({
1548
+ endpoint: new AWS.Endpoint('http://minio.aslss.stage'),
1549
+ s3ForcePathStyle: true,
1550
+ signatureVersion: 'v4'
1551
+ });
1552
+ }
1553
+ // Funzione per caricare un file su minio
1554
+ uploadFile(fileName, fileContent) {
1555
+ const params = {
1556
+ Bucket: this.bucketName, // Nome del tuo bucket minio
1557
+ Key: fileName, // Nome del file
1558
+ Body: fileContent, // Contenuto del file
1559
+ ContentType: 'application/octet-stream' // Tipo di contenuto
1560
+ };
1561
+ // Carica il file su minio
1562
+ return this.s3.upload(params).promise();
1563
+ }
1564
+ // Funzione per ottenere un oggetto da minio
1565
+ getObject(fileName) {
1566
+ const params = {
1567
+ Bucket: this.bucketName,
1568
+ Key: fileName
1569
+ };
1570
+ // Ottieni il file da MinIO
1571
+ return this.s3.getObject(params).promise();
1572
+ }
1573
+ // metodo per recuperare tutti gli oggetti in una cartella
1574
+ async getAllObjectsInFolder(folderPath) {
1575
+ const folder = folderPath.endsWith('/') ? folderPath : `${folderPath}/`;
1576
+ const listParams = {
1577
+ Bucket: this.bucketName,
1578
+ Prefix: folder
1579
+ };
1580
+ try {
1581
+ // Lista tutti gli oggetti nella cartella
1582
+ const listedObjects = await this.s3.listObjects(listParams).promise();
1583
+ if (!listedObjects.Contents || listedObjects.Contents.length === 0) {
1584
+ return new Map();
1585
+ }
1586
+ // Mappa per memorizzare i risultati
1587
+ const objectsMap = new Map();
1588
+ // Recupera ogni oggetto
1589
+ const fetchPromises = listedObjects.Contents.map(async (item) => {
1590
+ if (item.Key) {
1591
+ const objectData = await this.getObject(item.Key);
1592
+ objectsMap.set(item.Key, objectData);
1593
+ }
1594
+ });
1595
+ // Attendere il completamento di tutte le richieste
1596
+ await Promise.all(fetchPromises);
1597
+ return objectsMap;
1598
+ }
1599
+ catch (error) {
1600
+ console.error('Errore nel recupero degli oggetti dalla cartella:', error);
1601
+ throw error;
1602
+ }
1603
+ }
1604
+ // Funzione per eliminare un oggetto da minio
1605
+ deleteObject(bucketName, fileName) {
1606
+ const params = {
1607
+ Bucket: bucketName,
1608
+ Key: fileName
1609
+ };
1610
+ // Elimina il file da minio
1611
+ return this.s3.deleteObject(params).promise();
1612
+ }
1613
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Minio, deps: [{ token: 'MINIO_CONFIG' }], target: i0.ɵɵFactoryTarget.Injectable });
1614
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Minio, providedIn: 'root' });
1615
+ }
1616
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Minio, decorators: [{
1617
+ type: Injectable,
1618
+ args: [{
1619
+ providedIn: 'root'
1620
+ }]
1621
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1622
+ type: Inject,
1623
+ args: ['MINIO_CONFIG']
1624
+ }] }] });
1625
+
1626
+ class FormatDate {
1627
+ //funzione per convertire date in giorno/mese/anno
1628
+ convertToISOFormat(date) {
1629
+ if (!date)
1630
+ return 'Non disponibile';
1631
+ let newDate = new Date(date);
1632
+ // prendo il giorno, mese e anno
1633
+ const day = newDate.getDate();
1634
+ // il mese inizia da 0, quindi aggiungiamo 1, come dopo per il giorno, è una configurazione
1635
+ //di alcune api per il convert
1636
+ const month = newDate.getMonth() + 1;
1637
+ const year = newDate.getFullYear();
1638
+ const hour = newDate.getHours();
1639
+ const minute = newDate.getMinutes();
1640
+ const second = newDate.getSeconds();
1641
+ // aggiungo uno zero iniziale se il valore è minore di 10
1642
+ const formattedDay = day < 10 ? `0${day}` : `${day}`;
1643
+ const formattedMonth = month < 10 ? `0${month}` : `${month}`;
1644
+ const formattedHour = hour < 10 ? `0${hour}` : `${hour}`;
1645
+ const formattedMinute = minute < 10 ? `0${minute}` : `${minute}`;
1646
+ const formattedSecond = second < 10 ? `0${second}` : `${second}`;
1647
+ //aggiungo il timezone offset
1648
+ const timezoneOffset = -newDate.getTimezoneOffset();
1649
+ const offsetHours = Math.floor(Math.abs(timezoneOffset) / 60);
1650
+ const offsetMinutes = Math.abs(timezoneOffset) % 60;
1651
+ const offsetSign = timezoneOffset >= 0 ? '+' : '-';
1652
+ const formattedOffset = `${offsetSign}${offsetHours.toString().padStart(2, '0')}:${offsetMinutes.toString().padStart(2, '0')}`;
1653
+ let dataToISO = `${year}-${formattedMonth}-${formattedDay}T${formattedHour}:${formattedMinute}:${formattedSecond}${formattedOffset}`;
1654
+ return dataToISO;
1655
+ }
1656
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: FormatDate, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1657
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: FormatDate, providedIn: 'root' });
1658
+ }
1659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: FormatDate, decorators: [{
1660
+ type: Injectable,
1661
+ args: [{
1662
+ providedIn: 'root'
1663
+ }]
1664
+ }] });
1665
+
1666
+ //Servizio api per le chiamate riguardarti le strutture
1667
+ class ApiAccountService {
1668
+ gateway;
1669
+ endpoint;
1670
+ constructor(gateway) {
1671
+ this.gateway = gateway;
1672
+ this.endpoint = `${this.gateway}/Account/`;
1673
+ }
1674
+ http = inject(HttpClient);
1675
+ //###############
1676
+ //##### GET #####
1677
+ //###############
1678
+ //funzioni per la ricerca degli account in base al parametro
1679
+ getAccounts() {
1680
+ return this.http.get(`${this.endpoint}`);
1681
+ }
1682
+ //ricerca con più di un parametro
1683
+ // getAccountsByParameters(id: string | "", fiscalCode: string | "", username: string | ""): Observable<IAccountResponse[]> {
1684
+ // const params = new HttpParams().set('id', id).set('fiscalCode', fiscalCode).set('username', username);
1685
+ // return this.http.get<IAccountResponse[]>(`${this.endpoint}`, {
1686
+ // params: params,
1687
+ // });
1688
+ // }
1689
+ getAccountById(id) {
1690
+ const params = new HttpParams().set('id', id);
1691
+ return this.http.get(`${this.endpoint}`, {
1692
+ params: params,
1693
+ });
1694
+ }
1695
+ getAccountByFiscalCode(fiscalCode) {
1696
+ const params = new HttpParams().set('fiscalCode', fiscalCode);
1697
+ return this.http.get(`${this.endpoint}`, {
1698
+ params: params,
1699
+ });
1700
+ }
1701
+ getAccountByUsername(username) {
1702
+ const params = new HttpParams().set('username', username);
1703
+ return this.http.get(`${this.endpoint}`, {
1704
+ params: params,
1705
+ });
1706
+ }
1707
+ getAccountByAccountProfileId(accountProfileId) {
1708
+ const params = new HttpParams().set('accountProfileId', accountProfileId);
1709
+ return this.http.get(`${this.endpoint}`, {
1710
+ params: params,
1711
+ });
1712
+ }
1713
+ getCredentialByAccountId(accountId) {
1714
+ const params = new HttpParams().set('accountId', accountId);
1715
+ return this.http.get(`${this.endpoint}Credential`, {
1716
+ params: params,
1717
+ });
1718
+ }
1719
+ //##############
1720
+ //#### POST ####
1721
+ //##############
1722
+ //funzione per l'inserimento e modifica dell'account
1723
+ postAccount(accountRequest) {
1724
+ return this.http.post(`${this.endpoint}`, accountRequest);
1725
+ }
1726
+ //FUNZIONE LOGIN
1727
+ postLogin(loginRequest) {
1728
+ const credentials = btoa(`apilogin:apipassword`); // Crea il token Basic Authentication
1729
+ const headers = new HttpHeaders({
1730
+ 'Authorization': `Basic ${credentials}`,
1731
+ 'Content-Type': 'application/json'
1732
+ });
1733
+ return this.http.post(`${this.endpoint}Login`, loginRequest, { headers: headers });
1734
+ }
1735
+ postLoginLdap(loginRequest) {
1736
+ const credentials = btoa(`apilogin:apipassword`); // Crea il token Basic Authentication
1737
+ const headers = new HttpHeaders({
1738
+ 'Authorization': `Basic ${credentials}`,
1739
+ 'Content-Type': 'application/json'
1740
+ });
1741
+ return this.http.post(`${this.endpoint}LoginLDAP`, loginRequest, { headers: headers });
1742
+ }
1743
+ postRefreshToken(refreshToken) {
1744
+ const credentials = btoa(`apilogin:apipassword`);
1745
+ const headers = new HttpHeaders({
1746
+ 'Authorization': `Basic ${credentials}`,
1747
+ 'Content-Type': 'application/json'
1748
+ });
1749
+ return this.http.post(`${this.endpoint}RefreshToken`, refreshToken, { headers: headers });
1750
+ }
1751
+ postCredential(accountCredentialDTO) {
1752
+ return this.http.post(`${this.endpoint}Credential`, accountCredentialDTO);
1753
+ }
1754
+ //###############
1755
+ //##### PUT #####
1756
+ //###############
1757
+ //funzione per settare il login dell'account
1758
+ setLoginAccount(id) {
1759
+ const params = new HttpParams().set('id', id);
1760
+ return this.http.put(`${this.endpoint}`, null, {
1761
+ params: params,
1762
+ });
1763
+ }
1764
+ //##############
1765
+ //### DELETE ###
1766
+ //##############
1767
+ //funzione per l'eliminazione logica dell'account
1768
+ deleteAccount(id) {
1769
+ return this.http.delete(`${this.endpoint}/${id}`);
1770
+ }
1771
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiAccountService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
1772
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiAccountService });
1773
+ }
1774
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiAccountService, decorators: [{
1775
+ type: Injectable
1776
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1777
+ type: Inject,
1778
+ args: [API_CONFIG]
1779
+ }] }] });
1780
+
1781
+ //Servizio api per le chiamate riguardarti le strutture
1782
+ class ApiAccountDictionaryService {
1783
+ gateway;
1784
+ endpoint;
1785
+ constructor(gateway) {
1786
+ this.gateway = gateway;
1787
+ this.endpoint = `${this.gateway}/Account/`;
1788
+ }
1789
+ http = inject(HttpClient);
1790
+ //###############
1791
+ //##### GET #####
1792
+ //###############
1793
+ //funzioni per la ricerca dei permessi in base al parametro
1794
+ getPermissions() {
1795
+ return this.http.get(`${this.endpoint}Dictionary/Permission`);
1796
+ }
1797
+ getPermissionById(id) {
1798
+ const params = new HttpParams().set('id', id);
1799
+ return this.http.get(`${this.endpoint}Dictionary/Permission`, {
1800
+ params: params,
1801
+ });
1802
+ }
1803
+ getPermissionByCode(code) {
1804
+ const params = new HttpParams().set('code', code);
1805
+ return this.http.get(`${this.endpoint}Dictionary/Permission`, {
1806
+ params: params,
1807
+ });
1808
+ }
1809
+ getPermissionByParameters(id, code) {
1810
+ const params = new HttpParams().set('id', id).set('code', code);
1811
+ return this.http.get(`${this.endpoint}Dictionary/Permission`, {
1812
+ params: params,
1813
+ });
1814
+ }
1815
+ //funzioni per la ricerca dei profili in base al parametro
1816
+ getProfiles() {
1817
+ return this.http.get(`${this.endpoint}Dictionary/Profile`);
1818
+ }
1819
+ getProfileById(id) {
1820
+ const params = new HttpParams().set('id', id);
1821
+ return this.http.get(`${this.endpoint}Dictionary/Profile`, {
1822
+ params: params,
1823
+ });
1824
+ }
1825
+ //funzioni per la ricerca dei type contact in base al parametro
1826
+ getTypesContact() {
1827
+ return this.http.get(`${this.endpoint}Dictionary/TypeContact`);
1828
+ }
1829
+ getTypeContactById(id) {
1830
+ const params = new HttpParams().set('id', id);
1831
+ return this.http.get(`${this.endpoint}Dictionary/TypeContact`, {
1832
+ params: params,
1833
+ });
1834
+ }
1835
+ getSystems() {
1836
+ return this.http.get(`${this.endpoint}Dictionary/System`);
1837
+ }
1838
+ getSystemById(id) {
1839
+ const params = new HttpParams().set('id', id);
1840
+ return this.http.get(`${this.endpoint}Dictionary/System`, {
1841
+ params: params
1842
+ });
1843
+ }
1844
+ //##############
1845
+ //#### POST ####
1846
+ //##############
1847
+ //funzione per la modifica dei permessi
1848
+ postPermission(permissionRequest) {
1849
+ return this.http.post(`${this.endpoint}Dictionary/Permission`, permissionRequest);
1850
+ }
1851
+ //funzione per la modifica dei profili
1852
+ postProfile(profileRequest) {
1853
+ return this.http.post(`${this.endpoint}Dictionary/Profile`, profileRequest);
1854
+ }
1855
+ //funzione per la modifica dei type contact
1856
+ postTypeContact(typeContactRequest) {
1857
+ return this.http.post(`${this.endpoint}Dictionary/TypeContact`, typeContactRequest);
1858
+ }
1859
+ postSystem(system) {
1860
+ return this.http.post(`${this.endpoint}Dictionary/System`, system);
1861
+ }
1862
+ //###############
1863
+ //##### PUT #####
1864
+ //###############
1865
+ //##############
1866
+ //### DELETE ###
1867
+ //##############
1868
+ //funzione per l'eliminazione logica dell'account
1869
+ deletePermission(id) {
1870
+ return this.http.delete(`${this.endpoint}Dictionary/Permission/${id}`);
1871
+ }
1872
+ //funzione per l'eliminazione logica dell'account
1873
+ deleteProfile(id) {
1874
+ const params = new HttpParams().set('id', id);
1875
+ return this.http.delete(`${this.endpoint}Dictionary/Profile`, {
1876
+ params: params,
1877
+ });
1878
+ }
1879
+ //funzione per l'eliminazione logica dell'account
1880
+ deleteTypeContact(id) {
1881
+ const params = new HttpParams().set('id', id);
1882
+ return this.http.delete(`${this.endpoint}Dictionary/TypeContact`, {
1883
+ params: params,
1884
+ });
1885
+ }
1886
+ deleteSystem(id) {
1887
+ const params = new HttpParams().set('id', id);
1888
+ return this.http.delete(`${this.endpoint}Dictionary/System`, {
1889
+ params: params
1890
+ });
1891
+ }
1892
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiAccountDictionaryService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
1893
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiAccountDictionaryService, providedIn: 'root' });
1894
+ }
1895
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiAccountDictionaryService, decorators: [{
1896
+ type: Injectable,
1897
+ args: [{
1898
+ providedIn: 'root',
1899
+ }]
1900
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1901
+ type: Inject,
1902
+ args: [API_CONFIG]
1903
+ }] }] });
1904
+
1905
+ //Servizio api per le chiamate riguardarti le strutture
1906
+ class ApiExamService {
1907
+ gateway;
1908
+ endpoint;
1909
+ constructor(gateway) {
1910
+ this.gateway = gateway;
1911
+ this.endpoint = `${this.gateway}/Exam/`;
1912
+ }
1913
+ http = inject(HttpClient);
1914
+ //###############
1915
+ //##### GET #####
1916
+ //###############
1917
+ getPatientExams() {
1918
+ return this.http.get(`${this.endpoint}`);
1919
+ }
1920
+ getPatientExamsByParameters(patientId, vitalSignId) {
1921
+ const params = new HttpParams().set('patientId', patientId).set('vitalSignId', vitalSignId);
1922
+ return this.http.get(`${this.endpoint}`, {
1923
+ params: params
1924
+ });
1925
+ }
1926
+ getPatientExamByPatientId(patientid) {
1927
+ const params = new HttpParams().set('patientid', patientid);
1928
+ return this.http.get(`${this.endpoint}`, {
1929
+ params: params,
1930
+ });
1931
+ }
1932
+ getPatientExamVitalSignId(id) {
1933
+ const params = new HttpParams().set('id', id);
1934
+ return this.http.get(`${this.endpoint}`, {
1935
+ params: params,
1936
+ });
1937
+ }
1938
+ //funzione per ottenere i valori di esami
1939
+ getExamValues() {
1940
+ return this.http.get(`${this.endpoint}Value`);
1941
+ }
1942
+ //ricerca con più di un parametro
1943
+ getExamValueByParameters(vitalSignId, patientId) {
1944
+ const params = new HttpParams().set('vitalSignId', vitalSignId).set('patientId', patientId);
1945
+ return this.http.get(`${this.endpoint}Value`, {
1946
+ params: params,
1947
+ });
1948
+ }
1949
+ getExamValueByVitalSignId(vitalSignId) {
1950
+ const params = new HttpParams().set('vitalSignId', vitalSignId);
1951
+ return this.http.get(`${this.endpoint}Value`, {
1952
+ params: params,
1953
+ });
1954
+ }
1955
+ getExamValueByPatientId(patientId) {
1956
+ const params = new HttpParams().set('patientId', patientId);
1957
+ return this.http.get(`${this.endpoint}Value`, {
1958
+ params: params,
1959
+ });
1960
+ }
1961
+ //##############
1962
+ //#### POST ####
1963
+ //##############
1964
+ //funzione per la modifica dell'esame del paziente
1965
+ postPatientExams(patientExamRequest) {
1966
+ return this.http.post(`${this.endpoint}`, patientExamRequest);
1967
+ }
1968
+ //funzione per la modifica del tipo di ricorrenza
1969
+ postExamValue(examValueRequest) {
1970
+ return this.http.post(`${this.endpoint}Value`, examValueRequest);
1971
+ }
1972
+ //###############
1973
+ //##### PUT #####
1974
+ //###############
1975
+ setPatientExam(id) {
1976
+ const params = new HttpParams().set('id', id);
1977
+ return this.http.put(`${this.endpoint}`, null, {
1978
+ params: params,
1979
+ });
1980
+ }
1981
+ setExamValue(patientId) {
1982
+ const params = new HttpParams().set('patientId', patientId);
1983
+ return this.http.put(`${this.endpoint}Value`, null, {
1984
+ params: params,
1985
+ });
1986
+ }
1987
+ //##############
1988
+ //### DELETE ###
1989
+ //##############
1990
+ deletePatientExam(id) {
1991
+ return this.http.delete(`${this.endpoint}${id}`);
1992
+ }
1993
+ //funzione per l'eliminazione del tipo di ricorrenza
1994
+ deleteExamValue(id) {
1995
+ const params = new HttpParams().set('id', id);
1996
+ return this.http.delete(`${this.endpoint}Value`, {
1997
+ params: params,
1998
+ });
1999
+ }
2000
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiExamService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
2001
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiExamService, providedIn: 'root' });
2002
+ }
2003
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiExamService, decorators: [{
2004
+ type: Injectable,
2005
+ args: [{
2006
+ providedIn: 'root',
2007
+ }]
2008
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2009
+ type: Inject,
2010
+ args: [API_CONFIG]
2011
+ }] }] });
2012
+
2013
+ //Servizio api per le chiamate riguardarti le strutture
2014
+ class ApiExamAppointmentService {
2015
+ gateway;
2016
+ endpoint;
2017
+ constructor(gateway) {
2018
+ this.gateway = gateway;
2019
+ this.endpoint = `${this.gateway}/Appointment/`;
2020
+ }
2021
+ http = inject(HttpClient);
2022
+ //###############
2023
+ //##### GET #####
2024
+ //###############
2025
+ //funzioni per la ricerca degli appuntamenti del paziente in base al parametro
2026
+ getPatientAppointments() {
2027
+ return this.http.get(`${this.endpoint}`);
2028
+ }
2029
+ //ricerca con più di un parametro
2030
+ getPatientAppointmentByParameters(patientId, accountProfileId, structureDepartmentId, typeId) {
2031
+ const params = new HttpParams().set('patientId', patientId).set('accountProfileId', accountProfileId).set('structureDepartmentId', structureDepartmentId).set('typeId', typeId);
2032
+ return this.http.get(`${this.endpoint}`, {
2033
+ params: params,
2034
+ });
2035
+ }
2036
+ getPatientAppointmentById(id) {
2037
+ const params = new HttpParams().set('id', id);
2038
+ return this.http.get(`${this.endpoint}`, {
2039
+ params: params,
2040
+ });
2041
+ }
2042
+ getPatientAppointmentByPatientId(patientId) {
2043
+ const params = new HttpParams().set('patientId', patientId);
2044
+ return this.http.get(`${this.endpoint}`, {
2045
+ params: params,
2046
+ });
2047
+ }
2048
+ getPatientAppointmentByAccountProfileId(accountProfileId) {
2049
+ const params = new HttpParams().set('accountProfileId', accountProfileId);
2050
+ return this.http.get(`${this.endpoint}`, {
2051
+ params: params,
2052
+ });
2053
+ }
2054
+ getPatientAppointmentByStructureDepartmentId(structureDepartmentId) {
2055
+ const params = new HttpParams().set('structureDepartmentId', structureDepartmentId);
2056
+ return this.http.get(`${this.endpoint}`, {
2057
+ params: params,
2058
+ });
2059
+ }
2060
+ getPatientAppointmentByTypeId(typeId) {
2061
+ const params = new HttpParams().set('typeId', typeId);
2062
+ return this.http.get(`${this.endpoint}`, {
2063
+ params: params,
2064
+ });
2065
+ }
2066
+ //##############
2067
+ //#### POST ####
2068
+ //##############
2069
+ //funzione per la modifica dell'appuntamento
2070
+ postPatientAppointment(patientAppointmentRequest) {
2071
+ return this.http.post(`${this.endpoint}`, patientAppointmentRequest);
2072
+ }
2073
+ //###############
2074
+ //##### PUT #####
2075
+ //###############
2076
+ //##############
2077
+ //### DELETE ###
2078
+ //##############
2079
+ //funzione per l'eliminazione logica dell'account
2080
+ deletePatientAppointment(id) {
2081
+ const params = new HttpParams().set('id', id);
2082
+ return this.http.delete(`${this.endpoint}`, {
2083
+ params: params,
2084
+ });
2085
+ }
2086
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiExamAppointmentService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
2087
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiExamAppointmentService, providedIn: 'root' });
2088
+ }
2089
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiExamAppointmentService, decorators: [{
2090
+ type: Injectable,
2091
+ args: [{
2092
+ providedIn: 'root',
2093
+ }]
2094
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2095
+ type: Inject,
2096
+ args: [API_CONFIG]
2097
+ }] }] });
2098
+
2099
+ //Servizio api per le chiamate riguardarti i dizionari degli esami
2100
+ class ApiExamDictionaryService {
2101
+ gateway;
2102
+ endpoint;
2103
+ constructor(gateway) {
2104
+ this.gateway = gateway;
2105
+ this.endpoint = `${this.gateway}/Exam/`;
2106
+ }
2107
+ http = inject(HttpClient);
2108
+ //###############
2109
+ //##### GET #####
2110
+ //###############
2111
+ getRecurrencies() {
2112
+ return this.http.get(`${this.endpoint}Dictionary/Recurrency`);
2113
+ }
2114
+ getRecurrencyById(id) {
2115
+ const params = new HttpParams().set('id', id);
2116
+ return this.http.get(`${this.endpoint}Dictionary/Recurrency`, {
2117
+ params: params,
2118
+ });
2119
+ }
2120
+ //funzione per ottenere i tipi di ricorrenza
2121
+ getTypesRecurrency() {
2122
+ return this.http.get(`${this.endpoint}Dictionary/TypeRecurrency`);
2123
+ }
2124
+ getTypeRecurrencyById(id) {
2125
+ const params = new HttpParams().set('id', id);
2126
+ return this.http.get(`${this.endpoint}Dictionary/TypeRecurrency`, {
2127
+ params: params,
2128
+ });
2129
+ }
2130
+ //funzione per ottenere i vitalsign
2131
+ getVitalSigns() {
2132
+ return this.http.get(`${this.endpoint}Dictionary/VitalSign`);
2133
+ }
2134
+ getVitalSignById(id) {
2135
+ const params = new HttpParams().set('id', id);
2136
+ return this.http.get(`${this.endpoint}Dictionary/VitalSign`, {
2137
+ params: params,
2138
+ });
2139
+ }
2140
+ //funzione per ottenere i tipi di appuntamento
2141
+ getTypesAppointment() {
2142
+ return this.http.get(`${this.endpoint}Dictionary/TypeAppointment`);
2143
+ }
2144
+ getTypeAppointmentById(id) {
2145
+ const params = new HttpParams().set('id', id);
2146
+ return this.http.get(`${this.endpoint}Dictionary/TypeAppointment`, {
2147
+ params: params,
2148
+ });
2149
+ }
2150
+ //funzione per ottenere i target
2151
+ getTargets() {
2152
+ return this.http.get(`${this.endpoint}Dictionary/Target`);
2153
+ }
2154
+ getTargetById(targetId) {
2155
+ const params = new HttpParams().set('targetId', targetId);
2156
+ return this.http.get(`${this.endpoint}Dictionary/Target`, {
2157
+ params: params,
2158
+ });
2159
+ }
2160
+ getTargetByVitalSignId(vitalSignId) {
2161
+ const params = new HttpParams().set('vitalSignId', vitalSignId);
2162
+ return this.http.get(`${this.endpoint}Dictionary/Target`, {
2163
+ params: params,
2164
+ });
2165
+ }
2166
+ getTargetByParameters(vitalSignId, targetId) {
2167
+ const params = new HttpParams().set('vitalSignId', vitalSignId).set('targetId', targetId);
2168
+ return this.http.get(`${this.endpoint}Dictionary/Target`, {
2169
+ params: params,
2170
+ });
2171
+ }
2172
+ //funzione per recuperare i kit
2173
+ getKits() {
2174
+ return this.http.get(`${this.endpoint}Dictionary/Kit`);
2175
+ }
2176
+ getKitById(id) {
2177
+ const params = new HttpParams().set('id', id);
2178
+ return this.http.get(`${this.endpoint}Dictionary/Kit`, {
2179
+ params: params,
2180
+ });
2181
+ }
2182
+ getComponents() {
2183
+ return this.http.get(`${this.endpoint}Dictionary/Kit/Component`);
2184
+ }
2185
+ getComponentById(id) {
2186
+ const params = new HttpParams().set('id', id);
2187
+ return this.http.get(`${this.endpoint}Dictionary/Kit/Component`, {
2188
+ params: params,
2189
+ });
2190
+ }
2191
+ getComponentsByType(type) {
2192
+ const params = new HttpParams().set('type', type);
2193
+ return this.http.get(`${this.endpoint}Dictionary/Kit/Component`, {
2194
+ params: params,
2195
+ });
2196
+ }
2197
+ getComponentByParameters(id, type) {
2198
+ const params = new HttpParams().set('id', id).set('type', type);
2199
+ return this.http.get(`${this.endpoint}Dictionary/Kit/Component`, {
2200
+ params: params,
2201
+ });
2202
+ }
2203
+ getTypeComponent() {
2204
+ return this.http.get(`${this.endpoint}Dictionary/TypeComponent`);
2205
+ }
2206
+ getTypeComponentById(id) {
2207
+ const params = new HttpParams().set('id', id);
2208
+ return this.http.get(`${this.endpoint}Dictionary/TypeComponent`, {
2209
+ params: params,
2210
+ });
2211
+ }
2212
+ getRisks() {
2213
+ return this.http.get(`${this.endpoint}Dictionary/Risk`);
2214
+ }
2215
+ getRiskById(id) {
2216
+ const params = new HttpParams().set('id', id);
2217
+ return this.http.get(`${this.endpoint}Dictionary/Risk`, {
2218
+ params: params
2219
+ });
2220
+ }
2221
+ //##############
2222
+ //#### POST ####
2223
+ //##############
2224
+ //funzione per la modifica della ricorrenza
2225
+ postRecurrency(recurrencyRequest) {
2226
+ return this.http.post(`${this.endpoint}Dictionary/Recurrency`, recurrencyRequest);
2227
+ }
2228
+ //funzione per la modifica del tipo di ricorrenza
2229
+ postTypeRecurrency(typeRecurrencyRequest) {
2230
+ return this.http.post(`${this.endpoint}Dictionary/TypeRecurrency`, typeRecurrencyRequest);
2231
+ }
2232
+ //funzione per la modifica del vital sign
2233
+ postVitalSign(vitalSignRequest) {
2234
+ return this.http.post(`${this.endpoint}Dictionary/VitalSign`, vitalSignRequest);
2235
+ }
2236
+ //funzione per la modifica del tipo di appuntamento
2237
+ postTypeAppointment(typeAppointmentRequest) {
2238
+ return this.http.post(`${this.endpoint}Dictionary/TypeAppointment`, typeAppointmentRequest);
2239
+ }
2240
+ postTarget(targetRequest) {
2241
+ return this.http.post(`${this.endpoint}Dictionary/Target`, targetRequest);
2242
+ }
2243
+ postComponent(componentRequest) {
2244
+ return this.http.post(`${this.endpoint}Dictionary/Kit/Component`, componentRequest);
2245
+ }
2246
+ postKit(kitRequest) {
2247
+ return this.http.post(`${this.endpoint}Dictionary/Kit`, kitRequest);
2248
+ }
2249
+ postRisk(riskRequest) {
2250
+ return this.http.post(`${this.endpoint}Dictionary/Risk`, riskRequest);
2251
+ }
2252
+ //###############
2253
+ //##### PUT #####
2254
+ //###############
2255
+ //##############
2256
+ //### DELETE ###
2257
+ //##############
2258
+ //funzione per l'eliminazione della ricorrenza
2259
+ deleteRecurrency(id) {
2260
+ const params = new HttpParams().set('id', id);
2261
+ return this.http.delete(`${this.endpoint}Dictionary/Recurrency`, {
2262
+ params: params,
2263
+ });
2264
+ }
2265
+ //funzione per l'eliminazione del tipo di ricorrenza
2266
+ deleteTypeRecurrency(id) {
2267
+ const params = new HttpParams().set('id', id);
2268
+ return this.http.delete(`${this.endpoint}Dictionary/TypeRecurrency`, {
2269
+ params: params,
2270
+ });
2271
+ }
2272
+ //funzione per l'eliminazione del vital sign
2273
+ deleteVitalSign(id) {
2274
+ return this.http.delete(`${this.endpoint}Dictionary/VitalSign/${id}`);
2275
+ }
2276
+ //funzione per l'eliminazione del tipo appuntamento
2277
+ deleteTypeAppointment(id) {
2278
+ const params = new HttpParams().set('id', id);
2279
+ return this.http.delete(`${this.endpoint}Dictionary/TypeAppointment`, {
2280
+ params: params,
2281
+ });
2282
+ }
2283
+ deleteTarget(targetId) {
2284
+ return this.http.delete(`${this.endpoint}Dictionary/Target/${targetId}`);
2285
+ }
2286
+ deleteKit(id) {
2287
+ return this.http.delete(`${this.endpoint}Dictionary/Kit/${id}`);
2288
+ }
2289
+ deleteRisk(id) {
2290
+ const params = new HttpParams().set('id', id);
2291
+ return this.http.delete(`${this.endpoint}Dictionary/Risk`, {
2292
+ params: params
2293
+ });
2294
+ }
2295
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiExamDictionaryService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
2296
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiExamDictionaryService, providedIn: 'root' });
2297
+ }
2298
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiExamDictionaryService, decorators: [{
2299
+ type: Injectable,
2300
+ args: [{
2301
+ providedIn: 'root',
2302
+ }]
2303
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2304
+ type: Inject,
2305
+ args: [API_CONFIG]
2306
+ }] }] });
2307
+
2308
+ //Servizio api per le chiamate riguardarti le strutture
2309
+ class ApiKitService {
2310
+ gateway;
2311
+ endpoint;
2312
+ constructor(gateway) {
2313
+ this.gateway = gateway;
2314
+ this.endpoint = `${this.gateway}/Kit/`;
2315
+ }
2316
+ http = inject(HttpClient);
2317
+ //###############
2318
+ //##### GET #####
2319
+ //###############
2320
+ getPatientKit() {
2321
+ return this.http.get(`${this.endpoint}`);
2322
+ }
2323
+ getPatientKitByParameters(id, patientId) {
2324
+ const params = new HttpParams().set('patientId', patientId).set('id', id);
2325
+ return this.http.get(`${this.endpoint}`, {
2326
+ params: params
2327
+ });
2328
+ }
2329
+ getPatientKitById(id) {
2330
+ const params = new HttpParams().set('id', id);
2331
+ return this.http.get(`${this.endpoint}`, {
2332
+ params: params
2333
+ });
2334
+ }
2335
+ getPatientKitByPatientId(patientId) {
2336
+ const params = new HttpParams().set('patientId', patientId);
2337
+ return this.http.get(`${this.endpoint}`, {
2338
+ params: params
2339
+ });
2340
+ }
2341
+ //##############
2342
+ //#### POST ####
2343
+ //##############
2344
+ postPatientKit(patientKitRequest) {
2345
+ return this.http.post(`${this.endpoint}`, patientKitRequest);
2346
+ }
2347
+ //###############
2348
+ //##### PUT #####
2349
+ //###############
2350
+ setPatientKit(id) {
2351
+ const params = new HttpParams().set('id', id);
2352
+ return this.http.put(`${this.endpoint}`, null, {
2353
+ params: params,
2354
+ });
2355
+ }
2356
+ //##############
2357
+ //### DELETE ###
2358
+ //##############
2359
+ deletePatientKit(id) {
2360
+ return this.http.delete(`${this.endpoint}${id}`);
2361
+ }
2362
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiKitService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
2363
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiKitService, providedIn: 'root' });
2364
+ }
2365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiKitService, decorators: [{
2366
+ type: Injectable,
2367
+ args: [{
2368
+ providedIn: 'root',
2369
+ }]
2370
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2371
+ type: Inject,
2372
+ args: [API_CONFIG]
2373
+ }] }] });
2374
+
2375
+ //Servizio api per le chiamate riguardarti le strutture
2376
+ class ApiGeographyService {
2377
+ gateway;
2378
+ endpoint;
2379
+ constructor(gateway) {
2380
+ this.gateway = gateway;
2381
+ this.endpoint = `${this.gateway}/Geo/`;
2382
+ }
2383
+ http = inject(HttpClient);
2384
+ //###############
2385
+ //##### GET #####
2386
+ //###############
2387
+ //funzioni per la ricerca delle asl in base al parametro
2388
+ getAsls() {
2389
+ return this.http.get(`${this.endpoint}Asl`);
2390
+ }
2391
+ //ricerca con più di un parametro
2392
+ // getAslByParameters(id: string | "", name: string | "", commonId: string | ""): Observable<IAslResponse[]> {
2393
+ // const params = new HttpParams().set('id', id).set('name', name).set('commonId', commonId);
2394
+ // return this.http.get<IAslResponse[]>(`${this.endpoint}Asl`, {
2395
+ // params: params,
2396
+ // });
2397
+ // }
2398
+ getAslById(id) {
2399
+ const params = new HttpParams().set('id', id);
2400
+ return this.http.get(`${this.endpoint}Asl`, {
2401
+ params: params,
2402
+ });
2403
+ }
2404
+ getAslByName(name) {
2405
+ const params = new HttpParams().set('name', name);
2406
+ return this.http.get(`${this.endpoint}Asl`, {
2407
+ params: params,
2408
+ });
2409
+ }
2410
+ getAslByCommonId(commonId) {
2411
+ const params = new HttpParams().set('commonId', commonId);
2412
+ return this.http.get(`${this.endpoint}Asl`, {
2413
+ params: params,
2414
+ });
2415
+ }
2416
+ //funzioni per la ricerca dei distretti in base al parametro
2417
+ getDistricts() {
2418
+ return this.http.get(`${this.endpoint}District`);
2419
+ }
2420
+ //ricerca con più di un parametro
2421
+ // getDistrictByParameters(id: string | "", name: string | "", aslId: string | ""): Observable<IDistrictResponse[]> {
2422
+ // const params = new HttpParams().set('id', id).set('name', name).set('aslId', aslId);
2423
+ // return this.http.get<IDistrictResponse[]>(`${this.endpoint}District`, {
2424
+ // params: params,
2425
+ // });
2426
+ // }
2427
+ getDistrictById(id) {
2428
+ const params = new HttpParams().set('id', id);
2429
+ return this.http.get(`${this.endpoint}District`, {
2430
+ params: params,
2431
+ });
2432
+ }
2433
+ getDistrictByName(name) {
2434
+ const params = new HttpParams().set('name', name);
2435
+ return this.http.get(`${this.endpoint}District`, {
2436
+ params: params,
2437
+ });
2438
+ }
2439
+ getDistrictByAslId(aslId) {
2440
+ const params = new HttpParams().set('aslId', aslId);
2441
+ return this.http.get(`${this.endpoint}District`, {
2442
+ params: params,
2443
+ });
2444
+ }
2445
+ //funzioni per la ricerca dei comuni in base al parametro
2446
+ getCommons() {
2447
+ return this.http.get(`${this.endpoint}Common`);
2448
+ }
2449
+ //ricerca con più di un parametro
2450
+ getCommonByParameters(provinceId, regionId) {
2451
+ const params = new HttpParams().set('provinceId', provinceId).set('regionId', regionId);
2452
+ return this.http.get(`${this.endpoint}Common`, {
2453
+ params: params,
2454
+ });
2455
+ }
2456
+ getCommonById(id) {
2457
+ const params = new HttpParams().set('id', id);
2458
+ return this.http.get(`${this.endpoint}Common`, {
2459
+ params: params,
2460
+ });
2461
+ }
2462
+ getCommonByName(name) {
2463
+ const params = new HttpParams().set('name', name);
2464
+ return this.http.get(`${this.endpoint}Common`, {
2465
+ params: params,
2466
+ });
2467
+ }
2468
+ getCommonByProvinceId(provinceId) {
2469
+ const params = new HttpParams().set('provinceId', provinceId);
2470
+ return this.http.get(`${this.endpoint}Common`, {
2471
+ params: params,
2472
+ });
2473
+ }
2474
+ getCommonByRegionId(regionId) {
2475
+ const params = new HttpParams().set('regionId', regionId);
2476
+ return this.http.get(`${this.endpoint}Common`, {
2477
+ params: params,
2478
+ });
2479
+ }
2480
+ //funzioni per la ricerca dei countries in base al parametro
2481
+ getCountries() {
2482
+ return this.http.get(`${this.endpoint}Country`);
2483
+ }
2484
+ //ricerca con più di un parametro
2485
+ // getCountryByParameters(id: string | "", name: string | ""): Observable<ICountryResponse[]> {
2486
+ // const params = new HttpParams().set('id', id).set('name', name);
2487
+ // return this.http.get<ICountryResponse[]>(`${this.endpoint}Country`, {
2488
+ // params: params,
2489
+ // });
2490
+ // }
2491
+ getCountryById(id) {
2492
+ const params = new HttpParams().set('id', id);
2493
+ return this.http.get(`${this.endpoint}Country`, {
2494
+ params: params,
2495
+ });
2496
+ }
2497
+ getCountryByName(name) {
2498
+ const params = new HttpParams().set('name', name);
2499
+ return this.http.get(`${this.endpoint}Country`, {
2500
+ params: params,
2501
+ });
2502
+ }
2503
+ //funzioni per la ricerca delle province in base al parametro
2504
+ getProvinces() {
2505
+ return this.http.get(`${this.endpoint}Province`);
2506
+ }
2507
+ //ricerca con più di un parametro
2508
+ // getProvinceByParameters(id: string | "", name: string | "", regionId: string | ""): Observable<IProvinceResponse[]> {
2509
+ // const params = new HttpParams().set('id', id).set('name', name).set('regionId', regionId).set('regionId', regionId);
2510
+ // return this.http.get<IProvinceResponse[]>(`${this.endpoint}Province`, {
2511
+ // params: params,
2512
+ // });
2513
+ // }
2514
+ getProvinceById(id) {
2515
+ const params = new HttpParams().set('id', id);
2516
+ return this.http.get(`${this.endpoint}Province`, {
2517
+ params: params,
2518
+ });
2519
+ }
2520
+ getProvinceByName(name) {
2521
+ const params = new HttpParams().set('name', name);
2522
+ return this.http.get(`${this.endpoint}Province`, {
2523
+ params: params,
2524
+ });
2525
+ }
2526
+ getProvinceByRegionId(regionId) {
2527
+ const params = new HttpParams().set('regionId', regionId);
2528
+ return this.http.get(`${this.endpoint}Province`, {
2529
+ params: params,
2530
+ });
2531
+ }
2532
+ //funzioni per la ricerca delle regioni in base al parametro
2533
+ getRegions() {
2534
+ return this.http.get(`${this.endpoint}Region`);
2535
+ }
2536
+ //ricerca con più di un parametro
2537
+ // getRegionByParameters(id: string | "", name: string | "", countryId: string | ""): Observable<IRegionResponse[]> {
2538
+ // const params = new HttpParams().set('id', id).set('name', name).set('countryId', countryId);
2539
+ // return this.http.get<IRegionResponse[]>(`${this.endpoint}Region`, {
2540
+ // params: params,
2541
+ // });
2542
+ // }
2543
+ getRegionById(id) {
2544
+ const params = new HttpParams().set('id', id);
2545
+ return this.http.get(`${this.endpoint}Region`, {
2546
+ params: params,
2547
+ });
2548
+ }
2549
+ getRegionByName(name) {
2550
+ const params = new HttpParams().set('name', name);
2551
+ return this.http.get(`${this.endpoint}Region`, {
2552
+ params: params,
2553
+ });
2554
+ }
2555
+ getRegionByCountryId(countryId) {
2556
+ const params = new HttpParams().set('countryId', countryId);
2557
+ return this.http.get(`${this.endpoint}Region`, {
2558
+ params: params,
2559
+ });
2560
+ }
2561
+ //##############
2562
+ //#### POST ####
2563
+ //##############
2564
+ //funzione per l'inserimento e modifica della asl
2565
+ postAsl(aslRequest) {
2566
+ return this.http.post(`${this.endpoint}Asl`, aslRequest);
2567
+ }
2568
+ //funzione per l'inserimento e modifica del distretto
2569
+ postDistrict(districtRequest) {
2570
+ return this.http.post(`${this.endpoint}District`, districtRequest);
2571
+ }
2572
+ //funzione per l'inserimento e modifica del comune
2573
+ postCommon(commonRequest) {
2574
+ return this.http.post(`${this.endpoint}Common`, commonRequest);
2575
+ }
2576
+ //funzione per l'inserimento e modifica del country
2577
+ postCountry(countryRequest) {
2578
+ return this.http.post(`${this.endpoint}Country`, countryRequest);
2579
+ }
2580
+ //funzione per l'inserimento e modifica della provincia
2581
+ postProvince(provinceRequest) {
2582
+ return this.http.post(`${this.endpoint}Province`, provinceRequest);
2583
+ }
2584
+ //funzione per l'inserimento e modifica della regione
2585
+ postRegion(regionRequest) {
2586
+ return this.http.post(`${this.endpoint}Region`, regionRequest);
2587
+ }
2588
+ //###############
2589
+ //##### PUT #####
2590
+ //###############
2591
+ //##############
2592
+ //### DELETE ###
2593
+ //##############
2594
+ //funzione per l'eliminazione della richiesta
2595
+ deleteAsl(id) {
2596
+ const params = new HttpParams().set('id', id);
2597
+ return this.http.delete(`${this.endpoint}Asl`, {
2598
+ params: params,
2599
+ });
2600
+ }
2601
+ //funzione per l'eliminazione del distretto
2602
+ deleteDistrict(id) {
2603
+ const params = new HttpParams().set('id', id);
2604
+ return this.http.delete(`${this.endpoint}District`, {
2605
+ params: params,
2606
+ });
2607
+ }
2608
+ //funzione per l'eliminazione del comune
2609
+ deleteCommon(id) {
2610
+ const params = new HttpParams().set('id', id);
2611
+ return this.http.delete(`${this.endpoint}Common`, {
2612
+ params: params,
2613
+ });
2614
+ }
2615
+ //funzione per l'eliminazione del country
2616
+ deleteCountry(id) {
2617
+ const params = new HttpParams().set('id', id);
2618
+ return this.http.delete(`${this.endpoint}Country`, {
2619
+ params: params,
2620
+ });
2621
+ }
2622
+ //funzione per l'eliminazione della provincia
2623
+ deleteProvince(id) {
2624
+ const params = new HttpParams().set('id', id);
2625
+ return this.http.delete(`${this.endpoint}Province`, {
2626
+ params: params,
2627
+ });
2628
+ }
2629
+ //funzione per l'eliminazione della regione
2630
+ deleteRegion(id) {
2631
+ const params = new HttpParams().set('id', id);
2632
+ return this.http.delete(`${this.endpoint}Region`, {
2633
+ params: params,
2634
+ });
2635
+ }
2636
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiGeographyService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
2637
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiGeographyService, providedIn: 'root' });
2638
+ }
2639
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiGeographyService, decorators: [{
2640
+ type: Injectable,
2641
+ args: [{
2642
+ providedIn: 'root',
2643
+ }]
2644
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2645
+ type: Inject,
2646
+ args: [API_CONFIG]
2647
+ }] }] });
2648
+
2649
+ //Servizio api per le chiamate riguardarti le strutture
2650
+ class ApiAdministrationService {
2651
+ gateway;
2652
+ endpoint;
2653
+ constructor(gateway) {
2654
+ this.gateway = gateway;
2655
+ this.endpoint = `${this.gateway}/Administration/`;
2656
+ }
2657
+ http = inject(HttpClient);
2658
+ //###############
2659
+ //##### GET #####
2660
+ //###############
2661
+ getPatientIdentifiers() {
2662
+ return this.http.get(`${this.endpoint}Patient/Identifier`);
2663
+ }
2664
+ getPatientIdentifierByParameters(patientId, identifierId) {
2665
+ const params = new HttpParams()
2666
+ .set('patientId', patientId)
2667
+ .set('identifierId', identifierId);
2668
+ return this.http.get(`${this.endpoint}Patient/Identifier`, {
2669
+ params: params
2670
+ });
2671
+ }
2672
+ getPatientContacts() {
2673
+ return this.http.get(`${this.endpoint}Patient/Contact`);
2674
+ }
2675
+ getPatientContactByParameters(patientId, contactId) {
2676
+ const params = new HttpParams()
2677
+ .set('patientId', patientId)
2678
+ .set('contactId', contactId);
2679
+ return this.http.get(`${this.endpoint}Patient/Contact`, {
2680
+ params: params
2681
+ });
2682
+ }
2683
+ getPatientAddresses() {
2684
+ return this.http.get(`${this.endpoint}Patient/Address`);
2685
+ }
2686
+ getPatientAddressByParameters(patientId, addressId) {
2687
+ const params = new HttpParams()
2688
+ .set('patientId', patientId)
2689
+ .set('addressId', addressId);
2690
+ return this.http.get(`${this.endpoint}Patient/Address`, {
2691
+ params: params
2692
+ });
2693
+ }
2694
+ //##############
2695
+ //#### POST ####
2696
+ //##############
2697
+ postPatientData(patientDataRequest) {
2698
+ return this.http.post(`${this.endpoint}Patient`, patientDataRequest);
2699
+ }
2700
+ //inserire
2701
+ postPatientIdentifier(patientIdentifierRequest) {
2702
+ return this.http.post(`${this.endpoint}Patient/Identifier`, patientIdentifierRequest);
2703
+ }
2704
+ postPatientContact(patientContactRequest) {
2705
+ return this.http.post(`${this.endpoint}Patient/Contact`, patientContactRequest);
2706
+ }
2707
+ postPatientAddress(patientAddressRequest) {
2708
+ return this.http.post(`${this.endpoint}Patient/Address`, patientAddressRequest);
2709
+ }
2710
+ //###############
2711
+ //##### PUT #####
2712
+ //###############
2713
+ //modificare
2714
+ putPatientIdentifier(patientIdentifierRequest) {
2715
+ return this.http.put(`${this.endpoint}Patient/Identifier`, patientIdentifierRequest);
2716
+ }
2717
+ putPatientContact(patientContactRequest) {
2718
+ return this.http.put(`${this.endpoint}Patient/Contact`, patientContactRequest);
2719
+ }
2720
+ putPatientAddress(patientAddressRequest) {
2721
+ return this.http.put(`${this.endpoint}Patient/Address`, patientAddressRequest);
2722
+ }
2723
+ //##############
2724
+ //### DELETE ###
2725
+ //##############
2726
+ deletePatientIdentifier(patientId, identifierId) {
2727
+ const params = new HttpParams()
2728
+ .set('patientId', patientId)
2729
+ .set('identifierId', identifierId);
2730
+ return this.http.delete(`${this.endpoint}Patient/Identifier`, { params });
2731
+ }
2732
+ deletePatientContact(contactId) {
2733
+ const params = new HttpParams()
2734
+ .set('contactId', contactId);
2735
+ return this.http.delete(`${this.endpoint}Patient/Contact`, { params });
2736
+ }
2737
+ deletePatientAddress(patientId, typeAddressId) {
2738
+ const params = new HttpParams()
2739
+ .set('patientId', patientId)
2740
+ .set('typeAddressId', typeAddressId);
2741
+ return this.http.delete(`${this.endpoint}Patient/Address`, { params });
2742
+ }
2743
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiAdministrationService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
2744
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiAdministrationService, providedIn: 'root' });
2745
+ }
2746
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiAdministrationService, decorators: [{
2747
+ type: Injectable,
2748
+ args: [{
2749
+ providedIn: 'root',
2750
+ }]
2751
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2752
+ type: Inject,
2753
+ args: [API_CONFIG]
2754
+ }] }] });
2755
+
2756
+ //Servizio api per le chiamate riguardarti le strutture
2757
+ class ApiPatientService {
2758
+ gateway;
2759
+ endpoint;
2760
+ constructor(gateway) {
2761
+ this.gateway = gateway;
2762
+ this.endpoint = `${this.gateway}/Patient/`;
2763
+ }
2764
+ http = inject(HttpClient);
2765
+ //###############
2766
+ //##### GET #####
2767
+ //###############
2768
+ getPatients() {
2769
+ return this.http.get(`${this.endpoint}`);
2770
+ }
2771
+ //funzione per la ricerca del paziente
2772
+ getPatientById(id) {
2773
+ const params = new HttpParams().set('id', id);
2774
+ return this.http.get(`${this.endpoint}`, {
2775
+ params: params,
2776
+ });
2777
+ }
2778
+ getPatientByFiscalCode(fiscalcode) {
2779
+ const params = new HttpParams().set('fiscalcode', fiscalcode);
2780
+ return this.http.get(`${this.endpoint}`, {
2781
+ params: params,
2782
+ });
2783
+ }
2784
+ //funzione per recupero dei target dei pazienti
2785
+ getTargets() {
2786
+ return this.http.get(`${this.endpoint}Target`);
2787
+ }
2788
+ getTargetByPatientId(patientId) {
2789
+ const params = new HttpParams().set('patientId', patientId);
2790
+ return this.http.get(`${this.endpoint}Target`, {
2791
+ params: params,
2792
+ });
2793
+ }
2794
+ getTargetByParameters(patientId, targetId) {
2795
+ const params = new HttpParams().set('patientId', patientId).set('targetId', targetId);
2796
+ return this.http.get(`${this.endpoint}Target`, {
2797
+ params: params,
2798
+ });
2799
+ }
2800
+ getSettings() {
2801
+ return this.http.get(`${this.endpoint}Setting`);
2802
+ }
2803
+ //funzione per recupero dei setting dei pazienti
2804
+ getSettingByPatientId(patientId) {
2805
+ const params = new HttpParams().set('patientId', patientId);
2806
+ return this.http.get(`${this.endpoint}Setting`, {
2807
+ params: params,
2808
+ });
2809
+ }
2810
+ getSettingById(id) {
2811
+ const params = new HttpParams().set('id', id);
2812
+ return this.http.get(`${this.endpoint}Setting`, {
2813
+ params: params,
2814
+ });
2815
+ }
2816
+ getCaregivers() {
2817
+ return this.http.get(`${this.endpoint}Caregiver`);
2818
+ }
2819
+ //funzione per recupero del caregiver del paziente
2820
+ getCaregiverById(id) {
2821
+ const params = new HttpParams().set('id', id);
2822
+ return this.http.get(`${this.endpoint}Caregiver`, {
2823
+ params: params,
2824
+ });
2825
+ }
2826
+ //funzione per recuperare tutte le note
2827
+ getNotes() {
2828
+ return this.http.get(`${this.endpoint}Note`);
2829
+ }
2830
+ //funzione per recuperare le note di un paziente
2831
+ getNotesByPatientId(patientId) {
2832
+ const params = new HttpParams().set('patientId', patientId);
2833
+ return this.http.get(`${this.endpoint}Note`, {
2834
+ params: params
2835
+ });
2836
+ }
2837
+ //funzione per recuperare tutti i log
2838
+ getLogs() {
2839
+ return this.http.get(`${this.endpoint}Log`);
2840
+ }
2841
+ //funzione per recuperare i log di un paziente
2842
+ getLogsByPatientId(patientId) {
2843
+ const params = new HttpParams().set('patientId', patientId);
2844
+ return this.http.get(`${this.endpoint}Log`, {
2845
+ params: params
2846
+ });
2847
+ }
2848
+ //funzione per recuperare tutti gli alert
2849
+ getAlerts() {
2850
+ return this.http.get(`${this.endpoint}Alert`);
2851
+ }
2852
+ //funzione per recuperare gli alert di un paziente
2853
+ getAlertsByPatientId(patientId) {
2854
+ const params = new HttpParams().set('patientId', patientId);
2855
+ return this.http.get(`${this.endpoint}Alert`, {
2856
+ params: params
2857
+ });
2858
+ }
2859
+ //##############
2860
+ //#### POST ####
2861
+ //##############
2862
+ //funzione per l'inserimento del paziente
2863
+ postPatient(patientRequest) {
2864
+ return this.http.post(`${this.endpoint}`, patientRequest);
2865
+ }
2866
+ //funzione per l'inserimento di parametri
2867
+ postTarget(targetRequest) {
2868
+ return this.http.post(`${this.endpoint}Target`, targetRequest);
2869
+ }
2870
+ //funzione per l'inserimento dei setting
2871
+ postSetting(settingRequest) {
2872
+ return this.http.post(`${this.endpoint}Setting`, settingRequest);
2873
+ }
2874
+ //funzione per l'inserimento del caregiver
2875
+ postCaregiver(dictionaryCaregiver) {
2876
+ return this.http.post(`${this.endpoint}Caregiver`, dictionaryCaregiver);
2877
+ }
2878
+ //funzione per l'inserimento di una nota
2879
+ postNote(annotationRequest) {
2880
+ return this.http.post(`${this.endpoint}Note`, annotationRequest);
2881
+ }
2882
+ //funzione per l'inserimento di un log
2883
+ postLog(annotationRequest) {
2884
+ return this.http.post(`${this.endpoint}Log`, annotationRequest);
2885
+ }
2886
+ postRisk(riskRequest) {
2887
+ return this.http.post(`${this.endpoint}Risk`, riskRequest);
2888
+ }
2889
+ //###############
2890
+ //##### PUT #####
2891
+ //###############
2892
+ //funzione per aggiornare la visualizzazione dell'alert
2893
+ putAlert(patientId) {
2894
+ console.log('chiamata', patientId);
2895
+ const params = new HttpParams().set('patientId', patientId);
2896
+ return this.http.put(`${this.endpoint}Alert`, {}, { params });
2897
+ }
2898
+ //##############
2899
+ //### DELETE ###
2900
+ //##############
2901
+ //funzione per l'eliminazione del paziente
2902
+ deletePatient(id) {
2903
+ return this.http.delete(`${this.endpoint}${id}`);
2904
+ }
2905
+ deleteSetting(id) {
2906
+ return this.http.delete(`${this.endpoint}Setting/${id}`);
2907
+ }
2908
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiPatientService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
2909
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiPatientService, providedIn: 'root' });
2910
+ }
2911
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiPatientService, decorators: [{
2912
+ type: Injectable,
2913
+ args: [{
2914
+ providedIn: 'root',
2915
+ }]
2916
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2917
+ type: Inject,
2918
+ args: [API_CONFIG]
2919
+ }] }] });
2920
+
2921
+ //Servizio api per le chiamate riguardarti le strutture
2922
+ class ApiPatientDictionaryService {
2923
+ gateway;
2924
+ endpoint;
2925
+ constructor(gateway) {
2926
+ this.gateway = gateway;
2927
+ this.endpoint = `${this.gateway}/Patient/`;
2928
+ }
2929
+ http = inject(HttpClient);
2930
+ //###############
2931
+ //##### GET #####
2932
+ //###############
2933
+ //funzione per il ritorno degli identifier in base ai parametri
2934
+ getIdentifiers() {
2935
+ return this.http.get(`${this.endpoint}Dictionary/Identifier`);
2936
+ }
2937
+ getDictionaryIdentifierById(identifierId) {
2938
+ const params = new HttpParams().set('identifierId', identifierId);
2939
+ return this.http.get(`${this.endpoint}Dictionary/Identifier`, {
2940
+ params: params,
2941
+ });
2942
+ }
2943
+ //funzione per il ritorno dei tipi di address in base al parametro
2944
+ getDictionaryTypesAddress() {
2945
+ return this.http.get(`${this.endpoint}Dictionary/TypeAddress`);
2946
+ }
2947
+ getDictionaryTypeAddressById(addressId) {
2948
+ const params = new HttpParams().set('addressId', addressId);
2949
+ return this.http.get(`${this.endpoint}Dictionary/TypeAddress`, {
2950
+ params: params,
2951
+ });
2952
+ }
2953
+ //funzione per il ritorno dei tipi di contatto
2954
+ getDictionaryTypesContact() {
2955
+ return this.http.get(`${this.endpoint}Dictionary/TypeContact`);
2956
+ }
2957
+ getDictionaryTypeContactById(contactId) {
2958
+ const params = new HttpParams().set('contactId', contactId);
2959
+ return this.http.get(`${this.endpoint}Dictionary/TypeContact`, {
2960
+ params: params,
2961
+ });
2962
+ }
2963
+ //funzione per il ritorno dei setting
2964
+ getSettingBySenderReceiver(sender, receiver) {
2965
+ const params = new HttpParams().set('sender', sender).set('receiver', receiver);
2966
+ return this.http.get(`${this.endpoint}Dictionary/Setting`, {
2967
+ params: params,
2968
+ });
2969
+ }
2970
+ getSettingById(id) {
2971
+ const params = new HttpParams().set('id', id);
2972
+ return this.http.get(`${this.endpoint}Dictionary/Setting`, {
2973
+ params: params,
2974
+ });
2975
+ }
2976
+ //funzione per il ritorno di setting status
2977
+ getSettingStatus() {
2978
+ return this.http.get(`${this.endpoint}Dictionary/Setting/Status`);
2979
+ }
2980
+ getSettingStatusById(id) {
2981
+ const params = new HttpParams().set('id', id);
2982
+ return this.http.get(`${this.endpoint}Dictionary/Setting/Status`, {
2983
+ params: params,
2984
+ });
2985
+ }
2986
+ getTypeEvent() {
2987
+ return this.http.get(`${this.endpoint}Dictionary/TypeEvent`);
2988
+ }
2989
+ getTypeEventByCode(code) {
2990
+ const params = new HttpParams().set('code', code);
2991
+ return this.http.get(`${this.endpoint}Dictionary/TypeEvent`, {
2992
+ params: params,
2993
+ });
2994
+ }
2995
+ getTypeEventById(id) {
2996
+ const params = new HttpParams().set('id', id);
2997
+ return this.http.get(`${this.endpoint}Dictionary/TypeEvent`, {
2998
+ params: params,
2999
+ });
3000
+ }
3001
+ //##############
3002
+ //#### POST ####
3003
+ //##############
3004
+ //inserimento identifier
3005
+ postDictionaryIdentifier(dictionaryIdentifierRequest) {
3006
+ return this.http.post(`${this.endpoint}Dictionary/Identifier`, dictionaryIdentifierRequest);
3007
+ }
3008
+ //inserimento tipo address
3009
+ postDictionaryTypeAddress(dictionaryTypeAddressRequest) {
3010
+ return this.http.post(`${this.endpoint}Dictionary/TypeAddress`, dictionaryTypeAddressRequest);
3011
+ }
3012
+ //insirimento tipo contatto
3013
+ postDictionaryTypeContact(dictionaryTypeContactRequest) {
3014
+ return this.http.post(`${this.endpoint}Dictionary/TypeContact`, dictionaryTypeContactRequest);
3015
+ }
3016
+ //inserimento sender/receiver
3017
+ postDictionarySetting(dictionarySetting) {
3018
+ return this.http.post(`${this.endpoint}Dictionary/Setting`, dictionarySetting);
3019
+ }
3020
+ //inserimento status setting
3021
+ postDictionarySettingStatus(dictionarySettingStatus) {
3022
+ return this.http.post(`${this.endpoint}Dictionary/Setting/Status`, dictionarySettingStatus);
3023
+ }
3024
+ //###############
3025
+ //##### PUT #####
3026
+ //###############
3027
+ //##############
3028
+ //### DELETE ###
3029
+ //##############
3030
+ //eliminazione identifier
3031
+ deleteIdentifier(identifierId) {
3032
+ const params = new HttpParams().set('identifierId', identifierId);
3033
+ return this.http.delete(`${this.endpoint}Dictionary/TypeContact`, {
3034
+ params: params,
3035
+ });
3036
+ }
3037
+ //eliminazione tipo address
3038
+ deleteTypeAddress(addressId) {
3039
+ const params = new HttpParams().set('addressId', addressId);
3040
+ return this.http.delete(`${this.endpoint}Dictionary/TypeAddress`, {
3041
+ params: params,
3042
+ });
3043
+ }
3044
+ //eliminazione tipo contatto
3045
+ deleteTypeContact(contactId) {
3046
+ const params = new HttpParams().set('contactId', contactId);
3047
+ return this.http.delete(`${this.endpoint}Dictionary/TypeContact`, {
3048
+ params: params,
3049
+ });
3050
+ }
3051
+ deleteSetting(id) {
3052
+ return this.http.delete(`${this.endpoint}Dictionary/Setting/${id}`);
3053
+ }
3054
+ deleteStatus(id) {
3055
+ return this.http.delete(`${this.endpoint}Dictionary/Setting/Status/${id}`);
3056
+ }
3057
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiPatientDictionaryService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
3058
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiPatientDictionaryService, providedIn: 'root' });
3059
+ }
3060
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiPatientDictionaryService, decorators: [{
3061
+ type: Injectable,
3062
+ args: [{
3063
+ providedIn: 'root',
3064
+ }]
3065
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
3066
+ type: Inject,
3067
+ args: [API_CONFIG]
3068
+ }] }] });
3069
+
3070
+ //Servizio api per le chiamate riguardarti le strutture
3071
+ class ApiRequestService {
3072
+ gateway;
3073
+ endpoint;
3074
+ constructor(gateway) {
3075
+ this.gateway = gateway;
3076
+ this.endpoint = `${this.gateway}/Request/`;
3077
+ }
3078
+ http = inject(HttpClient);
3079
+ //###############
3080
+ //##### GET #####
3081
+ //###############
3082
+ //funzioni per la ricerca delle richieste in base al parametro
3083
+ getRequests() {
3084
+ return this.http.get(`${this.endpoint}`);
3085
+ }
3086
+ getRequestByParameters(statusId, typeId) {
3087
+ const params = new HttpParams().set('statusId', statusId).set('typeId', typeId);
3088
+ return this.http.get(`${this.endpoint}`, {
3089
+ params: params,
3090
+ });
3091
+ }
3092
+ getRequestByKey(key) {
3093
+ const params = new HttpParams().set('key', key);
3094
+ return this.http.get(`${this.endpoint}`, {
3095
+ params: params,
3096
+ });
3097
+ }
3098
+ getRequestsByStatus(statusId) {
3099
+ const params = new HttpParams().set('statusId', statusId);
3100
+ return this.http.get(`${this.endpoint}`, {
3101
+ params: params,
3102
+ });
3103
+ }
3104
+ getRequestByType(typeId) {
3105
+ const params = new HttpParams().set('typeId', typeId);
3106
+ return this.http.get(`${this.endpoint}`, {
3107
+ params: params,
3108
+ });
3109
+ }
3110
+ //##############
3111
+ //#### POST ####
3112
+ //##############
3113
+ //funzione per l'inserimento della richiesta
3114
+ postRequest(requestRequest, accountProfileId) {
3115
+ const params = new HttpParams().set('accountProfileId', accountProfileId);
3116
+ return this.http.post(`${this.endpoint}`, requestRequest, {
3117
+ params: params,
3118
+ });
3119
+ }
3120
+ //###############
3121
+ //##### PUT #####
3122
+ //###############
3123
+ setRequestStatus(requestId, statusId, accountProfileId) {
3124
+ const params = new HttpParams().set('requestId', requestId).set('statusId', statusId).set('accountProfileId', accountProfileId);
3125
+ return this.http.put(`${this.endpoint}`, null, {
3126
+ params: params,
3127
+ });
3128
+ }
3129
+ //##############
3130
+ //### DELETE ###
3131
+ //##############
3132
+ //funzione per l'eliminazione della richiesta
3133
+ deleteRequest(key) {
3134
+ const params = new HttpParams().set('key', key);
3135
+ return this.http.delete(`${this.endpoint}`, {
3136
+ params: params,
3137
+ });
3138
+ }
3139
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiRequestService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
3140
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiRequestService, providedIn: 'root' });
3141
+ }
3142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiRequestService, decorators: [{
3143
+ type: Injectable,
3144
+ args: [{
3145
+ providedIn: 'root',
3146
+ }]
3147
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
3148
+ type: Inject,
3149
+ args: [API_CONFIG]
3150
+ }] }] });
3151
+
3152
+ //Servizio api per le chiamate riguardarti le strutture
3153
+ class ApiRequestDictionaryService {
3154
+ gateway;
3155
+ endpoint;
3156
+ constructor(gateway) {
3157
+ this.gateway = gateway;
3158
+ this.endpoint = `${this.gateway}/Request/`;
3159
+ }
3160
+ http = inject(HttpClient);
3161
+ //###############
3162
+ //##### GET #####
3163
+ //###############
3164
+ //funzioni per la ricerca delle key in base al parametro
3165
+ //tutte le key
3166
+ getKeys() {
3167
+ return this.http.get(`${this.endpoint}Dictionary/Key`);
3168
+ }
3169
+ //ricerca con più di un parametro
3170
+ getKeyByParameters(patientId, accessId, requestId, spoke) {
3171
+ const params = new HttpParams().set('patientId', patientId).set('accessId', accessId).set('requestId', requestId).set('spoke', spoke);
3172
+ return this.http.get(`${this.endpoint}Dictionary/Key`, {
3173
+ params: params,
3174
+ });
3175
+ }
3176
+ //dati parametri singoli
3177
+ getKeyById(id) {
3178
+ const params = new HttpParams().set('id', id);
3179
+ return this.http.get(`${this.endpoint}Dictionary/Key`, {
3180
+ params: params,
3181
+ });
3182
+ }
3183
+ getKeyByPatientId(patientId) {
3184
+ const params = new HttpParams().set('patientId', patientId);
3185
+ return this.http.get(`${this.endpoint}Dictionary/Key`, {
3186
+ params: params,
3187
+ });
3188
+ }
3189
+ getKeyByAccessId(accessId) {
3190
+ const params = new HttpParams().set('accessId', accessId);
3191
+ return this.http.get(`${this.endpoint}Dictionary/Key`, {
3192
+ params: params,
3193
+ });
3194
+ }
3195
+ getKeyByRequestId(requestId) {
3196
+ const params = new HttpParams().set('requestId', requestId);
3197
+ return this.http.get(`${this.endpoint}Dictionary/Key`, {
3198
+ params: params,
3199
+ });
3200
+ }
3201
+ getKeyBySpoke(spoke) {
3202
+ const params = new HttpParams().set('spoke', spoke);
3203
+ return this.http.get(`${this.endpoint}Dictionary/Key`, {
3204
+ params: params,
3205
+ });
3206
+ }
3207
+ //funzione che ritorna gli outcome
3208
+ getOutcomes() {
3209
+ return this.http.get(`${this.endpoint}Dictionary/Outcome`);
3210
+ }
3211
+ //funzione che ritorna gli outcome dato l'id
3212
+ getOutcomeById(id) {
3213
+ const params = new HttpParams().set('id', id);
3214
+ return this.http.get(`${this.endpoint}Dictionary/Key`, {
3215
+ params: params,
3216
+ });
3217
+ }
3218
+ //funzione che ritorna tutti gli status
3219
+ getStatus() {
3220
+ return this.http.get(`${this.endpoint}Dictionary/Status`);
3221
+ }
3222
+ //funzione che ritorna gli stauts dato l'id
3223
+ getStatusById(id) {
3224
+ const params = new HttpParams().set('id', id);
3225
+ return this.http.get(`${this.endpoint}Dictionary/Status`, {
3226
+ params: params,
3227
+ });
3228
+ }
3229
+ //funzione che ritorna tutti i tipi richiesta
3230
+ getTypesRequest() {
3231
+ return this.http.get(`${this.endpoint}Dictionary/TypeRequest`);
3232
+ }
3233
+ //funzione che ritorna il tipo richiesta dato l'id
3234
+ getTypeRequestById(id) {
3235
+ const params = new HttpParams().set('id', id);
3236
+ return this.http.get(`${this.endpoint}Dictionary/TypeRequest`, {
3237
+ params: params,
3238
+ });
3239
+ }
3240
+ //funzione che ritorna tutti i tipi richiesta
3241
+ getTypeRequestOutcome() {
3242
+ return this.http.get(`${this.endpoint}Dictionary/TypeRequest/Outcome`);
3243
+ }
3244
+ //funzione che ritorna il tipo richiesta dato l'id
3245
+ getTypeRequestOutcomeById(id) {
3246
+ const params = new HttpParams().set('id', id);
3247
+ return this.http.get(`${this.endpoint}Dictionary/TypeRequest/Outcome`, {
3248
+ params: params,
3249
+ });
3250
+ }
3251
+ //funzione che ritorna tutti i tipi di priorità
3252
+ getPriorities() {
3253
+ return this.http.get(`${this.endpoint}Dictionary/Priority`);
3254
+ }
3255
+ //funzione che ritorna la priorità dato l'id
3256
+ getPriority(id) {
3257
+ const params = new HttpParams().set('id', id);
3258
+ return this.http.get(`${this.endpoint}Dictionary/Priority`, {
3259
+ params: params,
3260
+ });
3261
+ }
3262
+ //##############
3263
+ //#### POST ####
3264
+ //##############
3265
+ //funzione post delle key
3266
+ postKey(dictionaryKey) {
3267
+ return this.http.post(`${this.endpoint}Dictionary/Key`, dictionaryKey);
3268
+ }
3269
+ //post outcome per inserimento
3270
+ postOutcome(dictionaryOutcome) {
3271
+ return this.http.post(`${this.endpoint}Dictionary/Outcome`, dictionaryOutcome);
3272
+ }
3273
+ //post status per inserimento
3274
+ postStatus(dictionaryStatus) {
3275
+ return this.http.post(`${this.endpoint}Dictionary/Stauts`, dictionaryStatus);
3276
+ }
3277
+ //post TypeRequest per inserimento
3278
+ postTypeRequest(dictionaryTypeRequest) {
3279
+ return this.http.post(`${this.endpoint}Dictionary/TypeRequest`, dictionaryTypeRequest);
3280
+ }
3281
+ //post tipo outcome per inserimento
3282
+ postTypeRequestOutcome(dictionaryTypeRequestOutcome) {
3283
+ return this.http.post(`${this.endpoint}Dictionary/TypeRequest/Outcome`, dictionaryTypeRequestOutcome);
3284
+ }
3285
+ //post priorità per inserimento
3286
+ postPriority(dictionaryPriority) {
3287
+ return this.http.post(`${this.endpoint}Dictionary/Priority`, dictionaryPriority);
3288
+ }
3289
+ //###############
3290
+ //##### PUT #####
3291
+ //###############
3292
+ putKey(dictionaryKey) {
3293
+ return this.http.put(`${this.endpoint}Dictionary/Key`, dictionaryKey);
3294
+ }
3295
+ //##############
3296
+ //### DELETE ###
3297
+ //##############
3298
+ //funzione per l'eliminazione della key
3299
+ deleteKey(key) {
3300
+ const params = new HttpParams().set('key', key);
3301
+ return this.http.delete(`${this.endpoint}Dictionary/Key`, {
3302
+ params: params,
3303
+ });
3304
+ }
3305
+ //funzione per l'eliminazione dell'outcome
3306
+ deleteOutcome(id) {
3307
+ const params = new HttpParams().set('id', id);
3308
+ return this.http.delete(`${this.endpoint}Dictionary/Outcome`, {
3309
+ params: params,
3310
+ });
3311
+ }
3312
+ //funzione per l'eliminazione dello Status
3313
+ deleteStatus(id) {
3314
+ const params = new HttpParams().set('id', id);
3315
+ return this.http.delete(`${this.endpoint}Dictionary/Status`, {
3316
+ params: params,
3317
+ });
3318
+ }
3319
+ //funzione per l'eliminazione del tipo richiesta
3320
+ deleteTypeRequest(id) {
3321
+ const params = new HttpParams().set('id', id);
3322
+ return this.http.delete(`${this.endpoint}Dictionary/TypeRequest`, {
3323
+ params: params,
3324
+ });
3325
+ }
3326
+ //funzione per l'eliminazione del tipo di outcome
3327
+ deleteTypeRequestOutcome(id) {
3328
+ const params = new HttpParams().set('id', id);
3329
+ return this.http.delete(`${this.endpoint}Dictionary/TypeRequest/Outcome`, {
3330
+ params: params,
3331
+ });
3332
+ }
3333
+ //funzione per l'eliminazione della priorità
3334
+ deletePriority(id) {
3335
+ const params = new HttpParams().set('id', id);
3336
+ return this.http.delete(`${this.endpoint}Dictionary/Priority`, {
3337
+ params: params,
3338
+ });
3339
+ }
3340
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiRequestDictionaryService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
3341
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiRequestDictionaryService, providedIn: 'root' });
3342
+ }
3343
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiRequestDictionaryService, decorators: [{
3344
+ type: Injectable,
3345
+ args: [{
3346
+ providedIn: 'root',
3347
+ }]
3348
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
3349
+ type: Inject,
3350
+ args: [API_CONFIG]
3351
+ }] }] });
3352
+
3353
+ //Servizio api per le chiamate riguardarti le strutture
3354
+ class ApiStructureService {
3355
+ gateway;
3356
+ endpoint;
3357
+ constructor(gateway) {
3358
+ this.gateway = gateway;
3359
+ this.endpoint = `${this.gateway}/Structure/`;
3360
+ }
3361
+ http = inject(HttpClient);
3362
+ //###############
3363
+ //##### GET #####
3364
+ //###############
3365
+ //funzioni per la ricerca delle richieste in base al parametro
3366
+ getStructures() {
3367
+ return this.http.get(`${this.endpoint}`);
3368
+ }
3369
+ getRequestById(id) {
3370
+ const params = new HttpParams().set('id', id);
3371
+ return this.http.get(`${this.endpoint}`, {
3372
+ params: params,
3373
+ });
3374
+ }
3375
+ getStructureByDepartmentId(departmentId) {
3376
+ const params = new HttpParams().set('departmentId', departmentId);
3377
+ return this.http.get(`${this.endpoint}`, {
3378
+ params: params,
3379
+ });
3380
+ }
3381
+ //##############
3382
+ //#### POST ####
3383
+ //##############
3384
+ //funzione per l'inserimento e modifica della struttura
3385
+ postStructure(structureRequest) {
3386
+ return this.http.post(`${this.endpoint}`, structureRequest);
3387
+ }
3388
+ //###############
3389
+ //##### PUT #####
3390
+ //###############
3391
+ //##############
3392
+ //### DELETE ###
3393
+ //##############
3394
+ //funzione per l'eliminazione della richiesta
3395
+ deleteStructure(id) {
3396
+ return this.http.delete(`${this.endpoint}${id}`);
3397
+ }
3398
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiStructureService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
3399
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiStructureService, providedIn: 'root' });
3400
+ }
3401
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiStructureService, decorators: [{
3402
+ type: Injectable,
3403
+ args: [{
3404
+ providedIn: 'root',
3405
+ }]
3406
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
3407
+ type: Inject,
3408
+ args: [API_CONFIG]
3409
+ }] }] });
3410
+
3411
+ //Servizio api per le chiamate riguardarti le strutture
3412
+ class ApiStructureDictionaryService {
3413
+ gateway;
3414
+ endpoint;
3415
+ constructor(gateway) {
3416
+ this.gateway = gateway;
3417
+ this.endpoint = `${this.gateway}/Structure/`;
3418
+ }
3419
+ http = inject(HttpClient);
3420
+ //###############
3421
+ //##### GET #####
3422
+ //###############
3423
+ //funzioni per la ricerca dei department in base al parametro
3424
+ getDepartments() {
3425
+ return this.http.get(`${this.endpoint}Dictionary/Department`);
3426
+ }
3427
+ getDepartmentById(id) {
3428
+ const params = new HttpParams().set('id', id);
3429
+ return this.http.get(`${this.endpoint}Dictionary/Department`, {
3430
+ params: params,
3431
+ });
3432
+ }
3433
+ getDepartmentByCode(code) {
3434
+ const params = new HttpParams().set('code', code);
3435
+ return this.http.get(`${this.endpoint}Dictionary/Department`, {
3436
+ params: params
3437
+ });
3438
+ }
3439
+ getDepartmentByParameters(id, code) {
3440
+ const params = new HttpParams().set('id', id).set('code', code);
3441
+ return this.http.get(`${this.endpoint}Dictionary/Department`, {
3442
+ params: params
3443
+ });
3444
+ }
3445
+ getTypesStructure() {
3446
+ return this.http.get(`${this.endpoint}Dictionary/TypeStructure`);
3447
+ }
3448
+ getTypeStructureById(id) {
3449
+ const params = new HttpParams().set('id', id);
3450
+ return this.http.get(`${this.endpoint}Dictionary/TypeStructure`, {
3451
+ params: params,
3452
+ });
3453
+ }
3454
+ //##############
3455
+ //#### POST ####
3456
+ //##############
3457
+ //funzione per l'inserimento e modifica del department
3458
+ postDepartment(departmentRequest) {
3459
+ return this.http.post(`${this.endpoint}Dictionary/Department`, departmentRequest);
3460
+ }
3461
+ postTypeStructure(typeStructureRequest) {
3462
+ return this.http.post(`${this.endpoint}Dictionary/TypeStructure`, typeStructureRequest);
3463
+ }
3464
+ //###############
3465
+ //##### PUT #####
3466
+ //###############
3467
+ //##############
3468
+ //### DELETE ###
3469
+ //##############
3470
+ //funzione per l'eliminazione della richiesta
3471
+ deleteDepartment(id) {
3472
+ return this.http.delete(`${this.endpoint}Dictionary/Department/${id}`);
3473
+ }
3474
+ deleteTypeStructure(id) {
3475
+ const params = new HttpParams().set('id', id);
3476
+ return this.http.delete(`${this.endpoint}Dictionary/TypeStructure`, {
3477
+ params: params,
3478
+ });
3479
+ }
3480
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiStructureDictionaryService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
3481
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiStructureDictionaryService, providedIn: 'root' });
3482
+ }
3483
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiStructureDictionaryService, decorators: [{
3484
+ type: Injectable,
3485
+ args: [{
3486
+ providedIn: 'root',
3487
+ }]
3488
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
3489
+ type: Inject,
3490
+ args: [API_CONFIG]
3491
+ }] }] });
3492
+
3493
+ class ApiSurveyDictionaryService {
3494
+ gateway;
3495
+ endpoint;
3496
+ constructor(gateway) {
3497
+ this.gateway = gateway;
3498
+ this.endpoint = `${this.gateway}/Survey/`;
3499
+ }
3500
+ http = inject(HttpClient);
3501
+ //###############
3502
+ //##### GET #####
3503
+ //###############
3504
+ //funzioni per la ricerca dei tipi di domanda in base al parametro
3505
+ getTypeQuestions() {
3506
+ return this.http.get(`${this.endpoint}Dictionary/TypeQuestion`);
3507
+ }
3508
+ getTypeQuestionById(id) {
3509
+ const params = new HttpParams().set('id', id);
3510
+ return this.http.get(`${this.endpoint}Dictionary/TypeQuestion`, {
3511
+ params: params,
3512
+ });
3513
+ }
3514
+ //funzioni per la ricerca dei tipi di domanda in base al parametro
3515
+ getTypeSurveys() {
3516
+ return this.http.get(`${this.endpoint}Dictionary/TypeSurvey`);
3517
+ }
3518
+ getTypeSurveyById(id) {
3519
+ const params = new HttpParams().set('id', id);
3520
+ return this.http.get(`${this.endpoint}Dictionary/TypeSurvey`, {
3521
+ params: params,
3522
+ });
3523
+ }
3524
+ //funzioni per la ricerca dei tipi di domanda in base al parametro
3525
+ getIcons() {
3526
+ return this.http.get(`${this.endpoint}Dictionary/TypeSurvey`);
3527
+ }
3528
+ getIconById(id) {
3529
+ const params = new HttpParams().set('id', id);
3530
+ return this.http.get(`${this.endpoint}Dictionary/TypeSurvey`, {
3531
+ params: params,
3532
+ });
3533
+ }
3534
+ //##############
3535
+ //#### POST ####
3536
+ //##############
3537
+ postTypeQuestion(dictionaryTypeQuestion) {
3538
+ return this.http.post(`${this.endpoint}Dictionary/TypeQuestion`, dictionaryTypeQuestion);
3539
+ }
3540
+ postTypeSurvey(dictionarySurveyQuestion) {
3541
+ return this.http.post(`${this.endpoint}Dictionary/TypeSurvey`, dictionarySurveyQuestion);
3542
+ }
3543
+ postIcon(dictionaryIcon) {
3544
+ return this.http.post(`${this.endpoint}Dictionary/Icon`, dictionaryIcon);
3545
+ }
3546
+ //###############
3547
+ //##### PUT #####
3548
+ //###############
3549
+ //##############
3550
+ //### DELETE ###
3551
+ //##############
3552
+ //funzione per l'eliminazione del tipo domanda
3553
+ deleteTypeQuestion(id) {
3554
+ const params = new HttpParams().set('id', id);
3555
+ return this.http.delete(`${this.endpoint}Dictionary/TypeQuestion`, {
3556
+ params: params,
3557
+ });
3558
+ }
3559
+ //funzione per l'eliminazione del tipo questionario
3560
+ deleteTypeSurvey(id) {
3561
+ return this.http.delete(`${this.endpoint}Dictionary/TypeSurvey/${id}`);
3562
+ }
3563
+ //funzione per l'eliminazione dell'icona
3564
+ deleteIcon(id) {
3565
+ const params = new HttpParams().set('id', id);
3566
+ return this.http.delete(`${this.endpoint}Dictionary/Icon`, {
3567
+ params: params,
3568
+ });
3569
+ }
3570
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiSurveyDictionaryService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
3571
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiSurveyDictionaryService, providedIn: 'root' });
3572
+ }
3573
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiSurveyDictionaryService, decorators: [{
3574
+ type: Injectable,
3575
+ args: [{
3576
+ providedIn: 'root'
3577
+ }]
3578
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
3579
+ type: Inject,
3580
+ args: [API_CONFIG]
3581
+ }] }] });
3582
+
3583
+ class ApiEventService {
3584
+ gateway;
3585
+ endpoint;
3586
+ constructor(gateway) {
3587
+ this.gateway = gateway;
3588
+ this.endpoint = `${this.gateway}/Event/`;
3589
+ }
3590
+ http = inject(HttpClient);
3591
+ //###############
3592
+ //##### GET #####
3593
+ //###############
3594
+ getEventsByPatientIdStartEnd(patientId, start, end) {
3595
+ const params = new HttpParams().set('patientId', patientId).set('start', start).set('end', end);
3596
+ return this.http.get(`${this.endpoint}`, {
3597
+ params: params,
3598
+ });
3599
+ }
3600
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiEventService, deps: [{ token: API_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
3601
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiEventService, providedIn: 'root' });
3602
+ }
3603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApiEventService, decorators: [{
3604
+ type: Injectable,
3605
+ args: [{
3606
+ providedIn: 'root'
3607
+ }]
3608
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
3609
+ type: Inject,
3610
+ args: [API_CONFIG]
3611
+ }] }] });
3612
+
3613
+ /*
3614
+ * Public API Surface of itc-library20
3615
+ */
3616
+
3617
+ /**
3618
+ * Generated bundle index. Do not edit.
3619
+ */
3620
+
3621
+ export { API_CONFIG, ApiAccountDictionaryService, ApiAccountService, ApiAdministrationService, ApiEventService, ApiExamAppointmentService, ApiExamDictionaryService, ApiExamService, ApiGeographyService, ApiKitService, ApiPatientDictionaryService, ApiPatientService, ApiRequestDictionaryService, ApiRequestService, ApiStructureDictionaryService, ApiStructureService, ApiSurveyDictionaryService, ApiSurveyService, BasicTable, Calendar, CalendarView, FormatDate, ItcLibrary20, Message, Minio, PRIMENG_ITALIAN_LOCALE, PrimaryButton, PrimengItalianLocale, SecondaryButton, SortableTable, Survey, SurveyRadio, SurveyText, SurveyValuebox, ThirdButton };
3622
+ //# sourceMappingURL=itc-components-library20.mjs.map