vxe-table 4.8.16 → 4.9.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/README.en.md +1 -1
- package/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/es/locale/lang/en-US.js +1 -0
- package/es/locale/lang/es-ES.js +1 -0
- package/es/locale/lang/hu-HU.js +1 -0
- package/es/locale/lang/ja-JP.js +1 -0
- package/es/locale/lang/ko-KR.js +1 -0
- package/es/locale/lang/pt-BR.js +1 -0
- package/es/locale/lang/ru-RU.js +1 -0
- package/es/locale/lang/uk-UA.js +1 -0
- package/es/locale/lang/vi-VN.js +1 -0
- package/es/locale/lang/zh-CHT.js +1 -0
- package/es/locale/lang/zh-CN.js +1 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +4 -0
- package/es/table/module/edit/hook.js +53 -34
- package/es/table/module/filter/hook.js +2 -3
- package/es/table/module/keyboard/hook.js +2 -2
- package/es/table/src/body.js +31 -24
- package/es/table/src/cell.js +99 -59
- package/es/table/src/emits.js +3 -0
- package/es/table/src/footer.js +177 -147
- package/es/table/src/header.js +144 -107
- package/es/table/src/props.js +5 -1
- package/es/table/src/table.js +346 -108
- package/es/table/src/util.js +9 -0
- package/es/table/style.css +33 -20
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +9 -4
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +33 -20
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.umd.js +1035 -573
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +1 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +1 -0
- package/lib/locale/lang/es-ES.js +1 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +1 -0
- package/lib/locale/lang/hu-HU.js +1 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +1 -0
- package/lib/locale/lang/ja-JP.js +1 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +1 -0
- package/lib/locale/lang/ko-KR.js +1 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +1 -0
- package/lib/locale/lang/pt-BR.js +1 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +1 -0
- package/lib/locale/lang/ru-RU.js +1 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +1 -0
- package/lib/locale/lang/uk-UA.js +1 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +1 -0
- package/lib/locale/lang/vi-VN.js +1 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +1 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +1 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +1 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/hook.js +4 -0
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/edit/hook.js +63 -42
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/filter/hook.js +1 -2
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +2 -2
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +34 -21
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +110 -51
- package/lib/table/src/cell.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/footer.js +222 -183
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +188 -150
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/props.js +5 -1
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +380 -110
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +10 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +33 -20
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +9 -4
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +33 -20
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +3 -3
- package/packages/locale/lang/en-US.ts +1 -0
- package/packages/locale/lang/es-ES.ts +1 -0
- package/packages/locale/lang/hu-HU.ts +1 -0
- package/packages/locale/lang/ja-JP.ts +1 -0
- package/packages/locale/lang/ko-KR.ts +1 -0
- package/packages/locale/lang/pt-BR.ts +1 -0
- package/packages/locale/lang/ru-RU.ts +1 -0
- package/packages/locale/lang/uk-UA.ts +1 -0
- package/packages/locale/lang/vi-VN.ts +1 -0
- package/packages/locale/lang/zh-CHT.ts +1 -0
- package/packages/locale/lang/zh-CN.ts +1 -0
- package/packages/table/module/custom/hook.ts +4 -0
- package/packages/table/module/edit/hook.ts +54 -34
- package/packages/table/module/filter/hook.ts +2 -3
- package/packages/table/module/keyboard/hook.ts +2 -2
- package/packages/table/src/body.ts +46 -31
- package/packages/table/src/cell.ts +140 -92
- package/packages/table/src/emits.ts +3 -0
- package/packages/table/src/footer.ts +189 -152
- package/packages/table/src/header.ts +157 -116
- package/packages/table/src/props.ts +5 -1
- package/packages/table/src/table.ts +358 -109
- package/packages/table/src/util.ts +10 -0
- package/packages/ui/index.ts +8 -3
- package/styles/components/table.scss +42 -35
- /package/es/{iconfont.1731633504443.ttf → iconfont.1731937248477.ttf} +0 -0
- /package/es/{iconfont.1731633504443.woff → iconfont.1731937248477.woff} +0 -0
- /package/es/{iconfont.1731633504443.woff2 → iconfont.1731937248477.woff2} +0 -0
- /package/lib/{iconfont.1731633504443.ttf → iconfont.1731937248477.ttf} +0 -0
- /package/lib/{iconfont.1731633504443.woff → iconfont.1731937248477.woff} +0 -0
- /package/lib/{iconfont.1731633504443.woff2 → iconfont.1731937248477.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCommentVNode, defineComponent, TransitionGroup, h, ref, inject, nextTick, onBeforeUnmount, onMounted, onUnmounted } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { VxeUI } from '../../ui';
|
|
4
|
-
import { mergeBodyMethod, getRowid } from './util';
|
|
4
|
+
import { mergeBodyMethod, getRowid, getRefElem } from './util';
|
|
5
5
|
import { updateCellTitle, getPropClass, setScrollTop, setScrollLeft } from '../../ui/src/dom';
|
|
6
6
|
import { isEnableConf } from '../../ui/src/utils';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
@@ -338,19 +338,20 @@ export default defineComponent({
|
|
|
338
338
|
getPropClass(compCellClassName, params),
|
|
339
339
|
getPropClass(className, params),
|
|
340
340
|
getPropClass(allCellClassName, params)
|
|
341
|
-
], key: columnKey || columnOpts.useKey || rowOpts.useKey ? colid : $columnIndex }, attrs), { style: Object.assign({
|
|
341
|
+
], key: columnKey || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex }, attrs), { style: Object.assign({
|
|
342
342
|
height: cellHeight
|
|
343
343
|
}, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle) }), tdOns), tdVNs);
|
|
344
344
|
};
|
|
345
345
|
const renderRows = (fixedType, tableData, tableColumn) => {
|
|
346
346
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, showOverflow: allColumnOverflow, editConfig, treeConfig } = tableProps;
|
|
347
|
-
const { hasFixedColumn, treeExpandedMaps, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, pendingRowList } = tableReactData;
|
|
347
|
+
const { hasFixedColumn, treeExpandedMaps, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, pendingRowList, isDragColMove } = tableReactData;
|
|
348
348
|
const { fullAllDataRowIdData } = tableInternalData;
|
|
349
349
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
350
350
|
const radioOpts = computeRadioOpts.value;
|
|
351
351
|
const treeOpts = computeTreeOpts.value;
|
|
352
352
|
const editOpts = computeEditOpts.value;
|
|
353
353
|
const rowOpts = computeRowOpts.value;
|
|
354
|
+
const columnOpts = computeColumnOpts.value;
|
|
354
355
|
const { transform } = treeOpts;
|
|
355
356
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
356
357
|
const rows = [];
|
|
@@ -405,23 +406,29 @@ export default defineComponent({
|
|
|
405
406
|
rowChildren = row[childrenField];
|
|
406
407
|
isExpandTree = rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
407
408
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
409
|
+
const trClass = [
|
|
410
|
+
'vxe-body--row',
|
|
411
|
+
treeConfig ? `row--level-${rowLevel}` : '',
|
|
412
|
+
{
|
|
413
|
+
'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
|
|
414
|
+
'is--new': isNewRow,
|
|
415
|
+
'is--expand-row': isExpandRow,
|
|
416
|
+
'is--expand-tree': isExpandTree,
|
|
417
|
+
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
418
|
+
'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
|
|
419
|
+
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
420
|
+
'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
|
|
421
|
+
},
|
|
422
|
+
getPropClass(rowClassName, params)
|
|
423
|
+
];
|
|
424
|
+
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
423
425
|
return renderColumn(seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
424
|
-
})
|
|
426
|
+
});
|
|
427
|
+
rows.push(columnOpts.drag
|
|
428
|
+
? h(TransitionGroup, Object.assign({ name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`, tag: 'tr', class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex }, trOn), {
|
|
429
|
+
default: () => tdVNs
|
|
430
|
+
})
|
|
431
|
+
: h('tr', Object.assign({ class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex }, trOn), tdVNs));
|
|
425
432
|
// 如果行被展开了
|
|
426
433
|
if (isExpandRow) {
|
|
427
434
|
const expandOpts = computeExpandOpts.value;
|
|
@@ -538,10 +545,8 @@ export default defineComponent({
|
|
|
538
545
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
539
546
|
const rightElem = rightBody ? rightBody.$el : null;
|
|
540
547
|
const bodyElem = tableBody.$el;
|
|
541
|
-
const
|
|
542
|
-
const
|
|
543
|
-
const bodyXRef = elemStore['main-body-xSpace'];
|
|
544
|
-
const bodyXElem = bodyXRef ? bodyXRef.value : null;
|
|
548
|
+
const bodyYElem = getRefElem(elemStore['main-body-ySpace']);
|
|
549
|
+
const bodyXElem = getRefElem(elemStore['main-body-xSpace']);
|
|
545
550
|
const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight;
|
|
546
551
|
const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth;
|
|
547
552
|
const remainSize = isPrevWheelTop === isTopWheel ? Math.max(0, wheelYSize - wheelYTotal) : 0;
|
|
@@ -664,6 +669,7 @@ export default defineComponent({
|
|
|
664
669
|
const emptyOpts = computeEmptyOpts.value;
|
|
665
670
|
const keyboardOpts = computeKeyboardOpts.value;
|
|
666
671
|
const mouseOpts = computeMouseOpts.value;
|
|
672
|
+
const columnOpts = computeColumnOpts.value;
|
|
667
673
|
// const isMergeLeftFixedExceeded = computeIsMergeLeftFixedExceeded.value
|
|
668
674
|
// const isMergeRightFixedExceeded = computeIsMergeRightFixedExceeded.value
|
|
669
675
|
// 如果是使用优化模式
|
|
@@ -737,8 +743,9 @@ export default defineComponent({
|
|
|
737
743
|
/**
|
|
738
744
|
* 内容
|
|
739
745
|
*/
|
|
740
|
-
rowOpts.drag
|
|
746
|
+
rowOpts.drag || columnOpts.drag
|
|
741
747
|
? h(TransitionGroup, {
|
|
748
|
+
ref: refBodyTBody,
|
|
742
749
|
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
743
750
|
tag: 'tbody'
|
|
744
751
|
}, {
|
package/es/table/src/cell.js
CHANGED
|
@@ -9,43 +9,44 @@ const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI;
|
|
|
9
9
|
function renderTitlePrefixIcon(params) {
|
|
10
10
|
const { $table, column } = params;
|
|
11
11
|
const titlePrefix = column.titlePrefix || column.titleHelp;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
: [];
|
|
12
|
+
if (titlePrefix) {
|
|
13
|
+
return h('i', {
|
|
14
|
+
class: ['vxe-cell-title-prefix-icon', titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX],
|
|
15
|
+
onMouseenter(evnt) {
|
|
16
|
+
$table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
|
|
17
|
+
},
|
|
18
|
+
onMouseleave(evnt) {
|
|
19
|
+
$table.handleTargetLeaveEvent(evnt);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return renderEmptyElement($table);
|
|
25
24
|
}
|
|
26
25
|
function renderTitleSuffixIcon(params) {
|
|
27
26
|
const { $table, column } = params;
|
|
28
27
|
const titleSuffix = column.titleSuffix;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
: [];
|
|
28
|
+
if (titleSuffix) {
|
|
29
|
+
h('i', {
|
|
30
|
+
class: ['vxe-cell-title-suffix-icon', titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX],
|
|
31
|
+
onMouseenter(evnt) {
|
|
32
|
+
$table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
|
|
33
|
+
},
|
|
34
|
+
onMouseleave(evnt) {
|
|
35
|
+
$table.handleTargetLeaveEvent(evnt);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return renderEmptyElement($table);
|
|
42
40
|
}
|
|
43
41
|
function renderCellDragIcon(params) {
|
|
44
42
|
const { $table } = params;
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const {
|
|
48
|
-
const
|
|
43
|
+
const tableProps = $table.props;
|
|
44
|
+
const { dragConfig } = tableProps;
|
|
45
|
+
const { computeRowDragOpts } = $table.getComputeMaps();
|
|
46
|
+
const rowDragOpts = computeRowDragOpts.value;
|
|
47
|
+
const { icon, disabledMethod } = rowDragOpts;
|
|
48
|
+
const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null);
|
|
49
|
+
const isDisabled = rDisabledMethod && rDisabledMethod(params);
|
|
49
50
|
return h('span', {
|
|
50
51
|
key: 'dg',
|
|
51
52
|
class: ['vxe-cell--drag-handle', {
|
|
@@ -59,7 +60,7 @@ function renderCellDragIcon(params) {
|
|
|
59
60
|
onMouseup: $table.handleCellDragMouseupEvent
|
|
60
61
|
}, [
|
|
61
62
|
h('i', {
|
|
62
|
-
class: rowIcon || getIcon().TABLE_DRAG_ROW
|
|
63
|
+
class: icon || (dragConfig ? dragConfig.rowIcon : '') || getIcon().TABLE_DRAG_ROW
|
|
63
64
|
})
|
|
64
65
|
]);
|
|
65
66
|
}
|
|
@@ -67,19 +68,58 @@ function renderCellBaseVNs(params, content) {
|
|
|
67
68
|
const { $table, column, level } = params;
|
|
68
69
|
const { dragSort } = column;
|
|
69
70
|
const tableProps = $table.props;
|
|
70
|
-
const { treeConfig } = tableProps;
|
|
71
|
-
const { computeRowOpts,
|
|
71
|
+
const { treeConfig, dragConfig } = tableProps;
|
|
72
|
+
const { computeRowOpts, computeRowDragOpts } = $table.getComputeMaps();
|
|
72
73
|
const rowOpts = computeRowOpts.value;
|
|
73
|
-
const
|
|
74
|
-
const {
|
|
74
|
+
const rowDragOpts = computeRowDragOpts.value;
|
|
75
|
+
const { showIcon, visibleMethod } = rowDragOpts;
|
|
76
|
+
const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
|
|
75
77
|
const vns = XEUtils.isArray(content) ? content : [content];
|
|
76
|
-
if (dragSort && rowOpts.drag && (showRowIcon && (!
|
|
78
|
+
if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
|
|
77
79
|
if (!treeConfig || !level) {
|
|
78
80
|
vns.unshift(renderCellDragIcon(params));
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
return vns;
|
|
82
84
|
}
|
|
85
|
+
function renderHeaderCellDragIcon(params) {
|
|
86
|
+
const { $table, column } = params;
|
|
87
|
+
const { computeColumnOpts, computeColumnDragOpts } = $table.getComputeMaps();
|
|
88
|
+
const columnOpts = computeColumnOpts.value;
|
|
89
|
+
const columnDragOpts = computeColumnDragOpts.value;
|
|
90
|
+
const { showIcon, icon, visibleMethod, disabledMethod } = columnDragOpts;
|
|
91
|
+
const isDisabled = disabledMethod && disabledMethod(params);
|
|
92
|
+
if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
|
|
93
|
+
if (!(column.fixed || column.parentId)) {
|
|
94
|
+
return h('span', {
|
|
95
|
+
key: 'dg',
|
|
96
|
+
class: ['vxe-cell--drag-handle', {
|
|
97
|
+
'is--disabled': isDisabled
|
|
98
|
+
}],
|
|
99
|
+
onMousedown(evnt) {
|
|
100
|
+
if (!isDisabled) {
|
|
101
|
+
$table.handleHeaderCellDragMousedownEvent(evnt, params);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
onMouseup: $table.handleHeaderCellDragMouseupEvent
|
|
105
|
+
}, [
|
|
106
|
+
h('i', {
|
|
107
|
+
class: icon || getIcon().TABLE_DRAG_COLUMN
|
|
108
|
+
})
|
|
109
|
+
]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return renderEmptyElement($table);
|
|
113
|
+
}
|
|
114
|
+
function renderHeaderCellBaseVNs(params, content) {
|
|
115
|
+
const vns = [
|
|
116
|
+
renderTitlePrefixIcon(params),
|
|
117
|
+
renderHeaderCellDragIcon(params),
|
|
118
|
+
...(XEUtils.isArray(content) ? content : [content]),
|
|
119
|
+
renderTitleSuffixIcon(params)
|
|
120
|
+
];
|
|
121
|
+
return vns;
|
|
122
|
+
}
|
|
83
123
|
function renderTitleContent(params, content) {
|
|
84
124
|
const { $table, column } = params;
|
|
85
125
|
const { props, reactData } = $table;
|
|
@@ -243,7 +283,7 @@ export const Cell = {
|
|
|
243
283
|
return createColumn($xeTable, columnOpts, renConfs);
|
|
244
284
|
},
|
|
245
285
|
/**
|
|
246
|
-
*
|
|
286
|
+
* 列头标题
|
|
247
287
|
*/
|
|
248
288
|
renderHeaderTitle(params) {
|
|
249
289
|
const { $table, column } = params;
|
|
@@ -265,7 +305,7 @@ export const Cell = {
|
|
|
265
305
|
return renderTitleContent(params, formatText(column.getTitle(), 1));
|
|
266
306
|
},
|
|
267
307
|
renderDefaultHeader(params) {
|
|
268
|
-
return
|
|
308
|
+
return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params));
|
|
269
309
|
},
|
|
270
310
|
renderDefaultCell(params) {
|
|
271
311
|
const { $table, row, column } = params;
|
|
@@ -377,13 +417,13 @@ export const Cell = {
|
|
|
377
417
|
];
|
|
378
418
|
},
|
|
379
419
|
/**
|
|
380
|
-
*
|
|
420
|
+
* 序号
|
|
381
421
|
*/
|
|
382
422
|
renderSeqHeader(params) {
|
|
383
423
|
const { $table, column } = params;
|
|
384
424
|
const { slots } = column;
|
|
385
425
|
const headerSlot = slots ? slots.header : null;
|
|
386
|
-
return renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : formatText(column.getTitle(), 1));
|
|
426
|
+
return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : formatText(column.getTitle(), 1)));
|
|
387
427
|
},
|
|
388
428
|
renderSeqCell(params) {
|
|
389
429
|
const { $table, column } = params;
|
|
@@ -413,13 +453,13 @@ export const Cell = {
|
|
|
413
453
|
const { slots } = column;
|
|
414
454
|
const headerSlot = slots ? slots.header : null;
|
|
415
455
|
const titleSlot = slots ? slots.title : null;
|
|
416
|
-
return renderTitleContent(params, headerSlot
|
|
456
|
+
return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot
|
|
417
457
|
? $table.callSlot(headerSlot, params)
|
|
418
458
|
: [
|
|
419
459
|
h('span', {
|
|
420
460
|
class: 'vxe-radio--label'
|
|
421
461
|
}, titleSlot ? $table.callSlot(titleSlot, params) : formatText(column.getTitle(), 1))
|
|
422
|
-
]);
|
|
462
|
+
]));
|
|
423
463
|
},
|
|
424
464
|
renderRadioCell(params) {
|
|
425
465
|
const { $table, column, isHidden } = params;
|
|
@@ -499,16 +539,16 @@ export const Cell = {
|
|
|
499
539
|
}
|
|
500
540
|
const checkboxParams = Object.assign(Object.assign({}, params), { checked: isAllCheckboxSelected, disabled: isAllCheckboxDisabled, indeterminate: isAllCheckboxIndeterminate });
|
|
501
541
|
if (headerSlot) {
|
|
502
|
-
return renderTitleContent(checkboxParams, $table.callSlot(headerSlot, checkboxParams));
|
|
542
|
+
return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, $table.callSlot(headerSlot, checkboxParams)));
|
|
503
543
|
}
|
|
504
544
|
if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
|
|
505
|
-
return renderTitleContent(checkboxParams, [
|
|
545
|
+
return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
|
|
506
546
|
h('span', {
|
|
507
547
|
class: 'vxe-checkbox--label'
|
|
508
548
|
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : headerTitle)
|
|
509
|
-
]);
|
|
549
|
+
]));
|
|
510
550
|
}
|
|
511
|
-
return renderTitleContent(checkboxParams, [
|
|
551
|
+
return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
|
|
512
552
|
h('span', Object.assign({ class: ['vxe-cell--checkbox', {
|
|
513
553
|
'is--checked': isAllCheckboxSelected,
|
|
514
554
|
'is--disabled': isAllCheckboxDisabled,
|
|
@@ -524,7 +564,7 @@ export const Cell = {
|
|
|
524
564
|
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : headerTitle)
|
|
525
565
|
]
|
|
526
566
|
: []))
|
|
527
|
-
]);
|
|
567
|
+
]));
|
|
528
568
|
},
|
|
529
569
|
renderCheckboxCell(params) {
|
|
530
570
|
const { $table, row, column, isHidden } = params;
|
|
@@ -736,15 +776,13 @@ export const Cell = {
|
|
|
736
776
|
* 排序和筛选
|
|
737
777
|
*/
|
|
738
778
|
renderSortAndFilterHeader(params) {
|
|
739
|
-
return Cell.
|
|
740
|
-
.concat(Cell.renderSortIcon(params))
|
|
741
|
-
.concat(Cell.renderFilterIcon(params));
|
|
779
|
+
return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params).concat(Cell.renderFilterIcon(params))));
|
|
742
780
|
},
|
|
743
781
|
/**
|
|
744
782
|
* 排序
|
|
745
783
|
*/
|
|
746
784
|
renderSortHeader(params) {
|
|
747
|
-
return Cell.
|
|
785
|
+
return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params)));
|
|
748
786
|
},
|
|
749
787
|
renderSortIcon(params) {
|
|
750
788
|
const { $table, column } = params;
|
|
@@ -786,7 +824,7 @@ export const Cell = {
|
|
|
786
824
|
* 筛选
|
|
787
825
|
*/
|
|
788
826
|
renderFilterHeader(params) {
|
|
789
|
-
return Cell.
|
|
827
|
+
return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderFilterIcon(params)));
|
|
790
828
|
},
|
|
791
829
|
renderFilterIcon(params) {
|
|
792
830
|
const { $table, column, hasFilter } = params;
|
|
@@ -832,22 +870,24 @@ export const Cell = {
|
|
|
832
870
|
isRequired = columnRules.some((rule) => rule.required);
|
|
833
871
|
}
|
|
834
872
|
}
|
|
835
|
-
|
|
836
|
-
|
|
873
|
+
let editIconVNs = [];
|
|
874
|
+
if (isEnableConf(editConfig)) {
|
|
875
|
+
editIconVNs = [
|
|
837
876
|
isRequired && editOpts.showAsterisk
|
|
838
877
|
? h('i', {
|
|
839
878
|
class: 'vxe-cell--required-icon'
|
|
840
879
|
})
|
|
841
|
-
:
|
|
880
|
+
: renderEmptyElement($table),
|
|
842
881
|
isEnableConf(editRender) && editOpts.showIcon
|
|
843
882
|
? h('i', {
|
|
844
883
|
class: ['vxe-cell--edit-icon', editOpts.icon || getIcon().TABLE_EDIT]
|
|
845
884
|
})
|
|
846
|
-
:
|
|
847
|
-
]
|
|
848
|
-
|
|
885
|
+
: renderEmptyElement($table)
|
|
886
|
+
];
|
|
887
|
+
}
|
|
888
|
+
return renderHeaderCellBaseVNs(params, editIconVNs.concat(Cell.renderHeaderTitle(params))
|
|
849
889
|
.concat(sortable ? Cell.renderSortIcon(params) : [])
|
|
850
|
-
.concat(filters ? Cell.renderFilterIcon(params) : []);
|
|
890
|
+
.concat(filters ? Cell.renderFilterIcon(params) : []));
|
|
851
891
|
},
|
|
852
892
|
// 行格编辑模式
|
|
853
893
|
renderRowEdit(params) {
|