vxe-table 4.13.5 → 4.13.6
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/grid/src/grid.js +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +3 -2
- package/es/locale/lang/de-DE.js +3 -2
- package/es/locale/lang/en-US.js +2 -1
- package/es/locale/lang/es-ES.js +3 -2
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/id-ID.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +2 -1
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +2 -1
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +11 -8
- package/es/table/module/custom/panel.js +7 -7
- package/es/table/module/export/hook.js +21 -20
- package/es/table/module/keyboard/hook.js +3 -2
- package/es/table/src/body.js +45 -10
- package/es/table/src/cell.js +159 -69
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/emits.js +1 -0
- package/es/table/src/props.js +9 -7
- package/es/table/src/table.js +653 -171
- package/es/table/style.css +70 -40
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +13 -1
- package/es/ui/src/dom.js +3 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +70 -40
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +419 -179
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +3 -2
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +3 -2
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- package/lib/locale/lang/es-ES.js +3 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +3 -2
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +2 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +2 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -1
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +2 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -1
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/hook.js +11 -1
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +6 -2
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/hook.js +21 -11
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +2 -1
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +35 -9
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +177 -52
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/props.js +9 -7
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +134 -91
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +70 -40
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +13 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +4 -0
- package/lib/ui/src/dom.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 +70 -40
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- package/packages/locale/lang/ar-EG.ts +3 -2
- package/packages/locale/lang/de-DE.ts +3 -2
- package/packages/locale/lang/en-US.ts +2 -1
- package/packages/locale/lang/es-ES.ts +3 -2
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/id-ID.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +2 -1
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +2 -1
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/custom/hook.ts +14 -8
- package/packages/table/module/custom/panel.ts +7 -7
- package/packages/table/module/export/hook.ts +28 -27
- package/packages/table/module/keyboard/hook.ts +3 -2
- package/packages/table/src/body.ts +46 -10
- package/packages/table/src/cell.ts +162 -73
- package/packages/table/src/column.ts +2 -0
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/emits.ts +1 -0
- package/packages/table/src/props.ts +9 -7
- package/packages/table/src/table.ts +658 -176
- package/packages/ui/index.ts +12 -0
- package/packages/ui/src/dom.ts +4 -0
- package/styles/components/table.scss +131 -92
- /package/es/{iconfont.1744880866629.ttf → iconfont.1745197925862.ttf} +0 -0
- /package/es/{iconfont.1744880866629.woff → iconfont.1745197925862.woff} +0 -0
- /package/es/{iconfont.1744880866629.woff2 → iconfont.1745197925862.woff2} +0 -0
- /package/lib/{iconfont.1744880866629.ttf → iconfont.1745197925862.ttf} +0 -0
- /package/lib/{iconfont.1744880866629.woff → iconfont.1745197925862.woff} +0 -0
- /package/lib/{iconfont.1744880866629.woff2 → iconfont.1745197925862.woff2} +0 -0
package/es/table/src/cell.js
CHANGED
|
@@ -81,18 +81,18 @@ function renderCellBaseVNs(params, content) {
|
|
|
81
81
|
const treeOpts = computeTreeOpts.value;
|
|
82
82
|
const { showIcon, isPeerDrag, isCrossDrag, visibleMethod } = rowDragOpts;
|
|
83
83
|
const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
|
|
84
|
-
const vns =
|
|
84
|
+
const vns = [];
|
|
85
85
|
if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
|
|
86
86
|
if (treeConfig) {
|
|
87
87
|
if (treeOpts.transform && (isPeerDrag || isCrossDrag || !level)) {
|
|
88
|
-
vns.
|
|
88
|
+
vns.push(renderCellDragIcon(params));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
else {
|
|
92
|
-
vns.
|
|
92
|
+
vns.push(renderCellDragIcon(params));
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
return vns;
|
|
95
|
+
return vns.concat(XEUtils.isArray(content) ? content : [content]);
|
|
96
96
|
}
|
|
97
97
|
function renderHeaderCellDragIcon(params) {
|
|
98
98
|
const { $table, column } = params;
|
|
@@ -246,26 +246,27 @@ function renderCellHandle(params) {
|
|
|
246
246
|
const { column, $table } = params;
|
|
247
247
|
const tableProps = $table.props;
|
|
248
248
|
const { editConfig } = tableProps;
|
|
249
|
-
const { type, treeNode, editRender } = column;
|
|
249
|
+
const { type, treeNode, rowGroupNode, editRender } = column;
|
|
250
250
|
const { computeEditOpts, computeCheckboxOpts } = $table.getComputeMaps();
|
|
251
251
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
252
252
|
const editOpts = computeEditOpts.value;
|
|
253
|
+
const isDeepCell = treeNode || rowGroupNode;
|
|
253
254
|
switch (type) {
|
|
254
255
|
case 'seq':
|
|
255
|
-
return
|
|
256
|
+
return isDeepCell ? Cell.renderDeepIndexCell(params) : Cell.renderSeqCell(params);
|
|
256
257
|
case 'radio':
|
|
257
|
-
return
|
|
258
|
+
return isDeepCell ? Cell.renderDeepRadioCell(params) : Cell.renderRadioCell(params);
|
|
258
259
|
case 'checkbox':
|
|
259
|
-
return checkboxOpts.checkField ? (
|
|
260
|
+
return checkboxOpts.checkField ? (isDeepCell ? Cell.renderDeepSelectionCellByProp(params) : Cell.renderCheckboxCellByProp(params)) : (isDeepCell ? Cell.renderDeepSelectionCell(params) : Cell.renderCheckboxCell(params));
|
|
260
261
|
case 'expand':
|
|
261
262
|
return Cell.renderExpandCell(params);
|
|
262
263
|
case 'html':
|
|
263
|
-
return
|
|
264
|
+
return isDeepCell ? Cell.renderDeepHTMLCell(params) : Cell.renderHTMLCell(params);
|
|
264
265
|
}
|
|
265
266
|
if (isEnableConf(editConfig) && editRender) {
|
|
266
|
-
return editOpts.mode === 'cell' ? (
|
|
267
|
+
return editOpts.mode === 'cell' ? (isDeepCell ? Cell.renderDeepCellEdit(params) : Cell.renderCellEdit(params)) : (isDeepCell ? Cell.renderDeepRowEdit(params) : Cell.renderRowEdit(params));
|
|
267
268
|
}
|
|
268
|
-
return
|
|
269
|
+
return isDeepCell ? Cell.renderDeepCell(params) : Cell.renderDefaultCell(params);
|
|
269
270
|
}
|
|
270
271
|
function renderHeaderHandle(params) {
|
|
271
272
|
const { column, $table } = params;
|
|
@@ -348,7 +349,10 @@ export const Cell = {
|
|
|
348
349
|
},
|
|
349
350
|
renderDefaultCell(params) {
|
|
350
351
|
const { $table, row, column } = params;
|
|
351
|
-
const
|
|
352
|
+
const tableReactData = $table.reactData;
|
|
353
|
+
const tableInternalData = $table.internalData;
|
|
354
|
+
const { isRowGroupStatus } = tableReactData;
|
|
355
|
+
const { slots, editRender, cellRender, rowGroupNode } = column;
|
|
352
356
|
const renderOpts = editRender || cellRender;
|
|
353
357
|
const defaultSlot = slots ? slots.default : null;
|
|
354
358
|
if (defaultSlot) {
|
|
@@ -365,7 +369,36 @@ export const Cell = {
|
|
|
365
369
|
}
|
|
366
370
|
}
|
|
367
371
|
}
|
|
368
|
-
|
|
372
|
+
let cellValue = '';
|
|
373
|
+
if (isRowGroupStatus && rowGroupNode && row.isAggregate) {
|
|
374
|
+
const { fullColumnFieldData } = tableInternalData;
|
|
375
|
+
const { computeRowGroupOpts } = $table.getComputeMaps();
|
|
376
|
+
const rowGroupOpts = computeRowGroupOpts.value;
|
|
377
|
+
const { showTotal, totalMethod, contentMethod, mapChildrenField } = rowGroupOpts;
|
|
378
|
+
const groupField = row.groupField;
|
|
379
|
+
cellValue = row.groupContent;
|
|
380
|
+
const childList = mapChildrenField ? (row[mapChildrenField] || []) : [];
|
|
381
|
+
const totalValue = childList.length;
|
|
382
|
+
const colRest = fullColumnFieldData[groupField] || {};
|
|
383
|
+
const params = {
|
|
384
|
+
$table,
|
|
385
|
+
groupField,
|
|
386
|
+
groupColumn: (colRest ? colRest.column : null),
|
|
387
|
+
column,
|
|
388
|
+
groupValue: cellValue,
|
|
389
|
+
children: childList,
|
|
390
|
+
totalValue: totalValue
|
|
391
|
+
};
|
|
392
|
+
if (contentMethod) {
|
|
393
|
+
cellValue = `${contentMethod(params)}`;
|
|
394
|
+
}
|
|
395
|
+
if (showTotal) {
|
|
396
|
+
cellValue = getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(params) : totalValue, totalValue]);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
else if (!(isRowGroupStatus && row.isAggregate)) {
|
|
400
|
+
cellValue = $table.getCellLabel(row, column);
|
|
401
|
+
}
|
|
369
402
|
const cellPlaceholder = editRender ? editRender.placeholder : '';
|
|
370
403
|
return renderCellBaseVNs(params, [
|
|
371
404
|
h('span', {
|
|
@@ -380,39 +413,79 @@ export const Cell = {
|
|
|
380
413
|
])
|
|
381
414
|
]);
|
|
382
415
|
},
|
|
383
|
-
|
|
384
|
-
return Cell.
|
|
416
|
+
renderDeepCell(params) {
|
|
417
|
+
return Cell.renderDeepNodeBtn(params, Cell.renderDefaultCell(params));
|
|
385
418
|
},
|
|
386
419
|
renderDefaultFooter(params) {
|
|
387
420
|
return getFooterContent(params);
|
|
388
421
|
},
|
|
389
422
|
/**
|
|
390
|
-
*
|
|
423
|
+
* 行分组
|
|
391
424
|
*/
|
|
392
|
-
|
|
425
|
+
renderRowGroupBtn(params, cellVNodes) {
|
|
426
|
+
const { $table } = params;
|
|
427
|
+
const tableReactData = $table.reactData;
|
|
428
|
+
const tableInternalData = $table.internalData;
|
|
429
|
+
const { row, level } = params;
|
|
430
|
+
const { computeRowGroupOpts } = $table.getComputeMaps();
|
|
431
|
+
const { rowGroupExpandedFlag } = tableReactData;
|
|
432
|
+
const { rowGroupExpandedMaps } = tableInternalData;
|
|
433
|
+
const rowGroupOpts = computeRowGroupOpts.value;
|
|
434
|
+
const { padding, indent } = rowGroupOpts;
|
|
435
|
+
const rowid = getRowid($table, row);
|
|
436
|
+
const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid];
|
|
437
|
+
return h('div', {
|
|
438
|
+
class: ['vxe-row-group--tree-node', {
|
|
439
|
+
'is--expanded': isExpand
|
|
440
|
+
}],
|
|
441
|
+
style: padding && indent
|
|
442
|
+
? {
|
|
443
|
+
paddingLeft: `${level * indent}px`
|
|
444
|
+
}
|
|
445
|
+
: undefined
|
|
446
|
+
}, [
|
|
447
|
+
h('span', {
|
|
448
|
+
class: 'vxe-row-group--node-btn',
|
|
449
|
+
onClick(evnt) {
|
|
450
|
+
$table.triggerRowGroupExpandEvent(evnt, params);
|
|
451
|
+
}
|
|
452
|
+
}, [
|
|
453
|
+
h('i', {
|
|
454
|
+
class: isExpand ? getIcon().TABLE_ROW_GROUP_OPEN : getIcon().TABLE_ROW_GROUP_CLOSE
|
|
455
|
+
})
|
|
456
|
+
]),
|
|
457
|
+
h('div', {
|
|
458
|
+
class: 'vxe-row-group-cell'
|
|
459
|
+
}, cellVNodes)
|
|
460
|
+
]);
|
|
461
|
+
},
|
|
462
|
+
/**
|
|
463
|
+
* 树
|
|
464
|
+
*/
|
|
465
|
+
renderTreeNodeBtn(params, cellVNodes) {
|
|
393
466
|
const { $table, isHidden } = params;
|
|
394
467
|
const tableReactData = $table.reactData;
|
|
395
468
|
const tableInternalData = $table.internalData;
|
|
469
|
+
const { row, column, level } = params;
|
|
470
|
+
const { slots } = column;
|
|
471
|
+
const iconSlot = slots ? slots.icon : null;
|
|
472
|
+
if (iconSlot) {
|
|
473
|
+
return $table.callSlot(iconSlot, params);
|
|
474
|
+
}
|
|
396
475
|
const { computeTreeOpts } = $table.getComputeMaps();
|
|
397
476
|
const { treeExpandedFlag } = tableReactData;
|
|
398
477
|
const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData;
|
|
399
478
|
const treeOpts = computeTreeOpts.value;
|
|
400
|
-
const {
|
|
401
|
-
const { slots } = column;
|
|
402
|
-
const { indent, lazy, trigger, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts;
|
|
479
|
+
const { padding, indent, lazy, trigger, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts;
|
|
403
480
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
404
481
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
405
482
|
const rowChilds = row[childrenField];
|
|
406
483
|
const hasChild = rowChilds && rowChilds.length;
|
|
407
|
-
const iconSlot = slots ? slots.icon : null;
|
|
408
484
|
let hasLazyChilds = false;
|
|
409
485
|
let isActive = false;
|
|
410
486
|
let isLazyLoading = false;
|
|
411
487
|
let isLazyLoaded = false;
|
|
412
488
|
const ons = {};
|
|
413
|
-
if (iconSlot) {
|
|
414
|
-
return $table.callSlot(iconSlot, params);
|
|
415
|
-
}
|
|
416
489
|
if (!isHidden) {
|
|
417
490
|
const rowid = getRowid($table, row);
|
|
418
491
|
isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid];
|
|
@@ -428,29 +501,41 @@ export const Cell = {
|
|
|
428
501
|
$table.triggerTreeExpandEvent(evnt, params);
|
|
429
502
|
};
|
|
430
503
|
}
|
|
431
|
-
return
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
504
|
+
return h('div', {
|
|
505
|
+
class: ['vxe-cell--tree-node', {
|
|
506
|
+
'is--active': isActive
|
|
507
|
+
}],
|
|
508
|
+
style: padding && indent
|
|
509
|
+
? {
|
|
437
510
|
paddingLeft: `${level * indent}px`
|
|
438
511
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
]
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
];
|
|
512
|
+
: undefined
|
|
513
|
+
}, [
|
|
514
|
+
showIcon && (lazy ? (isLazyLoaded ? hasChild : (hasChild || hasLazyChilds)) : hasChild)
|
|
515
|
+
? [
|
|
516
|
+
h('div', Object.assign({ class: 'vxe-cell--tree-btn' }, ons), [
|
|
517
|
+
h('i', {
|
|
518
|
+
class: isLazyLoading ? (iconLoaded || getIcon().TABLE_TREE_LOADED) : (isActive ? (iconOpen || getIcon().TABLE_TREE_OPEN) : (iconClose || getIcon().TABLE_TREE_CLOSE))
|
|
519
|
+
})
|
|
520
|
+
])
|
|
521
|
+
]
|
|
522
|
+
: null,
|
|
523
|
+
h('div', {
|
|
524
|
+
class: 'vxe-tree-cell'
|
|
525
|
+
}, cellVNodes)
|
|
526
|
+
]);
|
|
527
|
+
},
|
|
528
|
+
/**
|
|
529
|
+
* 层级节点。
|
|
530
|
+
* 行分组、树结构
|
|
531
|
+
*/
|
|
532
|
+
renderDeepNodeBtn(params, cellVNodes) {
|
|
533
|
+
const { row, column } = params;
|
|
534
|
+
const { rowGroupNode } = column;
|
|
535
|
+
if (rowGroupNode && row.isAggregate) {
|
|
536
|
+
return [Cell.renderRowGroupBtn(params, cellVNodes)];
|
|
537
|
+
}
|
|
538
|
+
return [Cell.renderTreeNodeBtn(params, cellVNodes)];
|
|
454
539
|
},
|
|
455
540
|
/**
|
|
456
541
|
* 序号
|
|
@@ -478,8 +563,8 @@ export const Cell = {
|
|
|
478
563
|
h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
|
|
479
564
|
]);
|
|
480
565
|
},
|
|
481
|
-
|
|
482
|
-
return Cell.
|
|
566
|
+
renderDeepIndexCell(params) {
|
|
567
|
+
return Cell.renderDeepNodeBtn(params, Cell.renderSeqCell(params));
|
|
483
568
|
},
|
|
484
569
|
/**
|
|
485
570
|
* 单选
|
|
@@ -509,7 +594,7 @@ export const Cell = {
|
|
|
509
594
|
const defaultSlot = slots ? slots.default : null;
|
|
510
595
|
const radioSlot = slots ? slots.radio : null;
|
|
511
596
|
const isChecked = $table.eqRow(row, selectRadioRow);
|
|
512
|
-
const isVisible = !visibleMethod || visibleMethod({ row });
|
|
597
|
+
const isVisible = !visibleMethod || visibleMethod({ $table, row });
|
|
513
598
|
let isDisabled = !!checkMethod;
|
|
514
599
|
let ons;
|
|
515
600
|
if (!isHidden) {
|
|
@@ -521,7 +606,7 @@ export const Cell = {
|
|
|
521
606
|
}
|
|
522
607
|
};
|
|
523
608
|
if (checkMethod) {
|
|
524
|
-
isDisabled = !checkMethod({ row });
|
|
609
|
+
isDisabled = !checkMethod({ $table, row });
|
|
525
610
|
}
|
|
526
611
|
}
|
|
527
612
|
const radioParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible });
|
|
@@ -546,8 +631,8 @@ export const Cell = {
|
|
|
546
631
|
}] }, ons), radioVNs)
|
|
547
632
|
]);
|
|
548
633
|
},
|
|
549
|
-
|
|
550
|
-
return Cell.
|
|
634
|
+
renderDeepRadioCell(params) {
|
|
635
|
+
return Cell.renderDeepNodeBtn(params, Cell.renderRadioCell(params));
|
|
551
636
|
},
|
|
552
637
|
/**
|
|
553
638
|
* 多选
|
|
@@ -607,7 +692,7 @@ export const Cell = {
|
|
|
607
692
|
const tableReactData = $table.reactData;
|
|
608
693
|
const tableInternalData = $table.internalData;
|
|
609
694
|
const { treeConfig } = tableProps;
|
|
610
|
-
const { updateCheckboxFlag } = tableReactData;
|
|
695
|
+
const { updateCheckboxFlag, isRowGroupStatus } = tableReactData;
|
|
611
696
|
const { selectCheckboxMaps, treeIndeterminateRowMaps } = tableInternalData;
|
|
612
697
|
const { computeCheckboxOpts } = $table.getComputeMaps();
|
|
613
698
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
@@ -617,7 +702,7 @@ export const Cell = {
|
|
|
617
702
|
const checkboxSlot = slots ? slots.checkbox : null;
|
|
618
703
|
let indeterminate = false;
|
|
619
704
|
let isChecked = false;
|
|
620
|
-
const isVisible = !visibleMethod || visibleMethod({ row });
|
|
705
|
+
const isVisible = !visibleMethod || visibleMethod({ $table, row });
|
|
621
706
|
let isDisabled = !!checkMethod;
|
|
622
707
|
const ons = {};
|
|
623
708
|
if (!isHidden) {
|
|
@@ -629,9 +714,9 @@ export const Cell = {
|
|
|
629
714
|
}
|
|
630
715
|
};
|
|
631
716
|
if (checkMethod) {
|
|
632
|
-
isDisabled = !checkMethod({ row });
|
|
717
|
+
isDisabled = !checkMethod({ $table, row });
|
|
633
718
|
}
|
|
634
|
-
if (treeConfig) {
|
|
719
|
+
if (treeConfig || isRowGroupStatus) {
|
|
635
720
|
indeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
636
721
|
}
|
|
637
722
|
}
|
|
@@ -659,8 +744,8 @@ export const Cell = {
|
|
|
659
744
|
}] }, ons), checkVNs)
|
|
660
745
|
]);
|
|
661
746
|
},
|
|
662
|
-
|
|
663
|
-
return Cell.
|
|
747
|
+
renderDeepSelectionCell(params) {
|
|
748
|
+
return Cell.renderDeepNodeBtn(params, Cell.renderCheckboxCell(params));
|
|
664
749
|
},
|
|
665
750
|
renderCheckboxCellByProp(params) {
|
|
666
751
|
const { $table, row, column, isHidden } = params;
|
|
@@ -668,7 +753,7 @@ export const Cell = {
|
|
|
668
753
|
const tableReactData = $table.reactData;
|
|
669
754
|
const tableInternalData = $table.internalData;
|
|
670
755
|
const { treeConfig } = tableProps;
|
|
671
|
-
const { updateCheckboxFlag } = tableReactData;
|
|
756
|
+
const { updateCheckboxFlag, isRowGroupStatus } = tableReactData;
|
|
672
757
|
const { treeIndeterminateRowMaps } = tableInternalData;
|
|
673
758
|
const { computeCheckboxOpts } = $table.getComputeMaps();
|
|
674
759
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
@@ -679,7 +764,7 @@ export const Cell = {
|
|
|
679
764
|
const checkboxSlot = slots ? slots.checkbox : null;
|
|
680
765
|
let isIndeterminate = false;
|
|
681
766
|
let isChecked = false;
|
|
682
|
-
const isVisible = !visibleMethod || visibleMethod({ row });
|
|
767
|
+
const isVisible = !visibleMethod || visibleMethod({ $table, row });
|
|
683
768
|
let isDisabled = !!checkMethod;
|
|
684
769
|
const ons = {};
|
|
685
770
|
if (!isHidden) {
|
|
@@ -691,9 +776,9 @@ export const Cell = {
|
|
|
691
776
|
}
|
|
692
777
|
};
|
|
693
778
|
if (checkMethod) {
|
|
694
|
-
isDisabled = !checkMethod({ row });
|
|
779
|
+
isDisabled = !checkMethod({ $table, row });
|
|
695
780
|
}
|
|
696
|
-
if (treeConfig) {
|
|
781
|
+
if (treeConfig || isRowGroupStatus) {
|
|
697
782
|
isIndeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
698
783
|
}
|
|
699
784
|
}
|
|
@@ -721,15 +806,17 @@ export const Cell = {
|
|
|
721
806
|
}] }, ons), checkVNs)
|
|
722
807
|
]);
|
|
723
808
|
},
|
|
724
|
-
|
|
725
|
-
return Cell.
|
|
809
|
+
renderDeepSelectionCellByProp(params) {
|
|
810
|
+
return Cell.renderDeepNodeBtn(params, Cell.renderCheckboxCellByProp(params));
|
|
726
811
|
},
|
|
727
812
|
/**
|
|
728
813
|
* 展开行
|
|
729
814
|
*/
|
|
730
815
|
renderExpandCell(params) {
|
|
731
816
|
const { $table, isHidden, row, column } = params;
|
|
817
|
+
const tableReactData = $table.reactData;
|
|
732
818
|
const tableInternalData = $table.internalData;
|
|
819
|
+
const { isRowGroupStatus } = tableReactData;
|
|
733
820
|
const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableInternalData;
|
|
734
821
|
const { computeExpandOpts } = $table.getComputeMaps();
|
|
735
822
|
const expandOpts = computeExpandOpts.value;
|
|
@@ -739,6 +826,9 @@ export const Cell = {
|
|
|
739
826
|
const iconSlot = slots ? slots.icon : null;
|
|
740
827
|
let isActive = false;
|
|
741
828
|
let isLazyLoading = false;
|
|
829
|
+
if (isRowGroupStatus && row.isAggregate) {
|
|
830
|
+
return renderCellBaseVNs(params, []);
|
|
831
|
+
}
|
|
742
832
|
if (iconSlot) {
|
|
743
833
|
return renderCellBaseVNs(params, $table.callSlot(iconSlot, params));
|
|
744
834
|
}
|
|
@@ -809,8 +899,8 @@ export const Cell = {
|
|
|
809
899
|
})
|
|
810
900
|
]);
|
|
811
901
|
},
|
|
812
|
-
|
|
813
|
-
return Cell.
|
|
902
|
+
renderDeepHTMLCell(params) {
|
|
903
|
+
return Cell.renderDeepNodeBtn(params, Cell.renderHTMLCell(params));
|
|
814
904
|
},
|
|
815
905
|
/**
|
|
816
906
|
* 排序和筛选
|
|
@@ -943,8 +1033,8 @@ export const Cell = {
|
|
|
943
1033
|
const { editRender } = column;
|
|
944
1034
|
return Cell.runRenderer(params, isEnableConf(editRender) && actived && actived.row === params.row);
|
|
945
1035
|
},
|
|
946
|
-
|
|
947
|
-
return Cell.
|
|
1036
|
+
renderDeepRowEdit(params) {
|
|
1037
|
+
return Cell.renderDeepNodeBtn(params, Cell.renderRowEdit(params));
|
|
948
1038
|
},
|
|
949
1039
|
// 单元格编辑模式
|
|
950
1040
|
renderCellEdit(params) {
|
|
@@ -955,8 +1045,8 @@ export const Cell = {
|
|
|
955
1045
|
const { editRender } = column;
|
|
956
1046
|
return Cell.runRenderer(params, isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
|
|
957
1047
|
},
|
|
958
|
-
|
|
959
|
-
return Cell.
|
|
1048
|
+
renderDeepCellEdit(params) {
|
|
1049
|
+
return Cell.renderDeepNodeBtn(params, Cell.renderCellEdit(params));
|
|
960
1050
|
},
|
|
961
1051
|
runRenderer(params, isEdit) {
|
|
962
1052
|
const { $table, column } = params;
|
package/es/table/src/column.js
CHANGED
|
@@ -76,6 +76,7 @@ export class ColumnInfo {
|
|
|
76
76
|
filterResetMethod: _vm.filterResetMethod,
|
|
77
77
|
filterRecoverMethod: _vm.filterRecoverMethod,
|
|
78
78
|
filterRender: _vm.filterRender,
|
|
79
|
+
rowGroupNode: _vm.rowGroupNode,
|
|
79
80
|
treeNode: _vm.treeNode,
|
|
80
81
|
dragSort: _vm.dragSort,
|
|
81
82
|
rowResize: _vm.rowResize,
|
package/es/table/src/emits.js
CHANGED
package/es/table/src/props.js
CHANGED
|
@@ -180,19 +180,21 @@ export default {
|
|
|
180
180
|
syncResize: [Boolean, String, Number],
|
|
181
181
|
// 响应式布局配置项
|
|
182
182
|
resizeConfig: Object,
|
|
183
|
-
//
|
|
183
|
+
// 列配置项
|
|
184
184
|
columnConfig: Object,
|
|
185
|
-
//
|
|
185
|
+
// 当前列配置项
|
|
186
186
|
currentColumnConfig: Object,
|
|
187
|
-
//
|
|
187
|
+
// 单元格配置项
|
|
188
188
|
cellConfig: Object,
|
|
189
|
-
//
|
|
189
|
+
// 表头单元格配置项
|
|
190
190
|
headerCellConfig: Object,
|
|
191
|
-
//
|
|
191
|
+
// 表尾单元格配置项
|
|
192
192
|
footerCellConfig: Object,
|
|
193
|
-
//
|
|
193
|
+
// 行配置项
|
|
194
194
|
rowConfig: Object,
|
|
195
|
-
//
|
|
195
|
+
// 行分组配置项
|
|
196
|
+
rowGroupConfig: Object,
|
|
197
|
+
// 当前行配置项
|
|
196
198
|
currentRowConfig: Object,
|
|
197
199
|
// 已废弃,被 rowDragConfig 替换
|
|
198
200
|
dragConfig: Object,
|