vue-notifications
Advanced tools
Comparing version 0.7.4 to 0.7.5
{ | ||
"name": "vue-notifications", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "Vuejs notifications", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue-notifications.js", |
@@ -63,6 +63,5 @@ ;(function(root, factory) { | ||
* @param {String} debugMsg | ||
* @param {Object} vueApp | ||
* @return {String} | ||
*/ | ||
showDefaultMessage: function showDefaultMessage(_ref, vueApp) { | ||
showDefaultMessage: function showDefaultMessage(_ref) { | ||
var type = _ref.type, | ||
@@ -82,4 +81,74 @@ message = _ref.message, | ||
* @param {Object} elem | ||
* @param {String} className | ||
*/ | ||
clearFn: function clearFn(elem) { | ||
addClass: function addClass(elem, className) { | ||
if (elem.classList) { | ||
elem.classList.add(className); | ||
} else { | ||
elem.className += ' ' + className; | ||
} | ||
}, | ||
/** | ||
* @param {Object} elem | ||
* @param {String} className | ||
*/ | ||
removeClass: function removeClass(elem, className) { | ||
if (elem.classList) { | ||
elem.classList.remove(className); | ||
} else { | ||
elem.className = elem.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); | ||
} | ||
}, | ||
/** | ||
* @param {Object} elem | ||
* @param {String} className | ||
* @return {Boolean} | ||
*/ | ||
hasClass: function hasClass(elem, className) { | ||
if (elem.classList) { | ||
return elem.classList.contains(className); | ||
} else { | ||
return new RegExp('(^| )' + className + '( |$)', 'gi').test(elem.className); | ||
} | ||
}, | ||
/** | ||
* @param {Object} elem | ||
* @param {String} message | ||
* @param {String} inClass | ||
* @param {String} outClass | ||
*/ | ||
showInlineFn: function showInlineFn(elem, message, _ref2) { | ||
var inClass = _ref2.inClass, | ||
outClass = _ref2.outClass; | ||
elem.innerText = message; | ||
if (inClass) { | ||
if (!innerMethods.hasClass(elem, inClass)) innerMethods.addClass(elem, inClass); | ||
} | ||
if (outClass) { | ||
if (innerMethods.hasClass(elem, outClass)) innerMethods.removeClass(elem, outClass); | ||
} | ||
}, | ||
/** | ||
* @param {Object} elem | ||
* @param {String} inClass | ||
* @param {String} outClass | ||
*/ | ||
clearInlineFn: function clearInlineFn(elem, _ref3) { | ||
var inClass = _ref3.inClass, | ||
outClass = _ref3.outClass; | ||
if (inClass) { | ||
if (innerMethods.hasClass(elem, inClass)) innerMethods.removeClass(elem, inClass); | ||
} | ||
if (outClass) { | ||
if (!innerMethods.hasClass(elem, outClass)) innerMethods.addClass(elem, outClass); | ||
} | ||
elem.innerText = ''; | ||
@@ -93,2 +162,3 @@ }, | ||
* @param {String} message | ||
* @param {Object} classes | ||
* @param {Function} watch | ||
@@ -100,10 +170,12 @@ * @param {String} debugMsg | ||
*/ | ||
showInlineMessage: function showInlineMessage(_ref2, vueApp) { | ||
var id = _ref2.id, | ||
type = _ref2.type, | ||
timeout = _ref2.timeout, | ||
message = _ref2.message, | ||
watch = _ref2.watch, | ||
debugMsg = _ref2.debugMsg, | ||
cb = _ref2.cb; | ||
showInlineMessage: function showInlineMessage(_ref4, vueApp) { | ||
var id = _ref4.id, | ||
type = _ref4.type, | ||
timeout = _ref4.timeout, | ||
message = _ref4.message, | ||
_ref4$classes = _ref4.classes, | ||
classes = _ref4$classes === undefined ? {} : _ref4$classes, | ||
watch = _ref4.watch, | ||
debugMsg = _ref4.debugMsg, | ||
cb = _ref4.cb; | ||
@@ -114,13 +186,10 @@ // TODO (S.Panfilov) handle class add and remove here | ||
elem.innerText = message; | ||
if (timeout && !watch) { | ||
setTimeout(function () { | ||
innerMethods.clearFn.call(vueApp, elem); | ||
}, timeout); | ||
} else { | ||
if (watch) { | ||
(function () { | ||
timeout = false; | ||
if (watch && watch()) innerMethods.showInlineFn(elem, message, classes); | ||
var interval = setInterval(function () { | ||
if (watch && !watch()) { | ||
clearInterval(interval); | ||
innerMethods.clearFn.call(innerMethods, elem); | ||
innerMethods.clearInlineFn.call(innerMethods, elem, classes); | ||
} | ||
@@ -131,2 +200,9 @@ }, 50); | ||
if (!watch) { | ||
innerMethods.showInlineFn(elem, message, classes); | ||
setTimeout(function () { | ||
innerMethods.clearInlineFn.call(vueApp, elem, classes); | ||
}, timeout); | ||
} | ||
// TODO (S.Panfilov) BUG: Weird behaviour: cb calls 2 times | ||
@@ -136,3 +212,3 @@ if (cb) { | ||
cb.call(vueApp, elem, function () { | ||
return innerMethods.clearFn.call(innerMethods, elem); | ||
return innerMethods.clearInlineFn.call(innerMethods, elem, classes); | ||
}); | ||
@@ -139,0 +215,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?module.exports=n():e.VueNotifications=n()}(this,function(){"use strict";var e="VueNotifications",n="vue-notifications",t="notifications",o={error:"error",warn:"warn",info:"info",success:"success"},i={evangelion:1,ghostInTheShell:2},s={alreadyInstalled:e+": plugin already installed",methodNameConflict:e+": names conflict - "},r={getVersion:function(e){var n=e.version.match(/(\d+)/g);return{major:+n[0],regular:+n[1],minor:+n[2]}},showInConsole:function(e,n,t){n===t.error?console.error(e):n===t.warn?console.warn(e):n===t.success?console.info(e):console.log(e)},showDefaultMessage:function(e,n){var t=e.type,i=e.message,s=e.title,a=e.debugMsg,c="Title: "+s+", Message: "+i+", DebugMsg: "+a+", type: "+t;return r.showInConsole(c,t,o),c},clearFn:function(e){e.innerText=""},showInlineMessage:function(e,n){var t=e.id,i=e.type,s=e.timeout,a=e.message,c=e.watch,l=e.debugMsg,u=e.cb;l&&r.showInConsole(l,i,o);var f=document.getElementById(t);return f.innerText=a,s&&!c?setTimeout(function(){r.clearFn.call(n,f)},s):!function(){var e=setInterval(function(){c&&!c()&&(clearInterval(e),r.clearFn.call(r,f))},50)}(),u&&u.call(n,f,function(){return r.clearFn.call(r,f)}),a},getValues:function(e,n){var t={},o=["cb","watch"];return Object.keys(n).forEach(function(i){o.forEach(function(o){i===o?t[i]=n[i].bind(e):t[i]="function"==typeof n[i]?n[i].call(e):n[i]})}),t},showMessage:function(e,n,t){var o=r.getValues(t,e),i=!!o.id;if(i)r.showInlineMessage(o,t);else{var s=n&&n[o.type],a=s?n[o.type]:r.showDefaultMessage;a(o,t)}if(e.cb)return e.cb()},addMethods:function(e,n,t){Object.keys(n).forEach(function(o){e[n[o]]=function(e){return e.type=n[o],r.showMessage(e,t)}})},setMethod:function(e,n,t,o){t.methods||(t.methods={}),t.methods[n]?console.error(s.methodNameConflict+n):t.methods[n]=r.makeMethod(e,n,t,o)},makeMethod:function(e,n,t,o){return function(i){var s={};return Object.assign(s,a.config),Object.assign(s,t[a.propertyName][n]),Object.assign(s,i),r.showMessage(s,o,e)}},initVueNotificationPlugin:function(e,t,o){t&&(Object.keys(t).forEach(function(n){r.setMethod(e,n,e.$options,o)}),e.$emit(n+"-initiated"))}},a={type:o,propertyName:t,config:{type:o.info,timeout:3e3},installed:!1,install:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},o=void 0;if(this.installed)throw console.error(s.alreadyInstalled);r.getVersion(e).major===i.evangelion&&(o="init"),r.getVersion(e).major===i.ghostInTheShell&&(o="beforeCreate"),t[o]=function(){var e=this,t=this.$options,o=t[a.propertyName];r.initVueNotificationPlugin(e,o,n)},e.mixin(t),r.addMethods(this,this.type,n),this.installed=!0}};return"undefined"!=typeof window&&window.Vue&&window.Vue.use(a),a}); | ||
!function(e,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?module.exports=n():e.VueNotifications=n()}(this,function(){"use strict";var e="VueNotifications",n="vue-notifications",s="notifications",t={error:"error",warn:"warn",info:"info",success:"success"},o={evangelion:1,ghostInTheShell:2},i={alreadyInstalled:e+": plugin already installed",methodNameConflict:e+": names conflict - "},a={getVersion:function(e){var n=e.version.match(/(\d+)/g);return{major:+n[0],regular:+n[1],minor:+n[2]}},showInConsole:function(e,n,s){n===s.error?console.error(e):n===s.warn?console.warn(e):n===s.success?console.info(e):console.log(e)},showDefaultMessage:function(e){var n=e.type,s=e.message,o=e.title,i=e.debugMsg,l="Title: "+o+", Message: "+s+", DebugMsg: "+i+", type: "+n;return a.showInConsole(l,n,t),l},addClass:function(e,n){e.classList?e.classList.add(n):e.className+=" "+n},removeClass:function(e,n){e.classList?e.classList.remove(n):e.className=e.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," ")},hasClass:function(e,n){return e.classList?e.classList.contains(n):new RegExp("(^| )"+n+"( |$)","gi").test(e.className)},showInlineFn:function(e,n,s){var t=s.inClass,o=s.outClass;e.innerText=n,t&&(a.hasClass(e,t)||a.addClass(e,t)),o&&a.hasClass(e,o)&&a.removeClass(e,o)},clearInlineFn:function(e,n){var s=n.inClass,t=n.outClass;s&&a.hasClass(e,s)&&a.removeClass(e,s),t&&(a.hasClass(e,t)||a.addClass(e,t)),e.innerText=""},showInlineMessage:function(e,n){var s=e.id,o=e.type,i=e.timeout,l=e.message,r=e.classes,c=void 0===r?{}:r,u=e.watch,f=e.debugMsg,d=e.cb;f&&a.showInConsole(f,o,t);var h=document.getElementById(s);return u&&!function(){i=!1,u&&u()&&a.showInlineFn(h,l,c);var e=setInterval(function(){u&&!u()&&(clearInterval(e),a.clearInlineFn.call(a,h,c))},50)}(),u||(a.showInlineFn(h,l,c),setTimeout(function(){a.clearInlineFn.call(n,h,c)},i)),d&&d.call(n,h,function(){return a.clearInlineFn.call(a,h,c)}),l},getValues:function(e,n){var s={},t=["cb","watch"];return Object.keys(n).forEach(function(o){t.forEach(function(t){o===t?s[o]=n[o].bind(e):s[o]="function"==typeof n[o]?n[o].call(e):n[o]})}),s},showMessage:function(e,n,s){var t=a.getValues(s,e),o=!!t.id;if(o)a.showInlineMessage(t,s);else{var i=n&&n[t.type],l=i?n[t.type]:a.showDefaultMessage;l(t,s)}if(e.cb)return e.cb()},addMethods:function(e,n,s){Object.keys(n).forEach(function(t){e[n[t]]=function(e){return e.type=n[t],a.showMessage(e,s)}})},setMethod:function(e,n,s,t){s.methods||(s.methods={}),s.methods[n]?console.error(i.methodNameConflict+n):s.methods[n]=a.makeMethod(e,n,s,t)},makeMethod:function(e,n,s,t){return function(o){var i={};return Object.assign(i,l.config),Object.assign(i,s[l.propertyName][n]),Object.assign(i,o),a.showMessage(i,t,e)}},initVueNotificationPlugin:function(e,s,t){s&&(Object.keys(s).forEach(function(n){a.setMethod(e,n,e.$options,t)}),e.$emit(n+"-initiated"))}},l={type:t,propertyName:s,config:{type:t.info,timeout:3e3},installed:!1,install:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s={},t=void 0;if(this.installed)throw console.error(i.alreadyInstalled);a.getVersion(e).major===o.evangelion&&(t="init"),a.getVersion(e).major===o.ghostInTheShell&&(t="beforeCreate"),s[t]=function(){var e=this,s=this.$options,t=s[l.propertyName];a.initVueNotificationPlugin(e,t,n)},e.mixin(s),a.addMethods(this,this.type,n),this.installed=!0}};return"undefined"!=typeof window&&window.Vue&&window.Vue.use(l),l}); | ||
//# sourceMappingURL=vue-notifications.es5.min.js.map |
@@ -53,6 +53,5 @@ const PLUGIN_NAME = 'VueNotifications' | ||
* @param {String} debugMsg | ||
* @param {Object} vueApp | ||
* @return {String} | ||
*/ | ||
showDefaultMessage ({ type, message, title, debugMsg }, vueApp) { | ||
showDefaultMessage ({ type, message, title, debugMsg }) { | ||
let msg = `Title: ${title}, Message: ${message}, DebugMsg: ${debugMsg}, type: ${type}` | ||
@@ -66,4 +65,64 @@ | ||
* @param {Object} elem | ||
* @param {String} className | ||
*/ | ||
clearFn (elem) { | ||
addClass (elem, className) { | ||
if (elem.classList) { | ||
elem.classList.add(className) | ||
} else { | ||
elem.className += ' ' + className | ||
} | ||
}, | ||
/** | ||
* @param {Object} elem | ||
* @param {String} className | ||
*/ | ||
removeClass (elem, className) { | ||
if (elem.classList) { | ||
elem.classList.remove(className) | ||
} else { | ||
elem.className = elem.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ') | ||
} | ||
}, | ||
/** | ||
* @param {Object} elem | ||
* @param {String} className | ||
* @return {Boolean} | ||
*/ | ||
hasClass (elem, className) { | ||
if (elem.classList) { | ||
return elem.classList.contains(className) | ||
} else { | ||
return new RegExp('(^| )' + className + '( |$)', 'gi').test(elem.className) | ||
} | ||
}, | ||
/** | ||
* @param {Object} elem | ||
* @param {String} message | ||
* @param {String} inClass | ||
* @param {String} outClass | ||
*/ | ||
showInlineFn (elem, message, { inClass, outClass }) { | ||
elem.innerText = message | ||
if (inClass) { | ||
if (!innerMethods.hasClass(elem, inClass)) innerMethods.addClass(elem, inClass) | ||
} | ||
if (outClass) { | ||
if (innerMethods.hasClass(elem, outClass)) innerMethods.removeClass(elem, outClass) | ||
} | ||
}, | ||
/** | ||
* @param {Object} elem | ||
* @param {String} inClass | ||
* @param {String} outClass | ||
*/ | ||
clearInlineFn (elem, { inClass, outClass }) { | ||
if (inClass) { | ||
if (innerMethods.hasClass(elem, inClass)) innerMethods.removeClass(elem, inClass) | ||
} | ||
if (outClass) { | ||
if (!innerMethods.hasClass(elem, outClass)) innerMethods.addClass(elem, outClass) | ||
} | ||
elem.innerText = '' | ||
@@ -76,2 +135,3 @@ }, | ||
* @param {String} message | ||
* @param {Object} classes | ||
* @param {Function} watch | ||
@@ -83,3 +143,3 @@ * @param {String} debugMsg | ||
*/ | ||
showInlineMessage ({ id, type, timeout, message, watch, debugMsg, cb }, vueApp) { | ||
showInlineMessage ({ id, type, timeout, message, classes = {}, watch, debugMsg, cb }, vueApp) { | ||
// TODO (S.Panfilov) handle class add and remove here | ||
@@ -89,13 +149,9 @@ if (debugMsg) innerMethods.showInConsole(debugMsg, type, TYPE) | ||
elem.innerText = message | ||
if (timeout && !watch) { | ||
setTimeout(() => { | ||
innerMethods.clearFn.call(vueApp, elem) | ||
}, timeout) | ||
} else { | ||
if (watch) { | ||
timeout = false | ||
if (watch && watch()) innerMethods.showInlineFn(elem, message, classes) | ||
const interval = setInterval(() => { | ||
if (watch && !watch()) { | ||
clearInterval(interval) | ||
innerMethods.clearFn.call(innerMethods, elem) | ||
innerMethods.clearInlineFn.call(innerMethods, elem, classes) | ||
} | ||
@@ -105,6 +161,13 @@ }, 50) | ||
if (!watch) { | ||
innerMethods.showInlineFn(elem, message, classes) | ||
setTimeout(() => { | ||
innerMethods.clearInlineFn.call(vueApp, elem, classes) | ||
}, timeout) | ||
} | ||
// TODO (S.Panfilov) BUG: Weird behaviour: cb calls 2 times | ||
if (cb) { | ||
// TODO (S.Panfilov) bug here | ||
cb.call(vueApp, elem, () => innerMethods.clearFn.call(innerMethods, elem)) | ||
cb.call(vueApp, elem, () => innerMethods.clearInlineFn.call(innerMethods, elem, classes)) | ||
} | ||
@@ -111,0 +174,0 @@ |
@@ -1,1 +0,1 @@ | ||
'use strict';var PLUGIN_NAME='VueNotifications',PACKAGE_NAME='vue-notifications',PROPERTY_NAME='notifications',TYPE={error:'error',warn:'warn',info:'info',success:'success'},VUE_VERSION={evangelion:1,ghostInTheShell:2},MESSAGES={alreadyInstalled:PLUGIN_NAME+': plugin already installed',methodNameConflict:PLUGIN_NAME+': names conflict - '},innerMethods={getVersion:function getVersion(a){var b=a.version.match(/(\d+)/g);return{major:+b[0],regular:+b[1],minor:+b[2]}},showInConsole:function showInConsole(a,b,c){b===c.error?console.error(a):b===c.warn?console.warn(a):b===c.success?console.info(a):console.log(a)},showDefaultMessage:function showDefaultMessage(_ref){var a=_ref.type,b=_ref.message,c=_ref.title,d=_ref.debugMsg,e='Title: '+c+', Message: '+b+', DebugMsg: '+d+', type: '+a;return innerMethods.showInConsole(e,a,TYPE),e},clearFn:function clearFn(a){a.innerText=''},showInlineMessage:function showInlineMessage(_ref2,h){var a=_ref2.id,b=_ref2.type,c=_ref2.timeout,d=_ref2.message,e=_ref2.watch,f=_ref2.debugMsg,g=_ref2.cb;f&&innerMethods.showInConsole(f,b,TYPE);var i=document.getElementById(a);return i.innerText=d,c&&!e?setTimeout(function(){innerMethods.clearFn.call(h,i)},c):function(){var j=setInterval(function(){e&&!e()&&(clearInterval(j),innerMethods.clearFn.call(innerMethods,i))},50)}(),(g&&g.call(h,i,function(){return innerMethods.clearFn.call(innerMethods,i)}),d)},getValues:function getValues(a,b){var c={},d=['cb','watch'];return Object.keys(b).forEach(function(e){d.forEach(function(f){c[e]=e===f?b[e].bind(a):'function'==typeof b[e]?b[e].call(a):b[e]})}),c},showMessage:function showMessage(a,b,c){var d=innerMethods.getValues(c,a),e=!!d.id;if(e)innerMethods.showInlineMessage(d,c);else{var f=b&&b[d.type],g=f?b[d.type]:innerMethods.showDefaultMessage;g(d,c)}return a.cb?a.cb():void 0},addMethods:function addMethods(a,b,c){Object.keys(b).forEach(function(d){a[b[d]]=function(e){return e.type=b[d],innerMethods.showMessage(e,c)}})},setMethod:function setMethod(a,b,c,d){c.methods||(c.methods={}),c.methods[b]?console.error(MESSAGES.methodNameConflict+b):c.methods[b]=innerMethods.makeMethod(a,b,c,d)},makeMethod:function makeMethod(a,b,c,d){return function(e){var f={};return Object.assign(f,VueNotifications.config),Object.assign(f,c[VueNotifications.propertyName][b]),Object.assign(f,e),innerMethods.showMessage(f,d,a)}},initVueNotificationPlugin:function initVueNotificationPlugin(a,b,c){b&&(Object.keys(b).forEach(function(d){innerMethods.setMethod(a,d,a.$options,c)}),a.$emit(PACKAGE_NAME+'-initiated'))}},VueNotifications={type:TYPE,propertyName:PROPERTY_NAME,config:{type:TYPE.info,timeout:3000},installed:!1,install:function install(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c={},d=void 0;if(this.installed)throw console.error(MESSAGES.alreadyInstalled);innerMethods.getVersion(a).major===VUE_VERSION.evangelion&&(d='init'),innerMethods.getVersion(a).major===VUE_VERSION.ghostInTheShell&&(d='beforeCreate'),c[d]=function(){var e=this,f=this.$options,g=f[VueNotifications.propertyName];innerMethods.initVueNotificationPlugin(e,g,b)},a.mixin(c),innerMethods.addMethods(this,this.type,b),this.installed=!0}};'undefined'!=typeof window&&window.Vue&&window.Vue.use(VueNotifications); | ||
'use strict';var PLUGIN_NAME='VueNotifications',PACKAGE_NAME='vue-notifications',PROPERTY_NAME='notifications',TYPE={error:'error',warn:'warn',info:'info',success:'success'},VUE_VERSION={evangelion:1,ghostInTheShell:2},MESSAGES={alreadyInstalled:PLUGIN_NAME+': plugin already installed',methodNameConflict:PLUGIN_NAME+': names conflict - '},innerMethods={getVersion:function getVersion(a){var b=a.version.match(/(\d+)/g);return{major:+b[0],regular:+b[1],minor:+b[2]}},showInConsole:function showInConsole(a,b,c){b===c.error?console.error(a):b===c.warn?console.warn(a):b===c.success?console.info(a):console.log(a)},showDefaultMessage:function showDefaultMessage(_ref){var a=_ref.type,b=_ref.message,c=_ref.title,d=_ref.debugMsg,e='Title: '+c+', Message: '+b+', DebugMsg: '+d+', type: '+a;return innerMethods.showInConsole(e,a,TYPE),e},addClass:function addClass(a,b){a.classList?a.classList.add(b):a.className+=' '+b},removeClass:function removeClass(a,b){a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp('(^|\\b)'+b.split(' ').join('|')+'(\\b|$)','gi'),' ')},hasClass:function hasClass(a,b){return a.classList?a.classList.contains(b):new RegExp('(^| )'+b+'( |$)','gi').test(a.className)},showInlineFn:function showInlineFn(a,b,_ref2){var c=_ref2.inClass,d=_ref2.outClass;a.innerText=b,c&&!innerMethods.hasClass(a,c)&&innerMethods.addClass(a,c),d&&innerMethods.hasClass(a,d)&&innerMethods.removeClass(a,d)},clearInlineFn:function clearInlineFn(a,_ref3){var b=_ref3.inClass,c=_ref3.outClass;b&&innerMethods.hasClass(a,b)&&innerMethods.removeClass(a,b),c&&!innerMethods.hasClass(a,c)&&innerMethods.addClass(a,c),a.innerText=''},showInlineMessage:function showInlineMessage(_ref4,i){var a=_ref4.id,b=_ref4.type,c=_ref4.timeout,d=_ref4.message,_ref4$classes=_ref4.classes,h=void 0===_ref4$classes?{}:_ref4$classes,e=_ref4.watch,f=_ref4.debugMsg,g=_ref4.cb;f&&innerMethods.showInConsole(f,b,TYPE);var j=document.getElementById(a);return e&&function(){c=!1,e&&e()&&innerMethods.showInlineFn(j,d,h);var k=setInterval(function(){e&&!e()&&(clearInterval(k),innerMethods.clearInlineFn.call(innerMethods,j,h))},50)}(),e||(innerMethods.showInlineFn(j,d,h),setTimeout(function(){innerMethods.clearInlineFn.call(i,j,h)},c)),g&&g.call(i,j,function(){return innerMethods.clearInlineFn.call(innerMethods,j,h)}),d},getValues:function getValues(a,b){var c={},d=['cb','watch'];return Object.keys(b).forEach(function(e){d.forEach(function(f){c[e]=e===f?b[e].bind(a):'function'==typeof b[e]?b[e].call(a):b[e]})}),c},showMessage:function showMessage(a,b,c){var d=innerMethods.getValues(c,a),e=!!d.id;if(e)innerMethods.showInlineMessage(d,c);else{var f=b&&b[d.type],g=f?b[d.type]:innerMethods.showDefaultMessage;g(d,c)}return a.cb?a.cb():void 0},addMethods:function addMethods(a,b,c){Object.keys(b).forEach(function(d){a[b[d]]=function(e){return e.type=b[d],innerMethods.showMessage(e,c)}})},setMethod:function setMethod(a,b,c,d){c.methods||(c.methods={}),c.methods[b]?console.error(MESSAGES.methodNameConflict+b):c.methods[b]=innerMethods.makeMethod(a,b,c,d)},makeMethod:function makeMethod(a,b,c,d){return function(e){var f={};return Object.assign(f,VueNotifications.config),Object.assign(f,c[VueNotifications.propertyName][b]),Object.assign(f,e),innerMethods.showMessage(f,d,a)}},initVueNotificationPlugin:function initVueNotificationPlugin(a,b,c){b&&(Object.keys(b).forEach(function(d){innerMethods.setMethod(a,d,a.$options,c)}),a.$emit(PACKAGE_NAME+'-initiated'))}},VueNotifications={type:TYPE,propertyName:PROPERTY_NAME,config:{type:TYPE.info,timeout:3000},installed:!1,install:function install(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c={},d=void 0;if(this.installed)throw console.error(MESSAGES.alreadyInstalled);innerMethods.getVersion(a).major===VUE_VERSION.evangelion&&(d='init'),innerMethods.getVersion(a).major===VUE_VERSION.ghostInTheShell&&(d='beforeCreate'),c[d]=function(){var e=this,f=this.$options,g=f[VueNotifications.propertyName];innerMethods.initVueNotificationPlugin(e,g,b)},a.mixin(c),innerMethods.addMethods(this,this.type,b),this.installed=!0}};'undefined'!=typeof window&&window.Vue&&window.Vue.use(VueNotifications); |
{ | ||
"name": "vue-notifications", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "Vuejs notifications", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue-notifications.es5.js", |
10
TODO.md
### TODOs | ||
| Filename | line # | TODO | ||
|:------|:------:|:------ | ||
| main.js | 81 | @S.Panfilov handle class add and remove here | ||
| main.js | 100 | @S.Panfilov BUG: Weird behaviour: cb calls 2 times | ||
| main.js | 102 | @S.Panfilov bug here | ||
| main.js | 167 | @S.Panfilov fix 'vueApp' in param | ||
| main.js | 185 | @S.Panfilov not sure - throw error here or just warn | ||
| main.js | 141 | @S.Panfilov handle class add and remove here | ||
| main.js | 163 | @S.Panfilov BUG: Weird behaviour: cb calls 2 times | ||
| main.js | 165 | @S.Panfilov bug here | ||
| main.js | 230 | @S.Panfilov fix 'vueApp' in param | ||
| main.js | 248 | @S.Panfilov not sure - throw error here or just warn | ||
| unit/main.spec.js | 283 | @S.Panfilov fix this test |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
261761
1051