vxe-table 3.24.0-beta.0 → 3.24.0-beta.1
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/mixin.js +3 -1
- package/es/table/module/export/mixin.js +6 -4
- package/es/table/module/filter/mixin.js +4 -2
- package/es/table/module/filter/panel.js +4 -2
- package/es/table/src/body.js +4 -2
- package/es/table/src/cell.js +11 -6
- package/es/table/src/columnInfo.js +2 -1
- package/es/table/src/footer.js +2 -1
- package/es/table/src/header.js +5 -3
- package/es/table/src/methods.js +7 -4
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +7 -1
- package/es/toolbar/src/toolbar.js +5 -4
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +64 -34
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +3 -1
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +6 -4
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/mixin.js +4 -2
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +4 -2
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/src/body.js +4 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +11 -6
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +2 -1
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +2 -1
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +5 -3
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +5 -5
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +7 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +5 -4
- package/lib/toolbar/src/toolbar.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/mixin.ts +3 -1
- package/packages/table/module/export/mixin.ts +6 -4
- package/packages/table/module/filter/mixin.ts +6 -4
- package/packages/table/module/filter/panel.ts +4 -2
- package/packages/table/src/body.ts +4 -2
- package/packages/table/src/cell.ts +11 -6
- package/packages/table/src/columnInfo.ts +2 -1
- package/packages/table/src/footer.ts +2 -1
- package/packages/table/src/header.ts +5 -3
- package/packages/table/src/methods.ts +7 -4
- package/packages/table/src/props.ts +4 -0
- package/packages/table/src/table.ts +8 -1
- package/packages/toolbar/src/toolbar.ts +5 -4
- /package/es/{iconfont.1789131659648.ttf → iconfont.1789279209327.ttf} +0 -0
- /package/es/{iconfont.1789131659648.woff → iconfont.1789279209327.woff} +0 -0
- /package/es/{iconfont.1789131659648.woff2 → iconfont.1789279209327.woff2} +0 -0
- /package/lib/{iconfont.1789131659648.ttf → iconfont.1789279209327.ttf} +0 -0
- /package/lib/{iconfont.1789131659648.woff → iconfont.1789279209327.woff} +0 -0
- /package/lib/{iconfont.1789131659648.woff2 → iconfont.1789279209327.woff2} +0 -0
|
@@ -925,7 +925,9 @@ export default {
|
|
|
925
925
|
const { editRender } = column;
|
|
926
926
|
const editOpts = $xeTable.computeEditOpts;
|
|
927
927
|
if (editConfig && isEnableConf(editRender)) {
|
|
928
|
-
const
|
|
928
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
929
|
+
const renderName = editRender.name;
|
|
930
|
+
const compRender = renderName ? (rendererOpts[renderName] || renderer.get(renderName)) : null;
|
|
929
931
|
let autoFocus = editRender.autofocus || editRender.autoFocus;
|
|
930
932
|
let autoSelect = editRender.autoSelect || editRender.autoselect;
|
|
931
933
|
let inputElem = null;
|
|
@@ -59,6 +59,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
|
|
|
59
59
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
60
60
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
61
61
|
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
62
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
62
63
|
if (!htmlCellElem) {
|
|
63
64
|
htmlCellElem = document.createElement('div');
|
|
64
65
|
}
|
|
@@ -91,7 +92,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
|
|
|
91
92
|
const renderOpts = editRender || cellRender;
|
|
92
93
|
let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
|
|
93
94
|
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
94
|
-
const compConf = renderer.get(renderOpts.name);
|
|
95
|
+
const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
|
|
95
96
|
if (compConf) {
|
|
96
97
|
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
|
|
97
98
|
}
|
|
@@ -236,7 +237,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
|
|
|
236
237
|
const renderOpts = column.editRender || column.cellRender;
|
|
237
238
|
let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
|
|
238
239
|
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
239
|
-
const compConf = renderer.get(renderOpts.name);
|
|
240
|
+
const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
|
|
240
241
|
if (compConf) {
|
|
241
242
|
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
|
|
242
243
|
}
|
|
@@ -306,7 +307,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
|
|
|
306
307
|
const renderOpts = column.editRender || column.cellRender;
|
|
307
308
|
let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
|
|
308
309
|
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
309
|
-
const compConf = renderer.get(renderOpts.name);
|
|
310
|
+
const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
|
|
310
311
|
if (compConf) {
|
|
311
312
|
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
|
|
312
313
|
}
|
|
@@ -375,10 +376,11 @@ function getHeaderTitle($xeTable, opts, column) {
|
|
|
375
376
|
}
|
|
376
377
|
function getFooterCellValue($xeTable, opts, row, column) {
|
|
377
378
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
379
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
378
380
|
const renderOpts = column.editRender || column.cellRender;
|
|
379
381
|
let footLabelMethod = column.footerExportMethod;
|
|
380
382
|
if (!footLabelMethod && renderOpts && renderOpts.name) {
|
|
381
|
-
const compConf = renderer.get(renderOpts.name);
|
|
383
|
+
const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
|
|
382
384
|
if (compConf) {
|
|
383
385
|
footLabelMethod = compConf.tableFooterExportMethod || compConf.footerExportMethod || compConf.footerCellExportMethod;
|
|
384
386
|
}
|
|
@@ -19,9 +19,10 @@ function updatePopupStyle($xeTable) {
|
|
|
19
19
|
}
|
|
20
20
|
const tableEl = $xeTable.$refs.refElem;
|
|
21
21
|
const filterOpts = $xeTable.computeFilterOpts;
|
|
22
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
22
23
|
const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts;
|
|
23
24
|
const filterRender = column ? column.filterRender : null;
|
|
24
|
-
const compConf = filterRender && isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
25
|
+
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
25
26
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
26
27
|
if (!headerScrollElem) {
|
|
27
28
|
return $xeTable.$nextTick();
|
|
@@ -445,7 +446,8 @@ export default {
|
|
|
445
446
|
if (column) {
|
|
446
447
|
const { filters, filterRender } = column;
|
|
447
448
|
if (filters) {
|
|
448
|
-
const
|
|
449
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
450
|
+
const compConf = isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
449
451
|
const filterResetMethod = column.filterResetMethod || (compConf ? (compConf.tableFilterResetMethod || compConf.filterResetMethod) : null);
|
|
450
452
|
filters.forEach((item) => {
|
|
451
453
|
item._checked = false;
|
|
@@ -233,9 +233,10 @@ export default {
|
|
|
233
233
|
return [];
|
|
234
234
|
}
|
|
235
235
|
const filterOpts = $xeTable.computeFilterOpts;
|
|
236
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
236
237
|
const hasCheckOption = $xeFilterPanel.computeHasCheckOption;
|
|
237
238
|
const { filterRender, filterMultiple } = column;
|
|
238
|
-
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
239
|
+
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
239
240
|
const isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
|
|
240
241
|
return filterMultiple && (compConf ? !(compConf.showTableFilterFooter === false || compConf.showFilterFooter === false || compConf.isFooter === false) : true)
|
|
241
242
|
? [
|
|
@@ -272,8 +273,9 @@ export default {
|
|
|
272
273
|
if (!column) {
|
|
273
274
|
return renderEmptyElement($xeFilterPanel);
|
|
274
275
|
}
|
|
276
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
275
277
|
const filterRender = column ? column.filterRender : null;
|
|
276
|
-
const compConf = filterRender && isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
278
|
+
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
277
279
|
const filterClassName = compConf ? (compConf.tableFilterClassName || compConf.filterClassName) : '';
|
|
278
280
|
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel: $xeFilterPanel, $table: $xeTable });
|
|
279
281
|
const tableProps = $xeTable;
|
package/es/table/src/body.js
CHANGED
|
@@ -91,6 +91,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
91
91
|
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
92
92
|
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
93
93
|
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
94
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
94
95
|
const { isAllColumnDrag, isAllRowDrag } = $xeTable.resizableOpts;
|
|
95
96
|
const rowOpts = $xeTable.computeRowOpts;
|
|
96
97
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
@@ -109,7 +110,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
109
110
|
const colid = column.id;
|
|
110
111
|
const colRest = fullColumnIdData[colid] || {};
|
|
111
112
|
const renderOpts = editRender || cellRender;
|
|
112
|
-
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
113
|
+
const compConf = renderOpts && renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
113
114
|
const compCellClassName = compConf ? (compConf.tableCellClassName || compConf.cellClassName) : null;
|
|
114
115
|
const compCellStyle = compConf ? (compConf.tableCellStyle || compConf.cellStyle) : '';
|
|
115
116
|
const showAllTip = tooltipOpts.showAll;
|
|
@@ -801,7 +802,8 @@ export default {
|
|
|
801
802
|
emptyContent = emptySlot.call($xeTable, emptyParams);
|
|
802
803
|
}
|
|
803
804
|
else {
|
|
804
|
-
const
|
|
805
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
806
|
+
const compConf = emptyOpts.name ? (rendererOpts[emptyOpts.name] || renderer.get(emptyOpts.name)) : null;
|
|
805
807
|
const rtEmptyView = compConf ? (compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty) : null;
|
|
806
808
|
if (rtEmptyView) {
|
|
807
809
|
emptyContent = getSlotVNs(rtEmptyView.call($xeTable, h, emptyOpts, emptyParams));
|
package/es/table/src/cell.js
CHANGED
|
@@ -230,7 +230,8 @@ function getFooterContent(h, params) {
|
|
|
230
230
|
const renderOpts = editRenderOpts || cellRenderOpts;
|
|
231
231
|
const itemValue = $table.getFooterCellLabel(row, column);
|
|
232
232
|
if (renderOpts) {
|
|
233
|
-
const
|
|
233
|
+
const rendererOpts = $table.computeRendererOpts;
|
|
234
|
+
const compConf = renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
234
235
|
const rtFooter = compConf ? (compConf.renderTableFooter || compConf.renderFooter) : null;
|
|
235
236
|
if (rtFooter) {
|
|
236
237
|
const footParams = Object.assign(params, {
|
|
@@ -362,7 +363,8 @@ export const Cell = {
|
|
|
362
363
|
}
|
|
363
364
|
}
|
|
364
365
|
if (renderOpts) {
|
|
365
|
-
const
|
|
366
|
+
const rendererOpts = $table.computeRendererOpts;
|
|
367
|
+
const compConf = renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
366
368
|
const rtHeader = compConf ? (compConf.renderTableHeader || compConf.renderHeader) : null;
|
|
367
369
|
if (rtHeader) {
|
|
368
370
|
return getSlotVNs(renderTitleContent(h, params, rtHeader.call($table, h, renderOpts, params)));
|
|
@@ -454,9 +456,10 @@ export const Cell = {
|
|
|
454
456
|
if (defaultSlot) {
|
|
455
457
|
return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, params, h));
|
|
456
458
|
}
|
|
459
|
+
const rendererOpts = $table.computeRendererOpts;
|
|
457
460
|
// 如果是编辑模式-查看:slot default > formatter > cellRender.renderTableDefault > editRender.renderTableCell > editRender.renderTableDefault > cellRender.tableCellFormatter > editRender.tableCellFormatter > field
|
|
458
461
|
// 如果是查看表格:slot default > formatter > cellRender。renderTableDefault > cellRender.tableCellFormatter > field
|
|
459
|
-
const cellCompConf = cellRenderOpts ? renderer.get(cellRenderOpts.name) : null;
|
|
462
|
+
const cellCompConf = cellRenderOpts && cellRenderOpts.name ? (rendererOpts[cellRenderOpts.name] || renderer.get(cellRenderOpts.name)) : null;
|
|
460
463
|
if (cellRenderOpts) {
|
|
461
464
|
const cellDefaultRenderFn = cellCompConf ? (cellCompConf.renderTableDefault || cellCompConf.renderDefault) : null;
|
|
462
465
|
if (cellDefaultRenderFn && cellRenderOpts) {
|
|
@@ -464,7 +467,7 @@ export const Cell = {
|
|
|
464
467
|
}
|
|
465
468
|
}
|
|
466
469
|
if (editRenderOpts) {
|
|
467
|
-
const editCompConf = editRenderOpts ? renderer.get(editRenderOpts.name) : null;
|
|
470
|
+
const editCompConf = editRenderOpts && editRenderOpts.name ? (rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name)) : null;
|
|
468
471
|
const editCellRenderFn = editCompConf
|
|
469
472
|
? ((editCompConf.renderTableCell || editCompConf.renderCell) ||
|
|
470
473
|
(editCompConf.renderTableDefault || editCompConf.renderDefault))
|
|
@@ -1013,7 +1016,8 @@ export const Cell = {
|
|
|
1013
1016
|
return $table.callSlot(slots.content, params, h);
|
|
1014
1017
|
}
|
|
1015
1018
|
if (contentRender) {
|
|
1016
|
-
const
|
|
1019
|
+
const rendererOpts = $table.computeRendererOpts;
|
|
1020
|
+
const compConf = contentRender.name ? (rendererOpts[contentRender.name] || renderer.get(contentRender.name)) : null;
|
|
1017
1021
|
const rtExpand = compConf ? (compConf.renderTableExpand || compConf.renderExpand) : null;
|
|
1018
1022
|
if (rtExpand) {
|
|
1019
1023
|
return getSlotVNs(rtExpand.call($table, h, contentRender, params));
|
|
@@ -1237,7 +1241,8 @@ export const Cell = {
|
|
|
1237
1241
|
if (slots && slots.edit) {
|
|
1238
1242
|
return $table.callSlot(slots.edit, cellParams, h);
|
|
1239
1243
|
}
|
|
1240
|
-
const
|
|
1244
|
+
const rendererOpts = $table.computeRendererOpts;
|
|
1245
|
+
const compConf = editRenderOpts.name ? (rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name)) : null;
|
|
1241
1246
|
const rtEdit = compConf ? (compConf.renderTableEdit || compConf.renderEdit) : null;
|
|
1242
1247
|
if (rtEdit) {
|
|
1243
1248
|
return getSlotVNs(rtEdit.call($table, h, editRender, cellParams));
|
|
@@ -18,7 +18,8 @@ export class ColumnInfo {
|
|
|
18
18
|
const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : null;
|
|
19
19
|
const defaultVisible = XEUtils.isBoolean(visible) ? visible : true;
|
|
20
20
|
const defaultRenderWidth = width && isPx(width) && width !== 'auto' ? Math.max(0, XEUtils.toInteger(width)) : 0;
|
|
21
|
-
const
|
|
21
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
22
|
+
const flCompConf = filterRender && isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
22
23
|
const ctFilterOptions = flCompConf ? flCompConf.createTableFilterOptions : null;
|
|
23
24
|
const filters = toFilters(colConfs.filters, colId);
|
|
24
25
|
const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
|
package/es/table/src/footer.js
CHANGED
|
@@ -28,12 +28,13 @@ function renderRows(h, _vm, isOptimizeMode, tableColumn, footerTableData, row, $
|
|
|
28
28
|
const cellOpts = $xeTable.computeCellOpts;
|
|
29
29
|
const footerCellOpts = $xeTable.computeFooterCellOpts;
|
|
30
30
|
const currCellHeight = getCalcHeight(footerCellOpts.height) || defaultRowHeight;
|
|
31
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
31
32
|
return tableColumn.map((column, $columnIndex) => {
|
|
32
33
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column;
|
|
33
34
|
const colid = column.id;
|
|
34
35
|
const colRest = fullColumnIdData[colid] || {};
|
|
35
36
|
const renderOpts = editRender || cellRender;
|
|
36
|
-
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
37
|
+
const compConf = renderOpts && renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
37
38
|
const showAllTip = footerTooltipOpts.showAll;
|
|
38
39
|
const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
39
40
|
const cellPadding = getDefaultConfig(footerCellOpts.padding, cellOpts.padding);
|
package/es/table/src/header.js
CHANGED
|
@@ -26,6 +26,7 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, _rowIndex, co
|
|
|
26
26
|
const cellOpts = $xeTable.computeCellOpts;
|
|
27
27
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
28
28
|
const headerCellOpts = $xeTable.computeHeaderCellOpts;
|
|
29
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
29
30
|
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
30
31
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
|
|
31
32
|
const isLastRow = _rowIndex === headerGroups.length - 1;
|
|
@@ -35,7 +36,7 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, _rowIndex, co
|
|
|
35
36
|
const colid = column.id;
|
|
36
37
|
const colRest = fullColumnIdData[colid] || {};
|
|
37
38
|
const renderOpts = editRender || cellRender;
|
|
38
|
-
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
39
|
+
const compConf = renderOpts && renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
39
40
|
const isColGroup = column.children && column.children.length;
|
|
40
41
|
const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
41
42
|
const cellPadding = getDefaultConfig(headerCellOpts.padding, cellOpts.padding);
|
|
@@ -228,6 +229,7 @@ function renderFilterRows(h, _vm, isOptimizeMode, cols) {
|
|
|
228
229
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
229
230
|
const headerCellOpts = $xeTable.computeHeaderCellOpts;
|
|
230
231
|
const floatingFilterOpts = $xeTable.computeFloatingFilterOpts;
|
|
232
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
231
233
|
const { cellClassName } = floatingFilterOpts;
|
|
232
234
|
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
233
235
|
return cols.map((column, $columnIndex) => {
|
|
@@ -235,8 +237,8 @@ function renderFilterRows(h, _vm, isOptimizeMode, cols) {
|
|
|
235
237
|
const colid = column.id;
|
|
236
238
|
const colRest = fullColumnIdData[colid] || {};
|
|
237
239
|
const renderOpts = editRender || cellRender;
|
|
238
|
-
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
239
|
-
const flCompConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
240
|
+
const compConf = renderOpts && renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
241
|
+
const flCompConf = isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
240
242
|
const rtFloatingFilter = flCompConf ? flCompConf.renderTableFloatingFilter : null;
|
|
241
243
|
const flSlot = slots ? (slots.floatingFilter || slots['floating-filter']) : null;
|
|
242
244
|
const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
package/es/table/src/methods.js
CHANGED
|
@@ -764,6 +764,7 @@ function updateAfterFullData($xeTable) {
|
|
|
764
764
|
const filterOpts = $xeTable.computeFilterOpts;
|
|
765
765
|
const sortOpts = $xeTable.computeSortOpts;
|
|
766
766
|
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
767
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
767
768
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
768
769
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
769
770
|
const { transform, rowField, parentField, mapChildrenField } = treeOpts;
|
|
@@ -803,7 +804,7 @@ function updateAfterFullData($xeTable) {
|
|
|
803
804
|
const handleFilter = (row) => {
|
|
804
805
|
return filterColumns.every(({ column, valueList, itemList }) => {
|
|
805
806
|
const { filterMethod, filterRender } = column;
|
|
806
|
-
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
807
|
+
const compConf = isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
807
808
|
const compFilterMethod = compConf ? (compConf.tableFilterMethod || compConf.filterMethod) : null;
|
|
808
809
|
const tdFilterMethod = compConf ? (compConf.tableFilterDefaultMethod || compConf.defaultTableFilterMethod || compConf.defaultFilterMethod) : null;
|
|
809
810
|
const cellValue = getCellValue(row, column);
|
|
@@ -5525,6 +5526,7 @@ const tableMethods = {
|
|
|
5525
5526
|
}
|
|
5526
5527
|
const { editConfig } = props;
|
|
5527
5528
|
const { formatter, editRender, cellRender } = column;
|
|
5529
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
5528
5530
|
let etOpSize = null;
|
|
5529
5531
|
let etOgSize = null;
|
|
5530
5532
|
let clOpSize = null;
|
|
@@ -5541,8 +5543,8 @@ const tableMethods = {
|
|
|
5541
5543
|
const editRenderOpts = formatter ? null : (isEnableEdit && isEnableConf(editRender) ? editRender : null);
|
|
5542
5544
|
const cellRenderOpts = formatter ? null : (isEnableConf(cellRender) ? cellRender : null);
|
|
5543
5545
|
// formatter > cellRender.tableCellFormatter > editRender.tableCellFormatter
|
|
5544
|
-
const cellCompConf = cellRenderOpts ? renderer.get(cellRenderOpts.name) : null;
|
|
5545
|
-
const editCompConf = editRenderOpts ? renderer.get(editRenderOpts.name) : null;
|
|
5546
|
+
const cellCompConf = cellRenderOpts && cellRenderOpts.name ? (rendererOpts[cellRenderOpts.name] || renderer.get(cellRenderOpts.name)) : null;
|
|
5547
|
+
const editCompConf = editRenderOpts && editRenderOpts.name ? (rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name)) : null;
|
|
5546
5548
|
const cellDfFormatter = cellCompConf ? cellCompConf.tableCellFormatter : null;
|
|
5547
5549
|
const editDfFormatter = editCompConf ? editCompConf.tableCellFormatter : null;
|
|
5548
5550
|
const cellValue = getCellValue(row, column);
|
|
@@ -6784,8 +6786,9 @@ const tableMethods = {
|
|
|
6784
6786
|
if (column) {
|
|
6785
6787
|
const { filterStore } = reactData;
|
|
6786
6788
|
const { filterRender, filters } = column;
|
|
6789
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
6787
6790
|
const filterOptions = filters || [];
|
|
6788
|
-
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
6791
|
+
const compConf = isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
6789
6792
|
const frMethod = column.filterRecoverMethod || (compConf ? (compConf.tableFilterRecoverMethod || compConf.filterRecoverMethod) : null);
|
|
6790
6793
|
filterStore.column = column;
|
|
6791
6794
|
// 复原状态
|
package/es/table/src/props.js
CHANGED
|
@@ -300,6 +300,10 @@ export const tableProps = {
|
|
|
300
300
|
animat: { type: Boolean, default: () => getConfig().table.animat },
|
|
301
301
|
// (可能会被废弃的参数,不要使用)
|
|
302
302
|
delayHover: { type: Number, default: () => getConfig().table.delayHover },
|
|
303
|
+
/**
|
|
304
|
+
* 渲染器配置项
|
|
305
|
+
*/
|
|
306
|
+
rendererConfig: Object,
|
|
303
307
|
// 额外的参数
|
|
304
308
|
params: Object
|
|
305
309
|
};
|
package/es/table/src/table.js
CHANGED
|
@@ -154,7 +154,8 @@ function renderEmptyBody(h, $xeTable) {
|
|
|
154
154
|
emptyContent = emptySlot.call($xeTable, emptyParams);
|
|
155
155
|
}
|
|
156
156
|
else {
|
|
157
|
-
const
|
|
157
|
+
const rendererOpts = $xeTable.computeRendererOpts;
|
|
158
|
+
const compConf = emptyOpts.name ? (rendererOpts[emptyOpts.name] || renderer.get(emptyOpts.name)) : null;
|
|
158
159
|
const rtEmptyView = compConf ? (compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty) : null;
|
|
159
160
|
if (rtEmptyView) {
|
|
160
161
|
emptyContent = getSlotVNs(rtEmptyView.call($xeTable, h, emptyOpts, emptyParams));
|
|
@@ -1376,6 +1377,11 @@ export default {
|
|
|
1376
1377
|
const props = $xeTable;
|
|
1377
1378
|
return Object.assign({}, getConfig().table.undoRedoHistoryConfig, props.undoRedoHistoryConfig);
|
|
1378
1379
|
},
|
|
1380
|
+
computeRendererOpts() {
|
|
1381
|
+
const $xeTable = this;
|
|
1382
|
+
const props = $xeTable;
|
|
1383
|
+
return Object.assign({}, getConfig().table.rendererConfig, props.rendererConfig);
|
|
1384
|
+
},
|
|
1379
1385
|
combineTabsResizeFlag() {
|
|
1380
1386
|
const $xeTable = this;
|
|
1381
1387
|
const $xeTabs = $xeTable.$xeTabs;
|
|
@@ -439,10 +439,11 @@ export default {
|
|
|
439
439
|
const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix'];
|
|
440
440
|
const btnVNs = [];
|
|
441
441
|
if (buttons) {
|
|
442
|
+
const rendererOpts = ($table ? $table.computeRendererOpts : null) || {};
|
|
442
443
|
buttons.forEach((item) => {
|
|
443
444
|
const { dropdowns, buttonRender } = item;
|
|
444
445
|
if (item.visible !== false) {
|
|
445
|
-
const compConf = buttonRender ? renderer.get(buttonRender.name) : null;
|
|
446
|
+
const compConf = buttonRender && buttonRender.name ? (rendererOpts[buttonRender.name] || renderer.get(buttonRender.name)) : null;
|
|
446
447
|
if (buttonRender && compConf && compConf.renderToolbarButton) {
|
|
447
448
|
const toolbarButtonClassName = compConf.toolbarButtonClassName;
|
|
448
449
|
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, button: item };
|
|
@@ -503,16 +504,16 @@ export default {
|
|
|
503
504
|
const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix'];
|
|
504
505
|
const btnVNs = [];
|
|
505
506
|
if (tools) {
|
|
507
|
+
const rendererOpts = ($table ? $table.computeRendererOpts : null) || {};
|
|
506
508
|
tools.forEach((item, tIndex) => {
|
|
507
509
|
const { dropdowns, toolRender } = item;
|
|
508
510
|
if (item.visible !== false) {
|
|
509
|
-
const
|
|
510
|
-
const compConf = toolRender ? renderer.get(rdName) : null;
|
|
511
|
+
const compConf = toolRender && toolRender.name ? (rendererOpts[toolRender.name] || renderer.get(toolRender.name)) : null;
|
|
511
512
|
if (toolRender && compConf && compConf.renderToolbarTool) {
|
|
512
513
|
const toolbarToolClassName = compConf.toolbarToolClassName;
|
|
513
514
|
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, tool: item };
|
|
514
515
|
btnVNs.push(h('span', {
|
|
515
|
-
key:
|
|
516
|
+
key: tIndex,
|
|
516
517
|
class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
|
|
517
518
|
}, getSlotVNs(compConf.renderToolbarTool(h, toolRender, params))));
|
|
518
519
|
}
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
const { log } = VxeUI;
|
|
3
|
-
const tableVersion = `table v${"3.24.0-beta.
|
|
3
|
+
const tableVersion = `table v${"3.24.0-beta.1"}`;
|
|
4
4
|
export function createComponentLog(name) {
|
|
5
5
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
6
6
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|