ngx-modialog-11
Version:
Modal / Dialog for Angular
16 lines (14 loc) • 3.81 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("ngx-modialog-11")):"function"==typeof define&&define.amd?define("ngxModialog.plugins.jsNative",["exports","@angular/core","ngx-modialog-11"],t):t(((e="undefined"!=typeof globalThis?globalThis: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),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),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}();s.decorators=[{type:t.Injectable}];var 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 l))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),l=function(e){function t(t){return e.call(this,t)||this}return r(t,e),t.prototype.alert=function(){return new c(this,o.DROP_IN_TYPE.alert)},t.prototype.prompt=function(){return new c(this,o.DROP_IN_TYPE.prompt)},t.prototype.confirm=function(){return new c(this,o.DROP_IN_TYPE.confirm)},t.prototype.create=function(e,t){return e},t}(o.Modal);l.decorators=[{type:t.Injectable}],l.ctorParameters=function(){return[{type:o.Overlay}]};var p=[{provide:o.Modal,useClass:l},{provide:l,useClass:l}],d=function(){function e(){}return e.getProviders=function(){return p},e}();d.decorators=[{type:t.NgModule,args:[{providers:p}]}],e.JSNativeModalContext=a,e.JSNativeModalContextBuilder=u,e.JSNativeModalModule=d,e.JSNativeModalRenderer=s,e.JSNativePresetBuilder=c,e.Modal=l,e.providers=p,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ngx-modialog-11-plugins-js-native.umd.min.js.map