@neocomplexx/ngx-neo-modal-mat
Version:
16 lines (14 loc) • 24.9 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/dialog"),require("@angular/common"),require("@angular/forms"),require("@angular/material/form-field"),require("@angular/material/input"),require("@angular/material/button"),require("@ngx-translate/core")):"function"==typeof define&&define.amd?define("@neocomplexx/ngx-neo-modal-mat",["exports","@angular/core","@angular/material/dialog","@angular/common","@angular/forms","@angular/material/form-field","@angular/material/input","@angular/material/button","@ngx-translate/core"],e):e(((t=t||self).neocomplexx=t.neocomplexx||{},t.neocomplexx["ngx-neo-modal-mat"]={}),t.ng.core,t.ng.material.dialog,t.ng.common,t.ng.forms,t.ng.material.formField,t.ng.material.input,t.ng.material.button,t.core$1)}(this,(function(t,e,n,o,i,r,a,s,c){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function l(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{c(o.next(t))}catch(t){r(t)}}function s(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))}function u(t,e){var n,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,o=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(6===r[0]&&a.label<i[1]){a.label=i[1],i=r;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}var d=["buttons"],m=["myInput"];function g(t,n){1&t&&(e.ɵɵelementStart(0,"div",16),e.ɵɵelement(1,"div",17),e.ɵɵelement(2,"span",18),e.ɵɵelement(3,"span",19),e.ɵɵelement(4,"div",20),e.ɵɵelement(5,"div",21),e.ɵɵelement(6,"div",22),e.ɵɵelementEnd())}function w(t,n){1&t&&(e.ɵɵelementStart(0,"div",23),e.ɵɵelementStart(1,"span",24),e.ɵɵelement(2,"span",25),e.ɵɵelement(3,"span",26),e.ɵɵelementEnd(),e.ɵɵelementEnd())}function h(t,n){1&t&&(e.ɵɵelementStart(0,"div",27),e.ɵɵtext(1,"!"),e.ɵɵelementEnd())}function y(t,n){1&t&&(e.ɵɵelementStart(0,"div",28),e.ɵɵtext(1,"i"),e.ɵɵelementEnd())}function x(t,n){1&t&&(e.ɵɵelementStart(0,"div",29),e.ɵɵtext(1,"?"),e.ɵɵelementEnd())}function b(t,n){if(1&t&&(e.ɵɵelementStart(0,"h4"),e.ɵɵtext(1),e.ɵɵelementEnd()),2&t){var o=e.ɵɵnextContext();e.ɵɵadvance(1),e.ɵɵtextInterpolate(o.config.title.text)}}function v(t,n){if(1&t){var o=e.ɵɵgetCurrentView();e.ɵɵelementStart(0,"form",30),e.ɵɵelementStart(1,"mat-form-field",30),e.ɵɵelementStart(2,"input",31,32),e.ɵɵlistener("ngModelChange",(function(t){return e.ɵɵrestoreView(o),e.ɵɵnextContext().config.input.value=t}))("keyup.enter",(function(){return e.ɵɵrestoreView(o),e.ɵɵnextContext().setFocus()})),e.ɵɵelementEnd(),e.ɵɵelementEnd(),e.ɵɵelementEnd()}if(2&t){var i=e.ɵɵnextContext();e.ɵɵadvance(2),e.ɵɵpropertyInterpolate("placeholder",i.config.input.placeholder),e.ɵɵproperty("ngModel",i.config.input.value)}}function M(t,n){if(1&t){var o=e.ɵɵgetCurrentView();e.ɵɵelementStart(0,"button",33),e.ɵɵlistener("click",(function(){return e.ɵɵrestoreView(o),e.ɵɵnextContext().informResult("Accept")})),e.ɵɵtext(1),e.ɵɵpipe(2,"translate"),e.ɵɵelementEnd()}2&t&&(e.ɵɵadvance(1),e.ɵɵtextInterpolate(e.ɵɵpipeBind1(2,1,"BTNACCEPT")))}function C(t,n){if(1&t){var o=e.ɵɵgetCurrentView();e.ɵɵelementStart(0,"button",34),e.ɵɵlistener("click",(function(){return e.ɵɵrestoreView(o),e.ɵɵnextContext().informResult("Cancel")})),e.ɵɵtext(1),e.ɵɵpipe(2,"translate"),e.ɵɵelementEnd()}2&t&&(e.ɵɵadvance(1),e.ɵɵtextInterpolate(e.ɵɵpipeBind1(2,1,"BTNCANCEL")))}function k(t,n){if(1&t){var o=e.ɵɵgetCurrentView();e.ɵɵelementStart(0,"button",35),e.ɵɵlistener("click",(function(){return e.ɵɵrestoreView(o),e.ɵɵnextContext().informResult("Yes")})),e.ɵɵtext(1),e.ɵɵpipe(2,"translate"),e.ɵɵelementEnd()}2&t&&(e.ɵɵadvance(1),e.ɵɵtextInterpolate(e.ɵɵpipeBind1(2,1,"BTNYES")))}function A(t,n){if(1&t){var o=e.ɵɵgetCurrentView();e.ɵɵelementStart(0,"button",36),e.ɵɵlistener("click",(function(){return e.ɵɵrestoreView(o),e.ɵɵnextContext().informResult("Retry")})),e.ɵɵtext(1),e.ɵɵpipe(2,"translate"),e.ɵɵelementEnd()}2&t&&(e.ɵɵadvance(1),e.ɵɵtextInterpolate(e.ɵɵpipeBind1(2,1,"BTNRETR")))}function O(t,n){if(1&t){var o=e.ɵɵgetCurrentView();e.ɵɵelementStart(0,"button",37),e.ɵɵlistener("click",(function(){return e.ɵɵrestoreView(o),e.ɵɵnextContext().informResult("No")})),e.ɵɵtext(1),e.ɵɵpipe(2,"translate"),e.ɵɵelementEnd()}2&t&&(e.ɵɵadvance(1),e.ɵɵtextInterpolate(e.ɵɵpipeBind1(2,1,"BTNO")))}var I,P=function(){function l(t,e){this.data=t,this.activeModal=e,this.config={title:{visibility:!0,text:"This is a title"},message:"This is a message",type:null,input:{visibility:!1,placeholder:"Ingrese su texto aquí",value:null,autofocus:!1,id:"neoInput"},button:{yes:{visibility:!1,autofocus:!1,text:"Si",id:"neoBtnYes"},no:{visibility:!1,autofocus:!1,text:"No",id:"neoBtnNo"},retry:{visibility:!1,autofocus:!1,text:"Reintentar",id:"neoBtnRetry"},cancel:{visibility:!0,autofocus:!1,text:"Cancelar",id:"neoBtnCancel"},accept:{visibility:!0,autofocus:!0,text:"Aceptar",id:"neoBtnAccept"}}},this.mergeDeep(this.config,t.config)}return l.prototype.ngOnInit=function(){},l.prototype.isObject=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},l.prototype.mergeDeep=function(t){for(var e,n,o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];if(!o.length)return t;var r=o.shift();if(this.isObject(t)&&this.isObject(r))for(var a in r)this.isObject(r[a])?(t[a]||Object.assign(t,((e={})[a]={},e)),this.mergeDeep(t[a],r[a])):Object.assign(t,((n={})[a]=r[a],n));return this.mergeDeep.apply(this,f([t],o))},l.prototype.activeFocus=function(t){void 0===t&&(t=!0);var e=this.getButtonFocus();if(!this.getInputFocus()||!t||e&&"neoBtnAccept"!==e){if(e){var n=this.btn.nativeElement.children.namedItem(e);n&&n.focus()}}else this.input.nativeElement.focus()},l.prototype.getButtonFocus=function(){var t=this,e=Object.keys(this.config.button).find((function(e){return t.config.button[e].visibility&&t.config.button[e].autofocus}));return e?this.config.button[e].id:null},l.prototype.getInputFocus=function(){return this.config.input.visibility&&this.config.input.autofocus?this.config.input.id:null},l.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){return t.activeFocus()}),0)},l.prototype.informResult=function(e){var n=t.AlertButton[e],o=new B(n,this.config.input.value);this.activeModal.close(o)},l.prototype.setFocus=function(){this.activeFocus(!1)},l.ɵfac=function(t){return new(t||l)(e.ɵɵdirectiveInject(n.MAT_DIALOG_DATA),e.ɵɵdirectiveInject(n.MatDialogRef))},l.ɵcmp=e.ɵɵdefineComponent({type:l,selectors:[["lib-ngx-neo-modal-mat"]],viewQuery:function(t,n){var o;(1&t&&(e.ɵɵstaticViewQuery(d,!0),e.ɵɵviewQuery(m,!0)),2&t)&&(e.ɵɵqueryRefresh(o=e.ɵɵloadQuery())&&(n.btn=o.first),e.ɵɵqueryRefresh(o=e.ɵɵloadQuery())&&(n.input=o.first))},decls:18,vars:13,consts:[["mat-dialog-content","",1,"text-center","mat-modal"],[1,"icons"],["class","swal2-icon swal2-success swal2-animate-success-icon",4,"ngIf"],["class","swal2-icon swal2-error swal2-animate-error-icon",4,"ngIf"],["class","swal2-icon swal2-warning",4,"ngIf"],["class","swal2-icon swal2-info",4,"ngIf"],["class","swal2-icon swal2-question",4,"ngIf"],[4,"ngIf"],["class","full-width",4,"ngIf"],["align","end"],["buttons",""],["mat-raised-button","","color","primary","id","neoBtnAccept","type","button",3,"click",4,"ngIf"],["mat-raised-button","","color","primary","id","neoBtnCancel","type","button",3,"click",4,"ngIf"],["mat-raised-button","","color","primary","id","neoBtnYes","type","button",3,"click",4,"ngIf"],["mat-raised-button","","color","primary","id","neoBtnRetry","type","button",3,"click",4,"ngIf"],["mat-raised-button","","color","primary","id","neoBtnNo","type","button",3,"click",4,"ngIf"],[1,"swal2-icon","swal2-success","swal2-animate-success-icon"],[1,"swal2-success-circular-line-left"],[1,"swal2-success-line-tip","swal2-animate-success-line-tip"],[1,"swal2-success-line-long","swal2-animate-success-line-long"],[1,"swal2-success-ring"],[1,"swal2-success-fix"],[1,"swal2-success-circular-line-right"],[1,"swal2-icon","swal2-error","swal2-animate-error-icon"],[1,"swal2-x-mark","swal2-animate-x-mark"],[1,"swal2-x-mark-line-left"],[1,"swal2-x-mark-line-right"],[1,"swal2-icon","swal2-warning"],[1,"swal2-icon","swal2-info"],[1,"swal2-icon","swal2-question"],[1,"full-width"],["name","inputModal","matInput","","id","neoInput","type","text",3,"ngModel","placeholder","ngModelChange","keyup.enter"],["myInput",""],["mat-raised-button","","color","primary","id","neoBtnAccept","type","button",3,"click"],["mat-raised-button","","color","primary","id","neoBtnCancel","type","button",3,"click"],["mat-raised-button","","color","primary","id","neoBtnYes","type","button",3,"click"],["mat-raised-button","","color","primary","id","neoBtnRetry","type","button",3,"click"],["mat-raised-button","","color","primary","id","neoBtnNo","type","button",3,"click"]],template:function(t,n){1&t&&(e.ɵɵelementStart(0,"div",0),e.ɵɵelementStart(1,"div",1),e.ɵɵtemplate(2,g,7,0,"div",2),e.ɵɵtemplate(3,w,4,0,"div",3),e.ɵɵtemplate(4,h,2,0,"div",4),e.ɵɵtemplate(5,y,2,0,"div",5),e.ɵɵtemplate(6,x,2,0,"div",6),e.ɵɵelementEnd(),e.ɵɵtemplate(7,b,2,1,"h4",7),e.ɵɵelementStart(8,"p"),e.ɵɵtext(9),e.ɵɵelementEnd(),e.ɵɵtemplate(10,v,4,2,"form",8),e.ɵɵelementEnd(),e.ɵɵelementStart(11,"mat-dialog-actions",9,10),e.ɵɵtemplate(13,M,3,3,"button",11),e.ɵɵtemplate(14,C,3,3,"button",12),e.ɵɵtemplate(15,k,3,3,"button",13),e.ɵɵtemplate(16,A,3,3,"button",14),e.ɵɵtemplate(17,O,3,3,"button",15),e.ɵɵelementEnd()),2&t&&(e.ɵɵadvance(2),e.ɵɵproperty("ngIf","success"===n.config.type),e.ɵɵadvance(1),e.ɵɵproperty("ngIf","error"===n.config.type),e.ɵɵadvance(1),e.ɵɵproperty("ngIf","warning"===n.config.type),e.ɵɵadvance(1),e.ɵɵproperty("ngIf","info"===n.config.type),e.ɵɵadvance(1),e.ɵɵproperty("ngIf","question"===n.config.type),e.ɵɵadvance(1),e.ɵɵproperty("ngIf",n.config.title.visibility),e.ɵɵadvance(2),e.ɵɵtextInterpolate(n.config.message),e.ɵɵadvance(1),e.ɵɵproperty("ngIf",n.config.input.visibility),e.ɵɵadvance(3),e.ɵɵproperty("ngIf",n.config.button.accept.visibility),e.ɵɵadvance(1),e.ɵɵproperty("ngIf",n.config.button.cancel.visibility),e.ɵɵadvance(1),e.ɵɵproperty("ngIf",n.config.button.yes.visibility),e.ɵɵadvance(1),e.ɵɵproperty("ngIf",n.config.button.retry.visibility),e.ɵɵadvance(1),e.ɵɵproperty("ngIf",n.config.button.no.visibility))},directives:[n.MatDialogContent,o.NgIf,n.MatDialogActions,i.ɵangular_packages_forms_forms_y,i.NgControlStatusGroup,i.NgForm,r.MatFormField,a.MatInput,i.DefaultValueAccessor,i.NgControlStatus,i.NgModel,s.MatButton],pipes:[c.TranslatePipe],styles:['.modal-footer[_ngcontent-%COMP%], .modal-header[_ngcontent-%COMP%]{border:0}@-webkit-keyframes showSweetAlert{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes showSweetAlert{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes hideSweetAlert{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes hideSweetAlert{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}.swal2-show[_ngcontent-%COMP%]{-webkit-animation:.3s showSweetAlert;animation:.3s showSweetAlert}.swal2-show.swal2-noanimation[_ngcontent-%COMP%]{-webkit-animation:none;animation:none}.swal2-hide[_ngcontent-%COMP%]{-webkit-animation:.15s forwards hideSweetAlert;animation:.15s forwards hideSweetAlert}.swal2-hide.swal2-noanimation[_ngcontent-%COMP%]{-webkit-animation:none;animation:none}@-webkit-keyframes animate-success-tip{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}100%{width:25px;left:14px;top:45px}}@keyframes animate-success-tip{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}100%{width:25px;left:14px;top:45px}}@-webkit-keyframes animate-success-long{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}100%{width:47px;right:8px;top:38px}}@keyframes animate-success-long{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}100%{width:47px;right:8px;top:38px}}@-webkit-keyframes rotatePlaceholder{0%,5%{transform:rotate(-45deg)}100%,12%{transform:rotate(-405deg)}}@keyframes rotatePlaceholder{0%,5%{transform:rotate(-45deg)}100%,12%{transform:rotate(-405deg)}}.swal2-animate-success-line-tip[_ngcontent-%COMP%]{-webkit-animation:.75s animate-success-tip;animation:.75s animate-success-tip}.swal2-animate-success-line-long[_ngcontent-%COMP%]{-webkit-animation:.75s animate-success-long;animation:.75s animate-success-long}@-webkit-keyframes animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}.swal2-animate-error-icon[_ngcontent-%COMP%]{-webkit-animation:.5s animate-error-icon;animation:.5s animate-error-icon}@-webkit-keyframes animate-x-mark{0%,50%{transform:scale(.4);margin-top:26px;opacity:0}80%{transform:scale(1.15);margin-top:-6px}100%{transform:scale(1);margin-top:0;opacity:1}}@keyframes animate-x-mark{0%,50%{transform:scale(.4);margin-top:26px;opacity:0}80%{transform:scale(1.15);margin-top:-6px}100%{transform:scale(1);margin-top:0;opacity:1}}.swal2-animate-x-mark[_ngcontent-%COMP%]{-webkit-animation:.5s animate-x-mark;animation:.5s animate-x-mark}@-webkit-keyframes rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.swal2-success.swal2-animate-success-icon[_ngcontent-%COMP%] .swal2-success-circular-line-right[_ngcontent-%COMP%]{-webkit-animation:4.25s ease-in rotatePlaceholder;animation:4.25s ease-in rotatePlaceholder}.swal2-icon[_ngcontent-%COMP%]{width:80px;height:80px;border:4px solid transparent;border-radius:50%;margin:20px auto 30px;padding:0;position:relative;box-sizing:content-box;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon.swal2-error[_ngcontent-%COMP%]{border-color:#f27474}.swal2-icon.swal2-error[_ngcontent-%COMP%] .swal2-x-mark[_ngcontent-%COMP%]{position:relative;display:block}.swal2-icon.swal2-error[_ngcontent-%COMP%] [class^=swal2-x-mark-line][_ngcontent-%COMP%]{position:absolute;height:5px;width:47px;background-color:#f27474;display:block;top:37px;border-radius:2px}.swal2-icon.swal2-error[_ngcontent-%COMP%] [class^=swal2-x-mark-line][class$=left][_ngcontent-%COMP%]{transform:rotate(45deg);left:17px}.swal2-icon.swal2-error[_ngcontent-%COMP%] [class^=swal2-x-mark-line][class$=right][_ngcontent-%COMP%]{transform:rotate(-45deg);right:16px}.swal2-icon.swal2-warning[_ngcontent-%COMP%]{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:#f8bb86;border-color:#facea8;font-size:60px;line-height:80px;text-align:center}.swal2-icon.swal2-info[_ngcontent-%COMP%]{font-family:"Open Sans",sans-serif;color:#3fc3ee;border-color:#9de0f6;font-size:60px;line-height:80px;text-align:center}.swal2-icon.swal2-question[_ngcontent-%COMP%]{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:#87adbd;border-color:#c9dae1;font-size:60px;line-height:80px;text-align:center}.swal2-icon.swal2-success[_ngcontent-%COMP%]{border-color:#a5dc86}.swal2-icon.swal2-success[_ngcontent-%COMP%] [class^=swal2-success-circular-line][_ngcontent-%COMP%]{border-radius:50%;position:absolute;width:60px;height:120px;transform:rotate(45deg)}.swal2-icon.swal2-success[_ngcontent-%COMP%] [class^=swal2-success-circular-line][class$=left][_ngcontent-%COMP%]{border-radius:120px 0 0 120px;top:-7px;left:-33px;transform:rotate(-45deg);transform-origin:60px 60px}.swal2-icon.swal2-success[_ngcontent-%COMP%] [class^=swal2-success-circular-line][class$=right][_ngcontent-%COMP%]{border-radius:0 120px 120px 0;top:-11px;left:30px;transform:rotate(-45deg);transform-origin:0 60px}.swal2-icon.swal2-success[_ngcontent-%COMP%] .swal2-success-ring[_ngcontent-%COMP%]{width:80px;height:80px;border:4px solid rgba(165,220,134,.2);border-radius:50%;box-sizing:content-box;position:absolute;left:-4px;top:-4px;z-index:2}.swal2-icon.swal2-success[_ngcontent-%COMP%] .swal2-success-fix[_ngcontent-%COMP%]{width:7px;height:90px;position:absolute;left:28px;top:8px;z-index:1;transform:rotate(-45deg)}.swal2-icon.swal2-success[_ngcontent-%COMP%] [class^=swal2-success-line][_ngcontent-%COMP%]{height:5px;background-color:#a5dc86;display:block;border-radius:2px;position:absolute;z-index:2}.swal2-icon.swal2-success[_ngcontent-%COMP%] [class^=swal2-success-line][class$=tip][_ngcontent-%COMP%]{width:25px;left:14px;top:46px;transform:rotate(45deg)}.swal2-icon.swal2-success[_ngcontent-%COMP%] [class^=swal2-success-line][class$=long][_ngcontent-%COMP%]{width:47px;right:8px;top:38px;transform:rotate(-45deg)}.full-width[_ngcontent-%COMP%]{width:100%}.text-center[_ngcontent-%COMP%]{text-align:center}']}),l}(),B=function(t,e){this.ButtonResponse=t,this.messageInput=e};(I=t.AlertButton||(t.AlertButton={}))[I.None=0]="None",I[I.Accept=1]="Accept",I[I.Cancel=2]="Cancel",I[I.Yes=4]="Yes",I[I.No=8]="No",I[I.Retry=16]="Retry";var _=function(){function o(t,e){var n=this;this.dialog=t,this.translate=e,this.originalAlert=window.alert,window.alert=function(t){return l(n,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.alert(t)];case 1:return e.sent(),[2]}}))}))}}return o.prototype.openModal=function(t){return l(this,void 0,void 0,(function(){return u(this,(function(e){return[2,this.dialog.open(P,{data:{config:t}}).afterClosed().toPromise()]}))}))},o.prototype.alert=function(t,e){return void 0===e&&(e=!1),l(this,void 0,void 0,(function(){var n;return u(this,(function(o){switch(o.label){case 0:return n={title:{visibility:!1},message:t,button:{cancel:{visibility:!1},accept:{autofocus:e}}},[4,this.openModal(n)];case 1:return o.sent(),[2]}}))}))},o.prototype.success=function(t,e){return void 0===e&&(e=!0),l(this,void 0,void 0,(function(){var n,o;return u(this,(function(i){switch(i.label){case 0:return[4,this.translate.get("SUCCESSTITLE").toPromise()];case 1:return n=i.sent(),o={title:{text:n},message:t,type:"success",button:{cancel:{visibility:!1},accept:{autofocus:e}}},[2,this.openModal(o)]}}))}))},o.prototype.warning=function(t,e){return void 0===e&&(e=!1),l(this,void 0,void 0,(function(){var n,o;return u(this,(function(i){switch(i.label){case 0:return[4,this.translate.get("WARNTITLE").toPromise()];case 1:return n=i.sent(),o={title:{text:n},message:t,type:"warning",button:{cancel:{visibility:!1},accept:{autofocus:e}}},[2,this.openModal(o)]}}))}))},o.prototype.error=function(t,e){return void 0===e&&(e=!0),l(this,void 0,void 0,(function(){var n,o;return u(this,(function(i){switch(i.label){case 0:return[4,this.translate.get("ERRORTITLE").toPromise()];case 1:return n=i.sent(),o={title:{text:n},message:t,type:"error",button:{cancel:{visibility:!1},accept:{autofocus:e}}},[2,this.openModal(o)]}}))}))},o.prototype.info=function(t,e){return void 0===e&&(e=!0),l(this,void 0,void 0,(function(){var n,o;return u(this,(function(i){switch(i.label){case 0:return[4,this.translate.get("INFOTITLE").toPromise()];case 1:return n=i.sent(),o={title:{text:n},message:t,type:"info",button:{cancel:{visibility:!1},accept:{autofocus:e}}},[2,this.openModal(o)]}}))}))},o.prototype.decision=function(e,n,o,i){return void 0===i&&(i=t.AlertButton.Cancel),l(this,void 0,void 0,(function(){var r,a,s,c,l=this;return u(this,(function(u){switch(u.label){case 0:return r=i===t.AlertButton.Accept,a=i===t.AlertButton.Cancel,[4,this.translate.get("DECISIONTITLE").toPromise()];case 1:return s=u.sent(),c={title:{text:s},message:e,type:"question",button:{cancel:{autofocus:a},accept:{autofocus:r}}},[2,this.openModal(c).then((function(e){return e.ButtonResponse===t.AlertButton.Accept?n&&""!==n&&l.success(n):o&&l.info(o),Promise.resolve(e)}))]}}))}))},o.prototype.input=function(e,n,o,i,r){return void 0===i&&(i=!0),void 0===r&&(r=t.AlertButton.Accept),l(this,void 0,void 0,(function(){var a,s,c,l=this;return u(this,(function(u){return a=r===t.AlertButton.Accept,s=r===t.AlertButton.Cancel,c={title:{text:e},message:"",input:{placeholder:n,visibility:!0,autofocus:i},button:{accepct:{autofocus:a},cancel:{autofocus:s}}},[2,this.openModal(c).then((function(e){return e.ButtonResponse===t.AlertButton.Accept&&o&&l.success(o),Promise.resolve(e)}))]}))}))},o.prototype.yesNoCancel=function(e,n,o){return l(this,void 0,void 0,(function(){return u(this,(function(i){return[2,this.custom(e,n,t.AlertButton.Yes|t.AlertButton.No|t.AlertButton.Cancel,o)]}))}))},o.prototype.custom=function(e,n,o,i){return l(this,void 0,void 0,(function(){var r,a,s,c,l,p,f,d,m,g,w;return u(this,(function(u){return r=(o&t.AlertButton.Accept)>0,a=(o&t.AlertButton.Yes)>0,s=(o&t.AlertButton.Cancel)>0,c=(o&t.AlertButton.No)>0,l=(o&t.AlertButton.Retry)>0,p=i===t.AlertButton.Accept,f=i===t.AlertButton.Yes,d=i===t.AlertButton.Cancel,m=i===t.AlertButton.No,g=i===t.AlertButton.Retry,w={title:{text:e},message:n,button:{yes:{visibility:a,autofocus:f},no:{visibility:c,autofocus:m},retry:{visibility:l,autofocus:g},cancel:{visibility:s,autofocus:d},accept:{visibility:r,autofocus:p}}},[2,this.openModal(w)]}))}))},o.prototype.isObject=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},o.prototype.mergeDeep=function(t){for(var e,n,o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];if(!o.length)return t;var r=o.shift();if(this.isObject(t)&&this.isObject(r))for(var a in r)this.isObject(r[a])?(t[a]||Object.assign(t,((e={})[a]={},e)),this.mergeDeep(t[a],r[a])):Object.assign(t,((n={})[a]=r[a],n));return this.mergeDeep.apply(this,f([t],o))},o.ɵfac=function(t){return new(t||o)(e.ɵɵinject(n.MatDialog),e.ɵɵinject(c.TranslateService))},o.ɵprov=e.ɵɵdefineInjectable({token:o,factory:o.ɵfac,providedIn:"root"}),o}(),S=function(){function t(){}return t.ɵmod=e.ɵɵdefineNgModule({type:t}),t.ɵinj=e.ɵɵdefineInjector({factory:function(e){return new(e||t)},providers:[{provide:n.MAT_DIALOG_DEFAULT_OPTIONS,useValue:{disableClose:!0,hasBackdrop:!0}}],imports:[[o.CommonModule,n.MatDialogModule,s.MatButtonModule,a.MatInputModule,i.FormsModule,c.TranslateModule.forChild({extend:!0})]]}),t}();("undefined"==typeof ngJitMode||ngJitMode)&&e.ɵɵsetNgModuleScope(S,{declarations:[P],imports:[o.CommonModule,n.MatDialogModule,s.MatButtonModule,a.MatInputModule,i.FormsModule,c.TranslateModule],exports:[P]}),t.AlertResult=B,t.NgxNeoModalMatComponent=P,t.NgxNeoModalMatModule=S,t.NgxNeoModalMatService=_,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=neocomplexx-ngx-neo-modal-mat.umd.min.js.map