UNPKG

4.23 kBJavaScriptView Raw
1!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/core"),require("lodash"),require("sweetalert2"),require("ng-snotify"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","lodash","sweetalert2","ng-snotify","@angular/common"],o):o((t["ngx-plus"]=t["ngx-plus"]||{},t["ngx-plus"]["ngx-alerts"]={}),t.ng.core,t.lodash,t.swal,t.ngSnotify,t.ng.common)}(this,function(t,o,n,e,r,i){"use strict";function s(t,o){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,i=n.call(t),s=[];try{for(;(void 0===o||o-- >0)&&!(e=i.next()).done;)s.push(e.value)}catch(u){r={error:u}}finally{try{e&&!e.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return s}function u(){for(var t=[],o=0;o<arguments.length;o++)t=t.concat(s(arguments[o]));return t}e=e&&e.hasOwnProperty("default")?e["default"]:e;var a=function(){return function(){}}();a.decorators=[{type:o.Component,args:[{selector:"ngx-alert-templates",template:"\n <ng-snotify></ng-snotify>\n "}]}],a.ctorParameters=function(){return[]};var l=function(){return function(){}}(),f=function(){function t(t){this.notifyService=t}return t.prototype.defaultNotify=function(t,o){return this.notifyService[t](o.body,o.title||null,{timeout:o.timeout||3e3,showProgressBar:o.showProgressBar||!0,closeOnClick:o.closeOnClick||!0,pauseOnHover:o.pauseOnHover||!0,buttons:o.buttons,placeholder:o.placeholder,html:o.html||null,position:o.position||"rightBottom"})},t.prototype.notifySimple=function(t){this.defaultNotify("simple",t)},t.prototype.notifySuccess=function(t){this.defaultNotify("success",t)},t.prototype.notifyInfo=function(t){this.defaultNotify("info",t)},t.prototype.notifyWarning=function(t){this.defaultNotify("warning",t)},t.prototype.notifyError=function(t){this.defaultNotify("error",t)},t.prototype.notifyPrompt=function(t){this.defaultNotify("prompt",t)},t.prototype.notifyConfirm=function(t){this.defaultNotify("confirm",t)},t.prototype.notifyDismiss=function(t){this.notifyService.remove(t)},t.prototype.alert=function(t,o,r){void 0===t&&(t={}),void 0===o&&(o=n.noop),void 0===r&&(r=n.noop);var i={type:t.type||null,title:t.title||null,text:t.text||null,buttonsStyling:t.buttonsStyling||!1,confirmButtonClass:t.confirmButtonClass||"btn btn-lg btn-secondary",animation:t.animation||!0,customClass:t.customClass||""};return r!==n.noop&&(i.showCancelButton=t.showCancelButton||!0,i.cancelButtonClass=t.cancelButtonClass||"btn btn-lg btn-secondary"),e(n.assign(i,t)).then(function(t){return o(t)},function(t){return r(t)})},t.prototype.alertSuccess=function(t,o,e){void 0===t&&(t={}),void 0===o&&(o=n.noop),void 0===e&&(e=n.noop);return this.alert(n.assign({type:"success",confirmButtonClass:"btn btn-lg btn-success"},t),o,e)},t.prototype.alertWarning=function(t,o,e){void 0===t&&(t={}),void 0===o&&(o=n.noop),void 0===e&&(e=n.noop);return this.alert(n.assign({type:"warning",confirmButtonClass:"btn btn-lg btn-warning"},t),o,e)},t.prototype.alertError=function(t,o,e){void 0===t&&(t={}),void 0===o&&(o=n.noop),void 0===e&&(e=n.noop);return this.alert(n.assign({type:"error",confirmButtonClass:"btn btn-lg btn-danger"},t),o,e)},t.prototype.alertInfo=function(t,o,e){void 0===t&&(t={}),void 0===o&&(o=n.noop),void 0===e&&(e=n.noop);return this.alert(n.assign({type:"info",confirmButtonClass:"btn btn-lg btn-info"},t),o,e)},t.prototype.alertQuestion=function(t,o,e){void 0===t&&(t={}),void 0===o&&(o=n.noop),void 0===e&&(e=n.noop);return this.alert(n.assign({type:"question",confirmButtonClass:"btn btn-lg btn-primary"},t),o,e)},t}();f.decorators=[{type:o.Injectable}],f.ctorParameters=function(){return[{type:r.SnotifyService}]};var c=[a],p=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[{provide:"SnotifyToastConfig",useValue:r.ToastDefaults},r.SnotifyService,f]}},t}();p.decorators=[{type:o.NgModule,args:[{imports:[i.CommonModule,r.SnotifyModule],declarations:u(c),exports:u(c)}]}],p.ctorParameters=function(){return[]},t.NgxAlertTemplatesComponent=a,t.NgxAlertInterfaces=l,t.NgxAlertsService=f,t.NgxAlertsModule=p,Object.defineProperty(t,"__esModule",{value:!0})});
2//# sourceMappingURL=ngx-plus-ngx-alerts.umd.min.js.map