Skip to content

Commit 27a219c

Browse files
author
along
committed
feat: add select/cornerHeaderSelectMode config
1 parent 09225a6 commit 27a219c

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

packages/vtable/src/state/select/update-position.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,31 +259,32 @@ export function updateSelectPosition(
259259
skipBodyMerge: true
260260
});
261261
} else {
262-
if (cornerHeaderSelectMode === 'all') {
263-
state.select.ranges.push({
264-
start: {
265-
col: table.leftRowSeriesNumberCount,
266-
row: 0
267-
},
268-
end: { col: table.colCount - 1, row: table.rowCount - 1 },
269-
skipBodyMerge: true
270-
});
271-
} else if (cornerHeaderSelectMode === 'cell') {
262+
if (cornerHeaderSelectMode === 'cell') {
272263
// 选中普通单元格
273264
const cellRange = skipBodyMerge ? { start: { col, row }, end: { col, row } } : table.getCellRange(col, row);
274265
state.select.ranges.push({
275266
start: { col: cellRange.start.col, row: cellRange.start.row },
276267
end: { col: cellRange.end.col, row: cellRange.end.row },
277268
skipBodyMerge: skipBodyMerge || undefined
278269
});
279-
} else {
270+
} else if (cornerHeaderSelectMode === 'inline') {
280271
// inline
281272
const cellRange = skipBodyMerge ? { start: { col, row }, end: { col, row } } : table.getCellRange(col, row);
282273
state.select.ranges.push({
283274
start: { col: cellRange.start.col, row: cellRange.start.row },
284275
end: { col: cellRange.end.col, row: table.rowCount - 1 },
285276
skipBodyMerge: true
286277
});
278+
} else {
279+
// all 或者用户传的其他的什么值 :'' | 'test',虽然类型会提示用户不能为其他的值,
280+
state.select.ranges.push({
281+
start: {
282+
col: table.leftRowSeriesNumberCount,
283+
row: 0
284+
},
285+
end: { col: table.colCount - 1, row: table.rowCount - 1 },
286+
skipBodyMerge: true
287+
});
287288
}
288289
// 选中全部
289290
// state.select.ranges.push({

0 commit comments

Comments
 (0)