cat-documents-ng 0.0.10 → 0.0.12

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.
Files changed (90) hide show
  1. package/README.md +19 -15
  2. package/Shared/constant/SHARED.d.ts +150 -0
  3. package/{projects/cat-document-lib/src/Shared/constant/URLS.ts → Shared/constant/URLS.d.ts} +29 -31
  4. package/Shared/services/app-config.service.d.ts +51 -0
  5. package/{projects/cat-document-lib/src/Shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +27 -29
  6. package/fesm2022/cat-documents-ng.mjs +1411 -0
  7. package/fesm2022/cat-documents-ng.mjs.map +1 -0
  8. package/index.d.ts +5 -0
  9. package/lib/document/components/document-container/document-container.component.d.ts +44 -0
  10. package/lib/document/components/document-list/document-list.component.d.ts +47 -0
  11. package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
  12. package/lib/document/components/document-upload/document-upload.component.d.ts +113 -0
  13. package/lib/document/components/document-viewer/document-viewer.component.d.ts +113 -0
  14. package/{projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.ts → lib/document/components/folder-block/folder-block.component.d.ts} +37 -51
  15. package/lib/document/components/folder-container/folder-container.component.d.ts +28 -0
  16. package/lib/document/document.module.d.ts +35 -0
  17. package/lib/document/models/document.model.d.ts +33 -0
  18. package/{projects/cat-document-lib/src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +29 -35
  19. package/lib/document/services/file-format.service.d.ts +23 -0
  20. package/{projects/cat-document-lib/src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +64 -95
  21. package/{projects/cat-document-lib/src/lib/document/state/document.state.ts → lib/document/state/document.state.d.ts} +30 -39
  22. package/lib/document/state/document.store.d.ts +20 -0
  23. package/package.json +25 -66
  24. package/{projects/cat-document-lib/src/public-api.ts → public-api.d.ts} +3 -8
  25. package/src/assets/config/app.config.json +4 -0
  26. package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
  27. package/.github/workflows/pr-validation.yml +0 -87
  28. package/.husky/pre-commit +0 -4
  29. package/angular.json +0 -119
  30. package/eslint.config.cjs +0 -148
  31. package/projects/cat-document-lib/README.md +0 -63
  32. package/projects/cat-document-lib/jest.config.mjs +0 -18
  33. package/projects/cat-document-lib/ng-package.json +0 -11
  34. package/projects/cat-document-lib/package-lock.json +0 -599
  35. package/projects/cat-document-lib/package.json +0 -19
  36. package/projects/cat-document-lib/setup-jest.ts +0 -10
  37. package/projects/cat-document-lib/src/Shared/constant/SHARED.ts +0 -232
  38. package/projects/cat-document-lib/src/Shared/services/app-config.service.spec.ts +0 -16
  39. package/projects/cat-document-lib/src/Shared/services/app-config.service.ts +0 -73
  40. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.html +0 -6
  41. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.scss +0 -0
  42. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.spec.ts +0 -0
  43. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.ts +0 -82
  44. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.html +0 -35
  45. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.scss +0 -12
  46. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.spec.ts +0 -0
  47. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.ts +0 -73
  48. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.html +0 -33
  49. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -22
  50. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -23
  51. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
  52. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.html +0 -56
  53. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.scss +0 -26
  54. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -24
  55. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.ts +0 -184
  56. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.html +0 -244
  57. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -36
  58. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -21
  59. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -125
  60. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.html +0 -46
  61. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.scss +0 -0
  62. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
  63. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.html +0 -2
  64. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
  65. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
  66. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.ts +0 -29
  67. package/projects/cat-document-lib/src/lib/document/document.module.ts +0 -191
  68. package/projects/cat-document-lib/src/lib/document/models/document.model.ts +0 -39
  69. package/projects/cat-document-lib/src/lib/document/services/file-format.service.spec.ts +0 -16
  70. package/projects/cat-document-lib/src/lib/document/services/file-format.service.ts +0 -41
  71. package/projects/cat-document-lib/src/lib/document/state/document.query.ts +0 -23
  72. package/projects/cat-document-lib/src/lib/document/state/document.store.ts +0 -23
  73. package/projects/cat-document-lib/tsconfig.lib.json +0 -15
  74. package/projects/cat-document-lib/tsconfig.lib.prod.json +0 -11
  75. package/projects/cat-document-lib/tsconfig.spec.json +0 -15
  76. package/public/favicon.ico +0 -0
  77. package/src/app/app.component.html +0 -1
  78. package/src/app/app.component.scss +0 -0
  79. package/src/app/app.component.spec.ts +0 -29
  80. package/src/app/app.component.ts +0 -15
  81. package/src/app/app.module.ts +0 -60
  82. package/src/app/app.routing.module.ts +0 -19
  83. package/src/index.html +0 -13
  84. package/src/main.ts +0 -5
  85. package/src/styles.scss +0 -39
  86. package/tsconfig.app.json +0 -15
  87. package/tsconfig.json +0 -32
  88. /package/{projects/cat-document-lib/src → src}/assets/images/FolderImg.png +0 -0
  89. /package/{projects/cat-document-lib/src → src}/assets/images/Frame.png +0 -0
  90. /package/{projects/cat-document-lib/src → src}/assets/images/document.png +0 -0
@@ -0,0 +1,1411 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, Input, EventEmitter, Output, ViewEncapsulation, ViewChild, APP_INITIALIZER, NgModule } from '@angular/core';
3
+ import * as i1$1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import { firstValueFrom, tap, Subscription } from 'rxjs';
6
+ import { __decorate } from 'tslib';
7
+ import { EntityStore, StoreConfig } from '@datorama/akita';
8
+ import * as i1 from '@angular/common/http';
9
+ import { HttpClientModule } from '@angular/common/http';
10
+ import * as i1$2 from 'primeng/accordion';
11
+ import { AccordionModule } from 'primeng/accordion';
12
+ import * as i2 from 'primeng/api';
13
+ import { MessageService } from 'primeng/api';
14
+ import * as i3 from 'primeng/button';
15
+ import { ButtonModule } from 'primeng/button';
16
+ import * as i4$1 from 'primeng/sidebar';
17
+ import { SidebarModule } from 'primeng/sidebar';
18
+ import * as i5$1 from 'primeng/dialog';
19
+ import { DialogModule } from 'primeng/dialog';
20
+ import * as i6 from 'primeng/fileupload';
21
+ import { FileUploadModule } from 'primeng/fileupload';
22
+ import * as i7 from 'primeng/progressbar';
23
+ import { ProgressBarModule } from 'primeng/progressbar';
24
+ import * as i4 from 'primeng/listbox';
25
+ import { ListboxModule } from 'primeng/listbox';
26
+ import * as i5 from 'primeng/checkbox';
27
+ import { CheckboxModule } from 'primeng/checkbox';
28
+ import * as i6$1 from 'primeng/timeline';
29
+ import { TimelineModule } from 'primeng/timeline';
30
+ import * as i7$1 from 'primeng/inputtextarea';
31
+ import { InputTextareaModule } from 'primeng/inputtextarea';
32
+ import * as i8 from '@angular/forms';
33
+ import { FormsModule } from '@angular/forms';
34
+ import * as i9 from 'ng2-pdf-viewer';
35
+ import { PdfViewerModule } from 'ng2-pdf-viewer';
36
+ import { BadgeModule } from 'primeng/badge';
37
+
38
+ /**
39
+ * Class that holds the URLs used throughout the application.
40
+ * These URLs are typically used for making API requests and accessing various resources.
41
+ * @class URLS
42
+ * @typedef {URLS}
43
+ */
44
+ class URLS {
45
+ /**
46
+ * The URL to fetch the application configuration file.
47
+ * This JSON file typically contains settings and options for the application.
48
+ * @static
49
+ * @type {string}
50
+ */
51
+ static CONFIGFILEURL = "assets/config/app.config.json";
52
+ /**
53
+ * The URL endpoint for document uploads.
54
+ * Used to send documents to the server for storage or processing.
55
+ * @static
56
+ * @type {string}
57
+ */
58
+ static DOCUMENT_UPLOAD = "documents";
59
+ /**
60
+ * The query parameter to pass a context ID in API requests.
61
+ * Used to specify the context for certain API calls, such as filtering or scoping the request.
62
+ * @static
63
+ * @type {string}
64
+ */
65
+ static CONTEXT = "?contextId=";
66
+ }
67
+
68
+ /**
69
+ * Creates the initial state for the `DocumentState` store.
70
+ *
71
+ * This function provides default values for all properties in the `DocumentState` interface,
72
+ * ensuring the store starts with a consistent initial structure.
73
+ *
74
+ * @returns {DocumentState} The initial state of the document store.
75
+ */
76
+ function createInitialState() {
77
+ return {
78
+ records: [],
79
+ filteredRecords: [],
80
+ folderId: null,
81
+ isDialogOpen: false,
82
+ };
83
+ }
84
+
85
+ /**
86
+ * Store that manages the state of documents in the application.
87
+ *
88
+ * The `DocumentStore` class extends Akita's `EntityStore` to manage the entity state for documents.
89
+ * It uses the `createInitialState` function to initialize the store with default values and
90
+ * is configured with the name `'documents'`.
91
+ *
92
+ * @extends EntityStore<DocumentState>
93
+ */
94
+ let DocumentStore = class DocumentStore extends EntityStore {
95
+ /**
96
+ * Creates an instance of `DocumentStore` with the initial state of the documents.
97
+ */
98
+ constructor() {
99
+ super(createInitialState());
100
+ }
101
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
102
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, providedIn: 'root' });
103
+ };
104
+ DocumentStore = __decorate([
105
+ StoreConfig({ name: 'documents' })
106
+ ], DocumentStore);
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, decorators: [{
108
+ type: Injectable,
109
+ args: [{ providedIn: 'root' }]
110
+ }], ctorParameters: () => [] });
111
+
112
+ /**
113
+ * Service that handles loading and providing configuration settings for the application.
114
+ * It fetches configuration data from a remote server and exposes various configuration options.
115
+ * @class AppConfigService
116
+ * @typedef {AppConfigService}
117
+ */
118
+ class AppConfigService {
119
+ http;
120
+ /**
121
+ * Holds the configuration data loaded from the server.
122
+ * @private
123
+ * @type {*}
124
+ */
125
+ appConfig;
126
+ /**
127
+ * Creates an instance of AppConfigService.
128
+ * Initializes the HttpClient for making HTTP requests.
129
+ * @class
130
+ * @param {HttpClient} http - The HttpClient service used for making HTTP requests.
131
+ */
132
+ constructor(http) {
133
+ this.http = http;
134
+ }
135
+ /**
136
+ * Loads the application configuration from the server by making an HTTP request to the configuration URL.
137
+ * This method retrieves the configuration data and assigns it to the appConfig property.
138
+ * @async
139
+ * @returns {*}
140
+ */
141
+ async loadAppConfig() {
142
+ try {
143
+ this.appConfig = await firstValueFrom(this.http.get(URLS.CONFIGFILEURL));
144
+ }
145
+ catch (error) {
146
+ throw new Error("Api url is missing.");
147
+ }
148
+ }
149
+ /**
150
+ * Returns the base URL for the API from the loaded configuration.
151
+ * @readonly
152
+ * @type {*}
153
+ */
154
+ get apiBaseUrl() {
155
+ return this.appConfig?.apiUrl;
156
+ }
157
+ /**
158
+ * Returns the local server API URL from the loaded configuration.
159
+ * @readonly
160
+ * @type {*}
161
+ */
162
+ get localServerApi() {
163
+ return this.appConfig?.localServerApi;
164
+ }
165
+ /**
166
+ * Returns the visibility options from the loaded configuration.
167
+ * @readonly
168
+ * @type {*}
169
+ */
170
+ get visibilityOptions() {
171
+ return this.appConfig?.visibilityOption;
172
+ }
173
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
174
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, providedIn: 'root' });
175
+ }
176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, decorators: [{
177
+ type: Injectable,
178
+ args: [{
179
+ providedIn: 'root'
180
+ }]
181
+ }], ctorParameters: () => [{ type: i1.HttpClient }] });
182
+
183
+ /**
184
+ * Service for managing document-related operations.
185
+ * The `DocumentService` acts as a bridge between the application and the backend API for handling document-related data.
186
+ * It interacts with the `DocumentStore` for state management and uses `HttpClient` for making HTTP requests.
187
+ * Creates an instance of `DocumentService`.
188
+ * @param {DocumentStore} documentStore - The store that manages the state of documents.
189
+ * @param {HttpClient} http - The Angular HTTP client for making API requests.
190
+ */
191
+ class DocumentService {
192
+ documentStore;
193
+ http;
194
+ appConfigService;
195
+ /**
196
+ * Creates an instance of DocumentService.
197
+ * @param {DocumentStore} documentStore - Store managing the state of documents.
198
+ * @param {HttpClient} http - Angular HTTP client for making API requests.
199
+ * @param {AppConfigService} appConfigService - Service for retrieving application configuration, such as API base URL.
200
+ */
201
+ constructor(documentStore, http, appConfigService) {
202
+ this.documentStore = documentStore;
203
+ this.http = http;
204
+ this.appConfigService = appConfigService;
205
+ }
206
+ /**
207
+ * Get api url from appConfigService.
208
+ * @readonly
209
+ * @type {string}
210
+ */
211
+ get apiUrl() {
212
+ return this.appConfigService.apiBaseUrl;
213
+ }
214
+ /**
215
+ * Sends a request to create a new document.
216
+ * @param {*} entity - The data of the document to be created.
217
+ * @returns {Observable<any>} Observable that emits the newly created document.
218
+ */
219
+ create(entity) {
220
+ return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}`, entity).pipe(tap((newEntity) => this.documentStore.add(newEntity)));
221
+ }
222
+ /**
223
+ * Fetches all documents from the backend.
224
+ * @returns {Observable<DocumentModel[]>} Observable that emits an array of documents.
225
+ */
226
+ getAll() {
227
+ return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}`).pipe(tap((entities) => this.documentStore.set(entities)));
228
+ }
229
+ /**
230
+ * Fetches a document by its ID.
231
+ * @param {string} id - The unique identifier of the document.
232
+ * @returns {Observable<any>} Observable that emits the retrieved document.
233
+ */
234
+ getById(id) {
235
+ return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(tap((entity) => this.documentStore.upsert(id, entity)));
236
+ }
237
+ /**
238
+ * Updates an existing document by its ID.
239
+ * @param {string} id - The unique identifier of the document.
240
+ * @param {DocumentModel} entity - The updated data of the document.
241
+ * @returns {Observable<DocumentModel>} Observable that emits the updated document.
242
+ */
243
+ update(id, entity) {
244
+ return this.http.put(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`, entity).pipe(tap((updatedEntity) => this.documentStore.update(id, updatedEntity)));
245
+ }
246
+ /**
247
+ * Deletes a document by its ID.
248
+ * @param {string} id - The unique identifier of the document to be deleted.
249
+ * @returns {Observable<void>} Observable that completes when the document is deleted.
250
+ */
251
+ delete(id) {
252
+ return this.http.delete(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(tap(() => this.documentStore.remove(id)));
253
+ }
254
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, deps: [{ token: DocumentStore }, { token: i1.HttpClient }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
255
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, providedIn: 'root' });
256
+ }
257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, decorators: [{
258
+ type: Injectable,
259
+ args: [{ providedIn: 'root' }]
260
+ }], ctorParameters: () => [{ type: DocumentStore }, { type: i1.HttpClient }, { type: AppConfigService }] });
261
+
262
+ /**
263
+ * The `SHARED` class contains shared constants used across the application.
264
+ * These constants are related to document statuses and other shared data.
265
+ */
266
+ class SHARED {
267
+ /**
268
+ * Represents the count of missing files.
269
+ */
270
+ static MISSINGCOUNT = 2;
271
+ /**
272
+ * Represents the count of pending files.
273
+ */
274
+ static PENDINGCOUNT = 3;
275
+ /**
276
+ * Represents an empty string.
277
+ */
278
+ static EMPTY = "";
279
+ /**
280
+ * Represents an true.
281
+ * @static
282
+ * @type {boolean}
283
+ */
284
+ static TRUE = true;
285
+ /**
286
+ * Represents an false.
287
+ * @static
288
+ * @type {boolean}
289
+ */
290
+ static FALSE = false;
291
+ /**
292
+ * Represents an INITIAL_COUNT.
293
+ */
294
+ static INITIAL_COUNT = 0;
295
+ /**
296
+ * Represents an INITIAL_VALUE.
297
+ */
298
+ static INITIAL_VALUE = 0;
299
+ /**
300
+ * Represents the constant value for one (1).
301
+ * @static
302
+ * @type {number}
303
+ */
304
+ static ONE = 1;
305
+ /**
306
+ * Represents the constant value for two (2).
307
+ * @static
308
+ * @type {number}
309
+ */
310
+ static TWO = 2;
311
+ /**
312
+ * Represents the constant value for ten (10).
313
+ * @static
314
+ * @type {number}
315
+ */
316
+ static TEN = 10;
317
+ /**
318
+ * Represents the constant string value 'files' used for file-related operations.
319
+ * @static
320
+ * @type {string}
321
+ */
322
+ static FILE = 'file';
323
+ /**
324
+ * Represents the array of file size units ('B', 'KB', 'MB') used for file size formatting.
325
+ * @static
326
+ * @type {string[]}
327
+ */
328
+ static FILE_SIZE_UNITS = ['B', 'KB', 'MB'];
329
+ /**
330
+ * Show SEVERITY value.
331
+ * @static
332
+ * @type {'error'}
333
+ */
334
+ static SEVERITY = 'error';
335
+ /**
336
+ * Show upload summery if it's failed.
337
+ * @static
338
+ * @type {'Upload Failed'}
339
+ */
340
+ static UPLOAD_SUMMERY = 'Upload Failed';
341
+ /**
342
+ * Represent empty array.
343
+ * @static
344
+ * @type {{}}
345
+ */
346
+ static EMPTY_ARRAY = [];
347
+ /**
348
+ * Represent contextId.
349
+ * @static
350
+ * @type {string}
351
+ */
352
+ static CONTEXT_ID = 'contextId';
353
+ /**
354
+ * Represent fileSize.
355
+ * @static
356
+ * @type {string}
357
+ */
358
+ static FILE_SIZE = 'fileSize';
359
+ }
360
+ /**
361
+ * `DUMMYDOCUMENTLIST` is a mock list of document objects used for testing and development purposes.
362
+ * Each document includes an ID, file name, status, and document URL.
363
+ */
364
+ const DUMMYDOCUMENTLIST = [
365
+ {
366
+ _id: 1,
367
+ fileName: 'Document 1',
368
+ status: 'pending',
369
+ documentUrl: 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf',
370
+ },
371
+ {
372
+ _id: 2,
373
+ fileName: 'Document 2',
374
+ status: 'verified',
375
+ documentUrl: 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf',
376
+ },
377
+ {
378
+ _id: 3,
379
+ fileName: 'Document 3',
380
+ status: 'sentReminder',
381
+ documentUrl: 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf',
382
+ },
383
+ {
384
+ _id: 4,
385
+ fileName: 'Document 4',
386
+ status: 'pending',
387
+ documentUrl: 'https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf',
388
+ },
389
+ ];
390
+ /**
391
+ * `FOLDERPANEL` is a mock list of folder data representing various folders in the application.
392
+ * Each folder contains an ID, file count, text description, missing files count, and pending files count.
393
+ */
394
+ const FOLDERPANEL = [
395
+ {
396
+ _id: 'folder1',
397
+ fileCount: 10,
398
+ text: 'Documents',
399
+ missingFiles: 3,
400
+ pendingFiles: 2,
401
+ },
402
+ {
403
+ _id: 'folder2',
404
+ fileCount: 5,
405
+ text: 'Images',
406
+ missingFiles: 0,
407
+ pendingFiles: 1,
408
+ },
409
+ {
410
+ _id: 'folder3',
411
+ fileCount: 20,
412
+ text: 'Reports',
413
+ missingFiles: 5,
414
+ pendingFiles: 0,
415
+ },
416
+ {
417
+ _id: 'folder4',
418
+ fileCount: 8,
419
+ text: 'Videos',
420
+ missingFiles: 0,
421
+ pendingFiles: 0,
422
+ },
423
+ {
424
+ _id: 'folder5',
425
+ fileCount: 15,
426
+ text: 'Archives',
427
+ missingFiles: 1,
428
+ pendingFiles: 3,
429
+ }
430
+ ];
431
+ /**
432
+ * Dummy data for sumaery.
433
+ * @type {{}}
434
+ */
435
+ const DUMMYSUMMARY = [
436
+ {
437
+ status: 'Valuation report requested on 10th Oct 2024',
438
+ date: '15/10/2020 10:30',
439
+ icon: 'pi pi-shopping-cart',
440
+ color: '#9C27B0',
441
+ image: 'game-controller.jpg',
442
+ },
443
+ {
444
+ status: 'Valuation report received on 13th Oct 2024',
445
+ date: '15/10/2020 14:00',
446
+ icon: 'pi pi-cog',
447
+ color: '#673AB7',
448
+ },
449
+ {
450
+ status: 'Waiting for Valuation Report to be accepted',
451
+ date: '15/10/2020 16:15',
452
+ icon: 'pi pi-shopping-cart',
453
+ color: '#FF9800',
454
+ },
455
+ ];
456
+ /**
457
+ * Dummy data for list box.
458
+ * @type {{}}
459
+ */
460
+ const COUNTRIES = [
461
+ { name: 'Any Word', code: 'NY', checked: false },
462
+ { name: 'Case Sensitive', code: 'RM', checked: false },
463
+ { name: 'Wildcard Search', code: 'LDN', checked: false },
464
+ { name: 'Whole Word Only', code: 'IST', checked: false },
465
+ ];
466
+ /**
467
+ * Default supported image types.
468
+ * @type {{}}
469
+ */
470
+ const SUPPORTED_IMAGE_TYPES = [
471
+ 'image/png'
472
+ ];
473
+
474
+ /**
475
+ * The `FolderBlockComponent` is responsible for displaying a block of folders and
476
+ * providing filtering functionality based on folder IDs.
477
+ *
478
+ * It uses data from the `DocumentStore` and constants from the `SHARED` configuration
479
+ * to display missing and pending file counts.
480
+ */
481
+ class FolderBlockComponent {
482
+ documentStore;
483
+ /**
484
+ * Array of folder blocks data to display.
485
+ * Each folder is represented as a `FolderBlockModel`.
486
+ */
487
+ folderBlocks = [];
488
+ /** Number of missing files, sourced from the `SHARED` constants. */
489
+ missingFileCount = SHARED.MISSINGCOUNT;
490
+ /** Number of pending files, sourced from the `SHARED` constants. */
491
+ pendingFileCount = SHARED.PENDINGCOUNT;
492
+ /**
493
+ * Injects the `DocumentStore` service to manage and access document-related state.
494
+ * @param {DocumentStore} documentStore - The state management store for documents.
495
+ */
496
+ constructor(documentStore) {
497
+ this.documentStore = documentStore;
498
+ }
499
+ /**
500
+ * Handles the click event for filtering based on the provided folder ID.
501
+ * This method validates the folder ID and returns it for further processing.
502
+ * If the folder ID is not provided, an empty string is returned.
503
+ * @param {string} folderBlockId - The unique identifier of the folder to filter by.
504
+ * @returns {string} The validated folder ID, or an empty string if the input is invalid.
505
+ */
506
+ handleClickForFilter(folderBlockId) {
507
+ if (!folderBlockId) {
508
+ return SHARED.EMPTY;
509
+ }
510
+ return folderBlockId;
511
+ }
512
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderBlockComponent, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
513
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: FolderBlockComponent, isStandalone: false, selector: "lib-folder-block", inputs: { folderBlocks: "folderBlocks" }, ngImport: i0, template: "<div class=\"card folder-info my-4\">\r\n <div class=\"text-900 text-xl font-semibold mb-3\">Folders</div>\r\n <div class=\"grid\">\r\n <div *ngFor=\"let folder of folderBlocks\" class=\"col-12 md:col-6 xl:col-4\">\r\n <div\r\n class=\"p-3 border-1 h-full surface-border flex flex-column justify-content-between surface-100 hover:surface-100 cursor-pointer border-round\"\r\n (click)=\"handleClickForFilter(folder._id)\"\r\n >\r\n <div class=\"icon\">\r\n <img src=\"../../../../assets/images/FolderImg.png\" alt=\"\" />\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span class=\"text-600 mt-2\"> {{ folder.fileCount }} Files </span>\r\n <span class=\"text-900 text-lg mt-2 mb-2 font-semibold font-medium\">\r\n {{ folder.text }}\r\n </span>\r\n </div>\r\n <hr />\r\n <div class=\"flex justify-content-between\">\r\n <div class=\"flex flex-column\">\r\n <span>Missing</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-pink-500': missingFileCount > 0,\r\n 'text-green-500': missingFileCount === 0\r\n }\"\r\n >\r\n {{ missingFileCount }}\r\n </span>\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span>Pending</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-yellow-500': pendingFileCount > 0,\r\n 'text-green-500': pendingFileCount === 0\r\n }\"\r\n >\r\n {{ pendingFileCount }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
514
+ }
515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderBlockComponent, decorators: [{
516
+ type: Component,
517
+ args: [{ selector: 'lib-folder-block', standalone: false, template: "<div class=\"card folder-info my-4\">\r\n <div class=\"text-900 text-xl font-semibold mb-3\">Folders</div>\r\n <div class=\"grid\">\r\n <div *ngFor=\"let folder of folderBlocks\" class=\"col-12 md:col-6 xl:col-4\">\r\n <div\r\n class=\"p-3 border-1 h-full surface-border flex flex-column justify-content-between surface-100 hover:surface-100 cursor-pointer border-round\"\r\n (click)=\"handleClickForFilter(folder._id)\"\r\n >\r\n <div class=\"icon\">\r\n <img src=\"../../../../assets/images/FolderImg.png\" alt=\"\" />\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span class=\"text-600 mt-2\"> {{ folder.fileCount }} Files </span>\r\n <span class=\"text-900 text-lg mt-2 mb-2 font-semibold font-medium\">\r\n {{ folder.text }}\r\n </span>\r\n </div>\r\n <hr />\r\n <div class=\"flex justify-content-between\">\r\n <div class=\"flex flex-column\">\r\n <span>Missing</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-pink-500': missingFileCount > 0,\r\n 'text-green-500': missingFileCount === 0\r\n }\"\r\n >\r\n {{ missingFileCount }}\r\n </span>\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span>Pending</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-yellow-500': pendingFileCount > 0,\r\n 'text-green-500': pendingFileCount === 0\r\n }\"\r\n >\r\n {{ pendingFileCount }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
518
+ }], ctorParameters: () => [{ type: DocumentStore }], propDecorators: { folderBlocks: [{
519
+ type: Input
520
+ }] } });
521
+
522
+ /**
523
+ * The `FolderContainerComponent` is responsible for rendering a container
524
+ * that displays a list of documents and associated folder panel data.
525
+ *
526
+ * This component utilizes the `FOLDERPANEL` constant for folder panel data
527
+ * and accepts a document list input of type `DocumentModel`.
528
+ */
529
+ class FolderContainerComponent {
530
+ /**
531
+ * A list of documents passed as input to the component.
532
+ * Represents the document data to be displayed in the folder container.
533
+ */
534
+ documentList;
535
+ /**
536
+ * Folder blocks data, sourced from the `SHARED` constants.
537
+ */
538
+ folderBlocks = FOLDERPANEL;
539
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
540
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList" }, ngImport: i0, template: "\r\n<lib-folder-block [folderBlocks]=\"folderBlocks\"></lib-folder-block>", styles: [""], dependencies: [{ kind: "component", type: FolderBlockComponent, selector: "lib-folder-block", inputs: ["folderBlocks"] }] });
541
+ }
542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderContainerComponent, decorators: [{
543
+ type: Component,
544
+ args: [{ selector: 'lib-folder-container', standalone: false, template: "\r\n<lib-folder-block [folderBlocks]=\"folderBlocks\"></lib-folder-block>" }]
545
+ }], propDecorators: { documentList: [{
546
+ type: Input
547
+ }] } });
548
+
549
+ /**
550
+ * DocumentListItemComponent
551
+ *
552
+ * This component displays individual document items within a list.
553
+ * It accepts a list of documents as input and handles interactions with documents.
554
+ */
555
+ class DocumentListItemComponent {
556
+ /**
557
+ * Emit the selected document.
558
+ * @type {EventEmitter<DocumentModel>}
559
+ */
560
+ documentClick = new EventEmitter();
561
+ /**
562
+ * The document to display.
563
+ * @type {DocumentModel[]}
564
+ */
565
+ document;
566
+ /**
567
+ * Handles interactions with a document.
568
+ * @param {DocumentModel} document - The document to be opened or interacted with.
569
+ */
570
+ handleOpenDocument(document) {
571
+ if (!document) {
572
+ console.error('Error: Document is null or undefined:', document);
573
+ return;
574
+ }
575
+ this.documentClick.emit(document);
576
+ }
577
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
578
+ 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\">\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\">{{ 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() === 'sentreminder'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Sent Reminder \r\n </ng-container>\r\n </span>\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-sentreminder{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
579
+ }
580
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListItemComponent, decorators: [{
581
+ type: Component,
582
+ args: [{ selector: 'lib-document-list-item', standalone: false, template: "<div class=\"grid\">\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\">{{ 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() === 'sentreminder'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Sent Reminder \r\n </ng-container>\r\n </span>\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-sentreminder{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}\n"] }]
583
+ }], propDecorators: { documentClick: [{
584
+ type: Output
585
+ }], document: [{
586
+ type: Input
587
+ }] } });
588
+
589
+ /**
590
+ * Description placeholder
591
+ * @class FileFormatService
592
+ * @typedef {FileFormatService}
593
+ */
594
+ class FileFormatService {
595
+ /**
596
+ * Creates an instance of FileFormatService.
597
+ * @constructor
598
+ */
599
+ constructor() { }
600
+ /**
601
+ * Description placeholder
602
+ * @param {number} bytes
603
+ * @param {PrimeNGConfig} config
604
+ * @returns {string}
605
+ */
606
+ formatFileSize(bytes, config) {
607
+ const kilobyte = 1024;
608
+ const decimalPlaces = SHARED.ONE;
609
+ const sizes = config.translation.fileSizeTypes || SHARED.FILE_SIZE_UNITS;
610
+ if (bytes < kilobyte) {
611
+ return `${bytes} ${sizes[SHARED.INITIAL_COUNT]}`;
612
+ }
613
+ else if (bytes < kilobyte * kilobyte) {
614
+ const kbSize = bytes / kilobyte;
615
+ return `${parseFloat(kbSize.toFixed(decimalPlaces))} ${sizes[SHARED.ONE]}`;
616
+ }
617
+ else {
618
+ const mbSize = bytes / (kilobyte * kilobyte);
619
+ return `${parseFloat(mbSize.toFixed(decimalPlaces))} ${sizes[SHARED.TWO]}`;
620
+ }
621
+ }
622
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FileFormatService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
623
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FileFormatService, providedIn: 'root' });
624
+ }
625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FileFormatService, decorators: [{
626
+ type: Injectable,
627
+ args: [{
628
+ providedIn: 'root'
629
+ }]
630
+ }], ctorParameters: () => [] });
631
+
632
+ /**
633
+ * A component for handling document uploads, including file selection, removal, and progress tracking.
634
+ * @class DocumentUploadComponent
635
+ */
636
+ class DocumentUploadComponent {
637
+ uploadService;
638
+ config;
639
+ fileFormatService;
640
+ messageService;
641
+ cdr;
642
+ /**
643
+ * Represent contextId
644
+ * @type {string}
645
+ */
646
+ contextId = SHARED.EMPTY;
647
+ /**
648
+ * Provide id of file after upload.
649
+ * @type {*}
650
+ */
651
+ onInput = new EventEmitter();
652
+ /**
653
+ * To make file explorer visible.
654
+ * @type {!FileUpload}
655
+ */
656
+ fileUploader;
657
+ fileProgress = new Map();
658
+ /**
659
+ * List of files selected for upload.
660
+ * @type {File[]}
661
+ */
662
+ uploadedFiles = [];
663
+ /**
664
+ * Percentage of the total size calculated for displaying upload progress.
665
+ * @type {number}
666
+ */
667
+ totalSizePercent = SHARED.INITIAL_COUNT;
668
+ /**
669
+ * The current upload progress percentage (SHARED.INITIAL_VALUE-100).
670
+ * @type {number}
671
+ */
672
+ uploadProgress = SHARED.INITIAL_COUNT;
673
+ /**
674
+ * Creates an instance of DocumentUploadComponent.
675
+ * @class
676
+ * @param {DocumentService} uploadService - Service for handling document upload.
677
+ * @param {PrimeNGConfig} config - PrimeNG configuration.
678
+ * @param {FileFormatService} fileFormatService - Service for formatting file sizes.
679
+ * @param {MessageService} messageService - Service for displaying messages.
680
+ * @param {ChangeDetectorRef} cdr - Service for detecting changes.
681
+ */
682
+ constructor(uploadService, config, fileFormatService, messageService, cdr) {
683
+ this.uploadService = uploadService;
684
+ this.config = config;
685
+ this.fileFormatService = fileFormatService;
686
+ this.messageService = messageService;
687
+ this.cdr = cdr;
688
+ }
689
+ /**
690
+ * Open the file explorer.
691
+ * @param {*} event - The triggering event.
692
+ * @param {() => void} callback - A callback function to execute.
693
+ * @returns {void} - No return value.
694
+ */
695
+ choose(event, callback) {
696
+ callback();
697
+ }
698
+ /**
699
+ * Prepares the files for upload by creating a FormData object.
700
+ * This method appends each file to the FormData for submission.
701
+ * @param {File} file - The file to upload.
702
+ * @returns {void}
703
+ */
704
+ handleTemplatedUpload(file) {
705
+ let formData = this.handleCreateFormData(file);
706
+ this.uploadService.create(formData)
707
+ .subscribe({
708
+ /**
709
+ * Handles the successful upload event.
710
+ * Updates the list of uploaded files and emits the file ID.
711
+ * @param {any} event - The event emitted by the upload service on success.
712
+ */
713
+ next: (event) => {
714
+ this.uploadedFiles.push(event);
715
+ this.fileProgress.set(event, 100);
716
+ this.onInput.emit(event._id);
717
+ this.totalSizePercent = 100;
718
+ },
719
+ /**
720
+ * Handles the error event during file upload.
721
+ * Updates the progress of the file to indicate failure.
722
+ * @param {any} error - The error object returned by the upload service.
723
+ */
724
+ error: (error) => {
725
+ this.fileProgress.set(file, SHARED.INITIAL_COUNT);
726
+ this.messageService.add({
727
+ severity: SHARED.SEVERITY,
728
+ summary: SHARED.UPLOAD_SUMMERY,
729
+ detail: error?.message,
730
+ });
731
+ },
732
+ });
733
+ }
734
+ /**
735
+ * Handle the creation of formdata.
736
+ * @param {File} file - The file to append in formdata.
737
+ * @returns {*}
738
+ */
739
+ handleCreateFormData(file) {
740
+ const formData = new FormData();
741
+ formData.append(SHARED.FILE, file, file.name);
742
+ formData.append(SHARED.CONTEXT_ID, this.contextId);
743
+ return formData;
744
+ }
745
+ /**
746
+ * Handles the event when new files are selected.
747
+ * @param { { currentFiles: File[] } } event - The event containing the newly selected files.
748
+ * @returns {void}
749
+ */
750
+ onSelectedFiles(event) {
751
+ event.currentFiles.forEach((file) => {
752
+ this.handleTemplatedUpload(file);
753
+ });
754
+ this.fileUploader.clear();
755
+ }
756
+ /**
757
+ * Formats the given file size in bytes into a readable format (e.g., KB, MB).
758
+ * @param {number} bytes - The size of the file in bytes.
759
+ * @returns {string} The formatted file size (e.g., '1.2 KB', '2.3 MB').
760
+ */
761
+ formatSize(bytes) {
762
+ return this.fileFormatService.formatFileSize(bytes, this.config);
763
+ }
764
+ /**
765
+ * Handles the removal of a file from the uploaded files list.
766
+ * @param {File} file - The file to be removed.
767
+ * @param {number} index - The index of the file in the uploaded files list.
768
+ */
769
+ handleDocumentRemove(file, index) {
770
+ this.uploadedFiles.splice(index, 1);
771
+ this.fileProgress.delete(file);
772
+ this.cdr.detectChanges();
773
+ }
774
+ /**
775
+ * Major progress for the progress bar.
776
+ * @param {File} file - File to check progress for.
777
+ * @returns {number} - The progress percentage for the file.
778
+ */
779
+ getProgress(file) {
780
+ return this.fileProgress.get(file) || SHARED.INITIAL_COUNT;
781
+ }
782
+ /**
783
+ * Triggers the file upload dialog.
784
+ * Opens the file explorer for selecting files.
785
+ * @returns {void}
786
+ */
787
+ triggerFileUpload() {
788
+ this.fileUploader.choose();
789
+ }
790
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadComponent, deps: [{ token: DocumentService }, { token: i2.PrimeNGConfig }, { token: FileFormatService }, { token: i2.MessageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
791
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentUploadComponent, isStandalone: false, selector: "lib-document-upload", inputs: { contextId: "contextId" }, outputs: { onInput: "onInput" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUploader"], descendants: true }], ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"1000000\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let file of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"file.name\" width=\"45\"\r\n height=\"50\" class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ file.fileName }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px;\"></div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\">{{ getProgress(file) }} %\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\" >\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\" (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i3.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: i6.FileUpload, selector: "p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError", "onRemoveUploadedFile"] }, { kind: "component", type: i7.ProgressBar, selector: "p-progressBar", inputs: ["value", "showValue", "styleClass", "style", "unit", "mode", "color"] }], encapsulation: i0.ViewEncapsulation.None });
792
+ }
793
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadComponent, decorators: [{
794
+ type: Component,
795
+ args: [{ selector: 'lib-document-upload', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"1000000\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let file of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"file.name\" width=\"45\"\r\n height=\"50\" class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ file.fileName }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px;\"></div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\">{{ getProgress(file) }} %\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\" >\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\" (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}\n"] }]
796
+ }], ctorParameters: () => [{ type: DocumentService }, { type: i2.PrimeNGConfig }, { type: FileFormatService }, { type: i2.MessageService }, { type: i0.ChangeDetectorRef }], propDecorators: { contextId: [{
797
+ type: Input
798
+ }], onInput: [{
799
+ type: Output
800
+ }], fileUploader: [{
801
+ type: ViewChild,
802
+ args: ['fileUploader']
803
+ }] } });
804
+
805
+ /**
806
+ * Component for viewing and managing document details.
807
+ * @class DocumentViewerComponent
808
+ * @typedef {DocumentViewerComponent}
809
+ * @implements {OnInit}
810
+ */
811
+ class DocumentViewerComponent {
812
+ /**
813
+ * Get the selected document by user.
814
+ * @type {*}
815
+ */
816
+ selectedDocument;
817
+ /**
818
+ * Handle notes data.
819
+ * @type {!string}
820
+ */
821
+ notes;
822
+ /**
823
+ * Country data according to Country model.
824
+ * @type {!Country[]}
825
+ */
826
+ countries;
827
+ /**
828
+ * Indicates whether a checkbox is selected.
829
+ * @type {boolean}
830
+ */
831
+ checked = false;
832
+ /**
833
+ * The currently selected country.
834
+ * @type {Country}
835
+ */
836
+ selectedCountry;
837
+ /**
838
+ * Reference to the dynamic dialog used for displaying additional details.
839
+ * @type {(DynamicDialogRef | undefined)}
840
+ */
841
+ ref;
842
+ /**
843
+ * Indicates whether the document has been verified.
844
+ * @type {boolean}
845
+ */
846
+ isVerified = false;
847
+ /**
848
+ * Additional property details related to the document.
849
+ * @type {any}
850
+ */
851
+ propertyDetails;
852
+ /**
853
+ * List of predefined events used for summaries or alerts.
854
+ * @type {*}
855
+ */
856
+ events = DUMMYSUMMARY;
857
+ /**
858
+ * Data used for displaying alert messages.
859
+ * @type {any}
860
+ */
861
+ alertData;
862
+ /**
863
+ * Initializes a new instance of the DocumentViewerComponent.
864
+ */
865
+ constructor() { }
866
+ /**
867
+ * Lifecycle hook that is called after data-bound properties are initialized.
868
+ * Initializes the list of countries.
869
+ */
870
+ ngOnInit() {
871
+ this.countries = COUNTRIES;
872
+ }
873
+ /**
874
+ * Determines if the given content type is an image.
875
+ * @param {string} contentType - The MIME type of the content.
876
+ * @returns {boolean} `true` if the content type is an image; otherwise, `false`.
877
+ */
878
+ isImage(contentType) {
879
+ return SUPPORTED_IMAGE_TYPES.includes(contentType);
880
+ }
881
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
882
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument" }, ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-between\">\r\n <div class=\"action col-12 p-0 md:col-2 no-grow-no-shrink\">\r\n <p-listbox\r\n [options]=\"countries\"\r\n [filter]=\"true\"\r\n [(ngModel)]=\"selectedCountry\"\r\n optionLabel=\"name\"\r\n [style]=\"{ width: '15rem' }\"\r\n [listStyle]=\"{ 'max-height': '250px' }\"\r\n >\r\n <ng-template let-country pTemplate=\"item\">\r\n <div class=\"flex align-items-center gap-2\">\r\n <p-checkbox\r\n [(ngModel)]=\"country.checked\"\r\n [binary]=\"true\"\r\n [inputId]=\"country.code\"\r\n ></p-checkbox>\r\n <div>{{ country.name }}</div>\r\n </div>\r\n </ng-template>\r\n </p-listbox>\r\n </div>\r\n @if(selectedDocument){\r\n\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument.documentUrl\"\r\n width=\"500\"\r\n height=\"500\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument.contentType == \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument.documentUrl\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 55vw; height: 100vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"left-part col-12 md:col-3 pt-0\">\r\n <div class=\"alerts mb-4 pb-1\">\r\n <button\r\n type=\"button\"\r\n *ngIf=\"\r\n (alertData?.status !== 'Pending' && !!alertData?.status) ||\r\n alertData?.isAlert === false\r\n \"\r\n class=\"bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3\"\r\n >\r\n <i\r\n class=\"pi pi-verified mr-2 cursor-pointer\"\r\n [ngStyle]=\"{\r\n color:\r\n alertData?.status === 'Pending' &&\r\n alertData?.isAlert !== false\r\n ? '#FFFFFF'\r\n : '#8A8EA6'\r\n }\"\r\n style=\"font-size: 20px\"\r\n ></i>\r\n <span class=\"font-semibold text-white\">Verified</span>\r\n </button>\r\n <div\r\n class=\"card mb-0\"\r\n [ngClass]=\"\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? 'alert-card'\r\n : 'success-alert'\r\n \"\r\n >\r\n <div class=\"flex align-items-center mb-2 pb-1\" >\r\n <h4 class=\"mr-3 mt-0 mb-0 text-color font-bold\" style=\"font-size: 21px; font-weight: bold; border-color: rgba(68, 72, 109, 0.2) ;\" >Alerts</h4>\r\n <i\r\n class=\"pi pi-exclamation-triangle\"\r\n style=\"font-size: 20px\"\r\n [ngStyle]=\"{\r\n color:\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? '#FB392D'\r\n : '#8A8EA6'\r\n }\"\r\n ></i>\r\n </div>\r\n <p class=\"text-color mb-0\">{{ alertData?.alertMessage }}</p>\r\n </div>\r\n </div>\r\n <div class=\"summery mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\r\n <div class=\"p-0\" >\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Summary</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\" style=\"border-top-right-radius: 0px;border-top-left-radius: 0px;\" >\r\n <p-timeline [value]=\"events\">\r\n <ng-template pTemplate=\"content\" let-event>\r\n {{ event.status }}\r\n </ng-template>\r\n </p-timeline>\r\n </div>\r\n </div>\r\n <div *ngIf=\"propertyDetails\" class=\"property-details mb-4 pb-1\">\r\n <div class=\"card mb-0\">\r\n <h4 class=\"bold\" style=\"font-size: 21px; font-weight: bold;\">Property Details</h4>\r\n <hr />\r\n <div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\" style=\"font-size: 21px; font-weight: bold;\">Detached House</div>\r\n <div class=\"decription\">\r\n {{ propertyDetails?.PropertyType }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Floors }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Floors</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/badroom.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Bedrooms }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Bedrooms</div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Kitchen }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Kitchen</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex ml-2 md:col-12\">\r\n <div class=\"img mr-2\">\r\n <img src=\"../../../../assets/icons/location.png\" alt=\"\" />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Address }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Address</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"notes card pl-0 pr-0 pt-0\">\r\n <div class=\"card p-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\r\n <div class=\"p-0\" >\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Notes</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0 pt-0\">\r\n <div class=\"textAreaControl mt-3\">\r\n <textarea\r\n rows=\"5\"\r\n cols=\"30\"\r\n pInputTextarea\r\n #textArea\r\n [(ngModel)]=\"notes\"\r\n >\r\n </textarea>\r\n </div>\r\n <div class=\"buttons document-btn-wrapper flex mt-2\">\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Resubmission\"\r\n class=\"p-button-outlined mr-2\"\r\n ></button>\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Accept\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer .p-dialog-header,.document-viewer .p-dialog-content{background-color:#ececf9}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4.Listbox, selector: "p-listbox", inputs: ["id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "ariaLabel", "selectOnFocus", "searchLocale", "focusOnHover", "filterMessage", "filterFields", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "scrollHeight", "tabindex", "multiple", "style", "styleClass", "listStyle", "listStyleClass", "readonly", "disabled", "checkbox", "filter", "filterBy", "filterMatchMode", "filterLocale", "metaKeySelection", "dataKey", "showToggleAll", "optionLabel", "optionValue", "optionGroupChildren", "optionGroupLabel", "optionDisabled", "ariaFilterLabel", "filterPlaceHolder", "emptyFilterMessage", "emptyMessage", "group", "options", "filterValue", "selectAll"], outputs: ["onChange", "onClick", "onDblClick", "onFilter", "onFocus", "onBlur", "onSelectAllChange"] }, { kind: "component", type: i5.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "component", type: i6$1.Timeline, selector: "p-timeline", inputs: ["value", "style", "styleClass", "align", "layout"] }, { kind: "directive", type: i7$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "directive", type: i8.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: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i9.PdfViewerComponent, selector: "pdf-viewer", inputs: ["src", "c-maps-url", "page", "render-text", "render-text-mode", "original-size", "show-all", "stick-to-page", "zoom", "zoom-scale", "rotation", "external-link-target", "autoresize", "fit-to-page", "show-borders"], outputs: ["after-load-complete", "page-rendered", "pages-initialized", "text-layer-rendered", "error", "on-progress", "pageChange"] }], encapsulation: i0.ViewEncapsulation.None });
883
+ }
884
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, decorators: [{
885
+ type: Component,
886
+ args: [{ selector: 'document-viewer', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-between\">\r\n <div class=\"action col-12 p-0 md:col-2 no-grow-no-shrink\">\r\n <p-listbox\r\n [options]=\"countries\"\r\n [filter]=\"true\"\r\n [(ngModel)]=\"selectedCountry\"\r\n optionLabel=\"name\"\r\n [style]=\"{ width: '15rem' }\"\r\n [listStyle]=\"{ 'max-height': '250px' }\"\r\n >\r\n <ng-template let-country pTemplate=\"item\">\r\n <div class=\"flex align-items-center gap-2\">\r\n <p-checkbox\r\n [(ngModel)]=\"country.checked\"\r\n [binary]=\"true\"\r\n [inputId]=\"country.code\"\r\n ></p-checkbox>\r\n <div>{{ country.name }}</div>\r\n </div>\r\n </ng-template>\r\n </p-listbox>\r\n </div>\r\n @if(selectedDocument){\r\n\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument.documentUrl\"\r\n width=\"500\"\r\n height=\"500\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument.contentType == \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument.documentUrl\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 55vw; height: 100vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"left-part col-12 md:col-3 pt-0\">\r\n <div class=\"alerts mb-4 pb-1\">\r\n <button\r\n type=\"button\"\r\n *ngIf=\"\r\n (alertData?.status !== 'Pending' && !!alertData?.status) ||\r\n alertData?.isAlert === false\r\n \"\r\n class=\"bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3\"\r\n >\r\n <i\r\n class=\"pi pi-verified mr-2 cursor-pointer\"\r\n [ngStyle]=\"{\r\n color:\r\n alertData?.status === 'Pending' &&\r\n alertData?.isAlert !== false\r\n ? '#FFFFFF'\r\n : '#8A8EA6'\r\n }\"\r\n style=\"font-size: 20px\"\r\n ></i>\r\n <span class=\"font-semibold text-white\">Verified</span>\r\n </button>\r\n <div\r\n class=\"card mb-0\"\r\n [ngClass]=\"\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? 'alert-card'\r\n : 'success-alert'\r\n \"\r\n >\r\n <div class=\"flex align-items-center mb-2 pb-1\" >\r\n <h4 class=\"mr-3 mt-0 mb-0 text-color font-bold\" style=\"font-size: 21px; font-weight: bold; border-color: rgba(68, 72, 109, 0.2) ;\" >Alerts</h4>\r\n <i\r\n class=\"pi pi-exclamation-triangle\"\r\n style=\"font-size: 20px\"\r\n [ngStyle]=\"{\r\n color:\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? '#FB392D'\r\n : '#8A8EA6'\r\n }\"\r\n ></i>\r\n </div>\r\n <p class=\"text-color mb-0\">{{ alertData?.alertMessage }}</p>\r\n </div>\r\n </div>\r\n <div class=\"summery mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\r\n <div class=\"p-0\" >\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Summary</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\" style=\"border-top-right-radius: 0px;border-top-left-radius: 0px;\" >\r\n <p-timeline [value]=\"events\">\r\n <ng-template pTemplate=\"content\" let-event>\r\n {{ event.status }}\r\n </ng-template>\r\n </p-timeline>\r\n </div>\r\n </div>\r\n <div *ngIf=\"propertyDetails\" class=\"property-details mb-4 pb-1\">\r\n <div class=\"card mb-0\">\r\n <h4 class=\"bold\" style=\"font-size: 21px; font-weight: bold;\">Property Details</h4>\r\n <hr />\r\n <div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\" style=\"font-size: 21px; font-weight: bold;\">Detached House</div>\r\n <div class=\"decription\">\r\n {{ propertyDetails?.PropertyType }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Floors }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Floors</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"feild flex\">\r\n <div class=\"col-12 flex md:col-7\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/badroom.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Bedrooms }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Bedrooms</div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex md:col-5\">\r\n <div class=\"img mr-2\">\r\n <img\r\n src=\"../../../../assets/icons/building-icon.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Kitchen }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Kitchen</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 flex ml-2 md:col-12\">\r\n <div class=\"img mr-2\">\r\n <img src=\"../../../../assets/icons/location.png\" alt=\"\" />\r\n </div>\r\n <div class=\"title\">\r\n <div class=\"title font-bold\">\r\n {{ propertyDetails?.Address }}\r\n </div>\r\n <div class=\"decription\" style=\"font-size: 21px; font-weight: bold;\">Address</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"notes card pl-0 pr-0 pt-0\">\r\n <div class=\"card p-0\" style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;\">\r\n <div class=\"p-0\" >\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Notes</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0 pt-0\">\r\n <div class=\"textAreaControl mt-3\">\r\n <textarea\r\n rows=\"5\"\r\n cols=\"30\"\r\n pInputTextarea\r\n #textArea\r\n [(ngModel)]=\"notes\"\r\n >\r\n </textarea>\r\n </div>\r\n <div class=\"buttons document-btn-wrapper flex mt-2\">\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Resubmission\"\r\n class=\"p-button-outlined mr-2\"\r\n ></button>\r\n <button\r\n pButton\r\n pRipple\r\n type=\"button\"\r\n label=\"Accept\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer .p-dialog-header,.document-viewer .p-dialog-content{background-color:#ececf9}\n"] }]
887
+ }], ctorParameters: () => [], propDecorators: { selectedDocument: [{
888
+ type: Input
889
+ }] } });
890
+
891
+ /**
892
+ * This component is responsible for displaying a list of documents.
893
+ * @class DocumentListComponent
894
+ * @typedef {DocumentListComponent}
895
+ */
896
+ class DocumentListComponent {
897
+ /**
898
+ * Represent contextId
899
+ * @type {string}
900
+ */
901
+ contextId = SHARED.EMPTY;
902
+ selectedDocument;
903
+ /**
904
+ * Default visbility of sidebar
905
+ * @type {boolean}
906
+ */
907
+ isSidebarVisible = SHARED.FALSE;
908
+ /**
909
+ * Default visbility of dialog
910
+ * @type {boolean}
911
+ */
912
+ isdialogVisible = SHARED.FALSE;
913
+ /**
914
+ * The list of documents to display.
915
+ * @type {DocumentModel[]}
916
+ */
917
+ documentList = [];
918
+ /**
919
+ * Handles the click event for file upload.
920
+ * Prevents event propagation and displays the sidebar.
921
+ * @param {MouseEvent} event - The click event triggered by the user.
922
+ */
923
+ handleFileUploadClick(event) {
924
+ event.stopPropagation();
925
+ this.isSidebarVisible = SHARED.TRUE;
926
+ }
927
+ /**
928
+ * Select a individual document.
929
+ * @param {*} docuemnt - The document that was clicked by the user.
930
+ */
931
+ handleClickForDocument(docuemnt) {
932
+ this.isdialogVisible = SHARED.TRUE;
933
+ this.selectedDocument = docuemnt;
934
+ }
935
+ /**
936
+ * Close dialog.
937
+ */
938
+ handleCloseModel() {
939
+ this.selectedDocument = { _id: SHARED.INITIAL_VALUE };
940
+ this.isdialogVisible = SHARED.FALSE;
941
+ }
942
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
943
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", documentList: "documentList" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModel()\" [style]=\"{ width: '100vw' }\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\"></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 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\">\r\n Documents\r\n </span>\r\n <button pButton pRipple class=\"p-button-raised\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\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\">\r\n <div class=\"col-12\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\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%}\n"], dependencies: [{ kind: "component", type: i1$2.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i1$2.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4$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: i5$1.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: DocumentListItemComponent, selector: "lib-document-list-item", inputs: ["document"], outputs: ["documentClick"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"], outputs: ["onInput"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument"] }], encapsulation: i0.ViewEncapsulation.None });
944
+ }
945
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, decorators: [{
946
+ type: Component,
947
+ 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: '100vw' }\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\"></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 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\">\r\n Documents\r\n </span>\r\n <button pButton pRipple class=\"p-button-raised\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\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\">\r\n <div class=\"col-12\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\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%}\n"] }]
948
+ }], propDecorators: { contextId: [{
949
+ type: Input
950
+ }], documentList: [{
951
+ type: Input
952
+ }] } });
953
+
954
+ /**
955
+ *This component is responsible for managing and displaying a list of documents.
956
+ * @class DocumentContainerComponent
957
+ * @typedef {DocumentContainerComponent}
958
+ */
959
+ class DocumentContainerComponent {
960
+ documentService;
961
+ /**
962
+ * Creates an instance of DocumentContainerComponent.
963
+ * @class
964
+ * @param {DocumentService} documentService - Service to manage document-related operations.
965
+ */
966
+ constructor(documentService) {
967
+ this.documentService = documentService;
968
+ }
969
+ /**
970
+ * Get contextId in input.
971
+ * @type {string}
972
+ */
973
+ contextId = "786755";
974
+ /**
975
+ * The list of dummy documents.
976
+ * @type {Array}
977
+ */
978
+ documentList = [];
979
+ /**
980
+ * Holds the subscription to manage observable cleanup.
981
+ * @private
982
+ * @type {Subscription}
983
+ */
984
+ subscription = new Subscription();
985
+ /**
986
+ * Call document service method to get the document by contextId.
987
+ */
988
+ ngOnInit() {
989
+ const documentSubscription = this.documentService
990
+ .getById(`${URLS.CONTEXT}${this.contextId}`)
991
+ .subscribe({
992
+ /**
993
+ * Handles the successful API response.
994
+ * @param {DocumentModel[]} res - The list of documents returned by the API.
995
+ */
996
+ next: (res) => {
997
+ if (res) {
998
+ this.documentList = res;
999
+ }
1000
+ },
1001
+ /**
1002
+ * Handles errors that occur during the API call.
1003
+ * Logs the error to the console.
1004
+ * @param {any} err - The error object returned from the API.
1005
+ */
1006
+ error: (err) => {
1007
+ throw new Error(err);
1008
+ }
1009
+ });
1010
+ this.subscription.add(documentSubscription);
1011
+ }
1012
+ /**
1013
+ * Unsubscribe subscription on destroy of component .
1014
+ */
1015
+ ngOnDestroy() {
1016
+ this.subscription.unsubscribe();
1017
+ }
1018
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentService }], target: i0.ɵɵFactoryTarget.Component });
1019
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div class=\"col-12 md:col-12 lg:col-12 overflow-y-scroll py-0 pl-0\" >\r\n <lib-folder-container [documentList]=\"documentList\"></lib-folder-container>\r\n <lib-document-list [documentList]=\"documentList\"></lib-document-list>\r\n </div>\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "documentList"] }] });
1020
+ }
1021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, decorators: [{
1022
+ type: Component,
1023
+ args: [{ selector: 'lib-document-container', standalone: false, template: "<div class=\"grid m-0\">\r\n <div class=\"col-12 md:col-12 lg:col-12 overflow-y-scroll py-0 pl-0\" >\r\n <lib-folder-container [documentList]=\"documentList\"></lib-folder-container>\r\n <lib-document-list [documentList]=\"documentList\"></lib-document-list>\r\n </div>\r\n</div>" }]
1024
+ }], ctorParameters: () => [{ type: DocumentService }], propDecorators: { contextId: [{
1025
+ type: Input
1026
+ }] } });
1027
+
1028
+ /**
1029
+ * GlobalErrorHandler is a custom error handler that implements the ErrorHandler interface.
1030
+ * It is used to handle both HTTP errors and other types of errors globally in the application.
1031
+ * @class
1032
+ * @implements {ErrorHandler}
1033
+ * @decorator {Injectable}
1034
+ */
1035
+ class GlobalErrorHandler {
1036
+ injector;
1037
+ /**
1038
+ * Creates an instance of GlobalErrorHandler.
1039
+ * @constructor
1040
+ * @param {Injector} injector - The Angular injector used to get instances of services.
1041
+ */
1042
+ constructor(injector) {
1043
+ this.injector = injector;
1044
+ }
1045
+ /**
1046
+ * Handles errors globally in the application.
1047
+ *
1048
+ * @param {any} error - The error object that needs to be handled.
1049
+ * @returns {void}
1050
+ */
1051
+ handleError(error) {
1052
+ console.error('GlobalErrorHandler:', error);
1053
+ }
1054
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: GlobalErrorHandler, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
1055
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: GlobalErrorHandler });
1056
+ }
1057
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: GlobalErrorHandler, decorators: [{
1058
+ type: Injectable
1059
+ }], ctorParameters: () => [{ type: i0.Injector }] });
1060
+
1061
+ /**
1062
+ * @module DocumentModule
1063
+ *
1064
+ * The `DocumentModule` handles the organization and display of document and folder components
1065
+ * in the application. This module is designed to support features like folder containers,
1066
+ * document lists, and individual document items.
1067
+ */
1068
+ class DocumentModule {
1069
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1070
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, declarations: [
1071
+ /**
1072
+ * The main container for managing documents.
1073
+ * DocumentContainerComponent
1074
+ */
1075
+ DocumentContainerComponent,
1076
+ /**
1077
+ * A container component to manage folders.
1078
+ * FolderContainerComponent
1079
+ */
1080
+ FolderContainerComponent,
1081
+ /**
1082
+ * A block component that represents an individual folder.
1083
+ * FolderBlockComponent
1084
+ */
1085
+ FolderBlockComponent,
1086
+ /**
1087
+ * A component to display a list of documents.
1088
+ * DocumentListComponent
1089
+ */
1090
+ DocumentListComponent,
1091
+ /**
1092
+ * A component representing an individual item in the document list.
1093
+ * DocumentListItemComponent
1094
+ */
1095
+ DocumentListItemComponent,
1096
+ /**
1097
+ * A component representing to upload a file.
1098
+ */
1099
+ DocumentUploadComponent,
1100
+ /**
1101
+ * A component representing and allow you to view the document.
1102
+ */
1103
+ DocumentViewerComponent], imports: [
1104
+ /**
1105
+ * Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
1106
+ */
1107
+ CommonModule,
1108
+ /**
1109
+ * PrimeNG AccordionModule is used for creating collapsible sections in the UI.
1110
+ */
1111
+ AccordionModule,
1112
+ /**
1113
+ * HttpClienModule for the http calls
1114
+ */
1115
+ HttpClientModule,
1116
+ /**
1117
+ * PrimeNG ButtonModule is used for creating buttons in the UI.
1118
+ */
1119
+ ButtonModule,
1120
+ /**
1121
+ * PrimeNG SidebarModule is used for creating sidebar in the UI.
1122
+ */
1123
+ SidebarModule,
1124
+ /**
1125
+ * PrimeNG FileUploadModule is used for uploading file.
1126
+ */
1127
+ FileUploadModule,
1128
+ /**
1129
+ * PrimeNG ProgressBarModule is used for showing progress.
1130
+ */
1131
+ ProgressBarModule,
1132
+ /**
1133
+ * PrimeNG BadgeModule is used for showing badge value.
1134
+ */
1135
+ BadgeModule,
1136
+ /**
1137
+ * PrimeNG ListboxModule is used for showing listbox value.
1138
+ */
1139
+ ListboxModule,
1140
+ /**
1141
+ * PrimeNG CheckboxModule is used for showing checkbox value.
1142
+ */
1143
+ CheckboxModule,
1144
+ /**
1145
+ * PrimeNG TimelineModule is used for showing timeline value.
1146
+ */
1147
+ TimelineModule,
1148
+ /**
1149
+ * PrimeNG InputTextareaModule is used for showing textarea value.
1150
+ */
1151
+ InputTextareaModule,
1152
+ /**
1153
+ * FormsModule to handle the forms.
1154
+ */
1155
+ FormsModule,
1156
+ /**
1157
+ * PdfViewerModule to handle and make visible the pdf.
1158
+ */
1159
+ PdfViewerModule,
1160
+ /**
1161
+ * PrimeNG DialogModule is used for showing dialog.
1162
+ */
1163
+ DialogModule], exports: [
1164
+ /**
1165
+ * Exports the `DocumentContainerComponent` to be used in other modules.
1166
+ */
1167
+ DocumentContainerComponent,
1168
+ /**
1169
+ * Exports the `DocumentViewerComponent` to be used in other modules.
1170
+ */
1171
+ DocumentViewerComponent] });
1172
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, providers: [
1173
+ /**
1174
+ * Provide the messageservice to be used in other components.
1175
+ */
1176
+ MessageService,
1177
+ /**
1178
+ * Provide the messageservice to be used in other components.
1179
+ */
1180
+ { provide: GlobalErrorHandler, useClass: GlobalErrorHandler },
1181
+ /**
1182
+ * Initializes the application configuration by loading it from the AppConfigService
1183
+ * before the application starts.
1184
+ * This ensures that the configuration is available for the rest of the app when needed.
1185
+ * The configuration is loaded asynchronously using the APP_INITIALIZER.
1186
+ * @returns {Function} - A function that loads the configuration from the AppConfigService.
1187
+ */
1188
+ {
1189
+ provide: APP_INITIALIZER,
1190
+ /**
1191
+ * This useFactory is executed when the app initializes.
1192
+ */
1193
+ useFactory: (configService) => () => configService.loadAppConfig().catch((error) => {
1194
+ throw new Error(error);
1195
+ }),
1196
+ deps: [AppConfigService],
1197
+ multi: true,
1198
+ }
1199
+ ], imports: [
1200
+ /**
1201
+ * Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
1202
+ */
1203
+ CommonModule,
1204
+ /**
1205
+ * PrimeNG AccordionModule is used for creating collapsible sections in the UI.
1206
+ */
1207
+ AccordionModule,
1208
+ /**
1209
+ * HttpClienModule for the http calls
1210
+ */
1211
+ HttpClientModule,
1212
+ /**
1213
+ * PrimeNG ButtonModule is used for creating buttons in the UI.
1214
+ */
1215
+ ButtonModule,
1216
+ /**
1217
+ * PrimeNG SidebarModule is used for creating sidebar in the UI.
1218
+ */
1219
+ SidebarModule,
1220
+ /**
1221
+ * PrimeNG FileUploadModule is used for uploading file.
1222
+ */
1223
+ FileUploadModule,
1224
+ /**
1225
+ * PrimeNG ProgressBarModule is used for showing progress.
1226
+ */
1227
+ ProgressBarModule,
1228
+ /**
1229
+ * PrimeNG BadgeModule is used for showing badge value.
1230
+ */
1231
+ BadgeModule,
1232
+ /**
1233
+ * PrimeNG ListboxModule is used for showing listbox value.
1234
+ */
1235
+ ListboxModule,
1236
+ /**
1237
+ * PrimeNG CheckboxModule is used for showing checkbox value.
1238
+ */
1239
+ CheckboxModule,
1240
+ /**
1241
+ * PrimeNG TimelineModule is used for showing timeline value.
1242
+ */
1243
+ TimelineModule,
1244
+ /**
1245
+ * PrimeNG InputTextareaModule is used for showing textarea value.
1246
+ */
1247
+ InputTextareaModule,
1248
+ /**
1249
+ * FormsModule to handle the forms.
1250
+ */
1251
+ FormsModule,
1252
+ /**
1253
+ * PdfViewerModule to handle and make visible the pdf.
1254
+ */
1255
+ PdfViewerModule,
1256
+ /**
1257
+ * PrimeNG DialogModule is used for showing dialog.
1258
+ */
1259
+ DialogModule] });
1260
+ }
1261
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, decorators: [{
1262
+ type: NgModule,
1263
+ args: [{
1264
+ declarations: [
1265
+ /**
1266
+ * The main container for managing documents.
1267
+ * DocumentContainerComponent
1268
+ */
1269
+ DocumentContainerComponent,
1270
+ /**
1271
+ * A container component to manage folders.
1272
+ * FolderContainerComponent
1273
+ */
1274
+ FolderContainerComponent,
1275
+ /**
1276
+ * A block component that represents an individual folder.
1277
+ * FolderBlockComponent
1278
+ */
1279
+ FolderBlockComponent,
1280
+ /**
1281
+ * A component to display a list of documents.
1282
+ * DocumentListComponent
1283
+ */
1284
+ DocumentListComponent,
1285
+ /**
1286
+ * A component representing an individual item in the document list.
1287
+ * DocumentListItemComponent
1288
+ */
1289
+ DocumentListItemComponent,
1290
+ /**
1291
+ * A component representing to upload a file.
1292
+ */
1293
+ DocumentUploadComponent,
1294
+ /**
1295
+ * A component representing and allow you to view the document.
1296
+ */
1297
+ DocumentViewerComponent,
1298
+ ],
1299
+ imports: [
1300
+ /**
1301
+ * Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
1302
+ */
1303
+ CommonModule,
1304
+ /**
1305
+ * PrimeNG AccordionModule is used for creating collapsible sections in the UI.
1306
+ */
1307
+ AccordionModule,
1308
+ /**
1309
+ * HttpClienModule for the http calls
1310
+ */
1311
+ HttpClientModule,
1312
+ /**
1313
+ * PrimeNG ButtonModule is used for creating buttons in the UI.
1314
+ */
1315
+ ButtonModule,
1316
+ /**
1317
+ * PrimeNG SidebarModule is used for creating sidebar in the UI.
1318
+ */
1319
+ SidebarModule,
1320
+ /**
1321
+ * PrimeNG FileUploadModule is used for uploading file.
1322
+ */
1323
+ FileUploadModule,
1324
+ /**
1325
+ * PrimeNG ProgressBarModule is used for showing progress.
1326
+ */
1327
+ ProgressBarModule,
1328
+ /**
1329
+ * PrimeNG BadgeModule is used for showing badge value.
1330
+ */
1331
+ BadgeModule,
1332
+ /**
1333
+ * PrimeNG ListboxModule is used for showing listbox value.
1334
+ */
1335
+ ListboxModule,
1336
+ /**
1337
+ * PrimeNG CheckboxModule is used for showing checkbox value.
1338
+ */
1339
+ CheckboxModule,
1340
+ /**
1341
+ * PrimeNG TimelineModule is used for showing timeline value.
1342
+ */
1343
+ TimelineModule,
1344
+ /**
1345
+ * PrimeNG InputTextareaModule is used for showing textarea value.
1346
+ */
1347
+ InputTextareaModule,
1348
+ /**
1349
+ * FormsModule to handle the forms.
1350
+ */
1351
+ FormsModule,
1352
+ /**
1353
+ * PdfViewerModule to handle and make visible the pdf.
1354
+ */
1355
+ PdfViewerModule,
1356
+ /**
1357
+ * PrimeNG DialogModule is used for showing dialog.
1358
+ */
1359
+ DialogModule
1360
+ ],
1361
+ exports: [
1362
+ /**
1363
+ * Exports the `DocumentContainerComponent` to be used in other modules.
1364
+ */
1365
+ DocumentContainerComponent,
1366
+ /**
1367
+ * Exports the `DocumentViewerComponent` to be used in other modules.
1368
+ */
1369
+ DocumentViewerComponent
1370
+ ],
1371
+ providers: [
1372
+ /**
1373
+ * Provide the messageservice to be used in other components.
1374
+ */
1375
+ MessageService,
1376
+ /**
1377
+ * Provide the messageservice to be used in other components.
1378
+ */
1379
+ { provide: GlobalErrorHandler, useClass: GlobalErrorHandler },
1380
+ /**
1381
+ * Initializes the application configuration by loading it from the AppConfigService
1382
+ * before the application starts.
1383
+ * This ensures that the configuration is available for the rest of the app when needed.
1384
+ * The configuration is loaded asynchronously using the APP_INITIALIZER.
1385
+ * @returns {Function} - A function that loads the configuration from the AppConfigService.
1386
+ */
1387
+ {
1388
+ provide: APP_INITIALIZER,
1389
+ /**
1390
+ * This useFactory is executed when the app initializes.
1391
+ */
1392
+ useFactory: (configService) => () => configService.loadAppConfig().catch((error) => {
1393
+ throw new Error(error);
1394
+ }),
1395
+ deps: [AppConfigService],
1396
+ multi: true,
1397
+ }
1398
+ ]
1399
+ }]
1400
+ }] });
1401
+
1402
+ /*
1403
+ * Public API Surface of cat-document-lib
1404
+ */
1405
+
1406
+ /**
1407
+ * Generated bundle index. Do not edit.
1408
+ */
1409
+
1410
+ export { DocumentContainerComponent, DocumentModule, DocumentViewerComponent };
1411
+ //# sourceMappingURL=cat-documents-ng.mjs.map