vxe-table 4.23.16 → 4.23.18
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/dist/all.esm.js +199 -124
- package/dist/all.esm.min.js +3 -3
- package/es/grid/src/grid.js +0 -8
- package/es/table/module/edit/hook.js +83 -81
- package/es/table/src/table.js +114 -33
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +0 -8
- package/lib/index.umd.js +199 -124
- package/lib/index.umd.min.js +3 -3
- package/lib/table/module/edit/hook.js +83 -81
- package/lib/table/src/table.js +114 -33
- package/lib/ui/index.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +0 -9
- package/packages/table/module/edit/hook.ts +95 -84
- package/packages/table/src/table.ts +16127 -16028
- /package/dist/{iconfont.1794189355036.ttf → iconfont.1794366305845.ttf} +0 -0
- /package/dist/{iconfont.1794189355036.woff → iconfont.1794366305845.woff} +0 -0
- /package/dist/{iconfont.1794189355036.woff2 → iconfont.1794366305845.woff2} +0 -0
- /package/es/{iconfont.1794189355036.ttf → iconfont.1794366305845.ttf} +0 -0
- /package/es/{iconfont.1794189355036.woff → iconfont.1794366305845.woff} +0 -0
- /package/es/{iconfont.1794189355036.woff2 → iconfont.1794366305845.woff2} +0 -0
- /package/lib/{iconfont.1794189355036.ttf → iconfont.1794366305845.ttf} +0 -0
- /package/lib/{iconfont.1794189355036.woff → iconfont.1794366305845.woff} +0 -0
- /package/lib/{iconfont.1794189355036.woff2 → iconfont.1794366305845.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -318,7 +318,7 @@ function getDefaultConfig(val1, def1) {
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
// packages_temp/ui/index.ts
|
|
321
|
-
var version = "4.23.
|
|
321
|
+
var version = "4.23.18";
|
|
322
322
|
import_core2.VxeUI.version = version;
|
|
323
323
|
import_core2.VxeUI.tableVersion = version;
|
|
324
324
|
import_core2.VxeUI.setConfig({
|
|
@@ -1147,7 +1147,7 @@ function getPopupAppendElement(appendTo) {
|
|
|
1147
1147
|
// packages_temp/ui/src/log.ts
|
|
1148
1148
|
var import_core3 = require("@vxe-ui/core");
|
|
1149
1149
|
var { log } = import_core3.VxeUI;
|
|
1150
|
-
var tableVersion = `table v${"4.23.
|
|
1150
|
+
var tableVersion = `table v${"4.23.18"}`;
|
|
1151
1151
|
function createComponentLog(name) {
|
|
1152
1152
|
const uiVersion = import_core3.VxeUI.uiVersion ? `ui v${import_core3.VxeUI.uiVersion}` : "";
|
|
1153
1153
|
const ganttVersion = import_core3.VxeUI.ganttVersion ? `gantt v${import_core3.VxeUI.ganttVersion}` : "";
|
|
@@ -11086,76 +11086,26 @@ hooks3.add("tableEditModule", {
|
|
|
11086
11086
|
const { editRender } = column;
|
|
11087
11087
|
const { isFocus, isPos, isClear } = options;
|
|
11088
11088
|
const cell = params.cell || $xeTable.getCellElement(row, column);
|
|
11089
|
-
const
|
|
11089
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
11090
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod;
|
|
11090
11091
|
const editParams = { ...params, cell };
|
|
11091
|
-
if (cell
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
column.renderHeight = cell.offsetHeight;
|
|
11109
|
-
actived.args = editParams;
|
|
11110
|
-
actived.row = row;
|
|
11111
|
-
actived.column = column;
|
|
11112
|
-
$xeTable.handlePushStack();
|
|
11113
|
-
if (isClear) {
|
|
11114
|
-
setCellValue(row, column, null);
|
|
11115
|
-
}
|
|
11116
|
-
if (mode === "row") {
|
|
11117
|
-
tableColumn.forEach((column2) => getEditColumnModel(row, column2));
|
|
11118
|
-
} else {
|
|
11119
|
-
getEditColumnModel(row, column);
|
|
11120
|
-
}
|
|
11121
|
-
const afterEditMethod = editOpts.afterEditMethod;
|
|
11122
|
-
(0, import_vue17.nextTick)(() => {
|
|
11123
|
-
if (isFocus) {
|
|
11124
|
-
$xeTable.handleFocus(editParams, evnt);
|
|
11125
|
-
}
|
|
11126
|
-
if (afterEditMethod) {
|
|
11127
|
-
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
11128
|
-
}
|
|
11129
|
-
});
|
|
11130
|
-
}
|
|
11131
|
-
$xeTable.dispatchEvent(
|
|
11132
|
-
type,
|
|
11133
|
-
{
|
|
11134
|
-
row,
|
|
11135
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
11136
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
11137
|
-
column,
|
|
11138
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
11139
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
11140
|
-
},
|
|
11141
|
-
evnt
|
|
11142
|
-
);
|
|
11143
|
-
if (type === "edit-activated") {
|
|
11144
|
-
$xeTable.dispatchEvent(
|
|
11145
|
-
"edit-actived",
|
|
11146
|
-
{
|
|
11147
|
-
row,
|
|
11148
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
11149
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
11150
|
-
column,
|
|
11151
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
11152
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
11153
|
-
},
|
|
11154
|
-
evnt
|
|
11155
|
-
);
|
|
11156
|
-
}
|
|
11157
|
-
} else {
|
|
11158
|
-
const { column: oldColumn } = actived;
|
|
11092
|
+
if (!cell || !isEnableConf(editConfig) || !isEnableConf(editRender)) {
|
|
11093
|
+
return (0, import_vue17.nextTick)();
|
|
11094
|
+
}
|
|
11095
|
+
if ($xeTable.isPendingByRow(row) || $xeTable.isAggregateRecord(row)) {
|
|
11096
|
+
return (0, import_vue17.nextTick)();
|
|
11097
|
+
}
|
|
11098
|
+
if (actived.row !== row || (mode === "cell" ? actived.column !== column : false)) {
|
|
11099
|
+
const evntParams = {
|
|
11100
|
+
row,
|
|
11101
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
11102
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
11103
|
+
column,
|
|
11104
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
11105
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
11106
|
+
};
|
|
11107
|
+
const handleCellEdit = (status) => {
|
|
11108
|
+
if (status) {
|
|
11159
11109
|
if (hasEnableConf(mouseConfig, mouseOpts)) {
|
|
11160
11110
|
$xeTable.clearSelected();
|
|
11161
11111
|
if ($xeTable.clearCellAreas) {
|
|
@@ -11163,29 +11113,81 @@ hooks3.add("tableEditModule", {
|
|
|
11163
11113
|
$xeTable.clearCopyCellArea();
|
|
11164
11114
|
}
|
|
11165
11115
|
}
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
setCellValue(row, oldColumn, oldModel.value);
|
|
11170
|
-
}
|
|
11171
|
-
if ($xeTable.clearValidate) {
|
|
11172
|
-
$xeTable.clearValidate(row, column);
|
|
11173
|
-
}
|
|
11116
|
+
$xeTable.closeTooltip();
|
|
11117
|
+
if (actived.column) {
|
|
11118
|
+
handleClearEdit(evnt);
|
|
11174
11119
|
}
|
|
11175
11120
|
column.renderHeight = cell.offsetHeight;
|
|
11176
11121
|
actived.args = editParams;
|
|
11122
|
+
actived.row = row;
|
|
11177
11123
|
actived.column = column;
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11124
|
+
$xeTable.handlePushStack();
|
|
11125
|
+
if (isClear) {
|
|
11126
|
+
setCellValue(row, column, null);
|
|
11127
|
+
}
|
|
11128
|
+
if (mode === "row") {
|
|
11129
|
+
tableColumn.forEach((column2) => getEditColumnModel(row, column2));
|
|
11130
|
+
} else {
|
|
11131
|
+
getEditColumnModel(row, column);
|
|
11182
11132
|
}
|
|
11133
|
+
const afterEditMethod = editOpts.afterEditMethod;
|
|
11134
|
+
(0, import_vue17.nextTick)(() => {
|
|
11135
|
+
if (isFocus) {
|
|
11136
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
11137
|
+
}
|
|
11138
|
+
if (afterEditMethod) {
|
|
11139
|
+
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
11140
|
+
}
|
|
11141
|
+
});
|
|
11142
|
+
$xeTable.dispatchEvent("edit-activated", evntParams, evnt);
|
|
11143
|
+
$xeTable.dispatchEvent("edit-actived", evntParams, evnt);
|
|
11144
|
+
} else {
|
|
11145
|
+
$xeTable.dispatchEvent("edit-disabled", evntParams, evnt);
|
|
11183
11146
|
}
|
|
11184
11147
|
focused.column = null;
|
|
11185
11148
|
focused.row = null;
|
|
11186
11149
|
$xeTable.focus();
|
|
11150
|
+
};
|
|
11151
|
+
const eFnParams = { ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt };
|
|
11152
|
+
if (beforeEditFn) {
|
|
11153
|
+
handleCellEdit(!!beforeEditFn(eFnParams));
|
|
11154
|
+
} else if (beforeEditAsyncFn) {
|
|
11155
|
+
return Promise.resolve().then(() => beforeEditAsyncFn(eFnParams)).catch(() => false).then((status) => {
|
|
11156
|
+
handleCellEdit(!!status);
|
|
11157
|
+
});
|
|
11158
|
+
} else {
|
|
11159
|
+
handleCellEdit(true);
|
|
11160
|
+
}
|
|
11161
|
+
return (0, import_vue17.nextTick)();
|
|
11162
|
+
}
|
|
11163
|
+
const { column: oldColumn } = actived;
|
|
11164
|
+
if (hasEnableConf(mouseConfig, mouseOpts)) {
|
|
11165
|
+
$xeTable.clearSelected();
|
|
11166
|
+
if ($xeTable.clearCellAreas) {
|
|
11167
|
+
$xeTable.clearCellAreas();
|
|
11168
|
+
$xeTable.clearCopyCellArea();
|
|
11169
|
+
}
|
|
11170
|
+
}
|
|
11171
|
+
if (oldColumn && oldColumn !== column) {
|
|
11172
|
+
const { model: oldModel } = oldColumn;
|
|
11173
|
+
if (oldModel.update) {
|
|
11174
|
+
setCellValue(row, oldColumn, oldModel.value);
|
|
11175
|
+
}
|
|
11176
|
+
if ($xeTable.clearValidate) {
|
|
11177
|
+
$xeTable.clearValidate(row, column);
|
|
11187
11178
|
}
|
|
11188
11179
|
}
|
|
11180
|
+
column.renderHeight = cell.offsetHeight;
|
|
11181
|
+
actived.args = editParams;
|
|
11182
|
+
actived.column = column;
|
|
11183
|
+
if (isPos) {
|
|
11184
|
+
setTimeout(() => {
|
|
11185
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
11186
|
+
});
|
|
11187
|
+
}
|
|
11188
|
+
focused.column = null;
|
|
11189
|
+
focused.row = null;
|
|
11190
|
+
$xeTable.focus();
|
|
11189
11191
|
return (0, import_vue17.nextTick)();
|
|
11190
11192
|
};
|
|
11191
11193
|
const handleEditCell = (row, fieldOrColumn, options) => {
|
|
@@ -18139,7 +18141,7 @@ var table_default = (
|
|
|
18139
18141
|
internalData.mergeHeaderMaps = {};
|
|
18140
18142
|
internalData.mergeHeaderCellMaps = {};
|
|
18141
18143
|
internalData.mergeHeaderRowMaps = {};
|
|
18142
|
-
internalData.
|
|
18144
|
+
internalData.mergeHeaderColMaps = {};
|
|
18143
18145
|
$xeTable.setMergeHeaderCells(merges);
|
|
18144
18146
|
};
|
|
18145
18147
|
const handleHeaderMerge = (merges) => {
|
|
@@ -18862,35 +18864,51 @@ var table_default = (
|
|
|
18862
18864
|
updateColumnOffsetLeft();
|
|
18863
18865
|
updateHeight();
|
|
18864
18866
|
};
|
|
18865
|
-
const calcCellAutoHeight = (rowid, rowRest, wrapperEl) => {
|
|
18867
|
+
const calcCellAutoHeight = (rowid, rowRest, wrapperEl, cacheElemList) => {
|
|
18866
18868
|
const { fullCellHeightMaps } = internalData;
|
|
18867
18869
|
let chRest = fullCellHeightMaps[rowid];
|
|
18868
18870
|
if (!chRest) {
|
|
18869
18871
|
chRest = {};
|
|
18870
18872
|
fullCellHeightMaps[rowid] = chRest;
|
|
18871
18873
|
}
|
|
18872
|
-
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
18873
|
-
|
|
18874
|
-
let topBottomPadding = 0;
|
|
18874
|
+
const wrapperElemList = cacheElemList || Array.from(wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`));
|
|
18875
|
+
const cellItemList = [];
|
|
18875
18876
|
let changeCH = false;
|
|
18876
18877
|
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
18877
18878
|
const wrapperElem = wrapperElemList[i];
|
|
18878
18879
|
const cellElem = wrapperElem.parentElement;
|
|
18879
|
-
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
if (
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
|
|
18887
|
-
|
|
18888
|
-
|
|
18880
|
+
if (!cellElem) {
|
|
18881
|
+
continue;
|
|
18882
|
+
}
|
|
18883
|
+
const orHeight = cellElem.style.height;
|
|
18884
|
+
if (orHeight) {
|
|
18885
|
+
cellElem.style.height = "";
|
|
18886
|
+
}
|
|
18887
|
+
cellItemList.push({
|
|
18888
|
+
wrapperElem,
|
|
18889
|
+
cellElem,
|
|
18890
|
+
colid: wrapperElem.getAttribute("colid") || "",
|
|
18891
|
+
orHeight
|
|
18892
|
+
});
|
|
18893
|
+
}
|
|
18894
|
+
let topBottomPadding = 0;
|
|
18895
|
+
if (cellItemList.length) {
|
|
18896
|
+
const firstCellStyle = getComputedStyle(cellItemList[0].cellElem);
|
|
18897
|
+
topBottomPadding = Math.ceil(import_xe_utils24.default.toNumber(firstCellStyle.paddingTop) + import_xe_utils24.default.toNumber(firstCellStyle.paddingBottom));
|
|
18898
|
+
}
|
|
18899
|
+
for (let i = 0; i < cellItemList.length; i++) {
|
|
18900
|
+
const { wrapperElem, colid } = cellItemList[i];
|
|
18901
|
+
const colHeight = Math.ceil(wrapperElem.clientHeight + topBottomPadding);
|
|
18889
18902
|
if (chRest[colid] !== colHeight) {
|
|
18890
18903
|
changeCH = true;
|
|
18891
18904
|
chRest[colid] = colHeight;
|
|
18892
18905
|
}
|
|
18893
|
-
|
|
18906
|
+
}
|
|
18907
|
+
for (let i = 0; i < cellItemList.length; i++) {
|
|
18908
|
+
const { cellElem, orHeight } = cellItemList[i];
|
|
18909
|
+
if (orHeight) {
|
|
18910
|
+
cellElem.style.height = orHeight;
|
|
18911
|
+
}
|
|
18894
18912
|
}
|
|
18895
18913
|
const cellMaxHeight = getRowMaxHeight(chRest, changeCH);
|
|
18896
18914
|
return cellMaxHeight;
|
|
@@ -18907,12 +18925,18 @@ var table_default = (
|
|
|
18907
18925
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
18908
18926
|
if (!isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && treeOpts.showLine)) {
|
|
18909
18927
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
18928
|
+
const rowWrapperMaps = {};
|
|
18929
|
+
el.querySelectorAll(".vxe-cell--wrapper[rowid]").forEach((wrapperElem) => {
|
|
18930
|
+
const rid = wrapperElem.getAttribute("rowid") || "";
|
|
18931
|
+
const elemList = rowWrapperMaps[rid] || (rowWrapperMaps[rid] = []);
|
|
18932
|
+
elemList.push(wrapperElem);
|
|
18933
|
+
});
|
|
18910
18934
|
el.setAttribute("data-calc-row", "Y");
|
|
18911
18935
|
tableData.forEach((row) => {
|
|
18912
18936
|
const rowid = handleGetRowId(row);
|
|
18913
18937
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
18914
18938
|
if (rowRest) {
|
|
18915
|
-
const reHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
18939
|
+
const reHeight = calcCellAutoHeight(rowid, rowRest, el, rowWrapperMaps[rowid] || []);
|
|
18916
18940
|
rowRest.height = Math.max(defaultRowHeight, reHeight);
|
|
18917
18941
|
}
|
|
18918
18942
|
});
|
|
@@ -20705,7 +20729,7 @@ var table_default = (
|
|
|
20705
20729
|
};
|
|
20706
20730
|
const loadScrollXData = () => {
|
|
20707
20731
|
const { isScrollXBig } = reactData;
|
|
20708
|
-
const { mergeBodyList, mergeFooterList,
|
|
20732
|
+
const { mergeBodyList, mergeFooterList, mergeBodyColMaps, scrollXStore } = internalData;
|
|
20709
20733
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore;
|
|
20710
20734
|
const { toVisibleIndex, visibleSize } = handleVirtualXVisible();
|
|
20711
20735
|
const offsetItem = {
|
|
@@ -20714,7 +20738,7 @@ var table_default = (
|
|
|
20714
20738
|
};
|
|
20715
20739
|
scrollXStore.visibleStartIndex = toVisibleIndex - 1;
|
|
20716
20740
|
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
20717
|
-
calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList),
|
|
20741
|
+
calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList), mergeBodyColMaps, offsetItem, "col");
|
|
20718
20742
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
20719
20743
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
20720
20744
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
@@ -21090,7 +21114,7 @@ var table_default = (
|
|
|
21090
21114
|
};
|
|
21091
21115
|
const loadScrollYData = () => {
|
|
21092
21116
|
const { isAllOverflow, isScrollYBig } = reactData;
|
|
21093
|
-
const { mergeBodyList,
|
|
21117
|
+
const { mergeBodyList, mergeBodyRowMaps, scrollYStore } = internalData;
|
|
21094
21118
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollYStore;
|
|
21095
21119
|
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
|
|
21096
21120
|
const { toVisibleIndex, visibleSize } = handleVirtualYVisible();
|
|
@@ -21100,7 +21124,7 @@ var table_default = (
|
|
|
21100
21124
|
};
|
|
21101
21125
|
scrollYStore.visibleStartIndex = toVisibleIndex - 1;
|
|
21102
21126
|
scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
21103
|
-
calculateMergerOffsetIndex(mergeBodyList,
|
|
21127
|
+
calculateMergerOffsetIndex(mergeBodyList, mergeBodyRowMaps, offsetItem, "row");
|
|
21104
21128
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
21105
21129
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
21106
21130
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
@@ -21169,7 +21193,7 @@ var table_default = (
|
|
|
21169
21193
|
loadScrollYData();
|
|
21170
21194
|
}, fpsTime);
|
|
21171
21195
|
};
|
|
21172
|
-
const handleSyncScroll = (isRollX, isRollY) => {
|
|
21196
|
+
const handleSyncScroll = (isRollX, isRollY, isCompensate) => {
|
|
21173
21197
|
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
|
|
21174
21198
|
const autoWidthColumnList = computeAutoWidthColumnList.value;
|
|
21175
21199
|
internalData.lcsRunTime = Date.now();
|
|
@@ -21190,7 +21214,9 @@ var table_default = (
|
|
|
21190
21214
|
let xRest = null;
|
|
21191
21215
|
let yRest = null;
|
|
21192
21216
|
if (!isAllOverflow) {
|
|
21193
|
-
|
|
21217
|
+
if (!isCompensate) {
|
|
21218
|
+
calcCellHeight();
|
|
21219
|
+
}
|
|
21194
21220
|
updateRowOffsetTop();
|
|
21195
21221
|
}
|
|
21196
21222
|
if (isRollX && scrollXLoad) {
|
|
@@ -21206,7 +21232,9 @@ var table_default = (
|
|
|
21206
21232
|
autoCellWidth();
|
|
21207
21233
|
}
|
|
21208
21234
|
if (!isAllOverflow) {
|
|
21209
|
-
|
|
21235
|
+
if (!isCompensate) {
|
|
21236
|
+
calcCellHeight();
|
|
21237
|
+
}
|
|
21210
21238
|
updateRowOffsetTop();
|
|
21211
21239
|
}
|
|
21212
21240
|
return $xeTable.updateScrollYSpace();
|
|
@@ -21227,7 +21255,7 @@ var table_default = (
|
|
|
21227
21255
|
(0, import_vue22.nextTick)(() => {
|
|
21228
21256
|
updateRowExpandStyle();
|
|
21229
21257
|
if (!internalData.lcsTimeout) {
|
|
21230
|
-
handleSyncScroll(isRollX, isRollY);
|
|
21258
|
+
handleSyncScroll(isRollX, isRollY, true);
|
|
21231
21259
|
}
|
|
21232
21260
|
});
|
|
21233
21261
|
}
|
|
@@ -22877,6 +22905,7 @@ var table_default = (
|
|
|
22877
22905
|
const { fullAllDataRowIdData } = internalData;
|
|
22878
22906
|
const rows = import_xe_utils24.default.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
22879
22907
|
const el = refElem.value;
|
|
22908
|
+
let status = false;
|
|
22880
22909
|
if (el) {
|
|
22881
22910
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
22882
22911
|
el.setAttribute("data-calc-row", "Y");
|
|
@@ -22885,12 +22914,15 @@ var table_default = (
|
|
|
22885
22914
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
22886
22915
|
if (rowRest) {
|
|
22887
22916
|
rowRest.resizeHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
22917
|
+
status = true;
|
|
22888
22918
|
}
|
|
22889
22919
|
});
|
|
22890
22920
|
el.removeAttribute("data-calc-row");
|
|
22891
22921
|
reactData.calcCellHeightFlag++;
|
|
22892
22922
|
}
|
|
22893
|
-
return (0, import_vue22.nextTick)()
|
|
22923
|
+
return (0, import_vue22.nextTick)().then(() => {
|
|
22924
|
+
return { status };
|
|
22925
|
+
});
|
|
22894
22926
|
},
|
|
22895
22927
|
setRowHeight(rowOrId, height) {
|
|
22896
22928
|
const { fullAllDataRowIdData } = internalData;
|
|
@@ -25090,7 +25122,8 @@ var table_default = (
|
|
|
25090
25122
|
const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
|
|
25091
25123
|
const operCtxMenu = isContentMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
|
|
25092
25124
|
const isEditStatus = isEnableConf(editConfig) && actived.column && actived.row;
|
|
25093
|
-
const
|
|
25125
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
25126
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod;
|
|
25094
25127
|
const selectRow = selected.row;
|
|
25095
25128
|
const selectColumn = selected.column;
|
|
25096
25129
|
if (operCtxMenu) {
|
|
@@ -25318,7 +25351,7 @@ var table_default = (
|
|
|
25318
25351
|
$grid: $xeGrid,
|
|
25319
25352
|
$gantt: $xeGantt
|
|
25320
25353
|
};
|
|
25321
|
-
|
|
25354
|
+
const handleEdit = () => {
|
|
25322
25355
|
if (delMethod) {
|
|
25323
25356
|
delMethod(params);
|
|
25324
25357
|
} else {
|
|
@@ -25330,6 +25363,20 @@ var table_default = (
|
|
|
25330
25363
|
}
|
|
25331
25364
|
$xeTable.updateFooter();
|
|
25332
25365
|
dispatchEvent("cell-delete-value", params, evnt);
|
|
25366
|
+
};
|
|
25367
|
+
if (beforeEditFn) {
|
|
25368
|
+
if (beforeEditFn(params)) {
|
|
25369
|
+
handleEdit();
|
|
25370
|
+
}
|
|
25371
|
+
} else if (beforeEditAsyncFn) {
|
|
25372
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
25373
|
+
if (status) {
|
|
25374
|
+
handleEdit();
|
|
25375
|
+
}
|
|
25376
|
+
}).catch(() => {
|
|
25377
|
+
});
|
|
25378
|
+
} else {
|
|
25379
|
+
handleEdit();
|
|
25333
25380
|
}
|
|
25334
25381
|
}
|
|
25335
25382
|
} else if (hasBackspaceKey && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isBack && isEnableConf(editConfig) && (selectRow || selectColumn)) {
|
|
@@ -25349,7 +25396,7 @@ var table_default = (
|
|
|
25349
25396
|
$grid: $xeGrid,
|
|
25350
25397
|
$gantt: $xeGantt
|
|
25351
25398
|
};
|
|
25352
|
-
|
|
25399
|
+
const handleEdit = () => {
|
|
25353
25400
|
if (backMethod) {
|
|
25354
25401
|
backMethod(params);
|
|
25355
25402
|
} else {
|
|
@@ -25358,6 +25405,20 @@ var table_default = (
|
|
|
25358
25405
|
});
|
|
25359
25406
|
}
|
|
25360
25407
|
dispatchEvent("cell-backspace-value", params, evnt);
|
|
25408
|
+
};
|
|
25409
|
+
if (beforeEditFn) {
|
|
25410
|
+
if (beforeEditFn(params)) {
|
|
25411
|
+
handleEdit();
|
|
25412
|
+
}
|
|
25413
|
+
} else if (beforeEditAsyncFn) {
|
|
25414
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
25415
|
+
if (status) {
|
|
25416
|
+
handleEdit();
|
|
25417
|
+
}
|
|
25418
|
+
}).catch(() => {
|
|
25419
|
+
});
|
|
25420
|
+
} else {
|
|
25421
|
+
handleEdit();
|
|
25361
25422
|
}
|
|
25362
25423
|
}
|
|
25363
25424
|
}
|
|
@@ -25388,7 +25449,6 @@ var table_default = (
|
|
|
25388
25449
|
} else if (hasEnableConf(keyboardConfig, keyboardOpts) && isEnableConf(editConfig) && keyboardOpts.isEdit && !isControlKey && (isSpacebar || isProcess || evnt.key === "Process" || keyCode >= 48 && keyCode <= 57 || keyCode >= 65 && keyCode <= 90 || keyCode >= 96 && keyCode <= 111 || keyCode >= 186 && keyCode <= 192 || keyCode >= 219 && keyCode <= 222)) {
|
|
25389
25450
|
const { editMode, editMethod } = keyboardOpts;
|
|
25390
25451
|
if (selectColumn && selectRow && isEnableConf(selectColumn.editRender)) {
|
|
25391
|
-
const beforeEditMethod2 = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
25392
25452
|
const params = {
|
|
25393
25453
|
row: selectRow,
|
|
25394
25454
|
rowIndex: $xeTable.getRowIndex(selectRow),
|
|
@@ -25402,7 +25462,7 @@ var table_default = (
|
|
|
25402
25462
|
$grid: $xeGrid,
|
|
25403
25463
|
$gantt: $xeGantt
|
|
25404
25464
|
};
|
|
25405
|
-
|
|
25465
|
+
const handleEdit = () => {
|
|
25406
25466
|
if (editMethod) {
|
|
25407
25467
|
editMethod(params);
|
|
25408
25468
|
} else {
|
|
@@ -25414,6 +25474,20 @@ var table_default = (
|
|
|
25414
25474
|
isClear: isClearValue
|
|
25415
25475
|
});
|
|
25416
25476
|
}
|
|
25477
|
+
};
|
|
25478
|
+
if (beforeEditFn) {
|
|
25479
|
+
if (beforeEditFn(params)) {
|
|
25480
|
+
handleEdit();
|
|
25481
|
+
}
|
|
25482
|
+
} else if (beforeEditAsyncFn) {
|
|
25483
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
25484
|
+
if (status) {
|
|
25485
|
+
handleEdit();
|
|
25486
|
+
}
|
|
25487
|
+
}).catch(() => {
|
|
25488
|
+
});
|
|
25489
|
+
} else {
|
|
25490
|
+
handleEdit();
|
|
25417
25491
|
}
|
|
25418
25492
|
}
|
|
25419
25493
|
}
|
|
@@ -31179,6 +31253,7 @@ var table_default = (
|
|
|
31179
31253
|
const mouseOpts = computeMouseOpts.value;
|
|
31180
31254
|
const exportOpts = computeExportOpts.value;
|
|
31181
31255
|
const importOpts = computeImportOpts.value;
|
|
31256
|
+
const keyboardOpts = computeKeyboardOpts.value;
|
|
31182
31257
|
const rowDragOpts = computeRowDragOpts.value;
|
|
31183
31258
|
const areaOpts = computeAreaOpts.value;
|
|
31184
31259
|
const sortOpts = computeSortOpts.value;
|
|
@@ -31337,8 +31412,16 @@ var table_default = (
|
|
|
31337
31412
|
if (mouseOpts.area && props.treeConfig && !treeOpts.transform) {
|
|
31338
31413
|
errLog10("vxe.error.notSupportProp", ["mouse-config.area", "tree-config.transform=false", "tree-config.transform=true"]);
|
|
31339
31414
|
}
|
|
31340
|
-
if (props.editConfig
|
|
31341
|
-
|
|
31415
|
+
if (props.editConfig) {
|
|
31416
|
+
if (editOpts.activeMethod) {
|
|
31417
|
+
warnLog7("vxe.error.delProp", ["edit-config.activeMethod", "edit-config.beforeEditMethod"]);
|
|
31418
|
+
}
|
|
31419
|
+
if (editOpts.beforeEditMethod && editOpts.beforeEditAsyncMethod) {
|
|
31420
|
+
errLog10("vxe.error.errConflicts", ["edit-config.beforeEditMethod", "edit-config.beforeEditAsyncMethod"]);
|
|
31421
|
+
}
|
|
31422
|
+
if (keyboardOpts.isEdit && editOpts.beforeEditAsyncMethod) {
|
|
31423
|
+
warnLog7("vxe.error.errConflicts", ["keyboard-config.isEdit", "edit-config.beforeEditAsyncMethod"]);
|
|
31424
|
+
}
|
|
31342
31425
|
}
|
|
31343
31426
|
if (checkboxOpts.halfField) {
|
|
31344
31427
|
warnLog7("vxe.error.delProp", ["checkbox-config.halfField", "checkbox-config.indeterminateField"]);
|
|
@@ -32504,14 +32587,6 @@ var grid_default = (
|
|
|
32504
32587
|
return funcs;
|
|
32505
32588
|
};
|
|
32506
32589
|
const gridExtendTableMethods = extendTableMethods(tableComponentMethodKeys);
|
|
32507
|
-
tableComponentMethodKeys.forEach((name) => {
|
|
32508
|
-
gridExtendTableMethods[name] = (...args) => {
|
|
32509
|
-
const $xeTable = refTable.value;
|
|
32510
|
-
if ($xeTable && $xeTable[name]) {
|
|
32511
|
-
return $xeTable && $xeTable[name](...args);
|
|
32512
|
-
}
|
|
32513
|
-
};
|
|
32514
|
-
});
|
|
32515
32590
|
const computeProxyOpts = (0, import_vue25.computed)(() => {
|
|
32516
32591
|
return import_xe_utils27.default.merge({}, import_xe_utils27.default.clone(getConfig10().grid.proxyConfig, true), props.proxyConfig);
|
|
32517
32592
|
});
|