vxe-pc-ui 3.5.2 → 3.5.4
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/list/src/list.js +3 -2
- package/es/print/src/util.js +2 -1
- package/es/split/src/split-item.js +22 -2
- package/es/split/src/split.js +241 -52
- package/es/split/style.css +75 -15
- 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 +7 -2
- package/es/ui/src/dom.js +0 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-split/style.css +75 -15
- 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 +317 -56
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +2 -1
- package/lib/list/src/list.min.js +1 -1
- package/lib/print/src/util.js +2 -1
- package/lib/print/src/util.min.js +1 -1
- package/lib/split/src/split-item.js +22 -2
- package/lib/split/src/split-item.min.js +1 -1
- package/lib/split/src/split.js +281 -48
- package/lib/split/src/split.min.js +1 -1
- package/lib/split/style/style.css +75 -15
- 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 +7 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +0 -2
- package/lib/ui/src/dom.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 +75 -15
- package/lib/vxe-split/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/list/src/list.ts +4 -2
- package/packages/print/src/util.ts +3 -1
- package/packages/split/src/split-item.ts +24 -2
- package/packages/split/src/split.ts +252 -52
- package/packages/ui/index.ts +7 -1
- package/packages/ui/src/dom.ts +0 -2
- package/styles/components/split.scss +98 -15
- package/types/components/split-item.d.ts +5 -1
- package/types/components/split.d.ts +87 -1
- package/types/ui/global-icon.d.ts +6 -0
- /package/es/icon/{iconfont.1743056503870.ttf → iconfont.1743125681770.ttf} +0 -0
- /package/es/icon/{iconfont.1743056503870.woff → iconfont.1743125681770.woff} +0 -0
- /package/es/icon/{iconfont.1743056503870.woff2 → iconfont.1743125681770.woff2} +0 -0
- /package/es/{iconfont.1743056503870.ttf → iconfont.1743125681770.ttf} +0 -0
- /package/es/{iconfont.1743056503870.woff → iconfont.1743125681770.woff} +0 -0
- /package/es/{iconfont.1743056503870.woff2 → iconfont.1743125681770.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1743056503870.ttf → iconfont.1743125681770.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1743056503870.woff → iconfont.1743125681770.woff} +0 -0
- /package/lib/icon/style/{iconfont.1743056503870.woff2 → iconfont.1743125681770.woff2} +0 -0
- /package/lib/{iconfont.1743056503870.ttf → iconfont.1743125681770.ttf} +0 -0
- /package/lib/{iconfont.1743056503870.woff → iconfont.1743125681770.woff} +0 -0
- /package/lib/{iconfont.1743056503870.woff2 → iconfont.1743125681770.woff2} +0 -0
package/lib/list/src/list.js
CHANGED
|
@@ -15,6 +15,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
15
15
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
var browseObj = _xeUtils.default.browse();
|
|
18
19
|
var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defineVxeComponent)({
|
|
19
20
|
name: 'VxeList',
|
|
20
21
|
mixins: [_ui.globalMixins.sizeMixin],
|
|
@@ -230,7 +231,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
230
231
|
if (scrollYLoad) {
|
|
231
232
|
var scrollBodyElem = $xeList.$refs.refVirtualWrapper;
|
|
232
233
|
var visibleYSize = Math.max(8, Math.ceil(scrollBodyElem.clientHeight / rowHeight));
|
|
233
|
-
var offsetYSize = sYOpts.oSize ? _xeUtils.default.toNumber(sYOpts.oSize) :
|
|
234
|
+
var offsetYSize = sYOpts.oSize ? _xeUtils.default.toNumber(sYOpts.oSize) : browseObj.edge ? 10 : 0;
|
|
234
235
|
scrollYStore.offsetSize = offsetYSize;
|
|
235
236
|
scrollYStore.visibleSize = visibleYSize;
|
|
236
237
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
package/lib/list/src/list.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperty(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);i=i.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeList",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,height:[Number,String],maxHeight:[Number,String],loading:Boolean,className:[String,Function],size:{type:String,default:function(){return(0,_ui.getConfig)().list.size||(0,_ui.getConfig)().size}},autoResize:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.autoResize}},syncResize:[Boolean,String,Number],virtualYConfig:Object,scrollY:Object},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{scrollYLoad:!1,bodyHeight:0,customHeight:0,customMaxHeight:0,parentHeight:0,topSpaceHeight:0,items:[]},internalData:{resizeObserver:void 0,fullData:[],lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0}}}},computed:Object.assign(Object.assign({},{}),{computeSYOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.virtualYConfig||(0,_ui.getConfig)().list.scrollY,this.virtualYConfig||this.scrollY)},computeStyles:function(){var t=this.reactData,e=this.height,i=this.maxHeight,r=t.customHeight,t=t.customMaxHeight,a={};return e?a.height="".concat(r,"px"):i&&(a.height="auto",a.maxHeight="".concat(t,"px")),a}}),methods:{dispatchEvent:function(t,e,i){this.$emit(t,(0,_ui.createEvent)(i,{$list:this},e))},callSlot:function(t,e,i){var r=this.$scopedSlots;return t&&(_xeUtils.default.isString(t)&&(t=r[t]||null),_xeUtils.default.isFunction(t))?(0,_vn.getSlotVNs)(t.call(this,e,i)):[]},loadData:function(t){var e=this,i=e.reactData,r=e.internalData,a=r.scrollYStore,l=e.computeSYOpts,t=t||[];return Object.assign(a,{startIndex:0,endIndex:1,visibleSize:0}),r.fullData=t,i.scrollYLoad=!!l.enabled&&-1<l.gt&&(0===l.gt||l.gt<=t.length),e.handleData(),e.computeScrollLoad().then(function(){e.refreshScroll()})},reloadData:function(t){return this.clearScroll(),this.loadData(t)},calcTableHeight:function(t){var e=this.reactData.parentHeight,t=this[t],i=0;return i=t?"100%"===t||"auto"===t?e:(i=(0,_dom.isScale)(t)?Math.floor((_xeUtils.default.toInteger(t)||1)/100*e):_xeUtils.default.toNumber(t),Math.max(40,i)):i},updateHeight:function(){var t=this.reactData;t.customHeight=this.calcTableHeight("height"),t.customMaxHeight=this.calcTableHeight("maxHeight")},updateYSpace:function(){var t=this.reactData,e=this.internalData,i=t.scrollYLoad,r=e.scrollYStore;t.bodyHeight=i?e.fullData.length*r.rowHeight:0,t.topSpaceHeight=i?Math.max(r.startIndex*r.rowHeight,0):0},handleData:function(){var t=this.reactData,e=this.internalData,i=t.scrollYLoad,r=e.fullData,e=e.scrollYStore;return t.items=i?r.slice(e.startIndex,e.endIndex):r.slice(0),this.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var o=this,n=o.reactData,s=o.internalData;return o.$nextTick().then(function(){var t,e=n.scrollYLoad,i=s.scrollYStore,r=o.$refs.refVirtualBody,a=o.computeSYOpts,l=0;(t=r?(t=a.sItem?r.querySelector(a.sItem):t)||r.children[0]:t)&&(l=t.offsetHeight),l=Math.max(12,l),i.rowHeight=l,e?(r=o.$refs.refVirtualWrapper,t=Math.max(8,Math.ceil(r.clientHeight/l)),e=a.oSize?_xeUtils.default.toNumber(a.oSize):
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperty(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);i=i.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var browseObj=_xeUtils.default.browse(),_default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeList",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,height:[Number,String],maxHeight:[Number,String],loading:Boolean,className:[String,Function],size:{type:String,default:function(){return(0,_ui.getConfig)().list.size||(0,_ui.getConfig)().size}},autoResize:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.autoResize}},syncResize:[Boolean,String,Number],virtualYConfig:Object,scrollY:Object},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{scrollYLoad:!1,bodyHeight:0,customHeight:0,customMaxHeight:0,parentHeight:0,topSpaceHeight:0,items:[]},internalData:{resizeObserver:void 0,fullData:[],lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0}}}},computed:Object.assign(Object.assign({},{}),{computeSYOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.virtualYConfig||(0,_ui.getConfig)().list.scrollY,this.virtualYConfig||this.scrollY)},computeStyles:function(){var t=this.reactData,e=this.height,i=this.maxHeight,r=t.customHeight,t=t.customMaxHeight,a={};return e?a.height="".concat(r,"px"):i&&(a.height="auto",a.maxHeight="".concat(t,"px")),a}}),methods:{dispatchEvent:function(t,e,i){this.$emit(t,(0,_ui.createEvent)(i,{$list:this},e))},callSlot:function(t,e,i){var r=this.$scopedSlots;return t&&(_xeUtils.default.isString(t)&&(t=r[t]||null),_xeUtils.default.isFunction(t))?(0,_vn.getSlotVNs)(t.call(this,e,i)):[]},loadData:function(t){var e=this,i=e.reactData,r=e.internalData,a=r.scrollYStore,l=e.computeSYOpts,t=t||[];return Object.assign(a,{startIndex:0,endIndex:1,visibleSize:0}),r.fullData=t,i.scrollYLoad=!!l.enabled&&-1<l.gt&&(0===l.gt||l.gt<=t.length),e.handleData(),e.computeScrollLoad().then(function(){e.refreshScroll()})},reloadData:function(t){return this.clearScroll(),this.loadData(t)},calcTableHeight:function(t){var e=this.reactData.parentHeight,t=this[t],i=0;return i=t?"100%"===t||"auto"===t?e:(i=(0,_dom.isScale)(t)?Math.floor((_xeUtils.default.toInteger(t)||1)/100*e):_xeUtils.default.toNumber(t),Math.max(40,i)):i},updateHeight:function(){var t=this.reactData;t.customHeight=this.calcTableHeight("height"),t.customMaxHeight=this.calcTableHeight("maxHeight")},updateYSpace:function(){var t=this.reactData,e=this.internalData,i=t.scrollYLoad,r=e.scrollYStore;t.bodyHeight=i?e.fullData.length*r.rowHeight:0,t.topSpaceHeight=i?Math.max(r.startIndex*r.rowHeight,0):0},handleData:function(){var t=this.reactData,e=this.internalData,i=t.scrollYLoad,r=e.fullData,e=e.scrollYStore;return t.items=i?r.slice(e.startIndex,e.endIndex):r.slice(0),this.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var o=this,n=o.reactData,s=o.internalData;return o.$nextTick().then(function(){var t,e=n.scrollYLoad,i=s.scrollYStore,r=o.$refs.refVirtualBody,a=o.computeSYOpts,l=0;(t=r?(t=a.sItem?r.querySelector(a.sItem):t)||r.children[0]:t)&&(l=t.offsetHeight),l=Math.max(12,l),i.rowHeight=l,e?(r=o.$refs.refVirtualWrapper,t=Math.max(8,Math.ceil(r.clientHeight/l)),e=a.oSize?_xeUtils.default.toNumber(a.oSize):browseObj.edge?10:0,i.offsetSize=e,i.visibleSize=t,i.endIndex=Math.max(i.startIndex+t+e,i.endIndex),o.updateYData()):o.updateYSpace()})},clearScroll:function(){var t=this.$refs.refVirtualWrapper;return t&&(t.scrollTop=0),this.$nextTick()},scrollTo:function(t,e){var i=this,r=i.reactData,a=i.$refs.refVirtualWrapper;return _xeUtils.default.isNumber(t)&&(a.scrollLeft=t),_xeUtils.default.isNumber(e)&&(a.scrollTop=e),r.scrollYLoad?new Promise(function(t){setTimeout(function(){i.$nextTick(function(){t()})},50)}):i.$nextTick()},refreshScroll:function(){var t=this.internalData,e=t.lastScrollLeft,i=t.lastScrollTop;return this.clearScroll().then(function(){if(e||i)return t.lastScrollLeft=0,t.lastScrollTop=0,scrollTo(e,i)})},recalculate:function(){var t=this,e=t.reactData,i=t.$refs.refElem;if(i){var r=i.parentElement;if(e.parentHeight=r?r.clientHeight:0,t.updateHeight(),i.clientWidth&&i.clientHeight)return t.computeScrollLoad()}return t.$nextTick()},loadYData:function(t){var e=this.internalData.scrollYStore,i=e.startIndex,r=e.endIndex,a=e.visibleSize,l=e.offsetSize,t=t.target.scrollTop,t=Math.floor(t/e.rowHeight),o=Math.max(0,t-1-l),l=t+a+l;!(t<=i||r-a-1<=t)||i===o&&r===l||(e.startIndex=o,e.endIndex=l,this.updateYData())},scrollEvent:function(t){var e=this.reactData,i=this.internalData,r=t.target,a=r.scrollTop,r=r.scrollLeft,l=r!==i.lastScrollLeft,o=a!==i.lastScrollTop;i.lastScrollTop=a,i.lastScrollLeft=r,e.scrollYLoad&&this.loadYData(t),this.dispatchEvent("scroll",{scrollLeft:r,scrollTop:a,isX:l,isY:o},t)},renderVN:function(t){var e=this,i=e.reactData,r=e.className,a=e.loading,l=i.bodyHeight,o=i.topSpaceHeight,i=i.items,n=e.$scopedSlots.default,s=e.computeSize,c=e.computeStyles;return t("div",{ref:"refElem",class:["vxe-list",r?_xeUtils.default.isFunction(r)?r({$list:e}):r:"",_defineProperty(_defineProperty({},"size--".concat(s),s),"is--loading",a)]},[t("div",{ref:"refVirtualWrapper",class:"vxe-list--virtual-wrapper",style:c,on:{scroll:e.scrollEvent}},[t("div",{class:"vxe-list--y-space",style:{height:l?"".concat(l,"px"):""}}),t("div",{ref:"refVirtualBody",class:"vxe-list--body",style:{marginTop:o?"".concat(o,"px"):""}},n?e.callSlot(n,{items:i},t):[])]),t(_loading.default,{class:"vxe-list--loading",props:{value:a}})])}},watch:{data:function(){this.loadData(this.data||[])},height:function(){this.recalculate()},maxHeight:function(){this.recalculate()},syncResize:function(t){var e=this;t&&(e.recalculate(),e.$nextTick(function(){return setTimeout(function(){return e.recalculate()})}))}},created:function(){this.loadData(this.data||[])},mounted:function(){var t,e=this,i=e,r=e.internalData;e.recalculate(),i.autoResize&&(i=e.$refs.refElem,(t=_ui.globalResize.create(function(){return e.recalculate()})).observe(i),i&&t.observe(i.parentElement),r.resizeObserver=t),_ui.globalEvents.on(e,"resize",e.recalculate)},activated:function(){var t=this;t.recalculate().then(function(){return t.refreshScroll()})},beforeDestroy:function(){var t=this.internalData.resizeObserver;t&&t.disconnect(),_ui.globalEvents.off(this,"resize")},render:function(t){return this.renderVN(t)}});
|
package/lib/print/src/util.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.destroyPageBreak = destroyPageBreak;
|
|
|
9
9
|
exports.printHtml = void 0;
|
|
10
10
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
var browseObj = _xeUtils.default.browse();
|
|
12
13
|
// 打印
|
|
13
14
|
var printFrame;
|
|
14
15
|
// 默认导出或打印的 HTML 样式
|
|
@@ -60,7 +61,7 @@ function handlePrint(opts) {
|
|
|
60
61
|
printHtml = createHtmlPage(opts, printHtml);
|
|
61
62
|
var blob = getExportBlobByString(printHtml, 'html');
|
|
62
63
|
return new Promise(function (resolve) {
|
|
63
|
-
if (
|
|
64
|
+
if (browseObj.msie) {
|
|
64
65
|
removeFrame();
|
|
65
66
|
printFrame = createPrintFrame();
|
|
66
67
|
appendPrintFrame();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.assemblePageBreak=assemblePageBreak,exports.createPrintFrame=createPrintFrame,exports.destroyPageBreak=destroyPageBreak,exports.printHtml=void 0;var
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.assemblePageBreak=assemblePageBreak,exports.createPrintFrame=createPrintFrame,exports.destroyPageBreak=destroyPageBreak,exports.printHtml=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var printFrame,browseObj=_xeUtils.default.browse(),defaultHtmlStyle='body{margin:0;padding:0;color:#000000;font-size:14px;font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu}body *{-webkit-box-sizing:border-box;box-sizing:border-box}.vxe-table{border-collapse:collapse;text-align:left;border-spacing:0}.vxe-table:not(.is--print){table-layout:fixed}.vxe-table,.vxe-table th,.vxe-table td,.vxe-table td{border-color:#D0D0D0;border-style:solid;border-width:0}.vxe-table.is--print{width:100%}.border--default,.border--full,.border--outer{border-top-width:1px}.border--default,.border--full,.border--outer{border-left-width:1px}.border--outer,.border--default th,.border--default td,.border--full th,.border--full td,.border--outer th,.border--inner th,.border--inner td{border-bottom-width:1px}.border--default,.border--outer,.border--full th,.border--full td{border-right-width:1px}.border--default th,.border--full th,.border--outer th{background-color:#f8f8f9}.vxe-table td>div,.vxe-table th>div{padding:.5em .4em}.col--center{text-align:center}.col--right{text-align:right}.vxe-table:not(.is--print) .col--ellipsis>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.vxe-table--tree-node{text-align:left}.vxe-table--tree-node-wrapper{position:relative}.vxe-table--tree-icon-wrapper{position:absolute;top:50%;width:1em;height:1em;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.vxe-table--tree-unfold-icon,.vxe-table--tree-fold-icon{position:absolute;width:0;height:0;border-style:solid;border-width:.5em;border-right-color:transparent;border-bottom-color:transparent}.vxe-table--tree-unfold-icon{left:.3em;top:0;border-left-color:#939599;border-top-color:transparent}.vxe-table--tree-fold-icon{left:0;top:.3em;border-left-color:transparent;border-top-color:#939599}.vxe-table--tree-cell{display:block;padding-left:1.5em}.vxe-table input[type="checkbox"]{margin:0}.vxe-table input[type="checkbox"],.vxe-table input[type="radio"],.vxe-table input[type="checkbox"]+span,.vxe-table input[type="radio"]+span{vertical-align:middle;padding-left:0.4em}';function createPrintFrame(){var e=document.createElement("iframe");return e.className="vxe-table--print-frame",e}function appendPrintFrame(){printFrame.parentNode||document.body.appendChild(printFrame)}function afterPrintEvent(){requestAnimationFrame(removeFrame)}function removeFrame(){if(printFrame){if(printFrame.parentNode){try{printFrame.contentDocument.write("")}catch(e){}printFrame.parentNode.removeChild(printFrame)}printFrame=null}}function getExportBlobByString(e,t){return new Blob([e],{type:"text/".concat(t,";charset=utf-8;")})}var printMargin=80;function createHtmlPage(e,t){var r=e.customStyle;return["<!DOCTYPE html><html>","<head>",'<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<title>".concat(e.title,"</title>"),e._pageBreaks||e.pageBreaks&&e.pageBreaks.length?'<style media="print">@page {size: auto;margin: 0mm;}</style>':"","<style>.vxe-print-slots{display: none;}.vxe-print-page-break.align--center{text-align:center;}.vxe-print-page-break.align--left{text-align:left;}.vxe-print-page-break.align--right{text-align:right;}.vxe-print-page-break--header-title{font-size:1.8em;text-align:center;line-height:".concat(printMargin,"px;}.vxe-print-page-break{page-break-before:always;display:flex;flex-direction:column;height:100vh;overflow:hidden;}.vxe-print-page-break--body{display:flex;flex-direction:row;flex-grow:1;overflow: hidden;}.vxe-print-page-break--left,.vxe-print-page-break--right{flex-shrink:0;width:").concat(printMargin,"px;height:100%;}.vxe-print-page-break--header,.vxe-print-page-break--footer{flex-shrink:0;height:").concat(printMargin,"px;width:100%;}.vxe-print-page-break--content{flex-grow: 1;overflow: hidden;}.vxe-print-page-break--footer-page-number{line-height:").concat(printMargin,"px;text-align:center;}</style>"),"<style>.vxe-table{white-space:pre;}</style>","<style>".concat(defaultHtmlStyle,"</style>"),r?"<style>".concat(r,"</style>"):"","</head>","<body>","".concat(t),"</body>","</html>"].join("")}function handlePrint(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",t=e.beforeMethod,a=getExportBlobByString(r=createHtmlPage(e,r=t?t({content:r,html:r,options:e})||"":r),"html");return new Promise(function(t){browseObj.msie?(removeFrame(),printFrame=createPrintFrame(),appendPrintFrame(),printFrame.contentDocument.write(r),printFrame.contentDocument.execCommand("print"),setTimeout(function(){t({status:!0})},300)):(printFrame||((printFrame=createPrintFrame()).onload=function(e){e.target.src&&(e.target.contentWindow.onafterprint=afterPrintEvent,e.target.contentWindow.print()),t({status:!0})},printFrame.onerror=function(){t({status:!1})}),appendPrintFrame(),printFrame.src=URL.createObjectURL(a))})}function createPageBreak(d){var c=d.title,p=d.showPageNumber,s=d.align,b=d.headerAlign,g=d.footerAlign,m=d.showAllPageTitle,e=d.pageBreaks||[],u=e.length;return e.map(function(e,t){var r=e.bodyHtml,a=e.headerHtml||d.headerHtml,n=e.footerHtml||d.footerHtml,i=e.leftHtml||d.leftHtml,e=e.rightHtml||d.rightHtml,o=t+1,l={currentPage:o,pageCount:u};return['<div class="'.concat(["vxe-print-page-break",s?"align--".concat(s):""].join(" "),'">'),'<div class="'.concat(["vxe-print-page-break--header",b?"align--".concat(b):""].join(" "),'">'),a?"".concat(_xeUtils.default.isFunction(a)?a(l):a||""):!c||!m&&t?"":'<div class="vxe-print-page-break--header-title">'.concat(c||"","</div>"),"</div>",'<div class="vxe-print-page-break--body">','<div class="vxe-print-page-break--left">'.concat(_xeUtils.default.isFunction(i)?i(l):i||"","</div>"),'<div class="vxe-print-page-break--content">'.concat(_xeUtils.default.isFunction(r)?r(l):r||"","</div>"),'<div class="vxe-print-page-break--right">'.concat(_xeUtils.default.isFunction(e)?e(l):e||"","</div>"),"</div>",'<div class="'.concat(["vxe-print-page-break--footer",g?"align--".concat(g):""].join(" "),'">'),n?"".concat(_xeUtils.default.isFunction(n)?n(l):n||""):p?'<div class="vxe-print-page-break--footer-page-number">'.concat(o,"/").concat(u,"</div>"):"","</div>","</div>"].join("")}).join("")}var printHtml=exports.printHtml=function(e){e=Object.assign({_pageBreaks:!1,customLayout:!0},e);return e.sheetName&&(e.title=e.title||e.sheetName),e.style&&(e.customStyle=e.customStyle||e.style),e.beforePrintMethod&&(e.beforeMethod=e.beforeMethod||e.beforePrintMethod),e.pageBreaks&&e.pageBreaks.length?handlePrint(e,createPageBreak(e)):handlePrint(e,e.html||e.content)};function assemblePageBreak(e,t,r){var a=e.reactData.staticPageBreaks,n=t.parentNode;n&&a&&(a.splice(_xeUtils.default.arrayIndexOf(n.children,t),0,r),e.reactData.staticPageBreaks=a.slice(0))}function destroyPageBreak(e,t){e.reactData.staticPageBreaks=e.reactData.staticPageBreaks.filter(function(e){return e.id!==t.id})}
|
|
@@ -13,8 +13,10 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
13
13
|
name: 'VxeSplitItem',
|
|
14
14
|
mixins: [_ui.globalMixins.sizeMixin],
|
|
15
15
|
props: {
|
|
16
|
+
name: [Number, String],
|
|
16
17
|
width: [Number, String],
|
|
17
18
|
height: [Number, String],
|
|
19
|
+
showAction: Boolean,
|
|
18
20
|
minWidth: {
|
|
19
21
|
type: [Number, String],
|
|
20
22
|
default: function _default() {
|
|
@@ -44,12 +46,20 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
44
46
|
var reactData = {};
|
|
45
47
|
var chunkConfig = {
|
|
46
48
|
id: xID,
|
|
49
|
+
name: '',
|
|
47
50
|
width: 0,
|
|
48
51
|
height: 0,
|
|
49
52
|
minWidth: 0,
|
|
50
53
|
minHeight: 0,
|
|
54
|
+
showAction: false,
|
|
55
|
+
isVisible: true,
|
|
56
|
+
isExpand: true,
|
|
51
57
|
renderWidth: 0,
|
|
58
|
+
resizeWidth: 0,
|
|
59
|
+
foldWidth: 0,
|
|
52
60
|
renderHeight: 0,
|
|
61
|
+
resizeHeight: 0,
|
|
62
|
+
foldHeight: 0,
|
|
53
63
|
slots: {}
|
|
54
64
|
};
|
|
55
65
|
return {
|
|
@@ -60,6 +70,11 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
60
70
|
},
|
|
61
71
|
computed: Object.assign({}, {}),
|
|
62
72
|
watch: {
|
|
73
|
+
name: function name(val) {
|
|
74
|
+
var $xeSplitItem = this;
|
|
75
|
+
var chunkConfig = $xeSplitItem.chunkConfig;
|
|
76
|
+
chunkConfig.name = val;
|
|
77
|
+
},
|
|
63
78
|
width: function width(val) {
|
|
64
79
|
var $xeSplitItem = this;
|
|
65
80
|
var chunkConfig = $xeSplitItem.chunkConfig;
|
|
@@ -79,6 +94,11 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
79
94
|
var $xeSplitItem = this;
|
|
80
95
|
var chunkConfig = $xeSplitItem.chunkConfig;
|
|
81
96
|
chunkConfig.minHeight = val;
|
|
97
|
+
},
|
|
98
|
+
showAction: function showAction(val) {
|
|
99
|
+
var $xeSplitItem = this;
|
|
100
|
+
var chunkConfig = $xeSplitItem.chunkConfig;
|
|
101
|
+
chunkConfig.showAction = val;
|
|
82
102
|
}
|
|
83
103
|
},
|
|
84
104
|
methods: {
|
|
@@ -106,12 +126,12 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
106
126
|
var slots = $xeSplitItem.$scopedSlots;
|
|
107
127
|
var chunkConfig = $xeSplitItem.chunkConfig;
|
|
108
128
|
Object.assign(chunkConfig, {
|
|
129
|
+
name: props.name,
|
|
109
130
|
width: props.width,
|
|
110
131
|
height: props.height,
|
|
111
132
|
minWidth: props.minWidth,
|
|
112
133
|
minHeight: props.minHeight,
|
|
113
|
-
|
|
114
|
-
renderHeight: 0,
|
|
134
|
+
showAction: props.showAction,
|
|
115
135
|
slots: slots
|
|
116
136
|
});
|
|
117
137
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_ui=require("../../ui"),_util=require("./util"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_ui=require("../../ui"),_util=require("./util"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(i){return i&&i.__esModule?i:{default:i}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeSplitItem",mixins:[_ui.globalMixins.sizeMixin],props:{name:[Number,String],width:[Number,String],height:[Number,String],showAction:Boolean,minWidth:{type:[Number,String],default:function(){return null}},minHeight:{type:[Number,String],default:function(){return null}}},inject:{$xeSplit:{default:null}},provide:function(){return{$xeSplitItem:this}},data:function(){var i=_xeUtils.default.uniqueId();return{xID:i,reactData:{},chunkConfig:{id:i,name:"",width:0,height:0,minWidth:0,minHeight:0,showAction:!1,isVisible:!0,isExpand:!0,renderWidth:0,resizeWidth:0,foldWidth:0,renderHeight:0,resizeHeight:0,foldHeight:0,slots:{}}}},computed:Object.assign({},{}),watch:{name:function(i){this.chunkConfig.name=i},width:function(i){this.chunkConfig.width=i},height:function(i){this.chunkConfig.height=i},minWidth:function(i){this.chunkConfig.minWidth=i},minHeight:function(i){this.chunkConfig.minHeight=i},showAction:function(i){this.chunkConfig.showAction=i}},methods:{dispatchEvent:function(i,t,e){this.$emit(i,(0,_ui.createEvent)(e,{$splitItem:this},t))},renderVN:function(i){return i("div",{ref:"refElem"})}},created:function(){var i=this,t=i.$scopedSlots;Object.assign(i.chunkConfig,{name:i.name,width:i.width,height:i.height,minWidth:i.minWidth,minHeight:i.minHeight,showAction:i.showAction,slots:t})},mounted:function(){var i=this,t=i.$scopedSlots,e=i.chunkConfig,n=i.$xeSplit,t=(e.slots=t,i.$refs.refElem);n&&t&&(0,_util.assembleSplitItem)(n,t,e)},beforeDestroy:function(){var i=this.chunkConfig,t=this.$xeSplit;t&&(0,_util.destroySplitItem)(t,i)},render:function(i){return this.renderVN(i)}});
|
package/lib/split/src/split.js
CHANGED
|
@@ -35,7 +35,9 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
35
35
|
return (0, _ui.getConfig)().split.padding;
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
itemConfig: Object
|
|
38
|
+
itemConfig: Object,
|
|
39
|
+
barConfig: Object,
|
|
40
|
+
actionConfig: Object
|
|
39
41
|
},
|
|
40
42
|
data: function data() {
|
|
41
43
|
var xID = _xeUtils.default.uniqueId();
|
|
@@ -60,6 +62,35 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
60
62
|
var $xeSplit = this;
|
|
61
63
|
var props = $xeSplit;
|
|
62
64
|
return Object.assign({}, (0, _ui.getConfig)().split.itemConfig, props.itemConfig);
|
|
65
|
+
},
|
|
66
|
+
computeBarOpts: function computeBarOpts() {
|
|
67
|
+
var $xeSplit = this;
|
|
68
|
+
var props = $xeSplit;
|
|
69
|
+
return Object.assign({}, (0, _ui.getConfig)().split.barConfig, props.barConfig);
|
|
70
|
+
},
|
|
71
|
+
computeActionOpts: function computeActionOpts() {
|
|
72
|
+
var $xeSplit = this;
|
|
73
|
+
var props = $xeSplit;
|
|
74
|
+
return Object.assign({}, (0, _ui.getConfig)().split.actionConfig, props.actionConfig);
|
|
75
|
+
},
|
|
76
|
+
computeIsFoldNext: function computeIsFoldNext() {
|
|
77
|
+
var $xeSplit = this;
|
|
78
|
+
var actionOpts = $xeSplit.computeActionOpts;
|
|
79
|
+
return actionOpts.direction === 'next';
|
|
80
|
+
},
|
|
81
|
+
computeBarStyle: function computeBarStyle() {
|
|
82
|
+
var $xeSplit = this;
|
|
83
|
+
var barOpts = $xeSplit.computeBarOpts;
|
|
84
|
+
var width = barOpts.width,
|
|
85
|
+
height = barOpts.height;
|
|
86
|
+
var stys = {};
|
|
87
|
+
if (height) {
|
|
88
|
+
stys.height = (0, _dom.toCssUnit)(height);
|
|
89
|
+
}
|
|
90
|
+
if (width) {
|
|
91
|
+
stys.width = (0, _dom.toCssUnit)(width);
|
|
92
|
+
}
|
|
93
|
+
return stys;
|
|
63
94
|
}
|
|
64
95
|
}),
|
|
65
96
|
methods: {
|
|
@@ -85,6 +116,20 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
85
116
|
}
|
|
86
117
|
return [];
|
|
87
118
|
},
|
|
119
|
+
reset: function reset() {
|
|
120
|
+
var $xeSplit = this;
|
|
121
|
+
var reactData = $xeSplit.reactData;
|
|
122
|
+
var staticItems = reactData.staticItems;
|
|
123
|
+
staticItems.forEach(function (item) {
|
|
124
|
+
item.isExpand = true;
|
|
125
|
+
item.isVisible = true;
|
|
126
|
+
item.foldHeight = 0;
|
|
127
|
+
item.foldWidth = 0;
|
|
128
|
+
item.resizeHeight = 0;
|
|
129
|
+
item.resizeWidth = 0;
|
|
130
|
+
});
|
|
131
|
+
return $xeSplit.$nextTick();
|
|
132
|
+
},
|
|
88
133
|
recalculate: function recalculate() {
|
|
89
134
|
var $xeSplit = this;
|
|
90
135
|
var props = $xeSplit;
|
|
@@ -161,12 +206,13 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
161
206
|
evnt.preventDefault();
|
|
162
207
|
var vertical = props.vertical;
|
|
163
208
|
var staticItems = reactData.staticItems;
|
|
164
|
-
var
|
|
209
|
+
var barEl = evnt.currentTarget;
|
|
210
|
+
var handleEl = barEl.parentElement;
|
|
165
211
|
var el = $xeSplit.$refs.refElem;
|
|
166
212
|
if (!el) {
|
|
167
213
|
return;
|
|
168
214
|
}
|
|
169
|
-
var itemId = handleEl.getAttribute('
|
|
215
|
+
var itemId = handleEl.getAttribute('itemid');
|
|
170
216
|
var itemIndex = _xeUtils.default.findIndexOf(staticItems, function (item) {
|
|
171
217
|
return item.id === itemId;
|
|
172
218
|
});
|
|
@@ -174,19 +220,23 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
174
220
|
if (!item) {
|
|
175
221
|
return;
|
|
176
222
|
}
|
|
223
|
+
if (!item.isExpand) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
177
227
|
var itemOpts = $xeSplit.computeItemOpts;
|
|
178
228
|
var allMinWidth = _xeUtils.default.toNumber(itemOpts.minWidth);
|
|
179
229
|
var allMinHeight = _xeUtils.default.toNumber(itemOpts.minHeight);
|
|
180
|
-
var
|
|
181
|
-
var
|
|
182
|
-
var currItemEl = item ? el.querySelector(".vxe-split-item[
|
|
183
|
-
var
|
|
230
|
+
var targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)];
|
|
231
|
+
var targetItemEl = targetItem ? el.querySelector(".vxe-split-item[itemid=\"".concat(targetItem.id, "\"]")) : null;
|
|
232
|
+
var currItemEl = item ? el.querySelector(".vxe-split-item[itemid=\"".concat(item.id, "\"]")) : null;
|
|
233
|
+
var targetWidth = targetItemEl ? targetItemEl.clientWidth : 0;
|
|
184
234
|
var currWidth = currItemEl ? currItemEl.clientWidth : 0;
|
|
185
|
-
var
|
|
235
|
+
var targetHeight = targetItemEl ? targetItemEl.clientHeight : 0;
|
|
186
236
|
var currHeight = currItemEl ? currItemEl.clientHeight : 0;
|
|
187
|
-
var
|
|
237
|
+
var targetMinWidth = _xeUtils.default.toNumber(targetItem ? (0, _utils.getGlobalDefaultConfig)(targetItem.minWidth, allMinWidth) : allMinWidth);
|
|
188
238
|
var currMinWidth = _xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minWidth, allMinWidth));
|
|
189
|
-
var
|
|
239
|
+
var targetMinHeight = _xeUtils.default.toNumber(targetItem ? (0, _utils.getGlobalDefaultConfig)(targetItem.minHeight, allMinHeight) : allMinHeight);
|
|
190
240
|
var currMinHeight = _xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minHeight, allMinHeight));
|
|
191
241
|
var disX = evnt.clientX;
|
|
192
242
|
var disY = evnt.clientY;
|
|
@@ -194,50 +244,216 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
194
244
|
document.onmousemove = function (evnt) {
|
|
195
245
|
evnt.preventDefault();
|
|
196
246
|
if (vertical) {
|
|
197
|
-
var offsetTop = evnt.clientY - disY;
|
|
247
|
+
var offsetTop = isFoldNext ? disY - evnt.clientY : evnt.clientY - disY;
|
|
198
248
|
if (offsetTop > 0) {
|
|
199
|
-
if (
|
|
249
|
+
if (targetItem) {
|
|
200
250
|
if (currHeight - offsetTop >= currMinHeight) {
|
|
201
|
-
|
|
202
|
-
|
|
251
|
+
var reHeight = currHeight - offsetTop;
|
|
252
|
+
targetItem.resizeHeight = targetHeight + offsetTop;
|
|
253
|
+
item.resizeHeight = reHeight;
|
|
254
|
+
$xeSplit.dispatchEvent('resize-drag', {
|
|
255
|
+
item: item,
|
|
256
|
+
name: item.name,
|
|
257
|
+
offsetHeight: offsetTop,
|
|
258
|
+
resizeHeight: reHeight,
|
|
259
|
+
offsetWidth: 0,
|
|
260
|
+
resizeWidth: 0
|
|
261
|
+
}, evnt);
|
|
203
262
|
}
|
|
204
263
|
}
|
|
205
264
|
} else {
|
|
206
|
-
if (
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
|
|
265
|
+
if (targetItem) {
|
|
266
|
+
if (targetHeight + offsetTop >= targetMinHeight) {
|
|
267
|
+
var _reHeight = currHeight - offsetTop;
|
|
268
|
+
targetItem.resizeHeight = targetHeight + offsetTop;
|
|
269
|
+
item.resizeHeight = _reHeight;
|
|
270
|
+
$xeSplit.dispatchEvent('resize-drag', {
|
|
271
|
+
item: item,
|
|
272
|
+
name: item.name,
|
|
273
|
+
offsetHeight: offsetTop,
|
|
274
|
+
resizeHeight: _reHeight,
|
|
275
|
+
offsetWidth: 0,
|
|
276
|
+
resizeWidth: 0
|
|
277
|
+
}, evnt);
|
|
210
278
|
}
|
|
211
279
|
}
|
|
212
280
|
}
|
|
213
281
|
} else {
|
|
214
|
-
var offsetLeft = evnt.clientX - disX;
|
|
282
|
+
var offsetLeft = isFoldNext ? disX - evnt.clientX : evnt.clientX - disX;
|
|
215
283
|
if (offsetLeft > 0) {
|
|
216
|
-
if (
|
|
284
|
+
if (targetItem) {
|
|
217
285
|
if (currWidth - offsetLeft >= currMinWidth) {
|
|
218
|
-
|
|
219
|
-
|
|
286
|
+
var reWidth = currWidth - offsetLeft;
|
|
287
|
+
targetItem.resizeWidth = targetWidth + offsetLeft;
|
|
288
|
+
item.resizeWidth = reWidth;
|
|
289
|
+
$xeSplit.dispatchEvent('resize-drag', {
|
|
290
|
+
item: item,
|
|
291
|
+
name: item.name,
|
|
292
|
+
offsetHeight: 0,
|
|
293
|
+
resizeHeight: 0,
|
|
294
|
+
offsetWidth: offsetLeft,
|
|
295
|
+
resizeWidth: reWidth
|
|
296
|
+
}, evnt);
|
|
220
297
|
}
|
|
221
298
|
}
|
|
222
299
|
} else {
|
|
223
|
-
if (
|
|
224
|
-
if (
|
|
225
|
-
|
|
226
|
-
|
|
300
|
+
if (targetItem) {
|
|
301
|
+
if (targetWidth + offsetLeft >= targetMinWidth) {
|
|
302
|
+
var _reWidth = currWidth - offsetLeft;
|
|
303
|
+
targetItem.resizeWidth = targetWidth + offsetLeft;
|
|
304
|
+
item.resizeWidth = _reWidth;
|
|
305
|
+
$xeSplit.dispatchEvent('resize-drag', {
|
|
306
|
+
item: item,
|
|
307
|
+
name: item.name,
|
|
308
|
+
offsetHeight: 0,
|
|
309
|
+
resizeHeight: 0,
|
|
310
|
+
offsetWidth: offsetLeft,
|
|
311
|
+
resizeWidth: _reWidth
|
|
312
|
+
}, evnt);
|
|
227
313
|
}
|
|
228
314
|
}
|
|
229
315
|
}
|
|
230
316
|
}
|
|
231
317
|
};
|
|
232
|
-
document.onmouseup = function () {
|
|
318
|
+
document.onmouseup = function (evnt) {
|
|
233
319
|
document.onmousemove = null;
|
|
234
320
|
document.onmouseup = null;
|
|
235
321
|
(0, _dom.removeClass)(el, 'is--drag');
|
|
322
|
+
$xeSplit.dispatchEvent('resize-end', {
|
|
323
|
+
item: item,
|
|
324
|
+
name: item.name,
|
|
325
|
+
resizeHeight: item.resizeHeight,
|
|
326
|
+
resizeWidth: item.resizeWidth
|
|
327
|
+
}, evnt);
|
|
328
|
+
$xeSplit.recalculate();
|
|
236
329
|
};
|
|
330
|
+
$xeSplit.dispatchEvent('resize-start', {
|
|
331
|
+
item: item,
|
|
332
|
+
name: item.name
|
|
333
|
+
}, evnt);
|
|
334
|
+
},
|
|
335
|
+
handleItemActionEvent: function handleItemActionEvent(evnt) {
|
|
336
|
+
var $xeSplit = this;
|
|
337
|
+
var props = $xeSplit;
|
|
338
|
+
var reactData = $xeSplit.reactData;
|
|
339
|
+
var el = $xeSplit.$refs.refElem;
|
|
340
|
+
if (!el) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
var vertical = props.vertical;
|
|
344
|
+
var staticItems = reactData.staticItems;
|
|
345
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
346
|
+
var btnEl = evnt.currentTarget;
|
|
347
|
+
var handleEl = btnEl.parentElement;
|
|
348
|
+
var itemId = handleEl.getAttribute('itemid');
|
|
349
|
+
var itemIndex = _xeUtils.default.findIndexOf(staticItems, function (item) {
|
|
350
|
+
return item.id === itemId;
|
|
351
|
+
});
|
|
352
|
+
var item = staticItems[itemIndex];
|
|
353
|
+
var targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)];
|
|
354
|
+
if (item) {
|
|
355
|
+
var showAction = item.showAction,
|
|
356
|
+
isExpand = item.isExpand;
|
|
357
|
+
if (showAction) {
|
|
358
|
+
if (vertical) {
|
|
359
|
+
if (targetItem) {
|
|
360
|
+
targetItem.isVisible = !isExpand;
|
|
361
|
+
targetItem.foldHeight = 0;
|
|
362
|
+
item.isExpand = !isExpand;
|
|
363
|
+
item.isVisible = true;
|
|
364
|
+
item.foldHeight = isExpand ? (targetItem.resizeHeight || targetItem.renderHeight) + (item.resizeHeight || item.renderHeight) : 0;
|
|
365
|
+
}
|
|
366
|
+
} else {
|
|
367
|
+
if (targetItem) {
|
|
368
|
+
targetItem.isVisible = !isExpand;
|
|
369
|
+
targetItem.foldWidth = 0;
|
|
370
|
+
item.isExpand = !isExpand;
|
|
371
|
+
item.isVisible = true;
|
|
372
|
+
item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
$xeSplit.dispatchEvent(evnt.type === 'dblclick' ? 'action-dblclick' : 'action-click', {
|
|
376
|
+
item: item,
|
|
377
|
+
name: item.name,
|
|
378
|
+
targetItem: targetItem,
|
|
379
|
+
targetName: targetItem ? targetItem.name : '',
|
|
380
|
+
expanded: item.isExpand
|
|
381
|
+
}, evnt);
|
|
382
|
+
$xeSplit.recalculate();
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
handleGlobalResizeEvent: function handleGlobalResizeEvent() {
|
|
387
|
+
var $xeSplit = this;
|
|
388
|
+
$xeSplit.recalculate();
|
|
389
|
+
},
|
|
390
|
+
getDefaultActionIcon: function getDefaultActionIcon(item) {
|
|
391
|
+
var $xeSplit = this;
|
|
392
|
+
var props = $xeSplit;
|
|
393
|
+
var vertical = props.vertical;
|
|
394
|
+
var showAction = item.showAction,
|
|
395
|
+
isExpand = item.isExpand;
|
|
396
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
397
|
+
var topIcon = 'SPLIT_TOP_ACTION';
|
|
398
|
+
var bottomIcon = 'SPLIT_BOTTOM_ACTION';
|
|
399
|
+
var leftIcon = 'SPLIT_LEFT_ACTION';
|
|
400
|
+
var rightIcon = 'SPLIT_RIGHT_ACTION';
|
|
401
|
+
if (showAction) {
|
|
402
|
+
var iconName = '';
|
|
403
|
+
if (isFoldNext) {
|
|
404
|
+
if (vertical) {
|
|
405
|
+
iconName = isExpand ? bottomIcon : topIcon;
|
|
406
|
+
} else {
|
|
407
|
+
iconName = isExpand ? rightIcon : leftIcon;
|
|
408
|
+
}
|
|
409
|
+
} else {
|
|
410
|
+
if (vertical) {
|
|
411
|
+
iconName = isExpand ? topIcon : bottomIcon;
|
|
412
|
+
} else {
|
|
413
|
+
iconName = isExpand ? leftIcon : rightIcon;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
if (iconName) {
|
|
417
|
+
return (0, _ui.getIcon)()[iconName];
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return '';
|
|
237
421
|
},
|
|
238
422
|
//
|
|
239
423
|
// Render
|
|
240
424
|
//
|
|
425
|
+
renderHandleBar: function renderHandleBar(h, item) {
|
|
426
|
+
var $xeSplit = this;
|
|
427
|
+
var barStyle = $xeSplit.computeBarStyle;
|
|
428
|
+
var actionOpts = $xeSplit.computeActionOpts;
|
|
429
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
430
|
+
var id = item.id,
|
|
431
|
+
isExpand = item.isExpand,
|
|
432
|
+
showAction = item.showAction;
|
|
433
|
+
var btnOns = {};
|
|
434
|
+
if (actionOpts.trigger === 'dblclick') {
|
|
435
|
+
btnOns.dblclick = $xeSplit.handleItemActionEvent;
|
|
436
|
+
} else {
|
|
437
|
+
btnOns.click = $xeSplit.handleItemActionEvent;
|
|
438
|
+
}
|
|
439
|
+
return h('div', {
|
|
440
|
+
attrs: {
|
|
441
|
+
itemid: id
|
|
442
|
+
},
|
|
443
|
+
class: ['vxe-split-item-handle', isFoldNext ? 'to--next' : 'to--prev']
|
|
444
|
+
}, [h('div', {
|
|
445
|
+
class: 'vxe-split-item-handle-bar',
|
|
446
|
+
style: barStyle,
|
|
447
|
+
on: {
|
|
448
|
+
mousedown: $xeSplit.dragEvent
|
|
449
|
+
}
|
|
450
|
+
}), showAction ? h('span', {
|
|
451
|
+
class: 'vxe-split-item-action-btn',
|
|
452
|
+
on: btnOns
|
|
453
|
+
}, [h('i', {
|
|
454
|
+
class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || $xeSplit.getDefaultActionIcon(item)
|
|
455
|
+
})]) : (0, _ui.renderEmptyElement)($xeSplit)]);
|
|
456
|
+
},
|
|
241
457
|
renderItems: function renderItems(h) {
|
|
242
458
|
var $xeSplit = this;
|
|
243
459
|
var props = $xeSplit;
|
|
@@ -246,52 +462,55 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
246
462
|
padding = props.padding,
|
|
247
463
|
vertical = props.vertical;
|
|
248
464
|
var staticItems = reactData.staticItems;
|
|
465
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
249
466
|
var itemVNs = [];
|
|
250
467
|
staticItems.forEach(function (item, index) {
|
|
251
468
|
var id = item.id,
|
|
252
469
|
slots = item.slots,
|
|
253
470
|
renderHeight = item.renderHeight,
|
|
254
|
-
|
|
471
|
+
resizeHeight = item.resizeHeight,
|
|
472
|
+
foldHeight = item.foldHeight,
|
|
473
|
+
renderWidth = item.renderWidth,
|
|
474
|
+
resizeWidth = item.resizeWidth,
|
|
475
|
+
foldWidth = item.foldWidth,
|
|
476
|
+
isVisible = item.isVisible,
|
|
477
|
+
isExpand = item.isExpand;
|
|
255
478
|
var defaultSlot = slots ? slots.default : null;
|
|
256
479
|
var stys = {};
|
|
480
|
+
var itemWidth = isVisible ? foldWidth || resizeWidth || renderWidth : 0;
|
|
481
|
+
var itemHeight = isVisible ? foldHeight || resizeHeight || renderHeight : 0;
|
|
257
482
|
if (vertical) {
|
|
258
|
-
if (
|
|
259
|
-
stys.height = (0, _dom.toCssUnit)(
|
|
483
|
+
if (itemHeight) {
|
|
484
|
+
stys.height = (0, _dom.toCssUnit)(itemHeight);
|
|
260
485
|
}
|
|
261
486
|
} else {
|
|
262
|
-
if (
|
|
263
|
-
stys.width = (0, _dom.toCssUnit)(
|
|
487
|
+
if (itemWidth) {
|
|
488
|
+
stys.width = (0, _dom.toCssUnit)(itemWidth);
|
|
264
489
|
}
|
|
265
490
|
}
|
|
266
491
|
itemVNs.push(h('div', {
|
|
267
492
|
attrs: {
|
|
268
|
-
|
|
493
|
+
itemid: id
|
|
269
494
|
},
|
|
270
495
|
class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
|
|
271
496
|
'is--padding': padding,
|
|
272
497
|
'is--border': border,
|
|
273
|
-
'is--height':
|
|
274
|
-
'is--width':
|
|
275
|
-
'is--fill': !
|
|
276
|
-
'is--handle': index > 0
|
|
498
|
+
'is--height': itemHeight,
|
|
499
|
+
'is--width': itemWidth,
|
|
500
|
+
'is--fill': isVisible && !itemHeight && !itemWidth,
|
|
501
|
+
'is--handle': index > 0,
|
|
502
|
+
'is--expand': isExpand,
|
|
503
|
+
'is--hidden': !isVisible
|
|
277
504
|
}],
|
|
278
505
|
style: stys
|
|
279
|
-
}, [index ? h('div', {
|
|
506
|
+
}, [index && !isFoldNext ? $xeSplit.renderHandleBar(h, item) : (0, _ui.renderEmptyElement)($xeSplit), h('div', {
|
|
280
507
|
attrs: {
|
|
281
|
-
|
|
282
|
-
},
|
|
283
|
-
class: 'vxe-split-item-handle',
|
|
284
|
-
on: {
|
|
285
|
-
mousedown: $xeSplit.dragEvent
|
|
286
|
-
}
|
|
287
|
-
}) : (0, _ui.renderEmptyElement)($xeSplit), h('div', {
|
|
288
|
-
attrs: {
|
|
289
|
-
xid: id
|
|
508
|
+
itemid: id
|
|
290
509
|
},
|
|
291
510
|
class: 'vxe-split-item--wrapper'
|
|
292
511
|
}, [h('div', {
|
|
293
512
|
class: 'vxe-split-item--inner'
|
|
294
|
-
}, defaultSlot ? $xeSplit.callSlot(defaultSlot, {}) : [])])]));
|
|
513
|
+
}, defaultSlot ? $xeSplit.callSlot(defaultSlot, {}) : [])]), isFoldNext && index < staticItems.length - 1 ? $xeSplit.renderHandleBar(h, item) : (0, _ui.renderEmptyElement)($xeSplit)]));
|
|
295
514
|
});
|
|
296
515
|
return h('div', {
|
|
297
516
|
class: 'vxe-split-wrapper'
|
|
@@ -321,6 +540,20 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
321
540
|
}, defaultSlot ? defaultSlot({}) : []), $xeSplit.renderItems(h)]);
|
|
322
541
|
}
|
|
323
542
|
},
|
|
543
|
+
created: function created() {
|
|
544
|
+
var $xeSplit = this;
|
|
545
|
+
_ui.globalEvents.on($xeSplit, 'resize', $xeSplit.handleGlobalResizeEvent);
|
|
546
|
+
},
|
|
547
|
+
mounted: function mounted() {
|
|
548
|
+
var $xeSplit = this;
|
|
549
|
+
$xeSplit.$nextTick(function () {
|
|
550
|
+
$xeSplit.recalculate();
|
|
551
|
+
});
|
|
552
|
+
},
|
|
553
|
+
beforeDestroy: function beforeDestroy() {
|
|
554
|
+
var $xeSplit = this;
|
|
555
|
+
_ui.globalEvents.off($xeSplit, 'resize');
|
|
556
|
+
},
|
|
324
557
|
render: function render(h) {
|
|
325
558
|
return this.renderVN(h);
|
|
326
559
|
}
|