vxe-pc-ui 4.5.5 → 4.5.7
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/README.md +1 -1
- package/es/components.js +3 -3
- package/es/icon/style.css +1 -1
- package/es/modal/src/modal.js +1 -2
- package/es/split/src/{split-item.js → split-pane.js} +14 -14
- package/es/split/src/split.js +10 -10
- package/es/split/src/util.js +4 -4
- package/es/split/style.css +35 -35
- package/es/split/style.min.css +1 -1
- package/es/split-pane/index.js +13 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +15 -15
- package/es/upload/style.css +1 -1
- package/es/upload/style.min.css +1 -1
- package/es/vxe-split/style.css +35 -35
- package/es/vxe-split/style.min.css +1 -1
- package/es/vxe-split-pane/index.js +3 -0
- package/es/vxe-upload/style.css +1 -1
- package/es/vxe-upload/style.min.css +1 -1
- package/lib/components.js +5 -5
- package/lib/components.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +63 -63
- package/lib/index.umd.min.js +1 -1
- package/lib/modal/src/modal.js +1 -2
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/split/src/{split-item.js → split-pane.js} +14 -14
- package/lib/split/src/{split-item.min.js → split-pane.min.js} +1 -1
- package/lib/split/src/split.js +10 -10
- package/lib/split/src/split.min.js +1 -1
- package/lib/split/src/util.js +4 -4
- package/lib/split/style/style.css +35 -35
- package/lib/split/style/style.min.css +1 -1
- package/lib/split-pane/index.js +20 -0
- package/lib/split-pane/index.min.js +1 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +2 -2
- 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/upload/src/upload.js +16 -16
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/upload/style/style.css +1 -1
- package/lib/upload/style/style.min.css +1 -1
- package/lib/vxe-split/style/style.css +35 -35
- package/lib/vxe-split/style/style.min.css +1 -1
- package/lib/{vxe-split-item → vxe-split-pane}/index.js +5 -5
- package/lib/vxe-split-pane/index.min.js +1 -0
- package/lib/vxe-upload/style/style.css +1 -1
- package/lib/vxe-upload/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/components.ts +3 -3
- package/packages/modal/src/modal.ts +1 -2
- package/packages/split/src/{split-item.ts → split-pane.ts} +25 -25
- package/packages/split/src/split.ts +17 -17
- package/packages/split/src/util.ts +4 -4
- package/packages/split-pane/index.ts +17 -0
- package/packages/ui/index.ts +1 -1
- package/packages/upload/src/upload.ts +15 -15
- package/styles/all.scss +1 -1
- package/styles/components/split.scss +30 -30
- package/styles/components/upload.scss +1 -1
- package/types/all.d.ts +3 -3
- package/types/components/split-pane.d.ts +96 -0
- package/types/components/split.d.ts +20 -20
- package/types/ui/global-config.d.ts +2 -2
- package/es/split-item/index.js +0 -12
- package/es/vxe-split-item/index.js +0 -3
- package/lib/split-item/index.js +0 -19
- package/lib/split-item/index.min.js +0 -1
- package/lib/vxe-split-item/index.min.js +0 -1
- package/packages/split-item/index.ts +0 -16
- package/types/components/split-item.d.ts +0 -96
- /package/es/icon/{iconfont.1743138565378.ttf → iconfont.1743248072130.ttf} +0 -0
- /package/es/icon/{iconfont.1743138565378.woff → iconfont.1743248072130.woff} +0 -0
- /package/es/icon/{iconfont.1743138565378.woff2 → iconfont.1743248072130.woff2} +0 -0
- /package/es/{iconfont.1743138565378.ttf → iconfont.1743248072130.ttf} +0 -0
- /package/es/{iconfont.1743138565378.woff → iconfont.1743248072130.woff} +0 -0
- /package/es/{iconfont.1743138565378.woff2 → iconfont.1743248072130.woff2} +0 -0
- /package/es/{split-item → split-pane}/style.css +0 -0
- /package/es/{split-item → split-pane}/style.min.css +0 -0
- /package/es/{vxe-split-item → vxe-split-pane}/style.css +0 -0
- /package/es/{vxe-split-item → vxe-split-pane}/style.min.css +0 -0
- /package/lib/icon/style/{iconfont.1743138565378.ttf → iconfont.1743248072130.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1743138565378.woff → iconfont.1743248072130.woff} +0 -0
- /package/lib/icon/style/{iconfont.1743138565378.woff2 → iconfont.1743248072130.woff2} +0 -0
- /package/lib/{iconfont.1743138565378.ttf → iconfont.1743248072130.ttf} +0 -0
- /package/lib/{iconfont.1743138565378.woff → iconfont.1743248072130.woff} +0 -0
- /package/lib/{iconfont.1743138565378.woff2 → iconfont.1743248072130.woff2} +0 -0
- /package/lib/{split-item → split-pane}/style/index.js +0 -0
- /package/lib/{split-item → split-pane}/style/style.css +0 -0
- /package/lib/{split-item → split-pane}/style/style.min.css +0 -0
- /package/lib/{vxe-split-item → vxe-split-pane}/style/index.js +0 -0
- /package/lib/{vxe-split-item → vxe-split-pane}/style/style.css +0 -0
- /package/lib/{vxe-split-item → vxe-split-pane}/style/style.min.css +0 -0
- /package/styles/components/{split-item.scss → split-pane.scss} +0 -0
package/lib/modal/src/modal.js
CHANGED
|
@@ -1238,7 +1238,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1238
1238
|
showMaximize,
|
|
1239
1239
|
draggable
|
|
1240
1240
|
} = props;
|
|
1241
|
-
const isMsg = computeIsMsg.value;
|
|
1242
1241
|
const headerSlot = slots.header || propSlots.header;
|
|
1243
1242
|
if (props.showHeader) {
|
|
1244
1243
|
const headerOns = {};
|
|
@@ -1251,7 +1250,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1251
1250
|
return (0, _vue.h)('div', Object.assign({
|
|
1252
1251
|
ref: refHeaderElem,
|
|
1253
1252
|
class: ['vxe-modal--header', {
|
|
1254
|
-
'is--ellipsis':
|
|
1253
|
+
'is--ellipsis': props.showTitleOverflow
|
|
1255
1254
|
}]
|
|
1256
1255
|
}, headerOns), headerSlot ? (0, _vn.getSlotVNs)(headerSlot({
|
|
1257
1256
|
$modal: $xeModal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.allActiveModals=void 0;var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_ui=require("../../ui"),_button=_interopRequireDefault(require("../../button/src/button")),_index=_interopRequireDefault(require("../../loading/index")),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const allActiveModals=exports.allActiveModals=[],msgQueue=[],notifyQueue=[],lockScrollAttrKey="data-vxe-lock-scroll",lockScrollCssWidthKey="--vxe-ui-modal-lock-scroll-view-width";var _default=exports.default=(0,_vue.defineComponent)({name:"VxeModal",props:{modelValue:Boolean,id:String,type:{type:String,default:"modal"},loading:{type:Boolean,default:null},status:String,iconStatus:String,className:String,top:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.top},position:[String,Object],title:String,duration:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.duration},content:[Number,String],showCancelButton:{type:Boolean,default:null},cancelButtonText:{type:String,default:()=>(0,_ui.getConfig)().modal.cancelButtonText},showConfirmButton:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showConfirmButton},confirmButtonText:{type:String,default:()=>(0,_ui.getConfig)().modal.confirmButtonText},lockView:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.lockView},lockScroll:Boolean,mask:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.mask},maskClosable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.maskClosable},escClosable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.escClosable},cancelClosable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.cancelClosable},confirmClosable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.confirmClosable},resize:Boolean,showHeader:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showHeader},showFooter:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showFooter},showZoom:Boolean,zoomConfig:Object,showMaximize:{type:Boolean,default:()=>(0,_utils.handleBooleanDefaultValue)((0,_ui.getConfig)().modal.showMaximize)},showMinimize:{type:Boolean,default:()=>(0,_utils.handleBooleanDefaultValue)((0,_ui.getConfig)().modal.showMinimize)},showClose:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showClose},dblclickZoom:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.dblclickZoom},width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.minWidth},minHeight:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.minHeight},zIndex:Number,marginSize:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.marginSize},fullscreen:Boolean,draggable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.draggable},remember:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.remember},destroyOnClose:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.destroyOnClose},showTitleOverflow:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showTitleOverflow},transfer:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.transfer},storage:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.storage},storageKey:{type:String,default:()=>(0,_ui.getConfig)().modal.storageKey},padding:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.padding},size:{type:String,default:()=>(0,_ui.getConfig)().modal.size||(0,_ui.getConfig)().size},beforeHideMethod:Function,slots:Object,message:[Number,String],animat:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.animat}},emits:["update:modelValue","show","hide","before-hide","close","confirm","cancel","zoom","resize","move"],setup(w,e){const{slots:N,emit:s}=e,a=_xeUtils.default.uniqueId(),o=(0,_vue.inject)("$xeModal",null),L=(0,_vue.inject)("$xeDrawer",null),A=(0,_vue.inject)("$xeTable",null),$=(0,_vue.inject)("$xeForm",null),k=(0,_ui.useSize)(w)["computeSize"],B=(0,_vue.reactive)({initialized:!1,visible:!1,contentVisible:!1,modalTop:0,modalZindex:0,prevZoomStatus:"",zoomStatus:"",revertLocat:null,prevLocat:null,firstOpen:!0}),t={msgTimeout:void 0},M=(0,_vue.ref)(),O=(0,_vue.ref)(),T=(0,_vue.ref)(),n=(0,_vue.ref)(),u=(0,_vue.ref)(),E={refElem:M},Z=(0,_vue.computed)(()=>{var e=w["transfer"];if(null===e){var t=(0,_ui.getConfig)().modal.transfer;if(_xeUtils.default.isBoolean(t))return t;if(A||o||L||$)return!0}return e}),V=(0,_vue.computed)(()=>"message"===w.type||"notification"===w.type),U=(0,_vue.computed)(()=>"minimize"===B.zoomStatus),H=(0,_vue.computed)(()=>"maximize"===B.zoomStatus),l=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().modal.zoomConfig,w.zoomConfig)),j={computeSize:k,computeZoomOpts:l},D={xID:a,props:w,context:e,reactData:B,internalData:t,getRefMaps:()=>E,getComputeMaps:()=>j};const z=()=>{return O.value},d=()=>{var{width:e,height:t}=w,o=z();return o&&(o.style.width=e?(0,_dom.toCssUnit)(e):"",o.style.height=t?(0,_dom.toCssUnit)(t):""),(0,_vue.nextTick)()},r=()=>{var e=w["zIndex"],t=B["modalZindex"];e?B.modalZindex=e:t<(0,_utils.getLastZIndex)()&&(B.modalZindex=(0,_utils.nextZIndex)())},c=()=>(0,_vue.nextTick)().then(()=>{var o=w["position"],i=_xeUtils.default.toNumber(w.marginSize),l=z();if(l){var a=document.documentElement.clientWidth||document.body.clientWidth,s=document.documentElement.clientHeight||document.body.clientHeight,n="center"===o,{top:o,left:u}=_xeUtils.default.isString(o)?{top:o,left:o}:Object.assign({},o),r=n||"center"===o;let e="",t="";t=u&&!(n||"center"===u)?isNaN(u)?u:u+"px":Math.max(i,a/2-l.offsetWidth/2)+"px",e=o&&!r?isNaN(o)?o:o+"px":Math.max(i,s/2-l.offsetHeight/2)+"px",l.style.top=e,l.style.left=t}}),v=()=>{(0,_vue.nextTick)(()=>{var e=w["type"],e="notification"===e?notifyQueue:msgQueue;let o=0;e.forEach(e=>{var t=e.getBox();t&&(o+=_xeUtils.default.toNumber(e.props.top),e.reactData.modalTop=o,o+=t.clientHeight)})})},m=()=>{var e=w["type"],e="notification"===e?notifyQueue:msgQueue;-1<e.indexOf(D)&&_xeUtils.default.remove(e,e=>e===D),v()},i=e=>{const t=w["remember"];var o=B["visible"];const i=V.value;var l=w.beforeHideMethod||(0,_ui.getConfig)().modal.beforeHideMethod;const a={type:e};return o&&Promise.resolve(l?l(a):null).then(e=>{_xeUtils.default.isError(e)||(i&&m(),B.contentVisible=!1,t||y(),_xeUtils.default.remove(allActiveModals,e=>e===D),S("before-hide",a,null),setTimeout(()=>{B.visible=!1,s("update:modelValue",!1),S("hide",a,null)},200),h())}).catch(e=>e),(0,_vue.nextTick)()},W=e=>{var t="close";S(t,{type:t},e),i(t)},K=e=>{var t=w["confirmClosable"],o="confirm";S(o,{type:o},e),t&&i(o)},q=e=>{var t=w["cancelClosable"],o="cancel";S(o,{type:o},e),t&&i(o)},f=e=>{var t=(0,_ui.getConfig)().version,e=_xeUtils.default.toStringJSON(localStorage.getItem(e)||"");return e&&e._v===t?e:{_v:t}},C=()=>{var{id:e,storage:t,storageKey:o}=w,{zoomStatus:i,revertLocat:l}=B;i||e&&t&&(i=z())&&((t=f(o))[e]=[i.style.left,i.style.top,i.style.width,i.style.height].concat(l?[l.left,l.top,l.width,l.height]:[]).map(e=>e?_xeUtils.default.toNumber(e):"").join(","),localStorage.setItem(o,_xeUtils.default.toJSONString(t)))},g=()=>{const{minimizeLayout:e,minimizeMaxSize:t,minimizeHorizontalOffset:s,minimizeVerticalOffset:n,minimizeOffsetMethod:u}=l.value,r="horizontal"===e,m=B.zoomStatus,o=[],i=[],d=(allActiveModals.forEach(e=>{e.xID!==D.xID&&"modal"===e.props.type&&"minimize"===e.reactData.zoomStatus&&("horizontal"===e.getComputeMaps().computeZoomOpts.value.minimizeLayout?o:i).push(e)}),r?o:i);return t&&d.length>=t?(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({status:"error",content:(0,_ui.getI18n)("vxe.modal.miniMaxSize",[t])}),Promise.resolve({status:!1})):(B.prevZoomStatus=m,B.zoomStatus="minimize",(0,_vue.nextTick)().then(()=>{var e=z();if(!e)return{status:!1};var t=T.value;if(!t)return{status:!1};var o=(0,_dom.getDomNode)()["visibleHeight"],i=(m||(B.revertLocat={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth+(e.style.width?0:1),height:e.offsetHeight+(e.style.height?0:1)}),_xeUtils.default[r?"max":"min"](d,e=>{e=e.getBox();return e?_xeUtils.default.toNumber(e.style[r?"left":"top"]):0}));let l=o-t.offsetHeight-16,a=16;if(i){o=i.getBox();if(o){i=_xeUtils.default.toNumber(o.style.left),o=_xeUtils.default.toNumber(o.style.top);let e={};e=r?Object.assign({},s):Object.assign({},n),a=i+_xeUtils.default.toNumber(e.left),l=o+_xeUtils.default.toNumber(e.top),u&&(e=u({$modal:D,left:a,top:l}),a=_xeUtils.default.toNumber(e.left),l=_xeUtils.default.toNumber(e.top))}}return Object.assign(e.style,{top:l+"px",left:a+"px",width:"200px",height:t.offsetHeight+"px"}),C(),{status:!0}}))},p=()=>{const l=B.zoomStatus;return B.prevZoomStatus=l,B.zoomStatus="maximize",(0,_vue.nextTick)().then(()=>{var e,t,o,i=z();return i&&(l||(e=_xeUtils.default.toNumber(w.marginSize),t=document.documentElement.clientWidth||document.body.clientWidth,o=document.documentElement.clientHeight||document.body.clientHeight,B.revertLocat={top:Math.max(e,o/2-i.offsetHeight/2),left:Math.max(e,t/2-i.offsetWidth/2),width:i.offsetWidth+(i.style.width?0:1),height:i.offsetHeight+(i.style.height?0:1)}),Object.assign(i.style,{top:"0",left:"0",width:"100%",height:"100%"})),C(),{status:!0}})},_=()=>{var e=w["duration"];-1!==e&&(t.msgTimeout=setTimeout(()=>i("close"),_xeUtils.default.toNumber(e)))},h=()=>{var e=document.documentElement,t=e.getAttribute(lockScrollAttrKey);t&&((t=t.split(",").filter(e=>e!==a)).length?e.setAttribute(lockScrollAttrKey,t.join(",")):(e.removeAttribute(lockScrollAttrKey),e.style.removeProperty(lockScrollCssWidthKey)))},x=()=>{const{remember:m,showFooter:o}=w;var e,{initialized:t,visible:i}=B,l=V.value;return t||(B.initialized=!0),i||(t=w.lockScroll,i=V.value,t&&!i&&(t=document.documentElement,i=document.body.clientWidth,(e=(e=t.getAttribute(lockScrollAttrKey))?e.split(","):[]).includes(a)||(e.push(a),t.setAttribute(lockScrollAttrKey,e.join(","))),t.style.setProperty(lockScrollCssWidthKey,i+"px")),B.visible=!0,B.contentVisible=!1,r(),allActiveModals.push(D),setTimeout(()=>{B.contentVisible=!0,(0,_vue.nextTick)(()=>{o&&(e=n.value,t=u.value,e=e||t)&&e.focus();var e,t={type:""};s("update:modelValue",!0),S("show",t,null)})},10),l?(-1===(e="notification"===(e=w.type)?notifyQueue:msgQueue).indexOf(D)&&e.push(D),v(),_()):(0,_vue.nextTick)(()=>{var e,t,o,i,l,a,s,n,u=w["fullscreen"],r=B["firstOpen"];r?(B.firstOpen=!1,(()=>{var{id:e,storage:t,storageKey:o}=w;return!!(e&&t&&f(o)[e])})()?({id:r,storage:s,storageKey:n}=w,r&&s&&(s=f(n)[r])&&(n=z(),[r,s,e,t,o,i,l,a]=s.split(","),n&&(r&&(n.style.left=r+"px"),s&&(n.style.top=s+"px"),e&&(n.style.width=e+"px"),t)&&(n.style.height=t+"px"),o)&&i&&(B.revertLocat={left:o,top:i,width:l,height:a})):u?(0,_vue.nextTick)(()=>p()):(d(),c().then(()=>{setTimeout(()=>c(),20)}))):m||(d(),c().then(()=>{setTimeout(()=>c(),20)}))})),(0,_vue.nextTick)()},P=e=>{var t=M.value;w.maskClosable&&e.target===t&&i("mask")},Y=()=>{var e=t["msgTimeout"];e&&V.value&&(clearTimeout(e),t.msgTimeout=void 0)},F=()=>{var e=t["msgTimeout"];e||V.value&&_()},X=e=>{if(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE)){const t=_xeUtils.default.max(allActiveModals,e=>e.reactData.modalZindex);t&&setTimeout(()=>{t===D&&t.props.escClosable&&(S("close",{type:"exit"},e),i("exit"))},10)}};const y=()=>(B.prevZoomStatus=B.zoomStatus,(B.zoomStatus="",_vue.nextTick)().then(()=>{var e,t=B["revertLocat"];return t?(e=z(),B.revertLocat=null,e&&Object.assign(e.style,{top:t.top+"px",left:t.left+"px",width:t.width+"px",height:t.height+"px"}),C(),(0,_vue.nextTick)().then(()=>({status:!0}))):{status:!1}})),b=t=>{const o=B["zoomStatus"];return new Promise(e=>{if(t)return"maximize"===t?void e(p()):"minimize"===t?void e(g()):void e(y());e((o?y:p)())}).then(()=>B.zoomStatus||"revert")},Q=t=>{var{zoomStatus:e,prevZoomStatus:o}=B;return b("minimize"===e?o||"revert":"minimize").then(e=>{e={type:e};S("zoom",e,t)})},I=t=>b().then(e=>{e={type:e};S("zoom",e,t)});const R=()=>{const t=B["modalZindex"];allActiveModals.some(e=>e.reactData.visible&&e.reactData.modalZindex>t)&&r()},J=e=>{const t=w["storage"];var o=B["zoomStatus"];const n=_xeUtils.default.toNumber(w.marginSize),u=z();if(u&&"maximize"!==o&&0===e.button&&!(0,_dom.getEventTargetNode)(e,u,"trigger--btn").flag){e.preventDefault();const i=document.onmousemove,l=document.onmouseup,r=e.clientX-u.offsetLeft,m=e.clientY-u.offsetTop,{visibleHeight:d,visibleWidth:c}=(0,_dom.getDomNode)();document.onmousemove=e=>{e.preventDefault();var t=u.offsetWidth,o=u.offsetHeight,i=n,t=c-t-n-1,l=n,o=d-o-n-1;let a=e.clientX-r,s=e.clientY-m;(a=a>t?t:a)<i&&(a=i),(s=s>o?o:s)<l&&(s=l),u.style.left=a+"px",u.style.top=s+"px",u.className=u.className.replace(/\s?is--drag/,"")+" is--drag",S("move",{type:"move"},e)},document.onmouseup=()=>{document.onmousemove=i,document.onmouseup=l,t&&(0,_vue.nextTick)(()=>{C()}),setTimeout(()=>{u.className=u.className.replace(/\s?is--drag/,"")},50)}}},G=e=>{e.preventDefault();const a=w["storage"],{visibleHeight:s,visibleWidth:n}=(0,_dom.getDomNode)(),u=_xeUtils.default.toNumber(w.marginSize);const r=e.target.getAttribute("type"),m=_xeUtils.default.toNumber(w.minWidth),d=_xeUtils.default.toNumber(w.minHeight),c=n,v=s,f=z(),g=f.clientWidth,p=f.clientHeight,_=e.clientX,h=e.clientY,x=f.offsetTop,y=f.offsetLeft,b={type:"resize"};document.onmousemove=e=>{e.preventDefault();let t,o,i,l;switch(r){case"wl":t=_-e.clientX,i=t+g,y-t>u&&i>m&&(f.style.width=`${i<c?i:c}px`,f.style.left=y-t+"px");break;case"swst":t=_-e.clientX,o=h-e.clientY,i=t+g,l=o+p,y-t>u&&i>m&&(f.style.width=`${i<c?i:c}px`,f.style.left=y-t+"px"),x-o>u&&l>d&&(f.style.height=`${l<v?l:v}px`,f.style.top=x-o+"px");break;case"swlb":t=_-e.clientX,o=e.clientY-h,i=t+g,l=o+p,y-t>u&&i>m&&(f.style.width=`${i<c?i:c}px`,f.style.left=y-t+"px"),x+l+u<s&&l>d&&(f.style.height=`${l<v?l:v}px`);break;case"st":o=h-e.clientY,l=p+o,x-o>u&&l>d&&(f.style.height=`${l<v?l:v}px`,f.style.top=x-o+"px");break;case"wr":t=e.clientX-_,i=t+g,y+i+u<n&&i>m&&(f.style.width=`${i<c?i:c}px`);break;case"sest":t=e.clientX-_,o=h-e.clientY,i=t+g,l=o+p,y+i+u<n&&i>m&&(f.style.width=`${i<c?i:c}px`),x-o>u&&l>d&&(f.style.height=`${l<v?l:v}px`,f.style.top=x-o+"px");break;case"selb":t=e.clientX-_,o=e.clientY-h,i=t+g,l=o+p,y+i+u<n&&i>m&&(f.style.width=`${i<c?i:c}px`),x+l+u<s&&l>d&&(f.style.height=`${l<v?l:v}px`);break;case"sb":o=e.clientY-h,l=o+p,x+l+u<s&&l>d&&(f.style.height=`${l<v?l:v}px`)}f.className=f.className.replace(/\s?is--drag/,"")+" is--drag",a&&C(),S("resize",b,e)},document.onmouseup=()=>{B.revertLocat=null,document.onmousemove=null,document.onmouseup=null,setTimeout(()=>{f.className=f.className.replace(/\s?is--drag/,"")},50)}},S=(e,t,o)=>{s(e,(0,_ui.createEvent)(o,{$modal:D},t))},ee=(e={dispatchEvent:S,open:x,close(){return i("close")},getBox:z,getPosition:()=>{if(!V.value){var e=z();if(e)return{top:e.offsetTop,left:e.offsetLeft}}return null},setPosition:(e,t)=>{var o;return V.value||(o=z())&&(_xeUtils.default.isNumber(e)&&(o.style.top=e+"px"),_xeUtils.default.isNumber(t))&&(o.style.left=t+"px"),(0,_vue.nextTick)()},isMinimized:()=>"minimize"===B.zoomStatus,isMaximized:()=>"maximize"===B.zoomStatus,zoom(){return b()},minimize(){return B.visible?g():Promise.resolve({status:!1})},maximize(){return B.visible?p():Promise.resolve({status:!1})},revert(){return B.visible?y():Promise.resolve({status:!1})}},Object.assign(D,e),()=>{var{slots:e={},showClose:t,showZoom:o,showMaximize:i,showMinimize:l,title:a}=w,s=B["zoomStatus"],n=N.title||e.title,e=N.corner||e.corner,u=U.value,r=H.value;return[(0,_vue.h)("div",{class:"vxe-modal--header-title"},n?(0,_vn.getSlotVNs)(n({$modal:D,minimized:u,maximized:r})):a?(0,_utils.getFuncText)(a):(0,_ui.getI18n)("vxe.alert.title")),(0,_vue.h)("div",{class:"vxe-modal--header-right"},[e&&!u?(0,_vue.h)("div",{class:"vxe-modal--corner-wrapper"},(0,_vn.getSlotVNs)(e({$modal:D}))):(0,_vue.createCommentVNode)(),(_xeUtils.default.isBoolean(l)?l:o)?(0,_vue.h)("div",{class:["vxe-modal--zoom-btn","trigger--btn"],title:(0,_ui.getI18n)("vxe.modal.zoom"+("minimize"===s?"Out":"Min")),onClick:Q},[(0,_vue.h)("i",{class:"minimize"===s?(0,_ui.getIcon)().MODAL_ZOOM_REVERT:(0,_ui.getIcon)().MODAL_ZOOM_MIN})]):(0,_vue.createCommentVNode)(),(_xeUtils.default.isBoolean(i)?i:o)&&"minimize"!==s?(0,_vue.h)("div",{class:["vxe-modal--zoom-btn","trigger--btn"],title:(0,_ui.getI18n)("vxe.modal.zoom"+("maximize"===s?"Out":"In")),onClick:I},[(0,_vue.h)("i",{class:"maximize"===s?(0,_ui.getIcon)().MODAL_ZOOM_OUT:(0,_ui.getIcon)().MODAL_ZOOM_IN})]):(0,_vue.createCommentVNode)(),t?(0,_vue.h)("div",{class:["vxe-modal--close-btn","trigger--btn"],title:(0,_ui.getI18n)("vxe.modal.close"),onClick:W},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().MODAL_CLOSE})]):(0,_vue.createCommentVNode)()])]}),te=()=>{var{slots:e={},showCancelButton:t,showConfirmButton:o,type:i,loading:l}=w,a=N.leftfoot||e.leftfoot,e=N.rightfoot||e.rightfoot,s=[];return(_xeUtils.default.isBoolean(t)?t:"confirm"===i)&&s.push((0,_vue.h)(_button.default,{key:1,ref:u,content:w.cancelButtonText||(0,_ui.getI18n)("vxe.button.cancel"),onClick:q})),(_xeUtils.default.isBoolean(o)?o:"confirm"===i||"alert"===i)&&s.push((0,_vue.h)(_button.default,{key:2,ref:n,loading:l,status:"primary",content:w.confirmButtonText||(0,_ui.getI18n)("vxe.button.confirm"),onClick:K})),(0,_vue.h)("div",{class:"vxe-modal--footer-wrapper"},[(0,_vue.h)("div",{class:"vxe-modal--footer-left"},a?(0,_vn.getSlotVNs)(a({$modal:D})):[]),(0,_vue.h)("div",{class:"vxe-modal--footer-right"},e?(0,_vn.getSlotVNs)(e({$modal:D})):s)])};return D.renderVN=()=>{var{slots:e={},className:t,type:o,animat:i,draggable:l,iconStatus:a,position:s,loading:n,destroyOnClose:u,status:r,lockScroll:m,padding:d,lockView:c,mask:v,resize:f}=w,{initialized:g,modalTop:p,contentVisible:_,visible:h,zoomStatus:x}=B,e=N.aside||e.aside,y=k.value,b=V.value,z=U.value,C=Z.value,S={};return b&&(S.onMouseover=Y,S.onMouseout=F),(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!C||!g},[(0,_vue.h)("div",Object.assign({ref:M,class:["vxe-modal--wrapper","type--"+o,"zoom--"+(x||"revert"),t||"",s?"pos--"+s:"",{["size--"+y]:y,["status--"+r]:r,"is--padding":d,"is--animat":i,"lock--scroll":m,"lock--view":c,"is--draggable":l,"is--resize":f,"is--mask":v,"is--visible":_,"is--active":h,"is--loading":n}],style:{zIndex:B.modalZindex,top:p?p+"px":null},onClick:P},S),[(0,_vue.h)("div",{ref:O,class:"vxe-modal--box",onMousedown:R},[!b&&!e||z?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-modal--aside"},e?(0,_vn.getSlotVNs)(e({$modal:D})):[r||a?(0,_vue.h)("div",{class:"vxe-modal--status-wrapper"},[(0,_vue.h)("i",{class:["vxe-modal--status-icon",a||(0,_ui.getIcon)()[("MODAL_"+r).toLocaleUpperCase()]]})]):(0,_vue.createCommentVNode)()]),(0,_vue.h)("div",{class:"vxe-modal--container"},!B.initialized||u&&!B.visible?[]:[(()=>{var e,{slots:t={},showZoom:o,showMaximize:i,draggable:l}=w,a=V.value,t=N.header||t.header;return w.showHeader?(e={},l&&(e.onMousedown=J),(_xeUtils.default.isBoolean(i)?i:o)&&w.dblclickZoom&&"modal"===w.type&&(e.onDblclick=I),(0,_vue.h)("div",Object.assign({ref:T,class:["vxe-modal--header",{"is--ellipsis":!a&&w.showTitleOverflow}]},e),t?(0,_vn.getSlotVNs)(t({$modal:D})):ee())):(0,_vue.createCommentVNode)()})(),(()=>{var{slots:e={},status:t,message:o,iconStatus:i}=w,o=w.content||o,l=V.value,a=N.default||e.default,s=N.left||e.left,e=N.right||e.right,n=[];return l||!t&&!i||n.push((0,_vue.h)("div",{class:"vxe-modal--status-wrapper"},[(0,_vue.h)("i",{class:["vxe-modal--status-icon",i||(0,_ui.getIcon)()[("MODAL_"+t).toLocaleUpperCase()]]})])),n.push((0,_vue.h)("div",{class:"vxe-modal--content"},a?(0,_vn.getSlotVNs)(a({$modal:D})):(0,_utils.getFuncText)(o))),(0,_vue.h)("div",{class:"vxe-modal--body"},[s?(0,_vue.h)("div",{class:"vxe-modal--body-left"},(0,_vn.getSlotVNs)(s({$modal:D}))):(0,_vue.createCommentVNode)(),(0,_vue.h)("div",{class:"vxe-modal--body-default"},n),e?(0,_vue.h)("div",{class:"vxe-modal--body-right"},(0,_vn.getSlotVNs)(e({$modal:D}))):(0,_vue.createCommentVNode)(),l?(0,_vue.createCommentVNode)():(0,_vue.h)(_index.default,{class:"vxe-modal--loading",modelValue:w.loading})])})(),(()=>{var{slots:e={}}=w,e=N.footer||e.footer;return w.showFooter?(0,_vue.h)("div",{class:"vxe-modal--footer"},e?(0,_vn.getSlotVNs)(e({$modal:D})):[te()]):(0,_vue.createCommentVNode)()})(),!b&&f?(0,_vue.h)("span",{class:"vxe-modal--resize"},["wl","wr","swst","sest","st","swlb","selb","sb"].map(e=>(0,_vue.h)("span",{class:e+"-resize",type:e,onMousedown:G}))):(0,_vue.createCommentVNode)()])])])])},(0,_vue.watch)(()=>w.width,d),(0,_vue.watch)(()=>w.height,d),(0,_vue.watch)(()=>w.modelValue,e=>{e?x():i("model")}),(0,_vue.onMounted)(()=>{"development"===process.env.NODE_ENV&&"modal"===w.type&&w.showFooter&&!(w.showConfirmButton||w.showCancelButton||N.footer)&&(0,_log.warnLog)("vxe.modal.footPropErr"),(0,_vue.nextTick)(()=>{w.storage&&!w.id&&(0,_log.errLog)("vxe.error.reqProp",["modal.id"]),w.modelValue&&x(),d()}),w.escClosable&&_ui.globalEvents.on(D,"keydown",X)}),(0,_vue.onUnmounted)(()=>{_ui.globalEvents.off(D,"keydown"),m(),h()}),(0,_vue.provide)("$xeModal",D),D},render(){return this.renderVN()}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.allActiveModals=void 0;var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_ui=require("../../ui"),_button=_interopRequireDefault(require("../../button/src/button")),_index=_interopRequireDefault(require("../../loading/index")),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const allActiveModals=exports.allActiveModals=[],msgQueue=[],notifyQueue=[],lockScrollAttrKey="data-vxe-lock-scroll",lockScrollCssWidthKey="--vxe-ui-modal-lock-scroll-view-width";var _default=exports.default=(0,_vue.defineComponent)({name:"VxeModal",props:{modelValue:Boolean,id:String,type:{type:String,default:"modal"},loading:{type:Boolean,default:null},status:String,iconStatus:String,className:String,top:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.top},position:[String,Object],title:String,duration:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.duration},content:[Number,String],showCancelButton:{type:Boolean,default:null},cancelButtonText:{type:String,default:()=>(0,_ui.getConfig)().modal.cancelButtonText},showConfirmButton:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showConfirmButton},confirmButtonText:{type:String,default:()=>(0,_ui.getConfig)().modal.confirmButtonText},lockView:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.lockView},lockScroll:Boolean,mask:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.mask},maskClosable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.maskClosable},escClosable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.escClosable},cancelClosable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.cancelClosable},confirmClosable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.confirmClosable},resize:Boolean,showHeader:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showHeader},showFooter:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showFooter},showZoom:Boolean,zoomConfig:Object,showMaximize:{type:Boolean,default:()=>(0,_utils.handleBooleanDefaultValue)((0,_ui.getConfig)().modal.showMaximize)},showMinimize:{type:Boolean,default:()=>(0,_utils.handleBooleanDefaultValue)((0,_ui.getConfig)().modal.showMinimize)},showClose:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showClose},dblclickZoom:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.dblclickZoom},width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.minWidth},minHeight:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.minHeight},zIndex:Number,marginSize:{type:[Number,String],default:()=>(0,_ui.getConfig)().modal.marginSize},fullscreen:Boolean,draggable:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.draggable},remember:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.remember},destroyOnClose:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.destroyOnClose},showTitleOverflow:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.showTitleOverflow},transfer:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.transfer},storage:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.storage},storageKey:{type:String,default:()=>(0,_ui.getConfig)().modal.storageKey},padding:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.padding},size:{type:String,default:()=>(0,_ui.getConfig)().modal.size||(0,_ui.getConfig)().size},beforeHideMethod:Function,slots:Object,message:[Number,String],animat:{type:Boolean,default:()=>(0,_ui.getConfig)().modal.animat}},emits:["update:modelValue","show","hide","before-hide","close","confirm","cancel","zoom","resize","move"],setup(w,e){const{slots:N,emit:s}=e,a=_xeUtils.default.uniqueId(),o=(0,_vue.inject)("$xeModal",null),L=(0,_vue.inject)("$xeDrawer",null),A=(0,_vue.inject)("$xeTable",null),$=(0,_vue.inject)("$xeForm",null),k=(0,_ui.useSize)(w)["computeSize"],B=(0,_vue.reactive)({initialized:!1,visible:!1,contentVisible:!1,modalTop:0,modalZindex:0,prevZoomStatus:"",zoomStatus:"",revertLocat:null,prevLocat:null,firstOpen:!0}),t={msgTimeout:void 0},M=(0,_vue.ref)(),O=(0,_vue.ref)(),T=(0,_vue.ref)(),n=(0,_vue.ref)(),u=(0,_vue.ref)(),E={refElem:M},Z=(0,_vue.computed)(()=>{var e=w["transfer"];if(null===e){var t=(0,_ui.getConfig)().modal.transfer;if(_xeUtils.default.isBoolean(t))return t;if(A||o||L||$)return!0}return e}),V=(0,_vue.computed)(()=>"message"===w.type||"notification"===w.type),U=(0,_vue.computed)(()=>"minimize"===B.zoomStatus),H=(0,_vue.computed)(()=>"maximize"===B.zoomStatus),l=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().modal.zoomConfig,w.zoomConfig)),j={computeSize:k,computeZoomOpts:l},D={xID:a,props:w,context:e,reactData:B,internalData:t,getRefMaps:()=>E,getComputeMaps:()=>j};const z=()=>{return O.value},d=()=>{var{width:e,height:t}=w,o=z();return o&&(o.style.width=e?(0,_dom.toCssUnit)(e):"",o.style.height=t?(0,_dom.toCssUnit)(t):""),(0,_vue.nextTick)()},r=()=>{var e=w["zIndex"],t=B["modalZindex"];e?B.modalZindex=e:t<(0,_utils.getLastZIndex)()&&(B.modalZindex=(0,_utils.nextZIndex)())},c=()=>(0,_vue.nextTick)().then(()=>{var o=w["position"],i=_xeUtils.default.toNumber(w.marginSize),l=z();if(l){var a=document.documentElement.clientWidth||document.body.clientWidth,s=document.documentElement.clientHeight||document.body.clientHeight,n="center"===o,{top:o,left:u}=_xeUtils.default.isString(o)?{top:o,left:o}:Object.assign({},o),r=n||"center"===o;let e="",t="";t=u&&!(n||"center"===u)?isNaN(u)?u:u+"px":Math.max(i,a/2-l.offsetWidth/2)+"px",e=o&&!r?isNaN(o)?o:o+"px":Math.max(i,s/2-l.offsetHeight/2)+"px",l.style.top=e,l.style.left=t}}),v=()=>{(0,_vue.nextTick)(()=>{var e=w["type"],e="notification"===e?notifyQueue:msgQueue;let o=0;e.forEach(e=>{var t=e.getBox();t&&(o+=_xeUtils.default.toNumber(e.props.top),e.reactData.modalTop=o,o+=t.clientHeight)})})},m=()=>{var e=w["type"],e="notification"===e?notifyQueue:msgQueue;-1<e.indexOf(D)&&_xeUtils.default.remove(e,e=>e===D),v()},i=e=>{const t=w["remember"];var o=B["visible"];const i=V.value;var l=w.beforeHideMethod||(0,_ui.getConfig)().modal.beforeHideMethod;const a={type:e};return o&&Promise.resolve(l?l(a):null).then(e=>{_xeUtils.default.isError(e)||(i&&m(),B.contentVisible=!1,t||y(),_xeUtils.default.remove(allActiveModals,e=>e===D),S("before-hide",a,null),setTimeout(()=>{B.visible=!1,s("update:modelValue",!1),S("hide",a,null)},200),h())}).catch(e=>e),(0,_vue.nextTick)()},W=e=>{var t="close";S(t,{type:t},e),i(t)},K=e=>{var t=w["confirmClosable"],o="confirm";S(o,{type:o},e),t&&i(o)},q=e=>{var t=w["cancelClosable"],o="cancel";S(o,{type:o},e),t&&i(o)},f=e=>{var t=(0,_ui.getConfig)().version,e=_xeUtils.default.toStringJSON(localStorage.getItem(e)||"");return e&&e._v===t?e:{_v:t}},C=()=>{var{id:e,storage:t,storageKey:o}=w,{zoomStatus:i,revertLocat:l}=B;i||e&&t&&(i=z())&&((t=f(o))[e]=[i.style.left,i.style.top,i.style.width,i.style.height].concat(l?[l.left,l.top,l.width,l.height]:[]).map(e=>e?_xeUtils.default.toNumber(e):"").join(","),localStorage.setItem(o,_xeUtils.default.toJSONString(t)))},g=()=>{const{minimizeLayout:e,minimizeMaxSize:t,minimizeHorizontalOffset:s,minimizeVerticalOffset:n,minimizeOffsetMethod:u}=l.value,r="horizontal"===e,m=B.zoomStatus,o=[],i=[],d=(allActiveModals.forEach(e=>{e.xID!==D.xID&&"modal"===e.props.type&&"minimize"===e.reactData.zoomStatus&&("horizontal"===e.getComputeMaps().computeZoomOpts.value.minimizeLayout?o:i).push(e)}),r?o:i);return t&&d.length>=t?(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({status:"error",content:(0,_ui.getI18n)("vxe.modal.miniMaxSize",[t])}),Promise.resolve({status:!1})):(B.prevZoomStatus=m,B.zoomStatus="minimize",(0,_vue.nextTick)().then(()=>{var e=z();if(!e)return{status:!1};var t=T.value;if(!t)return{status:!1};var o=(0,_dom.getDomNode)()["visibleHeight"],i=(m||(B.revertLocat={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth+(e.style.width?0:1),height:e.offsetHeight+(e.style.height?0:1)}),_xeUtils.default[r?"max":"min"](d,e=>{e=e.getBox();return e?_xeUtils.default.toNumber(e.style[r?"left":"top"]):0}));let l=o-t.offsetHeight-16,a=16;if(i){o=i.getBox();if(o){i=_xeUtils.default.toNumber(o.style.left),o=_xeUtils.default.toNumber(o.style.top);let e={};e=r?Object.assign({},s):Object.assign({},n),a=i+_xeUtils.default.toNumber(e.left),l=o+_xeUtils.default.toNumber(e.top),u&&(e=u({$modal:D,left:a,top:l}),a=_xeUtils.default.toNumber(e.left),l=_xeUtils.default.toNumber(e.top))}}return Object.assign(e.style,{top:l+"px",left:a+"px",width:"200px",height:t.offsetHeight+"px"}),C(),{status:!0}}))},p=()=>{const l=B.zoomStatus;return B.prevZoomStatus=l,B.zoomStatus="maximize",(0,_vue.nextTick)().then(()=>{var e,t,o,i=z();return i&&(l||(e=_xeUtils.default.toNumber(w.marginSize),t=document.documentElement.clientWidth||document.body.clientWidth,o=document.documentElement.clientHeight||document.body.clientHeight,B.revertLocat={top:Math.max(e,o/2-i.offsetHeight/2),left:Math.max(e,t/2-i.offsetWidth/2),width:i.offsetWidth+(i.style.width?0:1),height:i.offsetHeight+(i.style.height?0:1)}),Object.assign(i.style,{top:"0",left:"0",width:"100%",height:"100%"})),C(),{status:!0}})},_=()=>{var e=w["duration"];-1!==e&&(t.msgTimeout=setTimeout(()=>i("close"),_xeUtils.default.toNumber(e)))},h=()=>{var e=document.documentElement,t=e.getAttribute(lockScrollAttrKey);t&&((t=t.split(",").filter(e=>e!==a)).length?e.setAttribute(lockScrollAttrKey,t.join(",")):(e.removeAttribute(lockScrollAttrKey),e.style.removeProperty(lockScrollCssWidthKey)))},x=()=>{const{remember:m,showFooter:o}=w;var e,{initialized:t,visible:i}=B,l=V.value;return t||(B.initialized=!0),i||(t=w.lockScroll,i=V.value,t&&!i&&(t=document.documentElement,i=document.body.clientWidth,(e=(e=t.getAttribute(lockScrollAttrKey))?e.split(","):[]).includes(a)||(e.push(a),t.setAttribute(lockScrollAttrKey,e.join(","))),t.style.setProperty(lockScrollCssWidthKey,i+"px")),B.visible=!0,B.contentVisible=!1,r(),allActiveModals.push(D),setTimeout(()=>{B.contentVisible=!0,(0,_vue.nextTick)(()=>{o&&(e=n.value,t=u.value,e=e||t)&&e.focus();var e,t={type:""};s("update:modelValue",!0),S("show",t,null)})},10),l?(-1===(e="notification"===(e=w.type)?notifyQueue:msgQueue).indexOf(D)&&e.push(D),v(),_()):(0,_vue.nextTick)(()=>{var e,t,o,i,l,a,s,n,u=w["fullscreen"],r=B["firstOpen"];r?(B.firstOpen=!1,(()=>{var{id:e,storage:t,storageKey:o}=w;return!!(e&&t&&f(o)[e])})()?({id:r,storage:s,storageKey:n}=w,r&&s&&(s=f(n)[r])&&(n=z(),[r,s,e,t,o,i,l,a]=s.split(","),n&&(r&&(n.style.left=r+"px"),s&&(n.style.top=s+"px"),e&&(n.style.width=e+"px"),t)&&(n.style.height=t+"px"),o)&&i&&(B.revertLocat={left:o,top:i,width:l,height:a})):u?(0,_vue.nextTick)(()=>p()):(d(),c().then(()=>{setTimeout(()=>c(),20)}))):m||(d(),c().then(()=>{setTimeout(()=>c(),20)}))})),(0,_vue.nextTick)()},P=e=>{var t=M.value;w.maskClosable&&e.target===t&&i("mask")},Y=()=>{var e=t["msgTimeout"];e&&V.value&&(clearTimeout(e),t.msgTimeout=void 0)},F=()=>{var e=t["msgTimeout"];e||V.value&&_()},X=e=>{if(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE)){const t=_xeUtils.default.max(allActiveModals,e=>e.reactData.modalZindex);t&&setTimeout(()=>{t===D&&t.props.escClosable&&(S("close",{type:"exit"},e),i("exit"))},10)}};const y=()=>(B.prevZoomStatus=B.zoomStatus,(B.zoomStatus="",_vue.nextTick)().then(()=>{var e,t=B["revertLocat"];return t?(e=z(),B.revertLocat=null,e&&Object.assign(e.style,{top:t.top+"px",left:t.left+"px",width:t.width+"px",height:t.height+"px"}),C(),(0,_vue.nextTick)().then(()=>({status:!0}))):{status:!1}})),b=t=>{const o=B["zoomStatus"];return new Promise(e=>{if(t)return"maximize"===t?void e(p()):"minimize"===t?void e(g()):void e(y());e((o?y:p)())}).then(()=>B.zoomStatus||"revert")},Q=t=>{var{zoomStatus:e,prevZoomStatus:o}=B;return b("minimize"===e?o||"revert":"minimize").then(e=>{e={type:e};S("zoom",e,t)})},I=t=>b().then(e=>{e={type:e};S("zoom",e,t)});const R=()=>{const t=B["modalZindex"];allActiveModals.some(e=>e.reactData.visible&&e.reactData.modalZindex>t)&&r()},J=e=>{const t=w["storage"];var o=B["zoomStatus"];const n=_xeUtils.default.toNumber(w.marginSize),u=z();if(u&&"maximize"!==o&&0===e.button&&!(0,_dom.getEventTargetNode)(e,u,"trigger--btn").flag){e.preventDefault();const i=document.onmousemove,l=document.onmouseup,r=e.clientX-u.offsetLeft,m=e.clientY-u.offsetTop,{visibleHeight:d,visibleWidth:c}=(0,_dom.getDomNode)();document.onmousemove=e=>{e.preventDefault();var t=u.offsetWidth,o=u.offsetHeight,i=n,t=c-t-n-1,l=n,o=d-o-n-1;let a=e.clientX-r,s=e.clientY-m;(a=a>t?t:a)<i&&(a=i),(s=s>o?o:s)<l&&(s=l),u.style.left=a+"px",u.style.top=s+"px",u.className=u.className.replace(/\s?is--drag/,"")+" is--drag",S("move",{type:"move"},e)},document.onmouseup=()=>{document.onmousemove=i,document.onmouseup=l,t&&(0,_vue.nextTick)(()=>{C()}),setTimeout(()=>{u.className=u.className.replace(/\s?is--drag/,"")},50)}}},G=e=>{e.preventDefault();const a=w["storage"],{visibleHeight:s,visibleWidth:n}=(0,_dom.getDomNode)(),u=_xeUtils.default.toNumber(w.marginSize);const r=e.target.getAttribute("type"),m=_xeUtils.default.toNumber(w.minWidth),d=_xeUtils.default.toNumber(w.minHeight),c=n,v=s,f=z(),g=f.clientWidth,p=f.clientHeight,_=e.clientX,h=e.clientY,x=f.offsetTop,y=f.offsetLeft,b={type:"resize"};document.onmousemove=e=>{e.preventDefault();let t,o,i,l;switch(r){case"wl":t=_-e.clientX,i=t+g,y-t>u&&i>m&&(f.style.width=`${i<c?i:c}px`,f.style.left=y-t+"px");break;case"swst":t=_-e.clientX,o=h-e.clientY,i=t+g,l=o+p,y-t>u&&i>m&&(f.style.width=`${i<c?i:c}px`,f.style.left=y-t+"px"),x-o>u&&l>d&&(f.style.height=`${l<v?l:v}px`,f.style.top=x-o+"px");break;case"swlb":t=_-e.clientX,o=e.clientY-h,i=t+g,l=o+p,y-t>u&&i>m&&(f.style.width=`${i<c?i:c}px`,f.style.left=y-t+"px"),x+l+u<s&&l>d&&(f.style.height=`${l<v?l:v}px`);break;case"st":o=h-e.clientY,l=p+o,x-o>u&&l>d&&(f.style.height=`${l<v?l:v}px`,f.style.top=x-o+"px");break;case"wr":t=e.clientX-_,i=t+g,y+i+u<n&&i>m&&(f.style.width=`${i<c?i:c}px`);break;case"sest":t=e.clientX-_,o=h-e.clientY,i=t+g,l=o+p,y+i+u<n&&i>m&&(f.style.width=`${i<c?i:c}px`),x-o>u&&l>d&&(f.style.height=`${l<v?l:v}px`,f.style.top=x-o+"px");break;case"selb":t=e.clientX-_,o=e.clientY-h,i=t+g,l=o+p,y+i+u<n&&i>m&&(f.style.width=`${i<c?i:c}px`),x+l+u<s&&l>d&&(f.style.height=`${l<v?l:v}px`);break;case"sb":o=e.clientY-h,l=o+p,x+l+u<s&&l>d&&(f.style.height=`${l<v?l:v}px`)}f.className=f.className.replace(/\s?is--drag/,"")+" is--drag",a&&C(),S("resize",b,e)},document.onmouseup=()=>{B.revertLocat=null,document.onmousemove=null,document.onmouseup=null,setTimeout(()=>{f.className=f.className.replace(/\s?is--drag/,"")},50)}},S=(e,t,o)=>{s(e,(0,_ui.createEvent)(o,{$modal:D},t))},ee=(e={dispatchEvent:S,open:x,close(){return i("close")},getBox:z,getPosition:()=>{if(!V.value){var e=z();if(e)return{top:e.offsetTop,left:e.offsetLeft}}return null},setPosition:(e,t)=>{var o;return V.value||(o=z())&&(_xeUtils.default.isNumber(e)&&(o.style.top=e+"px"),_xeUtils.default.isNumber(t))&&(o.style.left=t+"px"),(0,_vue.nextTick)()},isMinimized:()=>"minimize"===B.zoomStatus,isMaximized:()=>"maximize"===B.zoomStatus,zoom(){return b()},minimize(){return B.visible?g():Promise.resolve({status:!1})},maximize(){return B.visible?p():Promise.resolve({status:!1})},revert(){return B.visible?y():Promise.resolve({status:!1})}},Object.assign(D,e),()=>{var{slots:e={},showClose:t,showZoom:o,showMaximize:i,showMinimize:l,title:a}=w,s=B["zoomStatus"],n=N.title||e.title,e=N.corner||e.corner,u=U.value,r=H.value;return[(0,_vue.h)("div",{class:"vxe-modal--header-title"},n?(0,_vn.getSlotVNs)(n({$modal:D,minimized:u,maximized:r})):a?(0,_utils.getFuncText)(a):(0,_ui.getI18n)("vxe.alert.title")),(0,_vue.h)("div",{class:"vxe-modal--header-right"},[e&&!u?(0,_vue.h)("div",{class:"vxe-modal--corner-wrapper"},(0,_vn.getSlotVNs)(e({$modal:D}))):(0,_vue.createCommentVNode)(),(_xeUtils.default.isBoolean(l)?l:o)?(0,_vue.h)("div",{class:["vxe-modal--zoom-btn","trigger--btn"],title:(0,_ui.getI18n)("vxe.modal.zoom"+("minimize"===s?"Out":"Min")),onClick:Q},[(0,_vue.h)("i",{class:"minimize"===s?(0,_ui.getIcon)().MODAL_ZOOM_REVERT:(0,_ui.getIcon)().MODAL_ZOOM_MIN})]):(0,_vue.createCommentVNode)(),(_xeUtils.default.isBoolean(i)?i:o)&&"minimize"!==s?(0,_vue.h)("div",{class:["vxe-modal--zoom-btn","trigger--btn"],title:(0,_ui.getI18n)("vxe.modal.zoom"+("maximize"===s?"Out":"In")),onClick:I},[(0,_vue.h)("i",{class:"maximize"===s?(0,_ui.getIcon)().MODAL_ZOOM_OUT:(0,_ui.getIcon)().MODAL_ZOOM_IN})]):(0,_vue.createCommentVNode)(),t?(0,_vue.h)("div",{class:["vxe-modal--close-btn","trigger--btn"],title:(0,_ui.getI18n)("vxe.modal.close"),onClick:W},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().MODAL_CLOSE})]):(0,_vue.createCommentVNode)()])]}),te=()=>{var{slots:e={},showCancelButton:t,showConfirmButton:o,type:i,loading:l}=w,a=N.leftfoot||e.leftfoot,e=N.rightfoot||e.rightfoot,s=[];return(_xeUtils.default.isBoolean(t)?t:"confirm"===i)&&s.push((0,_vue.h)(_button.default,{key:1,ref:u,content:w.cancelButtonText||(0,_ui.getI18n)("vxe.button.cancel"),onClick:q})),(_xeUtils.default.isBoolean(o)?o:"confirm"===i||"alert"===i)&&s.push((0,_vue.h)(_button.default,{key:2,ref:n,loading:l,status:"primary",content:w.confirmButtonText||(0,_ui.getI18n)("vxe.button.confirm"),onClick:K})),(0,_vue.h)("div",{class:"vxe-modal--footer-wrapper"},[(0,_vue.h)("div",{class:"vxe-modal--footer-left"},a?(0,_vn.getSlotVNs)(a({$modal:D})):[]),(0,_vue.h)("div",{class:"vxe-modal--footer-right"},e?(0,_vn.getSlotVNs)(e({$modal:D})):s)])};return D.renderVN=()=>{var{slots:e={},className:t,type:o,animat:i,draggable:l,iconStatus:a,position:s,loading:n,destroyOnClose:u,status:r,lockScroll:m,padding:d,lockView:c,mask:v,resize:f}=w,{initialized:g,modalTop:p,contentVisible:_,visible:h,zoomStatus:x}=B,e=N.aside||e.aside,y=k.value,b=V.value,z=U.value,C=Z.value,S={};return b&&(S.onMouseover=Y,S.onMouseout=F),(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!C||!g},[(0,_vue.h)("div",Object.assign({ref:M,class:["vxe-modal--wrapper","type--"+o,"zoom--"+(x||"revert"),t||"",s?"pos--"+s:"",{["size--"+y]:y,["status--"+r]:r,"is--padding":d,"is--animat":i,"lock--scroll":m,"lock--view":c,"is--draggable":l,"is--resize":f,"is--mask":v,"is--visible":_,"is--active":h,"is--loading":n}],style:{zIndex:B.modalZindex,top:p?p+"px":null},onClick:P},S),[(0,_vue.h)("div",{ref:O,class:"vxe-modal--box",onMousedown:R},[!b&&!e||z?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-modal--aside"},e?(0,_vn.getSlotVNs)(e({$modal:D})):[r||a?(0,_vue.h)("div",{class:"vxe-modal--status-wrapper"},[(0,_vue.h)("i",{class:["vxe-modal--status-icon",a||(0,_ui.getIcon)()[("MODAL_"+r).toLocaleUpperCase()]]})]):(0,_vue.createCommentVNode)()]),(0,_vue.h)("div",{class:"vxe-modal--container"},!B.initialized||u&&!B.visible?[]:[(()=>{var e,{slots:t={},showZoom:o,showMaximize:i,draggable:l}=w,t=N.header||t.header;return w.showHeader?(e={},l&&(e.onMousedown=J),(_xeUtils.default.isBoolean(i)?i:o)&&w.dblclickZoom&&"modal"===w.type&&(e.onDblclick=I),(0,_vue.h)("div",Object.assign({ref:T,class:["vxe-modal--header",{"is--ellipsis":w.showTitleOverflow}]},e),t?(0,_vn.getSlotVNs)(t({$modal:D})):ee())):(0,_vue.createCommentVNode)()})(),(()=>{var{slots:e={},status:t,message:o,iconStatus:i}=w,o=w.content||o,l=V.value,a=N.default||e.default,s=N.left||e.left,e=N.right||e.right,n=[];return l||!t&&!i||n.push((0,_vue.h)("div",{class:"vxe-modal--status-wrapper"},[(0,_vue.h)("i",{class:["vxe-modal--status-icon",i||(0,_ui.getIcon)()[("MODAL_"+t).toLocaleUpperCase()]]})])),n.push((0,_vue.h)("div",{class:"vxe-modal--content"},a?(0,_vn.getSlotVNs)(a({$modal:D})):(0,_utils.getFuncText)(o))),(0,_vue.h)("div",{class:"vxe-modal--body"},[s?(0,_vue.h)("div",{class:"vxe-modal--body-left"},(0,_vn.getSlotVNs)(s({$modal:D}))):(0,_vue.createCommentVNode)(),(0,_vue.h)("div",{class:"vxe-modal--body-default"},n),e?(0,_vue.h)("div",{class:"vxe-modal--body-right"},(0,_vn.getSlotVNs)(e({$modal:D}))):(0,_vue.createCommentVNode)(),l?(0,_vue.createCommentVNode)():(0,_vue.h)(_index.default,{class:"vxe-modal--loading",modelValue:w.loading})])})(),(()=>{var{slots:e={}}=w,e=N.footer||e.footer;return w.showFooter?(0,_vue.h)("div",{class:"vxe-modal--footer"},e?(0,_vn.getSlotVNs)(e({$modal:D})):[te()]):(0,_vue.createCommentVNode)()})(),!b&&f?(0,_vue.h)("span",{class:"vxe-modal--resize"},["wl","wr","swst","sest","st","swlb","selb","sb"].map(e=>(0,_vue.h)("span",{class:e+"-resize",type:e,onMousedown:G}))):(0,_vue.createCommentVNode)()])])])])},(0,_vue.watch)(()=>w.width,d),(0,_vue.watch)(()=>w.height,d),(0,_vue.watch)(()=>w.modelValue,e=>{e?x():i("model")}),(0,_vue.onMounted)(()=>{"development"===process.env.NODE_ENV&&"modal"===w.type&&w.showFooter&&!(w.showConfirmButton||w.showCancelButton||N.footer)&&(0,_log.warnLog)("vxe.modal.footPropErr"),(0,_vue.nextTick)(()=>{w.storage&&!w.id&&(0,_log.errLog)("vxe.error.reqProp",["modal.id"]),w.modelValue&&x(),d()}),w.escClosable&&_ui.globalEvents.on(D,"keydown",X)}),(0,_vue.onUnmounted)(()=>{_ui.globalEvents.off(D,"keydown"),m(),h()}),(0,_vue.provide)("$xeModal",D),D},render(){return this.renderVN()}});
|
|
@@ -10,7 +10,7 @@ var _util = require("./util");
|
|
|
10
10
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
var _default = exports.default = (0, _vue.defineComponent)({
|
|
13
|
-
name: '
|
|
13
|
+
name: 'VxeSplitPane',
|
|
14
14
|
props: {
|
|
15
15
|
name: [Number, String],
|
|
16
16
|
width: [Number, String],
|
|
@@ -34,7 +34,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
34
34
|
const xID = _xeUtils.default.uniqueId();
|
|
35
35
|
const $xeSplit = (0, _vue.inject)('$xeSplit', null);
|
|
36
36
|
const refElem = (0, _vue.ref)();
|
|
37
|
-
const
|
|
37
|
+
const paneConfig = (0, _vue.reactive)({
|
|
38
38
|
id: xID,
|
|
39
39
|
name: props.name,
|
|
40
40
|
width: props.width,
|
|
@@ -69,46 +69,46 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
69
69
|
};
|
|
70
70
|
const dispatchEvent = (type, params, evnt) => {
|
|
71
71
|
emit(type, (0, _ui.createEvent)(evnt, {
|
|
72
|
-
$
|
|
72
|
+
$splitPane: $xeSplitItem
|
|
73
73
|
}, params));
|
|
74
74
|
};
|
|
75
|
-
const
|
|
75
|
+
const splitPaneMethods = {
|
|
76
76
|
dispatchEvent
|
|
77
77
|
};
|
|
78
|
-
const
|
|
79
|
-
Object.assign($xeSplitItem,
|
|
78
|
+
const splitPanePrivateMethods = {};
|
|
79
|
+
Object.assign($xeSplitItem, splitPaneMethods, splitPanePrivateMethods);
|
|
80
80
|
const renderVN = () => {
|
|
81
81
|
return (0, _vue.h)('div', {
|
|
82
82
|
ref: refElem
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
(0, _vue.watch)(() => props.name, val => {
|
|
86
|
-
|
|
86
|
+
paneConfig.name = val;
|
|
87
87
|
});
|
|
88
88
|
(0, _vue.watch)(() => props.width, val => {
|
|
89
|
-
|
|
89
|
+
paneConfig.width = val;
|
|
90
90
|
});
|
|
91
91
|
(0, _vue.watch)(() => props.height, val => {
|
|
92
|
-
|
|
92
|
+
paneConfig.height = val;
|
|
93
93
|
});
|
|
94
94
|
(0, _vue.watch)(() => props.minWidth, val => {
|
|
95
|
-
|
|
95
|
+
paneConfig.minWidth = val;
|
|
96
96
|
});
|
|
97
97
|
(0, _vue.watch)(() => props.minHeight, val => {
|
|
98
|
-
|
|
98
|
+
paneConfig.minHeight = val;
|
|
99
99
|
});
|
|
100
100
|
(0, _vue.watch)(() => props.showAction, val => {
|
|
101
|
-
|
|
101
|
+
paneConfig.showAction = val;
|
|
102
102
|
});
|
|
103
103
|
(0, _vue.onMounted)(() => {
|
|
104
104
|
const elem = refElem.value;
|
|
105
105
|
if ($xeSplit && elem) {
|
|
106
|
-
(0, _util.assembleSplitItem)($xeSplit, elem,
|
|
106
|
+
(0, _util.assembleSplitItem)($xeSplit, elem, paneConfig);
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
(0, _vue.onUnmounted)(() => {
|
|
110
110
|
if ($xeSplit) {
|
|
111
|
-
(0, _util.destroySplitItem)($xeSplit,
|
|
111
|
+
(0, _util.destroySplitItem)($xeSplit, paneConfig);
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
(0, _vue.provide)('$xeSplitItem', $xeSplitItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_ui=require("../../ui"),_util=require("./util"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_vue.defineComponent)({name:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_ui=require("../../ui"),_util=require("./util"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_vue.defineComponent)({name:"VxeSplitPane",props:{name:[Number,String],width:[Number,String],height:[Number,String],showAction:Boolean,minWidth:{type:[Number,String],default:()=>null},minHeight:{type:[Number,String],default:()=>null}},emits:[],setup(e,t){const{emit:n,slots:i}=t;var r=_xeUtils.default.uniqueId();const u=(0,_vue.inject)("$xeSplit",null),a=(0,_vue.ref)(),h=(0,_vue.reactive)({id:r,name:e.name,width:e.width,height:e.height,minWidth:e.minWidth,minHeight:e.minHeight,showAction:e.showAction,isVisible:!0,isExpand:!0,renderWidth:0,resizeWidth:0,foldWidth:0,renderHeight:0,resizeHeight:0,foldHeight:0,slots:i});var d=(0,_vue.reactive)({});const l={},o={refElem:a},s={xID:r,props:e,context:t,reactData:d,internalData:{},getRefMaps:()=>o,getComputeMaps:()=>l};Object.assign(s,{dispatchEvent:(e,t,i)=>{n(e,(0,_ui.createEvent)(i,{$splitPane:s},t))}},{});return(0,_vue.watch)(()=>e.name,e=>{h.name=e}),(0,_vue.watch)(()=>e.width,e=>{h.width=e}),(0,_vue.watch)(()=>e.height,e=>{h.height=e}),(0,_vue.watch)(()=>e.minWidth,e=>{h.minWidth=e}),(0,_vue.watch)(()=>e.minHeight,e=>{h.minHeight=e}),(0,_vue.watch)(()=>e.showAction,e=>{h.showAction=e}),(0,_vue.onMounted)(()=>{var e=a.value;u&&e&&(0,_util.assembleSplitItem)(u,e,h)}),(0,_vue.onUnmounted)(()=>{u&&(0,_util.destroySplitItem)(u,h)}),(0,_vue.provide)("$xeSplitItem",s),s.renderVN=()=>(0,_vue.h)("div",{ref:a}),s},render(){return this.renderVN()}});
|
package/lib/split/src/split.js
CHANGED
|
@@ -186,7 +186,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
186
186
|
});
|
|
187
187
|
});
|
|
188
188
|
if (staticItems.length) {
|
|
189
|
-
(0, _log.errLog)('vxe.error.errConflicts', ['<vxe-split-
|
|
189
|
+
(0, _log.errLog)('vxe.error.errConflicts', ['<vxe-split-pane ...>', 'items']);
|
|
190
190
|
}
|
|
191
191
|
return recalculate();
|
|
192
192
|
};
|
|
@@ -298,8 +298,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
298
298
|
const allMinWidth = _xeUtils.default.toNumber(itemOpts.minWidth);
|
|
299
299
|
const allMinHeight = _xeUtils.default.toNumber(itemOpts.minHeight);
|
|
300
300
|
const targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)];
|
|
301
|
-
const targetItemEl = targetItem ? el.querySelector(`.vxe-split-
|
|
302
|
-
const currItemEl = item ? el.querySelector(`.vxe-split-
|
|
301
|
+
const targetItemEl = targetItem ? el.querySelector(`.vxe-split-pane[itemid="${targetItem.id}"]`) : null;
|
|
302
|
+
const currItemEl = item ? el.querySelector(`.vxe-split-pane[itemid="${item.id}"]`) : null;
|
|
303
303
|
const targetWidth = targetItemEl ? targetItemEl.clientWidth : 0;
|
|
304
304
|
const currWidth = currItemEl ? currItemEl.clientWidth : 0;
|
|
305
305
|
const targetHeight = targetItemEl ? targetItemEl.clientHeight : 0;
|
|
@@ -513,13 +513,13 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
513
513
|
} = item;
|
|
514
514
|
return (0, _vue.h)('div', {
|
|
515
515
|
itemid: id,
|
|
516
|
-
class: ['vxe-split-
|
|
516
|
+
class: ['vxe-split-pane-handle', isFoldNext ? 'to--next' : 'to--prev']
|
|
517
517
|
}, [(0, _vue.h)('div', {
|
|
518
|
-
class: 'vxe-split-
|
|
518
|
+
class: 'vxe-split-pane-handle-bar',
|
|
519
519
|
style: barStyle,
|
|
520
520
|
onMousedown: dragEvent
|
|
521
521
|
}), showAction ? (0, _vue.h)('span', {
|
|
522
|
-
class: 'vxe-split-
|
|
522
|
+
class: 'vxe-split-pane-action-btn',
|
|
523
523
|
onDblclick: handleActionDblclickEvent,
|
|
524
524
|
onClick: handleActionClickEvent
|
|
525
525
|
}, [(0, _vue.h)('i', {
|
|
@@ -566,7 +566,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
566
566
|
}
|
|
567
567
|
itemVNs.push((0, _vue.h)('div', {
|
|
568
568
|
itemid: id,
|
|
569
|
-
class: ['vxe-split-
|
|
569
|
+
class: ['vxe-split-pane', vertical ? 'is--vertical' : 'is--horizontal', {
|
|
570
570
|
'is--padding': padding,
|
|
571
571
|
'is--border': border,
|
|
572
572
|
'is--height': itemHeight,
|
|
@@ -579,9 +579,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
579
579
|
style: stys
|
|
580
580
|
}, [index && !isFoldNext ? renderHandleBar(item) : (0, _ui.renderEmptyElement)($xeSplit), (0, _vue.h)('div', {
|
|
581
581
|
itemid: id,
|
|
582
|
-
class: 'vxe-split-
|
|
582
|
+
class: 'vxe-split-pane--wrapper'
|
|
583
583
|
}, [(0, _vue.h)('div', {
|
|
584
|
-
class: 'vxe-split-
|
|
584
|
+
class: 'vxe-split-pane--inner'
|
|
585
585
|
}, defaultSlot ? callSlot(defaultSlot, {
|
|
586
586
|
name,
|
|
587
587
|
isVisible,
|
|
@@ -626,7 +626,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
626
626
|
});
|
|
627
627
|
(0, _vue.watch)(() => reactData.staticItems, val => {
|
|
628
628
|
if (props.items && props.items.length) {
|
|
629
|
-
(0, _log.errLog)('vxe.error.errConflicts', ['<vxe-split-
|
|
629
|
+
(0, _log.errLog)('vxe.error.errConflicts', ['<vxe-split-pane ...>', 'items']);
|
|
630
630
|
}
|
|
631
631
|
reactData.itemList = val;
|
|
632
632
|
recalculate();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_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,_vue.defineComponent)({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},items:Array,itemConfig:Object,barConfig:Object,actionConfig:Object},emits:["action-dblclick","action-click","toggle-expand","resize-start","resize-drag","resize-end"],setup(z,e){const{emit:s,slots:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_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,_vue.defineComponent)({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},items:Array,itemConfig:Object,barConfig:Object,actionConfig:Object},emits:["action-dblclick","action-click","toggle-expand","resize-start","resize-drag","resize-end"],setup(z,e){const{emit:s,slots:r}=e;var t=_xeUtils.default.uniqueId();const H=(0,_vue.ref)(),C=(0,_vue.reactive)({staticItems:[],itemList:[]});const W=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.itemConfig,z.itemConfig)),n=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.barConfig,z.barConfig)),a=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().split.actionConfig,z.actionConfig)),E=(0,_vue.computed)(()=>{return"next"===a.value.direction}),o=(0,_vue.computed)(()=>{var{width:e,height:t}=n.value,i={};return t&&(i.height=(0,_dom.toCssUnit)(t)),e&&(i.width=(0,_dom.toCssUnit)(e)),i}),i={computeItemOpts:W,computeBarOpts:n,computeActionOpts:a,computeIsFoldNext:E},l={refElem:H},b={xID:t,props:z,context:e,reactData:C,internalData:{},getRefMaps:()=>l,getComputeMaps:()=>i},U=(e,t,i)=>{s(e,(0,_ui.createEvent)(i,{$split:b},t))},I=(e,t)=>e&&(_xeUtils.default.isString(e)&&(e=r[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e(t)):[];const d=(e,t)=>{var i=C["staticItems"];const s={isVisible:!0,isExpand:!0,renderWidth:0,resizeWidth:0,foldWidth:0,renderHeight:0,resizeHeight:0,foldHeight:0};return C.itemList=e.map(e=>(e.slots&&_xeUtils.default.each(e.slots,e=>{_xeUtils.default.isFunction(e)||r[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"]),N()},u=e=>d(e||[],!1);const N=()=>(0,_vue.nextTick)().then(()=>{var e=z["vertical"],t=C["itemList"],i=H.value;if(i){const n=i.clientWidth,r=i.clientHeight;if(n&&r){i=W.value;const l=_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)?r*_xeUtils.default.toNumber(t):_xeUtils.default.toNumber(t),e.renderHeight=i):o.push(e),s+=i}),o.length){const d=(r-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)?n*_xeUtils.default.toNumber(t):_xeUtils.default.toNumber(t),e.renderWidth=i):o.push(e),s+=i}),o.length){const u=(n-s)/o.length;o.forEach(e=>{e.renderWidth=Math.max(_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(e.minWidth,l)),u)})}}}}}),c=e=>{e.preventDefault();const s=z["vertical"];var t=C["itemList"],i=e.currentTarget.parentElement;const n=H.value;if(n){const a=i.getAttribute("itemid");i=_xeUtils.default.findIndexOf(t,e=>e.id===a);const o=t[i];if(o&&o.isExpand){const d=E.value;var r=W.value,l=_xeUtils.default.toNumber(r.minWidth),r=_xeUtils.default.toNumber(r.minHeight);const u=t[i+(d?1:-1)];t=u?n.querySelector(`.vxe-split-pane[itemid="${u.id}"]`):null,i=o?n.querySelector(`.vxe-split-pane[itemid="${o.id}"]`):null;const c=t?t.clientWidth:0,m=i?i.clientWidth:0,h=t?t.clientHeight:0,g=i?i.clientHeight:0,f=_xeUtils.default.toNumber(u?(0,_utils.getGlobalDefaultConfig)(u.minWidth,l):l),v=_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(o.minWidth,l)),_=_xeUtils.default.toNumber(u?(0,_utils.getGlobalDefaultConfig)(u.minHeight,r):r),p=_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(o.minHeight,r)),x=e.clientX,b=e.clientY;(0,_dom.addClass)(n,"is--drag"),document.onmousemove=e=>{var t,i;e.preventDefault(),s?0<(t=d?b-e.clientY:e.clientY-b)?u&&g-t>=p&&(i=g-t,u.resizeHeight=h+t,o.resizeHeight=i,U("resize-drag",{item:o,name:o.name,offsetHeight:t,resizeHeight:i,offsetWidth:0,resizeWidth:0},e)):u&&h+t>=_&&(i=g-t,u.resizeHeight=h+t,o.resizeHeight=i,U("resize-drag",{item:o,name:o.name,offsetHeight:t,resizeHeight:i,offsetWidth:0,resizeWidth:0},e)):0<(t=d?x-e.clientX:e.clientX-x)?u&&m-t>=v&&(i=m-t,u.resizeWidth=c+t,o.resizeWidth=i,U("resize-drag",{item:o,name:o.name,offsetHeight:0,resizeHeight:0,offsetWidth:t,resizeWidth:i},e)):u&&c+t>=f&&(i=m-t,u.resizeWidth=c+t,o.resizeWidth=i,U("resize-drag",{item:o,name:o.name,offsetHeight:0,resizeHeight:0,offsetWidth:t,resizeWidth:i},e))},document.onmouseup=e=>{document.onmousemove=null,(document.onmouseup=null,_dom.removeClass)(n,"is--drag"),U("resize-end",{item:o,name:o.name,resizeHeight:o.resizeHeight,resizeWidth:o.resizeWidth},e),N()},U("resize-start",{item:o,name:o.name},e)}}},m=e=>{if(H.value){var t=z["vertical"],i=C["itemList"],s=E.value;const l=e.currentTarget.parentElement.getAttribute("itemid");var n=_xeUtils.default.findIndexOf(i,e=>e.id===l),r=i[n],i=i[n+(s?1:-1)];r&&({showAction:n,isExpand:s}=r,n)&&(t?i&&(i.isVisible=!s,i.foldHeight=0,r.isExpand=!s,r.isVisible=!0,r.foldHeight=s?(i.resizeHeight||i.renderHeight)+(r.resizeHeight||r.renderHeight):0):i&&(i.isVisible=!s,i.foldWidth=0,r.isExpand=!s,r.isVisible=!0,r.foldWidth=s?(i.resizeWidth||i.renderWidth)+(r.resizeWidth||r.renderWidth):0),U("toggle-expand",{item:r,name:r.name,targetItem:i,targetName:i?i.name:"",expanded:r.isExpand},e),N())}},h=e=>{var t=C["itemList"],i=a.value;const s=e.currentTarget.parentElement.getAttribute("itemid");t=t[_xeUtils.default.findIndexOf(t,e=>e.id===s)];"dblclick"===i.trigger&&m(e),U("action-dblclick",{item:t,name:t?t.name:""},e)},g=e=>{var t=C["itemList"],i=a.value;const s=e.currentTarget.parentElement.getAttribute("itemid");t=t[_xeUtils.default.findIndexOf(t,e=>e.id===s)];"dblclick"!==i.trigger&&m(e),U("action-click",{item:t,name:t?t.name:""},e)},f=()=>{N()};t={dispatchEvent:U,recalculate:N,reset:()=>{var e=C["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:u,reloadItem:e=>d(e||[],!0)};Object.assign(b,t,{});const O=e=>{var t=o.value,i=a.value,s=E.value,{id:n,isExpand:r,showAction:l}=e;return(0,_vue.h)("div",{itemid:n,class:["vxe-split-pane-handle",s?"to--next":"to--prev"]},[(0,_vue.h)("div",{class:"vxe-split-pane-handle-bar",style:t,onMousedown:c}),l?(0,_vue.h)("span",{class:"vxe-split-pane-action-btn",onDblclick:h,onClick:g},[(0,_vue.h)("i",{class:(r?i.openIcon:i.closeIcon)||(e=>{var t=z["vertical"],{showAction:e,isExpand:i}=e,s=E.value,n="SPLIT_TOP_ACTION",r="SPLIT_BOTTOM_ACTION",l="SPLIT_LEFT_ACTION",a="SPLIT_RIGHT_ACTION";if(e){let e="";if(e=s?t?i?r:n:i?a:l:t?i?n:r:i?l:a)return(0,_ui.getIcon)()[e]}return""})(e)})]):(0,_ui.renderEmptyElement)(b)])};const v=(0,_vue.ref)(0);return(0,_vue.watch)(()=>z.items?z.items.length:-1,()=>{v.value++}),(0,_vue.watch)(()=>z.items,()=>{v.value++}),(0,_vue.watch)(v,()=>{u(z.items||[])}),(0,_vue.watch)(()=>C.staticItems,e=>{z.items&&z.items.length&&(0,_log.errLog)("vxe.error.errConflicts",["<vxe-split-pane ...>","items"]),C.itemList=e,N()}),(0,_vue.onMounted)(()=>{(0,_vue.nextTick)(()=>{N()}),_ui.globalEvents.on(b,"resize",f)}),(0,_vue.onUnmounted)(()=>{_ui.globalEvents.off(b,"resize")}),(0,_vue.onActivated)(()=>{N()}),z.items&&u(z.items),(0,_vue.provide)("$xeSplit",b),b.renderVN=()=>{var{vertical:e,width:t,height:i}=z,s=r.default,n={};return i&&(n.height=(0,_dom.toCssUnit)(i)),t&&(n.width=(0,_dom.toCssUnit)(t)),(0,_vue.h)("div",{ref:H,class:["vxe-split",e?"is--vertical":"is--horizontal"],style:n},[(0,_vue.h)("div",{class:"vxe-split-slots"},s?s({}):[]),(()=>{const{border:g,padding:f,vertical:v}=z,_=C["itemList"],p=E.value,x=[];return _.forEach((e,t)=>{var{id:i,name:s,slots:n,renderHeight:r,resizeHeight:l,foldHeight:a,renderWidth:o,resizeWidth:d,foldWidth:u,isVisible:c,isExpand:m}=e,n=n?n.default:null,h={},u=c?u||d||o:0,d=c?a||l||r:0;v?d&&(h.height=(0,_dom.toCssUnit)(d)):u&&(h.width=(0,_dom.toCssUnit)(u)),x.push((0,_vue.h)("div",{itemid:i,class:["vxe-split-pane",v?"is--vertical":"is--horizontal",{"is--padding":f,"is--border":g,"is--height":d,"is--width":u,"is--fill":c&&!d&&!u,"is--handle":0<t,"is--expand":m,"is--hidden":!c}],style:h},[t&&!p?O(e):(0,_ui.renderEmptyElement)(b),(0,_vue.h)("div",{itemid:i,class:"vxe-split-pane--wrapper"},[(0,_vue.h)("div",{class:"vxe-split-pane--inner"},n?I(n,{name:s,isVisible:c,isExpand:m}):[])]),p&&t<_.length-1?O(e):(0,_ui.renderEmptyElement)(b)]))}),(0,_vue.h)("div",{class:"vxe-split-wrapper"},x)})()])},b},render(){return this.renderVN()}});
|
package/lib/split/src/util.js
CHANGED
|
@@ -7,17 +7,17 @@ exports.assembleSplitItem = assembleSplitItem;
|
|
|
7
7
|
exports.destroySplitItem = destroySplitItem;
|
|
8
8
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function assembleSplitItem($xeSplit, elem,
|
|
10
|
+
function assembleSplitItem($xeSplit, elem, paneConfig) {
|
|
11
11
|
const staticItems = $xeSplit.reactData.staticItems;
|
|
12
12
|
const parentElem = elem.parentNode;
|
|
13
13
|
if (parentElem) {
|
|
14
|
-
staticItems.splice(_xeUtils.default.arrayIndexOf(parentElem.children, elem), 0,
|
|
14
|
+
staticItems.splice(_xeUtils.default.arrayIndexOf(parentElem.children, elem), 0, paneConfig);
|
|
15
15
|
$xeSplit.reactData.staticItems = staticItems.slice(0);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
function destroySplitItem($xeSplit,
|
|
18
|
+
function destroySplitItem($xeSplit, paneConfig) {
|
|
19
19
|
const staticItems = $xeSplit.reactData.staticItems;
|
|
20
|
-
const index = _xeUtils.default.findIndexOf(staticItems, item => item.id ===
|
|
20
|
+
const index = _xeUtils.default.findIndexOf(staticItems, item => item.id === paneConfig.id);
|
|
21
21
|
if (index > -1) {
|
|
22
22
|
staticItems.splice(index, 1);
|
|
23
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.vxe-split.is--vertical > .vxe-split-wrapper {
|
|
2
2
|
flex-direction: column;
|
|
3
3
|
}
|
|
4
|
-
.vxe-split.is--vertical > .vxe-split-wrapper > .vxe-split-
|
|
4
|
+
.vxe-split.is--vertical > .vxe-split-wrapper > .vxe-split-pane {
|
|
5
5
|
width: 100%;
|
|
6
6
|
}
|
|
7
7
|
.vxe-split.is--drag {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
-moz-user-select: none;
|
|
10
10
|
user-select: none;
|
|
11
11
|
}
|
|
12
|
-
.vxe-split.is--drag > .vxe-split-wrapper > .vxe-split-
|
|
12
|
+
.vxe-split.is--drag > .vxe-split-wrapper > .vxe-split-pane > .vxe-split-pane--wrapper::after {
|
|
13
13
|
content: "";
|
|
14
14
|
position: absolute;
|
|
15
15
|
top: 0;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
display: none;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.vxe-split-
|
|
34
|
+
.vxe-split-pane-handle {
|
|
35
35
|
position: relative;
|
|
36
36
|
flex-shrink: 0;
|
|
37
37
|
-webkit-user-select: none;
|
|
@@ -39,27 +39,27 @@
|
|
|
39
39
|
user-select: none;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.vxe-split-
|
|
42
|
+
.vxe-split-pane--wrapper {
|
|
43
43
|
position: relative;
|
|
44
44
|
word-break: break-word;
|
|
45
45
|
overflow: hidden;
|
|
46
46
|
flex-grow: 1;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.vxe-split-
|
|
49
|
+
.vxe-split-pane--inner {
|
|
50
50
|
height: 100%;
|
|
51
51
|
width: 100%;
|
|
52
52
|
overflow: auto;
|
|
53
53
|
}
|
|
54
|
-
.vxe-split-
|
|
54
|
+
.vxe-split-pane--inner > .vxe-split {
|
|
55
55
|
height: 100%;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.vxe-split-
|
|
58
|
+
.vxe-split-pane-handle-bar {
|
|
59
59
|
background-color: var(--vxe-split-handle-bar-background-color);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.vxe-split-
|
|
62
|
+
.vxe-split-pane-action-btn {
|
|
63
63
|
display: block;
|
|
64
64
|
position: absolute;
|
|
65
65
|
z-index: 2;
|
|
@@ -69,92 +69,92 @@
|
|
|
69
69
|
transition: transform 0.1s ease-in-out;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.vxe-split-
|
|
72
|
+
.vxe-split-pane {
|
|
73
73
|
display: flex;
|
|
74
74
|
position: relative;
|
|
75
75
|
overflow: hidden;
|
|
76
76
|
}
|
|
77
|
-
.vxe-split-
|
|
77
|
+
.vxe-split-pane.is--hidden {
|
|
78
78
|
width: 0;
|
|
79
79
|
}
|
|
80
|
-
.vxe-split-
|
|
80
|
+
.vxe-split-pane.is--padding > .vxe-split-pane--wrapper {
|
|
81
81
|
padding: var(--vxe-ui-layout-padding-default);
|
|
82
82
|
}
|
|
83
|
-
.vxe-split-
|
|
83
|
+
.vxe-split-pane.is--fill {
|
|
84
84
|
flex-grow: 1;
|
|
85
85
|
}
|
|
86
|
-
.vxe-split-
|
|
86
|
+
.vxe-split-pane.is--width, .vxe-split-pane.is--height {
|
|
87
87
|
flex-shrink: 0;
|
|
88
88
|
}
|
|
89
|
-
.vxe-split-
|
|
89
|
+
.vxe-split-pane.is--border > .vxe-split-pane--wrapper, .vxe-split-pane.is--border > .vxe-split-pane-handle {
|
|
90
90
|
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
91
91
|
}
|
|
92
|
-
.vxe-split-
|
|
92
|
+
.vxe-split-pane.is--expand.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
93
93
|
cursor: w-resize;
|
|
94
94
|
}
|
|
95
|
-
.vxe-split-
|
|
95
|
+
.vxe-split-pane.is--expand.is--vertical > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
96
96
|
cursor: n-resize;
|
|
97
97
|
}
|
|
98
|
-
.vxe-split-
|
|
98
|
+
.vxe-split-pane.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar {
|
|
99
99
|
background-color: var(--vxe-split-handle-bar-background-color);
|
|
100
100
|
}
|
|
101
|
-
.vxe-split-
|
|
101
|
+
.vxe-split-pane.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar:hover {
|
|
102
102
|
background-color: var(--vxe-ui-font-primary-lighten-color);
|
|
103
103
|
}
|
|
104
|
-
.vxe-split-
|
|
104
|
+
.vxe-split-pane.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar:active {
|
|
105
105
|
background-color: var(--vxe-ui-font-primary-darken-color);
|
|
106
106
|
}
|
|
107
|
-
.vxe-split-
|
|
107
|
+
.vxe-split-pane.is--horizontal {
|
|
108
108
|
flex-direction: row;
|
|
109
109
|
}
|
|
110
|
-
.vxe-split-
|
|
110
|
+
.vxe-split-pane.is--horizontal > .vxe-split-pane-handle.to--prev .vxe-split-pane-action-btn {
|
|
111
111
|
left: 0;
|
|
112
112
|
}
|
|
113
|
-
.vxe-split-
|
|
113
|
+
.vxe-split-pane.is--horizontal > .vxe-split-pane-handle.to--next .vxe-split-pane-action-btn {
|
|
114
114
|
right: 0;
|
|
115
115
|
}
|
|
116
|
-
.vxe-split-
|
|
116
|
+
.vxe-split-pane.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
117
117
|
width: var(--vxe-split-handle-bar-width);
|
|
118
118
|
height: 100%;
|
|
119
119
|
}
|
|
120
|
-
.vxe-split-
|
|
120
|
+
.vxe-split-pane.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-action-btn {
|
|
121
121
|
top: 50%;
|
|
122
122
|
transform: translateY(-50%);
|
|
123
123
|
padding: 1em 0;
|
|
124
124
|
}
|
|
125
|
-
.vxe-split-
|
|
125
|
+
.vxe-split-pane.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-action-btn:hover {
|
|
126
126
|
color: var(--vxe-ui-font-primary-color);
|
|
127
127
|
}
|
|
128
|
-
.vxe-split-
|
|
128
|
+
.vxe-split-pane.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-action-btn:active {
|
|
129
129
|
transform: translateY(-50%) scale(0.9);
|
|
130
130
|
}
|
|
131
|
-
.vxe-split-
|
|
131
|
+
.vxe-split-pane.is--horizontal.is--border > .vxe-split-pane-handle {
|
|
132
132
|
border-width: 1px 0 1px 0;
|
|
133
133
|
}
|
|
134
|
-
.vxe-split-
|
|
134
|
+
.vxe-split-pane.is--vertical {
|
|
135
135
|
flex-direction: column;
|
|
136
136
|
}
|
|
137
|
-
.vxe-split-
|
|
137
|
+
.vxe-split-pane.is--vertical > .vxe-split-pane-handle.to--prev .vxe-split-pane-action-btn {
|
|
138
138
|
top: 0;
|
|
139
139
|
}
|
|
140
|
-
.vxe-split-
|
|
140
|
+
.vxe-split-pane.is--vertical > .vxe-split-pane-handle.to--next .vxe-split-pane-action-btn {
|
|
141
141
|
bottom: 0;
|
|
142
142
|
}
|
|
143
|
-
.vxe-split-
|
|
143
|
+
.vxe-split-pane.is--vertical > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
144
144
|
height: var(--vxe-split-handle-bar-height);
|
|
145
145
|
width: 100%;
|
|
146
146
|
}
|
|
147
|
-
.vxe-split-
|
|
147
|
+
.vxe-split-pane.is--vertical > .vxe-split-pane-handle .vxe-split-pane-action-btn {
|
|
148
148
|
left: 50%;
|
|
149
149
|
transform: translateX(-50%);
|
|
150
150
|
padding: 0 1em;
|
|
151
151
|
}
|
|
152
|
-
.vxe-split-
|
|
152
|
+
.vxe-split-pane.is--vertical > .vxe-split-pane-handle .vxe-split-pane-action-btn:hover {
|
|
153
153
|
color: var(--vxe-ui-font-primary-color);
|
|
154
154
|
}
|
|
155
|
-
.vxe-split-
|
|
155
|
+
.vxe-split-pane.is--vertical > .vxe-split-pane-handle .vxe-split-pane-action-btn:active {
|
|
156
156
|
transform: translateX(-50%) scale(0.9);
|
|
157
157
|
}
|
|
158
|
-
.vxe-split-
|
|
158
|
+
.vxe-split-pane.is--vertical.is--border > .vxe-split-pane-handle {
|
|
159
159
|
border-width: 0 1px 0 1px;
|
|
160
160
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.vxe-split.is--vertical>.vxe-split-wrapper{flex-direction:column}.vxe-split.is--vertical>.vxe-split-wrapper>.vxe-split-
|
|
1
|
+
.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}.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-split-handle-bar-background-color)}.vxe-split-pane-action-btn{display:block;position:absolute;z-index:2;cursor:pointer;background-color:var(--vxe-ui-layout-background-color);border:1px solid var(--vxe-ui-input-border-color);transition:transform .1s ease-in-out}.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,.vxe-split-pane.is--border>.vxe-split-pane-handle{border:1px solid var(--vxe-ui-base-popup-border-color)}.vxe-split-pane.is--expand.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-handle-bar{cursor:w-resize}.vxe-split-pane.is--expand.is--vertical>.vxe-split-pane-handle .vxe-split-pane-handle-bar{cursor:n-resize}.vxe-split-pane.is--expand>.vxe-split-pane-handle>.vxe-split-pane-handle-bar{background-color:var(--vxe-split-handle-bar-background-color)}.vxe-split-pane.is--expand>.vxe-split-pane-handle>.vxe-split-pane-handle-bar:hover{background-color:var(--vxe-ui-font-primary-lighten-color)}.vxe-split-pane.is--expand>.vxe-split-pane-handle>.vxe-split-pane-handle-bar:active{background-color:var(--vxe-ui-font-primary-darken-color)}.vxe-split-pane.is--horizontal{flex-direction:row}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle.to--prev .vxe-split-pane-action-btn{left:0}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle.to--next .vxe-split-pane-action-btn{right:0}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-handle-bar{width:var(--vxe-split-handle-bar-width);height:100%}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-action-btn{top:50%;transform:translateY(-50%);padding:1em 0}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-action-btn:hover{color:var(--vxe-ui-font-primary-color)}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-action-btn:active{transform:translateY(-50%) scale(.9)}.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.to--prev .vxe-split-pane-action-btn{top:0}.vxe-split-pane.is--vertical>.vxe-split-pane-handle.to--next .vxe-split-pane-action-btn{bottom:0}.vxe-split-pane.is--vertical>.vxe-split-pane-handle .vxe-split-pane-handle-bar{height:var(--vxe-split-handle-bar-height);width:100%}.vxe-split-pane.is--vertical>.vxe-split-pane-handle .vxe-split-pane-action-btn{left:50%;transform:translateX(-50%);padding:0 1em}.vxe-split-pane.is--vertical>.vxe-split-pane-handle .vxe-split-pane-action-btn:hover{color:var(--vxe-ui-font-primary-color)}.vxe-split-pane.is--vertical>.vxe-split-pane-handle .vxe-split-pane-action-btn:active{transform:translateX(-50%) scale(.9)}.vxe-split-pane.is--vertical.is--border>.vxe-split-pane-handle{border-width:0 1px 0 1px}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.VxeSplitPane = exports.SplitPane = void 0;
|
|
7
|
+
var _core = require("@vxe-ui/core");
|
|
8
|
+
var _splitPane = _interopRequireDefault(require("../split/src/split-pane"));
|
|
9
|
+
var _dynamics = require("../dynamics");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const VxeSplitPane = exports.VxeSplitPane = Object.assign({}, _splitPane.default, {
|
|
12
|
+
install(app) {
|
|
13
|
+
app.component(_splitPane.default.name, _splitPane.default);
|
|
14
|
+
app.component('VxeSplitItem', _splitPane.default);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
_dynamics.dynamicApp.use(VxeSplitPane);
|
|
18
|
+
_core.VxeUI.component(_splitPane.default);
|
|
19
|
+
const SplitPane = exports.SplitPane = VxeSplitPane;
|
|
20
|
+
var _default = exports.default = VxeSplitPane;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.VxeSplitPane=exports.SplitPane=void 0;var _core=require("@vxe-ui/core"),_splitPane=_interopRequireDefault(require("../split/src/split-pane")),_dynamics=require("../dynamics");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const VxeSplitPane=exports.VxeSplitPane=Object.assign({},_splitPane.default,{install(e){e.component(_splitPane.default.name,_splitPane.default),e.component("VxeSplitItem",_splitPane.default)}}),SplitPane=(_dynamics.dynamicApp.use(VxeSplitPane),_core.VxeUI.component(_splitPane.default),exports.SplitPane=VxeSplitPane);var _default=exports.default=VxeSplitPane;
|