vxe-pc-ui 3.5.2 → 3.5.3
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 +225 -52
- package/es/split/style.css +74 -14
- 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 +6 -1
- package/es/ui/src/dom.js +0 -1
- package/es/vxe-split/style.css +74 -14
- 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 +299 -54
- 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 +265 -48
- package/lib/split/src/split.min.js +1 -1
- package/lib/split/style/style.css +74 -14
- 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 +6 -1
- 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/vxe-split/style/style.css +74 -14
- 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 +235 -52
- package/packages/ui/index.ts +7 -1
- package/packages/ui/src/dom.ts +0 -2
- package/styles/components/split.scss +97 -14
- package/types/components/split-item.d.ts +5 -1
- package/types/components/split.d.ts +86 -1
- package/types/ui/global-icon.d.ts +6 -0
- /package/es/icon/{iconfont.1743056503870.ttf → iconfont.1743080331925.ttf} +0 -0
- /package/es/icon/{iconfont.1743056503870.woff → iconfont.1743080331925.woff} +0 -0
- /package/es/icon/{iconfont.1743056503870.woff2 → iconfont.1743080331925.woff2} +0 -0
- /package/es/{iconfont.1743056503870.ttf → iconfont.1743080331925.ttf} +0 -0
- /package/es/{iconfont.1743056503870.woff → iconfont.1743080331925.woff} +0 -0
- /package/es/{iconfont.1743056503870.woff2 → iconfont.1743080331925.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1743056503870.ttf → iconfont.1743080331925.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1743056503870.woff → iconfont.1743080331925.woff} +0 -0
- /package/lib/icon/style/{iconfont.1743056503870.woff2 → iconfont.1743080331925.woff2} +0 -0
- /package/lib/{iconfont.1743056503870.ttf → iconfont.1743080331925.ttf} +0 -0
- /package/lib/{iconfont.1743056503870.woff → iconfont.1743080331925.woff} +0 -0
- /package/lib/{iconfont.1743056503870.woff2 → iconfont.1743080331925.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: {
|
|
@@ -161,12 +192,13 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
161
192
|
evnt.preventDefault();
|
|
162
193
|
var vertical = props.vertical;
|
|
163
194
|
var staticItems = reactData.staticItems;
|
|
164
|
-
var
|
|
195
|
+
var barEl = evnt.currentTarget;
|
|
196
|
+
var handleEl = barEl.parentElement;
|
|
165
197
|
var el = $xeSplit.$refs.refElem;
|
|
166
198
|
if (!el) {
|
|
167
199
|
return;
|
|
168
200
|
}
|
|
169
|
-
var itemId = handleEl.getAttribute('
|
|
201
|
+
var itemId = handleEl.getAttribute('itemid');
|
|
170
202
|
var itemIndex = _xeUtils.default.findIndexOf(staticItems, function (item) {
|
|
171
203
|
return item.id === itemId;
|
|
172
204
|
});
|
|
@@ -174,19 +206,23 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
174
206
|
if (!item) {
|
|
175
207
|
return;
|
|
176
208
|
}
|
|
209
|
+
if (!item.isExpand) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
177
213
|
var itemOpts = $xeSplit.computeItemOpts;
|
|
178
214
|
var allMinWidth = _xeUtils.default.toNumber(itemOpts.minWidth);
|
|
179
215
|
var allMinHeight = _xeUtils.default.toNumber(itemOpts.minHeight);
|
|
180
|
-
var
|
|
181
|
-
var
|
|
182
|
-
var currItemEl = item ? el.querySelector(".vxe-split-item[
|
|
183
|
-
var
|
|
216
|
+
var targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)];
|
|
217
|
+
var targetItemEl = targetItem ? el.querySelector(".vxe-split-item[itemid=\"".concat(targetItem.id, "\"]")) : null;
|
|
218
|
+
var currItemEl = item ? el.querySelector(".vxe-split-item[itemid=\"".concat(item.id, "\"]")) : null;
|
|
219
|
+
var targetWidth = targetItemEl ? targetItemEl.clientWidth : 0;
|
|
184
220
|
var currWidth = currItemEl ? currItemEl.clientWidth : 0;
|
|
185
|
-
var
|
|
221
|
+
var targetHeight = targetItemEl ? targetItemEl.clientHeight : 0;
|
|
186
222
|
var currHeight = currItemEl ? currItemEl.clientHeight : 0;
|
|
187
|
-
var
|
|
223
|
+
var targetMinWidth = _xeUtils.default.toNumber(targetItem ? (0, _utils.getGlobalDefaultConfig)(targetItem.minWidth, allMinWidth) : allMinWidth);
|
|
188
224
|
var currMinWidth = _xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minWidth, allMinWidth));
|
|
189
|
-
var
|
|
225
|
+
var targetMinHeight = _xeUtils.default.toNumber(targetItem ? (0, _utils.getGlobalDefaultConfig)(targetItem.minHeight, allMinHeight) : allMinHeight);
|
|
190
226
|
var currMinHeight = _xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minHeight, allMinHeight));
|
|
191
227
|
var disX = evnt.clientX;
|
|
192
228
|
var disY = evnt.clientY;
|
|
@@ -194,50 +230,214 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
194
230
|
document.onmousemove = function (evnt) {
|
|
195
231
|
evnt.preventDefault();
|
|
196
232
|
if (vertical) {
|
|
197
|
-
var offsetTop = evnt.clientY - disY;
|
|
233
|
+
var offsetTop = isFoldNext ? disY - evnt.clientY : evnt.clientY - disY;
|
|
198
234
|
if (offsetTop > 0) {
|
|
199
|
-
if (
|
|
235
|
+
if (targetItem) {
|
|
200
236
|
if (currHeight - offsetTop >= currMinHeight) {
|
|
201
|
-
|
|
202
|
-
|
|
237
|
+
var reHeight = currHeight - offsetTop;
|
|
238
|
+
targetItem.resizeHeight = targetHeight + offsetTop;
|
|
239
|
+
item.resizeHeight = reHeight;
|
|
240
|
+
$xeSplit.dispatchEvent('resize-drag', {
|
|
241
|
+
item: item,
|
|
242
|
+
name: item.name,
|
|
243
|
+
offsetHeight: offsetTop,
|
|
244
|
+
resizeHeight: reHeight,
|
|
245
|
+
offsetWidth: 0,
|
|
246
|
+
resizeWidth: 0
|
|
247
|
+
}, evnt);
|
|
203
248
|
}
|
|
204
249
|
}
|
|
205
250
|
} else {
|
|
206
|
-
if (
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
|
|
251
|
+
if (targetItem) {
|
|
252
|
+
if (targetHeight + offsetTop >= targetMinHeight) {
|
|
253
|
+
var _reHeight = currHeight - offsetTop;
|
|
254
|
+
targetItem.resizeHeight = targetHeight + offsetTop;
|
|
255
|
+
item.resizeHeight = _reHeight;
|
|
256
|
+
$xeSplit.dispatchEvent('resize-drag', {
|
|
257
|
+
item: item,
|
|
258
|
+
name: item.name,
|
|
259
|
+
offsetHeight: offsetTop,
|
|
260
|
+
resizeHeight: _reHeight,
|
|
261
|
+
offsetWidth: 0,
|
|
262
|
+
resizeWidth: 0
|
|
263
|
+
}, evnt);
|
|
210
264
|
}
|
|
211
265
|
}
|
|
212
266
|
}
|
|
213
267
|
} else {
|
|
214
|
-
var offsetLeft = evnt.clientX - disX;
|
|
268
|
+
var offsetLeft = isFoldNext ? disX - evnt.clientX : evnt.clientX - disX;
|
|
215
269
|
if (offsetLeft > 0) {
|
|
216
|
-
if (
|
|
270
|
+
if (targetItem) {
|
|
217
271
|
if (currWidth - offsetLeft >= currMinWidth) {
|
|
218
|
-
|
|
219
|
-
|
|
272
|
+
var reWidth = currWidth - offsetLeft;
|
|
273
|
+
targetItem.resizeWidth = targetWidth + offsetLeft;
|
|
274
|
+
item.resizeWidth = reWidth;
|
|
275
|
+
$xeSplit.dispatchEvent('resize-drag', {
|
|
276
|
+
item: item,
|
|
277
|
+
name: item.name,
|
|
278
|
+
offsetHeight: 0,
|
|
279
|
+
resizeHeight: 0,
|
|
280
|
+
offsetWidth: offsetLeft,
|
|
281
|
+
resizeWidth: reWidth
|
|
282
|
+
}, evnt);
|
|
220
283
|
}
|
|
221
284
|
}
|
|
222
285
|
} else {
|
|
223
|
-
if (
|
|
224
|
-
if (
|
|
225
|
-
|
|
226
|
-
|
|
286
|
+
if (targetItem) {
|
|
287
|
+
if (targetWidth + offsetLeft >= targetMinWidth) {
|
|
288
|
+
var _reWidth = currWidth - offsetLeft;
|
|
289
|
+
targetItem.resizeWidth = targetWidth + offsetLeft;
|
|
290
|
+
item.resizeWidth = _reWidth;
|
|
291
|
+
$xeSplit.dispatchEvent('resize-drag', {
|
|
292
|
+
item: item,
|
|
293
|
+
name: item.name,
|
|
294
|
+
offsetHeight: 0,
|
|
295
|
+
resizeHeight: 0,
|
|
296
|
+
offsetWidth: offsetLeft,
|
|
297
|
+
resizeWidth: _reWidth
|
|
298
|
+
}, evnt);
|
|
227
299
|
}
|
|
228
300
|
}
|
|
229
301
|
}
|
|
230
302
|
}
|
|
231
303
|
};
|
|
232
|
-
document.onmouseup = function () {
|
|
304
|
+
document.onmouseup = function (evnt) {
|
|
233
305
|
document.onmousemove = null;
|
|
234
306
|
document.onmouseup = null;
|
|
235
307
|
(0, _dom.removeClass)(el, 'is--drag');
|
|
308
|
+
$xeSplit.dispatchEvent('resize-end', {
|
|
309
|
+
item: item,
|
|
310
|
+
name: item.name,
|
|
311
|
+
resizeHeight: item.resizeHeight,
|
|
312
|
+
resizeWidth: item.resizeWidth
|
|
313
|
+
}, evnt);
|
|
236
314
|
};
|
|
315
|
+
$xeSplit.dispatchEvent('resize-start', {
|
|
316
|
+
item: item,
|
|
317
|
+
name: item.name
|
|
318
|
+
}, evnt);
|
|
319
|
+
},
|
|
320
|
+
handleItemActionEvent: function handleItemActionEvent(evnt) {
|
|
321
|
+
var $xeSplit = this;
|
|
322
|
+
var props = $xeSplit;
|
|
323
|
+
var reactData = $xeSplit.reactData;
|
|
324
|
+
var el = $xeSplit.$refs.refElem;
|
|
325
|
+
if (!el) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
var vertical = props.vertical;
|
|
329
|
+
var staticItems = reactData.staticItems;
|
|
330
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
331
|
+
var btnEl = evnt.currentTarget;
|
|
332
|
+
var handleEl = btnEl.parentElement;
|
|
333
|
+
var itemId = handleEl.getAttribute('itemid');
|
|
334
|
+
var itemIndex = _xeUtils.default.findIndexOf(staticItems, function (item) {
|
|
335
|
+
return item.id === itemId;
|
|
336
|
+
});
|
|
337
|
+
var item = staticItems[itemIndex];
|
|
338
|
+
var targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)];
|
|
339
|
+
if (item) {
|
|
340
|
+
var showAction = item.showAction,
|
|
341
|
+
isExpand = item.isExpand;
|
|
342
|
+
if (showAction) {
|
|
343
|
+
if (vertical) {
|
|
344
|
+
if (targetItem) {
|
|
345
|
+
targetItem.isVisible = !isExpand;
|
|
346
|
+
targetItem.foldHeight = 0;
|
|
347
|
+
item.isExpand = !isExpand;
|
|
348
|
+
item.isVisible = true;
|
|
349
|
+
item.foldHeight = isExpand ? (targetItem.resizeHeight || targetItem.renderHeight) + (item.resizeHeight || item.renderHeight) : 0;
|
|
350
|
+
}
|
|
351
|
+
} else {
|
|
352
|
+
if (targetItem) {
|
|
353
|
+
targetItem.isVisible = !isExpand;
|
|
354
|
+
targetItem.foldWidth = 0;
|
|
355
|
+
item.isExpand = !isExpand;
|
|
356
|
+
item.isVisible = true;
|
|
357
|
+
item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
$xeSplit.dispatchEvent(evnt.type === 'dblclick' ? 'action-dblclick' : 'action-click', {
|
|
361
|
+
item: item,
|
|
362
|
+
name: item.name,
|
|
363
|
+
targetItem: targetItem,
|
|
364
|
+
targetName: targetItem ? targetItem.name : '',
|
|
365
|
+
expanded: item.isExpand
|
|
366
|
+
}, evnt);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
handleGlobalResizeEvent: function handleGlobalResizeEvent() {
|
|
371
|
+
var $xeSplit = this;
|
|
372
|
+
$xeSplit.recalculate();
|
|
373
|
+
},
|
|
374
|
+
getDefaultActionIcon: function getDefaultActionIcon(item) {
|
|
375
|
+
var $xeSplit = this;
|
|
376
|
+
var props = $xeSplit;
|
|
377
|
+
var vertical = props.vertical;
|
|
378
|
+
var showAction = item.showAction,
|
|
379
|
+
isExpand = item.isExpand;
|
|
380
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
381
|
+
var topIcon = 'SPLIT_TOP_ACTION';
|
|
382
|
+
var bottomIcon = 'SPLIT_BOTTOM_ACTION';
|
|
383
|
+
var leftIcon = 'SPLIT_LEFT_ACTION';
|
|
384
|
+
var rightIcon = 'SPLIT_RIGHT_ACTION';
|
|
385
|
+
if (showAction) {
|
|
386
|
+
var iconName = '';
|
|
387
|
+
if (isFoldNext) {
|
|
388
|
+
if (vertical) {
|
|
389
|
+
iconName = isExpand ? bottomIcon : topIcon;
|
|
390
|
+
} else {
|
|
391
|
+
iconName = isExpand ? rightIcon : leftIcon;
|
|
392
|
+
}
|
|
393
|
+
} else {
|
|
394
|
+
if (vertical) {
|
|
395
|
+
iconName = isExpand ? topIcon : bottomIcon;
|
|
396
|
+
} else {
|
|
397
|
+
iconName = isExpand ? leftIcon : rightIcon;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
if (iconName) {
|
|
401
|
+
return (0, _ui.getIcon)()[iconName];
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return '';
|
|
237
405
|
},
|
|
238
406
|
//
|
|
239
407
|
// Render
|
|
240
408
|
//
|
|
409
|
+
renderHandleBar: function renderHandleBar(h, item) {
|
|
410
|
+
var $xeSplit = this;
|
|
411
|
+
var barStyle = $xeSplit.computeBarStyle;
|
|
412
|
+
var actionOpts = $xeSplit.computeActionOpts;
|
|
413
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
414
|
+
var id = item.id,
|
|
415
|
+
isExpand = item.isExpand,
|
|
416
|
+
showAction = item.showAction;
|
|
417
|
+
var btnOns = {};
|
|
418
|
+
if (actionOpts.trigger === 'dblclick') {
|
|
419
|
+
btnOns.dblclick = $xeSplit.handleItemActionEvent;
|
|
420
|
+
} else {
|
|
421
|
+
btnOns.click = $xeSplit.handleItemActionEvent;
|
|
422
|
+
}
|
|
423
|
+
return h('div', {
|
|
424
|
+
attrs: {
|
|
425
|
+
itemid: id
|
|
426
|
+
},
|
|
427
|
+
class: ['vxe-split-item-handle', isFoldNext ? 'to--next' : 'to--prev']
|
|
428
|
+
}, [h('div', {
|
|
429
|
+
class: 'vxe-split-item-handle-bar',
|
|
430
|
+
style: barStyle,
|
|
431
|
+
on: {
|
|
432
|
+
mousedown: $xeSplit.dragEvent
|
|
433
|
+
}
|
|
434
|
+
}), showAction ? h('span', {
|
|
435
|
+
class: 'vxe-split-item-action-btn',
|
|
436
|
+
on: btnOns
|
|
437
|
+
}, [h('i', {
|
|
438
|
+
class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || $xeSplit.getDefaultActionIcon(item)
|
|
439
|
+
})]) : (0, _ui.renderEmptyElement)($xeSplit)]);
|
|
440
|
+
},
|
|
241
441
|
renderItems: function renderItems(h) {
|
|
242
442
|
var $xeSplit = this;
|
|
243
443
|
var props = $xeSplit;
|
|
@@ -246,52 +446,55 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
246
446
|
padding = props.padding,
|
|
247
447
|
vertical = props.vertical;
|
|
248
448
|
var staticItems = reactData.staticItems;
|
|
449
|
+
var isFoldNext = $xeSplit.computeIsFoldNext;
|
|
249
450
|
var itemVNs = [];
|
|
250
451
|
staticItems.forEach(function (item, index) {
|
|
251
452
|
var id = item.id,
|
|
252
453
|
slots = item.slots,
|
|
253
454
|
renderHeight = item.renderHeight,
|
|
254
|
-
|
|
455
|
+
resizeHeight = item.resizeHeight,
|
|
456
|
+
foldHeight = item.foldHeight,
|
|
457
|
+
renderWidth = item.renderWidth,
|
|
458
|
+
resizeWidth = item.resizeWidth,
|
|
459
|
+
foldWidth = item.foldWidth,
|
|
460
|
+
isVisible = item.isVisible,
|
|
461
|
+
isExpand = item.isExpand;
|
|
255
462
|
var defaultSlot = slots ? slots.default : null;
|
|
256
463
|
var stys = {};
|
|
464
|
+
var itemWidth = isVisible ? foldWidth || resizeWidth || renderWidth : 0;
|
|
465
|
+
var itemHeight = isVisible ? foldHeight || resizeHeight || renderHeight : 0;
|
|
257
466
|
if (vertical) {
|
|
258
|
-
if (
|
|
259
|
-
stys.height = (0, _dom.toCssUnit)(
|
|
467
|
+
if (itemHeight) {
|
|
468
|
+
stys.height = (0, _dom.toCssUnit)(itemHeight);
|
|
260
469
|
}
|
|
261
470
|
} else {
|
|
262
|
-
if (
|
|
263
|
-
stys.width = (0, _dom.toCssUnit)(
|
|
471
|
+
if (itemWidth) {
|
|
472
|
+
stys.width = (0, _dom.toCssUnit)(itemWidth);
|
|
264
473
|
}
|
|
265
474
|
}
|
|
266
475
|
itemVNs.push(h('div', {
|
|
267
476
|
attrs: {
|
|
268
|
-
|
|
477
|
+
itemid: id
|
|
269
478
|
},
|
|
270
479
|
class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
|
|
271
480
|
'is--padding': padding,
|
|
272
481
|
'is--border': border,
|
|
273
|
-
'is--height':
|
|
274
|
-
'is--width':
|
|
275
|
-
'is--fill': !
|
|
276
|
-
'is--handle': index > 0
|
|
482
|
+
'is--height': itemHeight,
|
|
483
|
+
'is--width': itemWidth,
|
|
484
|
+
'is--fill': isVisible && !itemHeight && !itemWidth,
|
|
485
|
+
'is--handle': index > 0,
|
|
486
|
+
'is--expand': isExpand,
|
|
487
|
+
'is--hidden': !isVisible
|
|
277
488
|
}],
|
|
278
489
|
style: stys
|
|
279
|
-
}, [index ? h('div', {
|
|
490
|
+
}, [index && !isFoldNext ? $xeSplit.renderHandleBar(h, item) : (0, _ui.renderEmptyElement)($xeSplit), h('div', {
|
|
280
491
|
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
|
|
492
|
+
itemid: id
|
|
290
493
|
},
|
|
291
494
|
class: 'vxe-split-item--wrapper'
|
|
292
495
|
}, [h('div', {
|
|
293
496
|
class: 'vxe-split-item--inner'
|
|
294
|
-
}, defaultSlot ? $xeSplit.callSlot(defaultSlot, {}) : [])])]));
|
|
497
|
+
}, defaultSlot ? $xeSplit.callSlot(defaultSlot, {}) : [])]), isFoldNext && index < staticItems.length - 1 ? $xeSplit.renderHandleBar(h, item) : (0, _ui.renderEmptyElement)($xeSplit)]));
|
|
295
498
|
});
|
|
296
499
|
return h('div', {
|
|
297
500
|
class: 'vxe-split-wrapper'
|
|
@@ -321,6 +524,20 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
321
524
|
}, defaultSlot ? defaultSlot({}) : []), $xeSplit.renderItems(h)]);
|
|
322
525
|
}
|
|
323
526
|
},
|
|
527
|
+
created: function created() {
|
|
528
|
+
var $xeSplit = this;
|
|
529
|
+
_ui.globalEvents.on($xeSplit, 'resize', $xeSplit.handleGlobalResizeEvent);
|
|
530
|
+
},
|
|
531
|
+
mounted: function mounted() {
|
|
532
|
+
var $xeSplit = this;
|
|
533
|
+
$xeSplit.$nextTick(function () {
|
|
534
|
+
$xeSplit.recalculate();
|
|
535
|
+
});
|
|
536
|
+
},
|
|
537
|
+
beforeDestroy: function beforeDestroy() {
|
|
538
|
+
var $xeSplit = this;
|
|
539
|
+
_ui.globalEvents.off($xeSplit, 'resize');
|
|
540
|
+
},
|
|
324
541
|
render: function render(h) {
|
|
325
542
|
return this.renderVN(h);
|
|
326
543
|
}
|