cat-documents-ng 0.2.94 → 0.2.96

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.
@@ -1,5 +1,4 @@
1
- import { OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
2
- import { DocumentService } from '../../state/document.service';
1
+ import { OnInit, OnDestroy, OnChanges, SimpleChanges, ElementRef } from '@angular/core';
3
2
  import { Subscription } from 'rxjs';
4
3
  import { DocumentHttpService } from '../../services/document-http.service';
5
4
  import { DocumentQuery } from '../../state/document.query';
@@ -16,19 +15,49 @@ import * as i0 from "@angular/core";
16
15
  * @typedef {DocumentContainerComponent}
17
16
  */
18
17
  export declare class DocumentContainerComponent implements OnInit, OnDestroy, OnChanges {
19
- documentStore: DocumentStore;
20
- documentService: DocumentService;
21
- documentQuery: DocumentQuery;
22
- documentHttpService: DocumentHttpService;
23
- documentHelperService: DocumentHelperService;
18
+ private documentHttpService;
19
+ private documentHelperService;
20
+ private documentQuery;
21
+ private documentStore;
22
+ /**
23
+ * The document list response data
24
+ * @type {DocumentListResponse[] | null}
25
+ */
26
+ documentListResponse: DocumentListResponse[] | null;
27
+ /**
28
+ * Status data for the current selection
29
+ * @type {StatusDataModel[]}
30
+ */
31
+ statusData: StatusDataModel[];
32
+ /**
33
+ * The currently selected menu item ID for scrolling
34
+ */
35
+ selectedMenuItemId: string | null;
36
+ /**
37
+ * Additional navigation information for better scrolling
38
+ */
39
+ navigationInfo: {
40
+ menuItemId: string;
41
+ menuItemLabel: string;
42
+ categoryLabel: string;
43
+ categoryIndex: number;
44
+ } | null;
45
+ /**
46
+ * Reference to the content scroll container
47
+ */
48
+ contentScrollContainer: ElementRef;
49
+ /**
50
+ * Subscription to track selected menu item changes
51
+ */
52
+ private selectedMenuItemSubscription;
24
53
  /**
25
54
  * Creates an instance of DocumentContainerComponent.
26
- * @param {DocumentStore} documentStore - Query Store service to manage store document-related state.
27
- * @param {DocumentService} documentService - Service to manage document-related operations.
28
- * @param {DocumentQuery} documentQuery - Query service to manage document-related state.
29
- * @param {DocumentHttpService} documentHttpService - Service to make HTTP requests related to documents.
55
+ * @param {DocumentHttpService} documentHttpService - Service for HTTP operations
56
+ * @param {DocumentHelperService} documentHelperService - Service for document operations
57
+ * @param {DocumentQuery} documentQuery - Query service for document state
58
+ * @param {DocumentStore} documentStore - Store service for document state
30
59
  */
31
- constructor(documentStore: DocumentStore, documentService: DocumentService, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService, documentHelperService: DocumentHelperService);
60
+ constructor(documentHttpService: DocumentHttpService, documentHelperService: DocumentHelperService, documentQuery: DocumentQuery, documentStore: DocumentStore);
32
61
  /**
33
62
  * Get contextId in input.
34
63
  * @type {string}
@@ -41,19 +70,8 @@ export declare class DocumentContainerComponent implements OnInit, OnDestroy, On
41
70
  applicationNumber: string;
42
71
  catagories: DocumentCategory[];
43
72
  userList: UserListModel[];
44
- /**
45
- * Status data for the current selection
46
- * @type {StatusDataModel[]}
47
- */
48
- statusData: StatusDataModel[];
49
- /**
50
- * Document list response from API
51
- * @type {DocumentListResponse | null}
52
- */
53
- documentListResponse: DocumentListResponse[] | null;
54
73
  /**
55
74
  * Holds the subscription to manage observable cleanup.
56
- * @
57
75
  * @type {Subscription}
58
76
  */
59
77
  subscription: Subscription;
@@ -62,10 +80,31 @@ export declare class DocumentContainerComponent implements OnInit, OnDestroy, On
62
80
  */
63
81
  ngOnChanges(changes: SimpleChanges): void;
64
82
  /**
65
- * Fetches the folder and document data on initialization.
66
- * @returns {void}
83
+ * Initializes the component
67
84
  */
68
85
  ngOnInit(): void;
86
+ /**
87
+ * Sets up subscription to track selected menu item changes
88
+ */
89
+ setupSelectedMenuItemSubscription(): void;
90
+ /**
91
+ * Handles menu item selection events from the documents menu
92
+ * @param event - The menu item selection event
93
+ */
94
+ onMenuItemSelected(event: {
95
+ item: any;
96
+ category: any;
97
+ navigationInfo?: {
98
+ menuItemId: string;
99
+ menuItemLabel: string;
100
+ categoryLabel: string;
101
+ categoryIndex: number;
102
+ };
103
+ }): void;
104
+ /**
105
+ * Resets the content scroll container to the top
106
+ */
107
+ private resetContentScrollToTop;
69
108
  /**
70
109
  * Initialize all data with proper sequencing to avoid duplicate API calls
71
110
  */
@@ -1,4 +1,4 @@
1
- import { OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
1
+ import { 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';
@@ -9,7 +9,7 @@ import * as i0 from "@angular/core";
9
9
  * Provides functionality for file upload, document selection, and dialog management.
10
10
  * @class DocumentListComponent
11
11
  */
12
- export declare class DocumentListComponent implements OnInit, OnDestroy, OnChanges {
12
+ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
13
13
  private documentListService;
14
14
  /**
15
15
  * Represents the context ID for the document list.
@@ -24,6 +24,27 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
24
24
  * @memberof DocumentListComponent
25
25
  */
26
26
  documentListResponse: DocumentListResponse[] | null;
27
+ /**
28
+ * The selected menu item ID for scrolling to specific sections
29
+ * @type {string | null}
30
+ * @memberof DocumentListComponent
31
+ */
32
+ selectedMenuItemId: string | null;
33
+ /**
34
+ * Additional navigation information for precise scrolling
35
+ * @type {object | null}
36
+ * @memberof DocumentListComponent
37
+ */
38
+ navigationInfo: {
39
+ menuItemId: string;
40
+ menuItemLabel: string;
41
+ categoryLabel: string;
42
+ categoryIndex: number;
43
+ } | null;
44
+ /**
45
+ * Reference to the document categories container for scrolling
46
+ */
47
+ documentCategoriesContainer: ElementRef;
27
48
  /**
28
49
  * Subscription to document list response from store
29
50
  */
@@ -108,6 +129,10 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
108
129
  * Initializes the component by setting up document list subscription.
109
130
  */
110
131
  ngOnInit(): void;
132
+ /**
133
+ * Called after the view is initialized
134
+ */
135
+ ngAfterViewInit(): void;
111
136
  /**
112
137
  * Handles the visibility of the sidebar.
113
138
  * @param {boolean} isVisible - Indicates whether the sidebar should be visible or not.
@@ -140,10 +165,31 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
140
165
  * @param {boolean} isDeleteAction - Optional flag indicating if this refresh is due to a delete action
141
166
  */
142
167
  refreshDocumentList(isDeleteAction?: boolean): void;
168
+ /**
169
+ * Scrolls to the category section that matches the selected menu item
170
+ * @param menuItemId - The ID of the selected menu item
171
+ */
172
+ scrollToCategorySection(menuItemId: string): void;
173
+ /**
174
+ * Scrolls to the category section using navigationInfo
175
+ * @param navigationInfo - The navigation info object containing menuItemId
176
+ */
177
+ private scrollToCategorySectionWithNavigationInfo;
178
+ /**
179
+ * Adds a temporary highlight effect to the scrolled category
180
+ * @param categoryElement - The DOM element of the category to highlight
181
+ */
182
+ private highlightCategory;
183
+ /**
184
+ * Alternative scrolling method using IntersectionObserver for better performance
185
+ * This method can be used as a fallback or alternative to the current approach
186
+ * @param navigationInfo - The navigation info object
187
+ */
188
+ private scrollToCategorySectionWithIntersectionObserver;
143
189
  /**
144
190
  * Cleanup subscriptions on component destroy
145
191
  */
146
192
  ngOnDestroy(): void;
147
193
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListComponent, never>;
148
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "lib-document-list", never, { "contextId": { "alias": "contextId"; "required": false; }; "documentListResponse": { "alias": "documentListResponse"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, {}, never, ["*"], false, 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>;
149
195
  }
@@ -1,4 +1,4 @@
1
- import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
1
+ import { OnInit, OnChanges, SimpleChanges, EventEmitter } from '@angular/core';
2
2
  import { DocumentStore } from '../../state/document.store';
3
3
  import { DocumentQuery } from '../../state/document.query';
4
4
  import { DocumentCategory, DocumentCategoryItem } from '../../models/document-category.model';
@@ -13,6 +13,16 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges {
13
13
  catagories: DocumentCategory[];
14
14
  applicationNumber: string;
15
15
  contextId: string;
16
+ menuItemSelected: EventEmitter<{
17
+ item: DocumentCategoryItem;
18
+ category: DocumentCategory;
19
+ navigationInfo?: {
20
+ menuItemId: string;
21
+ menuItemLabel: string;
22
+ categoryLabel: string;
23
+ categoryIndex: number;
24
+ };
25
+ }>;
16
26
  selectedMenuItem: string | null;
17
27
  selectedMenuItemId: string | null;
18
28
  private storeCategories;
@@ -41,20 +51,22 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges {
41
51
  * @returns The label of the menu item or null if not found
42
52
  */
43
53
  private findMenuItemLabelById;
54
+ /**
55
+ * Finds the category for a menu item by its _id
56
+ * @param id The _id to search for
57
+ * @returns The category or null if not found
58
+ */
59
+ private findMenuItemCategoryById;
44
60
  /**
45
61
  * Update menu use catagories
46
62
  */
47
63
  private updateMenuItemsData;
48
64
  /**
49
- * Handle the menu item click
65
+ * Handle the menu item click for navigation
50
66
  * @param {*} event - Event
51
67
  * @param {DocumentCategoryItem} item - catagory item
52
68
  */
53
69
  onMenuItemClick(event: any, item: DocumentCategoryItem): void;
54
- /**
55
- * Handle deselection to ensure immediate visual feedback
56
- */
57
- private handleDeselection;
58
70
  /**
59
71
  * Handle the menu item selection
60
72
  * @param {string} menuItemId - The ID of the menu item to select
@@ -70,7 +82,7 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges {
70
82
  */
71
83
  getSelectedMenuItem(): string | null;
72
84
  /**
73
- * Handles contextId changes by clearing current selection and refreshing data
85
+ * Handles contextId changes by clearing current selection
74
86
  */
75
87
  private handleContextIdChange;
76
88
  /**
@@ -79,5 +91,5 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges {
79
91
  */
80
92
  getSelectedMenuItemId(): string | null;
81
93
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentsMenuComponent, never>;
82
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentsMenuComponent, "lib-documents-menu", never, { "catagories": { "alias": "catagories"; "required": false; }; "applicationNumber": { "alias": "applicationNumber"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
94
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentsMenuComponent, "lib-documents-menu", never, { "catagories": { "alias": "catagories"; "required": false; }; "applicationNumber": { "alias": "applicationNumber"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, { "menuItemSelected": "menuItemSelected"; }, never, never, false, never>;
83
95
  }
@@ -89,10 +89,11 @@ export declare class DocumentHttpService {
89
89
  */
90
90
  getStatusDocumentCount(applicationId: string, contextId?: string | null, categoryId?: string | null): Observable<StatusDataModel[]>;
91
91
  /**
92
- * Fetches documents based on selection criteria (menu item, user ID, status, and search key).
92
+ * Fetches documents based on selection criteria (user ID, status, and search key).
93
93
  * This method sends an HTTP GET request with query parameters for the selected filters.
94
+ * Note: Menu item filtering has been removed - menu items are now used for navigation only.
94
95
  * @param {string} contextId - The context ID (applicationId or applicantId).
95
- * @param {string | null} menuItem - The selected menu item filter.
96
+ * @param {string | null} menuItem - Reserved parameter (no longer used for filtering).
96
97
  * @param {string | null} userId - The selected user ID filter.
97
98
  * @param {string | null} status - The selected status filter.
98
99
  * @param {string | null} searchKey - The search key filter.
@@ -135,15 +135,15 @@ export declare class DocumentHelperService {
135
135
  *
136
136
  * This method ensures that after a document action (accept/reject/delete):
137
137
  * 1. Document categories are refreshed
138
- * 2. Status counts are refreshed with current menu item and user filters
138
+ * 2. Status counts are refreshed with current user filters
139
139
  * 3. User list is refreshed with current filters (if applicable)
140
- * 4. Document list is refreshed with all current filters (menu item, user, status, search)
140
+ * 4. Document list is refreshed with current filters (user, status, search)
141
141
  *
142
142
  * Filter application:
143
143
  * - Document categories: Uses base contextId
144
- * - Status data: Uses userId as contextId and menuItem as categoryId
144
+ * - Status data: Uses userId as contextId (no category filtering)
145
145
  * - User list: Uses base contextId (can be enhanced with additional filters if API supports)
146
- * - Document list: Uses all current filters (menuItem, userId, status, searchKey)
146
+ * - Document list: Uses current filters (userId, status, searchKey)
147
147
  *
148
148
  * @param contextId - The context ID to use for the API calls
149
149
  */
@@ -11,13 +11,6 @@ export declare class UserListService {
11
11
  getColorByIndex(index: number): string;
12
12
  getColorValue(colorName: string): string;
13
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
14
  /**
22
15
  * Filters user list based on selected menu item category
23
16
  * @param userList - The complete user list
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.2.94",
3
+ "version": "0.2.96",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"