@gravitee/ui-particles-angular 4.10.3 → 4.10.4

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.
@@ -65,6 +65,7 @@
65
65
  */
66
66
  this.invalidState = false;
67
67
  this.creationMode = false;
68
+ this.hasSubmitLock = true;
68
69
  this.resetClicked = new i0.EventEmitter();
69
70
  this.submitted = new i0.EventEmitter();
70
71
  this.submittedInvalidState = new i0.EventEmitter();
@@ -96,6 +97,9 @@
96
97
  }
97
98
  this.resetClicked.emit();
98
99
  };
100
+ GioSaveBarComponent.prototype.onDisableSubmitLock = function () {
101
+ this.hasSubmitLock = true;
102
+ };
99
103
  GioSaveBarComponent.prototype.onSubmitClicked = function () {
100
104
  var _this = this;
101
105
  var _a;
@@ -104,8 +108,11 @@
104
108
  this.submittedInvalidState.emit();
105
109
  return;
106
110
  }
107
- if (!this.isSubmitted) {
108
- this.submitted.emit();
111
+ if (this.isSubmitted) {
112
+ return;
113
+ }
114
+ this.submitted.emit();
115
+ if (this.hasSubmitLock) {
109
116
  this.isSubmitted = true;
110
117
  rxjs.timer(2000).subscribe(function () { return (_this.isSubmitted = false); });
111
118
  }
@@ -113,7 +120,7 @@
113
120
  return GioSaveBarComponent;
114
121
  }());
115
122
  GioSaveBarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: GioSaveBarComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
116
- GioSaveBarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: GioSaveBarComponent, selector: "gio-save-bar", inputs: { opened: "opened", invalidState: "invalidState", creationMode: "creationMode", form: "form", formInitialValues: "formInitialValues" }, outputs: { resetClicked: "resetClicked", submitted: "submitted", submittedInvalidState: "submittedInvalidState" }, host: { properties: { "class.save-bar-sticky": "this.isSticky", "class.is-open": "this.isOpen" } }, ngImport: i0__namespace, template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div *ngIf=\"isOpen\" [@slideUpDown] [@.disabled]=\"creationMode\">\n <mat-card class=\"save-bar__content\" [class.mat-elevation-z3]=\"creationMode\" [class.mat-elevation-z6]=\"!creationMode\">\n <div class=\"save-bar__content__label\">{{ creationMode ? '' : 'You have unsaved changes' }}</div>\n <div>\n <button *ngIf=\"!creationMode\" class=\"save-bar__content__reset-button\" mat-button type=\"button\" (click)=\"onResetClicked()\">\n Discard\n </button>\n <button\n class=\"save-bar__content__submit-button\"\n [class.invalid]=\"(form && form.invalid) || invalidState\"\n mat-flat-button\n color=\"primary\"\n [type]=\"form ? 'submit' : 'button'\"\n (click)=\"onSubmitClicked()\"\n >\n {{ creationMode ? 'Create' : 'Save' }}\n </button>\n </div>\n </mat-card>\n</div>\n", styles: [":host{z-index:1000;display:block;height:68px;margin-top:32px;visibility:hidden}:host.is-open{visibility:visible}:host(.save-bar-sticky){position:sticky;bottom:0;margin-right:-16px;margin-left:-16px}.save-bar__content{display:flex;height:100%;align-items:center;justify-content:space-between;padding:16px 24px}.save-bar__content__label{font:400 14px / 20px \"Golos UI\",Roboto,\"Helvetica Neue\",sans-serif;letter-spacing:.4px}.save-bar__content__reset-button{margin-right:16px}.save-bar__content__submit-button.invalid{background-color:#d6ffff;color:#000}.save-bar__content__submit-button.invalid:hover:enabled{background-color:#099;color:#fff}\n"], components: [{ type: i1__namespace.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i2__namespace.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: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
123
+ GioSaveBarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: GioSaveBarComponent, selector: "gio-save-bar", inputs: { opened: "opened", invalidState: "invalidState", creationMode: "creationMode", form: "form", formInitialValues: "formInitialValues" }, outputs: { resetClicked: "resetClicked", submitted: "submitted", submittedInvalidState: "submittedInvalidState" }, host: { listeners: { "disable-submit-lock": "onDisableSubmitLock()" }, properties: { "class.save-bar-sticky": "this.isSticky", "class.is-open": "this.isOpen" } }, ngImport: i0__namespace, template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div *ngIf=\"isOpen\" [@slideUpDown] [@.disabled]=\"creationMode\">\n <mat-card class=\"save-bar__content\" [class.mat-elevation-z3]=\"creationMode\" [class.mat-elevation-z6]=\"!creationMode\">\n <div class=\"save-bar__content__label\">{{ creationMode ? '' : 'You have unsaved changes' }}</div>\n <div>\n <button *ngIf=\"!creationMode\" class=\"save-bar__content__reset-button\" mat-button type=\"button\" (click)=\"onResetClicked()\">\n Discard\n </button>\n <button\n class=\"save-bar__content__submit-button\"\n [class.invalid]=\"(form && form.invalid) || invalidState\"\n mat-flat-button\n color=\"primary\"\n [type]=\"form ? 'submit' : 'button'\"\n (click)=\"onSubmitClicked()\"\n >\n {{ creationMode ? 'Create' : 'Save' }}\n </button>\n </div>\n </mat-card>\n</div>\n", styles: [":host{z-index:1000;display:block;height:68px;margin-top:32px;visibility:hidden}:host.is-open{visibility:visible}:host(.save-bar-sticky){position:sticky;bottom:0;margin-right:-16px;margin-left:-16px}.save-bar__content{display:flex;height:100%;align-items:center;justify-content:space-between;padding:16px 24px}.save-bar__content__label{font:400 14px / 20px \"Golos UI\",Roboto,\"Helvetica Neue\",sans-serif;letter-spacing:.4px}.save-bar__content__reset-button{margin-right:16px}.save-bar__content__submit-button.invalid{background-color:#d6ffff;color:#000}.save-bar__content__submit-button.invalid:hover:enabled{background-color:#099;color:#fff}\n"], components: [{ type: i1__namespace.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i2__namespace.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: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
117
124
  animations.trigger('slideUpDown', [
118
125
  animations.transition(':enter', [
119
126
  animations.style({ transform: 'translateY(40vh)', opacity: '0' }),
@@ -166,6 +173,9 @@
166
173
  }], isOpen: [{
167
174
  type: i0.HostBinding,
168
175
  args: ['class.is-open']
176
+ }], onDisableSubmitLock: [{
177
+ type: i0.HostListener,
178
+ args: ['disable-submit-lock']
169
179
  }] } });
170
180
 
171
181
  /*
@@ -544,11 +554,17 @@
544
554
  };
545
555
  GioSaveBarHarness.prototype.clickSubmit = function () {
546
556
  return __awaiter(this, void 0, void 0, function () {
547
- var submitButton;
557
+ var host, submitButton;
548
558
  return __generator(this, function (_a) {
549
559
  switch (_a.label) {
550
- case 0: return [4 /*yield*/, this.getSubmitButton()];
560
+ case 0: return [4 /*yield*/, this.host()];
551
561
  case 1:
562
+ host = _a.sent();
563
+ return [4 /*yield*/, host.dispatchEvent('disable-submit-lock')];
564
+ case 2:
565
+ _a.sent();
566
+ return [4 /*yield*/, this.getSubmitButton()];
567
+ case 3:
552
568
  submitButton = _a.sent();
553
569
  return [2 /*return*/, submitButton.click()];
554
570
  }