1 line
6.1 KiB
JavaScript
1 line
6.1 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[16],{"+/Xb":function(t,e,s){"use strict";var i=s("Fofw"),o=s.n(i);o.a},"3IoI":function(t,e,s){},Fofw:function(t,e,s){},QPWA:function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"split-pane-page-wrapper"},[s("split-pane",{on:{"on-moving":t.handleMoving},model:{value:t.offset,callback:function(e){t.offset=e},expression:"offset"}},[s("div",{staticClass:"pane left-pane",attrs:{slot:"left"},slot:"left"},[s("split-pane",{attrs:{mode:"vertical"},on:{"on-moving":t.handleMoving},model:{value:t.offsetVertical,callback:function(e){t.offsetVertical=e},expression:"offsetVertical"}},[s("div",{staticClass:"pane top-pane",attrs:{slot:"top"},slot:"top"}),t._v(" "),s("div",{staticClass:"pane bottom-pane",attrs:{slot:"bottom"},slot:"bottom"}),t._v(" "),s("div",{staticClass:"custom-trigger",attrs:{slot:"trigger"},slot:"trigger"},[s("icons",{staticClass:"trigger-icon",attrs:{size:22,type:"resize-vertical",color:"#fff"}})],1)])],1),t._v(" "),s("div",{staticClass:"pane right-pane",attrs:{slot:"right"},slot:"right"})])],1)},o=[],n=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{ref:"outerWrapper",class:t.wrapperClasses},[t.isHorizontal?s("div",{class:t.prefix+"-horizontal"},[s("div",{class:[t.prefix+"-pane","left-pane"],style:{right:t.anotherOffset+"%"}},[t._t("left")],2),t._v(" "),s("div",{class:t.prefix+"-trigger-con",style:{left:t.offset+"%"},on:{mousedown:t.handleMousedown}},[t._t("trigger",[s("trigger",{attrs:{mode:"vertical"}})])],2),t._v(" "),s("div",{class:[t.prefix+"-pane","right-pane"],style:{left:t.offset+"%"}},[t._t("right")],2)]):s("div",{class:t.prefix+"-vertical"},[s("div",{class:[t.prefix+"-pane","top-pane"],style:{bottom:t.anotherOffset+"%"}},[t._t("top")],2),t._v(" "),s("div",{class:t.prefix+"-trigger-con",style:{top:t.offset+"%"},on:{mousedown:t.handleMousedown}},[t._t("trigger",[s("trigger",{attrs:{mode:"horizontal"}})])],2),t._v(" "),s("div",{class:[t.prefix+"-pane","bottom-pane"],style:{top:t.offset+"%"}},[t._t("bottom")],2)])])},a=[],r=s("kN7S"),l=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{class:t.classes},[s("div",{class:t.barConClasses},t._m(0))])},f=[function(){var t=this,e=t.$createElement,s=t._self._c||e;return t._l(8,function(e){return s("i",{key:"trigger-"+e,class:t.prefix+"-bar"})})}],u={name:"Trigger",props:{mode:String},data:function(){return{prefix:"ivu-split-trigger",initOffset:0}},computed:{isVertical:function(){return"vertical"===this.mode},classes:function(){return[this.prefix,this.isVertical?"".concat(this.prefix,"-vertical"):"".concat(this.prefix,"-horizontal")]},barConClasses:function(){return["".concat(this.prefix,"-bar-con"),this.isVertical?"vertical":"horizontal"]}}},c=u,p=(s("+/Xb"),s("KHd+")),h=Object(p["a"])(c,l,f,!1,null,null,null),d=h.exports,v={name:"SplitPane",components:{Trigger:d},props:{value:{type:[Number,String],default:.5},mode:{validator:function(t){return Object(r["f"])(t,["horizontal","vertical"])},default:"horizontal"},min:{type:[Number,String],default:"40px"},max:{type:[Number,String],default:"40px"}},data:function(){return{prefix:"ivu-split",offset:0,oldOffset:0,isMoving:!1}},computed:{wrapperClasses:function(){return["".concat(this.prefix,"-wrapper"),this.isMoving?"no-select":""]},isHorizontal:function(){return"horizontal"===this.mode},anotherOffset:function(){return 100-this.offset},valueIsPx:function(){return"string"===typeof this.value},offsetSize:function(){return this.isHorizontal?"offsetWidth":"offsetHeight"},computedMin:function(){return this.getComputedThresholdValue("min")},computedMax:function(){return this.getComputedThresholdValue("max")}},methods:{px2percent:function(t,e){return parseFloat(t)/parseFloat(e)},getComputedThresholdValue:function(t){var e=this.$refs.outerWrapper[this.offsetSize];return this.valueIsPx?"string"===typeof this[t]?this[t]:e*this[t]:"string"===typeof this[t]?this.px2percent(this[t],e):this[t]},getMin:function(t,e){return this.valueIsPx?"".concat(Math.min(parseFloat(t),parseFloat(e)),"px"):Math.min(t,e)},getMax:function(t,e){return this.valueIsPx?"".concat(Math.max(parseFloat(t),parseFloat(e)),"px"):Math.max(t,e)},getAnotherOffset:function(t){var e=0;return e=this.valueIsPx?"".concat(this.$refs.outerWrapper[this.offsetSize]-parseFloat(t),"px"):1-t,e},handleMove:function(t){var e=this.isHorizontal?t.pageX:t.pageY,s=e-this.initOffset,i=this.$refs.outerWrapper[this.offsetSize],o=this.valueIsPx?"".concat(parseFloat(this.oldOffset)+s,"px"):this.px2percent(i*this.oldOffset+s,i),n=this.getAnotherOffset(o);parseFloat(o)<=parseFloat(this.computedMin)&&(o=this.getMax(o,this.computedMin)),parseFloat(n)<=parseFloat(this.computedMax)&&(o=this.getAnotherOffset(this.getMax(n,this.computedMax))),t.atMin=this.value===this.computedMin,t.atMax=this.valueIsPx?this.getAnotherOffset(this.value)===this.computedMax:this.getAnotherOffset(this.value).toFixed(5)===this.computedMax.toFixed(5),this.$emit("input",o),this.$emit("on-moving",t)},handleUp:function(){this.isMoving=!1,Object(r["d"])(document,"mousemove",this.handleMove),Object(r["d"])(document,"mouseup",this.handleUp),this.$emit("on-move-end")},handleMousedown:function(t){this.initOffset=this.isHorizontal?t.pageX:t.pageY,this.oldOffset=this.value,this.isMoving=!0,Object(r["e"])(document,"mousemove",this.handleMove),Object(r["e"])(document,"mouseup",this.handleUp),this.$emit("on-move-start")}},watch:{value:function(){this.offset=1e4*(this.valueIsPx?this.px2percent(this.value,this.$refs.outerWrapper[this.offsetSize]):this.value)/100}},mounted:function(){var t=this;this.$nextTick(function(){t.offset=1e4*(t.valueIsPx?t.px2percent(t.value,t.$refs.outerWrapper[t.offsetSize]):t.value)/100})}},m=v,g=(s("jFZs"),Object(p["a"])(m,n,a,!1,null,null,null)),x=g.exports,M=x,b=s("g67X"),_={name:"split_pane_page",components:{SplitPane:M,Icons:b["a"]},data:function(){return{offset:.6,offsetVertical:"250px"}},methods:{handleMoving:function(t){console.log(t.atMin,t.atMax)}}},O=_,z=(s("u4Gd"),Object(p["a"])(O,i,o,!1,null,null,null));e["default"]=z.exports},SwzL:function(t,e,s){},jFZs:function(t,e,s){"use strict";var i=s("3IoI"),o=s.n(i);o.a},u4Gd:function(t,e,s){"use strict";var i=s("SwzL"),o=s.n(i);o.a}}]); |