"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[6344],{7177:function(e,t,s){s.r(t),s.d(t,{default:function(){return f}});var i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pos-panels",class:{"pos-panels-compact":e.compact}},[t("transition",{attrs:{name:"slide-left"}},[e.showLeft&&e.leftSize>0?t("ViewportPanel",{ref:"left",attrs:{size:e.leftSize,title:e.leftTitle,right:!1,compact:e.compact},on:{resize:e.sendResize,close:function(t){return e.panelClose("left")}}},[e._t("left")],2):e._e()],1),t("div",{ref:"main",staticClass:"pos-panels-main"},[e._t("default")],2),t("transition",{attrs:{name:"slide-right"}},[e.showRight&&e.rightSize>0?t("ViewportPanel",{ref:"right",attrs:{size:e.rightSize,title:e.rightTitle,right:!0,compact:e.compact},on:{resize:e.sendResize,close:function(t){return e.panelClose("right")}}},[e._t("right")],2):e._e()],1)],1)},r=[],o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pos-panels-side",class:{"pos-panels-left":!e.right,"pos-panels-right":e.right},style:{width:e.calcSize}},[!e.compact&&e.right?t("div",{staticClass:"pos-panels-splitter",on:{mousedown:e.resizeStart}}):e._e(),t("div",{staticClass:"pos-panels-side-body"},[t("div",{staticClass:"pos-panels-header"},[t("span",{staticClass:"pos-panels-header-title",domProps:{textContent:e._s(e.title)}}),t("a",{staticClass:"pos-panels-header-close",on:{click:function(t){return t.preventDefault(),e.$emit("close")}}},[t("img",{attrs:{src:"img/icons/icon__close.svg","uk-svg":"",width:"16",height:"16"}})])]),t("div",{staticClass:"pos-panels-side-content"},[e._t("default")],2)]),e.compact||e.right?e._e():t("div",{staticClass:"pos-panels-splitter",on:{mousedown:e.resizeStart}})])},l=[],a={name:"ViewportPanel",props:{right:Boolean,title:String,size:{default:0,type:Number},minSize:{default:100,type:Number},compact:{type:Boolean,default:!1}},data(){return{startSize:0,startX:null,curSize:0}},computed:{calcSize(){return this.compact?"inherited":this.curSize+"px"}},watch:{size(){this.curSize=this.size}},created(){this.curSize=this.size},mounted(){this.curResizeStop=()=>{this.resizeStop()},this.curResizeMove=e=>{this.resizeMove(e)},document.body.addEventListener("mouseup",this.curResizeStop,!1)},beforeDestroy(){document.body.removeEventListener("mouseup",this.curResizeStop,!1),document.body.removeEventListener("mousemove",this.curResizeMove,!1)},methods:{resizeStart(e){e.preventDefault(),e.stopPropagation(),document.body.addEventListener("mousemove",this.curResizeMove,!1),this.startSize=this.curSize,this.startX=e.clientX},resizeMove(e){let t=e.clientX-this.startX;this.right&&(t=-t),this.curSize=this.startSize+t,this.curSize<this.minSize&&(this.curSize=this.minSize)},resizeStop(){null!==this.startX&&(this.$emit("resize",this.curSize),document.body.removeEventListener("mousemove",this.curResizeMove,!1),this.startX=null)}}},n=a,c=s(1656),u=(0,c.A)(n,o,l,!1,null,null,null),h=u.exports,p=s(1574),d={name:"ViewportPanels",components:{ViewportPanel:h},props:{keepClosedSize:{default:!1,type:Boolean},showLeft:{default:!0,type:Boolean},showRight:{default:!0,type:Boolean},leftSize:{default:0,type:Number},rightSize:{default:0,type:Number},leftTitle:{default:"",type:String},rightTitle:{default:"",type:String}},data(){return{fullWidth:0}},computed:{compact(){return p.A.compact}},mounted(){this.$emit("mounted")},beforeDestroy(){},methods:{sendResize(){let e={left:this.$refs.left?this.$refs.left.curSize:0,right:this.$refs.right?this.$refs.right.curSize:0};console.log("sendResize",e),this.$emit("resize",e)},panelClose(e){this.keepClosedSize||("left"===e?this.$refs.left.curSize=0:this.$refs.right.curSize=0,this.sendResize()),this.$emit("close",e)}}},m=d,z=(0,c.A)(m,i,r,!1,null,null,null),f=z.exports}}]);
//# sourceMappingURL=ViewportPanels.061b19b0.js.map