cat-documents-ng 0.2.34 → 0.2.35
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/components/table-primary/table-primary.component.d.ts +4 -2
- package/Shared/constant/ERROR.d.ts +1 -0
- package/Shared/constant/SHARED.d.ts +67 -0
- package/Shared/constant/URLS.d.ts +22 -0
- package/fesm2022/cat-documents-ng.mjs +1256 -587
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-container/document-container.component.d.ts +36 -35
- package/lib/document/components/document-list/document-list.component.d.ts +52 -34
- package/lib/document/components/document-status/document-status.component.d.ts +11 -14
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +6 -6
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +33 -11
- package/lib/document/components/folder-container/folder-container.component.d.ts +23 -6
- package/lib/document/components/linked-document/linked-document.component.d.ts +5 -4
- package/lib/document/components/user-list/user-list.component.d.ts +19 -22
- package/lib/document/directives/document.directive.d.ts +2 -2
- package/lib/document/models/document-category.model.d.ts +19 -0
- package/lib/document/models/document-list-response.model.d.ts +24 -0
- package/lib/document/models/status-data.model.d.ts +27 -0
- package/lib/document/models/user-list.model.d.ts +8 -0
- package/lib/document/services/document-http.service.d.ts +28 -2
- package/lib/document/services/document-menu.service.d.ts +65 -0
- package/lib/document/services/document-table-builder.service.d.ts +34 -30
- package/lib/document/services/document.service.d.ts +29 -8
- package/lib/document/services/status-calculator.service.d.ts +20 -0
- package/lib/document/services/user-list.service.d.ts +36 -0
- package/lib/document/state/document.query.d.ts +52 -1
- package/lib/document/state/document.state.d.ts +9 -0
- package/lib/document/state/document.store.d.ts +9 -0
- package/package.json +1 -1
- package/lib/document/models/document-status.model.d.ts +0 -6
|
@@ -6,6 +6,9 @@ import { DocumentTypeModel } from '../models/document-type.model';
|
|
|
6
6
|
import { DocumentAlertModel } from '../models/document-alert.model';
|
|
7
7
|
import { DocumentModel } from '../models/document.model';
|
|
8
8
|
import { FolderBlockModel } from '../models/folder.model';
|
|
9
|
+
import { DocumentCategory } from '../models/document-category.model';
|
|
10
|
+
import { UserListModel } from '../models/user-list.model';
|
|
11
|
+
import { StatusDataModel } from '../models/status-data.model';
|
|
9
12
|
import * as i0 from "@angular/core";
|
|
10
13
|
/**
|
|
11
14
|
* Service for making HTTP requests related to documents.
|
|
@@ -36,6 +39,13 @@ export declare class DocumentHttpService {
|
|
|
36
39
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
37
40
|
*/
|
|
38
41
|
getFoldersData(contextId: string | undefined): Observable<FolderBlockModel[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Fetches a document catagories by its path name.
|
|
44
|
+
* Includes error handling for failed API requests.
|
|
45
|
+
* @param {string} contextId - The context ID to fetch the document.
|
|
46
|
+
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
47
|
+
*/
|
|
48
|
+
getDocumentCatagories(contextId: string): Observable<DocumentCategory[]>;
|
|
39
49
|
/**
|
|
40
50
|
* Fetches a document by its path name and transforms the response for dropdown options.
|
|
41
51
|
* Includes error handling for failed API requests.
|
|
@@ -65,14 +75,30 @@ export declare class DocumentHttpService {
|
|
|
65
75
|
*/
|
|
66
76
|
updateDocumentName(documentId: string, payload: any): Observable<DocumentModel>;
|
|
67
77
|
/**
|
|
68
|
-
|
|
78
|
+
* Fetches a userlist by its path name.
|
|
79
|
+
* @param {string} contextId - The document ID to fetch the document.
|
|
80
|
+
* @returns {Observable<UserListModel[]>} Observable that emits the user list data.
|
|
81
|
+
*/
|
|
82
|
+
getUserListByContextId(contextId: string): Observable<UserListModel[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Fetches document status count data by application ID with optional context ID and category parameters.
|
|
85
|
+
* @param {string} applicationId - The application ID to fetch status data.
|
|
86
|
+
* @param {string | null} contextId - The context ID (applicant ID) to filter by. If null, uses applicationId.
|
|
87
|
+
* @param {string | null} categoryId - The category ID to filter by.
|
|
88
|
+
* @returns {Observable<StatusDataModel[]>} Observable that emits the status data.
|
|
89
|
+
*/
|
|
90
|
+
getStatusDocumentCount(applicationId: string, contextId?: string | null, categoryId?: string | null): Observable<StatusDataModel[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Fetches documents based on selection criteria (menu item, user ID, status, and search key).
|
|
69
93
|
* This method sends an HTTP GET request with query parameters for the selected filters.
|
|
94
|
+
* @param {string} contextId - The context ID (applicationId or applicantId).
|
|
70
95
|
* @param {string | null} menuItem - The selected menu item filter.
|
|
71
96
|
* @param {string | null} userId - The selected user ID filter.
|
|
72
97
|
* @param {string | null} status - The selected status filter.
|
|
98
|
+
* @param {string | null} searchKey - The search key filter.
|
|
73
99
|
* @returns {Observable<any>} An observable that emits the filtered document data.
|
|
74
100
|
*/
|
|
75
|
-
getDocumentsBySelection(menuItem: string | null, userId: string | null, status: string | null): Observable<any>;
|
|
101
|
+
getDocumentsBySelection(contextId: string, menuItem: string | null, userId: string | null, status: string | null, searchKey?: string | null): Observable<any>;
|
|
76
102
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHttpService, never>;
|
|
77
103
|
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHttpService>;
|
|
78
104
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { DocumentCategory, DocumentCategoryItem } from '../models/document-category.model';
|
|
2
|
+
import { DocumentStore } from '../state/document.store';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class DocumentMenuService {
|
|
5
|
+
private documentStore;
|
|
6
|
+
constructor(documentStore: DocumentStore);
|
|
7
|
+
/**
|
|
8
|
+
* Gets the category name for a given menu item _id
|
|
9
|
+
* @param menuItemId - The _id of the menu item
|
|
10
|
+
* @param categories - The list of document categories
|
|
11
|
+
* @returns The category name or null if not found
|
|
12
|
+
*/
|
|
13
|
+
getMenuItemCategory(menuItemId: string, categories: DocumentCategory[]): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the menu item by its _id
|
|
16
|
+
* @param menuItemId - The _id of the menu item
|
|
17
|
+
* @param categories - The list of document categories
|
|
18
|
+
* @returns The menu item or null if not found
|
|
19
|
+
*/
|
|
20
|
+
getMenuItemById(menuItemId: string, categories: DocumentCategory[]): DocumentCategoryItem | null;
|
|
21
|
+
/**
|
|
22
|
+
* Handles user list visibility based on menu item category
|
|
23
|
+
* @param menuItemId - The _id of the menu item
|
|
24
|
+
* @param categories - The list of document categories
|
|
25
|
+
*/
|
|
26
|
+
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
|
+
/**
|
|
34
|
+
* Calculates total documents for a menu item
|
|
35
|
+
* @param item - The menu item
|
|
36
|
+
* @returns Total number of documents
|
|
37
|
+
*/
|
|
38
|
+
getTotalDocuments(item: DocumentCategoryItem): number;
|
|
39
|
+
/**
|
|
40
|
+
* Calculates completed documents for a menu item
|
|
41
|
+
* @param item - The menu item
|
|
42
|
+
* @returns Number of completed documents
|
|
43
|
+
*/
|
|
44
|
+
getCompletedDocuments(item: DocumentCategoryItem): number;
|
|
45
|
+
/**
|
|
46
|
+
* Gets badge value for a menu item
|
|
47
|
+
* @param item - The menu item
|
|
48
|
+
* @returns Badge value string (e.g., "1/2")
|
|
49
|
+
*/
|
|
50
|
+
getBadgeValue(item: DocumentCategoryItem): string;
|
|
51
|
+
/**
|
|
52
|
+
* Gets badge severity based on status
|
|
53
|
+
* @param item - The menu item
|
|
54
|
+
* @returns Badge severity for PrimeNG
|
|
55
|
+
*/
|
|
56
|
+
getBadgeSeverity(item: DocumentCategoryItem): 'success' | 'info' | 'warning' | 'danger';
|
|
57
|
+
/**
|
|
58
|
+
* Checks if badge should be shown for a menu item
|
|
59
|
+
* @param item - The menu item
|
|
60
|
+
* @returns True if badge should be shown
|
|
61
|
+
*/
|
|
62
|
+
shouldShowBadge(item: DocumentCategoryItem): boolean;
|
|
63
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentMenuService, never>;
|
|
64
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentMenuService>;
|
|
65
|
+
}
|
|
@@ -1,52 +1,56 @@
|
|
|
1
1
|
import { TableData } from '../../../Shared/components/table-primary/table-primary.component';
|
|
2
|
+
import { DocumentListResponse, DocumentListItem } from '../models/document-list-response.model';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
|
-
export interface DocumentSection {
|
|
4
|
-
header: string;
|
|
5
|
-
description: string;
|
|
6
|
-
pendingDocument: number;
|
|
7
|
-
approvedDocument: number;
|
|
8
|
-
list: DocumentItem[];
|
|
9
|
-
}
|
|
10
|
-
export interface DocumentItem {
|
|
11
|
-
documentName: string;
|
|
12
|
-
documentType: string;
|
|
13
|
-
documentUrl: string;
|
|
14
|
-
status: string;
|
|
15
|
-
applicantName: string;
|
|
16
|
-
uploadedTime: string;
|
|
17
|
-
}
|
|
18
4
|
export declare class DocumentTableBuilderService {
|
|
19
5
|
constructor();
|
|
20
6
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @param
|
|
7
|
+
* Gets document type from file name extension
|
|
8
|
+
* @param fileName File name with extension
|
|
9
|
+
* @returns Document type string
|
|
10
|
+
*/
|
|
11
|
+
private getDocumentTypeFromFileName;
|
|
12
|
+
/**
|
|
13
|
+
* Builds table data for document categories
|
|
14
|
+
* @param categories Array of document categories
|
|
23
15
|
* @returns Array of TableData objects
|
|
24
16
|
*/
|
|
25
|
-
|
|
17
|
+
buildDocumentCategoriesTables(categories: DocumentListResponse[]): TableData[];
|
|
26
18
|
/**
|
|
27
|
-
* Builds table data for a single document
|
|
28
|
-
* @param
|
|
19
|
+
* Builds table data for a single document category
|
|
20
|
+
* @param category Document category
|
|
29
21
|
* @returns TableData object
|
|
30
22
|
*/
|
|
31
|
-
private
|
|
23
|
+
private buildTableForCategory;
|
|
32
24
|
/**
|
|
33
|
-
* Builds a single table from document list
|
|
34
|
-
* @param documents Array of document items
|
|
25
|
+
* Builds a single table from document list items
|
|
26
|
+
* @param documents Array of document list items
|
|
35
27
|
* @returns TableData object
|
|
36
28
|
*/
|
|
37
|
-
buildDocumentTable(documents:
|
|
29
|
+
buildDocumentTable(documents: DocumentListItem[]): TableData;
|
|
38
30
|
/**
|
|
39
|
-
* Gets completion count for a
|
|
40
|
-
* @param
|
|
31
|
+
* Gets completion count for a category
|
|
32
|
+
* @param category Document category
|
|
41
33
|
* @returns Completion string (e.g., "2/4")
|
|
42
34
|
*/
|
|
43
|
-
getCompletionCount(
|
|
35
|
+
getCompletionCount(category: DocumentListResponse): string;
|
|
36
|
+
/**
|
|
37
|
+
* Gets pending document count for a category
|
|
38
|
+
* @param category Document category
|
|
39
|
+
* @returns Number of pending documents
|
|
40
|
+
*/
|
|
41
|
+
getPendingDocumentCount(category: DocumentListResponse): number;
|
|
42
|
+
/**
|
|
43
|
+
* Gets approved document count for a category
|
|
44
|
+
* @param category Document category
|
|
45
|
+
* @returns Number of approved documents
|
|
46
|
+
*/
|
|
47
|
+
getApprovedDocumentCount(category: DocumentListResponse): number;
|
|
44
48
|
/**
|
|
45
|
-
* Transforms document model to document item
|
|
49
|
+
* Transforms document model to document list item
|
|
46
50
|
* @param documents Array of DocumentModel
|
|
47
|
-
* @returns Array of
|
|
51
|
+
* @returns Array of DocumentListItem
|
|
48
52
|
*/
|
|
49
|
-
|
|
53
|
+
transformDocumentModelToListItem(documents: any[]): DocumentListItem[];
|
|
50
54
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentTableBuilderService, never>;
|
|
51
55
|
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentTableBuilderService>;
|
|
52
56
|
}
|
|
@@ -7,16 +7,21 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
/**
|
|
8
8
|
* Service to manage the document data and selection state
|
|
9
9
|
*/
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class DocumentHelperService {
|
|
11
11
|
private documentStore;
|
|
12
12
|
private documentQuery;
|
|
13
13
|
private documentHttpService;
|
|
14
|
-
private documentSubject$;
|
|
15
14
|
constructor(documentStore: DocumentStore, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService);
|
|
16
15
|
/**
|
|
17
16
|
* Initialize watcher for selection state changes
|
|
17
|
+
* @param contextId - The context ID to use for API calls
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
initializeSelectionWatcher(contextId: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* Initialize watcher for selection state changes with initial load
|
|
22
|
+
* @param contextId - The context ID to use for API calls
|
|
23
|
+
*/
|
|
24
|
+
initializeSelectionWatcherWithInitialLoad(contextId: string): void;
|
|
20
25
|
/**
|
|
21
26
|
* Set the document data
|
|
22
27
|
* @param document the document data
|
|
@@ -27,9 +32,14 @@ export declare class DocumentService {
|
|
|
27
32
|
* @returns the document data
|
|
28
33
|
*/
|
|
29
34
|
get(): Observable<DocumentModel | null>;
|
|
35
|
+
/**
|
|
36
|
+
* Get the current document value synchronously
|
|
37
|
+
* @returns the current document value
|
|
38
|
+
*/
|
|
39
|
+
getValue(): DocumentModel | null;
|
|
30
40
|
/**
|
|
31
41
|
* Set the selected menu item
|
|
32
|
-
* @param menuItem the selected menu item
|
|
42
|
+
* @param menuItem the selected menu item _id (not the label)
|
|
33
43
|
*/
|
|
34
44
|
setSelectedMenuItem(menuItem: string | null): void;
|
|
35
45
|
/**
|
|
@@ -44,7 +54,7 @@ export declare class DocumentService {
|
|
|
44
54
|
setSelectedStatus(status: string | null): void;
|
|
45
55
|
/**
|
|
46
56
|
* Set all selection state at once
|
|
47
|
-
* @param menuItem the selected menu item
|
|
57
|
+
* @param menuItem the selected menu item _id (not the label)
|
|
48
58
|
* @param userId the selected user ID
|
|
49
59
|
* @param status the selected status
|
|
50
60
|
*/
|
|
@@ -67,10 +77,21 @@ export declare class DocumentService {
|
|
|
67
77
|
userId: string | null;
|
|
68
78
|
status: string | null;
|
|
69
79
|
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Get observable for filtered documents
|
|
82
|
+
* @returns Observable that emits filtered document responses
|
|
83
|
+
*/
|
|
84
|
+
getFilteredDocuments(): Observable<any>;
|
|
70
85
|
/**
|
|
71
86
|
* Manually trigger API call with current selection state
|
|
87
|
+
* @param contextId - The context ID to use for the API call
|
|
88
|
+
*/
|
|
89
|
+
refreshDocumentsWithCurrentSelection(contextId: string): void;
|
|
90
|
+
/**
|
|
91
|
+
* Force refresh documents with no filters
|
|
92
|
+
* @param contextId - The context ID to use for the API call
|
|
72
93
|
*/
|
|
73
|
-
|
|
74
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
75
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
94
|
+
refreshDocumentsWithoutFilters(contextId: string): void;
|
|
95
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHelperService, never>;
|
|
96
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHelperService>;
|
|
76
97
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface StatusData {
|
|
3
|
+
status: string;
|
|
4
|
+
count: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
_id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CalculatedStatusData extends StatusData {
|
|
10
|
+
percentage: number;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
statusClass: string;
|
|
13
|
+
iconClass: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class StatusCalculatorService {
|
|
16
|
+
calculateTotalCount(statusData: StatusData[]): number;
|
|
17
|
+
calculateStatusDataWithPercentages(statusData: StatusData[], selectedStatusId: string | null): CalculatedStatusData[];
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StatusCalculatorService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StatusCalculatorService>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { UserListModel } from '../models/user-list.model';
|
|
2
|
+
import { DocumentStore } from '../state/document.store';
|
|
3
|
+
import { DocumentQuery } from '../state/document.query';
|
|
4
|
+
import { DocumentCategory } from '../models/document-category.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class UserListService {
|
|
7
|
+
private documentStore;
|
|
8
|
+
private documentQuery;
|
|
9
|
+
constructor(documentStore: DocumentStore, documentQuery: DocumentQuery);
|
|
10
|
+
getInitials(name: string): string;
|
|
11
|
+
getColorByIndex(index: number): string;
|
|
12
|
+
getColorValue(colorName: string): string;
|
|
13
|
+
processUserData(userList: UserListModel[]): UserListModel[];
|
|
14
|
+
/**
|
|
15
|
+
* Finds the selected menu item from categories
|
|
16
|
+
* @param selectedMenuItemId - The ID of the selected menu item
|
|
17
|
+
* @param categories - The document categories
|
|
18
|
+
* @returns The selected menu item or null
|
|
19
|
+
*/
|
|
20
|
+
private findSelectedMenuItem;
|
|
21
|
+
/**
|
|
22
|
+
* Filters user list based on selected menu item category
|
|
23
|
+
* @param userList - The complete user list
|
|
24
|
+
* @param categories - The document categories
|
|
25
|
+
* @returns Filtered user list
|
|
26
|
+
*/
|
|
27
|
+
filterUsersByCategory(userList: UserListModel[], categories: DocumentCategory[]): UserListModel[];
|
|
28
|
+
selectUser(userId: string, userData: UserListModel[]): {
|
|
29
|
+
selectedUser: string | undefined;
|
|
30
|
+
name: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
unselectUser(): void;
|
|
33
|
+
isUserSelected(userId: string, userData: UserListModel[], selectedUser: string | undefined): boolean;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserListService, never>;
|
|
35
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UserListService>;
|
|
36
|
+
}
|
|
@@ -4,6 +4,10 @@ import { DocumentState } from './document.state';
|
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { Message } from 'primeng/api';
|
|
6
6
|
import { DocumentModel } from '../models/document.model';
|
|
7
|
+
import { DocumentCategory } from '../models/document-category.model';
|
|
8
|
+
import { UserListModel } from '../models/user-list.model';
|
|
9
|
+
import { StatusDataModel } from '../models/status-data.model';
|
|
10
|
+
import { DocumentListResponse } from '../models/document-list-response.model';
|
|
7
11
|
import * as i0 from "@angular/core";
|
|
8
12
|
/**
|
|
9
13
|
* Query service for managing document state.
|
|
@@ -35,9 +39,14 @@ export declare class DocumentQuery extends QueryEntity<DocumentState> {
|
|
|
35
39
|
* @returns {Observable<DocumentModel[]>} Observable that emits the documets.
|
|
36
40
|
*/
|
|
37
41
|
selectDocumets(): Observable<DocumentModel[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Selects the document categories.
|
|
44
|
+
* @returns {Observable<DocumentCategory[]>} Observable that emits the document categories.
|
|
45
|
+
*/
|
|
46
|
+
selectDocumentCategories(): Observable<DocumentCategory[]>;
|
|
38
47
|
/**
|
|
39
48
|
* Selects the currently selected menu item.
|
|
40
|
-
* @returns {Observable<string | null>} Observable that emits the currently selected menu item.
|
|
49
|
+
* @returns {Observable<string | null>} Observable that emits the currently selected menu item _id (not the label).
|
|
41
50
|
*/
|
|
42
51
|
selectSelectedMenuItem(): Observable<string | null>;
|
|
43
52
|
/**
|
|
@@ -53,6 +62,7 @@ export declare class DocumentQuery extends QueryEntity<DocumentState> {
|
|
|
53
62
|
/**
|
|
54
63
|
* Selects all selection state properties (menu item, user ID, status).
|
|
55
64
|
* @returns {Observable<{menuItem: string | null, userId: string | null, status: string | null}>} Observable that emits the current selection state.
|
|
65
|
+
* Note: menuItem is the _id of the selected menu item, not the label.
|
|
56
66
|
*/
|
|
57
67
|
selectSelectionState(): Observable<{
|
|
58
68
|
menuItem: string | null;
|
|
@@ -62,6 +72,7 @@ export declare class DocumentQuery extends QueryEntity<DocumentState> {
|
|
|
62
72
|
/**
|
|
63
73
|
* Gets the current selection state values (synchronous).
|
|
64
74
|
* @returns {Object} The current selection state values.
|
|
75
|
+
* Note: menuItem is the _id of the selected menu item, not the label.
|
|
65
76
|
*/
|
|
66
77
|
getSelectionState(): {
|
|
67
78
|
menuItem: string | null;
|
|
@@ -78,6 +89,46 @@ export declare class DocumentQuery extends QueryEntity<DocumentState> {
|
|
|
78
89
|
* @returns {boolean} The current user list visibility.
|
|
79
90
|
*/
|
|
80
91
|
getShowUserList(): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Selects the current document.
|
|
94
|
+
* @returns {Observable<DocumentModel | null>} Observable that emits the current document.
|
|
95
|
+
*/
|
|
96
|
+
selectCurrentDocument(): Observable<DocumentModel | null>;
|
|
97
|
+
/**
|
|
98
|
+
* Gets the current document value (synchronous).
|
|
99
|
+
* @returns {DocumentModel | null} The current document.
|
|
100
|
+
*/
|
|
101
|
+
getCurrentDocument(): DocumentModel | null;
|
|
102
|
+
/**
|
|
103
|
+
* Selects the user list.
|
|
104
|
+
* @returns {Observable<UserListModel[]>} Observable that emits the user list.
|
|
105
|
+
*/
|
|
106
|
+
selectUserList(): Observable<UserListModel[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Gets the current user list value (synchronous).
|
|
109
|
+
* @returns {UserListModel[]} The current user list.
|
|
110
|
+
*/
|
|
111
|
+
getUserList(): UserListModel[];
|
|
112
|
+
/**
|
|
113
|
+
* Selects the status data.
|
|
114
|
+
* @returns {Observable<StatusDataModel[]>} Observable that emits the status data.
|
|
115
|
+
*/
|
|
116
|
+
selectStatusData(): Observable<StatusDataModel[]>;
|
|
117
|
+
/**
|
|
118
|
+
* Gets the current status data value (synchronous).
|
|
119
|
+
* @returns {StatusDataModel[]} The current status data.
|
|
120
|
+
*/
|
|
121
|
+
getStatusData(): StatusDataModel[];
|
|
122
|
+
/**
|
|
123
|
+
* Selects the document list response.
|
|
124
|
+
* @returns {Observable<DocumentListResponse[] | null>} Observable that emits the document list response.
|
|
125
|
+
*/
|
|
126
|
+
selectDocumentListResponse(): Observable<DocumentListResponse[] | null>;
|
|
127
|
+
/**
|
|
128
|
+
* Gets the current document list response value (synchronous).
|
|
129
|
+
* @returns {DocumentListResponse[] | null} The current document list response.
|
|
130
|
+
*/
|
|
131
|
+
getDocumentListResponse(): DocumentListResponse[] | null;
|
|
81
132
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentQuery, never>;
|
|
82
133
|
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentQuery>;
|
|
83
134
|
}
|
|
@@ -3,7 +3,11 @@ import { DocumentModel } from '../models/document.model';
|
|
|
3
3
|
import { DocumentTypeModel } from '../models/document-type.model';
|
|
4
4
|
import { DocumentAlertModel } from '../models/document-alert.model';
|
|
5
5
|
import { FolderBlockModel } from '../models/folder.model';
|
|
6
|
+
import { DocumentCategory } from '../models/document-category.model';
|
|
6
7
|
import { Message } from 'primeng/api';
|
|
8
|
+
import { UserListModel } from '../models/user-list.model';
|
|
9
|
+
import { StatusDataModel } from '../models/status-data.model';
|
|
10
|
+
import { DocumentListResponse } from '../models/document-list-response.model';
|
|
7
11
|
/**
|
|
8
12
|
* Represents the state of the documents in the application.
|
|
9
13
|
* This interface extends Akita's `EntityState` to include additional properties
|
|
@@ -26,10 +30,15 @@ export interface DocumentState extends EntityState<DocumentModel, string> {
|
|
|
26
30
|
folders: FolderBlockModel[];
|
|
27
31
|
messages: Message[];
|
|
28
32
|
documentList: DocumentModel[];
|
|
33
|
+
documentCategories: DocumentCategory[];
|
|
29
34
|
selectedMenuItem: string | null;
|
|
30
35
|
selectedUserId: string | null;
|
|
31
36
|
selectedStatus: string | null;
|
|
32
37
|
showUserList: boolean;
|
|
38
|
+
currentDocument: DocumentModel | null;
|
|
39
|
+
userList: UserListModel[];
|
|
40
|
+
statusData: StatusDataModel[];
|
|
41
|
+
documentListResponse: DocumentListResponse[] | null;
|
|
33
42
|
}
|
|
34
43
|
/**
|
|
35
44
|
* Creates the initial state for the `DocumentState` store.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { EntityStore } from '@datorama/akita';
|
|
2
2
|
import { DocumentState } from './document.state';
|
|
3
|
+
import { DocumentCategory } from '../models/document-category.model';
|
|
3
4
|
import { Message } from 'primeng/api';
|
|
4
5
|
import { DocumentModel } from '../models/document.model';
|
|
6
|
+
import { UserListModel } from '../models/user-list.model';
|
|
7
|
+
import { StatusDataModel } from '../models/status-data.model';
|
|
8
|
+
import { DocumentListResponse } from '../models/document-list-response.model';
|
|
5
9
|
import * as i0 from "@angular/core";
|
|
6
10
|
/**
|
|
7
11
|
* Store that manages the state of documents in the application.
|
|
@@ -22,12 +26,17 @@ export declare class DocumentStore extends EntityStore<DocumentState> {
|
|
|
22
26
|
setParentDocumentTypeId(parentDocumentTypeId: string): void;
|
|
23
27
|
setMessage(message: Message[]): void;
|
|
24
28
|
setDocumentList(documents: DocumentModel[]): void;
|
|
29
|
+
setDocumentCategories(categories: DocumentCategory[]): void;
|
|
25
30
|
setSelectedMenuItem(menuItem: string | null): void;
|
|
26
31
|
setSelectedUserId(userId: string | null): void;
|
|
27
32
|
setSelectedStatus(status: string | null): void;
|
|
28
33
|
setSelectionState(menuItem: string | null, userId: string | null, status: string | null): void;
|
|
29
34
|
clearSelectionState(): void;
|
|
30
35
|
setShowUserList(show: boolean): void;
|
|
36
|
+
setCurrentDocument(document: DocumentModel | null): void;
|
|
37
|
+
setUserList(userList: UserListModel[]): void;
|
|
38
|
+
setStatusData(statusData: StatusDataModel[]): void;
|
|
39
|
+
setDocumentListResponse(response: DocumentListResponse[] | null): void;
|
|
31
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentStore, never>;
|
|
32
41
|
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentStore>;
|
|
33
42
|
}
|
package/package.json
CHANGED