vxe-table 3.14.0-beta.21 → 3.14.0-beta.23
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/export/mixin.js +1 -1
- package/es/table/module/keyboard/mixin.js +62 -27
- package/es/table/src/methods.js +9 -18
- package/es/table/src/table.js +4 -1
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +84 -51
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/mixin.js +1 -1
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +67 -29
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/methods.js +8 -17
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +4 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +2 -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 +2 -2
- package/packages/table/module/export/mixin.ts +1 -1
- package/packages/table/module/keyboard/mixin.ts +69 -30
- package/packages/table/src/methods.ts +9 -18
- package/packages/table/src/table.ts +4 -1
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1742437924038.ttf → iconfont.1742535187527.ttf} +0 -0
- /package/es/{iconfont.1742437924038.woff → iconfont.1742535187527.woff} +0 -0
- /package/es/{iconfont.1742437924038.woff2 → iconfont.1742535187527.woff2} +0 -0
- /package/lib/{iconfont.1742437924038.ttf → iconfont.1742535187527.ttf} +0 -0
- /package/lib/{iconfont.1742437924038.woff → iconfont.1742535187527.woff} +0 -0
- /package/lib/{iconfont.1742437924038.woff2 → iconfont.1742535187527.woff2} +0 -0
|
@@ -95,6 +95,39 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
95
95
|
}
|
|
96
96
|
return rangeRows;
|
|
97
97
|
}
|
|
98
|
+
function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow) {
|
|
99
|
+
const internalData = $xeTable;
|
|
100
|
+
const { afterFullData, visibleColumn } = internalData;
|
|
101
|
+
const params = Object.assign({}, args);
|
|
102
|
+
const _rowIndex = $xeTable.getVTRowIndex(params.row);
|
|
103
|
+
const _columnIndex = $xeTable.getVTColumnIndex(params.column);
|
|
104
|
+
evnt.preventDefault();
|
|
105
|
+
if (isUpArrow && _rowIndex > 0) {
|
|
106
|
+
// 移动到上一行
|
|
107
|
+
params.rowIndex = _rowIndex - 1;
|
|
108
|
+
params.row = afterFullData[params.rowIndex];
|
|
109
|
+
}
|
|
110
|
+
else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
|
|
111
|
+
// 移动到下一行
|
|
112
|
+
params.rowIndex = _rowIndex + 1;
|
|
113
|
+
params.row = afterFullData[params.rowIndex];
|
|
114
|
+
}
|
|
115
|
+
else if (isLeftArrow && _columnIndex) {
|
|
116
|
+
// 移动到左侧单元格
|
|
117
|
+
params.columnIndex = _columnIndex - 1;
|
|
118
|
+
params.column = visibleColumn[params.columnIndex];
|
|
119
|
+
}
|
|
120
|
+
else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
|
|
121
|
+
// 移动到右侧单元格
|
|
122
|
+
params.columnIndex = _columnIndex + 1;
|
|
123
|
+
params.column = visibleColumn[params.columnIndex];
|
|
124
|
+
}
|
|
125
|
+
$xeTable.scrollToRow(params.row, params.column).then(() => {
|
|
126
|
+
params.cell = $xeTable.getCellElement(params.row, params.column);
|
|
127
|
+
$xeTable.handleSelected(params, evnt);
|
|
128
|
+
});
|
|
129
|
+
return params;
|
|
130
|
+
}
|
|
98
131
|
export default {
|
|
99
132
|
methods: {
|
|
100
133
|
// 处理 Tab 键移动
|
|
@@ -262,38 +295,40 @@ export default {
|
|
|
262
295
|
}
|
|
263
296
|
},
|
|
264
297
|
// 处理可编辑方向键移动
|
|
265
|
-
|
|
298
|
+
moveArrowSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
266
299
|
const $xeTable = this;
|
|
267
|
-
const
|
|
268
|
-
const {
|
|
269
|
-
const
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
if (isUpArrow &&
|
|
274
|
-
|
|
275
|
-
params.rowIndex = _rowIndex - 1;
|
|
276
|
-
params.row = afterFullData[params.rowIndex];
|
|
300
|
+
const props = $xeTable;
|
|
301
|
+
const { highlightCurrentRow, highlightCurrentColumn } = props;
|
|
302
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
303
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
304
|
+
handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
305
|
+
// 当前行按键上下移动
|
|
306
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
307
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
277
308
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
params.row = afterFullData[params.rowIndex];
|
|
309
|
+
// 当前行按键左右移动
|
|
310
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
311
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
282
312
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
313
|
+
},
|
|
314
|
+
moveEnterSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
315
|
+
const $xeTable = this;
|
|
316
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
317
|
+
const currentRowOpts = $xeTable.computeCurrentRowOpts;
|
|
318
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
319
|
+
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
320
|
+
const params = handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
321
|
+
if ((rowOpts.isCurrent && currentRowOpts.isFollowSelected)) {
|
|
322
|
+
$xeTable.triggerCurrentRowEvent(evnt, params);
|
|
287
323
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
params.columnIndex = _columnIndex + 1;
|
|
291
|
-
params.column = visibleColumn[params.columnIndex];
|
|
324
|
+
if (columnOpts.isCurrent && currentColumnOpts.isFollowSelected) {
|
|
325
|
+
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
292
326
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
327
|
+
},
|
|
328
|
+
// 处理可编辑方向键移动
|
|
329
|
+
moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
330
|
+
const $xeTable = this;
|
|
331
|
+
handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
297
332
|
},
|
|
298
333
|
handleCellMousedownEvent(evnt, params) {
|
|
299
334
|
const $xeTable = this;
|
package/es/table/src/methods.js
CHANGED
|
@@ -2485,7 +2485,7 @@ const Methods = {
|
|
|
2485
2485
|
*/
|
|
2486
2486
|
getParentHeight() {
|
|
2487
2487
|
const $xeTable = this;
|
|
2488
|
-
const $xeGrid = $xeTable
|
|
2488
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
2489
2489
|
const props = $xeTable;
|
|
2490
2490
|
const { height } = props;
|
|
2491
2491
|
const el = $xeTable.$refs.refElem;
|
|
@@ -3597,7 +3597,7 @@ const Methods = {
|
|
|
3597
3597
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
3598
3598
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
3599
3599
|
const { transform, rowField, parentField, mapChildrenField } = treeOpts;
|
|
3600
|
-
const { remote: allRemoteFilter, filterMethod: allFilterMethod } = filterOpts;
|
|
3600
|
+
const { isEvery, remote: allRemoteFilter, filterMethod: allFilterMethod } = filterOpts;
|
|
3601
3601
|
const { remote: allRemoteSort, sortMethod: allSortMethod, multiple: sortMultiple, chronological } = sortOpts;
|
|
3602
3602
|
let tableData = [];
|
|
3603
3603
|
let tableTree = [];
|
|
@@ -3656,7 +3656,7 @@ const Methods = {
|
|
|
3656
3656
|
// 筛选虚拟树
|
|
3657
3657
|
tableTree = XEUtils.searchTree(tableFullTreeData, handleFilter, {
|
|
3658
3658
|
original: true,
|
|
3659
|
-
isEvery
|
|
3659
|
+
isEvery,
|
|
3660
3660
|
children: mapChildrenField,
|
|
3661
3661
|
mapChildren: childrenField
|
|
3662
3662
|
});
|
|
@@ -3672,7 +3672,7 @@ const Methods = {
|
|
|
3672
3672
|
// 还原虚拟树
|
|
3673
3673
|
tableTree = XEUtils.searchTree(tableFullTreeData, () => true, {
|
|
3674
3674
|
original: true,
|
|
3675
|
-
isEvery
|
|
3675
|
+
isEvery,
|
|
3676
3676
|
children: mapChildrenField,
|
|
3677
3677
|
mapChildren: childrenField
|
|
3678
3678
|
});
|
|
@@ -3735,7 +3735,7 @@ const Methods = {
|
|
|
3735
3735
|
// 还原虚拟树
|
|
3736
3736
|
tableTree = XEUtils.searchTree(tableFullTreeData, () => true, {
|
|
3737
3737
|
original: true,
|
|
3738
|
-
isEvery
|
|
3738
|
+
isEvery,
|
|
3739
3739
|
children: treeOpts.mapChildrenField,
|
|
3740
3740
|
mapChildren: childrenField
|
|
3741
3741
|
});
|
|
@@ -5105,8 +5105,7 @@ const Methods = {
|
|
|
5105
5105
|
if (this.isActivated) {
|
|
5106
5106
|
this.preventEvent(evnt, 'event.keydown', null, () => {
|
|
5107
5107
|
const { afterFullData } = internalData;
|
|
5108
|
-
const { filterStore, isCtxMenu, ctxMenuStore, editStore, editOpts, editConfig, mouseConfig, mouseOpts, keyboardConfig, keyboardOpts, treeConfig, treeOpts, highlightCurrentRow,
|
|
5109
|
-
const columnOpts = $xeTable.computeColumnOpts;
|
|
5108
|
+
const { filterStore, isCtxMenu, ctxMenuStore, editStore, editOpts, editConfig, mouseConfig, mouseOpts, keyboardConfig, keyboardOpts, treeConfig, treeOpts, highlightCurrentRow, currentRow, bodyCtxMenu, rowOpts } = this;
|
|
5110
5109
|
const { selected, actived } = editStore;
|
|
5111
5110
|
const { keyCode } = evnt;
|
|
5112
5111
|
const hasBackspaceKey = keyCode === 8;
|
|
@@ -5200,7 +5199,7 @@ const Methods = {
|
|
|
5200
5199
|
this.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
5201
5200
|
}
|
|
5202
5201
|
else {
|
|
5203
|
-
this.
|
|
5202
|
+
this.moveEnterSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
|
|
5204
5203
|
}
|
|
5205
5204
|
}
|
|
5206
5205
|
else {
|
|
@@ -5234,7 +5233,7 @@ const Methods = {
|
|
|
5234
5233
|
return;
|
|
5235
5234
|
}
|
|
5236
5235
|
}
|
|
5237
|
-
this.
|
|
5236
|
+
this.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
5238
5237
|
if (enterMethod) {
|
|
5239
5238
|
enterMethod(etrParams);
|
|
5240
5239
|
}
|
|
@@ -5260,15 +5259,7 @@ const Methods = {
|
|
|
5260
5259
|
if (!isEditStatus) {
|
|
5261
5260
|
// 如果按下了方向键
|
|
5262
5261
|
if (selected.row && selected.column) {
|
|
5263
|
-
$xeTable.
|
|
5264
|
-
}
|
|
5265
|
-
// 当前行按键上下移动
|
|
5266
|
-
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
5267
|
-
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
5268
|
-
}
|
|
5269
|
-
// 当前行按键左右移动
|
|
5270
|
-
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
5271
|
-
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
5262
|
+
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
5272
5263
|
}
|
|
5273
5264
|
}
|
|
5274
5265
|
}
|
package/es/table/src/table.js
CHANGED
|
@@ -409,6 +409,9 @@ export default {
|
|
|
409
409
|
},
|
|
410
410
|
$xegrid: {
|
|
411
411
|
default: null
|
|
412
|
+
},
|
|
413
|
+
xeGrid: {
|
|
414
|
+
default: null
|
|
412
415
|
}
|
|
413
416
|
},
|
|
414
417
|
data() {
|
|
@@ -1606,7 +1609,7 @@ export default {
|
|
|
1606
1609
|
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
|
|
1607
1610
|
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
1608
1611
|
const $xeTable = this;
|
|
1609
|
-
const $xeGrid = $xeTable
|
|
1612
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
1610
1613
|
const props = $xeTable;
|
|
1611
1614
|
const slots = $xeTable.$scopedSlots;
|
|
1612
1615
|
const reactData = $xeTable;
|
package/es/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
import { getFuncText } from './src/utils';
|
|
3
|
-
export const version = "3.14.0-beta.
|
|
3
|
+
export const version = "3.14.0-beta.23";
|
|
4
4
|
VxeUI.version = version;
|
|
5
5
|
VxeUI.tableVersion = version;
|
|
6
6
|
VxeUI.setConfig({
|
|
@@ -124,6 +124,7 @@ VxeUI.setConfig({
|
|
|
124
124
|
// remote: false,
|
|
125
125
|
// filterMethod: null,
|
|
126
126
|
// destroyOnClose: false,
|
|
127
|
+
isEvery: true,
|
|
127
128
|
showIcon: true
|
|
128
129
|
},
|
|
129
130
|
treeConfig: {
|
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.14.0-beta.
|
|
2223
|
+
const version = "3.14.0-beta.23";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2344,6 +2344,7 @@ core_.VxeUI.setConfig({
|
|
|
2344
2344
|
// remote: false,
|
|
2345
2345
|
// filterMethod: null,
|
|
2346
2346
|
// destroyOnClose: false,
|
|
2347
|
+
isEvery: true,
|
|
2347
2348
|
showIcon: true
|
|
2348
2349
|
},
|
|
2349
2350
|
treeConfig: {
|
|
@@ -2843,7 +2844,7 @@ function isNodeElement(elem) {
|
|
|
2843
2844
|
const {
|
|
2844
2845
|
log: log_log
|
|
2845
2846
|
} = core_.VxeUI;
|
|
2846
|
-
const log_version = `table v${"3.14.0-beta.
|
|
2847
|
+
const log_version = `table v${"3.14.0-beta.23"}`;
|
|
2847
2848
|
const warnLog = log_log.create('warn', log_version);
|
|
2848
2849
|
const errLog = log_log.create('error', log_version);
|
|
2849
2850
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -8040,7 +8041,7 @@ const Methods = {
|
|
|
8040
8041
|
*/
|
|
8041
8042
|
getParentHeight() {
|
|
8042
8043
|
const $xeTable = this;
|
|
8043
|
-
const $xeGrid = $xeTable
|
|
8044
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
8044
8045
|
const props = $xeTable;
|
|
8045
8046
|
const {
|
|
8046
8047
|
height
|
|
@@ -9335,6 +9336,7 @@ const Methods = {
|
|
|
9335
9336
|
mapChildrenField
|
|
9336
9337
|
} = treeOpts;
|
|
9337
9338
|
const {
|
|
9339
|
+
isEvery,
|
|
9338
9340
|
remote: allRemoteFilter,
|
|
9339
9341
|
filterMethod: allFilterMethod
|
|
9340
9342
|
} = filterOpts;
|
|
@@ -9447,7 +9449,7 @@ const Methods = {
|
|
|
9447
9449
|
// 筛选虚拟树
|
|
9448
9450
|
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, handleFilter, {
|
|
9449
9451
|
original: true,
|
|
9450
|
-
isEvery
|
|
9452
|
+
isEvery,
|
|
9451
9453
|
children: mapChildrenField,
|
|
9452
9454
|
mapChildren: childrenField
|
|
9453
9455
|
});
|
|
@@ -9461,7 +9463,7 @@ const Methods = {
|
|
|
9461
9463
|
// 还原虚拟树
|
|
9462
9464
|
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, () => true, {
|
|
9463
9465
|
original: true,
|
|
9464
|
-
isEvery
|
|
9466
|
+
isEvery,
|
|
9465
9467
|
children: mapChildrenField,
|
|
9466
9468
|
mapChildren: childrenField
|
|
9467
9469
|
});
|
|
@@ -9538,7 +9540,7 @@ const Methods = {
|
|
|
9538
9540
|
// 还原虚拟树
|
|
9539
9541
|
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, () => true, {
|
|
9540
9542
|
original: true,
|
|
9541
|
-
isEvery
|
|
9543
|
+
isEvery,
|
|
9542
9544
|
children: treeOpts.mapChildrenField,
|
|
9543
9545
|
mapChildren: childrenField
|
|
9544
9546
|
});
|
|
@@ -11091,12 +11093,10 @@ const Methods = {
|
|
|
11091
11093
|
treeConfig,
|
|
11092
11094
|
treeOpts,
|
|
11093
11095
|
highlightCurrentRow,
|
|
11094
|
-
highlightCurrentColumn,
|
|
11095
11096
|
currentRow,
|
|
11096
11097
|
bodyCtxMenu,
|
|
11097
11098
|
rowOpts
|
|
11098
11099
|
} = this;
|
|
11099
|
-
const columnOpts = $xeTable.computeColumnOpts;
|
|
11100
11100
|
const {
|
|
11101
11101
|
selected,
|
|
11102
11102
|
actived
|
|
@@ -11190,7 +11190,7 @@ const Methods = {
|
|
|
11190
11190
|
if (keyboardOpts.enterToTab) {
|
|
11191
11191
|
this.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
11192
11192
|
} else {
|
|
11193
|
-
this.
|
|
11193
|
+
this.moveEnterSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
|
|
11194
11194
|
}
|
|
11195
11195
|
} else {
|
|
11196
11196
|
if (keyboardOpts.enterToTab) {
|
|
@@ -11227,7 +11227,7 @@ const Methods = {
|
|
|
11227
11227
|
return;
|
|
11228
11228
|
}
|
|
11229
11229
|
}
|
|
11230
|
-
this.
|
|
11230
|
+
this.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
11231
11231
|
if (enterMethod) {
|
|
11232
11232
|
enterMethod(etrParams);
|
|
11233
11233
|
}
|
|
@@ -11252,15 +11252,7 @@ const Methods = {
|
|
|
11252
11252
|
if (!isEditStatus) {
|
|
11253
11253
|
// 如果按下了方向键
|
|
11254
11254
|
if (selected.row && selected.column) {
|
|
11255
|
-
$xeTable.
|
|
11256
|
-
}
|
|
11257
|
-
// 当前行按键上下移动
|
|
11258
|
-
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
11259
|
-
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
11260
|
-
}
|
|
11261
|
-
// 当前行按键左右移动
|
|
11262
|
-
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
11263
|
-
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
11255
|
+
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
11264
11256
|
}
|
|
11265
11257
|
}
|
|
11266
11258
|
} else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
@@ -23579,7 +23571,7 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
23579
23571
|
const props = $xeTable;
|
|
23580
23572
|
const reactData = $xeTable;
|
|
23581
23573
|
const internalData = $xeTable;
|
|
23582
|
-
const $xeGrid = $xeTable
|
|
23574
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
23583
23575
|
const {
|
|
23584
23576
|
treeConfig,
|
|
23585
23577
|
showHeader,
|
|
@@ -24410,6 +24402,39 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
24410
24402
|
}
|
|
24411
24403
|
return rangeRows;
|
|
24412
24404
|
}
|
|
24405
|
+
function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow) {
|
|
24406
|
+
const internalData = $xeTable;
|
|
24407
|
+
const {
|
|
24408
|
+
afterFullData,
|
|
24409
|
+
visibleColumn
|
|
24410
|
+
} = internalData;
|
|
24411
|
+
const params = Object.assign({}, args);
|
|
24412
|
+
const _rowIndex = $xeTable.getVTRowIndex(params.row);
|
|
24413
|
+
const _columnIndex = $xeTable.getVTColumnIndex(params.column);
|
|
24414
|
+
evnt.preventDefault();
|
|
24415
|
+
if (isUpArrow && _rowIndex > 0) {
|
|
24416
|
+
// 移动到上一行
|
|
24417
|
+
params.rowIndex = _rowIndex - 1;
|
|
24418
|
+
params.row = afterFullData[params.rowIndex];
|
|
24419
|
+
} else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
|
|
24420
|
+
// 移动到下一行
|
|
24421
|
+
params.rowIndex = _rowIndex + 1;
|
|
24422
|
+
params.row = afterFullData[params.rowIndex];
|
|
24423
|
+
} else if (isLeftArrow && _columnIndex) {
|
|
24424
|
+
// 移动到左侧单元格
|
|
24425
|
+
params.columnIndex = _columnIndex - 1;
|
|
24426
|
+
params.column = visibleColumn[params.columnIndex];
|
|
24427
|
+
} else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
|
|
24428
|
+
// 移动到右侧单元格
|
|
24429
|
+
params.columnIndex = _columnIndex + 1;
|
|
24430
|
+
params.column = visibleColumn[params.columnIndex];
|
|
24431
|
+
}
|
|
24432
|
+
$xeTable.scrollToRow(params.row, params.column).then(() => {
|
|
24433
|
+
params.cell = $xeTable.getCellElement(params.row, params.column);
|
|
24434
|
+
$xeTable.handleSelected(params, evnt);
|
|
24435
|
+
});
|
|
24436
|
+
return params;
|
|
24437
|
+
}
|
|
24413
24438
|
/* harmony default export */ var keyboard_mixin = ({
|
|
24414
24439
|
methods: {
|
|
24415
24440
|
// 处理 Tab 键移动
|
|
@@ -24581,38 +24606,43 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
24581
24606
|
}
|
|
24582
24607
|
},
|
|
24583
24608
|
// 处理可编辑方向键移动
|
|
24584
|
-
|
|
24609
|
+
moveArrowSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
24585
24610
|
const $xeTable = this;
|
|
24586
|
-
const
|
|
24611
|
+
const props = $xeTable;
|
|
24587
24612
|
const {
|
|
24588
|
-
|
|
24589
|
-
|
|
24590
|
-
} =
|
|
24591
|
-
const
|
|
24592
|
-
const
|
|
24593
|
-
|
|
24594
|
-
|
|
24595
|
-
if (isUpArrow &&
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
24599
|
-
|
|
24600
|
-
|
|
24601
|
-
|
|
24602
|
-
|
|
24603
|
-
|
|
24604
|
-
|
|
24605
|
-
|
|
24606
|
-
|
|
24607
|
-
|
|
24608
|
-
|
|
24609
|
-
|
|
24610
|
-
|
|
24611
|
-
|
|
24612
|
-
|
|
24613
|
-
|
|
24614
|
-
$xeTable.
|
|
24615
|
-
}
|
|
24613
|
+
highlightCurrentRow,
|
|
24614
|
+
highlightCurrentColumn
|
|
24615
|
+
} = props;
|
|
24616
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
24617
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
24618
|
+
handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
24619
|
+
// 当前行按键上下移动
|
|
24620
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
24621
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
24622
|
+
}
|
|
24623
|
+
// 当前行按键左右移动
|
|
24624
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
24625
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
24626
|
+
}
|
|
24627
|
+
},
|
|
24628
|
+
moveEnterSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
24629
|
+
const $xeTable = this;
|
|
24630
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
24631
|
+
const currentRowOpts = $xeTable.computeCurrentRowOpts;
|
|
24632
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
24633
|
+
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
24634
|
+
const params = handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
24635
|
+
if (rowOpts.isCurrent && currentRowOpts.isFollowSelected) {
|
|
24636
|
+
$xeTable.triggerCurrentRowEvent(evnt, params);
|
|
24637
|
+
}
|
|
24638
|
+
if (columnOpts.isCurrent && currentColumnOpts.isFollowSelected) {
|
|
24639
|
+
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
24640
|
+
}
|
|
24641
|
+
},
|
|
24642
|
+
// 处理可编辑方向键移动
|
|
24643
|
+
moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
24644
|
+
const $xeTable = this;
|
|
24645
|
+
handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
24616
24646
|
},
|
|
24617
24647
|
handleCellMousedownEvent(evnt, params) {
|
|
24618
24648
|
const $xeTable = this;
|
|
@@ -26185,6 +26215,9 @@ function renderBody(h, $xeTable) {
|
|
|
26185
26215
|
},
|
|
26186
26216
|
$xegrid: {
|
|
26187
26217
|
default: null
|
|
26218
|
+
},
|
|
26219
|
+
xeGrid: {
|
|
26220
|
+
default: null
|
|
26188
26221
|
}
|
|
26189
26222
|
},
|
|
26190
26223
|
data() {
|
|
@@ -27465,7 +27498,7 @@ function renderBody(h, $xeTable) {
|
|
|
27465
27498
|
const VxeUILoadingComponent = core_.VxeUI.getComponent('VxeLoading');
|
|
27466
27499
|
const VxeUITooltipComponent = core_.VxeUI.getComponent('VxeTooltip');
|
|
27467
27500
|
const $xeTable = this;
|
|
27468
|
-
const $xeGrid = $xeTable
|
|
27501
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
27469
27502
|
const props = $xeTable;
|
|
27470
27503
|
const slots = $xeTable.$scopedSlots;
|
|
27471
27504
|
const reactData = $xeTable;
|