Files
vanillajs-seed/node_modules/pnotify/dist/umd/PNotifyNonBlock.js
2019-12-20 20:02:44 +01: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(e){"use strict";e=e&&e.__esModule?e.default:e;var o;function t(t){!function(t,e){t._handlers=i(),t._slots=i(),t._bind=e._bind,t._staged={},t.options=e,t.root=e.root||t,t.store=e.store||t.root.store,e.root||(t._beforecreate=[],t._oncreate=[],t._aftercreate=[])}(this,t),this._state=s(_extends({_notice:null,_options:{}},e.modules.NonBlock.defaults),t.data),this._intro=!0,this._fragment=(this._state,{c:n,m:n,p:n,d:n}),t.target&&(this._fragment.c(),this._mount(t.target,t.anchor))}function n(){}function s(t,e){for(var o in e)t[o]=e[o];return t}function i(){return Object.create(null)}function r(t){for(;t&&t.length;)t.shift()()}return s(t.prototype,{destroy:function(t){this.destroy=n,this.fire("destroy"),this.set=n,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,r(t._beforecreate),r(t._oncreate),r(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=n,(o=t).key="NonBlock",o.defaults={nonblock:!1},o.init=function(t){return new o({target:document.body,data:{_notice:t}})},e.modules.NonBlock=o,t});
//# sourceMappingURL=PNotifyNonBlock.js.map