vxe-table 4.22.0-beta.0 → 4.22.0
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 -43
- package/dist/style.css +1 -1
- package/es/grid/src/grid.js +2 -2
- package/es/style.css +1 -1
- package/es/table/module/edit/hook.js +4 -2
- package/es/table/module/export/hook.js +7 -5
- package/es/table/module/filter/hook.js +5 -3
- package/es/table/module/filter/panel.js +5 -3
- package/es/table/src/body.js +5 -3
- package/es/table/src/cell.js +16 -6
- package/es/table/src/columnInfo.js +3 -2
- package/es/table/src/footer.js +3 -2
- package/es/table/src/header.js +6 -4
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +13 -5
- package/es/toolbar/src/toolbar.js +7 -4
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +2 -2
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +100 -47
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +5 -2
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +8 -5
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/filter/hook.js +6 -3
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/filter/panel.js +6 -3
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/src/body.js +6 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +26 -6
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +6 -4
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +4 -2
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +7 -4
- package/lib/table/src/header.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 -7
- package/lib/table/src/table.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +11 -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/grid/src/grid.ts +2 -2
- package/packages/table/module/edit/hook.ts +4 -2
- package/packages/table/module/export/hook.ts +7 -5
- package/packages/table/module/filter/hook.ts +6 -4
- package/packages/table/module/filter/panel.ts +5 -3
- package/packages/table/src/body.ts +5 -3
- package/packages/table/src/cell.ts +16 -6
- package/packages/table/src/columnInfo.ts +4 -2
- package/packages/table/src/footer.ts +3 -2
- package/packages/table/src/header.ts +6 -4
- package/packages/table/src/props.ts +4 -0
- package/packages/table/src/table.ts +14 -5
- package/packages/toolbar/src/toolbar.ts +7 -4
- /package/es/{iconfont.1789131679524.ttf → iconfont.1789914604819.ttf} +0 -0
- /package/es/{iconfont.1789131679524.woff → iconfont.1789914604819.woff} +0 -0
- /package/es/{iconfont.1789131679524.woff2 → iconfont.1789914604819.woff2} +0 -0
- /package/lib/{iconfont.1789131679524.ttf → iconfont.1789914604819.ttf} +0 -0
- /package/lib/{iconfont.1789131679524.woff → iconfont.1789914604819.woff} +0 -0
- /package/lib/{iconfont.1789131679524.woff2 → iconfont.1789914604819.woff2} +0 -0
|
@@ -12,7 +12,7 @@ hooks.add('tableEditModule', {
|
|
|
12
12
|
setupTable($xeTable) {
|
|
13
13
|
const { props, reactData, internalData } = $xeTable;
|
|
14
14
|
const { refElem } = $xeTable.getRefMaps();
|
|
15
|
-
const { computeMouseOpts, computeEditOpts, computeCheckboxOpts, computeTreeOpts, computeValidOpts } = $xeTable.getComputeMaps();
|
|
15
|
+
const { computeMouseOpts, computeEditOpts, computeCheckboxOpts, computeTreeOpts, computeValidOpts, computeRendererOpts } = $xeTable.getComputeMaps();
|
|
16
16
|
const browseObj = XEUtils.browse();
|
|
17
17
|
let editMethods = {};
|
|
18
18
|
let editPrivateMethods = {};
|
|
@@ -945,7 +945,9 @@ hooks.add('tableEditModule', {
|
|
|
945
945
|
const { editRender } = column;
|
|
946
946
|
const editOpts = computeEditOpts.value;
|
|
947
947
|
if (editConfig && isEnableConf(editRender)) {
|
|
948
|
-
const
|
|
948
|
+
const rendererOpts = computeRendererOpts.value;
|
|
949
|
+
const renderName = editRender.name;
|
|
950
|
+
const compRender = renderName ? (rendererOpts[renderName] || renderer.get(renderName)) : null;
|
|
949
951
|
let autoFocus = editRender.autofocus || editRender.autoFocus;
|
|
950
952
|
let autoSelect = editRender.autoSelect || editRender.autoselect;
|
|
951
953
|
let inputElem = null;
|
|
@@ -257,7 +257,7 @@ const tableExportMethodKeys = ['exportData', 'importByFile', 'importData', 'save
|
|
|
257
257
|
hooks.add('tableExportModule', {
|
|
258
258
|
setupTable($xeTable) {
|
|
259
259
|
const { props, reactData, internalData } = $xeTable;
|
|
260
|
-
const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts, computeAggregateOpts } = $xeTable.getComputeMaps();
|
|
260
|
+
const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts, computeAggregateOpts, computeRendererOpts } = $xeTable.getComputeMaps();
|
|
261
261
|
const getSeq = (cellValue, row, $rowIndex, column, $columnIndex) => {
|
|
262
262
|
const seqOpts = computeSeqOpts.value;
|
|
263
263
|
const seqMd = seqOpts.seqMethod || column.seqMethod;
|
|
@@ -297,6 +297,7 @@ hooks.add('tableExportModule', {
|
|
|
297
297
|
const treeOpts = computeTreeOpts.value;
|
|
298
298
|
const columnOpts = computeColumnOpts.value;
|
|
299
299
|
const aggregateOpts = computeAggregateOpts.value;
|
|
300
|
+
const rendererOpts = computeRendererOpts.value;
|
|
300
301
|
if (!htmlCellElem) {
|
|
301
302
|
htmlCellElem = document.createElement('div');
|
|
302
303
|
}
|
|
@@ -329,7 +330,7 @@ hooks.add('tableExportModule', {
|
|
|
329
330
|
const renderOpts = editRender || cellRender;
|
|
330
331
|
let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
|
|
331
332
|
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
332
|
-
const compConf = renderer.get(renderOpts.name);
|
|
333
|
+
const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
|
|
333
334
|
if (compConf) {
|
|
334
335
|
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
|
|
335
336
|
}
|
|
@@ -474,7 +475,7 @@ hooks.add('tableExportModule', {
|
|
|
474
475
|
const renderOpts = column.editRender || column.cellRender;
|
|
475
476
|
let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
|
|
476
477
|
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
477
|
-
const compConf = renderer.get(renderOpts.name);
|
|
478
|
+
const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
|
|
478
479
|
if (compConf) {
|
|
479
480
|
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
|
|
480
481
|
}
|
|
@@ -544,7 +545,7 @@ hooks.add('tableExportModule', {
|
|
|
544
545
|
const renderOpts = column.editRender || column.cellRender;
|
|
545
546
|
let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
|
|
546
547
|
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
547
|
-
const compConf = renderer.get(renderOpts.name);
|
|
548
|
+
const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
|
|
548
549
|
if (compConf) {
|
|
549
550
|
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
|
|
550
551
|
}
|
|
@@ -605,10 +606,11 @@ hooks.add('tableExportModule', {
|
|
|
605
606
|
};
|
|
606
607
|
const getFooterCellValue = (opts, row, column) => {
|
|
607
608
|
const columnOpts = computeColumnOpts.value;
|
|
609
|
+
const rendererOpts = computeRendererOpts.value;
|
|
608
610
|
const renderOpts = column.editRender || column.cellRender;
|
|
609
611
|
let footLabelMethod = column.footerExportMethod;
|
|
610
612
|
if (!footLabelMethod && renderOpts && renderOpts.name) {
|
|
611
|
-
const compConf = renderer.get(renderOpts.name);
|
|
613
|
+
const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
|
|
612
614
|
if (compConf) {
|
|
613
615
|
footLabelMethod = compConf.tableFooterExportMethod || compConf.footerExportMethod;
|
|
614
616
|
}
|
|
@@ -14,7 +14,7 @@ hooks.add('tableFilterModule', {
|
|
|
14
14
|
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
15
15
|
const { props, reactData, internalData } = $xeTable;
|
|
16
16
|
const { refElem, refTableFilter } = $xeTable.getRefMaps();
|
|
17
|
-
const { computeFilterOpts, computeMouseOpts } = $xeTable.getComputeMaps();
|
|
17
|
+
const { computeFilterOpts, computeMouseOpts, computeRendererOpts } = $xeTable.getComputeMaps();
|
|
18
18
|
const updatePopupStyle = () => {
|
|
19
19
|
const { filterStore } = reactData;
|
|
20
20
|
const { elemStore } = internalData;
|
|
@@ -24,9 +24,10 @@ hooks.add('tableFilterModule', {
|
|
|
24
24
|
}
|
|
25
25
|
const tableEl = refElem.value;
|
|
26
26
|
const filterOpts = computeFilterOpts.value;
|
|
27
|
+
const rendererOpts = computeRendererOpts.value;
|
|
27
28
|
const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts;
|
|
28
29
|
const filterRender = column ? column.filterRender : null;
|
|
29
|
-
const compConf = filterRender && isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
30
|
+
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
30
31
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
31
32
|
if (!headerScrollElem) {
|
|
32
33
|
return nextTick();
|
|
@@ -162,7 +163,8 @@ hooks.add('tableFilterModule', {
|
|
|
162
163
|
if (column) {
|
|
163
164
|
const { filters, filterRender } = column;
|
|
164
165
|
if (filters) {
|
|
165
|
-
const
|
|
166
|
+
const rendererOpts = computeRendererOpts.value;
|
|
167
|
+
const compConf = isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
166
168
|
const frMethod = column.filterResetMethod || (compConf ? (compConf.tableFilterResetMethod || compConf.filterResetMethod) : null);
|
|
167
169
|
filters.forEach((item) => {
|
|
168
170
|
item._checked = false;
|
|
@@ -20,7 +20,7 @@ export default defineVxeComponent({
|
|
|
20
20
|
const xID = XEUtils.uniqueId();
|
|
21
21
|
const $xeTable = inject('$xeTable', {});
|
|
22
22
|
const { reactData: tableReactData, internalData: tableInternalData, getComputeMaps } = $xeTable;
|
|
23
|
-
const { computeFilterOpts } = getComputeMaps();
|
|
23
|
+
const { computeFilterOpts, computeRendererOpts } = getComputeMaps();
|
|
24
24
|
const refElem = ref();
|
|
25
25
|
const refMaps = {
|
|
26
26
|
refElem
|
|
@@ -204,10 +204,11 @@ export default defineVxeComponent({
|
|
|
204
204
|
return [];
|
|
205
205
|
}
|
|
206
206
|
const filterOpts = computeFilterOpts.value;
|
|
207
|
+
const rendererOpts = computeRendererOpts.value;
|
|
207
208
|
const hasCheckOption = computeHasCheckOption.value;
|
|
208
209
|
const { filterRender, filterMultiple } = column;
|
|
209
210
|
const { confirmButtonText, resetButtonText, showFooter } = filterOpts;
|
|
210
|
-
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
211
|
+
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
211
212
|
const isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
|
|
212
213
|
let showFlFoot = !!filterMultiple;
|
|
213
214
|
if (XEUtils.isBoolean(showFooter)) {
|
|
@@ -242,8 +243,9 @@ export default defineVxeComponent({
|
|
|
242
243
|
if (!column) {
|
|
243
244
|
return renderEmptyElement($xeFilterPanel);
|
|
244
245
|
}
|
|
246
|
+
const rendererOpts = computeRendererOpts.value;
|
|
245
247
|
const filterRender = column ? column.filterRender : null;
|
|
246
|
-
const compConf = filterRender && isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
248
|
+
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
247
249
|
const filterClassName = compConf ? (compConf.tableFilterClassName || compConf.filterClassName) : '';
|
|
248
250
|
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel: $xeFilterPanel, $table: $xeTable });
|
|
249
251
|
const tableProps = $xeTable.props;
|
package/es/table/src/body.js
CHANGED
|
@@ -23,7 +23,7 @@ export default defineVxeComponent({
|
|
|
23
23
|
setup(props) {
|
|
24
24
|
const $xeTable = inject('$xeTable', {});
|
|
25
25
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
26
|
-
const { computeEditOpts, computeMouseOpts, computeCellOffsetWidth, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeResizableOpts, computeVirtualXOpts, computeVirtualYOpts, computeIsBodyRenderOptimize } = $xeTable.getComputeMaps();
|
|
26
|
+
const { computeEditOpts, computeMouseOpts, computeCellOffsetWidth, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeResizableOpts, computeVirtualXOpts, computeVirtualYOpts, computeIsBodyRenderOptimize, computeRendererOpts } = $xeTable.getComputeMaps();
|
|
27
27
|
const refElem = ref();
|
|
28
28
|
const refBodyScroll = ref();
|
|
29
29
|
const refBodyTable = ref();
|
|
@@ -108,6 +108,7 @@ export default defineVxeComponent({
|
|
|
108
108
|
const resizableOpts = computeResizableOpts.value;
|
|
109
109
|
const virtualXOpts = computeVirtualXOpts.value;
|
|
110
110
|
const virtualYOpts = computeVirtualYOpts.value;
|
|
111
|
+
const rendererOpts = computeRendererOpts.value;
|
|
111
112
|
const { isAllColumnDrag, isAllRowDrag } = resizableOpts;
|
|
112
113
|
const rowOpts = computeRowOpts.value;
|
|
113
114
|
const rowDragOpts = computeRowDragOpts.value;
|
|
@@ -126,7 +127,7 @@ export default defineVxeComponent({
|
|
|
126
127
|
const colid = column.id;
|
|
127
128
|
const colRest = fullColumnIdData[colid] || {};
|
|
128
129
|
const renderOpts = editRender || cellRender;
|
|
129
|
-
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
130
|
+
const compConf = renderOpts && renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
130
131
|
const compCellClassName = compConf ? (compConf.tableCellClassName || compConf.cellClassName) : null;
|
|
131
132
|
const compCellStyle = compConf ? (compConf.tableCellStyle || compConf.cellStyle) : '';
|
|
132
133
|
const showAllTip = tooltipOpts.showAll;
|
|
@@ -763,7 +764,8 @@ export default defineVxeComponent({
|
|
|
763
764
|
emptyContent = $xeTable.callSlot(emptySlot, emptyParams);
|
|
764
765
|
}
|
|
765
766
|
else {
|
|
766
|
-
const
|
|
767
|
+
const rendererOpts = computeRendererOpts.value;
|
|
768
|
+
const compConf = emptyOpts.name ? (rendererOpts[emptyOpts.name] || renderer.get(emptyOpts.name)) : null;
|
|
767
769
|
const rtEmptyView = compConf ? (compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty) : null;
|
|
768
770
|
if (rtEmptyView) {
|
|
769
771
|
emptyContent = getSlotVNs(rtEmptyView(emptyOpts, emptyParams));
|
package/es/table/src/cell.js
CHANGED
|
@@ -221,7 +221,9 @@ function getFooterContent(params) {
|
|
|
221
221
|
const renderOpts = editRenderOpts || cellRenderOpts;
|
|
222
222
|
const itemValue = $table.getFooterCellLabel(row, column);
|
|
223
223
|
if (renderOpts) {
|
|
224
|
-
const
|
|
224
|
+
const { computeRendererOpts } = $table.getComputeMaps();
|
|
225
|
+
const rendererOpts = computeRendererOpts.value;
|
|
226
|
+
const compConf = renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
225
227
|
if (compConf) {
|
|
226
228
|
const rtFooter = compConf.renderTableFooter || compConf.renderFooter;
|
|
227
229
|
if (rtFooter) {
|
|
@@ -358,7 +360,9 @@ export const Cell = {
|
|
|
358
360
|
}
|
|
359
361
|
}
|
|
360
362
|
if (renderOpts) {
|
|
361
|
-
const
|
|
363
|
+
const { computeRendererOpts } = $table.getComputeMaps();
|
|
364
|
+
const rendererOpts = computeRendererOpts.value;
|
|
365
|
+
const compConf = renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
362
366
|
if (compConf) {
|
|
363
367
|
const rtHeader = compConf.renderTableHeader || compConf.renderHeader;
|
|
364
368
|
if (rtHeader) {
|
|
@@ -453,9 +457,11 @@ export const Cell = {
|
|
|
453
457
|
if (defaultSlot) {
|
|
454
458
|
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
455
459
|
}
|
|
460
|
+
const { computeRendererOpts } = $table.getComputeMaps();
|
|
461
|
+
const rendererOpts = computeRendererOpts.value;
|
|
456
462
|
// 如果是编辑模式-查看:slot default > formatter > cellRender.renderTableDefault > editRender.renderTableCell > editRender.renderTableDefault > cellRender.tableCellFormatter > editRender.tableCellFormatter > field
|
|
457
463
|
// 如果是查看表格:slot default > formatter > cellRender.renderTableDefault > cellRender.tableCellFormatter > field
|
|
458
|
-
const cellCompConf = cellRenderOpts ? renderer.get(cellRenderOpts.name) : null;
|
|
464
|
+
const cellCompConf = cellRenderOpts && cellRenderOpts.name ? (rendererOpts[cellRenderOpts.name] || renderer.get(cellRenderOpts.name)) : null;
|
|
459
465
|
if (cellRenderOpts) {
|
|
460
466
|
const cellDefaultRenderFn = cellCompConf ? (cellCompConf.renderTableDefault || cellCompConf.renderDefault) : null;
|
|
461
467
|
if (cellDefaultRenderFn && cellRenderOpts) {
|
|
@@ -463,7 +469,7 @@ export const Cell = {
|
|
|
463
469
|
}
|
|
464
470
|
}
|
|
465
471
|
if (editRenderOpts) {
|
|
466
|
-
const editCompConf = editRenderOpts ? renderer.get(editRenderOpts.name) : null;
|
|
472
|
+
const editCompConf = editRenderOpts && editRenderOpts.name ? (rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name)) : null;
|
|
467
473
|
const editCellRenderFn = editCompConf
|
|
468
474
|
? ((editCompConf.renderTableCell || editCompConf.renderCell) ||
|
|
469
475
|
(editCompConf.renderTableDefault || editCompConf.renderDefault))
|
|
@@ -1001,7 +1007,9 @@ export const Cell = {
|
|
|
1001
1007
|
return $table.callSlot(contentSlot, params);
|
|
1002
1008
|
}
|
|
1003
1009
|
if (contentRender) {
|
|
1004
|
-
const
|
|
1010
|
+
const { computeRendererOpts } = $table.getComputeMaps();
|
|
1011
|
+
const rendererOpts = computeRendererOpts.value;
|
|
1012
|
+
const compConf = contentRender.name ? (rendererOpts[contentRender.name] || renderer.get(contentRender.name)) : null;
|
|
1005
1013
|
if (compConf) {
|
|
1006
1014
|
const rtExpand = compConf.renderTableExpand || compConf.renderExpand;
|
|
1007
1015
|
if (rtExpand) {
|
|
@@ -1217,7 +1225,9 @@ export const Cell = {
|
|
|
1217
1225
|
if (editSlot) {
|
|
1218
1226
|
return $table.callSlot(editSlot, cellParams);
|
|
1219
1227
|
}
|
|
1220
|
-
const
|
|
1228
|
+
const { computeRendererOpts } = $table.getComputeMaps();
|
|
1229
|
+
const rendererOpts = computeRendererOpts.value;
|
|
1230
|
+
const compConf = editRenderOpts.name ? (rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name)) : null;
|
|
1221
1231
|
const rtEdit = compConf ? (compConf.renderTableEdit || compConf.renderEdit) : null;
|
|
1222
1232
|
if (rtEdit) {
|
|
1223
1233
|
return getSlotVNs(rtEdit(editRenderOpts, cellParams));
|
|
@@ -13,11 +13,13 @@ export class ColumnInfo {
|
|
|
13
13
|
const $xeGrid = $xeTable.xeGrid;
|
|
14
14
|
const $xeGantt = $xeTable.xeGantt;
|
|
15
15
|
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
16
|
+
const { computeRendererOpts, computeTreeOpts } = $xeTable.getComputeMaps();
|
|
16
17
|
const { type, field, width, visible, fixed, align, headerAlign, footerAlign, aggFunc, formatter, filterMultiple, cellRender, editRender, filterRender } = colConfs;
|
|
17
18
|
const colId = colConfs.colId || XEUtils.uniqueId('col_');
|
|
18
19
|
const defaultVisible = XEUtils.isBoolean(visible) ? visible : true;
|
|
19
20
|
const defaultRenderWidth = width && isPx(width) && width !== 'auto' ? Math.max(0, XEUtils.toInteger(width)) : 0;
|
|
20
|
-
const
|
|
21
|
+
const rendererOpts = computeRendererOpts.value;
|
|
22
|
+
const flCompConf = filterRender && isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
21
23
|
const ctFilterOptions = flCompConf ? flCompConf.createTableFilterOptions : null;
|
|
22
24
|
const filters = toFilters(colConfs.filters, colId);
|
|
23
25
|
const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
|
|
@@ -32,7 +34,6 @@ export class ColumnInfo {
|
|
|
32
34
|
}
|
|
33
35
|
if (type === 'expand') {
|
|
34
36
|
const { treeConfig } = tableProps;
|
|
35
|
-
const { computeTreeOpts } = $xeTable.getComputeMaps();
|
|
36
37
|
const treeOpts = computeTreeOpts.value;
|
|
37
38
|
if (treeConfig && (treeOpts.showLine || treeOpts.line)) {
|
|
38
39
|
errLog('vxe.error.errConflicts', ['tree-config.showLine', 'column.type=expand']);
|
package/es/table/src/footer.js
CHANGED
|
@@ -31,7 +31,7 @@ export default defineVxeComponent({
|
|
|
31
31
|
setup(props) {
|
|
32
32
|
const $xeTable = inject('$xeTable', {});
|
|
33
33
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
34
|
-
const { computeFooterTooltipOpts, computeColumnOpts, computeCellOpts, computeFooterCellOpts, computeDefaultRowHeight, computeResizableOpts, computeVirtualXOpts, computeIsFooterRenderOptimize } = $xeTable.getComputeMaps();
|
|
34
|
+
const { computeFooterTooltipOpts, computeColumnOpts, computeCellOpts, computeFooterCellOpts, computeDefaultRowHeight, computeResizableOpts, computeVirtualXOpts, computeIsFooterRenderOptimize, computeRendererOpts } = $xeTable.getComputeMaps();
|
|
35
35
|
const refElem = ref();
|
|
36
36
|
const refFooterScroll = ref();
|
|
37
37
|
const refFooterTable = ref();
|
|
@@ -54,12 +54,13 @@ export default defineVxeComponent({
|
|
|
54
54
|
const cellOpts = computeCellOpts.value;
|
|
55
55
|
const footerCellOpts = computeFooterCellOpts.value;
|
|
56
56
|
const currCellHeight = getCalcHeight(footerCellOpts.height) || defaultRowHeight;
|
|
57
|
+
const rendererOpts = computeRendererOpts.value;
|
|
57
58
|
return tableColumn.map((column, $columnIndex) => {
|
|
58
59
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column;
|
|
59
60
|
const colid = column.id;
|
|
60
61
|
const colRest = fullColumnIdData[colid] || {};
|
|
61
62
|
const renderOpts = editRender || cellRender;
|
|
62
|
-
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
63
|
+
const compConf = renderOpts && renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
63
64
|
const showAllTip = footerTooltipOpts.showAll;
|
|
64
65
|
const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
65
66
|
const cellPadding = getDefaultConfig(footerCellOpts.padding, cellOpts.padding);
|
package/es/table/src/header.js
CHANGED
|
@@ -23,7 +23,7 @@ export default defineVxeComponent({
|
|
|
23
23
|
setup(props) {
|
|
24
24
|
const $xeTable = inject('$xeTable', {});
|
|
25
25
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
26
|
-
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts, computeFloatingFilterOpts, computeIsHeaderRenderOptimize, computeHeaderTooltipOpts } = $xeTable.getComputeMaps();
|
|
26
|
+
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts, computeFloatingFilterOpts, computeIsHeaderRenderOptimize, computeHeaderTooltipOpts, computeRendererOpts } = $xeTable.getComputeMaps();
|
|
27
27
|
const headerColumn = ref([]);
|
|
28
28
|
const refElem = ref();
|
|
29
29
|
const refHeaderScroll = ref();
|
|
@@ -62,6 +62,7 @@ export default defineVxeComponent({
|
|
|
62
62
|
const cellOpts = computeCellOpts.value;
|
|
63
63
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
64
64
|
const headerCellOpts = computeHeaderCellOpts.value;
|
|
65
|
+
const rendererOpts = computeRendererOpts.value;
|
|
65
66
|
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
66
67
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
|
|
67
68
|
const isLastRow = _rowIndex === headerGroups.length - 1;
|
|
@@ -70,7 +71,7 @@ export default defineVxeComponent({
|
|
|
70
71
|
const colid = column.id;
|
|
71
72
|
const colRest = fullColumnIdData[colid] || {};
|
|
72
73
|
const renderOpts = editRender || cellRender;
|
|
73
|
-
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
74
|
+
const compConf = renderOpts && renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
74
75
|
const isColGroup = column.children && column.children.length;
|
|
75
76
|
const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
76
77
|
const cellPadding = getDefaultConfig(headerCellOpts.padding, cellOpts.padding);
|
|
@@ -251,6 +252,7 @@ export default defineVxeComponent({
|
|
|
251
252
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
252
253
|
const headerCellOpts = computeHeaderCellOpts.value;
|
|
253
254
|
const floatingFilterOpts = computeFloatingFilterOpts.value;
|
|
255
|
+
const rendererOpts = computeRendererOpts.value;
|
|
254
256
|
const { cellClassName } = floatingFilterOpts;
|
|
255
257
|
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
256
258
|
return cols.map((column, $columnIndex) => {
|
|
@@ -259,8 +261,8 @@ export default defineVxeComponent({
|
|
|
259
261
|
const colRest = fullColumnIdData[colid] || {};
|
|
260
262
|
const renderOpts = editRender || cellRender;
|
|
261
263
|
const flSlot = slots ? (slots.floatingFilter || slots['floating-filter']) : null;
|
|
262
|
-
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
263
|
-
const flCompConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
264
|
+
const compConf = renderOpts && renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
265
|
+
const flCompConf = isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
264
266
|
const rtFloatingFilter = flCompConf ? flCompConf.renderTableFloatingFilter : null;
|
|
265
267
|
const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
266
268
|
const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
|
package/es/table/src/props.js
CHANGED
package/es/table/src/table.js
CHANGED
|
@@ -698,6 +698,9 @@ export default defineVxeComponent({
|
|
|
698
698
|
const combineSplitterResizeFlag = computed(() => {
|
|
699
699
|
return $xeSplitter ? $xeSplitter.reactData.resizeFlag : null;
|
|
700
700
|
});
|
|
701
|
+
const computeRendererOpts = computed(() => {
|
|
702
|
+
return Object.assign({}, getConfig().table.rendererConfig, props.rendererConfig);
|
|
703
|
+
});
|
|
701
704
|
const refMaps = {
|
|
702
705
|
refElem,
|
|
703
706
|
refTooltip,
|
|
@@ -804,6 +807,7 @@ export default defineVxeComponent({
|
|
|
804
807
|
computeRowGroupColumns,
|
|
805
808
|
computeAggFuncColumns,
|
|
806
809
|
computeUndoRedoHistoryOpts,
|
|
810
|
+
computeRendererOpts,
|
|
807
811
|
computeFNROpts,
|
|
808
812
|
computeSXOpts,
|
|
809
813
|
computeSYOpts
|
|
@@ -2243,6 +2247,7 @@ export default defineVxeComponent({
|
|
|
2243
2247
|
const filterOpts = computeFilterOpts.value;
|
|
2244
2248
|
const sortOpts = computeSortOpts.value;
|
|
2245
2249
|
const aggregateOpts = computeAggregateOpts.value;
|
|
2250
|
+
const rendererOpts = computeRendererOpts.value;
|
|
2246
2251
|
const treeOpts = computeTreeOpts.value;
|
|
2247
2252
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2248
2253
|
const { transform, rowField, parentField, mapChildrenField } = treeOpts;
|
|
@@ -2282,7 +2287,7 @@ export default defineVxeComponent({
|
|
|
2282
2287
|
const handleFilter = (row) => {
|
|
2283
2288
|
return filterColumns.every(({ column, valueList, itemList }) => {
|
|
2284
2289
|
const { filterMethod, filterRender } = column;
|
|
2285
|
-
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
2290
|
+
const compConf = isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
2286
2291
|
const compFilterMethod = compConf ? (compConf.tableFilterMethod || compConf.filterMethod) : null;
|
|
2287
2292
|
const tdFilterMethod = compConf ? (compConf.tableFilterDefaultMethod || compConf.defaultTableFilterMethod || compConf.defaultFilterMethod) : null;
|
|
2288
2293
|
const cellValue = getCellValue(row, column);
|
|
@@ -5393,6 +5398,7 @@ export default defineVxeComponent({
|
|
|
5393
5398
|
}
|
|
5394
5399
|
const { editConfig } = props;
|
|
5395
5400
|
const { formatter, editRender, cellRender } = column;
|
|
5401
|
+
const rendererOpts = computeRendererOpts.value;
|
|
5396
5402
|
let etOpSize = null;
|
|
5397
5403
|
let etOgSize = null;
|
|
5398
5404
|
let clOpSize = null;
|
|
@@ -5409,8 +5415,8 @@ export default defineVxeComponent({
|
|
|
5409
5415
|
const editRenderOpts = formatter ? null : (isEnableEdit && isEnableConf(editRender) ? editRender : null);
|
|
5410
5416
|
const cellRenderOpts = formatter ? null : (isEnableConf(cellRender) ? cellRender : null);
|
|
5411
5417
|
// formatter > cellRender.tableCellFormatter > editRender.tableCellFormatter
|
|
5412
|
-
const cellCompConf = cellRenderOpts ? renderer.get(cellRenderOpts.name) : null;
|
|
5413
|
-
const editCompConf = editRenderOpts ? renderer.get(editRenderOpts.name) : null;
|
|
5418
|
+
const cellCompConf = cellRenderOpts && cellRenderOpts.name ? (rendererOpts[cellRenderOpts.name] || renderer.get(cellRenderOpts.name)) : null;
|
|
5419
|
+
const editCompConf = editRenderOpts && editRenderOpts.name ? (rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name)) : null;
|
|
5414
5420
|
const cellDfFormatter = cellCompConf ? cellCompConf.tableCellFormatter : null;
|
|
5415
5421
|
const editDfFormatter = editCompConf ? editCompConf.tableCellFormatter : null;
|
|
5416
5422
|
const cellValue = getCellValue(row, column);
|
|
@@ -10196,8 +10202,9 @@ export default defineVxeComponent({
|
|
|
10196
10202
|
if (column) {
|
|
10197
10203
|
const { filterStore } = reactData;
|
|
10198
10204
|
const { filterRender, filters } = column;
|
|
10205
|
+
const rendererOpts = computeRendererOpts.value;
|
|
10199
10206
|
const filterOptions = filters || [];
|
|
10200
|
-
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
10207
|
+
const compConf = isEnableConf(filterRender) && filterRender.name ? (rendererOpts[filterRender.name] || renderer.get(filterRender.name)) : null;
|
|
10201
10208
|
const frMethod = column.filterRecoverMethod || (compConf ? (compConf.tableFilterRecoverMethod || compConf.filterRecoverMethod) : null);
|
|
10202
10209
|
filterStore.column = column;
|
|
10203
10210
|
// 复原状态
|
|
@@ -13494,7 +13501,8 @@ export default defineVxeComponent({
|
|
|
13494
13501
|
return emptySlot(emptyParams);
|
|
13495
13502
|
}
|
|
13496
13503
|
else {
|
|
13497
|
-
const
|
|
13504
|
+
const rendererOpts = computeRendererOpts.value;
|
|
13505
|
+
const compConf = emptyOpts.name ? (rendererOpts[emptyOpts.name] || renderer.get(emptyOpts.name)) : null;
|
|
13498
13506
|
const rtEmptyView = compConf ? (compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty) : null;
|
|
13499
13507
|
if (rtEmptyView) {
|
|
13500
13508
|
return getSlotVNs(rtEmptyView(emptyOpts, emptyParams));
|
|
@@ -366,10 +366,12 @@ export default defineVxeComponent({
|
|
|
366
366
|
const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix'];
|
|
367
367
|
const btnVNs = [];
|
|
368
368
|
if (buttons) {
|
|
369
|
+
const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
|
|
370
|
+
const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
|
|
369
371
|
buttons.forEach((item, index) => {
|
|
370
372
|
const { dropdowns, buttonRender } = item;
|
|
371
373
|
if (item.visible !== false) {
|
|
372
|
-
const compConf = buttonRender ? renderer.get(buttonRender.name) : null;
|
|
374
|
+
const compConf = buttonRender && buttonRender.name ? (rendererOpts[buttonRender.name] || renderer.get(buttonRender.name)) : null;
|
|
373
375
|
if (buttonRender && compConf && compConf.renderToolbarButton) {
|
|
374
376
|
const toolbarButtonClassName = compConf.toolbarButtonClassName;
|
|
375
377
|
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, button: item };
|
|
@@ -417,16 +419,17 @@ export default defineVxeComponent({
|
|
|
417
419
|
const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix'];
|
|
418
420
|
const btnVNs = [];
|
|
419
421
|
if (tools) {
|
|
422
|
+
const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
|
|
423
|
+
const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
|
|
420
424
|
tools.forEach((item, tIndex) => {
|
|
421
425
|
const { dropdowns, toolRender } = item;
|
|
422
426
|
if (item.visible !== false) {
|
|
423
|
-
const
|
|
424
|
-
const compConf = toolRender ? renderer.get(rdName) : null;
|
|
427
|
+
const compConf = toolRender && toolRender.name ? (rendererOpts[toolRender.name] || renderer.get(toolRender.name)) : null;
|
|
425
428
|
if (toolRender && compConf && compConf.renderToolbarTool) {
|
|
426
429
|
const toolbarToolClassName = compConf.toolbarToolClassName;
|
|
427
430
|
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, tool: item };
|
|
428
431
|
btnVNs.push(h('span', {
|
|
429
|
-
key:
|
|
432
|
+
key: tIndex,
|
|
430
433
|
class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
|
|
431
434
|
}, getSlotVNs(compConf.renderToolbarTool(toolRender, params))));
|
|
432
435
|
}
|
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${"4.22.0
|
|
3
|
+
const tableVersion = `table v${"4.22.0"}`;
|
|
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}` : '';
|
package/lib/grid/src/grid.js
CHANGED
|
@@ -650,7 +650,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
650
650
|
// 处理插槽
|
|
651
651
|
formOpts.items.forEach(item => {
|
|
652
652
|
_xeUtils.default.each(item.slots, func => {
|
|
653
|
-
if (!_xeUtils.default.isFunction(func)) {
|
|
653
|
+
if (func && !_xeUtils.default.isFunction(func)) {
|
|
654
654
|
if (slots[func]) {
|
|
655
655
|
formSlots[func] = slots[func];
|
|
656
656
|
}
|
|
@@ -1984,7 +1984,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1984
1984
|
_xeUtils.default.eachTree(columns, column => {
|
|
1985
1985
|
if (column.slots) {
|
|
1986
1986
|
_xeUtils.default.each(column.slots, func => {
|
|
1987
|
-
if (!_xeUtils.default.isFunction(func)) {
|
|
1987
|
+
if (func && !_xeUtils.default.isFunction(func)) {
|
|
1988
1988
|
if (!slots[func]) {
|
|
1989
1989
|
errLog('vxe.error.notSlot', [func]);
|
|
1990
1990
|
}
|