UNPKG

ngx-modialog-10

Version:
16 lines (14 loc) 3.77 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("ngx-modialog-10")):"function"==typeof define&&define.amd?define("ngxModialog.plugins.jsNative",["exports","@angular/core","ngx-modialog-10"],t):t(((e=e||self).ngxModialog=e.ngxModialog||{},e.ngxModialog.plugins=e.ngxModialog.plugins||{},e.ngxModialog.plugins.jsNative={}),e.ng.core,e.ngxModialog)}(this,(function(e,t,o){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};function r(e,t){function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var i=["promptDefault"],a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.normalize=function(){this.message||(this.message=""),void 0===this.dialogType&&(this.dialogType=o.DROP_IN_TYPE.alert)},t}(o.ModalOpenContext);var u=function(e){function t(t,n,r){return void 0===t&&(t=void 0),void 0===n&&(n=void 0),void 0===r&&(r=void 0),e.call(this,t||{},o.arrayUnion(i,n||[]),r||a)||this}return r(t,e),t}(o.ModalOpenContextBuilder);var s=function(){function e(){}return e.prototype.render=function(e,t){var n;switch(e.context.dialogType){case o.DROP_IN_TYPE.alert:window.alert(e.context.message),n=!0;break;case o.DROP_IN_TYPE.prompt:n=window.prompt(e.context.message,e.context.promptDefault);break;case o.DROP_IN_TYPE.confirm:n=window.confirm(e.context.message)}return e.destroy=function(){},!1===n?e.dismiss():e.close(n),{}},e.decorators=[{type:t.Injectable}],e}(),c=function(e){function t(t,o){return e.call(this,{modal:t,dialogType:o})||this}return r(t,e),t.prototype.open=function(e){var t=this.toJSON();if(!(t.modal instanceof p))return Promise.reject(new Error("Configuration Error: modal service not set."));this.$$beforeOpen(t);var o={context:t,renderer:new s,viewContainer:e};return t.modal.open(t.component,o)},t}(u),p=function(e){function n(t){return e.call(this,t)||this}return r(n,e),n.prototype.alert=function(){return new c(this,o.DROP_IN_TYPE.alert)},n.prototype.prompt=function(){return new c(this,o.DROP_IN_TYPE.prompt)},n.prototype.confirm=function(){return new c(this,o.DROP_IN_TYPE.confirm)},n.prototype.create=function(e,t){return e},n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[{type:o.Overlay}]},n}(o.Modal),l=[{provide:o.Modal,useClass:p},{provide:p,useClass:p}],d=function(){function e(){}return e.getProviders=function(){return l},e.decorators=[{type:t.NgModule,args:[{providers:l}]}],e}();e.JSNativeModalContext=a,e.JSNativeModalContextBuilder=u,e.JSNativeModalModule=d,e.JSNativeModalRenderer=s,e.JSNativePresetBuilder=c,e.Modal=p,e.providers=l,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=ngx-modialog-10-plugins-js-native.umd.min.js.map