vue-toast-notification
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -10,3 +10,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
root["VueToast"] = factory(); | ||
})(this, function() { | ||
})(this, () => { | ||
return /******/ (() => { // webpackBootstrap | ||
@@ -45,7 +45,45 @@ /******/ "use strict"; | ||
;// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/js/Component.vue?vue&type=template&id=6dd22dbe& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"enter-active-class":_vm.transition.enter,"leave-active-class":_vm.transition.leave}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isActive),expression:"isActive"}],staticClass:"v-toast__item",class:[("v-toast__item--" + _vm.type), ("v-toast__item--" + _vm.position)],attrs:{"role":"alert"},on:{"mouseover":function($event){return _vm.toggleTimer(true)},"mouseleave":function($event){return _vm.toggleTimer(false)},"click":_vm.whenClicked}},[_c('div',{staticClass:"v-toast__icon"}),_vm._v(" "),_c('p',{staticClass:"v-toast__text",domProps:{"innerHTML":_vm._s(_vm.message)}})])])} | ||
var staticRenderFns = [] | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_fswvdo7jykdwhfxrdcvghfn6pa/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@15.10.0_iocpgemohyqh7pam3r2r2fxxra/node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/.pnpm/vue-loader@15.10.0_iocpgemohyqh7pam3r2r2fxxra/node_modules/vue-loader/lib/index.js??vue-loader-options!./src/js/Component.vue?vue&type=template&id=6dd22dbe& | ||
var render = function render() { | ||
var _vm = this, | ||
_c = _vm._self._c; | ||
return _c('transition', { | ||
attrs: { | ||
"enter-active-class": _vm.transition.enter, | ||
"leave-active-class": _vm.transition.leave | ||
} | ||
}, [_c('div', { | ||
directives: [{ | ||
name: "show", | ||
rawName: "v-show", | ||
value: _vm.isActive, | ||
expression: "isActive" | ||
}], | ||
staticClass: "v-toast__item", | ||
class: ["v-toast__item--".concat(_vm.type), "v-toast__item--".concat(_vm.position)], | ||
attrs: { | ||
"role": "alert" | ||
}, | ||
on: { | ||
"mouseover": function ($event) { | ||
return _vm.toggleTimer(true); | ||
}, | ||
"mouseleave": function ($event) { | ||
return _vm.toggleTimer(false); | ||
}, | ||
"click": _vm.whenClicked | ||
} | ||
}, [_c('div', { | ||
staticClass: "v-toast__icon" | ||
}), _vm._v(" "), _c('p', { | ||
staticClass: "v-toast__text", | ||
domProps: { | ||
"innerHTML": _vm._s(_vm.message) | ||
} | ||
})])]); | ||
}; | ||
var staticRenderFns = []; | ||
;// CONCATENATED MODULE: ./src/js/helpers.js | ||
@@ -96,28 +134,10 @@ const removeElement = el => { | ||
})); | ||
;// CONCATENATED MODULE: ./node_modules/mitt/dist/mitt.es.js | ||
/* harmony default export */ function mitt_es(n){return{all:n=n||new Map,on:function(t,e){var i=n.get(t);i&&i.push(e)||n.set(t,[e])},off:function(t,e){var i=n.get(t);i&&i.splice(i.indexOf(e)>>>0,1)},emit:function(t,e){(n.get(t)||[]).slice().map(function(n){n(e)}),(n.get("*")||[]).slice().map(function(n){n(t,e)})}}} | ||
//# sourceMappingURL=mitt.es.js.map | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/mitt@3.0.0/node_modules/mitt/dist/mitt.mjs | ||
/* harmony default export */ function mitt(n){return{all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e])},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]))},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e)}),(i=n.get("*"))&&i.slice().map(function(n){n(t,e)})}}} | ||
//# sourceMappingURL=mitt.mjs.map | ||
;// CONCATENATED MODULE: ./src/js/bus.js | ||
/* harmony default export */ const bus = (mitt_es()); | ||
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/js/Component.vue?vue&type=script&lang=js& | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
/* harmony default export */ const bus = (mitt()); | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_fswvdo7jykdwhfxrdcvghfn6pa/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@15.10.0_iocpgemohyqh7pam3r2r2fxxra/node_modules/vue-loader/lib/index.js??vue-loader-options!./src/js/Component.vue?vue&type=script&lang=js& | ||
@@ -298,3 +318,3 @@ | ||
/* harmony default export */ const js_Componentvue_type_script_lang_js_ = (Componentvue_type_script_lang_js_); | ||
;// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/vue-loader@15.10.0_iocpgemohyqh7pam3r2r2fxxra/node_modules/vue-loader/lib/runtime/componentNormalizer.js | ||
/* globals __VUE_SSR_CONTEXT__ */ | ||
@@ -306,3 +326,3 @@ | ||
function normalizeComponent ( | ||
function normalizeComponent( | ||
scriptExports, | ||
@@ -314,9 +334,8 @@ render, | ||
scopeId, | ||
moduleIdentifier, /* server only */ | ||
moduleIdentifier /* server only */, | ||
shadowMode /* vue-cli only */ | ||
) { | ||
// Vue.extend constructor export interop | ||
var options = typeof scriptExports === 'function' | ||
? scriptExports.options | ||
: scriptExports | ||
var options = | ||
typeof scriptExports === 'function' ? scriptExports.options : scriptExports | ||
@@ -341,3 +360,4 @@ // render functions | ||
var hook | ||
if (moduleIdentifier) { // server build | ||
if (moduleIdentifier) { | ||
// server build | ||
hook = function (context) { | ||
@@ -368,7 +388,7 @@ // 2.3 injection | ||
? function () { | ||
injectStyles.call( | ||
this, | ||
(options.functional ? this.parent : this).$root.$options.shadowRoot | ||
) | ||
} | ||
injectStyles.call( | ||
this, | ||
(options.functional ? this.parent : this).$root.$options.shadowRoot | ||
) | ||
} | ||
: injectStyles | ||
@@ -384,3 +404,3 @@ } | ||
var originalRender = options.render | ||
options.render = function renderWithStyleInjection (h, context) { | ||
options.render = function renderWithStyleInjection(h, context) { | ||
hook.call(context) | ||
@@ -392,5 +412,3 @@ return originalRender(h, context) | ||
var existing = options.beforeCreate | ||
options.beforeCreate = existing | ||
? [].concat(existing, hook) | ||
: [hook] | ||
options.beforeCreate = existing ? [].concat(existing, hook) : [hook] | ||
} | ||
@@ -429,3 +447,4 @@ } | ||
const Api = (Vue, globalOptions = {}) => { | ||
const Api = function (Vue) { | ||
let globalOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return { | ||
@@ -449,3 +468,4 @@ open(options) { | ||
success(message, options = {}) { | ||
success(message) { | ||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return this.open(Object.assign({}, { | ||
@@ -457,3 +477,4 @@ message, | ||
error(message, options = {}) { | ||
error(message) { | ||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return this.open(Object.assign({}, { | ||
@@ -465,3 +486,4 @@ message, | ||
info(message, options = {}) { | ||
info(message) { | ||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return this.open(Object.assign({}, { | ||
@@ -473,3 +495,4 @@ message, | ||
warning(message, options = {}) { | ||
warning(message) { | ||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return this.open(Object.assign({}, { | ||
@@ -481,3 +504,4 @@ message, | ||
default(message, options = {}) { | ||
default(message) { | ||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return this.open(Object.assign({}, { | ||
@@ -498,3 +522,4 @@ message, | ||
const Plugin = (Vue, options = {}) => { | ||
const Plugin = function (Vue) { | ||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
let methods = api(Vue, options); | ||
@@ -508,3 +533,3 @@ Vue.$toast = methods; | ||
__webpack_exports__ = __webpack_exports__.default; | ||
__webpack_exports__ = __webpack_exports__["default"]; | ||
/******/ return __webpack_exports__; | ||
@@ -511,0 +536,0 @@ /******/ })() |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("VueToast",[],e):"object"==typeof exports?exports.VueToast=e():t.VueToast=e()}(this,(function(){return(()=>{"use strict";var t={d:(e,s)=>{for(var o in s)t.o(s,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:s[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>c});class s{constructor(t,e){this.startedAt=Date.now(),this.callback=t,this.delay=e,this.timer=setTimeout(t,e)}pause(){this.stop(),this.delay-=Date.now()-this.startedAt}resume(){this.stop(),this.startedAt=Date.now(),this.timer=setTimeout(this.callback,this.delay)}stop(){clearTimeout(this.timer)}}const o=Object.freeze({TOP_RIGHT:"top-right",TOP:"top",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left"});const i={all:n=n||new Map,on:function(t,e){var s=n.get(t);s&&s.push(e)||n.set(t,[e])},off:function(t,e){var s=n.get(t);s&&s.splice(s.indexOf(e)>>>0,1)},emit:function(t,e){(n.get(t)||[]).slice().map((function(t){t(e)})),(n.get("*")||[]).slice().map((function(s){s(t,e)}))}};var n;const a=function(t,e,s,o,i,n,a,r){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=s,u._compiled=!0),o&&(u.functional=!0),n&&(u._scopeId="data-v-"+n),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):i&&(c=r?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var p=u.beforeCreate;u.beforeCreate=p?[].concat(p,c):[c]}return{exports:t,options:u}}({name:"toast",props:{message:{type:String,required:!0},type:{type:String,default:"success"},position:{type:String,default:o.BOTTOM_RIGHT,validator:t=>Object.values(o).includes(t)},duration:{type:Number,default:3e3},dismissible:{type:Boolean,default:!0},onDismiss:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},queue:Boolean,pauseOnHover:{type:Boolean,default:!0}},data:()=>({isActive:!1,parentTop:null,parentBottom:null,isHovered:!1}),beforeMount(){this.setupContainer()},mounted(){this.showNotice(),i.on("toast-clear",this.dismiss)},methods:{setupContainer(){if(this.parentTop=document.querySelector(".v-toast.v-toast--top"),this.parentBottom=document.querySelector(".v-toast.v-toast--bottom"),this.parentTop&&this.parentBottom)return;this.parentTop||(this.parentTop=document.createElement("div"),this.parentTop.className="v-toast v-toast--top"),this.parentBottom||(this.parentBottom=document.createElement("div"),this.parentBottom.className="v-toast v-toast--bottom");const t=document.body;t.appendChild(this.parentTop),t.appendChild(this.parentBottom)},shouldQueue(){return!!this.queue&&(this.parentTop.childElementCount>0||this.parentBottom.childElementCount>0)},dismiss(){this.timer&&this.timer.stop(),clearTimeout(this.queueTimer),this.isActive=!1,setTimeout((()=>{var t;this.onDismiss.apply(null,arguments),this.$destroy(),void 0!==(t=this.$el).remove?t.remove():t.parentNode.removeChild(t)}),150)},showNotice(){this.shouldQueue()?this.queueTimer=setTimeout(this.showNotice,250):(this.correctParent.insertAdjacentElement("afterbegin",this.$el),this.isActive=!0,this.duration&&(this.timer=new s(this.dismiss,this.duration)))},whenClicked(){this.dismissible&&(this.onClick.apply(null,arguments),this.dismiss())},toggleTimer(t){this.pauseOnHover&&this.timer&&(t?this.timer.pause():this.timer.resume())}},computed:{correctParent(){switch(this.position){case o.TOP:case o.TOP_RIGHT:case o.TOP_LEFT:return this.parentTop;case o.BOTTOM:case o.BOTTOM_RIGHT:case o.BOTTOM_LEFT:return this.parentBottom}},transition(){switch(this.position){case o.TOP:case o.TOP_RIGHT:case o.TOP_LEFT:return{enter:"v-toast--fade-in-down",leave:"v-toast--fade-out"};case o.BOTTOM:case o.BOTTOM_RIGHT:case o.BOTTOM_LEFT:return{enter:"v-toast--fade-in-up",leave:"v-toast--fade-out"}}}},beforeDestroy(){i.off("toast-clear",this.dismiss)}},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("transition",{attrs:{"enter-active-class":t.transition.enter,"leave-active-class":t.transition.leave}},[s("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive,expression:"isActive"}],staticClass:"v-toast__item",class:["v-toast__item--"+t.type,"v-toast__item--"+t.position],attrs:{role:"alert"},on:{mouseover:function(e){return t.toggleTimer(!0)},mouseleave:function(e){return t.toggleTimer(!1)},click:t.whenClicked}},[s("div",{staticClass:"v-toast__icon"}),t._v(" "),s("p",{staticClass:"v-toast__text",domProps:{innerHTML:t._s(t.message)}})])])}),[],!1,null,null,null).exports,r=(t,e={})=>({open(s){let o;"string"==typeof s&&(o=s);const i={message:o},n=Object.assign({},i,e,s);return new(t.extend(a))({el:document.createElement("div"),propsData:n})},clear(){i.emit("toast-clear")},success(t,e={}){return this.open(Object.assign({},{message:t,type:"success"},e))},error(t,e={}){return this.open(Object.assign({},{message:t,type:"error"},e))},info(t,e={}){return this.open(Object.assign({},{message:t,type:"info"},e))},warning(t,e={}){return this.open(Object.assign({},{message:t,type:"warning"},e))},default(t,e={}){return this.open(Object.assign({},{message:t,type:"default"},e))}});a.install=(t,e={})=>{let s=r(t,e);t.$toast=s,t.prototype.$toast=s};const c=a;return e=e.default})()})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("VueToast",[],e):"object"==typeof exports?exports.VueToast=e():t.VueToast=e()}(this,(()=>(()=>{"use strict";var t={d:(e,s)=>{for(var o in s)t.o(s,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:s[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>l});class s{constructor(t,e){this.startedAt=Date.now(),this.callback=t,this.delay=e,this.timer=setTimeout(t,e)}pause(){this.stop(),this.delay-=Date.now()-this.startedAt}resume(){this.stop(),this.startedAt=Date.now(),this.timer=setTimeout(this.callback,this.delay)}stop(){clearTimeout(this.timer)}}const o=Object.freeze({TOP_RIGHT:"top-right",TOP:"top",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left"});const i={all:n=n||new Map,on:function(t,e){var s=n.get(t);s?s.push(e):n.set(t,[e])},off:function(t,e){var s=n.get(t);s&&(e?s.splice(s.indexOf(e)>>>0,1):n.set(t,[]))},emit:function(t,e){var s=n.get(t);s&&s.slice().map((function(t){t(e)})),(s=n.get("*"))&&s.slice().map((function(s){s(t,e)}))}};var n;var a=function(t,e,s,o,i,n,a,r){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=s,l._compiled=!0),o&&(l.functional=!0),n&&(l._scopeId="data-v-"+n),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},l._ssrRegister=c):i&&(c=r?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,c):[c]}return{exports:t,options:l}}({name:"toast",props:{message:{type:String,required:!0},type:{type:String,default:"success"},position:{type:String,default:o.BOTTOM_RIGHT,validator:t=>Object.values(o).includes(t)},duration:{type:Number,default:3e3},dismissible:{type:Boolean,default:!0},onDismiss:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},queue:Boolean,pauseOnHover:{type:Boolean,default:!0}},data:()=>({isActive:!1,parentTop:null,parentBottom:null,isHovered:!1}),beforeMount(){this.setupContainer()},mounted(){this.showNotice(),i.on("toast-clear",this.dismiss)},methods:{setupContainer(){if(this.parentTop=document.querySelector(".v-toast.v-toast--top"),this.parentBottom=document.querySelector(".v-toast.v-toast--bottom"),this.parentTop&&this.parentBottom)return;this.parentTop||(this.parentTop=document.createElement("div"),this.parentTop.className="v-toast v-toast--top"),this.parentBottom||(this.parentBottom=document.createElement("div"),this.parentBottom.className="v-toast v-toast--bottom");const t=document.body;t.appendChild(this.parentTop),t.appendChild(this.parentBottom)},shouldQueue(){return!!this.queue&&(this.parentTop.childElementCount>0||this.parentBottom.childElementCount>0)},dismiss(){this.timer&&this.timer.stop(),clearTimeout(this.queueTimer),this.isActive=!1,setTimeout((()=>{var t;this.onDismiss.apply(null,arguments),this.$destroy(),void 0!==(t=this.$el).remove?t.remove():t.parentNode.removeChild(t)}),150)},showNotice(){this.shouldQueue()?this.queueTimer=setTimeout(this.showNotice,250):(this.correctParent.insertAdjacentElement("afterbegin",this.$el),this.isActive=!0,this.duration&&(this.timer=new s(this.dismiss,this.duration)))},whenClicked(){this.dismissible&&(this.onClick.apply(null,arguments),this.dismiss())},toggleTimer(t){this.pauseOnHover&&this.timer&&(t?this.timer.pause():this.timer.resume())}},computed:{correctParent(){switch(this.position){case o.TOP:case o.TOP_RIGHT:case o.TOP_LEFT:return this.parentTop;case o.BOTTOM:case o.BOTTOM_RIGHT:case o.BOTTOM_LEFT:return this.parentBottom}},transition(){switch(this.position){case o.TOP:case o.TOP_RIGHT:case o.TOP_LEFT:return{enter:"v-toast--fade-in-down",leave:"v-toast--fade-out"};case o.BOTTOM:case o.BOTTOM_RIGHT:case o.BOTTOM_LEFT:return{enter:"v-toast--fade-in-up",leave:"v-toast--fade-out"}}}},beforeDestroy(){i.off("toast-clear",this.dismiss)}},(function(){var t=this,e=t._self._c;return e("transition",{attrs:{"enter-active-class":t.transition.enter,"leave-active-class":t.transition.leave}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive,expression:"isActive"}],staticClass:"v-toast__item",class:["v-toast__item--".concat(t.type),"v-toast__item--".concat(t.position)],attrs:{role:"alert"},on:{mouseover:function(e){return t.toggleTimer(!0)},mouseleave:function(e){return t.toggleTimer(!1)},click:t.whenClicked}},[e("div",{staticClass:"v-toast__icon"}),t._v(" "),e("p",{staticClass:"v-toast__text",domProps:{innerHTML:t._s(t.message)}})])])}),[],!1,null,null,null);const r=a.exports,c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{open(s){let o;"string"==typeof s&&(o=s);const i={message:o},n=Object.assign({},i,e,s);return new(t.extend(r))({el:document.createElement("div"),propsData:n})},clear(){i.emit("toast-clear")},success(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.open(Object.assign({},{message:t,type:"success"},e))},error(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.open(Object.assign({},{message:t,type:"error"},e))},info(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.open(Object.assign({},{message:t,type:"info"},e))},warning(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.open(Object.assign({},{message:t,type:"warning"},e))},default(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.open(Object.assign({},{message:t,type:"default"},e))}}};r.install=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=c(t,e);t.$toast=s,t.prototype.$toast=s};const l=r;return e=e.default})())); |
{ | ||
"name": "vue-toast-notification", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "Vue.js toast notification plugin", | ||
@@ -33,10 +33,9 @@ "main": "dist/index.js", | ||
"test": "jest", | ||
"test:watch": "yarn run test --watch --notify", | ||
"start": "yarn run dev", | ||
"test:watch": "npm run test --watch --notify", | ||
"start": "npm run dev", | ||
"dev": "cross-env NODE_ENV=development webpack serve --hot --config=webpack.config.dev.js", | ||
"docs": "cross-env NODE_ENV=production webpack --config=webpack.config.dev.js --progress --mode=production", | ||
"build": "cross-env NODE_ENV=production webpack --progress --mode=production", | ||
"prepublishOnly": "yarn run test && yarn run build" | ||
"prepublishOnly": "npm run test && npm run build" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -46,2 +45,3 @@ "@babel/core": "^7.14.3", | ||
"@vue/test-utils": "^1.2.0", | ||
"@vue/vue2-jest": "^27", | ||
"babel-core": "7.0.0-bridge.0", | ||
@@ -51,22 +51,20 @@ "babel-jest": "^27.0.2", | ||
"bootstrap": "^4.5.3", | ||
"clean-webpack-plugin": "^4.0.0-alpha.0", | ||
"cross-env": "^7.0.3", | ||
"css-loader": "^5.2.6", | ||
"css-loader": "^6.0.0", | ||
"file-loader": "^6.2.0", | ||
"html-webpack-plugin": "^5.3.1", | ||
"jest": "^27.0.3", | ||
"jest": "^27.0.4", | ||
"mini-css-extract-plugin": "^1.6.0", | ||
"mitt": "^2.1.0", | ||
"sass": "~1.34.0", | ||
"sass-loader": "^11.1.1", | ||
"style-loader": "^2.0.0", | ||
"mitt": "^3.0.0", | ||
"sass": "^1.53.0", | ||
"sass-loader": "^13.0.0", | ||
"style-loader": "^3.0.0", | ||
"svg-url-loader": "^7.1.1", | ||
"vue": "^2.6.12", | ||
"vue-jest": "^3.0.7", | ||
"vue": "^2.6.13", | ||
"vue-loader": "^15.9.7", | ||
"vue-template-compiler": "^2.6.12", | ||
"vue-template-compiler": "^2.7.2", | ||
"webpack": "^5.38.1", | ||
"webpack-cli": "^4.7.0", | ||
"webpack-dev-server": "^4.0.0-beta.0", | ||
"webpack-remove-empty-scripts": "^0.7.1" | ||
"webpack-dev-server": "^4.0.0", | ||
"webpack-remove-empty-scripts": "^0.8.1" | ||
}, | ||
@@ -78,26 +76,3 @@ "peerDependencies": { | ||
"node": ">=10.13.0" | ||
}, | ||
"jest": { | ||
"testEnvironment": "jsdom", | ||
"moduleFileExtensions": [ | ||
"js", | ||
"json", | ||
"jsx", | ||
"node", | ||
"vue", | ||
"css" | ||
], | ||
"setupFiles": [ | ||
"<rootDir>/__test__/setup.js" | ||
], | ||
"transform": { | ||
"^.+\\.js$": "babel-jest", | ||
".*\\.(vue)$": "vue-jest" | ||
}, | ||
"moduleNameMapper": { | ||
"\\.(css|less|scss)$": "<rootDir>/__test__/__mocks__/styleMock.js" | ||
}, | ||
"collectCoverage": false, | ||
"testURL": "http://localhost" | ||
} | ||
} |
@@ -11,6 +11,4 @@ # Vue Toast Notification | ||
Yet another Vue.js Toast notification plugin. | ||
Yet another Vue.js v2 Toast notification plugin. | ||
:warning: This library is not compatible with Vue v3 yet | ||
## [Demo](https://ankurk91.github.io/vue-toast-notification) or [JSFiddle](https://jsfiddle.net/ankurk91/ebakcs62/) | ||
@@ -21,7 +19,3 @@ | ||
```bash | ||
# yarn | ||
yarn add vue-toast-notification | ||
# npm | ||
npm install vue-toast-notification | ||
npm install vue-toast-notification@^0.6 | ||
``` | ||
@@ -124,6 +118,6 @@ | ||
<!-- Vue.js --> | ||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/vue@2.7"></script> | ||
<!-- Lastly add this package --> | ||
<script src="https://cdn.jsdelivr.net/npm/vue-toast-notification"></script> | ||
<link href="https://cdn.jsdelivr.net/npm/vue-toast-notification/dist/theme-sugar.css" rel="stylesheet"> | ||
<script src="https://cdn.jsdelivr.net/npm/vue-toast-notification@0.6"></script> | ||
<link href="https://cdn.jsdelivr.net/npm/vue-toast-notification/@0.6/dist/theme-sugar.css" rel="stylesheet"> | ||
<!-- Init the plugin --> | ||
@@ -138,6 +132,6 @@ <script> | ||
* Clone this repo | ||
* Make sure you have node-js `>=12.15` and [yarn](https://yarnpkg.com) `>=1.22` pre-installed | ||
* Install dependencies - `yarn install` | ||
* Run webpack dev server - `yarn start` | ||
* This should open the demo page at `http://localhost:9000` in your default web browser | ||
* Make sure you have node-js `>=16.9` and [pnpm](https://pnpm.io/) `>=7.2` pre-installed | ||
* Install dependencies - `pnpm install` | ||
* Run webpack dev server - `npm start` | ||
* This should open the demo page in your default web browser | ||
@@ -144,0 +138,0 @@ ## Acknowledgements |
import {Vue, VueConstructor, ExtendedVue} from 'vue/types/vue' | ||
import {PluginFunction} from 'vue' | ||
export interface ToastComponent extends ExtendedVue<any, any, any, any, any> { | ||
export interface ToastComponent extends ExtendedVue<any, any, any, any, any, any> { | ||
dismiss(): void | ||
@@ -6,0 +6,0 @@ } |
26
617
47946
26
141