vxe-table 3.9.21 → 3.10.0-beta.0
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/locale/lang/ja-JP.js +5 -5
- package/es/locale/lang/ko-KR.js +5 -5
- package/es/locale/lang/uk-UA.js +5 -5
- package/es/locale/lang/vi-VN.js +5 -5
- package/es/locale/lang/zh-CHT.js +5 -5
- package/es/locale/lang/zh-CN.js +5 -5
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +3 -3
- package/es/table/src/body.js +50 -115
- package/es/table/src/footer.js +24 -21
- package/es/table/src/methods.js +392 -123
- package/es/table/src/table.js +68 -10
- package/es/table/src/util.js +58 -33
- package/es/table/style.css +46 -3
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +46 -3
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.umd.js +672 -361
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +5 -5
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -5
- package/lib/locale/lang/ko-KR.js +5 -5
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +5 -5
- package/lib/locale/lang/uk-UA.js +5 -5
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +5 -5
- package/lib/locale/lang/vi-VN.js +5 -5
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +5 -5
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +5 -5
- package/lib/locale/lang/zh-CN.js +5 -5
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +5 -5
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +6 -3
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +49 -118
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +24 -33
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/methods.js +449 -148
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +61 -13
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +72 -38
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +46 -3
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +46 -3
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ja-JP.ts +5 -5
- package/packages/locale/lang/ko-KR.ts +5 -5
- package/packages/locale/lang/uk-UA.ts +5 -5
- package/packages/locale/lang/vi-VN.ts +5 -5
- package/packages/locale/lang/zh-CHT.ts +5 -5
- package/packages/locale/lang/zh-CN.ts +5 -5
- package/packages/table/module/edit/mixin.ts +3 -3
- package/packages/table/src/body.ts +50 -118
- package/packages/table/src/footer.ts +24 -22
- package/packages/table/src/methods.ts +418 -127
- package/packages/table/src/props.ts +8 -8
- package/packages/table/src/table.ts +70 -10
- package/packages/table/src/util.ts +61 -36
- package/packages/ui/index.ts +1 -1
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/components/table.scss +45 -6
- package/styles/modules.scss +0 -2
- package/styles/theme/base.scss +1 -1
- package/styles/theme/dark.scss +7 -4
- package/styles/variable.scss +5 -1
- /package/es/{iconfont.1729992873866.ttf → iconfont.1730347297462.ttf} +0 -0
- /package/es/{iconfont.1729992873866.woff → iconfont.1730347297462.woff} +0 -0
- /package/es/{iconfont.1729992873866.woff2 → iconfont.1730347297462.woff2} +0 -0
- /package/lib/{iconfont.1729992873866.ttf → iconfont.1730347297462.ttf} +0 -0
- /package/lib/{iconfont.1729992873866.woff → iconfont.1730347297462.woff} +0 -0
- /package/lib/{iconfont.1729992873866.woff2 → iconfont.1730347297462.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -20,7 +20,7 @@ import exportMixin from '../module/export/mixin';
|
|
|
20
20
|
import keyboardMixin from '../module/keyboard/mixin';
|
|
21
21
|
import validatorMixin from '../module/validator/mixin';
|
|
22
22
|
import customMixin from '../module/custom/mixin';
|
|
23
|
-
const { getConfig, getI18n, renderer, globalResize, globalEvents, globalMixins } = VxeUI;
|
|
23
|
+
const { getConfig, getI18n, renderer, globalResize, globalEvents, globalMixins, renderEmptyElement } = VxeUI;
|
|
24
24
|
/**
|
|
25
25
|
* 渲染浮固定列
|
|
26
26
|
* 分别渲染左边固定列和右边固定列
|
|
@@ -73,7 +73,7 @@ function renderFixed(h, $xetable, fixedType) {
|
|
|
73
73
|
: _e()
|
|
74
74
|
]);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function renderEmptyBody(h, _vm) {
|
|
77
77
|
const { $scopedSlots, emptyOpts } = _vm;
|
|
78
78
|
let emptyContent = '';
|
|
79
79
|
const params = { $table: _vm };
|
|
@@ -619,6 +619,15 @@ export default {
|
|
|
619
619
|
}
|
|
620
620
|
return false;
|
|
621
621
|
},
|
|
622
|
+
computeVirtualScrollBars() {
|
|
623
|
+
const $xeTable = this;
|
|
624
|
+
const reactData = $xeTable;
|
|
625
|
+
const { overflowX, scrollXLoad, overflowY, scrollYLoad } = reactData;
|
|
626
|
+
return {
|
|
627
|
+
x: overflowX && scrollXLoad,
|
|
628
|
+
y: overflowY && scrollYLoad
|
|
629
|
+
};
|
|
630
|
+
},
|
|
622
631
|
tabsResizeFlag() {
|
|
623
632
|
const $xeTable = this;
|
|
624
633
|
const $xeTabs = $xeTable.$xeTabs;
|
|
@@ -1002,10 +1011,12 @@ export default {
|
|
|
1002
1011
|
// 使用已安装的组件,如果未安装则不渲染
|
|
1003
1012
|
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
|
|
1004
1013
|
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
1005
|
-
const
|
|
1014
|
+
const $xeTable = this;
|
|
1015
|
+
const { _e, $scopedSlots, tId, isCalcColumn, tableData, tableColumn, tableGroupColumn, isGroup, loading, stripe, showHeader, height, tableBorder, treeOpts, treeConfig, mouseConfig, mouseOpts, computeSize, validOpts, showFooter, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, validTipOpts, initStore, columnStore, filterStore, customStore, ctxMenuStore, ctxMenuOpts, footerTableData, columnOpts, rowOpts, checkboxOpts, loadingOpts, editRules } = $xeTable;
|
|
1006
1016
|
const { leftList, rightList } = columnStore;
|
|
1007
1017
|
const currLoading = this._isLoading || loading;
|
|
1008
1018
|
const vSize = computeSize;
|
|
1019
|
+
const virtualScrollBars = $xeTable.computeVirtualScrollBars;
|
|
1009
1020
|
return h('div', {
|
|
1010
1021
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
|
|
1011
1022
|
[`valid-msg--${validOpts.msgMode}`]: !!editRules,
|
|
@@ -1050,6 +1061,7 @@ export default {
|
|
|
1050
1061
|
ref: 'hideColumn'
|
|
1051
1062
|
}, this.$slots.default),
|
|
1052
1063
|
h('div', {
|
|
1064
|
+
key: 'tw',
|
|
1053
1065
|
class: 'vxe-table--render-wrapper'
|
|
1054
1066
|
}, [
|
|
1055
1067
|
h('div', {
|
|
@@ -1097,37 +1109,74 @@ export default {
|
|
|
1097
1109
|
h('div', {
|
|
1098
1110
|
class: 'vxe-table--fixed-wrapper'
|
|
1099
1111
|
}, [
|
|
1100
|
-
/**
|
|
1101
|
-
* 左侧固定区域
|
|
1102
|
-
*/
|
|
1103
1112
|
leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(),
|
|
1104
|
-
/**
|
|
1105
|
-
* 右侧固定区域
|
|
1106
|
-
*/
|
|
1107
1113
|
rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e()
|
|
1108
1114
|
])
|
|
1109
1115
|
]),
|
|
1116
|
+
virtualScrollBars.x
|
|
1117
|
+
? h('div', {
|
|
1118
|
+
key: 'vx',
|
|
1119
|
+
ref: 'refScrollXVirtualElem',
|
|
1120
|
+
class: 'vxe-table--scroll-x-virtual'
|
|
1121
|
+
}, [
|
|
1122
|
+
h('div', {
|
|
1123
|
+
ref: 'refScrollXHandleElem',
|
|
1124
|
+
class: 'vxe-table--scroll-x-handle',
|
|
1125
|
+
on: {
|
|
1126
|
+
scroll: $xeTable.scrollXEvent
|
|
1127
|
+
}
|
|
1128
|
+
}, [
|
|
1129
|
+
h('div', {
|
|
1130
|
+
ref: 'refScrollXSpaceElem',
|
|
1131
|
+
class: 'vxe-table--scroll-x-space'
|
|
1132
|
+
})
|
|
1133
|
+
])
|
|
1134
|
+
])
|
|
1135
|
+
: renderEmptyElement($xeTable),
|
|
1136
|
+
virtualScrollBars.y
|
|
1137
|
+
? h('div', {
|
|
1138
|
+
key: 'vy',
|
|
1139
|
+
ref: 'refScrollYVirtualElem',
|
|
1140
|
+
class: 'vxe-table--scroll-y-virtual'
|
|
1141
|
+
}, [
|
|
1142
|
+
h('div', {
|
|
1143
|
+
ref: 'refScrollYHandleElem',
|
|
1144
|
+
class: 'vxe-table--scroll-y-handle',
|
|
1145
|
+
on: {
|
|
1146
|
+
scroll: $xeTable.scrollYEvent
|
|
1147
|
+
}
|
|
1148
|
+
}, [
|
|
1149
|
+
h('div', {
|
|
1150
|
+
ref: 'refScrollYSpaceElem',
|
|
1151
|
+
class: 'vxe-table--scroll-x-space'
|
|
1152
|
+
})
|
|
1153
|
+
])
|
|
1154
|
+
])
|
|
1155
|
+
: renderEmptyElement($xeTable),
|
|
1110
1156
|
/**
|
|
1111
1157
|
* 空数据
|
|
1112
1158
|
*/
|
|
1113
1159
|
h('div', {
|
|
1160
|
+
key: 'tn',
|
|
1114
1161
|
ref: 'emptyPlaceholder',
|
|
1115
1162
|
class: 'vxe-table--empty-placeholder'
|
|
1116
1163
|
}, [
|
|
1117
1164
|
h('div', {
|
|
1118
1165
|
class: 'vxe-table--empty-content'
|
|
1119
|
-
},
|
|
1166
|
+
}, renderEmptyBody(h, this))
|
|
1120
1167
|
]),
|
|
1121
1168
|
/**
|
|
1122
1169
|
* 边框线
|
|
1123
1170
|
*/
|
|
1124
1171
|
h('div', {
|
|
1172
|
+
key: 'tl',
|
|
1125
1173
|
class: 'vxe-table--border-line'
|
|
1126
1174
|
}),
|
|
1127
1175
|
/**
|
|
1128
1176
|
* 列宽线
|
|
1129
1177
|
*/
|
|
1130
1178
|
h('div', {
|
|
1179
|
+
key: 'cl',
|
|
1131
1180
|
class: 'vxe-table--resizable-bar',
|
|
1132
1181
|
style: overflowX
|
|
1133
1182
|
? {
|
|
@@ -1141,6 +1190,7 @@ export default {
|
|
|
1141
1190
|
*/
|
|
1142
1191
|
VxeUILoadingComponent
|
|
1143
1192
|
? h(VxeUILoadingComponent, {
|
|
1193
|
+
key: 'lg',
|
|
1144
1194
|
class: 'vxe-table--loading',
|
|
1145
1195
|
props: {
|
|
1146
1196
|
value: currLoading,
|
|
@@ -1154,6 +1204,7 @@ export default {
|
|
|
1154
1204
|
*/
|
|
1155
1205
|
initStore.custom
|
|
1156
1206
|
? h(TableCustomPanelComponent, {
|
|
1207
|
+
key: 'cs',
|
|
1157
1208
|
ref: 'customWrapper',
|
|
1158
1209
|
props: {
|
|
1159
1210
|
customStore
|
|
@@ -1165,6 +1216,7 @@ export default {
|
|
|
1165
1216
|
*/
|
|
1166
1217
|
initStore.filter
|
|
1167
1218
|
? h(TableFilterPanelComponent, {
|
|
1219
|
+
key: 'tf',
|
|
1168
1220
|
ref: 'filterWrapper',
|
|
1169
1221
|
props: {
|
|
1170
1222
|
filterStore
|
|
@@ -1176,6 +1228,7 @@ export default {
|
|
|
1176
1228
|
*/
|
|
1177
1229
|
initStore.import && this.importConfig
|
|
1178
1230
|
? h(TableImportPanelComponent, {
|
|
1231
|
+
key: 'it',
|
|
1179
1232
|
props: {
|
|
1180
1233
|
defaultOptions: this.importParams,
|
|
1181
1234
|
storeData: this.importStore
|
|
@@ -1187,6 +1240,7 @@ export default {
|
|
|
1187
1240
|
*/
|
|
1188
1241
|
initStore.export && (this.exportConfig || this.printConfig)
|
|
1189
1242
|
? h(TableExportPanelComponent, {
|
|
1243
|
+
key: 'et',
|
|
1190
1244
|
props: {
|
|
1191
1245
|
defaultOptions: this.exportParams,
|
|
1192
1246
|
storeData: this.exportStore
|
|
@@ -1198,6 +1252,7 @@ export default {
|
|
|
1198
1252
|
*/
|
|
1199
1253
|
ctxMenuStore.visible && this.isCtxMenu
|
|
1200
1254
|
? h(TableMenuPanelComponent, {
|
|
1255
|
+
key: 'tm',
|
|
1201
1256
|
ref: 'ctxWrapper',
|
|
1202
1257
|
props: {
|
|
1203
1258
|
ctxMenuStore,
|
|
@@ -1211,6 +1266,7 @@ export default {
|
|
|
1211
1266
|
*/
|
|
1212
1267
|
VxeUITooltipComponent
|
|
1213
1268
|
? h(VxeUITooltipComponent, {
|
|
1269
|
+
key: 'ctp',
|
|
1214
1270
|
ref: 'commTip',
|
|
1215
1271
|
props: {
|
|
1216
1272
|
isArrow: false,
|
|
@@ -1223,6 +1279,7 @@ export default {
|
|
|
1223
1279
|
*/
|
|
1224
1280
|
VxeUITooltipComponent
|
|
1225
1281
|
? h(VxeUITooltipComponent, {
|
|
1282
|
+
key: 'btp',
|
|
1226
1283
|
ref: 'tooltip',
|
|
1227
1284
|
props: Object.assign({}, this.tipConfig, this.tooltipStore.currOpts)
|
|
1228
1285
|
})
|
|
@@ -1232,6 +1289,7 @@ export default {
|
|
|
1232
1289
|
*/
|
|
1233
1290
|
VxeUITooltipComponent && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
|
|
1234
1291
|
? h(VxeUITooltipComponent, {
|
|
1292
|
+
key: 'vtp',
|
|
1235
1293
|
ref: 'validTip',
|
|
1236
1294
|
class: [{
|
|
1237
1295
|
'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete'
|
package/es/table/src/util.js
CHANGED
|
@@ -80,16 +80,6 @@ export function restoreScrollLocation(_vm, scrollLeft, scrollTop) {
|
|
|
80
80
|
export function toTreePathSeq(path) {
|
|
81
81
|
return path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
|
|
82
82
|
}
|
|
83
|
-
export function removeScrollListener(scrollElem) {
|
|
84
|
-
if (scrollElem && scrollElem._onscroll) {
|
|
85
|
-
scrollElem.onscroll = null;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
export function restoreScrollListener(scrollElem) {
|
|
89
|
-
if (scrollElem && scrollElem._onscroll) {
|
|
90
|
-
scrollElem.onscroll = scrollElem._onscroll;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
83
|
/**
|
|
94
84
|
* 生成行的唯一主键
|
|
95
85
|
*/
|
|
@@ -317,30 +307,62 @@ export function isColumnInfo(column) {
|
|
|
317
307
|
export function createColumn($xeTable, options, renderOptions) {
|
|
318
308
|
return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions);
|
|
319
309
|
}
|
|
320
|
-
export function rowToVisible($
|
|
321
|
-
const {
|
|
310
|
+
export function rowToVisible($xeTable, row) {
|
|
311
|
+
const { reactData, internalData } = $xeTable;
|
|
312
|
+
const tableProps = $xeTable;
|
|
313
|
+
const { showOverflow } = tableProps;
|
|
314
|
+
const tableBody = $xeTable.$refs.tableBody;
|
|
315
|
+
const { columnStore, scrollYLoad } = reactData;
|
|
316
|
+
const { afterFullData, scrollYStore, fullAllDataRowIdData } = internalData;
|
|
317
|
+
const { leftList, rightList } = columnStore;
|
|
322
318
|
const bodyElem = tableBody ? tableBody.$el : null;
|
|
319
|
+
const rowid = getRowid($xeTable, row);
|
|
320
|
+
let offsetFixedLeft = 0;
|
|
321
|
+
leftList.forEach(item => {
|
|
322
|
+
offsetFixedLeft += item.renderWidth;
|
|
323
|
+
});
|
|
324
|
+
let offsetFixedRight = 0;
|
|
325
|
+
rightList.forEach(item => {
|
|
326
|
+
offsetFixedRight += item.renderWidth;
|
|
327
|
+
});
|
|
323
328
|
if (bodyElem) {
|
|
324
|
-
const
|
|
329
|
+
const bodyHeight = bodyElem.clientHeight;
|
|
330
|
+
const bodyScrollTop = bodyElem.scrollTop;
|
|
331
|
+
const trElem = bodyElem.querySelector(`[rowid="${rowid}"]`);
|
|
325
332
|
if (trElem) {
|
|
326
|
-
const
|
|
327
|
-
const
|
|
328
|
-
const trOffsetTop = trElem.offsetTop + (trElem.offsetParent ? trElem.offsetParent.offsetTop : 0);
|
|
333
|
+
const trOffsetParent = trElem.offsetParent;
|
|
334
|
+
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0);
|
|
329
335
|
const trHeight = trElem.clientHeight;
|
|
330
336
|
// 检测行是否在可视区中
|
|
331
|
-
if (trOffsetTop <
|
|
332
|
-
|
|
333
|
-
return $xetable.scrollTo(null, trOffsetTop);
|
|
337
|
+
if (trOffsetTop < bodyScrollTop || trOffsetTop > bodyScrollTop + bodyHeight) {
|
|
338
|
+
return $xeTable.scrollTo(null, trOffsetTop);
|
|
334
339
|
}
|
|
335
|
-
else if (trOffsetTop + trHeight >= bodyHeight +
|
|
336
|
-
|
|
337
|
-
return $xetable.scrollTo(null, bodySrcollTop + trHeight);
|
|
340
|
+
else if (trOffsetTop + trHeight >= bodyHeight + bodyScrollTop) {
|
|
341
|
+
return $xeTable.scrollTo(null, bodyScrollTop + trHeight);
|
|
338
342
|
}
|
|
339
343
|
}
|
|
340
344
|
else {
|
|
341
|
-
//
|
|
342
|
-
if (
|
|
343
|
-
|
|
345
|
+
// 如果是虚拟渲染滚动
|
|
346
|
+
if (scrollYLoad) {
|
|
347
|
+
if (showOverflow) {
|
|
348
|
+
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * scrollYStore.rowHeight);
|
|
349
|
+
}
|
|
350
|
+
let scrollTop = 0;
|
|
351
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
352
|
+
const rHeight = rest ? rest.height : 0;
|
|
353
|
+
for (let i = 0; i < afterFullData.length; i++) {
|
|
354
|
+
const currRow = afterFullData[i];
|
|
355
|
+
const currRowid = getRowid($xeTable, currRow);
|
|
356
|
+
if (currRow === row || currRowid === rowid) {
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
const rest = fullAllDataRowIdData[currRowid];
|
|
360
|
+
scrollTop += rest ? rest.height : 0;
|
|
361
|
+
}
|
|
362
|
+
if (scrollTop < bodyScrollTop) {
|
|
363
|
+
return $xeTable.scrollTo(null, scrollTop - offsetFixedLeft - 1);
|
|
364
|
+
}
|
|
365
|
+
return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight - offsetFixedRight - 1));
|
|
344
366
|
}
|
|
345
367
|
}
|
|
346
368
|
}
|
|
@@ -348,9 +370,12 @@ export function rowToVisible($xetable, row) {
|
|
|
348
370
|
}
|
|
349
371
|
export function colToVisible($xeTable, column) {
|
|
350
372
|
const { columnStore, scrollXLoad, visibleColumn } = $xeTable;
|
|
351
|
-
const
|
|
373
|
+
const tableBody = $xeTable.$refs.tableBody;
|
|
352
374
|
const { leftList, rightList } = columnStore;
|
|
353
375
|
const bodyElem = tableBody ? tableBody.$el : null;
|
|
376
|
+
if (column.fixed) {
|
|
377
|
+
return Promise.resolve();
|
|
378
|
+
}
|
|
354
379
|
let offsetFixedLeft = 0;
|
|
355
380
|
leftList.forEach((item) => {
|
|
356
381
|
offsetFixedLeft += item.renderWidth;
|
|
@@ -361,16 +386,16 @@ export function colToVisible($xeTable, column) {
|
|
|
361
386
|
});
|
|
362
387
|
if (bodyElem) {
|
|
363
388
|
const bodyWidth = bodyElem.clientWidth;
|
|
364
|
-
const
|
|
389
|
+
const bodyScrollLeft = bodyElem.scrollLeft;
|
|
365
390
|
const tdElem = bodyElem.querySelector(`.${column.id}`);
|
|
366
391
|
if (tdElem) {
|
|
367
392
|
const tdOffsetLeft = tdElem.offsetLeft + (tdElem.offsetParent ? tdElem.offsetParent.offsetLeft : 0);
|
|
368
393
|
const cellWidth = tdElem.clientWidth;
|
|
369
394
|
// 检测是否在可视区中
|
|
370
|
-
if (tdOffsetLeft < (
|
|
395
|
+
if (tdOffsetLeft < (bodyScrollLeft + offsetFixedLeft)) {
|
|
371
396
|
return $xeTable.scrollTo(tdOffsetLeft - offsetFixedLeft - 1);
|
|
372
397
|
}
|
|
373
|
-
else if ((tdOffsetLeft + cellWidth -
|
|
398
|
+
else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth - offsetFixedRight)) {
|
|
374
399
|
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - offsetFixedRight - 1));
|
|
375
400
|
}
|
|
376
401
|
}
|
|
@@ -379,13 +404,13 @@ export function colToVisible($xeTable, column) {
|
|
|
379
404
|
if (scrollXLoad) {
|
|
380
405
|
let scrollLeft = 0;
|
|
381
406
|
const cellWidth = column.renderWidth;
|
|
382
|
-
for (let
|
|
383
|
-
if (visibleColumn[
|
|
407
|
+
for (let i = 0; i < visibleColumn.length; i++) {
|
|
408
|
+
if (visibleColumn[i] === column) {
|
|
384
409
|
break;
|
|
385
410
|
}
|
|
386
|
-
scrollLeft += visibleColumn[
|
|
411
|
+
scrollLeft += visibleColumn[i].renderWidth;
|
|
387
412
|
}
|
|
388
|
-
if (scrollLeft <
|
|
413
|
+
if (scrollLeft < bodyScrollLeft) {
|
|
389
414
|
return $xeTable.scrollTo(scrollLeft - offsetFixedLeft - 1);
|
|
390
415
|
}
|
|
391
416
|
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth - offsetFixedRight - 1));
|
package/es/table/style.css
CHANGED
|
@@ -1373,7 +1373,7 @@
|
|
|
1373
1373
|
border-radius: var(--vxe-ui-border-radius);
|
|
1374
1374
|
background-color: var(--vxe-ui-layout-background-color);
|
|
1375
1375
|
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
1376
|
-
box-shadow:
|
|
1376
|
+
box-shadow: var(--vxe-ui-base-popup-box-shadow);
|
|
1377
1377
|
z-index: 10;
|
|
1378
1378
|
}
|
|
1379
1379
|
.vxe-table--filter-wrapper:not(.is--multiple) {
|
|
@@ -2045,10 +2045,10 @@
|
|
|
2045
2045
|
/*单元格编辑状态*/
|
|
2046
2046
|
/*可编辑*/
|
|
2047
2047
|
}
|
|
2048
|
-
.vxe-table--render-default .vxe-table--body-wrapper
|
|
2048
|
+
.vxe-table--render-default .vxe-table--body-wrapper {
|
|
2049
2049
|
background-color: var(--vxe-ui-layout-background-color);
|
|
2050
2050
|
}
|
|
2051
|
-
.vxe-table--render-default .vxe-table--footer-wrapper
|
|
2051
|
+
.vxe-table--render-default .vxe-table--footer-wrapper {
|
|
2052
2052
|
background-color: var(--vxe-ui-table-footer-background-color);
|
|
2053
2053
|
}
|
|
2054
2054
|
.vxe-table--render-default .vxe-table--header,
|
|
@@ -2277,6 +2277,48 @@
|
|
|
2277
2277
|
.vxe-table--render-default.size--mini .vxe-cell .vxe-default-input[type=date]::-webkit-inner-spin-button {
|
|
2278
2278
|
margin-top: 1px;
|
|
2279
2279
|
}
|
|
2280
|
+
.vxe-table--render-default .vxe-table--scroll-x-virtual,
|
|
2281
|
+
.vxe-table--render-default .vxe-table--scroll-y-virtual {
|
|
2282
|
+
position: absolute;
|
|
2283
|
+
z-index: 7;
|
|
2284
|
+
overflow: hidden;
|
|
2285
|
+
}
|
|
2286
|
+
.vxe-table--render-default .vxe-table--scroll-x-handle,
|
|
2287
|
+
.vxe-table--render-default .vxe-table--scroll-y-handle {
|
|
2288
|
+
position: absolute;
|
|
2289
|
+
}
|
|
2290
|
+
.vxe-table--render-default .vxe-table--scroll-x-handle div,
|
|
2291
|
+
.vxe-table--render-default .vxe-table--scroll-y-handle div {
|
|
2292
|
+
display: block;
|
|
2293
|
+
}
|
|
2294
|
+
.vxe-table--render-default .vxe-table--scroll-x-virtual,
|
|
2295
|
+
.vxe-table--render-default .vxe-table--scroll-x-handle {
|
|
2296
|
+
width: 100%;
|
|
2297
|
+
left: 0;
|
|
2298
|
+
bottom: 0;
|
|
2299
|
+
}
|
|
2300
|
+
.vxe-table--render-default .vxe-table--scroll-x-handle {
|
|
2301
|
+
overflow-y: hidden;
|
|
2302
|
+
overflow-x: auto;
|
|
2303
|
+
height: 18px;
|
|
2304
|
+
}
|
|
2305
|
+
.vxe-table--render-default .vxe-table--scroll-y-virtual,
|
|
2306
|
+
.vxe-table--render-default .vxe-table--scroll-y-handle {
|
|
2307
|
+
height: 100%;
|
|
2308
|
+
right: 0;
|
|
2309
|
+
top: 0;
|
|
2310
|
+
}
|
|
2311
|
+
.vxe-table--render-default .vxe-table--scroll-y-handle {
|
|
2312
|
+
overflow-y: auto;
|
|
2313
|
+
overflow-x: hidden;
|
|
2314
|
+
width: 18px;
|
|
2315
|
+
}
|
|
2316
|
+
.vxe-table--render-default .vxe-table--scroll-x-space {
|
|
2317
|
+
height: 1px;
|
|
2318
|
+
}
|
|
2319
|
+
.vxe-table--render-default .vxe-table--scroll-y-space {
|
|
2320
|
+
width: 1px;
|
|
2321
|
+
}
|
|
2280
2322
|
.vxe-table--render-default.is--padding .vxe-cell {
|
|
2281
2323
|
padding-left: var(--vxe-ui-table-cell-padding-left);
|
|
2282
2324
|
padding-right: var(--vxe-ui-table-cell-padding-right);
|
|
@@ -2375,6 +2417,7 @@
|
|
|
2375
2417
|
background-color: inherit;
|
|
2376
2418
|
transition: 0.3s box-shadow;
|
|
2377
2419
|
outline: 0;
|
|
2420
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
2378
2421
|
}
|
|
2379
2422
|
.vxe-table--render-default .vxe-table--fixed-left-wrapper .vxe-table--body-wrapper,
|
|
2380
2423
|
.vxe-table--render-default .vxe-table--fixed-right-wrapper .vxe-table--body-wrapper {
|