spiderly 19.7.3 → 19.7.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.
@@ -48,7 +48,7 @@ import * as i1$1 from 'primeng/api';
48
48
  import { ConfirmationService } from 'primeng/api';
49
49
  import * as i1$2 from '@angular/common/http';
50
50
  import { HttpParams, HttpHeaders, HttpErrorResponse, HttpResponse } from '@angular/common/http';
51
- import { map as map$1, finalize, delay, tap, filter, catchError } from 'rxjs/operators';
51
+ import { map as map$1, finalize, delay, tap, filter, takeUntil, catchError } from 'rxjs/operators';
52
52
  import * as i3$3 from '@abacritt/angularx-social-login';
53
53
  import { InputOtp } from 'primeng/inputotp';
54
54
  import * as i2$1 from 'primeng/menu';
@@ -3578,9 +3578,10 @@ class SpiderlyDeleteConfirmationComponent {
3578
3578
  this.config = config;
3579
3579
  }
3580
3580
  accept() {
3581
- const observable = this.config.data.deleteListFromTableObservableMethod
3582
- ? this.config.data.deleteListFromTableObservableMethod(this.config.data.ids)
3583
- : this.config.data.deleteItemFromTableObservableMethod(this.config.data.id);
3581
+ const data = this.config.data;
3582
+ const observable = 'deleteListFromTableObservableMethod' in data
3583
+ ? data.deleteListFromTableObservableMethod(data.ids)
3584
+ : data.deleteItemFromTableObservableMethod(data.id);
3584
3585
  observable.subscribe({
3585
3586
  next: () => {
3586
3587
  this.ref.close(true); // deleted succesfully
@@ -3594,11 +3595,11 @@ class SpiderlyDeleteConfirmationComponent {
3594
3595
  this.ref.close(false);
3595
3596
  }
3596
3597
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyDeleteConfirmationComponent, deps: [{ token: i1$5.DynamicDialogRef }, { token: i1$5.DynamicDialogConfig }], target: i0.ɵɵFactoryTarget.Component }); }
3597
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyDeleteConfirmationComponent, isStandalone: true, selector: "spiderly-delete-confirmation", providers: [ConfirmationService], ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <p-confirmDialog #cd></p-confirmDialog>\n <div\n class=\"border-b surface-border text-lg\"\n style=\"\n display: flex;\n align-items: center;\n padding-bottom: 10px;\n width: 100%;\n gap: 10px;\n \"\n >\n <i class=\"pi pi-exclamation-circle text-4xl\"></i>\n <p>{{ t(\"PleaseConfirmToProceed\") }}</p>\n </div>\n\n <div\n style=\"display: flex; gap: 12px; justify-content: right; margin-top: 28px\"\n >\n <spiderly-button\n (onClick)=\"reject()\"\n icon=\"pi pi-times\"\n [label]=\"t('Cancel')\"\n severity=\"secondary\"\n ></spiderly-button>\n <spiderly-button\n (onClick)=\"accept()\"\n icon=\"pi pi-check\"\n [label]=\"t('Confirm')\"\n styleClass=\"p-button-danger\"\n ></spiderly-button>\n </div>\n</ng-container>\n", dependencies: [{ kind: "component", type: SpiderlyButtonComponent, selector: "spiderly-button", inputs: ["type"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i2$2.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position", "draggable"], outputs: ["onHide"] }] }); }
3598
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyDeleteConfirmationComponent, isStandalone: true, selector: "spiderly-delete-confirmation", providers: [ConfirmationService], ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <p-confirmDialog #cd></p-confirmDialog>\n <div\n class=\"border-b surface-border text-lg\"\n style=\"\n display: flex;\n align-items: center;\n padding-bottom: 10px;\n width: 100%;\n gap: 10px;\n \"\n >\n <i class=\"pi pi-exclamation-circle text-4xl\"></i>\n <p>{{ config.data.message }}</p>\n </div>\n\n <div\n style=\"display: flex; gap: 12px; justify-content: right; margin-top: 28px\"\n >\n <spiderly-button\n (onClick)=\"reject()\"\n icon=\"pi pi-times\"\n [label]=\"t('Cancel')\"\n severity=\"secondary\"\n ></spiderly-button>\n <spiderly-button\n (onClick)=\"accept()\"\n icon=\"pi pi-check\"\n [label]=\"t('Confirm')\"\n styleClass=\"p-button-danger\"\n ></spiderly-button>\n </div>\n</ng-container>\n", dependencies: [{ kind: "component", type: SpiderlyButtonComponent, selector: "spiderly-button", inputs: ["type"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i2$2.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position", "draggable"], outputs: ["onHide"] }] }); }
3598
3599
  }
3599
3600
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyDeleteConfirmationComponent, decorators: [{
3600
3601
  type: Component,
3601
- args: [{ selector: 'spiderly-delete-confirmation', imports: [SpiderlyButtonComponent, TranslocoDirective, ConfirmDialogModule], providers: [ConfirmationService], template: "<ng-container *transloco=\"let t\">\n <p-confirmDialog #cd></p-confirmDialog>\n <div\n class=\"border-b surface-border text-lg\"\n style=\"\n display: flex;\n align-items: center;\n padding-bottom: 10px;\n width: 100%;\n gap: 10px;\n \"\n >\n <i class=\"pi pi-exclamation-circle text-4xl\"></i>\n <p>{{ t(\"PleaseConfirmToProceed\") }}</p>\n </div>\n\n <div\n style=\"display: flex; gap: 12px; justify-content: right; margin-top: 28px\"\n >\n <spiderly-button\n (onClick)=\"reject()\"\n icon=\"pi pi-times\"\n [label]=\"t('Cancel')\"\n severity=\"secondary\"\n ></spiderly-button>\n <spiderly-button\n (onClick)=\"accept()\"\n icon=\"pi pi-check\"\n [label]=\"t('Confirm')\"\n styleClass=\"p-button-danger\"\n ></spiderly-button>\n </div>\n</ng-container>\n" }]
3602
+ args: [{ selector: 'spiderly-delete-confirmation', imports: [SpiderlyButtonComponent, TranslocoDirective, ConfirmDialogModule], providers: [ConfirmationService], template: "<ng-container *transloco=\"let t\">\n <p-confirmDialog #cd></p-confirmDialog>\n <div\n class=\"border-b surface-border text-lg\"\n style=\"\n display: flex;\n align-items: center;\n padding-bottom: 10px;\n width: 100%;\n gap: 10px;\n \"\n >\n <i class=\"pi pi-exclamation-circle text-4xl\"></i>\n <p>{{ config.data.message }}</p>\n </div>\n\n <div\n style=\"display: flex; gap: 12px; justify-content: right; margin-top: 28px\"\n >\n <spiderly-button\n (onClick)=\"reject()\"\n icon=\"pi pi-times\"\n [label]=\"t('Cancel')\"\n severity=\"secondary\"\n ></spiderly-button>\n <spiderly-button\n (onClick)=\"accept()\"\n icon=\"pi pi-check\"\n [label]=\"t('Confirm')\"\n styleClass=\"p-button-danger\"\n ></spiderly-button>\n </div>\n</ng-container>\n" }]
3602
3603
  }], ctorParameters: () => [{ type: i1$5.DynamicDialogRef }, { type: i1$5.DynamicDialogConfig }] });
3603
3604
 
3604
3605
  class SpiderlyDataTableComponent {
@@ -3610,6 +3611,7 @@ class SpiderlyDataTableComponent {
3610
3611
  this.translocoService = translocoService;
3611
3612
  this.configService = configService;
3612
3613
  this.locale = locale;
3614
+ this.destroy$ = new Subject();
3613
3615
  this.tableIcon = 'pi pi-list';
3614
3616
  this.showPaginator = true; // Pass only when hasLazyLoad === false
3615
3617
  this.showCardWrapper = false;
@@ -3882,6 +3884,7 @@ class SpiderlyDataTableComponent {
3882
3884
  this.openDeleteConfirmation({
3883
3885
  deleteItemFromTableObservableMethod: this.deleteItemFromTableObservableMethod,
3884
3886
  id: rowId,
3887
+ message: this.translocoService.translate('PleaseConfirmToProceed'),
3885
3888
  }, 'SuccessfullyDeletedMessage');
3886
3889
  }
3887
3890
  deleteSelectedObjects() {
@@ -3891,6 +3894,9 @@ class SpiderlyDataTableComponent {
3891
3894
  this.openDeleteConfirmation({
3892
3895
  deleteListFromTableObservableMethod: this.deleteListFromTableObservableMethod,
3893
3896
  ids: selectedIds,
3897
+ message: this.translocoService.translate('DeleteBulkConfirmation', {
3898
+ count: selectedIds.length,
3899
+ }),
3894
3900
  }, 'SuccessfullyDeletedListMessage', () => this.resetSelection());
3895
3901
  }
3896
3902
  openDeleteConfirmation(data, successMessageKey, onSuccess) {
@@ -3899,7 +3905,9 @@ class SpiderlyDataTableComponent {
3899
3905
  width: '400px',
3900
3906
  data,
3901
3907
  });
3902
- this.deleteRef.onClose.subscribe((deletedSuccessfully) => {
3908
+ this.deleteRef.onClose
3909
+ .pipe(takeUntil(this.destroy$))
3910
+ .subscribe((deletedSuccessfully) => {
3903
3911
  if (deletedSuccessfully === true) {
3904
3912
  this.messageService.successMessage(this.translocoService.translate(successMessageKey));
3905
3913
  onSuccess?.();
@@ -3907,6 +3915,10 @@ class SpiderlyDataTableComponent {
3907
3915
  }
3908
3916
  });
3909
3917
  }
3918
+ ngOnDestroy() {
3919
+ this.destroy$.next();
3920
+ this.destroy$.complete();
3921
+ }
3910
3922
  get showSelectAllCheckbox() {
3911
3923
  return (this.selectionMode === 'multiple' &&
3912
3924
  this.selectedLazyLoadObservableMethod != null);