brainloper-ui 1.0.0 → 1.0.2

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.
@@ -99,6 +99,8 @@ class MessageService {
99
99
  constructor(dialog) {
100
100
  this.dialog = dialog;
101
101
  this.loadingNow = false;
102
+ this.warningQueue = [];
103
+ this.showingWarning = false;
102
104
  }
103
105
  openLoading(title, message) {
104
106
  if (!this.loadingNow) {
@@ -166,28 +168,50 @@ class MessageService {
166
168
  });
167
169
  });
168
170
  }
169
- Warning(title, message, showCancelButton = false, confirmButtonText = 'Aceptar', cancelButtonText = 'Cancelar') {
171
+ Warning(title, message, showCancelButton = false, confirmButtonText = 'Aceptar', cancelButtonText = 'Cancelar', allowOutsideClick = false) {
170
172
  return new Promise((resolve, reject) => {
171
- Swal.fire({
173
+ const warningData = {
172
174
  title: title,
173
- text: message,
174
- icon: 'warning',
175
+ message: message,
175
176
  showCancelButton: showCancelButton,
176
177
  confirmButtonText: confirmButtonText,
177
178
  cancelButtonText: cancelButtonText,
179
+ resolve: resolve,
180
+ allowOutsideClick
181
+ };
182
+ this.warningQueue.push(warningData);
183
+ if (!this.showingWarning) {
184
+ this.showNextWarning();
185
+ }
186
+ });
187
+ }
188
+ showNextWarning() {
189
+ if (this.warningQueue.length > 0) {
190
+ this.showingWarning = true;
191
+ const warningData = this.warningQueue.shift();
192
+ Swal.fire({
193
+ title: warningData.title,
194
+ text: warningData.message,
195
+ icon: 'warning',
196
+ showCancelButton: warningData.showCancelButton,
197
+ confirmButtonText: warningData.confirmButtonText,
198
+ cancelButtonText: warningData.cancelButtonText,
178
199
  customClass: {
179
200
  confirmButton: 'confirm-button-class',
180
201
  cancelButton: 'cancel-button-class',
181
- }
202
+ },
203
+ allowOutsideClick: warningData.allowOutsideClick,
182
204
  }).then((result) => {
205
+ this.showingWarning = false;
183
206
  if (result.value) {
184
- resolve(true);
207
+ warningData.resolve(true);
185
208
  }
186
209
  else if (result.dismiss === Swal.DismissReason.cancel) {
187
- resolve(false);
210
+ warningData.resolve(false);
188
211
  }
212
+ this.showNextWarning();
189
213
  });
190
- });
214
+ }
191
215
  }
192
216
  Info(title, message, showCancelButton = false, confirmButtonText = 'Aceptar', cancelButtonText = 'Cancelar') {
193
217
  return new Promise((resolve, reject) => {
@@ -490,10 +514,10 @@ class TableModalComponent {
490
514
  }
491
515
  }
492
516
  TableModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TableModalComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i10.FormBuilder }, { token: HttpService }], target: i0.ɵɵFactoryTarget.Component });
493
- TableModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: TableModalComponent, selector: "app-table-modal", ngImport: i0, template: "<div>\r\n <div style='display:flex; justify-content: space-between;'>\r\n <div>\r\n <strong>\r\n <h3 *ngIf='data.action==\"edit\"'> Editar </h3>\r\n <h3 *ngIf='data.action==\"add\"'> Agregar </h3>\r\n </strong>\r\n </div>\r\n <div mat-dialog-close>\r\n <i class=\"fa fa-times-circle\" style=\"font-size: 150%; position: relative;\"></i>\r\n </div>\r\n </div>\r\n\r\n <form>\r\n\r\n <div *ngFor='let input of data.columns'>\r\n\r\n\r\n\r\n <div *ngIf='data.action==\"edit\"; else Agregar'>\r\n <mat-form-field *ngIf=\"!input.disregardForEdit\">\r\n <div *ngIf='input.type==\"combo\"; else otherInputEdit'>\r\n\r\n <mat-select [value]='input.value' (selectionChange)='onChange(input.ID,$event, input.type)'\r\n placeholder='{{input.paramsCombo.visibleField}}'>\r\n <mat-option *ngFor='let data of dataCombo[input.ID]'\r\n value='{{data[input.paramsCombo.selectionField]}}'>\r\n {{data[input.paramsCombo.visibleField]}}</mat-option>\r\n </mat-select>\r\n </div>\r\n\r\n <ng-template #otherInputEdit>\r\n <input [type]='input.type' [name]='input.ID' [value]='input.value'\r\n (input)='onChange(input.ID,$event, input.type)' matInput [placeholder]='input.label' />\r\n </ng-template>\r\n\r\n <mat-error>Campo Obligatorio</mat-error>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <ng-template #Agregar>\r\n <mat-form-field *ngIf=\"!input.disregardForAdd\">\r\n <div *ngIf='input.type==\"combo\"; else otherInput'>\r\n\r\n <mat-select (selectionChange)='onChange(input.ID,$event, input.type)' placeholder='{{input.label}}'>\r\n <mat-option *ngFor='let data of dataCombo[input.ID]'\r\n value='{{data[input.paramsCombo.selectionField]}}'>\r\n {{data[input.paramsCombo.visibleField]}}</mat-option>\r\n </mat-select>\r\n\r\n </div>\r\n\r\n <ng-template #otherInput>\r\n <input [type]='input.type' [name]='input.ID' (input)='onChange(input.ID, $event, input.type)'\r\n matInput [placeholder]='input.label' />\r\n\r\n </ng-template>\r\n <mat-error>Campo Obligatorio</mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n\r\n\r\n\r\n\r\n </div>\r\n\r\n <button *ngIf='data.action==\"add\" || data.action==\"edit\"' (click)='onSubmit()' color='primary' mat-raised-button>Guardar</button>\r\n\r\n </form>\r\n</div>\r\n\r\n", styles: ["button{width:100%}mat-form-field{width:100%}\n"], components: [{ type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i3$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { type: i10.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i10.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i10.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3.MatError, selector: "mat-error", inputs: ["id"] }] });
517
+ TableModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: TableModalComponent, selector: "app-table-modal", ngImport: i0, template: "<div>\r\n <div style='display:flex; justify-content: space-between;'>\r\n <div>\r\n <strong>\r\n <h3 *ngIf='data.action==\"edit\"'> Editar </h3>\r\n <h3 *ngIf='data.action==\"add\"'> Agregar </h3>\r\n </strong>\r\n </div>\r\n <div mat-dialog-close>\r\n <i class=\"fa fa-times-circle\" style=\"font-size: 150%; position: relative;\"></i>\r\n </div>\r\n </div>\r\n\r\n <form>\r\n\r\n <div *ngFor='let input of data.columns'>\r\n\r\n\r\n\r\n <div *ngIf='data.action==\"edit\"; else Agregar'>\r\n <mat-form-field *ngIf=\"!input.disregardForEdit\">\r\n <div *ngIf='input.type==\"combo\"; else otherInputEdit'>\r\n\r\n <mat-select [value]='input.value' (selectionChange)='onChange(input.ID,$event, input.type)'\r\n placeholder='{{input.paramsCombo.visibleField}}'>\r\n <mat-option *ngFor='let data of dataCombo[input.ID]'\r\n value='{{data[input.paramsCombo.selectionField]}}'>\r\n {{data[input.paramsCombo.visibleField]}}</mat-option>\r\n </mat-select>\r\n </div>\r\n\r\n <ng-template #otherInputEdit>\r\n <input [type]='input.type' [name]='input.ID' [value]='input.value'\r\n (input)='onChange(input.ID,$event, input.type)' matInput [placeholder]='input.label' [required]=\"input.required\" />\r\n </ng-template>\r\n\r\n <mat-error>Campo Obligatorio</mat-error>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <ng-template #Agregar>\r\n <mat-form-field *ngIf=\"!input.disregardForAdd\">\r\n <div *ngIf='input.type==\"combo\"; else otherInput'>\r\n\r\n <mat-select (selectionChange)='onChange(input.ID,$event, input.type)' placeholder='{{input.label}}'>\r\n <mat-option *ngFor='let data of dataCombo[input.ID]'\r\n value='{{data[input.paramsCombo.selectionField]}}'>\r\n {{data[input.paramsCombo.visibleField]}}</mat-option>\r\n </mat-select>\r\n\r\n </div>\r\n\r\n <ng-template #otherInput>\r\n <input [type]='input.type' [name]='input.ID' (input)='onChange(input.ID, $event, input.type)'\r\n matInput [placeholder]='input.label' [required]=\"input.required\" />\r\n\r\n </ng-template>\r\n <mat-error>Campo Obligatorio</mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n\r\n\r\n\r\n\r\n </div>\r\n\r\n <button *ngIf='data.action==\"add\" || data.action==\"edit\"' (click)='onSubmit()' color='primary' mat-raised-button>Guardar</button>\r\n\r\n </form>\r\n</div>\r\n\r\n", styles: ["button{width:100%}mat-form-field{width:100%}\n"], components: [{ type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i3$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { type: i10.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i10.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i10.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3.MatError, selector: "mat-error", inputs: ["id"] }] });
494
518
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TableModalComponent, decorators: [{
495
519
  type: Component,
496
- args: [{ selector: 'app-table-modal', template: "<div>\r\n <div style='display:flex; justify-content: space-between;'>\r\n <div>\r\n <strong>\r\n <h3 *ngIf='data.action==\"edit\"'> Editar </h3>\r\n <h3 *ngIf='data.action==\"add\"'> Agregar </h3>\r\n </strong>\r\n </div>\r\n <div mat-dialog-close>\r\n <i class=\"fa fa-times-circle\" style=\"font-size: 150%; position: relative;\"></i>\r\n </div>\r\n </div>\r\n\r\n <form>\r\n\r\n <div *ngFor='let input of data.columns'>\r\n\r\n\r\n\r\n <div *ngIf='data.action==\"edit\"; else Agregar'>\r\n <mat-form-field *ngIf=\"!input.disregardForEdit\">\r\n <div *ngIf='input.type==\"combo\"; else otherInputEdit'>\r\n\r\n <mat-select [value]='input.value' (selectionChange)='onChange(input.ID,$event, input.type)'\r\n placeholder='{{input.paramsCombo.visibleField}}'>\r\n <mat-option *ngFor='let data of dataCombo[input.ID]'\r\n value='{{data[input.paramsCombo.selectionField]}}'>\r\n {{data[input.paramsCombo.visibleField]}}</mat-option>\r\n </mat-select>\r\n </div>\r\n\r\n <ng-template #otherInputEdit>\r\n <input [type]='input.type' [name]='input.ID' [value]='input.value'\r\n (input)='onChange(input.ID,$event, input.type)' matInput [placeholder]='input.label' />\r\n </ng-template>\r\n\r\n <mat-error>Campo Obligatorio</mat-error>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <ng-template #Agregar>\r\n <mat-form-field *ngIf=\"!input.disregardForAdd\">\r\n <div *ngIf='input.type==\"combo\"; else otherInput'>\r\n\r\n <mat-select (selectionChange)='onChange(input.ID,$event, input.type)' placeholder='{{input.label}}'>\r\n <mat-option *ngFor='let data of dataCombo[input.ID]'\r\n value='{{data[input.paramsCombo.selectionField]}}'>\r\n {{data[input.paramsCombo.visibleField]}}</mat-option>\r\n </mat-select>\r\n\r\n </div>\r\n\r\n <ng-template #otherInput>\r\n <input [type]='input.type' [name]='input.ID' (input)='onChange(input.ID, $event, input.type)'\r\n matInput [placeholder]='input.label' />\r\n\r\n </ng-template>\r\n <mat-error>Campo Obligatorio</mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n\r\n\r\n\r\n\r\n </div>\r\n\r\n <button *ngIf='data.action==\"add\" || data.action==\"edit\"' (click)='onSubmit()' color='primary' mat-raised-button>Guardar</button>\r\n\r\n </form>\r\n</div>\r\n\r\n", styles: ["button{width:100%}mat-form-field{width:100%}\n"] }]
520
+ args: [{ selector: 'app-table-modal', template: "<div>\r\n <div style='display:flex; justify-content: space-between;'>\r\n <div>\r\n <strong>\r\n <h3 *ngIf='data.action==\"edit\"'> Editar </h3>\r\n <h3 *ngIf='data.action==\"add\"'> Agregar </h3>\r\n </strong>\r\n </div>\r\n <div mat-dialog-close>\r\n <i class=\"fa fa-times-circle\" style=\"font-size: 150%; position: relative;\"></i>\r\n </div>\r\n </div>\r\n\r\n <form>\r\n\r\n <div *ngFor='let input of data.columns'>\r\n\r\n\r\n\r\n <div *ngIf='data.action==\"edit\"; else Agregar'>\r\n <mat-form-field *ngIf=\"!input.disregardForEdit\">\r\n <div *ngIf='input.type==\"combo\"; else otherInputEdit'>\r\n\r\n <mat-select [value]='input.value' (selectionChange)='onChange(input.ID,$event, input.type)'\r\n placeholder='{{input.paramsCombo.visibleField}}'>\r\n <mat-option *ngFor='let data of dataCombo[input.ID]'\r\n value='{{data[input.paramsCombo.selectionField]}}'>\r\n {{data[input.paramsCombo.visibleField]}}</mat-option>\r\n </mat-select>\r\n </div>\r\n\r\n <ng-template #otherInputEdit>\r\n <input [type]='input.type' [name]='input.ID' [value]='input.value'\r\n (input)='onChange(input.ID,$event, input.type)' matInput [placeholder]='input.label' [required]=\"input.required\" />\r\n </ng-template>\r\n\r\n <mat-error>Campo Obligatorio</mat-error>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <ng-template #Agregar>\r\n <mat-form-field *ngIf=\"!input.disregardForAdd\">\r\n <div *ngIf='input.type==\"combo\"; else otherInput'>\r\n\r\n <mat-select (selectionChange)='onChange(input.ID,$event, input.type)' placeholder='{{input.label}}'>\r\n <mat-option *ngFor='let data of dataCombo[input.ID]'\r\n value='{{data[input.paramsCombo.selectionField]}}'>\r\n {{data[input.paramsCombo.visibleField]}}</mat-option>\r\n </mat-select>\r\n\r\n </div>\r\n\r\n <ng-template #otherInput>\r\n <input [type]='input.type' [name]='input.ID' (input)='onChange(input.ID, $event, input.type)'\r\n matInput [placeholder]='input.label' [required]=\"input.required\" />\r\n\r\n </ng-template>\r\n <mat-error>Campo Obligatorio</mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n\r\n\r\n\r\n\r\n </div>\r\n\r\n <button *ngIf='data.action==\"add\" || data.action==\"edit\"' (click)='onSubmit()' color='primary' mat-raised-button>Guardar</button>\r\n\r\n </form>\r\n</div>\r\n\r\n", styles: ["button{width:100%}mat-form-field{width:100%}\n"] }]
497
521
  }], ctorParameters: function () { return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
498
522
  type: Inject,
499
523
  args: [MAT_DIALOG_DATA]