vue-notifications
Advanced tools
Comparing version 0.8.2 to 0.9.0
@@ -18,3 +18,3 @@ ;(function(root, factory) { | ||
var TYPE = { | ||
var TYPES = { | ||
error: 'error', | ||
@@ -27,3 +27,2 @@ warn: 'warn', | ||
var EVANGELION = 1; | ||
var GHOST_IN_THE_SHELL = 2; | ||
@@ -35,3 +34,3 @@ var MESSAGES = { | ||
function getMajorVersion(Vue) { | ||
function getVersion(Vue) { | ||
var version = Vue.version.match(/(\d+)/g); | ||
@@ -41,17 +40,9 @@ return +version[0]; | ||
function showInConsole(msg, type, types) { | ||
if (type === types.error) console.error(msg);else if (type === types.warn) console.warn(msg);else console.log(msg); | ||
} | ||
function showDefaultMessage(_ref) { | ||
var type = _ref.type, | ||
message = _ref.message, | ||
title = _ref.title, | ||
debugMsg = _ref.debugMsg; | ||
title = _ref.title; | ||
var msg = 'Title: ' + title + ' Message: ' + message + ' DebugMsg: ' + debugMsg + ' type: ' + type; | ||
showInConsole(msg, type, TYPE); | ||
return msg; | ||
var msg = 'Title: ' + title + ', Message: ' + message + ', Type: ' + type; | ||
if (type === TYPES.error) console.error(msg);else if (type === TYPES.warn) console.warn(msg);else console.log(msg); | ||
} | ||
@@ -61,12 +52,9 @@ | ||
var result = {}; | ||
var keepFnFields = ['cb']; | ||
Object.keys(config).forEach(function (field) { | ||
keepFnFields.forEach(function (fnField) { | ||
if (field === fnField) { | ||
result[field] = config[field].bind(vueApp); | ||
} else { | ||
result[field] = typeof config[field] === 'function' ? config[field].call(vueApp) : config[field]; | ||
} | ||
}); | ||
if (field === 'cb') { | ||
result[field] = config[field].bind(vueApp); | ||
} else { | ||
result[field] = typeof config[field] === 'function' ? config[field].call(vueApp) : config[field]; | ||
} | ||
}); | ||
@@ -77,6 +65,6 @@ | ||
function showMessage(config, options, vueApp) { | ||
function showMessage(config, vueApp) { | ||
var valuesObj = getValues(vueApp, config); | ||
var isMethodOverridden = options && options[valuesObj.type]; | ||
var method = isMethodOverridden ? options[valuesObj.type] : showDefaultMessage; | ||
var isMethodOverridden = VueNotifications.pluginOptions[valuesObj.type]; | ||
var method = isMethodOverridden ? VueNotifications.pluginOptions[valuesObj.type] : showDefaultMessage; | ||
method(valuesObj, vueApp); | ||
@@ -87,3 +75,3 @@ | ||
function addMethods(targetObj, typesObj, options) { | ||
function addMethods(targetObj, typesObj) { | ||
Object.keys(typesObj).forEach(function (v) { | ||
@@ -93,3 +81,3 @@ targetObj[typesObj[v]] = function (config) { | ||
return showMessage(config, options); | ||
return showMessage(config); | ||
}; | ||
@@ -109,6 +97,3 @@ }); | ||
return function (config) { | ||
var newConfig = {}; | ||
Object.assign(newConfig, VueNotifications.config); | ||
Object.assign(newConfig, options[VueNotifications.propertyName][configName]); | ||
Object.assign(newConfig, config); | ||
var newConfig = Object.assign({}, VueNotifications.config, options[VueNotifications.propertyName][configName], config); | ||
@@ -122,5 +107,4 @@ return showMessage(newConfig, pluginOptions, vueApp); | ||
Object.keys(notifications).forEach(function (name) { | ||
setMethod(vueApp, name, vueApp.$options, pluginOptions); | ||
return setMethod(vueApp, name, vueApp.$options, pluginOptions); | ||
}); | ||
vueApp.$emit(PACKAGE_NAME + '-initiated'); | ||
@@ -145,28 +129,10 @@ } | ||
var hooks = { | ||
init: '', | ||
destroy: 'beforeDestroy', | ||
mounted: '' | ||
}; | ||
var init = getVersion(Vue) === EVANGELION ? 'init' : 'beforeCreate'; | ||
if (getMajorVersion(Vue) === EVANGELION) { | ||
hooks.init = 'init'; | ||
hooks.mounted = 'compiled'; | ||
} | ||
if (getMajorVersion(Vue) === GHOST_IN_THE_SHELL) { | ||
hooks.init = 'beforeCreate'; | ||
hooks.mounted = 'mounted'; | ||
} | ||
return _ref2 = {}, _defineProperty(_ref2, hooks.init, function () { | ||
var vueApp = this; | ||
var vueAppOptions = this.$options; | ||
var notificationsField = vueAppOptions[VueNotifications.propertyName]; | ||
initVueNotificationPlugin(vueApp, notificationsField, pluginOptions); | ||
}), _defineProperty(_ref2, hooks.destroy, function () { | ||
var vueApp = this; | ||
var vueAppOptions = this.$options; | ||
var notificationsField = vueAppOptions[VueNotifications.propertyName]; | ||
unlinkVueNotificationPlugin(vueApp, notificationsField); | ||
return _ref2 = {}, _defineProperty(_ref2, init, function () { | ||
var notificationsField = this.$options[VueNotifications.propertyName]; | ||
initVueNotificationPlugin(this, notificationsField, pluginOptions); | ||
}), _defineProperty(_ref2, 'beforeDestroy', function beforeDestroy() { | ||
var notificationsField = this.$options[VueNotifications.propertyName]; | ||
unlinkVueNotificationPlugin(this, notificationsField); | ||
}), _ref2; | ||
@@ -176,8 +142,9 @@ } | ||
var VueNotifications = { | ||
type: TYPE, | ||
types: TYPES, | ||
propertyName: PROPERTY_NAME, | ||
config: { | ||
type: TYPE.info, | ||
type: TYPES.info, | ||
timeout: 3000 | ||
}, | ||
pluginOptions: {}, | ||
installed: false, | ||
@@ -191,5 +158,11 @@ install: function install(Vue) { | ||
addMethods(this, this.type, pluginOptions); | ||
this.setPluginOptions(pluginOptions); | ||
addMethods(this, this.types); | ||
this.installed = true; | ||
}, | ||
setPluginOptions: function setPluginOptions() { | ||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
this.pluginOptions = options; | ||
} | ||
@@ -196,0 +169,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.VueNotifications=t()}(this,function(){"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e){return+e.version.match(/(\d+)/g)[0]}function n(e,t,n){t===n.error?console.error(e):t===n.warn?console.warn(e):console.log(e)}function i(e){var t=e.type,i=e.message,o="Title: "+e.title+" Message: "+i+" DebugMsg: "+e.debugMsg+" type: "+t;return n(o,t,p),o}function o(e,t){var n={},i=["cb"];return Object.keys(t).forEach(function(o){i.forEach(function(i){n[o]=o===i?t[o].bind(e):"function"==typeof t[o]?t[o].call(e):t[o]})}),n}function r(e,t,n){var r=o(n,e);if((t&&t[r.type]?t[r.type]:i)(r,n),e.cb)return e.cb()}function c(e,t,n){Object.keys(t).forEach(function(i){e[t[i]]=function(e){return e.type=t[i],r(e,n)}})}function s(e,t,n,i){n.methods||(n.methods={}),n.methods[t]||(n.methods[t]=u(e,t,n,i))}function u(e,t,n,i){return function(o){var c={};return Object.assign(c,b.config),Object.assign(c,n[b.propertyName][t]),Object.assign(c,o),r(c,i,e)}}function f(e,t,n){t&&(Object.keys(t).forEach(function(t){s(e,t,e.$options,n)}),e.$emit(l+"-initiated"))}function a(e,t){if(t){var n=e.$options.methods;Object.keys(t).forEach(function(e){n[e]&&(n[e]=void 0,delete n[e])}),e.$emit(l+"-unlinked")}}function d(n,i){var o,r={init:"",destroy:"beforeDestroy",mounted:""};return t(n)===y&&(r.init="init",r.mounted="compiled"),t(n)===m&&(r.init="beforeCreate",r.mounted="mounted"),o={},e(o,r.init,function(){f(this,this.$options[b.propertyName],i)}),e(o,r.destroy,function(){a(this,this.$options[b.propertyName])}),o}var l="vue-notifications",p={error:"error",warn:"warn",info:"info",success:"success"},y=1,m=2,h={alreadyInstalled:"VueNotifications: plugin already installed",methodNameConflict:"VueNotifications: names conflict - "},b={type:p,propertyName:"notifications",config:{type:p.info,timeout:3e3},installed:!1,install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.installed)throw console.error(h.alreadyInstalled);var n=d(e,t);e.mixin(n),c(this,this.type,t),this.installed=!0}};return"undefined"!=typeof window&&window.Vue&&window.Vue.use(b),b}); | ||
!function(n,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():n.VueNotifications=t()}(this,function(){"use strict";function n(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function t(n){return+n.version.match(/(\d+)/g)[0]}function e(n){var t=n.type,e=n.message,i="Title: "+n.title+", Message: "+e+", Type: "+t;t===p.error?console.error(i):t===p.warn?console.warn(i):console.log(i)}function i(n,t){var e={};return Object.keys(t).forEach(function(i){e[i]="cb"===i?t[i].bind(n):"function"==typeof t[i]?t[i].call(n):t[i]}),e}function o(n,t){var o=i(t,n);if((y.pluginOptions[o.type]?y.pluginOptions[o.type]:e)(o,t),n.cb)return n.cb()}function r(n,t){Object.keys(t).forEach(function(e){n[t[e]]=function(n){return n.type=t[e],o(n)}})}function s(n,t,e,i){e.methods||(e.methods={}),e.methods[t]||(e.methods[t]=c(n,t,e,i))}function c(n,t,e,i){return function(r){return o(Object.assign({},y.config,e[y.propertyName][t],r),i,n)}}function u(n,t,e){t&&(Object.keys(t).forEach(function(t){return s(n,t,n.$options,e)}),n.$emit(l+"-initiated"))}function f(n,t){if(t){var e=n.$options.methods;Object.keys(t).forEach(function(n){e[n]&&(e[n]=void 0,delete e[n])}),n.$emit(l+"-unlinked")}}function a(e,i){var o;return o={},n(o,t(e)===d?"init":"beforeCreate",function(){u(this,this.$options[y.propertyName],i)}),n(o,"beforeDestroy",function(){f(this,this.$options[y.propertyName])}),o}var l="vue-notifications",p={error:"error",warn:"warn",info:"info",success:"success"},d=1,h={alreadyInstalled:"VueNotifications: plugin already installed",methodNameConflict:"VueNotifications: names conflict - "},y={types:p,propertyName:"notifications",config:{type:p.info,timeout:3e3},pluginOptions:{},installed:!1,install:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.installed)throw console.error(h.alreadyInstalled);var e=a(n,t);n.mixin(e),this.setPluginOptions(t),r(this,this.types),this.installed=!0},setPluginOptions:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pluginOptions=n}};return"undefined"!=typeof window&&window.Vue&&window.Vue.use(y),y}); | ||
//# sourceMappingURL=vue-notifications.es5.min.js.map |
@@ -5,3 +5,3 @@ const PLUGIN_NAME = 'VueNotifications' | ||
const TYPE = { | ||
const TYPES = { | ||
error: 'error', | ||
@@ -14,3 +14,2 @@ warn: 'warn', | ||
const EVANGELION = 1 | ||
const GHOST_IN_THE_SHELL = 2 | ||
@@ -22,3 +21,3 @@ const MESSAGES = { | ||
function getMajorVersion (Vue) { | ||
function getVersion (Vue) { | ||
const version = Vue.version.match(/(\d+)/g) | ||
@@ -28,28 +27,18 @@ return +version[0] | ||
function showInConsole (msg, type, types) { | ||
if (type === types.error) console.error(msg) | ||
else if (type === types.warn) console.warn(msg) | ||
function showDefaultMessage ({type, message, title}) { | ||
let msg = `Title: ${title}, Message: ${message}, Type: ${type}` | ||
if (type === TYPES.error) console.error(msg) | ||
else if (type === TYPES.warn) console.warn(msg) | ||
else console.log(msg) | ||
} | ||
function showDefaultMessage ({type, message, title, debugMsg}) { | ||
let msg = `Title: ${title} Message: ${message} DebugMsg: ${debugMsg} type: ${type}` | ||
showInConsole(msg, type, TYPE) | ||
return msg | ||
} | ||
function getValues (vueApp, config) { | ||
const result = {} | ||
const keepFnFields = ['cb'] | ||
Object.keys(config).forEach(field => { | ||
keepFnFields.forEach(fnField => { | ||
if (field === fnField) { | ||
result[field] = config[field].bind(vueApp) | ||
} else { | ||
result[field] = (typeof config[field] === 'function') ? config[field].call(vueApp) : config[field] | ||
} | ||
}) | ||
if (field === 'cb') { | ||
result[field] = config[field].bind(vueApp) | ||
} else { | ||
result[field] = (typeof config[field] === 'function') ? config[field].call(vueApp) : config[field] | ||
} | ||
}) | ||
@@ -60,6 +49,6 @@ | ||
function showMessage (config, options, vueApp) { | ||
function showMessage (config, vueApp) { | ||
const valuesObj = getValues(vueApp, config) | ||
const isMethodOverridden = options && options[valuesObj.type] | ||
const method = isMethodOverridden ? options[valuesObj.type] : showDefaultMessage | ||
const isMethodOverridden = VueNotifications.pluginOptions[valuesObj.type] | ||
const method = isMethodOverridden ? VueNotifications.pluginOptions[valuesObj.type] : showDefaultMessage | ||
method(valuesObj, vueApp) | ||
@@ -70,3 +59,3 @@ | ||
function addMethods (targetObj, typesObj, options) { | ||
function addMethods (targetObj, typesObj) { | ||
Object.keys(typesObj).forEach(v => { | ||
@@ -76,3 +65,3 @@ targetObj[typesObj[v]] = function (config) { | ||
// TODO (S.Panfilov) fix 'vueApp' in param | ||
return showMessage(config, options) | ||
return showMessage(config) | ||
} | ||
@@ -105,6 +94,6 @@ }) | ||
return function (config) { | ||
const newConfig = {} | ||
Object.assign(newConfig, VueNotifications.config) | ||
Object.assign(newConfig, options[VueNotifications.propertyName][configName]) | ||
Object.assign(newConfig, config) | ||
const newConfig = Object.assign({}, | ||
VueNotifications.config, | ||
options[VueNotifications.propertyName][configName], | ||
config) | ||
@@ -117,6 +106,3 @@ return showMessage(newConfig, pluginOptions, vueApp) | ||
if (!notifications) return | ||
Object.keys(notifications).forEach(name => { | ||
setMethod(vueApp, name, vueApp.$options, pluginOptions) | ||
}) | ||
Object.keys(notifications).forEach(name => setMethod(vueApp, name, vueApp.$options, pluginOptions)) | ||
vueApp.$emit(`${PACKAGE_NAME}-initiated`) | ||
@@ -139,30 +125,14 @@ } | ||
function makeMixin (Vue, pluginOptions) { | ||
let hooks = { | ||
init: '', | ||
destroy: 'beforeDestroy', | ||
mounted: '' | ||
} | ||
const init = getVersion(Vue) === EVANGELION ? 'init' : 'beforeCreate' | ||
if (getMajorVersion(Vue) === EVANGELION) { | ||
hooks.init = 'init' | ||
hooks.mounted = 'compiled' | ||
} | ||
if (getMajorVersion(Vue) === GHOST_IN_THE_SHELL) { | ||
hooks.init = 'beforeCreate' | ||
hooks.mounted = 'mounted' | ||
} | ||
return { | ||
[hooks.init]: function () { | ||
const vueApp = this | ||
const vueAppOptions = this.$options | ||
const notificationsField = vueAppOptions[VueNotifications.propertyName] | ||
initVueNotificationPlugin(vueApp, notificationsField, pluginOptions) | ||
[init]: function () { | ||
//this === vueApp | ||
const notificationsField = this.$options[VueNotifications.propertyName] | ||
initVueNotificationPlugin(this, notificationsField, pluginOptions) | ||
}, | ||
[hooks.destroy]: function () { | ||
const vueApp = this | ||
const vueAppOptions = this.$options | ||
const notificationsField = vueAppOptions[VueNotifications.propertyName] | ||
unlinkVueNotificationPlugin(vueApp, notificationsField) | ||
'beforeDestroy': function () { | ||
//this === vueApp | ||
const notificationsField = this.$options[VueNotifications.propertyName] | ||
unlinkVueNotificationPlugin(this, notificationsField) | ||
} | ||
@@ -173,8 +143,9 @@ } | ||
const VueNotifications = { | ||
type: TYPE, | ||
types: TYPES, | ||
propertyName: PROPERTY_NAME, | ||
config: { | ||
type: TYPE.info, | ||
type: TYPES.info, | ||
timeout: 3000 | ||
}, | ||
pluginOptions: {}, | ||
installed: false, | ||
@@ -192,5 +163,9 @@ /** | ||
addMethods(this, this.type, pluginOptions) | ||
this.setPluginOptions(pluginOptions) | ||
addMethods(this, this.types) | ||
this.installed = true | ||
}, | ||
setPluginOptions (options = {}) { | ||
this.pluginOptions = options | ||
} | ||
@@ -197,0 +172,0 @@ |
@@ -1,1 +0,1 @@ | ||
'use strict';function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}var PLUGIN_NAME='VueNotifications',PACKAGE_NAME='vue-notifications',PROPERTY_NAME='notifications',TYPE={error:'error',warn:'warn',info:'info',success:'success'},EVANGELION=1,GHOST_IN_THE_SHELL=2,MESSAGES={alreadyInstalled:PLUGIN_NAME+': plugin already installed',methodNameConflict:PLUGIN_NAME+': names conflict - '};function getMajorVersion(a){var b=a.version.match(/(\d+)/g);return+b[0]}function showInConsole(a,b,c){b===c.error?console.error(a):b===c.warn?console.warn(a):console.log(a)}function showDefaultMessage(a){var b=a.type,c=a.message,d=a.title,e=a.debugMsg,f='Title: '+d+' Message: '+c+' DebugMsg: '+e+' type: '+b;return showInConsole(f,b,TYPE),f}function getValues(a,b){var c={},d=['cb'];return Object.keys(b).forEach(function(e){d.forEach(function(d){c[e]=e===d?b[e].bind(a):'function'==typeof b[e]?b[e].call(a):b[e]})}),c}function showMessage(a,b,c){var d=getValues(c,a),e=b&&b[d.type],f=e?b[d.type]:showDefaultMessage;if(f(d,c),a.cb)return a.cb()}function addMethods(a,b,c){Object.keys(b).forEach(function(d){a[b[d]]=function(a){return a.type=b[d],showMessage(a,c)}})}function setMethod(a,b,c,d){c.methods||(c.methods={}),c.methods[b]||(c.methods[b]=makeMethod(a,b,c,d))}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),showMessage(f,d,a)}}function initVueNotificationPlugin(a,b,c){b&&(Object.keys(b).forEach(function(b){setMethod(a,b,a.$options,c)}),a.$emit(PACKAGE_NAME+'-initiated'))}function unlinkVueNotificationPlugin(a,b){if(b){var c=a.$options.methods;Object.keys(b).forEach(function(a){c[a]&&(c[a]=void 0,delete c[a])}),a.$emit(PACKAGE_NAME+'-unlinked')}}function makeMixin(a,b){var c,d={init:'',destroy:'beforeDestroy',mounted:''};return getMajorVersion(a)===EVANGELION&&(d.init='init',d.mounted='compiled'),getMajorVersion(a)===GHOST_IN_THE_SHELL&&(d.init='beforeCreate',d.mounted='mounted'),(c={},_defineProperty(c,d.init,function(){var a=this,c=this.$options,d=c[VueNotifications.propertyName];initVueNotificationPlugin(a,d,b)}),_defineProperty(c,d.destroy,function(){var a=this,b=this.$options,c=b[VueNotifications.propertyName];unlinkVueNotificationPlugin(a,c)}),c)}var VueNotifications={type:TYPE,propertyName:PROPERTY_NAME,config:{type:TYPE.info,timeout:3e3},installed:!1,install:function install(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};if(this.installed)throw console.error(MESSAGES.alreadyInstalled);var c=makeMixin(a,b);a.mixin(c),addMethods(this,this.type,b),this.installed=!0}};'undefined'!=typeof window&&window.Vue&&window.Vue.use(VueNotifications); | ||
'use strict';function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}var PLUGIN_NAME='VueNotifications',PACKAGE_NAME='vue-notifications',PROPERTY_NAME='notifications',TYPES={error:'error',warn:'warn',info:'info',success:'success'},EVANGELION=1,MESSAGES={alreadyInstalled:PLUGIN_NAME+': plugin already installed',methodNameConflict:PLUGIN_NAME+': names conflict - '};function getVersion(a){var b=a.version.match(/(\d+)/g);return+b[0]}function showDefaultMessage(a){var b=a.type,c=a.message,d=a.title,e='Title: '+d+', Message: '+c+', Type: '+b;b===TYPES.error?console.error(e):b===TYPES.warn?console.warn(e):console.log(e)}function getValues(a,b){var c={};return Object.keys(b).forEach(function(d){c[d]='cb'===d?b[d].bind(a):'function'==typeof b[d]?b[d].call(a):b[d]}),c}function showMessage(a,b){var c=getValues(b,a),d=VueNotifications.pluginOptions[c.type],e=d?VueNotifications.pluginOptions[c.type]:showDefaultMessage;if(e(c,b),a.cb)return a.cb()}function addMethods(a,b){Object.keys(b).forEach(function(c){a[b[c]]=function(a){return a.type=b[c],showMessage(a)}})}function setMethod(a,b,c,d){c.methods||(c.methods={}),c.methods[b]||(c.methods[b]=makeMethod(a,b,c,d))}function makeMethod(a,b,c,d){return function(e){var f=Object.assign({},VueNotifications.config,c[VueNotifications.propertyName][b],e);return showMessage(f,d,a)}}function initVueNotificationPlugin(a,b,c){b&&(Object.keys(b).forEach(function(b){return setMethod(a,b,a.$options,c)}),a.$emit(PACKAGE_NAME+'-initiated'))}function unlinkVueNotificationPlugin(a,b){if(b){var c=a.$options.methods;Object.keys(b).forEach(function(a){c[a]&&(c[a]=void 0,delete c[a])}),a.$emit(PACKAGE_NAME+'-unlinked')}}function makeMixin(a,b){var c,d=getVersion(a)===EVANGELION?'init':'beforeCreate';return c={},_defineProperty(c,d,function(){var a=this.$options[VueNotifications.propertyName];initVueNotificationPlugin(this,a,b)}),_defineProperty(c,'beforeDestroy',function beforeDestroy(){var a=this.$options[VueNotifications.propertyName];unlinkVueNotificationPlugin(this,a)}),c}var VueNotifications={types:TYPES,propertyName:PROPERTY_NAME,config:{type:TYPES.info,timeout:3e3},pluginOptions:{},installed:!1,install:function install(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};if(this.installed)throw console.error(MESSAGES.alreadyInstalled);var c=makeMixin(a,b);a.mixin(c),this.setPluginOptions(b),addMethods(this,this.types),this.installed=!0},setPluginOptions:function setPluginOptions(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};this.pluginOptions=a}};'undefined'!=typeof window&&window.Vue&&window.Vue.use(VueNotifications); |
{ | ||
"name": "vue-notifications", | ||
"version": "0.8.2", | ||
"version": "0.9.0", | ||
"description": "Vuejs notifications", | ||
@@ -9,4 +9,4 @@ "main": "dist/vue-notifications.es5.js", | ||
"build": "cross-env BABEL_ENV=production && gulp make", | ||
"docs": "cd ./docs gitbook build ./html", | ||
"docs:to:gh": "cpx './docs/**' ../dev-server/docs", | ||
"docs": "rimraf ./docs/html/** && gitbook build ./docs/md/ ./docs/html", | ||
"docs:to:gh": "rimraf ../dev-server/docs/** && cpx './docs/**' ../dev-server/docs", | ||
"update": "ncu -a && yarn upgrade", | ||
@@ -58,3 +58,3 @@ "upgrade": "yarn upgrade", | ||
"cpx": "1.5.0", | ||
"cross-env": "^5.0.5", | ||
"cross-env": "5.0.5", | ||
"eslint": "4.7.1", | ||
@@ -83,2 +83,3 @@ "eslint-config-standard": "10.2.1", | ||
"require-dir": "0.3.2", | ||
"rimraf": "^2.6.2", | ||
"run-sequence": "2.2.0", | ||
@@ -85,0 +86,0 @@ "sinon": "3.3.0", |
@@ -10,2 +10,4 @@ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8a6dee4e21d04653b53c0a9618a2cc84)](https://www.codacy.com/app/se-panfilov/vue-notifications?utm_source=github.com&utm_medium=referral&utm_content=se-panfilov/vue-notifications&utm_campaign=Badge_Grade) | ||
| [SITE](https://se-panfilov.github.io/vue-notifications/) | [DOCS](https://se-panfilov.github.io/vue-notifications/docs/html/index.html) | [GITHUB](https://github.com/se-panfilov/vue-notifications) | | ||
# vue-notifications | ||
@@ -129,3 +131,3 @@ | ||
message: 'Failed to authenticate', | ||
type: 'error' //Default: 'info', also you can use VueNotifications.type.error instead of 'error' | ||
type: 'error' //Default: 'info', also you can use VueNotifications.types.error instead of 'error' | ||
} | ||
@@ -189,3 +191,3 @@ }, | ||
message: 'Failed to authenticate', | ||
type: 'error', //Also you can use VueNotifications.type.error instead of 'error' | ||
type: 'error', //Also you can use VueNotifications.types.error instead of 'error' | ||
consoleMessage: 'let it be in console', | ||
@@ -192,0 +194,0 @@ consoleMessage2: 'let it be in console too', |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 5 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
1545608
64
3020
247
49
1
80
3
9
6