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
package/lib/table/src/methods.js
CHANGED
|
@@ -21,6 +21,7 @@ const {
|
|
|
21
21
|
interceptor,
|
|
22
22
|
createEvent
|
|
23
23
|
} = _ui.VxeUI;
|
|
24
|
+
const browseObj = _xeUtils.default.browse();
|
|
24
25
|
const supportMaxRow = 5e6;
|
|
25
26
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
26
27
|
const maxYHeight = 5e6;
|
|
@@ -623,11 +624,11 @@ function updateStyle($xeTable) {
|
|
|
623
624
|
}
|
|
624
625
|
if (xLeftCornerEl) {
|
|
625
626
|
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
626
|
-
xLeftCornerEl.style.display = scrollbarXToTop ?
|
|
627
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? overflowX && osbHeight ? 'block' : '' : '';
|
|
627
628
|
}
|
|
628
629
|
if (xRightCornerEl) {
|
|
629
630
|
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
630
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' :
|
|
631
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : overflowX && osbHeight ? 'block' : '';
|
|
631
632
|
}
|
|
632
633
|
const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem;
|
|
633
634
|
if (scrollYVirtualEl) {
|
|
@@ -638,7 +639,7 @@ function updateStyle($xeTable) {
|
|
|
638
639
|
const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem;
|
|
639
640
|
if (yTopCornerEl) {
|
|
640
641
|
yTopCornerEl.style.height = `${headerHeight}px`;
|
|
641
|
-
yTopCornerEl.style.display = headerHeight ? 'block' : '';
|
|
642
|
+
yTopCornerEl.style.display = overflowY && headerHeight ? 'block' : '';
|
|
642
643
|
}
|
|
643
644
|
const yWrapperEl = $xeTable.$refs.refScrollYWrapperElem;
|
|
644
645
|
if (yWrapperEl) {
|
|
@@ -649,7 +650,7 @@ function updateStyle($xeTable) {
|
|
|
649
650
|
if (yBottomCornerEl) {
|
|
650
651
|
yBottomCornerEl.style.height = `${footerHeight}px`;
|
|
651
652
|
yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`;
|
|
652
|
-
yBottomCornerEl.style.display = footerHeight ? 'block' : '';
|
|
653
|
+
yBottomCornerEl.style.display = overflowY && footerHeight ? 'block' : '';
|
|
653
654
|
}
|
|
654
655
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
655
656
|
if (rowExpandEl) {
|
|
@@ -763,7 +764,7 @@ function updateStyle($xeTable) {
|
|
|
763
764
|
if (tableElem) {
|
|
764
765
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
765
766
|
// 兼容性处理
|
|
766
|
-
tableElem.style.paddingRight = osbWidth && fixedType && (
|
|
767
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browseObj['-moz'] || browseObj.safari) ? `${osbWidth}px` : '';
|
|
767
768
|
}
|
|
768
769
|
const emptyBlockElem = (0, _util.getRefElem)(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
769
770
|
if (emptyBlockElem) {
|
|
@@ -2083,7 +2084,7 @@ function hideDropTip($xeTable) {
|
|
|
2083
2084
|
* @param {Event} evnt 事件
|
|
2084
2085
|
* @param {Row} row 行对象
|
|
2085
2086
|
*/
|
|
2086
|
-
function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
2087
|
+
function handleTooltip($xeTable, evnt, tdEl, overflowElem, tipElem, params) {
|
|
2087
2088
|
const reactData = $xeTable;
|
|
2088
2089
|
const tipOverEl = overflowElem || tdEl;
|
|
2089
2090
|
if (!tipOverEl) {
|
|
@@ -2105,7 +2106,8 @@ function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
|
2105
2106
|
const customContent = contentMethod ? contentMethod(params) : null;
|
|
2106
2107
|
const useCustom = contentMethod && !_xeUtils.default.eqNull(customContent);
|
|
2107
2108
|
const content = useCustom ? customContent : _xeUtils.default.toString(column.type === 'html' ? tipOverEl.innerText : tipOverEl.textContent).trim();
|
|
2108
|
-
|
|
2109
|
+
const isOver = tipOverEl.scrollWidth > tipOverEl.clientWidth;
|
|
2110
|
+
if (content && (showAll || useCustom || isOver)) {
|
|
2109
2111
|
Object.assign(tooltipStore, {
|
|
2110
2112
|
row,
|
|
2111
2113
|
column,
|
|
@@ -2115,7 +2117,7 @@ function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
|
2115
2117
|
$xeTable.$nextTick(() => {
|
|
2116
2118
|
const $tooltip = $xeTable.$refs.refTooltip;
|
|
2117
2119
|
if ($tooltip && $tooltip.open) {
|
|
2118
|
-
$tooltip.open(tipOverEl, (0, _utils.formatText)(content));
|
|
2120
|
+
$tooltip.open(isOver ? tipOverEl : tipElem, (0, _utils.formatText)(content));
|
|
2119
2121
|
}
|
|
2120
2122
|
});
|
|
2121
2123
|
}
|
|
@@ -5978,32 +5980,38 @@ const Methods = {
|
|
|
5978
5980
|
*/
|
|
5979
5981
|
handleGlobalKeydownEvent(evnt) {
|
|
5980
5982
|
const $xeTable = this;
|
|
5983
|
+
const props = $xeTable;
|
|
5981
5984
|
const internalData = $xeTable;
|
|
5985
|
+
const reactData = $xeTable;
|
|
5982
5986
|
const $xeGrid = $xeTable.$xeGrid;
|
|
5983
5987
|
// 该行为只对当前激活的表格有效
|
|
5984
|
-
if (
|
|
5985
|
-
|
|
5986
|
-
const {
|
|
5987
|
-
afterFullData
|
|
5988
|
-
} = internalData;
|
|
5988
|
+
if (internalData.isActivated) {
|
|
5989
|
+
$xeTable.preventEvent(evnt, 'event.keydown', null, () => {
|
|
5989
5990
|
const {
|
|
5990
|
-
filterStore,
|
|
5991
|
-
isCtxMenu,
|
|
5992
|
-
ctxMenuStore,
|
|
5993
|
-
editStore,
|
|
5994
|
-
editOpts,
|
|
5995
|
-
editConfig,
|
|
5996
5991
|
mouseConfig,
|
|
5997
|
-
mouseOpts,
|
|
5998
5992
|
keyboardConfig,
|
|
5999
|
-
keyboardOpts,
|
|
6000
5993
|
treeConfig,
|
|
6001
|
-
|
|
5994
|
+
editConfig,
|
|
6002
5995
|
highlightCurrentRow,
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
5996
|
+
highlightCurrentColumn
|
|
5997
|
+
} = props;
|
|
5998
|
+
const {
|
|
5999
|
+
ctxMenuStore,
|
|
6000
|
+
editStore,
|
|
6001
|
+
currentRow
|
|
6002
|
+
} = reactData;
|
|
6003
|
+
const {
|
|
6004
|
+
afterFullData
|
|
6005
|
+
} = internalData;
|
|
6006
|
+
const isMenu = $xeTable.computeIsMenu;
|
|
6007
|
+
const bodyMenu = $xeTable.computeBodyMenu;
|
|
6008
|
+
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
6009
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
6010
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
6011
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
6012
|
+
const menuList = $xeTable.computeMenuList;
|
|
6013
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
6014
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
6007
6015
|
const {
|
|
6008
6016
|
selected,
|
|
6009
6017
|
actived
|
|
@@ -6028,33 +6036,44 @@ const Methods = {
|
|
|
6028
6036
|
const hasShiftKey = evnt.shiftKey;
|
|
6029
6037
|
const hasAltKey = evnt.altKey;
|
|
6030
6038
|
const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
|
|
6031
|
-
const operCtxMenu =
|
|
6039
|
+
const operCtxMenu = isMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
|
|
6032
6040
|
const isEditStatus = (0, _utils.isEnableConf)(editConfig) && actived.column && actived.row;
|
|
6033
6041
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6034
6042
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
6035
|
-
if (filterStore.visible) {
|
|
6036
|
-
if (isEsc) {
|
|
6037
|
-
this.closeFilter();
|
|
6038
|
-
}
|
|
6039
|
-
return;
|
|
6040
|
-
}
|
|
6041
6043
|
if (operCtxMenu) {
|
|
6042
6044
|
// 如果配置了右键菜单; 支持方向键操作、回车
|
|
6043
6045
|
evnt.preventDefault();
|
|
6044
6046
|
if (ctxMenuStore.showChild && (0, _utils.hasChildrenList)(ctxMenuStore.selected)) {
|
|
6045
|
-
|
|
6047
|
+
$xeTable.moveCtxMenu(evnt, ctxMenuStore, 'selectChild', isLeftArrow, false, ctxMenuStore.selected.children);
|
|
6046
6048
|
} else {
|
|
6047
|
-
|
|
6049
|
+
$xeTable.moveCtxMenu(evnt, ctxMenuStore, 'selected', isRightArrow, true, menuList);
|
|
6050
|
+
}
|
|
6051
|
+
} else if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKeyboardCellAreaEvent) {
|
|
6052
|
+
$xeTable.handleKeyboardCellAreaEvent(evnt);
|
|
6053
|
+
} else if (isEsc) {
|
|
6054
|
+
// 如果按下了 Esc 键,关闭快捷菜单、筛选
|
|
6055
|
+
if ($xeTable.closeMenu) {
|
|
6056
|
+
$xeTable.closeMenu();
|
|
6057
|
+
}
|
|
6058
|
+
$xeTable.closeFilter();
|
|
6059
|
+
if (keyboardConfig && keyboardOpts.isEsc) {
|
|
6060
|
+
// 如果是激活编辑状态,则取消编辑
|
|
6061
|
+
if (actived.row) {
|
|
6062
|
+
const params = actived.args;
|
|
6063
|
+
$xeTable.handleClearEdit(evnt);
|
|
6064
|
+
// 如果配置了选中功能,则为选中状态
|
|
6065
|
+
if (mouseOpts.selected) {
|
|
6066
|
+
$xeTable.$nextTick(() => $xeTable.handleSelected(params, evnt));
|
|
6067
|
+
}
|
|
6068
|
+
}
|
|
6048
6069
|
}
|
|
6049
|
-
} else if (keyboardConfig && mouseConfig && mouseOpts.area && this.handleKeyboardCellAreaEvent) {
|
|
6050
|
-
this.handleKeyboardCellAreaEvent(evnt);
|
|
6051
6070
|
} else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'radio')) {
|
|
6052
6071
|
// 空格键支持选中复选框
|
|
6053
6072
|
evnt.preventDefault();
|
|
6054
6073
|
if (selected.column.type === 'checkbox') {
|
|
6055
|
-
|
|
6074
|
+
$xeTable.handleToggleCheckRowEvent(evnt, selected.args);
|
|
6056
6075
|
} else {
|
|
6057
|
-
|
|
6076
|
+
$xeTable.triggerRadioRowEvent(evnt, selected.args);
|
|
6058
6077
|
}
|
|
6059
6078
|
} else if (isF2 && (0, _utils.isEnableConf)(editConfig)) {
|
|
6060
6079
|
if (!isEditStatus) {
|
|
@@ -6062,12 +6081,12 @@ const Methods = {
|
|
|
6062
6081
|
if (selected.row && selected.column) {
|
|
6063
6082
|
evnt.stopPropagation();
|
|
6064
6083
|
evnt.preventDefault();
|
|
6065
|
-
|
|
6084
|
+
$xeTable.handleEdit(selected.args, evnt);
|
|
6066
6085
|
}
|
|
6067
6086
|
}
|
|
6068
6087
|
} else if (isContextMenu) {
|
|
6069
6088
|
// 如果按下上下文键
|
|
6070
|
-
internalData._keyCtx = selected.row && selected.column &&
|
|
6089
|
+
internalData._keyCtx = selected.row && selected.column && bodyMenu.length;
|
|
6071
6090
|
clearTimeout(internalData.keyCtxTimeout);
|
|
6072
6091
|
internalData.keyCtxTimeout = setTimeout(() => {
|
|
6073
6092
|
internalData._keyCtx = false;
|
|
@@ -6083,10 +6102,10 @@ const Methods = {
|
|
|
6083
6102
|
// 如果是激活编辑状态,则取消编辑
|
|
6084
6103
|
if (actived.row) {
|
|
6085
6104
|
const params = actived.args;
|
|
6086
|
-
|
|
6105
|
+
$xeTable.handleClearEdit(evnt);
|
|
6087
6106
|
// 如果配置了选中功能,则为选中状态
|
|
6088
6107
|
if (mouseConfig && mouseOpts.selected) {
|
|
6089
|
-
|
|
6108
|
+
$xeTable.$nextTick(() => $xeTable.handleSelected(params, evnt));
|
|
6090
6109
|
}
|
|
6091
6110
|
}
|
|
6092
6111
|
} else {
|
|
@@ -6095,13 +6114,13 @@ const Methods = {
|
|
|
6095
6114
|
const activeParams = selected.row ? selected.args : actived.args;
|
|
6096
6115
|
if (hasShiftKey) {
|
|
6097
6116
|
if (keyboardOpts.enterToTab) {
|
|
6098
|
-
|
|
6117
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
6099
6118
|
} else {
|
|
6100
|
-
|
|
6119
|
+
$xeTable.moveEnterSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
|
|
6101
6120
|
}
|
|
6102
6121
|
} else {
|
|
6103
6122
|
if (keyboardOpts.enterToTab) {
|
|
6104
|
-
|
|
6123
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
6105
6124
|
} else {
|
|
6106
6125
|
const activeRow = selected.row || actived.row;
|
|
6107
6126
|
const activeColumn = selected.column || actived.column;
|
|
@@ -6133,7 +6152,7 @@ const Methods = {
|
|
|
6133
6152
|
return;
|
|
6134
6153
|
}
|
|
6135
6154
|
}
|
|
6136
|
-
|
|
6155
|
+
$xeTable.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
6137
6156
|
if (enterMethod) {
|
|
6138
6157
|
enterMethod(etrParams);
|
|
6139
6158
|
}
|
|
@@ -6147,26 +6166,37 @@ const Methods = {
|
|
|
6147
6166
|
evnt.preventDefault();
|
|
6148
6167
|
const targetRow = childrens[0];
|
|
6149
6168
|
const params = {
|
|
6150
|
-
$table:
|
|
6151
|
-
row: targetRow
|
|
6169
|
+
$table: $xeTable,
|
|
6170
|
+
row: targetRow,
|
|
6171
|
+
rowIndex: $xeTable.getRowIndex(targetRow),
|
|
6172
|
+
$rowIndex: $xeTable.getVMRowIndex(targetRow)
|
|
6152
6173
|
};
|
|
6153
|
-
|
|
6174
|
+
$xeTable.setTreeExpand(currentRow, true).then(() => $xeTable.scrollToRow(targetRow)).then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
6154
6175
|
}
|
|
6155
6176
|
}
|
|
6156
6177
|
}
|
|
6157
6178
|
} else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
|
|
6158
6179
|
if (!isEditStatus) {
|
|
6159
6180
|
// 如果按下了方向键
|
|
6160
|
-
if (selected.row && selected.column) {
|
|
6181
|
+
if (mouseOpts.selected && selected.row && selected.column) {
|
|
6161
6182
|
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
6183
|
+
} else {
|
|
6184
|
+
// 当前行按键上下移动
|
|
6185
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
6186
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
6187
|
+
}
|
|
6188
|
+
// 当前行按键左右移动
|
|
6189
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
6190
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
6191
|
+
}
|
|
6162
6192
|
}
|
|
6163
6193
|
}
|
|
6164
6194
|
} else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
6165
6195
|
// 如果按下了 Tab 键切换
|
|
6166
6196
|
if (selected.row || selected.column) {
|
|
6167
|
-
|
|
6197
|
+
$xeTable.moveTabSelected(selected.args, hasShiftKey, evnt);
|
|
6168
6198
|
} else if (actived.row || actived.column) {
|
|
6169
|
-
|
|
6199
|
+
$xeTable.moveTabSelected(actived.args, hasShiftKey, evnt);
|
|
6170
6200
|
}
|
|
6171
6201
|
} else if (keyboardConfig && keyboardOpts.isDel && hasDeleteKey && (0, _utils.isEnableConf)(editConfig) && (selected.row || selected.column)) {
|
|
6172
6202
|
// 如果是删除键
|
|
@@ -6176,10 +6206,10 @@ const Methods = {
|
|
|
6176
6206
|
} = keyboardOpts;
|
|
6177
6207
|
const params = {
|
|
6178
6208
|
row: selected.row,
|
|
6179
|
-
rowIndex:
|
|
6209
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
6180
6210
|
column: selected.column,
|
|
6181
|
-
columnIndex:
|
|
6182
|
-
$table:
|
|
6211
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
6212
|
+
$table: $xeTable,
|
|
6183
6213
|
$grid: $xeGrid
|
|
6184
6214
|
};
|
|
6185
6215
|
// 是否被禁用
|
|
@@ -6190,8 +6220,8 @@ const Methods = {
|
|
|
6190
6220
|
(0, _util.setCellValue)(selected.row, selected.column, null);
|
|
6191
6221
|
}
|
|
6192
6222
|
// 如果按下 del 键,更新表尾数据
|
|
6193
|
-
|
|
6194
|
-
|
|
6223
|
+
$xeTable.updateFooter();
|
|
6224
|
+
$xeTable.dispatchEvent('cell-delete-value', params, evnt);
|
|
6195
6225
|
}
|
|
6196
6226
|
}
|
|
6197
6227
|
} else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && (0, _utils.isEnableConf)(editConfig) && (selected.row || selected.column)) {
|
|
@@ -6204,10 +6234,10 @@ const Methods = {
|
|
|
6204
6234
|
if (keyboardOpts.isDel && (0, _utils.isEnableConf)(editConfig) && (selected.row || selected.column)) {
|
|
6205
6235
|
const params = {
|
|
6206
6236
|
row: selected.row,
|
|
6207
|
-
rowIndex:
|
|
6237
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
6208
6238
|
column: selected.column,
|
|
6209
|
-
columnIndex:
|
|
6210
|
-
$table:
|
|
6239
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
6240
|
+
$table: $xeTable,
|
|
6211
6241
|
$grid: $xeGrid
|
|
6212
6242
|
};
|
|
6213
6243
|
// 是否被禁用
|
|
@@ -6219,9 +6249,9 @@ const Methods = {
|
|
|
6219
6249
|
if (editMode !== 'insert') {
|
|
6220
6250
|
(0, _util.setCellValue)(selected.row, selected.column, null);
|
|
6221
6251
|
}
|
|
6222
|
-
|
|
6252
|
+
$xeTable.handleEdit(selected.args, evnt);
|
|
6223
6253
|
}
|
|
6224
|
-
|
|
6254
|
+
$xeTable.dispatchEvent('cell-backspace-value', params, evnt);
|
|
6225
6255
|
}
|
|
6226
6256
|
}
|
|
6227
6257
|
}
|
|
@@ -6229,19 +6259,19 @@ const Methods = {
|
|
|
6229
6259
|
// 如果树形表格回退键关闭当前行返回父节点
|
|
6230
6260
|
const {
|
|
6231
6261
|
parent: parentRow
|
|
6232
|
-
} = _xeUtils.default.findTree(
|
|
6262
|
+
} = _xeUtils.default.findTree(internalData.afterTreeFullData, item => item === currentRow, {
|
|
6233
6263
|
children: childrenField
|
|
6234
6264
|
});
|
|
6235
6265
|
if (parentRow) {
|
|
6236
6266
|
evnt.preventDefault();
|
|
6237
6267
|
const params = {
|
|
6238
6268
|
row: parentRow,
|
|
6239
|
-
rowIndex:
|
|
6240
|
-
$rowIndex:
|
|
6241
|
-
$table:
|
|
6269
|
+
rowIndex: $xeTable.getRowIndex(parentRow),
|
|
6270
|
+
$rowIndex: $xeTable.getVMRowIndex(parentRow),
|
|
6271
|
+
$table: $xeTable,
|
|
6242
6272
|
$grid: $xeGrid
|
|
6243
6273
|
};
|
|
6244
|
-
|
|
6274
|
+
$xeTable.setTreeExpand(parentRow, false).then(() => $xeTable.scrollToRow(parentRow)).then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
6245
6275
|
}
|
|
6246
6276
|
} 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)) {
|
|
6247
6277
|
const {
|
|
@@ -6256,10 +6286,10 @@ const Methods = {
|
|
|
6256
6286
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
6257
6287
|
const params = {
|
|
6258
6288
|
row: selected.row,
|
|
6259
|
-
rowIndex:
|
|
6289
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
6260
6290
|
column: selected.column,
|
|
6261
|
-
columnIndex:
|
|
6262
|
-
$table:
|
|
6291
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
6292
|
+
$table: $xeTable,
|
|
6263
6293
|
$grid: $xeGrid
|
|
6264
6294
|
};
|
|
6265
6295
|
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
@@ -6267,12 +6297,12 @@ const Methods = {
|
|
|
6267
6297
|
editMethod(params);
|
|
6268
6298
|
} else {
|
|
6269
6299
|
(0, _util.setCellValue)(selected.row, selected.column, null);
|
|
6270
|
-
|
|
6300
|
+
$xeTable.handleEdit(selected.args, evnt);
|
|
6271
6301
|
}
|
|
6272
6302
|
}
|
|
6273
6303
|
}
|
|
6274
6304
|
}
|
|
6275
|
-
|
|
6305
|
+
$xeTable.dispatchEvent('keydown', {}, evnt);
|
|
6276
6306
|
});
|
|
6277
6307
|
}
|
|
6278
6308
|
},
|
|
@@ -6417,7 +6447,7 @@ const Methods = {
|
|
|
6417
6447
|
return;
|
|
6418
6448
|
}
|
|
6419
6449
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
6420
|
-
handleTooltip($xeTable, evnt, thEl, thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
6450
|
+
handleTooltip($xeTable, evnt, thEl, thEl.querySelector('.vxe-cell--wrapper'), thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
6421
6451
|
}
|
|
6422
6452
|
},
|
|
6423
6453
|
/**
|
|
@@ -6458,7 +6488,7 @@ const Methods = {
|
|
|
6458
6488
|
}
|
|
6459
6489
|
}
|
|
6460
6490
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
6461
|
-
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
6491
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
6462
6492
|
}
|
|
6463
6493
|
},
|
|
6464
6494
|
/**
|
|
@@ -6476,7 +6506,7 @@ const Methods = {
|
|
|
6476
6506
|
const tdEl = evnt.currentTarget;
|
|
6477
6507
|
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row);
|
|
6478
6508
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
6479
|
-
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
6509
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
6480
6510
|
}
|
|
6481
6511
|
},
|
|
6482
6512
|
openTooltip(target, content) {
|
|
@@ -10176,6 +10206,7 @@ const Methods = {
|
|
|
10176
10206
|
elemStore,
|
|
10177
10207
|
fullColumnIdData
|
|
10178
10208
|
} = internalData;
|
|
10209
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
10179
10210
|
const tableBody = $xeTable.$refs.refTableBody;
|
|
10180
10211
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
10181
10212
|
if (tableBodyElem) {
|
|
@@ -10234,6 +10265,9 @@ const Methods = {
|
|
|
10234
10265
|
if (scrollXSpaceEl) {
|
|
10235
10266
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
|
|
10236
10267
|
}
|
|
10268
|
+
if (isScrollXBig && mouseOpts.area) {
|
|
10269
|
+
(0, _log.errLog)('vxe.error.notProp', ['mouse-config.area']);
|
|
10270
|
+
}
|
|
10237
10271
|
$xeTable.$nextTick(() => {
|
|
10238
10272
|
updateStyle($xeTable);
|
|
10239
10273
|
});
|
|
@@ -10269,6 +10303,7 @@ const Methods = {
|
|
|
10269
10303
|
const {
|
|
10270
10304
|
startIndex
|
|
10271
10305
|
} = scrollYStore;
|
|
10306
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
10272
10307
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
10273
10308
|
const rowOpts = $xeTable.computeRowOpts;
|
|
10274
10309
|
const cellOpts = $xeTable.computeCellOpts;
|
|
@@ -10349,6 +10384,9 @@ const Methods = {
|
|
|
10349
10384
|
reactData.scrollYTop = scrollYTop;
|
|
10350
10385
|
reactData.scrollYHeight = scrollYHeight;
|
|
10351
10386
|
reactData.isScrollYBig = isScrollYBig;
|
|
10387
|
+
if (isScrollYBig && mouseOpts.area) {
|
|
10388
|
+
(0, _log.errLog)('vxe.error.notProp', ['mouse-config.area']);
|
|
10389
|
+
}
|
|
10352
10390
|
return $xeTable.$nextTick().then(() => {
|
|
10353
10391
|
updateStyle($xeTable);
|
|
10354
10392
|
});
|