vueup
Version:
Simple, lightweight and elegant global notification popup for Vue.js
2 lines • 7.74 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):"object"==typeof exports?exports["vue-notification"]=t(require("vue")):e["vue-notification"]=t(e.vue)}(window,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=5)}([function(e,t,n){var o=n(3);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);(0,n(6).default)("7e7e119f",o,!0,{})},function(t,n){t.exports=e},function(e,t,n){"use strict";var o=n(0);n.n(o).a},function(e,t,n){(t=n(4)(!1)).push([e.i,"\n.vue-up[data-v-6e0f19ae] {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100vh;\n z-index: 1000000000;\n pointer-events: none;\n}\n.vue-up.show_el[data-v-6e0f19ae] {\n opacity: 1;\n}\n.vue-up[data-v-6e0f19ae]:not(.show_el) {\n opacity: 0;\n transition: opacity .4s;\n}\n.vue-up .text[data-v-6e0f19ae] {\n color: #fff;\n font-family: 'Arial', sans-serif;\n position: absolute;\n text-align: center;\n top: 50%;\n transform: translateY(-50%);\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n}\n\n",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(a=o,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(u," */")),i=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([r]).join("\n")}var a,s,u;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(o)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(r[a]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);o&&r[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),t.push(u))}},t}},function(e,t,n){"use strict";n.r(t);var o=n(1),r=new(n.n(o).a),i={name:"vue-up",data:function(){return{show:!1,backgroundColor:"rgba(0, 0, 0, 0.8)",color:"#ffffff",fontSize:"60"}},mounted:function(){var e=this;r.$on("TRIGGER",(function(t){if(t.hasOwnProperty("message")){e.message=t.message;var n=t.hasOwnProperty("delay")?t.delay:3.5;e.color=t.hasOwnProperty("color")?t.color:"#ffffff",e.backgroundColor=t.hasOwnProperty("backgroundColor")?t.backgroundColor:"rgba(0, 0, 0, 0.8)",e.fontSize=t.hasOwnProperty("fontSize")?t.fontSize:"60",n*=1e3,e.show=!0,setTimeout((function(){e.show=!1}),n)}}))}};n(2);var a=function(e,t,n,o,r,i,a,s){var u,f="function"==typeof e?e.options:e;if(t&&(f.render=t,f.staticRenderFns=n,f._compiled=!0),o&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),a?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},f._ssrRegister=u):r&&(u=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),u)if(f.functional){f._injectStyles=u;var c=f.render;f.render=function(e,t){return u.call(t),c(e,t)}}else{var l=f.beforeCreate;f.beforeCreate=l?[].concat(l,u):[u]}return{exports:e,options:f}}(i,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"vue-up",class:{show_el:this.show},style:{backgroundColor:this.backgroundColor}},[t("div",{staticClass:"text",style:{color:this.color,fontSize:this.fontSize+"px"}},[this._v("\n "+this._s(this.message)+"\n ")])])}),[],!1,null,"6e0f19ae",null).exports;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var u={install:function(e){if(!this.installed)return this.installed=!0,e.component("vue-up",a),e.prototype.$popup=function(e){var t,n=e.hasOwnProperty("delay")?e.delay:3.5;return"string"==typeof e&&(e={message:e}),"object"===s(e)&&r.$emit("TRIGGER",e),(t=1e3*n,new Promise((function(e){return setTimeout(e,t)}))).then((function(){}))}}};t.default=u},function(e,t,n){"use strict";function o(e,t){for(var n=[],o={},r=0;r<t.length;r++){var i=t[r],a=i[0],s={id:e+":"+r,css:i[1],media:i[2],sourceMap:i[3]};o[a]?o[a].parts.push(s):n.push(o[a]={id:a,parts:[s]})}return n}n.r(t),n.d(t,"default",(function(){return p}));var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var i={},a=r&&(document.head||document.getElementsByTagName("head")[0]),s=null,u=0,f=!1,c=function(){},l=null,d="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function p(e,t,n,r){f=n,l=r||{};var a=o(e,t);return v(a),function(t){for(var n=[],r=0;r<a.length;r++){var s=a[r];(u=i[s.id]).refs--,n.push(u)}t?v(a=o(e,t)):a=[];for(r=0;r<n.length;r++){var u;if(0===(u=n[r]).refs){for(var f=0;f<u.parts.length;f++)u.parts[f]();delete i[u.id]}}}}function v(e){for(var t=0;t<e.length;t++){var n=e[t],o=i[n.id];if(o){o.refs++;for(var r=0;r<o.parts.length;r++)o.parts[r](n.parts[r]);for(;r<n.parts.length;r++)o.parts.push(y(n.parts[r]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{var a=[];for(r=0;r<n.parts.length;r++)a.push(y(n.parts[r]));i[n.id]={id:n.id,refs:1,parts:a}}}}function h(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function y(e){var t,n,o=document.querySelector('style[data-vue-ssr-id~="'+e.id+'"]');if(o){if(f)return c;o.parentNode.removeChild(o)}if(d){var r=u++;o=s||(s=h()),t=b.bind(null,o,r,!1),n=b.bind(null,o,r,!0)}else o=h(),t=_.bind(null,o),n=function(){o.parentNode.removeChild(o)};return t(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;t(e=o)}else n()}}var m,g=(m=[],function(e,t){return m[e]=t,m.filter(Boolean).join("\n")});function b(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=g(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function _(e,t){var n=t.css,o=t.media,r=t.sourceMap;if(o&&e.setAttribute("media",o),l.ssrId&&e.setAttribute("data-vue-ssr-id",t.id),r&&(n+="\n/*# sourceURL="+r.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}}])}));
//# sourceMappingURL=index.js.map