cat-documents-ng 0.2.86 → 0.2.88

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.
@@ -31,6 +31,10 @@ export declare class DocumentSearchComponent implements OnInit, OnDestroy {
31
31
  * Clears the search input
32
32
  */
33
33
  onClearSearch(): void;
34
+ /**
35
+ * Clears all filters including search, menu item, user, and status selections
36
+ */
37
+ onClearAllFilters(): void;
34
38
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentSearchComponent, never>;
35
39
  static ɵcmp: i0.ɵɵComponentDeclaration<DocumentSearchComponent, "document-search", never, { "contextId": { "alias": "contextId"; "required": false; }; }, { "onActionClick": "onActionClick"; }, never, never, false, never>;
36
40
  }
@@ -72,6 +72,10 @@ export declare class FolderContainerComponent implements OnInit {
72
72
  * Tracks whether the save button should be disabled
73
73
  */
74
74
  isSaveButtonDisabled: boolean;
75
+ /**
76
+ * Tracks whether there are unsaved changes in the document upload form
77
+ */
78
+ hasUnsavedChanges: boolean;
75
79
  constructor(documentQuery: DocumentQuery, documentHelperService: DocumentHelperService);
76
80
  ngOnInit(): void;
77
81
  /**
@@ -86,6 +90,10 @@ export declare class FolderContainerComponent implements OnInit {
86
90
  * Handles form validation changes from the document upload component
87
91
  */
88
92
  onFormValidationChange(): void;
93
+ /**
94
+ * Checks if there are unsaved changes in the document upload form
95
+ */
96
+ private checkForUnsavedChanges;
89
97
  /**
90
98
  * Opens the document upload sidebar
91
99
  */
@@ -98,6 +106,10 @@ export declare class FolderContainerComponent implements OnInit {
98
106
  * Handles the document upload sidebar close event (when close button is clicked or sidebar is dismissed)
99
107
  */
100
108
  onDocumentUploadSidebarClose(): void;
109
+ /**
110
+ * Handles the document upload sidebar close with unsaved changes event
111
+ */
112
+ onDocumentUploadSidebarCloseWithUnsavedChanges(): void;
101
113
  /**
102
114
  * Handles the document upload save event
103
115
  */
@@ -1,7 +1,11 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { EventEmitter, OnDestroy, Injector } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- export declare class SidebarComponent {
4
- visible: boolean;
3
+ export declare class SidebarComponent implements OnDestroy {
4
+ private injector;
5
+ set visible(value: boolean);
6
+ get visible(): boolean;
7
+ private _visible;
8
+ private isProgrammaticallyClosing;
5
9
  position: 'left' | 'right';
6
10
  width: string;
7
11
  title: string;
@@ -20,12 +24,25 @@ export declare class SidebarComponent {
20
24
  saveButtonDisabled: boolean;
21
25
  successMessage: string;
22
26
  errorMessage: string;
27
+ hasUnsavedChanges: boolean;
23
28
  visibleChange: EventEmitter<boolean>;
24
29
  onShow: EventEmitter<void>;
25
30
  onHide: EventEmitter<void>;
26
31
  onSave: EventEmitter<void>;
32
+ onDiscardChanges: EventEmitter<void>;
27
33
  showSuccessMessage: boolean;
28
34
  showErrorMessage: boolean;
35
+ private destroy$;
36
+ private confirmationService;
37
+ constructor(injector: Injector);
38
+ /**
39
+ * Handles the onHide event from PrimeNG sidebar
40
+ */
41
+ onSidebarHide(): void;
42
+ /**
43
+ * Handles the visibleChange event from PrimeNG sidebar
44
+ */
45
+ onVisibleChange(value: boolean): void;
29
46
  /**
30
47
  * Opens the sidebar
31
48
  */
@@ -34,18 +51,38 @@ export declare class SidebarComponent {
34
51
  * Closes the sidebar
35
52
  */
36
53
  close(): void;
54
+ /**
55
+ * Closes the sidebar and discards all changes
56
+ */
57
+ closeAndDiscardChanges(): void;
37
58
  /**
38
59
  * Toggles the sidebar visibility
39
60
  */
40
61
  toggle(): void;
41
62
  /**
42
- * Handles the close button click
63
+ * Handles the close button click with unsaved changes check
43
64
  */
44
65
  onCloseClick(): void;
45
66
  /**
46
- * Handles the mask click (when dismissible is true)
67
+ * Handles the mask click (when dismissible is true) with unsaved changes check
47
68
  */
48
69
  onMaskClick(): void;
70
+ /**
71
+ * Handles the escape key press with unsaved changes check
72
+ */
73
+ onEscapeKey(event: KeyboardEvent): void;
74
+ /**
75
+ * Handles backdrop click with unsaved changes check
76
+ */
77
+ onBackdropClick(event: Event): void;
78
+ /**
79
+ * Handles close button click with unsaved changes check
80
+ */
81
+ onCloseButtonClick(): void;
82
+ /**
83
+ * Shows confirmation dialog for unsaved changes
84
+ */
85
+ private showUnsavedChangesConfirmation;
49
86
  /**
50
87
  * Shows success message and closes sidebar after delay
51
88
  */
@@ -58,6 +95,16 @@ export declare class SidebarComponent {
58
95
  * Clears all messages
59
96
  */
60
97
  clearMessages(): void;
98
+ /**
99
+ * Checks if there are unsaved changes
100
+ * @returns True if there are unsaved changes, false otherwise
101
+ */
102
+ checkForUnsavedChanges(): boolean;
103
+ /**
104
+ * Lifecycle hook that is called when component is destroyed.
105
+ * Cleans up subscriptions.
106
+ */
107
+ ngOnDestroy(): void;
61
108
  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>;
109
+ 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; }; "hasUnsavedChanges": { "alias": "hasUnsavedChanges"; "required": false; }; }, { "visibleChange": "visibleChange"; "onShow": "onShow"; "onHide": "onHide"; "onSave": "onSave"; "onDiscardChanges": "onDiscardChanges"; }, never, ["[header]", "*"], false, never>;
63
110
  }
@@ -40,6 +40,7 @@ import * as i38 from "primeng/table";
40
40
  import * as i39 from "../../Shared/shared.module";
41
41
  import * as i40 from "primeng/toast";
42
42
  import * as i41 from "primeng/confirmdialog";
43
+ import * as i42 from "primeng/tooltip";
43
44
  /**
44
45
  * @module DocumentModule
45
46
  *
@@ -49,6 +50,6 @@ import * as i41 from "primeng/confirmdialog";
49
50
  */
50
51
  export declare class DocumentModule {
51
52
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
52
- 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 i40.ToastModule, typeof i41.ConfirmDialogModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i14.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i9.DocumentDirective, typeof i15.DocumentSearchComponent, typeof i16.SidebarComponent]>;
53
+ 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 i40.ToastModule, typeof i41.ConfirmDialogModule, typeof i42.TooltipModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i14.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i9.DocumentDirective, typeof i15.DocumentSearchComponent, typeof i16.SidebarComponent]>;
53
54
  static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
54
55
  }
@@ -0,0 +1,7 @@
1
+ export interface UploadedFileResponse {
2
+ id?: string;
3
+ fileName: string;
4
+ contentType: string;
5
+ url: string;
6
+ size: string;
7
+ }
@@ -4,14 +4,17 @@ import { FileFormatService } from './file-format.service';
4
4
  import { UserListModel } from '../models/user-list.model';
5
5
  import { DocumentCategory } from '../models/document-category.model';
6
6
  import { DocumentTypeModel } from '../models/document-type.model';
7
+ import { UploadedFileResponse } from '../models/uploaded-file-response.model';
7
8
  import * as i0 from "@angular/core";
8
9
  export interface UploadedFile {
9
10
  file: File;
10
- formattedSize: string;
11
- progress: number;
12
- uploadResponse?: any;
11
+ formattedSize?: string;
12
+ progress?: number;
13
+ uploadResponse?: UploadedFileResponse;
13
14
  url?: string;
14
15
  contentType?: string;
16
+ fileName?: string;
17
+ size?: string;
15
18
  }
16
19
  export interface DocumentUploadPayload {
17
20
  source: 'Applicant' | 'Application';
@@ -25,6 +28,7 @@ export interface DocumentUploadPayload {
25
28
  uploadedFileId?: string;
26
29
  url?: string;
27
30
  contentType?: string;
31
+ size?: string;
28
32
  }[];
29
33
  }
30
34
  export declare class DocumentUploadBusinessService {
@@ -85,6 +85,15 @@ export declare class DocumentUploadService {
85
85
  * @returns {*} - The formdata object.
86
86
  */
87
87
  handleCreateFormData(uploadedFile?: File, contextId?: string): FormData | null;
88
+ /**
89
+ * Generic method to sort any list of objects by a specified property.
90
+ * Supports fallback properties if the primary property is undefined.
91
+ * @param list - Array of objects to sort
92
+ * @param primaryProperty - Primary property to sort by
93
+ * @param fallbackProperty - Optional fallback property if primary is undefined
94
+ * @returns Sorted array
95
+ */
96
+ sortListByProperty<T>(list: T[], primaryProperty: keyof T, fallbackProperty?: keyof T): T[];
88
97
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadService, never>;
89
98
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentUploadService>;
90
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.2.86",
3
+ "version": "0.2.88",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"
package/public-api.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './lib/document/components/document-list/document-list.component';
7
7
  export * from './lib/document/components/document-search/document-search.component';
8
8
  export * from './lib/document/components/sidebar/sidebar.component';
9
9
  export * from './lib/document/models/document-history.model';
10
+ export * from './lib/document/models/uploaded-file-response.model';
10
11
  export * from './lib/document/services/document-table-builder.service';
11
12
  export * from './lib/document/directives/document.directive';
12
13
  export * from './lib/document/directives/permission.directive';