Files
vanillajs-seed/node_modules/pnotify/dist/umd/PNotifyNonBlock.js
2020-05-26 10:37:57 +02:00

2 lines
3.0 KiB
JavaScript

var _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e(require("./PNotify")):"function"==typeof define&&define.amd?define("PNotifyNonBlock",["./PNotify"],e):t.PNotifyNonBlock=e(PNotify)}(this,function(n){"use strict";n=n&&n.__esModule?n.default:n;var e;function t(t){var e,o;o=t,(e=this)._handlers=r(),e._slots=r(),e._bind=o._bind,e._staged={},e.options=o,e.root=o.root||e,e.store=o.store||e.root.store,o.root||(e._beforecreate=[],e._oncreate=[],e._aftercreate=[]),this._state=s(_extends({_notice:null,_options:{}},n.modules.NonBlock.defaults),t.data),this._intro=!0,this._fragment=(this._state,{c:i,m:i,p:i,d:i}),t.target&&(this._fragment.c(),this._mount(t.target,t.anchor))}function i(){}function s(t,e){for(var o in e)t[o]=e[o];return t}function r(){return Object.create(null)}function o(t){for(;t&&t.length;)t.shift()()}return s(t.prototype,{destroy:function(t){this.destroy=i,this.fire("destroy"),this.set=i,this._fragment.d(!1!==t),this._fragment=null,this._state={}},get:function(){return this._state},fire:function(t,e){var o=t in this._handlers&&this._handlers[t].slice();if(!o)return;for(var n=0;n<o.length;n+=1){var i=o[n];if(!i.__calling)try{i.__calling=!0,i.call(this,e)}finally{i.__calling=!1}}},on:function(t,e){var o=this._handlers[t]||(this._handlers[t]=[]);return o.push(e),{cancel:function(){var t=o.indexOf(e);~t&&o.splice(t,1)}}},set:function(t){if(this._set(s({},t)),this.root._lock)return;!function(t){t._lock=!0,o(t._beforecreate),o(t._oncreate),o(t._aftercreate),t._lock=!1}(this.root)},_set:function(t){var e=this._state,o={},n=!1;for(var i in t=s(this._staged,t),this._staged={},t)this._differs(t[i],e[i])&&(o[i]=n=!0);if(!n)return;this._state=s(s({},e),t),this._recompute(o,this._state),this._bind&&this._bind(o,this._state);this._fragment&&(this.fire("state",{changed:o,current:this._state,previous:e}),this._fragment.p(o,this._state),this.fire("update",{changed:o,current:this._state,previous:e}))},_stage:function(t){s(this._staged,t)},_mount:function(t,e){this._fragment[this._fragment.i?"i":"m"](t,e||null)},_differs:function(t,e){return t!=t?e==e:t!==e||t&&"object"===(void 0===t?"undefined":_typeof(t))||"function"==typeof t}}),s(t.prototype,{initModule:function(t){this.set(t),this.doNonBlockClass()},update:function(){this.doNonBlockClass()},doNonBlockClass:function(){this.get().nonblock?this.get()._notice.addModuleClass("nonblock"):this.get()._notice.removeModuleClass("nonblock")}}),t.prototype._recompute=i,(e=t).key="NonBlock",e.defaults={nonblock:!1},e.init=function(t){return new e({target:document.body,data:{_notice:t}})},n.modules.NonBlock=e,t});
//# sourceMappingURL=PNotifyNonBlock.js.map