vxe-table 4.21.1 → 4.21.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/dist/all.esm.js +166 -102
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +4 -0
- package/es/table/module/export/export-panel.js +3 -2
- package/es/table/module/export/hook.js +13 -7
- package/es/table/module/filter/hook.js +97 -79
- package/es/table/src/body.js +12 -4
- package/es/table/src/footer.js +12 -3
- package/es/table/src/header.js +12 -4
- package/es/table/src/table.js +12 -2
- package/es/table/src/util.js +1 -0
- package/es/table/style.css +35 -60
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +35 -60
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +176 -110
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/hook.js +6 -0
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/export/export-panel.js +3 -2
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/hook.js +15 -7
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/filter/hook.js +111 -86
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/src/body.js +11 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +12 -3
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +11 -3
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +3 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +35 -60
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +1 -1
- 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-table/style/style.css +35 -60
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/custom/hook.ts +4 -0
- package/packages/table/module/export/export-panel.ts +3 -2
- package/packages/table/module/export/hook.ts +12 -7
- package/packages/table/module/filter/hook.ts +94 -75
- package/packages/table/src/body.ts +14 -4
- package/packages/table/src/footer.ts +14 -3
- package/packages/table/src/header.ts +14 -4
- package/packages/table/src/table.ts +12 -2
- package/packages/table/src/util.ts +1 -0
- package/packages/ui/src/dom.ts +1 -1
- package/packages/ui/src/utils.ts +1 -1
- package/styles/components/table.scss +37 -75
- /package/es/{iconfont.1787542597284.ttf → iconfont.1788176649939.ttf} +0 -0
- /package/es/{iconfont.1787542597284.woff → iconfont.1788176649939.woff} +0 -0
- /package/es/{iconfont.1787542597284.woff2 → iconfont.1788176649939.woff2} +0 -0
- /package/lib/{iconfont.1787542597284.ttf → iconfont.1788176649939.ttf} +0 -0
- /package/lib/{iconfont.1787542597284.woff → iconfont.1788176649939.woff} +0 -0
- /package/lib/{iconfont.1787542597284.woff2 → iconfont.1788176649939.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -47,7 +47,7 @@ function getDefaultConfig(val1, def1) {
|
|
|
47
47
|
return XEUtils.eqNull(val1) ? def1 : val1;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
const version = "4.21.
|
|
50
|
+
const version = "4.21.3";
|
|
51
51
|
VxeUI.version = version;
|
|
52
52
|
VxeUI.tableVersion = version;
|
|
53
53
|
VxeUI.setConfig({
|
|
@@ -591,7 +591,7 @@ function getTpImg() {
|
|
|
591
591
|
return tpImgEl;
|
|
592
592
|
}
|
|
593
593
|
function getPropClass(property, params) {
|
|
594
|
-
return property ? XEUtils.isFunction(property) ? property(params) : property : '';
|
|
594
|
+
return property ? (XEUtils.isFunction(property) ? property(params) : property) || '' : '';
|
|
595
595
|
}
|
|
596
596
|
function getClsRE(cls) {
|
|
597
597
|
if (!reClsMap[cls]) {
|
|
@@ -769,7 +769,7 @@ function wheelScrollTopTo(diffNum, cb) {
|
|
|
769
769
|
}
|
|
770
770
|
|
|
771
771
|
const { log } = VxeUI;
|
|
772
|
-
const tableVersion = `table v${"4.21.
|
|
772
|
+
const tableVersion = `table v${"4.21.3"}`;
|
|
773
773
|
function createComponentLog(name) {
|
|
774
774
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
775
775
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -1208,6 +1208,7 @@ function createReactData$2() {
|
|
|
1208
1208
|
customColumnList: [],
|
|
1209
1209
|
// 当前选中的筛选列
|
|
1210
1210
|
filterStore: {
|
|
1211
|
+
targetEl: null,
|
|
1211
1212
|
isAllSelected: false,
|
|
1212
1213
|
isIndeterminate: false,
|
|
1213
1214
|
style: null,
|
|
@@ -4186,8 +4187,13 @@ var TableBodyComponent = defineVxeComponent({
|
|
|
4186
4187
|
const isEdit = isEnableConf(editRender);
|
|
4187
4188
|
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
4188
4189
|
let fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
4189
|
-
const
|
|
4190
|
-
const
|
|
4190
|
+
const cellPadding = getDefaultConfig(padding, (allPadding === null ? cellOpts.padding : allPadding));
|
|
4191
|
+
const isAllCellPadding = cellPadding === true;
|
|
4192
|
+
const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false;
|
|
4193
|
+
const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false;
|
|
4194
|
+
const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false;
|
|
4195
|
+
const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false;
|
|
4196
|
+
const cellOverflow = getDefaultConfig(showOverflow, allShowOverflow);
|
|
4191
4197
|
const showEllipsis = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'ellipsis';
|
|
4192
4198
|
const showTitle = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'title';
|
|
4193
4199
|
const showTooltip = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'tooltip';
|
|
@@ -4479,7 +4485,10 @@ var TableBodyComponent = defineVxeComponent({
|
|
|
4479
4485
|
'col--max-height': maxHeight,
|
|
4480
4486
|
'fixed--width': !isAutoCellWidth,
|
|
4481
4487
|
'fixed--hidden': fixedHiddenColumn,
|
|
4482
|
-
'is--
|
|
4488
|
+
'is--pg-top': isCellPaddingTop,
|
|
4489
|
+
'is--pg-bottom': isCellPaddingBottom,
|
|
4490
|
+
'is--pg-left': isCellPaddingLeft,
|
|
4491
|
+
'is--pg-right': isCellPaddingRight,
|
|
4483
4492
|
'is--progress': (fixedHiddenColumn && isAllOverflow) || isVNPreEmptyStatus,
|
|
4484
4493
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
4485
4494
|
'is--drag-disabled': isDisabledDrag,
|
|
@@ -4991,8 +5000,13 @@ var TableHeaderComponent = defineVxeComponent({
|
|
|
4991
5000
|
const compConf = renderOpts ? renderer$8.get(renderOpts.name) : null;
|
|
4992
5001
|
const isColGroup = column.children && column.children.length;
|
|
4993
5002
|
const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
4994
|
-
const
|
|
4995
|
-
const
|
|
5003
|
+
const cellPadding = getDefaultConfig(headerCellOpts.padding, cellOpts.padding);
|
|
5004
|
+
const isAllCellPadding = cellPadding === true;
|
|
5005
|
+
const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false;
|
|
5006
|
+
const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false;
|
|
5007
|
+
const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false;
|
|
5008
|
+
const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false;
|
|
5009
|
+
const headOverflow = getDefaultConfig(showHeaderOverflow, allColumnHeaderOverflow);
|
|
4996
5010
|
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
4997
5011
|
const showEllipsis = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'ellipsis';
|
|
4998
5012
|
const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'title';
|
|
@@ -5108,7 +5122,10 @@ var TableHeaderComponent = defineVxeComponent({
|
|
|
5108
5122
|
'col--group': isColGroup,
|
|
5109
5123
|
'col--ellipsis': hasEllipsis,
|
|
5110
5124
|
'fixed--width': !isAutoCellWidth,
|
|
5111
|
-
'is--
|
|
5125
|
+
'is--pg-top': isCellPaddingTop,
|
|
5126
|
+
'is--pg-bottom': isCellPaddingBottom,
|
|
5127
|
+
'is--pg-left': isCellPaddingLeft,
|
|
5128
|
+
'is--pg-right': isCellPaddingRight,
|
|
5112
5129
|
'is--sortable': column.sortable,
|
|
5113
5130
|
'col--filter': !!filters,
|
|
5114
5131
|
'is--filter-active': hasFilter,
|
|
@@ -5492,8 +5509,13 @@ var TableFooterComponent = defineVxeComponent({
|
|
|
5492
5509
|
const compConf = renderOpts ? renderer$7.get(renderOpts.name) : null;
|
|
5493
5510
|
const showAllTip = footerTooltipOpts.showAll;
|
|
5494
5511
|
const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
5495
|
-
const
|
|
5496
|
-
const
|
|
5512
|
+
const cellPadding = getDefaultConfig(footerCellOpts.padding, cellOpts.padding);
|
|
5513
|
+
const isAllCellPadding = cellPadding === true;
|
|
5514
|
+
const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false;
|
|
5515
|
+
const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false;
|
|
5516
|
+
const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false;
|
|
5517
|
+
const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false;
|
|
5518
|
+
const footOverflow = getDefaultConfig(showFooterOverflow, allColumnFooterOverflow);
|
|
5497
5519
|
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
5498
5520
|
const showEllipsis = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'ellipsis';
|
|
5499
5521
|
const showTitle = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'title';
|
|
@@ -5600,7 +5622,10 @@ var TableFooterComponent = defineVxeComponent({
|
|
|
5600
5622
|
'col--last': isLastColumn,
|
|
5601
5623
|
'fixed--width': !isAutoCellWidth,
|
|
5602
5624
|
'fixed--hidden': fixedHiddenColumn,
|
|
5603
|
-
'is--
|
|
5625
|
+
'is--pg-top': isCellPaddingTop,
|
|
5626
|
+
'is--pg-bottom': isCellPaddingBottom,
|
|
5627
|
+
'is--pg-left': isCellPaddingLeft,
|
|
5628
|
+
'is--pg-right': isCellPaddingRight,
|
|
5604
5629
|
'col--ellipsis': hasEllipsis,
|
|
5605
5630
|
'col--current': currentColumn === column
|
|
5606
5631
|
}, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)] }, attrs), { style: footerCellStyle ? (XEUtils.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle) : null }), tfOns), { key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex }), [
|
|
@@ -8001,9 +8026,10 @@ var TableExportPanelComponent = defineVxeComponent({
|
|
|
8001
8026
|
const { hasMerge, columns } = storeData;
|
|
8002
8027
|
const checkedAll = computeCheckedAll.value;
|
|
8003
8028
|
const supportMerge = computeSupportMerge.value;
|
|
8004
|
-
|
|
8029
|
+
// 内部导出使用 _columns -> _children 为自定义子集
|
|
8030
|
+
const expColumns = XEUtils.searchTree(columns, (column) => column.checked, { children: 'children', mapChildren: '_children', original: true });
|
|
8005
8031
|
return Object.assign({}, defaultOptions, {
|
|
8006
|
-
|
|
8032
|
+
_columns: expColumns,
|
|
8007
8033
|
isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
|
|
8008
8034
|
});
|
|
8009
8035
|
};
|
|
@@ -8656,6 +8682,92 @@ hooks$7.add('tableFilterModule', {
|
|
|
8656
8682
|
const { props, reactData, internalData } = $xeTable;
|
|
8657
8683
|
const { refElem, refTableFilter } = $xeTable.getRefMaps();
|
|
8658
8684
|
const { computeFilterOpts, computeMouseOpts } = $xeTable.getComputeMaps();
|
|
8685
|
+
const updatePopupStyle = () => {
|
|
8686
|
+
const { filterStore } = reactData;
|
|
8687
|
+
const { elemStore } = internalData;
|
|
8688
|
+
const { column, targetEl } = filterStore;
|
|
8689
|
+
if (!column || !targetEl) {
|
|
8690
|
+
return nextTick();
|
|
8691
|
+
}
|
|
8692
|
+
const tableEl = refElem.value;
|
|
8693
|
+
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
|
|
8694
|
+
const filterOpts = computeFilterOpts.value;
|
|
8695
|
+
const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts;
|
|
8696
|
+
const currEl = targetEl;
|
|
8697
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
8698
|
+
const filterRender = column ? column.filterRender : null;
|
|
8699
|
+
const compConf = filterRender && isEnableConf(filterRender) ? renderer$5.get(filterRender.name) : null;
|
|
8700
|
+
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8701
|
+
if (!headerScrollElem) {
|
|
8702
|
+
return nextTick();
|
|
8703
|
+
}
|
|
8704
|
+
const tableFilter = refTableFilter.value;
|
|
8705
|
+
const filterWrapperElem = tableFilter ? tableFilter.getRefMaps().refElem.value : null;
|
|
8706
|
+
if (!filterWrapperElem) {
|
|
8707
|
+
return nextTick();
|
|
8708
|
+
}
|
|
8709
|
+
const btnRect = currEl.getBoundingClientRect();
|
|
8710
|
+
const filterHeadElem = filterWrapperElem.querySelector('.vxe-table--filter-header');
|
|
8711
|
+
const filterFootElem = filterWrapperElem.querySelector('.vxe-table--filter-footer');
|
|
8712
|
+
const filterWidth = filterWrapperElem.offsetWidth;
|
|
8713
|
+
const centerWidth = currEl ? filterWidth / 2 : ((filterWidth - column.renderWidth) / 2);
|
|
8714
|
+
let left = 0;
|
|
8715
|
+
let top = 0;
|
|
8716
|
+
let maxHeight = 0;
|
|
8717
|
+
/**
|
|
8718
|
+
* 是否显示筛选按钮图标
|
|
8719
|
+
* 如果不存在图标,则相对单元格居中显示
|
|
8720
|
+
*/
|
|
8721
|
+
if (transfer) {
|
|
8722
|
+
left = btnRect.left - centerWidth + scrollLeft;
|
|
8723
|
+
top = btnRect.top + currEl.clientHeight + scrollTop;
|
|
8724
|
+
maxHeight = Math.min(Math.max(tableRect.height, Math.floor(visibleHeight / 2)), Math.max(80, visibleHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 28));
|
|
8725
|
+
if (left < 16) {
|
|
8726
|
+
left = 16;
|
|
8727
|
+
}
|
|
8728
|
+
else if (left > (visibleWidth - filterWidth - 16)) {
|
|
8729
|
+
left = visibleWidth - filterWidth - 16;
|
|
8730
|
+
}
|
|
8731
|
+
}
|
|
8732
|
+
else {
|
|
8733
|
+
left = btnRect.left - tableRect.left - centerWidth;
|
|
8734
|
+
top = btnRect.top - tableRect.top + currEl.clientHeight;
|
|
8735
|
+
maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14);
|
|
8736
|
+
if (left < 1) {
|
|
8737
|
+
left = 1;
|
|
8738
|
+
}
|
|
8739
|
+
else if (left > (tableEl.clientWidth - filterWidth - 1)) {
|
|
8740
|
+
left = tableEl.clientWidth - filterWidth - 1;
|
|
8741
|
+
}
|
|
8742
|
+
if ($xeGGWrapper) {
|
|
8743
|
+
const wrapperEl = $xeGGWrapper.getRefMaps().refElem.value;
|
|
8744
|
+
if (wrapperEl) {
|
|
8745
|
+
const wrapperRect = wrapperEl.getBoundingClientRect();
|
|
8746
|
+
top += tableRect.top - wrapperRect.top;
|
|
8747
|
+
}
|
|
8748
|
+
}
|
|
8749
|
+
}
|
|
8750
|
+
const fStys = {
|
|
8751
|
+
top: toCssUnit(top),
|
|
8752
|
+
left: toCssUnit(left)
|
|
8753
|
+
};
|
|
8754
|
+
if (zIndex) {
|
|
8755
|
+
fStys.zIndex = zIndex;
|
|
8756
|
+
}
|
|
8757
|
+
filterStore.style = fStys;
|
|
8758
|
+
// 筛选面板是自适应表格高度
|
|
8759
|
+
if (compConf ? !compConf.tableFilterAutoHeight : false) {
|
|
8760
|
+
maxHeight = 0;
|
|
8761
|
+
}
|
|
8762
|
+
else {
|
|
8763
|
+
if (customMaxHeight) {
|
|
8764
|
+
maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
|
|
8765
|
+
}
|
|
8766
|
+
}
|
|
8767
|
+
// 判断面板不能大于表格高度
|
|
8768
|
+
filterStore.maxHeight = maxHeight;
|
|
8769
|
+
return nextTick();
|
|
8770
|
+
};
|
|
8659
8771
|
const filterPrivateMethods = {
|
|
8660
8772
|
checkFilterOptions() {
|
|
8661
8773
|
const { filterStore } = reactData;
|
|
@@ -8668,96 +8780,21 @@ hooks$7.add('tableFilterModule', {
|
|
|
8668
8780
|
},
|
|
8669
8781
|
handleOpenFilterColumn(evnt, btnEl, colEl, column, params) {
|
|
8670
8782
|
const { initStore, filterStore } = reactData;
|
|
8671
|
-
const { elemStore } = internalData;
|
|
8672
8783
|
if (filterStore.column === column && filterStore.visible) {
|
|
8673
8784
|
filterStore.visible = false;
|
|
8674
8785
|
}
|
|
8675
8786
|
else {
|
|
8676
|
-
const tableEl = refElem.value;
|
|
8677
|
-
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
|
|
8678
|
-
const filterOpts = computeFilterOpts.value;
|
|
8679
|
-
const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts;
|
|
8680
8787
|
const currEl = btnEl || colEl;
|
|
8681
|
-
const tableRect = tableEl.getBoundingClientRect();
|
|
8682
|
-
const filterRender = column ? column.filterRender : null;
|
|
8683
|
-
const compConf = filterRender && isEnableConf(filterRender) ? renderer$5.get(filterRender.name) : null;
|
|
8684
8788
|
$xeTable.handleFilterOptions(column);
|
|
8685
8789
|
internalData._currFilterParams = params;
|
|
8790
|
+
filterStore.targetEl = currEl;
|
|
8686
8791
|
filterStore.style = null;
|
|
8687
8792
|
filterStore.visible = true;
|
|
8688
8793
|
initStore.filter = true;
|
|
8689
|
-
nextTick(() => {
|
|
8690
|
-
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8691
|
-
if (!headerScrollElem) {
|
|
8692
|
-
return;
|
|
8693
|
-
}
|
|
8694
|
-
const tableFilter = refTableFilter.value;
|
|
8695
|
-
const filterWrapperElem = tableFilter ? tableFilter.getRefMaps().refElem.value : null;
|
|
8696
|
-
if (!filterWrapperElem) {
|
|
8697
|
-
return;
|
|
8698
|
-
}
|
|
8699
|
-
const btnRect = currEl.getBoundingClientRect();
|
|
8700
|
-
const filterHeadElem = filterWrapperElem.querySelector('.vxe-table--filter-header');
|
|
8701
|
-
const filterFootElem = filterWrapperElem.querySelector('.vxe-table--filter-footer');
|
|
8702
|
-
const filterWidth = filterWrapperElem.offsetWidth;
|
|
8703
|
-
const centerWidth = btnEl ? filterWidth / 2 : ((filterWidth - column.renderWidth) / 2);
|
|
8704
|
-
let left = 0;
|
|
8705
|
-
let top = 0;
|
|
8706
|
-
let maxHeight = 0;
|
|
8707
|
-
/**
|
|
8708
|
-
* 是否显示筛选按钮图标
|
|
8709
|
-
* 如果不存在图标,则相对单元格居中显示
|
|
8710
|
-
*/
|
|
8711
|
-
if (transfer) {
|
|
8712
|
-
left = btnRect.left - centerWidth + scrollLeft;
|
|
8713
|
-
top = btnRect.top + currEl.clientHeight + scrollTop;
|
|
8714
|
-
maxHeight = Math.min(Math.max(tableRect.height, Math.floor(visibleHeight / 2)), Math.max(80, visibleHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 28));
|
|
8715
|
-
if (left < 16) {
|
|
8716
|
-
left = 16;
|
|
8717
|
-
}
|
|
8718
|
-
else if (left > (visibleWidth - filterWidth - 16)) {
|
|
8719
|
-
left = visibleWidth - filterWidth - 16;
|
|
8720
|
-
}
|
|
8721
|
-
}
|
|
8722
|
-
else {
|
|
8723
|
-
left = btnRect.left - tableRect.left - centerWidth;
|
|
8724
|
-
top = btnRect.top - tableRect.top + currEl.clientHeight;
|
|
8725
|
-
maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14);
|
|
8726
|
-
if (left < 1) {
|
|
8727
|
-
left = 1;
|
|
8728
|
-
}
|
|
8729
|
-
else if (left > (tableEl.clientWidth - filterWidth - 1)) {
|
|
8730
|
-
left = tableEl.clientWidth - filterWidth - 1;
|
|
8731
|
-
}
|
|
8732
|
-
if ($xeGGWrapper) {
|
|
8733
|
-
const wrapperEl = $xeGGWrapper.getRefMaps().refElem.value;
|
|
8734
|
-
if (wrapperEl) {
|
|
8735
|
-
const wrapperRect = wrapperEl.getBoundingClientRect();
|
|
8736
|
-
top += tableRect.top - wrapperRect.top;
|
|
8737
|
-
}
|
|
8738
|
-
}
|
|
8739
|
-
}
|
|
8740
|
-
const fStys = {
|
|
8741
|
-
top: toCssUnit(top),
|
|
8742
|
-
left: toCssUnit(left)
|
|
8743
|
-
};
|
|
8744
|
-
if (zIndex) {
|
|
8745
|
-
fStys.zIndex = zIndex;
|
|
8746
|
-
}
|
|
8747
|
-
filterStore.style = fStys;
|
|
8748
|
-
// 筛选面板是自适应表格高度
|
|
8749
|
-
if (compConf ? !compConf.tableFilterAutoHeight : false) {
|
|
8750
|
-
maxHeight = 0;
|
|
8751
|
-
}
|
|
8752
|
-
else {
|
|
8753
|
-
if (customMaxHeight) {
|
|
8754
|
-
maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
|
|
8755
|
-
}
|
|
8756
|
-
}
|
|
8757
|
-
// 判断面板不能大于表格高度
|
|
8758
|
-
filterStore.maxHeight = maxHeight;
|
|
8759
|
-
});
|
|
8760
8794
|
}
|
|
8795
|
+
nextTick(() => {
|
|
8796
|
+
updatePopupStyle();
|
|
8797
|
+
});
|
|
8761
8798
|
$xeTable.dispatchEvent('filter-visible', { column, field: column.field, property: column.field, filterList: $xeTable.getCheckedFilters(), visible: filterStore.visible }, evnt);
|
|
8762
8799
|
},
|
|
8763
8800
|
/**
|
|
@@ -8915,6 +8952,13 @@ hooks$7.add('tableFilterModule', {
|
|
|
8915
8952
|
$xeTable.dispatchEvent('clear-filter', { filterList: [] }, evnt);
|
|
8916
8953
|
}
|
|
8917
8954
|
}
|
|
8955
|
+
},
|
|
8956
|
+
handleFilterStyle() {
|
|
8957
|
+
const { filterStore } = reactData;
|
|
8958
|
+
if (!filterStore.visible) {
|
|
8959
|
+
return nextTick();
|
|
8960
|
+
}
|
|
8961
|
+
return updatePopupStyle();
|
|
8918
8962
|
}
|
|
8919
8963
|
};
|
|
8920
8964
|
const filterMethods = {
|
|
@@ -10800,7 +10844,7 @@ const tableExportMethodKeys = ['exportData', 'importByFile', 'importData', 'save
|
|
|
10800
10844
|
hooks$4.add('tableExportModule', {
|
|
10801
10845
|
setupTable($xeTable) {
|
|
10802
10846
|
const { props, reactData, internalData } = $xeTable;
|
|
10803
|
-
const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts,
|
|
10847
|
+
const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts, computeAggregateOpts } = $xeTable.getComputeMaps();
|
|
10804
10848
|
const getSeq = (cellValue, row, $rowIndex, column, $columnIndex) => {
|
|
10805
10849
|
const seqOpts = computeSeqOpts.value;
|
|
10806
10850
|
const seqMd = seqOpts.seqMethod || column.seqMethod;
|
|
@@ -11757,9 +11801,9 @@ hooks$4.add('tableExportModule', {
|
|
|
11757
11801
|
const { initStore, isGroup, rowGroupList, footerTableData, exportStore, exportParams } = reactData;
|
|
11758
11802
|
const { collectColumn, mergeBodyList, mergeFooterList } = internalData;
|
|
11759
11803
|
const exportOpts = computeExportOpts.value;
|
|
11804
|
+
const printOpts = computePrintOpts.value;
|
|
11760
11805
|
const hasTree = !!treeConfig;
|
|
11761
11806
|
const hasRowGroup = rowGroupList.length > 0;
|
|
11762
|
-
const customOpts = computeCustomOpts.value;
|
|
11763
11807
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
11764
11808
|
const proxyOpts = $xeGGWrapper ? $xeGGWrapper.getComputeMaps().computeProxyOpts.value : {};
|
|
11765
11809
|
const hasFooter = !!footerTableData.length;
|
|
@@ -11780,9 +11824,9 @@ hooks$4.add('tableExportModule', {
|
|
|
11780
11824
|
warnLog$4('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
|
|
11781
11825
|
defOpts.isTreeAllExpanded = defOpts.isAllExpand;
|
|
11782
11826
|
}
|
|
11783
|
-
const types = defOpts.types || XEUtils.keys(exportOpts._typeMaps);
|
|
11827
|
+
const types = isPrint ? [] : (defOpts.types || XEUtils.keys(exportOpts._typeMaps));
|
|
11784
11828
|
const modes = defOpts.modes || [];
|
|
11785
|
-
const checkMethod =
|
|
11829
|
+
const checkMethod = (isPrint ? printOpts : exportOpts).checkMethod;
|
|
11786
11830
|
const exportColumns = collectColumn.slice(0);
|
|
11787
11831
|
const { columns, excludeFields, includeFields, extraFields } = defOpts;
|
|
11788
11832
|
// 处理类型
|
|
@@ -11889,10 +11933,10 @@ hooks$4.add('tableExportModule', {
|
|
|
11889
11933
|
}
|
|
11890
11934
|
}
|
|
11891
11935
|
if (!modeList.some(item => item.value === mode)) {
|
|
11892
|
-
exportParams.mode = modeList[0].value;
|
|
11936
|
+
exportParams.mode = modeList.length ? modeList[0].value : '';
|
|
11893
11937
|
}
|
|
11894
11938
|
if (!typeList.some(item => item.value === type)) {
|
|
11895
|
-
exportParams.type = typeList[0].value;
|
|
11939
|
+
exportParams.type = typeList.length ? typeList[0].value : '';
|
|
11896
11940
|
}
|
|
11897
11941
|
if (!exportParams.widthMode) {
|
|
11898
11942
|
exportParams.widthMode = '';
|
|
@@ -11981,7 +12025,13 @@ hooks$4.add('tableExportModule', {
|
|
|
11981
12025
|
}
|
|
11982
12026
|
let isCustomCol = false;
|
|
11983
12027
|
let customCols = [];
|
|
11984
|
-
|
|
12028
|
+
const _columns = opts._columns;
|
|
12029
|
+
if (_columns) {
|
|
12030
|
+
// 内部导出使用 _columns -> _children 为自定义子集
|
|
12031
|
+
isCustomCol = true;
|
|
12032
|
+
customCols = XEUtils.searchTree(_columns, () => true, { children: '_children', mapChildren: 'childNodes', original: true });
|
|
12033
|
+
}
|
|
12034
|
+
else if (columns) {
|
|
11985
12035
|
isCustomCol = true;
|
|
11986
12036
|
customCols = XEUtils.searchTree(columns, () => true, { children: 'children', mapChildren: 'childNodes', original: true });
|
|
11987
12037
|
}
|
|
@@ -14095,6 +14145,10 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
14095
14145
|
handleUpdateCustomColumn,
|
|
14096
14146
|
handleCustomStyle() {
|
|
14097
14147
|
const reactData = $xeTable.reactData;
|
|
14148
|
+
const { customStore } = reactData;
|
|
14149
|
+
if (!customStore.visible) {
|
|
14150
|
+
return nextTick();
|
|
14151
|
+
}
|
|
14098
14152
|
reactData.isCustomDragStatus = false;
|
|
14099
14153
|
return updatePopupStyle();
|
|
14100
14154
|
}
|
|
@@ -17628,10 +17682,9 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
17628
17682
|
if (!el || !el.clientWidth) {
|
|
17629
17683
|
return;
|
|
17630
17684
|
}
|
|
17631
|
-
const cellOpts = computeCellOpts.value;
|
|
17632
17685
|
const treeOpts = computeTreeOpts.value;
|
|
17633
17686
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
17634
|
-
if (!isAllOverflow && (scrollYLoad || scrollXLoad ||
|
|
17687
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
|
|
17635
17688
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
17636
17689
|
el.setAttribute('data-calc-row', 'Y');
|
|
17637
17690
|
tableData.forEach(row => {
|
|
@@ -23996,6 +24049,11 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
23996
24049
|
}
|
|
23997
24050
|
};
|
|
23998
24051
|
const handleGlobalScrollEvent = (evnt) => {
|
|
24052
|
+
const { filterStore } = reactData;
|
|
24053
|
+
const filterOpts = computeFilterOpts.value;
|
|
24054
|
+
if (filterStore.visible && filterOpts.transfer) {
|
|
24055
|
+
$xeTable.handleFilterStyle();
|
|
24056
|
+
}
|
|
23999
24057
|
reUpdateCustomStyleEvent(evnt);
|
|
24000
24058
|
};
|
|
24001
24059
|
/**
|
|
@@ -29842,6 +29900,12 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29842
29900
|
}, () => {
|
|
29843
29901
|
reLayoutFlag.value++;
|
|
29844
29902
|
});
|
|
29903
|
+
watch(() => {
|
|
29904
|
+
const cellOpts = computeCellOpts.value;
|
|
29905
|
+
return cellOpts.height;
|
|
29906
|
+
}, () => {
|
|
29907
|
+
reLayoutFlag.value++;
|
|
29908
|
+
});
|
|
29845
29909
|
watch(reLayoutFlag, () => {
|
|
29846
29910
|
$xeTable.recalculate(true);
|
|
29847
29911
|
});
|