cat-documents-ng 0.3.3 → 0.3.5

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,12 +1,13 @@
1
1
  import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { SHARED } from '../../../../Shared/constant/SHARED';
3
3
  import { DocumentActionsService, DocumentAction } from '../../services/document-actions.service';
4
- import { ConfirmationDialogComponent } from '../../../../Shared/components/confirmation-dialog/confirmation-dialog.component';
4
+ import { ConfirmationService } from 'primeng/api';
5
5
  import { SessionService } from '../../../../Shared/services/session.service';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class DocumentActionsComponent implements OnChanges {
8
8
  private documentActionsService;
9
9
  private sessionService;
10
+ private confirmationService;
10
11
  readonly SHARED: typeof SHARED;
11
12
  document?: any;
12
13
  documentId?: string;
@@ -29,8 +30,7 @@ export declare class DocumentActionsComponent implements OnChanges {
29
30
  showApproveRejectActions: boolean;
30
31
  showDeleteAction: boolean;
31
32
  showNoActions: boolean;
32
- confirmationDialog: ConfirmationDialogComponent;
33
- constructor(documentActionsService: DocumentActionsService, sessionService: SessionService);
33
+ constructor(documentActionsService: DocumentActionsService, sessionService: SessionService, confirmationService: ConfirmationService);
34
34
  get rejectNote(): string;
35
35
  set rejectNote(value: string);
36
36
  ngOnChanges(changes: SimpleChanges): void;
@@ -1,21 +1,29 @@
1
1
  import { EventEmitter, OnDestroy } from '@angular/core';
2
- import { ConfirmationDialogComponent, ConfirmationOptions } from '../../../../Shared/components/confirmation-dialog/confirmation-dialog.component';
2
+ import { ConfirmationService } from 'primeng/api';
3
3
  import * as i0 from "@angular/core";
4
+ interface ConfirmationOptions {
5
+ message: string;
6
+ header?: string;
7
+ icon?: string;
8
+ acceptLabel?: string;
9
+ rejectLabel?: string;
10
+ acceptIcon?: string;
11
+ rejectIcon?: string;
12
+ acceptButtonClass?: string;
13
+ rejectButtonClass?: string;
14
+ }
4
15
  export declare class SidebarComponent implements OnDestroy {
5
- confirmationDialog: ConfirmationDialogComponent;
16
+ private confirmationService;
17
+ private isShowingConfirmation;
6
18
  set visible(value: boolean);
7
19
  get visible(): boolean;
8
20
  private _visible;
9
- private isProgrammaticallyClosing;
10
21
  position: 'left' | 'right';
11
22
  width: string;
12
23
  title: string;
13
24
  showCloseButton: boolean;
14
25
  modal: boolean;
15
26
  dismissible: boolean;
16
- closeOnEscape: boolean;
17
- baseZIndex: number;
18
- autoZIndex: boolean;
19
27
  styleClass: string;
20
28
  appendTo: string;
21
29
  blockScroll: boolean;
@@ -30,18 +38,20 @@ export declare class SidebarComponent implements OnDestroy {
30
38
  onShow: EventEmitter<void>;
31
39
  onHide: EventEmitter<void>;
32
40
  onSave: EventEmitter<void>;
33
- onDiscardChanges: EventEmitter<void>;
41
+ onClose: EventEmitter<void>;
34
42
  showSuccessMessage: boolean;
35
43
  showErrorMessage: boolean;
36
44
  private destroy$;
37
45
  unsavedChangesConfirmationOptions: ConfirmationOptions;
38
- constructor();
46
+ constructor(confirmationService: ConfirmationService);
39
47
  /**
40
48
  * Handles the onHide event from PrimeNG sidebar
49
+ * Only emits when actually closing, not when showing confirmation
41
50
  */
42
51
  onSidebarHide(): void;
43
52
  /**
44
53
  * Handles the visibleChange event from PrimeNG sidebar
54
+ * Intercepts automatic closing to show confirmation if needed
45
55
  */
46
56
  onVisibleChange(value: boolean): void;
47
57
  /**
@@ -53,33 +63,20 @@ export declare class SidebarComponent implements OnDestroy {
53
63
  */
54
64
  close(): void;
55
65
  /**
56
- * Closes the sidebar and discards all changes
57
- */
58
- closeAndDiscardChanges(): void;
59
- /**
60
- * Toggles the sidebar visibility
61
- */
62
- toggle(): void;
63
- /**
64
- * Handles the close button click with unsaved changes check
65
- */
66
- onCloseClick(): void;
67
- /**
68
- * Handles the mask click (when dismissible is true) with unsaved changes check
69
- */
70
- onMaskClick(): void;
71
- /**
72
- * Handles the escape key press with unsaved changes check
66
+ * Handles escape key press
67
+ * Shows confirmation if there are unsaved changes
73
68
  */
74
- onEscapeKey(event: KeyboardEvent): void;
69
+ handleEscapeKey(event: KeyboardEvent): void;
75
70
  /**
76
- * Handles backdrop click with unsaved changes check
71
+ * Handles backdrop click events
72
+ * Prevents default PrimeNG behavior and shows confirmation if needed
77
73
  */
78
- onBackdropClick(event: Event): void;
74
+ handleBackdropClick(event: Event): void;
79
75
  /**
80
- * Handles close button click with unsaved changes check
76
+ * Handles all closing scenarios (backdrop click, escape key, close button, etc.)
77
+ * This is the single entry point for all closing logic
81
78
  */
82
- onCloseButtonClick(): void;
79
+ handleClose(): void;
83
80
  /**
84
81
  * Shows confirmation dialog for unsaved changes
85
82
  */
@@ -107,5 +104,6 @@ export declare class SidebarComponent implements OnDestroy {
107
104
  */
108
105
  ngOnDestroy(): void;
109
106
  static ɵfac: i0.ɵɵFactoryDeclaration<SidebarComponent, never>;
110
- 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>;
107
+ 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; }; "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"; "onClose": "onClose"; }, never, ["[header]", "*"], false, never>;
111
108
  }
109
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"