vxe-table 3.12.10-beta.9 → 3.12.11
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +4 -3
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +4 -3
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +518 -517
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +7 -7
- package/es/table/module/export/mixin.js +105 -69
- package/es/table/module/keyboard/mixin.js +68 -25
- package/es/table/module/menu/mixin.js +3 -1
- package/es/table/src/body.js +114 -87
- package/es/table/src/cell.js +43 -57
- package/es/table/src/column.js +43 -8
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/footer.js +47 -6
- package/es/table/src/header.js +67 -165
- package/es/table/src/methods.js +962 -480
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +114 -33
- package/es/table/src/util.js +74 -58
- package/es/table/style.css +246 -191
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +20 -6
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +246 -191
- 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 +1725 -1022
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -3
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -3
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +4 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -3
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +518 -517
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +518 -517
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +7 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +105 -64
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +73 -27
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +3 -1
- package/lib/table/src/body.js +114 -80
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +32 -42
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +12 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +3 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +43 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +49 -172
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1072 -538
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +14 -4
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +113 -36
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +88 -71
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +246 -191
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +20 -6
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +246 -191
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +4 -3
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +4 -3
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +518 -517
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/edit/mixin.ts +7 -7
- package/packages/table/module/export/mixin.ts +138 -80
- package/packages/table/module/keyboard/mixin.ts +65 -24
- package/packages/table/module/menu/mixin.ts +4 -1
- package/packages/table/src/body.ts +126 -90
- package/packages/table/src/cell.ts +45 -67
- package/packages/table/src/column.ts +48 -10
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/footer.ts +50 -7
- package/packages/table/src/header.ts +67 -166
- package/packages/table/src/methods.ts +1007 -492
- package/packages/table/src/props.ts +16 -6
- package/packages/table/src/table.ts +124 -33
- package/packages/table/src/util.ts +83 -63
- package/packages/ui/index.ts +19 -5
- package/styles/components/table.scss +313 -274
- package/styles/theme/base.scss +4 -6
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -0
- /package/es/{iconfont.1736854649055.ttf → iconfont.1739008141486.ttf} +0 -0
- /package/es/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
- /package/es/{iconfont.1736854649055.woff2 → iconfont.1739008141486.woff2} +0 -0
- /package/lib/{iconfont.1736854649055.ttf → iconfont.1739008141486.ttf} +0 -0
- /package/lib/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
- /package/lib/{iconfont.1736854649055.woff2 → iconfont.1739008141486.woff2} +0 -0
package/es/table/src/props.js
CHANGED
|
@@ -29,10 +29,10 @@ export default {
|
|
|
29
29
|
type: [Boolean, String],
|
|
30
30
|
default: () => getConfig().table.border
|
|
31
31
|
},
|
|
32
|
-
//
|
|
32
|
+
// 已废弃,被 cell-config.padding 替换
|
|
33
33
|
padding: {
|
|
34
34
|
type: Boolean,
|
|
35
|
-
default:
|
|
35
|
+
default: null
|
|
36
36
|
},
|
|
37
37
|
// 是否圆角边框
|
|
38
38
|
round: {
|
|
@@ -81,12 +81,18 @@ export default {
|
|
|
81
81
|
type: Boolean,
|
|
82
82
|
default: () => getConfig().table.highlightHoverRow
|
|
83
83
|
},
|
|
84
|
-
|
|
84
|
+
/**
|
|
85
|
+
* (即将废弃)是否要高亮当前选中列
|
|
86
|
+
* @deprecated
|
|
87
|
+
*/
|
|
85
88
|
highlightCurrentColumn: {
|
|
86
89
|
type: Boolean,
|
|
87
90
|
default: () => getConfig().table.highlightCurrentColumn
|
|
88
91
|
},
|
|
89
|
-
|
|
92
|
+
/**
|
|
93
|
+
* (即将废弃)鼠标移到列是否要高亮显示
|
|
94
|
+
* @deprecated
|
|
95
|
+
*/
|
|
90
96
|
highlightHoverColumn: {
|
|
91
97
|
type: Boolean,
|
|
92
98
|
default: () => getConfig().table.highlightHoverColumn
|
|
@@ -157,6 +163,10 @@ export default {
|
|
|
157
163
|
columnConfig: Object,
|
|
158
164
|
// 单元格配置信息
|
|
159
165
|
cellConfig: Object,
|
|
166
|
+
// 表头单元格配置信息
|
|
167
|
+
headerCellConfig: Object,
|
|
168
|
+
// 表尾单元格配置信息
|
|
169
|
+
footerCellConfig: Object,
|
|
160
170
|
// 行配置信息
|
|
161
171
|
rowConfig: Object,
|
|
162
172
|
// 已废弃,被 rowDragConfig 替换
|
package/es/table/src/table.js
CHANGED
|
@@ -165,7 +165,7 @@ const renderDragTip = (h, $xeTable) => {
|
|
|
165
165
|
}
|
|
166
166
|
return renderEmptyElement($xeTable);
|
|
167
167
|
};
|
|
168
|
-
function
|
|
168
|
+
function handleUpdateResize(_vm) {
|
|
169
169
|
const { $el } = _vm;
|
|
170
170
|
if ($el && $el.clientWidth && $el.clientHeight) {
|
|
171
171
|
_vm.recalculate();
|
|
@@ -342,8 +342,7 @@ export default {
|
|
|
342
342
|
const xID = XEUtils.uniqueId();
|
|
343
343
|
return {
|
|
344
344
|
xID,
|
|
345
|
-
tId:
|
|
346
|
-
isCalcColumn: false,
|
|
345
|
+
tId: xID,
|
|
347
346
|
// 低性能的静态列
|
|
348
347
|
staticColumns: [],
|
|
349
348
|
// 渲染的列分组
|
|
@@ -554,15 +553,17 @@ export default {
|
|
|
554
553
|
isFooter: false
|
|
555
554
|
},
|
|
556
555
|
scrollVMLoading: false,
|
|
557
|
-
|
|
556
|
+
calcCellHeightFlag: 0,
|
|
557
|
+
resizeHeightFlag: 0,
|
|
558
558
|
isCustomStatus: false,
|
|
559
559
|
isDragRowMove: false,
|
|
560
560
|
dragRow: null,
|
|
561
561
|
isDragColMove: false,
|
|
562
562
|
dragCol: null,
|
|
563
563
|
dragTipText: '',
|
|
564
|
-
|
|
565
|
-
|
|
564
|
+
isDragResize: false,
|
|
565
|
+
isRowLoading: false,
|
|
566
|
+
isColLoading: false,
|
|
566
567
|
reScrollFlag: 0,
|
|
567
568
|
reLayoutFlag: 0,
|
|
568
569
|
footFlag: 0
|
|
@@ -657,7 +658,7 @@ export default {
|
|
|
657
658
|
const $xeTable = this;
|
|
658
659
|
const vSize = $xeTable.computeSize;
|
|
659
660
|
const rowHeightMaps = $xeTable.computeRowHeightMaps;
|
|
660
|
-
return rowHeightMaps[vSize || 'default'];
|
|
661
|
+
return rowHeightMaps[vSize || 'default'] || 18;
|
|
661
662
|
},
|
|
662
663
|
columnOpts() {
|
|
663
664
|
return this.computeColumnOpts;
|
|
@@ -666,7 +667,19 @@ export default {
|
|
|
666
667
|
return Object.assign({}, getConfig().table.columnConfig, this.columnConfig);
|
|
667
668
|
},
|
|
668
669
|
computeCellOpts() {
|
|
669
|
-
|
|
670
|
+
const $xeTable = this;
|
|
671
|
+
const props = $xeTable;
|
|
672
|
+
return Object.assign({}, getConfig().table.cellConfig, props.cellConfig);
|
|
673
|
+
},
|
|
674
|
+
computeHeaderCellOpts() {
|
|
675
|
+
const $xeTable = this;
|
|
676
|
+
const props = $xeTable;
|
|
677
|
+
return Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
678
|
+
},
|
|
679
|
+
computeFooterCellOpts() {
|
|
680
|
+
const $xeTable = this;
|
|
681
|
+
const props = $xeTable;
|
|
682
|
+
return Object.assign({}, getConfig().table.footerCellConfig, props.footerCellConfig);
|
|
670
683
|
},
|
|
671
684
|
rowOpts() {
|
|
672
685
|
return this.computeRowOpts;
|
|
@@ -719,6 +732,18 @@ export default {
|
|
|
719
732
|
tipConfig() {
|
|
720
733
|
return Object.assign({}, this.tooltipOpts);
|
|
721
734
|
},
|
|
735
|
+
computeTableTipConfig() {
|
|
736
|
+
const $xeTable = this;
|
|
737
|
+
const reactData = $xeTable;
|
|
738
|
+
const { tooltipStore } = reactData;
|
|
739
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
740
|
+
return Object.assign({}, tooltipOpts, tooltipStore.currOpts);
|
|
741
|
+
},
|
|
742
|
+
computeValidTipConfig() {
|
|
743
|
+
const $xeTable = this;
|
|
744
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
745
|
+
return Object.assign({}, tooltipOpts);
|
|
746
|
+
},
|
|
722
747
|
validTipOpts() {
|
|
723
748
|
return Object.assign({ isArrow: false }, this.tooltipOpts);
|
|
724
749
|
},
|
|
@@ -771,24 +796,54 @@ export default {
|
|
|
771
796
|
return Object.assign({}, getConfig().table.fnrConfig, this.fnrConfig);
|
|
772
797
|
},
|
|
773
798
|
headerCtxMenu() {
|
|
774
|
-
|
|
799
|
+
return this.computeHeaderMenu;
|
|
800
|
+
},
|
|
801
|
+
computeHeaderMenu() {
|
|
802
|
+
const $xeTable = this;
|
|
803
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
804
|
+
const headerOpts = menuOpts.header;
|
|
775
805
|
return headerOpts && headerOpts.options ? headerOpts.options : [];
|
|
776
806
|
},
|
|
777
807
|
bodyCtxMenu() {
|
|
778
|
-
|
|
808
|
+
return this.computeBodyMenu;
|
|
809
|
+
},
|
|
810
|
+
computeBodyMenu() {
|
|
811
|
+
const $xeTable = this;
|
|
812
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
813
|
+
const bodyOpts = menuOpts.body;
|
|
779
814
|
return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
|
|
780
815
|
},
|
|
781
816
|
footerCtxMenu() {
|
|
782
|
-
|
|
817
|
+
return this.computeFooterMenu;
|
|
818
|
+
},
|
|
819
|
+
computeFooterMenu() {
|
|
820
|
+
const $xeTable = this;
|
|
821
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
822
|
+
const footerOpts = menuOpts.footer;
|
|
783
823
|
return footerOpts && footerOpts.options ? footerOpts.options : [];
|
|
784
824
|
},
|
|
785
825
|
isCtxMenu() {
|
|
786
|
-
return
|
|
826
|
+
return this.computeIsMenu;
|
|
827
|
+
},
|
|
828
|
+
computeIsMenu() {
|
|
829
|
+
const $xeTable = this;
|
|
830
|
+
const props = $xeTable;
|
|
831
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
832
|
+
const headerMenu = $xeTable.computeHeaderMenu;
|
|
833
|
+
const bodyMenu = $xeTable.computeBodyMenu;
|
|
834
|
+
const footerMenu = $xeTable.computeFooterMenu;
|
|
835
|
+
return !!((props.contextMenu || props.menuConfig) && isEnableConf(menuOpts) && (headerMenu.length || bodyMenu.length || footerMenu.length));
|
|
787
836
|
},
|
|
788
837
|
ctxMenuList() {
|
|
838
|
+
return this.computeMenuList;
|
|
839
|
+
},
|
|
840
|
+
computeMenuList() {
|
|
841
|
+
const $xeTable = this;
|
|
842
|
+
const reactData = $xeTable;
|
|
843
|
+
const { ctxMenuStore } = reactData;
|
|
789
844
|
const rest = [];
|
|
790
|
-
|
|
791
|
-
list.forEach(item => {
|
|
845
|
+
ctxMenuStore.list.forEach((list) => {
|
|
846
|
+
list.forEach((item) => {
|
|
792
847
|
rest.push(item);
|
|
793
848
|
});
|
|
794
849
|
});
|
|
@@ -963,7 +1018,7 @@ export default {
|
|
|
963
1018
|
if (value && value.length >= 50000) {
|
|
964
1019
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
965
1020
|
}
|
|
966
|
-
this.loadTableData(value || []).then(() => {
|
|
1021
|
+
this.loadTableData(value || [], true).then(() => {
|
|
967
1022
|
this.inited = true;
|
|
968
1023
|
this.initStatus = true;
|
|
969
1024
|
if (!initStatus) {
|
|
@@ -1031,10 +1086,10 @@ export default {
|
|
|
1031
1086
|
},
|
|
1032
1087
|
syncResize(value) {
|
|
1033
1088
|
if (value) {
|
|
1034
|
-
|
|
1089
|
+
handleUpdateResize(this);
|
|
1035
1090
|
this.$nextTick(() => {
|
|
1036
|
-
|
|
1037
|
-
setTimeout(() =>
|
|
1091
|
+
handleUpdateResize(this);
|
|
1092
|
+
setTimeout(() => handleUpdateResize(this));
|
|
1038
1093
|
});
|
|
1039
1094
|
}
|
|
1040
1095
|
},
|
|
@@ -1136,11 +1191,14 @@ export default {
|
|
|
1136
1191
|
if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
|
|
1137
1192
|
warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow']);
|
|
1138
1193
|
}
|
|
1194
|
+
if (treeConfig && !treeOpts.transform && this.stripe) {
|
|
1195
|
+
warnLog('vxe.error.noTree', ['stripe']);
|
|
1196
|
+
}
|
|
1139
1197
|
if (this.showFooter && !(this.footerMethod || this.footerData)) {
|
|
1140
1198
|
warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
|
|
1141
1199
|
}
|
|
1142
|
-
if (
|
|
1143
|
-
warnLog('vxe.error.
|
|
1200
|
+
if (rowOpts.height) {
|
|
1201
|
+
warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
|
|
1144
1202
|
}
|
|
1145
1203
|
if (this.tooltipOpts.enabled) {
|
|
1146
1204
|
warnLog('vxe.error.delProp', ['tooltip-config.enabled', 'tooltip-config.showAll']);
|
|
@@ -1282,7 +1340,7 @@ export default {
|
|
|
1282
1340
|
endIndex: 1,
|
|
1283
1341
|
visibleSize: 0
|
|
1284
1342
|
});
|
|
1285
|
-
this.loadTableData(data).then(() => {
|
|
1343
|
+
this.loadTableData(data, true).then(() => {
|
|
1286
1344
|
if (data && data.length) {
|
|
1287
1345
|
this.inited = true;
|
|
1288
1346
|
this.initStatus = true;
|
|
@@ -1390,10 +1448,11 @@ export default {
|
|
|
1390
1448
|
const reactData = $xeTable;
|
|
1391
1449
|
const { xID } = $xeTable;
|
|
1392
1450
|
const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props;
|
|
1393
|
-
const {
|
|
1451
|
+
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, columnStore, filterStore, customStore } = reactData;
|
|
1394
1452
|
const { leftList, rightList } = columnStore;
|
|
1395
1453
|
const loadingSlot = slots.loading;
|
|
1396
|
-
const
|
|
1454
|
+
const tableTipConfig = $xeTable.computeTableTipConfig;
|
|
1455
|
+
const validTipConfig = $xeTable.computeValidTipConfig;
|
|
1397
1456
|
const validOpts = $xeTable.computeValidOpts;
|
|
1398
1457
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
1399
1458
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -1405,7 +1464,7 @@ export default {
|
|
|
1405
1464
|
const areaOpts = $xeTable.computeAreaOpts;
|
|
1406
1465
|
const loadingOpts = $xeTable.computeLoadingOpts;
|
|
1407
1466
|
const isMenu = $xeTable.computeIsMenu;
|
|
1408
|
-
const currLoading = reactData.
|
|
1467
|
+
const currLoading = reactData.isColLoading || reactData.isRowLoading || loading;
|
|
1409
1468
|
const resizableOpts = $xeTable.computeResizableOpts;
|
|
1410
1469
|
const isArea = mouseConfig && mouseOpts.area;
|
|
1411
1470
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
@@ -1426,7 +1485,6 @@ export default {
|
|
|
1426
1485
|
'row--highlight': rowOpts.isHover || highlightHoverRow,
|
|
1427
1486
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
1428
1487
|
'checkbox--range': checkboxOpts.range,
|
|
1429
|
-
'column--calc': isCalcColumn,
|
|
1430
1488
|
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
1431
1489
|
'is--header': showHeader,
|
|
1432
1490
|
'is--footer': showFooter,
|
|
@@ -1435,7 +1493,6 @@ export default {
|
|
|
1435
1493
|
'is--fixed-left': leftList.length,
|
|
1436
1494
|
'is--fixed-right': rightList.length,
|
|
1437
1495
|
'is--animat': !!props.animat,
|
|
1438
|
-
'is--padding': props.padding,
|
|
1439
1496
|
'is--round': props.round,
|
|
1440
1497
|
'is--stripe': !treeConfig && stripe,
|
|
1441
1498
|
'is--loading': currLoading,
|
|
@@ -1494,13 +1551,27 @@ export default {
|
|
|
1494
1551
|
* 列宽线
|
|
1495
1552
|
*/
|
|
1496
1553
|
h('div', {
|
|
1497
|
-
key: '
|
|
1498
|
-
ref: '
|
|
1499
|
-
class: 'vxe-table--resizable-bar'
|
|
1554
|
+
key: 'tcl',
|
|
1555
|
+
ref: 'refColResizeBar',
|
|
1556
|
+
class: 'vxe-table--resizable-col-bar'
|
|
1557
|
+
}, resizableOpts.showDragTip
|
|
1558
|
+
? [
|
|
1559
|
+
h('div', {
|
|
1560
|
+
ref: 'refColResizeTip',
|
|
1561
|
+
class: 'vxe-table--resizable-number-tip'
|
|
1562
|
+
})
|
|
1563
|
+
]
|
|
1564
|
+
: []),
|
|
1565
|
+
/**
|
|
1566
|
+
* 行高线
|
|
1567
|
+
*/
|
|
1568
|
+
h('div', {
|
|
1569
|
+
key: 'trl',
|
|
1570
|
+
ref: 'refRowResizeBar',
|
|
1571
|
+
class: 'vxe-table--resizable-row-bar'
|
|
1500
1572
|
}, resizableOpts.showDragTip
|
|
1501
1573
|
? [
|
|
1502
1574
|
h('div', {
|
|
1503
|
-
ref: 'refCellResizeTip',
|
|
1504
1575
|
class: 'vxe-table--resizable-number-tip'
|
|
1505
1576
|
})
|
|
1506
1577
|
]
|
|
@@ -1615,8 +1686,13 @@ export default {
|
|
|
1615
1686
|
VxeUITooltipComponent
|
|
1616
1687
|
? h(VxeUITooltipComponent, {
|
|
1617
1688
|
key: 'btp',
|
|
1618
|
-
ref: '
|
|
1619
|
-
props:
|
|
1689
|
+
ref: 'refTooltip',
|
|
1690
|
+
props: {
|
|
1691
|
+
theme: tableTipConfig.theme,
|
|
1692
|
+
enterable: tableTipConfig.enterable,
|
|
1693
|
+
enterDelay: tableTipConfig.enterDelay,
|
|
1694
|
+
leaveDelay: tableTipConfig.leaveDelay
|
|
1695
|
+
}
|
|
1620
1696
|
})
|
|
1621
1697
|
: renderEmptyElement($xeTable),
|
|
1622
1698
|
/**
|
|
@@ -1629,7 +1705,12 @@ export default {
|
|
|
1629
1705
|
class: [{
|
|
1630
1706
|
'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete'
|
|
1631
1707
|
}, 'vxe-table--valid-error'],
|
|
1632
|
-
props:
|
|
1708
|
+
props: {
|
|
1709
|
+
theme: validTipConfig.theme,
|
|
1710
|
+
enterable: validTipConfig.enterable,
|
|
1711
|
+
enterDelay: validTipConfig.enterDelay,
|
|
1712
|
+
leaveDelay: validTipConfig.leaveDelay
|
|
1713
|
+
}
|
|
1633
1714
|
})
|
|
1634
1715
|
: renderEmptyElement($xeTable)
|
|
1635
1716
|
])
|
package/es/table/src/util.js
CHANGED
|
@@ -116,9 +116,15 @@ function getElementMarginWidth(elem) {
|
|
|
116
116
|
}
|
|
117
117
|
return 0;
|
|
118
118
|
}
|
|
119
|
+
export function getCellHeight(height) {
|
|
120
|
+
if (height === 'unset') {
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
return height || 0;
|
|
124
|
+
}
|
|
119
125
|
export function handleFieldOrColumn(_vm, fieldOrColumn) {
|
|
120
126
|
if (fieldOrColumn) {
|
|
121
|
-
return XEUtils.isString(fieldOrColumn) ? _vm.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
127
|
+
return XEUtils.isString(fieldOrColumn) || XEUtils.isNumber(fieldOrColumn) ? _vm.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
|
|
122
128
|
}
|
|
123
129
|
return null;
|
|
124
130
|
}
|
|
@@ -180,6 +186,7 @@ export function toFilters(filters) {
|
|
|
180
186
|
}
|
|
181
187
|
export function getColReMinWidth(params) {
|
|
182
188
|
const { $table, column, cell } = params;
|
|
189
|
+
const internalData = $table;
|
|
183
190
|
const { showHeaderOverflow: allColumnHeaderOverflow, resizableOpts } = $table;
|
|
184
191
|
const { minWidth } = resizableOpts;
|
|
185
192
|
// 如果自定义调整宽度逻辑
|
|
@@ -189,6 +196,7 @@ export function getColReMinWidth(params) {
|
|
|
189
196
|
return Math.max(1, XEUtils.toNumber(customMinWidth));
|
|
190
197
|
}
|
|
191
198
|
}
|
|
199
|
+
const { elemStore } = internalData;
|
|
192
200
|
const { showHeaderOverflow, minWidth: colMinWidth } = column;
|
|
193
201
|
const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
194
202
|
const showEllipsis = headOverflow === 'ellipsis';
|
|
@@ -212,11 +220,10 @@ export function getColReMinWidth(params) {
|
|
|
212
220
|
}
|
|
213
221
|
// 如果设置最小宽
|
|
214
222
|
if (colMinWidth) {
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
if (bodyElem) {
|
|
223
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
224
|
+
if (bodyScrollElem) {
|
|
218
225
|
if (isScale(colMinWidth)) {
|
|
219
|
-
const bodyWidth =
|
|
226
|
+
const bodyWidth = bodyScrollElem.clientWidth - 1;
|
|
220
227
|
const meanWidth = bodyWidth / 100;
|
|
221
228
|
return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMinWidth) * meanWidth));
|
|
222
229
|
}
|
|
@@ -257,13 +264,31 @@ export function getOffsetSize($xeTable) {
|
|
|
257
264
|
return 0;
|
|
258
265
|
}
|
|
259
266
|
export function calcTreeLine(params, prevRow) {
|
|
260
|
-
const { $table } = params;
|
|
267
|
+
const { $table, row } = params;
|
|
268
|
+
const tableProps = $table;
|
|
261
269
|
const tableReactData = $table;
|
|
270
|
+
const tableInternalData = $table;
|
|
271
|
+
const { showOverflow } = tableProps;
|
|
272
|
+
const { scrollYLoad } = tableReactData;
|
|
273
|
+
const { fullAllDataRowIdData } = tableInternalData;
|
|
274
|
+
const rowOpts = $table.computeRowOpts;
|
|
275
|
+
const cellOpts = $table.computeCellOpts;
|
|
276
|
+
const defaultRowHeight = $table.computeDefaultRowHeight;
|
|
277
|
+
const rowid = getRowid($table, row);
|
|
278
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
279
|
+
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
262
280
|
let expandSize = 1;
|
|
263
281
|
if (prevRow) {
|
|
264
282
|
expandSize = countTreeExpand(prevRow, params);
|
|
265
283
|
}
|
|
266
|
-
|
|
284
|
+
let cellHeight = currCellHeight;
|
|
285
|
+
const vnHeight = rowRest.height;
|
|
286
|
+
if (scrollYLoad) {
|
|
287
|
+
if (!showOverflow) {
|
|
288
|
+
cellHeight = vnHeight || currCellHeight;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return cellHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)));
|
|
267
292
|
}
|
|
268
293
|
export function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
|
|
269
294
|
for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
|
|
@@ -327,29 +352,23 @@ export function createColumn($xeTable, options, renderOptions) {
|
|
|
327
352
|
return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions);
|
|
328
353
|
}
|
|
329
354
|
export function rowToVisible($xeTable, row) {
|
|
355
|
+
const tableProps = $xeTable;
|
|
330
356
|
const reactData = $xeTable;
|
|
331
357
|
const internalData = $xeTable;
|
|
332
|
-
const tableProps = $xeTable;
|
|
333
358
|
const { showOverflow } = tableProps;
|
|
334
|
-
const
|
|
335
|
-
const {
|
|
336
|
-
const
|
|
337
|
-
const
|
|
338
|
-
const
|
|
339
|
-
const
|
|
359
|
+
const { scrollYLoad } = reactData;
|
|
360
|
+
const { elemStore, afterFullData, fullAllDataRowIdData, isResizeCellHeight } = internalData;
|
|
361
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
362
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
363
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
364
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
365
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
366
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
340
367
|
const rowid = getRowid($xeTable, row);
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
let offsetFixedRight = 0;
|
|
346
|
-
rightList.forEach((item) => {
|
|
347
|
-
offsetFixedRight += item.renderWidth;
|
|
348
|
-
});
|
|
349
|
-
if (bodyElem) {
|
|
350
|
-
const bodyHeight = bodyElem.clientHeight;
|
|
351
|
-
const bodyScrollTop = bodyElem.scrollTop;
|
|
352
|
-
const trElem = bodyElem.querySelector(`[rowid="${rowid}"]`);
|
|
368
|
+
if (bodyScrollElem) {
|
|
369
|
+
const bodyHeight = bodyScrollElem.clientHeight;
|
|
370
|
+
const bodyScrollTop = bodyScrollElem.scrollTop;
|
|
371
|
+
const trElem = bodyScrollElem.querySelector(`[rowid="${rowid}"]`);
|
|
353
372
|
if (trElem) {
|
|
354
373
|
const trOffsetParent = trElem.offsetParent;
|
|
355
374
|
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0);
|
|
@@ -365,67 +384,63 @@ export function rowToVisible($xeTable, row) {
|
|
|
365
384
|
else {
|
|
366
385
|
// 如果是虚拟渲染滚动
|
|
367
386
|
if (scrollYLoad) {
|
|
368
|
-
|
|
369
|
-
|
|
387
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
388
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
389
|
+
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
|
|
370
390
|
}
|
|
371
391
|
let scrollTop = 0;
|
|
372
392
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
373
|
-
const rHeight = rowRest
|
|
393
|
+
const rHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
374
394
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
375
395
|
const currRow = afterFullData[i];
|
|
376
396
|
const currRowid = getRowid($xeTable, currRow);
|
|
377
397
|
if (currRow === row || currRowid === rowid) {
|
|
378
398
|
break;
|
|
379
399
|
}
|
|
380
|
-
const
|
|
381
|
-
scrollTop +=
|
|
400
|
+
const currRowRest = fullAllDataRowIdData[currRowid];
|
|
401
|
+
scrollTop += currRowRest.resizeHeight || cellOpts.height || rowOpts.height || currRowRest.height || defaultRowHeight;
|
|
382
402
|
}
|
|
383
403
|
if (scrollTop < bodyScrollTop) {
|
|
384
|
-
return $xeTable.scrollTo(null, scrollTop -
|
|
404
|
+
return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
|
|
385
405
|
}
|
|
386
|
-
return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight -
|
|
406
|
+
return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight - rightFixedWidth - 1));
|
|
387
407
|
}
|
|
388
408
|
}
|
|
389
409
|
}
|
|
390
410
|
return Promise.resolve();
|
|
391
411
|
}
|
|
392
412
|
export function colToVisible($xeTable, column, row) {
|
|
393
|
-
const
|
|
394
|
-
const
|
|
395
|
-
const {
|
|
396
|
-
const
|
|
413
|
+
const reactData = $xeTable;
|
|
414
|
+
const internalData = $xeTable;
|
|
415
|
+
const { scrollXLoad } = reactData;
|
|
416
|
+
const { elemStore, visibleColumn } = internalData;
|
|
417
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
418
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
419
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
397
420
|
if (column.fixed) {
|
|
398
421
|
return Promise.resolve();
|
|
399
422
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
});
|
|
404
|
-
let offsetFixedRight = 0;
|
|
405
|
-
rightList.forEach((item) => {
|
|
406
|
-
offsetFixedRight += item.renderWidth;
|
|
407
|
-
});
|
|
408
|
-
if (bodyElem) {
|
|
409
|
-
const bodyWidth = bodyElem.clientWidth;
|
|
410
|
-
const bodyScrollLeft = bodyElem.scrollLeft;
|
|
423
|
+
if (bodyScrollElem) {
|
|
424
|
+
const bodyWidth = bodyScrollElem.clientWidth;
|
|
425
|
+
const bodyScrollLeft = bodyScrollElem.scrollLeft;
|
|
411
426
|
let tdElem = null;
|
|
412
427
|
if (row) {
|
|
413
428
|
const rowid = getRowid($xeTable, row);
|
|
414
|
-
tdElem =
|
|
429
|
+
tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
|
|
415
430
|
}
|
|
416
431
|
if (!tdElem) {
|
|
417
|
-
tdElem =
|
|
432
|
+
tdElem = bodyScrollElem.querySelector(`.${column.id}`);
|
|
418
433
|
}
|
|
419
434
|
if (tdElem) {
|
|
420
435
|
const tdOffsetParent = tdElem.offsetParent;
|
|
421
436
|
const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0);
|
|
422
437
|
const cellWidth = tdElem.clientWidth;
|
|
423
438
|
// 检测是否在可视区中
|
|
424
|
-
if (tdOffsetLeft < (bodyScrollLeft +
|
|
425
|
-
return $xeTable.scrollTo(tdOffsetLeft -
|
|
439
|
+
if (tdOffsetLeft < (bodyScrollLeft + leftFixedWidth)) {
|
|
440
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
|
|
426
441
|
}
|
|
427
|
-
else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth -
|
|
428
|
-
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth -
|
|
442
|
+
else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth - rightFixedWidth)) {
|
|
443
|
+
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1));
|
|
429
444
|
}
|
|
430
445
|
}
|
|
431
446
|
else {
|
|
@@ -434,15 +449,16 @@ export function colToVisible($xeTable, column, row) {
|
|
|
434
449
|
let scrollLeft = 0;
|
|
435
450
|
const cellWidth = column.renderWidth;
|
|
436
451
|
for (let i = 0; i < visibleColumn.length; i++) {
|
|
437
|
-
|
|
452
|
+
const currCol = visibleColumn[i];
|
|
453
|
+
if (currCol === column || currCol.id === column.id) {
|
|
438
454
|
break;
|
|
439
455
|
}
|
|
440
|
-
scrollLeft +=
|
|
456
|
+
scrollLeft += currCol.renderWidth;
|
|
441
457
|
}
|
|
442
458
|
if (scrollLeft < bodyScrollLeft) {
|
|
443
|
-
return $xeTable.scrollTo(scrollLeft -
|
|
459
|
+
return $xeTable.scrollTo(scrollLeft - leftFixedWidth - 1);
|
|
444
460
|
}
|
|
445
|
-
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth -
|
|
461
|
+
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1));
|
|
446
462
|
}
|
|
447
463
|
}
|
|
448
464
|
}
|