!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(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="",t(t.s=1)}([function(e,t,n){"use strict";function o(e){return[].slice.apply(e.querySelector(".rounded-menus").childNodes).filter(function(e){return 1===e.nodeType})}function r(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1}function i(e){if(!e)return u.height=document.body.style.height,u.position=document.body.style.position,document.body.style.touchAction="none",document.body.style.msTouchAction="none",document.body.style.height="100%",void(document.body.style.position="fixed");document.body.style.touchAction="",document.body.style.msTouchAction="",document.body.style.height=u.height,document.body.style.position=u.position}t.c=o,t.a=r,n.d(t,"b",function(){return a}),n.d(t,"d",function(){return s}),t.e=i;var a="ontouchstart"in window,s=document.documentElement,u={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"VueExpandBall",function(){return a});var o=n(2),r=n.n(o),i=[r.a],a={install:function(e){a.installed||i.forEach(function(t){e.component(t.name,t)})}}},function(e,t,n){function o(e){r||n(3)}var r=!1,i=n(8)(n(9),n(14),o,"data-v-6f039d14",null);i.options.__file="/Users/howard/codes/github/vue-expand-ball/src/components/expand-ball.vue",i.esModule&&Object.keys(i.esModule).some(function(e){return"default"!==e&&"__"!==e.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] expand-ball.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){var o=n(4);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(6)("0ea83f28",o,!1)},function(e,t,n){t=e.exports=n(5)(void 0),t.push([e.i,"\n.expand-ball[data-v-6f039d14] {\n position: fixed;\n margin: 0;\n padding: 0;\n text-align: center;\n color: #fff;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.expand-ball .rounded-menus > *[data-v-6f039d14],\n.center-ball[data-v-6f039d14] {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n}\n.expand-ball .rounded-menus > *[data-v-6f039d14] {\n -webkit-transition: all 0.5s;\n -o-transition: all 0.5s;\n transition: all 0.5s;\n}\n.center-ball[data-v-6f039d14] {\n z-index: 1;\n border-radius: 50%;\n}\n",""])},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;rn.parts.length&&(o.parts.length=n.parts.length)}else{for(var a=[],r=0;re?e:this.options.menuSize,expanded:this.expanded,radius:this.options.radius||60,ballColor:t,menuColor:this.options.menuColor||t}}},mounted:function(){var e=this;o.c(this.$el).forEach(function(t){t.addEventListener("click",function(){e.expanded&&(e.expanded=!e.expanded)},!1)})},methods:{toggle:function(){"true"!==this.$el.dataset.dragging&&(this.expanded=!this.expanded)}},directives:{toggleExpand:r.a,setupStyle:i.a,draggable:a.a}}},function(e,t,n){"use strict";function o(e,t){var n=r.c(t),o=e.value,i=o.expanded,a=o.radius,s=o.ballSize,u=o.menuSize;if(i)return n.forEach(function(e,t){e.style.transitionDelay=100*t+"ms",e.style.webkitTransitionDelay=100*t+"ms",e.style.left=parseInt(e.style.left)+a*Math.cos(2*Math.PI/360*(360/n.length*t))+"px",e.style.top=parseInt(e.style.top)+-a*Math.sin(2*Math.PI/360*(360/n.length*t))+"px"});n.forEach(function(e,t){e.style.top=(s-u)/2+"px",e.style.left=(s-u)/2+"px"})}var r=n(0);t.a={bind:function(e,t,n){o(t,e)},update:function(e,t,n){o(t,e)}}},function(e,t,n){"use strict";var o=n(0);t.a={bind:function(e,t,n){var r=t.value,i=r.ballSize,a=r.menuSize,s=r.ballColor,u=r.menuColor,l=e.querySelector(".center-ball");e.style.width=i+"px",e.style.height=i+"px",e.style.lineHeight=i+"px",l.style.width=i+"px",l.style.height=i+"px",l.style.lineHeight=i+"px",l.style.backgroundColor=s,o.c(e).forEach(function(e){e.style.backgroundColor=u,e.style.width=a+"px",e.style.height=a+"px",e.style.lineHeight=a+"px",e.style.top=(i-a)/2+"px",e.style.left=(i-a)/2+"px"})}}},function(e,t,n){"use strict";function o(e){var t=e.getBoundingClientRect(),n=t.top,o=t.left,r=t.right,i=t.bottom,a=t.width,u=t.height;n<0&&(e.style.top="1px"),o<0&&(e.style.left="1px"),i>s.d.clientHeight&&(e.style.top=s.d.clientHeight-u-1+"px"),r>s.d.clientWidth&&(e.style.left=s.d.clientWidth-a-1+"px")}function r(e){var t=e.touches,n=t&&t.length?t:e.changedTouches;return{x:s.b?n[0].clientX:e.pageX,y:s.b?n[0].clientY:e.pageY}}function i(){return{startEvent:s.b?"touchstart":"mousedown",moveEvent:s.b?"touchmove":"mousemove",endEvent:s.b?"touchend":"mouseup"}}function a(e,t,n){var o=parseFloat(window.getComputedStyle(e).left);o||(o=s.d.clientWidth-parseFloat(window.getComputedStyle(e).right));var r=parseFloat(window.getComputedStyle(e).top);r||(r=s.d.clientHeight-parseFloat(window.getComputedStyle(e).bottom)),e.style.left=o+t+"px",e.style.top=r+n+"px"}var s=n(0),u=n(13),l={};t.a={bind:function(e,t,n){function d(t){var n=t||window.e,o=r(n);u.a(t);var i=parseFloat(y.x),s=parseFloat(y.y);return o.x===i&&o.y===s||(a(e,o.x-i,o.y-s),y=o),!1}function c(t){return!!s.a(e,t.target)&&(s.b&&s.e(!1),g=setTimeout(function(){e.dataset.dragging="true";var n=t||window.e;n.preventDefault&&n.preventDefault(),y=r(n),document.body.addEventListener(v,d,{passive:!1,cancelable:!0})},100),!1)}function p(t){return g&&o(e),clearTimeout(g),g=null,document.body.removeEventListener(v,d),setTimeout(function(){e.dataset.dragging="",s.b&&s.e(!0)},50),!1}var f=i(),h=f.startEvent,v=f.moveEvent,m=f.endEvent;e.dataset.listenerId="listener_"+(new Date).getTime(),l[e.dataset.listenerId]=[{name:h,listener:c},{name:m,listener:p}];var g=null,y=null;window.addEventListener(h,c,{passive:!1,cancelable:!0}),window.addEventListener(m,p,!1)},unbind:function(e){l[e.dataset.listenerId]&&l[e.dataset.listenerId].length&&(l[e.dataset.listenerId].forEach(function(e){window.removeEventListener(e.name,e.listener)}),delete l[e.dataset.listenerId])}}},function(e,t,n){"use strict";function o(e){e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),e.preventDefault&&e.preventDefault()}t.a=o},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"toggle-expand",rawName:"v-toggle-expand",value:e.opts,expression:"opts"},{name:"setup-style",rawName:"v-setup-style",value:e.opts,expression:"opts"},{name:"draggable",rawName:"v-draggable"}],staticClass:"expand-ball"},[n("div",{staticClass:"center-ball",on:{click:e.toggle}},[e.opts.expanded?e._t("ball-open",[e._v("-")]):e._e(),e._v(" "),e.opts.expanded?e._e():e._t("ball-close",[e._v("+")])],2),e._v(" "),n("div",{staticClass:"rounded-menus"},[e._t("menu")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0}])});