cat-documents-ng 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{src/Shared/constant/ERROR.ts → Shared/constant/ERROR.d.ts} +43 -38
- package/Shared/constant/PERMISSIONS.d.ts +20 -0
- package/Shared/constant/SHARED.d.ts +215 -0
- package/{src/Shared/constant/URLS.ts → Shared/constant/URLS.d.ts} +60 -65
- package/Shared/services/app-config.service.d.ts +51 -0
- package/{src/Shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +27 -29
- package/Shared/services/session.service.d.ts +46 -0
- package/fesm2022/cat-documents-ng.mjs +2623 -0
- package/fesm2022/cat-documents-ng.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/document/components/document-container/document-container.component.d.ts +101 -0
- package/lib/document/components/document-list/document-list.component.d.ts +193 -0
- package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
- package/lib/document/components/document-upload/document-upload.component.d.ts +120 -0
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +77 -0
- package/{src/lib/document/components/folder-block/folder-block.component.ts → lib/document/components/folder-block/folder-block.component.d.ts} +37 -53
- package/lib/document/components/folder-container/folder-container.component.d.ts +29 -0
- package/lib/document/components/linked-document/linked-document.component.d.ts +38 -0
- package/lib/document/directives/document.directive.d.ts +20 -0
- package/lib/document/directives/permission.directive.d.ts +38 -0
- package/lib/document/document.module.d.ts +40 -0
- package/{src/lib/document/models/document-alert.model.ts → lib/document/models/document-alert.model.d.ts} +38 -45
- package/lib/document/models/document-type.model.d.ts +37 -0
- package/lib/document/models/document.model.d.ts +44 -0
- package/{src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +29 -35
- package/lib/document/services/document-http.service.d.ts +69 -0
- package/lib/document/services/document-upload.service.d.ts +67 -0
- package/lib/document/services/document.service.d.ts +20 -0
- package/lib/document/services/file-format.service.d.ts +23 -0
- package/lib/document/state/document.query.d.ts +50 -0
- package/{src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +64 -95
- package/{src/lib/document/state/document.state.ts → lib/document/state/document.state.d.ts} +36 -52
- package/lib/document/state/document.store.d.ts +29 -0
- package/package.json +25 -20
- package/{src/public-api.ts → public-api.d.ts} +6 -10
- package/ng-package.json +0 -11
- package/src/Shared/constant/PERMISSIONS.ts +0 -16
- package/src/Shared/constant/SHARED.ts +0 -312
- package/src/Shared/services/app-config.service.spec.ts +0 -19
- package/src/Shared/services/app-config.service.ts +0 -73
- package/src/Shared/services/session.service.spec.ts +0 -16
- package/src/Shared/services/session.service.ts +0 -76
- package/src/assets/config/api.config.json +0 -20
- package/src/lib/document/components/document-container/document-container.component.html +0 -14
- package/src/lib/document/components/document-container/document-container.component.scss +0 -8
- package/src/lib/document/components/document-container/document-container.component.spec.ts +0 -110
- package/src/lib/document/components/document-container/document-container.component.ts +0 -173
- package/src/lib/document/components/document-list/document-list.component.html +0 -81
- package/src/lib/document/components/document-list/document-list.component.scss +0 -82
- package/src/lib/document/components/document-list/document-list.component.spec.ts +0 -96
- package/src/lib/document/components/document-list/document-list.component.ts +0 -244
- package/src/lib/document/components/document-list-item/document-list-item.component.html +0 -36
- package/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -34
- package/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -75
- package/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
- package/src/lib/document/components/document-upload/document-upload.component.html +0 -56
- package/src/lib/document/components/document-upload/document-upload.component.scss +0 -32
- package/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -95
- package/src/lib/document/components/document-upload/document-upload.component.ts +0 -162
- package/src/lib/document/components/document-viewer/document-viewer.component.html +0 -98
- package/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -54
- package/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -79
- package/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -106
- package/src/lib/document/components/folder-block/folder-block.component.html +0 -46
- package/src/lib/document/components/folder-block/folder-block.component.scss +0 -9
- package/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -70
- package/src/lib/document/components/folder-container/folder-container.component.html +0 -2
- package/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
- package/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -27
- package/src/lib/document/components/folder-container/folder-container.component.ts +0 -37
- package/src/lib/document/components/linked-document/linked-document.component.html +0 -23
- package/src/lib/document/components/linked-document/linked-document.component.scss +0 -10
- package/src/lib/document/components/linked-document/linked-document.component.spec.ts +0 -61
- package/src/lib/document/components/linked-document/linked-document.component.ts +0 -49
- package/src/lib/document/directives/document.directive.ts +0 -32
- package/src/lib/document/directives/permission.directive.spec.ts +0 -0
- package/src/lib/document/directives/permission.directive.ts +0 -66
- package/src/lib/document/document.module.ts +0 -241
- package/src/lib/document/models/document-type.model.ts +0 -44
- package/src/lib/document/models/document.model.ts +0 -53
- package/src/lib/document/services/document-http.service.spec.ts +0 -119
- package/src/lib/document/services/document-http.service.ts +0 -125
- package/src/lib/document/services/document-upload.service.spec.ts +0 -99
- package/src/lib/document/services/document-upload.service.ts +0 -127
- package/src/lib/document/services/document.service.ts +0 -29
- package/src/lib/document/services/file-format.service.spec.ts +0 -16
- package/src/lib/document/services/file-format.service.ts +0 -41
- package/src/lib/document/state/document.query.ts +0 -52
- package/src/lib/document/state/document.store.ts +0 -51
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { ElementRef, EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { DocumentModel } from '../../models/document.model';
|
|
3
|
+
import { DocumentHttpService } from '../../services/document-http.service';
|
|
4
|
+
import { DocumentUploadService } from '../../services/document-upload.service';
|
|
5
|
+
import { Message } from 'primeng/api';
|
|
6
|
+
import { DocumentQuery } from '../../state/document.query';
|
|
7
|
+
import { DocumentStore } from '../../state/document.store';
|
|
8
|
+
import { PERMISSIONS } from '../../../../Shared/constant/PERMISSIONS';
|
|
9
|
+
import { SessionService } from '../../../../Shared/services/session.service';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
/**
|
|
12
|
+
* This component is responsible for displaying and managing a list of documents.
|
|
13
|
+
* Provides functionality for file upload, document selection, and dialog management.
|
|
14
|
+
* @class DocumentListComponent
|
|
15
|
+
*/
|
|
16
|
+
export declare class DocumentListComponent implements OnInit {
|
|
17
|
+
documentUploadService: DocumentUploadService;
|
|
18
|
+
documentHttpService: DocumentHttpService;
|
|
19
|
+
documentQuery: DocumentQuery;
|
|
20
|
+
documentStore: DocumentStore;
|
|
21
|
+
private sessionService;
|
|
22
|
+
onRefresh: EventEmitter<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Represents the context ID for the document list.
|
|
25
|
+
* This value is passed from the parent component.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof DocumentListComponent
|
|
28
|
+
*/
|
|
29
|
+
contextId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Default visibility of the upload button.
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
* @memberof DocumentListComponent
|
|
34
|
+
*/
|
|
35
|
+
isUploadButtonVisible: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The currently selected document.
|
|
38
|
+
* @type {DocumentModel}
|
|
39
|
+
* @memberof DocumentListComponent
|
|
40
|
+
*/
|
|
41
|
+
selectedDocument: DocumentModel;
|
|
42
|
+
/**
|
|
43
|
+
* Default visibility of the sidebar.
|
|
44
|
+
* @type {boolean}
|
|
45
|
+
* @memberof DocumentListComponent
|
|
46
|
+
*/
|
|
47
|
+
isSidebarVisible: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Default visibility of the Accordion.
|
|
50
|
+
* @type {boolean}
|
|
51
|
+
* @memberof DocumentListComponent
|
|
52
|
+
*/
|
|
53
|
+
isCollapsed: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Default visibility of the messages.
|
|
56
|
+
* @type {Message[]}
|
|
57
|
+
* @memberof DocumentListComponent
|
|
58
|
+
*/
|
|
59
|
+
messages: Message[];
|
|
60
|
+
/**
|
|
61
|
+
* Default visibility of the dialog.
|
|
62
|
+
* @type {boolean}
|
|
63
|
+
* @memberof DocumentListComponent
|
|
64
|
+
*/
|
|
65
|
+
isdialogVisible: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The list of documents to display.
|
|
68
|
+
* This value is passed from the parent component.
|
|
69
|
+
* @type {DocumentModel[]}
|
|
70
|
+
* @memberof DocumentListComponent
|
|
71
|
+
*/
|
|
72
|
+
documentList: DocumentModel[];
|
|
73
|
+
/**
|
|
74
|
+
* The name of the document being uploaded or managed.
|
|
75
|
+
* @type {string}
|
|
76
|
+
* @memberof DocumentListComponent
|
|
77
|
+
*/
|
|
78
|
+
documentName: string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Available document types for selection.
|
|
81
|
+
* @type {string[]}
|
|
82
|
+
* @memberof DocumentListComponent
|
|
83
|
+
*/
|
|
84
|
+
options: any[];
|
|
85
|
+
/**
|
|
86
|
+
* The selected option for the document type.
|
|
87
|
+
* @type {(string | null)}
|
|
88
|
+
* @memberof DocumentListComponent
|
|
89
|
+
*/
|
|
90
|
+
selectedOption: string | null;
|
|
91
|
+
/**
|
|
92
|
+
* The set of permissions available for this component.
|
|
93
|
+
*/
|
|
94
|
+
PERMISSION: typeof PERMISSIONS;
|
|
95
|
+
/**
|
|
96
|
+
* The file name associated with the document.
|
|
97
|
+
* It may be undefined until a file is selected or loaded.
|
|
98
|
+
* @type {string | undefined}
|
|
99
|
+
*/
|
|
100
|
+
documentStatus: string | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Indicates whether the user has permission to upload or modify documents.
|
|
103
|
+
* The exact type depends on the access control implementation.
|
|
104
|
+
* @type {any}
|
|
105
|
+
*/
|
|
106
|
+
hasDocumentPutAccess: any;
|
|
107
|
+
/**
|
|
108
|
+
* Error message related to the file name, if validation fails.
|
|
109
|
+
* @type {string}
|
|
110
|
+
*/
|
|
111
|
+
fileNameError: string;
|
|
112
|
+
/**
|
|
113
|
+
* Extension of the selected document file (e.g., .pdf, .docx).
|
|
114
|
+
* @type {string}
|
|
115
|
+
*/
|
|
116
|
+
documentExtension: string;
|
|
117
|
+
/**
|
|
118
|
+
* Regular expression to match disallowed characters in file names.
|
|
119
|
+
* Prevents characters like < > : " / \ | ? *
|
|
120
|
+
* @type {RegExp}
|
|
121
|
+
*/
|
|
122
|
+
disallowedCharsRegex: RegExp;
|
|
123
|
+
/**
|
|
124
|
+
* Reference to the file input element used for uploading documents.
|
|
125
|
+
* @type {ElementRef<HTMLInputElement>}
|
|
126
|
+
*/
|
|
127
|
+
fileInput: ElementRef<HTMLInputElement>;
|
|
128
|
+
/**
|
|
129
|
+
* Creates an instance of DocumentListComponent.
|
|
130
|
+
* @class
|
|
131
|
+
* @param {DocumentUploadService} documentUploadService - The service responsible for uploading documents.
|
|
132
|
+
* @param {DocumentHttpService} documentHttpService - The service responsible for fetching documents from the server.
|
|
133
|
+
* @param {DocumentQuery} documentQuery - The service responsible for geting stored documents.
|
|
134
|
+
* @param {DocumentStore} documentStore - The service responsible for storing documents.
|
|
135
|
+
*/
|
|
136
|
+
constructor(documentUploadService: DocumentUploadService, documentHttpService: DocumentHttpService, documentQuery: DocumentQuery, documentStore: DocumentStore, sessionService: SessionService);
|
|
137
|
+
/**
|
|
138
|
+
* Initializes the component by fetching the document type list.
|
|
139
|
+
*/
|
|
140
|
+
ngOnInit(): void;
|
|
141
|
+
handleUpdatedDocument(document: DocumentModel): void;
|
|
142
|
+
/**
|
|
143
|
+
* Handles the click event for file upload.
|
|
144
|
+
* Prevents event propagation and displays the sidebar.
|
|
145
|
+
* @param {MouseEvent} event - The click event triggered by the user.
|
|
146
|
+
* @memberof DocumentListComponent
|
|
147
|
+
*/
|
|
148
|
+
handleFileUploadClick(event: MouseEvent): void;
|
|
149
|
+
/**
|
|
150
|
+
* Handles the selection of an individual document.
|
|
151
|
+
* Opens a dialog to display or manage the selected document.
|
|
152
|
+
* @param {DocumentModel} document - The document that was clicked by the user.
|
|
153
|
+
* @memberof DocumentListComponent
|
|
154
|
+
*/
|
|
155
|
+
handleClickForDocument(document: DocumentModel): void;
|
|
156
|
+
/**
|
|
157
|
+
* Handles the save click event to update the document's file name.
|
|
158
|
+
* This method creates a payload with the updated file name and calls the
|
|
159
|
+
* updateDocumentName() method from the documentHttpService. On a successful update,
|
|
160
|
+
* it logs a message with the document's ID.
|
|
161
|
+
* @returns {void}
|
|
162
|
+
*/
|
|
163
|
+
handleSaveClick(): void;
|
|
164
|
+
/**
|
|
165
|
+
* Closes the dialog and resets the selected document.
|
|
166
|
+
* @memberof DocumentListComponent
|
|
167
|
+
*/
|
|
168
|
+
handleCloseModal(): void;
|
|
169
|
+
/**
|
|
170
|
+
* Handles changes to the document name input field.
|
|
171
|
+
* - Updates the `documentName` property.
|
|
172
|
+
* - Validates for disallowed characters and sets appropriate error messages.
|
|
173
|
+
* - Dynamically adjusts the width of the input field based on the content using a hidden span element.
|
|
174
|
+
* @param {Event} event - The input change event triggered when the user types in the document name field.
|
|
175
|
+
*/
|
|
176
|
+
onDocumentNameChange(event: Event): void;
|
|
177
|
+
/**
|
|
178
|
+
* Handles the upload action for a document.
|
|
179
|
+
* Validates if a document type is selected and logs the result.
|
|
180
|
+
* @memberof DocumentListComponent
|
|
181
|
+
*/
|
|
182
|
+
handleUploadDocument(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Fetches the list of document types from the server.
|
|
185
|
+
* Updates the options array with the available document types.
|
|
186
|
+
* @memberof DocumentListComponent
|
|
187
|
+
* @returns {void}
|
|
188
|
+
*/
|
|
189
|
+
getDocumentTypeList(): void;
|
|
190
|
+
handleOpenSideBar(isVisible: boolean): void;
|
|
191
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListComponent, never>;
|
|
192
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "lib-document-list", never, { "contextId": { "alias": "contextId"; "required": false; }; "isUploadButtonVisible": { "alias": "isUploadButtonVisible"; "required": false; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, { "onRefresh": "onRefresh"; }, never, ["*"], false, never>;
|
|
193
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { DocumentModel } from '../../models/document.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* DocumentListItemComponent
|
|
6
|
+
*
|
|
7
|
+
* This component displays individual document items within a list.
|
|
8
|
+
* It accepts a list of documents as input and handles interactions with documents.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DocumentListItemComponent {
|
|
11
|
+
/**
|
|
12
|
+
* Emit the selected document.
|
|
13
|
+
* @type {EventEmitter<DocumentModel>}
|
|
14
|
+
*/
|
|
15
|
+
documentClick: EventEmitter<DocumentModel>;
|
|
16
|
+
/**
|
|
17
|
+
* The document to display.
|
|
18
|
+
* @type {DocumentModel[]}
|
|
19
|
+
*/
|
|
20
|
+
document: DocumentModel;
|
|
21
|
+
/**
|
|
22
|
+
* Handles interactions with a document.
|
|
23
|
+
* @param {DocumentModel} document - The document to be opened or interacted with.
|
|
24
|
+
*/
|
|
25
|
+
handleOpenDocument(document: DocumentModel): void;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListItemComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListItemComponent, "lib-document-list-item", never, { "document": { "alias": "document"; "required": false; }; }, { "documentClick": "documentClick"; }, never, never, false, never>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { FileUpload } from 'primeng/fileupload';
|
|
3
|
+
import { MessageService } from 'primeng/api';
|
|
4
|
+
import { PrimeNGConfig } from 'primeng/api';
|
|
5
|
+
import { FileFormatService } from '../../services/file-format.service';
|
|
6
|
+
import { DocumentService } from '../../state/document.service';
|
|
7
|
+
import { DocumentUploadService } from '../../services/document-upload.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* A component for handling document uploads, including file selection, removal, and progress tracking.
|
|
11
|
+
* @class DocumentUploadComponent
|
|
12
|
+
*/
|
|
13
|
+
export declare class DocumentUploadComponent {
|
|
14
|
+
documentUpload: DocumentUploadService;
|
|
15
|
+
uploadService: DocumentService;
|
|
16
|
+
private config;
|
|
17
|
+
fileFormatService: FileFormatService;
|
|
18
|
+
messageService: MessageService;
|
|
19
|
+
cdr: ChangeDetectorRef;
|
|
20
|
+
/**
|
|
21
|
+
* Represents the file size.
|
|
22
|
+
* @type {number}
|
|
23
|
+
*/
|
|
24
|
+
fileSize: string;
|
|
25
|
+
/**
|
|
26
|
+
* Represent contextId
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
contextId: string;
|
|
30
|
+
/**
|
|
31
|
+
* To make file explorer visible.
|
|
32
|
+
* @type {!FileUpload}
|
|
33
|
+
*/
|
|
34
|
+
fileUploader: FileUpload;
|
|
35
|
+
fileProgress: Map<File, number>;
|
|
36
|
+
/**
|
|
37
|
+
* List of files selected for upload.
|
|
38
|
+
* @type {File[]}
|
|
39
|
+
*/
|
|
40
|
+
uploadedFiles: {
|
|
41
|
+
file: File;
|
|
42
|
+
formattedSize: string;
|
|
43
|
+
progress: number;
|
|
44
|
+
}[];
|
|
45
|
+
/**
|
|
46
|
+
* Percentage of the total size calculated for displaying upload progress.
|
|
47
|
+
* @type {number}
|
|
48
|
+
*/
|
|
49
|
+
totalSizePercent: number;
|
|
50
|
+
/**
|
|
51
|
+
* The current upload progress percentage (SHARED.INITIAL_VALUE-100).
|
|
52
|
+
* @type {number}
|
|
53
|
+
*/
|
|
54
|
+
uploadProgress: number;
|
|
55
|
+
/**
|
|
56
|
+
* Creates an instance of DocumentUploadComponent.
|
|
57
|
+
* @class
|
|
58
|
+
* @param {DocumentUploadService} documentUpload - Service for handling document upload.
|
|
59
|
+
* @param {DocumentService} uploadService - Service for handling document upload.
|
|
60
|
+
* @param {PrimeNGConfig} config - PrimeNG configuration.
|
|
61
|
+
* @param {FileFormatService} fileFormatService - Service for formatting file sizes.
|
|
62
|
+
* @param {MessageService} messageService - Service for displaying messages.
|
|
63
|
+
* @param {ChangeDetectorRef} cdr - Service for detecting changes.
|
|
64
|
+
*/
|
|
65
|
+
constructor(documentUpload: DocumentUploadService, uploadService: DocumentService, config: PrimeNGConfig, fileFormatService: FileFormatService, messageService: MessageService, cdr: ChangeDetectorRef);
|
|
66
|
+
/**
|
|
67
|
+
* Open the file explorer.
|
|
68
|
+
* @param {*} event - The triggering event.
|
|
69
|
+
* @param {() => void} callback - A callback function to execute.
|
|
70
|
+
* @returns {void} - No return value.
|
|
71
|
+
*/
|
|
72
|
+
choose(event: any, callback: () => void): void;
|
|
73
|
+
/**
|
|
74
|
+
* Prepares the files for upload by creating a FormData object.
|
|
75
|
+
* This method appends each file to the FormData for submission.
|
|
76
|
+
* @param {File} file - The file to upload.
|
|
77
|
+
* @returns {void}
|
|
78
|
+
*/
|
|
79
|
+
handleTemplatedUpload(file: File): void;
|
|
80
|
+
/**
|
|
81
|
+
* Handle the creation of formdata.
|
|
82
|
+
* @param {File} file - The file to append in formdata.
|
|
83
|
+
* @returns {*} - The formdata object.
|
|
84
|
+
*/
|
|
85
|
+
handleCreateFormData(file: File): FormData;
|
|
86
|
+
/**
|
|
87
|
+
* Handles the event when new files are selected.
|
|
88
|
+
* @param { { currentFiles: File[] } } event - The event containing the newly selected files.
|
|
89
|
+
* @returns {void} - No return value.
|
|
90
|
+
*/
|
|
91
|
+
onSelectedFiles(event: {
|
|
92
|
+
currentFiles: File[];
|
|
93
|
+
}): void;
|
|
94
|
+
/**
|
|
95
|
+
* Formats the given file size in bytes into a readable format (e.g., KB, MB).
|
|
96
|
+
* @param {number} bytes - The size of the file in bytes.
|
|
97
|
+
* @returns {string} The formatted file size (e.g., '1.2 KB', '2.3 MB').
|
|
98
|
+
*/
|
|
99
|
+
formatSize(bytes: number): void;
|
|
100
|
+
/**
|
|
101
|
+
* Handles the removal of a file from the uploaded files list.
|
|
102
|
+
* @param {File} file - The file to be removed.
|
|
103
|
+
* @param {number} index - The index of the file in the uploaded files list.
|
|
104
|
+
*/
|
|
105
|
+
handleDocumentRemove(file: File, index: number): void;
|
|
106
|
+
/**
|
|
107
|
+
* Major progress for the progress bar.
|
|
108
|
+
* @param {File} file - File to check progress for.
|
|
109
|
+
* @returns {number} - The progress percentage for the file.
|
|
110
|
+
*/
|
|
111
|
+
getProgress(file: File): number;
|
|
112
|
+
/**
|
|
113
|
+
* Triggers the file upload dialog.
|
|
114
|
+
* Opens the file explorer for selecting files.
|
|
115
|
+
* @returns {void}
|
|
116
|
+
*/
|
|
117
|
+
triggerFileUpload(): void;
|
|
118
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadComponent, never>;
|
|
119
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentUploadComponent, "lib-document-upload", never, { "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
|
|
120
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, OnDestroy } from '@angular/core';
|
|
2
|
+
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
3
|
+
import { DocumentHttpService } from '../../services/document-http.service';
|
|
4
|
+
import { DocumentModel } from '../../models/document.model';
|
|
5
|
+
import { DocumentService } from '../../services/document.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Component for viewing and managing document details.
|
|
9
|
+
* @class DocumentViewerComponent
|
|
10
|
+
* @typedef {DocumentViewerComponent}
|
|
11
|
+
*/
|
|
12
|
+
export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
|
|
13
|
+
documentHttpService: DocumentHttpService;
|
|
14
|
+
private documentService;
|
|
15
|
+
/**
|
|
16
|
+
* Get the selected document by user.
|
|
17
|
+
* @type {*}
|
|
18
|
+
*/
|
|
19
|
+
selectedDocument?: DocumentModel;
|
|
20
|
+
/**
|
|
21
|
+
* Get the selected document by user.
|
|
22
|
+
* @type {*}
|
|
23
|
+
*/
|
|
24
|
+
documentList?: DocumentModel[];
|
|
25
|
+
/**
|
|
26
|
+
* Indicates whether a checkbox is selected.
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
*/
|
|
29
|
+
checked: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Reference to the dynamic dialog used for displaying additional details.
|
|
32
|
+
* @type {(DynamicDialogRef | undefined)}
|
|
33
|
+
*/
|
|
34
|
+
ref: DynamicDialogRef | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Indicates whether the document has been verified.
|
|
37
|
+
* @type {boolean}
|
|
38
|
+
*/
|
|
39
|
+
isVerified: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Data used for displaying alert messages.
|
|
42
|
+
* @type {any}
|
|
43
|
+
*/
|
|
44
|
+
alertData: any;
|
|
45
|
+
/**
|
|
46
|
+
* Emits the updated document after changes like upload, rename, or replace.
|
|
47
|
+
* @type {EventEmitter<DocumentModel>}
|
|
48
|
+
*/
|
|
49
|
+
updatedDocument: EventEmitter<DocumentModel>;
|
|
50
|
+
/**
|
|
51
|
+
* Holds the subscription to manage observable cleanup.
|
|
52
|
+
* @private
|
|
53
|
+
* @type {Subscription}
|
|
54
|
+
*/
|
|
55
|
+
private subscription;
|
|
56
|
+
/**
|
|
57
|
+
* Initializes a new instance of the DocumentViewerComponent.
|
|
58
|
+
* @param {DocumentHttpService} documentHttpService - Handle the http service.
|
|
59
|
+
* @param {DocumentService} documentService - Handle the states.
|
|
60
|
+
*/
|
|
61
|
+
constructor(documentHttpService: DocumentHttpService, documentService: DocumentService);
|
|
62
|
+
/**
|
|
63
|
+
* Fetches the alerts for the selected document.
|
|
64
|
+
* @returns {void}
|
|
65
|
+
*/
|
|
66
|
+
ngOnChanges(): void;
|
|
67
|
+
handleSelectedDocument(document: DocumentModel): void;
|
|
68
|
+
/**
|
|
69
|
+
* Determines if the given content type is an image.
|
|
70
|
+
* @param {string | undefined} contentType - The MIME type of the content.
|
|
71
|
+
* @returns {boolean} `true` if the content type is an image; otherwise, `false`.
|
|
72
|
+
*/
|
|
73
|
+
isImage(contentType?: string): boolean;
|
|
74
|
+
ngOnDestroy(): void;
|
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentViewerComponent, never>;
|
|
76
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentViewerComponent, "document-viewer", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, { "updatedDocument": "updatedDocument"; }, never, ["[action-launcher]", "*"], false, never>;
|
|
77
|
+
}
|
|
@@ -1,53 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Handles the click event for filtering based on the provided folder ID.
|
|
40
|
-
* This method validates the folder ID and returns it for further processing.
|
|
41
|
-
* If the folder ID is not provided, an empty string is returned.
|
|
42
|
-
* @param {string} folderBlockId - The unique identifier of the folder to filter by.
|
|
43
|
-
* @returns {string} The validated folder ID, or an empty string if the input is invalid.
|
|
44
|
-
*/
|
|
45
|
-
handleClickForFilter(folderBlockId: string): string {
|
|
46
|
-
if (!folderBlockId) {
|
|
47
|
-
return SHARED.EMPTY;
|
|
48
|
-
}
|
|
49
|
-
this.documentStore.setParentDocumentTypeId(folderBlockId);
|
|
50
|
-
return folderBlockId;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
}
|
|
1
|
+
import { DocumentStore } from '../../state/document.store';
|
|
2
|
+
import { FolderBlockModel } from '../../models/folder.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* The `FolderBlockComponent` is responsible for displaying a block of folders and
|
|
6
|
+
* providing filtering functionality based on folder IDs.
|
|
7
|
+
*
|
|
8
|
+
* It uses data from the `DocumentStore` and constants from the `SHARED` configuration
|
|
9
|
+
* to display missing and pending file counts.
|
|
10
|
+
*/
|
|
11
|
+
export declare class FolderBlockComponent {
|
|
12
|
+
documentStore: DocumentStore;
|
|
13
|
+
/**
|
|
14
|
+
* Array of folder blocks data to display.
|
|
15
|
+
* Each folder is represented as a `FolderBlockModel`.
|
|
16
|
+
*/
|
|
17
|
+
folderList: FolderBlockModel[];
|
|
18
|
+
/** Number of missing files, sourced from the `SHARED` constants. */
|
|
19
|
+
missingFileCount: number;
|
|
20
|
+
/** Number of pending files, sourced from the `SHARED` constants. */
|
|
21
|
+
pendingFileCount: number;
|
|
22
|
+
/**
|
|
23
|
+
* Injects the `DocumentStore` service to manage and access document-related state.
|
|
24
|
+
* @param {DocumentStore} documentStore - The state management store for documents.
|
|
25
|
+
*/
|
|
26
|
+
constructor(documentStore: DocumentStore);
|
|
27
|
+
/**
|
|
28
|
+
* Handles the click event for filtering based on the provided folder ID.
|
|
29
|
+
* This method validates the folder ID and returns it for further processing.
|
|
30
|
+
* If the folder ID is not provided, an empty string is returned.
|
|
31
|
+
* @param {string} folderBlockId - The unique identifier of the folder to filter by.
|
|
32
|
+
* @returns {string} The validated folder ID, or an empty string if the input is invalid.
|
|
33
|
+
*/
|
|
34
|
+
handleClickForFilter(folderBlockId: any): string;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FolderBlockComponent, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FolderBlockComponent, "lib-folder-block", never, { "folderList": { "alias": "folderList"; "required": false; }; }, {}, never, never, false, never>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DocumentModel } from '../../models/document.model';
|
|
2
|
+
import { FolderBlockModel } from '../../models/folder.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* The `FolderContainerComponent` is responsible for rendering a container
|
|
6
|
+
* that displays a list of documents and associated folder panel data.
|
|
7
|
+
*
|
|
8
|
+
* This component utilizes the `FOLDERPANEL` constant for folder panel data
|
|
9
|
+
* and accepts a document list input of type `DocumentModel`.
|
|
10
|
+
*/
|
|
11
|
+
export declare class FolderContainerComponent {
|
|
12
|
+
/**
|
|
13
|
+
* A list of documents passed as input to the component.
|
|
14
|
+
* Represents the document data to be displayed in the folder container.
|
|
15
|
+
*/
|
|
16
|
+
documentList?: DocumentModel[];
|
|
17
|
+
/**
|
|
18
|
+
* A list of documents passed as input to the component.
|
|
19
|
+
* Represents the document data to be displayed in the folder container.
|
|
20
|
+
*/
|
|
21
|
+
folderList: FolderBlockModel[];
|
|
22
|
+
/**
|
|
23
|
+
* The context ID for the folder container.
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
contextId: string;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FolderContainerComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FolderContainerComponent, "lib-folder-container", never, { "documentList": { "alias": "documentList"; "required": false; }; "folderList": { "alias": "folderList"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { DocumentModel } from '../../models/document.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Description placeholder
|
|
6
|
+
* @class LinkedDocumentComponent
|
|
7
|
+
* @typedef {LinkedDocumentComponent}
|
|
8
|
+
* @implements {OnChanges}
|
|
9
|
+
*/
|
|
10
|
+
export declare class LinkedDocumentComponent {
|
|
11
|
+
/**
|
|
12
|
+
* Selected document for view.
|
|
13
|
+
* @type {?DocumentModel}
|
|
14
|
+
*/
|
|
15
|
+
selectedDocument?: DocumentModel;
|
|
16
|
+
/**
|
|
17
|
+
* Whole document list.
|
|
18
|
+
* @type {?DocumentModel[]}
|
|
19
|
+
*/
|
|
20
|
+
documentList?: DocumentModel[];
|
|
21
|
+
/**
|
|
22
|
+
* Changed selected document.
|
|
23
|
+
* @type {*}
|
|
24
|
+
*/
|
|
25
|
+
selectedDocumentChange: EventEmitter<DocumentModel>;
|
|
26
|
+
/**
|
|
27
|
+
* Filtered documents.
|
|
28
|
+
* @type {DocumentModel[]}
|
|
29
|
+
*/
|
|
30
|
+
filteredDocuments: DocumentModel[];
|
|
31
|
+
/**
|
|
32
|
+
* Handle the click on the document.
|
|
33
|
+
* @param {DocumentModel} document - Clicked document.
|
|
34
|
+
*/
|
|
35
|
+
handleDocumentClick(document: DocumentModel): void;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LinkedDocumentComponent, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LinkedDocumentComponent, "app-linked-document", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, { "selectedDocumentChange": "selectedDocumentChange"; }, never, never, false, never>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TemplateRef, ViewContainerRef } from "@angular/core";
|
|
2
|
+
import { DocumentService } from "../services/document.service";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Directive to display the document data
|
|
6
|
+
*/
|
|
7
|
+
export declare class DocumentDirective {
|
|
8
|
+
private documentService;
|
|
9
|
+
private templateRef;
|
|
10
|
+
private vcr;
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of DocumentDirective.
|
|
13
|
+
* @param documentService Service to get the document data.
|
|
14
|
+
* @param templateRef Reference to the template.
|
|
15
|
+
* @param vcr View container reference to manage the view.
|
|
16
|
+
*/
|
|
17
|
+
constructor(documentService: DocumentService, templateRef: TemplateRef<any>, vcr: ViewContainerRef);
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentDirective, never>;
|
|
19
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DocumentDirective, "[doc]", never, {}, {}, never, never, false, never>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ElementRef, Renderer2, SimpleChanges, OnChanges } from '@angular/core';
|
|
2
|
+
import { SessionService } from '../../../Shared/services/session.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Directive to conditionally show or hide elements based on user permissions.
|
|
6
|
+
* @class HasPermissionDirective
|
|
7
|
+
* @typedef {HasPermissionDirective}
|
|
8
|
+
*/
|
|
9
|
+
export declare class HasPermissionDirective implements OnChanges {
|
|
10
|
+
private el;
|
|
11
|
+
private renderer;
|
|
12
|
+
sessionService: SessionService;
|
|
13
|
+
/**
|
|
14
|
+
* The required permission(s) to display the element.
|
|
15
|
+
* Accepts a single string or an array of strings.
|
|
16
|
+
* @type {string | string[]}
|
|
17
|
+
*/
|
|
18
|
+
permission?: string | string[];
|
|
19
|
+
/**
|
|
20
|
+
* Creates an instance of HasPermissionDirective.
|
|
21
|
+
* @param {ElementRef} el - Reference to the host element.
|
|
22
|
+
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
23
|
+
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
24
|
+
*/
|
|
25
|
+
constructor(el: ElementRef, renderer: Renderer2, sessionService: SessionService);
|
|
26
|
+
/**
|
|
27
|
+
* Lifecycle hook that is called when input properties change.
|
|
28
|
+
* @param {SimpleChanges} changes - The changes in input properties.
|
|
29
|
+
*/
|
|
30
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
31
|
+
/**
|
|
32
|
+
* Checks if the user has the required permission(s).
|
|
33
|
+
* Hides the element if the permission is not found.
|
|
34
|
+
*/
|
|
35
|
+
private checkPermission;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HasPermissionDirective, never>;
|
|
37
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HasPermissionDirective, "[permission]", never, { "permission": { "alias": "permission"; "required": false; }; }, {}, never, never, false, never>;
|
|
38
|
+
}
|