vxe-table 4.10.12 → 4.10.14
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/es/style.css +1 -1
- package/es/table/module/edit/hook.js +133 -123
- package/es/table/module/export/hook.js +3 -2
- package/es/table/src/body.js +1 -0
- package/es/table/src/table.js +40 -12
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +224 -168
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +159 -149
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +3 -2
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/body.js +1 -0
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +57 -13
- 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 +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/hook.ts +136 -124
- package/packages/table/module/export/hook.ts +3 -2
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/table.ts +43 -12
- /package/es/{iconfont.1739237387649.ttf → iconfont.1739333111603.ttf} +0 -0
- /package/es/{iconfont.1739237387649.woff → iconfont.1739333111603.woff} +0 -0
- /package/es/{iconfont.1739237387649.woff2 → iconfont.1739333111603.woff2} +0 -0
- /package/lib/{iconfont.1739237387649.ttf → iconfont.1739333111603.ttf} +0 -0
- /package/lib/{iconfont.1739237387649.woff → iconfont.1739333111603.woff} +0 -0
- /package/lib/{iconfont.1739237387649.woff2 → iconfont.1739333111603.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.10.
|
|
3141
|
+
const version = "4.10.14";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3585,7 +3585,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3585
3585
|
const {
|
|
3586
3586
|
log: log_log
|
|
3587
3587
|
} = core_.VxeUI;
|
|
3588
|
-
const log_version = `table v${"4.10.
|
|
3588
|
+
const log_version = `table v${"4.10.14"}`;
|
|
3589
3589
|
const warnLog = log_log.create('warn', log_version);
|
|
3590
3590
|
const errLog = log_log.create('error', log_version);
|
|
3591
3591
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -6606,6 +6606,7 @@ const renderType = 'body';
|
|
|
6606
6606
|
'fixed--width': !isAutoCellWidth,
|
|
6607
6607
|
'fixed--hidden': fixedHiddenColumn,
|
|
6608
6608
|
'is--padding': isCellPadding,
|
|
6609
|
+
'is--progress': fixedHiddenColumn && isAllOverflow || isVNPreEmptyStatus,
|
|
6609
6610
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
6610
6611
|
'is--drag-disabled': isDisabledDrag,
|
|
6611
6612
|
'col--dirty': isDirty,
|
|
@@ -12059,7 +12060,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12059
12060
|
const treeOpts = computeTreeOpts.value;
|
|
12060
12061
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12061
12062
|
const {
|
|
12062
|
-
transform
|
|
12063
|
+
transform,
|
|
12064
|
+
rowField,
|
|
12065
|
+
parentField,
|
|
12066
|
+
mapChildrenField
|
|
12063
12067
|
} = treeOpts;
|
|
12064
12068
|
const {
|
|
12065
12069
|
remote: allRemoteFilter,
|
|
@@ -12073,7 +12077,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12073
12077
|
} = sortOpts;
|
|
12074
12078
|
let tableData = [];
|
|
12075
12079
|
let tableTree = [];
|
|
12076
|
-
//
|
|
12080
|
+
// 处理数据
|
|
12077
12081
|
if (!allRemoteFilter || !allRemoteSort) {
|
|
12078
12082
|
const filterColumns = [];
|
|
12079
12083
|
let orderColumns = [];
|
|
@@ -12175,7 +12179,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12175
12179
|
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, handleFilter, {
|
|
12176
12180
|
original: true,
|
|
12177
12181
|
isEvery: true,
|
|
12178
|
-
children:
|
|
12182
|
+
children: mapChildrenField,
|
|
12179
12183
|
mapChildren: childrenField
|
|
12180
12184
|
});
|
|
12181
12185
|
tableData = tableTree;
|
|
@@ -12189,7 +12193,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12189
12193
|
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, () => true, {
|
|
12190
12194
|
original: true,
|
|
12191
12195
|
isEvery: true,
|
|
12192
|
-
children:
|
|
12196
|
+
children: mapChildrenField,
|
|
12193
12197
|
mapChildren: childrenField
|
|
12194
12198
|
});
|
|
12195
12199
|
tableData = tableTree;
|
|
@@ -12211,10 +12215,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12211
12215
|
});
|
|
12212
12216
|
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests) ? sortRests : tableTree;
|
|
12213
12217
|
} else {
|
|
12214
|
-
|
|
12218
|
+
const treeList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(tableTree, {
|
|
12219
|
+
children: mapChildrenField
|
|
12220
|
+
});
|
|
12221
|
+
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(treeList, orderColumns.map(({
|
|
12215
12222
|
column,
|
|
12216
12223
|
order
|
|
12217
|
-
}) => [getOrderField(column), order]))
|
|
12224
|
+
}) => [getOrderField(column), order])), {
|
|
12225
|
+
key: rowField,
|
|
12226
|
+
parentKey: parentField,
|
|
12227
|
+
children: childrenField,
|
|
12228
|
+
mapChildren: mapChildrenField
|
|
12229
|
+
});
|
|
12218
12230
|
}
|
|
12219
12231
|
tableData = tableTree;
|
|
12220
12232
|
} else {
|
|
@@ -20152,6 +20164,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20152
20164
|
}
|
|
20153
20165
|
},
|
|
20154
20166
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
20167
|
+
const {
|
|
20168
|
+
scrollYLoad,
|
|
20169
|
+
scrollXLoad
|
|
20170
|
+
} = reactData;
|
|
20155
20171
|
const {
|
|
20156
20172
|
elemStore,
|
|
20157
20173
|
intoRunScroll,
|
|
@@ -20217,13 +20233,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20217
20233
|
setScrollTop(rightScrollElem, scrollTop);
|
|
20218
20234
|
}
|
|
20219
20235
|
setScrollTop(yHandleEl, scrollTop);
|
|
20220
|
-
|
|
20236
|
+
if (scrollYLoad) {
|
|
20237
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
20238
|
+
}
|
|
20221
20239
|
}
|
|
20222
20240
|
if (isRollX) {
|
|
20223
20241
|
setScrollLeft(xHandleEl, scrollLeft);
|
|
20224
20242
|
setScrollLeft(headerScrollElem, scrollLeft);
|
|
20225
20243
|
setScrollLeft(footerScrollElem, scrollLeft);
|
|
20226
|
-
|
|
20244
|
+
if (scrollXLoad) {
|
|
20245
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
20246
|
+
}
|
|
20227
20247
|
}
|
|
20228
20248
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20229
20249
|
type: 'body',
|
|
@@ -20231,6 +20251,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20231
20251
|
});
|
|
20232
20252
|
},
|
|
20233
20253
|
triggerHeaderScrollEvent(evnt, fixedType) {
|
|
20254
|
+
const {
|
|
20255
|
+
scrollXLoad
|
|
20256
|
+
} = reactData;
|
|
20234
20257
|
const {
|
|
20235
20258
|
elemStore,
|
|
20236
20259
|
intoRunScroll,
|
|
@@ -20267,13 +20290,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20267
20290
|
setScrollLeft(xHandleEl, scrollLeft);
|
|
20268
20291
|
setScrollLeft(footerScrollElem, scrollLeft);
|
|
20269
20292
|
setScrollLeft(bodyScrollElem, scrollLeft);
|
|
20270
|
-
|
|
20293
|
+
if (scrollXLoad) {
|
|
20294
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
20295
|
+
}
|
|
20271
20296
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20272
20297
|
type: 'header',
|
|
20273
20298
|
fixed: fixedType
|
|
20274
20299
|
});
|
|
20275
20300
|
},
|
|
20276
20301
|
triggerFooterScrollEvent(evnt, fixedType) {
|
|
20302
|
+
const {
|
|
20303
|
+
scrollXLoad
|
|
20304
|
+
} = reactData;
|
|
20277
20305
|
const {
|
|
20278
20306
|
elemStore,
|
|
20279
20307
|
intoRunScroll,
|
|
@@ -20310,7 +20338,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20310
20338
|
setScrollLeft(xHandleEl, scrollLeft);
|
|
20311
20339
|
setScrollLeft(headerScrollElem, scrollLeft);
|
|
20312
20340
|
setScrollLeft(bodyScrollElem, scrollLeft);
|
|
20313
|
-
|
|
20341
|
+
if (scrollXLoad) {
|
|
20342
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
20343
|
+
}
|
|
20314
20344
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20315
20345
|
type: 'footer',
|
|
20316
20346
|
fixed: fixedType
|
|
@@ -20328,6 +20358,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20328
20358
|
const {
|
|
20329
20359
|
highlightHoverRow
|
|
20330
20360
|
} = src_props;
|
|
20361
|
+
const {
|
|
20362
|
+
scrollYLoad
|
|
20363
|
+
} = reactData;
|
|
20331
20364
|
const {
|
|
20332
20365
|
elemStore,
|
|
20333
20366
|
lastScrollTop,
|
|
@@ -20374,7 +20407,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20374
20407
|
setScrollTop(bodyScrollElem, currTopNum);
|
|
20375
20408
|
setScrollTop(leftScrollElem, currTopNum);
|
|
20376
20409
|
setScrollTop(rightScrollElem, currTopNum);
|
|
20377
|
-
|
|
20410
|
+
if (scrollYLoad) {
|
|
20411
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
20412
|
+
}
|
|
20378
20413
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
20379
20414
|
type: 'table',
|
|
20380
20415
|
fixed: ''
|
|
@@ -20393,6 +20428,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20393
20428
|
}
|
|
20394
20429
|
},
|
|
20395
20430
|
triggerVirtualScrollXEvent(evnt) {
|
|
20431
|
+
const {
|
|
20432
|
+
scrollXLoad
|
|
20433
|
+
} = reactData;
|
|
20396
20434
|
const {
|
|
20397
20435
|
elemStore,
|
|
20398
20436
|
inWheelScroll,
|
|
@@ -20426,13 +20464,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20426
20464
|
setScrollLeft(bodyScrollElem, scrollLeft);
|
|
20427
20465
|
setScrollLeft(headerScrollElem, scrollLeft);
|
|
20428
20466
|
setScrollLeft(footerScrollElem, scrollLeft);
|
|
20429
|
-
|
|
20467
|
+
if (scrollXLoad) {
|
|
20468
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
20469
|
+
}
|
|
20430
20470
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20431
20471
|
type: 'table',
|
|
20432
20472
|
fixed: ''
|
|
20433
20473
|
});
|
|
20434
20474
|
},
|
|
20435
20475
|
triggerVirtualScrollYEvent(evnt) {
|
|
20476
|
+
const {
|
|
20477
|
+
scrollYLoad
|
|
20478
|
+
} = reactData;
|
|
20436
20479
|
const {
|
|
20437
20480
|
elemStore,
|
|
20438
20481
|
inWheelScroll,
|
|
@@ -20466,7 +20509,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20466
20509
|
setScrollTop(bodyScrollElem, scrollTop);
|
|
20467
20510
|
setScrollTop(leftScrollElem, scrollTop);
|
|
20468
20511
|
setScrollTop(rightScrollElem, scrollTop);
|
|
20469
|
-
|
|
20512
|
+
if (scrollYLoad) {
|
|
20513
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
20514
|
+
}
|
|
20470
20515
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20471
20516
|
type: 'table',
|
|
20472
20517
|
fixed: ''
|
|
@@ -22617,7 +22662,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22617
22662
|
}
|
|
22618
22663
|
}
|
|
22619
22664
|
};
|
|
22620
|
-
|
|
22665
|
+
const syncActivedCell = () => {
|
|
22621
22666
|
const {
|
|
22622
22667
|
editStore,
|
|
22623
22668
|
tableColumn
|
|
@@ -22637,8 +22682,8 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22637
22682
|
setEditColumnModel(row, column);
|
|
22638
22683
|
}
|
|
22639
22684
|
}
|
|
22640
|
-
}
|
|
22641
|
-
|
|
22685
|
+
};
|
|
22686
|
+
const insertTreeRow = (newRecords, isAppend) => {
|
|
22642
22687
|
const {
|
|
22643
22688
|
tableFullTreeData,
|
|
22644
22689
|
afterFullData,
|
|
@@ -22719,7 +22764,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22719
22764
|
fullAllDataRowIdData[rowid] = rest;
|
|
22720
22765
|
}
|
|
22721
22766
|
});
|
|
22722
|
-
}
|
|
22767
|
+
};
|
|
22723
22768
|
const handleInsertRowAt = (records, targetRow, isInsertNextRow) => {
|
|
22724
22769
|
const {
|
|
22725
22770
|
treeConfig
|
|
@@ -23038,6 +23083,160 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23038
23083
|
}
|
|
23039
23084
|
});
|
|
23040
23085
|
};
|
|
23086
|
+
const handleEditActive = (params, evnt, isFocus) => {
|
|
23087
|
+
const {
|
|
23088
|
+
editConfig,
|
|
23089
|
+
mouseConfig
|
|
23090
|
+
} = props;
|
|
23091
|
+
const {
|
|
23092
|
+
editStore,
|
|
23093
|
+
tableColumn
|
|
23094
|
+
} = reactData;
|
|
23095
|
+
const editOpts = computeEditOpts.value;
|
|
23096
|
+
const {
|
|
23097
|
+
mode
|
|
23098
|
+
} = editOpts;
|
|
23099
|
+
const {
|
|
23100
|
+
actived,
|
|
23101
|
+
focused
|
|
23102
|
+
} = editStore;
|
|
23103
|
+
const {
|
|
23104
|
+
row,
|
|
23105
|
+
column
|
|
23106
|
+
} = params;
|
|
23107
|
+
const {
|
|
23108
|
+
editRender
|
|
23109
|
+
} = column;
|
|
23110
|
+
const cell = params.cell || $xeTable.getCellElement(row, column);
|
|
23111
|
+
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
23112
|
+
params.cell = cell;
|
|
23113
|
+
if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
|
|
23114
|
+
// 激活编辑
|
|
23115
|
+
if (!$xeTable.isPendingByRow(row)) {
|
|
23116
|
+
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
23117
|
+
// 判断是否禁用编辑
|
|
23118
|
+
let type = 'edit-disabled';
|
|
23119
|
+
if (!beforeEditMethod || beforeEditMethod({
|
|
23120
|
+
...params,
|
|
23121
|
+
$table: $xeTable,
|
|
23122
|
+
$grid: $xeTable.xegrid
|
|
23123
|
+
})) {
|
|
23124
|
+
if (mouseConfig) {
|
|
23125
|
+
$xeTable.clearSelected();
|
|
23126
|
+
if ($xeTable.clearCellAreas) {
|
|
23127
|
+
$xeTable.clearCellAreas();
|
|
23128
|
+
$xeTable.clearCopyCellArea();
|
|
23129
|
+
}
|
|
23130
|
+
}
|
|
23131
|
+
$xeTable.closeTooltip();
|
|
23132
|
+
if (actived.column) {
|
|
23133
|
+
handleClearEdit(evnt);
|
|
23134
|
+
}
|
|
23135
|
+
type = 'edit-activated';
|
|
23136
|
+
column.renderHeight = cell.offsetHeight;
|
|
23137
|
+
actived.args = params;
|
|
23138
|
+
actived.row = row;
|
|
23139
|
+
actived.column = column;
|
|
23140
|
+
if (mode === 'row') {
|
|
23141
|
+
tableColumn.forEach(column => getEditColumnModel(row, column));
|
|
23142
|
+
} else {
|
|
23143
|
+
getEditColumnModel(row, column);
|
|
23144
|
+
}
|
|
23145
|
+
const afterEditMethod = editOpts.afterEditMethod;
|
|
23146
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
23147
|
+
if (isFocus) {
|
|
23148
|
+
$xeTable.handleFocus(params, evnt);
|
|
23149
|
+
}
|
|
23150
|
+
if (afterEditMethod) {
|
|
23151
|
+
afterEditMethod({
|
|
23152
|
+
...params,
|
|
23153
|
+
$table: $xeTable,
|
|
23154
|
+
$grid: $xeTable.xegrid
|
|
23155
|
+
});
|
|
23156
|
+
}
|
|
23157
|
+
});
|
|
23158
|
+
}
|
|
23159
|
+
$xeTable.dispatchEvent(type, {
|
|
23160
|
+
row,
|
|
23161
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
23162
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
23163
|
+
column,
|
|
23164
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
23165
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
23166
|
+
}, evnt);
|
|
23167
|
+
// v4已废弃
|
|
23168
|
+
if (type === 'edit-activated') {
|
|
23169
|
+
$xeTable.dispatchEvent('edit-actived', {
|
|
23170
|
+
row,
|
|
23171
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
23172
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
23173
|
+
column,
|
|
23174
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
23175
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
23176
|
+
}, evnt);
|
|
23177
|
+
}
|
|
23178
|
+
} else {
|
|
23179
|
+
const {
|
|
23180
|
+
column: oldColumn
|
|
23181
|
+
} = actived;
|
|
23182
|
+
if (mouseConfig) {
|
|
23183
|
+
$xeTable.clearSelected();
|
|
23184
|
+
if ($xeTable.clearCellAreas) {
|
|
23185
|
+
$xeTable.clearCellAreas();
|
|
23186
|
+
$xeTable.clearCopyCellArea();
|
|
23187
|
+
}
|
|
23188
|
+
}
|
|
23189
|
+
if (oldColumn !== column) {
|
|
23190
|
+
const {
|
|
23191
|
+
model: oldModel
|
|
23192
|
+
} = oldColumn;
|
|
23193
|
+
if (oldModel.update) {
|
|
23194
|
+
setCellValue(row, oldColumn, oldModel.value);
|
|
23195
|
+
}
|
|
23196
|
+
if ($xeTable.clearValidate) {
|
|
23197
|
+
$xeTable.clearValidate(row, column);
|
|
23198
|
+
}
|
|
23199
|
+
}
|
|
23200
|
+
column.renderHeight = cell.offsetHeight;
|
|
23201
|
+
actived.args = params;
|
|
23202
|
+
actived.column = column;
|
|
23203
|
+
if (isFocus) {
|
|
23204
|
+
setTimeout(() => {
|
|
23205
|
+
$xeTable.handleFocus(params, evnt);
|
|
23206
|
+
});
|
|
23207
|
+
}
|
|
23208
|
+
}
|
|
23209
|
+
focused.column = null;
|
|
23210
|
+
focused.row = null;
|
|
23211
|
+
$xeTable.focus();
|
|
23212
|
+
}
|
|
23213
|
+
}
|
|
23214
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23215
|
+
};
|
|
23216
|
+
const handleEditCell = (row, fieldOrColumn, isPos) => {
|
|
23217
|
+
const {
|
|
23218
|
+
editConfig
|
|
23219
|
+
} = props;
|
|
23220
|
+
const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
23221
|
+
if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
|
|
23222
|
+
return Promise.resolve(isPos ? $xeTable.scrollToRow(row, column) : null).then(() => {
|
|
23223
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
23224
|
+
if (cell) {
|
|
23225
|
+
handleEditActive({
|
|
23226
|
+
row,
|
|
23227
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
23228
|
+
column,
|
|
23229
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
23230
|
+
cell,
|
|
23231
|
+
$table: $xeTable
|
|
23232
|
+
}, null, false);
|
|
23233
|
+
internalData._lastCallTime = Date.now();
|
|
23234
|
+
}
|
|
23235
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23236
|
+
});
|
|
23237
|
+
}
|
|
23238
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23239
|
+
};
|
|
23041
23240
|
editMethods = {
|
|
23042
23241
|
/**
|
|
23043
23242
|
* 往表格中插入临时数据
|
|
@@ -23432,7 +23631,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23432
23631
|
if (fieldOrColumn) {
|
|
23433
23632
|
column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
23434
23633
|
}
|
|
23435
|
-
return
|
|
23634
|
+
return handleEditCell(row, column, false);
|
|
23436
23635
|
},
|
|
23437
23636
|
setActiveCell(row, fieldOrColumn) {
|
|
23438
23637
|
if (true) {
|
|
@@ -23445,28 +23644,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23445
23644
|
* 激活单元格编辑
|
|
23446
23645
|
*/
|
|
23447
23646
|
setEditCell(row, fieldOrColumn) {
|
|
23448
|
-
|
|
23449
|
-
editConfig
|
|
23450
|
-
} = props;
|
|
23451
|
-
const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
23452
|
-
if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
|
|
23453
|
-
return $xeTable.scrollToRow(row, column).then(() => {
|
|
23454
|
-
const cell = $xeTable.getCellElement(row, column);
|
|
23455
|
-
if (cell) {
|
|
23456
|
-
editPrivateMethods.handleEdit({
|
|
23457
|
-
row,
|
|
23458
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
23459
|
-
column,
|
|
23460
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
23461
|
-
cell,
|
|
23462
|
-
$table: $xeTable
|
|
23463
|
-
});
|
|
23464
|
-
internalData._lastCallTime = Date.now();
|
|
23465
|
-
}
|
|
23466
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23467
|
-
});
|
|
23468
|
-
}
|
|
23469
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23647
|
+
return handleEditCell(row, fieldOrColumn, true);
|
|
23470
23648
|
},
|
|
23471
23649
|
/**
|
|
23472
23650
|
* 只对 trigger=dblclick 有效,选中单元格
|
|
@@ -23499,130 +23677,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23499
23677
|
* 处理激活编辑
|
|
23500
23678
|
*/
|
|
23501
23679
|
handleEdit(params, evnt) {
|
|
23502
|
-
|
|
23503
|
-
editConfig,
|
|
23504
|
-
mouseConfig
|
|
23505
|
-
} = props;
|
|
23506
|
-
const {
|
|
23507
|
-
editStore,
|
|
23508
|
-
tableColumn
|
|
23509
|
-
} = reactData;
|
|
23510
|
-
const editOpts = computeEditOpts.value;
|
|
23511
|
-
const {
|
|
23512
|
-
mode
|
|
23513
|
-
} = editOpts;
|
|
23514
|
-
const {
|
|
23515
|
-
actived,
|
|
23516
|
-
focused
|
|
23517
|
-
} = editStore;
|
|
23518
|
-
const {
|
|
23519
|
-
row,
|
|
23520
|
-
column
|
|
23521
|
-
} = params;
|
|
23522
|
-
const {
|
|
23523
|
-
editRender
|
|
23524
|
-
} = column;
|
|
23525
|
-
const cell = params.cell || $xeTable.getCellElement(row, column);
|
|
23526
|
-
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
23527
|
-
params.cell = cell;
|
|
23528
|
-
if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
|
|
23529
|
-
// 激活编辑
|
|
23530
|
-
if (!$xeTable.isPendingByRow(row)) {
|
|
23531
|
-
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
23532
|
-
// 判断是否禁用编辑
|
|
23533
|
-
let type = 'edit-disabled';
|
|
23534
|
-
if (!beforeEditMethod || beforeEditMethod({
|
|
23535
|
-
...params,
|
|
23536
|
-
$table: $xeTable,
|
|
23537
|
-
$grid: $xeTable.xegrid
|
|
23538
|
-
})) {
|
|
23539
|
-
if (mouseConfig) {
|
|
23540
|
-
editMethods.clearSelected();
|
|
23541
|
-
if ($xeTable.clearCellAreas) {
|
|
23542
|
-
$xeTable.clearCellAreas();
|
|
23543
|
-
$xeTable.clearCopyCellArea();
|
|
23544
|
-
}
|
|
23545
|
-
}
|
|
23546
|
-
$xeTable.closeTooltip();
|
|
23547
|
-
if (actived.column) {
|
|
23548
|
-
handleClearEdit(evnt);
|
|
23549
|
-
}
|
|
23550
|
-
type = 'edit-activated';
|
|
23551
|
-
column.renderHeight = cell.offsetHeight;
|
|
23552
|
-
actived.args = params;
|
|
23553
|
-
actived.row = row;
|
|
23554
|
-
actived.column = column;
|
|
23555
|
-
if (mode === 'row') {
|
|
23556
|
-
tableColumn.forEach(column => getEditColumnModel(row, column));
|
|
23557
|
-
} else {
|
|
23558
|
-
getEditColumnModel(row, column);
|
|
23559
|
-
}
|
|
23560
|
-
const afterEditMethod = editOpts.afterEditMethod;
|
|
23561
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
23562
|
-
editPrivateMethods.handleFocus(params, evnt);
|
|
23563
|
-
if (afterEditMethod) {
|
|
23564
|
-
afterEditMethod({
|
|
23565
|
-
...params,
|
|
23566
|
-
$table: $xeTable,
|
|
23567
|
-
$grid: $xeTable.xegrid
|
|
23568
|
-
});
|
|
23569
|
-
}
|
|
23570
|
-
});
|
|
23571
|
-
}
|
|
23572
|
-
$xeTable.dispatchEvent(type, {
|
|
23573
|
-
row,
|
|
23574
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
23575
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
23576
|
-
column,
|
|
23577
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
23578
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
23579
|
-
}, evnt);
|
|
23580
|
-
// v4已废弃
|
|
23581
|
-
if (type === 'edit-activated') {
|
|
23582
|
-
$xeTable.dispatchEvent('edit-actived', {
|
|
23583
|
-
row,
|
|
23584
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
23585
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
23586
|
-
column,
|
|
23587
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
23588
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
23589
|
-
}, evnt);
|
|
23590
|
-
}
|
|
23591
|
-
} else {
|
|
23592
|
-
const {
|
|
23593
|
-
column: oldColumn
|
|
23594
|
-
} = actived;
|
|
23595
|
-
if (mouseConfig) {
|
|
23596
|
-
editMethods.clearSelected();
|
|
23597
|
-
if ($xeTable.clearCellAreas) {
|
|
23598
|
-
$xeTable.clearCellAreas();
|
|
23599
|
-
$xeTable.clearCopyCellArea();
|
|
23600
|
-
}
|
|
23601
|
-
}
|
|
23602
|
-
if (oldColumn !== column) {
|
|
23603
|
-
const {
|
|
23604
|
-
model: oldModel
|
|
23605
|
-
} = oldColumn;
|
|
23606
|
-
if (oldModel.update) {
|
|
23607
|
-
setCellValue(row, oldColumn, oldModel.value);
|
|
23608
|
-
}
|
|
23609
|
-
if ($xeTable.clearValidate) {
|
|
23610
|
-
$xeTable.clearValidate(row, column);
|
|
23611
|
-
}
|
|
23612
|
-
}
|
|
23613
|
-
column.renderHeight = cell.offsetHeight;
|
|
23614
|
-
actived.args = params;
|
|
23615
|
-
actived.column = column;
|
|
23616
|
-
setTimeout(() => {
|
|
23617
|
-
editPrivateMethods.handleFocus(params, evnt);
|
|
23618
|
-
});
|
|
23619
|
-
}
|
|
23620
|
-
focused.column = null;
|
|
23621
|
-
focused.row = null;
|
|
23622
|
-
$xeTable.focus();
|
|
23623
|
-
}
|
|
23624
|
-
}
|
|
23625
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23680
|
+
return handleEditActive(params, evnt, true);
|
|
23626
23681
|
},
|
|
23627
23682
|
/**
|
|
23628
23683
|
* @deprecated
|
|
@@ -23803,6 +23858,7 @@ function createHtmlPage(opts, content) {
|
|
|
23803
23858
|
|
|
23804
23859
|
|
|
23805
23860
|
|
|
23861
|
+
|
|
23806
23862
|
const {
|
|
23807
23863
|
getI18n: export_hook_getI18n,
|
|
23808
23864
|
hooks: export_hook_hooks,
|
|
@@ -24204,7 +24260,7 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24204
24260
|
cellValue = htmlCellElem.innerText.trim();
|
|
24205
24261
|
} else {
|
|
24206
24262
|
const cell = $xeTable.getCellElement(row, column);
|
|
24207
|
-
if (cell) {
|
|
24263
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
24208
24264
|
cellValue = cell.innerText.trim();
|
|
24209
24265
|
}
|
|
24210
24266
|
}
|
|
@@ -24274,7 +24330,7 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24274
24330
|
cellValue = htmlCellElem.innerText.trim();
|
|
24275
24331
|
} else {
|
|
24276
24332
|
const cell = $xeTable.getCellElement(row, column);
|
|
24277
|
-
if (cell) {
|
|
24333
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
24278
24334
|
cellValue = cell.innerText.trim();
|
|
24279
24335
|
}
|
|
24280
24336
|
}
|