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/dist/all.esm.js
CHANGED
|
@@ -123,7 +123,7 @@ function getDefaultConfig(val1, def1) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
// packages_temp/ui/index.ts
|
|
126
|
-
var version = "4.23.
|
|
126
|
+
var version = "4.23.18";
|
|
127
127
|
VxeUI2.version = version;
|
|
128
128
|
VxeUI2.tableVersion = version;
|
|
129
129
|
VxeUI2.setConfig({
|
|
@@ -952,7 +952,7 @@ function getPopupAppendElement(appendTo) {
|
|
|
952
952
|
// packages_temp/ui/src/log.ts
|
|
953
953
|
import { VxeUI as VxeUI3 } from "@vxe-ui/core";
|
|
954
954
|
var { log } = VxeUI3;
|
|
955
|
-
var tableVersion = `table v${"4.23.
|
|
955
|
+
var tableVersion = `table v${"4.23.18"}`;
|
|
956
956
|
function createComponentLog(name) {
|
|
957
957
|
const uiVersion = VxeUI3.uiVersion ? `ui v${VxeUI3.uiVersion}` : "";
|
|
958
958
|
const ganttVersion = VxeUI3.ganttVersion ? `gantt v${VxeUI3.ganttVersion}` : "";
|
|
@@ -10891,76 +10891,26 @@ hooks3.add("tableEditModule", {
|
|
|
10891
10891
|
const { editRender } = column;
|
|
10892
10892
|
const { isFocus, isPos, isClear } = options;
|
|
10893
10893
|
const cell = params.cell || $xeTable.getCellElement(row, column);
|
|
10894
|
-
const
|
|
10894
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
10895
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod;
|
|
10895
10896
|
const editParams = { ...params, cell };
|
|
10896
|
-
if (cell
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
column.renderHeight = cell.offsetHeight;
|
|
10914
|
-
actived.args = editParams;
|
|
10915
|
-
actived.row = row;
|
|
10916
|
-
actived.column = column;
|
|
10917
|
-
$xeTable.handlePushStack();
|
|
10918
|
-
if (isClear) {
|
|
10919
|
-
setCellValue(row, column, null);
|
|
10920
|
-
}
|
|
10921
|
-
if (mode === "row") {
|
|
10922
|
-
tableColumn.forEach((column2) => getEditColumnModel(row, column2));
|
|
10923
|
-
} else {
|
|
10924
|
-
getEditColumnModel(row, column);
|
|
10925
|
-
}
|
|
10926
|
-
const afterEditMethod = editOpts.afterEditMethod;
|
|
10927
|
-
nextTick9(() => {
|
|
10928
|
-
if (isFocus) {
|
|
10929
|
-
$xeTable.handleFocus(editParams, evnt);
|
|
10930
|
-
}
|
|
10931
|
-
if (afterEditMethod) {
|
|
10932
|
-
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
10933
|
-
}
|
|
10934
|
-
});
|
|
10935
|
-
}
|
|
10936
|
-
$xeTable.dispatchEvent(
|
|
10937
|
-
type,
|
|
10938
|
-
{
|
|
10939
|
-
row,
|
|
10940
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
10941
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
10942
|
-
column,
|
|
10943
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
10944
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
10945
|
-
},
|
|
10946
|
-
evnt
|
|
10947
|
-
);
|
|
10948
|
-
if (type === "edit-activated") {
|
|
10949
|
-
$xeTable.dispatchEvent(
|
|
10950
|
-
"edit-actived",
|
|
10951
|
-
{
|
|
10952
|
-
row,
|
|
10953
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
10954
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
10955
|
-
column,
|
|
10956
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
10957
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
10958
|
-
},
|
|
10959
|
-
evnt
|
|
10960
|
-
);
|
|
10961
|
-
}
|
|
10962
|
-
} else {
|
|
10963
|
-
const { column: oldColumn } = actived;
|
|
10897
|
+
if (!cell || !isEnableConf(editConfig) || !isEnableConf(editRender)) {
|
|
10898
|
+
return nextTick9();
|
|
10899
|
+
}
|
|
10900
|
+
if ($xeTable.isPendingByRow(row) || $xeTable.isAggregateRecord(row)) {
|
|
10901
|
+
return nextTick9();
|
|
10902
|
+
}
|
|
10903
|
+
if (actived.row !== row || (mode === "cell" ? actived.column !== column : false)) {
|
|
10904
|
+
const evntParams = {
|
|
10905
|
+
row,
|
|
10906
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
10907
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
10908
|
+
column,
|
|
10909
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
10910
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
10911
|
+
};
|
|
10912
|
+
const handleCellEdit = (status) => {
|
|
10913
|
+
if (status) {
|
|
10964
10914
|
if (hasEnableConf(mouseConfig, mouseOpts)) {
|
|
10965
10915
|
$xeTable.clearSelected();
|
|
10966
10916
|
if ($xeTable.clearCellAreas) {
|
|
@@ -10968,29 +10918,81 @@ hooks3.add("tableEditModule", {
|
|
|
10968
10918
|
$xeTable.clearCopyCellArea();
|
|
10969
10919
|
}
|
|
10970
10920
|
}
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
setCellValue(row, oldColumn, oldModel.value);
|
|
10975
|
-
}
|
|
10976
|
-
if ($xeTable.clearValidate) {
|
|
10977
|
-
$xeTable.clearValidate(row, column);
|
|
10978
|
-
}
|
|
10921
|
+
$xeTable.closeTooltip();
|
|
10922
|
+
if (actived.column) {
|
|
10923
|
+
handleClearEdit(evnt);
|
|
10979
10924
|
}
|
|
10980
10925
|
column.renderHeight = cell.offsetHeight;
|
|
10981
10926
|
actived.args = editParams;
|
|
10927
|
+
actived.row = row;
|
|
10982
10928
|
actived.column = column;
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10929
|
+
$xeTable.handlePushStack();
|
|
10930
|
+
if (isClear) {
|
|
10931
|
+
setCellValue(row, column, null);
|
|
10932
|
+
}
|
|
10933
|
+
if (mode === "row") {
|
|
10934
|
+
tableColumn.forEach((column2) => getEditColumnModel(row, column2));
|
|
10935
|
+
} else {
|
|
10936
|
+
getEditColumnModel(row, column);
|
|
10987
10937
|
}
|
|
10938
|
+
const afterEditMethod = editOpts.afterEditMethod;
|
|
10939
|
+
nextTick9(() => {
|
|
10940
|
+
if (isFocus) {
|
|
10941
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
10942
|
+
}
|
|
10943
|
+
if (afterEditMethod) {
|
|
10944
|
+
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
10945
|
+
}
|
|
10946
|
+
});
|
|
10947
|
+
$xeTable.dispatchEvent("edit-activated", evntParams, evnt);
|
|
10948
|
+
$xeTable.dispatchEvent("edit-actived", evntParams, evnt);
|
|
10949
|
+
} else {
|
|
10950
|
+
$xeTable.dispatchEvent("edit-disabled", evntParams, evnt);
|
|
10988
10951
|
}
|
|
10989
10952
|
focused.column = null;
|
|
10990
10953
|
focused.row = null;
|
|
10991
10954
|
$xeTable.focus();
|
|
10955
|
+
};
|
|
10956
|
+
const eFnParams = { ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt };
|
|
10957
|
+
if (beforeEditFn) {
|
|
10958
|
+
handleCellEdit(!!beforeEditFn(eFnParams));
|
|
10959
|
+
} else if (beforeEditAsyncFn) {
|
|
10960
|
+
return Promise.resolve().then(() => beforeEditAsyncFn(eFnParams)).catch(() => false).then((status) => {
|
|
10961
|
+
handleCellEdit(!!status);
|
|
10962
|
+
});
|
|
10963
|
+
} else {
|
|
10964
|
+
handleCellEdit(true);
|
|
10965
|
+
}
|
|
10966
|
+
return nextTick9();
|
|
10967
|
+
}
|
|
10968
|
+
const { column: oldColumn } = actived;
|
|
10969
|
+
if (hasEnableConf(mouseConfig, mouseOpts)) {
|
|
10970
|
+
$xeTable.clearSelected();
|
|
10971
|
+
if ($xeTable.clearCellAreas) {
|
|
10972
|
+
$xeTable.clearCellAreas();
|
|
10973
|
+
$xeTable.clearCopyCellArea();
|
|
10974
|
+
}
|
|
10975
|
+
}
|
|
10976
|
+
if (oldColumn && oldColumn !== column) {
|
|
10977
|
+
const { model: oldModel } = oldColumn;
|
|
10978
|
+
if (oldModel.update) {
|
|
10979
|
+
setCellValue(row, oldColumn, oldModel.value);
|
|
10980
|
+
}
|
|
10981
|
+
if ($xeTable.clearValidate) {
|
|
10982
|
+
$xeTable.clearValidate(row, column);
|
|
10992
10983
|
}
|
|
10993
10984
|
}
|
|
10985
|
+
column.renderHeight = cell.offsetHeight;
|
|
10986
|
+
actived.args = editParams;
|
|
10987
|
+
actived.column = column;
|
|
10988
|
+
if (isPos) {
|
|
10989
|
+
setTimeout(() => {
|
|
10990
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
10991
|
+
});
|
|
10992
|
+
}
|
|
10993
|
+
focused.column = null;
|
|
10994
|
+
focused.row = null;
|
|
10995
|
+
$xeTable.focus();
|
|
10994
10996
|
return nextTick9();
|
|
10995
10997
|
};
|
|
10996
10998
|
const handleEditCell = (row, fieldOrColumn, options) => {
|
|
@@ -17944,7 +17946,7 @@ var table_default = (
|
|
|
17944
17946
|
internalData.mergeHeaderMaps = {};
|
|
17945
17947
|
internalData.mergeHeaderCellMaps = {};
|
|
17946
17948
|
internalData.mergeHeaderRowMaps = {};
|
|
17947
|
-
internalData.
|
|
17949
|
+
internalData.mergeHeaderColMaps = {};
|
|
17948
17950
|
$xeTable.setMergeHeaderCells(merges);
|
|
17949
17951
|
};
|
|
17950
17952
|
const handleHeaderMerge = (merges) => {
|
|
@@ -18667,35 +18669,51 @@ var table_default = (
|
|
|
18667
18669
|
updateColumnOffsetLeft();
|
|
18668
18670
|
updateHeight();
|
|
18669
18671
|
};
|
|
18670
|
-
const calcCellAutoHeight = (rowid, rowRest, wrapperEl) => {
|
|
18672
|
+
const calcCellAutoHeight = (rowid, rowRest, wrapperEl, cacheElemList) => {
|
|
18671
18673
|
const { fullCellHeightMaps } = internalData;
|
|
18672
18674
|
let chRest = fullCellHeightMaps[rowid];
|
|
18673
18675
|
if (!chRest) {
|
|
18674
18676
|
chRest = {};
|
|
18675
18677
|
fullCellHeightMaps[rowid] = chRest;
|
|
18676
18678
|
}
|
|
18677
|
-
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
18678
|
-
|
|
18679
|
-
let topBottomPadding = 0;
|
|
18679
|
+
const wrapperElemList = cacheElemList || Array.from(wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`));
|
|
18680
|
+
const cellItemList = [];
|
|
18680
18681
|
let changeCH = false;
|
|
18681
18682
|
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
18682
18683
|
const wrapperElem = wrapperElemList[i];
|
|
18683
18684
|
const cellElem = wrapperElem.parentElement;
|
|
18684
|
-
|
|
18685
|
-
|
|
18686
|
-
|
|
18687
|
-
|
|
18688
|
-
if (
|
|
18689
|
-
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18685
|
+
if (!cellElem) {
|
|
18686
|
+
continue;
|
|
18687
|
+
}
|
|
18688
|
+
const orHeight = cellElem.style.height;
|
|
18689
|
+
if (orHeight) {
|
|
18690
|
+
cellElem.style.height = "";
|
|
18691
|
+
}
|
|
18692
|
+
cellItemList.push({
|
|
18693
|
+
wrapperElem,
|
|
18694
|
+
cellElem,
|
|
18695
|
+
colid: wrapperElem.getAttribute("colid") || "",
|
|
18696
|
+
orHeight
|
|
18697
|
+
});
|
|
18698
|
+
}
|
|
18699
|
+
let topBottomPadding = 0;
|
|
18700
|
+
if (cellItemList.length) {
|
|
18701
|
+
const firstCellStyle = getComputedStyle(cellItemList[0].cellElem);
|
|
18702
|
+
topBottomPadding = Math.ceil(XEUtils24.toNumber(firstCellStyle.paddingTop) + XEUtils24.toNumber(firstCellStyle.paddingBottom));
|
|
18703
|
+
}
|
|
18704
|
+
for (let i = 0; i < cellItemList.length; i++) {
|
|
18705
|
+
const { wrapperElem, colid } = cellItemList[i];
|
|
18706
|
+
const colHeight = Math.ceil(wrapperElem.clientHeight + topBottomPadding);
|
|
18694
18707
|
if (chRest[colid] !== colHeight) {
|
|
18695
18708
|
changeCH = true;
|
|
18696
18709
|
chRest[colid] = colHeight;
|
|
18697
18710
|
}
|
|
18698
|
-
|
|
18711
|
+
}
|
|
18712
|
+
for (let i = 0; i < cellItemList.length; i++) {
|
|
18713
|
+
const { cellElem, orHeight } = cellItemList[i];
|
|
18714
|
+
if (orHeight) {
|
|
18715
|
+
cellElem.style.height = orHeight;
|
|
18716
|
+
}
|
|
18699
18717
|
}
|
|
18700
18718
|
const cellMaxHeight = getRowMaxHeight(chRest, changeCH);
|
|
18701
18719
|
return cellMaxHeight;
|
|
@@ -18712,12 +18730,18 @@ var table_default = (
|
|
|
18712
18730
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
18713
18731
|
if (!isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && treeOpts.showLine)) {
|
|
18714
18732
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
18733
|
+
const rowWrapperMaps = {};
|
|
18734
|
+
el.querySelectorAll(".vxe-cell--wrapper[rowid]").forEach((wrapperElem) => {
|
|
18735
|
+
const rid = wrapperElem.getAttribute("rowid") || "";
|
|
18736
|
+
const elemList = rowWrapperMaps[rid] || (rowWrapperMaps[rid] = []);
|
|
18737
|
+
elemList.push(wrapperElem);
|
|
18738
|
+
});
|
|
18715
18739
|
el.setAttribute("data-calc-row", "Y");
|
|
18716
18740
|
tableData.forEach((row) => {
|
|
18717
18741
|
const rowid = handleGetRowId(row);
|
|
18718
18742
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
18719
18743
|
if (rowRest) {
|
|
18720
|
-
const reHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
18744
|
+
const reHeight = calcCellAutoHeight(rowid, rowRest, el, rowWrapperMaps[rowid] || []);
|
|
18721
18745
|
rowRest.height = Math.max(defaultRowHeight, reHeight);
|
|
18722
18746
|
}
|
|
18723
18747
|
});
|
|
@@ -20510,7 +20534,7 @@ var table_default = (
|
|
|
20510
20534
|
};
|
|
20511
20535
|
const loadScrollXData = () => {
|
|
20512
20536
|
const { isScrollXBig } = reactData;
|
|
20513
|
-
const { mergeBodyList, mergeFooterList,
|
|
20537
|
+
const { mergeBodyList, mergeFooterList, mergeBodyColMaps, scrollXStore } = internalData;
|
|
20514
20538
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore;
|
|
20515
20539
|
const { toVisibleIndex, visibleSize } = handleVirtualXVisible();
|
|
20516
20540
|
const offsetItem = {
|
|
@@ -20519,7 +20543,7 @@ var table_default = (
|
|
|
20519
20543
|
};
|
|
20520
20544
|
scrollXStore.visibleStartIndex = toVisibleIndex - 1;
|
|
20521
20545
|
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
20522
|
-
calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList),
|
|
20546
|
+
calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList), mergeBodyColMaps, offsetItem, "col");
|
|
20523
20547
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
20524
20548
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
20525
20549
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
@@ -20895,7 +20919,7 @@ var table_default = (
|
|
|
20895
20919
|
};
|
|
20896
20920
|
const loadScrollYData = () => {
|
|
20897
20921
|
const { isAllOverflow, isScrollYBig } = reactData;
|
|
20898
|
-
const { mergeBodyList,
|
|
20922
|
+
const { mergeBodyList, mergeBodyRowMaps, scrollYStore } = internalData;
|
|
20899
20923
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollYStore;
|
|
20900
20924
|
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
|
|
20901
20925
|
const { toVisibleIndex, visibleSize } = handleVirtualYVisible();
|
|
@@ -20905,7 +20929,7 @@ var table_default = (
|
|
|
20905
20929
|
};
|
|
20906
20930
|
scrollYStore.visibleStartIndex = toVisibleIndex - 1;
|
|
20907
20931
|
scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
20908
|
-
calculateMergerOffsetIndex(mergeBodyList,
|
|
20932
|
+
calculateMergerOffsetIndex(mergeBodyList, mergeBodyRowMaps, offsetItem, "row");
|
|
20909
20933
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
20910
20934
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
20911
20935
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
@@ -20974,7 +20998,7 @@ var table_default = (
|
|
|
20974
20998
|
loadScrollYData();
|
|
20975
20999
|
}, fpsTime);
|
|
20976
21000
|
};
|
|
20977
|
-
const handleSyncScroll = (isRollX, isRollY) => {
|
|
21001
|
+
const handleSyncScroll = (isRollX, isRollY, isCompensate) => {
|
|
20978
21002
|
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
|
|
20979
21003
|
const autoWidthColumnList = computeAutoWidthColumnList.value;
|
|
20980
21004
|
internalData.lcsRunTime = Date.now();
|
|
@@ -20995,7 +21019,9 @@ var table_default = (
|
|
|
20995
21019
|
let xRest = null;
|
|
20996
21020
|
let yRest = null;
|
|
20997
21021
|
if (!isAllOverflow) {
|
|
20998
|
-
|
|
21022
|
+
if (!isCompensate) {
|
|
21023
|
+
calcCellHeight();
|
|
21024
|
+
}
|
|
20999
21025
|
updateRowOffsetTop();
|
|
21000
21026
|
}
|
|
21001
21027
|
if (isRollX && scrollXLoad) {
|
|
@@ -21011,7 +21037,9 @@ var table_default = (
|
|
|
21011
21037
|
autoCellWidth();
|
|
21012
21038
|
}
|
|
21013
21039
|
if (!isAllOverflow) {
|
|
21014
|
-
|
|
21040
|
+
if (!isCompensate) {
|
|
21041
|
+
calcCellHeight();
|
|
21042
|
+
}
|
|
21015
21043
|
updateRowOffsetTop();
|
|
21016
21044
|
}
|
|
21017
21045
|
return $xeTable.updateScrollYSpace();
|
|
@@ -21032,7 +21060,7 @@ var table_default = (
|
|
|
21032
21060
|
nextTick13(() => {
|
|
21033
21061
|
updateRowExpandStyle();
|
|
21034
21062
|
if (!internalData.lcsTimeout) {
|
|
21035
|
-
handleSyncScroll(isRollX, isRollY);
|
|
21063
|
+
handleSyncScroll(isRollX, isRollY, true);
|
|
21036
21064
|
}
|
|
21037
21065
|
});
|
|
21038
21066
|
}
|
|
@@ -22682,6 +22710,7 @@ var table_default = (
|
|
|
22682
22710
|
const { fullAllDataRowIdData } = internalData;
|
|
22683
22711
|
const rows = XEUtils24.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
22684
22712
|
const el = refElem.value;
|
|
22713
|
+
let status = false;
|
|
22685
22714
|
if (el) {
|
|
22686
22715
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
22687
22716
|
el.setAttribute("data-calc-row", "Y");
|
|
@@ -22690,12 +22719,15 @@ var table_default = (
|
|
|
22690
22719
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
22691
22720
|
if (rowRest) {
|
|
22692
22721
|
rowRest.resizeHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
22722
|
+
status = true;
|
|
22693
22723
|
}
|
|
22694
22724
|
});
|
|
22695
22725
|
el.removeAttribute("data-calc-row");
|
|
22696
22726
|
reactData.calcCellHeightFlag++;
|
|
22697
22727
|
}
|
|
22698
|
-
return nextTick13()
|
|
22728
|
+
return nextTick13().then(() => {
|
|
22729
|
+
return { status };
|
|
22730
|
+
});
|
|
22699
22731
|
},
|
|
22700
22732
|
setRowHeight(rowOrId, height) {
|
|
22701
22733
|
const { fullAllDataRowIdData } = internalData;
|
|
@@ -24895,7 +24927,8 @@ var table_default = (
|
|
|
24895
24927
|
const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
|
|
24896
24928
|
const operCtxMenu = isContentMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
|
|
24897
24929
|
const isEditStatus = isEnableConf(editConfig) && actived.column && actived.row;
|
|
24898
|
-
const
|
|
24930
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
24931
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod;
|
|
24899
24932
|
const selectRow = selected.row;
|
|
24900
24933
|
const selectColumn = selected.column;
|
|
24901
24934
|
if (operCtxMenu) {
|
|
@@ -25123,7 +25156,7 @@ var table_default = (
|
|
|
25123
25156
|
$grid: $xeGrid,
|
|
25124
25157
|
$gantt: $xeGantt
|
|
25125
25158
|
};
|
|
25126
|
-
|
|
25159
|
+
const handleEdit = () => {
|
|
25127
25160
|
if (delMethod) {
|
|
25128
25161
|
delMethod(params);
|
|
25129
25162
|
} else {
|
|
@@ -25135,6 +25168,20 @@ var table_default = (
|
|
|
25135
25168
|
}
|
|
25136
25169
|
$xeTable.updateFooter();
|
|
25137
25170
|
dispatchEvent("cell-delete-value", params, evnt);
|
|
25171
|
+
};
|
|
25172
|
+
if (beforeEditFn) {
|
|
25173
|
+
if (beforeEditFn(params)) {
|
|
25174
|
+
handleEdit();
|
|
25175
|
+
}
|
|
25176
|
+
} else if (beforeEditAsyncFn) {
|
|
25177
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
25178
|
+
if (status) {
|
|
25179
|
+
handleEdit();
|
|
25180
|
+
}
|
|
25181
|
+
}).catch(() => {
|
|
25182
|
+
});
|
|
25183
|
+
} else {
|
|
25184
|
+
handleEdit();
|
|
25138
25185
|
}
|
|
25139
25186
|
}
|
|
25140
25187
|
} else if (hasBackspaceKey && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isBack && isEnableConf(editConfig) && (selectRow || selectColumn)) {
|
|
@@ -25154,7 +25201,7 @@ var table_default = (
|
|
|
25154
25201
|
$grid: $xeGrid,
|
|
25155
25202
|
$gantt: $xeGantt
|
|
25156
25203
|
};
|
|
25157
|
-
|
|
25204
|
+
const handleEdit = () => {
|
|
25158
25205
|
if (backMethod) {
|
|
25159
25206
|
backMethod(params);
|
|
25160
25207
|
} else {
|
|
@@ -25163,6 +25210,20 @@ var table_default = (
|
|
|
25163
25210
|
});
|
|
25164
25211
|
}
|
|
25165
25212
|
dispatchEvent("cell-backspace-value", params, evnt);
|
|
25213
|
+
};
|
|
25214
|
+
if (beforeEditFn) {
|
|
25215
|
+
if (beforeEditFn(params)) {
|
|
25216
|
+
handleEdit();
|
|
25217
|
+
}
|
|
25218
|
+
} else if (beforeEditAsyncFn) {
|
|
25219
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
25220
|
+
if (status) {
|
|
25221
|
+
handleEdit();
|
|
25222
|
+
}
|
|
25223
|
+
}).catch(() => {
|
|
25224
|
+
});
|
|
25225
|
+
} else {
|
|
25226
|
+
handleEdit();
|
|
25166
25227
|
}
|
|
25167
25228
|
}
|
|
25168
25229
|
}
|
|
@@ -25193,7 +25254,6 @@ var table_default = (
|
|
|
25193
25254
|
} 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)) {
|
|
25194
25255
|
const { editMode, editMethod } = keyboardOpts;
|
|
25195
25256
|
if (selectColumn && selectRow && isEnableConf(selectColumn.editRender)) {
|
|
25196
|
-
const beforeEditMethod2 = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
25197
25257
|
const params = {
|
|
25198
25258
|
row: selectRow,
|
|
25199
25259
|
rowIndex: $xeTable.getRowIndex(selectRow),
|
|
@@ -25207,7 +25267,7 @@ var table_default = (
|
|
|
25207
25267
|
$grid: $xeGrid,
|
|
25208
25268
|
$gantt: $xeGantt
|
|
25209
25269
|
};
|
|
25210
|
-
|
|
25270
|
+
const handleEdit = () => {
|
|
25211
25271
|
if (editMethod) {
|
|
25212
25272
|
editMethod(params);
|
|
25213
25273
|
} else {
|
|
@@ -25219,6 +25279,20 @@ var table_default = (
|
|
|
25219
25279
|
isClear: isClearValue
|
|
25220
25280
|
});
|
|
25221
25281
|
}
|
|
25282
|
+
};
|
|
25283
|
+
if (beforeEditFn) {
|
|
25284
|
+
if (beforeEditFn(params)) {
|
|
25285
|
+
handleEdit();
|
|
25286
|
+
}
|
|
25287
|
+
} else if (beforeEditAsyncFn) {
|
|
25288
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
25289
|
+
if (status) {
|
|
25290
|
+
handleEdit();
|
|
25291
|
+
}
|
|
25292
|
+
}).catch(() => {
|
|
25293
|
+
});
|
|
25294
|
+
} else {
|
|
25295
|
+
handleEdit();
|
|
25222
25296
|
}
|
|
25223
25297
|
}
|
|
25224
25298
|
}
|
|
@@ -30984,6 +31058,7 @@ var table_default = (
|
|
|
30984
31058
|
const mouseOpts = computeMouseOpts.value;
|
|
30985
31059
|
const exportOpts = computeExportOpts.value;
|
|
30986
31060
|
const importOpts = computeImportOpts.value;
|
|
31061
|
+
const keyboardOpts = computeKeyboardOpts.value;
|
|
30987
31062
|
const rowDragOpts = computeRowDragOpts.value;
|
|
30988
31063
|
const areaOpts = computeAreaOpts.value;
|
|
30989
31064
|
const sortOpts = computeSortOpts.value;
|
|
@@ -31142,8 +31217,16 @@ var table_default = (
|
|
|
31142
31217
|
if (mouseOpts.area && props.treeConfig && !treeOpts.transform) {
|
|
31143
31218
|
errLog10("vxe.error.notSupportProp", ["mouse-config.area", "tree-config.transform=false", "tree-config.transform=true"]);
|
|
31144
31219
|
}
|
|
31145
|
-
if (props.editConfig
|
|
31146
|
-
|
|
31220
|
+
if (props.editConfig) {
|
|
31221
|
+
if (editOpts.activeMethod) {
|
|
31222
|
+
warnLog7("vxe.error.delProp", ["edit-config.activeMethod", "edit-config.beforeEditMethod"]);
|
|
31223
|
+
}
|
|
31224
|
+
if (editOpts.beforeEditMethod && editOpts.beforeEditAsyncMethod) {
|
|
31225
|
+
errLog10("vxe.error.errConflicts", ["edit-config.beforeEditMethod", "edit-config.beforeEditAsyncMethod"]);
|
|
31226
|
+
}
|
|
31227
|
+
if (keyboardOpts.isEdit && editOpts.beforeEditAsyncMethod) {
|
|
31228
|
+
warnLog7("vxe.error.errConflicts", ["keyboard-config.isEdit", "edit-config.beforeEditAsyncMethod"]);
|
|
31229
|
+
}
|
|
31147
31230
|
}
|
|
31148
31231
|
if (checkboxOpts.halfField) {
|
|
31149
31232
|
warnLog7("vxe.error.delProp", ["checkbox-config.halfField", "checkbox-config.indeterminateField"]);
|
|
@@ -32309,14 +32392,6 @@ var grid_default = (
|
|
|
32309
32392
|
return funcs;
|
|
32310
32393
|
};
|
|
32311
32394
|
const gridExtendTableMethods = extendTableMethods(tableComponentMethodKeys);
|
|
32312
|
-
tableComponentMethodKeys.forEach((name) => {
|
|
32313
|
-
gridExtendTableMethods[name] = (...args) => {
|
|
32314
|
-
const $xeTable = refTable.value;
|
|
32315
|
-
if ($xeTable && $xeTable[name]) {
|
|
32316
|
-
return $xeTable && $xeTable[name](...args);
|
|
32317
|
-
}
|
|
32318
|
-
};
|
|
32319
|
-
});
|
|
32320
32395
|
const computeProxyOpts = computed7(() => {
|
|
32321
32396
|
return XEUtils27.merge({}, XEUtils27.clone(getConfig10().grid.proxyConfig, true), props.proxyConfig);
|
|
32322
32397
|
});
|