cat-documents-ng 0.1.31 → 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/Shared/constant/ERROR.d.ts +7 -0
- package/Shared/constant/PERMISSIONS.d.ts +6 -0
- package/Shared/constant/SHARED.d.ts +6 -0
- package/fesm2022/cat-documents-ng.mjs +276 -113
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-container/document-container.component.d.ts +14 -2
- package/lib/document/components/document-list/document-list.component.d.ts +42 -4
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +7 -2
- package/lib/document/components/folder-block/folder-block.component.d.ts +1 -1
- package/lib/document/state/document.query.d.ts +10 -0
- package/lib/document/state/document.store.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { DocumentService } from '../../state/document.service';
|
|
3
3
|
import { DocumentModel } from '../../models/document.model';
|
|
4
|
+
import { Subject } from 'rxjs';
|
|
4
5
|
import { FolderBlockModel } from '../../models/folder.model';
|
|
5
6
|
import { DocumentHttpService } from '../../services/document-http.service';
|
|
6
7
|
import { DocumentQuery } from '../../state/document.query';
|
|
@@ -44,6 +45,17 @@ export declare class DocumentContainerComponent implements OnInit {
|
|
|
44
45
|
* @type {boolean}
|
|
45
46
|
*/
|
|
46
47
|
isUploadButtonVisible: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Emits the document selected by the user.
|
|
50
|
+
* @type {EventEmitter<DocumentModel>}
|
|
51
|
+
*/
|
|
52
|
+
selectedDocument: EventEmitter<DocumentModel>;
|
|
53
|
+
/**
|
|
54
|
+
* Subject used to clean up subscriptions when the component is destroyed.
|
|
55
|
+
* Helps prevent memory leaks in observables.
|
|
56
|
+
* @type {Subject<void>}
|
|
57
|
+
*/
|
|
58
|
+
destroy$: Subject<void>;
|
|
47
59
|
/**
|
|
48
60
|
* The list of documents.
|
|
49
61
|
* @type {Array}
|
|
@@ -85,5 +97,5 @@ export declare class DocumentContainerComponent implements OnInit {
|
|
|
85
97
|
*/
|
|
86
98
|
ngOnDestroy(): void;
|
|
87
99
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentContainerComponent, never>;
|
|
88
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContainerComponent, "lib-document-container", never, { "contextId": { "alias": "contextId"; "required": false; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; }; "showFolderList": { "alias": "showFolderList"; "required": false; }; "isUploadButtonVisible": { "alias": "isUploadButtonVisible"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
100
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContainerComponent, "lib-document-container", never, { "contextId": { "alias": "contextId"; "required": false; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; }; "showFolderList": { "alias": "showFolderList"; "required": false; }; "isUploadButtonVisible": { "alias": "isUploadButtonVisible"; "required": false; }; }, { "selectedDocument": "selectedDocument"; }, never, ["*"], false, never>;
|
|
89
101
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter, OnInit } from '@angular/core';
|
|
1
|
+
import { ElementRef, EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { DocumentModel } from '../../models/document.model';
|
|
3
3
|
import { DocumentHttpService } from '../../services/document-http.service';
|
|
4
4
|
import { DocumentUploadService } from '../../services/document-upload.service';
|
|
@@ -6,6 +6,7 @@ import { Message } from 'primeng/api';
|
|
|
6
6
|
import { DocumentQuery } from '../../state/document.query';
|
|
7
7
|
import { DocumentStore } from '../../state/document.store';
|
|
8
8
|
import { PERMISSIONS } from '../../../../Shared/constant/PERMISSIONS';
|
|
9
|
+
import { SessionService } from '../../../../Shared/services/session.service';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
/**
|
|
11
12
|
* This component is responsible for displaying and managing a list of documents.
|
|
@@ -17,6 +18,7 @@ export declare class DocumentListComponent implements OnInit {
|
|
|
17
18
|
documentHttpService: DocumentHttpService;
|
|
18
19
|
documentQuery: DocumentQuery;
|
|
19
20
|
documentStore: DocumentStore;
|
|
21
|
+
private sessionService;
|
|
20
22
|
onRefresh: EventEmitter<any>;
|
|
21
23
|
/**
|
|
22
24
|
* Represents the context ID for the document list.
|
|
@@ -73,7 +75,7 @@ export declare class DocumentListComponent implements OnInit {
|
|
|
73
75
|
* @type {string}
|
|
74
76
|
* @memberof DocumentListComponent
|
|
75
77
|
*/
|
|
76
|
-
documentName: string;
|
|
78
|
+
documentName: string | undefined;
|
|
77
79
|
/**
|
|
78
80
|
* Available document types for selection.
|
|
79
81
|
* @type {string[]}
|
|
@@ -95,7 +97,34 @@ export declare class DocumentListComponent implements OnInit {
|
|
|
95
97
|
* It may be undefined until a file is selected or loaded.
|
|
96
98
|
* @type {string | undefined}
|
|
97
99
|
*/
|
|
98
|
-
|
|
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>;
|
|
99
128
|
/**
|
|
100
129
|
* Creates an instance of DocumentListComponent.
|
|
101
130
|
* @class
|
|
@@ -104,11 +133,12 @@ export declare class DocumentListComponent implements OnInit {
|
|
|
104
133
|
* @param {DocumentQuery} documentQuery - The service responsible for geting stored documents.
|
|
105
134
|
* @param {DocumentStore} documentStore - The service responsible for storing documents.
|
|
106
135
|
*/
|
|
107
|
-
constructor(documentUploadService: DocumentUploadService, documentHttpService: DocumentHttpService, documentQuery: DocumentQuery, documentStore: DocumentStore);
|
|
136
|
+
constructor(documentUploadService: DocumentUploadService, documentHttpService: DocumentHttpService, documentQuery: DocumentQuery, documentStore: DocumentStore, sessionService: SessionService);
|
|
108
137
|
/**
|
|
109
138
|
* Initializes the component by fetching the document type list.
|
|
110
139
|
*/
|
|
111
140
|
ngOnInit(): void;
|
|
141
|
+
handleUpdatedDocument(document: DocumentModel): void;
|
|
112
142
|
/**
|
|
113
143
|
* Handles the click event for file upload.
|
|
114
144
|
* Prevents event propagation and displays the sidebar.
|
|
@@ -136,6 +166,14 @@ export declare class DocumentListComponent implements OnInit {
|
|
|
136
166
|
* @memberof DocumentListComponent
|
|
137
167
|
*/
|
|
138
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;
|
|
139
177
|
/**
|
|
140
178
|
* Handles the upload action for a document.
|
|
141
179
|
* Validates if a document type is selected and logs the result.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnChanges, OnDestroy } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnChanges, OnDestroy } from '@angular/core';
|
|
2
2
|
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
3
3
|
import { DocumentHttpService } from '../../services/document-http.service';
|
|
4
4
|
import { DocumentModel } from '../../models/document.model';
|
|
@@ -42,6 +42,11 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
|
|
|
42
42
|
* @type {any}
|
|
43
43
|
*/
|
|
44
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>;
|
|
45
50
|
/**
|
|
46
51
|
* Holds the subscription to manage observable cleanup.
|
|
47
52
|
* @private
|
|
@@ -68,5 +73,5 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
|
|
|
68
73
|
isImage(contentType?: string): boolean;
|
|
69
74
|
ngOnDestroy(): void;
|
|
70
75
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentViewerComponent, never>;
|
|
71
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentViewerComponent, "document-viewer", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, {}, never, ["*"], false, 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>;
|
|
72
77
|
}
|
|
@@ -31,7 +31,7 @@ export declare class FolderBlockComponent {
|
|
|
31
31
|
* @param {string} folderBlockId - The unique identifier of the folder to filter by.
|
|
32
32
|
* @returns {string} The validated folder ID, or an empty string if the input is invalid.
|
|
33
33
|
*/
|
|
34
|
-
handleClickForFilter(folderBlockId:
|
|
34
|
+
handleClickForFilter(folderBlockId: any): string;
|
|
35
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<FolderBlockComponent, never>;
|
|
36
36
|
static ɵcmp: i0.ɵɵComponentDeclaration<FolderBlockComponent, "lib-folder-block", never, { "folderList": { "alias": "folderList"; "required": false; }; }, {}, never, never, false, never>;
|
|
37
37
|
}
|
|
@@ -35,6 +35,16 @@ export declare class DocumentQuery extends QueryEntity<DocumentState> {
|
|
|
35
35
|
* @returns {Observable<DocumentModel[]>} Observable that emits the documets.
|
|
36
36
|
*/
|
|
37
37
|
selectDocumets(): Observable<DocumentModel[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves the currently selected document from the store state.
|
|
40
|
+
* @returns {Observable<any>} Observable that emits the selected document.
|
|
41
|
+
*/
|
|
42
|
+
getSelectedDocument(): Observable<any>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves the flag indicating whether a document has been updated.
|
|
45
|
+
* @returns {Observable<any>} Observable that emits a boolean or status flag.
|
|
46
|
+
*/
|
|
47
|
+
getIsDocumentUpdated(): Observable<any>;
|
|
38
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentQuery, never>;
|
|
39
49
|
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentQuery>;
|
|
40
50
|
}
|
|
@@ -22,6 +22,8 @@ export declare class DocumentStore extends EntityStore<DocumentState> {
|
|
|
22
22
|
setParentDocumentTypeId(parentDocumentTypeId: string): void;
|
|
23
23
|
setMessage(message: Message[]): void;
|
|
24
24
|
setDocumentList(documents: DocumentModel[]): void;
|
|
25
|
+
setSelectedDocument(selectedDocument: any): void;
|
|
26
|
+
setIsDocumentUpdated(isDocumentUpdated: any): void;
|
|
25
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentStore, never>;
|
|
26
28
|
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentStore>;
|
|
27
29
|
}
|