cat-documents-ng 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +15 -8
- package/Shared/shared.module.d.ts +2 -1
- package/fesm2022/cat-documents-ng.mjs +219 -235
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-actions/document-actions.component.d.ts +3 -3
- package/lib/document/components/sidebar/sidebar.component.d.ts +29 -31
- package/package.json +1 -1
|
@@ -8,6 +8,8 @@ import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http'
|
|
|
8
8
|
import { __decorate } from 'tslib';
|
|
9
9
|
import { EntityStore, StoreConfig, QueryEntity } from '@datorama/akita';
|
|
10
10
|
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
|
|
11
|
+
import * as i6$2 from 'primeng/confirmdialog';
|
|
12
|
+
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
11
13
|
import { trigger, state, transition, style, animate } from '@angular/animations';
|
|
12
14
|
import * as i3 from 'primeng/api';
|
|
13
15
|
import { ConfirmationService, MessageService } from 'primeng/api';
|
|
@@ -1339,7 +1341,7 @@ class DocumentHttpService {
|
|
|
1339
1341
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1340
1342
|
*/
|
|
1341
1343
|
getDocumentCatagories(contextId) {
|
|
1342
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1344
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1343
1345
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`, { headers }).pipe(tap((response) => {
|
|
1344
1346
|
// Store only the categories array, not the entire response
|
|
1345
1347
|
if (response && response.categories) {
|
|
@@ -1398,7 +1400,7 @@ class DocumentHttpService {
|
|
|
1398
1400
|
* @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
|
|
1399
1401
|
*/
|
|
1400
1402
|
updateDocumentName(documentId, payload) {
|
|
1401
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1403
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1402
1404
|
return this.http.put(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${documentId}`, payload, { headers }).pipe(catchError((error) => {
|
|
1403
1405
|
return throwError(() => new Error(error));
|
|
1404
1406
|
}));
|
|
@@ -1409,7 +1411,7 @@ class DocumentHttpService {
|
|
|
1409
1411
|
* @returns {Observable<UserListModel[]>} Observable that emits the user list data.
|
|
1410
1412
|
*/
|
|
1411
1413
|
getUserListByContextId(contextId) {
|
|
1412
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1414
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1413
1415
|
if (!contextId)
|
|
1414
1416
|
return EMPTY;
|
|
1415
1417
|
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`, { headers }).pipe(tap((userList) => {
|
|
@@ -1428,7 +1430,7 @@ class DocumentHttpService {
|
|
|
1428
1430
|
getStatusDocumentCount(applicationId, contextId = null, categoryId = null) {
|
|
1429
1431
|
if (!applicationId)
|
|
1430
1432
|
return EMPTY;
|
|
1431
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1433
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1432
1434
|
let url = `${this.apiUrl}${URLS.STATUS_DOCUMENT_COUNT}${applicationId}`;
|
|
1433
1435
|
let params = new HttpParams();
|
|
1434
1436
|
const contextParam = contextId || null;
|
|
@@ -1457,7 +1459,7 @@ class DocumentHttpService {
|
|
|
1457
1459
|
*/
|
|
1458
1460
|
getDocumentsBySelection(contextId, menuItem, userId, status, searchKey = null) {
|
|
1459
1461
|
let params = new HttpParams();
|
|
1460
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1462
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1461
1463
|
if (userId) {
|
|
1462
1464
|
params = params.set(SHARED.CONTEXT_ID, userId);
|
|
1463
1465
|
}
|
|
@@ -1479,7 +1481,7 @@ class DocumentHttpService {
|
|
|
1479
1481
|
if (!documentId) {
|
|
1480
1482
|
return of([]);
|
|
1481
1483
|
}
|
|
1482
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1484
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1483
1485
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`, { headers }).pipe(catchError((error) => {
|
|
1484
1486
|
return throwError(() => new Error(error));
|
|
1485
1487
|
}));
|
|
@@ -1492,7 +1494,7 @@ class DocumentHttpService {
|
|
|
1492
1494
|
getCategoriesBySource(source) {
|
|
1493
1495
|
if (!source)
|
|
1494
1496
|
return EMPTY;
|
|
1495
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1497
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1496
1498
|
return this.http.get(`${this.apiUrl}${URLS.GET_CATEGORIES_BY_SOURCE}${source}`, { headers }).pipe(catchError((error) => {
|
|
1497
1499
|
return throwError(() => new Error(error));
|
|
1498
1500
|
}));
|
|
@@ -1505,7 +1507,7 @@ class DocumentHttpService {
|
|
|
1505
1507
|
getDocumentTypesByCategory(categoryId) {
|
|
1506
1508
|
if (!categoryId)
|
|
1507
1509
|
return EMPTY;
|
|
1508
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1510
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1509
1511
|
return this.http.get(`${this.apiUrl}${URLS.GET_DOCUMENT_TYPES_BY_CATEGORY}${categoryId}`, { headers }).pipe(catchError((error) => {
|
|
1510
1512
|
return throwError(() => new Error(error));
|
|
1511
1513
|
}));
|
|
@@ -1516,7 +1518,7 @@ class DocumentHttpService {
|
|
|
1516
1518
|
* @returns {Observable<any>} Observable that emits the upload response.
|
|
1517
1519
|
*/
|
|
1518
1520
|
uploadFile(formData) {
|
|
1519
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1521
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1520
1522
|
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, formData, { headers }).pipe(catchError((error) => {
|
|
1521
1523
|
return throwError(() => new Error(error));
|
|
1522
1524
|
}));
|
|
@@ -1527,7 +1529,7 @@ class DocumentHttpService {
|
|
|
1527
1529
|
* @returns {Observable<any>} Observable that emits the save response.
|
|
1528
1530
|
*/
|
|
1529
1531
|
saveDocumentUpload(payload) {
|
|
1530
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1532
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1531
1533
|
return this.http.post(`${this.apiUrl}${URLS.SAVE_DOCUMENT_UPLOAD}`, payload, { headers }).pipe(catchError((error) => {
|
|
1532
1534
|
return throwError(() => new Error(error));
|
|
1533
1535
|
}));
|
|
@@ -1543,7 +1545,7 @@ class DocumentHttpService {
|
|
|
1543
1545
|
const payload = {
|
|
1544
1546
|
statusUpdateDescription: statusUpdateDescription
|
|
1545
1547
|
};
|
|
1546
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1548
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1547
1549
|
return this.http.put(`${this.apiUrl}${URLS.UPDATE_DOCUMENT_STATUS}${documentId}/${status}`, payload, { headers }).pipe(tap((response) => {
|
|
1548
1550
|
if (response && response.status) {
|
|
1549
1551
|
const normalizedStatus = this.normalizeStatus(response.status);
|
|
@@ -1577,7 +1579,7 @@ class DocumentHttpService {
|
|
|
1577
1579
|
* @returns {Observable<any>} Observable that emits the delete response
|
|
1578
1580
|
*/
|
|
1579
1581
|
deleteDocument(documentId, contextId) {
|
|
1580
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1582
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1581
1583
|
return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`, { headers }).pipe(tap(() => {
|
|
1582
1584
|
this.getDocumentCatagories(contextId).subscribe();
|
|
1583
1585
|
this.getUserListByContextId(contextId).subscribe();
|
|
@@ -2379,7 +2381,7 @@ class DocumentService {
|
|
|
2379
2381
|
* @returns {Observable<any>} Observable that emits the newly created document.
|
|
2380
2382
|
*/
|
|
2381
2383
|
create(entity) {
|
|
2382
|
-
const headers = { 'Authorization': 'Bearer
|
|
2384
|
+
const headers = { 'Authorization': 'Bearer db15d0f4-46e9-4968-8e37-4371acb093c1' };
|
|
2383
2385
|
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, entity, { headers }).pipe(tap((newEntity) => this.documentStore.add(newEntity)));
|
|
2384
2386
|
}
|
|
2385
2387
|
/**
|
|
@@ -3536,6 +3538,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3536
3538
|
}] } });
|
|
3537
3539
|
|
|
3538
3540
|
class ConfirmationDialogComponent {
|
|
3541
|
+
confirmationService;
|
|
3539
3542
|
confirmationOptions = {
|
|
3540
3543
|
message: 'Are you sure that you want to proceed?',
|
|
3541
3544
|
header: 'Confirmation',
|
|
@@ -3544,13 +3547,12 @@ class ConfirmationDialogComponent {
|
|
|
3544
3547
|
rejectLabel: 'No',
|
|
3545
3548
|
acceptIcon: 'pi pi-check',
|
|
3546
3549
|
rejectIcon: 'pi pi-times',
|
|
3547
|
-
acceptButtonClass: 'btn-
|
|
3550
|
+
acceptButtonClass: 'btn-danger',
|
|
3548
3551
|
rejectButtonClass: 'btn-secondary'
|
|
3549
3552
|
};
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
rejectCallback;
|
|
3553
|
+
constructor(confirmationService) {
|
|
3554
|
+
this.confirmationService = confirmationService;
|
|
3555
|
+
}
|
|
3554
3556
|
/**
|
|
3555
3557
|
* Shows the confirmation dialog with the specified options
|
|
3556
3558
|
* @param options - Configuration options for the confirmation dialog
|
|
@@ -3558,19 +3560,60 @@ class ConfirmationDialogComponent {
|
|
|
3558
3560
|
* @param rejectCallback - Function to execute when user rejects
|
|
3559
3561
|
*/
|
|
3560
3562
|
confirm(options, acceptCallback, rejectCallback) {
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3563
|
+
const confirmation = {
|
|
3564
|
+
message: options.message || this.confirmationOptions.message,
|
|
3565
|
+
header: options.header || this.confirmationOptions.header,
|
|
3566
|
+
icon: options.icon || this.confirmationOptions.icon,
|
|
3567
|
+
acceptLabel: options.acceptLabel || this.confirmationOptions.acceptLabel,
|
|
3568
|
+
rejectLabel: options.rejectLabel || this.confirmationOptions.rejectLabel,
|
|
3569
|
+
acceptIcon: options.acceptIcon || this.confirmationOptions.acceptIcon,
|
|
3570
|
+
rejectIcon: options.rejectIcon || this.confirmationOptions.rejectIcon,
|
|
3571
|
+
accept: acceptCallback,
|
|
3572
|
+
reject: rejectCallback
|
|
3573
|
+
};
|
|
3574
|
+
this.confirmationService.confirm(confirmation);
|
|
3575
|
+
}
|
|
3576
|
+
/**
|
|
3577
|
+
* Static method to show a confirmation dialog (for components that don't want to inject this component)
|
|
3578
|
+
* @param confirmationService - The ConfirmationService instance
|
|
3579
|
+
* @param options - Configuration options for the confirmation dialog
|
|
3580
|
+
* @param acceptCallback - Function to execute when user accepts
|
|
3581
|
+
* @param rejectCallback - Function to execute when user rejects
|
|
3582
|
+
*/
|
|
3583
|
+
static confirm(confirmationService, options, acceptCallback, rejectCallback) {
|
|
3584
|
+
const defaultOptions = {
|
|
3585
|
+
message: 'Are you sure that you want to proceed?',
|
|
3586
|
+
header: 'Confirmation',
|
|
3587
|
+
icon: 'pi pi-exclamation-triangle',
|
|
3588
|
+
acceptLabel: 'Yes',
|
|
3589
|
+
rejectLabel: 'No',
|
|
3590
|
+
acceptIcon: 'pi pi-check',
|
|
3591
|
+
rejectIcon: 'pi pi-times',
|
|
3592
|
+
acceptButtonClass: 'btn-success',
|
|
3593
|
+
rejectButtonClass: 'btn-secondary'
|
|
3594
|
+
};
|
|
3595
|
+
const confirmation = {
|
|
3596
|
+
message: options.message || defaultOptions.message,
|
|
3597
|
+
header: options.header || defaultOptions.header,
|
|
3598
|
+
icon: options.icon || defaultOptions.icon,
|
|
3599
|
+
acceptLabel: options.acceptLabel || defaultOptions.acceptLabel,
|
|
3600
|
+
rejectLabel: options.rejectLabel || defaultOptions.rejectLabel,
|
|
3601
|
+
acceptIcon: options.acceptIcon || defaultOptions.acceptIcon,
|
|
3602
|
+
rejectIcon: options.rejectIcon || defaultOptions.rejectIcon,
|
|
3603
|
+
accept: acceptCallback,
|
|
3604
|
+
reject: rejectCallback
|
|
3605
|
+
};
|
|
3606
|
+
confirmationService.confirm(confirmation);
|
|
3565
3607
|
}
|
|
3566
3608
|
/**
|
|
3567
|
-
*
|
|
3609
|
+
* Static method to show a delete confirmation dialog
|
|
3610
|
+
* @param confirmationService - The ConfirmationService instance
|
|
3568
3611
|
* @param itemName - Name of the item to be deleted
|
|
3569
3612
|
* @param acceptCallback - Function to execute when user accepts deletion
|
|
3570
3613
|
* @param rejectCallback - Function to execute when user rejects deletion
|
|
3571
3614
|
*/
|
|
3572
|
-
confirmDelete(itemName, acceptCallback, rejectCallback) {
|
|
3573
|
-
|
|
3615
|
+
static confirmDelete(confirmationService, itemName, acceptCallback, rejectCallback) {
|
|
3616
|
+
ConfirmationDialogComponent.confirm(confirmationService, {
|
|
3574
3617
|
message: `Are you sure you want to delete "${itemName}"?`,
|
|
3575
3618
|
header: 'Delete Confirmation',
|
|
3576
3619
|
acceptLabel: 'Delete',
|
|
@@ -3578,31 +3621,26 @@ class ConfirmationDialogComponent {
|
|
|
3578
3621
|
acceptButtonClass: 'btn-danger'
|
|
3579
3622
|
}, acceptCallback, rejectCallback);
|
|
3580
3623
|
}
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
this.acceptCallback();
|
|
3585
|
-
}
|
|
3586
|
-
}
|
|
3587
|
-
onReject() {
|
|
3588
|
-
this.isVisible = false;
|
|
3589
|
-
if (this.rejectCallback) {
|
|
3590
|
-
this.rejectCallback();
|
|
3591
|
-
}
|
|
3592
|
-
}
|
|
3593
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmationDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3594
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ConfirmationDialogComponent, isStandalone: false, selector: "app-confirmation-dialog", inputs: { confirmationOptions: "confirmationOptions" }, ngImport: i0, template: "<div *ngIf=\"isVisible\" class=\"custom-confirmation-overlay\">\r\n <div class=\"custom-confirmation-dialog\">\r\n <div class=\"dialog-header\">\r\n <i *ngIf=\"currentOptions.icon\" [class]=\"currentOptions.icon\"></i>\r\n <h3>{{ currentOptions.header }}</h3>\r\n </div>\r\n <div class=\"dialog-content\">\r\n <p>{{ currentOptions.message }}</p>\r\n </div>\r\n <div class=\"dialog-actions\">\r\n <button \r\n type=\"button\" \r\n pButton\r\n class=\"btn btn-secondary\"\r\n (click)=\"onReject()\">\r\n <i *ngIf=\"currentOptions.rejectIcon\" [class]=\"currentOptions.rejectIcon\"></i>\r\n {{ currentOptions.rejectLabel }}\r\n </button>\r\n <button \r\n type=\"button\" \r\n pButton\r\n [class]=\"'btn ' + currentOptions.acceptButtonClass\"\r\n (click)=\"onAccept()\">\r\n <i *ngIf=\"currentOptions.acceptIcon\" [class]=\"currentOptions.acceptIcon\"></i>\r\n {{ currentOptions.acceptLabel }}\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".custom-confirmation-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000080;display:flex;align-items:center;justify-content:center;z-index:10001}.custom-confirmation-dialog{background:#fff;border-radius:8px;padding:1.5rem;max-width:400px;width:90%;box-shadow:0 4px 20px #00000026}.dialog-header{display:flex;align-items:center;gap:.5rem;margin-bottom:1rem;padding-bottom:1rem;border-bottom:1px solid #e9ecef}.dialog-header h3{margin:0;font-size:1.25rem;font-weight:600}.dialog-content{margin-bottom:1.5rem}.dialog-content p{margin:0;color:#495057;line-height:1.5}.dialog-actions{display:flex;gap:.75rem;justify-content:flex-end}.btn{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.875rem;font-weight:500;display:flex;align-items:center;gap:.5rem;transition:all .2s ease}.btn:hover{transform:translateY(-1px);box-shadow:0 2px 8px #00000026}.btn-secondary{background-color:#6c757d;color:#fff}.btn-secondary:hover{background-color:#5a6268}.btn-success{background-color:#28a745;color:#fff}.btn-success:hover{background-color:#218838}.btn-danger{background-color:#dc3545;color:#fff}.btn-danger:hover{background-color:#c82333}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }] });
|
|
3624
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmationDialogComponent, deps: [{ token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3625
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ConfirmationDialogComponent, isStandalone: false, selector: "app-confirmation-dialog", inputs: { confirmationOptions: "confirmationOptions" }, ngImport: i0, template: "<!-- This component no longer renders a p-confirmDialog element -->\n<!-- The p-confirmDialog should be placed only once in the main app component -->\n<!-- This component now only provides methods to trigger confirmations via ConfirmationService -->\n", styles: [".btn-danger{background-color:#ef4444;color:#fff;border-color:#e53e3e;max-width:100px}.btn-secondary{background-color:#f3f4f6;color:#000;max-width:100px}\n"] });
|
|
3626
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmationDialogComponent, providedIn: 'root' });
|
|
3595
3627
|
}
|
|
3596
3628
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmationDialogComponent, decorators: [{
|
|
3629
|
+
type: Injectable,
|
|
3630
|
+
args: [{
|
|
3631
|
+
providedIn: 'root'
|
|
3632
|
+
}]
|
|
3633
|
+
}, {
|
|
3597
3634
|
type: Component,
|
|
3598
|
-
args: [{ selector: 'app-confirmation-dialog', standalone: false, template: "
|
|
3599
|
-
}], propDecorators: { confirmationOptions: [{
|
|
3635
|
+
args: [{ selector: 'app-confirmation-dialog', standalone: false, template: "<!-- This component no longer renders a p-confirmDialog element -->\n<!-- The p-confirmDialog should be placed only once in the main app component -->\n<!-- This component now only provides methods to trigger confirmations via ConfirmationService -->\n", styles: [".btn-danger{background-color:#ef4444;color:#fff;border-color:#e53e3e;max-width:100px}.btn-secondary{background-color:#f3f4f6;color:#000;max-width:100px}\n"] }]
|
|
3636
|
+
}], ctorParameters: () => [{ type: i3.ConfirmationService }], propDecorators: { confirmationOptions: [{
|
|
3600
3637
|
type: Input
|
|
3601
3638
|
}] } });
|
|
3602
3639
|
|
|
3603
3640
|
class SidebarComponent {
|
|
3604
|
-
|
|
3605
|
-
//
|
|
3641
|
+
confirmationService;
|
|
3642
|
+
// Flag to prevent multiple confirmations
|
|
3643
|
+
isShowingConfirmation = false;
|
|
3606
3644
|
set visible(value) {
|
|
3607
3645
|
this._visible = value;
|
|
3608
3646
|
}
|
|
@@ -3610,17 +3648,12 @@ class SidebarComponent {
|
|
|
3610
3648
|
return this._visible;
|
|
3611
3649
|
}
|
|
3612
3650
|
_visible = false;
|
|
3613
|
-
// Flag to prevent double event emission
|
|
3614
|
-
isProgrammaticallyClosing = false;
|
|
3615
3651
|
position = 'right';
|
|
3616
3652
|
width = SHARED.WIDTH;
|
|
3617
3653
|
title = SHARED.EMPTY;
|
|
3618
3654
|
showCloseButton = true;
|
|
3619
3655
|
modal = true;
|
|
3620
3656
|
dismissible = true;
|
|
3621
|
-
closeOnEscape = true;
|
|
3622
|
-
baseZIndex = 10000;
|
|
3623
|
-
autoZIndex = false;
|
|
3624
3657
|
styleClass = SHARED.EMPTY;
|
|
3625
3658
|
appendTo = 'body';
|
|
3626
3659
|
blockScroll = true;
|
|
@@ -3635,7 +3668,7 @@ class SidebarComponent {
|
|
|
3635
3668
|
onShow = new EventEmitter();
|
|
3636
3669
|
onHide = new EventEmitter();
|
|
3637
3670
|
onSave = new EventEmitter();
|
|
3638
|
-
|
|
3671
|
+
onClose = new EventEmitter();
|
|
3639
3672
|
showSuccessMessage = false;
|
|
3640
3673
|
showErrorMessage = false;
|
|
3641
3674
|
destroy$ = new Subject();
|
|
@@ -3651,23 +3684,32 @@ class SidebarComponent {
|
|
|
3651
3684
|
acceptButtonClass: SHARED.ACCEPT_BUTTON_STYLE_CLASS,
|
|
3652
3685
|
rejectButtonClass: SHARED.REJECT_BUTTON_STYLE_CLASS
|
|
3653
3686
|
};
|
|
3654
|
-
constructor() {
|
|
3687
|
+
constructor(confirmationService) {
|
|
3688
|
+
this.confirmationService = confirmationService;
|
|
3655
3689
|
}
|
|
3656
3690
|
/**
|
|
3657
3691
|
* Handles the onHide event from PrimeNG sidebar
|
|
3692
|
+
* Only emits when actually closing, not when showing confirmation
|
|
3658
3693
|
*/
|
|
3659
3694
|
onSidebarHide() {
|
|
3660
|
-
if
|
|
3695
|
+
// Only emit onHide if we're not showing confirmation
|
|
3696
|
+
if (!this.isShowingConfirmation) {
|
|
3661
3697
|
this.onHide.emit();
|
|
3662
3698
|
}
|
|
3663
3699
|
}
|
|
3664
3700
|
/**
|
|
3665
3701
|
* Handles the visibleChange event from PrimeNG sidebar
|
|
3702
|
+
* Intercepts automatic closing to show confirmation if needed
|
|
3666
3703
|
*/
|
|
3667
3704
|
onVisibleChange(value) {
|
|
3668
|
-
|
|
3669
|
-
|
|
3705
|
+
// If PrimeNG is trying to close the sidebar and we have unsaved changes
|
|
3706
|
+
if (!value && this.hasUnsavedChanges && !this.isShowingConfirmation) {
|
|
3707
|
+
// Prevent the close and show confirmation
|
|
3708
|
+
this._visible = true;
|
|
3709
|
+
this.showUnsavedChangesConfirmation();
|
|
3710
|
+
return;
|
|
3670
3711
|
}
|
|
3712
|
+
this.visibleChange.emit(value);
|
|
3671
3713
|
}
|
|
3672
3714
|
/**
|
|
3673
3715
|
* Opens the sidebar
|
|
@@ -3682,94 +3724,36 @@ class SidebarComponent {
|
|
|
3682
3724
|
* Closes the sidebar
|
|
3683
3725
|
*/
|
|
3684
3726
|
close() {
|
|
3685
|
-
this.isProgrammaticallyClosing = true;
|
|
3686
3727
|
this._visible = false;
|
|
3687
3728
|
this.clearMessages();
|
|
3688
3729
|
this.visibleChange.emit(this._visible);
|
|
3689
3730
|
this.onHide.emit();
|
|
3690
|
-
this.isProgrammaticallyClosing = false;
|
|
3691
3731
|
}
|
|
3692
3732
|
/**
|
|
3693
|
-
*
|
|
3733
|
+
* Handles escape key press
|
|
3734
|
+
* Shows confirmation if there are unsaved changes
|
|
3694
3735
|
*/
|
|
3695
|
-
|
|
3696
|
-
this.
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
this.visibleChange.emit(this._visible);
|
|
3700
|
-
this.onDiscardChanges.emit();
|
|
3701
|
-
this.onHide.emit();
|
|
3702
|
-
this.isProgrammaticallyClosing = false;
|
|
3703
|
-
}
|
|
3704
|
-
/**
|
|
3705
|
-
* Toggles the sidebar visibility
|
|
3706
|
-
*/
|
|
3707
|
-
toggle() {
|
|
3708
|
-
this._visible = !this._visible;
|
|
3709
|
-
if (this._visible) {
|
|
3710
|
-
this.clearMessages();
|
|
3711
|
-
this.onShow.emit();
|
|
3712
|
-
}
|
|
3713
|
-
else {
|
|
3714
|
-
this.clearMessages();
|
|
3715
|
-
this.onHide.emit();
|
|
3716
|
-
}
|
|
3717
|
-
this.visibleChange.emit(this._visible);
|
|
3718
|
-
}
|
|
3719
|
-
/**
|
|
3720
|
-
* Handles the close button click with unsaved changes check
|
|
3721
|
-
*/
|
|
3722
|
-
onCloseClick() {
|
|
3723
|
-
if (this.hasUnsavedChanges) {
|
|
3724
|
-
this.showUnsavedChangesConfirmation();
|
|
3725
|
-
}
|
|
3726
|
-
else {
|
|
3727
|
-
this.close();
|
|
3728
|
-
}
|
|
3729
|
-
}
|
|
3730
|
-
/**
|
|
3731
|
-
* Handles the mask click (when dismissible is true) with unsaved changes check
|
|
3732
|
-
*/
|
|
3733
|
-
onMaskClick() {
|
|
3734
|
-
if (this.dismissible) {
|
|
3735
|
-
if (this.hasUnsavedChanges) {
|
|
3736
|
-
this.showUnsavedChangesConfirmation();
|
|
3737
|
-
}
|
|
3738
|
-
else {
|
|
3739
|
-
this.close();
|
|
3740
|
-
}
|
|
3741
|
-
}
|
|
3742
|
-
}
|
|
3743
|
-
/**
|
|
3744
|
-
* Handles the escape key press with unsaved changes check
|
|
3745
|
-
*/
|
|
3746
|
-
onEscapeKey(event) {
|
|
3747
|
-
if (this._visible && this.closeOnEscape) {
|
|
3748
|
-
if (this.hasUnsavedChanges) {
|
|
3749
|
-
event.preventDefault();
|
|
3750
|
-
this.showUnsavedChangesConfirmation();
|
|
3751
|
-
}
|
|
3752
|
-
else {
|
|
3753
|
-
this.close();
|
|
3754
|
-
}
|
|
3736
|
+
handleEscapeKey(event) {
|
|
3737
|
+
if (this.visible) {
|
|
3738
|
+
event.preventDefault();
|
|
3739
|
+
this.handleClose();
|
|
3755
3740
|
}
|
|
3756
3741
|
}
|
|
3757
3742
|
/**
|
|
3758
|
-
* Handles backdrop click
|
|
3743
|
+
* Handles backdrop click events
|
|
3744
|
+
* Prevents default PrimeNG behavior and shows confirmation if needed
|
|
3759
3745
|
*/
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
else {
|
|
3765
|
-
this.close();
|
|
3766
|
-
}
|
|
3746
|
+
handleBackdropClick(event) {
|
|
3747
|
+
event.preventDefault();
|
|
3748
|
+
event.stopPropagation();
|
|
3749
|
+
this.handleClose();
|
|
3767
3750
|
}
|
|
3768
3751
|
/**
|
|
3769
|
-
* Handles
|
|
3752
|
+
* Handles all closing scenarios (backdrop click, escape key, close button, etc.)
|
|
3753
|
+
* This is the single entry point for all closing logic
|
|
3770
3754
|
*/
|
|
3771
|
-
|
|
3772
|
-
if (this.hasUnsavedChanges) {
|
|
3755
|
+
handleClose() {
|
|
3756
|
+
if (this.hasUnsavedChanges && !this.isShowingConfirmation) {
|
|
3773
3757
|
this.showUnsavedChangesConfirmation();
|
|
3774
3758
|
}
|
|
3775
3759
|
else {
|
|
@@ -3780,9 +3764,17 @@ class SidebarComponent {
|
|
|
3780
3764
|
* Shows confirmation dialog for unsaved changes
|
|
3781
3765
|
*/
|
|
3782
3766
|
showUnsavedChangesConfirmation() {
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
}
|
|
3767
|
+
if (this.isShowingConfirmation) {
|
|
3768
|
+
return; // Prevent multiple confirmations
|
|
3769
|
+
}
|
|
3770
|
+
this.isShowingConfirmation = true;
|
|
3771
|
+
ConfirmationDialogComponent.confirm(this.confirmationService, this.unsavedChangesConfirmationOptions, () => {
|
|
3772
|
+
this.isShowingConfirmation = false;
|
|
3773
|
+
this.close();
|
|
3774
|
+
this.onClose.emit(); // Emit close event when user confirms
|
|
3775
|
+
}, () => {
|
|
3776
|
+
this.isShowingConfirmation = false;
|
|
3777
|
+
});
|
|
3786
3778
|
}
|
|
3787
3779
|
/**
|
|
3788
3780
|
* Shows success message and closes sidebar after delay
|
|
@@ -3824,16 +3816,13 @@ class SidebarComponent {
|
|
|
3824
3816
|
this.destroy$.next();
|
|
3825
3817
|
this.destroy$.complete();
|
|
3826
3818
|
}
|
|
3827
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3828
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SidebarComponent, isStandalone: false, selector: "lib-sidebar", inputs: { visible: "visible", position: "position", width: "width", title: "title", showCloseButton: "showCloseButton", modal: "modal", dismissible: "dismissible",
|
|
3819
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SidebarComponent, deps: [{ token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3820
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SidebarComponent, isStandalone: false, selector: "lib-sidebar", inputs: { visible: "visible", position: "position", width: "width", title: "title", showCloseButton: "showCloseButton", modal: "modal", dismissible: "dismissible", styleClass: "styleClass", appendTo: "appendTo", blockScroll: "blockScroll", closeIcon: "closeIcon", showSaveButton: "showSaveButton", saveButtonText: "saveButtonText", saveButtonDisabled: "saveButtonDisabled", successMessage: "successMessage", errorMessage: "errorMessage", hasUnsavedChanges: "hasUnsavedChanges" }, outputs: { visibleChange: "visibleChange", onShow: "onShow", onHide: "onHide", onSave: "onSave", onClose: "onClose" }, host: { listeners: { "document:keydown.escape": "handleEscapeKey($event)" } }, ngImport: i0, template: "<!-- PrimeNG Sidebar with proper backdrop handling -->\n<p-sidebar \n [(visible)]=\"visible\"\n [position]=\"position\"\n [style]=\"{width: width}\"\n [modal]=\"true\"\n [dismissible]=\"true\"\n [showCloseIcon]=\"false\"\n [styleClass]=\"styleClass\"\n [appendTo]=\"'body'\"\n [blockScroll]=\"blockScroll\"\n (visibleChange)=\"onVisibleChange($event)\"\n (onShow)=\"onShow.emit()\"\n (onHide)=\"onSidebarHide()\"\n (onMaskClick)=\"handleBackdropClick($event)\"\n>\n <ng-template pTemplate=\"header\" *ngIf=\"title || showCloseButton || showSaveButton\">\n <div class=\"sidebar-header\">\n <h3 *ngIf=\"title\" class=\"sidebar-title\">{{ title }}</h3>\n <div class=\"header-content\">\n <ng-content select=\"[header]\"></ng-content>\n \n <p-messages \n *ngIf=\"showSuccessMessage\"\n severity=\"success\"\n [closable]=\"false\"\n [style]=\"{'margin-bottom': '0.5rem'}\"\n class=\"ml-3\"\n >\n <ng-template pTemplate=\"message\">\n <span>{{ successMessage }}</span>\n </ng-template>\n </p-messages>\n <p-messages \n *ngIf=\"showErrorMessage\"\n severity=\"error\"\n [closable]=\"false\"\n [style]=\"{'margin-bottom': '0.5rem'}\"\n class=\"ml-3\"\n >\n <ng-template pTemplate=\"message\">\n <span>{{ errorMessage }}</span>\n </ng-template>\n </p-messages>\n\n <div class=\"header-actions mr-3\">\n <button \n *ngIf=\"showSaveButton\"\n pButton \n type=\"button\" \n [label]=\"saveButtonText\"\n [disabled]=\"saveButtonDisabled\"\n class=\"p-button-primary\"\n (click)=\"onSave.emit()\"\n ></button>\n\n <button \n *ngIf=\"showCloseButton\"\n pButton \n type=\"button\" \n icon=\"pi pi-times\"\n class=\"p-button-text p-button-rounded\"\n (click)=\"handleClose()\"\n ></button>\n \n </div>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"content\">\n <div class=\"sidebar-content\">\n <ng-content></ng-content>\n </div>\n </ng-template>\n</p-sidebar>\n", styles: [":host{display:block}.sidebar-header{display:flex;justify-content:space-between;align-items:center;padding:0;width:100%}.sidebar-title{margin:0;font-size:1.25rem;font-weight:600;color:#212529;flex:1}.header-content{display:flex;align-items:center;gap:.5rem;justify-content:space-between;width:100%}.header-actions{display:flex;align-items:center;gap:.5rem;margin-left:auto;margin-right:0}.close-button{background:none;border:none;color:#6c757d;cursor:pointer;padding:.5rem;border-radius:.375rem;transition:all .2s ease;display:flex;align-items:center;justify-content:center;min-width:2rem;min-height:2rem;margin-right:.5rem}.close-button:hover{background-color:#e9ecef;color:#495057}.close-button:focus{outline:none;box-shadow:0 0 0 3px #0f8bfd4d}.close-button i{font-size:1rem}.sidebar-content{height:100%;overflow-y:auto;padding:0}.header-actions .p-button-text.p-button-rounded{width:2rem;height:2rem;border-radius:50%}.header-actions .p-button-text.p-button-rounded:hover{background-color:#0000001a}::ng-deep .p-sidebar .p-sidebar-header{border-bottom:1px solid #e9ecef;margin-bottom:1rem;background-color:#f8f9fa}::ng-deep .p-sidebar .p-sidebar-content{padding:0 1.5rem 1.5rem;height:calc(100% - 80px);overflow-y:auto}::ng-deep .p-sidebar.p-sidebar-right .p-sidebar-content{padding-left:1.5rem;padding-right:1.5rem}::ng-deep .p-sidebar.p-sidebar-left .p-sidebar-content{padding-left:1.5rem;padding-right:1.5rem}@media (max-width: 768px){::ng-deep .p-sidebar{width:100%!important;max-width:100%!important}::ng-deep .p-sidebar .p-sidebar-header{padding:1rem 1rem 0}::ng-deep .p-sidebar .p-sidebar-content{padding:0 1rem 1rem}}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i9.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "component", type: i5.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }] });
|
|
3829
3821
|
}
|
|
3830
3822
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SidebarComponent, decorators: [{
|
|
3831
3823
|
type: Component,
|
|
3832
|
-
args: [{ selector: 'lib-sidebar', standalone: false, template: "<!--
|
|
3833
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
3834
|
-
type: ViewChild,
|
|
3835
|
-
args: ['confirmationDialog']
|
|
3836
|
-
}], visible: [{
|
|
3824
|
+
args: [{ selector: 'lib-sidebar', standalone: false, template: "<!-- PrimeNG Sidebar with proper backdrop handling -->\n<p-sidebar \n [(visible)]=\"visible\"\n [position]=\"position\"\n [style]=\"{width: width}\"\n [modal]=\"true\"\n [dismissible]=\"true\"\n [showCloseIcon]=\"false\"\n [styleClass]=\"styleClass\"\n [appendTo]=\"'body'\"\n [blockScroll]=\"blockScroll\"\n (visibleChange)=\"onVisibleChange($event)\"\n (onShow)=\"onShow.emit()\"\n (onHide)=\"onSidebarHide()\"\n (onMaskClick)=\"handleBackdropClick($event)\"\n>\n <ng-template pTemplate=\"header\" *ngIf=\"title || showCloseButton || showSaveButton\">\n <div class=\"sidebar-header\">\n <h3 *ngIf=\"title\" class=\"sidebar-title\">{{ title }}</h3>\n <div class=\"header-content\">\n <ng-content select=\"[header]\"></ng-content>\n \n <p-messages \n *ngIf=\"showSuccessMessage\"\n severity=\"success\"\n [closable]=\"false\"\n [style]=\"{'margin-bottom': '0.5rem'}\"\n class=\"ml-3\"\n >\n <ng-template pTemplate=\"message\">\n <span>{{ successMessage }}</span>\n </ng-template>\n </p-messages>\n <p-messages \n *ngIf=\"showErrorMessage\"\n severity=\"error\"\n [closable]=\"false\"\n [style]=\"{'margin-bottom': '0.5rem'}\"\n class=\"ml-3\"\n >\n <ng-template pTemplate=\"message\">\n <span>{{ errorMessage }}</span>\n </ng-template>\n </p-messages>\n\n <div class=\"header-actions mr-3\">\n <button \n *ngIf=\"showSaveButton\"\n pButton \n type=\"button\" \n [label]=\"saveButtonText\"\n [disabled]=\"saveButtonDisabled\"\n class=\"p-button-primary\"\n (click)=\"onSave.emit()\"\n ></button>\n\n <button \n *ngIf=\"showCloseButton\"\n pButton \n type=\"button\" \n icon=\"pi pi-times\"\n class=\"p-button-text p-button-rounded\"\n (click)=\"handleClose()\"\n ></button>\n \n </div>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"content\">\n <div class=\"sidebar-content\">\n <ng-content></ng-content>\n </div>\n </ng-template>\n</p-sidebar>\n", styles: [":host{display:block}.sidebar-header{display:flex;justify-content:space-between;align-items:center;padding:0;width:100%}.sidebar-title{margin:0;font-size:1.25rem;font-weight:600;color:#212529;flex:1}.header-content{display:flex;align-items:center;gap:.5rem;justify-content:space-between;width:100%}.header-actions{display:flex;align-items:center;gap:.5rem;margin-left:auto;margin-right:0}.close-button{background:none;border:none;color:#6c757d;cursor:pointer;padding:.5rem;border-radius:.375rem;transition:all .2s ease;display:flex;align-items:center;justify-content:center;min-width:2rem;min-height:2rem;margin-right:.5rem}.close-button:hover{background-color:#e9ecef;color:#495057}.close-button:focus{outline:none;box-shadow:0 0 0 3px #0f8bfd4d}.close-button i{font-size:1rem}.sidebar-content{height:100%;overflow-y:auto;padding:0}.header-actions .p-button-text.p-button-rounded{width:2rem;height:2rem;border-radius:50%}.header-actions .p-button-text.p-button-rounded:hover{background-color:#0000001a}::ng-deep .p-sidebar .p-sidebar-header{border-bottom:1px solid #e9ecef;margin-bottom:1rem;background-color:#f8f9fa}::ng-deep .p-sidebar .p-sidebar-content{padding:0 1.5rem 1.5rem;height:calc(100% - 80px);overflow-y:auto}::ng-deep .p-sidebar.p-sidebar-right .p-sidebar-content{padding-left:1.5rem;padding-right:1.5rem}::ng-deep .p-sidebar.p-sidebar-left .p-sidebar-content{padding-left:1.5rem;padding-right:1.5rem}@media (max-width: 768px){::ng-deep .p-sidebar{width:100%!important;max-width:100%!important}::ng-deep .p-sidebar .p-sidebar-header{padding:1rem 1rem 0}::ng-deep .p-sidebar .p-sidebar-content{padding:0 1rem 1rem}}\n"] }]
|
|
3825
|
+
}], ctorParameters: () => [{ type: i3.ConfirmationService }], propDecorators: { visible: [{
|
|
3837
3826
|
type: Input
|
|
3838
3827
|
}], position: [{
|
|
3839
3828
|
type: Input
|
|
@@ -3847,12 +3836,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3847
3836
|
type: Input
|
|
3848
3837
|
}], dismissible: [{
|
|
3849
3838
|
type: Input
|
|
3850
|
-
}], closeOnEscape: [{
|
|
3851
|
-
type: Input
|
|
3852
|
-
}], baseZIndex: [{
|
|
3853
|
-
type: Input
|
|
3854
|
-
}], autoZIndex: [{
|
|
3855
|
-
type: Input
|
|
3856
3839
|
}], styleClass: [{
|
|
3857
3840
|
type: Input
|
|
3858
3841
|
}], appendTo: [{
|
|
@@ -3881,9 +3864,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3881
3864
|
type: Output
|
|
3882
3865
|
}], onSave: [{
|
|
3883
3866
|
type: Output
|
|
3884
|
-
}],
|
|
3867
|
+
}], onClose: [{
|
|
3885
3868
|
type: Output
|
|
3886
|
-
}],
|
|
3869
|
+
}], handleEscapeKey: [{
|
|
3887
3870
|
type: HostListener,
|
|
3888
3871
|
args: ['document:keydown.escape', ['$event']]
|
|
3889
3872
|
}] } });
|
|
@@ -4477,7 +4460,7 @@ class FolderContainerComponent {
|
|
|
4477
4460
|
}
|
|
4478
4461
|
}
|
|
4479
4462
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderContainerComponent, deps: [{ token: DocumentQuery }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4480
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList", folderList: "folderList", contextId: "contextId", userList: "userList", statusData: "statusData", categories: "categories" }, viewQueries: [{ propertyName: "documentUploadComponent", first: true, predicate: DocumentUploadComponent, descendants: true }, { propertyName: "sidebarComponent", first: true, predicate: SidebarComponent, descendants: true }], ngImport: i0, template: "\
|
|
4463
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList", folderList: "folderList", contextId: "contextId", userList: "userList", statusData: "statusData", categories: "categories" }, viewQueries: [{ propertyName: "documentUploadComponent", first: true, predicate: DocumentUploadComponent, descendants: true }, { propertyName: "sidebarComponent", first: true, predicate: SidebarComponent, descendants: true }], ngImport: i0, template: "\n<document-search [contextId]=\"contextId\" (onActionClick)=\"openDocumentUploadSidebar()\"></document-search>\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\n</div>\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>\n\n<!-- Document Upload Sidebar -->\n<lib-sidebar\n [(visible)]=\"isDocumentUploadSidebarOpen\"\n position=\"right\"\n width=\"600px\"\n title=\"Upload Documents\"\n [showCloseButton]=\"true\"\n [showSaveButton]=\"true\"\n [saveButtonText]=\"'Save'\"\n [saveButtonDisabled]=\"isSaveButtonDisabled\"\n [successMessage]=\"'Document Saved Successfully'\"\n [hasUnsavedChanges]=\"hasUnsavedChanges\"\n (onHide)=\"onDocumentUploadSidebarHide()\"\n (onSave)=\"onDocumentUploadSave()\"\n (onClose)=\"onDocumentUploadSidebarCloseWithUnsavedChanges()\"\n>\n <lib-document-upload \n [contextId]=\"contextId\" \n (onFormValidationChange)=\"onFormValidationChange()\" \n (onUploadSuccess)=\"onDocumentUploadSuccess()\"\n (onUploadError)=\"onDocumentUploadError($event)\"\n ></lib-document-upload>\n</lib-sidebar>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"], outputs: ["onFormValidationChange", "onUploadSuccess"] }, { kind: "component", type: UserListComponent, selector: "lib-user-list", inputs: ["userList", "categories"], outputs: ["userSelected"] }, { kind: "component", type: DocumentStatusComponent, selector: "lib-document-status", inputs: ["contextId", "statusData"] }, { kind: "component", type: DocumentSearchComponent, selector: "document-search", inputs: ["contextId"], outputs: ["onActionClick"] }, { kind: "component", type: SidebarComponent, selector: "lib-sidebar", inputs: ["visible", "position", "width", "title", "showCloseButton", "modal", "dismissible", "styleClass", "appendTo", "blockScroll", "closeIcon", "showSaveButton", "saveButtonText", "saveButtonDisabled", "successMessage", "errorMessage", "hasUnsavedChanges"], outputs: ["visibleChange", "onShow", "onHide", "onSave", "onClose"] }], animations: [
|
|
4481
4464
|
trigger('slideInOut', [
|
|
4482
4465
|
state('visible', style({
|
|
4483
4466
|
height: '*',
|
|
@@ -4531,7 +4514,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4531
4514
|
animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)')
|
|
4532
4515
|
])
|
|
4533
4516
|
])
|
|
4534
|
-
], template: "\
|
|
4517
|
+
], template: "\n<document-search [contextId]=\"contextId\" (onActionClick)=\"openDocumentUploadSidebar()\"></document-search>\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\n</div>\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>\n\n<!-- Document Upload Sidebar -->\n<lib-sidebar\n [(visible)]=\"isDocumentUploadSidebarOpen\"\n position=\"right\"\n width=\"600px\"\n title=\"Upload Documents\"\n [showCloseButton]=\"true\"\n [showSaveButton]=\"true\"\n [saveButtonText]=\"'Save'\"\n [saveButtonDisabled]=\"isSaveButtonDisabled\"\n [successMessage]=\"'Document Saved Successfully'\"\n [hasUnsavedChanges]=\"hasUnsavedChanges\"\n (onHide)=\"onDocumentUploadSidebarHide()\"\n (onSave)=\"onDocumentUploadSave()\"\n (onClose)=\"onDocumentUploadSidebarCloseWithUnsavedChanges()\"\n>\n <lib-document-upload \n [contextId]=\"contextId\" \n (onFormValidationChange)=\"onFormValidationChange()\" \n (onUploadSuccess)=\"onDocumentUploadSuccess()\"\n (onUploadError)=\"onDocumentUploadError($event)\"\n ></lib-document-upload>\n</lib-sidebar>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"] }]
|
|
4535
4518
|
}], ctorParameters: () => [{ type: DocumentQuery }, { type: DocumentHelperService }], propDecorators: { documentList: [{
|
|
4536
4519
|
type: Input
|
|
4537
4520
|
}], folderList: [{
|
|
@@ -5624,80 +5607,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5624
5607
|
}]
|
|
5625
5608
|
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
5626
5609
|
|
|
5627
|
-
/**
|
|
5628
|
-
* Directive to conditionally show or hide elements based on user permissions.
|
|
5629
|
-
* @class HasPermissionDirective
|
|
5630
|
-
* @typedef {HasPermissionDirective}
|
|
5631
|
-
*/
|
|
5632
|
-
class HasPermissionDirective {
|
|
5633
|
-
el;
|
|
5634
|
-
renderer;
|
|
5635
|
-
sessionService;
|
|
5636
|
-
/**
|
|
5637
|
-
* The required permission(s) to display the element.
|
|
5638
|
-
* Accepts a single string or an array of strings.
|
|
5639
|
-
* @type {string | string[]}
|
|
5640
|
-
*/
|
|
5641
|
-
permission;
|
|
5642
|
-
/**
|
|
5643
|
-
* Creates an instance of HasPermissionDirective.
|
|
5644
|
-
* @param {ElementRef} el - Reference to the host element.
|
|
5645
|
-
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
5646
|
-
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
5647
|
-
*/
|
|
5648
|
-
constructor(el, renderer, sessionService) {
|
|
5649
|
-
this.el = el;
|
|
5650
|
-
this.renderer = renderer;
|
|
5651
|
-
this.sessionService = sessionService;
|
|
5652
|
-
}
|
|
5653
|
-
/**
|
|
5654
|
-
* Lifecycle hook that is called when input properties change.
|
|
5655
|
-
* @param {SimpleChanges} changes - The changes in input properties.
|
|
5656
|
-
*/
|
|
5657
|
-
ngOnChanges(changes) {
|
|
5658
|
-
if (changes['permission']) {
|
|
5659
|
-
this.checkPermission();
|
|
5660
|
-
}
|
|
5661
|
-
}
|
|
5662
|
-
/**
|
|
5663
|
-
* Checks if the user has the required permission(s).
|
|
5664
|
-
* Hides the element if the permission is not found.
|
|
5665
|
-
*/
|
|
5666
|
-
checkPermission() {
|
|
5667
|
-
// If no permission is required (empty string, null, or undefined), show the element
|
|
5668
|
-
if (!this.permission || this.permission === '' || (Array.isArray(this.permission) && this.permission.length === 0)) {
|
|
5669
|
-
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
5670
|
-
return;
|
|
5671
|
-
}
|
|
5672
|
-
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
5673
|
-
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
5674
|
-
const requiredPermissions = Array.isArray(this.permission)
|
|
5675
|
-
? this.permission
|
|
5676
|
-
: [this.permission];
|
|
5677
|
-
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
5678
|
-
if (!hasPermission) {
|
|
5679
|
-
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
5680
|
-
}
|
|
5681
|
-
else {
|
|
5682
|
-
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
5683
|
-
}
|
|
5684
|
-
}
|
|
5685
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5686
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
5687
|
-
}
|
|
5688
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
5689
|
-
type: Directive,
|
|
5690
|
-
args: [{
|
|
5691
|
-
selector: '[permission]',
|
|
5692
|
-
standalone: false
|
|
5693
|
-
}]
|
|
5694
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
5695
|
-
type: Input
|
|
5696
|
-
}] } });
|
|
5697
|
-
|
|
5698
5610
|
class DocumentActionsComponent {
|
|
5699
5611
|
documentActionsService;
|
|
5700
5612
|
sessionService;
|
|
5613
|
+
confirmationService;
|
|
5701
5614
|
SHARED = SHARED;
|
|
5702
5615
|
document;
|
|
5703
5616
|
documentId;
|
|
@@ -5723,10 +5636,10 @@ class DocumentActionsComponent {
|
|
|
5723
5636
|
showApproveRejectActions = false;
|
|
5724
5637
|
showDeleteAction = false;
|
|
5725
5638
|
showNoActions = false;
|
|
5726
|
-
|
|
5727
|
-
constructor(documentActionsService, sessionService) {
|
|
5639
|
+
constructor(documentActionsService, sessionService, confirmationService) {
|
|
5728
5640
|
this.documentActionsService = documentActionsService;
|
|
5729
5641
|
this.sessionService = sessionService;
|
|
5642
|
+
this.confirmationService = confirmationService;
|
|
5730
5643
|
}
|
|
5731
5644
|
get rejectNote() {
|
|
5732
5645
|
return this._rejectNote;
|
|
@@ -5786,8 +5699,8 @@ class DocumentActionsComponent {
|
|
|
5786
5699
|
this.showRejectDialog = true;
|
|
5787
5700
|
}
|
|
5788
5701
|
onDeleteClick() {
|
|
5789
|
-
const documentName = this.document?.
|
|
5790
|
-
|
|
5702
|
+
const documentName = this.document?.docName || 'this document';
|
|
5703
|
+
ConfirmationDialogComponent.confirmDelete(this.confirmationService, documentName, () => {
|
|
5791
5704
|
this.actionPerformed.emit(this.documentActionsService.createDeleteAction());
|
|
5792
5705
|
}, () => { });
|
|
5793
5706
|
}
|
|
@@ -5809,13 +5722,13 @@ class DocumentActionsComponent {
|
|
|
5809
5722
|
this.acceptNote = SHARED.EMPTY;
|
|
5810
5723
|
this.rejectNote = SHARED.EMPTY;
|
|
5811
5724
|
}
|
|
5812
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, deps: [{ token: DocumentActionsService }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5813
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentActionsComponent, isStandalone: false, selector: "document-actions", inputs: { document: "document", documentId: "documentId", currentStatus: "currentStatus", isLoading: "isLoading", isUploaded: "isUploaded", statusId: "statusId" }, outputs: { actionPerformed: "actionPerformed" }, viewQueries: [{ propertyName: "confirmationDialog", first: true, predicate: ConfirmationDialogComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"document-actions-container\" *ngIf=\"document?.status !=='Pending' && !document?.isUploaded && document?.status === 'Reviewing'\">\r\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\r\n <div class=\"actions-buttons\">\r\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn reject-btn\" [ngClass]=\"rejectButtonClass\"\r\n (click)=\"onRejectClick()\" [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isRejecting\">\r\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isRejecting\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED :\r\n SHARED.BUTTON_LABEL_REJECT }}</span>\r\n </button>\r\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn accept-btn\" [ngClass]=\"acceptButtonClass\"\r\n (click)=\"onAcceptClick()\" [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isAccepting\">\r\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isAccepting\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT\r\n }}</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n@if(document?.isUploaded){\r\n<div class=\"actions-card\">\r\n <div class=\"actions-buttons\">\r\n <button class=\"action-btn delete-btn\" (click)=\"onDeleteClick()\" [disabled]=\"isLoading\"\r\n [permission]=\"'documents-deleteDocumentByDocumentId'\" pTooltip=\"Delete Document\" tooltipPosition=\"top\">\r\n <i class=\"pi pi-trash\"></i>\r\n </button>\r\n </div>\r\n</div>\r\n}\r\n<app-confirmation-dialog></app-confirmation-dialog>\r\n\r\n<p-dialog [(visible)]=\"showAcceptDialog\" [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\r\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\r\n <textarea id=\"acceptNote\" pInputTextarea [(ngModel)]=\"acceptNote\" [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\r\n rows=\"6\" class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\r\n </button>\r\n <button pButton [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" class=\"p-button-success\" (click)=\"onAcceptConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>\r\n\r\n<p-dialog [(visible)]=\"showRejectDialog\" [header]=\"SHARED.REJECT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\r\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\r\n <textarea id=\"rejectNote\" pInputTextarea [(ngModel)]=\"rejectNote\" [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\r\n rows=\"6\" class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\r\n </button>\r\n <button pButton [label]=\"SHARED.REJECT_BUTTON_LABEL\" class=\"p-button-danger\" [disabled]=\"isRejectNoteEmpty\"\r\n (click)=\"onRejectConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>", styles: [".document-actions-container{margin:0}.actions-card{border-radius:8px;padding:.75rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease;width:92%;margin-left:3%}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card.rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-approved-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card[class*=status-].status-rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card:has(.delete-btn){width:auto;margin-left:0;background-color:#fff;border:1px solid #e2e8f0;padding:.5rem}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn.primary-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn.primary-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-approved-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn[class*=status-].status-rejected-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-pending-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn.primary-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-approved-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-rejected-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn[class*=status-].status-pending-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#f5f5f5;border-color:#e57373;color:#e57373;padding:.5rem;min-width:auto;width:40px;height:40px;border-radius:6px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}.no-actions-message{display:flex;align-items:center;justify-content:center;padding:.5rem;min-height:40px}.no-actions-message .no-actions-text{color:#6b7280;font-size:.875rem;font-style:italic;text-align:center}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i9.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i6.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i9$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }, { kind: "component", type: ConfirmationDialogComponent, selector: "app-confirmation-dialog", inputs: ["confirmationOptions"] }] });
|
|
5725
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, deps: [{ token: DocumentActionsService }, { token: SessionService }, { token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5726
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentActionsComponent, isStandalone: false, selector: "document-actions", inputs: { document: "document", documentId: "documentId", currentStatus: "currentStatus", isLoading: "isLoading", isUploaded: "isUploaded", statusId: "statusId" }, outputs: { actionPerformed: "actionPerformed" }, usesOnChanges: true, ngImport: i0, template: "<!-- <div class=\"document-actions-container\" *ngIf=\"document?.status !=='Pending' && !document?.isUploaded && document?.status === 'Reviewing'\"> -->\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\n <div class=\"actions-buttons\">\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn reject-btn\" [ngClass]=\"rejectButtonClass\"\n (click)=\"onRejectClick()\" [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isRejecting\">\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isRejecting\"></i>\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED :\n SHARED.BUTTON_LABEL_REJECT }}</span>\n </button>\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn accept-btn\" [ngClass]=\"acceptButtonClass\"\n (click)=\"onAcceptClick()\" [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isAccepting\">\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isAccepting\"></i>\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT\n }}</span>\n </button>\n </div>\n </div>\n<!-- </div> -->\n\n<!-- @if(document?.isUploaded){ -->\n<div class=\"actions-card\">\n <div class=\"actions-buttons\">\n <button class=\"action-btn delete-btn\" (click)=\"onDeleteClick()\" [disabled]=\"isLoading\"\n pTooltip=\"Delete Document\" tooltipPosition=\"top\">\n <i class=\"pi pi-trash\"></i>\n </button>\n </div>\n</div>\n<!-- } -->\n\n<p-dialog [(visible)]=\"showAcceptDialog\" [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\n <textarea id=\"acceptNote\" pInputTextarea [(ngModel)]=\"acceptNote\" [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\n rows=\"6\" class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\n </button>\n <button pButton [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" class=\"p-button-success\" (click)=\"onAcceptConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>\n\n<p-dialog [(visible)]=\"showRejectDialog\" [header]=\"SHARED.REJECT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\n <textarea id=\"rejectNote\" pInputTextarea [(ngModel)]=\"rejectNote\" [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\n rows=\"6\" class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\n </button>\n <button pButton [label]=\"SHARED.REJECT_BUTTON_LABEL\" class=\"p-button-danger\" [disabled]=\"isRejectNoteEmpty\"\n (click)=\"onRejectConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>", styles: [".document-actions-container{margin:0}.actions-card{border-radius:8px;padding:.75rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease;width:92%;margin-left:3%}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card.rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-approved-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card[class*=status-].status-rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card:has(.delete-btn){width:auto;margin-left:0;background-color:#fff;border:1px solid #e2e8f0;padding:.5rem}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn.primary-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn.primary-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-approved-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn[class*=status-].status-rejected-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-pending-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn.primary-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-approved-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-rejected-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn[class*=status-].status-pending-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#f5f5f5;border-color:#e57373;color:#e57373;padding:.5rem;min-width:auto;width:40px;height:40px;border-radius:6px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}.no-actions-message{display:flex;align-items:center;justify-content:center;padding:.5rem;min-height:40px}.no-actions-message .no-actions-text{color:#6b7280;font-size:.875rem;font-style:italic;text-align:center}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i9.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i6.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i9$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }] });
|
|
5814
5727
|
}
|
|
5815
5728
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, decorators: [{
|
|
5816
5729
|
type: Component,
|
|
5817
|
-
args: [{ selector: 'document-actions', standalone: false, template: "<div class=\"document-actions-container\" *ngIf=\"document?.status !=='Pending' && !document?.isUploaded && document?.status === 'Reviewing'\">\r\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\r\n <div class=\"actions-buttons\">\r\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn reject-btn\" [ngClass]=\"rejectButtonClass\"\r\n (click)=\"onRejectClick()\" [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isRejecting\">\r\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isRejecting\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED :\r\n SHARED.BUTTON_LABEL_REJECT }}</span>\r\n </button>\r\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn accept-btn\" [ngClass]=\"acceptButtonClass\"\r\n (click)=\"onAcceptClick()\" [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isAccepting\">\r\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isAccepting\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT\r\n }}</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n@if(document?.isUploaded){\r\n<div class=\"actions-card\">\r\n <div class=\"actions-buttons\">\r\n <button class=\"action-btn delete-btn\" (click)=\"onDeleteClick()\" [disabled]=\"isLoading\"\r\n [permission]=\"'documents-deleteDocumentByDocumentId'\" pTooltip=\"Delete Document\" tooltipPosition=\"top\">\r\n <i class=\"pi pi-trash\"></i>\r\n </button>\r\n </div>\r\n</div>\r\n}\r\n<app-confirmation-dialog></app-confirmation-dialog>\r\n\r\n<p-dialog [(visible)]=\"showAcceptDialog\" [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\r\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\r\n <textarea id=\"acceptNote\" pInputTextarea [(ngModel)]=\"acceptNote\" [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\r\n rows=\"6\" class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\r\n </button>\r\n <button pButton [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" class=\"p-button-success\" (click)=\"onAcceptConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>\r\n\r\n<p-dialog [(visible)]=\"showRejectDialog\" [header]=\"SHARED.REJECT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\r\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\r\n <textarea id=\"rejectNote\" pInputTextarea [(ngModel)]=\"rejectNote\" [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\r\n rows=\"6\" class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\r\n </button>\r\n <button pButton [label]=\"SHARED.REJECT_BUTTON_LABEL\" class=\"p-button-danger\" [disabled]=\"isRejectNoteEmpty\"\r\n (click)=\"onRejectConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>", styles: [".document-actions-container{margin:0}.actions-card{border-radius:8px;padding:.75rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease;width:92%;margin-left:3%}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card.rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-approved-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card[class*=status-].status-rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card:has(.delete-btn){width:auto;margin-left:0;background-color:#fff;border:1px solid #e2e8f0;padding:.5rem}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn.primary-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn.primary-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-approved-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn[class*=status-].status-rejected-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-pending-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn.primary-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-approved-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-rejected-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn[class*=status-].status-pending-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#f5f5f5;border-color:#e57373;color:#e57373;padding:.5rem;min-width:auto;width:40px;height:40px;border-radius:6px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}.no-actions-message{display:flex;align-items:center;justify-content:center;padding:.5rem;min-height:40px}.no-actions-message .no-actions-text{color:#6b7280;font-size:.875rem;font-style:italic;text-align:center}\n"] }]
|
|
5818
|
-
}], ctorParameters: () => [{ type: DocumentActionsService }, { type: SessionService }], propDecorators: { document: [{
|
|
5730
|
+
args: [{ selector: 'document-actions', standalone: false, template: "<!-- <div class=\"document-actions-container\" *ngIf=\"document?.status !=='Pending' && !document?.isUploaded && document?.status === 'Reviewing'\"> -->\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\n <div class=\"actions-buttons\">\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn reject-btn\" [ngClass]=\"rejectButtonClass\"\n (click)=\"onRejectClick()\" [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isRejecting\">\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isRejecting\"></i>\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED :\n SHARED.BUTTON_LABEL_REJECT }}</span>\n </button>\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn accept-btn\" [ngClass]=\"acceptButtonClass\"\n (click)=\"onAcceptClick()\" [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isAccepting\">\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isAccepting\"></i>\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT\n }}</span>\n </button>\n </div>\n </div>\n<!-- </div> -->\n\n<!-- @if(document?.isUploaded){ -->\n<div class=\"actions-card\">\n <div class=\"actions-buttons\">\n <button class=\"action-btn delete-btn\" (click)=\"onDeleteClick()\" [disabled]=\"isLoading\"\n pTooltip=\"Delete Document\" tooltipPosition=\"top\">\n <i class=\"pi pi-trash\"></i>\n </button>\n </div>\n</div>\n<!-- } -->\n\n<p-dialog [(visible)]=\"showAcceptDialog\" [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\n <textarea id=\"acceptNote\" pInputTextarea [(ngModel)]=\"acceptNote\" [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\n rows=\"6\" class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\n </button>\n <button pButton [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" class=\"p-button-success\" (click)=\"onAcceptConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>\n\n<p-dialog [(visible)]=\"showRejectDialog\" [header]=\"SHARED.REJECT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\n <textarea id=\"rejectNote\" pInputTextarea [(ngModel)]=\"rejectNote\" [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\n rows=\"6\" class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\n </button>\n <button pButton [label]=\"SHARED.REJECT_BUTTON_LABEL\" class=\"p-button-danger\" [disabled]=\"isRejectNoteEmpty\"\n (click)=\"onRejectConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>", styles: [".document-actions-container{margin:0}.actions-card{border-radius:8px;padding:.75rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease;width:92%;margin-left:3%}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card.rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-approved-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card[class*=status-].status-rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card:has(.delete-btn){width:auto;margin-left:0;background-color:#fff;border:1px solid #e2e8f0;padding:.5rem}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn.primary-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn.primary-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-approved-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn[class*=status-].status-rejected-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-pending-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn.primary-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-approved-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-rejected-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn[class*=status-].status-pending-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#f5f5f5;border-color:#e57373;color:#e57373;padding:.5rem;min-width:auto;width:40px;height:40px;border-radius:6px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}.no-actions-message{display:flex;align-items:center;justify-content:center;padding:.5rem;min-height:40px}.no-actions-message .no-actions-text{color:#6b7280;font-size:.875rem;font-style:italic;text-align:center}\n"] }]
|
|
5731
|
+
}], ctorParameters: () => [{ type: DocumentActionsService }, { type: SessionService }, { type: i3.ConfirmationService }], propDecorators: { document: [{
|
|
5819
5732
|
type: Input
|
|
5820
5733
|
}], documentId: [{
|
|
5821
5734
|
type: Input
|
|
@@ -5829,9 +5742,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5829
5742
|
type: Input
|
|
5830
5743
|
}], actionPerformed: [{
|
|
5831
5744
|
type: Output
|
|
5832
|
-
}], confirmationDialog: [{
|
|
5833
|
-
type: ViewChild,
|
|
5834
|
-
args: [ConfirmationDialogComponent]
|
|
5835
5745
|
}] } });
|
|
5836
5746
|
|
|
5837
5747
|
/**
|
|
@@ -7124,11 +7034,11 @@ class DocumentContainerComponent {
|
|
|
7124
7034
|
this.clearAllState();
|
|
7125
7035
|
}
|
|
7126
7036
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentHelperService }, { token: DocumentQuery }, { token: DocumentStore }, { token: DocumentMenuService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7127
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { refreshTrigger: "refreshTrigger", contextId: "contextId" }, outputs: { selectedDocument: "selectedDocument" }, viewQueries: [{ propertyName: "contentScrollContainer", first: true, predicate: ["contentScrollContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"grid m-0 flex document-container-layout\">\n <!-- Fixed Left Menu -->\n <div class=\"menu-panel col-12 md:col-2\">\n <lib-documents-menu \n [catagories]=\"catagories\" \n [applicationNumber]=\"applicationNumber\" \n [contextId]=\"contextId\"\n (menuItemSelected)=\"onMenuItemSelected($event)\">\n </lib-documents-menu>\n </div>\n \n <!-- Scrollable Right Content -->\n <div class=\"content-panel col-12 md:col-10\" #contentScrollContainer>\n <div class=\"card content-card\">\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\n </div>\n <div>\n <lib-document-list \n [contextId]=\"contextId\" \n [documentListResponse]=\"documentListResponse\"\n [selectedMenuItemId]=\"selectedMenuItemId\"\n [navigationInfo]=\"navigationInfo\"\n [sortedMenuItems]=\"sortedMenuItems\"\n (handleSelectedDocument)=\"onDocumentSelected($event)\"\n >\n <ng-content></ng-content>\n </lib-document-list>\n </div>\n </div>\n</div>", styles: [".document-container-layout{display:grid;grid-template-columns:1fr;height:98vh;overflow:auto;position:relative}@media (min-width: 768px){.document-container-layout{grid-template-columns:16.6667% 1fr}}.menu-panel{background-color:#fff;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.menu-panel{position:fixed;left:0;top:0;bottom:0;width:16.6667%}}.menu-panel::-webkit-scrollbar{display:none}.content-panel{display:flex;flex-direction:column;height:98vh;overflow-y:auto;overflow-x:hidden;padding:0;position:relative;z-index:10;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.content-panel{margin-left:16.6667%}}.content-panel::-webkit-scrollbar{display:none}@media (max-width: 1024px){.menu-panel{width:240px}.content-panel{margin-left:240px}}@media (max-width: 768px){.document-container-layout{grid-template-columns:1fr}.menu-panel{position:relative;width:100%;height:200px;border-right:none;border-bottom:1px solid #e5e7eb;z-index:auto}.content-panel{margin-left:0;flex:1}}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}*{scrollbar-width:thin}body,html{height:100%}::ng-deep .p-card{overflow:visible!important}::ng-deep .p-card-body{overflow:visible!important}::ng-deep .p-dialog{z-index:9999!important}::ng-deep .p-dialog-mask{z-index:9998!important}::ng-deep .content-panel .p-card{overflow:visible!important}\n"], dependencies: [{ kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId", "userList", "statusData", "categories"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "documentListResponse", "selectedMenuItemId", "navigationInfo", "sortedMenuItems", "documentList"], outputs: ["handleSelectedDocument"] }, { kind: "component", type: DocumentsMenuComponent, selector: "lib-documents-menu", inputs: ["catagories", "applicationNumber", "contextId"], outputs: ["menuItemSelected"] }] });
|
|
7037
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { refreshTrigger: "refreshTrigger", contextId: "contextId" }, outputs: { selectedDocument: "selectedDocument" }, viewQueries: [{ propertyName: "contentScrollContainer", first: true, predicate: ["contentScrollContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"grid m-0 flex document-container-layout\">\n <!-- Fixed Left Menu -->\n <div class=\"menu-panel col-12 md:col-2\">\n <lib-documents-menu \n [catagories]=\"catagories\" \n [applicationNumber]=\"applicationNumber\" \n [contextId]=\"contextId\"\n (menuItemSelected)=\"onMenuItemSelected($event)\">\n </lib-documents-menu>\n </div>\n \n <!-- Scrollable Right Content -->\n <div class=\"content-panel col-12 md:col-10\" #contentScrollContainer>\n <div class=\"card content-card\">\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\n </div>\n <div>\n <lib-document-list \n [contextId]=\"contextId\" \n [documentListResponse]=\"documentListResponse\"\n [selectedMenuItemId]=\"selectedMenuItemId\"\n [navigationInfo]=\"navigationInfo\"\n [sortedMenuItems]=\"sortedMenuItems\"\n (handleSelectedDocument)=\"onDocumentSelected($event)\"\n >\n <ng-content></ng-content>\n </lib-document-list>\n </div>\n </div>\n</div>\n\n<!-- Centralized confirmation dialog for all components -->\n<p-confirmDialog \n [style]=\"{width: '25vw'}\" \n acceptLabel=\"Yes\"\n rejectLabel=\"No\"\n appendTo=\"body\"\n acceptIcon=\"pi pi-check\"\n rejectIcon=\"pi pi-times\">\n</p-confirmDialog>", styles: [".document-container-layout{display:grid;grid-template-columns:1fr;height:98vh;overflow:auto;position:relative}@media (min-width: 768px){.document-container-layout{grid-template-columns:16.6667% 1fr}}.menu-panel{background-color:#fff;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.menu-panel{position:fixed;left:0;top:0;bottom:0;width:16.6667%}}.menu-panel::-webkit-scrollbar{display:none}.content-panel{display:flex;flex-direction:column;height:98vh;overflow-y:auto;overflow-x:hidden;padding:0;position:relative;z-index:10;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.content-panel{margin-left:16.6667%}}.content-panel::-webkit-scrollbar{display:none}@media (max-width: 1024px){.menu-panel{width:240px}.content-panel{margin-left:240px}}@media (max-width: 768px){.document-container-layout{grid-template-columns:1fr}.menu-panel{position:relative;width:100%;height:200px;border-right:none;border-bottom:1px solid #e5e7eb;z-index:auto}.content-panel{margin-left:0;flex:1}}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}*{scrollbar-width:thin}body,html{height:100%}::ng-deep .p-card{overflow:visible!important}::ng-deep .p-card-body{overflow:visible!important}::ng-deep .p-dialog{z-index:9999!important}::ng-deep .p-dialog-mask{z-index:9998!important}::ng-deep .content-panel .p-card{overflow:visible!important}\n"], dependencies: [{ kind: "component", type: i6$2.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId", "userList", "statusData", "categories"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "documentListResponse", "selectedMenuItemId", "navigationInfo", "sortedMenuItems", "documentList"], outputs: ["handleSelectedDocument"] }, { kind: "component", type: DocumentsMenuComponent, selector: "lib-documents-menu", inputs: ["catagories", "applicationNumber", "contextId"], outputs: ["menuItemSelected"] }] });
|
|
7128
7038
|
}
|
|
7129
7039
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, decorators: [{
|
|
7130
7040
|
type: Component,
|
|
7131
|
-
args: [{ selector: 'lib-document-container', standalone: false, template: "<div class=\"grid m-0 flex document-container-layout\">\n <!-- Fixed Left Menu -->\n <div class=\"menu-panel col-12 md:col-2\">\n <lib-documents-menu \n [catagories]=\"catagories\" \n [applicationNumber]=\"applicationNumber\" \n [contextId]=\"contextId\"\n (menuItemSelected)=\"onMenuItemSelected($event)\">\n </lib-documents-menu>\n </div>\n \n <!-- Scrollable Right Content -->\n <div class=\"content-panel col-12 md:col-10\" #contentScrollContainer>\n <div class=\"card content-card\">\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\n </div>\n <div>\n <lib-document-list \n [contextId]=\"contextId\" \n [documentListResponse]=\"documentListResponse\"\n [selectedMenuItemId]=\"selectedMenuItemId\"\n [navigationInfo]=\"navigationInfo\"\n [sortedMenuItems]=\"sortedMenuItems\"\n (handleSelectedDocument)=\"onDocumentSelected($event)\"\n >\n <ng-content></ng-content>\n </lib-document-list>\n </div>\n </div>\n</div>", styles: [".document-container-layout{display:grid;grid-template-columns:1fr;height:98vh;overflow:auto;position:relative}@media (min-width: 768px){.document-container-layout{grid-template-columns:16.6667% 1fr}}.menu-panel{background-color:#fff;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.menu-panel{position:fixed;left:0;top:0;bottom:0;width:16.6667%}}.menu-panel::-webkit-scrollbar{display:none}.content-panel{display:flex;flex-direction:column;height:98vh;overflow-y:auto;overflow-x:hidden;padding:0;position:relative;z-index:10;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.content-panel{margin-left:16.6667%}}.content-panel::-webkit-scrollbar{display:none}@media (max-width: 1024px){.menu-panel{width:240px}.content-panel{margin-left:240px}}@media (max-width: 768px){.document-container-layout{grid-template-columns:1fr}.menu-panel{position:relative;width:100%;height:200px;border-right:none;border-bottom:1px solid #e5e7eb;z-index:auto}.content-panel{margin-left:0;flex:1}}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}*{scrollbar-width:thin}body,html{height:100%}::ng-deep .p-card{overflow:visible!important}::ng-deep .p-card-body{overflow:visible!important}::ng-deep .p-dialog{z-index:9999!important}::ng-deep .p-dialog-mask{z-index:9998!important}::ng-deep .content-panel .p-card{overflow:visible!important}\n"] }]
|
|
7041
|
+
args: [{ selector: 'lib-document-container', standalone: false, template: "<div class=\"grid m-0 flex document-container-layout\">\n <!-- Fixed Left Menu -->\n <div class=\"menu-panel col-12 md:col-2\">\n <lib-documents-menu \n [catagories]=\"catagories\" \n [applicationNumber]=\"applicationNumber\" \n [contextId]=\"contextId\"\n (menuItemSelected)=\"onMenuItemSelected($event)\">\n </lib-documents-menu>\n </div>\n \n <!-- Scrollable Right Content -->\n <div class=\"content-panel col-12 md:col-10\" #contentScrollContainer>\n <div class=\"card content-card\">\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\n </div>\n <div>\n <lib-document-list \n [contextId]=\"contextId\" \n [documentListResponse]=\"documentListResponse\"\n [selectedMenuItemId]=\"selectedMenuItemId\"\n [navigationInfo]=\"navigationInfo\"\n [sortedMenuItems]=\"sortedMenuItems\"\n (handleSelectedDocument)=\"onDocumentSelected($event)\"\n >\n <ng-content></ng-content>\n </lib-document-list>\n </div>\n </div>\n</div>\n\n<!-- Centralized confirmation dialog for all components -->\n<p-confirmDialog \n [style]=\"{width: '25vw'}\" \n acceptLabel=\"Yes\"\n rejectLabel=\"No\"\n appendTo=\"body\"\n acceptIcon=\"pi pi-check\"\n rejectIcon=\"pi pi-times\">\n</p-confirmDialog>", styles: [".document-container-layout{display:grid;grid-template-columns:1fr;height:98vh;overflow:auto;position:relative}@media (min-width: 768px){.document-container-layout{grid-template-columns:16.6667% 1fr}}.menu-panel{background-color:#fff;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.menu-panel{position:fixed;left:0;top:0;bottom:0;width:16.6667%}}.menu-panel::-webkit-scrollbar{display:none}.content-panel{display:flex;flex-direction:column;height:98vh;overflow-y:auto;overflow-x:hidden;padding:0;position:relative;z-index:10;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.content-panel{margin-left:16.6667%}}.content-panel::-webkit-scrollbar{display:none}@media (max-width: 1024px){.menu-panel{width:240px}.content-panel{margin-left:240px}}@media (max-width: 768px){.document-container-layout{grid-template-columns:1fr}.menu-panel{position:relative;width:100%;height:200px;border-right:none;border-bottom:1px solid #e5e7eb;z-index:auto}.content-panel{margin-left:0;flex:1}}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}*{scrollbar-width:thin}body,html{height:100%}::ng-deep .p-card{overflow:visible!important}::ng-deep .p-card-body{overflow:visible!important}::ng-deep .p-dialog{z-index:9999!important}::ng-deep .p-dialog-mask{z-index:9998!important}::ng-deep .content-panel .p-card{overflow:visible!important}\n"] }]
|
|
7132
7042
|
}], ctorParameters: () => [{ type: DocumentHttpService }, { type: DocumentHelperService }, { type: DocumentQuery }, { type: DocumentStore }, { type: DocumentMenuService }], propDecorators: { refreshTrigger: [{
|
|
7133
7043
|
type: Input
|
|
7134
7044
|
}], contentScrollContainer: [{
|
|
@@ -7346,16 +7256,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7346
7256
|
type: Output
|
|
7347
7257
|
}] } });
|
|
7348
7258
|
|
|
7259
|
+
/**
|
|
7260
|
+
* Directive to conditionally show or hide elements based on user permissions.
|
|
7261
|
+
* @class HasPermissionDirective
|
|
7262
|
+
* @typedef {HasPermissionDirective}
|
|
7263
|
+
*/
|
|
7264
|
+
class HasPermissionDirective {
|
|
7265
|
+
el;
|
|
7266
|
+
renderer;
|
|
7267
|
+
sessionService;
|
|
7268
|
+
/**
|
|
7269
|
+
* The required permission(s) to display the element.
|
|
7270
|
+
* Accepts a single string or an array of strings.
|
|
7271
|
+
* @type {string | string[]}
|
|
7272
|
+
*/
|
|
7273
|
+
permission;
|
|
7274
|
+
/**
|
|
7275
|
+
* Creates an instance of HasPermissionDirective.
|
|
7276
|
+
* @param {ElementRef} el - Reference to the host element.
|
|
7277
|
+
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
7278
|
+
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
7279
|
+
*/
|
|
7280
|
+
constructor(el, renderer, sessionService) {
|
|
7281
|
+
this.el = el;
|
|
7282
|
+
this.renderer = renderer;
|
|
7283
|
+
this.sessionService = sessionService;
|
|
7284
|
+
}
|
|
7285
|
+
/**
|
|
7286
|
+
* Lifecycle hook that is called when input properties change.
|
|
7287
|
+
* @param {SimpleChanges} changes - The changes in input properties.
|
|
7288
|
+
*/
|
|
7289
|
+
ngOnChanges(changes) {
|
|
7290
|
+
if (changes['permission']) {
|
|
7291
|
+
this.checkPermission();
|
|
7292
|
+
}
|
|
7293
|
+
}
|
|
7294
|
+
/**
|
|
7295
|
+
* Checks if the user has the required permission(s).
|
|
7296
|
+
* Hides the element if the permission is not found.
|
|
7297
|
+
*/
|
|
7298
|
+
checkPermission() {
|
|
7299
|
+
// If no permission is required (empty string, null, or undefined), show the element
|
|
7300
|
+
if (!this.permission || this.permission === '' || (Array.isArray(this.permission) && this.permission.length === 0)) {
|
|
7301
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
7302
|
+
return;
|
|
7303
|
+
}
|
|
7304
|
+
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
7305
|
+
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
7306
|
+
const requiredPermissions = Array.isArray(this.permission)
|
|
7307
|
+
? this.permission
|
|
7308
|
+
: [this.permission];
|
|
7309
|
+
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
7310
|
+
if (!hasPermission) {
|
|
7311
|
+
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
7312
|
+
}
|
|
7313
|
+
else {
|
|
7314
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
7315
|
+
}
|
|
7316
|
+
}
|
|
7317
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
7318
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
7319
|
+
}
|
|
7320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
7321
|
+
type: Directive,
|
|
7322
|
+
args: [{
|
|
7323
|
+
selector: '[permission]',
|
|
7324
|
+
standalone: false
|
|
7325
|
+
}]
|
|
7326
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
7327
|
+
type: Input
|
|
7328
|
+
}] } });
|
|
7329
|
+
|
|
7349
7330
|
class SharedModule {
|
|
7350
7331
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7351
7332
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, declarations: [TablePrimaryComponent, HasPermissionDirective, ConfirmationDialogComponent], imports: [CommonModule,
|
|
7352
7333
|
TableModule,
|
|
7353
7334
|
ButtonModule,
|
|
7354
|
-
RippleModule
|
|
7335
|
+
RippleModule,
|
|
7336
|
+
ConfirmDialogModule], exports: [TablePrimaryComponent, HasPermissionDirective, ConfirmationDialogComponent, ConfirmDialogModule] });
|
|
7355
7337
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, providers: [ConfirmationService], imports: [CommonModule,
|
|
7356
7338
|
TableModule,
|
|
7357
7339
|
ButtonModule,
|
|
7358
|
-
RippleModule
|
|
7340
|
+
RippleModule,
|
|
7341
|
+
ConfirmDialogModule, ConfirmDialogModule] });
|
|
7359
7342
|
}
|
|
7360
7343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, decorators: [{
|
|
7361
7344
|
type: NgModule,
|
|
@@ -7365,10 +7348,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7365
7348
|
CommonModule,
|
|
7366
7349
|
TableModule,
|
|
7367
7350
|
ButtonModule,
|
|
7368
|
-
RippleModule
|
|
7351
|
+
RippleModule,
|
|
7352
|
+
ConfirmDialogModule
|
|
7369
7353
|
],
|
|
7370
7354
|
providers: [ConfirmationService],
|
|
7371
|
-
exports: [TablePrimaryComponent, HasPermissionDirective, ConfirmationDialogComponent]
|
|
7355
|
+
exports: [TablePrimaryComponent, HasPermissionDirective, ConfirmationDialogComponent, ConfirmDialogModule]
|
|
7372
7356
|
}]
|
|
7373
7357
|
}] });
|
|
7374
7358
|
|