@inovamobil/ic-databar-lib 2.2.1-dev.0 → 2.2.2-next.1

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.
@@ -1,2 +1,2 @@
1
- !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("@inovamobil/ic-confirma-dialog"),require("@inovamobil/icm-snackbar"),require("rxjs/operators"),require("@angular/material/dialog"),require("@angular/material/button"),require("@angular/material/divider"),require("@angular/material/icon"),require("@angular/material/list"),require("@angular/material/progress-spinner"),require("@angular/material/sidenav"),require("@angular/material/toolbar"),require("@angular/material/tooltip"),require("@angular/flex-layout"),require("@angular/common")):"function"==typeof define&&define.amd?define("@inovamobil/ic-databar-lib",["exports","@angular/core","@inovamobil/ic-confirma-dialog","@inovamobil/icm-snackbar","rxjs/operators","@angular/material/dialog","@angular/material/button","@angular/material/divider","@angular/material/icon","@angular/material/list","@angular/material/progress-spinner","@angular/material/sidenav","@angular/material/toolbar","@angular/material/tooltip","@angular/flex-layout","@angular/common"],r):r(((t="undefined"!=typeof globalThis?globalThis:t||self).inovamobil=t.inovamobil||{},t.inovamobil["ic-databar-lib"]={}),t.ng.core,t["ic-confirma-dialog"],t["icm-snackbar"],t.rxjs.operators,t.ng.material.dialog,t.ng.material.button,t.ng.material.divider,t.ng.material.icon,t.ng.material.list,t.ng.material.progressSpinner,t.ng.material.sidenav,t.ng.material.toolbar,t.ng.material.tooltip,t.ng.flexLayout,t.ng.common)}(this,(function(t,r,a,e,o,i,n,s,c,d,l,u,m,p,b,v){"use strict";var f;(f=t.EStatus||(t.EStatus={})).novaPesquisa="Nova pesquisa",f.inserindo="Inserindo",f.editando="Editando",f.removendo="Removendo",f.dadosCarregados="Dados carregados",f.pesquisando="Pesquisando",f.executarAcao="Executar ação",f.salvando="Salvando";var g=function(){function r(){this.EStatus=t.EStatus}return r.prototype.ngOnInit=function(){this.onInit(),this.servicoDataBarBind.status=t.EStatus.novaPesquisa},r.prototype.statusChanged=function(t){this.servicoDataBarBind.status=t,this.statusDataBar=t,this.onStatusChanged(t)},Object.defineProperty(r.prototype,"inserindoOuEditando",{get:function(){return this.statusDataBar===t.EStatus.inserindo||this.statusDataBar===t.EStatus.editando},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"inserindo",{get:function(){return this.statusDataBar===t.EStatus.inserindo},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"editando",{get:function(){return this.statusDataBar===t.EStatus.editando},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"editandoOuRemovendo",{get:function(){return this.statusDataBar===t.EStatus.editando||this.statusDataBar===t.EStatus.removendo},enumerable:!1,configurable:!0}),r}();g.decorators=[{type:r.Directive}];var h,x=function(){function t(){}return t.prototype.desabilitarBotaoNovaPesquisa=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoReverter=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoPesquisar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoEditar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoClonar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoAdicionar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoRemover=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoSalvar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoPrimeiro=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoAnterior=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoProximo=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoUltimo=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoModoTabela=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.exibirBotaoModoTabela=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.exibirBotaoClonar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t}();(h=t.EEventoClick||(t.EEventoClick={})).onClickInserir="onInserir",h.afterClickInserir="afterClickInserir",h.onClickReverter="onReverter",h.afterClickReverter="afterClickReverter",h.onClickNovaPesquisa="onNovaPesquisa",h.afterClickNovaPesquisa="afterClickNovaPesquisa",h.onClickEditar="onEditar",h.afterClickEditar="afterClickEditar",h.onClickRemover="onRemover",h.afterClickRemover="afterClickRemover",h.onClickSalvar="onClickSalvar",h.afterClickSalvar="afterClickSalvar",h.onClickModoTabela="onClickModoTabela",h.afterClickClonar="afterClickClonar";var _=function(){function t(t){this.onEvent=t}return t.prototype.emitir=function(t){this.onEvent(t)},t}(),E=function(){function t(t,r){this.dialogRef=t,this.mensagem=r.mensagem,this.titulo=r.titulo}return t.prototype.close=function(){this.dialogRef.close()},t}();E.decorators=[{type:r.Component,args:[{selector:"confirma-dialog",template:'<h2 mat-dialog-title class="error__title">{{titulo}}</h2>\r\n\r\n<mat-dialog-content>\r\n <p>{{mensagem}}</p>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions align="end">\r\n <button class="mat-raised-button" (click)="close()">Ok</button>\r\n</mat-dialog-actions>\r\n',styles:[".error__title{text-align:center}"]}]}],E.ctorParameters=function(){return[{type:i.MatDialogRef},{type:void 0,decorators:[{type:r.Inject,args:[i.MAT_DIALOG_DATA]}]}]};var S=function(){function t(t){this.dialog=t}return t.prototype.openDialog=function(t,r){var a=new i.MatDialogConfig;a.disableClose=!0,a.autoFocus=!0,a.data={titulo:t,mensagem:r},a.minWidth="300px",this.dialogRef=this.dialog.open(E,a)},t.prototype.closeDialog=function(){this.dialogRef.close()},t}();S.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new S(r.ɵɵinject(i.MatDialog))},token:S,providedIn:"root"}),S.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],S.ctorParameters=function(){return[{type:i.MatDialog}]};var y=function(){function t(){}return Object.defineProperty(t.prototype,"statusAnterior",{get:function(){return this._statusAnterior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dadosAnterioresFormulario",{get:function(){return this._dadosAnterioresFormulario},enumerable:!1,configurable:!0}),t.prototype.setDadosAnteriores=function(t,r,a){this._entidadePaginadaAnterior={entidade:a.entidade,posicao:a.posicao,quantidade:a.quantidade,total:a.total},this._dadosAnterioresFormulario=r.getRawValue(),this._statusAnterior=t},t.prototype.restaurarDadosAnteriores=function(t){return t.patchValue(this._dadosAnterioresFormulario),this._entidadePaginadaAnterior},t}();y.decorators=[{type:r.Injectable}];var P=function(){function t(){}return t.prototype.desabilitarForm=function(t){t.disable({emitEvent:!1,onlySelf:!0})},t.prototype.habilitarForm=function(t){t.enable({emitEvent:!1,onlySelf:!0})},t.prototype.resetForm=function(t,r){t.reset({emitEvent:!1,onlySelf:!0}),r.entidade=null,r.posicao=0,r.total=0},t.prototype.emitirEventoClick=function(t,r){t.eventDatabar&&t.eventDatabar.emitir(r)},t.prototype.definirProgresso=function(t,r){if(t)return r?this.desabilitarForm(t):this.habilitarForm(t),r},t}();P.decorators=[{type:r.Injectable}],P.ctorParameters=function(){return[]};var B=function(){function a(a,e,o,i,n){this._dialog=a,this._dialogErro=e,this._elementRef=o,this._databarService=i,this._snackBarService=n,this.disabled=!1,this.statusChanged=new r.EventEmitter,this.EStatus=t.EStatus,this.emProgresso=!1}return Object.defineProperty(a.prototype,"servicoReverter",{set:function(t){this._servicoReverter=t},enumerable:!1,configurable:!0}),a.prototype.ngOnInit=function(){this.validarPropertsObrigatorias(),this.setProgresso(!1),this.novaPesquisa(),this._submeterFormularioOnEnter(),this.observarSetStatus(),this._pesquisarPosicaoSelecionada()},a.prototype.ngOnDestroy=function(){this.servicoBind.onClickEnter&&this.servicoBind.onClickEnter.unsubscribe(),this.$setStatus&&this.$setStatus.unsubscribe()},a.prototype.fecharSidenav=function(t){this._elementRef.nativeElement.contains(t.target)||this.drawer.close()},Object.defineProperty(a.prototype,"inserindoOuEditando",{get:function(){return this.status===t.EStatus.inserindo||this.status===t.EStatus.editando},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoModoTabela",{get:function(){var r;return this.status==t.EStatus.inserindo||this.status==t.EStatus.editando||this.emProgresso||this.form.invalid||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoModoTabela())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoPesquisar",{get:function(){var r;return this.status==t.EStatus.inserindo||this.status==t.EStatus.editando||this.status==t.EStatus.dadosCarregados||this.emProgresso||this.form.invalid||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoPesquisar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoReverter",{get:function(){var r;return this.status==t.EStatus.novaPesquisa||this.status==t.EStatus.executarAcao||this.status==t.EStatus.dadosCarregados||this.emProgresso||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoReverter())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoAdicionar",{get:function(){var r;return this.status==t.EStatus.editando||this.status==t.EStatus.inserindo||this.emProgresso||this.disabled||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoAdicionar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoEditar",{get:function(){var r;return this.status==t.EStatus.inserindo||this.status==t.EStatus.novaPesquisa||this.status==t.EStatus.executarAcao||this.status==t.EStatus.pesquisando||this.status==t.EStatus.editando||this.emProgresso||this.disabled||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoEditar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoClonar",{get:function(){var r,a;return!(null===(r=this.entidadePaginada)||void 0===r?void 0:r.entidade)||this.status!=t.EStatus.dadosCarregados||this.emProgresso||(null===(a=this.servicoConfiguracaoBotoes)||void 0===a?void 0:a.desabilitarBotaoClonar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoRemover",{get:function(){var r,a;return!(null===(r=this.entidadePaginada)||void 0===r?void 0:r.entidade)||this.status!=t.EStatus.dadosCarregados||this.emProgresso||(null===(a=this.servicoConfiguracaoBotoes)||void 0===a?void 0:a.desabilitarBotaoRemover())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoSalvar",{get:function(){var r,a;return(null===(r=this.form)||void 0===r?void 0:r.invalid)||this.status!=t.EStatus.inserindo&&this.status!=t.EStatus.editando||this.emProgresso||this.disabled||(null===(a=this.servicoConfiguracaoBotoes)||void 0===a?void 0:a.desabilitarBotaoSalvar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotoesPaginacaoRetroceder",{get:function(){return this.inserindoOuEditando||this.entidadePaginada.posicao<=1||this.emProgresso},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotoesPaginacaoAvancar",{get:function(){return this.inserindoOuEditando||this.entidadePaginada.posicao>=this.entidadePaginada.total||this.emProgresso},enumerable:!1,configurable:!0}),a.prototype.onClickReverter=function(){this._exibirDialogConfirmacaoReverter()},a.prototype.onClickModoTabela=function(){this._emitirEventoClick(t.EEventoClick.onClickModoTabela)},a.prototype.onClickNovaPesquisa=function(){this._emitirEventoClick(t.EEventoClick.onClickNovaPesquisa),this.novaPesquisa(),this._emitirEventoClick(t.EEventoClick.afterClickNovaPesquisa)},a.prototype.novaPesquisa=function(){this._databarService.habilitarForm(this.form),this.form.reset({emitEvent:!1,onlySelf:!0}),this.entidadePaginada.entidade=this.form.value,this.entidadePaginada.posicao=0,this.entidadePaginada.total=0,this.setStatus(t.EStatus.novaPesquisa)},a.prototype.pesquisar=function(){this.form.invalid||(this._setDadosAnteriores(),this.setStatus(t.EStatus.pesquisando),this.entidadePaginada.entidade=[].concat(this._getEntidade()),this._paginar(),this.drawer.close())},a.prototype.inserir=function(){this._emitirEventoClick(t.EEventoClick.onClickInserir),this._clickInserir(),this._emitirEventoClick(t.EEventoClick.afterClickInserir)},a.prototype.editar=function(){this._emitirEventoClick(t.EEventoClick.onClickEditar),this._clickEditar(),this._emitirEventoClick(t.EEventoClick.afterClickEditar)},a.prototype.clonar=function(){this.inserir(),this.form.patchValue(this.retornarServicoReverter().dadosAnterioresFormulario),this._emitirEventoClick(t.EEventoClick.afterClickClonar)},a.prototype.remover=function(){this._emitirEventoClick(t.EEventoClick.onClickRemover),this._clickRemover(),this._emitirEventoClick(t.EEventoClick.afterClickRemover)},a.prototype.proximo=function(){this._paginar("proximo")},a.prototype.anterior=function(){this._paginar("anterior")},a.prototype.ultimo=function(){this._paginar("ultimo")},a.prototype.primeiro=function(){this._paginar("primeiro")},a.prototype.salvar=function(){switch(this._emitirEventoClick(t.EEventoClick.onClickSalvar),this.status){case t.EStatus.inserindo:this._inserir();break;case t.EStatus.editando:this._editar()}},a.prototype._inserir=function(){var r=this;this.setStatus(t.EStatus.salvando),this.setProgresso(!0),this.servicoBind.criar().pipe(o.finalize((function(){r._emitirEventoClick(t.EEventoClick.afterClickSalvar)}))).subscribe((function(a){r.setProgresso(!1),r._snackBarService.abrirSnackBarSucesso("Registro salvo com sucesso!"),r.form.patchValue(a),r.setStatus(t.EStatus.dadosCarregados),r.drawer.close(),r._databarService.desabilitarForm(r.form)}),(function(){r.setProgresso(!1),r.setStatus(t.EStatus.inserindo)}))},a.prototype._editar=function(){var r=this;this.setStatus(t.EStatus.salvando),this.setProgresso(!0),this.servicoBind.editar().pipe(o.finalize((function(){r._emitirEventoClick(t.EEventoClick.afterClickSalvar)}))).subscribe((function(a){r._snackBarService.abrirSnackBarSucesso("Registro editado com sucesso!"),r.form.patchValue(a),r.setProgresso(!1),r.setStatus(t.EStatus.dadosCarregados),r._databarService.desabilitarForm(r.form),r.drawer.close()}),(function(){r.setProgresso(!1),r.setStatus(t.EStatus.editando)}))},a.prototype.observarSetStatus=function(){var r=this;this.servicoBind.setStatus&&(this.$setStatus=this.servicoBind.setStatus.subscribe((function(a){switch(a){case t.EStatus.editando:r.editar(),r.emProgresso=!1;break;case t.EStatus.inserindo:r.inserir(),r.emProgresso=!1;break;case t.EStatus.pesquisando:r.pesquisar();break;case t.EStatus.novaPesquisa:r.novaPesquisa();break;case t.EStatus.removendo:r.remover();break;case t.EStatus.dadosCarregados:r.status=t.EStatus.dadosCarregados,r.emProgresso=!1}})))},a.prototype.retornarServicoReverter=function(){return null==this._servicoReverter&&(this._servicoReverter=new y),this._servicoReverter},a.prototype._setDadosAnteriores=function(){this.retornarServicoReverter().setDadosAnteriores(this.status,this.form,this.entidadePaginada)},a.prototype._reverter=function(){this._emitirEventoClick(t.EEventoClick.onClickReverter),this.entidadePaginada=this.retornarServicoReverter().restaurarDadosAnteriores(this.form);var r=this.retornarServicoReverter().statusAnterior;r==t.EStatus.dadosCarregados?this._databarService.desabilitarForm(this.form):this._databarService.habilitarForm(this.form),this.setStatus(r),this._emitirEventoClick(t.EEventoClick.afterClickReverter)},a.prototype._resetarContadorPaginacao=function(){this.entidadePaginada.posicao=0,this.entidadePaginada.total=0},a.prototype.validarPropertsObrigatorias=function(){if(null==this.servicoBind)throw new Error("É obrigatório ter um serviço de bind vinculado.");if(null==this.entidadePaginada)throw new Error("É obrigatório ter uma entidade paginada vinculada.")},a.prototype.setStatus=function(t){t&&(this.status=t,this.statusChanged.emit(this.status))},a.prototype._getEntidade=function(){return this.form.getRawValue()},a.prototype._submeterFormularioOnEnter=function(){var r=this;this.servicoBind.onClickEnter&&this.servicoBind.onClickEnter.subscribe((function(){r.status===t.EStatus.novaPesquisa&&r.form.valid&&r.pesquisar()}))},a.prototype._pesquisarPosicaoSelecionada=function(){var r=this;this.servicoBind.pesquisarPosicaoSelecionada&&this.servicoBind.pesquisarPosicaoSelecionada.subscribe((function(a){r.status===t.EStatus.novaPesquisa&&r.form.valid&&(r.entidadePaginada=a,r._pesquisarSelecionado())}))},a.prototype._pesquisarSelecionado=function(){this.form.invalid||(this._setDadosAnteriores(),this.setStatus(t.EStatus.pesquisando),this._paginar("customizado"),this.drawer.close())},a.prototype._clickInserir=function(){this._setDadosAnteriores(),this._resetarContadorPaginacao(),this._databarService.habilitarForm(this.form),this.form.reset({emitEvent:!1,onlySelf:!0}),this.form.markAllAsTouched(),this.drawer.close(),this.setStatus(t.EStatus.inserindo)},a.prototype._clickEditar=function(){this._setDadosAnteriores(),this._databarService.habilitarForm(this.form),this.form.markAllAsTouched(),this.drawer.close(),this.setStatus(t.EStatus.editando)},a.prototype._clickRemover=function(){this.setStatus(t.EStatus.removendo),this._exibirDialogConfirmacao(),this.drawer.close()},a.prototype._emitirEventoClick=function(t){return this._databarService.emitirEventoClick(this.servicoBind,t)},a.prototype._acaoCloseDialogConfirmacao=function(){this._dialog.emProgresso=!1,this._dialog.closeDialog(),this.setStatus(t.EStatus.dadosCarregados)},a.prototype._exibirDialogConfirmacao=function(){var t=this;this._dialog.acaoMensagem="Removendo registro...",this._dialog.acaoOk=function(){return t.servicoBind.remover().subscribe((function(){t._dialog.closeDialog(),t.novaPesquisa(),t._dialog.emProgresso=!1,t._snackBarService.abrirSnackBarSucesso("Removido com sucesso!")}),(function(){return t._acaoCloseDialogConfirmacao()}))},this._dialog.acaoCancelar=function(){t._acaoCloseDialogConfirmacao()},this._dialog.openDialog("Atenção!","Você realmente deseja excluir este registro?")},a.prototype._exibirDialogConfirmacaoReverter=function(){var t=this;this._dialog.acaoOk=function(){t._reverter(),t._dialog.emProgresso=!1,t._dialog.closeDialog()},this._dialog.acaoCancelar=function(){t._dialog.closeDialog()},this._dialog.openDialog("Atenção!","As alterações realizadas serão perdidas. Deseja continuar?")},a.prototype._paginar=function(r){var a=this;this.setStatus(t.EStatus.pesquisando),null==this.entidadePaginada.entidade&&(this.entidadePaginada.entidade=[].concat(this._getEntidade()));var e=this.entidadePaginada.posicao;switch(r){case"primeiro":this.entidadePaginada.posicao=1;break;case"ultimo":this.entidadePaginada.posicao=this.entidadePaginada.total;break;case"proximo":this.entidadePaginada.posicao++;break;case"anterior":this.entidadePaginada.posicao--;break;case"customizado":break;default:this.entidadePaginada.posicao=0}this.setProgresso(!0),this.servicoBind.listarPaginacao(this.entidadePaginada).subscribe((function(r){return a.setProgresso(!1),null==r?(a._dialogErro.openDialog("Atenção!","Nenhum registro foi encontrado."),void a.setStatus(t.EStatus.novaPesquisa)):null==r.entidade?(a._databarService.resetForm(a.form,a.entidadePaginada),void a.setStatus(t.EStatus.novaPesquisa)):(a.setStatus(t.EStatus.dadosCarregados),a.entidadePaginada.entidade?(a.entidadePaginada.total=r.total,a.entidadePaginada.posicao=r.posicao):a.entidadePaginada=r,a.form.patchValue(r.entidade[0]),a.setProgresso(!1),void a._databarService.desabilitarForm(a.form))}),(function(r){422===r.status?a.setStatus(t.EStatus.novaPesquisa):(a.setStatus(t.EStatus.dadosCarregados),a.entidadePaginada.posicao=e,a._databarService.desabilitarForm(a.form)),a.setProgresso(!1),console.error("erro paginação",r)}))},a.prototype.setProgresso=function(t){this.emProgresso=this._databarService.definirProgresso(this.form,t)},a}();B.decorators=[{type:r.Component,args:[{selector:"ic-data-bar",template:'<div fxFlex="1 0 auto" fxFlexLayout="space-around center" fxLayout="column">\r\n \x3c!-- DESKTOP --\x3e\r\n <mat-toolbar class="px-0 mat-elevation-z4">\r\n <div fxFlex="1 0 auto" fxLayout="row" fxLayoutAlign="space-around center">\r\n \x3c!-- BOTÃO EXIBIR DRAWER --\x3e\r\n <mat-drawer-container fxFlex.sm fxHide.gt-sm>\r\n <button\r\n (click)="drawer.toggle()"\r\n id="btn_exibir_databar_mobile"\r\n mat-button\r\n type="button"\r\n color="primary"\r\n >\r\n <mat-icon>menu</mat-icon>\r\n </button>\r\n </mat-drawer-container>\r\n \x3c!-- /BOTÃO EXIBIR DRAWER --\x3e\r\n\r\n \x3c!-- AÇÕES --\x3e\r\n <div\r\n fxFlex.sm\r\n fxHide\r\n fxLayout="row"\r\n fxLayoutAlign="space-around center"\r\n fxShow.gt-sm\r\n >\r\n \x3c!-- BTN_NOVA_PESQUISA --\x3e\r\n <button\r\n (click)="onClickNovaPesquisa()"\r\n [disabled]="servicoConfiguracaoBotoes?.desabilitarBotaoNovaPesquisa()"\r\n color="primary"\r\n id="btn_nova_pesquisa"\r\n mat-button\r\n matTooltip="Nova Pesquisa"\r\n >\r\n <mat-icon>insert_drive_file</mat-icon>\r\n </button>\r\n \x3c!-- BTN_NOVA_PESQUISA --\x3e\r\n\r\n \x3c!-- BTN_REVERTER --\x3e\r\n <button\r\n (click)="onClickReverter()"\r\n [disabled]="desabilitarBotaoReverter"\r\n color="primary"\r\n id="btn_reverter"\r\n mat-button\r\n matTooltip="Reverter"\r\n >\r\n <mat-icon>restore</mat-icon>\r\n </button>\r\n \x3c!-- BTN_REVERTER --\x3e\r\n\r\n \x3c!-- BTN_PESQUISAR --\x3e\r\n <button\r\n (click)="pesquisar()"\r\n [disabled]="desabilitarBotaoPesquisar"\r\n color="primary"\r\n id="btn_pesquisar"\r\n mat-button\r\n matTooltip="Pesquisar"\r\n >\r\n <mat-icon>search</mat-icon>\r\n </button>\r\n \x3c!-- BTN_PESQUISAR --\x3e\r\n\r\n \x3c!-- BTN_ADICIONAR --\x3e\r\n <button\r\n (click)="inserir()"\r\n [disabled]="desabilitarBotaoAdicionar"\r\n color="primary"\r\n id="btn_adicionar"\r\n mat-button\r\n matTooltip="Adicionar"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n \x3c!-- BTN_ADICIONAR --\x3e\r\n\r\n \x3c!-- BTN_EDITAR --\x3e\r\n <button\r\n (click)="editar()"\r\n [disabled]="desabilitarBotaoEditar"\r\n color="primary"\r\n id="btn_editar"\r\n mat-button\r\n matTooltip="Editar"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n \x3c!-- BTN_EDITAR --\x3e\r\n\r\n \x3c!-- BTN_CLONAR --\x3e\r\n <button\r\n *ngIf="servicoConfiguracaoBotoes?.exibirBotaoClonar()"\r\n (click)="clonar()"\r\n [disabled]="desabilitarBotaoClonar"\r\n color="primary"\r\n id="btn_clonar"\r\n mat-button\r\n matTooltip="Clonar"\r\n >\r\n <mat-icon>content_copy</mat-icon>\r\n </button>\r\n \x3c!-- BTN_CLONAR --\x3e\r\n\r\n \x3c!-- BTN_REMOVER --\x3e\r\n <button\r\n (click)="remover()"\r\n [disabled]="desabilitarBotaoRemover"\r\n color="primary"\r\n id="btn_remover"\r\n mat-button\r\n matTooltip="Remover"\r\n >\r\n <mat-icon>delete_forever</mat-icon>\r\n </button>\r\n \x3c!-- BTN_REMOVER --\x3e\r\n\r\n \x3c!-- BTN_SALVAR --\x3e\r\n <button\r\n (click)="salvar()"\r\n [disabled]="desabilitarBotaoSalvar"\r\n color="primary"\r\n id="btn_salvar"\r\n mat-button\r\n matTooltip="Salvar"\r\n >\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n \x3c!-- BTN_SALVAR --\x3e\r\n </div>\r\n \x3c!-- /AÇÕES --\x3e\r\n\r\n \x3c!-- STATUS --\x3e\r\n <div fxLayout="row" fxLayoutAlign="center center">\r\n \x3c!-- PROGRESS --\x3e\r\n <mat-spinner *ngIf="emProgresso" [diameter]="20"></mat-spinner>\r\n \x3c!-- PROGRESS --\x3e\r\n\r\n <button\r\n color="primary"\r\n fxHide.lt-sm\r\n id="btn_status"\r\n mat-button\r\n matTooltip="Ação no momento"\r\n >\r\n {{ status }}\r\n </button>\r\n </div>\r\n \x3c!-- STATUS --\x3e\r\n\r\n \x3c!-- PAGINAÇÃO --\x3e\r\n <div fxFlex.sm fxLayout="row" fxLayoutAlign="center center">\r\n \x3c!-- BTN_PRIMEIRO --\x3e\r\n <button\r\n (click)="primeiro()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoRetroceder ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoPrimeiro()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n fxFlex.sm\r\n fxHide.lt-sm\r\n id="btn_primeiro"\r\n mat-button\r\n matTooltip="Primeiro item"\r\n >\r\n <mat-icon>first_page</mat-icon>\r\n </button>\r\n \x3c!-- BTN_PRIMEIRO --\x3e\r\n\r\n \x3c!-- BTN_ANTERIOR --\x3e\r\n <button\r\n (click)="anterior()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoRetroceder ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoAnterior()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n id="btn_anterior"\r\n mat-button\r\n matTooltip="Anterior"\r\n >\r\n <mat-icon>navigate_before</mat-icon>\r\n </button>\r\n \x3c!-- BTN_ANTERIOR --\x3e\r\n\r\n <div\r\n class="px-0 px-sm-12 contador-paginas"\r\n id="contador_paginacao"\r\n matTooltip="Página Atual"\r\n >\r\n {{ entidadePaginada?.posicao }} de {{ entidadePaginada?.total }}\r\n </div>\r\n\r\n \x3c!-- BTN_PROXIMO --\x3e\r\n <button\r\n (click)="proximo()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoAvancar ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoProximo()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n id="btn_proximo"\r\n mat-button\r\n matTooltip="Próximo"\r\n >\r\n <mat-icon>navigate_next</mat-icon>\r\n </button>\r\n \x3c!-- BTN_PROXIMO --\x3e\r\n\r\n \x3c!-- BTN_ULTIMO --\x3e\r\n <button\r\n (click)="ultimo()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoAvancar ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoUltimo()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n id="btn_ultimo"\r\n fxFlex.sm\r\n fxHide.lt-sm\r\n mat-button\r\n matTooltip="Último"\r\n >\r\n <mat-icon>last_page</mat-icon>\r\n </button>\r\n \x3c!-- BTN_ULTIMO --\x3e\r\n </div>\r\n \x3c!-- /PAGINAÇÃO --\x3e\r\n\r\n <div\r\n fxShow.gt-sm\r\n fxHide\r\n fxFlex.sm\r\n fxLayout="row"\r\n fxLayoutAlign="center center"\r\n >\r\n \x3c!-- MODO_TABELA --\x3e\r\n <button\r\n *ngIf="servicoConfiguracaoBotoes?.exibirBotaoModoTabela()"\r\n (click)="onClickModoTabela()"\r\n [disabled]="desabilitarBotaoModoTabela"\r\n color="primary"\r\n id="btn_modo_tabela"\r\n mat-button\r\n matTooltip="Alterar exibição para tabela"\r\n >\r\n <mat-icon>format_list_bulleted</mat-icon>\r\n </button>\r\n \x3c!-- MODO_TABELA --\x3e\r\n </div>\r\n </div>\r\n </mat-toolbar>\r\n \x3c!-- /DESKTOP --\x3e\r\n\r\n \x3c!-- MOBILE --\x3e\r\n <mat-drawer #drawer fxFlex fxLayoutAlign="column" mode="over">\r\n \x3c!-- FECHAR SIDENAV --\x3e\r\n <button\r\n (click)="drawer.toggle()"\r\n class="btn-fechar-drawer"\r\n id="btn_fechar_databar_mobile"\r\n mat-icon-button\r\n >\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n \x3c!-- /FECHAR SIDENAV --\x3e\r\n\r\n \x3c!-- STATUS --\x3e\r\n <div class="pr-12" fxLayout="row" fxLayoutAlign="space-between center">\r\n <div fxFlex="100" fxLayout="column" fxLayoutAlign="center center">\r\n <h4 class="pl-12">Ações</h4>\r\n <p class="texto-status" id="status_mobile">{{ status }}</p>\r\n </div>\r\n </div>\r\n \x3c!-- /STATUS --\x3e\r\n\r\n \x3c!-- OPCOES --\x3e\r\n <div class="px-12 overflow" fxLayout="column" fxLayoutAlign="start start">\r\n <mat-list>\r\n \x3c!-- BTN_PRIMEIRO --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="primeiro()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoRetroceder ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoPrimeiro()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n mat-button\r\n id="btn_primeiro_mobile"\r\n matTooltip="Primeiro item"\r\n >\r\n <mat-icon>first_page</mat-icon>\r\n Primeiro item\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_PRIMEIRO --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_ULTIMO --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="ultimo()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoAvancar ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoUltimo()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n id="btn_ultimo_mobile"\r\n mat-button\r\n matTooltip="Último"\r\n >\r\n <mat-icon>last_page</mat-icon>\r\n Último item\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_ULTIMO --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- MODO_TABELA --\x3e\r\n <mat-list-item>\r\n <button\r\n *ngIf="servicoConfiguracaoBotoes?.exibirBotaoModoTabela()"\r\n (click)="onClickModoTabela()"\r\n [disabled]="desabilitarBotaoModoTabela"\r\n color="primary"\r\n id="btn_modo_tabela_mobile"\r\n mat-button\r\n matTooltip="Alterar exibição para tabela"\r\n >\r\n <mat-icon>list</mat-icon>\r\n Modo tabela\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- MODO_TABELA --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_NOVA_PESQUISA --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="onClickNovaPesquisa()"\r\n [disabled]="\r\n servicoConfiguracaoBotoes?.desabilitarBotaoNovaPesquisa()\r\n "\r\n color="primary"\r\n mat-button\r\n id="btn_nova_pesquisa_mobile"\r\n matTooltip="Nova Pesquisa"\r\n >\r\n <mat-icon>restore_page</mat-icon>\r\n Nova Pesquisa\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_NOVA_PESQUISA --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_PESQUISAR --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="pesquisar()"\r\n [disabled]="desabilitarBotaoPesquisar"\r\n color="primary"\r\n id="btn_pesquisar_mobile"\r\n mat-button\r\n matTooltip="Pesquisar"\r\n >\r\n <mat-icon>search</mat-icon>\r\n Pesquisar\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_PESQUISAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_ADICIONAR --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="inserir()"\r\n [disabled]="desabilitarBotaoAdicionar"\r\n color="primary"\r\n mat-button\r\n id="btn_adicionar_mobile"\r\n matTooltip="Adicionar"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n Incluir\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_ADICIONAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_EDITAR --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="editar()"\r\n [disabled]="desabilitarBotaoEditar"\r\n color="primary"\r\n mat-button\r\n id="btn_editar_mobile"\r\n matTooltip="Editar"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n Editar\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_EDITAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_CLONAR --\x3e\r\n <mat-list-item *ngIf="servicoConfiguracaoBotoes?.exibirBotaoClonar()">\r\n <button\r\n (click)="clonar()"\r\n [disabled]="desabilitarBotaoClonar"\r\n color="primary"\r\n id="btn_clonar_mobile"\r\n mat-button\r\n matTooltip="Clonar"\r\n >\r\n <mat-icon>content_copy</mat-icon>\r\n Clonar\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_CLONAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_REMOVER --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="remover()"\r\n [disabled]="desabilitarBotaoRemover"\r\n color="primary"\r\n mat-button\r\n id="btn_remover_mobile"\r\n matTooltip="Remover"\r\n >\r\n <mat-icon>delete_forever</mat-icon>\r\n Remover\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_REMOVER --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_SALVAR --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="salvar()"\r\n [disabled]="desabilitarBotaoSalvar"\r\n color="primary"\r\n mat-button\r\n id="btn_salvar_mobile"\r\n matTooltip="Salvar"\r\n >\r\n <mat-icon>save</mat-icon>\r\n Salvar\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_SALVAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n </mat-list>\r\n </div>\r\n \x3c!-- /OPCOES --\x3e\r\n </mat-drawer>\r\n \x3c!-- /MOBILE --\x3e\r\n</div>\r\n',styles:["::ng-deep .sucesso{background:#4caf50!important;color:#fff!important}::ng-deep .sucesso button{color:#1b5e20!important;font-weight:800!important}.contador-paginas{color:#039be5;font-size:14px}@media (max-width:959px){.contador-paginas{font-size:12px}}.btn-fechar-drawer{position:absolute;right:5px;top:5px}.texto-status{color:#039be5;text-align:center}mat-toolbar{height:52px;width:100%}mat-drawer-container{background:transparent!important}mat-drawer{left:0;min-width:240px}.overflow,mat-drawer,mat-list{overflow-y:auto}:host{display:flex;flex:0 0 auto;z-index:99999}:host .mat-toolbar .pagina{font-size:10px;margin:1vm;text-align:center}:host.above{position:relative;z-index:99999999}"]}]}],B.ctorParameters=function(){return[{type:a.IcConfirmaDialogService},{type:S},{type:r.ElementRef},{type:P},{type:e.IcmSnackBarService}]},B.propDecorators={servicoBind:[{type:r.Input}],form:[{type:r.Input}],entidadePaginada:[{type:r.Input}],disabled:[{type:r.Input}],servicoConfiguracaoBotoes:[{type:r.Input}],servicoReverter:[{type:r.Input}],statusChanged:[{type:r.Output}],drawer:[{type:r.ViewChild,args:["drawer",{static:!1}]}],fecharSidenav:[{type:r.HostListener,args:["document:click",["$event"]]}]};var C=function(){};C.decorators=[{type:r.NgModule,args:[{declarations:[E],imports:[i.MatDialogModule],exports:[E],entryComponents:[E]}]}];var k=function(){};k.decorators=[{type:r.NgModule,args:[{declarations:[B],imports:[v.CommonModule,m.MatToolbarModule,d.MatListModule,u.MatSidenavModule,c.MatIconModule,l.MatProgressSpinnerModule,s.MatDividerModule,n.MatButtonModule,p.MatTooltipModule,b.FlexLayoutModule,a.IcConfirmaDialogModule,C,e.IcmSnackBarModule],exports:[B],providers:[P]}]}],t.DataBarComponent=B,t.DataBarConfigBotoesService=x,t.DataBarModule=k,t.DatabarEventClickService=_,t.OnInitDataBar=g,t.ɵa=S,t.ɵb=P,t.ɵc=C,t.ɵd=E,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("@inovamobil/ic-confirma-dialog"),require("@inovamobil/icm-snackbar"),require("rxjs/operators"),require("@angular/material/dialog"),require("@angular/material/button"),require("@angular/material/divider"),require("@angular/material/icon"),require("@angular/material/list"),require("@angular/material/progress-spinner"),require("@angular/material/sidenav"),require("@angular/material/toolbar"),require("@angular/material/tooltip"),require("@angular/flex-layout"),require("@angular/common")):"function"==typeof define&&define.amd?define("@inovamobil/ic-databar-lib",["exports","@angular/core","@inovamobil/ic-confirma-dialog","@inovamobil/icm-snackbar","rxjs/operators","@angular/material/dialog","@angular/material/button","@angular/material/divider","@angular/material/icon","@angular/material/list","@angular/material/progress-spinner","@angular/material/sidenav","@angular/material/toolbar","@angular/material/tooltip","@angular/flex-layout","@angular/common"],r):r(((t="undefined"!=typeof globalThis?globalThis:t||self).inovamobil=t.inovamobil||{},t.inovamobil["ic-databar-lib"]={}),t.ng.core,t["ic-confirma-dialog"],t["icm-snackbar"],t.rxjs.operators,t.ng.material.dialog,t.ng.material.button,t.ng.material.divider,t.ng.material.icon,t.ng.material.list,t.ng.material.progressSpinner,t.ng.material.sidenav,t.ng.material.toolbar,t.ng.material.tooltip,t.ng.flexLayout,t.ng.common)}(this,(function(t,r,a,e,i,o,n,s,c,l,d,u,m,p,b,v){"use strict";var f;(f=t.EStatus||(t.EStatus={})).novaPesquisa="Nova pesquisa",f.inserindo="Inserindo",f.editando="Editando",f.removendo="Removendo",f.dadosCarregados="Dados carregados",f.pesquisando="Pesquisando",f.executarAcao="Executar ação",f.salvando="Salvando";var g=function(){function r(){this.EStatus=t.EStatus}return r.prototype.ngOnInit=function(){this.onInit(),this.servicoDataBarBind.status=t.EStatus.novaPesquisa},r.prototype.statusChanged=function(t){this.servicoDataBarBind.status=t,this.statusDataBar=t,this.onStatusChanged(t)},Object.defineProperty(r.prototype,"inserindoOuEditando",{get:function(){return this.statusDataBar===t.EStatus.inserindo||this.statusDataBar===t.EStatus.editando},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"inserindo",{get:function(){return this.statusDataBar===t.EStatus.inserindo},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"editando",{get:function(){return this.statusDataBar===t.EStatus.editando},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"editandoOuRemovendo",{get:function(){return this.statusDataBar===t.EStatus.editando||this.statusDataBar===t.EStatus.removendo},enumerable:!1,configurable:!0}),r}();g.decorators=[{type:r.Directive}];var h,x=function(){function t(){}return t.prototype.desabilitarBotaoNovaPesquisa=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoReverter=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoPesquisar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoEditar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoClonar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoAdicionar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoRemover=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoSalvar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoPrimeiro=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoAnterior=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoProximo=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoUltimo=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.desabilitarBotaoModoTabela=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.exibirBotaoModoTabela=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t.prototype.exibirBotaoClonar=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!1},t}();(h=t.EEventoClick||(t.EEventoClick={})).onClickInserir="onInserir",h.afterClickInserir="afterClickInserir",h.onClickReverter="onReverter",h.afterClickReverter="afterClickReverter",h.onClickNovaPesquisa="onNovaPesquisa",h.afterClickNovaPesquisa="afterClickNovaPesquisa",h.onClickEditar="onEditar",h.afterClickEditar="afterClickEditar",h.onClickRemover="onRemover",h.afterClickRemover="afterClickRemover",h.onClickSalvar="onClickSalvar",h.afterClickSalvar="afterClickSalvar",h.onClickModoTabela="onClickModoTabela",h.onClickClonar="onClickClonar",h.afterClickClonar="afterClickClonar";var _=function(){function t(t){this.onEvent=t}return t.prototype.emitir=function(t){this.onEvent(t)},t}(),E=function(){function t(t,r){this.dialogRef=t,this.mensagem=r.mensagem,this.titulo=r.titulo}return t.prototype.close=function(){this.dialogRef.close()},t}();E.decorators=[{type:r.Component,args:[{selector:"confirma-dialog",template:'<h2 mat-dialog-title class="error__title">{{titulo}}</h2>\r\n\r\n<mat-dialog-content>\r\n <p>{{mensagem}}</p>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions align="end">\r\n <button class="mat-raised-button" (click)="close()">Ok</button>\r\n</mat-dialog-actions>\r\n',styles:[".error__title{text-align:center}"]}]}],E.ctorParameters=function(){return[{type:o.MatDialogRef},{type:void 0,decorators:[{type:r.Inject,args:[o.MAT_DIALOG_DATA]}]}]};var S=function(){function t(t){this.dialog=t}return t.prototype.openDialog=function(t,r){var a=new o.MatDialogConfig;a.disableClose=!0,a.autoFocus=!0,a.data={titulo:t,mensagem:r},a.minWidth="300px",this.dialogRef=this.dialog.open(E,a)},t.prototype.closeDialog=function(){this.dialogRef.close()},t}();S.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new S(r.ɵɵinject(o.MatDialog))},token:S,providedIn:"root"}),S.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],S.ctorParameters=function(){return[{type:o.MatDialog}]};var y=function(){function t(){}return Object.defineProperty(t.prototype,"statusAnterior",{get:function(){return this._statusAnterior},enumerable:!1,configurable:!0}),t.prototype.setDadosAnteriores=function(t,r,a){this._entidadePaginadaAnterior={entidade:a.entidade,posicao:a.posicao,quantidade:a.quantidade,total:a.total},this._dadosAnterioresFormulario=r.getRawValue(),this._statusAnterior=t},t.prototype.restaurarDadosAnteriores=function(t){return t.patchValue(this._dadosAnterioresFormulario),this._entidadePaginadaAnterior},t}();y.decorators=[{type:r.Injectable}];var C=function(){function t(){}return t.prototype.desabilitarForm=function(t){t.disable({emitEvent:!1,onlySelf:!0})},t.prototype.habilitarForm=function(t){t.enable({emitEvent:!1,onlySelf:!0})},t.prototype.resetForm=function(t,r){t.reset({emitEvent:!1,onlySelf:!0}),r.entidade=null,r.posicao=0,r.total=0},t.prototype.emitirEventoClick=function(t,r){t.eventDatabar&&t.eventDatabar.emitir(r)},t.prototype.definirProgresso=function(t,r){if(t)return r?this.desabilitarForm(t):this.habilitarForm(t),r},t}();C.decorators=[{type:r.Injectable}],C.ctorParameters=function(){return[]};var P=function(){function a(a,e,i,o,n){this._dialog=a,this._dialogErro=e,this._elementRef=i,this._databarService=o,this._snackBarService=n,this.disabled=!1,this.statusChanged=new r.EventEmitter,this.EStatus=t.EStatus,this.emProgresso=!1}return Object.defineProperty(a.prototype,"servicoReverter",{set:function(t){this._servicoReverter=t},enumerable:!1,configurable:!0}),a.prototype.ngOnInit=function(){this.validarPropertsObrigatorias(),this.setProgresso(!1),this.novaPesquisa(),this._submeterFormularioOnEnter(),this.observarSetStatus(),this._pesquisarPosicaoSelecionada()},a.prototype.ngOnDestroy=function(){this.servicoBind.onClickEnter&&this.servicoBind.onClickEnter.unsubscribe(),this.$setStatus&&this.$setStatus.unsubscribe()},a.prototype.fecharSidenav=function(t){this._elementRef.nativeElement.contains(t.target)||this.drawer.close()},Object.defineProperty(a.prototype,"inserindoOuEditando",{get:function(){return this.status===t.EStatus.inserindo||this.status===t.EStatus.editando},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoModoTabela",{get:function(){var r;return this.status==t.EStatus.inserindo||this.status==t.EStatus.editando||this.emProgresso||this.form.invalid||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoModoTabela())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoPesquisar",{get:function(){var r;return this.status==t.EStatus.inserindo||this.status==t.EStatus.editando||this.status==t.EStatus.dadosCarregados||this.emProgresso||this.form.invalid||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoPesquisar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoReverter",{get:function(){var r;return this.status==t.EStatus.novaPesquisa||this.status==t.EStatus.executarAcao||this.status==t.EStatus.dadosCarregados||this.emProgresso||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoReverter())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoAdicionar",{get:function(){var r;return this.status==t.EStatus.editando||this.status==t.EStatus.inserindo||this.emProgresso||this.disabled||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoAdicionar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoEditar",{get:function(){var r;return this.status==t.EStatus.inserindo||this.status==t.EStatus.novaPesquisa||this.status==t.EStatus.executarAcao||this.status==t.EStatus.pesquisando||this.status==t.EStatus.editando||this.emProgresso||this.disabled||(null===(r=this.servicoConfiguracaoBotoes)||void 0===r?void 0:r.desabilitarBotaoEditar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoClonar",{get:function(){var r,a;return!(null===(r=this.entidadePaginada)||void 0===r?void 0:r.entidade)||this.status!=t.EStatus.dadosCarregados||this.emProgresso||(null===(a=this.servicoConfiguracaoBotoes)||void 0===a?void 0:a.desabilitarBotaoClonar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoRemover",{get:function(){var r,a;return!(null===(r=this.entidadePaginada)||void 0===r?void 0:r.entidade)||this.status!=t.EStatus.dadosCarregados||this.emProgresso||(null===(a=this.servicoConfiguracaoBotoes)||void 0===a?void 0:a.desabilitarBotaoRemover())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotaoSalvar",{get:function(){var r,a;return(null===(r=this.form)||void 0===r?void 0:r.invalid)||this.status!=t.EStatus.inserindo&&this.status!=t.EStatus.editando||this.emProgresso||this.disabled||(null===(a=this.servicoConfiguracaoBotoes)||void 0===a?void 0:a.desabilitarBotaoSalvar())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotoesPaginacaoRetroceder",{get:function(){return this.inserindoOuEditando||this.entidadePaginada.posicao<=1||this.emProgresso},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"desabilitarBotoesPaginacaoAvancar",{get:function(){return this.inserindoOuEditando||this.entidadePaginada.posicao>=this.entidadePaginada.total||this.emProgresso},enumerable:!1,configurable:!0}),a.prototype.onClickReverter=function(){this._exibirDialogConfirmacaoReverter()},a.prototype.onClickModoTabela=function(){this._emitirEventoClick(t.EEventoClick.onClickModoTabela)},a.prototype.onClickNovaPesquisa=function(){this._emitirEventoClick(t.EEventoClick.onClickNovaPesquisa),this.novaPesquisa(),this._emitirEventoClick(t.EEventoClick.afterClickNovaPesquisa)},a.prototype.novaPesquisa=function(){this._databarService.habilitarForm(this.form),this.form.reset({emitEvent:!1,onlySelf:!0}),this.entidadePaginada.entidade=this.form.value,this.entidadePaginada.posicao=0,this.entidadePaginada.total=0,this.setStatus(t.EStatus.novaPesquisa)},a.prototype.pesquisar=function(){this.form.invalid||(this._setDadosAnteriores(),this.setStatus(t.EStatus.pesquisando),this.entidadePaginada.entidade=[].concat(this._getEntidade()),this._paginar(),this.drawer.close())},a.prototype.inserir=function(){this._emitirEventoClick(t.EEventoClick.onClickInserir),this._clickInserir(),this._emitirEventoClick(t.EEventoClick.afterClickInserir)},a.prototype.editar=function(){this._emitirEventoClick(t.EEventoClick.onClickEditar),this._clickEditar(),this._emitirEventoClick(t.EEventoClick.afterClickEditar)},a.prototype.clonar=function(){this._emitirEventoClick(t.EEventoClick.onClickClonar),this._clickClonar(),this._emitirEventoClick(t.EEventoClick.afterClickClonar)},a.prototype.remover=function(){this._emitirEventoClick(t.EEventoClick.onClickRemover),this._clickRemover(),this._emitirEventoClick(t.EEventoClick.afterClickRemover)},a.prototype.proximo=function(){this._paginar("proximo")},a.prototype.anterior=function(){this._paginar("anterior")},a.prototype.ultimo=function(){this._paginar("ultimo")},a.prototype.primeiro=function(){this._paginar("primeiro")},a.prototype.salvar=function(){switch(this._emitirEventoClick(t.EEventoClick.onClickSalvar),this.status){case t.EStatus.inserindo:this._inserir();break;case t.EStatus.editando:this._editar()}},a.prototype._inserir=function(){var r=this;this.setStatus(t.EStatus.salvando),this.setProgresso(!0),this.servicoBind.criar().pipe(i.finalize((function(){r._emitirEventoClick(t.EEventoClick.afterClickSalvar)}))).subscribe((function(a){r.setProgresso(!1),r._snackBarService.abrirSnackBarSucesso("Registro salvo com sucesso!"),r.form.patchValue(a),r.setStatus(t.EStatus.dadosCarregados),r.drawer.close(),r._databarService.desabilitarForm(r.form)}),(function(){r.setProgresso(!1),r.setStatus(t.EStatus.inserindo)}))},a.prototype._editar=function(){var r=this;this.setStatus(t.EStatus.salvando),this.setProgresso(!0),this.servicoBind.editar().pipe(i.finalize((function(){r._emitirEventoClick(t.EEventoClick.afterClickSalvar)}))).subscribe((function(a){r._snackBarService.abrirSnackBarSucesso("Registro editado com sucesso!"),r.form.patchValue(a),r.setProgresso(!1),r.setStatus(t.EStatus.dadosCarregados),r._databarService.desabilitarForm(r.form),r.drawer.close()}),(function(){r.setProgresso(!1),r.setStatus(t.EStatus.editando)}))},a.prototype.observarSetStatus=function(){var r=this;this.servicoBind.setStatus&&(this.$setStatus=this.servicoBind.setStatus.subscribe((function(a){switch(a){case t.EStatus.editando:r.editar(),r.emProgresso=!1;break;case t.EStatus.inserindo:r.inserir(),r.emProgresso=!1;break;case t.EStatus.pesquisando:r.pesquisar();break;case t.EStatus.novaPesquisa:r.novaPesquisa();break;case t.EStatus.removendo:r.remover();break;case t.EStatus.dadosCarregados:r.status=t.EStatus.dadosCarregados,r.emProgresso=!1}})))},a.prototype.retornarServicoReverter=function(){return null==this._servicoReverter&&(this._servicoReverter=new y),this._servicoReverter},a.prototype._setDadosAnteriores=function(){this.retornarServicoReverter().setDadosAnteriores(this.status,this.form,this.entidadePaginada)},a.prototype._reverter=function(){this._emitirEventoClick(t.EEventoClick.onClickReverter),this.entidadePaginada=this.retornarServicoReverter().restaurarDadosAnteriores(this.form);var r=this.retornarServicoReverter().statusAnterior;r==t.EStatus.dadosCarregados?this._databarService.desabilitarForm(this.form):this._databarService.habilitarForm(this.form),this.setStatus(r),this._emitirEventoClick(t.EEventoClick.afterClickReverter)},a.prototype._resetarContadorPaginacao=function(){this.entidadePaginada.posicao=0,this.entidadePaginada.total=0},a.prototype.validarPropertsObrigatorias=function(){if(null==this.servicoBind)throw new Error("É obrigatório ter um serviço de bind vinculado.");if(null==this.entidadePaginada)throw new Error("É obrigatório ter uma entidade paginada vinculada.")},a.prototype.setStatus=function(t){t&&(this.status=t,this.statusChanged.emit(this.status))},a.prototype._getEntidade=function(){return this.form.getRawValue()},a.prototype._submeterFormularioOnEnter=function(){var r=this;this.servicoBind.onClickEnter&&this.servicoBind.onClickEnter.subscribe((function(){r.status===t.EStatus.novaPesquisa&&r.form.valid&&r.pesquisar()}))},a.prototype._pesquisarPosicaoSelecionada=function(){var r=this;this.servicoBind.pesquisarPosicaoSelecionada&&this.servicoBind.pesquisarPosicaoSelecionada.subscribe((function(a){r.status===t.EStatus.novaPesquisa&&r.form.valid&&(r.entidadePaginada=a,r._pesquisarSelecionado())}))},a.prototype._pesquisarSelecionado=function(){this.form.invalid||(this._setDadosAnteriores(),this.setStatus(t.EStatus.pesquisando),this._paginar("customizado"),this.drawer.close())},a.prototype._clickInserir=function(){this._setDadosAnteriores(),this._resetarContadorPaginacao(),this._databarService.habilitarForm(this.form),this.form.reset({emitEvent:!1,onlySelf:!0}),this.form.markAllAsTouched(),this.drawer.close(),this.setStatus(t.EStatus.inserindo)},a.prototype._clickEditar=function(){this._setDadosAnteriores(),this._databarService.habilitarForm(this.form),this.form.markAllAsTouched(),this.drawer.close(),this.setStatus(t.EStatus.editando)},a.prototype._clickClonar=function(){this._setDadosAnteriores(),this._resetarContadorPaginacao(),this._databarService.habilitarForm(this.form),this.form.markAllAsTouched(),this.drawer.close(),this.setStatus(t.EStatus.inserindo)},a.prototype._clickRemover=function(){this.setStatus(t.EStatus.removendo),this._exibirDialogConfirmacao(),this.drawer.close()},a.prototype._emitirEventoClick=function(t){return this._databarService.emitirEventoClick(this.servicoBind,t)},a.prototype._acaoCloseDialogConfirmacao=function(){this._dialog.emProgresso=!1,this._dialog.closeDialog(),this.setStatus(t.EStatus.dadosCarregados)},a.prototype._exibirDialogConfirmacao=function(){var t=this;this._dialog.acaoMensagem="Removendo registro...",this._dialog.acaoOk=function(){return t.servicoBind.remover().subscribe((function(){t._dialog.closeDialog(),t.novaPesquisa(),t._dialog.emProgresso=!1,t._snackBarService.abrirSnackBarSucesso("Removido com sucesso!")}),(function(){return t._acaoCloseDialogConfirmacao()}))},this._dialog.acaoCancelar=function(){t._acaoCloseDialogConfirmacao()},this._dialog.openDialog("Atenção!","Você realmente deseja excluir este registro?")},a.prototype._exibirDialogConfirmacaoReverter=function(){var t=this;this._dialog.acaoOk=function(){t._reverter(),t._dialog.emProgresso=!1,t._dialog.closeDialog()},this._dialog.acaoCancelar=function(){t._dialog.closeDialog()},this._dialog.openDialog("Atenção!","As alterações realizadas serão perdidas. Deseja continuar?")},a.prototype._paginar=function(r){var a=this;this.setStatus(t.EStatus.pesquisando),null==this.entidadePaginada.entidade&&(this.entidadePaginada.entidade=[].concat(this._getEntidade()));var e=this.entidadePaginada.posicao;switch(r){case"primeiro":this.entidadePaginada.posicao=1;break;case"ultimo":this.entidadePaginada.posicao=this.entidadePaginada.total;break;case"proximo":this.entidadePaginada.posicao++;break;case"anterior":this.entidadePaginada.posicao--;break;case"customizado":break;default:this.entidadePaginada.posicao=0}this.setProgresso(!0),this.servicoBind.listarPaginacao(this.entidadePaginada).subscribe((function(r){return a.setProgresso(!1),null==r?(a._dialogErro.openDialog("Atenção!","Nenhum registro foi encontrado."),void a.setStatus(t.EStatus.novaPesquisa)):null==r.entidade?(a._databarService.resetForm(a.form,a.entidadePaginada),void a.setStatus(t.EStatus.novaPesquisa)):(a.setStatus(t.EStatus.dadosCarregados),a.entidadePaginada.entidade?(a.entidadePaginada.total=r.total,a.entidadePaginada.posicao=r.posicao):a.entidadePaginada=r,a.form.patchValue(r.entidade[0]),a.setProgresso(!1),void a._databarService.desabilitarForm(a.form))}),(function(r){422===r.status?a.setStatus(t.EStatus.novaPesquisa):(a.setStatus(t.EStatus.dadosCarregados),a.entidadePaginada.posicao=e,a._databarService.desabilitarForm(a.form)),a.setProgresso(!1),console.error("erro paginação",r)}))},a.prototype.setProgresso=function(t){this.emProgresso=this._databarService.definirProgresso(this.form,t)},a}();P.decorators=[{type:r.Component,args:[{selector:"ic-data-bar",template:'<div fxFlex="1 0 auto" fxFlexLayout="space-around center" fxLayout="column">\r\n \x3c!-- DESKTOP --\x3e\r\n <mat-toolbar class="px-0 mat-elevation-z4">\r\n <div fxFlex="1 0 auto" fxLayout="row" fxLayoutAlign="space-around center">\r\n \x3c!-- BOTÃO EXIBIR DRAWER --\x3e\r\n <mat-drawer-container fxFlex.sm fxHide.gt-sm>\r\n <button\r\n (click)="drawer.toggle()"\r\n id="btn_exibir_databar_mobile"\r\n mat-button\r\n type="button"\r\n color="primary"\r\n >\r\n <mat-icon>menu</mat-icon>\r\n </button>\r\n </mat-drawer-container>\r\n \x3c!-- /BOTÃO EXIBIR DRAWER --\x3e\r\n\r\n \x3c!-- AÇÕES --\x3e\r\n <div\r\n fxFlex.sm\r\n fxHide\r\n fxLayout="row"\r\n fxLayoutAlign="space-around center"\r\n fxShow.gt-sm\r\n >\r\n \x3c!-- BTN_NOVA_PESQUISA --\x3e\r\n <button\r\n (click)="onClickNovaPesquisa()"\r\n [disabled]="servicoConfiguracaoBotoes?.desabilitarBotaoNovaPesquisa()"\r\n color="primary"\r\n id="btn_nova_pesquisa"\r\n mat-button\r\n matTooltip="Nova Pesquisa"\r\n >\r\n <mat-icon>insert_drive_file</mat-icon>\r\n </button>\r\n \x3c!-- BTN_NOVA_PESQUISA --\x3e\r\n\r\n \x3c!-- BTN_REVERTER --\x3e\r\n <button\r\n (click)="onClickReverter()"\r\n [disabled]="desabilitarBotaoReverter"\r\n color="primary"\r\n id="btn_reverter"\r\n mat-button\r\n matTooltip="Reverter"\r\n >\r\n <mat-icon>restore</mat-icon>\r\n </button>\r\n \x3c!-- BTN_REVERTER --\x3e\r\n\r\n \x3c!-- BTN_PESQUISAR --\x3e\r\n <button\r\n (click)="pesquisar()"\r\n [disabled]="desabilitarBotaoPesquisar"\r\n color="primary"\r\n id="btn_pesquisar"\r\n mat-button\r\n matTooltip="Pesquisar"\r\n >\r\n <mat-icon>search</mat-icon>\r\n </button>\r\n \x3c!-- BTN_PESQUISAR --\x3e\r\n\r\n \x3c!-- BTN_ADICIONAR --\x3e\r\n <button\r\n (click)="inserir()"\r\n [disabled]="desabilitarBotaoAdicionar"\r\n color="primary"\r\n id="btn_adicionar"\r\n mat-button\r\n matTooltip="Adicionar"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n \x3c!-- BTN_ADICIONAR --\x3e\r\n\r\n \x3c!-- BTN_EDITAR --\x3e\r\n <button\r\n (click)="editar()"\r\n [disabled]="desabilitarBotaoEditar"\r\n color="primary"\r\n id="btn_editar"\r\n mat-button\r\n matTooltip="Editar"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n \x3c!-- BTN_EDITAR --\x3e\r\n\r\n \x3c!-- BTN_CLONAR --\x3e\r\n <button\r\n *ngIf="servicoConfiguracaoBotoes?.exibirBotaoClonar()"\r\n (click)="clonar()"\r\n [disabled]="desabilitarBotaoClonar"\r\n color="primary"\r\n id="btn_clonar"\r\n mat-button\r\n matTooltip="Clonar"\r\n >\r\n <mat-icon>file_copy</mat-icon>\r\n </button>\r\n \x3c!-- BTN_CLONAR --\x3e\r\n\r\n \x3c!-- BTN_REMOVER --\x3e\r\n <button\r\n (click)="remover()"\r\n [disabled]="desabilitarBotaoRemover"\r\n color="primary"\r\n id="btn_remover"\r\n mat-button\r\n matTooltip="Remover"\r\n >\r\n <mat-icon>delete_forever</mat-icon>\r\n </button>\r\n \x3c!-- BTN_REMOVER --\x3e\r\n\r\n \x3c!-- BTN_SALVAR --\x3e\r\n <button\r\n (click)="salvar()"\r\n [disabled]="desabilitarBotaoSalvar"\r\n color="primary"\r\n id="btn_salvar"\r\n mat-button\r\n matTooltip="Salvar"\r\n >\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n \x3c!-- BTN_SALVAR --\x3e\r\n </div>\r\n \x3c!-- /AÇÕES --\x3e\r\n\r\n \x3c!-- STATUS --\x3e\r\n <div fxLayout="row" fxLayoutAlign="center center">\r\n \x3c!-- PROGRESS --\x3e\r\n <mat-spinner *ngIf="emProgresso" [diameter]="20"></mat-spinner>\r\n \x3c!-- PROGRESS --\x3e\r\n\r\n <button\r\n color="primary"\r\n fxHide.lt-sm\r\n id="btn_status"\r\n mat-button\r\n matTooltip="Ação no momento"\r\n >\r\n {{ status }}\r\n </button>\r\n </div>\r\n \x3c!-- STATUS --\x3e\r\n\r\n \x3c!-- PAGINAÇÃO --\x3e\r\n <div fxFlex.sm fxLayout="row" fxLayoutAlign="center center">\r\n \x3c!-- BTN_PRIMEIRO --\x3e\r\n <button\r\n (click)="primeiro()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoRetroceder ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoPrimeiro()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n fxFlex.sm\r\n fxHide.lt-sm\r\n id="btn_primeiro"\r\n mat-button\r\n matTooltip="Primeiro item"\r\n >\r\n <mat-icon>first_page</mat-icon>\r\n </button>\r\n \x3c!-- BTN_PRIMEIRO --\x3e\r\n\r\n \x3c!-- BTN_ANTERIOR --\x3e\r\n <button\r\n (click)="anterior()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoRetroceder ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoAnterior()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n id="btn_anterior"\r\n mat-button\r\n matTooltip="Anterior"\r\n >\r\n <mat-icon>navigate_before</mat-icon>\r\n </button>\r\n \x3c!-- BTN_ANTERIOR --\x3e\r\n\r\n <div\r\n class="px-0 px-sm-12 contador-paginas"\r\n id="contador_paginacao"\r\n matTooltip="Página Atual"\r\n >\r\n {{ entidadePaginada?.posicao }} de {{ entidadePaginada?.total }}\r\n </div>\r\n\r\n \x3c!-- BTN_PROXIMO --\x3e\r\n <button\r\n (click)="proximo()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoAvancar ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoProximo()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n id="btn_proximo"\r\n mat-button\r\n matTooltip="Próximo"\r\n >\r\n <mat-icon>navigate_next</mat-icon>\r\n </button>\r\n \x3c!-- BTN_PROXIMO --\x3e\r\n\r\n \x3c!-- BTN_ULTIMO --\x3e\r\n <button\r\n (click)="ultimo()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoAvancar ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoUltimo()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n id="btn_ultimo"\r\n fxFlex.sm\r\n fxHide.lt-sm\r\n mat-button\r\n matTooltip="Último"\r\n >\r\n <mat-icon>last_page</mat-icon>\r\n </button>\r\n \x3c!-- BTN_ULTIMO --\x3e\r\n </div>\r\n \x3c!-- /PAGINAÇÃO --\x3e\r\n\r\n <div\r\n fxShow.gt-sm\r\n fxHide\r\n fxFlex.sm\r\n fxLayout="row"\r\n fxLayoutAlign="center center"\r\n >\r\n \x3c!-- MODO_TABELA --\x3e\r\n <button\r\n *ngIf="servicoConfiguracaoBotoes?.exibirBotaoModoTabela()"\r\n (click)="onClickModoTabela()"\r\n [disabled]="desabilitarBotaoModoTabela"\r\n color="primary"\r\n id="btn_modo_tabela"\r\n mat-button\r\n matTooltip="Alterar exibição para tabela"\r\n >\r\n <mat-icon>format_list_bulleted</mat-icon>\r\n </button>\r\n \x3c!-- MODO_TABELA --\x3e\r\n </div>\r\n </div>\r\n </mat-toolbar>\r\n \x3c!-- /DESKTOP --\x3e\r\n\r\n \x3c!-- MOBILE --\x3e\r\n <mat-drawer #drawer fxFlex fxLayoutAlign="column" mode="over">\r\n \x3c!-- FECHAR SIDENAV --\x3e\r\n <button\r\n (click)="drawer.toggle()"\r\n class="btn-fechar-drawer"\r\n id="btn_fechar_databar_mobile"\r\n mat-icon-button\r\n >\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n \x3c!-- /FECHAR SIDENAV --\x3e\r\n\r\n \x3c!-- STATUS --\x3e\r\n <div class="pr-12" fxLayout="row" fxLayoutAlign="space-between center">\r\n <div fxFlex="100" fxLayout="column" fxLayoutAlign="center center">\r\n <h4 class="pl-12">Ações</h4>\r\n <p class="texto-status" id="status_mobile">{{ status }}</p>\r\n </div>\r\n </div>\r\n \x3c!-- /STATUS --\x3e\r\n\r\n \x3c!-- OPCOES --\x3e\r\n <div class="px-12 overflow" fxLayout="column" fxLayoutAlign="start start">\r\n <mat-list>\r\n \x3c!-- BTN_PRIMEIRO --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="primeiro()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoRetroceder ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoPrimeiro()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n mat-button\r\n id="btn_primeiro_mobile"\r\n matTooltip="Primeiro item"\r\n >\r\n <mat-icon>first_page</mat-icon>\r\n Primeiro item\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_PRIMEIRO --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_ULTIMO --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="ultimo()"\r\n [disabled]="\r\n desabilitarBotoesPaginacaoAvancar ||\r\n servicoConfiguracaoBotoes?.desabilitarBotaoUltimo()\r\n "\r\n class="px-0 px-sm-12"\r\n color="primary"\r\n id="btn_ultimo_mobile"\r\n mat-button\r\n matTooltip="Último"\r\n >\r\n <mat-icon>last_page</mat-icon>\r\n Último item\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_ULTIMO --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- MODO_TABELA --\x3e\r\n <mat-list-item>\r\n <button\r\n *ngIf="servicoConfiguracaoBotoes?.exibirBotaoModoTabela()"\r\n (click)="onClickModoTabela()"\r\n [disabled]="desabilitarBotaoModoTabela"\r\n color="primary"\r\n id="btn_modo_tabela_mobile"\r\n mat-button\r\n matTooltip="Alterar exibição para tabela"\r\n >\r\n <mat-icon>list</mat-icon>\r\n Modo tabela\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- MODO_TABELA --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_NOVA_PESQUISA --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="onClickNovaPesquisa()"\r\n [disabled]="\r\n servicoConfiguracaoBotoes?.desabilitarBotaoNovaPesquisa()\r\n "\r\n color="primary"\r\n mat-button\r\n id="btn_nova_pesquisa_mobile"\r\n matTooltip="Nova Pesquisa"\r\n >\r\n <mat-icon>restore_page</mat-icon>\r\n Nova Pesquisa\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_NOVA_PESQUISA --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_PESQUISAR --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="pesquisar()"\r\n [disabled]="desabilitarBotaoPesquisar"\r\n color="primary"\r\n id="btn_pesquisar_mobile"\r\n mat-button\r\n matTooltip="Pesquisar"\r\n >\r\n <mat-icon>search</mat-icon>\r\n Pesquisar\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_PESQUISAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_ADICIONAR --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="inserir()"\r\n [disabled]="desabilitarBotaoAdicionar"\r\n color="primary"\r\n mat-button\r\n id="btn_adicionar_mobile"\r\n matTooltip="Adicionar"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n Incluir\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_ADICIONAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_EDITAR --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="editar()"\r\n [disabled]="desabilitarBotaoEditar"\r\n color="primary"\r\n mat-button\r\n id="btn_editar_mobile"\r\n matTooltip="Editar"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n Editar\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_EDITAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_CLONAR --\x3e\r\n <mat-list-item *ngIf="servicoConfiguracaoBotoes?.exibirBotaoClonar()">\r\n <button\r\n (click)="clonar()"\r\n [disabled]="desabilitarBotaoClonar"\r\n color="primary"\r\n id="btn_clonar_mobile"\r\n mat-button\r\n matTooltip="Clonar"\r\n >\r\n <mat-icon>file_copy</mat-icon>\r\n Clonar\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_CLONAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_REMOVER --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="remover()"\r\n [disabled]="desabilitarBotaoRemover"\r\n color="primary"\r\n mat-button\r\n id="btn_remover_mobile"\r\n matTooltip="Remover"\r\n >\r\n <mat-icon>delete_forever</mat-icon>\r\n Remover\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_REMOVER --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n\r\n \x3c!-- BTN_SALVAR --\x3e\r\n <mat-list-item>\r\n <button\r\n (click)="salvar()"\r\n [disabled]="desabilitarBotaoSalvar"\r\n color="primary"\r\n mat-button\r\n id="btn_salvar_mobile"\r\n matTooltip="Salvar"\r\n >\r\n <mat-icon>save</mat-icon>\r\n Salvar\r\n </button>\r\n </mat-list-item>\r\n \x3c!-- BTN_SALVAR --\x3e\r\n\r\n <mat-divider></mat-divider>\r\n </mat-list>\r\n </div>\r\n \x3c!-- /OPCOES --\x3e\r\n </mat-drawer>\r\n \x3c!-- /MOBILE --\x3e\r\n</div>\r\n',styles:["::ng-deep .sucesso{background:#4caf50!important;color:#fff!important}::ng-deep .sucesso button{color:#1b5e20!important;font-weight:800!important}.contador-paginas{color:#039be5;font-size:14px}@media (max-width:959px){.contador-paginas{font-size:12px}}.btn-fechar-drawer{position:absolute;right:5px;top:5px}.texto-status{color:#039be5;text-align:center}mat-toolbar{height:52px;width:100%}mat-drawer-container{background:transparent!important}mat-drawer{left:0;min-width:240px}.overflow,mat-drawer,mat-list{overflow-y:auto}:host{display:flex;flex:0 0 auto;z-index:99999}:host .mat-toolbar .pagina{font-size:10px;margin:1vm;text-align:center}:host.above{position:relative;z-index:99999999}"]}]}],P.ctorParameters=function(){return[{type:a.IcConfirmaDialogService},{type:S},{type:r.ElementRef},{type:C},{type:e.IcmSnackBarService}]},P.propDecorators={servicoBind:[{type:r.Input}],form:[{type:r.Input}],entidadePaginada:[{type:r.Input}],disabled:[{type:r.Input}],servicoConfiguracaoBotoes:[{type:r.Input}],servicoReverter:[{type:r.Input}],statusChanged:[{type:r.Output}],drawer:[{type:r.ViewChild,args:["drawer",{static:!1}]}],fecharSidenav:[{type:r.HostListener,args:["document:click",["$event"]]}]};var B=function(){};B.decorators=[{type:r.NgModule,args:[{declarations:[E],imports:[o.MatDialogModule],exports:[E],entryComponents:[E]}]}];var k=function(){};k.decorators=[{type:r.NgModule,args:[{declarations:[P],imports:[v.CommonModule,m.MatToolbarModule,l.MatListModule,u.MatSidenavModule,c.MatIconModule,d.MatProgressSpinnerModule,s.MatDividerModule,n.MatButtonModule,p.MatTooltipModule,b.FlexLayoutModule,a.IcConfirmaDialogModule,B,e.IcmSnackBarModule],exports:[P],providers:[C]}]}],t.DataBarComponent=P,t.DataBarConfigBotoesService=x,t.DataBarModule=k,t.DatabarEventClickService=_,t.OnInitDataBar=g,t.ɵa=S,t.ɵb=C,t.ɵc=B,t.ɵd=E,Object.defineProperty(t,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=inovamobil-ic-databar-lib.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../projects/ic-databar-lib/src/lib/enum/estatus.ts","../../../projects/ic-databar-lib/src/lib/contrato/OnInitDataBar.ts","../../../projects/ic-databar-lib/src/lib/enum/eeventoclick.ts","../../../projects/ic-databar-lib/src/lib/contrato/DataBarConfigBotoesService.ts","../../../projects/ic-databar-lib/src/lib/services/ic-databar-event-click.service.ts","../../../projects/ic-databar-lib/src/components/dialogs/error-dialog/error-dialog.component.ts","../../../projects/ic-databar-lib/src/components/dialogs/error-dialog/service/error-dialog.service.ts","../../../projects/ic-databar-lib/src/lib/services/ic-databar-reverter.service.ts","../../../projects/ic-databar-lib/src/lib/services/ic-databar.service.ts","../../../projects/ic-databar-lib/src/lib/ic-data-bar.component.ts","../../../projects/ic-databar-lib/src/components/dialogs/error-dialog/error-dialog.module.ts","../../../projects/ic-databar-lib/src/lib/ic-data-bar.module.ts"],"names":["EStatus","OnInitDataBar","this","prototype","ngOnInit","onInit","servicoDataBarBind","status","novaPesquisa","statusChanged","statusDataBar","onStatusChanged","Object","defineProperty","inserindo","editando","removendo","Directive","EEventoClick","DataBarConfigBotoesService","desabilitarBotaoNovaPesquisa","args","_i","arguments","length","desabilitarBotaoReverter","desabilitarBotaoPesquisar","desabilitarBotaoEditar","desabilitarBotaoClonar","desabilitarBotaoAdicionar","desabilitarBotaoRemover","desabilitarBotaoSalvar","desabilitarBotaoPrimeiro","desabilitarBotaoAnterior","desabilitarBotaoProximo","desabilitarBotaoUltimo","desabilitarBotaoModoTabela","exibirBotaoModoTabela","exibirBotaoClonar","DatabarEventClickService","onEvent","emitir","evento","ErrorDialogComponent","dialogRef","data","mensagem","titulo","close","Component","selector","template","MatDialogRef","Inject","MAT_DIALOG_DATA","ErrorDialogService","dialog","openDialog","dialogConfig","MatDialogConfig","disableClose","autoFocus","minWidth","open","closeDialog","Injectable","providedIn","MatDialog","IcDatabarReverterService","_statusAnterior","_dadosAnterioresFormulario","setDadosAnteriores","formularo","entidadePaginada","_entidadePaginadaAnterior","entidade","posicao","quantidade","total","getRawValue","restaurarDadosAnteriores","formulario","patchValue","DatabarService","desabilitarForm","form","disable","emitEvent","onlySelf","habilitarForm","enable","resetForm","reset","emitirEventoClick","servico","eventDatabar","definirProgresso","progresso","DataBarComponent","_dialog","_dialogErro","_elementRef","_databarService","_snackBarService","disabled","EventEmitter","emProgresso","_servicoReverter","validarPropertsObrigatorias","setProgresso","_submeterFormularioOnEnter","observarSetStatus","_pesquisarPosicaoSelecionada","ngOnDestroy","servicoBind","onClickEnter","unsubscribe","$setStatus","fecharSidenav","event","nativeElement","contains","target","drawer","invalid","_a","servicoConfiguracaoBotoes","dadosCarregados","executarAcao","pesquisando","_b","inserindoOuEditando","onClickReverter","_exibirDialogConfirmacaoReverter","onClickModoTabela","_emitirEventoClick","onClickNovaPesquisa","afterClickNovaPesquisa","value","setStatus","pesquisar","_setDadosAnteriores","concat","_getEntidade","_paginar","inserir","onClickInserir","_clickInserir","afterClickInserir","editar","onClickEditar","_clickEditar","afterClickEditar","clonar","retornarServicoReverter","dadosAnterioresFormulario","afterClickClonar","remover","onClickRemover","_clickRemover","afterClickRemover","proximo","anterior","ultimo","primeiro","salvar","onClickSalvar","_inserir","_editar","_this","salvando","criar","pipe","finalize","afterClickSalvar","subscribe","success","abrirSnackBarSucesso","_reverter","statusAnterior","afterClickReverter","_resetarContadorPaginacao","Error","emit","valid","pesquisarPosicaoSelecionada","_pesquisarSelecionado","markAllAsTouched","_exibirDialogConfirmacao","_acaoCloseDialogConfirmacao","acaoMensagem","acaoOk","acaoCancelar","acao","posicaoAnterior","listarPaginacao","error","console","IcConfirmaDialogService","ElementRef","IcmSnackBarService","Input","Output","ViewChild","static","HostListener","NgModule","declarations","imports","MatDialogModule","exports","entryComponents","CommonModule","MatToolbarModule","MatListModule","MatSidenavModule","MatIconModule","MatProgressSpinnerModule","MatDividerModule","MatButtonModule","MatTooltipModule","FlexLayoutModule","IcConfirmaDialogModule","ErrorDialogModule","IcmSnackBarModule","providers"],"mappings":"mhDACA,IAAYA,GAAAA,EAAAA,EAAAA,UAAAA,EAAAA,QAAO,KACf,aAAA,gBACAA,EAAA,UAAA,YACAA,EAAA,SAAA,WACAA,EAAA,UAAA,YACAA,EAAA,gBAAA,mBACAA,EAAA,YAAA,cACAA,EAAA,aAAA,gBACAA,EAAA,SAAA,4BCDJ,SAAAC,IAMIC,KAAAF,QAA0BA,EAAAA,eAM1BC,EAAAE,UAAAC,SAAA,WACIF,KAAKG,SACLH,KAAKI,mBAAmBC,OAASP,EAAAA,QAAQQ,cAG7CP,EAAAE,UAAAM,cAAA,SAAcF,GACVL,KAAKI,mBAAmBC,OAASA,EACjCL,KAAKQ,cAAgBH,EACrBL,KAAKS,gBAAgBJ,IAGzBK,OAAAC,eAAWZ,EAAAE,UAAA,sBAAmB,KAA9B,WACI,OAAOD,KAAKQ,gBAAkBV,EAAAA,QAAQc,WAC/BZ,KAAKQ,gBAAkBV,EAAAA,QAAQe,0CAG1CH,OAAAC,eAAWZ,EAAAE,UAAA,YAAS,KAApB,WACI,OAAOD,KAAKQ,gBAAkBV,EAAAA,QAAQc,2CAG1CF,OAAAC,eAAWZ,EAAAE,UAAA,WAAQ,KAAnB,WACI,OAAOD,KAAKQ,gBAAkBV,EAAAA,QAAQe,0CAG1CH,OAAAC,eAAWZ,EAAAE,UAAA,sBAAmB,KAA9B,WACI,OAAQD,KAAKQ,gBAAkBV,EAAAA,QAAQe,UAAYb,KAAKQ,gBAAkBV,EAAAA,QAAQgB,oEArCzFC,EAAAA,gBCRWC,eCAZ,SA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ACf8G,QAAS,CACLI,EAAAA,aACAC,EAAAA,iBACAC,EAAAA,cACAC,EAAAA,iBACAC,EAAAA,cACAC,EAAAA,yBACAC,EAAAA,iBACAC,EAAAA,gBACAC,EAAAA,iBACAC,EAAAA,iBACAC,EAAAA,uBACAC,EACAC,EAAAA,mBAEJd,QAAS,CAAChH,GACV+H,UAAW,CAAC9I","sourcesContent":["\r\nexport enum EStatus {\r\n novaPesquisa = 'Nova pesquisa',\r\n inserindo = 'Inserindo',\r\n editando = 'Editando',\r\n removendo = 'Removendo',\r\n dadosCarregados = 'Dados carregados',\r\n pesquisando = 'Pesquisando',\r\n executarAcao = 'Executar ação',\r\n salvando = 'Salvando'\r\n}\r\n","import { IDataBarBindComponent } from './IDataBarBind';\r\nimport { Component, Directive } from '@angular/core';\r\nimport { FormGroup } from '@angular/forms';\r\n\r\nimport { IDataEntidadePaginada } from './IDataEntidadePaginada';\r\nimport { IDataBarBindService } from './IDataBarService';\r\nimport { EStatus } from '../enum/estatus';\r\n\r\n@Directive()\r\nexport abstract class OnInitDataBar<T> implements IDataBarBindComponent<T> {\r\n form: FormGroup;\r\n entidadePaginada: IDataEntidadePaginada<T>;\r\n statusDataBar: EStatus;\r\n servicoDataBarBind: IDataBarBindService<T>;\r\n EStatus: typeof EStatus = EStatus;\r\n\r\n abstract onStatusChanged(status: EStatus): void;\r\n\r\n abstract onInit(): void;\r\n\r\n ngOnInit(): void {\r\n this.onInit();\r\n this.servicoDataBarBind.status = EStatus.novaPesquisa;\r\n }\r\n\r\n statusChanged(status: EStatus): void {\r\n this.servicoDataBarBind.status = status;\r\n this.statusDataBar = status;\r\n this.onStatusChanged(status);\r\n }\r\n\r\n public get inserindoOuEditando(): boolean {\r\n return this.statusDataBar === EStatus.inserindo ||\r\n this.statusDataBar === EStatus.editando;\r\n }\r\n\r\n public get inserindo(): boolean {\r\n return this.statusDataBar === EStatus.inserindo;\r\n }\r\n\r\n public get editando(): boolean {\r\n return this.statusDataBar === EStatus.editando;\r\n }\r\n\r\n public get editandoOuRemovendo(): boolean {\r\n return (this.statusDataBar === EStatus.editando || this.statusDataBar === EStatus.removendo);\r\n }\r\n}\r\n","export enum EEventoClick {\r\n onClickInserir = 'onInserir',\r\n afterClickInserir = 'afterClickInserir',\r\n onClickReverter = 'onReverter',\r\n afterClickReverter = 'afterClickReverter',\r\n onClickNovaPesquisa = 'onNovaPesquisa',\r\n afterClickNovaPesquisa = 'afterClickNovaPesquisa',\r\n onClickEditar = 'onEditar',\r\n afterClickEditar = 'afterClickEditar',\r\n onClickRemover = 'onRemover',\r\n afterClickRemover = 'afterClickRemover',\r\n onClickSalvar = 'onClickSalvar',\r\n afterClickSalvar = 'afterClickSalvar',\r\n onClickModoTabela = 'onClickModoTabela',\r\n afterClickClonar = 'afterClickClonar',\r\n}\r\n","export abstract class DataBarConfigBotoesService {\r\n desabilitarBotaoNovaPesquisa(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoReverter(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoPesquisar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoEditar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoClonar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoAdicionar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoRemover(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoSalvar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoPrimeiro(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoAnterior(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoProximo(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoUltimo(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoModoTabela(...args): boolean {\r\n return false;\r\n }\r\n\r\n exibirBotaoModoTabela(...args): boolean {\r\n return false;\r\n }\r\n\r\n exibirBotaoClonar(...args): boolean {\r\n return false;\r\n }\r\n}\r\n","import { EEventoClick } from '../enum/eeventoclick';\r\n\r\nexport class DatabarEventClickService {\r\n\r\n constructor(private onEvent: (event: EEventoClick) => void) {}\r\n \r\n emitir(evento: EEventoClick): void {\r\n this.onEvent(evento);\r\n }\r\n\r\n}\r\n","import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\r\nimport { Inject, Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'confirma-dialog',\r\n templateUrl: './view/error-dialog.html',\r\n styleUrls: ['./view/error-dialog.scss']\r\n})\r\nexport class ErrorDialogComponent {\r\n\r\n mensagem: string;\r\n titulo: string;\r\n\r\n constructor(\r\n private dialogRef: MatDialogRef<ErrorDialogComponent>,\r\n @Inject(MAT_DIALOG_DATA) data) {\r\n\r\n this.mensagem = data.mensagem;\r\n this.titulo = data.titulo;\r\n }\r\n\r\n close(): void {\r\n this.dialogRef.close();\r\n }\r\n}\r\n\r\n","import { MatDialogConfig, MatDialog } from '@angular/material/dialog';\r\nimport { Injectable } from '@angular/core';\r\n\r\nimport { ErrorDialogComponent } from '../error-dialog.component';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport abstract class ErrorDialogService {\r\n\r\n dialogRef: any;\r\n\r\n constructor(private dialog: MatDialog) { }\r\n\r\n openDialog(titulo: string, mensagem: string): void {\r\n const dialogConfig = new MatDialogConfig();\r\n dialogConfig.disableClose = true;\r\n dialogConfig.autoFocus = true;\r\n\r\n dialogConfig.data = {\r\n titulo: titulo,\r\n mensagem: mensagem\r\n };\r\n\r\n dialogConfig.minWidth = '300px';\r\n\r\n this.dialogRef = this.dialog.open(ErrorDialogComponent, dialogConfig);\r\n\r\n }\r\n\r\n closeDialog(): void {\r\n this.dialogRef.close();\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { FormGroup } from '@angular/forms';\r\n\r\nimport { IDataBarReverterService } from '../contrato/IDataBarReverterService';\r\nimport { IDataEntidadePaginada } from '../contrato/IDataEntidadePaginada';\r\nimport { EStatus } from '../enum/estatus';\r\n\r\n@Injectable()\r\nexport class IcDatabarReverterService<T> implements IDataBarReverterService<T> {\r\n private _statusAnterior: EStatus;\r\n private _dadosAnterioresFormulario: T;\r\n private _entidadePaginadaAnterior: IDataEntidadePaginada<T>;\r\n\r\n get statusAnterior(): EStatus {\r\n return this._statusAnterior;\r\n }\r\n\r\n get dadosAnterioresFormulario(): T {\r\n return this._dadosAnterioresFormulario;\r\n }\r\n\r\n public setDadosAnteriores(\r\n status: EStatus,\r\n formularo: FormGroup,\r\n entidadePaginada: IDataEntidadePaginada<T>,\r\n ): void {\r\n this._entidadePaginadaAnterior = {\r\n entidade: entidadePaginada.entidade,\r\n posicao: entidadePaginada.posicao,\r\n quantidade: entidadePaginada.quantidade,\r\n total: entidadePaginada.total,\r\n } as IDataEntidadePaginada<T>;\r\n\r\n this._dadosAnterioresFormulario = formularo.getRawValue();\r\n this._statusAnterior = status;\r\n }\r\n\r\n public restaurarDadosAnteriores(formulario: FormGroup): IDataEntidadePaginada<T> {\r\n formulario.patchValue(this._dadosAnterioresFormulario);\r\n return this._entidadePaginadaAnterior;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { FormGroup } from '@angular/forms';\r\n\r\nimport { IDataEntidadePaginada } from '../contrato/IDataEntidadePaginada';\r\nimport { IDatabarBindOnClickService, EEventoClick } from '../../public-api';\r\n\r\n@Injectable()\r\nexport class DatabarService {\r\n\r\n\r\n constructor() { }\r\n\r\n public desabilitarForm(form: FormGroup): void {\r\n form.disable({ emitEvent: false, onlySelf: true });\r\n }\r\n\r\n public habilitarForm(form: FormGroup): void {\r\n form.enable({ emitEvent: false, onlySelf: true });\r\n }\r\n\r\n public resetForm(form: FormGroup, entidadePaginada: IDataEntidadePaginada<any>): void {\r\n form.reset({ emitEvent: false, onlySelf: true });\r\n entidadePaginada.entidade = null;\r\n entidadePaginada.posicao = 0;\r\n entidadePaginada.total = 0;\r\n }\r\n\r\n public emitirEventoClick<T>(servico: IDatabarBindOnClickService<T>, evento: EEventoClick): void {\r\n if (servico.eventDatabar) {\r\n servico.eventDatabar.emitir(evento);\r\n }\r\n }\r\n\r\n definirProgresso(form: FormGroup, progresso: boolean): boolean {\r\n if (!form)\r\n return;\r\n\r\n if (progresso)\r\n this.desabilitarForm(form);\r\n else\r\n this.habilitarForm(form);\r\n\r\n return progresso;\r\n }\r\n}\r\n","import { HttpErrorResponse } from '@angular/common/http';\r\nimport {\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n HostListener,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { FormGroup } from '@angular/forms';\r\nimport { MatDrawer } from '@angular/material/sidenav';\r\nimport { IcConfirmaDialogService } from '@inovamobil/ic-confirma-dialog';\r\nimport { IcmSnackBarService } from '@inovamobil/icm-snackbar';\r\nimport { Subscription } from 'rxjs';\r\nimport { finalize } from 'rxjs/operators';\r\n\r\nimport { ErrorDialogService } from '../components/dialogs/error-dialog/service/error-dialog.service';\r\nimport { IDatabarBindStatusService } from '../public-api';\r\nimport { ACAO_PAGINACAO } from './constants/ic-databar.constants';\r\nimport { DataBarConfigBotoesService } from './contrato/DataBarConfigBotoesService';\r\nimport { IDatabarBindOnClickService } from './contrato/IDataBarBindOnClickService';\r\nimport { IDataBarReverterService } from './contrato/IDataBarReverterService';\r\nimport { IDataBarBindService } from './contrato/IDataBarService';\r\nimport { IDataEntidadePaginada } from './contrato/IDataEntidadePaginada';\r\nimport { EEventoClick } from './enum/eeventoclick';\r\nimport { EStatus } from './enum/estatus';\r\nimport { IcDatabarReverterService } from './services/ic-databar-reverter.service';\r\nimport { DatabarService } from './services/ic-databar.service';\r\n\r\n@Component({\r\n selector: 'ic-data-bar',\r\n templateUrl: './view/ic-data-bar.component.html',\r\n styleUrls: ['./view/ic-data-bar.component.scss'],\r\n})\r\nexport class DataBarComponent<T> implements OnInit, OnDestroy {\r\n @Input() servicoBind:\r\n | IDataBarBindService<T>\r\n | IDatabarBindStatusService<T>\r\n | IDatabarBindOnClickService<T>;\r\n @Input() form: FormGroup;\r\n @Input() entidadePaginada: IDataEntidadePaginada<T>;\r\n @Input() disabled = false;\r\n @Input() servicoConfiguracaoBotoes: DataBarConfigBotoesService;\r\n @Input() set servicoReverter(servico: IDataBarReverterService<T>) {\r\n this._servicoReverter = servico;\r\n }\r\n\r\n @Output() statusChanged = new EventEmitter<EStatus>();\r\n\r\n public status: EStatus;\r\n public EStatus = EStatus;\r\n public emProgresso = false;\r\n private _servicoReverter: IDataBarReverterService<T>;\r\n private $setStatus: Subscription;\r\n\r\n @ViewChild('drawer', { static: false }) drawer: MatDrawer;\r\n\r\n constructor(\r\n private _dialog: IcConfirmaDialogService,\r\n private _dialogErro: ErrorDialogService,\r\n private _elementRef: ElementRef,\r\n private _databarService: DatabarService,\r\n private _snackBarService: IcmSnackBarService,\r\n ) {}\r\n\r\n ngOnInit(): void {\r\n this.validarPropertsObrigatorias();\r\n this.setProgresso(false);\r\n this.novaPesquisa();\r\n this._submeterFormularioOnEnter();\r\n this.observarSetStatus();\r\n this._pesquisarPosicaoSelecionada();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.servicoBind.onClickEnter) this.servicoBind.onClickEnter.unsubscribe();\r\n\r\n if (this.$setStatus) this.$setStatus.unsubscribe();\r\n }\r\n\r\n @HostListener('document:click', ['$event'])\r\n fecharSidenav(event): void {\r\n if (this._elementRef.nativeElement.contains(event.target)) {\r\n return;\r\n }\r\n this.drawer.close();\r\n }\r\n\r\n get inserindoOuEditando(): boolean {\r\n return this.status === EStatus.inserindo || this.status === EStatus.editando;\r\n }\r\n\r\n get desabilitarBotaoModoTabela(): boolean {\r\n return (\r\n this.status == EStatus.inserindo ||\r\n this.status == EStatus.editando ||\r\n this.emProgresso ||\r\n this.form.invalid ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoModoTabela()\r\n );\r\n }\r\n\r\n get desabilitarBotaoPesquisar(): boolean {\r\n return (\r\n this.status == EStatus.inserindo ||\r\n this.status == EStatus.editando ||\r\n this.status == EStatus.dadosCarregados ||\r\n this.emProgresso ||\r\n this.form.invalid ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoPesquisar()\r\n );\r\n }\r\n\r\n get desabilitarBotaoReverter(): boolean {\r\n return (\r\n this.status == EStatus.novaPesquisa ||\r\n this.status == EStatus.executarAcao ||\r\n this.status == EStatus.dadosCarregados ||\r\n this.emProgresso ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoReverter()\r\n );\r\n }\r\n\r\n get desabilitarBotaoAdicionar(): boolean {\r\n return (\r\n this.status == EStatus.editando ||\r\n this.status == EStatus.inserindo ||\r\n this.emProgresso ||\r\n this.disabled ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoAdicionar()\r\n );\r\n }\r\n\r\n get desabilitarBotaoEditar(): boolean {\r\n return (\r\n this.status == EStatus.inserindo ||\r\n this.status == EStatus.novaPesquisa ||\r\n this.status == EStatus.executarAcao ||\r\n this.status == EStatus.pesquisando ||\r\n this.status == EStatus.editando ||\r\n this.emProgresso ||\r\n this.disabled ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoEditar()\r\n );\r\n }\r\n\r\n get desabilitarBotaoClonar(): boolean {\r\n return (\r\n !this.entidadePaginada?.entidade ||\r\n this.status != EStatus.dadosCarregados ||\r\n this.emProgresso ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoClonar()\r\n );\r\n }\r\n\r\n get desabilitarBotaoRemover(): boolean {\r\n return (\r\n !this.entidadePaginada?.entidade ||\r\n this.status != EStatus.dadosCarregados ||\r\n this.emProgresso ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoRemover()\r\n );\r\n }\r\n\r\n get desabilitarBotaoSalvar(): boolean {\r\n return (\r\n this.form?.invalid ||\r\n (this.status != EStatus.inserindo && this.status != EStatus.editando) ||\r\n this.emProgresso ||\r\n this.disabled ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoSalvar()\r\n );\r\n }\r\n\r\n get desabilitarBotoesPaginacaoRetroceder(): boolean {\r\n return (\r\n this.inserindoOuEditando ||\r\n this.entidadePaginada.posicao <= 1 ||\r\n this.emProgresso\r\n );\r\n }\r\n\r\n get desabilitarBotoesPaginacaoAvancar(): boolean {\r\n return (\r\n this.inserindoOuEditando ||\r\n this.entidadePaginada.posicao >= this.entidadePaginada.total ||\r\n this.emProgresso\r\n );\r\n }\r\n\r\n onClickReverter(): void {\r\n this._exibirDialogConfirmacaoReverter();\r\n }\r\n\r\n onClickModoTabela(): void {\r\n this._emitirEventoClick(EEventoClick.onClickModoTabela);\r\n }\r\n\r\n onClickNovaPesquisa(): void {\r\n this._emitirEventoClick(EEventoClick.onClickNovaPesquisa);\r\n this.novaPesquisa();\r\n this._emitirEventoClick(EEventoClick.afterClickNovaPesquisa);\r\n }\r\n\r\n novaPesquisa(): void {\r\n this._databarService.habilitarForm(this.form);\r\n this.form.reset({ emitEvent: false, onlySelf: true });\r\n this.entidadePaginada.entidade = this.form.value;\r\n this.entidadePaginada.posicao = 0;\r\n this.entidadePaginada.total = 0;\r\n this.setStatus(EStatus.novaPesquisa);\r\n }\r\n\r\n pesquisar(): void {\r\n if (this.form.invalid) {\r\n return;\r\n }\r\n\r\n this._setDadosAnteriores();\r\n this.setStatus(EStatus.pesquisando);\r\n this.entidadePaginada.entidade = [].concat(this._getEntidade());\r\n this._paginar();\r\n this.drawer.close();\r\n }\r\n\r\n inserir(): void {\r\n this._emitirEventoClick(EEventoClick.onClickInserir);\r\n this._clickInserir();\r\n this._emitirEventoClick(EEventoClick.afterClickInserir);\r\n }\r\n\r\n editar(): void {\r\n this._emitirEventoClick(EEventoClick.onClickEditar);\r\n this._clickEditar();\r\n this._emitirEventoClick(EEventoClick.afterClickEditar);\r\n }\r\n\r\n clonar(): void {\r\n this.inserir();\r\n this.form.patchValue(this.retornarServicoReverter().dadosAnterioresFormulario);\r\n this._emitirEventoClick(EEventoClick.afterClickClonar);\r\n }\r\n\r\n remover(): void {\r\n this._emitirEventoClick(EEventoClick.onClickRemover);\r\n this._clickRemover();\r\n this._emitirEventoClick(EEventoClick.afterClickRemover);\r\n }\r\n\r\n proximo(): void {\r\n this._paginar('proximo');\r\n }\r\n\r\n anterior(): void {\r\n this._paginar('anterior');\r\n }\r\n\r\n ultimo(): void {\r\n this._paginar('ultimo');\r\n }\r\n\r\n primeiro(): void {\r\n this._paginar('primeiro');\r\n }\r\n\r\n salvar(): void {\r\n this._emitirEventoClick(EEventoClick.onClickSalvar);\r\n\r\n switch (this.status) {\r\n case EStatus.inserindo:\r\n this._inserir();\r\n break;\r\n\r\n case EStatus.editando:\r\n this._editar();\r\n break;\r\n }\r\n }\r\n\r\n private _inserir(): void {\r\n this.setStatus(EStatus.salvando);\r\n this.setProgresso(true);\r\n this.servicoBind\r\n .criar()\r\n .pipe(\r\n finalize(() => {\r\n this._emitirEventoClick(EEventoClick.afterClickSalvar);\r\n }),\r\n )\r\n .subscribe(\r\n (success) => {\r\n this.setProgresso(false);\r\n\r\n this._snackBarService.abrirSnackBarSucesso(\r\n 'Registro salvo com sucesso!',\r\n );\r\n\r\n this.form.patchValue(success);\r\n\r\n this.setStatus(EStatus.dadosCarregados);\r\n\r\n this.drawer.close();\r\n\r\n this._databarService.desabilitarForm(this.form);\r\n },\r\n () => {\r\n this.setProgresso(false);\r\n this.setStatus(EStatus.inserindo);\r\n },\r\n );\r\n }\r\n\r\n private _editar(): void {\r\n this.setStatus(EStatus.salvando);\r\n this.setProgresso(true);\r\n this.servicoBind\r\n .editar()\r\n .pipe(\r\n finalize(() => {\r\n this._emitirEventoClick(EEventoClick.afterClickSalvar);\r\n }),\r\n )\r\n .subscribe(\r\n (success) => {\r\n this._snackBarService.abrirSnackBarSucesso(\r\n 'Registro editado com sucesso!',\r\n );\r\n\r\n this.form.patchValue(success);\r\n\r\n this.setProgresso(false);\r\n\r\n this.setStatus(EStatus.dadosCarregados);\r\n\r\n this._databarService.desabilitarForm(this.form);\r\n\r\n this.drawer.close();\r\n },\r\n () => {\r\n this.setProgresso(false);\r\n this.setStatus(EStatus.editando);\r\n },\r\n );\r\n }\r\n\r\n private observarSetStatus(): void {\r\n if ((this.servicoBind as IDatabarBindStatusService<T>).setStatus) {\r\n this.$setStatus = (\r\n this.servicoBind as IDatabarBindStatusService<T>\r\n ).setStatus.subscribe((status) => {\r\n switch (status) {\r\n case EStatus.editando:\r\n this.editar();\r\n this.emProgresso = false;\r\n break;\r\n case EStatus.inserindo:\r\n this.inserir();\r\n this.emProgresso = false;\r\n break;\r\n case EStatus.pesquisando:\r\n this.pesquisar();\r\n break;\r\n case EStatus.novaPesquisa:\r\n this.novaPesquisa();\r\n break;\r\n case EStatus.removendo:\r\n this.remover();\r\n break;\r\n case EStatus.dadosCarregados:\r\n this.status = EStatus.dadosCarregados;\r\n this.emProgresso = false;\r\n break;\r\n }\r\n });\r\n }\r\n }\r\n\r\n private retornarServicoReverter(): IDataBarReverterService<T> {\r\n if (this._servicoReverter == null)\r\n this._servicoReverter = new IcDatabarReverterService();\r\n\r\n return this._servicoReverter;\r\n }\r\n\r\n private _setDadosAnteriores(): void {\r\n this.retornarServicoReverter().setDadosAnteriores(\r\n this.status,\r\n this.form,\r\n this.entidadePaginada,\r\n );\r\n }\r\n\r\n private _reverter(): void {\r\n this._emitirEventoClick(EEventoClick.onClickReverter);\r\n this.entidadePaginada = this.retornarServicoReverter().restaurarDadosAnteriores(\r\n this.form,\r\n );\r\n const statusAnterior = this.retornarServicoReverter().statusAnterior;\r\n\r\n if (statusAnterior == EStatus.dadosCarregados)\r\n this._databarService.desabilitarForm(this.form);\r\n else this._databarService.habilitarForm(this.form);\r\n\r\n this.setStatus(statusAnterior);\r\n this._emitirEventoClick(EEventoClick.afterClickReverter);\r\n }\r\n\r\n private _resetarContadorPaginacao(): void {\r\n this.entidadePaginada.posicao = 0;\r\n this.entidadePaginada.total = 0;\r\n }\r\n\r\n private validarPropertsObrigatorias(): any {\r\n if (this.servicoBind == null) {\r\n throw new Error('É obrigatório ter um serviço de bind vinculado.');\r\n }\r\n\r\n if (this.entidadePaginada == null) {\r\n throw new Error('É obrigatório ter uma entidade paginada vinculada.');\r\n }\r\n }\r\n\r\n private setStatus(status: EStatus): void {\r\n if (!status) {\r\n return;\r\n }\r\n this.status = status;\r\n this.statusChanged.emit(this.status);\r\n }\r\n\r\n private _getEntidade(): T {\r\n const result = this.form.getRawValue() as T;\r\n return result;\r\n }\r\n\r\n private _submeterFormularioOnEnter(): void {\r\n if (!this.servicoBind.onClickEnter) return;\r\n this.servicoBind.onClickEnter.subscribe(() => {\r\n if (this.status === EStatus.novaPesquisa && this.form.valid) {\r\n this.pesquisar();\r\n }\r\n });\r\n }\r\n\r\n private _pesquisarPosicaoSelecionada(): void {\r\n if (!this.servicoBind.pesquisarPosicaoSelecionada) return;\r\n\r\n this.servicoBind.pesquisarPosicaoSelecionada.subscribe((entidadePaginada) => {\r\n if (this.status === EStatus.novaPesquisa && this.form.valid) {\r\n this.entidadePaginada = entidadePaginada;\r\n this._pesquisarSelecionado();\r\n }\r\n });\r\n }\r\n\r\n private _pesquisarSelecionado(): void {\r\n if (this.form.invalid) {\r\n return;\r\n }\r\n\r\n this._setDadosAnteriores();\r\n this.setStatus(EStatus.pesquisando);\r\n this._paginar('customizado');\r\n this.drawer.close();\r\n }\r\n\r\n private _clickInserir(): void {\r\n this._setDadosAnteriores();\r\n this._resetarContadorPaginacao();\r\n this._databarService.habilitarForm(this.form);\r\n this.form.reset({ emitEvent: false, onlySelf: true });\r\n this.form.markAllAsTouched();\r\n this.drawer.close();\r\n this.setStatus(EStatus.inserindo);\r\n }\r\n\r\n private _clickEditar(): void {\r\n this._setDadosAnteriores();\r\n this._databarService.habilitarForm(this.form);\r\n\r\n this.form.markAllAsTouched();\r\n this.drawer.close();\r\n this.setStatus(EStatus.editando);\r\n }\r\n\r\n private _clickRemover(): void {\r\n this.setStatus(EStatus.removendo);\r\n this._exibirDialogConfirmacao();\r\n this.drawer.close();\r\n }\r\n\r\n private _emitirEventoClick(evento: EEventoClick): void {\r\n return this._databarService.emitirEventoClick<T>(\r\n this.servicoBind as IDatabarBindOnClickService<T>,\r\n evento,\r\n );\r\n }\r\n\r\n private _acaoCloseDialogConfirmacao(): void {\r\n this._dialog.emProgresso = false;\r\n this._dialog.closeDialog();\r\n this.setStatus(EStatus.dadosCarregados);\r\n }\r\n\r\n private _exibirDialogConfirmacao(): void {\r\n this._dialog.acaoMensagem = 'Removendo registro...';\r\n this._dialog.acaoOk = () =>\r\n this.servicoBind.remover().subscribe(\r\n () => {\r\n this._dialog.closeDialog();\r\n this.novaPesquisa();\r\n this._dialog.emProgresso = false;\r\n this._snackBarService.abrirSnackBarSucesso('Removido com sucesso!');\r\n },\r\n () => this._acaoCloseDialogConfirmacao(),\r\n );\r\n this._dialog.acaoCancelar = () => {\r\n this._acaoCloseDialogConfirmacao();\r\n };\r\n\r\n this._dialog.openDialog(\r\n 'Atenção!',\r\n 'Você realmente deseja excluir este registro?',\r\n );\r\n }\r\n\r\n private _exibirDialogConfirmacaoReverter(): void {\r\n this._dialog.acaoOk = () => {\r\n this._reverter();\r\n this._dialog.emProgresso = false;\r\n this._dialog.closeDialog();\r\n };\r\n\r\n this._dialog.acaoCancelar = () => {\r\n this._dialog.closeDialog();\r\n };\r\n\r\n this._dialog.openDialog(\r\n 'Atenção!',\r\n 'As alterações realizadas serão perdidas. Deseja continuar?',\r\n );\r\n }\r\n\r\n private _paginar(acao?: ACAO_PAGINACAO): void {\r\n this.setStatus(EStatus.pesquisando);\r\n\r\n if (this.entidadePaginada.entidade == null) {\r\n this.entidadePaginada.entidade = [].concat(this._getEntidade());\r\n }\r\n\r\n const posicaoAnterior = this.entidadePaginada.posicao;\r\n\r\n switch (acao) {\r\n case 'primeiro':\r\n this.entidadePaginada.posicao = 1;\r\n break;\r\n case 'ultimo':\r\n this.entidadePaginada.posicao = this.entidadePaginada.total;\r\n break;\r\n case 'proximo':\r\n this.entidadePaginada.posicao++;\r\n break;\r\n case 'anterior':\r\n this.entidadePaginada.posicao--;\r\n break;\r\n case 'customizado':\r\n break;\r\n default:\r\n this.entidadePaginada.posicao = 0;\r\n break;\r\n }\r\n\r\n this.setProgresso(true);\r\n\r\n this.servicoBind.listarPaginacao(this.entidadePaginada).subscribe(\r\n (success) => {\r\n this.setProgresso(false);\r\n\r\n if (success == null) {\r\n this._dialogErro.openDialog(\r\n 'Atenção!',\r\n 'Nenhum registro foi encontrado.',\r\n );\r\n this.setStatus(EStatus.novaPesquisa);\r\n return;\r\n }\r\n\r\n if (success.entidade == null) {\r\n this._databarService.resetForm(this.form, this.entidadePaginada);\r\n this.setStatus(EStatus.novaPesquisa);\r\n return;\r\n }\r\n\r\n this.setStatus(EStatus.dadosCarregados);\r\n\r\n if (!this.entidadePaginada.entidade) {\r\n this.entidadePaginada = success;\r\n } else {\r\n this.entidadePaginada.total = success.total;\r\n this.entidadePaginada.posicao = success.posicao;\r\n }\r\n\r\n this.form.patchValue(success.entidade[0]);\r\n\r\n this.setProgresso(false);\r\n\r\n this._databarService.desabilitarForm(this.form);\r\n },\r\n (error: HttpErrorResponse) => {\r\n if (error.status === 422) {\r\n this.setStatus(EStatus.novaPesquisa);\r\n } else {\r\n this.setStatus(EStatus.dadosCarregados);\r\n this.entidadePaginada.posicao = posicaoAnterior;\r\n this._databarService.desabilitarForm(this.form);\r\n }\r\n this.setProgresso(false);\r\n console.error('erro paginação', error);\r\n },\r\n );\r\n }\r\n\r\n private setProgresso(progresso: boolean): void {\r\n this.emProgresso = this._databarService.definirProgresso(this.form, progresso);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { ErrorDialogComponent } from './error-dialog.component';\r\n\r\n\r\n@NgModule({\r\n declarations: [ErrorDialogComponent],\r\n imports: [\r\n MatDialogModule\r\n ],\r\n exports: [ErrorDialogComponent],\r\n entryComponents: [ErrorDialogComponent]\r\n})\r\nexport class ErrorDialogModule { }\r\n","import { NgModule } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatSidenavModule } from '@angular/material/sidenav';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { FlexLayoutModule } from '@angular/flex-layout';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { IcConfirmaDialogModule } from '@inovamobil/ic-confirma-dialog';\r\nimport { DataBarComponent } from './ic-data-bar.component';\r\nimport { ErrorDialogModule } from '../components/dialogs/error-dialog/error-dialog.module';\r\nimport { DatabarService } from './services/ic-databar.service';\r\nimport { IcmSnackBarModule } from '@inovamobil/icm-snackbar';\r\n\r\n@NgModule({\r\n declarations: [DataBarComponent],\r\n imports: [\r\n CommonModule,\r\n MatToolbarModule,\r\n MatListModule,\r\n MatSidenavModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n MatDividerModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n FlexLayoutModule,\r\n IcConfirmaDialogModule,\r\n ErrorDialogModule,\r\n IcmSnackBarModule\r\n ],\r\n exports: [DataBarComponent],\r\n providers: [DatabarService]\r\n})\r\nexport class DataBarModule { }\r\n"]}
1
+ {"version":3,"sources":["../../../projects/ic-databar-lib/src/lib/enum/estatus.ts","../../../projects/ic-databar-lib/src/lib/contrato/OnInitDataBar.ts","../../../projects/ic-databar-lib/src/lib/enum/eeventoclick.ts","../../../projects/ic-databar-lib/src/lib/contrato/DataBarConfigBotoesService.ts","../../../projects/ic-databar-lib/src/lib/services/ic-databar-event-click.service.ts","../../../projects/ic-databar-lib/src/components/dialogs/error-dialog/error-dialog.component.ts","../../../projects/ic-databar-lib/src/components/dialogs/error-dialog/service/error-dialog.service.ts","../../../projects/ic-databar-lib/src/lib/services/ic-databar-reverter.service.ts","../../../projects/ic-databar-lib/src/lib/services/ic-databar.service.ts","../../../projects/ic-databar-lib/src/lib/ic-data-bar.component.ts","../../../projects/ic-databar-lib/src/components/dialogs/error-dialog/error-dialog.module.ts","../../../projects/ic-databar-lib/src/lib/ic-data-bar.module.ts"],"names":["EStatus","OnInitDataBar","this","prototype","ngOnInit","onInit","servicoDataBarBind","status","novaPesquisa","statusChanged","statusDataBar","onStatusChanged","Object","defineProperty","inserindo","editando","removendo","Directive","EEventoClick","DataBarConfigBotoesService","desabilitarBotaoNovaPesquisa","args","_i","arguments","length","desabilitarBotaoReverter","desabilitarBotaoPesquisar","desabilitarBotaoEditar","desabilitarBotaoClonar","desabilitarBotaoAdicionar","desabilitarBotaoRemover","desabilitarBotaoSalvar","desabilitarBotaoPrimeiro","desabilitarBotaoAnterior","desabilitarBotaoProximo","desabilitarBotaoUltimo","desabilitarBotaoModoTabela","exibirBotaoModoTabela","exibirBotaoClonar","DatabarEventClickService","onEvent","emitir","evento","ErrorDialogComponent","dialogRef","data","mensagem","titulo","close","Component","selector","template","MatDialogRef","Inject","MAT_DIALOG_DATA","ErrorDialogService","dialog","openDialog","dialogConfig","MatDialogConfig","disableClose","autoFocus","minWidth","open","closeDialog","Injectable","providedIn","MatDialog","IcDatabarReverterService","_statusAnterior","setDadosAnteriores","formularo","entidadePaginada","_entidadePaginadaAnterior","entidade","posicao","quantidade","total","_dadosAnterioresFormulario","getRawValue","restaurarDadosAnteriores","formulario","patchValue","DatabarService","desabilitarForm","form","disable","emitEvent","onlySelf","habilitarForm","enable","resetForm","reset","emitirEventoClick","servico","eventDatabar","definirProgresso","progresso","DataBarComponent","_dialog","_dialogErro","_elementRef","_databarService","_snackBarService","disabled","EventEmitter","emProgresso","_servicoReverter","validarPropertsObrigatorias","setProgresso","_submeterFormularioOnEnter","observarSetStatus","_pesquisarPosicaoSelecionada","ngOnDestroy","servicoBind","onClickEnter","unsubscribe","$setStatus","fecharSidenav","event","nativeElement","contains","target","drawer","invalid","_a","servicoConfiguracaoBotoes","dadosCarregados","executarAcao","pesquisando","_b","inserindoOuEditando","onClickReverter","_exibirDialogConfirmacaoReverter","onClickModoTabela","_emitirEventoClick","onClickNovaPesquisa","afterClickNovaPesquisa","value","setStatus","pesquisar","_setDadosAnteriores","concat","_getEntidade","_paginar","inserir","onClickInserir","_clickInserir","afterClickInserir","editar","onClickEditar","_clickEditar","afterClickEditar","clonar","onClickClonar","_clickClonar","afterClickClonar","remover","onClickRemover","_clickRemover","afterClickRemover","proximo","anterior","ultimo","primeiro","salvar","onClickSalvar","_inserir","_editar","_this","salvando","criar","pipe","finalize","afterClickSalvar","subscribe","success","abrirSnackBarSucesso","retornarServicoReverter","_reverter","statusAnterior","afterClickReverter","_resetarContadorPaginacao","Error","emit","valid","pesquisarPosicaoSelecionada","_pesquisarSelecionado","markAllAsTouched","_exibirDialogConfirmacao","_acaoCloseDialogConfirmacao","acaoMensagem","acaoOk","acaoCancelar","acao","posicaoAnterior","listarPaginacao","error","console","IcConfirmaDialogService","ElementRef","IcmSnackBarService","Input","Output","ViewChild","static","HostListener","NgModule","declarations","imports","MatDialogModule","exports","entryComponents","CommonModule","MatToolbarModule","MatListModule","MatSidenavModule","MatIconModule","MatProgressSpinnerModule","MatDividerModule","MatButtonModule","MatTooltipModule","FlexLayoutModule","IcConfirmaDialogModule","ErrorDialogModule","IcmSnackBarModule","providers"],"mappings":"mhDACA,IAAYA,GAAAA,EAAAA,EAAAA,UAAAA,EAAAA,QAAO,KACf,aAAA,gBACAA,EAAA,UAAA,YACAA,EAAA,SAAA,WACAA,EAAA,UAAA,YACAA,EAAA,gBAAA,mBACAA,EAAA,YAAA,cACAA,EAAA,aAAA,gBACAA,EAAA,SAAA,4BCDJ,SAAAC,IAMIC,KAAAF,QAA0BA,EAAAA,eAM1BC,EAAAE,UAAAC,SAAA,WACIF,KAAKG,SACLH,KAAKI,mBAAmB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AAUwH,EAChC1B,EAAKnE,gBAAgBlB,gBAAgBqF,EAAKpF,OAE9CoF,EAAK5D,cAAa,GAClByF,QAAQD,MAAM,iBAAkBA,OAKpCnG,EAAA/F,UAAA0G,aAAA,SAAaZ,GACjB/F,KAAKwG,YAAcxG,KAAKoG,gBAAgBN,iBAAiB9F,KAAKmF,KAAMY,6BA1lB3EhD,EAAAA,UAAS5B,KAAA,CAAC,CACP6B,SAAU,cACVC,SAAA,2qmBApBKoJ,EAAAA,+BAKAhJ,SAhBLiJ,EAAAA,kBA2BKrH,SAfAsH,EAAAA,2DAuBJC,EAAAA,oBAIAA,EAAAA,gCACAA,EAAAA,wBACAA,EAAAA,yCACAA,EAAAA,+BACAA,EAAAA,6BAIAC,EAAAA,uBAQAC,EAAAA,UAASvL,KAAA,CAAC,SAAU,CAAEwL,QAAQ,2BAyB9BC,EAAAA,aAAYzL,KAAA,CAAC,iBAAkB,CAAC,oBCtErC,iCARC0L,EAAAA,SAAQ1L,KAAA,CAAC,CACN2L,aAAc,CAACrK,GACfsK,QAAS,CACLC,EAAAA,iBAEJC,QAAS,CAACxK,GACVyK,gBAAiB,CAACzK,aC2BtB,iCApBCoK,EAAAA,SAAQ1L,KAAA,CAAC,CACN2L,aAAc,CAAC9G,GACf+G,QAAS,CACLI,EAAAA,aACAC,EAAAA,iBACAC,EAAAA,cACAC,EAAAA,iBACAC,EAAAA,cACAC,EAAAA,yBACAC,EAAAA,iBACAC,EAAAA,gBACAC,EAAAA,iBACAC,EAAAA,iBACAC,EAAAA,uBACAC,EACAC,EAAAA,mBAEJd,QAAS,CAACjH,GACVgI,UAAW,CAAC/I","sourcesContent":["\r\nexport enum EStatus {\r\n novaPesquisa = 'Nova pesquisa',\r\n inserindo = 'Inserindo',\r\n editando = 'Editando',\r\n removendo = 'Removendo',\r\n dadosCarregados = 'Dados carregados',\r\n pesquisando = 'Pesquisando',\r\n executarAcao = 'Executar ação',\r\n salvando = 'Salvando'\r\n}\r\n","import { IDataBarBindComponent } from './IDataBarBind';\r\nimport { Component, Directive } from '@angular/core';\r\nimport { FormGroup } from '@angular/forms';\r\n\r\nimport { IDataEntidadePaginada } from './IDataEntidadePaginada';\r\nimport { IDataBarBindService } from './IDataBarService';\r\nimport { EStatus } from '../enum/estatus';\r\n\r\n@Directive()\r\nexport abstract class OnInitDataBar<T> implements IDataBarBindComponent<T> {\r\n form: FormGroup;\r\n entidadePaginada: IDataEntidadePaginada<T>;\r\n statusDataBar: EStatus;\r\n servicoDataBarBind: IDataBarBindService<T>;\r\n EStatus: typeof EStatus = EStatus;\r\n\r\n abstract onStatusChanged(status: EStatus): void;\r\n\r\n abstract onInit(): void;\r\n\r\n ngOnInit(): void {\r\n this.onInit();\r\n this.servicoDataBarBind.status = EStatus.novaPesquisa;\r\n }\r\n\r\n statusChanged(status: EStatus): void {\r\n this.servicoDataBarBind.status = status;\r\n this.statusDataBar = status;\r\n this.onStatusChanged(status);\r\n }\r\n\r\n public get inserindoOuEditando(): boolean {\r\n return this.statusDataBar === EStatus.inserindo ||\r\n this.statusDataBar === EStatus.editando;\r\n }\r\n\r\n public get inserindo(): boolean {\r\n return this.statusDataBar === EStatus.inserindo;\r\n }\r\n\r\n public get editando(): boolean {\r\n return this.statusDataBar === EStatus.editando;\r\n }\r\n\r\n public get editandoOuRemovendo(): boolean {\r\n return (this.statusDataBar === EStatus.editando || this.statusDataBar === EStatus.removendo);\r\n }\r\n}\r\n","export enum EEventoClick {\r\n onClickInserir = 'onInserir',\r\n afterClickInserir = 'afterClickInserir',\r\n onClickReverter = 'onReverter',\r\n afterClickReverter = 'afterClickReverter',\r\n onClickNovaPesquisa = 'onNovaPesquisa',\r\n afterClickNovaPesquisa = 'afterClickNovaPesquisa',\r\n onClickEditar = 'onEditar',\r\n afterClickEditar = 'afterClickEditar',\r\n onClickRemover = 'onRemover',\r\n afterClickRemover = 'afterClickRemover',\r\n onClickSalvar = 'onClickSalvar',\r\n afterClickSalvar = 'afterClickSalvar',\r\n onClickModoTabela = 'onClickModoTabela',\r\n onClickClonar = 'onClickClonar',\r\n afterClickClonar = 'afterClickClonar',\r\n}\r\n","export abstract class DataBarConfigBotoesService {\r\n desabilitarBotaoNovaPesquisa(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoReverter(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoPesquisar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoEditar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoClonar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoAdicionar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoRemover(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoSalvar(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoPrimeiro(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoAnterior(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoProximo(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoUltimo(...args): boolean {\r\n return false;\r\n }\r\n\r\n desabilitarBotaoModoTabela(...args): boolean {\r\n return false;\r\n }\r\n\r\n exibirBotaoModoTabela(...args): boolean {\r\n return false;\r\n }\r\n\r\n exibirBotaoClonar(...args): boolean {\r\n return false;\r\n }\r\n}\r\n","import { EEventoClick } from '../enum/eeventoclick';\r\n\r\nexport class DatabarEventClickService {\r\n\r\n constructor(private onEvent: (event: EEventoClick) => void) {}\r\n \r\n emitir(evento: EEventoClick): void {\r\n this.onEvent(evento);\r\n }\r\n\r\n}\r\n","import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\r\nimport { Inject, Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'confirma-dialog',\r\n templateUrl: './view/error-dialog.html',\r\n styleUrls: ['./view/error-dialog.scss']\r\n})\r\nexport class ErrorDialogComponent {\r\n\r\n mensagem: string;\r\n titulo: string;\r\n\r\n constructor(\r\n private dialogRef: MatDialogRef<ErrorDialogComponent>,\r\n @Inject(MAT_DIALOG_DATA) data) {\r\n\r\n this.mensagem = data.mensagem;\r\n this.titulo = data.titulo;\r\n }\r\n\r\n close(): void {\r\n this.dialogRef.close();\r\n }\r\n}\r\n\r\n","import { MatDialogConfig, MatDialog } from '@angular/material/dialog';\r\nimport { Injectable } from '@angular/core';\r\n\r\nimport { ErrorDialogComponent } from '../error-dialog.component';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport abstract class ErrorDialogService {\r\n\r\n dialogRef: any;\r\n\r\n constructor(private dialog: MatDialog) { }\r\n\r\n openDialog(titulo: string, mensagem: string): void {\r\n const dialogConfig = new MatDialogConfig();\r\n dialogConfig.disableClose = true;\r\n dialogConfig.autoFocus = true;\r\n\r\n dialogConfig.data = {\r\n titulo: titulo,\r\n mensagem: mensagem\r\n };\r\n\r\n dialogConfig.minWidth = '300px';\r\n\r\n this.dialogRef = this.dialog.open(ErrorDialogComponent, dialogConfig);\r\n\r\n }\r\n\r\n closeDialog(): void {\r\n this.dialogRef.close();\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { FormGroup } from '@angular/forms';\r\n\r\nimport { IDataBarReverterService } from '../contrato/IDataBarReverterService';\r\nimport { IDataEntidadePaginada } from '../contrato/IDataEntidadePaginada';\r\nimport { EStatus } from '../enum/estatus';\r\n\r\n@Injectable()\r\nexport class IcDatabarReverterService<T> implements IDataBarReverterService<T> {\r\n private _statusAnterior: EStatus;\r\n private _dadosAnterioresFormulario: T;\r\n private _entidadePaginadaAnterior: IDataEntidadePaginada<T>;\r\n\r\n get statusAnterior(): EStatus {\r\n return this._statusAnterior;\r\n }\r\n\r\n public setDadosAnteriores(\r\n status: EStatus,\r\n formularo: FormGroup,\r\n entidadePaginada: IDataEntidadePaginada<T>,\r\n ): void {\r\n this._entidadePaginadaAnterior = {\r\n entidade: entidadePaginada.entidade,\r\n posicao: entidadePaginada.posicao,\r\n quantidade: entidadePaginada.quantidade,\r\n total: entidadePaginada.total,\r\n } as IDataEntidadePaginada<T>;\r\n\r\n this._dadosAnterioresFormulario = formularo.getRawValue();\r\n this._statusAnterior = status;\r\n }\r\n\r\n public restaurarDadosAnteriores(formulario: FormGroup): IDataEntidadePaginada<T> {\r\n formulario.patchValue(this._dadosAnterioresFormulario);\r\n return this._entidadePaginadaAnterior;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { FormGroup } from '@angular/forms';\r\n\r\nimport { IDataEntidadePaginada } from '../contrato/IDataEntidadePaginada';\r\nimport { IDatabarBindOnClickService, EEventoClick } from '../../public-api';\r\n\r\n@Injectable()\r\nexport class DatabarService {\r\n\r\n\r\n constructor() { }\r\n\r\n public desabilitarForm(form: FormGroup): void {\r\n form.disable({ emitEvent: false, onlySelf: true });\r\n }\r\n\r\n public habilitarForm(form: FormGroup): void {\r\n form.enable({ emitEvent: false, onlySelf: true });\r\n }\r\n\r\n public resetForm(form: FormGroup, entidadePaginada: IDataEntidadePaginada<any>): void {\r\n form.reset({ emitEvent: false, onlySelf: true });\r\n entidadePaginada.entidade = null;\r\n entidadePaginada.posicao = 0;\r\n entidadePaginada.total = 0;\r\n }\r\n\r\n public emitirEventoClick<T>(servico: IDatabarBindOnClickService<T>, evento: EEventoClick): void {\r\n if (servico.eventDatabar) {\r\n servico.eventDatabar.emitir(evento);\r\n }\r\n }\r\n\r\n definirProgresso(form: FormGroup, progresso: boolean): boolean {\r\n if (!form)\r\n return;\r\n\r\n if (progresso)\r\n this.desabilitarForm(form);\r\n else\r\n this.habilitarForm(form);\r\n\r\n return progresso;\r\n }\r\n}\r\n","import { HttpErrorResponse } from '@angular/common/http';\r\nimport {\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n HostListener,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { FormGroup } from '@angular/forms';\r\nimport { MatDrawer } from '@angular/material/sidenav';\r\nimport { IcConfirmaDialogService } from '@inovamobil/ic-confirma-dialog';\r\nimport { IcmSnackBarService } from '@inovamobil/icm-snackbar';\r\nimport { Subscription } from 'rxjs';\r\nimport { finalize } from 'rxjs/operators';\r\n\r\nimport { ErrorDialogService } from '../components/dialogs/error-dialog/service/error-dialog.service';\r\nimport { IDatabarBindStatusService } from '../public-api';\r\nimport { ACAO_PAGINACAO } from './constants/ic-databar.constants';\r\nimport { DataBarConfigBotoesService } from './contrato/DataBarConfigBotoesService';\r\nimport { IDatabarBindOnClickService } from './contrato/IDataBarBindOnClickService';\r\nimport { IDataBarReverterService } from './contrato/IDataBarReverterService';\r\nimport { IDataBarBindService } from './contrato/IDataBarService';\r\nimport { IDataEntidadePaginada } from './contrato/IDataEntidadePaginada';\r\nimport { EEventoClick } from './enum/eeventoclick';\r\nimport { EStatus } from './enum/estatus';\r\nimport { IcDatabarReverterService } from './services/ic-databar-reverter.service';\r\nimport { DatabarService } from './services/ic-databar.service';\r\n\r\n@Component({\r\n selector: 'ic-data-bar',\r\n templateUrl: './view/ic-data-bar.component.html',\r\n styleUrls: ['./view/ic-data-bar.component.scss'],\r\n})\r\nexport class DataBarComponent<T> implements OnInit, OnDestroy {\r\n @Input() servicoBind:\r\n | IDataBarBindService<T>\r\n | IDatabarBindStatusService<T>\r\n | IDatabarBindOnClickService<T>;\r\n @Input() form: FormGroup;\r\n @Input() entidadePaginada: IDataEntidadePaginada<T>;\r\n @Input() disabled = false;\r\n @Input() servicoConfiguracaoBotoes: DataBarConfigBotoesService;\r\n @Input() set servicoReverter(servico: IDataBarReverterService<T>) {\r\n this._servicoReverter = servico;\r\n }\r\n\r\n @Output() statusChanged = new EventEmitter<EStatus>();\r\n\r\n public status: EStatus;\r\n public EStatus = EStatus;\r\n public emProgresso = false;\r\n private _servicoReverter: IDataBarReverterService<T>;\r\n private $setStatus: Subscription;\r\n\r\n @ViewChild('drawer', { static: false }) drawer: MatDrawer;\r\n\r\n constructor(\r\n private _dialog: IcConfirmaDialogService,\r\n private _dialogErro: ErrorDialogService,\r\n private _elementRef: ElementRef,\r\n private _databarService: DatabarService,\r\n private _snackBarService: IcmSnackBarService,\r\n ) {}\r\n\r\n ngOnInit(): void {\r\n this.validarPropertsObrigatorias();\r\n this.setProgresso(false);\r\n this.novaPesquisa();\r\n this._submeterFormularioOnEnter();\r\n this.observarSetStatus();\r\n this._pesquisarPosicaoSelecionada();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.servicoBind.onClickEnter) this.servicoBind.onClickEnter.unsubscribe();\r\n\r\n if (this.$setStatus) this.$setStatus.unsubscribe();\r\n }\r\n\r\n @HostListener('document:click', ['$event'])\r\n fecharSidenav(event): void {\r\n if (this._elementRef.nativeElement.contains(event.target)) {\r\n return;\r\n }\r\n this.drawer.close();\r\n }\r\n\r\n get inserindoOuEditando(): boolean {\r\n return this.status === EStatus.inserindo || this.status === EStatus.editando;\r\n }\r\n\r\n get desabilitarBotaoModoTabela(): boolean {\r\n return (\r\n this.status == EStatus.inserindo ||\r\n this.status == EStatus.editando ||\r\n this.emProgresso ||\r\n this.form.invalid ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoModoTabela()\r\n );\r\n }\r\n\r\n get desabilitarBotaoPesquisar(): boolean {\r\n return (\r\n this.status == EStatus.inserindo ||\r\n this.status == EStatus.editando ||\r\n this.status == EStatus.dadosCarregados ||\r\n this.emProgresso ||\r\n this.form.invalid ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoPesquisar()\r\n );\r\n }\r\n\r\n get desabilitarBotaoReverter(): boolean {\r\n return (\r\n this.status == EStatus.novaPesquisa ||\r\n this.status == EStatus.executarAcao ||\r\n this.status == EStatus.dadosCarregados ||\r\n this.emProgresso ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoReverter()\r\n );\r\n }\r\n\r\n get desabilitarBotaoAdicionar(): boolean {\r\n return (\r\n this.status == EStatus.editando ||\r\n this.status == EStatus.inserindo ||\r\n this.emProgresso ||\r\n this.disabled ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoAdicionar()\r\n );\r\n }\r\n\r\n get desabilitarBotaoEditar(): boolean {\r\n return (\r\n this.status == EStatus.inserindo ||\r\n this.status == EStatus.novaPesquisa ||\r\n this.status == EStatus.executarAcao ||\r\n this.status == EStatus.pesquisando ||\r\n this.status == EStatus.editando ||\r\n this.emProgresso ||\r\n this.disabled ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoEditar()\r\n );\r\n }\r\n\r\n get desabilitarBotaoClonar(): boolean {\r\n return (\r\n !this.entidadePaginada?.entidade ||\r\n this.status != EStatus.dadosCarregados ||\r\n this.emProgresso ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoClonar()\r\n );\r\n }\r\n\r\n get desabilitarBotaoRemover(): boolean {\r\n return (\r\n !this.entidadePaginada?.entidade ||\r\n this.status != EStatus.dadosCarregados ||\r\n this.emProgresso ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoRemover()\r\n );\r\n }\r\n\r\n get desabilitarBotaoSalvar(): boolean {\r\n return (\r\n this.form?.invalid ||\r\n (this.status != EStatus.inserindo && this.status != EStatus.editando) ||\r\n this.emProgresso ||\r\n this.disabled ||\r\n this.servicoConfiguracaoBotoes?.desabilitarBotaoSalvar()\r\n );\r\n }\r\n\r\n get desabilitarBotoesPaginacaoRetroceder(): boolean {\r\n return (\r\n this.inserindoOuEditando ||\r\n this.entidadePaginada.posicao <= 1 ||\r\n this.emProgresso\r\n );\r\n }\r\n\r\n get desabilitarBotoesPaginacaoAvancar(): boolean {\r\n return (\r\n this.inserindoOuEditando ||\r\n this.entidadePaginada.posicao >= this.entidadePaginada.total ||\r\n this.emProgresso\r\n );\r\n }\r\n\r\n onClickReverter(): void {\r\n this._exibirDialogConfirmacaoReverter();\r\n }\r\n\r\n onClickModoTabela(): void {\r\n this._emitirEventoClick(EEventoClick.onClickModoTabela);\r\n }\r\n\r\n onClickNovaPesquisa(): void {\r\n this._emitirEventoClick(EEventoClick.onClickNovaPesquisa);\r\n this.novaPesquisa();\r\n this._emitirEventoClick(EEventoClick.afterClickNovaPesquisa);\r\n }\r\n\r\n novaPesquisa(): void {\r\n this._databarService.habilitarForm(this.form);\r\n this.form.reset({ emitEvent: false, onlySelf: true });\r\n this.entidadePaginada.entidade = this.form.value;\r\n this.entidadePaginada.posicao = 0;\r\n this.entidadePaginada.total = 0;\r\n this.setStatus(EStatus.novaPesquisa);\r\n }\r\n\r\n pesquisar(): void {\r\n if (this.form.invalid) {\r\n return;\r\n }\r\n\r\n this._setDadosAnteriores();\r\n this.setStatus(EStatus.pesquisando);\r\n this.entidadePaginada.entidade = [].concat(this._getEntidade());\r\n this._paginar();\r\n this.drawer.close();\r\n }\r\n\r\n inserir(): void {\r\n this._emitirEventoClick(EEventoClick.onClickInserir);\r\n this._clickInserir();\r\n this._emitirEventoClick(EEventoClick.afterClickInserir);\r\n }\r\n\r\n editar(): void {\r\n this._emitirEventoClick(EEventoClick.onClickEditar);\r\n this._clickEditar();\r\n this._emitirEventoClick(EEventoClick.afterClickEditar);\r\n }\r\n\r\n clonar(): void {\r\n this._emitirEventoClick(EEventoClick.onClickClonar);\r\n this._clickClonar();\r\n this._emitirEventoClick(EEventoClick.afterClickClonar);\r\n }\r\n\r\n remover(): void {\r\n this._emitirEventoClick(EEventoClick.onClickRemover);\r\n this._clickRemover();\r\n this._emitirEventoClick(EEventoClick.afterClickRemover);\r\n }\r\n\r\n proximo(): void {\r\n this._paginar('proximo');\r\n }\r\n\r\n anterior(): void {\r\n this._paginar('anterior');\r\n }\r\n\r\n ultimo(): void {\r\n this._paginar('ultimo');\r\n }\r\n\r\n primeiro(): void {\r\n this._paginar('primeiro');\r\n }\r\n\r\n salvar(): void {\r\n this._emitirEventoClick(EEventoClick.onClickSalvar);\r\n\r\n switch (this.status) {\r\n case EStatus.inserindo:\r\n this._inserir();\r\n break;\r\n\r\n case EStatus.editando:\r\n this._editar();\r\n break;\r\n }\r\n }\r\n\r\n private _inserir(): void {\r\n this.setStatus(EStatus.salvando);\r\n this.setProgresso(true);\r\n this.servicoBind\r\n .criar()\r\n .pipe(\r\n finalize(() => {\r\n this._emitirEventoClick(EEventoClick.afterClickSalvar);\r\n }),\r\n )\r\n .subscribe(\r\n (success) => {\r\n this.setProgresso(false);\r\n\r\n this._snackBarService.abrirSnackBarSucesso(\r\n 'Registro salvo com sucesso!',\r\n );\r\n\r\n this.form.patchValue(success);\r\n\r\n this.setStatus(EStatus.dadosCarregados);\r\n\r\n this.drawer.close();\r\n\r\n this._databarService.desabilitarForm(this.form);\r\n },\r\n () => {\r\n this.setProgresso(false);\r\n this.setStatus(EStatus.inserindo);\r\n },\r\n );\r\n }\r\n\r\n private _editar(): void {\r\n this.setStatus(EStatus.salvando);\r\n this.setProgresso(true);\r\n this.servicoBind\r\n .editar()\r\n .pipe(\r\n finalize(() => {\r\n this._emitirEventoClick(EEventoClick.afterClickSalvar);\r\n }),\r\n )\r\n .subscribe(\r\n (success) => {\r\n this._snackBarService.abrirSnackBarSucesso(\r\n 'Registro editado com sucesso!',\r\n );\r\n\r\n this.form.patchValue(success);\r\n\r\n this.setProgresso(false);\r\n\r\n this.setStatus(EStatus.dadosCarregados);\r\n\r\n this._databarService.desabilitarForm(this.form);\r\n\r\n this.drawer.close();\r\n },\r\n () => {\r\n this.setProgresso(false);\r\n this.setStatus(EStatus.editando);\r\n },\r\n );\r\n }\r\n\r\n private observarSetStatus(): void {\r\n if ((this.servicoBind as IDatabarBindStatusService<T>).setStatus) {\r\n this.$setStatus = (\r\n this.servicoBind as IDatabarBindStatusService<T>\r\n ).setStatus.subscribe((status) => {\r\n switch (status) {\r\n case EStatus.editando:\r\n this.editar();\r\n this.emProgresso = false;\r\n break;\r\n case EStatus.inserindo:\r\n this.inserir();\r\n this.emProgresso = false;\r\n break;\r\n case EStatus.pesquisando:\r\n this.pesquisar();\r\n break;\r\n case EStatus.novaPesquisa:\r\n this.novaPesquisa();\r\n break;\r\n case EStatus.removendo:\r\n this.remover();\r\n break;\r\n case EStatus.dadosCarregados:\r\n this.status = EStatus.dadosCarregados;\r\n this.emProgresso = false;\r\n break;\r\n }\r\n });\r\n }\r\n }\r\n\r\n private retornarServicoReverter(): IDataBarReverterService<T> {\r\n if (this._servicoReverter == null)\r\n this._servicoReverter = new IcDatabarReverterService();\r\n\r\n return this._servicoReverter;\r\n }\r\n\r\n private _setDadosAnteriores(): void {\r\n this.retornarServicoReverter().setDadosAnteriores(\r\n this.status,\r\n this.form,\r\n this.entidadePaginada,\r\n );\r\n }\r\n\r\n private _reverter(): void {\r\n this._emitirEventoClick(EEventoClick.onClickReverter);\r\n this.entidadePaginada = this.retornarServicoReverter().restaurarDadosAnteriores(\r\n this.form,\r\n );\r\n const statusAnterior = this.retornarServicoReverter().statusAnterior;\r\n\r\n if (statusAnterior == EStatus.dadosCarregados)\r\n this._databarService.desabilitarForm(this.form);\r\n else this._databarService.habilitarForm(this.form);\r\n\r\n this.setStatus(statusAnterior);\r\n this._emitirEventoClick(EEventoClick.afterClickReverter);\r\n }\r\n\r\n private _resetarContadorPaginacao(): void {\r\n this.entidadePaginada.posicao = 0;\r\n this.entidadePaginada.total = 0;\r\n }\r\n\r\n private validarPropertsObrigatorias(): any {\r\n if (this.servicoBind == null) {\r\n throw new Error('É obrigatório ter um serviço de bind vinculado.');\r\n }\r\n\r\n if (this.entidadePaginada == null) {\r\n throw new Error('É obrigatório ter uma entidade paginada vinculada.');\r\n }\r\n }\r\n\r\n private setStatus(status: EStatus): void {\r\n if (!status) {\r\n return;\r\n }\r\n this.status = status;\r\n this.statusChanged.emit(this.status);\r\n }\r\n\r\n private _getEntidade(): T {\r\n const result = this.form.getRawValue() as T;\r\n return result;\r\n }\r\n\r\n private _submeterFormularioOnEnter(): void {\r\n if (!this.servicoBind.onClickEnter) return;\r\n this.servicoBind.onClickEnter.subscribe(() => {\r\n if (this.status === EStatus.novaPesquisa && this.form.valid) {\r\n this.pesquisar();\r\n }\r\n });\r\n }\r\n\r\n private _pesquisarPosicaoSelecionada(): void {\r\n if (!this.servicoBind.pesquisarPosicaoSelecionada) return;\r\n\r\n this.servicoBind.pesquisarPosicaoSelecionada.subscribe((entidadePaginada) => {\r\n if (this.status === EStatus.novaPesquisa && this.form.valid) {\r\n this.entidadePaginada = entidadePaginada;\r\n this._pesquisarSelecionado();\r\n }\r\n });\r\n }\r\n\r\n private _pesquisarSelecionado(): void {\r\n if (this.form.invalid) {\r\n return;\r\n }\r\n\r\n this._setDadosAnteriores();\r\n this.setStatus(EStatus.pesquisando);\r\n this._paginar('customizado');\r\n this.drawer.close();\r\n }\r\n\r\n private _clickInserir(): void {\r\n this._setDadosAnteriores();\r\n this._resetarContadorPaginacao();\r\n this._databarService.habilitarForm(this.form);\r\n this.form.reset({ emitEvent: false, onlySelf: true });\r\n this.form.markAllAsTouched();\r\n this.drawer.close();\r\n this.setStatus(EStatus.inserindo);\r\n }\r\n\r\n private _clickEditar(): void {\r\n this._setDadosAnteriores();\r\n this._databarService.habilitarForm(this.form);\r\n this.form.markAllAsTouched();\r\n this.drawer.close();\r\n this.setStatus(EStatus.editando);\r\n }\r\n\r\n private _clickClonar(): void {\r\n this._setDadosAnteriores();\r\n this._resetarContadorPaginacao();\r\n this._databarService.habilitarForm(this.form);\r\n this.form.markAllAsTouched();\r\n this.drawer.close();\r\n this.setStatus(EStatus.inserindo);\r\n }\r\n\r\n private _clickRemover(): void {\r\n this.setStatus(EStatus.removendo);\r\n this._exibirDialogConfirmacao();\r\n this.drawer.close();\r\n }\r\n\r\n private _emitirEventoClick(evento: EEventoClick): void {\r\n return this._databarService.emitirEventoClick<T>(\r\n this.servicoBind as IDatabarBindOnClickService<T>,\r\n evento,\r\n );\r\n }\r\n\r\n private _acaoCloseDialogConfirmacao(): void {\r\n this._dialog.emProgresso = false;\r\n this._dialog.closeDialog();\r\n this.setStatus(EStatus.dadosCarregados);\r\n }\r\n\r\n private _exibirDialogConfirmacao(): void {\r\n this._dialog.acaoMensagem = 'Removendo registro...';\r\n this._dialog.acaoOk = () =>\r\n this.servicoBind.remover().subscribe(\r\n () => {\r\n this._dialog.closeDialog();\r\n this.novaPesquisa();\r\n this._dialog.emProgresso = false;\r\n this._snackBarService.abrirSnackBarSucesso('Removido com sucesso!');\r\n },\r\n () => this._acaoCloseDialogConfirmacao(),\r\n );\r\n this._dialog.acaoCancelar = () => {\r\n this._acaoCloseDialogConfirmacao();\r\n };\r\n\r\n this._dialog.openDialog(\r\n 'Atenção!',\r\n 'Você realmente deseja excluir este registro?',\r\n );\r\n }\r\n\r\n private _exibirDialogConfirmacaoReverter(): void {\r\n this._dialog.acaoOk = () => {\r\n this._reverter();\r\n this._dialog.emProgresso = false;\r\n this._dialog.closeDialog();\r\n };\r\n\r\n this._dialog.acaoCancelar = () => {\r\n this._dialog.closeDialog();\r\n };\r\n\r\n this._dialog.openDialog(\r\n 'Atenção!',\r\n 'As alterações realizadas serão perdidas. Deseja continuar?',\r\n );\r\n }\r\n\r\n private _paginar(acao?: ACAO_PAGINACAO): void {\r\n this.setStatus(EStatus.pesquisando);\r\n\r\n if (this.entidadePaginada.entidade == null) {\r\n this.entidadePaginada.entidade = [].concat(this._getEntidade());\r\n }\r\n\r\n const posicaoAnterior = this.entidadePaginada.posicao;\r\n\r\n switch (acao) {\r\n case 'primeiro':\r\n this.entidadePaginada.posicao = 1;\r\n break;\r\n case 'ultimo':\r\n this.entidadePaginada.posicao = this.entidadePaginada.total;\r\n break;\r\n case 'proximo':\r\n this.entidadePaginada.posicao++;\r\n break;\r\n case 'anterior':\r\n this.entidadePaginada.posicao--;\r\n break;\r\n case 'customizado':\r\n break;\r\n default:\r\n this.entidadePaginada.posicao = 0;\r\n break;\r\n }\r\n\r\n this.setProgresso(true);\r\n\r\n this.servicoBind.listarPaginacao(this.entidadePaginada).subscribe(\r\n (success) => {\r\n this.setProgresso(false);\r\n\r\n if (success == null) {\r\n this._dialogErro.openDialog(\r\n 'Atenção!',\r\n 'Nenhum registro foi encontrado.',\r\n );\r\n this.setStatus(EStatus.novaPesquisa);\r\n return;\r\n }\r\n\r\n if (success.entidade == null) {\r\n this._databarService.resetForm(this.form, this.entidadePaginada);\r\n this.setStatus(EStatus.novaPesquisa);\r\n return;\r\n }\r\n\r\n this.setStatus(EStatus.dadosCarregados);\r\n\r\n if (!this.entidadePaginada.entidade) {\r\n this.entidadePaginada = success;\r\n } else {\r\n this.entidadePaginada.total = success.total;\r\n this.entidadePaginada.posicao = success.posicao;\r\n }\r\n\r\n this.form.patchValue(success.entidade[0]);\r\n\r\n this.setProgresso(false);\r\n\r\n this._databarService.desabilitarForm(this.form);\r\n },\r\n (error: HttpErrorResponse) => {\r\n if (error.status === 422) {\r\n this.setStatus(EStatus.novaPesquisa);\r\n } else {\r\n this.setStatus(EStatus.dadosCarregados);\r\n this.entidadePaginada.posicao = posicaoAnterior;\r\n this._databarService.desabilitarForm(this.form);\r\n }\r\n this.setProgresso(false);\r\n console.error('erro paginação', error);\r\n },\r\n );\r\n }\r\n\r\n private setProgresso(progresso: boolean): void {\r\n this.emProgresso = this._databarService.definirProgresso(this.form, progresso);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { ErrorDialogComponent } from './error-dialog.component';\r\n\r\n\r\n@NgModule({\r\n declarations: [ErrorDialogComponent],\r\n imports: [\r\n MatDialogModule\r\n ],\r\n exports: [ErrorDialogComponent],\r\n entryComponents: [ErrorDialogComponent]\r\n})\r\nexport class ErrorDialogModule { }\r\n","import { NgModule } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatSidenavModule } from '@angular/material/sidenav';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { FlexLayoutModule } from '@angular/flex-layout';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { IcConfirmaDialogModule } from '@inovamobil/ic-confirma-dialog';\r\nimport { DataBarComponent } from './ic-data-bar.component';\r\nimport { ErrorDialogModule } from '../components/dialogs/error-dialog/error-dialog.module';\r\nimport { DatabarService } from './services/ic-databar.service';\r\nimport { IcmSnackBarModule } from '@inovamobil/icm-snackbar';\r\n\r\n@NgModule({\r\n declarations: [DataBarComponent],\r\n imports: [\r\n CommonModule,\r\n MatToolbarModule,\r\n MatListModule,\r\n MatSidenavModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n MatDividerModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n FlexLayoutModule,\r\n IcConfirmaDialogModule,\r\n ErrorDialogModule,\r\n IcmSnackBarModule\r\n ],\r\n exports: [DataBarComponent],\r\n providers: [DatabarService]\r\n})\r\nexport class DataBarModule { }\r\n"]}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSURhdGFCYXJSZXZlcnRlclNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiQzovVXNlcnMvYnJlbmUvT25lRHJpdmUvRG9jdW1lbnRvcy9HaXRIdWIvYmlibGlvdGVjYS1hbmd1bGFyL3Byb2plY3RzL2ljLWRhdGFiYXItbGliL3NyYy8iLCJzb3VyY2VzIjpbImxpYi9jb250cmF0by9JRGF0YUJhclJldmVydGVyU2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRm9ybUdyb3VwIH0gZnJvbSAnQGFuZ3VsYXIvZm9ybXMnO1xyXG5cclxuaW1wb3J0IHsgRVN0YXR1cyB9IGZyb20gJy4uL2VudW0vZXN0YXR1cyc7XHJcbmltcG9ydCB7IElEYXRhRW50aWRhZGVQYWdpbmFkYSB9IGZyb20gJy4vSURh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GFkZVBhZ2luYWRhJztcclxuXHJcbmV4cG9ydCBpbnRlcmZhY2UgSURhdGFCYXJSZXZlcnRlclNlcnZpY2U8VD4ge1xyXG4gICAgc3RhdHVzQW50ZXJpb3I6IEVTdGF0dXM7XHJcbiAgICBzZXREYWRvc0FudGVyaW9yZXMoXHJcbiAgICAgICAgc3RhdHVzOiBFU3RhdHVzLFxyXG4gICAgICAgIGZvcm11bGFybzogRm9ybUdyb3VwLFxyXG4gICAgICAgIGVudGlkYWRlUGFnaW5hZGE6IElEYXRhRW50aWRhZGVQYWdpbmFkYTxUPixcclxuICAgICk6IHZvaWQ7XHJcbiAgICByZXN0YXVyYXJEYWRvc0FudGVyaW9yZXMoZm9ybXVsYXJpbzogRm9ybUdyb3VwKTogSURhdGFFbnRpZGFkZVBhZ2luYWRhPFQ+O1xyXG59XHJcbiJdfQ==
@@ -13,6 +13,7 @@ export var EEventoClick;
13
13
  EEventoClick["onClickSalvar"] = "onClickSalvar";
14
14
  EEventoClick["afterClickSalvar"] = "afterClickSalvar";
15
15
  EEventoClick["onClickModoTabela"] = "onClickModoTabela";
16
+ EEventoClick["onClickClonar"] = "onClickClonar";
16
17
  EEventoClick["afterClickClonar"] = "afterClickClonar";
17
18
  })(EEventoClick || (EEventoClick = {}));
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWV2ZW50b2NsaWNrLmpzIiwic291cmNlUm9vdCI6IkM6L1VzZXJzL2JyZW5lL09uZURyaXZlL0RvY3VtZW50b3MvR2l0SHViL2JpYmxpb3RlY2EtYW5ndWxhci9wcm9qZWN0cy9pYy1kYXRhYmFyLWxpYi9zcmMvIiwic291cmNlcyI6WyJsaWIvZW51bS9lZXZlbnRvY2xpY2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFOLElBQVksWUFlWDtBQWZELFdBQVksWUFBWTtJQUNwQiw0Q0FBNEIsQ0FBQTtJQUM1Qix1RE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