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
|
@@ -427,76 +427,26 @@ hooks.add("tableEditModule", {
|
|
|
427
427
|
const { editRender } = column;
|
|
428
428
|
const { isFocus, isPos, isClear } = options;
|
|
429
429
|
const cell = params.cell || $xeTable.getCellElement(row, column);
|
|
430
|
-
const
|
|
430
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
431
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod;
|
|
431
432
|
const editParams = { ...params, cell };
|
|
432
|
-
if (cell
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
column.renderHeight = cell.offsetHeight;
|
|
450
|
-
actived.args = editParams;
|
|
451
|
-
actived.row = row;
|
|
452
|
-
actived.column = column;
|
|
453
|
-
$xeTable.handlePushStack();
|
|
454
|
-
if (isClear) {
|
|
455
|
-
(0, import_util.setCellValue)(row, column, null);
|
|
456
|
-
}
|
|
457
|
-
if (mode === "row") {
|
|
458
|
-
tableColumn.forEach((column2) => getEditColumnModel(row, column2));
|
|
459
|
-
} else {
|
|
460
|
-
getEditColumnModel(row, column);
|
|
461
|
-
}
|
|
462
|
-
const afterEditMethod = editOpts.afterEditMethod;
|
|
463
|
-
(0, import_vue.nextTick)(() => {
|
|
464
|
-
if (isFocus) {
|
|
465
|
-
$xeTable.handleFocus(editParams, evnt);
|
|
466
|
-
}
|
|
467
|
-
if (afterEditMethod) {
|
|
468
|
-
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
$xeTable.dispatchEvent(
|
|
473
|
-
type,
|
|
474
|
-
{
|
|
475
|
-
row,
|
|
476
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
477
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
478
|
-
column,
|
|
479
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
480
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
481
|
-
},
|
|
482
|
-
evnt
|
|
483
|
-
);
|
|
484
|
-
if (type === "edit-activated") {
|
|
485
|
-
$xeTable.dispatchEvent(
|
|
486
|
-
"edit-actived",
|
|
487
|
-
{
|
|
488
|
-
row,
|
|
489
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
490
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
491
|
-
column,
|
|
492
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
493
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
494
|
-
},
|
|
495
|
-
evnt
|
|
496
|
-
);
|
|
497
|
-
}
|
|
498
|
-
} else {
|
|
499
|
-
const { column: oldColumn } = actived;
|
|
433
|
+
if (!cell || !(0, import_utils.isEnableConf)(editConfig) || !(0, import_utils.isEnableConf)(editRender)) {
|
|
434
|
+
return (0, import_vue.nextTick)();
|
|
435
|
+
}
|
|
436
|
+
if ($xeTable.isPendingByRow(row) || $xeTable.isAggregateRecord(row)) {
|
|
437
|
+
return (0, import_vue.nextTick)();
|
|
438
|
+
}
|
|
439
|
+
if (actived.row !== row || (mode === "cell" ? actived.column !== column : false)) {
|
|
440
|
+
const evntParams = {
|
|
441
|
+
row,
|
|
442
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
443
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
444
|
+
column,
|
|
445
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
446
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
447
|
+
};
|
|
448
|
+
const handleCellEdit = (status) => {
|
|
449
|
+
if (status) {
|
|
500
450
|
if ((0, import_utils.hasEnableConf)(mouseConfig, mouseOpts)) {
|
|
501
451
|
$xeTable.clearSelected();
|
|
502
452
|
if ($xeTable.clearCellAreas) {
|
|
@@ -504,29 +454,81 @@ hooks.add("tableEditModule", {
|
|
|
504
454
|
$xeTable.clearCopyCellArea();
|
|
505
455
|
}
|
|
506
456
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
(0, import_util.setCellValue)(row, oldColumn, oldModel.value);
|
|
511
|
-
}
|
|
512
|
-
if ($xeTable.clearValidate) {
|
|
513
|
-
$xeTable.clearValidate(row, column);
|
|
514
|
-
}
|
|
457
|
+
$xeTable.closeTooltip();
|
|
458
|
+
if (actived.column) {
|
|
459
|
+
handleClearEdit(evnt);
|
|
515
460
|
}
|
|
516
461
|
column.renderHeight = cell.offsetHeight;
|
|
517
462
|
actived.args = editParams;
|
|
463
|
+
actived.row = row;
|
|
518
464
|
actived.column = column;
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
});
|
|
465
|
+
$xeTable.handlePushStack();
|
|
466
|
+
if (isClear) {
|
|
467
|
+
(0, import_util.setCellValue)(row, column, null);
|
|
523
468
|
}
|
|
469
|
+
if (mode === "row") {
|
|
470
|
+
tableColumn.forEach((column2) => getEditColumnModel(row, column2));
|
|
471
|
+
} else {
|
|
472
|
+
getEditColumnModel(row, column);
|
|
473
|
+
}
|
|
474
|
+
const afterEditMethod = editOpts.afterEditMethod;
|
|
475
|
+
(0, import_vue.nextTick)(() => {
|
|
476
|
+
if (isFocus) {
|
|
477
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
478
|
+
}
|
|
479
|
+
if (afterEditMethod) {
|
|
480
|
+
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
$xeTable.dispatchEvent("edit-activated", evntParams, evnt);
|
|
484
|
+
$xeTable.dispatchEvent("edit-actived", evntParams, evnt);
|
|
485
|
+
} else {
|
|
486
|
+
$xeTable.dispatchEvent("edit-disabled", evntParams, evnt);
|
|
524
487
|
}
|
|
525
488
|
focused.column = null;
|
|
526
489
|
focused.row = null;
|
|
527
490
|
$xeTable.focus();
|
|
491
|
+
};
|
|
492
|
+
const eFnParams = { ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt };
|
|
493
|
+
if (beforeEditFn) {
|
|
494
|
+
handleCellEdit(!!beforeEditFn(eFnParams));
|
|
495
|
+
} else if (beforeEditAsyncFn) {
|
|
496
|
+
return Promise.resolve().then(() => beforeEditAsyncFn(eFnParams)).catch(() => false).then((status) => {
|
|
497
|
+
handleCellEdit(!!status);
|
|
498
|
+
});
|
|
499
|
+
} else {
|
|
500
|
+
handleCellEdit(true);
|
|
528
501
|
}
|
|
502
|
+
return (0, import_vue.nextTick)();
|
|
529
503
|
}
|
|
504
|
+
const { column: oldColumn } = actived;
|
|
505
|
+
if ((0, import_utils.hasEnableConf)(mouseConfig, mouseOpts)) {
|
|
506
|
+
$xeTable.clearSelected();
|
|
507
|
+
if ($xeTable.clearCellAreas) {
|
|
508
|
+
$xeTable.clearCellAreas();
|
|
509
|
+
$xeTable.clearCopyCellArea();
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (oldColumn && oldColumn !== column) {
|
|
513
|
+
const { model: oldModel } = oldColumn;
|
|
514
|
+
if (oldModel.update) {
|
|
515
|
+
(0, import_util.setCellValue)(row, oldColumn, oldModel.value);
|
|
516
|
+
}
|
|
517
|
+
if ($xeTable.clearValidate) {
|
|
518
|
+
$xeTable.clearValidate(row, column);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
column.renderHeight = cell.offsetHeight;
|
|
522
|
+
actived.args = editParams;
|
|
523
|
+
actived.column = column;
|
|
524
|
+
if (isPos) {
|
|
525
|
+
setTimeout(() => {
|
|
526
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
focused.column = null;
|
|
530
|
+
focused.row = null;
|
|
531
|
+
$xeTable.focus();
|
|
530
532
|
return (0, import_vue.nextTick)();
|
|
531
533
|
};
|
|
532
534
|
const handleEditCell = (row, fieldOrColumn, options) => {
|
package/lib/table/src/table.js
CHANGED
|
@@ -1270,7 +1270,7 @@ var table_default = (
|
|
|
1270
1270
|
internalData.mergeHeaderMaps = {};
|
|
1271
1271
|
internalData.mergeHeaderCellMaps = {};
|
|
1272
1272
|
internalData.mergeHeaderRowMaps = {};
|
|
1273
|
-
internalData.
|
|
1273
|
+
internalData.mergeHeaderColMaps = {};
|
|
1274
1274
|
$xeTable.setMergeHeaderCells(merges);
|
|
1275
1275
|
};
|
|
1276
1276
|
const handleHeaderMerge = (merges) => {
|
|
@@ -1993,35 +1993,51 @@ var table_default = (
|
|
|
1993
1993
|
updateColumnOffsetLeft();
|
|
1994
1994
|
updateHeight();
|
|
1995
1995
|
};
|
|
1996
|
-
const calcCellAutoHeight = (rowid, rowRest, wrapperEl) => {
|
|
1996
|
+
const calcCellAutoHeight = (rowid, rowRest, wrapperEl, cacheElemList) => {
|
|
1997
1997
|
const { fullCellHeightMaps } = internalData;
|
|
1998
1998
|
let chRest = fullCellHeightMaps[rowid];
|
|
1999
1999
|
if (!chRest) {
|
|
2000
2000
|
chRest = {};
|
|
2001
2001
|
fullCellHeightMaps[rowid] = chRest;
|
|
2002
2002
|
}
|
|
2003
|
-
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
2004
|
-
|
|
2005
|
-
let topBottomPadding = 0;
|
|
2003
|
+
const wrapperElemList = cacheElemList || Array.from(wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`));
|
|
2004
|
+
const cellItemList = [];
|
|
2006
2005
|
let changeCH = false;
|
|
2007
2006
|
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
2008
2007
|
const wrapperElem = wrapperElemList[i];
|
|
2009
2008
|
const cellElem = wrapperElem.parentElement;
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
if (
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2009
|
+
if (!cellElem) {
|
|
2010
|
+
continue;
|
|
2011
|
+
}
|
|
2012
|
+
const orHeight = cellElem.style.height;
|
|
2013
|
+
if (orHeight) {
|
|
2014
|
+
cellElem.style.height = "";
|
|
2015
|
+
}
|
|
2016
|
+
cellItemList.push({
|
|
2017
|
+
wrapperElem,
|
|
2018
|
+
cellElem,
|
|
2019
|
+
colid: wrapperElem.getAttribute("colid") || "",
|
|
2020
|
+
orHeight
|
|
2021
|
+
});
|
|
2022
|
+
}
|
|
2023
|
+
let topBottomPadding = 0;
|
|
2024
|
+
if (cellItemList.length) {
|
|
2025
|
+
const firstCellStyle = getComputedStyle(cellItemList[0].cellElem);
|
|
2026
|
+
topBottomPadding = Math.ceil(import_xe_utils.default.toNumber(firstCellStyle.paddingTop) + import_xe_utils.default.toNumber(firstCellStyle.paddingBottom));
|
|
2027
|
+
}
|
|
2028
|
+
for (let i = 0; i < cellItemList.length; i++) {
|
|
2029
|
+
const { wrapperElem, colid } = cellItemList[i];
|
|
2030
|
+
const colHeight = Math.ceil(wrapperElem.clientHeight + topBottomPadding);
|
|
2020
2031
|
if (chRest[colid] !== colHeight) {
|
|
2021
2032
|
changeCH = true;
|
|
2022
2033
|
chRest[colid] = colHeight;
|
|
2023
2034
|
}
|
|
2024
|
-
|
|
2035
|
+
}
|
|
2036
|
+
for (let i = 0; i < cellItemList.length; i++) {
|
|
2037
|
+
const { cellElem, orHeight } = cellItemList[i];
|
|
2038
|
+
if (orHeight) {
|
|
2039
|
+
cellElem.style.height = orHeight;
|
|
2040
|
+
}
|
|
2025
2041
|
}
|
|
2026
2042
|
const cellMaxHeight = (0, import_util.getRowMaxHeight)(chRest, changeCH);
|
|
2027
2043
|
return cellMaxHeight;
|
|
@@ -2038,12 +2054,18 @@ var table_default = (
|
|
|
2038
2054
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
2039
2055
|
if (!isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && treeOpts.showLine)) {
|
|
2040
2056
|
const { handleGetRowId } = (0, import_util.createHandleGetRowId)($xeTable);
|
|
2057
|
+
const rowWrapperMaps = {};
|
|
2058
|
+
el.querySelectorAll(".vxe-cell--wrapper[rowid]").forEach((wrapperElem) => {
|
|
2059
|
+
const rid = wrapperElem.getAttribute("rowid") || "";
|
|
2060
|
+
const elemList = rowWrapperMaps[rid] || (rowWrapperMaps[rid] = []);
|
|
2061
|
+
elemList.push(wrapperElem);
|
|
2062
|
+
});
|
|
2041
2063
|
el.setAttribute("data-calc-row", "Y");
|
|
2042
2064
|
tableData.forEach((row) => {
|
|
2043
2065
|
const rowid = handleGetRowId(row);
|
|
2044
2066
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2045
2067
|
if (rowRest) {
|
|
2046
|
-
const reHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
2068
|
+
const reHeight = calcCellAutoHeight(rowid, rowRest, el, rowWrapperMaps[rowid] || []);
|
|
2047
2069
|
rowRest.height = Math.max(defaultRowHeight, reHeight);
|
|
2048
2070
|
}
|
|
2049
2071
|
});
|
|
@@ -3836,7 +3858,7 @@ var table_default = (
|
|
|
3836
3858
|
};
|
|
3837
3859
|
const loadScrollXData = () => {
|
|
3838
3860
|
const { isScrollXBig } = reactData;
|
|
3839
|
-
const { mergeBodyList, mergeFooterList,
|
|
3861
|
+
const { mergeBodyList, mergeFooterList, mergeBodyColMaps, scrollXStore } = internalData;
|
|
3840
3862
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore;
|
|
3841
3863
|
const { toVisibleIndex, visibleSize } = handleVirtualXVisible();
|
|
3842
3864
|
const offsetItem = {
|
|
@@ -3845,7 +3867,7 @@ var table_default = (
|
|
|
3845
3867
|
};
|
|
3846
3868
|
scrollXStore.visibleStartIndex = toVisibleIndex - 1;
|
|
3847
3869
|
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
3848
|
-
calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList),
|
|
3870
|
+
calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList), mergeBodyColMaps, offsetItem, "col");
|
|
3849
3871
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
3850
3872
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
3851
3873
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
@@ -4221,7 +4243,7 @@ var table_default = (
|
|
|
4221
4243
|
};
|
|
4222
4244
|
const loadScrollYData = () => {
|
|
4223
4245
|
const { isAllOverflow, isScrollYBig } = reactData;
|
|
4224
|
-
const { mergeBodyList,
|
|
4246
|
+
const { mergeBodyList, mergeBodyRowMaps, scrollYStore } = internalData;
|
|
4225
4247
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollYStore;
|
|
4226
4248
|
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
|
|
4227
4249
|
const { toVisibleIndex, visibleSize } = handleVirtualYVisible();
|
|
@@ -4231,7 +4253,7 @@ var table_default = (
|
|
|
4231
4253
|
};
|
|
4232
4254
|
scrollYStore.visibleStartIndex = toVisibleIndex - 1;
|
|
4233
4255
|
scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
4234
|
-
calculateMergerOffsetIndex(mergeBodyList,
|
|
4256
|
+
calculateMergerOffsetIndex(mergeBodyList, mergeBodyRowMaps, offsetItem, "row");
|
|
4235
4257
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
4236
4258
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
4237
4259
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
@@ -4300,7 +4322,7 @@ var table_default = (
|
|
|
4300
4322
|
loadScrollYData();
|
|
4301
4323
|
}, fpsTime);
|
|
4302
4324
|
};
|
|
4303
|
-
const handleSyncScroll = (isRollX, isRollY) => {
|
|
4325
|
+
const handleSyncScroll = (isRollX, isRollY, isCompensate) => {
|
|
4304
4326
|
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
|
|
4305
4327
|
const autoWidthColumnList = computeAutoWidthColumnList.value;
|
|
4306
4328
|
internalData.lcsRunTime = Date.now();
|
|
@@ -4321,7 +4343,9 @@ var table_default = (
|
|
|
4321
4343
|
let xRest = null;
|
|
4322
4344
|
let yRest = null;
|
|
4323
4345
|
if (!isAllOverflow) {
|
|
4324
|
-
|
|
4346
|
+
if (!isCompensate) {
|
|
4347
|
+
calcCellHeight();
|
|
4348
|
+
}
|
|
4325
4349
|
updateRowOffsetTop();
|
|
4326
4350
|
}
|
|
4327
4351
|
if (isRollX && scrollXLoad) {
|
|
@@ -4337,7 +4361,9 @@ var table_default = (
|
|
|
4337
4361
|
autoCellWidth();
|
|
4338
4362
|
}
|
|
4339
4363
|
if (!isAllOverflow) {
|
|
4340
|
-
|
|
4364
|
+
if (!isCompensate) {
|
|
4365
|
+
calcCellHeight();
|
|
4366
|
+
}
|
|
4341
4367
|
updateRowOffsetTop();
|
|
4342
4368
|
}
|
|
4343
4369
|
return $xeTable.updateScrollYSpace();
|
|
@@ -4358,7 +4384,7 @@ var table_default = (
|
|
|
4358
4384
|
(0, import_vue.nextTick)(() => {
|
|
4359
4385
|
updateRowExpandStyle();
|
|
4360
4386
|
if (!internalData.lcsTimeout) {
|
|
4361
|
-
handleSyncScroll(isRollX, isRollY);
|
|
4387
|
+
handleSyncScroll(isRollX, isRollY, true);
|
|
4362
4388
|
}
|
|
4363
4389
|
});
|
|
4364
4390
|
}
|
|
@@ -6008,6 +6034,7 @@ var table_default = (
|
|
|
6008
6034
|
const { fullAllDataRowIdData } = internalData;
|
|
6009
6035
|
const rows = import_xe_utils.default.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
6010
6036
|
const el = refElem.value;
|
|
6037
|
+
let status = false;
|
|
6011
6038
|
if (el) {
|
|
6012
6039
|
const { handleGetRowId } = (0, import_util.createHandleGetRowId)($xeTable);
|
|
6013
6040
|
el.setAttribute("data-calc-row", "Y");
|
|
@@ -6016,12 +6043,15 @@ var table_default = (
|
|
|
6016
6043
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
6017
6044
|
if (rowRest) {
|
|
6018
6045
|
rowRest.resizeHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
6046
|
+
status = true;
|
|
6019
6047
|
}
|
|
6020
6048
|
});
|
|
6021
6049
|
el.removeAttribute("data-calc-row");
|
|
6022
6050
|
reactData.calcCellHeightFlag++;
|
|
6023
6051
|
}
|
|
6024
|
-
return (0, import_vue.nextTick)()
|
|
6052
|
+
return (0, import_vue.nextTick)().then(() => {
|
|
6053
|
+
return { status };
|
|
6054
|
+
});
|
|
6025
6055
|
},
|
|
6026
6056
|
setRowHeight(rowOrId, height) {
|
|
6027
6057
|
const { fullAllDataRowIdData } = internalData;
|
|
@@ -8221,7 +8251,8 @@ var table_default = (
|
|
|
8221
8251
|
const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
|
|
8222
8252
|
const operCtxMenu = isContentMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
|
|
8223
8253
|
const isEditStatus = (0, import_utils.isEnableConf)(editConfig) && actived.column && actived.row;
|
|
8224
|
-
const
|
|
8254
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
8255
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod;
|
|
8225
8256
|
const selectRow = selected.row;
|
|
8226
8257
|
const selectColumn = selected.column;
|
|
8227
8258
|
if (operCtxMenu) {
|
|
@@ -8449,7 +8480,7 @@ var table_default = (
|
|
|
8449
8480
|
$grid: $xeGrid,
|
|
8450
8481
|
$gantt: $xeGantt
|
|
8451
8482
|
};
|
|
8452
|
-
|
|
8483
|
+
const handleEdit = () => {
|
|
8453
8484
|
if (delMethod) {
|
|
8454
8485
|
delMethod(params);
|
|
8455
8486
|
} else {
|
|
@@ -8461,6 +8492,20 @@ var table_default = (
|
|
|
8461
8492
|
}
|
|
8462
8493
|
$xeTable.updateFooter();
|
|
8463
8494
|
dispatchEvent("cell-delete-value", params, evnt);
|
|
8495
|
+
};
|
|
8496
|
+
if (beforeEditFn) {
|
|
8497
|
+
if (beforeEditFn(params)) {
|
|
8498
|
+
handleEdit();
|
|
8499
|
+
}
|
|
8500
|
+
} else if (beforeEditAsyncFn) {
|
|
8501
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
8502
|
+
if (status) {
|
|
8503
|
+
handleEdit();
|
|
8504
|
+
}
|
|
8505
|
+
}).catch(() => {
|
|
8506
|
+
});
|
|
8507
|
+
} else {
|
|
8508
|
+
handleEdit();
|
|
8464
8509
|
}
|
|
8465
8510
|
}
|
|
8466
8511
|
} else if (hasBackspaceKey && (0, import_utils.hasEnableConf)(keyboardConfig, keyboardOpts) && keyboardOpts.isBack && (0, import_utils.isEnableConf)(editConfig) && (selectRow || selectColumn)) {
|
|
@@ -8480,7 +8525,7 @@ var table_default = (
|
|
|
8480
8525
|
$grid: $xeGrid,
|
|
8481
8526
|
$gantt: $xeGantt
|
|
8482
8527
|
};
|
|
8483
|
-
|
|
8528
|
+
const handleEdit = () => {
|
|
8484
8529
|
if (backMethod) {
|
|
8485
8530
|
backMethod(params);
|
|
8486
8531
|
} else {
|
|
@@ -8489,6 +8534,20 @@ var table_default = (
|
|
|
8489
8534
|
});
|
|
8490
8535
|
}
|
|
8491
8536
|
dispatchEvent("cell-backspace-value", params, evnt);
|
|
8537
|
+
};
|
|
8538
|
+
if (beforeEditFn) {
|
|
8539
|
+
if (beforeEditFn(params)) {
|
|
8540
|
+
handleEdit();
|
|
8541
|
+
}
|
|
8542
|
+
} else if (beforeEditAsyncFn) {
|
|
8543
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
8544
|
+
if (status) {
|
|
8545
|
+
handleEdit();
|
|
8546
|
+
}
|
|
8547
|
+
}).catch(() => {
|
|
8548
|
+
});
|
|
8549
|
+
} else {
|
|
8550
|
+
handleEdit();
|
|
8492
8551
|
}
|
|
8493
8552
|
}
|
|
8494
8553
|
}
|
|
@@ -8519,7 +8578,6 @@ var table_default = (
|
|
|
8519
8578
|
} else if ((0, import_utils.hasEnableConf)(keyboardConfig, keyboardOpts) && (0, import_utils.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)) {
|
|
8520
8579
|
const { editMode, editMethod } = keyboardOpts;
|
|
8521
8580
|
if (selectColumn && selectRow && (0, import_utils.isEnableConf)(selectColumn.editRender)) {
|
|
8522
|
-
const beforeEditMethod2 = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
8523
8581
|
const params = {
|
|
8524
8582
|
row: selectRow,
|
|
8525
8583
|
rowIndex: $xeTable.getRowIndex(selectRow),
|
|
@@ -8533,7 +8591,7 @@ var table_default = (
|
|
|
8533
8591
|
$grid: $xeGrid,
|
|
8534
8592
|
$gantt: $xeGantt
|
|
8535
8593
|
};
|
|
8536
|
-
|
|
8594
|
+
const handleEdit = () => {
|
|
8537
8595
|
if (editMethod) {
|
|
8538
8596
|
editMethod(params);
|
|
8539
8597
|
} else {
|
|
@@ -8545,6 +8603,20 @@ var table_default = (
|
|
|
8545
8603
|
isClear: isClearValue
|
|
8546
8604
|
});
|
|
8547
8605
|
}
|
|
8606
|
+
};
|
|
8607
|
+
if (beforeEditFn) {
|
|
8608
|
+
if (beforeEditFn(params)) {
|
|
8609
|
+
handleEdit();
|
|
8610
|
+
}
|
|
8611
|
+
} else if (beforeEditAsyncFn) {
|
|
8612
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
8613
|
+
if (status) {
|
|
8614
|
+
handleEdit();
|
|
8615
|
+
}
|
|
8616
|
+
}).catch(() => {
|
|
8617
|
+
});
|
|
8618
|
+
} else {
|
|
8619
|
+
handleEdit();
|
|
8548
8620
|
}
|
|
8549
8621
|
}
|
|
8550
8622
|
}
|
|
@@ -14310,6 +14382,7 @@ var table_default = (
|
|
|
14310
14382
|
const mouseOpts = computeMouseOpts.value;
|
|
14311
14383
|
const exportOpts = computeExportOpts.value;
|
|
14312
14384
|
const importOpts = computeImportOpts.value;
|
|
14385
|
+
const keyboardOpts = computeKeyboardOpts.value;
|
|
14313
14386
|
const rowDragOpts = computeRowDragOpts.value;
|
|
14314
14387
|
const areaOpts = computeAreaOpts.value;
|
|
14315
14388
|
const sortOpts = computeSortOpts.value;
|
|
@@ -14468,8 +14541,16 @@ var table_default = (
|
|
|
14468
14541
|
if (mouseOpts.area && props.treeConfig && !treeOpts.transform) {
|
|
14469
14542
|
errLog("vxe.error.notSupportProp", ["mouse-config.area", "tree-config.transform=false", "tree-config.transform=true"]);
|
|
14470
14543
|
}
|
|
14471
|
-
if (props.editConfig
|
|
14472
|
-
|
|
14544
|
+
if (props.editConfig) {
|
|
14545
|
+
if (editOpts.activeMethod) {
|
|
14546
|
+
warnLog("vxe.error.delProp", ["edit-config.activeMethod", "edit-config.beforeEditMethod"]);
|
|
14547
|
+
}
|
|
14548
|
+
if (editOpts.beforeEditMethod && editOpts.beforeEditAsyncMethod) {
|
|
14549
|
+
errLog("vxe.error.errConflicts", ["edit-config.beforeEditMethod", "edit-config.beforeEditAsyncMethod"]);
|
|
14550
|
+
}
|
|
14551
|
+
if (keyboardOpts.isEdit && editOpts.beforeEditAsyncMethod) {
|
|
14552
|
+
warnLog("vxe.error.errConflicts", ["keyboard-config.isEdit", "edit-config.beforeEditAsyncMethod"]);
|
|
14553
|
+
}
|
|
14473
14554
|
}
|
|
14474
14555
|
if (checkboxOpts.halfField) {
|
|
14475
14556
|
warnLog("vxe.error.delProp", ["checkbox-config.halfField", "checkbox-config.indeterminateField"]);
|
package/lib/ui/index.js
CHANGED
|
@@ -33,7 +33,7 @@ __export(ui_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(ui_exports);
|
|
34
34
|
var import_core = require("@vxe-ui/core");
|
|
35
35
|
var import_utils = require("./src/utils");
|
|
36
|
-
const version = "4.23.
|
|
36
|
+
const version = "4.23.18";
|
|
37
37
|
import_core.VxeUI.version = version;
|
|
38
38
|
import_core.VxeUI.tableVersion = version;
|
|
39
39
|
import_core.VxeUI.setConfig({
|
package/lib/ui/src/log.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(log_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(log_exports);
|
|
26
26
|
var import_core = require("@vxe-ui/core");
|
|
27
27
|
const { log } = import_core.VxeUI;
|
|
28
|
-
const tableVersion = `table v${"4.23.
|
|
28
|
+
const tableVersion = `table v${"4.23.18"}`;
|
|
29
29
|
function createComponentLog(name) {
|
|
30
30
|
const uiVersion = import_core.VxeUI.uiVersion ? `ui v${import_core.VxeUI.uiVersion}` : "";
|
|
31
31
|
const ganttVersion = import_core.VxeUI.ganttVersion ? `gantt v${import_core.VxeUI.ganttVersion}` : "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "4.23.
|
|
3
|
+
"version": "4.23.18",
|
|
4
4
|
"description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"typescript": "~5.9.3",
|
|
76
76
|
"vue": "3.4.27",
|
|
77
77
|
"vue-router": "~4.5.1",
|
|
78
|
-
"vxe-pc-ui": "4.20.
|
|
78
|
+
"vxe-pc-ui": "4.20.41"
|
|
79
79
|
},
|
|
80
80
|
"allowScripts": {
|
|
81
81
|
"esbuild": true,
|
|
@@ -305,15 +305,6 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
305
305
|
|
|
306
306
|
const gridExtendTableMethods = extendTableMethods(tableComponentMethodKeys) as VxeTableMethods
|
|
307
307
|
|
|
308
|
-
tableComponentMethodKeys.forEach((name) => {
|
|
309
|
-
gridExtendTableMethods[name] = (...args: any[]) => {
|
|
310
|
-
const $xeTable: any = refTable.value
|
|
311
|
-
if ($xeTable && $xeTable[name]) {
|
|
312
|
-
return $xeTable && $xeTable[name](...args)
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
})
|
|
316
|
-
|
|
317
308
|
const computeProxyOpts = computed(() => {
|
|
318
309
|
return XEUtils.merge({}, XEUtils.clone(getConfig().grid.proxyConfig, true), props.proxyConfig)
|
|
319
310
|
})
|