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