cat-documents-ng 0.0.70 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Shared/constant/PERMISSIONS.d.ts +14 -0
- package/Shared/constant/SHARED.d.ts +4 -0
- package/Shared/services/session.service.d.ts +46 -0
- package/fesm2022/cat-documents-ng.mjs +207 -13
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-container/document-container.component.d.ts +4 -0
- package/lib/document/components/document-list/document-list.component.d.ts +4 -1
- package/lib/document/directives/permission.directive.d.ts +38 -0
- package/lib/document/document.module.d.ts +19 -17
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Router } from '@angular/router';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Service for managing user session details.
|
|
5
|
+
* @class SessionService
|
|
6
|
+
* @typedef {SessionService}
|
|
7
|
+
*/
|
|
8
|
+
export declare class SessionService {
|
|
9
|
+
router: Router;
|
|
10
|
+
/**
|
|
11
|
+
* Creates an instance of SessionService.
|
|
12
|
+
* @param {Router} router - Angular Router for navigation.
|
|
13
|
+
*/
|
|
14
|
+
constructor(router: Router);
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves the current user's role from local storage.
|
|
17
|
+
* @returns {string | null} The user's role, or null if not found.
|
|
18
|
+
*/
|
|
19
|
+
getUserRole(): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Stores the user session data in local storage.
|
|
22
|
+
* @param {any} data - The session data to store.
|
|
23
|
+
*/
|
|
24
|
+
setUserSession(data: any): void;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves the stored user session data.
|
|
27
|
+
* @returns {any | null} The parsed session data, or null if not found.
|
|
28
|
+
*/
|
|
29
|
+
getUserSession(): any | null;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves the user's permissions from the stored session data.
|
|
32
|
+
* @returns {any | null} The user's permissions, or null if not found.
|
|
33
|
+
*/
|
|
34
|
+
getUserPermissions(): any | null;
|
|
35
|
+
/**
|
|
36
|
+
* Retrieves the session ID from the stored session data.
|
|
37
|
+
* @returns {any | null} The session ID, or null if not found.
|
|
38
|
+
*/
|
|
39
|
+
getSessionID(): any | null;
|
|
40
|
+
/**
|
|
41
|
+
* Clears all stored session data from local storage.
|
|
42
|
+
*/
|
|
43
|
+
clearSession(): void;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SessionService, never>;
|
|
45
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SessionService>;
|
|
46
|
+
}
|
|
@@ -28,10 +28,12 @@ import * as i8 from 'primeng/progressbar';
|
|
|
28
28
|
import { ProgressBarModule } from 'primeng/progressbar';
|
|
29
29
|
import * as i4 from 'ng2-pdf-viewer';
|
|
30
30
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
|
31
|
+
import * as i1 from '@angular/router';
|
|
31
32
|
import { BadgeModule } from 'primeng/badge';
|
|
32
33
|
import { ListboxModule } from 'primeng/listbox';
|
|
33
34
|
import { TimelineModule } from 'primeng/timeline';
|
|
34
35
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
36
|
+
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
35
37
|
import { InputTextModule } from 'primeng/inputtext';
|
|
36
38
|
|
|
37
39
|
/**
|
|
@@ -39,6 +41,10 @@ import { InputTextModule } from 'primeng/inputtext';
|
|
|
39
41
|
* These constants are related to document statuses and other shared data.
|
|
40
42
|
*/
|
|
41
43
|
class SHARED {
|
|
44
|
+
/**
|
|
45
|
+
* Represents the stores userData.
|
|
46
|
+
*/
|
|
47
|
+
static SESSIONKEY = 'userData';
|
|
42
48
|
/**
|
|
43
49
|
* Represents the count of missing files.
|
|
44
50
|
*/
|
|
@@ -365,7 +371,7 @@ class URLS {
|
|
|
365
371
|
* @static
|
|
366
372
|
* @type {string}
|
|
367
373
|
*/
|
|
368
|
-
static DOCUMENT_UPLOAD = "
|
|
374
|
+
static DOCUMENT_UPLOAD = "Documents";
|
|
369
375
|
/**
|
|
370
376
|
* The query parameter to pass a context ID in API requests.
|
|
371
377
|
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
@@ -836,6 +842,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
836
842
|
type: Input
|
|
837
843
|
}] } });
|
|
838
844
|
|
|
845
|
+
/**
|
|
846
|
+
* Storing all permission properties.
|
|
847
|
+
* @export
|
|
848
|
+
* @class PERMISSIONS
|
|
849
|
+
* @typedef {PERMISSIONS}
|
|
850
|
+
*/
|
|
851
|
+
class PERMISSIONS {
|
|
852
|
+
/**
|
|
853
|
+
* Access permission.
|
|
854
|
+
* @static
|
|
855
|
+
* @type {string}
|
|
856
|
+
*/
|
|
857
|
+
static DOCUMENT_POST = 'Documents-POST';
|
|
858
|
+
}
|
|
859
|
+
|
|
839
860
|
/**
|
|
840
861
|
* Service for handling document uploads.
|
|
841
862
|
* @class DocumentUploadService
|
|
@@ -988,11 +1009,11 @@ class DocumentListItemComponent {
|
|
|
988
1009
|
this.documentClick.emit(document);
|
|
989
1010
|
}
|
|
990
1011
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
991
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentListItemComponent, isStandalone: false, selector: "lib-document-list-item", inputs: { document: "document" }, outputs: { documentClick: "documentClick" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-6 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4 file-name-wrapper document-text-wrapper\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1
|
|
1012
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentListItemComponent, isStandalone: false, selector: "lib-document-list-item", inputs: { document: "document" }, outputs: { documentClick: "documentClick" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-6 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4 file-name-wrapper document-text-wrapper\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1\"\r\n >\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'pending'\">\r\n <i class=\"pi pi-clock pr-1\" style=\"font-size: 12px;\"></i>\r\n Pending\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'verified'\">\r\n <i class=\"pi pi-check-circle pr-1\" style=\"font-size: 12px;\"></i>\r\n Verified\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'alert'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Alert\r\n </ng-container>\r\n </span>\r\n </div>\r\n <div class=\"document-type file-name-wrapper document-text-wrapper\">\r\n {{document.documentTypeName}}\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".product-badge.status-pending{background:#e9b127;color:#fff;border-radius:4px}.product-badge.status-verified{background:#4caf50;color:#fff;border-radius:4px}.product-badge.status-alert{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}.file-name-wrapper{font-size:15px;font-weight:500}.document-text-wrapper{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
992
1013
|
}
|
|
993
1014
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListItemComponent, decorators: [{
|
|
994
1015
|
type: Component,
|
|
995
|
-
args: [{ selector: 'lib-document-list-item', standalone: false, template: "<div class=\"grid m-0\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-6 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4 file-name-wrapper document-text-wrapper\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1
|
|
1016
|
+
args: [{ selector: 'lib-document-list-item', standalone: false, template: "<div class=\"grid m-0\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-6 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4 file-name-wrapper document-text-wrapper\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1\"\r\n >\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'pending'\">\r\n <i class=\"pi pi-clock pr-1\" style=\"font-size: 12px;\"></i>\r\n Pending\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'verified'\">\r\n <i class=\"pi pi-check-circle pr-1\" style=\"font-size: 12px;\"></i>\r\n Verified\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'alert'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Alert\r\n </ng-container>\r\n </span>\r\n </div>\r\n <div class=\"document-type file-name-wrapper document-text-wrapper\">\r\n {{document.documentTypeName}}\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".product-badge.status-pending{background:#e9b127;color:#fff;border-radius:4px}.product-badge.status-verified{background:#4caf50;color:#fff;border-radius:4px}.product-badge.status-alert{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}.file-name-wrapper{font-size:15px;font-weight:500}.document-text-wrapper{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
996
1017
|
}], propDecorators: { documentClick: [{
|
|
997
1018
|
type: Output
|
|
998
1019
|
}], document: [{
|
|
@@ -1300,6 +1321,146 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1300
1321
|
type: Input
|
|
1301
1322
|
}] } });
|
|
1302
1323
|
|
|
1324
|
+
/**
|
|
1325
|
+
* Service for managing user session details.
|
|
1326
|
+
* @class SessionService
|
|
1327
|
+
* @typedef {SessionService}
|
|
1328
|
+
*/
|
|
1329
|
+
class SessionService {
|
|
1330
|
+
router;
|
|
1331
|
+
/**
|
|
1332
|
+
* Creates an instance of SessionService.
|
|
1333
|
+
* @param {Router} router - Angular Router for navigation.
|
|
1334
|
+
*/
|
|
1335
|
+
constructor(router) {
|
|
1336
|
+
this.router = router;
|
|
1337
|
+
}
|
|
1338
|
+
/**
|
|
1339
|
+
* Retrieves the current user's role from local storage.
|
|
1340
|
+
* @returns {string | null} The user's role, or null if not found.
|
|
1341
|
+
*/
|
|
1342
|
+
getUserRole() {
|
|
1343
|
+
return localStorage.getItem('role');
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* Stores the user session data in local storage.
|
|
1347
|
+
* @param {any} data - The session data to store.
|
|
1348
|
+
*/
|
|
1349
|
+
setUserSession(data) {
|
|
1350
|
+
localStorage.setItem(SHARED.SESSIONKEY, JSON.stringify(data));
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Retrieves the stored user session data.
|
|
1354
|
+
* @returns {any | null} The parsed session data, or null if not found.
|
|
1355
|
+
*/
|
|
1356
|
+
getUserSession() {
|
|
1357
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
1358
|
+
return sessionData ? JSON.parse(sessionData) : null;
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Retrieves the user's permissions from the stored session data.
|
|
1362
|
+
* @returns {any | null} The user's permissions, or null if not found.
|
|
1363
|
+
*/
|
|
1364
|
+
getUserPermissions() {
|
|
1365
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
1366
|
+
return sessionData ? JSON.parse(sessionData).permissions : null;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Retrieves the session ID from the stored session data.
|
|
1370
|
+
* @returns {any | null} The session ID, or null if not found.
|
|
1371
|
+
*/
|
|
1372
|
+
getSessionID() {
|
|
1373
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
1374
|
+
console.log(sessionData);
|
|
1375
|
+
if (sessionData) {
|
|
1376
|
+
const sessionId = JSON.parse(sessionData);
|
|
1377
|
+
console.log(sessionId);
|
|
1378
|
+
return sessionId;
|
|
1379
|
+
}
|
|
1380
|
+
return null;
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* Clears all stored session data from local storage.
|
|
1384
|
+
*/
|
|
1385
|
+
clearSession() {
|
|
1386
|
+
localStorage.clear();
|
|
1387
|
+
}
|
|
1388
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1389
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, providedIn: 'root' });
|
|
1390
|
+
}
|
|
1391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, decorators: [{
|
|
1392
|
+
type: Injectable,
|
|
1393
|
+
args: [{
|
|
1394
|
+
providedIn: 'root'
|
|
1395
|
+
}]
|
|
1396
|
+
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
1397
|
+
|
|
1398
|
+
/**
|
|
1399
|
+
* Directive to conditionally show or hide elements based on user permissions.
|
|
1400
|
+
* @class HasPermissionDirective
|
|
1401
|
+
* @typedef {HasPermissionDirective}
|
|
1402
|
+
*/
|
|
1403
|
+
class HasPermissionDirective {
|
|
1404
|
+
el;
|
|
1405
|
+
renderer;
|
|
1406
|
+
sessionService;
|
|
1407
|
+
/**
|
|
1408
|
+
* The required permission(s) to display the element.
|
|
1409
|
+
* Accepts a single string or an array of strings.
|
|
1410
|
+
* @type {string | string[]}
|
|
1411
|
+
*/
|
|
1412
|
+
permission;
|
|
1413
|
+
/**
|
|
1414
|
+
* Creates an instance of HasPermissionDirective.
|
|
1415
|
+
* @param {ElementRef} el - Reference to the host element.
|
|
1416
|
+
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
1417
|
+
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
1418
|
+
*/
|
|
1419
|
+
constructor(el, renderer, sessionService) {
|
|
1420
|
+
this.el = el;
|
|
1421
|
+
this.renderer = renderer;
|
|
1422
|
+
this.sessionService = sessionService;
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Lifecycle hook that is called when input properties change.
|
|
1426
|
+
* @param {SimpleChanges} changes - The changes in input properties.
|
|
1427
|
+
*/
|
|
1428
|
+
ngOnChanges(changes) {
|
|
1429
|
+
if (changes['permission']) {
|
|
1430
|
+
this.checkPermission();
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
/**
|
|
1434
|
+
* Checks if the user has the required permission(s).
|
|
1435
|
+
* Hides the element if the permission is not found.
|
|
1436
|
+
*/
|
|
1437
|
+
checkPermission() {
|
|
1438
|
+
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
1439
|
+
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
1440
|
+
const requiredPermissions = Array.isArray(this.permission)
|
|
1441
|
+
? this.permission
|
|
1442
|
+
: [this.permission];
|
|
1443
|
+
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
1444
|
+
if (!hasPermission) {
|
|
1445
|
+
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
1446
|
+
}
|
|
1447
|
+
else {
|
|
1448
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1452
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
1453
|
+
}
|
|
1454
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
1455
|
+
type: Directive,
|
|
1456
|
+
args: [{
|
|
1457
|
+
selector: '[permission]',
|
|
1458
|
+
standalone: false
|
|
1459
|
+
}]
|
|
1460
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
1461
|
+
type: Input
|
|
1462
|
+
}] } });
|
|
1463
|
+
|
|
1303
1464
|
/**
|
|
1304
1465
|
* This component is responsible for displaying and managing a list of documents.
|
|
1305
1466
|
* Provides functionality for file upload, document selection, and dialog management.
|
|
@@ -1373,12 +1534,14 @@ class DocumentListComponent {
|
|
|
1373
1534
|
* @memberof DocumentListComponent
|
|
1374
1535
|
*/
|
|
1375
1536
|
selectedOption = null;
|
|
1537
|
+
PERMISSION = PERMISSIONS;
|
|
1376
1538
|
/**
|
|
1377
1539
|
* Creates an instance of DocumentListComponent.
|
|
1378
1540
|
* @class
|
|
1379
1541
|
* @param {DocumentUploadService} documentUploadService - The service responsible for uploading documents.
|
|
1380
1542
|
* @param {DocumentHttpService} documentHttpService - The service responsible for fetching documents from the server.
|
|
1381
|
-
* @param {DocumentQuery} documentQuery - The service responsible for
|
|
1543
|
+
* @param {DocumentQuery} documentQuery - The service responsible for geting stored documents.
|
|
1544
|
+
* @param {DocumentStore} documentStore - The service responsible for storing documents.
|
|
1382
1545
|
*/
|
|
1383
1546
|
constructor(documentUploadService, documentHttpService, documentQuery, documentStore) {
|
|
1384
1547
|
this.documentUploadService = documentUploadService;
|
|
@@ -1482,11 +1645,11 @@ class DocumentListComponent {
|
|
|
1482
1645
|
this.isSidebarVisible = isVisible;
|
|
1483
1646
|
}
|
|
1484
1647
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentUploadService }, { token: DocumentHttpService }, { token: DocumentQuery }, { token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
1485
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList" }, outputs: { onRefresh: "onRefresh" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModel()\" [style]=\"{ width: '90vw', height : '100vh' }\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\">\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion>\r\n <p-accordionTab [selected]=\"true\" class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}\n"], dependencies: [{ kind: "component", type: i5$1.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i5$1.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i7.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i8$1.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: i9.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "directive", type: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i10.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i11.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: "component", type: i12.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "autoShowPanelOnPrintableCharacterKeyDown", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: DocumentListItemComponent, selector: "lib-document-list-item", inputs: ["document"], outputs: ["documentClick"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1648
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList" }, outputs: { onRefresh: "onRefresh" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModel()\" [style]=\"{ width: '90vw', height : '100vh' }\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\">\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion>\r\n <p-accordionTab [selected]=\"true\" class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" [permission]=\"PERMISSION.DOCUMENT_POST\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}\n"], dependencies: [{ kind: "component", type: i5$1.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i5$1.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i7.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i8$1.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: i9.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "directive", type: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i10.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i11.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: "component", type: i12.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "autoShowPanelOnPrintableCharacterKeyDown", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: DocumentListItemComponent, selector: "lib-document-list-item", inputs: ["document"], outputs: ["documentClick"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument"] }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1486
1649
|
}
|
|
1487
1650
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, decorators: [{
|
|
1488
1651
|
type: Component,
|
|
1489
|
-
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModel()\" [style]=\"{ width: '90vw', height : '100vh' }\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\">\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion>\r\n <p-accordionTab [selected]=\"true\" class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}\n"] }]
|
|
1652
|
+
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModel()\" [style]=\"{ width: '90vw', height : '100vh' }\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\">\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion>\r\n <p-accordionTab [selected]=\"true\" class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" [permission]=\"PERMISSION.DOCUMENT_POST\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}\n"] }]
|
|
1490
1653
|
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }, { type: DocumentQuery }, { type: DocumentStore }], propDecorators: { onRefresh: [{
|
|
1491
1654
|
type: Output
|
|
1492
1655
|
}], contextId: [{
|
|
@@ -1572,6 +1735,10 @@ class DocumentContainerComponent {
|
|
|
1572
1735
|
* Fetches the folder data from the API.
|
|
1573
1736
|
* @returns {void}
|
|
1574
1737
|
*/
|
|
1738
|
+
/**
|
|
1739
|
+
* Fetches the folder data from the API.
|
|
1740
|
+
* @returns {void}
|
|
1741
|
+
*/
|
|
1575
1742
|
fetchFolder() {
|
|
1576
1743
|
const folderSubscription = this.documentHttpService.getFoldersData(this.contextId).subscribe({
|
|
1577
1744
|
/**
|
|
@@ -1580,10 +1747,9 @@ class DocumentContainerComponent {
|
|
|
1580
1747
|
*/
|
|
1581
1748
|
next: (folder) => {
|
|
1582
1749
|
if (folder && folder.length > 0) {
|
|
1583
|
-
this.folderList = folder;
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
this.fetchDocuments(validFolder[0]._id);
|
|
1750
|
+
this.folderList = folder.filter(f => (f.documentCount ?? 0) > 0);
|
|
1751
|
+
if (this.folderList.length > 0) {
|
|
1752
|
+
this.fetchDocuments(this.folderList[0]._id);
|
|
1587
1753
|
}
|
|
1588
1754
|
else {
|
|
1589
1755
|
console.warn('No folders with documents found.');
|
|
@@ -1766,7 +1932,11 @@ class DocumentModule {
|
|
|
1766
1932
|
/**
|
|
1767
1933
|
* A directive to show the document.
|
|
1768
1934
|
*/
|
|
1769
|
-
DocumentDirective
|
|
1935
|
+
DocumentDirective,
|
|
1936
|
+
/**
|
|
1937
|
+
* A directive to give permission.
|
|
1938
|
+
*/
|
|
1939
|
+
HasPermissionDirective], imports: [
|
|
1770
1940
|
/**
|
|
1771
1941
|
* Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
|
|
1772
1942
|
*/
|
|
@@ -1811,6 +1981,10 @@ class DocumentModule {
|
|
|
1811
1981
|
* PrimeNG TimelineModule is used for showing timeline value.
|
|
1812
1982
|
*/
|
|
1813
1983
|
TimelineModule,
|
|
1984
|
+
/**
|
|
1985
|
+
* PrimeNG InputTextareaModule is used for showing textarea value.
|
|
1986
|
+
*/
|
|
1987
|
+
InputTextareaModule,
|
|
1814
1988
|
/**
|
|
1815
1989
|
* FormsModule to handle the forms.
|
|
1816
1990
|
*/
|
|
@@ -1831,6 +2005,10 @@ class DocumentModule {
|
|
|
1831
2005
|
* PrimeNG InputTextModule is used for creating InputTextFeilds, allowing users to enter name for a document.
|
|
1832
2006
|
*/
|
|
1833
2007
|
InputTextModule], exports: [
|
|
2008
|
+
/**
|
|
2009
|
+
* A directive to give permission.
|
|
2010
|
+
*/
|
|
2011
|
+
HasPermissionDirective,
|
|
1834
2012
|
/**
|
|
1835
2013
|
* Exports the `DocumentContainerComponent` to be used in other modules.
|
|
1836
2014
|
*/
|
|
@@ -1924,6 +2102,10 @@ class DocumentModule {
|
|
|
1924
2102
|
* PrimeNG TimelineModule is used for showing timeline value.
|
|
1925
2103
|
*/
|
|
1926
2104
|
TimelineModule,
|
|
2105
|
+
/**
|
|
2106
|
+
* PrimeNG InputTextareaModule is used for showing textarea value.
|
|
2107
|
+
*/
|
|
2108
|
+
InputTextareaModule,
|
|
1927
2109
|
/**
|
|
1928
2110
|
* FormsModule to handle the forms.
|
|
1929
2111
|
*/
|
|
@@ -1985,7 +2167,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1985
2167
|
/**
|
|
1986
2168
|
* A directive to show the document.
|
|
1987
2169
|
*/
|
|
1988
|
-
DocumentDirective
|
|
2170
|
+
DocumentDirective,
|
|
2171
|
+
/**
|
|
2172
|
+
* A directive to give permission.
|
|
2173
|
+
*/
|
|
2174
|
+
HasPermissionDirective,
|
|
1989
2175
|
],
|
|
1990
2176
|
imports: [
|
|
1991
2177
|
/**
|
|
@@ -2032,6 +2218,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2032
2218
|
* PrimeNG TimelineModule is used for showing timeline value.
|
|
2033
2219
|
*/
|
|
2034
2220
|
TimelineModule,
|
|
2221
|
+
/**
|
|
2222
|
+
* PrimeNG InputTextareaModule is used for showing textarea value.
|
|
2223
|
+
*/
|
|
2224
|
+
InputTextareaModule,
|
|
2035
2225
|
/**
|
|
2036
2226
|
* FormsModule to handle the forms.
|
|
2037
2227
|
*/
|
|
@@ -2054,6 +2244,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2054
2244
|
InputTextModule
|
|
2055
2245
|
],
|
|
2056
2246
|
exports: [
|
|
2247
|
+
/**
|
|
2248
|
+
* A directive to give permission.
|
|
2249
|
+
*/
|
|
2250
|
+
HasPermissionDirective,
|
|
2057
2251
|
/**
|
|
2058
2252
|
* Exports the `DocumentContainerComponent` to be used in other modules.
|
|
2059
2253
|
*/
|
|
@@ -2115,5 +2309,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2115
2309
|
* Generated bundle index. Do not edit.
|
|
2116
2310
|
*/
|
|
2117
2311
|
|
|
2118
|
-
export { DocumentContainerComponent, DocumentDirective, DocumentListComponent, DocumentModule, DocumentViewerComponent };
|
|
2312
|
+
export { DocumentContainerComponent, DocumentDirective, DocumentListComponent, DocumentModule, DocumentViewerComponent, HasPermissionDirective };
|
|
2119
2313
|
//# sourceMappingURL=cat-documents-ng.mjs.map
|