cat-documents-ng 0.2.98 → 0.2.99
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/README.md +322 -322
- package/Shared/constant/SHARED.d.ts +5 -0
- package/fesm2022/cat-documents-ng.mjs +159 -123
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-container/document-container.component.d.ts +3 -1
- package/lib/document/components/document-list/document-list.component.d.ts +42 -6
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +1 -0
- package/lib/document/services/document-http.service.d.ts +3 -3
- package/lib/document/services/document-list.service.d.ts +6 -0
- package/lib/document/services/document-menu.service.d.ts +18 -6
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnInit, OnDestroy, OnChanges, SimpleChanges, ElementRef } from '@angular/core';
|
|
1
|
+
import { OnInit, OnDestroy, OnChanges, SimpleChanges, ElementRef, EventEmitter } from '@angular/core';
|
|
2
2
|
import { Subscription } from 'rxjs';
|
|
3
3
|
import { DocumentHttpService } from '../../services/document-http.service';
|
|
4
4
|
import { DocumentQuery } from '../../state/document.query';
|
|
@@ -46,6 +46,7 @@ export declare class DocumentContainerComponent implements OnInit, OnDestroy, On
|
|
|
46
46
|
* Reference to the content scroll container
|
|
47
47
|
*/
|
|
48
48
|
contentScrollContainer: ElementRef;
|
|
49
|
+
selectedDocument: EventEmitter<any>;
|
|
49
50
|
/**
|
|
50
51
|
* Subscription to track selected menu item changes
|
|
51
52
|
*/
|
|
@@ -142,6 +143,7 @@ export declare class DocumentContainerComponent implements OnInit, OnDestroy, On
|
|
|
142
143
|
* Sets up subscription to listen for filtered document responses
|
|
143
144
|
*/
|
|
144
145
|
setupFilteredDocumentSubscription(): void;
|
|
146
|
+
onDocumentSelected(document: any): void;
|
|
145
147
|
/**
|
|
146
148
|
* Unsubscribe subscription on destroy of component and clean up state.
|
|
147
149
|
*/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { OnInit, OnDestroy, OnChanges, SimpleChanges, ElementRef, AfterViewInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges, ElementRef, AfterViewInit } from '@angular/core';
|
|
2
2
|
import { DocumentListItem, DocumentListResponse } from '../../models/document-list-response.model';
|
|
3
3
|
import { TableData } from '../../../../Shared/components/table-primary/table-primary.model';
|
|
4
4
|
import { DocumentListService } from '../../services/document-list.service';
|
|
5
5
|
import { Message } from 'primeng/api';
|
|
6
|
+
import { DocumentHttpService } from '../../services/document-http.service';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
/**
|
|
8
9
|
* This component is responsible for displaying and managing a list of documents.
|
|
@@ -11,6 +12,7 @@ import * as i0 from "@angular/core";
|
|
|
11
12
|
*/
|
|
12
13
|
export declare class DocumentListComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
|
|
13
14
|
private documentListService;
|
|
15
|
+
private documentHttpService;
|
|
14
16
|
/**
|
|
15
17
|
* Represents the context ID for the document list.
|
|
16
18
|
* This value is passed from the parent component.
|
|
@@ -110,7 +112,29 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
|
|
|
110
112
|
* Completion counts for each category
|
|
111
113
|
*/
|
|
112
114
|
categoryCompletionCounts: string[];
|
|
115
|
+
/**
|
|
116
|
+
* Message to display for document deletion
|
|
117
|
+
*/
|
|
113
118
|
deleteMessage: Message[];
|
|
119
|
+
/**
|
|
120
|
+
* The name of the document being edited
|
|
121
|
+
*/
|
|
122
|
+
documentName: string;
|
|
123
|
+
/**
|
|
124
|
+
* Error message for invalid file names.
|
|
125
|
+
*/
|
|
126
|
+
fileNameError: string;
|
|
127
|
+
/**
|
|
128
|
+
* The file extension of the document being edited
|
|
129
|
+
*/
|
|
130
|
+
documentExtension: string;
|
|
131
|
+
handleSelectedDocument: EventEmitter<DocumentListItem>;
|
|
132
|
+
/**
|
|
133
|
+
* Regular expression to match disallowed characters in file names.
|
|
134
|
+
* Prevents characters like < > : " / \ | ? *
|
|
135
|
+
* @type {RegExp}
|
|
136
|
+
*/
|
|
137
|
+
disallowedCharsRegex: RegExp;
|
|
114
138
|
/**
|
|
115
139
|
* Getter to format category labels with proper suffix
|
|
116
140
|
*/
|
|
@@ -120,7 +144,7 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
|
|
|
120
144
|
* @class
|
|
121
145
|
* @param {DocumentListService} documentListService - The service responsible for document list operations.
|
|
122
146
|
*/
|
|
123
|
-
constructor(documentListService: DocumentListService);
|
|
147
|
+
constructor(documentListService: DocumentListService, documentHttpService: DocumentHttpService);
|
|
124
148
|
/**
|
|
125
149
|
* Handles changes to input properties
|
|
126
150
|
*/
|
|
@@ -174,22 +198,34 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
|
|
|
174
198
|
* Scrolls to the category section using navigationInfo
|
|
175
199
|
* @param navigationInfo - The navigation info object containing menuItemId
|
|
176
200
|
*/
|
|
177
|
-
|
|
201
|
+
scrollToCategorySectionWithNavigationInfo(navigationInfo: {
|
|
202
|
+
menuItemId: string;
|
|
203
|
+
menuItemLabel: string;
|
|
204
|
+
categoryLabel: string;
|
|
205
|
+
categoryIndex: number;
|
|
206
|
+
}): void;
|
|
178
207
|
/**
|
|
179
208
|
* Adds a temporary highlight effect to the scrolled category
|
|
180
209
|
* @param categoryElement - The DOM element of the category to highlight
|
|
181
210
|
*/
|
|
182
|
-
|
|
211
|
+
highlightCategory(categoryElement: HTMLElement): void;
|
|
183
212
|
/**
|
|
184
213
|
* Alternative scrolling method using IntersectionObserver for better performance
|
|
185
214
|
* This method can be used as a fallback or alternative to the current approach
|
|
186
215
|
* @param navigationInfo - The navigation info object
|
|
187
216
|
*/
|
|
188
|
-
|
|
217
|
+
scrollToCategorySectionWithIntersectionObserver(navigationInfo: {
|
|
218
|
+
menuItemId: string;
|
|
219
|
+
menuItemLabel: string;
|
|
220
|
+
categoryLabel: string;
|
|
221
|
+
categoryIndex: number;
|
|
222
|
+
}): void;
|
|
223
|
+
onDocumentNameChange(event: Event): void;
|
|
224
|
+
handleSaveClick(): void;
|
|
189
225
|
/**
|
|
190
226
|
* Cleanup subscriptions on component destroy
|
|
191
227
|
*/
|
|
192
228
|
ngOnDestroy(): void;
|
|
193
229
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListComponent, never>;
|
|
194
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "lib-document-list", never, { "contextId": { "alias": "contextId"; "required": false; }; "documentListResponse": { "alias": "documentListResponse"; "required": false; }; "selectedMenuItemId": { "alias": "selectedMenuItemId"; "required": false; }; "navigationInfo": { "alias": "navigationInfo"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
230
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "lib-document-list", never, { "contextId": { "alias": "contextId"; "required": false; }; "documentListResponse": { "alias": "documentListResponse"; "required": false; }; "selectedMenuItemId": { "alias": "selectedMenuItemId"; "required": false; }; "navigationInfo": { "alias": "navigationInfo"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, { "handleSelectedDocument": "handleSelectedDocument"; }, never, ["*"], false, never>;
|
|
195
231
|
}
|
|
@@ -43,6 +43,7 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges {
|
|
|
43
43
|
/**
|
|
44
44
|
* Gets the categories to use for the menu
|
|
45
45
|
* Priority: Store categories > Input categories
|
|
46
|
+
* Categories and menu items are sorted alphabetically
|
|
46
47
|
*/
|
|
47
48
|
get categories(): DocumentCategory[];
|
|
48
49
|
/**
|
|
@@ -51,19 +51,19 @@ export declare class DocumentHttpService {
|
|
|
51
51
|
* Fetches a document by its path name and transforms the response for dropdown options.
|
|
52
52
|
* Includes error handling for failed API requests.
|
|
53
53
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
54
|
-
|
|
54
|
+
*/
|
|
55
55
|
/**
|
|
56
56
|
* Fetches a document by its path name and transforms the response for dropdown options.
|
|
57
57
|
* @param {string} documentId - The document ID to fetch the document.
|
|
58
58
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
59
|
-
|
|
59
|
+
*/
|
|
60
60
|
getAlertsByDocumentID(documentId: string): Observable<DocumentAlertModel>;
|
|
61
61
|
/**
|
|
62
62
|
* Fetches a document by its folder ID and transforms the response for dropdown options.
|
|
63
63
|
* @param {string} folderId - The folder ID to fetch the document.
|
|
64
64
|
* @param {string} contextId - The context ID to fetch the document.
|
|
65
65
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
66
|
-
|
|
66
|
+
*/
|
|
67
67
|
getDocumentByFolderID(folderId: string, contextId: string): Observable<DocumentModel[]>;
|
|
68
68
|
/**
|
|
69
69
|
* Updates the name of a document.
|
|
@@ -36,6 +36,12 @@ export declare class DocumentListService {
|
|
|
36
36
|
* Get approved document count for a category
|
|
37
37
|
*/
|
|
38
38
|
getApprovedDocumentCount(category: DocumentListResponse): number;
|
|
39
|
+
/**
|
|
40
|
+
* Sorts document categories alphabetically by label
|
|
41
|
+
* @param categories - The list of document categories to sort
|
|
42
|
+
* @returns Sorted categories array
|
|
43
|
+
*/
|
|
44
|
+
sortDocumentCategoriesAlphabetically(categories: DocumentListResponse[]): DocumentListResponse[];
|
|
39
45
|
/**
|
|
40
46
|
* Build document categories from API response
|
|
41
47
|
*/
|
|
@@ -4,6 +4,24 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class DocumentMenuService {
|
|
5
5
|
private documentStore;
|
|
6
6
|
constructor(documentStore: DocumentStore);
|
|
7
|
+
/**
|
|
8
|
+
* Sorts categories alphabetically by label
|
|
9
|
+
* @param categories - The list of document categories to sort
|
|
10
|
+
* @returns Sorted categories array
|
|
11
|
+
*/
|
|
12
|
+
sortCategoriesAlphabetically(categories: DocumentCategory[]): DocumentCategory[];
|
|
13
|
+
/**
|
|
14
|
+
* Sorts menu items within each category alphabetically by label
|
|
15
|
+
* @param categories - The list of document categories to sort
|
|
16
|
+
* @returns Categories with sorted menu items
|
|
17
|
+
*/
|
|
18
|
+
sortMenuItemsAlphabetically(categories: DocumentCategory[]): DocumentCategory[];
|
|
19
|
+
/**
|
|
20
|
+
* Sorts both categories and their menu items alphabetically
|
|
21
|
+
* @param categories - The list of document categories to sort
|
|
22
|
+
* @returns Fully sorted categories array
|
|
23
|
+
*/
|
|
24
|
+
sortCategoriesAndMenuItems(categories: DocumentCategory[]): DocumentCategory[];
|
|
7
25
|
/**
|
|
8
26
|
* Gets the category name for a given menu item _id
|
|
9
27
|
* @param menuItemId - The _id of the menu item
|
|
@@ -24,12 +42,6 @@ export declare class DocumentMenuService {
|
|
|
24
42
|
* @param categories - The list of document categories
|
|
25
43
|
*/
|
|
26
44
|
handleUserListVisibility(menuItemId: string, categories: DocumentCategory[]): void;
|
|
27
|
-
/**
|
|
28
|
-
* Handles document status based on selected menu item
|
|
29
|
-
* @param menuItemId - The _id of the selected menu item
|
|
30
|
-
* @param categories - The list of document categories
|
|
31
|
-
*/
|
|
32
|
-
handleDocumentStatus(menuItemId: string, categories: DocumentCategory[]): void;
|
|
33
45
|
/**
|
|
34
46
|
* Calculates total documents for a menu item
|
|
35
47
|
* @param item - The menu item
|