基于vue的可自动以参数的元素拖动效果

代码语言:html

所属分类:布局界面

代码描述:基于vue的可自动以参数的元素拖动效果

代码标签: 自动 参数 元素 拖动 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
   
<meta charset="UTF-8">
   
<title>Title</title>
   
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet">
   
<style>
       
        html
, body, div, span, applet, object, iframe,
        h1
, h2, h3, h4, h5, h6, p, blockquote, pre,
        a
, abbr, acronym, address, big, cite, code,
        del
, dfn, em, img, ins, kbd, q, s, samp,
        small
, strike, strong, sub, sup, tt, var,
        b
, u, i, center,
        dl
, dt, dd, ol, ul, li,
        fieldset
, form, label, legend,
        table
, caption, tbody, tfoot, thead, tr, th, td,
        article
, aside, canvas, details, embed,
        figure
, figcaption, footer, header, hgroup,
        menu
, nav, output, ruby, section, summary,
        time
, mark, audio, video {
           
margin: 0;
           
padding: 0;
           
border: 0;
           
font-size: 100%;
           
font: inherit;
           
vertical-align: baseline;
       
}
       
/* HTML5 display-role reset for older browsers */
        article
, aside, details, figcaption, figure,
        footer
, header, hgroup, menu, nav, section {
           
display: block;
       
}
        body
{
           
line-height: 1;
       
}
        ol
, ul {
           
list-style: none;
       
}
        blockquote
, q {
           
quotes: none;
       
}
       
blockquote:before, blockquote:after,
       
q:before, q:after {
           
content: '';
           
content: none;
       
}
        table
{
           
border-collapse: collapse;
           
border-spacing: 0;
       
}
   
</style>
</head>
<body>
   
<div id="app"></div>
   
<script>!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueDragResize=e():t.VueDragResize=e()}(window,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=44)}([function(t,e,n){var i=n(16);"string"==typeof i&&(i=[[t.i,i,""]]);var r={};r.transform=void 0;n(5)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={y:{t:"top",m:"marginTop",b:"bottom"},x:{l:"left",m:"marginLeft",r:"right"}};e.default={name:"vue-drag-resize",props:{parentScaleX:{type:Number,default:1},parentScaleY:{type:Number,default:1},isActive:{type:Boolean,default:!1},preventActiveBehavior:{type:Boolean,default:!1},isDraggable:{type:Boolean,default:!0},isResizable:{type:Boolean,default:!0},aspectRatio:{type:Boolean,default:!1},parentLimitation:{type:Boolean,default:!1},parentW:{type:Number,default:0,validator:function(t){return t>=0}},parentH:{type:Number,default:0,validator:function(t){return t>=0}},w:{type:Number,default:100,validator:function(t){return t>0}},h:{type:Number,default:100,validator:function(t){return t>0}},minw:{type:Number,default:50,validator:function(t){return t>0}},minh:{type:Number,default:50,validator:function(t){return t>0}},x:{type:Number,default:0,validator:function(t){return"number"==typeof t}},y:{type:Number,default:0,validator:function(t){return"number"==typeof t}},z:{type:[String,Number],default:"auto",validator:function(t){return"string"==typeof t?"auto"===t:t>=0}},dragHandle:{type:String,default:null},dragCancel:{type:String,default:null},sticks:{type:Array,default:function(){return["tl","tm","tr","mr","br","bm","bl","ml"]}},axis:{type:String,default:"both",validator:function(t){return-1!==["x","y","both","none"].indexOf(t)}}},data:function(){return{active:this.isActive,rawWidth:this.w,rawHeight:this.h,rawLeft:this.x,rawTop:this.y,rawRight:null,rawBottom:null,zIndex:this.z,aspectFactor:this.w/this.h,parentWidth:null,parentHeight:null,left:this.x,top:this.y,right:null,bottom:null,minWidth:this.minw,minHeight:this.minh}},created:function(){this.stickDrag=!1,this.bodyDrag=!1,this.stickAxis=null,this.stickStartPos={mouseX:0,mouseY:0,x:0,y:0,w:0,h:0},this.limits={minLeft:null,maxLeft:null,minRight:null,maxRight:null,minTop:null,maxTop:null,minBottom:null,maxBottom:null},this.currentStick=[]},mounted:function(){if(this.parentElement=this.$el.parentNode,this.parentWidth=this.parentW?this.parentW:this.parentElement.clientWidth,this.parentHeight=this.parentH?this.parentH:this.parentElement.clientHeight,this.rawRight=this.parentWidth-this.rawWidth-this.rawLeft,this.rawBottom=this.parentHeight-this.rawHeight-this.rawTop,document.documentElement.addEventListener("mousemove",this.move),document.documentElement.addEventListener("mouseup",this.up),document.documentElement.addEventListener("mouseleave",this.up),document.documentElement.addEventListener("mousedown",this.deselect),document.documentElement.addEventListener("touchmove",this.move,!0),document.documentElement.addEventListener("touchend touchcancel",this.up,!0),document.documentElement.addEventListener("touchstart",this.up,!0),this.dragHandle){var t=Array.prototype.slice.call(this.$el.querySelectorAll(this.dragHandle));for(var e in t)t[e].setAttribute("data-drag-handle",this._uid)}if(this.dragCancel){var n=Array.prototype.slice.call(this.$el.querySelectorAll(this.dragCancel));for(var i in n)n[i].setAttribute("data-drag-cancel",this._uid)}},beforeDestroy:function(){document.documentElement.removeEventListener("mousemove",this.move),document.documentElement.removeEventListener("mouseup",this.up),document.documentElement.removeEventListener("mouseleave",this.up),document.documentElement.removeEventListener("mousedown",this.deselect),document.documentElement.removeEventListener("touchmove",this.move,!0),document.documentElement.removeEventListener("touchend touchcancel",this.up,!0),document.documentElement.removeEventListener("touchstart",this.up,!0)},methods:{deselect:function(){this.preventActiveBehavior||(this.active=!1)},move:function(t){(this.stickDrag||this.bodyDrag)&&(t.stopPropagation(),this.stickDrag&&this.stickMove(t),this.bodyDrag&&this.bodyMove(t))},up:function(t){this.stickDrag&&this.stickUp(t),this.bodyDrag&&this.bodyUp(t)},bodyDown:function(t){var e=t.target||t.srcElement;this.preventActiveBehavior||(this.active=!0),t.button&&0!==t.button||(this.$emit("clicked",t),this.isDraggable&&this.active&&(this.dragHandle&&e.getAttribute("data-drag-handle")!==this._uid.toString()||this.dragCancel&&e.getAttribute("data-drag-cancel")===this._uid.toString()||(this.bodyDrag=!0,this.stickStartPos.mouseX=t.pageX||t.touches[0].pageX,this.stickStartPos.mouseY=t.pageY||t.touches[0].pageY,this.stickStartPos.left=this.left,this.stickStartPos.right=this.right,this.stickStartPos.top=this.top,this.stickStartPos.bottom=this.bottom,this.parentLimitation&&(this.limits=this.calcDragLimitation()))))},calcDragLimitation:function(){var t=this.parentWidth,e=this.parentHeight;return{minLeft:0,maxLeft:t-this.width,minRight:0,maxRight:t-this.width,minTop:0,maxTop:e-this.height,minBottom:0,maxBottom:e-this.height}},bodyMove:function(t){var e=this.stickStartPos,n={x:("y"!==this.axis&&"none"!==this.axis?e.mouseX-(t.pageX||t.touches[0].pageX):0)/this.parentScaleX,y:("x"!==this.axis&&"none"!==this.axis?e.mouseY-(t.pageY||t.touches[0].pageY):0)/this.parentScaleY};this.rawTop=e.top-n.y,this.rawBottom=e.bottom+n.y,this.rawLeft=e.left-n.x,this.rawRight=e.right+n.x,this.$emit("dragging",this.rect)},bodyUp:function(){this.bodyDrag=!1,this.$emit("dragging",this.rect),this.$emit("dragstop",this.rect),this.stickStartPos={mouseX:0,mouseY:0,x:0,y:0,w:0,h:0},this.limits={minLeft:null,maxLeft:null,minRight:null,maxRight:null,minTop:null,maxTop:null,minBottom:null,maxBottom:null}},stickDown:function(t,e){if(this.isResizable&&this.active){switch(this.stickDrag=!0,this.stickStartPos.mouseX=e.pageX||e.touches[0].pageX,this.stickStartPos.mouseY=e.pageY||e.touches[0].pageY,this.stickStartPos.left=this.left,this.stickStartPos.right=this.right,this.stickStartPos.top=this.top,this.stickStartPos.bottom=this.bottom,this.currentStick=t.split(""),this.stickAxis=null,this.currentStick[0]){case"b":case"t":this.stickAxis="y"}switch(this.currentStick[1]){case"r":case"l":this.stickAxis="y"===this.stickAxis?"xy":"x"}this.limits=this.calcResizeLimitation()}},calcResizeLimitation:function(){var t=this.minWidth,e=this.minHeight,n=this.aspectFactor,i=this.width,r=this.height,o=this.bottom,a=this.top,s=this.left,c=this.right,u=this.stickAxis,l=this.parentLimitation?0:null;this.aspectRatio&&(t/e>n?e=t/n:t=n*e);var f={minLeft:l,maxLeft:s+(i-t),minRight:l,maxRight:c+(i-t),minTop:l,maxTop:a+(r-e),minBottom:l,maxBottom:o+(r-e)};if(this.aspectRatio){var d={minLeft:s-Math.min(a,o)*n*2,maxLeft:s+(r-e)/2*n*2,minRight:c-Math.min(a,o)*n*2,maxRight:c+(r-e)/2*n*2,minTop:a-Math.min(s,c)/n*2,maxTop:a+(i-t)/2/n*2,minBottom:o-Math.min(s,c)/n*2,maxBottom:o+(i-t)/2/n*2};"x"===u?f={minLeft:Math.max(f.minLeft,d.minLeft),maxLeft:Math.min(f.maxLeft,d.maxLeft),minRight:Math.max(f.minRight,d.minRight),maxRight:Math.min(f.maxRight,d.maxRight)}:"y"===u&&(f={minTop:Math.max(f.minTop,d.minTop),maxTop:Math.min(f.maxTop,d.maxTop),minBottom:Math.max(f.minBottom,d.minBottom),maxBottom:Math.min(f.maxBottom,d.maxBottom)})}return f},stickMove:function(t){var e=this.stickStartPos,n={x:(e.mouseX-(t.pageX||t.touches[0].pageX))/this.parentScaleX,y:(e.mouseY-(t.pageY||t.touches[0].pageY))/this.parentScaleY};switch(this.currentStick[0]){case"b":this.rawBottom=e.bottom+n.y;break;case"t":this.rawTop=e.top-n.y}switch(this.currentStick[1]){case"r":this.rawRight=e.right+n.x;break;case"l":this.rawLeft=e.left-n.x}this.$emit("resizing",this.rect)},stickUp:function(){this.stickDrag=!1,this.stickStartPos={mouseX:0,mouseY:0,x:0,y:0,w:0,h:0},this.limits={minLeft:null,maxLeft:null,minRight:null,maxRight:null,minTop:null,maxTop:null,minBottom:null,maxBottom:null},this.rawTop=this.top,this.rawBottom=this.bottom,this.rawLeft=this.left,this.rawRight=this.right,this.stickAxis=null,this.$emit("resizing",this.rect),this.$emit("resizestop",this.rect)},aspectRatioCorrection:function(){if(this.aspectRatio){var t=this.bottom,e=this.top,n=this.left,i=this.right,r=this.width,o=this.height,a=this.aspectFactor,s=this.currentStick;if(r/o>a){var c=a*o;"l"===s[1]?this.left=n+r-c:this.right=i+r-c}else{var u=r/a;"t"===s[0]?this.top=e+o-u:this.bottom=t+o-u}}}},computed:{style:function(){return{top:this.top+"px",left:this.left+"px",width:this.width+"px",height:this.height+"px",zIndex:this.zIndex}},vdrStick:function(){var t=this;return function(e){var n={width:8/t.parentScaleX+"px",height:8/t.parentScaleY+"px"};return n[i.y[e[0]]]=8/t.parentScaleX/-2+"px",n[i.x[e[1]]]=8/t.parentScaleX/-2+"px",n}},width:function(){return this.parentWidth-this.left-this.right},height:function(){return this.parentHeight-this.top-this.bottom},rect:function(){return{left:Math.round(this.left),top:Math.round(this.top),width:Math.round(this.width),height:Math.round(this.height)}}},watch:{rawLeft:function(t){var e=this.limits,n=this.stickAxis,i=this.aspectFactor,r=this.aspectRatio,o=this.left,a=this.bottom,s=this.top;if(null!==e.minLeft&&t<e.minLeft?t=e.minLeft:null!==e.maxLeft&&e.maxLeft<t&&(t=e.maxLeft),r&&"x"===n){var c=o-t;this.rawTop=s-c/i/2,this.rawBottom=a-c/i/2}this.left=t},rawRight:function(t){var e=this.limits,n=this.stickAxis,i=this.aspectFactor,r=this.aspectRatio,o=this.right,a=this.bottom,s=this.top;if(null!==e.minRight&&t<e.minRight?t=e.minRight:null!==e.maxRight&&e.maxRight<t&&(t=e.maxRight),r&&"x"===n){var c=o-t;this.rawTop=s-c/i/2,this.rawBottom=a-c/i/2}this.right=t},rawTop:function(t){var e=this.limits,n=this.stickAxis,i=this.aspectFactor,r=this.aspectRatio,o=this.right,a=this.left,s=this.top;if(null!==e.minTop&&t<e.minTop?t=e.minTop:null!==e.maxTop&&e.maxTop<t&&(t=e.maxTop),r&&"y"===n){var c=s-t;this.rawLeft=a-c*i/2,this.rawRight=o-c*i/2}this.top=t},rawBottom:function(t){var e=this.limits,n=this.stickAxis,i=this.aspectFactor,r=this.aspectRatio,o=this.right,a=this.left,s=this.bottom;if(null!==e.minBottom&&t<e.minBottom?t=e.minBottom:null!==e.maxBottom&&e.maxBottom<t&&(t=e.maxBottom),r&&"y"===n){var c=s-t;this.rawLeft=a-c*i/2,this.rawRight=o-c*i/2}this.bottom=t},width:function(){this.aspectRatioCorrection()},height:function(){this.aspectRatioCorrection()},active:function(t){t?this.$emit("activated"):this.$emit("deactivated")},isActive:function(t){this.active=t},z:function(t){(t>=0||"auto"===t)&&(this.zIndex=t)},aspectRatio:function(t){t&&(this.aspectFactor=this.width/this.height)},minw:function(t){t>0&&t<=this.width&&(this.minWidth=t)},minh:function(t){t>0&&t<=this.height&&(this.minHeight=t)},x:function(){if(!this.stickDrag&&!this.bodyDrag){this.parentLimitation&&(this.limits=this.calcDragLimitation());var t=this.x-this.left;this.rawLeft=this.x,this.rawRight=this.right-t}},y:function(){if(!this.stickDrag&&!this.bodyDrag){this.parentLimitation&&(this.limits=this.calcDragLimitation());var t=this.y-this.top;this.rawTop=this.y,this.rawBottom=this.bottom-t}},w:function(){if(!this.stickDrag&&!this.bodyDrag){this.currentStick=["m","r"],this.stickAxis="x",this.parentLimitation&&(this.limits=this.calcResizeLimitation());var t=this.width-this.w;this.rawRight=this.right+t}},h:function(){if(!this.stickDrag&&!this.bodyDrag){this.currentStick=["b","m"],this.stickAxis="y",this.parentLimitation&&(this.limits=this.calcResizeLimitation());var t=this.height-this.h;this.rawBottom=this.bottom+t}},parentW:function(t){this.right=t-this.width-this.left,this.parentWidth=t},parentH:function(t){this.bottom=t-this.height-this.top,this.parentHeight=t}}}},function(t,e,n){"use strict";n.r(e);var i=n(1),r=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,function(){return i[t]})}(o);e.default=r.a},function(t,e,n){"use strict";function i(t,e,n,i,r,o,a,s){var c="function"==typeof t?t.options:t;e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),o&&(c._scopeId="data-v-"+o);var u;if(a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):r&&(u=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(t,e){return u.call(e),l(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,u):[u]}return{exports:t,options:c}}n.d(e,"a",function(){return i})},function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vdr",class:t.active||t.isActive?"active":"inactive",style:t.style,on:{mousedown:function(e){e.stopPropagation(),e.preventDefault(),t.bodyDown(e)},touchstart:function(e){e.stopPropagation(),e.preventDefault(),t.bodyDown(e)}}},[t._t("default"),t._v(" "),t._l(t.sticks,function(e){return n("div",{staticClass:"vdr-stick",class:["vdr-stick-"+e,t.isResizable?"":"not-resizable"],style:t.vdrStick(e),on:{mousedown:function(n){n.stopPropagation(),n.preventDefault(),t.stickDown(e,n)},touchstart:function(n){n.stopPropagation(),n.preventDefault(),t.stickDown(e,n)}}})})],2)},r=[];i._withStripped=!0;n.d(e,"a",function(){return i}),n.d(e,"b",function(){return r})},function(t,e,n){function i(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=h[i.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](i.parts[o]);for(;o<i.parts.length;o++)r.parts.push(l(i.parts[o],e))}else{for(var a=[],o=0;o<i.parts.length;o++)a.push(l(i.parts[o],e));h[i.id]={id:i.id,refs:1,parts:a}}}}function r(t,e){for(var n=[],i={},r=0;r<t.length;r++){var o=t[r],a=e.base?o[0]+e.base:o[0],s=o[1],c=o[2],u=o[3],l={css:s,media:c,sourceMap:u};i[a]?i[a].parts.push(l):n.push(i[a]={id:a,parts:[l]})}return n}function o(t,e){var n=m(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=b[b.length-1];if("top"===t.insertAt)i?i.nextSibling?n.insertBefore(e,i.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),b.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}function a(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=b.indexOf(t);e>=0&&b.splice(e,1)}function s(t){var e=document.createElement("style");return t.attrs.type="text/css",u(e,t.attrs),o(t,e),e}function c(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",u(e,t.attrs),o(t,e),e}function u(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function l(t,e){var n,i,r,o;if(e.transform&&t.css){if(!(o=e.transform(t.css)))return function(){};t.css=o}if(e.singleton){var u=y++;n=g||(g=s(e)),i=f.bind(null,n,u,!1),r=f.bind(null,n,u,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(e),i=p.bind(null,n,e),r=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(e),i=d.bind(null,n),r=function(){a(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}function f(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=w(e,r);else{var o=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function d(t,e){var n=e.css,i=e.media;if(i&&t.setAttribute("media",i),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function p(t,e,n){var i=n.css,r=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||o)&&(i=_(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([i],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var h={},v=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),m=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t.call(this,n)),e[n]}}(function(t){return document.querySelector(t)}),g=null,y=0,b=[],_=n(15);t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},e.attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||(e.singleton=v()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=r(t,e);return i(n,e),function(t){for(var o=[],a=0;a<n.length;a++){var s=n[a],c=h[s.id];c.refs--,o.push(c)}if(t){i(r(t,e),e)}for(var a=0;a<o.length;a++){var c=o[a];if(0===c.refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete h[c.id]}}}};var w=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){function n(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=i(r);return[n].concat(r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"})).concat([o]).join("\n")}return[n].join("\n")}function i(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var i=n(e,t);return e[2]?"@media "+e[2]+"{"+i+"}":i}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];"number"==typeof o&&(i[o]=!0)}for(r=0;r<t.length;r++){var a=t[r];"number"==typeof a[0]&&i[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){!function(e,n){t.exports=function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="dist/",e(e.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){var i=n(2)(n(3),n(4),null,null,null);t.exports=i.exports},function(t,e){t.exports=function(t,e,n,i,r){var o,a=t=t||{},s=typeof t.default;"object"!==s&&"function"!==s||(o=t,a=t.default);var c="function"==typeof a?a.options:a;e&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns),i&&(c._scopeId=i);var u;if(r?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},c._ssrRegister=u):n&&(u=n),u){var l=c.functional,f=l?c.render:c.beforeCreate;l?c.render=function(t,e){return u.call(e),f(t,e)}:c.beforeCreate=f?[].concat(f,u):[u]}return{esModule:o,exports:a,options:c}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={},r=[],o="",a="",s="svg";e.default={data:function(){return{loaded:!1}},props:{icon:String,name:String,width:{type:String,default:""},height:{type:String,default:""},scale:String,dir:String,fill:{type:Boolean,default:!0},color:String,original:{type:Boolean,default:!1}},computed:{clazz:function(){var t=s+"-icon";return this.fill&&(t+=" "+s+"-fill"),this.dir&&(t+=" "+s+"-"+this.dir),t},iconName:function(){return this.name||this.icon},iconData:function(){return this.iconName&&this.loaded?i[this.iconName]:null},colors:function(){return this.color?this.color.split(" "):[]},path:function(){var t="";return this.iconData?(t=this.iconData.data,this.original&&(t=this.addOriginalColor(t)),this.colors.length>0&&(t=this.addColor(t))):r.push({name:this.iconName,component:this}),this.getValidPathData(t)},box:function(){var t=this.width||16,e=this.width||16;return this.iconData?this.iconData.viewBox?this.iconData.viewBox:"0 0 "+this.iconData.width+" "+this.iconData.height:"0 0 "+parseFloat(t)+" "+parseFloat(e)},style:function(){var t=/^\d+$/,e=Number(this.scale),n=void 0,i=void 0;return!isNaN(e)&&this.iconData?(n=Number(this.iconData.width)*e+"px",i=Number(this.iconData.height)*e+"px"):(n=t.test(this.width)?this.width+"px":this.width,i=t.test(this.height)?this.height+"px":this.height),{width:n||o,height:i||a}}},created:function(){i[this.iconName]&&(this.loaded=!0)},methods:{addColor:function(t){var e=this,n=/<(path|rect|circle|polygon|line|polyline|ellipse)\s/gi,i=0;return t.replace(n,function(t){var n=e.colors[i++]||e.colors[e.colors.length-1],r=e.fill;return n&&"_"===n?t:(n&&0===n.indexOf("r-")&&(r=!r,n=n.split("r-")[1]),t+(r?"fill":"stroke")+'="'+n+'" '+(r?"stroke":"fill")+'="none" ')})},addOriginalColor:function(t){var e=/_fill="|_stroke="/gi;return t.replace(e,function(t){return t&&t.slice(1)})},getValidPathData:function(t){if(this.original&&this.colors.length>0){var e=/<(path|rect|circle|polygon|line|polyline|ellipse)(\sfill|\sstroke)([="\w\s\.\-\+#\$\&>]+)(fill|stroke)/gi;t=t.replace(e,function(t,e,n,i,r){return"<"+e+n+i+"_"+r})}return t}},install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.tagName||"svgicon";e.classPrefix&&(s=e.classPrefix),e.defaultWidth&&(o=e.defaultWidth),e.defaultHeight&&(a=e.defaultHeight),t.component(n,this)},register:function(t){for(var e in t)!function(e){i[e]||(i[e]=t[e]),r=r.filter(function(t,n){return t.name===e&&t.component.$set(t.component,"loaded",!0),t.name!==e})}(e)},icons:i}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("svg",{class:t.clazz,style:t.style,attrs:{version:"1.1",viewBox:t.box},domProps:{innerHTML:t._s(t.path)}})},staticRenderFns:[]}}])}()}()},function(t,e,n){var i=n(31);"string"==typeof i&&(i=[[t.i,i,""]]);var r={};r.transform=void 0;n(5)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(37);"string"==typeof i&&(i=[[t.i,i,""]]);var r={};r.transform=void 0;n(5)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={computed:{activeRect:function(){return this.$store.getters["rect/getActive"]},width:function(){return null===this.activeRect?"":this.$store.state.rect.rects[this.activeRect].width},height:function(){return null===this.activeRect?"":this.$store.state.rect.rects[this.activeRect].height},top:function(){return null===this.activeRect?"":this.$store.state.rect.rects[this.activeRect].top},left:function(){return null===this.activeRect?"":this.$store.state.rect.rects[this.activeRect].left},minw:function(){return null===this.activeRect?"":this.$store.state.rect.rects[this.activeRect].minw},minh:function(){return null===this.activeRect?"":this.$store.state.rect.rects[this.activeRect].minh},aspectRatio:function(){return null!==this.activeRect&&this.$store.state.rect.rects[this.activeRect].aspectRatio},parentLim:function(){return null!==this.activeRect&&this.$store.state.rect.rects[this.activeRect].parentLim},draggable:function(){return null!==this.activeRect&&this.$store.state.rect.rects[this.activeRect].draggable},resizable:function(){return null!==this.activeRect&&this.$store.state.rect.rects[this.activeRect].resizable},topIsLocked:function(){return null!==this.activeRect&&("x"===this.$store.state.rect.rects[this.activeRect].axis||"none"===this.$store.state.rect.rects[this.activeRect].axis)},leftIsLocked:function(){return null!==this.activeRect&&("y"===this.$store.state.rect.rects[this.activeRect].axis||"none"===this.$store.state.rect.rects[this.activeRect].axis)},zIndex:function(){return null===this.activeRect?null:1===this.$store.state.rect.rects[this.activeRect].zIndex?"isFirst":this.$store.state.rect.rects[this.activeRect].zIndex===this.$store.state.rect.rects.length?"isLast":"normal"}},methods:{toggleYLock:function(){if(null===this.activeRect)return void this.$ga.event("toolbar","lock","y lock",0);this.$ga.event("toolbar","lock","y lock",1),this.$store.dispatch("rect/changeYLock",{id:this.activeRect})},toggleXLock:function(){if(null===this.activeRect)return void this.$ga.event("toolbar","lock","x lock",0);this.$ga.event("toolbar","lock","x lock",1),this.$store.dispatch("rect/changeXLock",{id:this.activeRect})},toggleAspect:function(){if(null===this.activeRect)return void this.$ga.event("toolbar","lock","aspect",0);this.$ga.event("toolbar","lock","aspect",1),this.$store.state.rect.rects[this.activeRect].aspectRatio?this.$store.dispatch("rect/unsetAspect",{id:this.activeRect}):this.$store.dispatch("rect/setAspect",{id:this.activeRect})},toggleParentLimitation:function(){this.$ga.event("toolbar","lock","parent",1),this.$store.dispatch("rect/toggleParentLimitation",{id:this.activeRect})},toggleResizable:function(){this.$ga.event("toolbar","lock","resize",1),this.$store.dispatch("rect/toggleResizable",{id:this.activeRect})},toggleDraggable:function(){this.$ga.event("toolbar","lock","drag",1),this.$store.dispatch("rect/toggleDraggable",{id:this.activeRect})},toTop:function(){this.$ga.event("toolbar","changeZ","top",1),this.$store.dispatch("rect/changeZToTop",{id:this.activeRect})},toBottom:function(){this.$ga.event("toolbar","changeZ","bottom",1),this.$store.dispatch("rect/changeZToBottom",{id:this.activeRect})},changeMinWidth:function(t){var e=parseInt(t.target.value);("number"!=typeof e||isNaN(e))&&(e=1),e<=0?e=1:e>this.$store.state.rect.rects[this.activeRect].width&&(e=this.$store.state.rect.rects[this.activeRect].width),this.$ga.event("toolbar","changeMin","width",e),t.target.value=e,this.$store.dispatch("rect/setMinWidth",{id:this.activeRect,width:e})},changeMinHeight:function(t){var e=parseInt(t.target.value);("number"!=typeof e||isNaN(e))&&(e=1),e<=0?e=1:e>this.$store.state.rect.rects[this.activeRect].height&&(e=this.$store.state.rect.rects[this.activeRect].height),this.$ga.event("toolbar","changeMin","height",e),t.target.value=e,this.$store.dispatch("rect/setMinHeight",{id:this.activeRect,height:e})},changeTop:function(t){var e=parseInt(t.target.value);if("number"!=typeof e||isNaN(e))return e=this.$store.state.rect.rects[this.activeRect].top,void(t.target.value=e);this.$ga.event("toolbar","changePosition","top",e),this.$store.dispatch("rect/setTop",{id:this.activeRect,top:e})},changeLeft:function(t){var e=parseInt(t.target.value);("number"!=typeof e||isNaN(e))&&(e=this.$store.state.rect.rects[this.activeRect].left,t.target.value=e),this.$ga.event("toolbar","changePosition","left",e),this.$store.dispatch("rect/setLeft",{id:this.activeRect,left:e})},changeWidth:function(t){var e=parseInt(t.target.value);("number"!=typeof e||isNaN(e))&&(e=this.$store.state.rect.rects[this.activeRect].width,t.target.value=e),this.$ga.event("toolbar","changeSize","width",e),this.$store.dispatch("rect/setWidth",{id:this.activeRect,width:e})},changeHeight:function(t){var e=parseInt(t.target.value);("number"!=typeof e||isNaN(e))&&(e=this.$store.state.rect.rects[this.activeRect].height,t.target.value=e),this.$ga.event("toolbar","changeSize","height",e),this.$store.dispatch("rect/setHeight",{id:this.activeRect,height:e})}}}},function(t,e,n){"use strict";n.r(e);var i=n(10),r=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,function(){return i[t]})}(o);e.default=r.a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(18),o=i(r),a=n(39),s=i(a);n(36),e.default={name:"app",components:{VueDragResize:o.default,toolbar:s.default},data:function(){return{listWidth:0,listHeight:0}},mounted:function(){var t=this,e=document.getElementById("list");this.listWidth=e.clientWidth,this.listHeight=e.clientHeight,window.addEventListener("resize",function(){t.listWidth=e.clientWidth,t.listHeight=e.clientHeight})},computed:{rects:function(){return this.$store.state.rect.rects}},methods:{activateEv:function(t){this.$ga.event("list","setActive","active",1),this.$store.dispatch("rect/setActive",{id:t})},deactivateEv:function(t){this.$ga.event("list","setActive","active",0),this.$store.dispatch("rect/unsetActive",{id:t})},changePosition:function(t,e){this.$ga.event("list","changePosition","index",e),this.$store.dispatch("rect/setTop",{id:e,top:t.top}),this.$store.dispatch("rect/setLeft",{id:e,left:t.left}),this.$store.dispatch("rect/setWidth",{id:e,width:t.width}),this.$store.dispatch("rect/setHeight",{id:e,height:t.height})},changeSize:function(t,e){this.$ga.event("list","changeSize","index",e),this.$store.dispatch("rect/setTop",{id:e,top:t.top}),this.$store.dispatch("rect/setLeft",{id:e,left:t.left}),this.$store.dispatch("rect/setWidth",{id:e,width:t.width}),this.$store.dispatch("rect/setHeight",{id:e,height:t.height})}}}},function(t,e,n){"use strict";n.r(e);var i=n(12),r=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,function(){return i[t]})}(o);e.default=r.a},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(r))return t;var o;return o=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:i+r.replace(/^\.\//,""),"url("+JSON.stringify(o)+")"})}},function(t,e,n){e=t.exports=n(6)(!1),e.push([t.i,'\n.vdr,.vdr.active:before{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box\n}\n.vdr.active:before{content:"";width:100%;height:100%;top:0;left:0;outline:1px dashed #d6d6d6\n}\n.vdr-stick{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;font-size:1px;background:#fff;border:1px solid #6c6c6c;-webkit-box-shadow:0 0 2px #bbb;box-shadow:0 0 2px #bbb\n}\n.inactive .vdr-stick{display:none\n}\n.vdr-stick-br,.vdr-stick-tl{cursor:nwse-resize\n}\n.vdr-stick-bm,.vdr-stick-tm{left:50%;cursor:ns-resize\n}\n.vdr-stick-bl,.vdr-stick-tr{cursor:nesw-resize\n}\n.vdr-stick-ml,.vdr-stick-mr{top:50%;cursor:ew-resize\n}\n.vdr-stick.not-resizable{display:none\n}',""])},function(t,e,n){"use strict";var i=n(0),r=n.n(i);r.a},function(t,e,n){"use strict";n.r(e);var i=n(4),r=n(2);for(var o in r)"default"!==o&&function(t){n.d(e,t,function(){return r[t]})}(o);var a=(n(17),n(3)),s=Object(a.a)(r.default,i.a,i.b,!1,null,null,null);s.options.__file="src/components/vue-drag-resize.vue",e.default=s.exports},function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"toolbar",on:{mousedown:function(t){t.stopPropagation()}}},[n("div",{staticClass:"toolbar-wh-row"},[n("p",{staticClass:"toolbar-row-title"},[t._v("Position")]),t._v(" "),n("span",{staticClass:"toolbar-position-inp"},[t._v("top\n            "),n("input",{domProps:{value:t.top},on:{keyup:t.changeTop}}),t._v(" "),n("svgicon",{staticClass:"position-lock-icon",attrs:{name:"lock",color:t.topIsLocked?"#42b983 #35495e":"#AAA",width:"15",height:"15"},nativeOn:{click:function(e){return t.toggleYLock(e)}}})],1),t._v(" "),n("span",{staticClass:"toolbar-position-inp"},[t._v("left\n            "),n("input",{domProps:{value:t.left},on:{keyup:t.changeLeft}}),t._v(" "),n("svgicon",{staticClass:"position-lock-icon",attrs:{name:"lock",color:t.leftIsLocked?"#42b983 #35495e":"#AAA",width:"15",height:"15"},nativeOn:{click:function(e){return t.toggleXLock(e)}}})],1)]),t._v(" "),n("div",{staticClass:"toolbar-wh-row"},[n("p",{staticClass:"toolbar-row-title"},[t._v("Size")]),t._v(" "),n("span",{staticClass:"toolbar-size-inp"},[t._v("width\n            "),n("input",{domProps:{value:t.width},on:{keyup:t.changeWidth}}),t._v(" "),n("svgicon",{staticClass:"size-lock-icon",attrs:{name:"lock",color:t.aspectRatio?"#42b983 #35495e":"#AAA",width:"17",height:"17"},nativeOn:{click:function(e){return t.toggleAspect(e)}}})],1),t._v(" "),n("span",{staticClass:"toolbar-size-inp"},[t._v("height\n            "),n("input",{domProps:{value:t.height},on:{keyup:t.changeHeight}})])]),t._v(" "),n("div",{staticClass:"toolbar-wh-row"},[n("p",{staticClass:"toolbar-row-title"},[t._v("Minimal size")]),t._v(" "),n("span",{staticClass:"toolbar-size-inp"},[t._v("width\n            "),n("input",{attrs:{disabled:null===t.activeRect},domProps:{value:t.minw},on:{keyup:t.changeMinWidth}})]),t._v(" "),n("span",{staticClass:"toolbar-size-inp"},[t._v("height\n            "),n("input",{attrs:{disabled:null===t.activeRect},domProps:{value:t.minh},on:{keyup:t.changeMinHeight}})])]),t._v(" "),n("div",{staticClass:"toolbar-wh-row"},[n("p",{staticClass:"toolbar-row-title"},[t._v("Restrictions")]),t._v(" "),n("label",{staticClass:"toolbar-check-inp"},[n("input",{attrs:{type:"checkbox",disabled:null===t.activeRect},domProps:{checked:t.resizable},on:{change:t.toggleResizable}}),t._v(" isResizable")]),t._v(" "),n("label",{staticClass:"toolbar-check-inp"},[n("input",{attrs:{type:"checkbox",disabled:null===t.activeRect},domProps:{checked:t.draggable},on:{change:t.toggleDraggable}}),t._v(" isDraggable")]),t._v(" "),n("label",{staticClass:"toolbar-check-inp"},[n("input",{attrs:{type:"checkbox",disabled:null===t.activeRect},domProps:{checked:t.parentLim},on:{change:t.toggleParentLimitation}}),t._v(" parentLimitation")]),t._v(" "),n("svgicon",{staticClass:"to-bottom-icon",attrs:{name:"toBottom",color:null!==t.activeRect&&"isFirst"!==t.zIndex?"#35495e":"#AAA",width:"30",height:"30"},nativeOn:{click:function(e){return t.toBottom(e)}}}),t._v(" "),n("svgicon",{staticClass:"to-top-icon",attrs:{name:"toTop",color:null!==t.activeRect&&"isLast"!==t.zIndex?"#35495e":"#AAA",width:"30",height:"30"},nativeOn:{click:function(e){return t.toTop(e)}}})],1)])},r=[];i._withStripped=!0;n.d(e,"a",function(){return i}),n.d(e,"b",function(){return r})},function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("div",{staticClass:"list",attrs:{id:"list"}},t._l(t.rects,function(e,i){return n("VueDragResize",{attrs:{w:e.width,h:e.height,x:e.left,y:e.top,parentW:t.listWidth,parentH:t.listHeight,axis:e.axis,isActive:e.active,minw:e.minw,minh:e.minh,isDraggable:e.draggable,isResizable:e.resizable,parentLimitation:e.parentLim,aspectRatio:e.aspectRatio,z:e.zIndex},on:{activated:function(e){t.activateEv(i)},deactivated:function(e){t.deactivateEv(i)},dragging:function(e){t.changePosition(e,i)},resizing:function(e){t.changeSize(e,i)}}},[n("div",{staticClass:"filler",style:{backgroundColor:e.color}})])})),t._v(" "),n("toolbar")],1)},r=[];i._withStripped=!0;n.d(e,"a",function(){return i}),n.d(e,"b",function(){return r})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=e.ENABLE_ACTIVE="ENABLE_ACTIVE",r=e.DISABLE_ACTIVE="DISABLE_ACTIVE",o=e.ENABLE_DRAGGABLE="ENABLE_DRAGGABLE",a=e.DISABLE_DRAGGABLE="DISABLE_DRAGGABLE",s=e.ENABLE_RESIZABLE="ENABLE_RESIZABLE",c=e.DISABLE_RESIZABLE="DISABLE_RESIZABLE",u=e.ENABLE_PARENT_LIMITATION="ENABLE_PARENT_LIMITATION",l=e.DISABLE_PARENT_LIMITATION="DISABLE_PARENT_LIMITATION",f=e.ENABLE_ASPECT="ENABLE_ASPECT",d=e.DISABLE_ASPECT="DISABLE_ASPECT",p=e.ENABLE_X_AXIS="ENABLE_X_AXIS",h=e.ENABLE_Y_AXIS="ENABLE_Y_AXIS",v=e.ENABLE_BOTH_AXIS="ENABLE_BOTH_AXIS",m=e.ENABLE_NONE_AXIS="ENABLE_NONE_AXIS",g=e.CHANGE_ZINDEX="CHANGE_ZINDEX",y=e.CHANGE_MINW="CHANGE_MINW",b=e.CHANGE_MINH="CHANGE_MINH",_=e.CHANGE_WIDTH="CHANGE_WIDTH",w=e.CHANGE_HEIGHT="CHANGE_HEIGHT",x=e.CHANGE_TOP="CHANGE_TOP",A=e.CHANGE_LEFT="CHANGE_LEFT";e.default={ENABLE_ACTIVE:i,DISABLE_ACTIVE:r,ENABLE_DRAGGABLE:o,DISABLE_DRAGGABLE:a,ENABLE_RESIZABLE:s,DISABLE_RESIZABLE:c,ENABLE_PARENT_LIMITATION:u,DISABLE_PARENT_LIMITATION:l,ENABLE_ASPECT:f,DISABLE_ASPECT:d,ENABLE_X_AXIS:p,ENABLE_Y_AXIS:h,ENABLE_NONE_AXIS:m,ENABLE_BOTH_AXIS:v,CHANGE_ZINDEX:g,CHANGE_MINW:y,CHANGE_MINH:b,CHANGE_WIDTH:_,CHANGE_HEIGHT:w,CHANGE_TOP:x,CHANGE_LEFT:A}},function(t,e,n){"use strict";(function(e,n){function i(t){return void 0===t||null===t}function r(t){return void 0!==t&&null!==t}function o(t){return!0===t}function a(t){return!1===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function c(t){return null!==t&&"object"==typeof t}function u(t){return"[object Object]"===so.call(t)}function l(t){return"[object RegExp]"===so.call(t)}function f(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function p(t){var e=parseFloat(t);return isNaN(e)?t:e}function h(t,e){for(var n=Object.create(null),i=t.split(","),r=0;r<i.length;r++)n[i[r]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}function v(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function m(t,e){return lo.call(t,e)}function g(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function y(t,e){function n(n){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function b(t,e){return t.bind(e)}function _(t,e){e=e||0;for(var n=t.length-e,i=new Array(n);n--;)i[n]=t[n+e];return i}function w(t,e){for(var n in e)t[n]=e[n];return t}function x(t){for(var e={},n=0;n<t.length;n++)t[n]&&w(e,t[n]);return e}function A(t,e,n){}function E(t,e){if(t===e)return!0;var n=c(t),i=c(e);if(!n||!i)return!n&&!i&&String(t)===String(e);try{var r=Array.isArray(t),o=Array.isArray(e);if(r&&o)return t.length===e.length&&t.every(function(t,n){return E(t,e[n])});if(r||o)return!1;var a=Object.keys(t),s=Object.keys(e);return a.length===s.length&&a.every(function(n){return E(t[n],e[n])})}catch(t){return!1}}function k(t,e){for(var n=0;n<t.length;n++)if(E(t[n],e))return n;return-1}function $(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function C(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function L(t,e,n,i){Object.defineProperty(t,e,{value:n,enumerable:!!i,writable:!0,configurable:!0})}function T(t){if(!Eo.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}function S(t){return"function"==typeof t&&/native code/.test(t.toString())}function O(t){Xo.target&&Uo.push(Xo.target),Xo.target=t}function N(){Xo.target=Uo.pop()}function I(t){return new Vo(void 0,void 0,void 0,String(t))}function R(t){var e=new Vo(t.tag,t.data,t.children,t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.isCloned=!0,e}function B(t){Jo=t}function M(t,e,n){t.__proto__=e}function D(t,e,n){for(var i=0,r=n.length;i<r;i++){var o=n[i];L(t,o,e[o])}}function P(t,e){if(c(t)&&!(t instanceof Vo)){var n;return m(t,"__ob__")&&t.__ob__ instanceof Qo?n=t.__ob__:Jo&&!jo()&&(Array.isArray(t)||u(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new Qo(t)),e&&n&&n.vmCount++,n}}function j(t,e,n,i,r){var o=new Xo,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var s=a&&a.get;s||2!==arguments.length||(n=t[e]);var c=a&&a.set,u=!r&&P(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=s?s.call(t):n;return Xo.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(e)&&F(e))),e},set:function(e){var i=s?s.call(t):n;e===i||e!==e&&i!==i||(c?c.call(t,e):n=e,u=!r&&P(e),o.notify())}})}}function H(t,e,n){if(Array.isArray(t)&&f(e))return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(e in t&&!(e in Object.prototype))return t[e]=n,n;var i=t.__ob__;return t._isVue||i&&i.vmCount?n:i?(j(i.value,e,n),i.dep.notify(),n):(t[e]=n,n)}function z(t,e){if(Array.isArray(t)&&f(e))return void t.splice(e,1);var n=t.__ob__;t._isVue||n&&n.vmCount||m(t,e)&&(delete t[e],n&&n.dep.notify())}function F(t){for(var e=void 0,n=0,i=t.length;n<i;n++)e=t[n],e&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&F(e)}function G(t,e){if(!e)return t;for(var n,i,r,o=Object.keys(e),a=0;a<o.length;a++)n=o[a],i=t[n],r=e[n],m(t,n)?u(i)&&u(r)&&G(i,r):H(t,n,r);return t}function X(t,e,n){return n?function(){var i="function"==typeof e?e.call(n,n):e,r="function"==typeof t?t.call(n,n):t;return i?G(i,r):r}:e?t?function(){return G("function"==typeof e?e.call(this,this):e,"function"==typeof t?t.call(this,this):t)}:e:t}function U(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t}function V(t,e,n,i){var r=Object.create(t||null);return e?w(r,e):r}function W(t,e){var n=t.props;if(n){var i,r,o,a={};if(Array.isArray(n))for(i=n.length;i--;)"string"==typeof(r=n[i])&&(o=po(r),a[o]={type:null});else if(u(n))for(var s in n)r=n[s],o=po(s),a[o]=u(r)?r:{type:r};t.props=a}}function q(t,e){var n=t.inject;if(n){var i=t.inject={};if(Array.isArray(n))for(var r=0;r<n.length;r++)i[n[r]]={from:n[r]};else if(u(n))for(var o in n){var a=n[o];i[o]=u(a)?w({from:o},a):{from:a}}}}function Y(t){var e=t.directives;if(e)for(var n in e){var i=e[n];"function"==typeof i&&(e[n]={bind:i,update:i})}}function Z(t,e,n){function i(i){var r=ta[i]||ia;c[i]=r(t[i],e[i],n,i)}"function"==typeof e&&(e=e.options),W(e,n),q(e,n),Y(e);var r=e.extends;if(r&&(t=Z(t,r,n)),e.mixins)for(var o=0,a=e.mixins.length;o<a;o++)t=Z(t,e.mixins[o],n);var s,c={};for(s in t)i(s);for(s in e)m(t,s)||i(s);return c}function K(t,e,n,i){if("string"==typeof n){var r=t[e];if(m(r,n))return r[n];var o=po(n);if(m(r,o))return r[o];var a=ho(o);if(m(r,a))return r[a];return r[n]||r[o]||r[a]}}function J(t,e,n,i){var r=e[t],o=!m(n,t),a=n[t],s=nt(Boolean,r.type);if(s>-1)if(o&&!m(r,"default"))a=!1;else if(""===a||a===mo(t)){var c=nt(String,r.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=Q(i,r,t);var u=Jo;B(!0),P(a),B(u)}return a}function Q(t,e,n){if(m(e,"default")){var i=e.default;return t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n]?t._props[n]:"function"==typeof i&&"Function"!==tt(e.type)?i.call(t):i}}function tt(t){var e=t&&t.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function et(t,e){return tt(t)===tt(e)}function nt(t,e){if(!Array.isArray(e))return et(e,t)?0:-1;for(var n=0,i=e.length;n<i;n++)if(et(e[n],t))return n;return-1}function it(t,e,n){if(e)for(var i=e;i=i.$parent;){var r=i.$options.errorCaptured;if(r)for(var o=0;o<r.length;o++)try{var a=!1===r[o].call(i,t,e,n);if(a)return}catch(t){rt(t,i,"errorCaptured hook")}}rt(t,e,n)}function rt(t,e,n){if(Ao.errorHandler)try{return Ao.errorHandler.call(null,t,e,n)}catch(t){ot(t,null,"config.errorHandler")}ot(t,e,n)}function ot(t,e,n){if(!$o&&!Co||"undefined"==typeof console)throw t;console.error(t)}function at(){oa=!1;var t=ra.slice(0);ra.length=0;for(var e=0;e<t.length;e++)t[e]()}function st(t){return t._withTask||(t._withTask=function(){aa=!0;var e=t.apply(null,arguments);return aa=!1,e})}function ct(t,e){var n;if(ra.push(function(){if(t)try{t.call(e)}catch(t){it(t,e,"nextTick")}else n&&n(e)}),oa||(oa=!0,aa?na():ea()),!t&&"undefined"!=typeof Promise)return new Promise(function(t){n=t})}function ut(t){lt(t,fa),fa.clear()}function lt(t,e){var n,i,r=Array.isArray(t);if(!(!r&&!c(t)||Object.isFrozen(t)||t instanceof Vo)){if(t.__ob__){var o=t.__ob__.dep.id;if(e.has(o))return;e.add(o)}if(r)for(n=t.length;n--;)lt(t[n],e);else for(i=Object.keys(t),n=i.length;n--;)lt(t[i[n]],e)}}function ft(t){function e(){var t=arguments,n=e.fns;if(!Array.isArray(n))return n.apply(null,arguments);for(var i=n.slice(),r=0;r<i.length;r++)i[r].apply(null,t)}return e.fns=t,e}function dt(t,e,n,r,o){var a,s,c,u;for(a in t)s=t[a],c=e[a],u=da(a),i(s)||(i(c)?(i(s.fns)&&(s=t[a]=ft(s)),n(u.name,s,u.once,u.capture,u.passive,u.params)):s!==c&&(c.fns=s,t[a]=c));for(a in e)i(t[a])&&(u=da(a),r(u.name,e[a],u.capture))}function pt(t,e,n){function a(){n.apply(this,arguments),v(s.fns,a)}t instanceof Vo&&(t=t.data.hook||(t.data.hook={}));var s,c=t[e];i(c)?s=ft([a]):r(c.fns)&&o(c.merged)?(s=c,s.fns.push(a)):s=ft([c,a]),s.merged=!0,t[e]=s}function ht(t,e,n){var o=e.options.props;if(!i(o)){var a={},s=t.attrs,c=t.props;if(r(s)||r(c))for(var u in o){var l=mo(u);vt(a,c,u,l,!0)||vt(a,s,u,l,!1)}return a}}function vt(t,e,n,i,o){if(r(e)){if(m(e,n))return t[n]=e[n],o||delete e[n],!0;if(m(e,i))return t[n]=e[i],o||delete e[i],!0}return!1}function mt(t){for(var e=0;e<t.length;e++)if(Array.isArray(t[e]))return Array.prototype.concat.apply([],t);return t}function gt(t){return s(t)?[I(t)]:Array.isArray(t)?bt(t):void 0}function yt(t){return r(t)&&r(t.text)&&a(t.isComment)}function bt(t,e){var n,a,c,u,l=[];for(n=0;n<t.length;n++)a=t[n],i(a)||"boolean"==typeof a||(c=l.length-1,u=l[c],Array.isArray(a)?a.length>0&&(a=bt(a,(e||"")+"_"+n),yt(a[0])&&yt(u)&&(l[c]=I(u.text+a[0].text),a.shift()),l.push.apply(l,a)):s(a)?yt(u)?l[c]=I(u.text+a):""!==a&&l.push(I(a)):yt(a)&&yt(u)?l[c]=I(u.text+a.text):(o(t._isVList)&&r(a.tag)&&i(a.key)&&r(e)&&(a.key="__vlist"+e+"_"+n+"__"),l.push(a)));return l}function _t(t,e){return(t.__esModule||zo&&"Module"===t[Symbol.toStringTag])&&(t=t.default),c(t)?e.extend(t):t}function wt(t,e,n,i,r){var o=qo();return o.asyncFactory=t,o.asyncMeta={data:e,context:n,children:i,tag:r},o}function xt(t,e,n){if(o(t.error)&&r(t.errorComp))return t.errorComp;if(r(t.resolved))return t.resolved;if(o(t.loading)&&r(t.loadingComp))return t.loadingComp;if(!r(t.contexts)){var a=t.contexts=[n],s=!0,u=function(){for(var t=0,e=a.length;t<e;t++)a[t].$forceUpdate()},l=$(function(n){t.resolved=_t(n,e),s||u()}),f=$(function(e){r(t.errorComp)&&(t.error=!0,u())}),d=t(l,f);return c(d)&&("function"==typeof d.then?i(t.resolved)&&d.then(l,f):r(d.component)&&"function"==typeof d.component.then&&(d.component.then(l,f),r(d.error)&&(t.errorComp=_t(d.error,e)),r(d.loading)&&(t.loadingComp=_t(d.loading,e),0===d.delay?t.loading=!0:setTimeout(function(){i(t.resolved)&&i(t.error)&&(t.loading=!0,u())},d.delay||200)),r(d.timeout)&&setTimeout(function(){i(t.resolved)&&f(null)},d.timeout))),s=!1,t.loading?t.loadingComp:t.resolved}t.contexts.push(n)}function At(t){return t.isComment&&t.asyncFactory}function Et(t){if(Array.isArray(t))for(var e=0;e<t.length;e++){var n=t[e];if(r(n)&&(r(n.componentOptions)||At(n)))return n}}function kt(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Lt(t,e)}function $t(t,e,n){n?la.$once(t,e):la.$on(t,e)}function Ct(t,e){la.$off(t,e)}function Lt(t,e,n){la=t,dt(e,n||{},$t,Ct,t),la=void 0}function Tt(t,e){var n={};if(!t)return n;for(var i=0,r=t.length;i<r;i++){var o=t[i],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==e&&o.fnContext!==e||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(St)&&delete n[u];return n}function St(t){return t.isComment&&!t.asyncFactory||" "===t.text}function Ot(t,e){e=e||{};for(var n=0;n<t.length;n++)Array.isArray(t[n])?Ot(t[n],e):e[t[n].key]=t[n].fn;return e}function Nt(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}function It(t,e,n){t.$el=e,t.$options.render||(t.$options.render=qo),Pt(t,"beforeMount");var i;return i=function(){t._update(t._render(),n)},new wa(t,i,A,null,!0),n=!1,null==t.$vnode&&(t._isMounted=!0,Pt(t,"mounted")),t}function Rt(t,e,n,i,r){var o=!!(r||t.$options._renderChildren||i.data.scopedSlots||t.$scopedSlots!==ao);if(t.$options._parentVnode=i,t.$vnode=i,t._vnode&&(t._vnode.parent=i),t.$options._renderChildren=r,t.$attrs=i.data.attrs||ao,t.$listeners=n||ao,e&&t.$options.props){B(!1);for(var a=t._props,s=t.$options._propKeys||[],c=0;c<s.length;c++){var u=s[c],l=t.$options.props;a[u]=J(u,l,e,t)}B(!0),t.$options.propsData=e}n=n||ao;var f=t.$options._parentListeners;t.$options._parentListeners=n,Lt(t,n,f),o&&(t.$slots=Tt(r,i.context),t.$forceUpdate())}function Bt(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function Mt(t,e){if(e){if(t._directInactive=!1,Bt(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)Mt(t.$children[n]);Pt(t,"activated")}}function Dt(t,e){if(!(e&&(t._directInactive=!0,Bt(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)Dt(t.$children[n]);Pt(t,"deactivated")}}function Pt(t,e){O();var n=t.$options[e];if(n)for(var i=0,r=n.length;i<r;i++)try{n[i].call(t)}catch(n){it(n,t,e+" hook")}t._hasHookEvent&&t.$emit("hook:"+e),N()}function jt(){ba=ha.length=va.length=0,ma={},ga=ya=!1}function Ht(){ya=!0;var t,e;for(ha.sort(function(t,e){return t.id-e.id}),ba=0;ba<ha.length;ba++)t=ha[ba],e=t.id,ma[e]=null,t.run();var n=va.slice(),i=ha.slice();jt(),Gt(n),zt(i),Ho&&Ao.devtools&&Ho.emit("flush")}function zt(t){for(var e=t.length;e--;){var n=t[e],i=n.vm;i._watcher===n&&i._isMounted&&Pt(i,"updated")}}function Ft(t){t._inactive=!1,va.push(t)}function Gt(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,Mt(t[e],!0)}function Xt(t){var e=t.id;if(null==ma[e]){if(ma[e]=!0,ya){for(var n=ha.length-1;n>ba&&ha[n].id>t.id;)n--;ha.splice(n+1,0,t)}else ha.push(t);ga||(ga=!0,ct(Ht))}}function Ut(t,e,n){xa.get=function(){return this[e][n]},xa.set=function(t){this[e][n]=t},Object.defineProperty(t,n,xa)}function Vt(t){t._watchers=[];var e=t.$options;e.props&&Wt(t,e.props),e.methods&&Qt(t,e.methods),e.data?qt(t):P(t._data={},!0),e.computed&&Zt(t,e.computed),e.watch&&e.watch!==Ro&&te(t,e.watch)}function Wt(t,e){var n=t.$options.propsData||{},i=t._props={},r=t.$options._propKeys=[];!t.$parent||B(!1);for(var o in e)!function(o){r.push(o);var a=J(o,e,n,t);j(i,o,a),o in t||Ut(t,"_props",o)}(o);B(!0)}function qt(t){var e=t.$options.data;e=t._data="function"==typeof e?Yt(e,t):e||{},u(e)||(e={});for(var n=Object.keys(e),i=t.$options.props,r=(t.$options.methods,n.length);r--;){var o=n[r];i&&m(i,o)||C(o)||Ut(t,"_data",o)}P(e,!0)}function Yt(t,e){O();try{return t.call(e,e)}catch(t){return it(t,e,"data()"),{}}finally{N()}}function Zt(t,e){var n=t._computedWatchers=Object.create(null),i=jo();for(var r in e){var o=e[r],a="function"==typeof o?o:o.get;i||(n[r]=new wa(t,a||A,A,Aa)),r in t||Kt(t,r,o)}}function Kt(t,e,n){var i=!jo();"function"==typeof n?(xa.get=i?Jt(e):n,xa.set=A):(xa.get=n.get?i&&!1!==n.cache?Jt(e):n.get:A,xa.set=n.set?n.set:A),Object.defineProperty(t,e,xa)}function Jt(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Xo.target&&e.depend(),e.value}}function Qt(t,e){t.$options.props;for(var n in e)t[n]=null==e[n]?A:go(e[n],t)}function te(t,e){for(var n in e){var i=e[n];if(Array.isArray(i))for(var r=0;r<i.length;r++)ee(t,n,i[r]);else ee(t,n,i)}}function ee(t,e,n,i){return u(n)&&(i=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,i)}function ne(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}function ie(t){var e=re(t.$options.inject,t);e&&(B(!1),Object.keys(e).forEach(function(n){j(t,n,e[n])}),B(!0))}function re(t,e){if(t){for(var n=Object.create(null),i=zo?Reflect.ownKeys(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enume.........完整代码请登录后点击上方下载按钮下载查看

网友评论0