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/es/grid/src/grid.js
CHANGED
|
@@ -264,14 +264,6 @@ var grid_default = (
|
|
|
264
264
|
return funcs;
|
|
265
265
|
};
|
|
266
266
|
const gridExtendTableMethods = extendTableMethods(tableComponentMethodKeys);
|
|
267
|
-
tableComponentMethodKeys.forEach((name) => {
|
|
268
|
-
gridExtendTableMethods[name] = (...args) => {
|
|
269
|
-
const $xeTable = refTable.value;
|
|
270
|
-
if ($xeTable && $xeTable[name]) {
|
|
271
|
-
return $xeTable && $xeTable[name](...args);
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
});
|
|
275
267
|
const computeProxyOpts = computed(() => {
|
|
276
268
|
return XEUtils.merge({}, XEUtils.clone(getConfig().grid.proxyConfig, true), props.proxyConfig);
|
|
277
269
|
});
|
|
@@ -404,76 +404,26 @@ hooks.add("tableEditModule", {
|
|
|
404
404
|
const { editRender } = column;
|
|
405
405
|
const { isFocus, isPos, isClear } = options;
|
|
406
406
|
const cell = params.cell || $xeTable.getCellElement(row, column);
|
|
407
|
-
const
|
|
407
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
408
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod;
|
|
408
409
|
const editParams = { ...params, cell };
|
|
409
|
-
if (cell
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
column.renderHeight = cell.offsetHeight;
|
|
427
|
-
actived.args = editParams;
|
|
428
|
-
actived.row = row;
|
|
429
|
-
actived.column = column;
|
|
430
|
-
$xeTable.handlePushStack();
|
|
431
|
-
if (isClear) {
|
|
432
|
-
setCellValue(row, column, null);
|
|
433
|
-
}
|
|
434
|
-
if (mode === "row") {
|
|
435
|
-
tableColumn.forEach((column2) => getEditColumnModel(row, column2));
|
|
436
|
-
} else {
|
|
437
|
-
getEditColumnModel(row, column);
|
|
438
|
-
}
|
|
439
|
-
const afterEditMethod = editOpts.afterEditMethod;
|
|
440
|
-
nextTick(() => {
|
|
441
|
-
if (isFocus) {
|
|
442
|
-
$xeTable.handleFocus(editParams, evnt);
|
|
443
|
-
}
|
|
444
|
-
if (afterEditMethod) {
|
|
445
|
-
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
$xeTable.dispatchEvent(
|
|
450
|
-
type,
|
|
451
|
-
{
|
|
452
|
-
row,
|
|
453
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
454
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
455
|
-
column,
|
|
456
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
457
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
458
|
-
},
|
|
459
|
-
evnt
|
|
460
|
-
);
|
|
461
|
-
if (type === "edit-activated") {
|
|
462
|
-
$xeTable.dispatchEvent(
|
|
463
|
-
"edit-actived",
|
|
464
|
-
{
|
|
465
|
-
row,
|
|
466
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
467
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
468
|
-
column,
|
|
469
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
470
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
471
|
-
},
|
|
472
|
-
evnt
|
|
473
|
-
);
|
|
474
|
-
}
|
|
475
|
-
} else {
|
|
476
|
-
const { column: oldColumn } = actived;
|
|
410
|
+
if (!cell || !isEnableConf(editConfig) || !isEnableConf(editRender)) {
|
|
411
|
+
return nextTick();
|
|
412
|
+
}
|
|
413
|
+
if ($xeTable.isPendingByRow(row) || $xeTable.isAggregateRecord(row)) {
|
|
414
|
+
return nextTick();
|
|
415
|
+
}
|
|
416
|
+
if (actived.row !== row || (mode === "cell" ? actived.column !== column : false)) {
|
|
417
|
+
const evntParams = {
|
|
418
|
+
row,
|
|
419
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
420
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
421
|
+
column,
|
|
422
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
423
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
424
|
+
};
|
|
425
|
+
const handleCellEdit = (status) => {
|
|
426
|
+
if (status) {
|
|
477
427
|
if (hasEnableConf(mouseConfig, mouseOpts)) {
|
|
478
428
|
$xeTable.clearSelected();
|
|
479
429
|
if ($xeTable.clearCellAreas) {
|
|
@@ -481,29 +431,81 @@ hooks.add("tableEditModule", {
|
|
|
481
431
|
$xeTable.clearCopyCellArea();
|
|
482
432
|
}
|
|
483
433
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
setCellValue(row, oldColumn, oldModel.value);
|
|
488
|
-
}
|
|
489
|
-
if ($xeTable.clearValidate) {
|
|
490
|
-
$xeTable.clearValidate(row, column);
|
|
491
|
-
}
|
|
434
|
+
$xeTable.closeTooltip();
|
|
435
|
+
if (actived.column) {
|
|
436
|
+
handleClearEdit(evnt);
|
|
492
437
|
}
|
|
493
438
|
column.renderHeight = cell.offsetHeight;
|
|
494
439
|
actived.args = editParams;
|
|
440
|
+
actived.row = row;
|
|
495
441
|
actived.column = column;
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
});
|
|
442
|
+
$xeTable.handlePushStack();
|
|
443
|
+
if (isClear) {
|
|
444
|
+
setCellValue(row, column, null);
|
|
500
445
|
}
|
|
446
|
+
if (mode === "row") {
|
|
447
|
+
tableColumn.forEach((column2) => getEditColumnModel(row, column2));
|
|
448
|
+
} else {
|
|
449
|
+
getEditColumnModel(row, column);
|
|
450
|
+
}
|
|
451
|
+
const afterEditMethod = editOpts.afterEditMethod;
|
|
452
|
+
nextTick(() => {
|
|
453
|
+
if (isFocus) {
|
|
454
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
455
|
+
}
|
|
456
|
+
if (afterEditMethod) {
|
|
457
|
+
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
$xeTable.dispatchEvent("edit-activated", evntParams, evnt);
|
|
461
|
+
$xeTable.dispatchEvent("edit-actived", evntParams, evnt);
|
|
462
|
+
} else {
|
|
463
|
+
$xeTable.dispatchEvent("edit-disabled", evntParams, evnt);
|
|
501
464
|
}
|
|
502
465
|
focused.column = null;
|
|
503
466
|
focused.row = null;
|
|
504
467
|
$xeTable.focus();
|
|
468
|
+
};
|
|
469
|
+
const eFnParams = { ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt };
|
|
470
|
+
if (beforeEditFn) {
|
|
471
|
+
handleCellEdit(!!beforeEditFn(eFnParams));
|
|
472
|
+
} else if (beforeEditAsyncFn) {
|
|
473
|
+
return Promise.resolve().then(() => beforeEditAsyncFn(eFnParams)).catch(() => false).then((status) => {
|
|
474
|
+
handleCellEdit(!!status);
|
|
475
|
+
});
|
|
476
|
+
} else {
|
|
477
|
+
handleCellEdit(true);
|
|
505
478
|
}
|
|
479
|
+
return nextTick();
|
|
506
480
|
}
|
|
481
|
+
const { column: oldColumn } = actived;
|
|
482
|
+
if (hasEnableConf(mouseConfig, mouseOpts)) {
|
|
483
|
+
$xeTable.clearSelected();
|
|
484
|
+
if ($xeTable.clearCellAreas) {
|
|
485
|
+
$xeTable.clearCellAreas();
|
|
486
|
+
$xeTable.clearCopyCellArea();
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (oldColumn && oldColumn !== column) {
|
|
490
|
+
const { model: oldModel } = oldColumn;
|
|
491
|
+
if (oldModel.update) {
|
|
492
|
+
setCellValue(row, oldColumn, oldModel.value);
|
|
493
|
+
}
|
|
494
|
+
if ($xeTable.clearValidate) {
|
|
495
|
+
$xeTable.clearValidate(row, column);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
column.renderHeight = cell.offsetHeight;
|
|
499
|
+
actived.args = editParams;
|
|
500
|
+
actived.column = column;
|
|
501
|
+
if (isPos) {
|
|
502
|
+
setTimeout(() => {
|
|
503
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
focused.column = null;
|
|
507
|
+
focused.row = null;
|
|
508
|
+
$xeTable.focus();
|
|
507
509
|
return nextTick();
|
|
508
510
|
};
|
|
509
511
|
const handleEditCell = (row, fieldOrColumn, options) => {
|
package/es/table/src/table.js
CHANGED
|
@@ -1268,7 +1268,7 @@ var table_default = (
|
|
|
1268
1268
|
internalData.mergeHeaderMaps = {};
|
|
1269
1269
|
internalData.mergeHeaderCellMaps = {};
|
|
1270
1270
|
internalData.mergeHeaderRowMaps = {};
|
|
1271
|
-
internalData.
|
|
1271
|
+
internalData.mergeHeaderColMaps = {};
|
|
1272
1272
|
$xeTable.setMergeHeaderCells(merges);
|
|
1273
1273
|
};
|
|
1274
1274
|
const handleHeaderMerge = (merges) => {
|
|
@@ -1991,35 +1991,51 @@ var table_default = (
|
|
|
1991
1991
|
updateColumnOffsetLeft();
|
|
1992
1992
|
updateHeight();
|
|
1993
1993
|
};
|
|
1994
|
-
const calcCellAutoHeight = (rowid, rowRest, wrapperEl) => {
|
|
1994
|
+
const calcCellAutoHeight = (rowid, rowRest, wrapperEl, cacheElemList) => {
|
|
1995
1995
|
const { fullCellHeightMaps } = internalData;
|
|
1996
1996
|
let chRest = fullCellHeightMaps[rowid];
|
|
1997
1997
|
if (!chRest) {
|
|
1998
1998
|
chRest = {};
|
|
1999
1999
|
fullCellHeightMaps[rowid] = chRest;
|
|
2000
2000
|
}
|
|
2001
|
-
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
2002
|
-
|
|
2003
|
-
let topBottomPadding = 0;
|
|
2001
|
+
const wrapperElemList = cacheElemList || Array.from(wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`));
|
|
2002
|
+
const cellItemList = [];
|
|
2004
2003
|
let changeCH = false;
|
|
2005
2004
|
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
2006
2005
|
const wrapperElem = wrapperElemList[i];
|
|
2007
2006
|
const cellElem = wrapperElem.parentElement;
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
if (
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2007
|
+
if (!cellElem) {
|
|
2008
|
+
continue;
|
|
2009
|
+
}
|
|
2010
|
+
const orHeight = cellElem.style.height;
|
|
2011
|
+
if (orHeight) {
|
|
2012
|
+
cellElem.style.height = "";
|
|
2013
|
+
}
|
|
2014
|
+
cellItemList.push({
|
|
2015
|
+
wrapperElem,
|
|
2016
|
+
cellElem,
|
|
2017
|
+
colid: wrapperElem.getAttribute("colid") || "",
|
|
2018
|
+
orHeight
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
let topBottomPadding = 0;
|
|
2022
|
+
if (cellItemList.length) {
|
|
2023
|
+
const firstCellStyle = getComputedStyle(cellItemList[0].cellElem);
|
|
2024
|
+
topBottomPadding = Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom));
|
|
2025
|
+
}
|
|
2026
|
+
for (let i = 0; i < cellItemList.length; i++) {
|
|
2027
|
+
const { wrapperElem, colid } = cellItemList[i];
|
|
2028
|
+
const colHeight = Math.ceil(wrapperElem.clientHeight + topBottomPadding);
|
|
2018
2029
|
if (chRest[colid] !== colHeight) {
|
|
2019
2030
|
changeCH = true;
|
|
2020
2031
|
chRest[colid] = colHeight;
|
|
2021
2032
|
}
|
|
2022
|
-
|
|
2033
|
+
}
|
|
2034
|
+
for (let i = 0; i < cellItemList.length; i++) {
|
|
2035
|
+
const { cellElem, orHeight } = cellItemList[i];
|
|
2036
|
+
if (orHeight) {
|
|
2037
|
+
cellElem.style.height = orHeight;
|
|
2038
|
+
}
|
|
2023
2039
|
}
|
|
2024
2040
|
const cellMaxHeight = getRowMaxHeight(chRest, changeCH);
|
|
2025
2041
|
return cellMaxHeight;
|
|
@@ -2036,12 +2052,18 @@ var table_default = (
|
|
|
2036
2052
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
2037
2053
|
if (!isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && treeOpts.showLine)) {
|
|
2038
2054
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
2055
|
+
const rowWrapperMaps = {};
|
|
2056
|
+
el.querySelectorAll(".vxe-cell--wrapper[rowid]").forEach((wrapperElem) => {
|
|
2057
|
+
const rid = wrapperElem.getAttribute("rowid") || "";
|
|
2058
|
+
const elemList = rowWrapperMaps[rid] || (rowWrapperMaps[rid] = []);
|
|
2059
|
+
elemList.push(wrapperElem);
|
|
2060
|
+
});
|
|
2039
2061
|
el.setAttribute("data-calc-row", "Y");
|
|
2040
2062
|
tableData.forEach((row) => {
|
|
2041
2063
|
const rowid = handleGetRowId(row);
|
|
2042
2064
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2043
2065
|
if (rowRest) {
|
|
2044
|
-
const reHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
2066
|
+
const reHeight = calcCellAutoHeight(rowid, rowRest, el, rowWrapperMaps[rowid] || []);
|
|
2045
2067
|
rowRest.height = Math.max(defaultRowHeight, reHeight);
|
|
2046
2068
|
}
|
|
2047
2069
|
});
|
|
@@ -3834,7 +3856,7 @@ var table_default = (
|
|
|
3834
3856
|
};
|
|
3835
3857
|
const loadScrollXData = () => {
|
|
3836
3858
|
const { isScrollXBig } = reactData;
|
|
3837
|
-
const { mergeBodyList, mergeFooterList,
|
|
3859
|
+
const { mergeBodyList, mergeFooterList, mergeBodyColMaps, scrollXStore } = internalData;
|
|
3838
3860
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore;
|
|
3839
3861
|
const { toVisibleIndex, visibleSize } = handleVirtualXVisible();
|
|
3840
3862
|
const offsetItem = {
|
|
@@ -3843,7 +3865,7 @@ var table_default = (
|
|
|
3843
3865
|
};
|
|
3844
3866
|
scrollXStore.visibleStartIndex = toVisibleIndex - 1;
|
|
3845
3867
|
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
3846
|
-
calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList),
|
|
3868
|
+
calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList), mergeBodyColMaps, offsetItem, "col");
|
|
3847
3869
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
3848
3870
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
3849
3871
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
@@ -4219,7 +4241,7 @@ var table_default = (
|
|
|
4219
4241
|
};
|
|
4220
4242
|
const loadScrollYData = () => {
|
|
4221
4243
|
const { isAllOverflow, isScrollYBig } = reactData;
|
|
4222
|
-
const { mergeBodyList,
|
|
4244
|
+
const { mergeBodyList, mergeBodyRowMaps, scrollYStore } = internalData;
|
|
4223
4245
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollYStore;
|
|
4224
4246
|
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
|
|
4225
4247
|
const { toVisibleIndex, visibleSize } = handleVirtualYVisible();
|
|
@@ -4229,7 +4251,7 @@ var table_default = (
|
|
|
4229
4251
|
};
|
|
4230
4252
|
scrollYStore.visibleStartIndex = toVisibleIndex - 1;
|
|
4231
4253
|
scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
4232
|
-
calculateMergerOffsetIndex(mergeBodyList,
|
|
4254
|
+
calculateMergerOffsetIndex(mergeBodyList, mergeBodyRowMaps, offsetItem, "row");
|
|
4233
4255
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
4234
4256
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
4235
4257
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
@@ -4298,7 +4320,7 @@ var table_default = (
|
|
|
4298
4320
|
loadScrollYData();
|
|
4299
4321
|
}, fpsTime);
|
|
4300
4322
|
};
|
|
4301
|
-
const handleSyncScroll = (isRollX, isRollY) => {
|
|
4323
|
+
const handleSyncScroll = (isRollX, isRollY, isCompensate) => {
|
|
4302
4324
|
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
|
|
4303
4325
|
const autoWidthColumnList = computeAutoWidthColumnList.value;
|
|
4304
4326
|
internalData.lcsRunTime = Date.now();
|
|
@@ -4319,7 +4341,9 @@ var table_default = (
|
|
|
4319
4341
|
let xRest = null;
|
|
4320
4342
|
let yRest = null;
|
|
4321
4343
|
if (!isAllOverflow) {
|
|
4322
|
-
|
|
4344
|
+
if (!isCompensate) {
|
|
4345
|
+
calcCellHeight();
|
|
4346
|
+
}
|
|
4323
4347
|
updateRowOffsetTop();
|
|
4324
4348
|
}
|
|
4325
4349
|
if (isRollX && scrollXLoad) {
|
|
@@ -4335,7 +4359,9 @@ var table_default = (
|
|
|
4335
4359
|
autoCellWidth();
|
|
4336
4360
|
}
|
|
4337
4361
|
if (!isAllOverflow) {
|
|
4338
|
-
|
|
4362
|
+
if (!isCompensate) {
|
|
4363
|
+
calcCellHeight();
|
|
4364
|
+
}
|
|
4339
4365
|
updateRowOffsetTop();
|
|
4340
4366
|
}
|
|
4341
4367
|
return $xeTable.updateScrollYSpace();
|
|
@@ -4356,7 +4382,7 @@ var table_default = (
|
|
|
4356
4382
|
nextTick(() => {
|
|
4357
4383
|
updateRowExpandStyle();
|
|
4358
4384
|
if (!internalData.lcsTimeout) {
|
|
4359
|
-
handleSyncScroll(isRollX, isRollY);
|
|
4385
|
+
handleSyncScroll(isRollX, isRollY, true);
|
|
4360
4386
|
}
|
|
4361
4387
|
});
|
|
4362
4388
|
}
|
|
@@ -6006,6 +6032,7 @@ var table_default = (
|
|
|
6006
6032
|
const { fullAllDataRowIdData } = internalData;
|
|
6007
6033
|
const rows = XEUtils.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
6008
6034
|
const el = refElem.value;
|
|
6035
|
+
let status = false;
|
|
6009
6036
|
if (el) {
|
|
6010
6037
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
6011
6038
|
el.setAttribute("data-calc-row", "Y");
|
|
@@ -6014,12 +6041,15 @@ var table_default = (
|
|
|
6014
6041
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
6015
6042
|
if (rowRest) {
|
|
6016
6043
|
rowRest.resizeHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
6044
|
+
status = true;
|
|
6017
6045
|
}
|
|
6018
6046
|
});
|
|
6019
6047
|
el.removeAttribute("data-calc-row");
|
|
6020
6048
|
reactData.calcCellHeightFlag++;
|
|
6021
6049
|
}
|
|
6022
|
-
return nextTick()
|
|
6050
|
+
return nextTick().then(() => {
|
|
6051
|
+
return { status };
|
|
6052
|
+
});
|
|
6023
6053
|
},
|
|
6024
6054
|
setRowHeight(rowOrId, height) {
|
|
6025
6055
|
const { fullAllDataRowIdData } = internalData;
|
|
@@ -8219,7 +8249,8 @@ var table_default = (
|
|
|
8219
8249
|
const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
|
|
8220
8250
|
const operCtxMenu = isContentMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
|
|
8221
8251
|
const isEditStatus = isEnableConf(editConfig) && actived.column && actived.row;
|
|
8222
|
-
const
|
|
8252
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
8253
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod;
|
|
8223
8254
|
const selectRow = selected.row;
|
|
8224
8255
|
const selectColumn = selected.column;
|
|
8225
8256
|
if (operCtxMenu) {
|
|
@@ -8447,7 +8478,7 @@ var table_default = (
|
|
|
8447
8478
|
$grid: $xeGrid,
|
|
8448
8479
|
$gantt: $xeGantt
|
|
8449
8480
|
};
|
|
8450
|
-
|
|
8481
|
+
const handleEdit = () => {
|
|
8451
8482
|
if (delMethod) {
|
|
8452
8483
|
delMethod(params);
|
|
8453
8484
|
} else {
|
|
@@ -8459,6 +8490,20 @@ var table_default = (
|
|
|
8459
8490
|
}
|
|
8460
8491
|
$xeTable.updateFooter();
|
|
8461
8492
|
dispatchEvent("cell-delete-value", params, evnt);
|
|
8493
|
+
};
|
|
8494
|
+
if (beforeEditFn) {
|
|
8495
|
+
if (beforeEditFn(params)) {
|
|
8496
|
+
handleEdit();
|
|
8497
|
+
}
|
|
8498
|
+
} else if (beforeEditAsyncFn) {
|
|
8499
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
8500
|
+
if (status) {
|
|
8501
|
+
handleEdit();
|
|
8502
|
+
}
|
|
8503
|
+
}).catch(() => {
|
|
8504
|
+
});
|
|
8505
|
+
} else {
|
|
8506
|
+
handleEdit();
|
|
8462
8507
|
}
|
|
8463
8508
|
}
|
|
8464
8509
|
} else if (hasBackspaceKey && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isBack && isEnableConf(editConfig) && (selectRow || selectColumn)) {
|
|
@@ -8478,7 +8523,7 @@ var table_default = (
|
|
|
8478
8523
|
$grid: $xeGrid,
|
|
8479
8524
|
$gantt: $xeGantt
|
|
8480
8525
|
};
|
|
8481
|
-
|
|
8526
|
+
const handleEdit = () => {
|
|
8482
8527
|
if (backMethod) {
|
|
8483
8528
|
backMethod(params);
|
|
8484
8529
|
} else {
|
|
@@ -8487,6 +8532,20 @@ var table_default = (
|
|
|
8487
8532
|
});
|
|
8488
8533
|
}
|
|
8489
8534
|
dispatchEvent("cell-backspace-value", params, evnt);
|
|
8535
|
+
};
|
|
8536
|
+
if (beforeEditFn) {
|
|
8537
|
+
if (beforeEditFn(params)) {
|
|
8538
|
+
handleEdit();
|
|
8539
|
+
}
|
|
8540
|
+
} else if (beforeEditAsyncFn) {
|
|
8541
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
8542
|
+
if (status) {
|
|
8543
|
+
handleEdit();
|
|
8544
|
+
}
|
|
8545
|
+
}).catch(() => {
|
|
8546
|
+
});
|
|
8547
|
+
} else {
|
|
8548
|
+
handleEdit();
|
|
8490
8549
|
}
|
|
8491
8550
|
}
|
|
8492
8551
|
}
|
|
@@ -8517,7 +8576,6 @@ var table_default = (
|
|
|
8517
8576
|
} 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)) {
|
|
8518
8577
|
const { editMode, editMethod } = keyboardOpts;
|
|
8519
8578
|
if (selectColumn && selectRow && isEnableConf(selectColumn.editRender)) {
|
|
8520
|
-
const beforeEditMethod2 = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
8521
8579
|
const params = {
|
|
8522
8580
|
row: selectRow,
|
|
8523
8581
|
rowIndex: $xeTable.getRowIndex(selectRow),
|
|
@@ -8531,7 +8589,7 @@ var table_default = (
|
|
|
8531
8589
|
$grid: $xeGrid,
|
|
8532
8590
|
$gantt: $xeGantt
|
|
8533
8591
|
};
|
|
8534
|
-
|
|
8592
|
+
const handleEdit = () => {
|
|
8535
8593
|
if (editMethod) {
|
|
8536
8594
|
editMethod(params);
|
|
8537
8595
|
} else {
|
|
@@ -8543,6 +8601,20 @@ var table_default = (
|
|
|
8543
8601
|
isClear: isClearValue
|
|
8544
8602
|
});
|
|
8545
8603
|
}
|
|
8604
|
+
};
|
|
8605
|
+
if (beforeEditFn) {
|
|
8606
|
+
if (beforeEditFn(params)) {
|
|
8607
|
+
handleEdit();
|
|
8608
|
+
}
|
|
8609
|
+
} else if (beforeEditAsyncFn) {
|
|
8610
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
8611
|
+
if (status) {
|
|
8612
|
+
handleEdit();
|
|
8613
|
+
}
|
|
8614
|
+
}).catch(() => {
|
|
8615
|
+
});
|
|
8616
|
+
} else {
|
|
8617
|
+
handleEdit();
|
|
8546
8618
|
}
|
|
8547
8619
|
}
|
|
8548
8620
|
}
|
|
@@ -14308,6 +14380,7 @@ var table_default = (
|
|
|
14308
14380
|
const mouseOpts = computeMouseOpts.value;
|
|
14309
14381
|
const exportOpts = computeExportOpts.value;
|
|
14310
14382
|
const importOpts = computeImportOpts.value;
|
|
14383
|
+
const keyboardOpts = computeKeyboardOpts.value;
|
|
14311
14384
|
const rowDragOpts = computeRowDragOpts.value;
|
|
14312
14385
|
const areaOpts = computeAreaOpts.value;
|
|
14313
14386
|
const sortOpts = computeSortOpts.value;
|
|
@@ -14466,8 +14539,16 @@ var table_default = (
|
|
|
14466
14539
|
if (mouseOpts.area && props.treeConfig && !treeOpts.transform) {
|
|
14467
14540
|
errLog("vxe.error.notSupportProp", ["mouse-config.area", "tree-config.transform=false", "tree-config.transform=true"]);
|
|
14468
14541
|
}
|
|
14469
|
-
if (props.editConfig
|
|
14470
|
-
|
|
14542
|
+
if (props.editConfig) {
|
|
14543
|
+
if (editOpts.activeMethod) {
|
|
14544
|
+
warnLog("vxe.error.delProp", ["edit-config.activeMethod", "edit-config.beforeEditMethod"]);
|
|
14545
|
+
}
|
|
14546
|
+
if (editOpts.beforeEditMethod && editOpts.beforeEditAsyncMethod) {
|
|
14547
|
+
errLog("vxe.error.errConflicts", ["edit-config.beforeEditMethod", "edit-config.beforeEditAsyncMethod"]);
|
|
14548
|
+
}
|
|
14549
|
+
if (keyboardOpts.isEdit && editOpts.beforeEditAsyncMethod) {
|
|
14550
|
+
warnLog("vxe.error.errConflicts", ["keyboard-config.isEdit", "edit-config.beforeEditAsyncMethod"]);
|
|
14551
|
+
}
|
|
14471
14552
|
}
|
|
14472
14553
|
if (checkboxOpts.halfField) {
|
|
14473
14554
|
warnLog("vxe.error.delProp", ["checkbox-config.halfField", "checkbox-config.indeterminateField"]);
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from "@vxe-ui/core";
|
|
2
2
|
const { log } = VxeUI;
|
|
3
|
-
const tableVersion = `table v${"4.23.
|
|
3
|
+
const tableVersion = `table v${"4.23.18"}`;
|
|
4
4
|
function createComponentLog(name) {
|
|
5
5
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : "";
|
|
6
6
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : "";
|
package/lib/grid/src/grid.js
CHANGED
|
@@ -297,14 +297,6 @@ var grid_default = (
|
|
|
297
297
|
return funcs;
|
|
298
298
|
};
|
|
299
299
|
const gridExtendTableMethods = extendTableMethods(tableComponentMethodKeys);
|
|
300
|
-
tableComponentMethodKeys.forEach((name) => {
|
|
301
|
-
gridExtendTableMethods[name] = (...args) => {
|
|
302
|
-
const $xeTable = refTable.value;
|
|
303
|
-
if ($xeTable && $xeTable[name]) {
|
|
304
|
-
return $xeTable && $xeTable[name](...args);
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
});
|
|
308
300
|
const computeProxyOpts = (0, import_vue.computed)(() => {
|
|
309
301
|
return import_xe_utils.default.merge({}, import_xe_utils.default.clone(getConfig().grid.proxyConfig, true), props.proxyConfig);
|
|
310
302
|
});
|