cat-documents-ng 0.3.10 → 0.3.11

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.
@@ -242,6 +242,8 @@ export declare class SHARED {
242
242
  static DOCUMENT_DELETED_SUCCESSFULLY: string;
243
243
  static UNSAVED_CHANGES_ICON: string;
244
244
  static REMOVE: string;
245
+ static YES: string;
246
+ static NO: string;
245
247
  static CANCEL: string;
246
248
  static ACCEPT_ICON: string;
247
249
  static REJECT_ICON: string;
@@ -297,11 +297,13 @@ class SHARED {
297
297
  static USER_LIST = 'userList';
298
298
  static HYPEN = '-';
299
299
  static CATEGORIES = 'categories';
300
- static UNSAVED_CHANGES_MESSAGE = 'You will loose all the data that was filled in the respective fields.';
300
+ static UNSAVED_CHANGES_MESSAGE = 'You have unsaved changes. Are you sure you want to leave?';
301
301
  static UNSAVED_CHANGES_HEADER = 'Unsaved Changes';
302
302
  static DOCUMENT_DELETED_SUCCESSFULLY = 'Document deleted successfully';
303
303
  static UNSAVED_CHANGES_ICON = 'pi pi-exclamation-triangle';
304
304
  static REMOVE = 'Remove';
305
+ static YES = 'Yes';
306
+ static NO = 'No';
305
307
  static CANCEL = 'Cancel';
306
308
  static ACCEPT_ICON = 'pi pi-times';
307
309
  static REJECT_ICON = 'pi pi-check';
@@ -3542,8 +3544,8 @@ class ConfirmationDialogComponent {
3542
3544
  confirmationService;
3543
3545
  confirmationOptions = {
3544
3546
  message: 'Are you sure that you want to proceed?',
3545
- header: 'Confirmation',
3546
- icon: 'pi pi-exclamation-triangle',
3547
+ header: '',
3548
+ icon: '',
3547
3549
  acceptLabel: 'Yes',
3548
3550
  rejectLabel: 'No',
3549
3551
  acceptIcon: 'pi pi-check',
@@ -3584,8 +3586,8 @@ class ConfirmationDialogComponent {
3584
3586
  static confirm(confirmationService, options, acceptCallback, rejectCallback) {
3585
3587
  const defaultOptions = {
3586
3588
  message: 'Are you sure that you want to proceed?',
3587
- header: 'Confirmation',
3588
- icon: 'pi pi-exclamation-triangle',
3589
+ header: '',
3590
+ icon: '',
3589
3591
  acceptLabel: 'Yes',
3590
3592
  rejectLabel: 'No',
3591
3593
  acceptIcon: 'pi pi-check',
@@ -3673,13 +3675,10 @@ class SidebarComponent {
3673
3675
  showSuccessMessage = false;
3674
3676
  showErrorMessage = false;
3675
3677
  destroy$ = new Subject();
3676
- // Confirmation options for unsaved changes
3677
3678
  unsavedChangesConfirmationOptions = {
3678
3679
  message: SHARED.UNSAVED_CHANGES_MESSAGE,
3679
- header: SHARED.UNSAVED_CHANGES_HEADER,
3680
- icon: SHARED.UNSAVED_CHANGES_ICON,
3681
- acceptLabel: SHARED.REMOVE,
3682
- rejectLabel: SHARED.CANCEL,
3680
+ acceptLabel: SHARED.YES,
3681
+ rejectLabel: SHARED.NO,
3683
3682
  acceptIcon: SHARED.ACCEPT_ICON,
3684
3683
  rejectIcon: SHARED.REJECT_ICON,
3685
3684
  acceptButtonClass: SHARED.ACCEPT_BUTTON_STYLE_CLASS,
@@ -3693,7 +3692,6 @@ class SidebarComponent {
3693
3692
  * Only emits when actually closing, not when showing confirmation
3694
3693
  */
3695
3694
  onSidebarHide() {
3696
- // Only emit onHide if we're not showing confirmation
3697
3695
  if (!this.isShowingConfirmation) {
3698
3696
  this.onHide.emit();
3699
3697
  }
@@ -3703,9 +3701,7 @@ class SidebarComponent {
3703
3701
  * Intercepts automatic closing to show confirmation if needed
3704
3702
  */
3705
3703
  onVisibleChange(value) {
3706
- // If PrimeNG is trying to close the sidebar and we have unsaved changes
3707
3704
  if (!value && this.hasUnsavedChanges && !this.isShowingConfirmation) {
3708
- // Prevent the close and show confirmation
3709
3705
  this._visible = true;
3710
3706
  this.showUnsavedChangesConfirmation();
3711
3707
  return;
@@ -3766,13 +3762,13 @@ class SidebarComponent {
3766
3762
  */
3767
3763
  showUnsavedChangesConfirmation() {
3768
3764
  if (this.isShowingConfirmation) {
3769
- return; // Prevent multiple confirmations
3765
+ return;
3770
3766
  }
3771
3767
  this.isShowingConfirmation = true;
3772
3768
  ConfirmationDialogComponent.confirm(this.confirmationService, this.unsavedChangesConfirmationOptions, () => {
3773
3769
  this.isShowingConfirmation = false;
3774
3770
  this.close();
3775
- this.onClose.emit(); // Emit close event when user confirms
3771
+ this.onClose.emit();
3776
3772
  }, () => {
3777
3773
  this.isShowingConfirmation = false;
3778
3774
  });