@posiwise/shared-components 0.0.171 → 0.0.172

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.
@@ -1765,7 +1765,11 @@ class EntityGroupComponent extends AppBaseComponent {
1765
1765
  });
1766
1766
  }
1767
1767
  onDelete(memberId) {
1768
- HelperService.raiseDeletePopup()
1768
+ HelperService.confirmAction({
1769
+ title: this.translation.translate('Common.Confirm.Delete.Title', { entityType: 'member' }),
1770
+ text: this.translation.translate('Common.Confirm.Delete.TextSimple', { entityType: 'member' }),
1771
+ destructive: true
1772
+ })
1769
1773
  .then(resp => {
1770
1774
  if (resp.value) {
1771
1775
  const data = JSON.stringify([memberId]);
@@ -2014,10 +2018,11 @@ class GroupDefinitionComponent extends AppBaseComponent {
2014
2018
  onDelete(id) {
2015
2019
  swal.fire({
2016
2020
  title: 'Delete',
2017
- text: 'Are you sure you want to delete this label?',
2021
+ html: 'Are you sure you want to delete this <strong>label</strong>?',
2018
2022
  showCancelButton: true,
2019
2023
  reverseButtons: true,
2020
- icon: 'warning'
2024
+ icon: 'error',
2025
+ customClass: { popup: 'swal-destructive' }
2021
2026
  }).then(rep => {
2022
2027
  if (rep.value) {
2023
2028
  this.groupService.groupDefinitionsDelete(id).subscribe(_ => {
@@ -2231,10 +2236,11 @@ class GroupsComponent extends AppBaseComponent {
2231
2236
  onDelete(id) {
2232
2237
  swal.fire({
2233
2238
  title: 'Delete',
2234
- text: `Are you sure you want to delete this team?`,
2239
+ html: `Are you sure you want to delete this <strong>team</strong>?`,
2235
2240
  showCancelButton: true,
2236
2241
  reverseButtons: true,
2237
- icon: 'warning'
2242
+ icon: 'error',
2243
+ customClass: { popup: 'swal-destructive' }
2238
2244
  }).then(rep => {
2239
2245
  if (rep.value) {
2240
2246
  this.groupService.deleteGroup(id).subscribe(_ => {
@@ -2621,11 +2627,29 @@ class PasswordValidationComponent extends AppBaseComponent {
2621
2627
  super(injector);
2622
2628
  this.modal = modal;
2623
2629
  this.cdr = cdr;
2624
- this.confirmMessage = 'User.Account.Message.EnterPassword';
2630
+ this.destructive = false;
2625
2631
  this.successEvent = new EventEmitter();
2632
+ this.passwordVisible = false;
2633
+ }
2634
+ get bodyMessage() {
2635
+ if (this.confirmMessage) {
2636
+ return this.confirmMessage;
2637
+ }
2638
+ return this.destructive
2639
+ ? 'Common.Confirm.PasswordValidation.BodyDestructive'
2640
+ : 'Common.Confirm.PasswordValidation.Body';
2626
2641
  }
2627
2642
  open() {
2628
- this.modal.open(this.content, { centered: true, windowClass: 'modal-holder' });
2643
+ this.passwordVisible = false;
2644
+ this.password = null;
2645
+ this.modalRef = this.modal.open(this.content, {
2646
+ centered: true,
2647
+ size: 'md',
2648
+ windowClass: 'pw-password-confirm-modal',
2649
+ backdrop: 'static',
2650
+ keyboard: true
2651
+ });
2652
+ setTimeout(() => this.passwordRef?.nativeElement?.focus(), 0);
2629
2653
  }
2630
2654
  validatePassword() {
2631
2655
  if (this.password) {
@@ -2637,6 +2661,7 @@ class PasswordValidationComponent extends AppBaseComponent {
2637
2661
  this.successEvent.emit(true);
2638
2662
  this.modal.dismissAll();
2639
2663
  this.password = null;
2664
+ this.passwordVisible = false;
2640
2665
  }
2641
2666
  else {
2642
2667
  this.successEvent.emit(false);
@@ -2651,16 +2676,21 @@ class PasswordValidationComponent extends AppBaseComponent {
2651
2676
  }
2652
2677
  }
2653
2678
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: PasswordValidationComponent, deps: [{ token: i0.Injector }, { token: i4.NgbModal }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
2654
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: PasswordValidationComponent, isStandalone: false, selector: "pw-password-validation", inputs: { confirmMessage: "confirmMessage" }, outputs: { successEvent: "successEvent" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Confirm</h5>\n <button type=\"button\"\n class=\"btn-close float-end\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"modal-body\">\n <strong class=\"p3\">{{ confirmMessage | transloco }}</strong>\n <div>\n <ng-content></ng-content>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <input type=\"password\"\n #passwordRef\n [(ngModel)]=\"password\"\n class=\"form-control\"\n placeholder=\"Current Password\" id=\"input_password_992\" name=\"input_password_992\" />\n </div>\n </div>\n <div class=\"row mt-2\">\n <div class=\"col-12\">\n <button [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary float-end\"\n type=\"button\"\n (click)=\"validatePassword()\">\n {{ 'Button.Confirm' | transloco }}\n </button>\n </div>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$1.ButtonBusyDirective, selector: "[buttonBusy]", inputs: ["buttonBusy", "busyText"] }, { kind: "pipe", type: i1$2.TranslocoPipe, name: "transloco" }] }); }
2679
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: PasswordValidationComponent, isStandalone: false, selector: "pw-password-validation", inputs: { confirmMessage: "confirmMessage", destructive: "destructive" }, outputs: { successEvent: "successEvent" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, static: true }, { propertyName: "passwordRef", first: true, predicate: ["passwordRef"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #content\n let-modal>\n <div class=\"pw-password-confirm\"\n [class.pw-password-confirm--destructive]=\"destructive\">\n <div class=\"pw-password-confirm__header\">\n <span class=\"pw-password-confirm__icon\"\n aria-hidden=\"true\">\n <i [class]=\"destructive ? 'pi pi-exclamation-triangle' : 'pi pi-shield'\"></i>\n </span>\n <h5 class=\"pw-password-confirm__title\">\n {{ (destructive\n ? 'Common.Confirm.PasswordValidation.TitleDestructive'\n : 'Common.Confirm.PasswordValidation.Title') | transloco }}\n </h5>\n <button type=\"button\"\n class=\"btn-close pw-password-confirm__close\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n\n <div class=\"pw-password-confirm__body\">\n <p class=\"pw-password-confirm__message\">\n {{ bodyMessage | transloco }}\n </p>\n\n <ng-content></ng-content>\n\n <div class=\"pw-password-confirm__field\">\n <label class=\"pw-password-confirm__label\"\n for=\"pw-password-confirm-input\">\n {{ 'Common.Confirm.PasswordValidation.PasswordLabel' | transloco }}\n </label>\n <div class=\"pw-password-confirm__input-wrap\">\n <input #passwordRef\n [type]=\"passwordVisible ? 'text' : 'password'\"\n [(ngModel)]=\"password\"\n (keyup.enter)=\"validatePassword()\"\n class=\"form-control pw-password-confirm__input\"\n id=\"pw-password-confirm-input\"\n name=\"pw-password-confirm-input\"\n autocomplete=\"current-password\"\n [placeholder]=\"'Common.Confirm.PasswordValidation.PasswordPlaceholder' | transloco\" />\n <button type=\"button\"\n class=\"pw-password-confirm__reveal\"\n [attr.aria-label]=\"(passwordVisible\n ? 'Common.Confirm.PasswordValidation.HidePassword'\n : 'Common.Confirm.PasswordValidation.ShowPassword') | transloco\"\n [attr.aria-pressed]=\"passwordVisible\"\n (click)=\"passwordVisible = !passwordVisible\">\n <i [class]=\"passwordVisible ? 'pi pi-eye-slash' : 'pi pi-eye'\"\n aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"pw-password-confirm__footer\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"modal.dismiss()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n [buttonBusy]=\"buttonBusy\"\n [disabled]=\"!password\"\n [class]=\"destructive ? 'btn btn-danger' : 'btn btn-primary'\"\n (click)=\"validatePassword()\">\n {{ 'Button.Confirm' | transloco }}\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [".pw-password-confirm{padding:24px 24px 20px}.pw-password-confirm__header{display:flex;align-items:center;gap:12px;margin-bottom:16px}.pw-password-confirm__icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:9999px;background:#1769e11a;color:var(--first, #1769e1);font-size:16px;flex-shrink:0}.pw-password-confirm--destructive .pw-password-confirm__icon{background:#dc35451a;color:#dc3545}.pw-password-confirm__title{flex:1;margin:0;font-size:16px;font-weight:600;color:var(--titles, #222);line-height:1.3}.pw-password-confirm__close{flex-shrink:0}.pw-password-confirm__body{margin-bottom:20px}.pw-password-confirm__message{margin:0 0 16px;color:var(--text, #222);font-size:14px;line-height:1.5}.pw-password-confirm__field{margin-top:12px}.pw-password-confirm__label{display:block;margin-bottom:8px;font-size:13px;font-weight:500;color:var(--titles, #222)}.pw-password-confirm__input-wrap{position:relative}.pw-password-confirm__input{padding-right:40px}.pw-password-confirm__reveal{position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;background:transparent;border:0;border-radius:4px;color:#6b7280;cursor:pointer}.pw-password-confirm__reveal:hover,.pw-password-confirm__reveal:focus-visible{color:var(--titles, #222);background:#0000000a;outline:none}.pw-password-confirm__reveal i{font-size:14px}.pw-password-confirm__footer{display:flex;justify-content:flex-end;gap:8px}::ng-deep .pw-password-confirm-modal .modal-content{border-radius:12px;border:1px solid #e2e5ea;box-shadow:0 10px 30px #1018281f;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$1.ButtonBusyDirective, selector: "[buttonBusy]", inputs: ["buttonBusy", "busyText"] }, { kind: "pipe", type: i1$2.TranslocoPipe, name: "transloco" }] }); }
2655
2680
  }
2656
2681
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: PasswordValidationComponent, decorators: [{
2657
2682
  type: Component,
2658
- args: [{ selector: 'pw-password-validation', standalone: false, template: "<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Confirm</h5>\n <button type=\"button\"\n class=\"btn-close float-end\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"modal-body\">\n <strong class=\"p3\">{{ confirmMessage | transloco }}</strong>\n <div>\n <ng-content></ng-content>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <input type=\"password\"\n #passwordRef\n [(ngModel)]=\"password\"\n class=\"form-control\"\n placeholder=\"Current Password\" id=\"input_password_992\" name=\"input_password_992\" />\n </div>\n </div>\n <div class=\"row mt-2\">\n <div class=\"col-12\">\n <button [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary float-end\"\n type=\"button\"\n (click)=\"validatePassword()\">\n {{ 'Button.Confirm' | transloco }}\n </button>\n </div>\n </div>\n </div>\n</ng-template>\n" }]
2683
+ args: [{ selector: 'pw-password-validation', standalone: false, template: "<ng-template #content\n let-modal>\n <div class=\"pw-password-confirm\"\n [class.pw-password-confirm--destructive]=\"destructive\">\n <div class=\"pw-password-confirm__header\">\n <span class=\"pw-password-confirm__icon\"\n aria-hidden=\"true\">\n <i [class]=\"destructive ? 'pi pi-exclamation-triangle' : 'pi pi-shield'\"></i>\n </span>\n <h5 class=\"pw-password-confirm__title\">\n {{ (destructive\n ? 'Common.Confirm.PasswordValidation.TitleDestructive'\n : 'Common.Confirm.PasswordValidation.Title') | transloco }}\n </h5>\n <button type=\"button\"\n class=\"btn-close pw-password-confirm__close\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n\n <div class=\"pw-password-confirm__body\">\n <p class=\"pw-password-confirm__message\">\n {{ bodyMessage | transloco }}\n </p>\n\n <ng-content></ng-content>\n\n <div class=\"pw-password-confirm__field\">\n <label class=\"pw-password-confirm__label\"\n for=\"pw-password-confirm-input\">\n {{ 'Common.Confirm.PasswordValidation.PasswordLabel' | transloco }}\n </label>\n <div class=\"pw-password-confirm__input-wrap\">\n <input #passwordRef\n [type]=\"passwordVisible ? 'text' : 'password'\"\n [(ngModel)]=\"password\"\n (keyup.enter)=\"validatePassword()\"\n class=\"form-control pw-password-confirm__input\"\n id=\"pw-password-confirm-input\"\n name=\"pw-password-confirm-input\"\n autocomplete=\"current-password\"\n [placeholder]=\"'Common.Confirm.PasswordValidation.PasswordPlaceholder' | transloco\" />\n <button type=\"button\"\n class=\"pw-password-confirm__reveal\"\n [attr.aria-label]=\"(passwordVisible\n ? 'Common.Confirm.PasswordValidation.HidePassword'\n : 'Common.Confirm.PasswordValidation.ShowPassword') | transloco\"\n [attr.aria-pressed]=\"passwordVisible\"\n (click)=\"passwordVisible = !passwordVisible\">\n <i [class]=\"passwordVisible ? 'pi pi-eye-slash' : 'pi pi-eye'\"\n aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"pw-password-confirm__footer\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"modal.dismiss()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n [buttonBusy]=\"buttonBusy\"\n [disabled]=\"!password\"\n [class]=\"destructive ? 'btn btn-danger' : 'btn btn-primary'\"\n (click)=\"validatePassword()\">\n {{ 'Button.Confirm' | transloco }}\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [".pw-password-confirm{padding:24px 24px 20px}.pw-password-confirm__header{display:flex;align-items:center;gap:12px;margin-bottom:16px}.pw-password-confirm__icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:9999px;background:#1769e11a;color:var(--first, #1769e1);font-size:16px;flex-shrink:0}.pw-password-confirm--destructive .pw-password-confirm__icon{background:#dc35451a;color:#dc3545}.pw-password-confirm__title{flex:1;margin:0;font-size:16px;font-weight:600;color:var(--titles, #222);line-height:1.3}.pw-password-confirm__close{flex-shrink:0}.pw-password-confirm__body{margin-bottom:20px}.pw-password-confirm__message{margin:0 0 16px;color:var(--text, #222);font-size:14px;line-height:1.5}.pw-password-confirm__field{margin-top:12px}.pw-password-confirm__label{display:block;margin-bottom:8px;font-size:13px;font-weight:500;color:var(--titles, #222)}.pw-password-confirm__input-wrap{position:relative}.pw-password-confirm__input{padding-right:40px}.pw-password-confirm__reveal{position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;background:transparent;border:0;border-radius:4px;color:#6b7280;cursor:pointer}.pw-password-confirm__reveal:hover,.pw-password-confirm__reveal:focus-visible{color:var(--titles, #222);background:#0000000a;outline:none}.pw-password-confirm__reveal i{font-size:14px}.pw-password-confirm__footer{display:flex;justify-content:flex-end;gap:8px}::ng-deep .pw-password-confirm-modal .modal-content{border-radius:12px;border:1px solid #e2e5ea;box-shadow:0 10px 30px #1018281f;overflow:hidden}\n"] }]
2659
2684
  }], ctorParameters: () => [{ type: i0.Injector }, { type: i4.NgbModal }, { type: i0.ChangeDetectorRef }], propDecorators: { content: [{
2660
2685
  type: ViewChild,
2661
2686
  args: ['content', { static: true }]
2687
+ }], passwordRef: [{
2688
+ type: ViewChild,
2689
+ args: ['passwordRef']
2662
2690
  }], confirmMessage: [{
2663
2691
  type: Input
2692
+ }], destructive: [{
2693
+ type: Input
2664
2694
  }], successEvent: [{
2665
2695
  type: Output
2666
2696
  }] } });