UNPKG

vue2-notify

Version:

Simple notify component for VueJS 2

2 lines 15.5 kB
module.exports=function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="/dist/",n(n.s=12)}([function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){var e=t.exports={version:"2.5.6"};"number"==typeof __e&&(__e=e)},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){t.exports=!e(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,e){t.exports={default:e(14),__esModule:!0}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){var o=e(8),r=e(9);t.exports=function(t){return o(r(t))}},function(t,n,e){var o=e(29);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){var e=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:e)(t)}},function(t,n,e){"use strict";var o=e(5),r=e.n(o),i=e(48),s=e.n(i),a=e(49),f=e.n(a);n.a={data:function(){return{types:{info:{itemClass:"alert-info",iconClass:"fa fa-lg fa-info-circle"},error:{itemClass:"alert-danger",iconClass:"fa fa-lg fa-exclamation-triangle"},warning:{itemClass:"alert-warning",iconClass:"fa fa-lg fa-exclamation-circle"},success:{itemClass:"alert-success",iconClass:"fa fa-lg fa-check-circle"}},options:{itemClass:"alert col-12",duration:500,visibility:2e3,position:"top-left",enter:"slideDown",leave:"slideUp",closeButtonClass:!1,width:"300px",mode:"text",permanent:!1},items:{},idx:0}},computed:{width:function(){return"top-full"===this.options.position||"bottom-full"===this.options.position?"auto":this.options.width}},methods:{setTypes:function(t){this.types=t},addItem:function(t,n,e){var o=this,i={iconClass:this.types[t].iconClass,itemClass:[this.options.itemClass,this.types[t].itemClass],visibility:this.options.visibility,mode:this.options.mode,closeButtonClass:this.options.closeButtonClass,permanent:this.options.permanent},a=r()({},i,e),f=this.idx;for(var u in this.items)if(this.items.hasOwnProperty(u)&&this.items[u].text===n)return;s.a.set(this.items,this.idx,{type:t,text:n,options:a}),this.idx++,!1===a.permanent&&setTimeout(function(){o.removeItem(f)},this.options.duration+a.visibility)},slideDown:function(t){f()(t,this.options.enter,{duration:this.options.duration})},slideUp:function(t,n){f()(t,this.options.leave,{duration:this.options.duration,complete:n})},removeItem:function(t){s.a.delete(this.items,t)},removeAll:function(){this.items={}}}}},function(t,n,e){t.exports=e(13)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=e(5),r=e.n(o),i=e(41);n.default={install:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.extend(i.a),o=new e;o.options=r()(o.options,n);var s=o.$mount();document.querySelector("body").appendChild(s.$el),t.$notify=t.prototype.$notify=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o.addItem(n,t,e)},t.$notify.info=t.prototype.$notify.info=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.addItem("info",t,n)},t.$notify.success=t.prototype.$notify.success=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.addItem("success",t,n)},t.$notify.error=t.prototype.$notify.error=t.$notify.danger=t.prototype.$notify.danger=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.addItem("error",t,n)},t.$notify.warning=t.prototype.$notify.warning=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.addItem("warning",t,n)},t.$notify.setTypes=t.prototype.$notify.setTypes=function(t){o.setTypes(t)},t.$notify.removeAll=t.prototype.$notify.removeAll=function(){o.removeAll()}}}},function(t,n,e){e(15),t.exports=e(1).Object.assign},function(t,n,e){var o=e(16);o(o.S+o.F,"Object",{assign:e(26)})},function(t,n,e){var o=e(0),r=e(1),i=e(17),s=e(19),a=e(6),f=function(t,n,e){var u,c,p,l=t&f.F,d=t&f.G,v=t&f.S,h=t&f.P,y=t&f.B,m=t&f.W,x=d?r:r[n]||(r[n]={}),g=x.prototype,b=d?o:v?o[n]:(o[n]||{}).prototype;d&&(e=n);for(u in e)(c=!l&&b&&void 0!==b[u])&&a(x,u)||(p=c?b[u]:e[u],x[u]=d&&"function"!=typeof b[u]?e[u]:y&&c?i(p,o):m&&b[u]==p?function(t){var n=function(n,e,o){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,o)}return t.apply(this,arguments)};return n.prototype=t.prototype,n}(p):h&&"function"==typeof p?i(Function.call,p):p,h&&((x.virtual||(x.virtual={}))[u]=p,t&f.R&&g&&!g[u]&&s(g,u,p)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},function(t,n,e){var o=e(18);t.exports=function(t,n,e){if(o(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,o){return t.call(n,e,o)};case 3:return function(e,o,r){return t.call(n,e,o,r)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var o=e(20),r=e(25);t.exports=e(3)?function(t,n,e){return o.f(t,n,r(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var o=e(21),r=e(22),i=e(24),s=Object.defineProperty;n.f=e(3)?Object.defineProperty:function(t,n,e){if(o(t),n=i(n,!0),o(e),r)try{return s(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var o=e(2);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,n,e){t.exports=!e(3)&&!e(4)(function(){return 7!=Object.defineProperty(e(23)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var o=e(2),r=e(0).document,i=o(r)&&o(r.createElement);t.exports=function(t){return i?r.createElement(t):{}}},function(t,n,e){var o=e(2);t.exports=function(t,n){if(!o(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!o(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!o(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!o(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){"use strict";var o=e(27),r=e(38),i=e(39),s=e(40),a=e(8),f=Object.assign;t.exports=!f||e(4)(function(){var t={},n={},e=Symbol(),o="abcdefghijklmnopqrst";return t[e]=7,o.split("").forEach(function(t){n[t]=t}),7!=f({},t)[e]||Object.keys(f({},n)).join("")!=o})?function(t,n){for(var e=s(t),f=arguments.length,u=1,c=r.f,p=i.f;f>u;)for(var l,d=a(arguments[u++]),v=c?o(d).concat(c(d)):o(d),h=v.length,y=0;h>y;)p.call(d,l=v[y++])&&(e[l]=d[l]);return e}:f},function(t,n,e){var o=e(28),r=e(37);t.exports=Object.keys||function(t){return o(t,r)}},function(t,n,e){var o=e(6),r=e(7),i=e(30)(!1),s=e(33)("IE_PROTO");t.exports=function(t,n){var e,a=r(t),f=0,u=[];for(e in a)e!=s&&o(a,e)&&u.push(e);for(;n.length>f;)o(a,e=n[f++])&&(~i(u,e)||u.push(e));return u}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){var o=e(7),r=e(31),i=e(32);t.exports=function(t){return function(n,e,s){var a,f=o(n),u=r(f.length),c=i(s,u);if(t&&e!=e){for(;u>c;)if((a=f[c++])!=a)return!0}else for(;u>c;c++)if((t||c in f)&&f[c]===e)return t||c||0;return!t&&-1}}},function(t,n,e){var o=e(10),r=Math.min;t.exports=function(t){return t>0?r(o(t),9007199254740991):0}},function(t,n,e){var o=e(10),r=Math.max,i=Math.min;t.exports=function(t,n){return t=o(t),t<0?r(t+n,0):i(t,n)}},function(t,n,e){var o=e(34)("keys"),r=e(36);t.exports=function(t){return o[t]||(o[t]=r(t))}},function(t,n,e){var o=e(1),r=e(0),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(t.exports=function(t,n){return i[t]||(i[t]=void 0!==n?n:{})})("versions",[]).push({version:o.version,mode:e(35)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=!0},function(t,n){var e=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+o).toString(36))}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,e){var o=e(9);t.exports=function(t){return Object(o(t))}},function(t,n,e){"use strict";function o(t){e(42)}var r=e(11),i=e(50),s=e(47),a=o,f=s(r.a,i.a,!1,a,"data-v-4e19f58f",null);n.a=f.exports},function(t,n,e){var o=e(43);"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);e(45)("17ebb296",o,!0,{})},function(t,n,e){n=t.exports=e(44)(!1),n.push([t.i,".notify-top-full[data-v-4e19f58f]{position:fixed;top:5px;left:15px;right:15px;z-index:9999}.notify-bottom-full[data-v-4e19f58f]{position:fixed;bottom:5px;left:15px;right:15px;z-index:9999}.notify-top-right[data-v-4e19f58f]{position:fixed;top:5px;right:15px}.notify-top-left[data-v-4e19f58f]{position:fixed;top:5px;left:15px}.notify-bottom-left[data-v-4e19f58f]{position:fixed;bottom:5px;width:300px;left:15px}.notify-bottom-right[data-v-4e19f58f]{position:fixed;bottom:5px;right:15px}.notify-top-full .notify-item[data-v-4e19f58f]:not(:last-child),.notify-top-left .notify-item[data-v-4e19f58f]:not(:last-child),.notify-top-right .notify-item[data-v-4e19f58f]:not(:last-child){margin-bottom:5px}.notify-bottom-full .notify-item[data-v-4e19f58f]:not(:first-child),.notify-bottom-left .notify-item[data-v-4e19f58f]:not(:first-child),.notify-bottom-right .notify-item[data-v-4e19f58f]:not(:first-child){margin-top:5px}.notify[data-v-4e19f58f]{z-index:100}",""])},function(t,n){function e(t,n){var e=t[1]||"",r=t[3];if(!r)return e;if(n&&"function"==typeof btoa){var i=o(r);return[e].concat(r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"})).concat([i]).join("\n")}return[e].join("\n")}function o(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var n=[];return n.toString=function(){return this.map(function(n){var o=e(n,t);return n[2]?"@media "+n[2]+"{"+o+"}":o}).join("")},n.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},r=0;r<this.length;r++){var i=this[r][0];"number"==typeof i&&(o[i]=!0)}for(r=0;r<t.length;r++){var s=t[r];"number"==typeof s[0]&&o[s[0]]||(e&&!s[2]?s[2]=e:e&&(s[2]="("+s[2]+") and ("+e+")"),n.push(s))}},n}},function(t,n,e){function o(t){for(var n=0;n<t.length;n++){var e=t[n],o=c[e.id];if(o){o.refs++;for(var r=0;r<o.parts.length;r++)o.parts[r](e.parts[r]);for(;r<e.parts.length;r++)o.parts.push(i(e.parts[r]));o.parts.length>e.parts.length&&(o.parts.length=e.parts.length)}else{for(var s=[],r=0;r<e.parts.length;r++)s.push(i(e.parts[r]));c[e.id]={id:e.id,refs:1,parts:s}}}}function r(){var t=document.createElement("style");return t.type="text/css",p.appendChild(t),t}function i(t){var n,e,o=document.querySelector("style["+m+'~="'+t.id+'"]');if(o){if(v)return h;o.parentNode.removeChild(o)}if(x){var i=d++;o=l||(l=r()),n=s.bind(null,o,i,!1),e=s.bind(null,o,i,!0)}else o=r(),n=a.bind(null,o),e=function(){o.parentNode.removeChild(o)};return n(t),function(o){if(o){if(o.css===t.css&&o.media===t.media&&o.sourceMap===t.sourceMap)return;n(t=o)}else e()}}function s(t,n,e,o){var r=e?"":o.css;if(t.styleSheet)t.styleSheet.cssText=g(n,r);else{var i=document.createTextNode(r),s=t.childNodes;s[n]&&t.removeChild(s[n]),s.length?t.insertBefore(i,s[n]):t.appendChild(i)}}function a(t,n){var e=n.css,o=n.media,r=n.sourceMap;if(o&&t.setAttribute("media",o),y.ssrId&&t.setAttribute(m,n.id),r&&(e+="\n/*# sourceURL="+r.sources[0]+" */",e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}var f="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!f)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 u=e(46),c={},p=f&&(document.head||document.getElementsByTagName("head")[0]),l=null,d=0,v=!1,h=function(){},y=null,m="data-vue-ssr-id",x="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,n,e,r){v=e,y=r||{};var i=u(t,n);return o(i),function(n){for(var e=[],r=0;r<i.length;r++){var s=i[r],a=c[s.id];a.refs--,e.push(a)}n?(i=u(t,n),o(i)):i=[];for(var r=0;r<e.length;r++){var a=e[r];if(0===a.refs){for(var f=0;f<a.parts.length;f++)a.parts[f]();delete c[a.id]}}}};var g=function(){var t=[];return function(n,e){return t[n]=e,t.filter(Boolean).join("\n")}}()},function(t,n){t.exports=function(t,n){for(var e=[],o={},r=0;r<n.length;r++){var i=n[r],s=i[0],a=i[1],f=i[2],u=i[3],c={id:t+":"+r,css:a,media:f,sourceMap:u};o[s]?o[s].parts.push(c):e.push(o[s]={id:s,parts:[c]})}return e}},function(t,n){t.exports=function(t,n,e,o,r,i){var s,a=t=t||{},f=typeof t.default;"object"!==f&&"function"!==f||(s=t,a=t.default);var u="function"==typeof a?a.options:a;n&&(u.render=n.render,u.staticRenderFns=n.staticRenderFns,u._compiled=!0),e&&(u.functional=!0),r&&(u._scopeId=r);var c;if(i?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=c):o&&(c=o),c){var p=u.functional,l=p?u.render:u.beforeCreate;p?(u._injectStyles=c,u.render=function(t,n){return c.call(n),l(t,n)}):u.beforeCreate=l?[].concat(l,c):[c]}return{esModule:s,exports:a,options:u}}},function(t,n){t.exports=require("vue")},function(t,n){t.exports=require("velocity-animate")},function(t,n,e){"use strict";var o=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"notify",class:"notify-"+t.options.position,style:{width:t.width}},[e("transition-group",{attrs:{name:"notify",tag:"div"},on:{enter:t.slideDown,leave:t.slideUp}},t._l(t.items,function(n,o){return e("div",{key:o,staticClass:"notify-item"},[e("div",{class:n.options.itemClass},[n.options.closeButtonClass?e("button",{class:n.options.closeButtonClass,attrs:{type:"button","aria-label":"Close"},on:{click:function(n){t.removeItem(o)}}},[e("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]):t._e(),t._v(" "),n.options.iconClass?e("span",{class:n.options.iconClass}):t._e(),t._v(" "),"html"===n.options.mode?e("div",{domProps:{innerHTML:t._s(n.text)}}):[t._v(t._s(n.text))]],2)])}))],1)},r=[],i={render:o,staticRenderFns:r};n.a=i}]); //# sourceMappingURL=build.js.map