import{be as z,bm as S,bn as f,bo as a,c,o as p,F as g,y,g as E,h as P,bp as b,b3 as d,i as L}from"./B7uMD7bG.js";var T={root:function(e){var n=e.props;return["p-splitter p-component","p-splitter-"+n.layout]},gutter:"p-splitter-gutter",gutterHandler:"p-splitter-gutter-handle"},x={root:function(e){var n=e.props;return[{display:"flex","flex-wrap":"nowrap"},n.layout==="vertical"?{"flex-direction":"column"}:""]}},M=z.extend({name:"splitter",classes:T,inlineStyles:x}),w={name:"BaseSplitter",extends:S,props:{layout:{type:String,default:"horizontal"},gutterSize:{type:Number,default:4},stateKey:{type:String,default:null},stateStorage:{type:String,default:"session"},step:{type:Number,default:5}},style:M,provide:function(){return{$parentInstance:this}}};function v(t){return G(t)||R(t)||I(t)||A()}function A(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I(t,e){if(t){if(typeof t=="string")return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,e)}}function R(t){if(typeof Symbol<"u"&&t[symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function G(t){if(Array.isArray(t))return m(t)}function m(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,s=new Array(e);n100||e<0||n>100||n<0)return!1;var s=f.getVNodeProp(this.panels[this.prevPanelIndex],"minSize");if(this.panels[this.prevPanelIndex].props&&s&&s>e)return!1;var r=f.getVNodeProp(this.panels[this.prevPanelIndex+1],"minSize");return!(this.panels[this.prevPanelIndex+1].props&&r&&r>n)},unbindMouseListeners:function(){this.mouseMoveListener&&(document.removeEventListener("mousemove",this.mouseMoveListener),this.mouseMoveListener=null),this.mouseUpListener&&(document.removeEventListener("mouseup",this.mouseUpListener),this.mouseUpListener=null)},unbindTouchListeners:function(){this.touchMoveListener&&(document.removeEventListener("touchmove",this.touchMoveListener),this.touchMoveListener=null),this.touchEndListener&&(document.removeEventListener("touchend",this.touchEndListener),this.touchEndListener=null)},clear:function(){this.dragging=!1,this.size=null,this.startPos=null,this.prevPanelElement=null,this.nextPanelElement=null,this.prevPanelSize=null,this.nextPanelSize=null,this.gutterElement=null,this.prevPanelIndex=null},isStateful:function(){return this.stateKey!=null},getStorage:function(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},saveState:function(){f.isArray(this.panelSizes)&&this.getStorage().setItem(this.stateKey,JSON.stringify(this.panelSizes))},restoreState:function(){var e=this,n=this.getStorage(),s=n.getItem(this.stateKey);if(s){this.panelSizes=JSON.parse(s);var r=v(this.$el.children).filter(function(i){return i.getAttribute("data-pc-name")==="splitterpanel"});return r.forEach(function(i,o){i.style.flexBasis="calc("+e.panelSizes[o]+"% - "+(e.panels.length-1)*e.gutterSize+"px)"}),!0}return!1}},computed:{panels:function(){var e=this,n=[];return this.$slots.default().forEach(function(s){e.isSplitterPanel(s)?n.push(s):s.children instanceof Array&&s.children.forEach(function(r){e.isSplitterPanel(r)&&n.push(r)})}),n},gutterStyle:function(){return this.horizontal?{width:this.gutterSize+"px"}:{height:this.gutterSize+"px"}},horizontal:function(){return this.layout==="horizontal"},getPTOptions:function(){var e;return{context:{nested:(e=this.$parentInstance)===null||e===void 0?void 0:e.nestedState}}}}},U=["onMousedown","onTouchstart","onTouchmove","onTouchend"],D=["aria-orientation","aria-valuenow","onKeydown"];function K(t,e,n,s,r,i){return p(),c("div",d({class:t.cx("root"),style:t.sx("root"),"data-p-resizing":!1},t.ptmi("root",i.getPTOptions)),[(p(!0),c(g,null,y(i.panels,function(o,u){return p(),c(g,{key:u},[(p(),E(b(o),{tabindex:"-1"})),u!==i.panels.length-1?(p(),c("div",d({key:0,ref_for:!0,ref:"gutter",class:t.cx("gutter"),role:"separator",tabindex:"-1",onMousedown:function(l){return i.onGutterMouseDown(l,u)},onTouchstart:function(l){return i.onGutterTouchStart(l,u)},onTouchmove:function(l){return i.onGutterTouchMove(l,u)},onTouchend:function(l){return i.onGutterTouchEnd(l,u)},"data-p-gutter-resizing":!1},t.ptm("gutter")),[L("div",d({class:t.cx("gutterHandler"),tabindex:"0",style:[i.gutterStyle],"aria-orientation":t.layout,"aria-valuenow":r.prevSize,onKeyup:e[0]||(e[0]=function(){return i.onGutterKeyUp&&i.onGutterKeyUp.apply(i,arguments)}),onKeydown:function(l){return i.onGutterKeyDown(l,u)}},t.ptm("gutterHandler")),null,16,D)],16,U)):P("",!0)],64)}),128))],16)}O.render=K;export{O as default};

AltStyle によって変換されたページ (->オリジナル) /