vxe-table 3.14.0-beta.22 → 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/keyboard/mixin.js +57 -32
- package/es/table/src/methods.js +4 -13
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +63 -45
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/keyboard/mixin.js +58 -30
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/methods.js +3 -13
- package/lib/table/src/methods.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 +2 -2
- package/packages/table/module/keyboard/mixin.ts +61 -32
- package/packages/table/src/methods.ts +4 -13
- /package/es/{iconfont.1742525024841.ttf → iconfont.1742535187527.ttf} +0 -0
- /package/es/{iconfont.1742525024841.woff → iconfont.1742535187527.woff} +0 -0
- /package/es/{iconfont.1742525024841.woff2 → iconfont.1742535187527.woff2} +0 -0
- /package/lib/{iconfont.1742525024841.ttf → iconfont.1742535187527.ttf} +0 -0
- /package/lib/{iconfont.1742525024841.woff → iconfont.1742535187527.woff} +0 -0
- /package/lib/{iconfont.1742525024841.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,48 +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 {
|
|
300
|
+
const props = $xeTable;
|
|
301
|
+
const { highlightCurrentRow, highlightCurrentColumn } = props;
|
|
269
302
|
const rowOpts = $xeTable.computeRowOpts;
|
|
270
|
-
const currentRowOpts = $xeTable.computeCurrentRowOpts;
|
|
271
303
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
evnt.preventDefault();
|
|
277
|
-
if (isUpArrow && _rowIndex > 0) {
|
|
278
|
-
// 移动到上一行
|
|
279
|
-
params.rowIndex = _rowIndex - 1;
|
|
280
|
-
params.row = afterFullData[params.rowIndex];
|
|
281
|
-
}
|
|
282
|
-
else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
|
|
283
|
-
// 移动到下一行
|
|
284
|
-
params.rowIndex = _rowIndex + 1;
|
|
285
|
-
params.row = afterFullData[params.rowIndex];
|
|
304
|
+
handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
305
|
+
// 当前行按键上下移动
|
|
306
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
307
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
286
308
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
params.column = visibleColumn[params.columnIndex];
|
|
309
|
+
// 当前行按键左右移动
|
|
310
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
311
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
291
312
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
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)) {
|
|
298
322
|
$xeTable.triggerCurrentRowEvent(evnt, params);
|
|
299
323
|
}
|
|
300
324
|
if (columnOpts.isCurrent && currentColumnOpts.isFollowSelected) {
|
|
301
325
|
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
302
326
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
327
|
+
},
|
|
328
|
+
// 处理可编辑方向键移动
|
|
329
|
+
moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
330
|
+
const $xeTable = this;
|
|
331
|
+
handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
307
332
|
},
|
|
308
333
|
handleCellMousedownEvent(evnt, params) {
|
|
309
334
|
const $xeTable = this;
|
package/es/table/src/methods.js
CHANGED
|
@@ -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/ui/index.js
CHANGED
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({
|
|
@@ -2844,7 +2844,7 @@ function isNodeElement(elem) {
|
|
|
2844
2844
|
const {
|
|
2845
2845
|
log: log_log
|
|
2846
2846
|
} = core_.VxeUI;
|
|
2847
|
-
const log_version = `table v${"3.14.0-beta.
|
|
2847
|
+
const log_version = `table v${"3.14.0-beta.23"}`;
|
|
2848
2848
|
const warnLog = log_log.create('warn', log_version);
|
|
2849
2849
|
const errLog = log_log.create('error', log_version);
|
|
2850
2850
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -11093,12 +11093,10 @@ const Methods = {
|
|
|
11093
11093
|
treeConfig,
|
|
11094
11094
|
treeOpts,
|
|
11095
11095
|
highlightCurrentRow,
|
|
11096
|
-
highlightCurrentColumn,
|
|
11097
11096
|
currentRow,
|
|
11098
11097
|
bodyCtxMenu,
|
|
11099
11098
|
rowOpts
|
|
11100
11099
|
} = this;
|
|
11101
|
-
const columnOpts = $xeTable.computeColumnOpts;
|
|
11102
11100
|
const {
|
|
11103
11101
|
selected,
|
|
11104
11102
|
actived
|
|
@@ -11192,7 +11190,7 @@ const Methods = {
|
|
|
11192
11190
|
if (keyboardOpts.enterToTab) {
|
|
11193
11191
|
this.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
11194
11192
|
} else {
|
|
11195
|
-
this.
|
|
11193
|
+
this.moveEnterSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
|
|
11196
11194
|
}
|
|
11197
11195
|
} else {
|
|
11198
11196
|
if (keyboardOpts.enterToTab) {
|
|
@@ -11229,7 +11227,7 @@ const Methods = {
|
|
|
11229
11227
|
return;
|
|
11230
11228
|
}
|
|
11231
11229
|
}
|
|
11232
|
-
this.
|
|
11230
|
+
this.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
11233
11231
|
if (enterMethod) {
|
|
11234
11232
|
enterMethod(etrParams);
|
|
11235
11233
|
}
|
|
@@ -11254,15 +11252,7 @@ const Methods = {
|
|
|
11254
11252
|
if (!isEditStatus) {
|
|
11255
11253
|
// 如果按下了方向键
|
|
11256
11254
|
if (selected.row && selected.column) {
|
|
11257
|
-
$xeTable.
|
|
11258
|
-
}
|
|
11259
|
-
// 当前行按键上下移动
|
|
11260
|
-
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
11261
|
-
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
11262
|
-
}
|
|
11263
|
-
// 当前行按键左右移动
|
|
11264
|
-
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
11265
|
-
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
11255
|
+
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
11266
11256
|
}
|
|
11267
11257
|
}
|
|
11268
11258
|
} else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
@@ -24412,6 +24402,39 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
24412
24402
|
}
|
|
24413
24403
|
return rangeRows;
|
|
24414
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
|
+
}
|
|
24415
24438
|
/* harmony default export */ var keyboard_mixin = ({
|
|
24416
24439
|
methods: {
|
|
24417
24440
|
// 处理 Tab 键移动
|
|
@@ -24583,48 +24606,43 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
24583
24606
|
}
|
|
24584
24607
|
},
|
|
24585
24608
|
// 处理可编辑方向键移动
|
|
24586
|
-
|
|
24609
|
+
moveArrowSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
24587
24610
|
const $xeTable = this;
|
|
24588
|
-
const
|
|
24611
|
+
const props = $xeTable;
|
|
24589
24612
|
const {
|
|
24590
|
-
|
|
24591
|
-
|
|
24592
|
-
} =
|
|
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;
|
|
24593
24630
|
const rowOpts = $xeTable.computeRowOpts;
|
|
24594
24631
|
const currentRowOpts = $xeTable.computeCurrentRowOpts;
|
|
24595
24632
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
24596
24633
|
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
24597
|
-
const params =
|
|
24598
|
-
const _rowIndex = $xeTable.getVTRowIndex(params.row);
|
|
24599
|
-
const _columnIndex = $xeTable.getVTColumnIndex(params.column);
|
|
24600
|
-
evnt.preventDefault();
|
|
24601
|
-
if (isUpArrow && _rowIndex > 0) {
|
|
24602
|
-
// 移动到上一行
|
|
24603
|
-
params.rowIndex = _rowIndex - 1;
|
|
24604
|
-
params.row = afterFullData[params.rowIndex];
|
|
24605
|
-
} else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
|
|
24606
|
-
// 移动到下一行
|
|
24607
|
-
params.rowIndex = _rowIndex + 1;
|
|
24608
|
-
params.row = afterFullData[params.rowIndex];
|
|
24609
|
-
} else if (isLeftArrow && _columnIndex) {
|
|
24610
|
-
// 移动到左侧单元格
|
|
24611
|
-
params.columnIndex = _columnIndex - 1;
|
|
24612
|
-
params.column = visibleColumn[params.columnIndex];
|
|
24613
|
-
} else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
|
|
24614
|
-
// 移动到右侧单元格
|
|
24615
|
-
params.columnIndex = _columnIndex + 1;
|
|
24616
|
-
params.column = visibleColumn[params.columnIndex];
|
|
24617
|
-
}
|
|
24634
|
+
const params = handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
24618
24635
|
if (rowOpts.isCurrent && currentRowOpts.isFollowSelected) {
|
|
24619
24636
|
$xeTable.triggerCurrentRowEvent(evnt, params);
|
|
24620
24637
|
}
|
|
24621
24638
|
if (columnOpts.isCurrent && currentColumnOpts.isFollowSelected) {
|
|
24622
24639
|
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
24623
24640
|
}
|
|
24624
|
-
|
|
24625
|
-
|
|
24626
|
-
|
|
24627
|
-
|
|
24641
|
+
},
|
|
24642
|
+
// 处理可编辑方向键移动
|
|
24643
|
+
moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
24644
|
+
const $xeTable = this;
|
|
24645
|
+
handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow);
|
|
24628
24646
|
},
|
|
24629
24647
|
handleCellMousedownEvent(evnt, params) {
|
|
24630
24648
|
const $xeTable = this;
|