cat-documents-ng 0.2.57 → 0.2.58

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.
@@ -9,6 +9,7 @@ export declare class DocumentSearchComponent implements OnInit, OnDestroy {
9
9
  onActionClick: EventEmitter<void>;
10
10
  searchTerm: string;
11
11
  private destroy$;
12
+ private searchSubject;
12
13
  constructor(documentHelperService: DocumentHelperService);
13
14
  ngOnInit(): void;
14
15
  ngOnDestroy(): void;
@@ -30,7 +31,6 @@ export declare class DocumentSearchComponent implements OnInit, OnDestroy {
30
31
  * Clears the search input
31
32
  */
32
33
  onClearSearch(): void;
33
- private searchSubject;
34
34
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentSearchComponent, never>;
35
35
  static ɵcmp: i0.ɵɵComponentDeclaration<DocumentSearchComponent, "document-search", never, { "contextId": { "alias": "contextId"; "required": false; }; }, { "onActionClick": "onActionClick"; }, never, never, false, never>;
36
36
  }
@@ -1,4 +1,4 @@
1
- import { ChangeDetectorRef, OnDestroy } from '@angular/core';
1
+ import { ChangeDetectorRef, OnDestroy, EventEmitter } from '@angular/core';
2
2
  import { FileUpload } from 'primeng/fileupload';
3
3
  import { MessageService } from 'primeng/api';
4
4
  import { PrimeNGConfig } from 'primeng/api';
@@ -12,6 +12,11 @@ import { UserListModel } from '../../models/user-list.model';
12
12
  import { DocumentCategory } from '../../models/document-category.model';
13
13
  import { DocumentTypeModel } from '../../models/document-type.model';
14
14
  import * as i0 from "@angular/core";
15
+ /**
16
+ * Component responsible for handling document uploads with templated metadata.
17
+ * Provides a comprehensive interface for uploading documents with assignment types,
18
+ * categories, document types, and applicant selection.
19
+ */
15
20
  export declare class DocumentUploadComponent implements OnDestroy {
16
21
  documentUpload: DocumentUploadService;
17
22
  uploadService: DocumentService;
@@ -22,62 +27,250 @@ export declare class DocumentUploadComponent implements OnDestroy {
22
27
  private businessService;
23
28
  private formService;
24
29
  private dataService;
30
+ /** The context ID for the document upload operation */
25
31
  contextId: string;
32
+ /** Reference to the file upload component */
26
33
  fileUploader: FileUpload;
34
+ /** Event emitted when form validation state changes */
35
+ onFormValidationChange: EventEmitter<void>;
36
+ /** Event emitted when upload is successful */
37
+ onUploadSuccess: EventEmitter<void>;
38
+ /** Currently selected assignment type (Applicant or Application) */
27
39
  selectedAssignmentType: 'Applicant' | 'Application' | null;
40
+ /** Currently selected applicant ID */
28
41
  selectedApplicant: string;
42
+ /** Currently selected document category */
29
43
  selectedCategory: string;
44
+ /** Currently selected document type */
30
45
  selectedDocumentType: string;
46
+ /** List of available applicants */
31
47
  applicantList: UserListModel[];
48
+ /** Filtered list of applicants based on current selection */
32
49
  filteredApplicantList: UserListModel[];
50
+ /** Available document categories for the selected assignment type */
33
51
  categoryOptions: DocumentCategory[];
52
+ /** Available document types for the selected category */
34
53
  documentTypeOptions: DocumentTypeModel[];
54
+ /** Array of files that have been uploaded */
35
55
  uploadedFiles: UploadedFile[];
56
+ /** Map tracking upload progress for each file */
36
57
  fileProgress: Map<File, number>;
58
+ /** Loading state for applicants data */
37
59
  isLoadingApplicants: boolean;
60
+ /** Loading state for categories data */
38
61
  isLoadingCategories: boolean;
62
+ /** Loading state for document types data */
39
63
  isLoadingDocumentTypes: boolean;
64
+ /** Loading state for save operation */
40
65
  isSaving: boolean;
66
+ /** Current form validation state */
41
67
  isFormValid: boolean;
68
+ /** Subject for managing component lifecycle and unsubscribing from observables */
42
69
  private destroy$;
70
+ /**
71
+ * Creates an instance of DocumentUploadComponent.
72
+ * @param documentUpload - Service for handling document upload operations
73
+ * @param uploadService - Service for document-related operations
74
+ * @param config - PrimeNG configuration service
75
+ * @param fileFormatService - Service for file format validation
76
+ * @param messageService - Service for displaying messages
77
+ * @param cdr - Change detector reference for manual change detection
78
+ * @param businessService - Service for business logic operations
79
+ * @param formService - Service for form validation and handling
80
+ * @param dataService - Service for data loading operations
81
+ */
43
82
  constructor(documentUpload: DocumentUploadService, uploadService: DocumentService, config: PrimeNGConfig, fileFormatService: FileFormatService, messageService: MessageService, cdr: ChangeDetectorRef, businessService: DocumentUploadBusinessService, formService: DocumentUploadFormService, dataService: DocumentUploadDataService);
83
+ /**
84
+ * Handles changes in assignment type selection.
85
+ * Resets form selections, loads categories, and handles applicant loading.
86
+ */
44
87
  onAssignmentTypeChange(): void;
88
+ /**
89
+ * Handles changes in category selection.
90
+ * Resets document type and loads available document types if category is selected.
91
+ */
45
92
  onCategoryChange(): void;
93
+ /**
94
+ * Handles changes in document type selection.
95
+ * Validates form and emits validation change event.
96
+ */
46
97
  onDocumentTypeChange(): void;
98
+ /**
99
+ * Handles changes in applicant selection.
100
+ * Validates form and emits validation change event.
101
+ */
47
102
  onApplicantSelectionChange(): void;
103
+ /**
104
+ * Handles file selection from the file upload component.
105
+ * Processes each selected file for templated upload.
106
+ * @param event - Event containing the selected files
107
+ */
48
108
  onSelectedFiles(event: {
49
109
  currentFiles: File[];
50
110
  }): void;
111
+ /**
112
+ * Loads the list of applicants for the current context.
113
+ * Sets loading state and handles success/error responses.
114
+ */
51
115
  loadApplicants(): void;
116
+ /**
117
+ * Loads document categories based on the selected assignment type.
118
+ * Sets loading state and handles success/error responses.
119
+ */
52
120
  loadCategories(): void;
121
+ /**
122
+ * Loads document types based on the selected category.
123
+ * Sets loading state and handles success/error responses.
124
+ */
53
125
  loadDocumentTypes(): void;
126
+ /**
127
+ * Saves the document upload with all metadata.
128
+ * Validates payload and required fields before proceeding with upload.
129
+ */
54
130
  saveDocumentUpload(): void;
131
+ /**
132
+ * Handles templated upload for a single file.
133
+ * Sets up progress tracking and upload listener for the file.
134
+ * @param file - The file to be uploaded
135
+ */
55
136
  handleTemplatedUpload(file: File): void;
137
+ /**
138
+ * Removes a document from the uploaded files list.
139
+ * Updates progress tracking and validates form.
140
+ * @param file - The file to be removed
141
+ * @param index - The index of the file in the uploaded files array
142
+ */
56
143
  handleDocumentRemove(file: File, index: number): void;
144
+ /**
145
+ * Utility method for file upload component integration.
146
+ * @param event - The file upload event
147
+ * @param callback - Callback function to execute
148
+ */
57
149
  choose(event: any, callback: () => void): void;
150
+ /**
151
+ * Triggers the file upload dialog.
152
+ */
58
153
  triggerFileUpload(): void;
154
+ /**
155
+ * Determines if the save button should be disabled.
156
+ * @returns True if the save button should be disabled, false otherwise
157
+ */
59
158
  getSaveButtonDisabled(): boolean;
159
+ /**
160
+ * Gets the upload progress for a specific file.
161
+ * @param file - The file to get progress for
162
+ * @returns The upload progress percentage (0-100)
163
+ */
60
164
  getProgress(file: File): number;
165
+ /**
166
+ * Checks if a file is currently uploading.
167
+ * @param file - The file to check
168
+ * @returns True if the file is uploading, false otherwise
169
+ */
61
170
  isFileUploading(file: File): boolean;
171
+ /**
172
+ * Checks if a file has been successfully uploaded.
173
+ * @param file - The file to check
174
+ * @returns True if the file is uploaded, false otherwise
175
+ */
62
176
  isFileUploaded(file: File): boolean;
177
+ /**
178
+ * Checks if a file upload encountered an error.
179
+ * @param file - The file to check
180
+ * @returns True if the file has an error, false otherwise
181
+ */
63
182
  isFileError(file: File): boolean;
183
+ /**
184
+ * Resets the form to its initial state.
185
+ * Clears all selections, uploaded files, and progress tracking.
186
+ */
64
187
  resetForm(): void;
188
+ /**
189
+ * Resets form selections (applicant, category, document type).
190
+ * Clears document type options.
191
+ */
65
192
  resetSelections(): void;
193
+ /**
194
+ * Resets document type selection and clears document type options.
195
+ */
66
196
  resetDocumentType(): void;
197
+ /**
198
+ * Handles applicant loading based on assignment type.
199
+ * Loads applicants if type is 'Applicant', otherwise filters existing list.
200
+ */
67
201
  handleApplicantLoading(): void;
68
- loadDocumentTypesIfCategorySelected(): void;
202
+ /**
203
+ * Handles successful loading of applicants data.
204
+ * Updates applicant list, filters applicants, and validates form.
205
+ * @param applicants - Array of loaded applicants
206
+ */
69
207
  handleApplicantsLoaded(applicants: UserListModel[]): void;
70
- handleApplicantsError(error: any): void;
208
+ /**
209
+ * Handles successful loading of categories data.
210
+ * Updates category options and validates form.
211
+ * @param categories - Array of loaded categories
212
+ */
71
213
  handleCategoriesLoaded(categories: DocumentCategory[]): void;
72
- handleCategoriesError(error: any): void;
214
+ /**
215
+ * Handles successful loading of document types data.
216
+ * Updates document type options and validates form.
217
+ * @param documentTypes - Array of loaded document types
218
+ */
73
219
  handleDocumentTypesLoaded(documentTypes: DocumentTypeModel[]): void;
74
- handleDocumentTypesError(error: any): void;
220
+ /**
221
+ * Handles successful upload completion.
222
+ * Resets form and emits upload success event.
223
+ * @param response - The upload response from the server
224
+ */
75
225
  handleUploadSuccess(response: any): void;
226
+ /**
227
+ * Handles upload error.
228
+ * Resets saving state.
229
+ * @param error - The error that occurred during upload
230
+ */
76
231
  handleUploadError(error: any): void;
232
+ /**
233
+ * Filters applicants based on the selected assignment type.
234
+ * Updates the filtered applicant list.
235
+ */
77
236
  filterApplicants(): void;
237
+ /**
238
+ * Validates the current form state.
239
+ * Checks payload validation and emits form validation change if state changed.
240
+ */
78
241
  validateForm(): void;
242
+ /**
243
+ * Saves document metadata to the server.
244
+ * Prepares upload payload and calls business service to save.
245
+ */
79
246
  saveDocumentMetadata(): void;
247
+ /**
248
+ * Sets up a listener for file upload completion.
249
+ * Updates progress tracking and emits validation change when upload completes.
250
+ * @param file - The file to monitor for upload completion
251
+ */
252
+ setupFileUploadListener(file: File): void;
253
+ /**
254
+ * Handles errors during data loading operations.
255
+ * Resets loading state and can be extended for error logging.
256
+ * @param title - Error title for display
257
+ * @param error - The error object
258
+ * @param resetLoading - Callback to reset loading state
259
+ */
260
+ handleError(title: string, error: any, resetLoading: () => void): void;
261
+ /**
262
+ * Validates form and emits validation change event.
263
+ */
264
+ validateAndEmit(): void;
265
+ /**
266
+ * Emits form validation change event.
267
+ */
268
+ emitFormValidationChange(): void;
269
+ /**
270
+ * Lifecycle hook that is called when component is destroyed.
271
+ * Cleans up subscriptions and destroys services.
272
+ */
80
273
  ngOnDestroy(): void;
81
274
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadComponent, never>;
82
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentUploadComponent, "lib-document-upload", never, { "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
275
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentUploadComponent, "lib-document-upload", never, { "contextId": { "alias": "contextId"; "required": false; }; }, { "onFormValidationChange": "onFormValidationChange"; "onUploadSuccess": "onUploadSuccess"; }, never, never, false, never>;
83
276
  }
@@ -17,7 +17,18 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges {
17
17
  selectedMenuItemId: string | null;
18
18
  private storeCategories;
19
19
  constructor(documentStore: DocumentStore, documentQuery: DocumentQuery, documentMenuService: DocumentMenuService, documentHelperService: DocumentHelperService);
20
+ /**
21
+ * Initialize the component
22
+ * @returns {void}
23
+ * @memberof DocumentsMenuComponent
24
+ */
20
25
  ngOnInit(): void;
26
+ /**
27
+ * Handle changes to input properties
28
+ * @param {SimpleChanges} changes - The changes to the input properties
29
+ * @returns {void}
30
+ * @memberof DocumentsMenuComponent
31
+ */
21
32
  ngOnChanges(changes: SimpleChanges): void;
22
33
  /**
23
34
  * Gets the categories to use for the menu
@@ -44,13 +55,28 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges {
44
55
  * Handle deselection to ensure immediate visual feedback
45
56
  */
46
57
  private handleDeselection;
58
+ /**
59
+ * Handle the menu item selection
60
+ * @param {string} menuItemId - The ID of the menu item to select
61
+ */
47
62
  onSelectMenuItem(menuItemId: string): void;
63
+ /**
64
+ * Handle the menu item unselection
65
+ */
48
66
  onUnselectMenuItem(): void;
67
+ /**
68
+ * Get the selected menu item
69
+ * @returns {string | null} - The selected menu item
70
+ */
49
71
  getSelectedMenuItem(): string | null;
50
72
  /**
51
73
  * Handles contextId changes by clearing current selection and refreshing data
52
74
  */
53
75
  private handleContextIdChange;
76
+ /**
77
+ * Get the selected menu item id
78
+ * @returns {string | null} - The selected menu item id
79
+ */
54
80
  getSelectedMenuItemId(): string | null;
55
81
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentsMenuComponent, never>;
56
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>;
@@ -6,6 +6,8 @@ import { UserListModel } from '../../models/user-list.model';
6
6
  import { StatusDataModel } from '../../models/status-data.model';
7
7
  import { DocumentCategory } from '../../models/document-category.model';
8
8
  import { DocumentUploadComponent } from '../document-upload/document-upload.component';
9
+ import { DocumentHelperService } from '../../services/document.service';
10
+ import { SidebarComponent } from '../sidebar/sidebar.component';
9
11
  import * as i0 from "@angular/core";
10
12
  /**
11
13
  * The `FolderContainerComponent` is responsible for rendering a container
@@ -15,6 +17,7 @@ import * as i0 from "@angular/core";
15
17
  */
16
18
  export declare class FolderContainerComponent implements OnInit {
17
19
  private documentQuery;
20
+ private documentHelperService;
18
21
  /**
19
22
  * A list of documents passed as input to the component.
20
23
  * Represents the document data to be displayed in the folder container.
@@ -61,11 +64,15 @@ export declare class FolderContainerComponent implements OnInit {
61
64
  * Reference to the document upload component
62
65
  */
63
66
  documentUploadComponent: DocumentUploadComponent;
67
+ /**
68
+ * Reference to the sidebar component
69
+ */
70
+ sidebarComponent: SidebarComponent;
64
71
  /**
65
72
  * Tracks whether the save button should be disabled
66
73
  */
67
74
  isSaveButtonDisabled: boolean;
68
- constructor(documentQuery: DocumentQuery);
75
+ constructor(documentQuery: DocumentQuery, documentHelperService: DocumentHelperService);
69
76
  ngOnInit(): void;
70
77
  /**
71
78
  * Called when the view is initialized to set up the save button state
@@ -74,7 +81,11 @@ export declare class FolderContainerComponent implements OnInit {
74
81
  /**
75
82
  * Updates the save button disabled state based on the document upload component
76
83
  */
77
- private updateSaveButtonState;
84
+ updateSaveButtonState(): void;
85
+ /**
86
+ * Handles form validation changes from the document upload component
87
+ */
88
+ onFormValidationChange(): void;
78
89
  /**
79
90
  * Opens the document upload sidebar
80
91
  */
@@ -83,10 +94,22 @@ export declare class FolderContainerComponent implements OnInit {
83
94
  * Handles the document upload sidebar hide event
84
95
  */
85
96
  onDocumentUploadSidebarHide(): void;
97
+ /**
98
+ * Handles the document upload sidebar close event (when close button is clicked or sidebar is dismissed)
99
+ */
100
+ onDocumentUploadSidebarClose(): void;
86
101
  /**
87
102
  * Handles the document upload save event
88
103
  */
89
104
  onDocumentUploadSave(): void;
105
+ /**
106
+ * Handles successful document upload and refreshes data
107
+ */
108
+ onDocumentUploadSuccess(): void;
109
+ /**
110
+ * Handles document upload error
111
+ */
112
+ onDocumentUploadError(error: any): void;
90
113
  static ɵfac: i0.ɵɵFactoryDeclaration<FolderContainerComponent, never>;
91
114
  static ɵcmp: i0.ɵɵComponentDeclaration<FolderContainerComponent, "lib-folder-container", never, { "documentList": { "alias": "documentList"; "required": false; }; "folderList": { "alias": "folderList"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; "userList": { "alias": "userList"; "required": false; }; "statusData": { "alias": "statusData"; "required": false; }; "categories": { "alias": "categories"; "required": false; }; }, {}, never, never, false, never>;
92
115
  }
@@ -0,0 +1,63 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class SidebarComponent {
4
+ visible: boolean;
5
+ position: 'left' | 'right';
6
+ width: string;
7
+ title: string;
8
+ showCloseButton: boolean;
9
+ modal: boolean;
10
+ dismissible: boolean;
11
+ closeOnEscape: boolean;
12
+ baseZIndex: number;
13
+ autoZIndex: boolean;
14
+ styleClass: string;
15
+ appendTo: string;
16
+ blockScroll: boolean;
17
+ closeIcon: string;
18
+ showSaveButton: boolean;
19
+ saveButtonText: string;
20
+ saveButtonDisabled: boolean;
21
+ successMessage: string;
22
+ errorMessage: string;
23
+ visibleChange: EventEmitter<boolean>;
24
+ onShow: EventEmitter<void>;
25
+ onHide: EventEmitter<void>;
26
+ onSave: EventEmitter<void>;
27
+ showSuccessMessage: boolean;
28
+ showErrorMessage: boolean;
29
+ /**
30
+ * Opens the sidebar
31
+ */
32
+ open(): void;
33
+ /**
34
+ * Closes the sidebar
35
+ */
36
+ close(): void;
37
+ /**
38
+ * Toggles the sidebar visibility
39
+ */
40
+ toggle(): void;
41
+ /**
42
+ * Handles the close button click
43
+ */
44
+ onCloseClick(): void;
45
+ /**
46
+ * Handles the mask click (when dismissible is true)
47
+ */
48
+ onMaskClick(): void;
49
+ /**
50
+ * Shows success message and closes sidebar after delay
51
+ */
52
+ showSuccess(): void;
53
+ /**
54
+ * Shows error message
55
+ */
56
+ showError(message?: string): void;
57
+ /**
58
+ * Clears all messages
59
+ */
60
+ clearMessages(): void;
61
+ static ɵfac: i0.ɵɵFactoryDeclaration<SidebarComponent, never>;
62
+ static ɵcmp: i0.ɵɵComponentDeclaration<SidebarComponent, "lib-sidebar", never, { "visible": { "alias": "visible"; "required": false; }; "position": { "alias": "position"; "required": false; }; "width": { "alias": "width"; "required": false; }; "title": { "alias": "title"; "required": false; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; }; "modal": { "alias": "modal"; "required": false; }; "dismissible": { "alias": "dismissible"; "required": false; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; }; "autoZIndex": { "alias": "autoZIndex"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "blockScroll": { "alias": "blockScroll"; "required": false; }; "closeIcon": { "alias": "closeIcon"; "required": false; }; "showSaveButton": { "alias": "showSaveButton"; "required": false; }; "saveButtonText": { "alias": "saveButtonText"; "required": false; }; "saveButtonDisabled": { "alias": "saveButtonDisabled"; "required": false; }; "successMessage": { "alias": "successMessage"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; }, { "visibleChange": "visibleChange"; "onShow": "onShow"; "onHide": "onHide"; "onSave": "onSave"; }, never, ["[header]", "*"], false, never>;
63
+ }
@@ -14,7 +14,7 @@ import * as i12 from "./components/user-list/user-list.component";
14
14
  import * as i13 from "./components/document-status/document-status.component";
15
15
  import * as i14 from "./components/document-actions/document-actions.component";
16
16
  import * as i15 from "./components/document-search/document-search.component";
17
- import * as i16 from "./components/common-sidebar/common-sidebar.component";
17
+ import * as i16 from "./components/sidebar/sidebar.component";
18
18
  import * as i17 from "@angular/common";
19
19
  import * as i18 from "primeng/accordion";
20
20
  import * as i19 from "@angular/common/http";
@@ -47,6 +47,6 @@ import * as i39 from "../../Shared/shared.module";
47
47
  */
48
48
  export declare class DocumentModule {
49
49
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
50
- static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentHistoryComponent, typeof i9.DocumentDirective, typeof i10.LinkedDocumentComponent, typeof i11.DocumentsMenuComponent, typeof i12.UserListComponent, typeof i13.DocumentStatusComponent, typeof i14.DocumentActionsComponent, typeof i15.DocumentSearchComponent, typeof i16.CommonSidebarComponent], [typeof i17.CommonModule, typeof i18.AccordionModule, typeof i19.HttpClientModule, typeof i20.ButtonModule, typeof i21.SidebarModule, typeof i22.FileUploadModule, typeof i23.ProgressBarModule, typeof i24.BadgeModule, typeof i25.ListboxModule, typeof i26.CheckboxModule, typeof i27.RadioButtonModule, typeof i28.TimelineModule, typeof i29.InputTextareaModule, typeof i30.FormsModule, typeof i31.PdfViewerModule, typeof i32.DialogModule, typeof i33.DropdownModule, typeof i34.InputTextModule, typeof i35.MenuModule, typeof i36.PanelMenuModule, typeof i37.CardModule, typeof i38.TableModule, typeof i39.SharedModule, typeof i29.InputTextareaModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i14.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i9.DocumentDirective, typeof i15.DocumentSearchComponent, typeof i16.CommonSidebarComponent]>;
50
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentHistoryComponent, typeof i9.DocumentDirective, typeof i10.LinkedDocumentComponent, typeof i11.DocumentsMenuComponent, typeof i12.UserListComponent, typeof i13.DocumentStatusComponent, typeof i14.DocumentActionsComponent, typeof i15.DocumentSearchComponent, typeof i16.SidebarComponent], [typeof i17.CommonModule, typeof i18.AccordionModule, typeof i19.HttpClientModule, typeof i20.ButtonModule, typeof i21.SidebarModule, typeof i22.FileUploadModule, typeof i23.ProgressBarModule, typeof i24.BadgeModule, typeof i25.ListboxModule, typeof i26.CheckboxModule, typeof i27.RadioButtonModule, typeof i28.TimelineModule, typeof i29.InputTextareaModule, typeof i30.FormsModule, typeof i31.PdfViewerModule, typeof i32.DialogModule, typeof i33.DropdownModule, typeof i34.InputTextModule, typeof i35.MenuModule, typeof i36.PanelMenuModule, typeof i37.CardModule, typeof i38.TableModule, typeof i39.SharedModule, typeof i29.InputTextareaModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i14.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i9.DocumentDirective, typeof i15.DocumentSearchComponent, typeof i16.SidebarComponent]>;
51
51
  static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
52
52
  }
@@ -1,8 +1,6 @@
1
1
  import { DocumentHistoryItem, DocumentHistorySection } from '../models/document-history.model';
2
2
  import { DocumentHistoryStyleService } from './document-history-style.service';
3
3
  import { HttpClient } from '@angular/common/http';
4
- import { SessionService } from '../../../Shared/services/session.service';
5
- import { AppConfigService } from '../../../Shared/services/app-config.service';
6
4
  import * as i0 from "@angular/core";
7
5
  interface ProcessedDocumentHistoryItem extends DocumentHistoryItem {
8
6
  actionIcon: string;
@@ -19,9 +17,7 @@ interface ProcessedDocumentHistorySection extends DocumentHistorySection {
19
17
  export declare class DocumentHistoryService {
20
18
  private documentHistoryStyleService;
21
19
  private http;
22
- private sessionService;
23
- private appConfigService;
24
- constructor(documentHistoryStyleService: DocumentHistoryStyleService, http: HttpClient, sessionService: SessionService, appConfigService: AppConfigService);
20
+ constructor(documentHistoryStyleService: DocumentHistoryStyleService, http: HttpClient);
25
21
  /**
26
22
  * Get the CSS class for accordion styling based on the section's label
27
23
  */
@@ -40,18 +36,6 @@ export declare class DocumentHistoryService {
40
36
  * @param docName - The name of the document
41
37
  */
42
38
  downloadDocument(documentUrl: string, docName?: string): void;
43
- /**
44
- * Get the full URL for the document, handling relative URLs
45
- * @private
46
- * @param documentUrl - The document URL (can be relative or absolute)
47
- * @returns {string} The full URL
48
- */
49
- private getFullUrl;
50
- /**
51
- * Debug method to help identify issues when the library is used in the main project
52
- * @public
53
- */
54
- debugEnvironment(): void;
55
39
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryService, never>;
56
40
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHistoryService>;
57
41
  }
@@ -54,6 +54,13 @@ export declare class DocumentUploadBusinessService {
54
54
  * Checks if save button should be disabled
55
55
  */
56
56
  isSaveButtonDisabled(assignmentType: 'Applicant' | 'Application' | null, selectedCategory: string, selectedDocumentType: string, selectedApplicant: string, uploadedFiles: UploadedFile[], isSaving: boolean): boolean;
57
+ /**
58
+ * Validates the complete payload before save
59
+ */
60
+ validatePayload(assignmentType: 'Applicant' | 'Application' | null, selectedCategory: string, selectedDocumentType: string, selectedApplicant: string, uploadedFiles: UploadedFile[]): {
61
+ isValid: boolean;
62
+ message: string;
63
+ };
57
64
  /**
58
65
  * Prepares upload payload
59
66
  */
@@ -74,10 +81,10 @@ export declare class DocumentUploadBusinessService {
74
81
  * Resets form data to initial state
75
82
  */
76
83
  getInitialFormState(): {
77
- selectedAssignmentType: "Applicant";
78
- selectedApplicant: string;
79
- selectedCategory: string;
80
- selectedDocumentType: string;
84
+ selectedAssignmentType: null;
85
+ selectedApplicant: null;
86
+ selectedCategory: null;
87
+ selectedDocumentType: null;
81
88
  uploadedFiles: UploadedFile[];
82
89
  isFormValid: boolean;
83
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.2.57",
3
+ "version": "0.2.58",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"
package/public-api.d.ts CHANGED
@@ -5,7 +5,7 @@ export * from './lib/document/components/document-actions/document-actions.compo
5
5
  export * from './lib/document/components/document-history/document-history.component';
6
6
  export * from './lib/document/components/document-list/document-list.component';
7
7
  export * from './lib/document/components/document-search/document-search.component';
8
- export * from './lib/document/components/common-sidebar/common-sidebar.component';
8
+ export * from './lib/document/components/sidebar/sidebar.component';
9
9
  export * from './lib/document/models/document-history.model';
10
10
  export * from './lib/document/services/document-table-builder.service';
11
11
  export * from './lib/document/directives/document.directive';
@@ -1,47 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class CommonSidebarComponent {
4
- visible: boolean;
5
- position: 'left' | 'right';
6
- width: string;
7
- title: string;
8
- showCloseButton: boolean;
9
- modal: boolean;
10
- dismissible: boolean;
11
- closeOnEscape: boolean;
12
- baseZIndex: number;
13
- autoZIndex: boolean;
14
- styleClass: string;
15
- appendTo: string;
16
- blockScroll: boolean;
17
- closeIcon: string;
18
- showSaveButton: boolean;
19
- saveButtonText: string;
20
- saveButtonDisabled: boolean;
21
- visibleChange: EventEmitter<boolean>;
22
- onShow: EventEmitter<void>;
23
- onHide: EventEmitter<void>;
24
- onSave: EventEmitter<void>;
25
- /**
26
- * Opens the sidebar
27
- */
28
- open(): void;
29
- /**
30
- * Closes the sidebar
31
- */
32
- close(): void;
33
- /**
34
- * Toggles the sidebar visibility
35
- */
36
- toggle(): void;
37
- /**
38
- * Handles the close button click
39
- */
40
- onCloseClick(): void;
41
- /**
42
- * Handles the mask click (when dismissible is true)
43
- */
44
- onMaskClick(): void;
45
- static ɵfac: i0.ɵɵFactoryDeclaration<CommonSidebarComponent, never>;
46
- static ɵcmp: i0.ɵɵComponentDeclaration<CommonSidebarComponent, "lib-common-sidebar", never, { "visible": { "alias": "visible"; "required": false; }; "position": { "alias": "position"; "required": false; }; "width": { "alias": "width"; "required": false; }; "title": { "alias": "title"; "required": false; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; }; "modal": { "alias": "modal"; "required": false; }; "dismissible": { "alias": "dismissible"; "required": false; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; }; "autoZIndex": { "alias": "autoZIndex"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "blockScroll": { "alias": "blockScroll"; "required": false; }; "closeIcon": { "alias": "closeIcon"; "required": false; }; "showSaveButton": { "alias": "showSaveButton"; "required": false; }; "saveButtonText": { "alias": "saveButtonText"; "required": false; }; "saveButtonDisabled": { "alias": "saveButtonDisabled"; "required": false; }; }, { "visibleChange": "visibleChange"; "onShow": "onShow"; "onHide": "onHide"; "onSave": "onSave"; }, never, ["[header]", "*"], false, never>;
47
- }