text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("contextMenu",[],t):"object"==typeof exports?exports.contextMenu=t():e.contextMenu=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=6)}([function(e,t){function n(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=o(r);return[n].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([i]).join("\n")}return[n].join("\n")}function o(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var o=n(t,e);return t[2]?"@media "+t[2]+"{"+o+"}":o}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r<this.length;r++){var i=this[r][0];"number"==typeof i&&(o[i]=!0)}for(r=0;r<e.length;r++){var s=e[r];"number"==typeof s[0]&&o[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}},function(e,t,n){function o(e){for(var t=0;t<e.length;t++){var n=e[t],o=f[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(i(n.parts[r]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{for(var s=[],r=0;r<n.parts.length;r++)s.push(i(n.parts[r]));f[n.id]={id:n.id,refs:1,parts:s}}}}function r(){var e=document.createElement("style");return e.type="text/css",d.appendChild(e),e}function i(e){var t,n,o=document.querySelector("style["+x+'~="'+e.id+'"]');if(o){if(h)return v;o.parentNode.removeChild(o)}if(y){var i=p++;o=l||(l=r()),t=s.bind(null,o,i,!1),n=s.bind(null,o,i,!0)}else o=r(),t=a.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()}}function s(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=g(t,r);else{var i=document.createTextNode(r),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function a(e,t){var n=t.css,o=t.media,r=t.sourceMap;if(o&&e.setAttribute("media",o),m.ssrId&&e.setAttribute(x,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))}}var u="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!u)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 c=n(10),f={},d=u&&(document.head||document.getElementsByTagName("head")[0]),l=null,p=0,h=!1,v=function(){},m=null,x="data-vue-ssr-id",y="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,r){h=n,m=r||{};var i=c(e,t);return o(i),function(t){for(var n=[],r=0;r<i.length;r++){var s=i[r],a=f[s.id];a.refs--,n.push(a)}t?(i=c(e,t),o(i)):i=[];for(var r=0;r<n.length;r++){var a=n[r];if(0===a.refs){for(var u=0;u<a.parts.length;u++)a.parts[u]();delete f[a.id]}}}};var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},u=typeof e.default;"object"!==u&&"function"!==u||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var f;if(i?(f=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=f):o&&(f=o),f){var d=c.functional,l=d?c.render:c.beforeCreate;d?(c._injectStyles=f,c.render=function(e,t){return f.call(t),l(e,t)}):c.beforeCreate=l?[].concat(l,f):[f]}return{esModule:s,exports:a,options:c}}},function(e,t,n){"use strict";t.a={name:"context-menu",props:["width","className"],provide:function(){return{contextMenu:this}},data:function(){return{show:!1,data:null,position:{},x:0,y:0,style:{},el:null}},computed:{containerWidth:function(){return this.width?this.width:"160px"}},watch:{show:function(e,t){var n=this;e?(this.$root.$el.onmousedown=function(e){n.show=!1},window.onmousewheel=function(e){n.show=!1},this.$emit("open",this.data),this.$nextTick(function(){n.computedPosition()})):(this.$root.$el.onmousedown=null,window.onmousewheel=null,this.data=null)}},methods:{computedPosition:function(){var e=this.position,t=e.x,n=e.y,o=[this.$refs.cont.clientWidth,this.$refs.cont.clientHeight],r=o[0],i=o[1],s=window.innerWidth/2,a=window.innerHeight/2;if(t>s){var u=r-s;this.x=u>0?s-u:t<s-u?t:s-u}else this.x=t;if(n>a){var c=i-a;this.y=c>0?a-c:n<a-c?n:a-c}else this.y=n;this.style={left:this.x+"px",top:this.y+"px"}}}}},function(e,t,n){"use strict";t.a={name:"context-menu-group",inject:["contextMenu"]}},function(e,t,n){"use strict";t.a={name:"context-menu-item",inject:["contextMenu"],methods:{onMouseDown:function(e){e.preventDefault(),e.stopPropagation()},onClick:function(){this.$emit("click",this.contextMenu.data,this.contextMenu.el),this.contextMenu.show=!1}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=n(12),i=n(16),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},a={install:function(e,t){e.component(o.a.name,o.a),e.component(r.a.name,r.a),e.component(i.a.name,i.a),e.directive("contextMenu",{inserted:function(e,t,n){t.arg||console.error("no target!"),e.addEventListener("contextmenu",function(o){o.preventDefault();var r=n.context.$refs[t.arg];r.position={x:o.pageX,y:o.pageY},r.data=t.value,r.el=e,r.show=!0})},update:function(e,t,n){var o=n.context.$refs[t.arg];o.data=t.value,o.el=e}})}};void 0!==("undefined"==typeof window?"undefined":s(window))&&window.Vue&&window.Vue.use(a),t.default=a},function(e,t,n){"use strict";function o(e){n(8)}var r=n(3),i=n(11),s=n(2),a=o,u=s(r.a,i.a,!1,a,"data-v-50e65d67",null);t.a=u.exports},function(e,t,n){var o=n(9);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(1)("b7f5f648",o,!0,{})},function(e,t,n){t=e.exports=n(0)(!1),t.push([e.i,".context-menu[data-v-50e65d67]{position:fixed;z-index:9999;background:#fff;box-shadow:0 0 5px rgba(0,0,0,.5)}[data-v-50e65d67] .context-menu-group:last-child .context-menu-group-line{border:none}",""])},function(e,t){e.exports=function(e,t){for(var n=[],o={},r=0;r<t.length;r++){var i=t[r],s=i[0],a=i[1],u=i[2],c=i[3],f={id:e+":"+r,css:a,media:u,sourceMap:c};o[s]?o[s].parts.push(f):n.push(o[s]={id:s,parts:[f]})}return n}},function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.show?n("div",{ref:"cont",staticClass:"context-menu",class:e.className,style:Object.assign({},e.style,{width:e.containerWidth})},[e._t("default")],2):e._e()},r=[],i={render:o,staticRenderFns:r};t.a=i},function(e,t,n){"use strict";function o(e){n(13)}var r=n(4),i=n(15),s=n(2),a=o,u=s(r.a,i.a,!1,a,"data-v-6fcb06ce",null);t.a=u.exports},function(e,t,n){var o=n(14);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(1)("7542afe6",o,!0,{})},function(e,t,n){t=e.exports=n(0)(!1),t.push([e.i,".context-menu-group-line[data-v-6fcb06ce]{width:100%;padding:0 15px;border-bottom:1px solid #ccc}",""])},function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"context-menu-group"},[e._t("default"),e._v(" "),n("div",{staticClass:"context-menu-group-line"})],2)},r=[],i={render:o,staticRenderFns:r};t.a=i},function(e,t,n){"use strict";function o(e){n(17)}var r=n(5),i=n(19),s=n(2),a=o,u=s(r.a,i.a,!1,a,"data-v-49b248e7",null);t.a=u.exports},function(e,t,n){var o=n(18);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(1)("fbd6f41e",o,!0,{})},function(e,t,n){t=e.exports=n(0)(!1),t.push([e.i,".context-menu-item[data-v-49b248e7]{padding:0 15px;line-height:32px;font-size:13px}.context-menu-item[data-v-49b248e7]:hover{cursor:pointer;background:hsla(203,3%,54%,.1)}",""])},function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"context-menu-item",on:{mousedown:function(t){return e.onMouseDown(t)},click:e.onClick}},[e._t("default")],2)},r=[],i={render:o,staticRenderFns:r};t.a=i}])});
  //# sourceMappingURL=contextMenu.js.map