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

2 lines
5.5 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}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("PNotifyReference",["./PNotify"],e):t.PNotifyReference=e(PNotify)}(this,function(r){"use strict";r=r&&r.__esModule?r.default:r;var t,e={initModule:function(t){var e=this;this.set(t);var n=this.get()._notice;n.on("mouseenter",function(){return e.set({_mouseIsIn:!0})}),n.on("mouseleave",function(){return e.set({_mouseIsIn:!1})})},doSomething:function(){var t=0,e=this.get()._notice,n=setInterval(function(){360===(t+=10)&&(t=0,clearInterval(n)),e.refs.elem.style.transform="rotate("+t+"deg)"},20)},update:function(){},beforeOpen:function(){},afterOpen:function(){},beforeClose:function(){},afterClose:function(){},beforeDestroy:function(){},afterDestroy:function(){}};function s(n,t){var i,o=t.putThing&&f(n,t);return{c:function(){o&&o.c(),i=document.createComment("")},m:function(t,e){o&&o.m(t,e),y(t,i,e)},p:function(t,e){e.putThing?o?o.p(t,e):((o=f(n,e)).c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null)},d:function(t){o&&o.d(t),t&&g(i)}}}function f(o,i){var r,s,f,a,c,u,l,h,d=i.labels.text;function _(t){o.doSomething()}return{c:function(){var t,e,n;r=m("button"),s=m("i"),a=b(" "),c=b(d),l=b("\n \n "),h=m("div"),s.className=f=i._notice.get()._icons.athing+" svelte-1qy4b0e",t="click",e=_,r.addEventListener(t,e,n),r.className="ui-pnotify-reference-button btn btn-default svelte-1qy4b0e",r.type="button",r.disabled=u=!i._mouseIsIn,h.className="ui-pnotify-reference-clearing svelte-1qy4b0e"},m:function(t,e){y(t,r,e),p(r,s),p(r,a),p(r,c),o.refs.thingElem=r,y(t,l,e),y(t,h,e)},p:function(t,e){var n;t._notice&&f!==(f=e._notice.get()._icons.athing+" svelte-1qy4b0e")&&(s.className=f),t.labels&&d!==(d=e.labels.text)&&(n=d,c.data=""+n),t._mouseIsIn&&u!==(u=!e._mouseIsIn)&&(r.disabled=u)},d:function(t){var e,n,i;t&&g(r),e="click",n=_,r.removeEventListener(e,n,i),o.refs.thingElem===r&&(o.refs.thingElem=null),t&&(g(l),g(h))}}}function n(t){var e,n,i,o=this;n=t,(e=this)._handlers=u(),e._slots=u(),e._bind=n._bind,e._staged={},e.options=n,e.root=n.root||e,e.store=n.store||e.root.store,n.root||(e._beforecreate=[],e._oncreate=[],e._aftercreate=[]),this.refs={},this._state=a(_extends({_notice:null,_options:{},_mouseIsIn:!1},r.modules.Reference.defaults),t.data),this._intro=!0,document.getElementById("svelte-1qy4b0e-style")||((i=m("style")).id="svelte-1qy4b0e-style",i.textContent=".ui-pnotify-reference-button.svelte-1qy4b0e{float:right}.ui-pnotify-reference-clearing.svelte-1qy4b0e{clear:right;line-height:0}",p(document.head,i)),this._fragment=s(this,this._state),this.root._oncreate.push(function(){(function(){this.fire("init",{module:this})}).call(o),o.fire("update",{changed:function(t,e){for(var n in e)t[n]=1;return t}({},o._state),current:o._state})}),t.target&&(this._fragment.c(),this._mount(t.target,t.anchor),c(this))}function m(t){return document.createElement(t)}function p(t,e){t.appendChild(e)}function y(t,e,n){t.insertBefore(e,n)}function g(t){t.parentNode.removeChild(t)}function b(t){return document.createTextNode(t)}function a(t,e){for(var n in e)t[n]=e[n];return t}function c(t){t._lock=!0,o(t._beforecreate),o(t._oncreate),o(t._aftercreate),t._lock=!1}function i(){}function u(){return Object.create(null)}function o(t){for(;t&&t.length;)t.shift()()}return a(n.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 n=t in this._handlers&&this._handlers[t].slice();if(!n)return;for(var i=0;i<n.length;i+=1){var o=n[i];if(!o.__calling)try{o.__calling=!0,o.call(this,e)}finally{o.__calling=!1}}},on:function(t,e){var n=this._handlers[t]||(this._handlers[t]=[]);return n.push(e),{cancel:function(){var t=n.indexOf(e);~t&&n.splice(t,1)}}},set:function(t){if(this._set(a({},t)),this.root._lock)return;c(this.root)},_set:function(t){var e=this._state,n={},i=!1;for(var o in t=a(this._staged,t),this._staged={},t)this._differs(t[o],e[o])&&(n[o]=i=!0);if(!i)return;this._state=a(a({},e),t),this._recompute(n,this._state),this._bind&&this._bind(n,this._state);this._fragment&&(this.fire("state",{changed:n,current:this._state,previous:e}),this._fragment.p(n,this._state),this.fire("update",{changed:n,current:this._state,previous:e}))},_stage:function(t){a(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}}),a(n.prototype,e),n.prototype._recompute=i,(t=n).key="Reference",t.defaults={putThing:!1,labels:{text:"Spin Around"}},r.modules.Reference=t,r.modulesAppendContainer.push(t),_extends(r.icons.brighttheme,{athing:"bt-icon bt-icon-refresh"}),_extends(r.icons.bootstrap3,{athing:"glyphicon glyphicon-refresh"}),_extends(r.icons.fontawesome4,{athing:"fa fa-refresh"}),_extends(r.icons.fontawesome5,{athing:"fas fa-sync"}),r.icons.material||(r.icons.material={}),_extends(r.icons.material,{athing:"material-icons pnotify-material-icon-refresh"}),n});
//# sourceMappingURL=PNotifyReference.js.map