vxe-table 4.19.18 → 4.19.20
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 +82 -27
- package/dist/style.css +1 -1
- package/es/grid/src/grid.js +1 -1
- package/es/style.css +1 -1
- package/es/table/module/edit/hook.js +16 -4
- package/es/table/src/table.js +60 -18
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +4 -3
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +29 -13
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +18 -4
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/table.js +6 -5
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +4 -3
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- package/packages/table/module/edit/hook.ts +15 -4
- package/packages/table/src/table.ts +58 -19
- package/packages/ui/src/log.ts +3 -2
- /package/es/{iconfont.1782186482222.ttf → iconfont.1782439515438.ttf} +0 -0
- /package/es/{iconfont.1782186482222.woff → iconfont.1782439515438.woff} +0 -0
- /package/es/{iconfont.1782186482222.woff2 → iconfont.1782439515438.woff2} +0 -0
- /package/lib/{iconfont.1782186482222.ttf → iconfont.1782439515438.ttf} +0 -0
- /package/lib/{iconfont.1782186482222.woff → iconfont.1782439515438.woff} +0 -0
- /package/lib/{iconfont.1782186482222.woff2 → iconfont.1782439515438.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
export { VxeUI } from '@vxe-ui/core';
|
|
3
|
-
import XEUtils
|
|
3
|
+
import XEUtils from 'xe-utils';
|
|
4
4
|
import DomZIndex from 'dom-zindex';
|
|
5
5
|
import { defineComponent, watch, reactive, h, ref, inject, createCommentVNode, onMounted, onUnmounted, provide, nextTick, TransitionGroup, computed, Teleport, resolveComponent, onActivated, onDeactivated, onBeforeUnmount } from 'vue';
|
|
6
6
|
|
|
@@ -44,7 +44,7 @@ function eqEmptyValue(cellValue) {
|
|
|
44
44
|
return cellValue === '' || XEUtils.eqNull(cellValue);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
const version = "4.19.
|
|
47
|
+
const version = "4.19.20";
|
|
48
48
|
VxeUI.version = version;
|
|
49
49
|
VxeUI.tableVersion = version;
|
|
50
50
|
VxeUI.setConfig({
|
|
@@ -743,14 +743,15 @@ function wheelScrollTopTo(diffNum, cb) {
|
|
|
743
743
|
}
|
|
744
744
|
|
|
745
745
|
const { log } = VxeUI;
|
|
746
|
-
const tableVersion = `table v${"4.19.
|
|
746
|
+
const tableVersion = `table v${"4.19.20"}`;
|
|
747
747
|
function createComponentLog(name) {
|
|
748
748
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
749
749
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
750
750
|
const designVersion = VxeUI.designVersion ? `design v${VxeUI.designVersion}` : '';
|
|
751
|
+
const versionInfo = [uiVersion, tableVersion, ganttVersion, designVersion].join(' ');
|
|
751
752
|
return {
|
|
752
|
-
warnLog: log.create('warn',
|
|
753
|
-
errLog: log.create('error',
|
|
753
|
+
warnLog: log.create('warn', versionInfo + '] [' + name),
|
|
754
|
+
errLog: log.create('error', versionInfo + '] [' + name)
|
|
754
755
|
};
|
|
755
756
|
}
|
|
756
757
|
log.create('warn', tableVersion);
|
|
@@ -9911,16 +9912,28 @@ hooks$5.add('tableEditModule', {
|
|
|
9911
9912
|
*/
|
|
9912
9913
|
getUpdateRecords() {
|
|
9913
9914
|
const { keepSource, treeConfig } = props;
|
|
9914
|
-
const { tableFullData } = internalData;
|
|
9915
|
+
const { tableFullData, tableFullTreeData } = internalData;
|
|
9915
9916
|
const treeOpts = computeTreeOpts.value;
|
|
9917
|
+
const updateRecords = [];
|
|
9916
9918
|
if (keepSource) {
|
|
9917
9919
|
syncActivedCell();
|
|
9918
9920
|
if (treeConfig) {
|
|
9919
|
-
|
|
9921
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
9922
|
+
XEUtils.eachTree(tableFullTreeData, row => {
|
|
9923
|
+
if ($xeTable.isUpdateByRow(row)) {
|
|
9924
|
+
updateRecords.push(row);
|
|
9925
|
+
}
|
|
9926
|
+
}, { children: childrenField });
|
|
9927
|
+
}
|
|
9928
|
+
else {
|
|
9929
|
+
tableFullData.forEach((row) => {
|
|
9930
|
+
if ($xeTable.isUpdateByRow(row)) {
|
|
9931
|
+
updateRecords.push(row);
|
|
9932
|
+
}
|
|
9933
|
+
});
|
|
9920
9934
|
}
|
|
9921
|
-
return tableFullData.filter((row) => $xeTable.isUpdateByRow(row));
|
|
9922
9935
|
}
|
|
9923
|
-
return
|
|
9936
|
+
return updateRecords;
|
|
9924
9937
|
},
|
|
9925
9938
|
getActiveRecord() {
|
|
9926
9939
|
warnLog$5('vxe.error.delFunc', ['getActiveRecord', 'getEditCell']);
|
|
@@ -15711,16 +15724,20 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
15711
15724
|
// 已废弃
|
|
15712
15725
|
xegrid: $xeGrid
|
|
15713
15726
|
};
|
|
15714
|
-
const eqCellValue = (
|
|
15715
|
-
const val1 = XEUtils.get(
|
|
15716
|
-
const val2 = XEUtils.get(
|
|
15727
|
+
const eqCellValue = (newRow, oldRow, field) => {
|
|
15728
|
+
const val1 = XEUtils.get(newRow, field);
|
|
15729
|
+
const val2 = XEUtils.get(oldRow, field);
|
|
15730
|
+
let result = false;
|
|
15717
15731
|
if (eqEmptyValue(val1) && eqEmptyValue(val2)) {
|
|
15718
|
-
|
|
15732
|
+
result = true;
|
|
15733
|
+
}
|
|
15734
|
+
else if (XEUtils.isString(val1) || XEUtils.isNumber(val1)) {
|
|
15735
|
+
result = ('' + val1) === ('' + val2);
|
|
15719
15736
|
}
|
|
15720
|
-
|
|
15721
|
-
|
|
15737
|
+
else {
|
|
15738
|
+
result = XEUtils.isEqual(val1, val2);
|
|
15722
15739
|
}
|
|
15723
|
-
return
|
|
15740
|
+
return { newValue: val1, oldValue: val2, result };
|
|
15724
15741
|
};
|
|
15725
15742
|
const handleKeyField = () => {
|
|
15726
15743
|
const keyField = computeRowField.value;
|
|
@@ -16958,7 +16975,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16958
16975
|
cellValue = $xeTable.getCellLabel(row, column);
|
|
16959
16976
|
}
|
|
16960
16977
|
if (!sortType || sortType === 'auto') {
|
|
16961
|
-
return isNaN
|
|
16978
|
+
return eqEmptyValue(cellValue) || isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
|
|
16962
16979
|
}
|
|
16963
16980
|
else if (sortType === 'number') {
|
|
16964
16981
|
return XEUtils.toNumber(cellValue);
|
|
@@ -16977,7 +16994,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16977
16994
|
cellValue = $xeTable.getCellLabel(row, column);
|
|
16978
16995
|
}
|
|
16979
16996
|
if (!sortType || sortType === 'auto') {
|
|
16980
|
-
return isNaN
|
|
16997
|
+
return eqEmptyValue(cellValue) || isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
|
|
16981
16998
|
}
|
|
16982
16999
|
else if (sortType === 'number') {
|
|
16983
17000
|
return XEUtils.toNumber(cellValue);
|
|
@@ -20549,18 +20566,57 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
20549
20566
|
}
|
|
20550
20567
|
const row = rowRest.row;
|
|
20551
20568
|
const oRow = sourceDataRowIdData[rowid];
|
|
20552
|
-
if (oRow) {
|
|
20553
|
-
|
|
20554
|
-
|
|
20569
|
+
if (!oRow) {
|
|
20570
|
+
return false;
|
|
20571
|
+
}
|
|
20572
|
+
if (arguments.length > 1) {
|
|
20573
|
+
return !eqCellValue(oRow, row, field).result;
|
|
20574
|
+
}
|
|
20575
|
+
for (let i = 0; i < keepFields.length; i++) {
|
|
20576
|
+
if (!eqCellValue(oRow, row, keepFields[i]).result) {
|
|
20577
|
+
return true;
|
|
20578
|
+
}
|
|
20579
|
+
}
|
|
20580
|
+
}
|
|
20581
|
+
return false;
|
|
20582
|
+
},
|
|
20583
|
+
getUpdateCells() {
|
|
20584
|
+
const { keepSource, treeConfig } = props;
|
|
20585
|
+
const { tableFullData, tableFullTreeData, fullDataRowIdData, sourceDataRowIdData, fullColumnFieldData } = internalData;
|
|
20586
|
+
const treeOpts = computeTreeOpts.value;
|
|
20587
|
+
const keepFields = computeKeepFields.value;
|
|
20588
|
+
const cellList = [];
|
|
20589
|
+
if (keepSource) {
|
|
20590
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
20591
|
+
const handleCell = (item) => {
|
|
20592
|
+
const rowid = handleGetRowId(item);
|
|
20593
|
+
const rowRest = fullDataRowIdData[rowid];
|
|
20594
|
+
// 新增的数据不需要检测
|
|
20595
|
+
if (!rowRest) {
|
|
20596
|
+
return;
|
|
20597
|
+
}
|
|
20598
|
+
const row = rowRest.row;
|
|
20599
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
20600
|
+
if (!oRow) {
|
|
20601
|
+
return;
|
|
20555
20602
|
}
|
|
20556
20603
|
for (let i = 0; i < keepFields.length; i++) {
|
|
20557
|
-
|
|
20558
|
-
|
|
20604
|
+
const field = keepFields[i];
|
|
20605
|
+
const { result, newValue, oldValue } = eqCellValue(oRow, row, field);
|
|
20606
|
+
if (!result) {
|
|
20607
|
+
const column = fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
|
|
20608
|
+
cellList.push({ row, rowid, column, field, newValue, oldValue });
|
|
20559
20609
|
}
|
|
20560
20610
|
}
|
|
20611
|
+
};
|
|
20612
|
+
if (treeConfig) {
|
|
20613
|
+
XEUtils.eachTree(tableFullTreeData, handleCell, treeOpts);
|
|
20614
|
+
}
|
|
20615
|
+
else {
|
|
20616
|
+
tableFullData.forEach(handleCell);
|
|
20561
20617
|
}
|
|
20562
20618
|
}
|
|
20563
|
-
return
|
|
20619
|
+
return cellList;
|
|
20564
20620
|
},
|
|
20565
20621
|
/**
|
|
20566
20622
|
* 获取表格的可视列,也可以指定索引获取列
|
|
@@ -29464,8 +29520,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29464
29520
|
}
|
|
29465
29521
|
if ((props.showOverflow === true || props.showOverflow === 'tooltip') ||
|
|
29466
29522
|
(props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip') ||
|
|
29467
|
-
(props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip')
|
|
29468
|
-
props.tooltipConfig || props.editRules) {
|
|
29523
|
+
(props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip')) {
|
|
29469
29524
|
if (!VxeUITooltipComponent) {
|
|
29470
29525
|
if (props.showOverflow === true) {
|
|
29471
29526
|
errLog$2('vxe.error.errProp', ['show-overflow=true', 'show-overflow=title']);
|
|
@@ -30117,7 +30172,7 @@ var VxeToolbarComponent = defineVxeComponent({
|
|
|
30117
30172
|
const { warnLog, errLog } = createComponentLog('grid');
|
|
30118
30173
|
const { getConfig, getI18n, commands, hooks, useFns, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI;
|
|
30119
30174
|
const tableComponentPropKeys = Object.keys(tableProps);
|
|
30120
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToStartRow', 'scrollToEndRow', 'scrollToRow', 'scrollToStartColumn', 'scrollToEndColumn', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'setCustomStoreData', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'updateCellLabel', 'clearFormatterCache', 'getFooterCellLabel', 'updateFooterCellLabel', 'clearFooterFormatterCache', 'undo', 'redo', 'effectCellData', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
|
|
30175
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToStartRow', 'scrollToEndRow', 'scrollToRow', 'scrollToStartColumn', 'scrollToEndColumn', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'setCustomStoreData', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'updateCellLabel', 'clearFormatterCache', 'getFooterCellLabel', 'updateFooterCellLabel', 'clearFooterFormatterCache', 'getUpdateCells', 'undo', 'redo', 'effectCellData', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
|
|
30121
30176
|
function createReactData() {
|
|
30122
30177
|
var _a;
|
|
30123
30178
|
return {
|