vxe-table 3.14.1 → 3.14.3
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/edit/mixin.js +3 -2
- package/es/table/module/keyboard/mixin.js +3 -2
- package/es/table/module/menu/mixin.js +8 -7
- package/es/table/src/methods.js +114 -65
- package/es/table/src/table.js +6 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +0 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +136 -88
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +2 -1
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -1
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +10 -7
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/src/methods.js +114 -76
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +6 -0
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +0 -2
- package/lib/ui/src/dom.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/edit/mixin.ts +4 -2
- package/packages/table/module/keyboard/mixin.ts +4 -2
- package/packages/table/module/menu/mixin.ts +9 -7
- package/packages/table/src/methods.ts +115 -65
- package/packages/table/src/table.ts +6 -0
- package/packages/ui/src/dom.ts +0 -2
- /package/es/{iconfont.1743045564244.ttf → iconfont.1743389110592.ttf} +0 -0
- /package/es/{iconfont.1743045564244.woff → iconfont.1743389110592.woff} +0 -0
- /package/es/{iconfont.1743045564244.woff2 → iconfont.1743389110592.woff2} +0 -0
- /package/lib/{iconfont.1743045564244.ttf → iconfont.1743389110592.ttf} +0 -0
- /package/lib/{iconfont.1743045564244.woff → iconfont.1743389110592.woff} +0 -0
- /package/lib/{iconfont.1743045564244.woff2 → iconfont.1743389110592.woff2} +0 -0
|
@@ -3,7 +3,7 @@ import { VxeUI } from '../../../ui';
|
|
|
3
3
|
import { getDomNode, getAbsolutePos, getEventTargetNode } from '../../../ui/src/dom';
|
|
4
4
|
import { isEnableConf, hasChildrenList } from '../../../ui/src/utils';
|
|
5
5
|
import { warnLog } from '../../../ui/src/log';
|
|
6
|
-
const { menus } = VxeUI;
|
|
6
|
+
const { menus, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI;
|
|
7
7
|
export default {
|
|
8
8
|
methods: {
|
|
9
9
|
/**
|
|
@@ -19,10 +19,11 @@ export default {
|
|
|
19
19
|
return this.$nextTick();
|
|
20
20
|
},
|
|
21
21
|
// 处理菜单的移动
|
|
22
|
-
moveCtxMenu(evnt,
|
|
22
|
+
moveCtxMenu(evnt, ctxMenuStore, property, hasOper, operRest, menuList) {
|
|
23
|
+
const $xeTable = this;
|
|
23
24
|
let selectItem;
|
|
24
25
|
const selectIndex = XEUtils.findIndexOf(menuList, item => ctxMenuStore[property] === item);
|
|
25
|
-
if (
|
|
26
|
+
if (hasOper) {
|
|
26
27
|
if (operRest && hasChildrenList(ctxMenuStore.selected)) {
|
|
27
28
|
ctxMenuStore.showChild = true;
|
|
28
29
|
}
|
|
@@ -31,7 +32,7 @@ export default {
|
|
|
31
32
|
ctxMenuStore.selectChild = null;
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
else if (
|
|
35
|
+
else if (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP)) {
|
|
35
36
|
for (let len = selectIndex - 1; len >= 0; len--) {
|
|
36
37
|
if (menuList[len].visible !== false) {
|
|
37
38
|
selectItem = menuList[len];
|
|
@@ -40,7 +41,7 @@ export default {
|
|
|
40
41
|
}
|
|
41
42
|
ctxMenuStore[property] = selectItem || menuList[menuList.length - 1];
|
|
42
43
|
}
|
|
43
|
-
else if (
|
|
44
|
+
else if (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN)) {
|
|
44
45
|
for (let index = selectIndex + 1; index < menuList.length; index++) {
|
|
45
46
|
if (menuList[index].visible !== false) {
|
|
46
47
|
selectItem = menuList[index];
|
|
@@ -49,8 +50,8 @@ export default {
|
|
|
49
50
|
}
|
|
50
51
|
ctxMenuStore[property] = selectItem || menuList[0];
|
|
51
52
|
}
|
|
52
|
-
else if (ctxMenuStore[property] && (
|
|
53
|
-
|
|
53
|
+
else if (ctxMenuStore[property] && (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ENTER) || globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.SPACEBAR))) {
|
|
54
|
+
$xeTable.ctxMenuLinkEvent(evnt, ctxMenuStore[property]);
|
|
54
55
|
}
|
|
55
56
|
},
|
|
56
57
|
/**
|
package/es/table/src/methods.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
|
-
import {
|
|
2
|
+
import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, getOffsetPos, setScrollTop, setScrollLeft, toCssUnit } from '../../ui/src/dom';
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
5
5
|
import Cell from './cell';
|
|
@@ -7,6 +7,7 @@ import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible,
|
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
8
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
9
9
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI;
|
|
10
|
+
const browseObj = XEUtils.browse();
|
|
10
11
|
const supportMaxRow = 5e6;
|
|
11
12
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
12
13
|
const maxYHeight = 5e6;
|
|
@@ -467,11 +468,11 @@ function updateStyle($xeTable) {
|
|
|
467
468
|
}
|
|
468
469
|
if (xLeftCornerEl) {
|
|
469
470
|
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
470
|
-
xLeftCornerEl.style.display = scrollbarXToTop ? (
|
|
471
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? (overflowX && osbHeight ? 'block' : '') : '';
|
|
471
472
|
}
|
|
472
473
|
if (xRightCornerEl) {
|
|
473
474
|
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
474
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' : (
|
|
475
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : (overflowX && osbHeight ? 'block' : '');
|
|
475
476
|
}
|
|
476
477
|
const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem;
|
|
477
478
|
if (scrollYVirtualEl) {
|
|
@@ -482,7 +483,7 @@ function updateStyle($xeTable) {
|
|
|
482
483
|
const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem;
|
|
483
484
|
if (yTopCornerEl) {
|
|
484
485
|
yTopCornerEl.style.height = `${headerHeight}px`;
|
|
485
|
-
yTopCornerEl.style.display = headerHeight ? 'block' : '';
|
|
486
|
+
yTopCornerEl.style.display = overflowY && headerHeight ? 'block' : '';
|
|
486
487
|
}
|
|
487
488
|
const yWrapperEl = $xeTable.$refs.refScrollYWrapperElem;
|
|
488
489
|
if (yWrapperEl) {
|
|
@@ -493,7 +494,7 @@ function updateStyle($xeTable) {
|
|
|
493
494
|
if (yBottomCornerEl) {
|
|
494
495
|
yBottomCornerEl.style.height = `${footerHeight}px`;
|
|
495
496
|
yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`;
|
|
496
|
-
yBottomCornerEl.style.display = footerHeight ? 'block' : '';
|
|
497
|
+
yBottomCornerEl.style.display = overflowY && footerHeight ? 'block' : '';
|
|
497
498
|
}
|
|
498
499
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
499
500
|
if (rowExpandEl) {
|
|
@@ -614,7 +615,7 @@ function updateStyle($xeTable) {
|
|
|
614
615
|
if (tableElem) {
|
|
615
616
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
616
617
|
// 兼容性处理
|
|
617
|
-
tableElem.style.paddingRight = osbWidth && fixedType && (
|
|
618
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browseObj['-moz'] || browseObj.safari) ? `${osbWidth}px` : '';
|
|
618
619
|
}
|
|
619
620
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
620
621
|
if (emptyBlockElem) {
|
|
@@ -1769,7 +1770,7 @@ function hideDropTip($xeTable) {
|
|
|
1769
1770
|
* @param {Event} evnt 事件
|
|
1770
1771
|
* @param {Row} row 行对象
|
|
1771
1772
|
*/
|
|
1772
|
-
function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
1773
|
+
function handleTooltip($xeTable, evnt, tdEl, overflowElem, tipElem, params) {
|
|
1773
1774
|
const reactData = $xeTable;
|
|
1774
1775
|
const tipOverEl = overflowElem || tdEl;
|
|
1775
1776
|
if (!tipOverEl) {
|
|
@@ -1783,7 +1784,8 @@ function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
|
1783
1784
|
const customContent = contentMethod ? contentMethod(params) : null;
|
|
1784
1785
|
const useCustom = contentMethod && !XEUtils.eqNull(customContent);
|
|
1785
1786
|
const content = useCustom ? customContent : XEUtils.toString(column.type === 'html' ? tipOverEl.innerText : tipOverEl.textContent).trim();
|
|
1786
|
-
|
|
1787
|
+
const isOver = tipOverEl.scrollWidth > tipOverEl.clientWidth;
|
|
1788
|
+
if (content && (showAll || useCustom || isOver)) {
|
|
1787
1789
|
Object.assign(tooltipStore, {
|
|
1788
1790
|
row,
|
|
1789
1791
|
column,
|
|
@@ -1793,7 +1795,7 @@ function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
|
1793
1795
|
$xeTable.$nextTick(() => {
|
|
1794
1796
|
const $tooltip = $xeTable.$refs.refTooltip;
|
|
1795
1797
|
if ($tooltip && $tooltip.open) {
|
|
1796
|
-
$tooltip.open(tipOverEl, formatText(content));
|
|
1798
|
+
$tooltip.open(isOver ? tipOverEl : tipElem, formatText(content));
|
|
1797
1799
|
}
|
|
1798
1800
|
});
|
|
1799
1801
|
}
|
|
@@ -5158,13 +5160,25 @@ const Methods = {
|
|
|
5158
5160
|
*/
|
|
5159
5161
|
handleGlobalKeydownEvent(evnt) {
|
|
5160
5162
|
const $xeTable = this;
|
|
5163
|
+
const props = $xeTable;
|
|
5161
5164
|
const internalData = $xeTable;
|
|
5165
|
+
const reactData = $xeTable;
|
|
5162
5166
|
const $xeGrid = $xeTable.$xeGrid;
|
|
5163
5167
|
// 该行为只对当前激活的表格有效
|
|
5164
|
-
if (
|
|
5165
|
-
|
|
5168
|
+
if (internalData.isActivated) {
|
|
5169
|
+
$xeTable.preventEvent(evnt, 'event.keydown', null, () => {
|
|
5170
|
+
const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow, highlightCurrentColumn } = props;
|
|
5171
|
+
const { ctxMenuStore, editStore, currentRow } = reactData;
|
|
5166
5172
|
const { afterFullData } = internalData;
|
|
5167
|
-
const
|
|
5173
|
+
const isMenu = $xeTable.computeIsMenu;
|
|
5174
|
+
const bodyMenu = $xeTable.computeBodyMenu;
|
|
5175
|
+
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
5176
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
5177
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
5178
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
5179
|
+
const menuList = $xeTable.computeMenuList;
|
|
5180
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
5181
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
5168
5182
|
const { selected, actived } = editStore;
|
|
5169
5183
|
const { keyCode } = evnt;
|
|
5170
5184
|
const hasBackspaceKey = keyCode === 8;
|
|
@@ -5184,37 +5198,49 @@ const Methods = {
|
|
|
5184
5198
|
const hasShiftKey = evnt.shiftKey;
|
|
5185
5199
|
const hasAltKey = evnt.altKey;
|
|
5186
5200
|
const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
|
|
5187
|
-
const operCtxMenu =
|
|
5201
|
+
const operCtxMenu = isMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
|
|
5188
5202
|
const isEditStatus = isEnableConf(editConfig) && actived.column && actived.row;
|
|
5189
5203
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5190
5204
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
5191
|
-
if (filterStore.visible) {
|
|
5192
|
-
if (isEsc) {
|
|
5193
|
-
this.closeFilter();
|
|
5194
|
-
}
|
|
5195
|
-
return;
|
|
5196
|
-
}
|
|
5197
5205
|
if (operCtxMenu) {
|
|
5198
5206
|
// 如果配置了右键菜单; 支持方向键操作、回车
|
|
5199
5207
|
evnt.preventDefault();
|
|
5200
5208
|
if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
|
|
5201
|
-
|
|
5209
|
+
$xeTable.moveCtxMenu(evnt, ctxMenuStore, 'selectChild', isLeftArrow, false, ctxMenuStore.selected.children);
|
|
5202
5210
|
}
|
|
5203
5211
|
else {
|
|
5204
|
-
|
|
5212
|
+
$xeTable.moveCtxMenu(evnt, ctxMenuStore, 'selected', isRightArrow, true, menuList);
|
|
5205
5213
|
}
|
|
5206
5214
|
}
|
|
5207
|
-
else if (keyboardConfig && mouseConfig && mouseOpts.area &&
|
|
5208
|
-
|
|
5215
|
+
else if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKeyboardCellAreaEvent) {
|
|
5216
|
+
$xeTable.handleKeyboardCellAreaEvent(evnt);
|
|
5217
|
+
}
|
|
5218
|
+
else if (isEsc) {
|
|
5219
|
+
// 如果按下了 Esc 键,关闭快捷菜单、筛选
|
|
5220
|
+
if ($xeTable.closeMenu) {
|
|
5221
|
+
$xeTable.closeMenu();
|
|
5222
|
+
}
|
|
5223
|
+
$xeTable.closeFilter();
|
|
5224
|
+
if (keyboardConfig && keyboardOpts.isEsc) {
|
|
5225
|
+
// 如果是激活编辑状态,则取消编辑
|
|
5226
|
+
if (actived.row) {
|
|
5227
|
+
const params = actived.args;
|
|
5228
|
+
$xeTable.handleClearEdit(evnt);
|
|
5229
|
+
// 如果配置了选中功能,则为选中状态
|
|
5230
|
+
if (mouseOpts.selected) {
|
|
5231
|
+
$xeTable.$nextTick(() => $xeTable.handleSelected(params, evnt));
|
|
5232
|
+
}
|
|
5233
|
+
}
|
|
5234
|
+
}
|
|
5209
5235
|
}
|
|
5210
5236
|
else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'radio')) {
|
|
5211
5237
|
// 空格键支持选中复选框
|
|
5212
5238
|
evnt.preventDefault();
|
|
5213
5239
|
if (selected.column.type === 'checkbox') {
|
|
5214
|
-
|
|
5240
|
+
$xeTable.handleToggleCheckRowEvent(evnt, selected.args);
|
|
5215
5241
|
}
|
|
5216
5242
|
else {
|
|
5217
|
-
|
|
5243
|
+
$xeTable.triggerRadioRowEvent(evnt, selected.args);
|
|
5218
5244
|
}
|
|
5219
5245
|
}
|
|
5220
5246
|
else if (isF2 && isEnableConf(editConfig)) {
|
|
@@ -5223,13 +5249,13 @@ const Methods = {
|
|
|
5223
5249
|
if (selected.row && selected.column) {
|
|
5224
5250
|
evnt.stopPropagation();
|
|
5225
5251
|
evnt.preventDefault();
|
|
5226
|
-
|
|
5252
|
+
$xeTable.handleEdit(selected.args, evnt);
|
|
5227
5253
|
}
|
|
5228
5254
|
}
|
|
5229
5255
|
}
|
|
5230
5256
|
else if (isContextMenu) {
|
|
5231
5257
|
// 如果按下上下文键
|
|
5232
|
-
internalData._keyCtx = selected.row && selected.column &&
|
|
5258
|
+
internalData._keyCtx = selected.row && selected.column && bodyMenu.length;
|
|
5233
5259
|
clearTimeout(internalData.keyCtxTimeout);
|
|
5234
5260
|
internalData.keyCtxTimeout = setTimeout(() => {
|
|
5235
5261
|
internalData._keyCtx = false;
|
|
@@ -5242,10 +5268,10 @@ const Methods = {
|
|
|
5242
5268
|
// 如果是激活编辑状态,则取消编辑
|
|
5243
5269
|
if (actived.row) {
|
|
5244
5270
|
const params = actived.args;
|
|
5245
|
-
|
|
5271
|
+
$xeTable.handleClearEdit(evnt);
|
|
5246
5272
|
// 如果配置了选中功能,则为选中状态
|
|
5247
5273
|
if (mouseConfig && mouseOpts.selected) {
|
|
5248
|
-
|
|
5274
|
+
$xeTable.$nextTick(() => $xeTable.handleSelected(params, evnt));
|
|
5249
5275
|
}
|
|
5250
5276
|
}
|
|
5251
5277
|
}
|
|
@@ -5255,15 +5281,15 @@ const Methods = {
|
|
|
5255
5281
|
const activeParams = selected.row ? selected.args : actived.args;
|
|
5256
5282
|
if (hasShiftKey) {
|
|
5257
5283
|
if (keyboardOpts.enterToTab) {
|
|
5258
|
-
|
|
5284
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
5259
5285
|
}
|
|
5260
5286
|
else {
|
|
5261
|
-
|
|
5287
|
+
$xeTable.moveEnterSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
|
|
5262
5288
|
}
|
|
5263
5289
|
}
|
|
5264
5290
|
else {
|
|
5265
5291
|
if (keyboardOpts.enterToTab) {
|
|
5266
|
-
|
|
5292
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
5267
5293
|
}
|
|
5268
5294
|
else {
|
|
5269
5295
|
const activeRow = selected.row || actived.row;
|
|
@@ -5292,7 +5318,7 @@ const Methods = {
|
|
|
5292
5318
|
return;
|
|
5293
5319
|
}
|
|
5294
5320
|
}
|
|
5295
|
-
|
|
5321
|
+
$xeTable.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
5296
5322
|
if (enterMethod) {
|
|
5297
5323
|
enterMethod(etrParams);
|
|
5298
5324
|
}
|
|
@@ -5306,10 +5332,15 @@ const Methods = {
|
|
|
5306
5332
|
if (childrens && childrens.length) {
|
|
5307
5333
|
evnt.preventDefault();
|
|
5308
5334
|
const targetRow = childrens[0];
|
|
5309
|
-
const params = {
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
.
|
|
5335
|
+
const params = {
|
|
5336
|
+
$table: $xeTable,
|
|
5337
|
+
row: targetRow,
|
|
5338
|
+
rowIndex: $xeTable.getRowIndex(targetRow),
|
|
5339
|
+
$rowIndex: $xeTable.getVMRowIndex(targetRow)
|
|
5340
|
+
};
|
|
5341
|
+
$xeTable.setTreeExpand(currentRow, true)
|
|
5342
|
+
.then(() => $xeTable.scrollToRow(targetRow))
|
|
5343
|
+
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
5313
5344
|
}
|
|
5314
5345
|
}
|
|
5315
5346
|
}
|
|
@@ -5317,18 +5348,28 @@ const Methods = {
|
|
|
5317
5348
|
else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
|
|
5318
5349
|
if (!isEditStatus) {
|
|
5319
5350
|
// 如果按下了方向键
|
|
5320
|
-
if (selected.row && selected.column) {
|
|
5351
|
+
if (mouseOpts.selected && selected.row && selected.column) {
|
|
5321
5352
|
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
5322
5353
|
}
|
|
5354
|
+
else {
|
|
5355
|
+
// 当前行按键上下移动
|
|
5356
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
5357
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
5358
|
+
}
|
|
5359
|
+
// 当前行按键左右移动
|
|
5360
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
5361
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
5362
|
+
}
|
|
5363
|
+
}
|
|
5323
5364
|
}
|
|
5324
5365
|
}
|
|
5325
5366
|
else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
5326
5367
|
// 如果按下了 Tab 键切换
|
|
5327
5368
|
if (selected.row || selected.column) {
|
|
5328
|
-
|
|
5369
|
+
$xeTable.moveTabSelected(selected.args, hasShiftKey, evnt);
|
|
5329
5370
|
}
|
|
5330
5371
|
else if (actived.row || actived.column) {
|
|
5331
|
-
|
|
5372
|
+
$xeTable.moveTabSelected(actived.args, hasShiftKey, evnt);
|
|
5332
5373
|
}
|
|
5333
5374
|
}
|
|
5334
5375
|
else if (keyboardConfig && keyboardOpts.isDel && hasDeleteKey && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
@@ -5337,10 +5378,10 @@ const Methods = {
|
|
|
5337
5378
|
const { delMethod } = keyboardOpts;
|
|
5338
5379
|
const params = {
|
|
5339
5380
|
row: selected.row,
|
|
5340
|
-
rowIndex:
|
|
5381
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
5341
5382
|
column: selected.column,
|
|
5342
|
-
columnIndex:
|
|
5343
|
-
$table:
|
|
5383
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
5384
|
+
$table: $xeTable,
|
|
5344
5385
|
$grid: $xeGrid
|
|
5345
5386
|
};
|
|
5346
5387
|
// 是否被禁用
|
|
@@ -5352,8 +5393,8 @@ const Methods = {
|
|
|
5352
5393
|
setCellValue(selected.row, selected.column, null);
|
|
5353
5394
|
}
|
|
5354
5395
|
// 如果按下 del 键,更新表尾数据
|
|
5355
|
-
|
|
5356
|
-
|
|
5396
|
+
$xeTable.updateFooter();
|
|
5397
|
+
$xeTable.dispatchEvent('cell-delete-value', params, evnt);
|
|
5357
5398
|
}
|
|
5358
5399
|
}
|
|
5359
5400
|
}
|
|
@@ -5364,10 +5405,10 @@ const Methods = {
|
|
|
5364
5405
|
if (keyboardOpts.isDel && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
5365
5406
|
const params = {
|
|
5366
5407
|
row: selected.row,
|
|
5367
|
-
rowIndex:
|
|
5408
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
5368
5409
|
column: selected.column,
|
|
5369
|
-
columnIndex:
|
|
5370
|
-
$table:
|
|
5410
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
5411
|
+
$table: $xeTable,
|
|
5371
5412
|
$grid: $xeGrid
|
|
5372
5413
|
};
|
|
5373
5414
|
// 是否被禁用
|
|
@@ -5380,28 +5421,28 @@ const Methods = {
|
|
|
5380
5421
|
if (editMode !== 'insert') {
|
|
5381
5422
|
setCellValue(selected.row, selected.column, null);
|
|
5382
5423
|
}
|
|
5383
|
-
|
|
5424
|
+
$xeTable.handleEdit(selected.args, evnt);
|
|
5384
5425
|
}
|
|
5385
|
-
|
|
5426
|
+
$xeTable.dispatchEvent('cell-backspace-value', params, evnt);
|
|
5386
5427
|
}
|
|
5387
5428
|
}
|
|
5388
5429
|
}
|
|
5389
5430
|
}
|
|
5390
5431
|
else if (hasBackspaceKey && keyboardConfig && treeConfig && keyboardOpts.isBack && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
|
|
5391
5432
|
// 如果树形表格回退键关闭当前行返回父节点
|
|
5392
|
-
const { parent: parentRow } = XEUtils.findTree(
|
|
5433
|
+
const { parent: parentRow } = XEUtils.findTree(internalData.afterTreeFullData, item => item === currentRow, { children: childrenField });
|
|
5393
5434
|
if (parentRow) {
|
|
5394
5435
|
evnt.preventDefault();
|
|
5395
5436
|
const params = {
|
|
5396
5437
|
row: parentRow,
|
|
5397
|
-
rowIndex:
|
|
5398
|
-
$rowIndex:
|
|
5399
|
-
$table:
|
|
5438
|
+
rowIndex: $xeTable.getRowIndex(parentRow),
|
|
5439
|
+
$rowIndex: $xeTable.getVMRowIndex(parentRow),
|
|
5440
|
+
$table: $xeTable,
|
|
5400
5441
|
$grid: $xeGrid
|
|
5401
5442
|
};
|
|
5402
|
-
|
|
5403
|
-
.then(() =>
|
|
5404
|
-
.then(() =>
|
|
5443
|
+
$xeTable.setTreeExpand(parentRow, false)
|
|
5444
|
+
.then(() => $xeTable.scrollToRow(parentRow))
|
|
5445
|
+
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
5405
5446
|
}
|
|
5406
5447
|
}
|
|
5407
5448
|
else if (keyboardConfig && keyboardOpts.isEdit && !hasCtrlKey && !hasMetaKey && (isSpacebar || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222))) {
|
|
@@ -5415,10 +5456,10 @@ const Methods = {
|
|
|
5415
5456
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
5416
5457
|
const params = {
|
|
5417
5458
|
row: selected.row,
|
|
5418
|
-
rowIndex:
|
|
5459
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
5419
5460
|
column: selected.column,
|
|
5420
|
-
columnIndex:
|
|
5421
|
-
$table:
|
|
5461
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
5462
|
+
$table: $xeTable,
|
|
5422
5463
|
$grid: $xeGrid
|
|
5423
5464
|
};
|
|
5424
5465
|
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
@@ -5427,12 +5468,12 @@ const Methods = {
|
|
|
5427
5468
|
}
|
|
5428
5469
|
else {
|
|
5429
5470
|
setCellValue(selected.row, selected.column, null);
|
|
5430
|
-
|
|
5471
|
+
$xeTable.handleEdit(selected.args, evnt);
|
|
5431
5472
|
}
|
|
5432
5473
|
}
|
|
5433
5474
|
}
|
|
5434
5475
|
}
|
|
5435
|
-
|
|
5476
|
+
$xeTable.dispatchEvent('keydown', {}, evnt);
|
|
5436
5477
|
});
|
|
5437
5478
|
}
|
|
5438
5479
|
},
|
|
@@ -5540,7 +5581,7 @@ const Methods = {
|
|
|
5540
5581
|
return;
|
|
5541
5582
|
}
|
|
5542
5583
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
5543
|
-
handleTooltip($xeTable, evnt, thEl, thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
5584
|
+
handleTooltip($xeTable, evnt, thEl, thEl.querySelector('.vxe-cell--wrapper'), thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
5544
5585
|
}
|
|
5545
5586
|
},
|
|
5546
5587
|
/**
|
|
@@ -5570,7 +5611,7 @@ const Methods = {
|
|
|
5570
5611
|
}
|
|
5571
5612
|
}
|
|
5572
5613
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
5573
|
-
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
5614
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
5574
5615
|
}
|
|
5575
5616
|
},
|
|
5576
5617
|
/**
|
|
@@ -5584,7 +5625,7 @@ const Methods = {
|
|
|
5584
5625
|
const tdEl = evnt.currentTarget;
|
|
5585
5626
|
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row);
|
|
5586
5627
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
5587
|
-
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
5628
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
5588
5629
|
}
|
|
5589
5630
|
},
|
|
5590
5631
|
openTooltip(target, content) {
|
|
@@ -8692,6 +8733,7 @@ const Methods = {
|
|
|
8692
8733
|
const internalData = $xeTable;
|
|
8693
8734
|
const { isGroup, scrollXLoad, overflowX, scrollXWidth } = reactData;
|
|
8694
8735
|
const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData;
|
|
8736
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
8695
8737
|
const tableBody = $xeTable.$refs.refTableBody;
|
|
8696
8738
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
8697
8739
|
if (tableBodyElem) {
|
|
@@ -8751,6 +8793,9 @@ const Methods = {
|
|
|
8751
8793
|
if (scrollXSpaceEl) {
|
|
8752
8794
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
|
|
8753
8795
|
}
|
|
8796
|
+
if (isScrollXBig && mouseOpts.area) {
|
|
8797
|
+
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
8798
|
+
}
|
|
8754
8799
|
$xeTable.$nextTick(() => {
|
|
8755
8800
|
updateStyle($xeTable);
|
|
8756
8801
|
});
|
|
@@ -8773,6 +8818,7 @@ const Methods = {
|
|
|
8773
8818
|
const { isAllOverflow, scrollYLoad, expandColumn } = reactData;
|
|
8774
8819
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData;
|
|
8775
8820
|
const { startIndex } = scrollYStore;
|
|
8821
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
8776
8822
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
8777
8823
|
const rowOpts = $xeTable.computeRowOpts;
|
|
8778
8824
|
const cellOpts = $xeTable.computeCellOpts;
|
|
@@ -8856,6 +8902,9 @@ const Methods = {
|
|
|
8856
8902
|
reactData.scrollYTop = scrollYTop;
|
|
8857
8903
|
reactData.scrollYHeight = scrollYHeight;
|
|
8858
8904
|
reactData.isScrollYBig = isScrollYBig;
|
|
8905
|
+
if (isScrollYBig && mouseOpts.area) {
|
|
8906
|
+
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
8907
|
+
}
|
|
8859
8908
|
return $xeTable.$nextTick().then(() => {
|
|
8860
8909
|
updateStyle($xeTable);
|
|
8861
8910
|
});
|
package/es/table/src/table.js
CHANGED
|
@@ -1130,6 +1130,9 @@ export default {
|
|
|
1130
1130
|
const $xeTable = this;
|
|
1131
1131
|
const $xeTabs = $xeTable.$xeTabs;
|
|
1132
1132
|
return $xeTabs ? $xeTabs.reactData.resizeFlag : null;
|
|
1133
|
+
},
|
|
1134
|
+
computeVxeLanguage() {
|
|
1135
|
+
return VxeUI.getLanguage();
|
|
1133
1136
|
} }),
|
|
1134
1137
|
watch: {
|
|
1135
1138
|
data(value) {
|
|
@@ -1202,6 +1205,9 @@ export default {
|
|
|
1202
1205
|
computeScrollbarYToLeft() {
|
|
1203
1206
|
this.reLayoutFlag++;
|
|
1204
1207
|
},
|
|
1208
|
+
computeVxeLanguage() {
|
|
1209
|
+
this.reLayoutFlag++;
|
|
1210
|
+
},
|
|
1205
1211
|
reLayoutFlag() {
|
|
1206
1212
|
const $xeTable = this;
|
|
1207
1213
|
$xeTable.$nextTick(() => $xeTable.recalculate(true));
|
package/es/ui/index.js
CHANGED
package/es/ui/src/dom.js
CHANGED
package/es/ui/src/log.js
CHANGED