vxe-table 3.12.12 → 3.12.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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +5 -6
- package/es/table/module/validator/mixin.js +13 -1
- package/es/table/render/index.js +104 -43
- package/es/table/src/header.js +4 -2
- package/es/table/src/methods.js +35 -28
- package/es/table/src/table.js +68 -28
- package/es/table/style.css +33 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +33 -2
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +232 -106
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +5 -6
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +18 -4
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +109 -41
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/header.js +4 -2
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +46 -40
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +44 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +33 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +5 -3
- 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/lib/vxe-table/style/style.css +33 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +5 -6
- package/packages/table/module/validator/mixin.ts +15 -2
- package/packages/table/render/index.ts +120 -51
- package/packages/table/src/header.ts +4 -2
- package/packages/table/src/methods.ts +42 -30
- package/packages/table/src/table.ts +71 -28
- package/packages/ui/index.ts +4 -2
- package/styles/components/table.scss +31 -2
- /package/es/{iconfont.1739010705633.ttf → iconfont.1739181382716.ttf} +0 -0
- /package/es/{iconfont.1739010705633.woff → iconfont.1739181382716.woff} +0 -0
- /package/es/{iconfont.1739010705633.woff2 → iconfont.1739181382716.woff2} +0 -0
- /package/lib/{iconfont.1739010705633.ttf → iconfont.1739181382716.ttf} +0 -0
- /package/lib/{iconfont.1739010705633.woff → iconfont.1739181382716.woff} +0 -0
- /package/lib/{iconfont.1739010705633.woff2 → iconfont.1739181382716.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.12.
|
|
2223
|
+
const version = "3.12.14";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2267,12 +2267,14 @@ core_.VxeUI.setConfig({
|
|
|
2267
2267
|
rowDragConfig: {
|
|
2268
2268
|
showIcon: true,
|
|
2269
2269
|
animation: true,
|
|
2270
|
-
showGuidesStatus: true
|
|
2270
|
+
showGuidesStatus: true,
|
|
2271
|
+
showDragTip: true
|
|
2271
2272
|
},
|
|
2272
2273
|
columnDragConfig: {
|
|
2273
2274
|
showIcon: true,
|
|
2274
2275
|
animation: true,
|
|
2275
|
-
showGuidesStatus: true
|
|
2276
|
+
showGuidesStatus: true,
|
|
2277
|
+
showDragTip: true
|
|
2276
2278
|
},
|
|
2277
2279
|
checkboxConfig: {
|
|
2278
2280
|
// trigger: 'default',
|
|
@@ -2840,7 +2842,7 @@ function isNodeElement(elem) {
|
|
|
2840
2842
|
const {
|
|
2841
2843
|
log: log_log
|
|
2842
2844
|
} = core_.VxeUI;
|
|
2843
|
-
const log_version = `table v${"3.12.
|
|
2845
|
+
const log_version = `table v${"3.12.14"}`;
|
|
2844
2846
|
const warnLog = log_log.create('warn', log_version);
|
|
2845
2847
|
const errLog = log_log.create('error', log_version);
|
|
2846
2848
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -12143,10 +12145,9 @@ const Methods = {
|
|
|
12143
12145
|
} = sortOpts;
|
|
12144
12146
|
const {
|
|
12145
12147
|
field,
|
|
12146
|
-
sortable
|
|
12147
|
-
remoteSort
|
|
12148
|
+
sortable
|
|
12148
12149
|
} = column;
|
|
12149
|
-
if (sortable || remoteSort) {
|
|
12150
|
+
if (sortable || column.remoteSort) {
|
|
12150
12151
|
if (!order || column.order === order) {
|
|
12151
12152
|
if (allowClear) {
|
|
12152
12153
|
$xeTable.clearSort(multiple ? column : null);
|
|
@@ -12160,6 +12161,44 @@ const Methods = {
|
|
|
12160
12161
|
$xeTable.handleColumnSortEvent(evnt, column);
|
|
12161
12162
|
}
|
|
12162
12163
|
},
|
|
12164
|
+
handleCellRuleUpdateStatus(type, cellParams, cellValue) {
|
|
12165
|
+
const $xeTable = this;
|
|
12166
|
+
const reactData = $xeTable;
|
|
12167
|
+
const {
|
|
12168
|
+
validStore
|
|
12169
|
+
} = reactData;
|
|
12170
|
+
const {
|
|
12171
|
+
row,
|
|
12172
|
+
column
|
|
12173
|
+
} = cellParams;
|
|
12174
|
+
if ($xeTable.hasCellRules) {
|
|
12175
|
+
if ($xeTable.hasCellRules(type, row, column)) {
|
|
12176
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
12177
|
+
if (cell) {
|
|
12178
|
+
const customVal = !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(cellValue);
|
|
12179
|
+
return $xeTable.validCellRules(type, row, column, cellValue).then(() => {
|
|
12180
|
+
if (customVal && validStore.visible) {
|
|
12181
|
+
setCellValue(row, column, cellValue);
|
|
12182
|
+
}
|
|
12183
|
+
$xeTable.clearValidate(row, column);
|
|
12184
|
+
}).catch(({
|
|
12185
|
+
rule
|
|
12186
|
+
}) => {
|
|
12187
|
+
if (customVal) {
|
|
12188
|
+
setCellValue(row, column, cellValue);
|
|
12189
|
+
}
|
|
12190
|
+
$xeTable.showValidTooltip({
|
|
12191
|
+
rule,
|
|
12192
|
+
row,
|
|
12193
|
+
column,
|
|
12194
|
+
cell
|
|
12195
|
+
});
|
|
12196
|
+
});
|
|
12197
|
+
}
|
|
12198
|
+
}
|
|
12199
|
+
}
|
|
12200
|
+
return $xeTable.$nextTick();
|
|
12201
|
+
},
|
|
12163
12202
|
/**
|
|
12164
12203
|
* 表头单元格按下事件
|
|
12165
12204
|
*/
|
|
@@ -14882,45 +14921,14 @@ const Methods = {
|
|
|
14882
14921
|
* 如果单元格配置了校验规则,则会进行校验
|
|
14883
14922
|
*/
|
|
14884
14923
|
updateStatus(slotParams, cellValue) {
|
|
14885
|
-
const
|
|
14924
|
+
const $xeTable = this;
|
|
14925
|
+
const props = $xeTable;
|
|
14886
14926
|
return this.$nextTick().then(() => {
|
|
14887
14927
|
const {
|
|
14888
|
-
|
|
14889
|
-
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
const refTableBody = $refs.refTableBody;
|
|
14893
|
-
if (slotParams && refTableBody && editRules) {
|
|
14894
|
-
const {
|
|
14895
|
-
row,
|
|
14896
|
-
column
|
|
14897
|
-
} = slotParams;
|
|
14898
|
-
const type = 'change';
|
|
14899
|
-
if (this.hasCellRules) {
|
|
14900
|
-
if (this.hasCellRules(type, row, column)) {
|
|
14901
|
-
const cell = this.getCellElement(row, column);
|
|
14902
|
-
if (cell) {
|
|
14903
|
-
return this.validCellRules(type, row, column, cellValue).then(() => {
|
|
14904
|
-
if (customVal && validStore.visible) {
|
|
14905
|
-
setCellValue(row, column, cellValue);
|
|
14906
|
-
}
|
|
14907
|
-
this.clearValidate(row, column);
|
|
14908
|
-
}).catch(({
|
|
14909
|
-
rule
|
|
14910
|
-
}) => {
|
|
14911
|
-
if (customVal) {
|
|
14912
|
-
setCellValue(row, column, cellValue);
|
|
14913
|
-
}
|
|
14914
|
-
this.showValidTooltip({
|
|
14915
|
-
rule,
|
|
14916
|
-
row,
|
|
14917
|
-
column,
|
|
14918
|
-
cell
|
|
14919
|
-
});
|
|
14920
|
-
});
|
|
14921
|
-
}
|
|
14922
|
-
}
|
|
14923
|
-
}
|
|
14928
|
+
editRules
|
|
14929
|
+
} = props;
|
|
14930
|
+
if (slotParams && editRules) {
|
|
14931
|
+
return $xeTable.handleCellRuleUpdateStatus('change', slotParams, cellValue);
|
|
14924
14932
|
}
|
|
14925
14933
|
});
|
|
14926
14934
|
},
|
|
@@ -16165,8 +16173,10 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
16165
16173
|
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
16166
16174
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
16167
16175
|
let isVNPreEmptyStatus = false;
|
|
16168
|
-
if (
|
|
16169
|
-
|
|
16176
|
+
if (!isGroup) {
|
|
16177
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
16178
|
+
isVNPreEmptyStatus = true;
|
|
16179
|
+
}
|
|
16170
16180
|
}
|
|
16171
16181
|
const tcStyle = {};
|
|
16172
16182
|
if (hasEllipsis) {
|
|
@@ -21077,11 +21087,6 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
21077
21087
|
}
|
|
21078
21088
|
focused.row = null;
|
|
21079
21089
|
focused.column = null;
|
|
21080
|
-
$xeTable.$nextTick(() => {
|
|
21081
|
-
if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
|
|
21082
|
-
return $xeTable.handleRecalculateCellAreas();
|
|
21083
|
-
}
|
|
21084
|
-
});
|
|
21085
21090
|
if (validOpts.autoClear) {
|
|
21086
21091
|
if (validOpts.msgMode !== 'full' || mixin_getConfig().cellVaildMode === 'obsolete') {
|
|
21087
21092
|
if ($xeTable.clearValidate) {
|
|
@@ -21089,7 +21094,11 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
21089
21094
|
}
|
|
21090
21095
|
}
|
|
21091
21096
|
}
|
|
21092
|
-
return $xeTable.$nextTick()
|
|
21097
|
+
return $xeTable.$nextTick().then(() => {
|
|
21098
|
+
if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
|
|
21099
|
+
return $xeTable.handleRecalculateCellAreas();
|
|
21100
|
+
}
|
|
21101
|
+
});
|
|
21093
21102
|
},
|
|
21094
21103
|
_getActiveRecord() {
|
|
21095
21104
|
if (true) {
|
|
@@ -23919,13 +23928,22 @@ function validErrorRuleValue(rule, val) {
|
|
|
23919
23928
|
* 返回 Promise 对象,或者使用回调方式
|
|
23920
23929
|
*/
|
|
23921
23930
|
beginValidate(rows, cols, cb, isFull) {
|
|
23931
|
+
const $xeTable = this;
|
|
23932
|
+
const props = $xeTable;
|
|
23933
|
+
const reactData = $xeTable;
|
|
23934
|
+
const internalData = $xeTable;
|
|
23922
23935
|
const validRest = {};
|
|
23923
23936
|
const {
|
|
23924
23937
|
editRules,
|
|
23925
|
-
|
|
23926
|
-
|
|
23927
|
-
|
|
23928
|
-
|
|
23938
|
+
treeConfig
|
|
23939
|
+
} = props;
|
|
23940
|
+
const {
|
|
23941
|
+
pendingRowMaps
|
|
23942
|
+
} = reactData;
|
|
23943
|
+
const {
|
|
23944
|
+
afterFullData
|
|
23945
|
+
} = internalData;
|
|
23946
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
23929
23947
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
23930
23948
|
let validList;
|
|
23931
23949
|
if (rows === true) {
|
|
@@ -23948,6 +23966,11 @@ function validErrorRuleValue(rule, val) {
|
|
|
23948
23966
|
if (editRules) {
|
|
23949
23967
|
const columns = cols && cols.length ? cols : this.getColumns();
|
|
23950
23968
|
const handleVaild = row => {
|
|
23969
|
+
const rowid = getRowid($xeTable, row);
|
|
23970
|
+
// 是否标记删除
|
|
23971
|
+
if (pendingRowMaps[rowid]) {
|
|
23972
|
+
return;
|
|
23973
|
+
}
|
|
23951
23974
|
if (isFull || !this.validRuleErr) {
|
|
23952
23975
|
const colVailds = [];
|
|
23953
23976
|
columns.forEach(column => {
|
|
@@ -24789,7 +24812,8 @@ const renderDragTipContents = (h, $xeTable) => {
|
|
|
24789
24812
|
const table_renderDragTip = (h, $xeTable) => {
|
|
24790
24813
|
const reactData = $xeTable;
|
|
24791
24814
|
const {
|
|
24792
|
-
dragRow
|
|
24815
|
+
dragRow,
|
|
24816
|
+
dragCol
|
|
24793
24817
|
} = reactData;
|
|
24794
24818
|
const rowOpts = $xeTable.computeRowOpts;
|
|
24795
24819
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
@@ -24808,7 +24832,7 @@ const table_renderDragTip = (h, $xeTable) => {
|
|
|
24808
24832
|
class: ['vxe-table--drag-col-line', {
|
|
24809
24833
|
'is--guides': columnDragOpts.showGuidesStatus
|
|
24810
24834
|
}]
|
|
24811
|
-
}), h('div', {
|
|
24835
|
+
}), dragRow && rowDragOpts.showDragTip || dragCol && columnDragOpts.showDragTip ? h('div', {
|
|
24812
24836
|
ref: 'refDragTipElem',
|
|
24813
24837
|
class: 'vxe-table--drag-sort-tip'
|
|
24814
24838
|
}, [h('div', {
|
|
@@ -24823,7 +24847,7 @@ const table_renderDragTip = (h, $xeTable) => {
|
|
|
24823
24847
|
class: ['vxe-table--drag-sort-tip-disabled-status', table_getIcon().TABLE_DRAG_DISABLED]
|
|
24824
24848
|
})]), h('div', {
|
|
24825
24849
|
class: 'vxe-table--drag-sort-tip-content'
|
|
24826
|
-
}, renderDragTipContents(h, $xeTable))])])]);
|
|
24850
|
+
}, renderDragTipContents(h, $xeTable))])]) : table_renderEmptyElement($xeTable)]);
|
|
24827
24851
|
}
|
|
24828
24852
|
return table_renderEmptyElement($xeTable);
|
|
24829
24853
|
};
|
|
@@ -25185,6 +25209,12 @@ function renderBody(h, $xeTable) {
|
|
|
25185
25209
|
isHeader: false,
|
|
25186
25210
|
isFooter: false
|
|
25187
25211
|
},
|
|
25212
|
+
rowHeightStore: {
|
|
25213
|
+
default: 48,
|
|
25214
|
+
medium: 44,
|
|
25215
|
+
small: 40,
|
|
25216
|
+
mini: 36
|
|
25217
|
+
},
|
|
25188
25218
|
scrollVMLoading: false,
|
|
25189
25219
|
calcCellHeightFlag: 0,
|
|
25190
25220
|
resizeHeightFlag: 0,
|
|
@@ -25292,12 +25322,9 @@ function renderBody(h, $xeTable) {
|
|
|
25292
25322
|
return this.computeRowHeightMaps;
|
|
25293
25323
|
},
|
|
25294
25324
|
computeRowHeightMaps() {
|
|
25295
|
-
|
|
25296
|
-
|
|
25297
|
-
|
|
25298
|
-
small: 40,
|
|
25299
|
-
mini: 36
|
|
25300
|
-
};
|
|
25325
|
+
const $xeTable = this;
|
|
25326
|
+
const reactData = $xeTable;
|
|
25327
|
+
return reactData.rowHeightStore;
|
|
25301
25328
|
},
|
|
25302
25329
|
computeDefaultRowHeight() {
|
|
25303
25330
|
const $xeTable = this;
|
|
@@ -26072,9 +26099,29 @@ function renderBody(h, $xeTable) {
|
|
|
26072
26099
|
mounted() {
|
|
26073
26100
|
const $xeTable = this;
|
|
26074
26101
|
const props = $xeTable;
|
|
26102
|
+
const reactData = $xeTable;
|
|
26103
|
+
const {
|
|
26104
|
+
rowHeightStore
|
|
26105
|
+
} = reactData;
|
|
26106
|
+
const varEl = $xeTable.$refs.refVarElem;
|
|
26075
26107
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
26076
26108
|
const rowOpts = $xeTable.computeRowOpts;
|
|
26077
26109
|
const customOpts = $xeTable.computeCustomOpts;
|
|
26110
|
+
if (varEl) {
|
|
26111
|
+
const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
|
|
26112
|
+
if (defEl) {
|
|
26113
|
+
rowHeightStore.default = defEl.clientHeight;
|
|
26114
|
+
}
|
|
26115
|
+
if (mediumEl) {
|
|
26116
|
+
rowHeightStore.medium = mediumEl.clientHeight;
|
|
26117
|
+
}
|
|
26118
|
+
if (smallEl) {
|
|
26119
|
+
rowHeightStore.small = smallEl.clientHeight;
|
|
26120
|
+
}
|
|
26121
|
+
if (miniEl) {
|
|
26122
|
+
rowHeightStore.mini = miniEl.clientHeight;
|
|
26123
|
+
}
|
|
26124
|
+
}
|
|
26078
26125
|
if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
|
|
26079
26126
|
initTpImg();
|
|
26080
26127
|
}
|
|
@@ -26253,6 +26300,17 @@ function renderBody(h, $xeTable) {
|
|
|
26253
26300
|
class: 'vxe-table-slots',
|
|
26254
26301
|
ref: 'hideColumn'
|
|
26255
26302
|
}, this.$slots.default), h('div', {
|
|
26303
|
+
ref: 'refVarElem',
|
|
26304
|
+
class: 'vxe-table-vars'
|
|
26305
|
+
}, [h('div', {
|
|
26306
|
+
class: 'vxe-table-var-default'
|
|
26307
|
+
}), h('div', {
|
|
26308
|
+
class: 'vxe-table-var-medium'
|
|
26309
|
+
}), h('div', {
|
|
26310
|
+
class: 'vxe-table-var-small'
|
|
26311
|
+
}), h('div', {
|
|
26312
|
+
class: 'vxe-table-var-mini'
|
|
26313
|
+
})]), h('div', {
|
|
26256
26314
|
key: 'tw',
|
|
26257
26315
|
class: 'vxe-table--render-wrapper'
|
|
26258
26316
|
}, scrollbarXToTop ? [renderScrollX(h, $xeTable), renderBody(h, $xeTable)] : [renderBody(h, $xeTable), renderScrollX(h, $xeTable)]),
|
|
@@ -28928,12 +28986,17 @@ function getCellLabelVNs(h, renderOpts, params, cellLabel) {
|
|
|
28928
28986
|
* @param modelFunc
|
|
28929
28987
|
* @param changeFunc
|
|
28930
28988
|
*/
|
|
28931
|
-
function getNativeElementOns(renderOpts, params,
|
|
28989
|
+
function getNativeElementOns(renderOpts, params, eFns) {
|
|
28932
28990
|
const {
|
|
28933
28991
|
events
|
|
28934
28992
|
} = renderOpts;
|
|
28935
28993
|
const modelEvent = getModelEvent(renderOpts);
|
|
28936
28994
|
const changeEvent = getChangeEvent(renderOpts);
|
|
28995
|
+
const {
|
|
28996
|
+
model: modelFunc,
|
|
28997
|
+
change: changeFunc,
|
|
28998
|
+
blur: blurFunc
|
|
28999
|
+
} = eFns || {};
|
|
28937
29000
|
const isSameEvent = changeEvent === modelEvent;
|
|
28938
29001
|
const ons = {};
|
|
28939
29002
|
if (events) {
|
|
@@ -28955,15 +29018,24 @@ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
28955
29018
|
};
|
|
28956
29019
|
}
|
|
28957
29020
|
if (!isSameEvent && changeFunc) {
|
|
28958
|
-
ons[getOnName(changeEvent)] = function (
|
|
28959
|
-
changeFunc(
|
|
29021
|
+
ons[getOnName(changeEvent)] = function (evnt) {
|
|
29022
|
+
changeFunc(evnt);
|
|
28960
29023
|
if (events && events[changeEvent]) {
|
|
28961
|
-
events[changeEvent](params,
|
|
29024
|
+
events[changeEvent](params, evnt);
|
|
29025
|
+
}
|
|
29026
|
+
};
|
|
29027
|
+
}
|
|
29028
|
+
if (blurFunc) {
|
|
29029
|
+
ons[getOnName(blurEvent)] = function (evnt) {
|
|
29030
|
+
blurFunc(evnt);
|
|
29031
|
+
if (events && events[blurEvent]) {
|
|
29032
|
+
events[blurEvent](params, evnt);
|
|
28962
29033
|
}
|
|
28963
29034
|
};
|
|
28964
29035
|
}
|
|
28965
29036
|
return ons;
|
|
28966
29037
|
}
|
|
29038
|
+
const blurEvent = 'blur';
|
|
28967
29039
|
/**
|
|
28968
29040
|
* 组件事件处理
|
|
28969
29041
|
* @param renderOpts
|
|
@@ -28971,12 +29043,17 @@ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
28971
29043
|
* @param modelFunc
|
|
28972
29044
|
* @param changeFunc
|
|
28973
29045
|
*/
|
|
28974
|
-
function getComponentOns(renderOpts, params,
|
|
29046
|
+
function getComponentOns(renderOpts, params, eFns) {
|
|
28975
29047
|
const {
|
|
28976
29048
|
events
|
|
28977
29049
|
} = renderOpts;
|
|
28978
29050
|
const modelEvent = getModelEvent(renderOpts);
|
|
28979
29051
|
const changeEvent = getChangeEvent(renderOpts);
|
|
29052
|
+
const {
|
|
29053
|
+
model: modelFunc,
|
|
29054
|
+
change: changeFunc,
|
|
29055
|
+
blur: blurFunc
|
|
29056
|
+
} = eFns || {};
|
|
28980
29057
|
const ons = {};
|
|
28981
29058
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(events, (func, key) => {
|
|
28982
29059
|
ons[getOnName(key)] = function (...args) {
|
|
@@ -29004,6 +29081,14 @@ function getComponentOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
29004
29081
|
}
|
|
29005
29082
|
};
|
|
29006
29083
|
}
|
|
29084
|
+
if (blurFunc) {
|
|
29085
|
+
ons[getOnName(blurEvent)] = function (...args) {
|
|
29086
|
+
blurFunc(...args);
|
|
29087
|
+
if (events && events[blurEvent]) {
|
|
29088
|
+
events[blurEvent](params, ...args);
|
|
29089
|
+
}
|
|
29090
|
+
};
|
|
29091
|
+
}
|
|
29007
29092
|
return ons;
|
|
29008
29093
|
}
|
|
29009
29094
|
function getEditOns(renderOpts, params) {
|
|
@@ -29019,31 +29104,47 @@ function getEditOns(renderOpts, params) {
|
|
|
29019
29104
|
model
|
|
29020
29105
|
} = column;
|
|
29021
29106
|
const isImmediate = isImmediateCell(renderOpts, params);
|
|
29022
|
-
return getComponentOns(renderOpts, params,
|
|
29023
|
-
|
|
29024
|
-
|
|
29025
|
-
model.value = cellValue;
|
|
29026
|
-
if (isImmediate) {
|
|
29027
|
-
setCellValue(row, column, cellValue);
|
|
29028
|
-
}
|
|
29029
|
-
}, eventParams => {
|
|
29030
|
-
// 处理 change 事件相关逻辑
|
|
29031
|
-
if (!isImmediate && ['VxeInput', 'VxeNumberInput', 'VxeTextarea', '$input', '$textarea'].includes(name)) {
|
|
29032
|
-
const cellValue = eventParams.value;
|
|
29107
|
+
return getComponentOns(renderOpts, params, {
|
|
29108
|
+
model(cellValue) {
|
|
29109
|
+
// 处理 model 值双向绑定
|
|
29033
29110
|
model.update = true;
|
|
29034
29111
|
model.value = cellValue;
|
|
29035
|
-
|
|
29036
|
-
|
|
29037
|
-
|
|
29112
|
+
if (isImmediate) {
|
|
29113
|
+
setCellValue(row, column, cellValue);
|
|
29114
|
+
}
|
|
29115
|
+
},
|
|
29116
|
+
change(eventParams) {
|
|
29117
|
+
// 处理 change 事件相关逻辑
|
|
29118
|
+
if (!isImmediate && name && ['VxeInput', 'VxeNumberInput', 'VxeTextarea', '$input', '$textarea'].includes(name)) {
|
|
29119
|
+
const cellValue = eventParams.value;
|
|
29120
|
+
model.update = true;
|
|
29121
|
+
model.value = cellValue;
|
|
29122
|
+
$table.updateStatus(params, cellValue);
|
|
29123
|
+
} else {
|
|
29124
|
+
$table.updateStatus(params);
|
|
29125
|
+
}
|
|
29126
|
+
},
|
|
29127
|
+
blur() {
|
|
29128
|
+
if (isImmediate) {
|
|
29129
|
+
$table.handleCellRuleUpdateStatus('blur', params);
|
|
29130
|
+
} else {
|
|
29131
|
+
$table.handleCellRuleUpdateStatus('blur', params, model.value);
|
|
29132
|
+
}
|
|
29038
29133
|
}
|
|
29039
29134
|
});
|
|
29040
29135
|
}
|
|
29041
29136
|
function getFilterOns(renderOpts, params, option) {
|
|
29042
|
-
return getComponentOns(renderOpts, params,
|
|
29043
|
-
|
|
29044
|
-
|
|
29045
|
-
|
|
29046
|
-
|
|
29137
|
+
return getComponentOns(renderOpts, params, {
|
|
29138
|
+
model(value) {
|
|
29139
|
+
// 处理 model 值双向绑定
|
|
29140
|
+
option.data = value;
|
|
29141
|
+
},
|
|
29142
|
+
change() {
|
|
29143
|
+
handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(option.data), option);
|
|
29144
|
+
},
|
|
29145
|
+
blur() {
|
|
29146
|
+
handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(option.data), option);
|
|
29147
|
+
}
|
|
29047
29148
|
});
|
|
29048
29149
|
}
|
|
29049
29150
|
function getNativeEditOns(renderOpts, params) {
|
|
@@ -29055,27 +29156,52 @@ function getNativeEditOns(renderOpts, params) {
|
|
|
29055
29156
|
const {
|
|
29056
29157
|
model
|
|
29057
29158
|
} = column;
|
|
29058
|
-
return getNativeElementOns(renderOpts, params,
|
|
29059
|
-
|
|
29060
|
-
|
|
29061
|
-
|
|
29062
|
-
|
|
29063
|
-
|
|
29064
|
-
|
|
29065
|
-
|
|
29159
|
+
return getNativeElementOns(renderOpts, params, {
|
|
29160
|
+
model(evnt) {
|
|
29161
|
+
// 处理 model 值双向绑定
|
|
29162
|
+
const targetEl = evnt.target;
|
|
29163
|
+
if (targetEl) {
|
|
29164
|
+
const cellValue = targetEl.value;
|
|
29165
|
+
if (isImmediateCell(renderOpts, params)) {
|
|
29166
|
+
setCellValue(row, column, cellValue);
|
|
29167
|
+
} else {
|
|
29168
|
+
model.update = true;
|
|
29169
|
+
model.value = cellValue;
|
|
29170
|
+
}
|
|
29171
|
+
}
|
|
29172
|
+
},
|
|
29173
|
+
change(evnt) {
|
|
29174
|
+
// 处理 change 事件相关逻辑
|
|
29175
|
+
const targetEl = evnt.target;
|
|
29176
|
+
if (targetEl) {
|
|
29177
|
+
const cellValue = targetEl.value;
|
|
29178
|
+
$table.updateStatus(params, cellValue);
|
|
29179
|
+
}
|
|
29180
|
+
},
|
|
29181
|
+
blur(evnt) {
|
|
29182
|
+
const targetEl = evnt.target;
|
|
29183
|
+
if (targetEl) {
|
|
29184
|
+
const cellValue = targetEl.value;
|
|
29185
|
+
$table.updateStatus(params, cellValue);
|
|
29186
|
+
}
|
|
29066
29187
|
}
|
|
29067
|
-
}, evnt => {
|
|
29068
|
-
// 处理 change 事件相关逻辑
|
|
29069
|
-
const cellValue = evnt.target.value;
|
|
29070
|
-
$table.updateStatus(params, cellValue);
|
|
29071
29188
|
});
|
|
29072
29189
|
}
|
|
29073
29190
|
function getNativeFilterOns(renderOpts, params, option) {
|
|
29074
|
-
return getNativeElementOns(renderOpts, params,
|
|
29075
|
-
|
|
29076
|
-
|
|
29077
|
-
|
|
29078
|
-
|
|
29191
|
+
return getNativeElementOns(renderOpts, params, {
|
|
29192
|
+
model(evnt) {
|
|
29193
|
+
// 处理 model 值双向绑定
|
|
29194
|
+
const targetEl = evnt.target;
|
|
29195
|
+
if (targetEl) {
|
|
29196
|
+
option.data = targetEl.value;
|
|
29197
|
+
}
|
|
29198
|
+
},
|
|
29199
|
+
change() {
|
|
29200
|
+
handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(option.data), option);
|
|
29201
|
+
},
|
|
29202
|
+
blur() {
|
|
29203
|
+
handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(option.data), option);
|
|
29204
|
+
}
|
|
29079
29205
|
});
|
|
29080
29206
|
}
|
|
29081
29207
|
/**
|