vxe-pc-ui 4.8.24 → 4.8.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/icon/style.css +1 -1
- package/es/language/en-US.js +12 -12
- package/es/split/src/split.js +189 -53
- package/es/split/style.css +74 -9
- package/es/split/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +5 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-split/style.css +74 -9
- package/es/vxe-split/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +201 -84
- package/lib/index.umd.min.js +1 -1
- package/lib/language/en-US.js +12 -12
- package/lib/language/en-US.min.js +1 -1
- package/lib/language/en-US.umd.js +12 -12
- package/lib/split/src/split.js +195 -82
- package/lib/split/src/split.min.js +1 -1
- package/lib/split/style/style.css +74 -9
- package/lib/split/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +5 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-split/style/style.css +74 -9
- package/lib/vxe-split/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/language/en-US.ts +12 -12
- package/packages/split/src/split.ts +196 -54
- package/packages/ui/index.ts +4 -0
- package/styles/components/split.scss +92 -16
- package/styles/theme/base.scss +2 -0
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -0
- package/types/components/gantt-module/gantt-view.d.ts +12 -12
- package/types/components/split.d.ts +14 -0
- /package/es/icon/{iconfont.1755847372488.ttf → iconfont.1755949930275.ttf} +0 -0
- /package/es/icon/{iconfont.1755847372488.woff → iconfont.1755949930275.woff} +0 -0
- /package/es/icon/{iconfont.1755847372488.woff2 → iconfont.1755949930275.woff2} +0 -0
- /package/es/{iconfont.1755847372488.ttf → iconfont.1755949930275.ttf} +0 -0
- /package/es/{iconfont.1755847372488.woff → iconfont.1755949930275.woff} +0 -0
- /package/es/{iconfont.1755847372488.woff2 → iconfont.1755949930275.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1755847372488.ttf → iconfont.1755949930275.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1755847372488.woff → iconfont.1755949930275.woff} +0 -0
- /package/lib/icon/style/{iconfont.1755847372488.woff2 → iconfont.1755949930275.woff2} +0 -0
- /package/lib/{iconfont.1755847372488.ttf → iconfont.1755949930275.ttf} +0 -0
- /package/lib/{iconfont.1755847372488.woff → iconfont.1755949930275.woff} +0 -0
- /package/lib/{iconfont.1755847372488.woff2 → iconfont.1755949930275.woff2} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeSplit",props:{width:[Number,String],height:[Number,String],vertical:{type:Boolean,default:()=>(0,_ui.getConfig)().split.vertical},border:{type:Boolean,default:()=>(0,_ui.getConfig)().split.border},padding:{type:Boolean,default:()=>(0,_ui.getConfig)().split.padding},resize:{type:Boolean,default:()=>(0,_ui.getConfig)().split.resize},items:Array,itemConfig:Object,barConfig:Object,actionConfig:Object},emits:["action-dblclick","action-click","toggle-expand","resize-start","resize-drag","resize-end"],setup(E,e){const{emit:s,slots:l}=e;var t=_xeUtils.default.uniqueId();const H=(0,_vue.ref)(),U=(0,_vue.reactive)({staticItems:[],itemList:[]}),h={wrapperWidth:0,wrapperHeight:0},W=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.itemConfig,E.itemConfig)),r=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.barConfig,E.barConfig)),a=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.actionConfig,E.actionConfig)),I=(0,_vue.computed)(()=>{return"next"===a.value.direction}),n=(0,_vue.computed)(()=>U.itemList.filter(e=>e.isVisible)),o=(0,_vue.computed)(()=>{var e=E["vertical"];const n=[];let a=0,o=0;return U.itemList.forEach(e?e=>{var{renderHeight:t,resizeHeight:i,foldHeight:s,isVisible:r,height:l}=e,r=r?s||i||t:0;l||n.push(e),a+=r}:e=>{var{renderWidth:t,resizeWidth:i,foldWidth:s,isVisible:r,width:l}=e,r=r?s||i||t:0;l||n.push(e),o+=r}),{autoItems:n,heightCount:a,heightRatio:a/100,widthCount:o,widthRatio:o/100}}),d=(0,_vue.computed)(()=>{var{width:e,height:t}=r.value,i={};return t&&(i.height=(0,_dom.toCssUnit)(t)),e&&(i.width=(0,_dom.toCssUnit)(e)),i}),i={computeItemOpts:W,computeBarOpts:r,computeActionOpts:a,computeIsFoldNext:I},u={refElem:H},w={xID:t,props:E,context:e,reactData:U,internalData:h,getRefMaps:()=>u,getComputeMaps:()=>i},C=(e,t,i)=>{s(e,(0,_ui.createEvent)(i,{$split:w},t))},N=(e,t)=>e&&(_xeUtils.default.isString(e)&&(e=l[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e(t)):[];const c=(e,t)=>{var i=U["staticItems"];const s={isVisible:!0,isExpand:!0,renderWidth:0,resizeWidth:0,foldWidth:0,renderHeight:0,resizeHeight:0,foldHeight:0};return U.itemList=e.map(e=>(e.slots&&_xeUtils.default.each(e.slots,e=>{_xeUtils.default.isFunction(e)||l[e]||(0,_log.errLog)("vxe.error.notSlot",[e])}),Object.assign({},t?null:s,e,t?s:null,{id:_xeUtils.default.uniqueId()}))),i.length&&(0,_log.errLog)("vxe.error.errConflicts",["<vxe-split-pane ...>","items"]),O()},m=e=>c(e||[],!1);const O=()=>(0,_vue.nextTick)().then(()=>{var e=E["vertical"],t=U["itemList"],i=H.value;if(i){const r=i.clientWidth,l=i.clientHeight;if(r&&l){i=W.value;const n=_xeUtils.default.toNumber(i.minWidth),a=_xeUtils.default.toNumber(i.minHeight),o=[];if(e){let s=0;if(t.forEach(e=>{var t=e["height"];let i=0;t?(i=(0,_dom.isScale)(t)?l*_xeUtils.default.toNumber(t)/100:_xeUtils.default.toNumber(t),e.renderHeight=i):o.push(e),s+=i}),o.length){const d=(l-s)/o.length;o.forEach(e=>{e.renderHeight=Math.max(_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(e.minHeight,a)),d)})}}else{let s=0;if(t.forEach(e=>{var t=e["width"];let i=0;t?(i=(0,_dom.isScale)(t)?r*_xeUtils.default.toNumber(t)/100:_xeUtils.default.toNumber(t),e.renderWidth=i):o.push(e),s+=i}),o.length){const u=(r-s)/o.length;o.forEach(e=>{e.renderWidth=Math.max(_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(e.minWidth,n)),u)})}}h.wrapperWidth=r,h.wrapperHeight=l}}}),g=e=>{const{resize:t,vertical:s}=E;var i=U["itemList"];if(t){e.preventDefault();var r=e.currentTarget.parentElement;const a=H.value;if(a){const o=r.getAttribute("itemid");r=_xeUtils.default.findIndexOf(i,e=>e.id===o);const d=i[r];if(d&&d.isExpand){const u=I.value;var l=W.value,n=_xeUtils.default.toNumber(l.minWidth),l=_xeUtils.default.toNumber(l.minHeight);const h=i[r+(u?1:-1)];i=h?a.querySelector(`.vxe-split-pane[itemid="${h.id}"]`):null,r=d?a.querySelector(`.vxe-split-pane[itemid="${d.id}"]`):null;const c=i?i.clientWidth:0,m=r?r.clientWidth:0,g=i?i.clientHeight:0,f=r?r.clientHeight:0,v=_xeUtils.default.toNumber(h?(0,_utils.getGlobalDefaultConfig)(h.minWidth,n):n),p=_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(d.minWidth,n)),_=_xeUtils.default.toNumber(h?(0,_utils.getGlobalDefaultConfig)(h.minHeight,l):l),x=_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(d.minHeight,l)),b=e.clientX,z=e.clientY;(0,_dom.addClass)(a,"is--drag"),document.onmousemove=e=>{var t,i;e.preventDefault(),s?0<(t=u?z-e.clientY:e.clientY-z)?h&&f-t>=x&&(i=f-t,h.resizeHeight=g+t,d.resizeHeight=i,C("resize-drag",{item:d,name:d.name,offsetHeight:t,resizeHeight:i,offsetWidth:0,resizeWidth:0},e)):h&&g+t>=_&&(i=f-t,h.resizeHeight=g+t,d.resizeHeight=i,C("resize-drag",{item:d,name:d.name,offsetHeight:t,resizeHeight:i,offsetWidth:0,resizeWidth:0},e)):0<(t=u?b-e.clientX:e.clientX-b)?h&&m-t>=p&&(i=m-t,h.resizeWidth=c+t,d.resizeWidth=i,C("resize-drag",{item:d,name:d.name,offsetHeight:0,resizeHeight:0,offsetWidth:t,resizeWidth:i},e)):h&&c+t>=v&&(i=m-t,h.resizeWidth=c+t,d.resizeWidth=i,C("resize-drag",{item:d,name:d.name,offsetHeight:0,resizeHeight:0,offsetWidth:t,resizeWidth:i},e))},document.onmouseup=e=>{document.onmousemove=null,(document.onmouseup=null,_dom.removeClass)(a,"is--drag"),C("resize-end",{item:d,name:d.name,resizeHeight:d.resizeHeight,resizeWidth:d.resizeWidth},e),O()},C("resize-start",{item:d,name:d.name},e)}}}},f=e=>{if(H.value){var t=E["vertical"],i=U["itemList"],s=I.value;const n=e.currentTarget.parentElement.getAttribute("itemid");var r=_xeUtils.default.findIndexOf(i,e=>e.id===n),l=i[r],i=i[r+(s?1:-1)];l&&({showAction:r,isExpand:s}=l,r)&&(t?i&&(i.isVisible=!s,i.foldHeight=0,l.isExpand=!s,l.isVisible=!0,l.foldHeight=s?(i.resizeHeight||i.renderHeight)+(l.resizeHeight||l.renderHeight):0):i&&(i.isVisible=!s,i.foldWidth=0,l.isExpand=!s,l.isVisible=!0,l.foldWidth=s?(i.resizeWidth||i.renderWidth)+(l.resizeWidth||l.renderWidth):0),C("toggle-expand",{item:l,name:l.name,targetItem:i,targetName:i?i.name:"",expanded:l.isExpand},e),O())}},v=e=>{var t=U["itemList"],i=a.value;const s=e.currentTarget.parentElement.getAttribute("itemid");t=t[_xeUtils.default.findIndexOf(t,e=>e.id===s)];"dblclick"===i.trigger&&f(e),C("action-dblclick",{item:t,name:t?t.name:""},e)},p=e=>{var t=U["itemList"],i=a.value;const s=e.currentTarget.parentElement.getAttribute("itemid");t=t[_xeUtils.default.findIndexOf(t,e=>e.id===s)];"dblclick"!==i.trigger&&f(e),C("action-click",{item:t,name:t?t.name:""},e)},_=()=>{O()};t={dispatchEvent:C,recalculate:O,reset:()=>{var e=U["itemList"];return e.forEach(e=>{e.isExpand=!0,e.isVisible=!0,e.foldHeight=0,e.foldWidth=0,e.resizeHeight=0,e.resizeWidth=0}),(0,_vue.nextTick)()},loadItem:m,reloadItem:e=>c(e||[],!0)};Object.assign(w,t,{});const L=e=>{var t=d.value,i=a.value,s=I.value,{id:r,isExpand:l,showAction:n}=e;return(0,_vue.h)("div",{itemid:r,class:["vxe-split-pane-handle",s?"to--next":"to--prev"]},[(0,_vue.h)("div",{class:"vxe-split-pane-handle-bar",style:t,onMousedown:g}),n?(0,_vue.h)("span",{class:"vxe-split-pane-action-btn",onDblclick:v,onClick:p},[(0,_vue.h)("i",{class:(l?i.openIcon:i.closeIcon)||(e=>{var t=E["vertical"],{showAction:e,isExpand:i}=e,s=I.value,r="SPLIT_TOP_ACTION",l="SPLIT_BOTTOM_ACTION",n="SPLIT_LEFT_ACTION",a="SPLIT_RIGHT_ACTION";if(e){let e="";if(e=s?t?i?l:r:i?a:n:t?i?r:l:i?n:a)return(0,_ui.getIcon)()[e]}return""})(e)})]):(0,_ui.renderEmptyElement)(w)])};const x=(0,_vue.ref)(0);(0,_vue.watch)(()=>E.items?E.items.length:-1,()=>{x.value++}),(0,_vue.watch)(()=>E.items,()=>{x.value++}),(0,_vue.watch)(x,()=>{m(E.items||[])}),(0,_vue.watch)(()=>U.staticItems,e=>{E.items&&E.items.length&&(0,_log.errLog)("vxe.error.errConflicts",["<vxe-split-pane ...>","items"]),U.itemList=e,O()});let b;return(0,_vue.onMounted)(()=>{(0,_vue.nextTick)(()=>{O()});var e=H.value;e&&(b=_ui.globalResize.create(()=>{O()})).observe(e),_ui.globalEvents.on(w,"resize",_)}),(0,_vue.onUnmounted)(()=>{b&&b.disconnect(),_ui.globalEvents.off(w,"resize")}),(0,_vue.onActivated)(()=>{O()}),E.items&&m(E.items),(0,_vue.provide)("$xeSplit",w),w.renderVN=()=>{var{vertical:e,width:t,height:i}=E,s=l.default,r={};return i&&(r.height=(0,_dom.toCssUnit)(i)),t&&(r.width=(0,_dom.toCssUnit)(t)),(0,_vue.h)("div",{ref:H,class:["vxe-split",e?"is--vertical":"is--horizontal"],style:r},[(0,_vue.h)("div",{class:"vxe-split-slots"},s?s({}):[]),(()=>{const{border:v,padding:p,resize:_,vertical:x}=E,b=U["itemList"],z=n.value,H=o.value["autoItems"],W=I.value,C=[];return b.forEach((e,t)=>{var{id:i,name:s,slots:r,renderHeight:l,resizeHeight:n,foldHeight:a,renderWidth:o,resizeWidth:d,foldWidth:u,isVisible:h,isExpand:c}=e,r=r?r.default:null,m={};let g=h?u||d||o:0,f=h?a||n||l:0;1===H.length&&(x?e.height||(f=0):e.width||(g=0)),x?f&&(m.height=1===z.length?"100%":(0,_dom.toCssUnit)(f)):g&&(m.width=1===z.length?"100%":(0,_dom.toCssUnit)(g)),C.push((0,_vue.h)("div",{itemid:i,class:["vxe-split-pane",x?"is--vertical":"is--horizontal",{"is--resize":_,"is--padding":p,"is--border":v,"is--height":f,"is--width":g,"is--fill":h&&!f&&!g,"is--handle":0<t,"is--expand":c,"is--hidden":!h}],style:m},[t&&!W?L(e):(0,_ui.renderEmptyElement)(w),(0,_vue.h)("div",{itemid:i,class:"vxe-split-pane--wrapper"},[(0,_vue.h)("div",{class:"vxe-split-pane--inner"},r?N(r,{name:s,isVisible:h,isExpand:c}):[])]),W&&t<b.length-1?L(e):(0,_ui.renderEmptyElement)(w)]))}),(0,_vue.h)("div",{class:"vxe-split-wrapper"},C)})()])},w},render(){return this.renderVN()}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeSplit",props:{width:[Number,String],height:[Number,String],vertical:{type:Boolean,default:()=>(0,_ui.getConfig)().split.vertical},border:{type:Boolean,default:()=>(0,_ui.getConfig)().split.border},padding:{type:Boolean,default:()=>(0,_ui.getConfig)().split.padding},resize:{type:Boolean,default:()=>(0,_ui.getConfig)().split.resize},items:Array,itemConfig:Object,barConfig:Object,resizeConfig:Object,actionConfig:Object},emits:["action-dblclick","action-click","toggle-expand","resize-start","resize-drag","resize-end"],setup(h,e){const{emit:s,slots:o}=e;var t=_xeUtils.default.uniqueId();const c=(0,_vue.ref)(),a=(0,_vue.ref)(),D=(0,_vue.reactive)({staticItems:[],itemList:[]}),f={wrapperWidth:0,wrapperHeight:0},j=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.itemConfig,h.itemConfig)),l=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.barConfig,h.barConfig)),d=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.resizeConfig,h.resizeConfig)),u=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.actionConfig,h.actionConfig)),R=(0,_vue.computed)(()=>{return"next"===u.value.direction}),m=(0,_vue.computed)(()=>D.itemList.filter(e=>e.isVisible)),p=(0,_vue.computed)(()=>{var e=h["vertical"];const r=[];let o=0,a=0;return D.itemList.forEach(e?e=>{var{renderHeight:t,resizeHeight:i,foldHeight:s,isVisible:l,height:n}=e,l=l?s||i||t:0;n||r.push(e),o+=l}:e=>{var{renderWidth:t,resizeWidth:i,foldWidth:s,isVisible:l,width:n}=e,l=l?s||i||t:0;n||r.push(e),a+=l}),{autoItems:r,heightCount:o,heightRatio:o/100,widthCount:a,widthRatio:a/100}}),g=(0,_vue.computed)(()=>{var{width:e,height:t}=l.value,i={};return t&&(i.height=(0,_dom.toCssUnit)(t)),e&&(i.width=(0,_dom.toCssUnit)(e)),i}),i={computeItemOpts:j,computeBarOpts:l,computeActionOpts:u,computeIsFoldNext:R},n={refElem:c},W={xID:t,props:h,context:e,reactData:D,internalData:f,getRefMaps:()=>n,getComputeMaps:()=>i},B=(e,t,i)=>{s(e,(0,_ui.createEvent)(i,{$split:W},t))},I=(e,t)=>e&&(_xeUtils.default.isString(e)&&(e=o[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e(t)):[];const r=(e,t)=>{var i=D["staticItems"];const s={isVisible:!0,isExpand:!0,renderWidth:0,resizeWidth:0,foldWidth:0,renderHeight:0,resizeHeight:0,foldHeight:0};return D.itemList=e.map(e=>(e.slots&&_xeUtils.default.each(e.slots,e=>{_xeUtils.default.isFunction(e)||o[e]||(0,_log.errLog)("vxe.error.notSlot",[e])}),Object.assign({},t?null:s,e,t?s:null,{id:_xeUtils.default.uniqueId()}))),i.length&&(0,_log.errLog)("vxe.error.errConflicts",["<vxe-split-pane ...>","items"]),G()},v=e=>r(e||[],!1);const G=()=>(0,_vue.nextTick)().then(()=>{var e=h["vertical"],t=D["itemList"],i=c.value;if(i){const l=i.clientWidth,n=i.clientHeight;if(l&&n){i=j.value;const r=_xeUtils.default.toNumber(i.minWidth),o=_xeUtils.default.toNumber(i.minHeight),a=[];if(e){let s=0;if(t.forEach(e=>{var t=e["height"];let i=0;t?(i=(0,_dom.isScale)(t)?n*_xeUtils.default.toNumber(t)/100:_xeUtils.default.toNumber(t),e.renderHeight=i):a.push(e),s+=i}),a.length){const d=(n-s)/a.length;a.forEach(e=>{e.renderHeight=Math.max(_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(e.minHeight,o)),d)})}}else{let s=0;if(t.forEach(e=>{var t=e["width"];let i=0;t?(i=(0,_dom.isScale)(t)?l*_xeUtils.default.toNumber(t)/100:_xeUtils.default.toNumber(t),e.renderWidth=i):a.push(e),s+=i}),a.length){const u=(l-s)/a.length;a.forEach(e=>{e.renderWidth=Math.max(_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(e.minWidth,r)),u)})}}f.wrapperWidth=l,f.wrapperHeight=n}}}),_=e=>{const{resize:t,vertical:f}=h;var i=D["itemList"];if(t){e.preventDefault();var s=e.currentTarget,l=s.parentElement;const _=c.value;if(_){const n=l.getAttribute("itemid");l=_xeUtils.default.findIndexOf(i,e=>e.id===n);const x=i[l];if(x&&x.isExpand){const b=_.getBoundingClientRect();s=s.getBoundingClientRect();const C=a.value,y=C?C.children[0]:null;var m=R.value,p=j.value;const z=d.value["immediate"];var g=_xeUtils.default.toNumber(p.minWidth),p=_xeUtils.default.toNumber(p.minHeight),v=i[l+(m?1:-1)];const H=i[l+(m?0:-1)],U=i[l+(m?1:0)],W=v?_.querySelector(`.vxe-split-pane[itemid="${H.id}"]`):null,I=x?_.querySelector(`.vxe-split-pane[itemid="${U.id}"]`):null;if(W&&I){i=Math.ceil(s.width-(e.clientX-s.left)),l=Math.ceil(e.clientY-s.top);const E=W.offsetWidth,w=I.offsetWidth;m=_xeUtils.default.toNumber(H?(0,_utils.getGlobalDefaultConfig)(H.minWidth,g):g),v=_xeUtils.default.toNumber(U?(0,_utils.getGlobalDefaultConfig)(U.minWidth,g):g);const N=W.offsetLeft+m-i,O=I.offsetLeft+I.offsetWidth-v-i,T=e.clientX-b.left;let n=-1,r=0,o=0,a=T;const L=W.offsetHeight,M=I.offsetHeight;s=_xeUtils.default.toNumber(H?(0,_utils.getGlobalDefaultConfig)(H.minHeight,p):p),g=_xeUtils.default.toNumber(U?(0,_utils.getGlobalDefaultConfig)(U.minHeight,p):p);const k=W.offsetTop+s+l,V=I.offsetTop+I.offsetHeight-g+l,S=e.clientY-b.top;let d=-1,u=0,h=0,c=S;const q=i=>{if(C){var s=y?y.children[0]:null,l=y?y.children[1]:null;if(f){let e=0,t=(s&&(d<0?(s.textContent=Math.floor(u)+"px",s.style.display="block",e=s.offsetWidth):s.style.display="none"),l&&(d<0?l.style.display="none":(l.textContent=Math.floor(h)+"px",l.style.display="block",e=l.offsetWidth)),Math.max(1,i.clientX-b.left-e/2));t>b.width-e-1&&(t=b.width-e-1),C.style.left="0",C.style.top=c+"px",y&&(y.style.left=t+"px")}else{let e=0,t=(s&&(n<0?(s.textContent=Math.floor(r)+"px",s.style.display="block",e=s.offsetHeight):s.style.display="none"),l&&(n<0?l.style.display="none":(l.textContent=Math.floor(o)+"px",l.style.display="block",e=l.offsetHeight)),Math.max(1,i.clientY-b.top-e/2));t>b.height-e-1&&(t=b.height-e-1),C.style.top="0",C.style.left=a+"px",y&&(y.style.top=t+"px")}}},A=e=>{f?((c=(c=e.clientY-b.top)<k?k:c)>V&&(c=V),d=c-S,u=L+d,h=M-d):((a=(a=e.clientX-b.left)<N?N:a)>O&&(a=O),n=a-T,r=E+n,o=w-n),z&&(f?(W.style.height=(0,_dom.toCssUnit)(u),I.style.height=(0,_dom.toCssUnit)(h)):(W.style.width=(0,_dom.toCssUnit)(r),I.style.width=(0,_dom.toCssUnit)(o))),C&&q(e),B("resize-drag",{item:x,name:x.name,prevItem:H,nextItem:U,offsetHeight:d,offsetWidth:n},e)};document.onmousemove=e=>{e.preventDefault(),A(e)},document.onmouseup=e=>{document.onmousemove=null,document.onmouseup=null,C&&(C.style.display=""),f?(H.resizeHeight=u,U.resizeHeight=h):(H.resizeWidth=r,U.resizeWidth=o),(0,_dom.removeClass)(_,"is--drag"),B("resize-end",{item:x,name:x.name,prevItem:H,nextItem:U,offsetHeight:d,offsetWidth:n},e),G()},C&&(C.style.display="block",q(e)),A(e),(0,_dom.addClass)(_,"is--drag"),B("resize-start",{item:x,name:x.name,prevItem:H,nextItem:U},e)}}}}},x=e=>{if(c.value){var t=h["vertical"],i=D["itemList"],s=R.value;const r=e.currentTarget.parentElement.getAttribute("itemid");var l=_xeUtils.default.findIndexOf(i,e=>e.id===r),n=i[l],i=i[l+(s?1:-1)];n&&({showAction:l,isExpand:s}=n,l)&&(t?i&&(i.isVisible=!s,i.foldHeight=0,n.isExpand=!s,n.isVisible=!0,n.foldHeight=s?(i.resizeHeight||i.renderHeight)+(n.resizeHeight||n.renderHeight):0):i&&(i.isVisible=!s,i.foldWidth=0,n.isExpand=!s,n.isVisible=!0,n.foldWidth=s?(i.resizeWidth||i.renderWidth)+(n.resizeWidth||n.renderWidth):0),B("toggle-expand",{item:n,name:n.name,targetItem:i,targetName:i?i.name:"",expanded:n.isExpand},e),G())}},b=e=>{var t=D["itemList"],i=u.value;const s=e.currentTarget.parentElement.getAttribute("itemid");t=t[_xeUtils.default.findIndexOf(t,e=>e.id===s)];"dblclick"===i.trigger&&x(e),B("action-dblclick",{item:t,name:t?t.name:""},e)},C=e=>{var t=D["itemList"],i=u.value;const s=e.currentTarget.parentElement.getAttribute("itemid");t=t[_xeUtils.default.findIndexOf(t,e=>e.id===s)];"dblclick"!==i.trigger&&x(e),B("action-click",{item:t,name:t?t.name:""},e)},y=()=>{G()};t={dispatchEvent:B,recalculate:G,reset:()=>{var e=D["itemList"];return e.forEach(e=>{e.isExpand=!0,e.isVisible=!0,e.foldHeight=0,e.foldWidth=0,e.resizeHeight=0,e.resizeWidth=0}),(0,_vue.nextTick)()},loadItem:v,reloadItem:e=>r(e||[],!0)};Object.assign(W,t,{});const E=e=>{var t=g.value,i=u.value,s=R.value,{id:l,isExpand:n,showAction:r}=e;return(0,_vue.h)("div",{itemid:l,class:["vxe-split-pane-handle",s?"to--next":"to--prev"]},[(0,_vue.h)("div",{class:"vxe-split-pane-handle-bar",style:t,onMousedown:_}),r?(0,_vue.h)("span",{class:"vxe-split-pane-action-btn",onDblclick:b,onClick:C},[(0,_vue.h)("i",{class:(n?i.openIcon:i.closeIcon)||(e=>{var t=h["vertical"],{showAction:e,isExpand:i}=e,s=R.value,l="SPLIT_TOP_ACTION",n="SPLIT_BOTTOM_ACTION",r="SPLIT_LEFT_ACTION",o="SPLIT_RIGHT_ACTION";if(e){let e="";if(e=s?t?i?n:l:i?o:r:t?i?l:n:i?r:o)return(0,_ui.getIcon)()[e]}return""})(e)})]):(0,_ui.renderEmptyElement)(W)])};const z=(0,_vue.ref)(0);(0,_vue.watch)(()=>h.items?h.items.length:-1,()=>{z.value++}),(0,_vue.watch)(()=>h.items,()=>{z.value++}),(0,_vue.watch)(z,()=>{v(h.items||[])}),(0,_vue.watch)(()=>D.staticItems,e=>{h.items&&h.items.length&&(0,_log.errLog)("vxe.error.errConflicts",["<vxe-split-pane ...>","items"]),D.itemList=e,G()});let H;return(0,_vue.onMounted)(()=>{(0,_vue.nextTick)(()=>{G()});var e=c.value;e&&(H=_ui.globalResize.create(()=>{G()})).observe(e),_ui.globalEvents.on(W,"resize",y)}),(0,_vue.onUnmounted)(()=>{H&&H.disconnect(),_ui.globalEvents.off(W,"resize")}),(0,_vue.onActivated)(()=>{G()}),h.items&&v(h.items),(0,_vue.provide)("$xeSplit",W),W.renderVN=()=>{var{vertical:e,width:t,height:i}=h,{immediate:s,showTip:l}=d.value,n=o.default,r={};return i&&(r.height=(0,_dom.toCssUnit)(i)),t&&(r.width=(0,_dom.toCssUnit)(t)),(0,_vue.h)("div",{ref:c,class:["vxe-split",e?"is--vertical":"is--horizontal"],style:r},[(0,_vue.h)("div",{class:"vxe-split-slots"},n?n({}):[]),(()=>{const{border:g,padding:v,resize:_,vertical:x}=h,b=D["itemList"];const C=d.value["immediate"],y=m.value,z=p.value["autoItems"],H=R.value,U=[];return b.forEach((e,t)=>{var{id:i,name:s,slots:l,renderHeight:n,resizeHeight:r,foldHeight:o,renderWidth:a,resizeWidth:d,foldWidth:u,isVisible:h,isExpand:c}=e,l=l?l.default:null,f={};let m=h?u||d||a:0,p=h?o||r||n:0;1===z.length&&(x?e.height||(p=0):e.width||(m=0)),x?p&&(f.height=1===y.length?"100%":(0,_dom.toCssUnit)(p)):m&&(f.width=1===y.length?"100%":(0,_dom.toCssUnit)(m)),U.push((0,_vue.h)("div",{itemid:i,class:["vxe-split-pane",x?"is--vertical":"is--horizontal",C?"is-resize--immediate":"is-resize--lazy",{"is--resize":_,"is--padding":v,"is--border":g,"is--height":p,"is--width":m,"is--fill":h&&!p&&!m,"is--handle":0<t,"is--expand":c,"is--hidden":!h}],style:f},[t&&!H?E(e):(0,_ui.renderEmptyElement)(W),(0,_vue.h)("div",{itemid:i,class:"vxe-split-pane--wrapper"},[(0,_vue.h)("div",{class:"vxe-split-pane--inner"},l?I(l,{name:s,isVisible:h,isExpand:c}):[])]),H&&t<b.length-1?E(e):(0,_ui.renderEmptyElement)(W)]))}),(0,_vue.h)("div",{class:"vxe-split-wrapper"},U)})(),(0,_vue.h)("div",{ref:a,class:["vxe-split--resizable-split-tip",e?"is--vertical":"is--horizontal",s?"is-resize--immediate":"is-resize--lazy"]},l?[(0,_vue.h)("div",{class:"vxe-split--resizable-split-tip-number"},[(0,_vue.h)("div",{class:"vxe-split--resizable-split-number-prev"}),(0,_vue.h)("div",{class:"vxe-split--resizable-split-number-next"})])]:[])])},W},render(){return this.renderVN()}});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.vxe-split {
|
|
2
|
+
position: relative;
|
|
2
3
|
width: 100%;
|
|
3
4
|
}
|
|
4
5
|
.vxe-split.is--vertical > .vxe-split-wrapper {
|
|
@@ -26,6 +27,66 @@
|
|
|
26
27
|
user-select: none;
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
.vxe-split--resizable-split-tip {
|
|
31
|
+
display: none;
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 0;
|
|
34
|
+
left: 0;
|
|
35
|
+
z-index: 7;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
-webkit-user-select: none;
|
|
38
|
+
-moz-user-select: none;
|
|
39
|
+
user-select: none;
|
|
40
|
+
cursor: col-resize;
|
|
41
|
+
}
|
|
42
|
+
.vxe-split--resizable-split-tip.is-resize--lazy:before {
|
|
43
|
+
content: "";
|
|
44
|
+
display: block;
|
|
45
|
+
height: 100%;
|
|
46
|
+
background-color: var(--vxe-ui-split-resizable-drag-line-color);
|
|
47
|
+
}
|
|
48
|
+
.vxe-split--resizable-split-tip.is--horizontal {
|
|
49
|
+
width: 1px;
|
|
50
|
+
height: 100%;
|
|
51
|
+
}
|
|
52
|
+
.vxe-split--resizable-split-tip.is--horizontal .vxe-split--resizable-split-number-prev {
|
|
53
|
+
right: 0;
|
|
54
|
+
}
|
|
55
|
+
.vxe-split--resizable-split-tip.is--horizontal .vxe-split--resizable-split-number-next {
|
|
56
|
+
left: 1px;
|
|
57
|
+
}
|
|
58
|
+
.vxe-split--resizable-split-tip.is--vertical {
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 1px;
|
|
61
|
+
}
|
|
62
|
+
.vxe-split--resizable-split-tip.is--vertical .vxe-split--resizable-split-number-prev {
|
|
63
|
+
bottom: 0;
|
|
64
|
+
}
|
|
65
|
+
.vxe-split--resizable-split-tip.is--vertical .vxe-split--resizable-split-number-next {
|
|
66
|
+
top: 1px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.vxe-split--resizable-split-tip-number {
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: 0;
|
|
72
|
+
left: 0;
|
|
73
|
+
-webkit-user-select: none;
|
|
74
|
+
-moz-user-select: none;
|
|
75
|
+
user-select: none;
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.vxe-split--resizable-split-number-prev,
|
|
80
|
+
.vxe-split--resizable-split-number-next {
|
|
81
|
+
position: absolute;
|
|
82
|
+
padding: 0.25em 0.25em;
|
|
83
|
+
font-size: 12px;
|
|
84
|
+
border-radius: var(--vxe-ui-border-radius);
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
color: #ffffff;
|
|
87
|
+
background-color: var(--vxe-ui-split-resizable-drag-line-color);
|
|
88
|
+
}
|
|
89
|
+
|
|
29
90
|
.vxe-split-wrapper {
|
|
30
91
|
height: 100%;
|
|
31
92
|
display: flex;
|
|
@@ -64,6 +125,9 @@
|
|
|
64
125
|
.vxe-split-pane-handle-bar {
|
|
65
126
|
background-color: var(--vxe-ui-split-handle-bar-background-color);
|
|
66
127
|
}
|
|
128
|
+
.vxe-split-pane-handle-bar:hover {
|
|
129
|
+
background-color: var(--vxe-ui-split-handle-bar-hover-background-color);
|
|
130
|
+
}
|
|
67
131
|
|
|
68
132
|
.vxe-split-pane-action-btn {
|
|
69
133
|
position: absolute;
|
|
@@ -84,7 +148,8 @@
|
|
|
84
148
|
transition: transform 0.1s ease-in-out;
|
|
85
149
|
}
|
|
86
150
|
.vxe-split-pane-action-btn:hover {
|
|
87
|
-
|
|
151
|
+
color: #ffffff;
|
|
152
|
+
background-color: var(--vxe-ui-font-primary-color);
|
|
88
153
|
}
|
|
89
154
|
.vxe-split-pane-action-btn:active {
|
|
90
155
|
transform: translate(-50%, -50%) scale(0.9);
|
|
@@ -110,20 +175,20 @@
|
|
|
110
175
|
.vxe-split-pane.is--border > .vxe-split-pane--wrapper {
|
|
111
176
|
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
112
177
|
}
|
|
113
|
-
.vxe-split-pane.is--resize.is--expand.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
178
|
+
.vxe-split-pane.is--resize.is--expand.is-resize--immediate.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
114
179
|
cursor: w-resize;
|
|
115
180
|
}
|
|
116
|
-
.vxe-split-pane.is--resize.is--expand.is--vertical > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
181
|
+
.vxe-split-pane.is--resize.is--expand.is-resize--immediate.is--vertical > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
117
182
|
cursor: n-resize;
|
|
118
183
|
}
|
|
119
|
-
.vxe-split-pane.is--resize.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar {
|
|
120
|
-
background-color: var(--vxe-ui-
|
|
184
|
+
.vxe-split-pane.is--resize.is--expand.is-resize--immediate > .vxe-split-pane-handle > .vxe-split-pane-handle-bar:active {
|
|
185
|
+
background-color: var(--vxe-ui-font-primary-color);
|
|
121
186
|
}
|
|
122
|
-
.vxe-split-pane.is--resize.is--expand > .vxe-split-pane-handle
|
|
123
|
-
|
|
187
|
+
.vxe-split-pane.is--resize.is--expand.is-resize--lazy.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
188
|
+
cursor: col-resize;
|
|
124
189
|
}
|
|
125
|
-
.vxe-split-pane.is--resize.is--expand > .vxe-split-pane-handle
|
|
126
|
-
|
|
190
|
+
.vxe-split-pane.is--resize.is--expand.is-resize--lazy.is--vertical > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
191
|
+
cursor: row-resize;
|
|
127
192
|
}
|
|
128
193
|
.vxe-split-pane.is--horizontal {
|
|
129
194
|
flex-direction: row;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.vxe-split{width:100%}.vxe-split.is--vertical>.vxe-split-wrapper{flex-direction:column}.vxe-split.is--vertical>.vxe-split-wrapper>.vxe-split-pane{width:100%}.vxe-split.is--drag{-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split.is--drag>.vxe-split-wrapper>.vxe-split-pane>.vxe-split-pane--wrapper::after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split-wrapper{height:100%;display:flex;flex-direction:row;overflow:hidden}.vxe-split-slots{display:none}.vxe-split-pane-handle{position:relative;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split-pane--wrapper{position:relative;word-break:break-word;overflow:hidden;flex-grow:1}.vxe-split-pane--inner{height:100%;width:100%;overflow:auto}.vxe-split-pane--inner>.vxe-split{height:100%}.vxe-split-pane-handle-bar{background-color:var(--vxe-ui-split-handle-bar-background-color)}.vxe-split-pane-action-btn{position:absolute;display:flex;flex-direction:row;align-items:center;justify-content:center;font-size:.5em;border-radius:var(--vxe-ui-base-border-radius);top:50%;left:50%;transform:translate(-50%,-50%);z-index:2;color:var(--vxe-ui-layout-background-color);background-color:var(--vxe-ui-split-handle-button-background-color);border:1px solid var(--vxe-ui-input-border-color);cursor:pointer;transition:transform .1s ease-in-out}.vxe-split-pane-action-btn:hover{background-color:var(--vxe-ui-font-primary-
|
|
1
|
+
.vxe-split{position:relative;width:100%}.vxe-split.is--vertical>.vxe-split-wrapper{flex-direction:column}.vxe-split.is--vertical>.vxe-split-wrapper>.vxe-split-pane{width:100%}.vxe-split.is--drag{-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split.is--drag>.vxe-split-wrapper>.vxe-split-pane>.vxe-split-pane--wrapper::after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split--resizable-split-tip{display:none;position:absolute;top:0;left:0;z-index:7;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:col-resize}.vxe-split--resizable-split-tip.is-resize--lazy:before{content:"";display:block;height:100%;background-color:var(--vxe-ui-split-resizable-drag-line-color)}.vxe-split--resizable-split-tip.is--horizontal{width:1px;height:100%}.vxe-split--resizable-split-tip.is--horizontal .vxe-split--resizable-split-number-prev{right:0}.vxe-split--resizable-split-tip.is--horizontal .vxe-split--resizable-split-number-next{left:1px}.vxe-split--resizable-split-tip.is--vertical{width:100%;height:1px}.vxe-split--resizable-split-tip.is--vertical .vxe-split--resizable-split-number-prev{bottom:0}.vxe-split--resizable-split-tip.is--vertical .vxe-split--resizable-split-number-next{top:1px}.vxe-split--resizable-split-tip-number{position:absolute;top:0;left:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.vxe-split--resizable-split-number-next,.vxe-split--resizable-split-number-prev{position:absolute;padding:.25em .25em;font-size:12px;border-radius:var(--vxe-ui-border-radius);white-space:nowrap;color:#fff;background-color:var(--vxe-ui-split-resizable-drag-line-color)}.vxe-split-wrapper{height:100%;display:flex;flex-direction:row;overflow:hidden}.vxe-split-slots{display:none}.vxe-split-pane-handle{position:relative;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split-pane--wrapper{position:relative;word-break:break-word;overflow:hidden;flex-grow:1}.vxe-split-pane--inner{height:100%;width:100%;overflow:auto}.vxe-split-pane--inner>.vxe-split{height:100%}.vxe-split-pane-handle-bar{background-color:var(--vxe-ui-split-handle-bar-background-color)}.vxe-split-pane-handle-bar:hover{background-color:var(--vxe-ui-split-handle-bar-hover-background-color)}.vxe-split-pane-action-btn{position:absolute;display:flex;flex-direction:row;align-items:center;justify-content:center;font-size:.5em;border-radius:var(--vxe-ui-base-border-radius);top:50%;left:50%;transform:translate(-50%,-50%);z-index:2;color:var(--vxe-ui-layout-background-color);background-color:var(--vxe-ui-split-handle-button-background-color);border:1px solid var(--vxe-ui-input-border-color);cursor:pointer;transition:transform .1s ease-in-out}.vxe-split-pane-action-btn:hover{color:#fff;background-color:var(--vxe-ui-font-primary-color)}.vxe-split-pane-action-btn:active{transform:translate(-50%,-50%) scale(.9)}.vxe-split-pane{display:flex;position:relative;overflow:hidden}.vxe-split-pane.is--hidden{width:0}.vxe-split-pane.is--padding>.vxe-split-pane--wrapper{padding:var(--vxe-ui-layout-padding-default)}.vxe-split-pane.is--fill{flex-grow:1}.vxe-split-pane.is--height,.vxe-split-pane.is--width{flex-shrink:0}.vxe-split-pane.is--border>.vxe-split-pane--wrapper{border:1px solid var(--vxe-ui-base-popup-border-color)}.vxe-split-pane.is--resize.is--expand.is-resize--immediate.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-handle-bar{cursor:w-resize}.vxe-split-pane.is--resize.is--expand.is-resize--immediate.is--vertical>.vxe-split-pane-handle .vxe-split-pane-handle-bar{cursor:n-resize}.vxe-split-pane.is--resize.is--expand.is-resize--immediate>.vxe-split-pane-handle>.vxe-split-pane-handle-bar:active{background-color:var(--vxe-ui-font-primary-color)}.vxe-split-pane.is--resize.is--expand.is-resize--lazy.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-handle-bar{cursor:col-resize}.vxe-split-pane.is--resize.is--expand.is-resize--lazy.is--vertical>.vxe-split-pane-handle .vxe-split-pane-handle-bar{cursor:row-resize}.vxe-split-pane.is--horizontal{flex-direction:row}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-handle-bar{width:var(--vxe-ui-split-handle-bar-horizontal-width);height:100%}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-action-btn{width:var(--vxe-ui-split-handle-bar-horizontal-width);height:var(--vxe-ui-split-handle-bar-horizontal-height)}.vxe-split-pane.is--horizontal.is--border>.vxe-split-pane-handle{border-width:1px 0 1px 0}.vxe-split-pane.is--vertical{flex-direction:column}.vxe-split-pane.is--vertical>.vxe-split-pane-handle .vxe-split-pane-handle-bar{height:var(--vxe-ui-split-handle-bar-vertical-height);width:100%}.vxe-split-pane.is--vertical>.vxe-split-pane-handle .vxe-split-pane-action-btn{width:var(--vxe-ui-split-handle-bar-vertical-width);height:var(--vxe-ui-split-handle-bar-vertical-height)}.vxe-split-pane.is--vertical.is--border>.vxe-split-pane-handle{border-width:0 1px 0 1px}.vxe-modal--content>.vxe-split{height:100%}
|