vxe-table 3.20.0-beta.21 → 3.20.0-beta.22
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/style.css +1 -1
- package/es/table/module/keyboard/mixin.js +14 -7
- package/es/table/src/methods.js +14 -14
- package/es/table/src/util.js +18 -12
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +37 -25
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/keyboard/mixin.js +13 -5
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/methods.js +7 -7
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +15 -11
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -1
- 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/package.json +1 -1
- package/packages/table/module/keyboard/mixin.ts +17 -11
- package/packages/table/src/methods.ts +14 -14
- package/packages/table/src/util.ts +21 -11
- /package/es/{iconfont.1770255814901.ttf → iconfont.1770264667973.ttf} +0 -0
- /package/es/{iconfont.1770255814901.woff → iconfont.1770264667973.woff} +0 -0
- /package/es/{iconfont.1770255814901.woff2 → iconfont.1770264667973.woff2} +0 -0
- /package/lib/{iconfont.1770255814901.ttf → iconfont.1770264667973.ttf} +0 -0
- /package/lib/{iconfont.1770255814901.woff → iconfont.1770264667973.woff} +0 -0
- /package/lib/{iconfont.1770255814901.woff2 → iconfont.1770264667973.woff2} +0 -0
|
@@ -80,7 +80,11 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
|
|
|
80
80
|
const params = Object.assign({}, args);
|
|
81
81
|
const _rowIndex = $xeTable.getVTRowIndex(params.row);
|
|
82
82
|
const _columnIndex = $xeTable.getVTColumnIndex(params.column);
|
|
83
|
-
|
|
83
|
+
let colAlign = isLeftArrow || isRightArrow;
|
|
84
|
+
if (visibleColumn.length <= 1 && ((isLeftArrow && _columnIndex >= 0) || (isRightArrow && _columnIndex <= visibleColumn.length - 1))) {
|
|
85
|
+
colAlign = false;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
84
88
|
evnt.preventDefault();
|
|
85
89
|
}
|
|
86
90
|
if (isUpArrow && _rowIndex > 0) {
|
|
@@ -103,8 +107,9 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
|
|
|
103
107
|
params.columnIndex = _columnIndex + 1;
|
|
104
108
|
params.column = visibleColumn[params.columnIndex];
|
|
105
109
|
}
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
$xeTable.scrollToRow(params.row, params.column, {
|
|
111
|
+
colAlign
|
|
112
|
+
}).then(() => {
|
|
108
113
|
params.cell = $xeTable.getCellElement(params.row, params.column);
|
|
109
114
|
$xeTable.handleSelected(params, evnt);
|
|
110
115
|
});
|
|
@@ -350,16 +355,18 @@ export default {
|
|
|
350
355
|
$xeTable.handleEdit(params, evnt);
|
|
351
356
|
}
|
|
352
357
|
else {
|
|
353
|
-
$xeTable.scrollToRow(params.row, params.column
|
|
354
|
-
|
|
358
|
+
$xeTable.scrollToRow(params.row, params.column, {
|
|
359
|
+
colAlign: true
|
|
360
|
+
}).then(() => {
|
|
355
361
|
$xeTable.handleSelected(params, evnt);
|
|
356
362
|
});
|
|
357
363
|
}
|
|
358
364
|
}
|
|
359
365
|
}
|
|
360
366
|
else {
|
|
361
|
-
$xeTable.scrollToRow(params.row, params.column
|
|
362
|
-
|
|
367
|
+
$xeTable.scrollToRow(params.row, params.column, {
|
|
368
|
+
colAlign: true
|
|
369
|
+
}).then(() => {
|
|
363
370
|
$xeTable.handleSelected(params, evnt);
|
|
364
371
|
});
|
|
365
372
|
}
|
package/es/table/src/methods.js
CHANGED
|
@@ -2818,12 +2818,12 @@ function handleTooltip($xeTable, evnt, tipOpts, type, tdEl, overflowElem, tipEle
|
|
|
2818
2818
|
}
|
|
2819
2819
|
return $xeTable.$nextTick();
|
|
2820
2820
|
}
|
|
2821
|
-
function handleScrollToRowColumn($xeTable, fieldOrColumn, row) {
|
|
2821
|
+
function handleScrollToRowColumn($xeTable, fieldOrColumn, row, options) {
|
|
2822
2822
|
const internalData = $xeTable;
|
|
2823
2823
|
const { fullColumnIdData } = internalData;
|
|
2824
2824
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
2825
2825
|
if (column && fullColumnIdData[column.id]) {
|
|
2826
|
-
return colToVisible($xeTable, column, row);
|
|
2826
|
+
return colToVisible($xeTable, !!(options && options.colAlign), column, row);
|
|
2827
2827
|
}
|
|
2828
2828
|
return $xeTable.$nextTick();
|
|
2829
2829
|
}
|
|
@@ -11877,7 +11877,7 @@ const tableMethods = {
|
|
|
11877
11877
|
* @param {Row} row 行对象
|
|
11878
11878
|
* @param {ColumnInfo} column 列配置
|
|
11879
11879
|
*/
|
|
11880
|
-
scrollToRow(row, fieldOrColumn) {
|
|
11880
|
+
scrollToRow(row, fieldOrColumn, options) {
|
|
11881
11881
|
const $xeTable = this;
|
|
11882
11882
|
const props = $xeTable;
|
|
11883
11883
|
const reactData = $xeTable;
|
|
@@ -11892,7 +11892,7 @@ const tableMethods = {
|
|
|
11892
11892
|
}
|
|
11893
11893
|
}
|
|
11894
11894
|
if (fieldOrColumn) {
|
|
11895
|
-
rest.push(handleScrollToRowColumn($xeTable, fieldOrColumn, row));
|
|
11895
|
+
rest.push(handleScrollToRowColumn($xeTable, fieldOrColumn, row, options));
|
|
11896
11896
|
}
|
|
11897
11897
|
return Promise.all(rest).then(() => {
|
|
11898
11898
|
if (row) {
|
|
@@ -11907,46 +11907,46 @@ const tableMethods = {
|
|
|
11907
11907
|
/**
|
|
11908
11908
|
* 如果有滚动条,则滚动到第一行
|
|
11909
11909
|
*/
|
|
11910
|
-
scrollToStartRow(fieldOrColumn) {
|
|
11910
|
+
scrollToStartRow(fieldOrColumn, options) {
|
|
11911
11911
|
const $xeTable = this;
|
|
11912
11912
|
const internalData = $xeTable;
|
|
11913
11913
|
const { afterFullData } = internalData;
|
|
11914
|
-
return $xeTable.scrollToRow(afterFullData[0], fieldOrColumn);
|
|
11914
|
+
return $xeTable.scrollToRow(afterFullData[0], fieldOrColumn, options);
|
|
11915
11915
|
},
|
|
11916
11916
|
/**
|
|
11917
11917
|
* 如果有滚动条,则滚动到最后一行
|
|
11918
11918
|
*/
|
|
11919
|
-
scrollToEndRow(fieldOrColumn) {
|
|
11919
|
+
scrollToEndRow(fieldOrColumn, options) {
|
|
11920
11920
|
const $xeTable = this;
|
|
11921
11921
|
const internalData = $xeTable;
|
|
11922
11922
|
const { afterFullData } = internalData;
|
|
11923
|
-
return $xeTable.scrollToRow(afterFullData[afterFullData.length - 1], fieldOrColumn);
|
|
11923
|
+
return $xeTable.scrollToRow(afterFullData[afterFullData.length - 1], fieldOrColumn, options);
|
|
11924
11924
|
},
|
|
11925
11925
|
/**
|
|
11926
11926
|
* 如果有滚动条,则滚动到对应的列
|
|
11927
11927
|
* @param {ColumnInfo} column 列配置
|
|
11928
11928
|
*/
|
|
11929
|
-
scrollToColumn(fieldOrColumn) {
|
|
11929
|
+
scrollToColumn(fieldOrColumn, options) {
|
|
11930
11930
|
const $xeTable = this;
|
|
11931
|
-
return handleScrollToRowColumn($xeTable, fieldOrColumn);
|
|
11931
|
+
return handleScrollToRowColumn($xeTable, null, fieldOrColumn, options);
|
|
11932
11932
|
},
|
|
11933
11933
|
/**
|
|
11934
11934
|
* 如果有滚动条,则滚动到第一列
|
|
11935
11935
|
*/
|
|
11936
|
-
scrollToStartColumn() {
|
|
11936
|
+
scrollToStartColumn(options) {
|
|
11937
11937
|
const $xeTable = this;
|
|
11938
11938
|
const internalData = $xeTable;
|
|
11939
11939
|
const { visibleColumn } = internalData;
|
|
11940
|
-
return $xeTable.scrollToColumn(visibleColumn[0]);
|
|
11940
|
+
return $xeTable.scrollToColumn(visibleColumn[0], options);
|
|
11941
11941
|
},
|
|
11942
11942
|
/**
|
|
11943
11943
|
* 如果有滚动条,则滚动到最后一列
|
|
11944
11944
|
*/
|
|
11945
|
-
scrollToEndColumn() {
|
|
11945
|
+
scrollToEndColumn(options) {
|
|
11946
11946
|
const $xeTable = this;
|
|
11947
11947
|
const internalData = $xeTable;
|
|
11948
11948
|
const { visibleColumn } = internalData;
|
|
11949
|
-
return $xeTable.scrollToColumn(visibleColumn[visibleColumn.length - 1]);
|
|
11949
|
+
return $xeTable.scrollToColumn(visibleColumn[visibleColumn.length - 1], options);
|
|
11950
11950
|
},
|
|
11951
11951
|
/**
|
|
11952
11952
|
* 对于树形结构中,可以直接滚动到指定深层节点中
|
package/es/table/src/util.js
CHANGED
|
@@ -869,7 +869,7 @@ export function rowToVisible($xeTable, row) {
|
|
|
869
869
|
}
|
|
870
870
|
return Promise.resolve();
|
|
871
871
|
}
|
|
872
|
-
export function colToVisible($xeTable, column, row) {
|
|
872
|
+
export function colToVisible($xeTable, isForce, column, row) {
|
|
873
873
|
const reactData = $xeTable;
|
|
874
874
|
const internalData = $xeTable;
|
|
875
875
|
const { scrollXLoad, scrollXLeft } = reactData;
|
|
@@ -895,29 +895,35 @@ export function colToVisible($xeTable, column, row) {
|
|
|
895
895
|
const tdOffsetLeft = tdElem.offsetLeft + (scrollXLoad ? scrollXLeft : 0);
|
|
896
896
|
const cellWidth = tdElem.clientWidth;
|
|
897
897
|
// 检测是否在可视区中
|
|
898
|
-
if (tdOffsetLeft
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
898
|
+
if (isForce || (!(tdOffsetLeft <= (bodyScrollLeft + leftFixedWidth) && (tdOffsetLeft + cellWidth) >= (bodyScrollLeft + leftFixedWidth)) &&
|
|
899
|
+
!(tdOffsetLeft >= (bodyScrollLeft + leftFixedWidth) && tdOffsetLeft <= (bodyScrollLeft + bodyWidth - rightFixedWidth)))) {
|
|
900
|
+
if (tdOffsetLeft < (bodyScrollLeft + leftFixedWidth)) {
|
|
901
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
|
|
902
|
+
}
|
|
903
|
+
else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth - rightFixedWidth)) {
|
|
904
|
+
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1));
|
|
905
|
+
}
|
|
903
906
|
}
|
|
904
907
|
}
|
|
905
908
|
else {
|
|
906
|
-
// 检测是否在虚拟渲染可视区中
|
|
907
909
|
if (scrollXLoad) {
|
|
908
|
-
let
|
|
910
|
+
let tdOffsetLeft = 0;
|
|
909
911
|
const cellWidth = column.renderWidth;
|
|
910
912
|
for (let i = 0; i < visibleColumn.length; i++) {
|
|
911
913
|
const currCol = visibleColumn[i];
|
|
912
914
|
if (currCol === column || currCol.id === column.id) {
|
|
913
915
|
break;
|
|
914
916
|
}
|
|
915
|
-
|
|
917
|
+
tdOffsetLeft += currCol.renderWidth;
|
|
916
918
|
}
|
|
917
|
-
|
|
918
|
-
|
|
919
|
+
// 检测是否在可视区中
|
|
920
|
+
if (isForce || (!(tdOffsetLeft <= (bodyScrollLeft + leftFixedWidth) && (tdOffsetLeft + cellWidth) >= (bodyScrollLeft + leftFixedWidth)) &&
|
|
921
|
+
!(tdOffsetLeft >= (bodyScrollLeft + leftFixedWidth) && tdOffsetLeft <= (bodyScrollLeft + bodyWidth - rightFixedWidth)))) {
|
|
922
|
+
if (tdOffsetLeft < bodyScrollLeft) {
|
|
923
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
|
|
924
|
+
}
|
|
925
|
+
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1));
|
|
919
926
|
}
|
|
920
|
-
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1));
|
|
921
927
|
}
|
|
922
928
|
}
|
|
923
929
|
}
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -2005,7 +2005,7 @@ function getClass(property, params) {
|
|
|
2005
2005
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2006
2006
|
|
|
2007
2007
|
|
|
2008
|
-
const version = "3.20.0-beta.
|
|
2008
|
+
const version = "3.20.0-beta.22";
|
|
2009
2009
|
core_.VxeUI.version = version;
|
|
2010
2010
|
core_.VxeUI.tableVersion = version;
|
|
2011
2011
|
core_.VxeUI.setConfig({
|
|
@@ -2739,7 +2739,7 @@ function scrollTopTo(diffNum, cb) {
|
|
|
2739
2739
|
const {
|
|
2740
2740
|
log: log_log
|
|
2741
2741
|
} = core_.VxeUI;
|
|
2742
|
-
const log_version = `table v${"3.20.0-beta.
|
|
2742
|
+
const log_version = `table v${"3.20.0-beta.22"}`;
|
|
2743
2743
|
const warnLog = log_log.create('warn', log_version);
|
|
2744
2744
|
const errLog = log_log.create('error', log_version);
|
|
2745
2745
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -3895,7 +3895,7 @@ function rowToVisible($xeTable, row) {
|
|
|
3895
3895
|
}
|
|
3896
3896
|
return Promise.resolve();
|
|
3897
3897
|
}
|
|
3898
|
-
function colToVisible($xeTable, column, row) {
|
|
3898
|
+
function colToVisible($xeTable, isForce, column, row) {
|
|
3899
3899
|
const reactData = $xeTable;
|
|
3900
3900
|
const internalData = $xeTable;
|
|
3901
3901
|
const {
|
|
@@ -3927,27 +3927,31 @@ function colToVisible($xeTable, column, row) {
|
|
|
3927
3927
|
const tdOffsetLeft = tdElem.offsetLeft + (scrollXLoad ? scrollXLeft : 0);
|
|
3928
3928
|
const cellWidth = tdElem.clientWidth;
|
|
3929
3929
|
// 检测是否在可视区中
|
|
3930
|
-
if (tdOffsetLeft
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3930
|
+
if (isForce || !(tdOffsetLeft <= bodyScrollLeft + leftFixedWidth && tdOffsetLeft + cellWidth >= bodyScrollLeft + leftFixedWidth) && !(tdOffsetLeft >= bodyScrollLeft + leftFixedWidth && tdOffsetLeft <= bodyScrollLeft + bodyWidth - rightFixedWidth)) {
|
|
3931
|
+
if (tdOffsetLeft < bodyScrollLeft + leftFixedWidth) {
|
|
3932
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
|
|
3933
|
+
} else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth - rightFixedWidth) {
|
|
3934
|
+
return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
3935
|
+
}
|
|
3934
3936
|
}
|
|
3935
3937
|
} else {
|
|
3936
|
-
// 检测是否在虚拟渲染可视区中
|
|
3937
3938
|
if (scrollXLoad) {
|
|
3938
|
-
let
|
|
3939
|
+
let tdOffsetLeft = 0;
|
|
3939
3940
|
const cellWidth = column.renderWidth;
|
|
3940
3941
|
for (let i = 0; i < visibleColumn.length; i++) {
|
|
3941
3942
|
const currCol = visibleColumn[i];
|
|
3942
3943
|
if (currCol === column || currCol.id === column.id) {
|
|
3943
3944
|
break;
|
|
3944
3945
|
}
|
|
3945
|
-
|
|
3946
|
+
tdOffsetLeft += currCol.renderWidth;
|
|
3946
3947
|
}
|
|
3947
|
-
|
|
3948
|
-
|
|
3948
|
+
// 检测是否在可视区中
|
|
3949
|
+
if (isForce || !(tdOffsetLeft <= bodyScrollLeft + leftFixedWidth && tdOffsetLeft + cellWidth >= bodyScrollLeft + leftFixedWidth) && !(tdOffsetLeft >= bodyScrollLeft + leftFixedWidth && tdOffsetLeft <= bodyScrollLeft + bodyWidth - rightFixedWidth)) {
|
|
3950
|
+
if (tdOffsetLeft < bodyScrollLeft) {
|
|
3951
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
|
|
3952
|
+
}
|
|
3953
|
+
return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
3949
3954
|
}
|
|
3950
|
-
return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
3951
3955
|
}
|
|
3952
3956
|
}
|
|
3953
3957
|
}
|
|
@@ -6373,7 +6377,7 @@ remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.
|
|
|
6373
6377
|
* 处理显示 tooltip
|
|
6374
6378
|
* @param {Event} evnt 事件
|
|
6375
6379
|
* @param {Row} row 行对象
|
|
6376
|
-
*/function handleTooltip($xeTable,evnt,tipOpts,type,tdEl,overflowElem,tipElem,params){const reactData=$xeTable;const tipOverEl=overflowElem||tdEl;if(!tipOverEl){return $xeTable.$nextTick();}params.cell=tdEl;const{tooltipStore}=reactData;const{column,row}=params;const{showAll,contentMethod}=tipOpts;const customContent=contentMethod?contentMethod(params):null;const useCustom=contentMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);const content=useCustom?customContent:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toString(column.type==='html'?tipOverEl.innerText:tipOverEl.textContent).trim();const isOver=tipOverEl.scrollWidth>tipOverEl.clientWidth;if(content&&(showAll||useCustom||isOver)){const tipContent=formatText(content);Object.assign(tooltipStore,{row,column,visible:true,content:tipContent,type,currOpts:tipOpts});$xeTable.$nextTick(()=>{const $tooltip=$xeTable.$refs.refTooltip;if($tooltip&&$tooltip.open){$tooltip.open(isOver?tipOverEl:tipElem,tipContent);}});}return $xeTable.$nextTick();}function handleScrollToRowColumn($xeTable,fieldOrColumn,row){const internalData=$xeTable;const{fullColumnIdData}=internalData;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(column&&fullColumnIdData[column.id]){return colToVisible($xeTable,column,row);}return $xeTable.$nextTick();}function handleRowExpandReserve($xeTable,row,expanded){const internalData=$xeTable;const{rowExpandedReserveRowMap}=internalData;const expandOpts=$xeTable.computeExpandOpts;if(expandOpts.reserve){const rowid=getRowid($xeTable,row);if(expanded){rowExpandedReserveRowMap[rowid]=row;}else if(rowExpandedReserveRowMap[rowid]){delete rowExpandedReserveRowMap[rowid];}}}function handleDefaultMergeCells($xeTable){const props=$xeTable;const{mergeCells}=props;if(mergeCells){$xeTable.setMergeCells(mergeCells);}}function handleDefaultMergeHeaderItems($xeTable){const props=$xeTable;const{mergeHeaderCells}=props;if(mergeHeaderCells){$xeTable.setMergeHeaderCells(mergeHeaderCells);}}function handleDefaultMergeFooterItems($xeTable){const props=$xeTable;const{mergeFooterCells,mergeFooterItems}=props;const mFooterCells=mergeFooterCells||mergeFooterItems;if(mFooterCells){$xeTable.setMergeFooterCells(mFooterCells);}}// 计算可视渲染相关数据
|
|
6380
|
+
*/function handleTooltip($xeTable,evnt,tipOpts,type,tdEl,overflowElem,tipElem,params){const reactData=$xeTable;const tipOverEl=overflowElem||tdEl;if(!tipOverEl){return $xeTable.$nextTick();}params.cell=tdEl;const{tooltipStore}=reactData;const{column,row}=params;const{showAll,contentMethod}=tipOpts;const customContent=contentMethod?contentMethod(params):null;const useCustom=contentMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);const content=useCustom?customContent:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toString(column.type==='html'?tipOverEl.innerText:tipOverEl.textContent).trim();const isOver=tipOverEl.scrollWidth>tipOverEl.clientWidth;if(content&&(showAll||useCustom||isOver)){const tipContent=formatText(content);Object.assign(tooltipStore,{row,column,visible:true,content:tipContent,type,currOpts:tipOpts});$xeTable.$nextTick(()=>{const $tooltip=$xeTable.$refs.refTooltip;if($tooltip&&$tooltip.open){$tooltip.open(isOver?tipOverEl:tipElem,tipContent);}});}return $xeTable.$nextTick();}function handleScrollToRowColumn($xeTable,fieldOrColumn,row,options){const internalData=$xeTable;const{fullColumnIdData}=internalData;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(column&&fullColumnIdData[column.id]){return colToVisible($xeTable,!!(options&&options.colAlign),column,row);}return $xeTable.$nextTick();}function handleRowExpandReserve($xeTable,row,expanded){const internalData=$xeTable;const{rowExpandedReserveRowMap}=internalData;const expandOpts=$xeTable.computeExpandOpts;if(expandOpts.reserve){const rowid=getRowid($xeTable,row);if(expanded){rowExpandedReserveRowMap[rowid]=row;}else if(rowExpandedReserveRowMap[rowid]){delete rowExpandedReserveRowMap[rowid];}}}function handleDefaultMergeCells($xeTable){const props=$xeTable;const{mergeCells}=props;if(mergeCells){$xeTable.setMergeCells(mergeCells);}}function handleDefaultMergeHeaderItems($xeTable){const props=$xeTable;const{mergeHeaderCells}=props;if(mergeHeaderCells){$xeTable.setMergeHeaderCells(mergeHeaderCells);}}function handleDefaultMergeFooterItems($xeTable){const props=$xeTable;const{mergeFooterCells,mergeFooterItems}=props;const mFooterCells=mergeFooterCells||mergeFooterItems;if(mFooterCells){$xeTable.setMergeFooterCells(mFooterCells);}}// 计算可视渲染相关数据
|
|
6377
6381
|
function computeScrollLoad($xeTable){const reactData=$xeTable;const internalData=$xeTable;return $xeTable.$nextTick().then(()=>{const{scrollXLoad,scrollYLoad}=reactData;const{scrollXStore,scrollYStore}=internalData;const virtualYOpts=$xeTable.computeVirtualYOpts;const virtualXOpts=$xeTable.computeVirtualXOpts;// 计算 X 逻辑
|
|
6378
6382
|
if(scrollXLoad){const{toVisibleIndex:toXVisibleIndex,visibleSize:visibleXSize}=handleVirtualXVisible($xeTable);const offsetXSize=Math.max(0,virtualXOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize):0);scrollXStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);scrollXStore.offsetSize=offsetXSize;scrollXStore.visibleSize=visibleXSize;scrollXStore.endIndex=Math.max(scrollXStore.startIndex+scrollXStore.visibleSize+offsetXSize,scrollXStore.endIndex);scrollXStore.visibleStartIndex=Math.max(scrollXStore.startIndex,toXVisibleIndex);scrollXStore.visibleEndIndex=Math.min(scrollXStore.endIndex,toXVisibleIndex+visibleXSize);$xeTable.updateScrollXData().then(()=>{loadScrollXData($xeTable);});}else{$xeTable.updateScrollXSpace();}// 计算 Y 逻辑
|
|
6379
6383
|
const rowHeight=computeRowHeight($xeTable);scrollYStore.rowHeight=rowHeight;// 已废弃
|
|
@@ -7008,18 +7012,18 @@ if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHei
|
|
|
7008
7012
|
* 如果有滚动条,则滚动到对应的行
|
|
7009
7013
|
* @param {Row} row 行对象
|
|
7010
7014
|
* @param {ColumnInfo} column 列配置
|
|
7011
|
-
*/scrollToRow(row,fieldOrColumn){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const{isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const rest=[];if(row){if(props.treeConfig){rest.push($xeTable.scrollToTreeRow(row));}else{rest.push(rowToVisible($xeTable,row));}}if(fieldOrColumn){rest.push(handleScrollToRowColumn($xeTable,fieldOrColumn,row));}return Promise.all(rest).then(()=>{if(row){if(!isAllOverflow&&(scrollYLoad||scrollXLoad)){calcCellHeight($xeTable);calcCellWidth($xeTable);}return $xeTable.$nextTick();}});},/**
|
|
7015
|
+
*/scrollToRow(row,fieldOrColumn,options){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const{isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const rest=[];if(row){if(props.treeConfig){rest.push($xeTable.scrollToTreeRow(row));}else{rest.push(rowToVisible($xeTable,row));}}if(fieldOrColumn){rest.push(handleScrollToRowColumn($xeTable,fieldOrColumn,row,options));}return Promise.all(rest).then(()=>{if(row){if(!isAllOverflow&&(scrollYLoad||scrollXLoad)){calcCellHeight($xeTable);calcCellWidth($xeTable);}return $xeTable.$nextTick();}});},/**
|
|
7012
7016
|
* 如果有滚动条,则滚动到第一行
|
|
7013
|
-
*/scrollToStartRow(fieldOrColumn){const $xeTable=this;const internalData=$xeTable;const{afterFullData}=internalData;return $xeTable.scrollToRow(afterFullData[0],fieldOrColumn);},/**
|
|
7017
|
+
*/scrollToStartRow(fieldOrColumn,options){const $xeTable=this;const internalData=$xeTable;const{afterFullData}=internalData;return $xeTable.scrollToRow(afterFullData[0],fieldOrColumn,options);},/**
|
|
7014
7018
|
* 如果有滚动条,则滚动到最后一行
|
|
7015
|
-
*/scrollToEndRow(fieldOrColumn){const $xeTable=this;const internalData=$xeTable;const{afterFullData}=internalData;return $xeTable.scrollToRow(afterFullData[afterFullData.length-1],fieldOrColumn);},/**
|
|
7019
|
+
*/scrollToEndRow(fieldOrColumn,options){const $xeTable=this;const internalData=$xeTable;const{afterFullData}=internalData;return $xeTable.scrollToRow(afterFullData[afterFullData.length-1],fieldOrColumn,options);},/**
|
|
7016
7020
|
* 如果有滚动条,则滚动到对应的列
|
|
7017
7021
|
* @param {ColumnInfo} column 列配置
|
|
7018
|
-
*/scrollToColumn(fieldOrColumn){const $xeTable=this;return handleScrollToRowColumn($xeTable,fieldOrColumn);},/**
|
|
7022
|
+
*/scrollToColumn(fieldOrColumn,options){const $xeTable=this;return handleScrollToRowColumn($xeTable,null,fieldOrColumn,options);},/**
|
|
7019
7023
|
* 如果有滚动条,则滚动到第一列
|
|
7020
|
-
*/scrollToStartColumn(){const $xeTable=this;const internalData=$xeTable;const{visibleColumn}=internalData;return $xeTable.scrollToColumn(visibleColumn[0]);},/**
|
|
7024
|
+
*/scrollToStartColumn(options){const $xeTable=this;const internalData=$xeTable;const{visibleColumn}=internalData;return $xeTable.scrollToColumn(visibleColumn[0],options);},/**
|
|
7021
7025
|
* 如果有滚动条,则滚动到最后一列
|
|
7022
|
-
*/scrollToEndColumn(){const $xeTable=this;const internalData=$xeTable;const{visibleColumn}=internalData;return $xeTable.scrollToColumn(visibleColumn[visibleColumn.length-1]);},/**
|
|
7026
|
+
*/scrollToEndColumn(options){const $xeTable=this;const internalData=$xeTable;const{visibleColumn}=internalData;return $xeTable.scrollToColumn(visibleColumn[visibleColumn.length-1],options);},/**
|
|
7023
7027
|
* 对于树形结构中,可以直接滚动到指定深层节点中
|
|
7024
7028
|
* 对于某些特定的场景可能会用到,比如定位到某一节点
|
|
7025
7029
|
* @param {Row} row 行对象
|
|
@@ -16188,7 +16192,10 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
|
|
|
16188
16192
|
const params = Object.assign({}, args);
|
|
16189
16193
|
const _rowIndex = $xeTable.getVTRowIndex(params.row);
|
|
16190
16194
|
const _columnIndex = $xeTable.getVTColumnIndex(params.column);
|
|
16191
|
-
|
|
16195
|
+
let colAlign = isLeftArrow || isRightArrow;
|
|
16196
|
+
if (visibleColumn.length <= 1 && (isLeftArrow && _columnIndex >= 0 || isRightArrow && _columnIndex <= visibleColumn.length - 1)) {
|
|
16197
|
+
colAlign = false;
|
|
16198
|
+
} else {
|
|
16192
16199
|
evnt.preventDefault();
|
|
16193
16200
|
}
|
|
16194
16201
|
if (isUpArrow && _rowIndex > 0) {
|
|
@@ -16208,8 +16215,9 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
|
|
|
16208
16215
|
params.columnIndex = _columnIndex + 1;
|
|
16209
16216
|
params.column = visibleColumn[params.columnIndex];
|
|
16210
16217
|
}
|
|
16211
|
-
|
|
16212
|
-
|
|
16218
|
+
$xeTable.scrollToRow(params.row, params.column, {
|
|
16219
|
+
colAlign
|
|
16220
|
+
}).then(() => {
|
|
16213
16221
|
params.cell = $xeTable.getCellElement(params.row, params.column);
|
|
16214
16222
|
$xeTable.handleSelected(params, evnt);
|
|
16215
16223
|
});
|
|
@@ -16463,13 +16471,17 @@ function handleCheckboxRangeEvent($xeTable, evnt, params) {
|
|
|
16463
16471
|
if (editOpts.mode === 'row') {
|
|
16464
16472
|
$xeTable.handleEdit(params, evnt);
|
|
16465
16473
|
} else {
|
|
16466
|
-
$xeTable.scrollToRow(params.row, params.column
|
|
16474
|
+
$xeTable.scrollToRow(params.row, params.column, {
|
|
16475
|
+
colAlign: true
|
|
16476
|
+
}).then(() => {
|
|
16467
16477
|
$xeTable.handleSelected(params, evnt);
|
|
16468
16478
|
});
|
|
16469
16479
|
}
|
|
16470
16480
|
}
|
|
16471
16481
|
} else {
|
|
16472
|
-
$xeTable.scrollToRow(params.row, params.column
|
|
16482
|
+
$xeTable.scrollToRow(params.row, params.column, {
|
|
16483
|
+
colAlign: true
|
|
16484
|
+
}).then(() => {
|
|
16473
16485
|
$xeTable.handleSelected(params, evnt);
|
|
16474
16486
|
});
|
|
16475
16487
|
}
|