@eurosat/buttons 10.0.0 → 12.0.0

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.
@@ -4,580 +4,339 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.eurosat = global.eurosat || {}, global.eurosat.buttons = {}), global.ng.core, global.ng.router, global.ng.material.snackBar, global.snackbar, global.http, global.icon, global.ng.material.dialog, global.dialog$1, global.form, global.rxjs['internal/operators'], global.ng.common, global.ng.material.button, global.ng.material.menu, global.ng.material.tooltip, global.core$1));
5
5
  }(this, (function (exports, core, router, snackBar, snackbar, http, icon, dialog, dialog$1, form, operators, common, button, menu, tooltip, core$1) { 'use strict';
6
6
 
7
- /**
8
- * @fileoverview added by tsickle
9
- * Generated from: lib/model/es-button-action.ts
10
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
11
- */
12
- var EsButtonAction = /** @class */ (function () {
13
- function EsButtonAction() {
14
- }
15
- return EsButtonAction;
16
- }());
17
- EsButtonAction.ACTION_DIALOG_CONFIRM = 'dialog-confirm';
18
- EsButtonAction.ACTION_DIALOG_DELETE = 'dialog-delete';
19
- EsButtonAction.ACTION_DIALOG_FORM = 'dialog-form';
20
- EsButtonAction.ACTION_CARD_CONTENT_FORM = 'card-content-form';
21
- EsButtonAction.ACTION_CARD_CONTENT_WIZARD = 'card-content-wizard'; // todo asi zrusit
22
- // todo asi zrusit
23
- EsButtonAction.ACTION_CHANGE_CARD_CONTENT = 'change-card-content'; // mozna zrusit ? je kuli neemitu clicku na button
24
- // mozna zrusit ? je kuli neemitu clicku na button
25
- EsButtonAction.ACTION_DOWNLOAD = 'download';
26
- EsButtonAction.ACTION_REQUEST = 'request';
27
- EsButtonAction.ACTION_ROUTER_NAVIGATE = 'router-navigate';
28
- EsButtonAction.ACTION_WINDOW_LOCATION = 'open-link';
29
- if (false) {
30
- /** @type {?} */
31
- EsButtonAction.ACTION_DIALOG_CONFIRM;
32
- /** @type {?} */
33
- EsButtonAction.ACTION_DIALOG_DELETE;
34
- /** @type {?} */
35
- EsButtonAction.ACTION_DIALOG_FORM;
36
- /** @type {?} */
37
- EsButtonAction.ACTION_CARD_CONTENT_FORM;
38
- /** @type {?} */
39
- EsButtonAction.ACTION_CARD_CONTENT_WIZARD;
40
- /** @type {?} */
41
- EsButtonAction.ACTION_CHANGE_CARD_CONTENT;
42
- /** @type {?} */
43
- EsButtonAction.ACTION_DOWNLOAD;
44
- /** @type {?} */
45
- EsButtonAction.ACTION_REQUEST;
46
- /** @type {?} */
47
- EsButtonAction.ACTION_ROUTER_NAVIGATE;
48
- /** @type {?} */
49
- EsButtonAction.ACTION_WINDOW_LOCATION;
50
- }
7
+ var EsButtonAction = /** @class */ (function () {
8
+ function EsButtonAction() {
9
+ }
10
+ return EsButtonAction;
11
+ }());
12
+ EsButtonAction.ACTION_DIALOG_CONFIRM = 'dialog-confirm';
13
+ EsButtonAction.ACTION_DIALOG_DELETE = 'dialog-delete';
14
+ EsButtonAction.ACTION_DIALOG_FORM = 'dialog-form';
15
+ EsButtonAction.ACTION_CARD_CONTENT_FORM = 'card-content-form';
16
+ EsButtonAction.ACTION_CARD_CONTENT_WIZARD = 'card-content-wizard'; // todo asi zrusit
17
+ EsButtonAction.ACTION_CHANGE_CARD_CONTENT = 'change-card-content'; // mozna zrusit ? je kuli neemitu clicku na button
18
+ EsButtonAction.ACTION_DOWNLOAD = 'download';
19
+ EsButtonAction.ACTION_REQUEST = 'request';
20
+ EsButtonAction.ACTION_ROUTER_NAVIGATE = 'router-navigate';
21
+ EsButtonAction.ACTION_WINDOW_LOCATION = 'open-link';
51
22
 
52
- /**
53
- * @fileoverview added by tsickle
54
- * Generated from: lib/components/dialog-confirm/dialog-confirm.component.ts
55
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
56
- */
57
- var DialogConfirmComponent = /** @class */ (function () {
58
- /**
59
- * @param {?} dialogRef
60
- * @param {?} snackBar
61
- * @param {?} ds
62
- */
63
- function DialogConfirmComponent(dialogRef, snackBar, ds) {
64
- this.dialogRef = dialogRef;
65
- this.snackBar = snackBar;
66
- this.ds = ds;
67
- this.submit = new core.EventEmitter();
68
- this.activeRequest = false;
69
- /** @type {?} */
70
- var data = this.ds.getData();
71
- this.message = data.message;
72
- this.url = data.url;
73
- }
74
- /**
75
- * @return {?}
76
- */
77
- DialogConfirmComponent.prototype.confirm = function () {
78
- var _this = this;
79
- this.activeRequest = true;
80
- this.ds.httpPost(this.url, null).subscribe(( /**
81
- * @param {?} response
82
- * @return {?}
83
- */function (response) {
84
- _this.activeRequest = false;
85
- /** @type {?} */
86
- var config = new snackBar.MatSnackBarConfig();
87
- config.duration = 2000;
88
- if (response.type === form.EsFormResponseMessageType.TYPE_OK) {
89
- config.panelClass = snackbar.EsSnackBarPanelClass.SUCCESS;
90
- _this.submit.emit();
91
- }
92
- else {
93
- config.panelClass = snackbar.EsSnackBarPanelClass.DANGER;
94
- }
95
- _this.snackBar.open(response.message, null, config);
96
- /** @type {?} */
97
- var result = {
98
- clickedYes: true,
99
- serverResponse: response
100
- };
101
- _this.dialogRef.close(result);
102
- }));
103
- };
104
- return DialogConfirmComponent;
105
- }());
106
- DialogConfirmComponent.decorators = [
107
- { type: core.Component, args: [{
108
- selector: 'dialog-confirm',
109
- template: "<p>{{message}}</p>\r\n<div class=\"button-container\">\r\n <mat-spinner *ngIf=\"activeRequest\" [diameter]=\"36\"></mat-spinner>\r\n <ng-container *ngIf=\"!activeRequest\">\r\n <button type=\"button\"\r\n color=\"accent\"\r\n mat-raised-button\r\n (click)=\"confirm()\"> {{'an.common.ano' | translate}}\r\n </button>\r\n <button type=\"button\"\r\n color=\"accent\"\r\n mat-raised-button\r\n (click)=\"dialogRef.close({clickedYes: false})\">{{'an.common.ne' | translate}}\r\n </button>\r\n </ng-container>\r\n</div>\r\n",
110
- styles: ["button:not(:last-child){margin-right:20px}.button-container{min-height:36px;min-width:196px;position:relative;text-align:center}.button-container mat-spinner{left:calc(50% - 18px);position:absolute!important;top:calc(50% - 18px)}"]
111
- }] }
112
- ];
113
- /** @nocollapse */
114
- DialogConfirmComponent.ctorParameters = function () { return [
115
- { type: dialog.MatDialogRef },
116
- { type: snackBar.MatSnackBar },
117
- { type: dialog$1.EsDialogService }
118
- ]; };
119
- DialogConfirmComponent.propDecorators = {
120
- submit: [{ type: core.Output }]
121
- };
122
- if (false) {
123
- /** @type {?} */
124
- DialogConfirmComponent.prototype.submit;
125
- /** @type {?} */
126
- DialogConfirmComponent.prototype.message;
127
- /** @type {?} */
128
- DialogConfirmComponent.prototype.url;
129
- /** @type {?} */
130
- DialogConfirmComponent.prototype.activeRequest;
131
- /** @type {?} */
132
- DialogConfirmComponent.prototype.dialogRef;
133
- /**
134
- * @type {?}
135
- * @private
136
- */
137
- DialogConfirmComponent.prototype.snackBar;
138
- /**
139
- * @type {?}
140
- * @private
141
- */
142
- DialogConfirmComponent.prototype.ds;
143
- }
23
+ var DialogConfirmComponent = /** @class */ (function () {
24
+ function DialogConfirmComponent(dialogRef, snackBar, ds) {
25
+ this.dialogRef = dialogRef;
26
+ this.snackBar = snackBar;
27
+ this.ds = ds;
28
+ this.submit = new core.EventEmitter();
29
+ this.activeRequest = false;
30
+ var data = this.ds.getData();
31
+ this.message = data.message;
32
+ this.url = data.url;
33
+ }
34
+ DialogConfirmComponent.prototype.confirm = function () {
35
+ var _this = this;
36
+ this.activeRequest = true;
37
+ this.ds.httpPost(this.url, null).subscribe(function (response) {
38
+ _this.activeRequest = false;
39
+ var config = new snackBar.MatSnackBarConfig();
40
+ config.duration = 2000;
41
+ if (response.type === form.EsFormResponseMessageType.TYPE_OK) {
42
+ config.panelClass = snackbar.EsSnackBarPanelClass.SUCCESS;
43
+ _this.submit.emit();
44
+ }
45
+ else {
46
+ config.panelClass = snackbar.EsSnackBarPanelClass.DANGER;
47
+ }
48
+ _this.snackBar.open(response.message, null, config);
49
+ var result = {
50
+ clickedYes: true,
51
+ serverResponse: response
52
+ };
53
+ _this.dialogRef.close(result);
54
+ });
55
+ };
56
+ return DialogConfirmComponent;
57
+ }());
58
+ DialogConfirmComponent.decorators = [
59
+ { type: core.Component, args: [{
60
+ selector: 'dialog-confirm',
61
+ template: "<p>{{message}}</p>\n<div class=\"button-container\">\n <mat-spinner *ngIf=\"activeRequest\" [diameter]=\"36\"></mat-spinner>\n <ng-container *ngIf=\"!activeRequest\">\n <button type=\"button\"\n color=\"accent\"\n mat-raised-button\n (click)=\"confirm()\"> {{'an.common.ano' | translate}}\n </button>\n <button type=\"button\"\n color=\"accent\"\n mat-raised-button\n (click)=\"dialogRef.close({clickedYes: false})\">{{'an.common.ne' | translate}}\n </button>\n </ng-container>\n</div>\n",
62
+ styles: ["button:not(:last-child){margin-right:20px}.button-container{min-height:36px;min-width:196px;position:relative;text-align:center}.button-container mat-spinner{position:absolute!important;left:calc(50% - 18px);top:calc(50% - 18px)}"]
63
+ },] }
64
+ ];
65
+ /** @nocollapse */
66
+ DialogConfirmComponent.ctorParameters = function () { return [
67
+ { type: dialog.MatDialogRef },
68
+ { type: snackBar.MatSnackBar },
69
+ { type: dialog$1.EsDialogService }
70
+ ]; };
71
+ DialogConfirmComponent.propDecorators = {
72
+ submit: [{ type: core.Output }]
73
+ };
144
74
 
145
- /**
146
- * @fileoverview added by tsickle
147
- * Generated from: lib/components/dialog-form/dialog-form.component.ts
148
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
149
- */
150
- var DialogFormComponent = /** @class */ (function () {
151
- /**
152
- * @param {?} dialogRef
153
- * @param {?} ds
154
- */
155
- function DialogFormComponent(dialogRef, ds) {
156
- this.dialogRef = dialogRef;
157
- this.cols = 1;
158
- this.maxFormHeight = window.innerHeight - 60;
159
- /** @type {?} */
160
- var data = ds.getData();
161
- this.formUrl = data.url;
162
- }
163
- /**
164
- * @param {?} value
165
- * @return {?}
166
- */
167
- DialogFormComponent.prototype.submit = function (value) {
168
- // sem se to dostane jen pri success ulozeni formu
169
- /** @type {?} */
170
- var result = {
171
- clickedYes: true
172
- };
173
- this.dialogRef.close(result);
174
- // pokud bysme chteli form.value
175
- // this.dialogRef.close(value);
176
- // console.log('form value v parent', value);
177
- };
178
- /**
179
- * @return {?}
180
- */
181
- DialogFormComponent.prototype.getWindowHeight = function () {
182
- this.maxFormHeight = window.innerHeight - 60;
183
- };
184
- return DialogFormComponent;
185
- }());
186
- DialogFormComponent.decorators = [
187
- { type: core.Component, args: [{
188
- selector: 'dialog-form',
189
- template: "<div class=\"es-form-container\" [style.max-height]=\"(maxFormHeight - 106) + 'px'\">\r\n <es-form [formUrl]=\"formUrl\"\r\n [dynamicForm]=\"esForm\"\r\n [cols]=\"cols\"\r\n (submit)=\"submit($event)\">\r\n </es-form>\r\n</div>\r\n",
190
- styles: [".es-form-container{margin-top:24px;overflow:auto;position:relative}"]
191
- }] }
192
- ];
193
- /** @nocollapse */
194
- DialogFormComponent.ctorParameters = function () { return [
195
- { type: dialog.MatDialogRef },
196
- { type: dialog$1.EsDialogService }
197
- ]; };
198
- if (false) {
199
- /** @type {?} */
200
- DialogFormComponent.prototype.formUrl;
201
- /** @type {?} */
202
- DialogFormComponent.prototype.cols;
203
- /** @type {?} */
204
- DialogFormComponent.prototype.esForm;
205
- /** @type {?} */
206
- DialogFormComponent.prototype.maxFormHeight;
207
- /** @type {?} */
208
- DialogFormComponent.prototype.dialogRef;
209
- }
75
+ var DialogFormComponent = /** @class */ (function () {
76
+ function DialogFormComponent(dialogRef, ds) {
77
+ this.dialogRef = dialogRef;
78
+ this.cols = 1;
79
+ this.maxFormHeight = window.innerHeight - 60;
80
+ var data = ds.getData();
81
+ this.formUrl = data.url;
82
+ }
83
+ DialogFormComponent.prototype.submit = function (value) {
84
+ // sem se to dostane jen pri success ulozeni formu
85
+ var result = {
86
+ clickedYes: true
87
+ };
88
+ this.dialogRef.close(result);
89
+ // pokud bysme chteli form.value
90
+ // this.dialogRef.close(value);
91
+ // console.log('form value v parent', value);
92
+ };
93
+ DialogFormComponent.prototype.getWindowHeight = function () {
94
+ this.maxFormHeight = window.innerHeight - 60;
95
+ };
96
+ return DialogFormComponent;
97
+ }());
98
+ DialogFormComponent.decorators = [
99
+ { type: core.Component, args: [{
100
+ selector: 'dialog-form',
101
+ template: "<div class=\"es-form-container\" [style.max-height]=\"(maxFormHeight - 106) + 'px'\">\n <es-form [formUrl]=\"formUrl\"\n [dynamicForm]=\"esForm\"\n [cols]=\"cols\"\n (submit)=\"submit($event)\">\n </es-form>\n</div>\n",
102
+ styles: [".es-form-container{overflow:auto;margin-top:24px;position:relative}"]
103
+ },] }
104
+ ];
105
+ /** @nocollapse */
106
+ DialogFormComponent.ctorParameters = function () { return [
107
+ { type: dialog.MatDialogRef },
108
+ { type: dialog$1.EsDialogService }
109
+ ]; };
210
110
 
211
- /**
212
- * @fileoverview added by tsickle
213
- * Generated from: lib/es-buttons.component.ts
214
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
215
- */
216
- // todo translates
217
- var EsButtonsComponent = /** @class */ (function () {
218
- /**
219
- * @param {?} router
220
- * @param {?} dialog
221
- * @param {?} snackBar
222
- * @param {?} http
223
- */
224
- function EsButtonsComponent(router, dialog, snackBar, http) {
225
- this.router = router;
226
- this.dialog = dialog;
227
- this.snackBar = snackBar;
228
- this.http = http;
229
- this.parentWidth = 40; // default 40 = 1 button
230
- // default 40 = 1 button
231
- this.buttons = []; // normal input
232
- // normal input
233
- this.forceMenu = false; // pokud chci zobrazit ... menu i pro jeden buttonek, na realtimu pouzito
234
- // pokud chci zobrazit ... menu i pro jeden buttonek, na realtimu pouzito
235
- this.buttonClick = new core.EventEmitter();
236
- this.reload = new core.EventEmitter();
237
- this.dialogCreated = new core.EventEmitter();
238
- this.serverResponse = new core.EventEmitter();
239
- this.menuVisible = false;
240
- this.buttonWidth = 40; // todo ViewChild, sirka buttonu ?
241
- // todo ViewChild, sirka buttonu ?
242
- this.visibleButtons = [];
243
- this.hiddenButtons = [];
244
- this.esIcon = icon.EsIcon;
245
- this._width = 0;
246
- }
247
- /**
248
- * @return {?}
249
- */
250
- EsButtonsComponent.prototype.showMenu = function () {
251
- return this.getHiddenButtons() && this.getHiddenButtons().length > 0 && this.getHiddenButtons().length !== 1;
252
- };
253
- /**
254
- * @return {?}
255
- */
256
- EsButtonsComponent.prototype.countVisible = function () {
257
- return Math.floor((this._width) / this.buttonWidth) - 1;
258
- };
259
- /**
260
- * @return {?}
261
- */
262
- EsButtonsComponent.prototype.getVisibleButtons = function () {
263
- var _this = this;
264
- if (this.buttons && this.buttons.length > 0) {
265
- return this.buttons.filter(( /**
266
- * @param {?} button
267
- * @return {?}
268
- */function (/**
269
- * @param {?} button
270
- * @return {?}
271
- */ button) {
272
- if (_this.buttons.indexOf(button) < _this.countVisible()
273
- || (_this.getHiddenButtons().length === 1 && !_this.forceMenu)) {
274
- return true;
275
- }
276
- }));
277
- }
278
- };
279
- /**
280
- * @return {?}
281
- */
282
- EsButtonsComponent.prototype.getHiddenButtons = function () {
283
- var _this = this;
284
- if (this.buttons && this.buttons.length > 0) {
285
- return this.buttons.filter(( /**
286
- * @param {?} button
287
- * @return {?}
288
- */function (/**
289
- * @param {?} button
290
- * @return {?}
291
- */ button) {
292
- if (_this.buttons.indexOf(button) >= _this.countVisible()) {
293
- return true;
294
- }
295
- }));
296
- }
297
- };
298
- /**
299
- * @param {?} simpleChange
300
- * @return {?}
301
- */
302
- EsButtonsComponent.prototype.ngOnChanges = function (simpleChange) {
303
- if (simpleChange['parentWidth']) {
304
- if (this.parentWidth > 0) {
305
- this._width = this.parentWidth;
306
- this.recalculateButtons();
307
- }
308
- }
309
- if (simpleChange['buttons']) {
310
- if (typeof this.buttons === 'string') {
311
- this.buttons = JSON.parse(this.buttons);
312
- }
313
- this.recalculateButtons();
314
- }
315
- };
316
- /**
317
- * @return {?}
318
- */
319
- EsButtonsComponent.prototype.recalculateButtons = function () {
320
- this.menuVisible = this.showMenu();
321
- this.visibleButtons = this.getVisibleButtons();
322
- this.hiddenButtons = this.getHiddenButtons();
323
- };
324
- /**
325
- * @param {?} button
326
- * @return {?}
327
- */
328
- EsButtonsComponent.prototype.handleAction = function (button) {
329
- var _this = this;
330
- if (button.action === EsButtonAction.ACTION_DIALOG_CONFIRM) {
331
- this.openConfirm(button);
332
- }
333
- if (button.action === EsButtonAction.ACTION_DIALOG_DELETE) {
334
- this.openDelete(button);
335
- }
336
- if (button.action === EsButtonAction.ACTION_DIALOG_FORM) {
337
- this.openForm(button);
338
- }
339
- if (button.action === EsButtonAction.ACTION_DOWNLOAD) {
340
- this.http.get(button.url, { responseType: 'blob', observe: 'response' }).subscribe(( /**
341
- * @param {?} response
342
- * @return {?}
343
- */function (/**
344
- * @param {?} response
345
- * @return {?}
346
- */ response) {
347
- /** @type {?} */
348
- var filename = response.headers.get('Content-Disposition').split('filename=')[1];
349
- if (window.navigator && window.navigator.msSaveOrOpenBlob) {
350
- window.navigator.msSaveBlob(response.body, filename);
351
- }
352
- else {
353
- /** @type {?} */
354
- var link = document.createElement('a');
355
- link.setAttribute('href', window.URL.createObjectURL(response.body));
356
- link.setAttribute('download', filename);
357
- link.style.visibility = 'hidden';
358
- document.body.appendChild(link);
359
- link.click();
360
- document.body.removeChild(link);
361
- }
362
- }));
363
- }
364
- if (button.action === EsButtonAction.ACTION_REQUEST) {
365
- this.http.get(button.url).subscribe(( /**
366
- * @param {?} response
367
- * @return {?}
368
- */function (response) {
369
- /** @type {?} */
370
- var config = new snackBar.MatSnackBarConfig();
371
- config.duration = 2000;
372
- if (response.type === form.EsFormResponseMessageType.TYPE_OK) {
373
- config.panelClass = snackbar.EsSnackBarPanelClass.SUCCESS;
374
- }
375
- else {
376
- config.panelClass = snackbar.EsSnackBarPanelClass.DANGER;
377
- }
378
- _this.snackBar.open(response.message, null, config);
379
- _this.reload.emit(true);
380
- _this.serverResponse.emit({ button: button, response: response });
381
- }));
382
- }
383
- if (button.action === EsButtonAction.ACTION_ROUTER_NAVIGATE) {
384
- this.router.navigateByUrl(button.url);
385
- }
386
- if (button.action === EsButtonAction.ACTION_WINDOW_LOCATION) {
387
- window.location.href = button.url;
388
- }
389
- this.buttonClick.emit(button);
390
- };
391
- // handleSubMenuAction(button: EsButton) {
392
- // // todo asi predelat na md2 menu
393
- // // todo nevim jestli se zpropaguje click kdyz je to zanoreny pres es-card-header
394
- // this.buttonClick.emit(button);
395
- // }
396
- /**
397
- * @param {?} button
398
- * @return {?}
399
- */
400
- EsButtonsComponent.prototype.openForm = function (button) {
401
- var _this = this;
402
- /** @type {?} */
403
- var config = {
404
- title: button.title,
405
- data: {
406
- url: button.url
407
- }
408
- };
409
- /** @type {?} */
410
- var dialogRef = this.dialog.open(DialogFormComponent, config);
411
- this.dialogCreated.emit(dialogRef);
412
- dialogRef.afterClosed().pipe(operators.take(1)).subscribe(( /**
413
- * @param {?} res
414
- * @return {?}
415
- */function (res) {
416
- if (res && res.clickedYes) {
417
- _this.reload.emit(true);
418
- if (res.serverResponse) {
419
- _this.serverResponse.emit({ button: button, response: res.serverResponse });
420
- }
421
- }
422
- }));
423
- };
424
- /**
425
- * @param {?} button
426
- * @return {?}
427
- */
428
- EsButtonsComponent.prototype.openDelete = function (button) {
429
- this.openConfirm(button);
430
- };
431
- /**
432
- * @param {?} button
433
- * @return {?}
434
- */
435
- EsButtonsComponent.prototype.openConfirm = function (button) {
436
- var _this = this;
437
- /** @type {?} */
438
- var config = {
439
- title: button.title,
440
- data: {
441
- message: button.message,
442
- url: button.url
443
- }
444
- };
445
- /** @type {?} */
446
- var dialogRef = this.dialog.open(DialogConfirmComponent, config);
447
- this.dialogCreated.emit(dialogRef);
448
- dialogRef.afterClosed().pipe(operators.take(1)).subscribe(( /**
449
- * @param {?} res
450
- * @return {?}
451
- */function (res) {
452
- if (res && res.clickedYes) {
453
- _this.reload.emit(true);
454
- if (res.serverResponse) {
455
- _this.serverResponse.emit({ button: button, response: res.serverResponse });
456
- }
457
- }
458
- }));
459
- };
460
- return EsButtonsComponent;
461
- }());
462
- EsButtonsComponent.decorators = [
463
- { type: core.Component, args: [{
464
- selector: 'es-buttons',
465
- template: "<ng-container *ngIf=\"visibleButtons && visibleButtons.length > 0\">\r\n <button *ngIf=\"visibleButtons.length > 0\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[0].disabled === true\"\r\n [matTooltip]=\"visibleButtons[0].tooltip? visibleButtons[0].tooltip : visibleButtons[0].title\"\r\n (click)=\"handleAction(visibleButtons[0])\">\r\n <es-icon [color]=\"visibleButtons[0].color\"\r\n [themeColor]=\"visibleButtons[0].themeColor\"\r\n [icon]=\"visibleButtons[0].icon\"></es-icon>\r\n </button>\r\n <button *ngIf=\"visibleButtons.length > 1\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[1].disabled === true\"\r\n [matTooltip]=\"visibleButtons[1].tooltip? visibleButtons[1].tooltip : visibleButtons[1].title\"\r\n (click)=\"handleAction(visibleButtons[1])\">\r\n <es-icon [color]=\"visibleButtons[1].color\"\r\n [themeColor]=\"visibleButtons[1].themeColor\"\r\n [icon]=\"visibleButtons[1].icon\"></es-icon>\r\n </button>\r\n <button *ngIf=\"visibleButtons.length > 2\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[2].disabled === true\"\r\n [matTooltip]=\"visibleButtons[2].tooltip? visibleButtons[2].tooltip : visibleButtons[2].title\"\r\n (click)=\"handleAction(visibleButtons[2])\">\r\n <es-icon [color]=\"visibleButtons[2].color\"\r\n [themeColor]=\"visibleButtons[2].themeColor\"\r\n [icon]=\"visibleButtons[2].icon\"></es-icon>\r\n </button>\r\n <button *ngIf=\"visibleButtons.length > 3\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[3].disabled === true\"\r\n [matTooltip]=\"visibleButtons[3].tooltip? visibleButtons[3].tooltip : visibleButtons[3].title\"\r\n (click)=\"handleAction(visibleButtons[3])\">\r\n <es-icon [color]=\"visibleButtons[3].color\"\r\n [themeColor]=\"visibleButtons[3].themeColor\"\r\n [icon]=\"visibleButtons[3].icon\"></es-icon>\r\n </button>\r\n <button *ngIf=\"visibleButtons.length > 4\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[4].disabled === true\"\r\n [matTooltip]=\"visibleButtons[4].tooltip? visibleButtons[4].tooltip : visibleButtons[4].title\"\r\n (click)=\"handleAction(visibleButtons[4])\">\r\n <es-icon [color]=\"visibleButtons[4].color\"\r\n [themeColor]=\"visibleButtons[4].themeColor\"\r\n [icon]=\"visibleButtons[4].icon\"></es-icon>\r\n </button>\r\n <button *ngIf=\"visibleButtons.length > 5\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[5].disabled === true\"\r\n [matTooltip]=\"visibleButtons[5].tooltip? visibleButtons[5].tooltip : visibleButtons[5].title\"\r\n (click)=\"handleAction(visibleButtons[5])\">\r\n <es-icon [color]=\"visibleButtons[5].color\"\r\n [themeColor]=\"visibleButtons[5].themeColor\"\r\n [icon]=\"visibleButtons[5].icon\"></es-icon>\r\n </button>\r\n <button *ngIf=\"visibleButtons.length > 6\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[6].disabled === true\"\r\n [matTooltip]=\"visibleButtons[6].tooltip? visibleButtons[6].tooltip : visibleButtons[6].title\"\r\n (click)=\"handleAction(visibleButtons[6])\">\r\n <es-icon [color]=\"visibleButtons[6].color\"\r\n [themeColor]=\"visibleButtons[6].themeColor\"\r\n [icon]=\"visibleButtons[6].icon\"></es-icon>\r\n </button>\r\n <button *ngIf=\"visibleButtons.length > 7\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[7].disabled === true\"\r\n [matTooltip]=\"visibleButtons[7].tooltip? visibleButtons[7].tooltip : visibleButtons[7].title\"\r\n (click)=\"handleAction(visibleButtons[7])\">\r\n <es-icon [color]=\"visibleButtons[7].color\"\r\n [themeColor]=\"visibleButtons[7].themeColor\"\r\n [icon]=\"visibleButtons[7].icon\"></es-icon>\r\n </button>\r\n <button *ngIf=\"visibleButtons.length > 8\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[8].disabled === true\"\r\n [matTooltip]=\"visibleButtons[8].tooltip? visibleButtons[8].tooltip : visibleButtons[8].title\"\r\n (click)=\"handleAction(visibleButtons[8])\">\r\n <es-icon [color]=\"visibleButtons[8].color\"\r\n [themeColor]=\"visibleButtons[8].themeColor\"\r\n [icon]=\"visibleButtons[8].icon\"></es-icon>\r\n </button>\r\n <button *ngIf=\"visibleButtons.length > 9\"\r\n mat-icon-button\r\n [disabled]=\"visibleButtons[9].disabled === true\"\r\n [matTooltip]=\"visibleButtons[9].tooltip? visibleButtons[9].tooltip : visibleButtons[9].title\"\r\n (click)=\"handleAction(visibleButtons[9])\">\r\n <es-icon [color]=\"visibleButtons[9].color\"\r\n [themeColor]=\"visibleButtons[9].themeColor\"\r\n [icon]=\"visibleButtons[9].icon\"></es-icon>\r\n </button>\r\n</ng-container>\r\n\r\n\r\n<button *ngIf=\"menuVisible || forceMenu\"\r\n mat-icon-button\r\n [matMenuTriggerFor]=\"menu\"\r\n [matTooltip]=\"'an.more' | translate\">\r\n <es-icon [icon]=\"esIcon.MORE_VERT\"></es-icon>\r\n</button>\r\n\r\n\r\n<mat-menu #menu=\"matMenu\"\r\n [overlapTrigger]=\"false\"\r\n yPosition=\"below\"\r\n xPosition=\"before\">\r\n <ng-container *ngIf=\"hiddenButtons && hiddenButtons.length > 0\">\r\n <button *ngIf=\"hiddenButtons.length > 0\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[0].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[0])\">\r\n <es-icon [color]=\"hiddenButtons[0].color\"\r\n [themeColor]=\"hiddenButtons[0].themeColor\"\r\n [icon]=\"hiddenButtons[0].icon\"></es-icon>\r\n <span>{{hiddenButtons[0].title}}</span>\r\n </button>\r\n <button *ngIf=\"hiddenButtons.length > 1\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[1].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[1])\">\r\n <es-icon [color]=\"hiddenButtons[1].color\"\r\n [themeColor]=\"hiddenButtons[1].themeColor\"\r\n [icon]=\"hiddenButtons[1].icon\"></es-icon>\r\n <span>{{hiddenButtons[1].title}}</span>\r\n </button>\r\n <button *ngIf=\"hiddenButtons.length > 2\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[2].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[2])\">\r\n <es-icon [color]=\"hiddenButtons[2].color\"\r\n [themeColor]=\"hiddenButtons[2].themeColor\"\r\n [icon]=\"hiddenButtons[2].icon\"></es-icon>\r\n <span>{{hiddenButtons[2].title}}</span>\r\n </button>\r\n <button *ngIf=\"hiddenButtons.length > 3\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[3].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[3])\">\r\n <es-icon [color]=\"hiddenButtons[3].color\"\r\n [themeColor]=\"hiddenButtons[3].themeColor\"\r\n [icon]=\"hiddenButtons[3].icon\"></es-icon>\r\n <span>{{hiddenButtons[3].title}}</span>\r\n </button>\r\n <button *ngIf=\"hiddenButtons.length > 4\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[4].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[4])\">\r\n <es-icon [color]=\"hiddenButtons[4].color\"\r\n [themeColor]=\"hiddenButtons[4].themeColor\"\r\n [icon]=\"hiddenButtons[4].icon\"></es-icon>\r\n <span>{{hiddenButtons[4].title}}</span>\r\n </button>\r\n <button *ngIf=\"hiddenButtons.length > 5\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[5].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[5])\">\r\n <es-icon [color]=\"hiddenButtons[5].color\"\r\n [themeColor]=\"hiddenButtons[5].themeColor\"\r\n [icon]=\"hiddenButtons[5].icon\"></es-icon>\r\n <span>{{hiddenButtons[5].title}}</span>\r\n </button>\r\n <button *ngIf=\"hiddenButtons.length > 6\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[6].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[6])\">\r\n <es-icon [color]=\"hiddenButtons[6].color\"\r\n [themeColor]=\"hiddenButtons[6].themeColor\"\r\n [icon]=\"hiddenButtons[6].icon\"></es-icon>\r\n <span>{{hiddenButtons[6].title}}</span>\r\n </button>\r\n <button *ngIf=\"hiddenButtons.length > 7\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[7].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[7])\">\r\n <es-icon [color]=\"hiddenButtons[7].color\"\r\n [themeColor]=\"hiddenButtons[7].themeColor\"\r\n [icon]=\"hiddenButtons[7].icon\"></es-icon>\r\n <span>{{hiddenButtons[7].title}}</span>\r\n </button>\r\n <button *ngIf=\"hiddenButtons.length > 8\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[8].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[8])\">\r\n <es-icon [color]=\"hiddenButtons[8].color\"\r\n [themeColor]=\"hiddenButtons[8].themeColor\"\r\n [icon]=\"hiddenButtons[8].icon\"></es-icon>\r\n <span>{{hiddenButtons[8].title}}</span>\r\n </button>\r\n <button *ngIf=\"hiddenButtons.length > 9\"\r\n mat-menu-item\r\n [disabled]=\"hiddenButtons[9].disabled === true\"\r\n (click)=\"handleAction(hiddenButtons[9])\">\r\n <es-icon [color]=\"hiddenButtons[9].color\"\r\n [themeColor]=\"hiddenButtons[9].themeColor\"\r\n [icon]=\"hiddenButtons[9].icon\"></es-icon>\r\n <span>{{hiddenButtons[9].title}}</span>\r\n </button>\r\n </ng-container>\r\n</mat-menu>\r\n",
466
- changeDetection: core.ChangeDetectionStrategy.OnPush,
467
- styles: [":host{float:right}"]
468
- }] }
469
- ];
470
- /** @nocollapse */
471
- EsButtonsComponent.ctorParameters = function () { return [
472
- { type: router.Router },
473
- { type: dialog$1.EsDialogService },
474
- { type: snackBar.MatSnackBar },
475
- { type: http.HttpService }
476
- ]; };
477
- EsButtonsComponent.propDecorators = {
478
- parentWidth: [{ type: core.Input }],
479
- buttons: [{ type: core.Input }],
480
- forceMenu: [{ type: core.Input }],
481
- buttonClick: [{ type: core.Output }],
482
- reload: [{ type: core.Output }],
483
- dialogCreated: [{ type: core.Output }],
484
- serverResponse: [{ type: core.Output }]
485
- };
486
- if (false) {
487
- /** @type {?} */
488
- EsButtonsComponent.prototype.parentWidth;
489
- /** @type {?} */
490
- EsButtonsComponent.prototype.buttons;
491
- /** @type {?} */
492
- EsButtonsComponent.prototype.forceMenu;
493
- /** @type {?} */
494
- EsButtonsComponent.prototype.buttonClick;
495
- /** @type {?} */
496
- EsButtonsComponent.prototype.reload;
497
- /** @type {?} */
498
- EsButtonsComponent.prototype.dialogCreated;
499
- /** @type {?} */
500
- EsButtonsComponent.prototype.serverResponse;
501
- /** @type {?} */
502
- EsButtonsComponent.prototype.menuVisible;
503
- /** @type {?} */
504
- EsButtonsComponent.prototype.buttonWidth;
505
- /** @type {?} */
506
- EsButtonsComponent.prototype.visibleButtons;
507
- /** @type {?} */
508
- EsButtonsComponent.prototype.hiddenButtons;
509
- /** @type {?} */
510
- EsButtonsComponent.prototype.esIcon;
511
- /** @type {?} */
512
- EsButtonsComponent.prototype._width;
513
- /**
514
- * @type {?}
515
- * @private
516
- */
517
- EsButtonsComponent.prototype.router;
518
- /**
519
- * @type {?}
520
- * @private
521
- */
522
- EsButtonsComponent.prototype.dialog;
523
- /**
524
- * @type {?}
525
- * @private
526
- */
527
- EsButtonsComponent.prototype.snackBar;
528
- /**
529
- * @type {?}
530
- * @private
531
- */
532
- EsButtonsComponent.prototype.http;
533
- }
111
+ // todo translates
112
+ var EsButtonsComponent = /** @class */ (function () {
113
+ function EsButtonsComponent(router, dialog, snackBar, http) {
114
+ this.router = router;
115
+ this.dialog = dialog;
116
+ this.snackBar = snackBar;
117
+ this.http = http;
118
+ this.parentWidth = 40; // default 40 = 1 button
119
+ this.buttons = []; // normal input
120
+ this.forceMenu = false; // pokud chci zobrazit ... menu i pro jeden buttonek, na realtimu pouzito
121
+ this.buttonClick = new core.EventEmitter();
122
+ this.reload = new core.EventEmitter();
123
+ this.dialogCreated = new core.EventEmitter();
124
+ this.serverResponse = new core.EventEmitter();
125
+ this.menuVisible = false;
126
+ this.buttonWidth = 40; // todo ViewChild, sirka buttonu ?
127
+ this.visibleButtons = [];
128
+ this.hiddenButtons = [];
129
+ this.esIcon = icon.EsIcon;
130
+ this._width = 0;
131
+ }
132
+ EsButtonsComponent.prototype.showMenu = function () {
133
+ return this.getHiddenButtons() && this.getHiddenButtons().length > 0 && this.getHiddenButtons().length !== 1;
134
+ };
135
+ EsButtonsComponent.prototype.countVisible = function () {
136
+ return Math.floor((this._width) / this.buttonWidth) - 1;
137
+ };
138
+ EsButtonsComponent.prototype.getVisibleButtons = function () {
139
+ var _this = this;
140
+ if (this.buttons && this.buttons.length > 0) {
141
+ return this.buttons.filter(function (button) {
142
+ if (_this.buttons.indexOf(button) < _this.countVisible()
143
+ || (_this.getHiddenButtons().length === 1 && !_this.forceMenu)) {
144
+ return true;
145
+ }
146
+ });
147
+ }
148
+ };
149
+ EsButtonsComponent.prototype.getHiddenButtons = function () {
150
+ var _this = this;
151
+ if (this.buttons && this.buttons.length > 0) {
152
+ return this.buttons.filter(function (button) {
153
+ if (_this.buttons.indexOf(button) >= _this.countVisible()) {
154
+ return true;
155
+ }
156
+ });
157
+ }
158
+ };
159
+ EsButtonsComponent.prototype.ngOnChanges = function (simpleChange) {
160
+ if (simpleChange['parentWidth']) {
161
+ if (this.parentWidth > 0) {
162
+ this._width = this.parentWidth;
163
+ this.recalculateButtons();
164
+ }
165
+ }
166
+ if (simpleChange['buttons']) {
167
+ if (typeof this.buttons === 'string') {
168
+ this.buttons = JSON.parse(this.buttons);
169
+ }
170
+ this.recalculateButtons();
171
+ }
172
+ };
173
+ EsButtonsComponent.prototype.recalculateButtons = function () {
174
+ this.menuVisible = this.showMenu();
175
+ this.visibleButtons = this.getVisibleButtons();
176
+ this.hiddenButtons = this.getHiddenButtons();
177
+ };
178
+ EsButtonsComponent.prototype.handleAction = function (button) {
179
+ var _this = this;
180
+ if (button.action === EsButtonAction.ACTION_DIALOG_CONFIRM) {
181
+ this.openConfirm(button);
182
+ }
183
+ if (button.action === EsButtonAction.ACTION_DIALOG_DELETE) {
184
+ this.openDelete(button);
185
+ }
186
+ if (button.action === EsButtonAction.ACTION_DIALOG_FORM) {
187
+ this.openForm(button);
188
+ }
189
+ if (button.action === EsButtonAction.ACTION_DOWNLOAD) {
190
+ this.http.get(button.url, { responseType: 'blob', observe: 'response' }).subscribe(function (response) {
191
+ var filename = response.headers.get('Content-Disposition').split('filename=')[1];
192
+ if (window.navigator && window.navigator.msSaveOrOpenBlob) {
193
+ window.navigator.msSaveBlob(response.body, filename);
194
+ }
195
+ else {
196
+ var link = document.createElement('a');
197
+ link.setAttribute('href', window.URL.createObjectURL(response.body));
198
+ link.setAttribute('download', filename);
199
+ link.style.visibility = 'hidden';
200
+ document.body.appendChild(link);
201
+ link.click();
202
+ document.body.removeChild(link);
203
+ }
204
+ });
205
+ }
206
+ if (button.action === EsButtonAction.ACTION_REQUEST) {
207
+ this.http.get(button.url).subscribe(function (response) {
208
+ var config = new snackBar.MatSnackBarConfig();
209
+ config.duration = 2000;
210
+ if (response.type === form.EsFormResponseMessageType.TYPE_OK) {
211
+ config.panelClass = snackbar.EsSnackBarPanelClass.SUCCESS;
212
+ }
213
+ else {
214
+ config.panelClass = snackbar.EsSnackBarPanelClass.DANGER;
215
+ }
216
+ _this.snackBar.open(response.message, null, config);
217
+ _this.reload.emit(true);
218
+ _this.serverResponse.emit({ button: button, response: response });
219
+ });
220
+ }
221
+ if (button.action === EsButtonAction.ACTION_ROUTER_NAVIGATE) {
222
+ this.router.navigateByUrl(button.url);
223
+ }
224
+ if (button.action === EsButtonAction.ACTION_WINDOW_LOCATION) {
225
+ window.location.href = button.url;
226
+ }
227
+ this.buttonClick.emit(button);
228
+ };
229
+ // handleSubMenuAction(button: EsButton) {
230
+ // // todo asi predelat na md2 menu
231
+ // // todo nevim jestli se zpropaguje click kdyz je to zanoreny pres es-card-header
232
+ // this.buttonClick.emit(button);
233
+ // }
234
+ EsButtonsComponent.prototype.openForm = function (button) {
235
+ var _this = this;
236
+ var config = {
237
+ title: button.title,
238
+ data: {
239
+ url: button.url
240
+ }
241
+ };
242
+ var dialogRef = this.dialog.open(DialogFormComponent, config);
243
+ this.dialogCreated.emit(dialogRef);
244
+ dialogRef.afterClosed().pipe(operators.take(1)).subscribe(function (res) {
245
+ if (res && res.clickedYes) {
246
+ _this.reload.emit(true);
247
+ if (res.serverResponse) {
248
+ _this.serverResponse.emit({ button: button, response: res.serverResponse });
249
+ }
250
+ }
251
+ });
252
+ };
253
+ EsButtonsComponent.prototype.openDelete = function (button) {
254
+ this.openConfirm(button);
255
+ };
256
+ EsButtonsComponent.prototype.openConfirm = function (button) {
257
+ var _this = this;
258
+ var config = {
259
+ title: button.title,
260
+ data: {
261
+ message: button.message,
262
+ url: button.url
263
+ }
264
+ };
265
+ var dialogRef = this.dialog.open(DialogConfirmComponent, config);
266
+ this.dialogCreated.emit(dialogRef);
267
+ dialogRef.afterClosed().pipe(operators.take(1)).subscribe(function (res) {
268
+ if (res && res.clickedYes) {
269
+ _this.reload.emit(true);
270
+ if (res.serverResponse) {
271
+ _this.serverResponse.emit({ button: button, response: res.serverResponse });
272
+ }
273
+ }
274
+ });
275
+ };
276
+ return EsButtonsComponent;
277
+ }());
278
+ EsButtonsComponent.decorators = [
279
+ { type: core.Component, args: [{
280
+ selector: 'es-buttons',
281
+ template: "<ng-container *ngIf=\"visibleButtons && visibleButtons.length > 0\">\n <button *ngIf=\"visibleButtons.length > 0\"\n mat-icon-button\n [disabled]=\"visibleButtons[0].disabled === true\"\n [matTooltip]=\"visibleButtons[0].tooltip? visibleButtons[0].tooltip : visibleButtons[0].title\"\n (click)=\"handleAction(visibleButtons[0])\">\n <es-icon [color]=\"visibleButtons[0].color\"\n [themeColor]=\"visibleButtons[0].themeColor\"\n [icon]=\"visibleButtons[0].icon\"></es-icon>\n </button>\n <button *ngIf=\"visibleButtons.length > 1\"\n mat-icon-button\n [disabled]=\"visibleButtons[1].disabled === true\"\n [matTooltip]=\"visibleButtons[1].tooltip? visibleButtons[1].tooltip : visibleButtons[1].title\"\n (click)=\"handleAction(visibleButtons[1])\">\n <es-icon [color]=\"visibleButtons[1].color\"\n [themeColor]=\"visibleButtons[1].themeColor\"\n [icon]=\"visibleButtons[1].icon\"></es-icon>\n </button>\n <button *ngIf=\"visibleButtons.length > 2\"\n mat-icon-button\n [disabled]=\"visibleButtons[2].disabled === true\"\n [matTooltip]=\"visibleButtons[2].tooltip? visibleButtons[2].tooltip : visibleButtons[2].title\"\n (click)=\"handleAction(visibleButtons[2])\">\n <es-icon [color]=\"visibleButtons[2].color\"\n [themeColor]=\"visibleButtons[2].themeColor\"\n [icon]=\"visibleButtons[2].icon\"></es-icon>\n </button>\n <button *ngIf=\"visibleButtons.length > 3\"\n mat-icon-button\n [disabled]=\"visibleButtons[3].disabled === true\"\n [matTooltip]=\"visibleButtons[3].tooltip? visibleButtons[3].tooltip : visibleButtons[3].title\"\n (click)=\"handleAction(visibleButtons[3])\">\n <es-icon [color]=\"visibleButtons[3].color\"\n [themeColor]=\"visibleButtons[3].themeColor\"\n [icon]=\"visibleButtons[3].icon\"></es-icon>\n </button>\n <button *ngIf=\"visibleButtons.length > 4\"\n mat-icon-button\n [disabled]=\"visibleButtons[4].disabled === true\"\n [matTooltip]=\"visibleButtons[4].tooltip? visibleButtons[4].tooltip : visibleButtons[4].title\"\n (click)=\"handleAction(visibleButtons[4])\">\n <es-icon [color]=\"visibleButtons[4].color\"\n [themeColor]=\"visibleButtons[4].themeColor\"\n [icon]=\"visibleButtons[4].icon\"></es-icon>\n </button>\n <button *ngIf=\"visibleButtons.length > 5\"\n mat-icon-button\n [disabled]=\"visibleButtons[5].disabled === true\"\n [matTooltip]=\"visibleButtons[5].tooltip? visibleButtons[5].tooltip : visibleButtons[5].title\"\n (click)=\"handleAction(visibleButtons[5])\">\n <es-icon [color]=\"visibleButtons[5].color\"\n [themeColor]=\"visibleButtons[5].themeColor\"\n [icon]=\"visibleButtons[5].icon\"></es-icon>\n </button>\n <button *ngIf=\"visibleButtons.length > 6\"\n mat-icon-button\n [disabled]=\"visibleButtons[6].disabled === true\"\n [matTooltip]=\"visibleButtons[6].tooltip? visibleButtons[6].tooltip : visibleButtons[6].title\"\n (click)=\"handleAction(visibleButtons[6])\">\n <es-icon [color]=\"visibleButtons[6].color\"\n [themeColor]=\"visibleButtons[6].themeColor\"\n [icon]=\"visibleButtons[6].icon\"></es-icon>\n </button>\n <button *ngIf=\"visibleButtons.length > 7\"\n mat-icon-button\n [disabled]=\"visibleButtons[7].disabled === true\"\n [matTooltip]=\"visibleButtons[7].tooltip? visibleButtons[7].tooltip : visibleButtons[7].title\"\n (click)=\"handleAction(visibleButtons[7])\">\n <es-icon [color]=\"visibleButtons[7].color\"\n [themeColor]=\"visibleButtons[7].themeColor\"\n [icon]=\"visibleButtons[7].icon\"></es-icon>\n </button>\n <button *ngIf=\"visibleButtons.length > 8\"\n mat-icon-button\n [disabled]=\"visibleButtons[8].disabled === true\"\n [matTooltip]=\"visibleButtons[8].tooltip? visibleButtons[8].tooltip : visibleButtons[8].title\"\n (click)=\"handleAction(visibleButtons[8])\">\n <es-icon [color]=\"visibleButtons[8].color\"\n [themeColor]=\"visibleButtons[8].themeColor\"\n [icon]=\"visibleButtons[8].icon\"></es-icon>\n </button>\n <button *ngIf=\"visibleButtons.length > 9\"\n mat-icon-button\n [disabled]=\"visibleButtons[9].disabled === true\"\n [matTooltip]=\"visibleButtons[9].tooltip? visibleButtons[9].tooltip : visibleButtons[9].title\"\n (click)=\"handleAction(visibleButtons[9])\">\n <es-icon [color]=\"visibleButtons[9].color\"\n [themeColor]=\"visibleButtons[9].themeColor\"\n [icon]=\"visibleButtons[9].icon\"></es-icon>\n </button>\n</ng-container>\n\n\n<button *ngIf=\"menuVisible || forceMenu\"\n mat-icon-button\n [matMenuTriggerFor]=\"menu\"\n [matTooltip]=\"'an.more' | translate\">\n <es-icon [icon]=\"esIcon.MORE_VERT\"></es-icon>\n</button>\n\n\n<mat-menu #menu=\"matMenu\"\n [overlapTrigger]=\"false\"\n yPosition=\"below\"\n xPosition=\"before\">\n <ng-container *ngIf=\"hiddenButtons && hiddenButtons.length > 0\">\n <button *ngIf=\"hiddenButtons.length > 0\"\n mat-menu-item\n [disabled]=\"hiddenButtons[0].disabled === true\"\n (click)=\"handleAction(hiddenButtons[0])\">\n <es-icon [color]=\"hiddenButtons[0].color\"\n [themeColor]=\"hiddenButtons[0].themeColor\"\n [icon]=\"hiddenButtons[0].icon\"></es-icon>\n <span>{{hiddenButtons[0].title}}</span>\n </button>\n <button *ngIf=\"hiddenButtons.length > 1\"\n mat-menu-item\n [disabled]=\"hiddenButtons[1].disabled === true\"\n (click)=\"handleAction(hiddenButtons[1])\">\n <es-icon [color]=\"hiddenButtons[1].color\"\n [themeColor]=\"hiddenButtons[1].themeColor\"\n [icon]=\"hiddenButtons[1].icon\"></es-icon>\n <span>{{hiddenButtons[1].title}}</span>\n </button>\n <button *ngIf=\"hiddenButtons.length > 2\"\n mat-menu-item\n [disabled]=\"hiddenButtons[2].disabled === true\"\n (click)=\"handleAction(hiddenButtons[2])\">\n <es-icon [color]=\"hiddenButtons[2].color\"\n [themeColor]=\"hiddenButtons[2].themeColor\"\n [icon]=\"hiddenButtons[2].icon\"></es-icon>\n <span>{{hiddenButtons[2].title}}</span>\n </button>\n <button *ngIf=\"hiddenButtons.length > 3\"\n mat-menu-item\n [disabled]=\"hiddenButtons[3].disabled === true\"\n (click)=\"handleAction(hiddenButtons[3])\">\n <es-icon [color]=\"hiddenButtons[3].color\"\n [themeColor]=\"hiddenButtons[3].themeColor\"\n [icon]=\"hiddenButtons[3].icon\"></es-icon>\n <span>{{hiddenButtons[3].title}}</span>\n </button>\n <button *ngIf=\"hiddenButtons.length > 4\"\n mat-menu-item\n [disabled]=\"hiddenButtons[4].disabled === true\"\n (click)=\"handleAction(hiddenButtons[4])\">\n <es-icon [color]=\"hiddenButtons[4].color\"\n [themeColor]=\"hiddenButtons[4].themeColor\"\n [icon]=\"hiddenButtons[4].icon\"></es-icon>\n <span>{{hiddenButtons[4].title}}</span>\n </button>\n <button *ngIf=\"hiddenButtons.length > 5\"\n mat-menu-item\n [disabled]=\"hiddenButtons[5].disabled === true\"\n (click)=\"handleAction(hiddenButtons[5])\">\n <es-icon [color]=\"hiddenButtons[5].color\"\n [themeColor]=\"hiddenButtons[5].themeColor\"\n [icon]=\"hiddenButtons[5].icon\"></es-icon>\n <span>{{hiddenButtons[5].title}}</span>\n </button>\n <button *ngIf=\"hiddenButtons.length > 6\"\n mat-menu-item\n [disabled]=\"hiddenButtons[6].disabled === true\"\n (click)=\"handleAction(hiddenButtons[6])\">\n <es-icon [color]=\"hiddenButtons[6].color\"\n [themeColor]=\"hiddenButtons[6].themeColor\"\n [icon]=\"hiddenButtons[6].icon\"></es-icon>\n <span>{{hiddenButtons[6].title}}</span>\n </button>\n <button *ngIf=\"hiddenButtons.length > 7\"\n mat-menu-item\n [disabled]=\"hiddenButtons[7].disabled === true\"\n (click)=\"handleAction(hiddenButtons[7])\">\n <es-icon [color]=\"hiddenButtons[7].color\"\n [themeColor]=\"hiddenButtons[7].themeColor\"\n [icon]=\"hiddenButtons[7].icon\"></es-icon>\n <span>{{hiddenButtons[7].title}}</span>\n </button>\n <button *ngIf=\"hiddenButtons.length > 8\"\n mat-menu-item\n [disabled]=\"hiddenButtons[8].disabled === true\"\n (click)=\"handleAction(hiddenButtons[8])\">\n <es-icon [color]=\"hiddenButtons[8].color\"\n [themeColor]=\"hiddenButtons[8].themeColor\"\n [icon]=\"hiddenButtons[8].icon\"></es-icon>\n <span>{{hiddenButtons[8].title}}</span>\n </button>\n <button *ngIf=\"hiddenButtons.length > 9\"\n mat-menu-item\n [disabled]=\"hiddenButtons[9].disabled === true\"\n (click)=\"handleAction(hiddenButtons[9])\">\n <es-icon [color]=\"hiddenButtons[9].color\"\n [themeColor]=\"hiddenButtons[9].themeColor\"\n [icon]=\"hiddenButtons[9].icon\"></es-icon>\n <span>{{hiddenButtons[9].title}}</span>\n </button>\n </ng-container>\n</mat-menu>\n",
282
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
283
+ styles: [":host{float:right}"]
284
+ },] }
285
+ ];
286
+ /** @nocollapse */
287
+ EsButtonsComponent.ctorParameters = function () { return [
288
+ { type: router.Router },
289
+ { type: dialog$1.EsDialogService },
290
+ { type: snackBar.MatSnackBar },
291
+ { type: http.HttpService }
292
+ ]; };
293
+ EsButtonsComponent.propDecorators = {
294
+ parentWidth: [{ type: core.Input }],
295
+ buttons: [{ type: core.Input }],
296
+ forceMenu: [{ type: core.Input }],
297
+ buttonClick: [{ type: core.Output }],
298
+ reload: [{ type: core.Output }],
299
+ dialogCreated: [{ type: core.Output }],
300
+ serverResponse: [{ type: core.Output }]
301
+ };
534
302
 
535
- /**
536
- * @fileoverview added by tsickle
537
- * Generated from: lib/es-buttons.module.ts
538
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
539
- */
540
- var EsButtonsModule = /** @class */ (function () {
541
- function EsButtonsModule() {
542
- }
543
- return EsButtonsModule;
544
- }());
545
- EsButtonsModule.decorators = [
546
- { type: core.NgModule, args: [{
547
- imports: [
548
- common.CommonModule,
549
- button.MatButtonModule,
550
- tooltip.MatTooltipModule,
551
- menu.MatMenuModule,
552
- snackBar.MatSnackBarModule,
553
- core$1.TranslateModule.forChild(),
554
- icon.EsIconModule,
555
- dialog$1.EsDialogModule,
556
- form.EsFormModule,
557
- ],
558
- declarations: [
559
- EsButtonsComponent,
560
- DialogConfirmComponent,
561
- DialogFormComponent,
562
- ],
563
- exports: [EsButtonsComponent],
564
- entryComponents: [
565
- DialogConfirmComponent,
566
- DialogFormComponent,
567
- ],
568
- },] }
303
+ var EsButtonsModule = /** @class */ (function () {
304
+ function EsButtonsModule() {
305
+ }
306
+ return EsButtonsModule;
307
+ }());
308
+ EsButtonsModule.decorators = [
309
+ { type: core.NgModule, args: [{
310
+ imports: [
311
+ common.CommonModule,
312
+ button.MatButtonModule,
313
+ tooltip.MatTooltipModule,
314
+ menu.MatMenuModule,
315
+ snackBar.MatSnackBarModule,
316
+ core$1.TranslateModule.forChild(),
317
+ icon.EsIconModule,
318
+ dialog$1.EsDialogModule,
319
+ form.EsFormModule,
320
+ ],
321
+ declarations: [
322
+ EsButtonsComponent,
323
+ DialogConfirmComponent,
324
+ DialogFormComponent,
325
+ ],
326
+ exports: [EsButtonsComponent],
327
+ entryComponents: [
328
+ DialogConfirmComponent,
329
+ DialogFormComponent,
330
+ ],
331
+ },] }
569
332
  ];
570
333
 
571
- /**
572
- * @fileoverview added by tsickle
573
- * Generated from: public_api.ts
574
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
334
+ /*
335
+ * Public API Surface of es-buttons
575
336
  */
576
337
 
577
- /**
578
- * @fileoverview added by tsickle
579
- * Generated from: eurosat-buttons.ts
580
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
338
+ /**
339
+ * Generated bundle index. Do not edit.
581
340
  */
582
341
 
583
342
  exports.EsButtonAction = EsButtonAction;