@eurosat/buttons 9.0.0-alpha.1 → 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.
- package/bundles/eurosat-buttons.umd.js +328 -646
- package/bundles/eurosat-buttons.umd.js.map +1 -1
- package/bundles/eurosat-buttons.umd.min.js +1 -1
- package/bundles/eurosat-buttons.umd.min.js.map +1 -1
- package/esm2015/eurosat-buttons.js +7 -12
- package/esm2015/lib/components/dialog-confirm/dialog-confirm.component.js +56 -98
- package/esm2015/lib/components/dialog-form/dialog-form.component.js +38 -68
- package/esm2015/lib/components/dialog-result.js +2 -16
- package/esm2015/lib/es-buttons.component.js +198 -327
- package/esm2015/lib/es-buttons.module.js +41 -46
- package/esm2015/lib/model/es-button-action.js +13 -42
- package/esm2015/lib/model/es-button-server-response.js +2 -16
- package/esm2015/lib/model/es-button.interface.js +2 -34
- package/esm2015/public_api.js +9 -14
- package/eurosat-buttons.d.ts +6 -6
- package/eurosat-buttons.metadata.json +1 -1
- package/fesm2015/eurosat-buttons.js +305 -594
- package/fesm2015/eurosat-buttons.js.map +1 -1
- package/lib/components/dialog-confirm/dialog-confirm.component.d.ts +15 -15
- package/lib/components/dialog-form/dialog-form.component.d.ts +15 -15
- package/lib/components/dialog-result.d.ts +4 -4
- package/lib/es-buttons.component.d.ts +39 -39
- package/lib/es-buttons.module.d.ts +2 -2
- package/lib/model/es-button-action.d.ts +12 -12
- package/lib/model/es-button-server-response.d.ts +5 -5
- package/lib/model/es-button.interface.d.ts +14 -14
- package/package.json +8 -10
- package/public_api.d.ts +5 -5
- package/esm5/eurosat-buttons.js +0 -12
- package/esm5/lib/components/dialog-confirm/dialog-confirm.component.js +0 -99
- package/esm5/lib/components/dialog-form/dialog-form.component.js +0 -73
- package/esm5/lib/components/dialog-result.js +0 -16
- package/esm5/lib/es-buttons.component.js +0 -374
- package/esm5/lib/es-buttons.module.js +0 -50
- package/esm5/lib/model/es-button-action.js +0 -46
- package/esm5/lib/model/es-button-server-response.js +0 -16
- package/esm5/lib/model/es-button.interface.js +0 -34
- package/esm5/public_api.js +0 -14
- package/fesm5/eurosat-buttons.js +0 -683
- package/fesm5/eurosat-buttons.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eurosat-buttons.js","sources":["ng://@eurosat/buttons/lib/model/es-button-action.ts","ng://@eurosat/buttons/lib/components/dialog-confirm/dialog-confirm.component.ts","ng://@eurosat/buttons/lib/components/dialog-form/dialog-form.component.ts","ng://@eurosat/buttons/lib/es-buttons.component.ts","ng://@eurosat/buttons/lib/es-buttons.module.ts","ng://@eurosat/buttons/lib/model/es-button.interface.ts","ng://@eurosat/buttons/lib/model/es-button-server-response.ts"],"sourcesContent":["export class EsButtonAction {\r\n\r\n public static ACTION_DIALOG_CONFIRM = 'dialog-confirm';\r\n public static ACTION_DIALOG_DELETE = 'dialog-delete';\r\n public static ACTION_DIALOG_FORM = 'dialog-form';\r\n public static ACTION_CARD_CONTENT_FORM = 'card-content-form';\r\n public static ACTION_CARD_CONTENT_WIZARD = 'card-content-wizard'; // todo asi zrusit\r\n public static ACTION_CHANGE_CARD_CONTENT = 'change-card-content'; // mozna zrusit ? je kuli neemitu clicku na button\r\n public static ACTION_DOWNLOAD = 'download';\r\n public static ACTION_REQUEST = 'request';\r\n public static ACTION_ROUTER_NAVIGATE = 'router-navigate';\r\n public static ACTION_WINDOW_LOCATION = 'open-link';\r\n}\r\n","import {Component, EventEmitter, Output} from '@angular/core';\r\nimport {MatDialogRef} from '@angular/material/dialog';\r\nimport {MatSnackBar, MatSnackBarConfig} from '@angular/material/snack-bar';\r\nimport {EsSnackBarPanelClass} from '@eurosat/snackbar';\r\nimport {EsDialogService} from '@eurosat/dialog';\r\nimport { DialogResult } from '../dialog-result';\r\nimport { EsFormResponseMessage, EsFormResponseMessageType } from '@eurosat/form';\r\n\r\n\r\n@Component({\r\n selector: 'dialog-confirm',\r\n templateUrl: './dialog-confirm.component.html',\r\n styleUrls: ['./dialog-confirm.component.scss']\r\n})\r\nexport class DialogConfirmComponent {\r\n\r\n @Output() submit: EventEmitter<any> = new EventEmitter<any>();\r\n public message: string;\r\n public url: string;\r\n activeRequest = false;\r\n\r\n constructor(\r\n public dialogRef: MatDialogRef<DialogConfirmComponent>,\r\n private snackBar: MatSnackBar,\r\n private ds: EsDialogService\r\n ) {\r\n const data = this.ds.getData();\r\n this.message = data.message;\r\n this.url = data.url;\r\n }\r\n\r\n confirm() {\r\n this.activeRequest = true;\r\n this.ds.httpPost(this.url, null).subscribe((response: EsFormResponseMessage) => {\r\n this.activeRequest = false;\r\n const config = new MatSnackBarConfig();\r\n config.duration = 2000;\r\n if (response.type === EsFormResponseMessageType.TYPE_OK) {\r\n config.panelClass = EsSnackBarPanelClass.SUCCESS;\r\n this.submit.emit();\r\n } else {\r\n config.panelClass = EsSnackBarPanelClass.DANGER;\r\n }\r\n this.snackBar.open(response.message, null, config);\r\n\r\n const result: DialogResult = {\r\n clickedYes: true,\r\n serverResponse: response\r\n };\r\n this.dialogRef.close(result);\r\n });\r\n }\r\n\r\n}\r\n","import {Component} from '@angular/core';\r\nimport {MatDialogRef} from '@angular/material/dialog';\r\nimport {EsForm} from '@eurosat/form';\r\nimport {EsDialogService} from '@eurosat/dialog';\r\nimport { DialogResult } from '../dialog-result';\r\n\r\n@Component({\r\n selector: 'dialog-form',\r\n templateUrl: './dialog-form.component.html',\r\n styleUrls: ['./dialog-form.component.scss']\r\n})\r\nexport class DialogFormComponent {\r\n\r\n public formUrl: string;\r\n public cols = 1;\r\n public esForm: EsForm;\r\n public maxFormHeight: number = window.innerHeight - 60;\r\n\r\n constructor(\r\n public dialogRef: MatDialogRef<DialogFormComponent>,\r\n ds: EsDialogService,\r\n ) {\r\n const data = ds.getData();\r\n this.formUrl = data.url;\r\n }\r\n\r\n submit(value: {[name: string]: any}) {\r\n\r\n // sem se to dostane jen pri success ulozeni formu\r\n const result: DialogResult = {\r\n clickedYes: true\r\n };\r\n this.dialogRef.close(result);\r\n\r\n\r\n\r\n // pokud bysme chteli form.value\r\n // this.dialogRef.close(value);\r\n // console.log('form value v parent', value);\r\n\r\n\r\n }\r\n\r\n getWindowHeight() {\r\n this.maxFormHeight = window.innerHeight - 60;\r\n }\r\n\r\n\r\n}\r\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';\r\nimport {Router} from '@angular/router';\r\nimport {EsButton} from './model/es-button.interface';\r\nimport {EsButtonAction} from './model/es-button-action';\r\nimport {MatDialogRef} from '@angular/material/dialog';\r\nimport {MatSnackBar, MatSnackBarConfig} from '@angular/material/snack-bar';\r\nimport {EsSnackBarPanelClass} from '@eurosat/snackbar';\r\nimport {HttpService} from '@eurosat/http';\r\nimport {EsIcon} from '@eurosat/icon';\r\nimport {DialogConfirmComponent} from './components/dialog-confirm/dialog-confirm.component';\r\nimport {take} from 'rxjs/internal/operators';\r\nimport {DialogFormComponent} from './components/dialog-form/dialog-form.component';\r\nimport {EsDialogService} from '@eurosat/dialog';\r\nimport {EsDialogConfig} from '@eurosat/dialog';\r\nimport { DialogResult } from './components/dialog-result';\r\nimport { EsButtonServerResponse } from './model/es-button-server-response';\r\nimport { EsFormResponseMessage, EsFormResponseMessageType } from '@eurosat/form';\r\n\r\n// todo translates\r\n\r\n@Component({\r\n selector: 'es-buttons',\r\n templateUrl: './es-buttons.component.html',\r\n styleUrls: ['./es-buttons.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class EsButtonsComponent implements OnChanges {\r\n\r\n @Input() parentWidth = 40; // default 40 = 1 button\r\n @Input() buttons: EsButton[] = []; // normal input\r\n @Input() forceMenu = false; // pokud chci zobrazit ... menu i pro jeden buttonek, na realtimu pouzito\r\n\r\n @Output() buttonClick = new EventEmitter<EsButton>();\r\n @Output() reload = new EventEmitter<boolean>();\r\n @Output() dialogCreated = new EventEmitter<MatDialogRef<any>>();\r\n @Output() serverResponse = new EventEmitter<EsButtonServerResponse>();\r\n\r\n menuVisible = false;\r\n buttonWidth = 40; // todo ViewChild, sirka buttonu ?\r\n visibleButtons: EsButton[] = [];\r\n hiddenButtons: EsButton[] = [];\r\n esIcon = EsIcon;\r\n _width = 0;\r\n\r\n constructor(\r\n private router: Router,\r\n private dialog: EsDialogService,\r\n private snackBar: MatSnackBar,\r\n private http: HttpService,\r\n ) { }\r\n\r\n showMenu() {\r\n return this.getHiddenButtons() && this.getHiddenButtons().length > 0 && this.getHiddenButtons().length !== 1;\r\n }\r\n\r\n countVisible() {\r\n return Math.floor((this._width) / this.buttonWidth) - 1;\r\n }\r\n\r\n getVisibleButtons() {\r\n if (this.buttons && this.buttons.length > 0) {\r\n return this.buttons.filter(button => {\r\n if (this.buttons.indexOf(button) < this.countVisible()\r\n || (this.getHiddenButtons().length === 1 && !this.forceMenu)) {\r\n return true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n getHiddenButtons() {\r\n if (this.buttons && this.buttons.length > 0) {\r\n return this.buttons.filter(button => {\r\n if (this.buttons.indexOf(button) >= this.countVisible()) {\r\n return true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n ngOnChanges(simpleChange: SimpleChanges) {\r\n if (simpleChange['parentWidth']) {\r\n if (this.parentWidth > 0) {\r\n this._width = this.parentWidth;\r\n this.recalculateButtons();\r\n }\r\n }\r\n\r\n if (simpleChange['buttons']) {\r\n if (typeof this.buttons === 'string') {\r\n this.buttons = JSON.parse(this.buttons);\r\n }\r\n this.recalculateButtons();\r\n }\r\n }\r\n\r\n recalculateButtons() {\r\n this.menuVisible = this.showMenu();\r\n this.visibleButtons = this.getVisibleButtons();\r\n this.hiddenButtons = this.getHiddenButtons();\r\n }\r\n\r\n handleAction(button: EsButton) {\r\n if (button.action === EsButtonAction.ACTION_DIALOG_CONFIRM) {\r\n this.openConfirm(button);\r\n }\r\n if (button.action === EsButtonAction.ACTION_DIALOG_DELETE) {\r\n this.openDelete(button);\r\n }\r\n if (button.action === EsButtonAction.ACTION_DIALOG_FORM) {\r\n this.openForm(button);\r\n }\r\n if (button.action === EsButtonAction.ACTION_DOWNLOAD) {\r\n this.http.get(button.url, {responseType: 'blob', observe: 'response'}).subscribe(response => {\r\n const filename = response.headers.get('Content-Disposition').split('filename=')[1];\r\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\r\n window.navigator.msSaveBlob(response.body, filename);\r\n } else {\r\n const link = document.createElement('a');\r\n link.setAttribute('href', window.URL.createObjectURL(response.body));\r\n link.setAttribute('download', filename);\r\n link.style.visibility = 'hidden';\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n }\r\n });\r\n }\r\n if (button.action === EsButtonAction.ACTION_REQUEST) {\r\n this.http.get(button.url).subscribe((response: EsFormResponseMessage) => {\r\n const config = new MatSnackBarConfig();\r\n config.duration = 2000;\r\n if (response.type === EsFormResponseMessageType.TYPE_OK) {\r\n config.panelClass = EsSnackBarPanelClass.SUCCESS;\r\n } else {\r\n config.panelClass = EsSnackBarPanelClass.DANGER;\r\n }\r\n this.snackBar.open(response.message, null, config);\r\n this.reload.emit(true);\r\n this.serverResponse.emit({button: button, response: response});\r\n });\r\n }\r\n if (button.action === EsButtonAction.ACTION_ROUTER_NAVIGATE) {\r\n this.router.navigateByUrl(button.url);\r\n }\r\n if (button.action === EsButtonAction.ACTION_WINDOW_LOCATION) {\r\n window.location.href = button.url;\r\n }\r\n this.buttonClick.emit(button);\r\n }\r\n\r\n // handleSubMenuAction(button: EsButton) {\r\n // // todo asi predelat na md2 menu\r\n // // todo nevim jestli se zpropaguje click kdyz je to zanoreny pres es-card-header\r\n // this.buttonClick.emit(button);\r\n // }\r\n\r\n openForm(button: EsButton) {\r\n const config: EsDialogConfig = {\r\n title: button.title,\r\n data: {\r\n url: button.url\r\n }\r\n };\r\n const dialogRef: MatDialogRef<DialogFormComponent> = this.dialog.open(DialogFormComponent, config);\r\n this.dialogCreated.emit(dialogRef);\r\n dialogRef.afterClosed().pipe(take(1)).subscribe( (res: DialogResult) => {\r\n if (res && res.clickedYes) {\r\n this.reload.emit(true);\r\n\r\n if (res.serverResponse) {\r\n this.serverResponse.emit({button: button, response: res.serverResponse});\r\n }\r\n }\r\n });\r\n }\r\n\r\n openDelete(button: EsButton) {\r\n this.openConfirm(button);\r\n }\r\n\r\n openConfirm(button: EsButton) {\r\n const config: EsDialogConfig = {\r\n title: button.title,\r\n data: {\r\n message: button.message,\r\n url: button.url\r\n }\r\n };\r\n const dialogRef: MatDialogRef<DialogConfirmComponent> = this.dialog.open(DialogConfirmComponent, config);\r\n this.dialogCreated.emit(dialogRef);\r\n dialogRef.afterClosed().pipe(take(1)).subscribe( (res: DialogResult) => {\r\n if (res && res.clickedYes) {\r\n this.reload.emit(true);\r\n\r\n if (res.serverResponse) {\r\n this.serverResponse.emit({button: button, response: res.serverResponse});\r\n }\r\n }\r\n });\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\nimport {EsButtonsComponent} from './es-buttons.component';\r\nimport {MatButtonModule} from '@angular/material/button';\r\nimport {MatMenuModule} from '@angular/material/menu';\r\nimport {MatSnackBarModule} from '@angular/material/snack-bar';\r\nimport {MatTooltipModule} from '@angular/material/tooltip';\r\nimport {TranslateModule} from '@ngx-translate/core';\r\nimport {EsIconModule} from '@eurosat/icon';\r\nimport {EsDialogModule} from '@eurosat/dialog';\r\nimport {EsFormModule} from '@eurosat/form';\r\nimport {DialogConfirmComponent} from './components/dialog-confirm/dialog-confirm.component';\r\nimport {DialogFormComponent} from './components/dialog-form/dialog-form.component';\r\n\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n MatMenuModule,\r\n MatSnackBarModule,\r\n TranslateModule.forChild(),\r\n EsIconModule,\r\n EsDialogModule,\r\n EsFormModule,\r\n ],\r\n declarations: [\r\n EsButtonsComponent,\r\n DialogConfirmComponent,\r\n DialogFormComponent,\r\n ],\r\n exports: [EsButtonsComponent],\r\n entryComponents: [\r\n DialogConfirmComponent,\r\n DialogFormComponent,\r\n ],\r\n})\r\nexport class EsButtonsModule { }\r\n","import {EsButtonAction} from './es-button-action';\r\n\r\nexport interface EsButton {\r\n key?: any;\r\n title: string;\r\n icon: string;\r\n url?: string;\r\n action?: EsButtonAction;\r\n message?: string;\r\n tooltip?: string;\r\n submenu?: EsButton[];\r\n color?: string;\r\n themeColor?: 'primary' | 'accent' | 'warn' | 'disabled-icon' | '';\r\n disabled?: boolean;\r\n}\r\n","import { EsButton } from './es-button.interface';\r\n\r\nexport interface EsButtonServerResponse {\r\n button: EsButton;\r\n response: any;\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;MAAa,cAAc;;AAET,oCAAqB,GAAG,gBAAgB,CAAC;AACzC,mCAAoB,GAAG,eAAe,CAAC;AACvC,iCAAkB,GAAG,aAAa,CAAC;AACnC,uCAAwB,GAAG,mBAAmB,CAAC;AAC/C,yCAA0B,GAAG,qBAAqB,CAAC;;AACnD,yCAA0B,GAAG,qBAAqB,CAAC;;AACnD,8BAAe,GAAG,UAAU,CAAC;AAC7B,6BAAc,GAAG,SAAS,CAAC;AAC3B,qCAAsB,GAAG,iBAAiB,CAAC;AAC3C,qCAAsB,GAAG,WAAW,CAAC;;;IATnD,qCAAuD;;IACvD,oCAAqD;;IACrD,kCAAiD;;IACjD,wCAA6D;;IAC7D,0CAAiE;;IACjE,0CAAiE;;IACjE,+BAA2C;;IAC3C,8BAAyC;;IACzC,sCAAyD;;IACzD,sCAAmD;;;;;;;;MCG1C,sBAAsB;;;;;;IAO/B,YACW,SAA+C,EAC9C,QAAqB,EACrB,EAAmB;QAFpB,cAAS,GAAT,SAAS,CAAsC;QAC9C,aAAQ,GAAR,QAAQ,CAAa;QACrB,OAAE,GAAF,EAAE,CAAiB;QARrB,WAAM,GAAsB,IAAI,YAAY,EAAO,CAAC;QAG9D,kBAAa,GAAG,KAAK,CAAC;;cAOZ,IAAI,GAAG,IA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kC;;IAClC,uCAA2B;;IAE3B,yCAAqD;;IACrD,oCAA+C;;IAC/C,2CAAgE;;IAChE,4CAAsE;;IAEtE,yCAAoB;;IACpB,yCAAiB;;IACjB,4CAAgC;;IAChC,2CAA+B;;IAC/B,oCAAgB;;IAChB,oCAAW;;;;;IAGP,oCAAsB;;;;;IACtB,oCAA+B;;;;;IAC/B,sCAA6B;;;;;IAC7B,kCAAyB;;;;;;;;MCVpB,eAAe;;;YAvB3B,QAAQ,SAAC;gBACN,OAAO,EAAE;oBACL,YAAY;oBACZ,eAAe;oBACf,gBAAgB;oBAChB,aAAa;oBACb,iBAAiB;oBACjB,eAAe,CAAC,QAAQ,EAAE;oBAC1B,YAAY;oBACZ,cAAc;oBACd,YAAY;iBACf;gBACD,YAAY,EAAE;oBACV,kBAAkB;oBAClB,sBAAsB;oBACtB,mBAAmB;iBACtB;gBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;gBAC7B,eAAe,EAAE;oBACb,sBAAsB;oBACtB,mBAAmB;iBACtB;aACJ;;;;;;;;;;;uBCvBA;;;IAXG,uBAAU;;IACV,yBAAc;;IACd,wBAAa;;IACb,uBAAa;;IACb,0BAAwB;;IACxB,2BAAiB;;IACjB,2BAAiB;;IACjB,2BAAqB;;IACrB,yBAAe;;IACf,8BAAkE;;IAClE,4BAAmB;;;;;;;;;;;qCCRtB;;;IAFG,wCAAiB;;IACjB,0CAAc;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"eurosat-buttons.js","sources":["../../../projects/buttons/src/lib/model/es-button-action.ts","../../../projects/buttons/src/lib/components/dialog-confirm/dialog-confirm.component.ts","../../../projects/buttons/src/lib/components/dialog-form/dialog-form.component.ts","../../../projects/buttons/src/lib/es-buttons.component.ts","../../../projects/buttons/src/lib/es-buttons.module.ts","../../../projects/buttons/src/public_api.ts","../../../projects/buttons/src/eurosat-buttons.ts"],"sourcesContent":["export class EsButtonAction {\n\n public static ACTION_DIALOG_CONFIRM = 'dialog-confirm';\n public static ACTION_DIALOG_DELETE = 'dialog-delete';\n public static ACTION_DIALOG_FORM = 'dialog-form';\n public static ACTION_CARD_CONTENT_FORM = 'card-content-form';\n public static ACTION_CARD_CONTENT_WIZARD = 'card-content-wizard'; // todo asi zrusit\n public static ACTION_CHANGE_CARD_CONTENT = 'change-card-content'; // mozna zrusit ? je kuli neemitu clicku na button\n public static ACTION_DOWNLOAD = 'download';\n public static ACTION_REQUEST = 'request';\n public static ACTION_ROUTER_NAVIGATE = 'router-navigate';\n public static ACTION_WINDOW_LOCATION = 'open-link';\n}\n","import {Component, EventEmitter, Output} from '@angular/core';\nimport {MatDialogRef} from '@angular/material/dialog';\nimport {MatSnackBar, MatSnackBarConfig} from '@angular/material/snack-bar';\nimport {EsSnackBarPanelClass} from '@eurosat/snackbar';\nimport {EsDialogService} from '@eurosat/dialog';\nimport { DialogResult } from '../dialog-result';\nimport { EsFormResponseMessage, EsFormResponseMessageType } from '@eurosat/form';\n\n\n@Component({\n selector: 'dialog-confirm',\n templateUrl: './dialog-confirm.component.html',\n styleUrls: ['./dialog-confirm.component.scss']\n})\nexport class DialogConfirmComponent {\n\n @Output() submit: EventEmitter<any> = new EventEmitter<any>();\n public message: string;\n public url: string;\n activeRequest = false;\n\n constructor(\n public dialogRef: MatDialogRef<DialogConfirmComponent>,\n private snackBar: MatSnackBar,\n private ds: EsDialogService\n ) {\n const data = this.ds.getData();\n this.message = data.message;\n this.url = data.url;\n }\n\n confirm() {\n this.activeRequest = true;\n this.ds.httpPost(this.url, null).subscribe((response: EsFormResponseMessage) => {\n this.activeRequest = false;\n const config = new MatSnackBarConfig();\n config.duration = 2000;\n if (response.type === EsFormResponseMessageType.TYPE_OK) {\n config.panelClass = EsSnackBarPanelClass.SUCCESS;\n this.submit.emit();\n } else {\n config.panelClass = EsSnackBarPanelClass.DANGER;\n }\n this.snackBar.open(response.message, null, config);\n\n const result: DialogResult = {\n clickedYes: true,\n serverResponse: response\n };\n this.dialogRef.close(result);\n });\n }\n\n}\n","import {Component} from '@angular/core';\nimport {MatDialogRef} from '@angular/material/dialog';\nimport {EsForm} from '@eurosat/form';\nimport {EsDialogService} from '@eurosat/dialog';\nimport { DialogResult } from '../dialog-result';\n\n@Component({\n selector: 'dialog-form',\n templateUrl: './dialog-form.component.html',\n styleUrls: ['./dialog-form.component.scss']\n})\nexport class DialogFormComponent {\n\n public formUrl: string;\n public cols = 1;\n public esForm: EsForm;\n public maxFormHeight: number = window.innerHeight - 60;\n\n constructor(\n public dialogRef: MatDialogRef<DialogFormComponent>,\n ds: EsDialogService,\n ) {\n const data = ds.getData();\n this.formUrl = data.url;\n }\n\n submit(value: {[name: string]: any}) {\n\n // sem se to dostane jen pri success ulozeni formu\n const result: DialogResult = {\n clickedYes: true\n };\n this.dialogRef.close(result);\n\n\n\n // pokud bysme chteli form.value\n // this.dialogRef.close(value);\n // console.log('form value v parent', value);\n\n\n }\n\n getWindowHeight() {\n this.maxFormHeight = window.innerHeight - 60;\n }\n\n\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';\nimport {Router} from '@angular/router';\nimport {EsButton} from './model/es-button.interface';\nimport {EsButtonAction} from './model/es-button-action';\nimport {MatDialogRef} from '@angular/material/dialog';\nimport {MatSnackBar, MatSnackBarConfig} from '@angular/material/snack-bar';\nimport {EsSnackBarPanelClass} from '@eurosat/snackbar';\nimport {HttpService} from '@eurosat/http';\nimport {EsIcon} from '@eurosat/icon';\nimport {DialogConfirmComponent} from './components/dialog-confirm/dialog-confirm.component';\nimport {take} from 'rxjs/internal/operators';\nimport {DialogFormComponent} from './components/dialog-form/dialog-form.component';\nimport {EsDialogService} from '@eurosat/dialog';\nimport {EsDialogConfig} from '@eurosat/dialog';\nimport { DialogResult } from './components/dialog-result';\nimport { EsButtonServerResponse } from './model/es-button-server-response';\nimport { EsFormResponseMessage, EsFormResponseMessageType } from '@eurosat/form';\n\n// todo translates\n\n@Component({\n selector: 'es-buttons',\n templateUrl: './es-buttons.component.html',\n styleUrls: ['./es-buttons.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EsButtonsComponent implements OnChanges {\n\n @Input() parentWidth = 40; // default 40 = 1 button\n @Input() buttons: EsButton[] = []; // normal input\n @Input() forceMenu = false; // pokud chci zobrazit ... menu i pro jeden buttonek, na realtimu pouzito\n\n @Output() buttonClick = new EventEmitter<EsButton>();\n @Output() reload = new EventEmitter<boolean>();\n @Output() dialogCreated = new EventEmitter<MatDialogRef<any>>();\n @Output() serverResponse = new EventEmitter<EsButtonServerResponse>();\n\n menuVisible = false;\n buttonWidth = 40; // todo ViewChild, sirka buttonu ?\n visibleButtons: EsButton[] = [];\n hiddenButtons: EsButton[] = [];\n esIcon = EsIcon;\n _width = 0;\n\n constructor(\n private router: Router,\n private dialog: EsDialogService,\n private snackBar: MatSnackBar,\n private http: HttpService,\n ) { }\n\n showMenu() {\n return this.getHiddenButtons() && this.getHiddenButtons().length > 0 && this.getHiddenButtons().length !== 1;\n }\n\n countVisible() {\n return Math.floor((this._width) / this.buttonWidth) - 1;\n }\n\n getVisibleButtons() {\n if (this.buttons && this.buttons.length > 0) {\n return this.buttons.filter(button => {\n if (this.buttons.indexOf(button) < this.countVisible()\n || (this.getHiddenButtons().length === 1 && !this.forceMenu)) {\n return true;\n }\n });\n }\n }\n\n getHiddenButtons() {\n if (this.buttons && this.buttons.length > 0) {\n return this.buttons.filter(button => {\n if (this.buttons.indexOf(button) >= this.countVisible()) {\n return true;\n }\n });\n }\n }\n\n ngOnChanges(simpleChange: SimpleChanges) {\n if (simpleChange['parentWidth']) {\n if (this.parentWidth > 0) {\n this._width = this.parentWidth;\n this.recalculateButtons();\n }\n }\n\n if (simpleChange['buttons']) {\n if (typeof this.buttons === 'string') {\n this.buttons = JSON.parse(this.buttons);\n }\n this.recalculateButtons();\n }\n }\n\n recalculateButtons() {\n this.menuVisible = this.showMenu();\n this.visibleButtons = this.getVisibleButtons();\n this.hiddenButtons = this.getHiddenButtons();\n }\n\n handleAction(button: EsButton) {\n if (button.action === EsButtonAction.ACTION_DIALOG_CONFIRM) {\n this.openConfirm(button);\n }\n if (button.action === EsButtonAction.ACTION_DIALOG_DELETE) {\n this.openDelete(button);\n }\n if (button.action === EsButtonAction.ACTION_DIALOG_FORM) {\n this.openForm(button);\n }\n if (button.action === EsButtonAction.ACTION_DOWNLOAD) {\n this.http.get(button.url, {responseType: 'blob', observe: 'response'}).subscribe(response => {\n const filename = response.headers.get('Content-Disposition').split('filename=')[1];\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\n window.navigator.msSaveBlob(response.body, filename);\n } else {\n const link = document.createElement('a');\n link.setAttribute('href', window.URL.createObjectURL(response.body));\n link.setAttribute('download', filename);\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n });\n }\n if (button.action === EsButtonAction.ACTION_REQUEST) {\n this.http.get(button.url).subscribe((response: EsFormResponseMessage) => {\n const config = new MatSnackBarConfig();\n config.duration = 2000;\n if (response.type === EsFormResponseMessageType.TYPE_OK) {\n config.panelClass = EsSnackBarPanelClass.SUCCESS;\n } else {\n config.panelClass = EsSnackBarPanelClass.DANGER;\n }\n this.snackBar.open(response.message, null, config);\n this.reload.emit(true);\n this.serverResponse.emit({button: button, response: response});\n });\n }\n if (button.action === EsButtonAction.ACTION_ROUTER_NAVIGATE) {\n this.router.navigateByUrl(button.url);\n }\n if (button.action === EsButtonAction.ACTION_WINDOW_LOCATION) {\n window.location.href = button.url;\n }\n this.buttonClick.emit(button);\n }\n\n // handleSubMenuAction(button: EsButton) {\n // // todo asi predelat na md2 menu\n // // todo nevim jestli se zpropaguje click kdyz je to zanoreny pres es-card-header\n // this.buttonClick.emit(button);\n // }\n\n openForm(button: EsButton) {\n const config: EsDialogConfig = {\n title: button.title,\n data: {\n url: button.url\n }\n };\n const dialogRef: MatDialogRef<DialogFormComponent> = this.dialog.open(DialogFormComponent, config);\n this.dialogCreated.emit(dialogRef);\n dialogRef.afterClosed().pipe(take(1)).subscribe( (res: DialogResult) => {\n if (res && res.clickedYes) {\n this.reload.emit(true);\n\n if (res.serverResponse) {\n this.serverResponse.emit({button: button, response: res.serverResponse});\n }\n }\n });\n }\n\n openDelete(button: EsButton) {\n this.openConfirm(button);\n }\n\n openConfirm(button: EsButton) {\n const config: EsDialogConfig = {\n title: button.title,\n data: {\n message: button.message,\n url: button.url\n }\n };\n const dialogRef: MatDialogRef<DialogConfirmComponent> = this.dialog.open(DialogConfirmComponent, config);\n this.dialogCreated.emit(dialogRef);\n dialogRef.afterClosed().pipe(take(1)).subscribe( (res: DialogResult) => {\n if (res && res.clickedYes) {\n this.reload.emit(true);\n\n if (res.serverResponse) {\n this.serverResponse.emit({button: button, response: res.serverResponse});\n }\n }\n });\n }\n}\n","import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {EsButtonsComponent} from './es-buttons.component';\nimport {MatButtonModule} from '@angular/material/button';\nimport {MatMenuModule} from '@angular/material/menu';\nimport {MatSnackBarModule} from '@angular/material/snack-bar';\nimport {MatTooltipModule} from '@angular/material/tooltip';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {EsIconModule} from '@eurosat/icon';\nimport {EsDialogModule} from '@eurosat/dialog';\nimport {EsFormModule} from '@eurosat/form';\nimport {DialogConfirmComponent} from './components/dialog-confirm/dialog-confirm.component';\nimport {DialogFormComponent} from './components/dialog-form/dialog-form.component';\n\n\n@NgModule({\n imports: [\n CommonModule,\n MatButtonModule,\n MatTooltipModule,\n MatMenuModule,\n MatSnackBarModule,\n TranslateModule.forChild(),\n EsIconModule,\n EsDialogModule,\n EsFormModule,\n ],\n declarations: [\n EsButtonsComponent,\n DialogConfirmComponent,\n DialogFormComponent,\n ],\n exports: [EsButtonsComponent],\n entryComponents: [\n DialogConfirmComponent,\n DialogFormComponent,\n ],\n})\nexport class EsButtonsModule { }\n","/*\n * Public API Surface of es-buttons\n */\n\nexport * from './lib/es-buttons.component';\nexport * from './lib/es-buttons.module';\nexport * from './lib/model/es-button.interface';\nexport * from './lib/model/es-button-action';\nexport * from './lib/model/es-button-server-response';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n\nexport {DialogConfirmComponent as ɵa} from './lib/components/dialog-confirm/dialog-confirm.component';\nexport {DialogFormComponent as ɵb} from './lib/components/dialog-form/dialog-form.component';"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAAa,cAAc;;AAET,oCAAqB,GAAG,gBAAgB,CAAC;AACzC,mCAAoB,GAAG,eAAe,CAAC;AACvC,iCAAkB,GAAG,aAAa,CAAC;AACnC,uCAAwB,GAAG,mBAAmB,CAAC;AAC/C,yCAA0B,GAAG,qBAAqB,CAAC;AACnD,yCAA0B,GAAG,qBAAqB,CAAC;AACnD,8BAAe,GAAG,UAAU,CAAC;AAC7B,6BAAc,GAAG,SAAS,CAAC;AAC3B,qCAAsB,GAAG,iBAAiB,CAAC;AAC3C,qCAAsB,GAAG,WAAW;;MCGzC,sBAAsB;IAO/B,YACW,SAA+C,EAC9C,QAAqB,EACrB,EAAmB;QAFpB,cAAS,GAAT,SAAS,CAAsC;QAC9C,aAAQ,GAAR,QAAQ,CAAa;QACrB,OAAE,GAAF,EAAE,CAAiB;QARrB,WAAM,GAAsB,IAAI,YAAY,EAAO,CAAC;QAG9D,kBAAa,GAAG,KAAK,CAAC;QAOlB,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;KACvB;IAED,OAAO;QACH,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,QAA+B;YACvE,IAAI,CAAC,aAAa,GAAG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,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAE,CAAC,GAAiB;YAC/D,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAEvB,IAAI,GAAG,CAAC,cAAc,EAAE;oBACpB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,cAAc,EAAC,CAAC,CAAC;iBAC5E;aACJ;SACJ,CAAC,CAAC;KACN;;;YApLJ,SAAS,SAAC;gBACP,QAAQ,EAAE,YAAY;gBACtB,wmUAA0C;gBAE1C,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAClD;;;;YAxBO,MAAM;YAWN,eAAe;YAPf,WAAW;YAEX,WAAW;;;0BAqBd,KAAK;sBACL,KAAK;wBACL,KAAK;0BAEL,MAAM;qBACN,MAAM;4BACN,MAAM;6BACN,MAAM;;;MCGE,eAAe;;;YAvB3B,QAAQ,SAAC;gBACN,OAAO,EAAE;oBACL,YAAY;oBACZ,eAAe;oBACf,gBAAgB;oBAChB,aAAa;oBACb,iBAAiB;oBACjB,eAAe,CAAC,QAAQ,EAAE;oBAC1B,YAAY;oBACZ,cAAc;oBACd,YAAY;iBACf;gBACD,YAAY,EAAE;oBACV,kBAAkB;oBAClB,sBAAsB;oBACtB,mBAAmB;iBACtB;gBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;gBAC7B,eAAe,EAAE;oBACb,sBAAsB;oBACtB,mBAAmB;iBACtB;aACJ;;;ACrCD;;;;ACAA;;;;;;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
-
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
-
import { EsDialogService } from '@eurosat/dialog';
|
|
5
|
-
export declare class DialogConfirmComponent {
|
|
6
|
-
dialogRef: MatDialogRef<DialogConfirmComponent>;
|
|
7
|
-
private snackBar;
|
|
8
|
-
private ds;
|
|
9
|
-
submit: EventEmitter<any>;
|
|
10
|
-
message: string;
|
|
11
|
-
url: string;
|
|
12
|
-
activeRequest: boolean;
|
|
13
|
-
constructor(dialogRef: MatDialogRef<DialogConfirmComponent>, snackBar: MatSnackBar, ds: EsDialogService);
|
|
14
|
-
confirm(): void;
|
|
15
|
-
}
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
+
import { EsDialogService } from '@eurosat/dialog';
|
|
5
|
+
export declare class DialogConfirmComponent {
|
|
6
|
+
dialogRef: MatDialogRef<DialogConfirmComponent>;
|
|
7
|
+
private snackBar;
|
|
8
|
+
private ds;
|
|
9
|
+
submit: EventEmitter<any>;
|
|
10
|
+
message: string;
|
|
11
|
+
url: string;
|
|
12
|
+
activeRequest: boolean;
|
|
13
|
+
constructor(dialogRef: MatDialogRef<DialogConfirmComponent>, snackBar: MatSnackBar, ds: EsDialogService);
|
|
14
|
+
confirm(): void;
|
|
15
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { MatDialogRef } from '@angular/material/dialog';
|
|
2
|
-
import { EsForm } from '@eurosat/form';
|
|
3
|
-
import { EsDialogService } from '@eurosat/dialog';
|
|
4
|
-
export declare class DialogFormComponent {
|
|
5
|
-
dialogRef: MatDialogRef<DialogFormComponent>;
|
|
6
|
-
formUrl: string;
|
|
7
|
-
cols: number;
|
|
8
|
-
esForm: EsForm;
|
|
9
|
-
maxFormHeight: number;
|
|
10
|
-
constructor(dialogRef: MatDialogRef<DialogFormComponent>, ds: EsDialogService);
|
|
11
|
-
submit(value: {
|
|
12
|
-
[name: string]: any;
|
|
13
|
-
}): void;
|
|
14
|
-
getWindowHeight(): void;
|
|
15
|
-
}
|
|
1
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
2
|
+
import { EsForm } from '@eurosat/form';
|
|
3
|
+
import { EsDialogService } from '@eurosat/dialog';
|
|
4
|
+
export declare class DialogFormComponent {
|
|
5
|
+
dialogRef: MatDialogRef<DialogFormComponent>;
|
|
6
|
+
formUrl: string;
|
|
7
|
+
cols: number;
|
|
8
|
+
esForm: EsForm;
|
|
9
|
+
maxFormHeight: number;
|
|
10
|
+
constructor(dialogRef: MatDialogRef<DialogFormComponent>, ds: EsDialogService);
|
|
11
|
+
submit(value: {
|
|
12
|
+
[name: string]: any;
|
|
13
|
+
}): void;
|
|
14
|
+
getWindowHeight(): void;
|
|
15
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface DialogResult {
|
|
2
|
-
clickedYes: boolean;
|
|
3
|
-
serverResponse?: any;
|
|
4
|
-
}
|
|
1
|
+
export interface DialogResult {
|
|
2
|
+
clickedYes: boolean;
|
|
3
|
+
serverResponse?: any;
|
|
4
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
3
|
-
import { EsButton } from './model/es-button.interface';
|
|
4
|
-
import { MatDialogRef } from '@angular/material/dialog';
|
|
5
|
-
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
6
|
-
import { HttpService } from '@eurosat/http';
|
|
7
|
-
import { EsIcon } from '@eurosat/icon';
|
|
8
|
-
import { EsDialogService } from '@eurosat/dialog';
|
|
9
|
-
import { EsButtonServerResponse } from './model/es-button-server-response';
|
|
10
|
-
export declare class EsButtonsComponent implements OnChanges {
|
|
11
|
-
private router;
|
|
12
|
-
private dialog;
|
|
13
|
-
private snackBar;
|
|
14
|
-
private http;
|
|
15
|
-
parentWidth: number;
|
|
16
|
-
buttons: EsButton[];
|
|
17
|
-
forceMenu: boolean;
|
|
18
|
-
buttonClick: EventEmitter<EsButton>;
|
|
19
|
-
reload: EventEmitter<boolean>;
|
|
20
|
-
dialogCreated: EventEmitter<MatDialogRef<any, any>>;
|
|
21
|
-
serverResponse: EventEmitter<EsButtonServerResponse>;
|
|
22
|
-
menuVisible: boolean;
|
|
23
|
-
buttonWidth: number;
|
|
24
|
-
visibleButtons: EsButton[];
|
|
25
|
-
hiddenButtons: EsButton[];
|
|
26
|
-
esIcon: typeof EsIcon;
|
|
27
|
-
_width: number;
|
|
28
|
-
constructor(router: Router, dialog: EsDialogService, snackBar: MatSnackBar, http: HttpService);
|
|
29
|
-
showMenu(): boolean;
|
|
30
|
-
countVisible(): number;
|
|
31
|
-
getVisibleButtons(): EsButton[];
|
|
32
|
-
getHiddenButtons(): EsButton[];
|
|
33
|
-
ngOnChanges(simpleChange: SimpleChanges): void;
|
|
34
|
-
recalculateButtons(): void;
|
|
35
|
-
handleAction(button: EsButton): void;
|
|
36
|
-
openForm(button: EsButton): void;
|
|
37
|
-
openDelete(button: EsButton): void;
|
|
38
|
-
openConfirm(button: EsButton): void;
|
|
39
|
-
}
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
import { EsButton } from './model/es-button.interface';
|
|
4
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
5
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
6
|
+
import { HttpService } from '@eurosat/http';
|
|
7
|
+
import { EsIcon } from '@eurosat/icon';
|
|
8
|
+
import { EsDialogService } from '@eurosat/dialog';
|
|
9
|
+
import { EsButtonServerResponse } from './model/es-button-server-response';
|
|
10
|
+
export declare class EsButtonsComponent implements OnChanges {
|
|
11
|
+
private router;
|
|
12
|
+
private dialog;
|
|
13
|
+
private snackBar;
|
|
14
|
+
private http;
|
|
15
|
+
parentWidth: number;
|
|
16
|
+
buttons: EsButton[];
|
|
17
|
+
forceMenu: boolean;
|
|
18
|
+
buttonClick: EventEmitter<EsButton>;
|
|
19
|
+
reload: EventEmitter<boolean>;
|
|
20
|
+
dialogCreated: EventEmitter<MatDialogRef<any, any>>;
|
|
21
|
+
serverResponse: EventEmitter<EsButtonServerResponse>;
|
|
22
|
+
menuVisible: boolean;
|
|
23
|
+
buttonWidth: number;
|
|
24
|
+
visibleButtons: EsButton[];
|
|
25
|
+
hiddenButtons: EsButton[];
|
|
26
|
+
esIcon: typeof EsIcon;
|
|
27
|
+
_width: number;
|
|
28
|
+
constructor(router: Router, dialog: EsDialogService, snackBar: MatSnackBar, http: HttpService);
|
|
29
|
+
showMenu(): boolean;
|
|
30
|
+
countVisible(): number;
|
|
31
|
+
getVisibleButtons(): EsButton[];
|
|
32
|
+
getHiddenButtons(): EsButton[];
|
|
33
|
+
ngOnChanges(simpleChange: SimpleChanges): void;
|
|
34
|
+
recalculateButtons(): void;
|
|
35
|
+
handleAction(button: EsButton): void;
|
|
36
|
+
openForm(button: EsButton): void;
|
|
37
|
+
openDelete(button: EsButton): void;
|
|
38
|
+
openConfirm(button: EsButton): void;
|
|
39
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare class EsButtonsModule {
|
|
2
|
-
}
|
|
1
|
+
export declare class EsButtonsModule {
|
|
2
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export declare class EsButtonAction {
|
|
2
|
-
static ACTION_DIALOG_CONFIRM: string;
|
|
3
|
-
static ACTION_DIALOG_DELETE: string;
|
|
4
|
-
static ACTION_DIALOG_FORM: string;
|
|
5
|
-
static ACTION_CARD_CONTENT_FORM: string;
|
|
6
|
-
static ACTION_CARD_CONTENT_WIZARD: string;
|
|
7
|
-
static ACTION_CHANGE_CARD_CONTENT: string;
|
|
8
|
-
static ACTION_DOWNLOAD: string;
|
|
9
|
-
static ACTION_REQUEST: string;
|
|
10
|
-
static ACTION_ROUTER_NAVIGATE: string;
|
|
11
|
-
static ACTION_WINDOW_LOCATION: string;
|
|
12
|
-
}
|
|
1
|
+
export declare class EsButtonAction {
|
|
2
|
+
static ACTION_DIALOG_CONFIRM: string;
|
|
3
|
+
static ACTION_DIALOG_DELETE: string;
|
|
4
|
+
static ACTION_DIALOG_FORM: string;
|
|
5
|
+
static ACTION_CARD_CONTENT_FORM: string;
|
|
6
|
+
static ACTION_CARD_CONTENT_WIZARD: string;
|
|
7
|
+
static ACTION_CHANGE_CARD_CONTENT: string;
|
|
8
|
+
static ACTION_DOWNLOAD: string;
|
|
9
|
+
static ACTION_REQUEST: string;
|
|
10
|
+
static ACTION_ROUTER_NAVIGATE: string;
|
|
11
|
+
static ACTION_WINDOW_LOCATION: string;
|
|
12
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EsButton } from './es-button.interface';
|
|
2
|
-
export interface EsButtonServerResponse {
|
|
3
|
-
button: EsButton;
|
|
4
|
-
response: any;
|
|
5
|
-
}
|
|
1
|
+
import { EsButton } from './es-button.interface';
|
|
2
|
+
export interface EsButtonServerResponse {
|
|
3
|
+
button: EsButton;
|
|
4
|
+
response: any;
|
|
5
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { EsButtonAction } from './es-button-action';
|
|
2
|
-
export interface EsButton {
|
|
3
|
-
key?: any;
|
|
4
|
-
title: string;
|
|
5
|
-
icon: string;
|
|
6
|
-
url?: string;
|
|
7
|
-
action?: EsButtonAction;
|
|
8
|
-
message?: string;
|
|
9
|
-
tooltip?: string;
|
|
10
|
-
submenu?: EsButton[];
|
|
11
|
-
color?: string;
|
|
12
|
-
themeColor?: 'primary' | 'accent' | 'warn' | 'disabled-icon' | '';
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
}
|
|
1
|
+
import { EsButtonAction } from './es-button-action';
|
|
2
|
+
export interface EsButton {
|
|
3
|
+
key?: any;
|
|
4
|
+
title: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
action?: EsButtonAction;
|
|
8
|
+
message?: string;
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
submenu?: EsButton[];
|
|
11
|
+
color?: string;
|
|
12
|
+
themeColor?: 'primary' | 'accent' | 'warn' | 'disabled-icon' | '';
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eurosat/buttons",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
7
|
-
"@eurosat/dialog": "^
|
|
8
|
-
"@eurosat/form": "^
|
|
5
|
+
"@angular/common": "^12.2.16",
|
|
6
|
+
"@angular/core": "^12.2.16",
|
|
7
|
+
"@eurosat/dialog": "^12.0.0",
|
|
8
|
+
"@eurosat/form": "^12.0.0"
|
|
9
9
|
},
|
|
10
10
|
"main": "bundles/eurosat-buttons.umd.js",
|
|
11
|
-
"module": "
|
|
11
|
+
"module": "fesm2015/eurosat-buttons.js",
|
|
12
12
|
"es2015": "fesm2015/eurosat-buttons.js",
|
|
13
|
-
"esm5": "esm5/eurosat-buttons.js",
|
|
14
13
|
"esm2015": "esm2015/eurosat-buttons.js",
|
|
15
|
-
"fesm5": "fesm5/eurosat-buttons.js",
|
|
16
14
|
"fesm2015": "fesm2015/eurosat-buttons.js",
|
|
17
15
|
"typings": "eurosat-buttons.d.ts",
|
|
18
16
|
"metadata": "eurosat-buttons.metadata.json",
|
|
19
17
|
"sideEffects": false,
|
|
20
18
|
"dependencies": {
|
|
21
|
-
"tslib": "^
|
|
19
|
+
"tslib": "^2.0.0"
|
|
22
20
|
}
|
|
23
|
-
}
|
|
21
|
+
}
|
package/public_api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './lib/es-buttons.component';
|
|
2
|
-
export * from './lib/es-buttons.module';
|
|
3
|
-
export * from './lib/model/es-button.interface';
|
|
4
|
-
export * from './lib/model/es-button-action';
|
|
5
|
-
export * from './lib/model/es-button-server-response';
|
|
1
|
+
export * from './lib/es-buttons.component';
|
|
2
|
+
export * from './lib/es-buttons.module';
|
|
3
|
+
export * from './lib/model/es-button.interface';
|
|
4
|
+
export * from './lib/model/es-button-action';
|
|
5
|
+
export * from './lib/model/es-button-server-response';
|
package/esm5/eurosat-buttons.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* Generated from: eurosat-buttons.ts
|
|
4
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Generated bundle index. Do not edit.
|
|
8
|
-
*/
|
|
9
|
-
export { EsButtonsComponent, EsButtonsModule, EsButtonAction } from './public_api';
|
|
10
|
-
export { DialogConfirmComponent as ɵa } from './lib/components/dialog-confirm/dialog-confirm.component';
|
|
11
|
-
export { DialogFormComponent as ɵb } from './lib/components/dialog-form/dialog-form.component';
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXVyb3NhdC1idXR0b25zLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGV1cm9zYXQvYnV0dG9ucy8iLCJzb3VyY2VzIjpbImV1cm9zYXQtYnV0dG9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUlBLG9FQUFjLGNBQWMsQ0FBQztBQUU3QixPQUFPLEVBQUMsc0JBQXNCLElBQUksRUFBRSxFQUFDLE1BQU0sMERBQTBELENBQUM7QUFDdEcsT0FBTyxFQUFDLG1CQUFtQixJQUFJLEVBQUUsRUFBQyxNQUFNLG9EQUFvRCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuXG5leHBvcnQge0RpYWxvZ0NvbmZpcm1Db21wb25lbnQgYXMgybVhfSBmcm9tICcuL2xpYi9jb21wb25lbnRzL2RpYWxvZy1jb25maXJtL2RpYWxvZy1jb25maXJtLmNvbXBvbmVudCc7XG5leHBvcnQge0RpYWxvZ0Zvcm1Db21wb25lbnQgYXMgybVifSBmcm9tICcuL2xpYi9jb21wb25lbnRzL2RpYWxvZy1mb3JtL2RpYWxvZy1mb3JtLmNvbXBvbmVudCc7Il19
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* Generated from: lib/components/dialog-confirm/dialog-confirm.component.ts
|
|
4
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
-
*/
|
|
6
|
-
import { Component, EventEmitter, Output } from '@angular/core';
|
|
7
|
-
import { MatDialogRef } from '@angular/material/dialog';
|
|
8
|
-
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
|
|
9
|
-
import { EsSnackBarPanelClass } from '@eurosat/snackbar';
|
|
10
|
-
import { EsDialogService } from '@eurosat/dialog';
|
|
11
|
-
import { EsFormResponseMessageType } from '@eurosat/form';
|
|
12
|
-
var DialogConfirmComponent = /** @class */ (function () {
|
|
13
|
-
function DialogConfirmComponent(dialogRef, snackBar, ds) {
|
|
14
|
-
this.dialogRef = dialogRef;
|
|
15
|
-
this.snackBar = snackBar;
|
|
16
|
-
this.ds = ds;
|
|
17
|
-
this.submit = new EventEmitter();
|
|
18
|
-
this.activeRequest = false;
|
|
19
|
-
/** @type {?} */
|
|
20
|
-
var data = this.ds.getData();
|
|
21
|
-
this.message = data.message;
|
|
22
|
-
this.url = data.url;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @return {?}
|
|
26
|
-
*/
|
|
27
|
-
DialogConfirmComponent.prototype.confirm = /**
|
|
28
|
-
* @return {?}
|
|
29
|
-
*/
|
|
30
|
-
function () {
|
|
31
|
-
var _this = this;
|
|
32
|
-
this.activeRequest = true;
|
|
33
|
-
this.ds.httpPost(this.url, null).subscribe((/**
|
|
34
|
-
* @param {?} response
|
|
35
|
-
* @return {?}
|
|
36
|
-
*/
|
|
37
|
-
function (response) {
|
|
38
|
-
_this.activeRequest = false;
|
|
39
|
-
/** @type {?} */
|
|
40
|
-
var config = new MatSnackBarConfig();
|
|
41
|
-
config.duration = 2000;
|
|
42
|
-
if (response.type === EsFormResponseMessageType.TYPE_OK) {
|
|
43
|
-
config.panelClass = EsSnackBarPanelClass.SUCCESS;
|
|
44
|
-
_this.submit.emit();
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
config.panelClass = EsSnackBarPanelClass.DANGER;
|
|
48
|
-
}
|
|
49
|
-
_this.snackBar.open(response.message, null, config);
|
|
50
|
-
/** @type {?} */
|
|
51
|
-
var result = {
|
|
52
|
-
clickedYes: true,
|
|
53
|
-
serverResponse: response
|
|
54
|
-
};
|
|
55
|
-
_this.dialogRef.close(result);
|
|
56
|
-
}));
|
|
57
|
-
};
|
|
58
|
-
DialogConfirmComponent.decorators = [
|
|
59
|
-
{ type: Component, args: [{
|
|
60
|
-
selector: 'dialog-confirm',
|
|
61
|
-
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",
|
|
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: MatDialogRef },
|
|
68
|
-
{ type: MatSnackBar },
|
|
69
|
-
{ type: EsDialogService }
|
|
70
|
-
]; };
|
|
71
|
-
DialogConfirmComponent.propDecorators = {
|
|
72
|
-
submit: [{ type: Output }]
|
|
73
|
-
};
|
|
74
|
-
return DialogConfirmComponent;
|
|
75
|
-
}());
|
|
76
|
-
export { DialogConfirmComponent };
|
|
77
|
-
if (false) {
|
|
78
|
-
/** @type {?} */
|
|
79
|
-
DialogConfirmComponent.prototype.submit;
|
|
80
|
-
/** @type {?} */
|
|
81
|
-
DialogConfirmComponent.prototype.message;
|
|
82
|
-
/** @type {?} */
|
|
83
|
-
DialogConfirmComponent.prototype.url;
|
|
84
|
-
/** @type {?} */
|
|
85
|
-
DialogConfirmComponent.prototype.activeRequest;
|
|
86
|
-
/** @type {?} */
|
|
87
|
-
DialogConfirmComponent.prototype.dialogRef;
|
|
88
|
-
/**
|
|
89
|
-
* @type {?}
|
|
90
|
-
* @private
|
|
91
|
-
*/
|
|
92
|
-
DialogConfirmComponent.prototype.snackBar;
|
|
93
|
-
/**
|
|
94
|
-
* @type {?}
|
|
95
|
-
* @private
|
|
96
|
-
*/
|
|
97
|
-
DialogConfirmComponent.prototype.ds;
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLWNvbmZpcm0uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGV1cm9zYXQvYnV0dG9ucy8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL2RpYWxvZy1jb25maXJtL2RpYWxvZy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xhc3MgPSBFc1NuYWNrQmFyUGFuZWxDbGFzcy5TVUNDRVNTO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5zdWJtaXQuZW1pdCgpO1xyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgY29uZmlnLnBhbmVsQ2xhc3MgPSBFc1NuYWNrQmFyUGFuZWxDbGFzcy5EQU5HRVI7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGhpcy5zbmFja0Jhci5vcGVuKHJlc3BvbnNlLm1lc3NhZ2UsIG51bGwsIGNvbmZpZyk7XHJcblxyXG4gICAgICAgICAgICBjb25zdCByZXN1bHQ6IERpYWxvZ1Jlc3VsdCA9IHtcclxuICAgICAgICAgICAgICAgIGNsaWNrZWRZZXM6IHRydWUsXHJcbiAgICAgICAgICAgICAgICBzZXJ2ZXJSZXNwb25zZTogcmVzcG9uc2VcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgdGhpcy5kaWFsb2dSZWYuY2xvc2UocmVzdWx0KTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcbn1cclxuIl19
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* Generated from: lib/components/dialog-form/dialog-form.component.ts
|
|
4
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
-
*/
|
|
6
|
-
import { Component } from '@angular/core';
|
|
7
|
-
import { MatDialogRef } from '@angular/material/dialog';
|
|
8
|
-
import { EsDialogService } from '@eurosat/dialog';
|
|
9
|
-
var DialogFormComponent = /** @class */ (function () {
|
|
10
|
-
function DialogFormComponent(dialogRef, ds) {
|
|
11
|
-
this.dialogRef = dialogRef;
|
|
12
|
-
this.cols = 1;
|
|
13
|
-
this.maxFormHeight = window.innerHeight - 60;
|
|
14
|
-
/** @type {?} */
|
|
15
|
-
var data = ds.getData();
|
|
16
|
-
this.formUrl = data.url;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* @param {?} value
|
|
20
|
-
* @return {?}
|
|
21
|
-
*/
|
|
22
|
-
DialogFormComponent.prototype.submit = /**
|
|
23
|
-
* @param {?} value
|
|
24
|
-
* @return {?}
|
|
25
|
-
*/
|
|
26
|
-
function (value) {
|
|
27
|
-
// sem se to dostane jen pri success ulozeni formu
|
|
28
|
-
/** @type {?} */
|
|
29
|
-
var result = {
|
|
30
|
-
clickedYes: true
|
|
31
|
-
};
|
|
32
|
-
this.dialogRef.close(result);
|
|
33
|
-
// pokud bysme chteli form.value
|
|
34
|
-
// this.dialogRef.close(value);
|
|
35
|
-
// console.log('form value v parent', value);
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* @return {?}
|
|
39
|
-
*/
|
|
40
|
-
DialogFormComponent.prototype.getWindowHeight = /**
|
|
41
|
-
* @return {?}
|
|
42
|
-
*/
|
|
43
|
-
function () {
|
|
44
|
-
this.maxFormHeight = window.innerHeight - 60;
|
|
45
|
-
};
|
|
46
|
-
DialogFormComponent.decorators = [
|
|
47
|
-
{ type: Component, args: [{
|
|
48
|
-
selector: 'dialog-form',
|
|
49
|
-
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",
|
|
50
|
-
styles: [".es-form-container{overflow:auto;margin-top:24px;position:relative}"]
|
|
51
|
-
}] }
|
|
52
|
-
];
|
|
53
|
-
/** @nocollapse */
|
|
54
|
-
DialogFormComponent.ctorParameters = function () { return [
|
|
55
|
-
{ type: MatDialogRef },
|
|
56
|
-
{ type: EsDialogService }
|
|
57
|
-
]; };
|
|
58
|
-
return DialogFormComponent;
|
|
59
|
-
}());
|
|
60
|
-
export { DialogFormComponent };
|
|
61
|
-
if (false) {
|
|
62
|
-
/** @type {?} */
|
|
63
|
-
DialogFormComponent.prototype.formUrl;
|
|
64
|
-
/** @type {?} */
|
|
65
|
-
DialogFormComponent.prototype.cols;
|
|
66
|
-
/** @type {?} */
|
|
67
|
-
DialogFormComponent.prototype.esForm;
|
|
68
|
-
/** @type {?} */
|
|
69
|
-
DialogFormComponent.prototype.maxFormHeight;
|
|
70
|
-
/** @type {?} */
|
|
71
|
-
DialogFormComponent.prototype.dialogRef;
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLWZvcm0uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGV1cm9zYXQvYnV0dG9ucy8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL2RpYWxvZy1mb3JtL2RpYWxvZy1mb3JtLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDeEMsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLDBCQUEwQixDQUFDO0FBRXRELE9BQU8sRUFBQyxlQUFlLEVBQUMsTUFBTSxpQkFBaUIsQ0FBQztBQUdoRDtJQVlJLDZCQUNXLFNBQTRDLEVBQ25ELEVBQW1CO1FBRFosY0FBUyxHQUFULFNBQVMsQ0FBbUM7UUFMaEQsU0FBSSxHQUFHLENBQUMsQ0FBQztRQUVULGtCQUFhLEdBQVcsTUFBTSxDQUFDLFdBQVcsR0FBRyxFQUFFLENBQUM7O1lBTTdDLElBQUksR0FBRyxFQUFFLENBQUMsT0FBTyxFQUFFO1FBQ3pCLElBQUksQ0FBQyxPQUFPLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQztJQUM1QixDQUFDOzs7OztJQUVELG9DQUFNOzs7O0lBQU4sVUFBTyxLQUE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biAgICAgICAgLy8gY29uc29sZS5sb2coJ2Zvcm0gdmFsdWUgdiBwYXJlbnQnLCB2YWx1ZSk7XHJcblxyXG5cclxuICAgIH1cclxuXHJcbiAgICBnZXRXaW5kb3dIZWlnaHQoKSB7XHJcbiAgICAgICAgdGhpcy5tYXhGb3JtSGVpZ2h0ID0gd2luZG93LmlubmVySGVpZ2h0IC0gNjA7XHJcbiAgICB9XHJcblxyXG5cclxufVxyXG4iXX0=
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* Generated from: lib/components/dialog-result.ts
|
|
4
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @record
|
|
8
|
-
*/
|
|
9
|
-
export function DialogResult() { }
|
|
10
|
-
if (false) {
|
|
11
|
-
/** @type {?} */
|
|
12
|
-
DialogResult.prototype.clickedYes;
|
|
13
|
-
/** @type {?|undefined} */
|
|
14
|
-
DialogResult.prototype.serverResponse;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLXJlc3VsdC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BldXJvc2F0L2J1dHRvbnMvIiwic291cmNlcyI6WyJsaWIvY29tcG9uZW50cy9kaWFsb2ctcmVzdWx0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUEsa0NBR0M7OztJQUZHLGtDQUFvQjs7SUFDcEIsc0NBQXFCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBEaWFsb2dSZXN1bHQge1xyXG4gICAgY2xpY2tlZFllczogYm9vbGVhbjtcclxuICAgIHNlcnZlclJlc3BvbnNlPzogYW55O1xyXG59XHJcbiJdfQ==
|