vxe-table 4.10.6-beta.8 → 4.10.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 +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +4 -3
- package/es/locale/lang/es-ES.js +2 -1
- 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/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 +4 -3
- 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 +518 -517
- 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/edit/hook.js +7 -7
- package/es/table/module/export/hook.js +97 -62
- package/es/table/module/keyboard/hook.js +63 -27
- package/es/table/src/body.js +128 -81
- package/es/table/src/cell.js +41 -55
- package/es/table/src/column.js +13 -1
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/emits.js +2 -0
- package/es/table/src/footer.js +48 -10
- package/es/table/src/header.js +70 -168
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +884 -426
- package/es/table/src/util.js +77 -62
- package/es/table/style.css +253 -189
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +26 -11
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +253 -189
- 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 +1533 -917
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -3
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -3
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- 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/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 +4 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -3
- 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 +518 -517
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +518 -517
- 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/edit/hook.js +7 -2
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +97 -57
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +71 -28
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +129 -80
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +32 -42
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +13 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +3 -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/footer.js +48 -8
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +54 -181
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/props.js +14 -4
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +935 -417
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +100 -82
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +253 -189
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +26 -11
- 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 +253 -189
- 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 +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +4 -3
- package/packages/locale/lang/es-ES.ts +2 -1
- 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/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 +4 -3
- 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 +518 -517
- 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/edit/hook.ts +7 -7
- package/packages/table/module/export/hook.ts +118 -65
- package/packages/table/module/keyboard/hook.ts +59 -25
- package/packages/table/src/body.ts +148 -91
- package/packages/table/src/cell.ts +41 -63
- package/packages/table/src/column.ts +13 -1
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/emits.ts +5 -1
- package/packages/table/src/footer.ts +51 -11
- package/packages/table/src/header.ts +70 -168
- package/packages/table/src/props.ts +14 -5
- package/packages/table/src/table.ts +890 -428
- package/packages/table/src/util.ts +81 -62
- package/packages/ui/index.ts +25 -10
- package/styles/components/table.scss +319 -271
- package/styles/theme/base.scss +4 -6
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -1
- /package/es/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/es/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
- /package/es/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
- /package/lib/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/lib/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
- /package/lib/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -21,7 +21,7 @@ export default defineComponent({
|
|
|
21
21
|
setup(props) {
|
|
22
22
|
const $xeTable = inject('$xeTable', {});
|
|
23
23
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
24
|
-
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeLeftFixedWidth, computeRightFixedWidth } = $xeTable.getComputeMaps();
|
|
24
|
+
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeLeftFixedWidth, computeRightFixedWidth, computeResizableOpts } = $xeTable.getComputeMaps();
|
|
25
25
|
const refElem = ref();
|
|
26
26
|
const refBodyScroll = ref();
|
|
27
27
|
const refBodyTable = ref();
|
|
@@ -33,10 +33,10 @@ export default defineComponent({
|
|
|
33
33
|
// 滚动、拖动过程中不需要触发
|
|
34
34
|
const isVMScrollProcess = () => {
|
|
35
35
|
const { delayHover } = tableProps;
|
|
36
|
-
const { lastScrollTime,
|
|
37
|
-
return !!(
|
|
36
|
+
const { lastScrollTime, isDragResize } = tableReactData;
|
|
37
|
+
return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + delayHover));
|
|
38
38
|
};
|
|
39
|
-
const renderLine = (params) => {
|
|
39
|
+
const renderLine = (params, cellHeight) => {
|
|
40
40
|
const { row, column } = params;
|
|
41
41
|
const { afterFullData } = tableInternalData;
|
|
42
42
|
const { treeConfig } = tableProps;
|
|
@@ -58,12 +58,14 @@ export default defineComponent({
|
|
|
58
58
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
59
59
|
return [
|
|
60
60
|
h('div', {
|
|
61
|
+
key: 'tl',
|
|
61
62
|
class: 'vxe-tree--line-wrapper'
|
|
62
63
|
}, [
|
|
63
64
|
h('div', {
|
|
64
65
|
class: 'vxe-tree--line',
|
|
65
66
|
style: {
|
|
66
67
|
height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
68
|
+
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
67
69
|
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
68
70
|
}
|
|
69
71
|
})
|
|
@@ -77,26 +79,30 @@ export default defineComponent({
|
|
|
77
79
|
*/
|
|
78
80
|
const renderTdColumn = (seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) => {
|
|
79
81
|
const { fullAllDataRowIdData } = tableInternalData;
|
|
80
|
-
const { columnKey,
|
|
81
|
-
const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad,
|
|
82
|
+
const { columnKey, resizable: allResizable, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
|
|
83
|
+
const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData;
|
|
82
84
|
const { afterFullData, scrollXStore, scrollYStore } = tableInternalData;
|
|
83
85
|
const cellOpts = computeCellOpts.value;
|
|
84
86
|
const validOpts = computeValidOpts.value;
|
|
85
87
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
86
88
|
const editOpts = computeEditOpts.value;
|
|
87
89
|
const tooltipOpts = computeTooltipOpts.value;
|
|
90
|
+
const resizableOpts = computeResizableOpts.value;
|
|
91
|
+
const { isAllColumnDrag, isAllRowDrag } = resizableOpts;
|
|
88
92
|
const rowOpts = computeRowOpts.value;
|
|
89
93
|
const rowDragOpts = computeRowDragOpts.value;
|
|
90
94
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
95
|
+
const customCellHeight = cellOpts.height || rowOpts.height;
|
|
96
|
+
const currCellHeight = customCellHeight || defaultRowHeight;
|
|
91
97
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts;
|
|
92
98
|
const columnOpts = computeColumnOpts.value;
|
|
93
99
|
const mouseOpts = computeMouseOpts.value;
|
|
94
100
|
const areaOpts = computeAreaOpts.value;
|
|
95
101
|
const { selectCellToRow } = areaOpts;
|
|
96
|
-
const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column;
|
|
97
|
-
const { verticalAlign } = cellOpts;
|
|
102
|
+
const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
|
|
103
|
+
const { verticalAlign: allVerticalAlign } = cellOpts;
|
|
98
104
|
const { actived } = editStore;
|
|
99
|
-
const
|
|
105
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
100
106
|
const colid = column.id;
|
|
101
107
|
const renderOpts = editRender || cellRender;
|
|
102
108
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
@@ -106,21 +112,25 @@ export default defineComponent({
|
|
|
106
112
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
107
113
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
108
114
|
const isEdit = isEnableConf(editRender);
|
|
115
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
109
116
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
|
|
110
|
-
const
|
|
117
|
+
const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding;
|
|
118
|
+
const cellOverflow = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
111
119
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
112
120
|
const showTitle = cellOverflow === 'title';
|
|
113
121
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
114
|
-
|
|
115
|
-
const
|
|
122
|
+
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
123
|
+
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
|
|
124
|
+
const isCsHeight = !!customCellHeight;
|
|
125
|
+
const isRsHeight = resizeHeight > 0;
|
|
116
126
|
let isDirty;
|
|
117
127
|
const tdOns = {};
|
|
118
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
119
128
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
129
|
+
const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
|
|
120
130
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
121
131
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline');
|
|
122
|
-
const
|
|
123
|
-
const
|
|
132
|
+
const tdAttrs = { colid };
|
|
133
|
+
const cellParams = {
|
|
124
134
|
$table: $xeTable,
|
|
125
135
|
$grid: $xeTable.xegrid,
|
|
126
136
|
isEdit: false,
|
|
@@ -148,7 +158,7 @@ export default defineComponent({
|
|
|
148
158
|
isRowDragCell = rowDragOpts.trigger === 'row' || (column.dragSort && rowDragOpts.trigger === 'cell');
|
|
149
159
|
}
|
|
150
160
|
if (isRowDragCell) {
|
|
151
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
161
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
152
162
|
}
|
|
153
163
|
// hover 进入事件
|
|
154
164
|
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
@@ -161,9 +171,9 @@ export default defineComponent({
|
|
|
161
171
|
}
|
|
162
172
|
else if (showTooltip || showAllTip) {
|
|
163
173
|
// 如果配置了显示 tooltip
|
|
164
|
-
$xeTable.triggerBodyTooltipEvent(evnt,
|
|
174
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams);
|
|
165
175
|
}
|
|
166
|
-
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget },
|
|
176
|
+
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
167
177
|
};
|
|
168
178
|
}
|
|
169
179
|
// hover 退出事件
|
|
@@ -175,13 +185,13 @@ export default defineComponent({
|
|
|
175
185
|
if (showTooltip || showAllTip) {
|
|
176
186
|
$xeTable.handleTargetLeaveEvent(evnt);
|
|
177
187
|
}
|
|
178
|
-
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget },
|
|
188
|
+
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
179
189
|
};
|
|
180
190
|
}
|
|
181
191
|
// 按下事件处理
|
|
182
192
|
if (isRowDragCell || checkboxOpts.range || mouseConfig) {
|
|
183
193
|
tdOns.onMousedown = (evnt) => {
|
|
184
|
-
$xeTable.triggerCellMousedownEvent(evnt,
|
|
194
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams);
|
|
185
195
|
};
|
|
186
196
|
}
|
|
187
197
|
// 拖拽列事件
|
|
@@ -190,11 +200,11 @@ export default defineComponent({
|
|
|
190
200
|
}
|
|
191
201
|
// 点击事件处理
|
|
192
202
|
tdOns.onClick = (evnt) => {
|
|
193
|
-
$xeTable.triggerCellClickEvent(evnt,
|
|
203
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams);
|
|
194
204
|
};
|
|
195
205
|
// 双击事件处理
|
|
196
206
|
tdOns.onDblclick = (evnt) => {
|
|
197
|
-
$xeTable.triggerCellDblclickEvent(evnt,
|
|
207
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
198
208
|
};
|
|
199
209
|
// 合并行或列
|
|
200
210
|
if (mergeList.length) {
|
|
@@ -205,29 +215,29 @@ export default defineComponent({
|
|
|
205
215
|
return null;
|
|
206
216
|
}
|
|
207
217
|
if (rowspan > 1) {
|
|
208
|
-
|
|
218
|
+
tdAttrs.rowspan = rowspan;
|
|
209
219
|
}
|
|
210
220
|
if (colspan > 1) {
|
|
211
|
-
|
|
221
|
+
tdAttrs.colspan = colspan;
|
|
212
222
|
}
|
|
213
223
|
}
|
|
214
224
|
}
|
|
215
225
|
else if (spanMethod) {
|
|
216
226
|
// 自定义合并行或列的方法
|
|
217
|
-
const { rowspan = 1, colspan = 1 } = spanMethod(
|
|
227
|
+
const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {};
|
|
218
228
|
if (!rowspan || !colspan) {
|
|
219
229
|
return null;
|
|
220
230
|
}
|
|
221
231
|
if (rowspan > 1) {
|
|
222
|
-
|
|
232
|
+
tdAttrs.rowspan = rowspan;
|
|
223
233
|
}
|
|
224
234
|
if (colspan > 1) {
|
|
225
|
-
|
|
235
|
+
tdAttrs.colspan = colspan;
|
|
226
236
|
}
|
|
227
237
|
}
|
|
228
238
|
// 如果被合并不可隐藏
|
|
229
239
|
if (fixedHiddenColumn && mergeList) {
|
|
230
|
-
if (
|
|
240
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
231
241
|
fixedHiddenColumn = false;
|
|
232
242
|
}
|
|
233
243
|
}
|
|
@@ -235,37 +245,73 @@ export default defineComponent({
|
|
|
235
245
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
236
246
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
237
247
|
}
|
|
248
|
+
const isVNAutoHeight = scrollYLoad && !hasEllipsis;
|
|
249
|
+
let cellHeight = currCellHeight;
|
|
250
|
+
const vnHeight = calcCellHeightFlag ? rowRest.height : 0;
|
|
251
|
+
if (resizeHeight) {
|
|
252
|
+
cellHeight = resizeHeight;
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
if (scrollYLoad) {
|
|
256
|
+
if (!hasEllipsis) {
|
|
257
|
+
cellHeight = vnHeight || currCellHeight;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
const isLastColumn = $columnIndex === columns.length - 1;
|
|
262
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
263
|
+
let isVNPreEmptyStatus = false;
|
|
264
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
265
|
+
isVNPreEmptyStatus = true;
|
|
266
|
+
}
|
|
267
|
+
else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
268
|
+
isVNPreEmptyStatus = true;
|
|
269
|
+
}
|
|
270
|
+
const tcStyle = {};
|
|
271
|
+
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
272
|
+
tcStyle.height = `${cellHeight}px`;
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
tcStyle.minHeight = `${cellHeight}px`;
|
|
276
|
+
}
|
|
238
277
|
const tdVNs = [];
|
|
239
|
-
if (fixedHiddenColumn &&
|
|
278
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
240
279
|
tdVNs.push(h('div', {
|
|
280
|
+
key: 'tc',
|
|
241
281
|
class: ['vxe-cell', {
|
|
242
282
|
'c--title': showTitle,
|
|
243
283
|
'c--tooltip': showTooltip,
|
|
244
284
|
'c--ellipsis': showEllipsis
|
|
245
285
|
}],
|
|
246
|
-
style:
|
|
247
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
248
|
-
}
|
|
286
|
+
style: tcStyle
|
|
249
287
|
}));
|
|
250
288
|
}
|
|
251
289
|
else {
|
|
252
290
|
// 渲染单元格
|
|
253
|
-
tdVNs.push(...renderLine(
|
|
291
|
+
tdVNs.push(...renderLine(cellParams, cellHeight), h('div', {
|
|
292
|
+
key: 'tc',
|
|
254
293
|
class: ['vxe-cell', {
|
|
255
294
|
'c--title': showTitle,
|
|
256
295
|
'c--tooltip': showTooltip,
|
|
257
296
|
'c--ellipsis': showEllipsis
|
|
258
297
|
}],
|
|
259
|
-
style:
|
|
260
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
261
|
-
},
|
|
298
|
+
style: tcStyle,
|
|
262
299
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
263
|
-
},
|
|
300
|
+
}, isVNPreEmptyStatus
|
|
301
|
+
? []
|
|
302
|
+
: [
|
|
303
|
+
h('div', {
|
|
304
|
+
colid,
|
|
305
|
+
rowid,
|
|
306
|
+
class: 'vxe-cell--wrapper'
|
|
307
|
+
}, column.renderCell(cellParams))
|
|
308
|
+
]));
|
|
264
309
|
if (showValidTip && errorValidItem) {
|
|
265
310
|
const errRule = errorValidItem.rule;
|
|
266
311
|
const validSlot = slots ? slots.valid : null;
|
|
267
|
-
const validParams = Object.assign(Object.assign(Object.assign({},
|
|
312
|
+
const validParams = Object.assign(Object.assign(Object.assign({}, cellParams), errorValidItem), { rule: errorValidItem });
|
|
268
313
|
tdVNs.push(h('div', {
|
|
314
|
+
key: 'tcv',
|
|
269
315
|
class: ['vxe-cell--valid-error-tip', getPropClass(validOpts.className, validParams)],
|
|
270
316
|
style: errRule && errRule.maxWidth
|
|
271
317
|
? {
|
|
@@ -287,49 +333,49 @@ export default defineComponent({
|
|
|
287
333
|
]));
|
|
288
334
|
}
|
|
289
335
|
}
|
|
290
|
-
let
|
|
291
|
-
const vnHeight = isCalcCellHeight ? rest.height : 0;
|
|
292
|
-
if (hasEllipsis) {
|
|
293
|
-
if (customRHeight) {
|
|
294
|
-
cellHeight = `${customRHeight}px`;
|
|
295
|
-
}
|
|
296
|
-
else if (!isAllOverflow) {
|
|
297
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
|
|
302
|
-
}
|
|
336
|
+
let showAreaRowStatus = false;
|
|
303
337
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
304
|
-
if ((
|
|
338
|
+
if ((!_columnIndex && selectCellToRow === true) ||
|
|
305
339
|
(selectCellToRow === column.field)) {
|
|
306
|
-
|
|
307
|
-
class: 'vxe-cell--area-status'
|
|
308
|
-
}));
|
|
340
|
+
showAreaRowStatus = true;
|
|
309
341
|
}
|
|
310
342
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
343
|
+
if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
|
|
344
|
+
tdVNs.push(h('div', {
|
|
345
|
+
key: 'tcc',
|
|
346
|
+
class: ['vxe-cell--col-resizable', {
|
|
347
|
+
'is--line': !border || border === 'none'
|
|
348
|
+
}],
|
|
349
|
+
onMousedown: (evnt) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
350
|
+
onDblclick: (evnt) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
351
|
+
}));
|
|
316
352
|
}
|
|
317
|
-
|
|
318
|
-
|
|
353
|
+
if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
|
|
354
|
+
tdVNs.push(h('div', {
|
|
355
|
+
key: 'tcr',
|
|
356
|
+
class: 'vxe-cell--row-resizable',
|
|
357
|
+
onMousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
358
|
+
onDblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
359
|
+
}));
|
|
319
360
|
}
|
|
320
361
|
return h('td', Object.assign(Object.assign(Object.assign({ class: [
|
|
321
362
|
'vxe-body--column',
|
|
322
363
|
colid,
|
|
364
|
+
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
|
|
365
|
+
cellAlign ? `col--${cellAlign}` : '',
|
|
366
|
+
type ? `col--${type}` : '',
|
|
323
367
|
{
|
|
324
|
-
[`col--${cellAlign}`]: cellAlign,
|
|
325
|
-
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
326
|
-
[`col--${type}`]: type,
|
|
327
368
|
'col--last': isLastColumn,
|
|
328
369
|
'col--tree-node': treeNode,
|
|
329
370
|
'col--edit': isEdit,
|
|
330
371
|
'col--ellipsis': hasEllipsis,
|
|
372
|
+
'col--cs-height': isCsHeight,
|
|
373
|
+
'col--rs-height': isRsHeight,
|
|
374
|
+
'col--to-row': showAreaRowStatus,
|
|
375
|
+
'col--auto-height': isVNAutoHeight,
|
|
331
376
|
'fixed--width': !isAutoCellWidth,
|
|
332
377
|
'fixed--hidden': fixedHiddenColumn,
|
|
378
|
+
'is--padding': isCellPadding,
|
|
333
379
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
334
380
|
'is--drag-disabled': isDisabledDrag,
|
|
335
381
|
'col--dirty': isDirty,
|
|
@@ -337,16 +383,14 @@ export default defineComponent({
|
|
|
337
383
|
'col--valid-error': !!errorValidItem,
|
|
338
384
|
'col--current': currentColumn === column
|
|
339
385
|
},
|
|
340
|
-
getPropClass(compCellClassName,
|
|
341
|
-
getPropClass(className,
|
|
342
|
-
getPropClass(allCellClassName,
|
|
343
|
-
], key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex },
|
|
344
|
-
height: cellHeight
|
|
345
|
-
}, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle) }), tdOns), isPreLoadStatus || (isOptimizeMode && fixedHiddenColumn) ? [] : tdVNs);
|
|
386
|
+
getPropClass(compCellClassName, cellParams),
|
|
387
|
+
getPropClass(className, cellParams),
|
|
388
|
+
getPropClass(allCellClassName, cellParams)
|
|
389
|
+
], key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex }, tdAttrs), { style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle) }), tdOns), isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
|
|
346
390
|
};
|
|
347
391
|
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
348
|
-
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle,
|
|
349
|
-
const { hasFixedColumn, treeExpandedMaps, scrollXLoad, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
|
|
392
|
+
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
393
|
+
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
|
|
350
394
|
const { fullAllDataRowIdData } = tableInternalData;
|
|
351
395
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
352
396
|
const radioOpts = computeRadioOpts.value;
|
|
@@ -431,7 +475,7 @@ export default defineComponent({
|
|
|
431
475
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
432
476
|
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
433
477
|
});
|
|
434
|
-
rows.push(columnOpts.drag && columnDragOpts.animation
|
|
478
|
+
rows.push(!isColLoading && (columnOpts.drag && columnDragOpts.animation)
|
|
435
479
|
? 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 || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex }, trOn), {
|
|
436
480
|
default: () => tdVNs
|
|
437
481
|
})
|
|
@@ -448,7 +492,7 @@ export default defineComponent({
|
|
|
448
492
|
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
|
|
449
493
|
}
|
|
450
494
|
const { showOverflow } = expandColumn;
|
|
451
|
-
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ?
|
|
495
|
+
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
|
|
452
496
|
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
453
497
|
rows.push(h('tr', Object.assign({ class: ['vxe-body--expanded-row', {
|
|
454
498
|
'is--padding': padding
|
|
@@ -511,8 +555,8 @@ export default defineComponent({
|
|
|
511
555
|
const renderVN = () => {
|
|
512
556
|
const { slots } = tableContext;
|
|
513
557
|
const { fixedColumn, fixedType, tableColumn } = props;
|
|
514
|
-
const {
|
|
515
|
-
const { isGroup, tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData;
|
|
558
|
+
const { spanMethod, footerSpanMethod, mouseConfig } = tableProps;
|
|
559
|
+
const { isGroup, tableData, isRowLoading, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData;
|
|
516
560
|
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData;
|
|
517
561
|
const rowOpts = computeRowOpts.value;
|
|
518
562
|
const emptyOpts = computeEmptyOpts.value;
|
|
@@ -524,7 +568,7 @@ export default defineComponent({
|
|
|
524
568
|
let renderColumnList = tableColumn;
|
|
525
569
|
let isOptimizeMode = false;
|
|
526
570
|
// 如果是使用优化模式
|
|
527
|
-
if (scrollXLoad || scrollYLoad ||
|
|
571
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
528
572
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
529
573
|
// 如果不支持优化模式
|
|
530
574
|
}
|
|
@@ -645,9 +689,9 @@ export default defineComponent({
|
|
|
645
689
|
});
|
|
646
690
|
})),
|
|
647
691
|
/**
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
rowOpts.drag && rowDragOpts.animation
|
|
692
|
+
* 内容
|
|
693
|
+
*/
|
|
694
|
+
!(isRowLoading || isColLoading) && (rowOpts.drag && rowDragOpts.animation)
|
|
651
695
|
? h(TransitionGroup, {
|
|
652
696
|
ref: refBodyTBody,
|
|
653
697
|
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
@@ -691,6 +735,9 @@ export default defineComponent({
|
|
|
691
735
|
}),
|
|
692
736
|
h('span', {
|
|
693
737
|
class: 'vxe-table--cell-active-area'
|
|
738
|
+
}),
|
|
739
|
+
h('span', {
|
|
740
|
+
class: 'vxe-table--cell-row-status-area'
|
|
694
741
|
})
|
|
695
742
|
])
|
|
696
743
|
: renderEmptyElement($xeTable),
|
package/es/table/src/cell.js
CHANGED
|
@@ -152,7 +152,7 @@ function renderTitleContent(params, content) {
|
|
|
152
152
|
const ons = {};
|
|
153
153
|
if (showTitle || showTooltip || showAllTip) {
|
|
154
154
|
ons.onMouseenter = (evnt) => {
|
|
155
|
-
if (tableReactData.
|
|
155
|
+
if (tableReactData.isDragResize) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
if (showTitle) {
|
|
@@ -165,7 +165,7 @@ function renderTitleContent(params, content) {
|
|
|
165
165
|
}
|
|
166
166
|
if (showTooltip || showAllTip) {
|
|
167
167
|
ons.onMouseleave = (evnt) => {
|
|
168
|
-
if (tableReactData.
|
|
168
|
+
if (tableReactData.isDragResize) {
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
171
|
if (showTooltip || showAllTip) {
|
|
@@ -179,18 +179,6 @@ function renderTitleContent(params, content) {
|
|
|
179
179
|
: h('span', Object.assign({ class: 'vxe-cell--title' }, ons), getSlotVNs(content))
|
|
180
180
|
];
|
|
181
181
|
}
|
|
182
|
-
function formatFooterLabel(footerFormatter, params) {
|
|
183
|
-
if (XEUtils.isFunction(footerFormatter)) {
|
|
184
|
-
return `${footerFormatter(params)}`;
|
|
185
|
-
}
|
|
186
|
-
const isArr = XEUtils.isArray(footerFormatter);
|
|
187
|
-
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
|
|
188
|
-
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
189
|
-
if (footerFormatMethod) {
|
|
190
|
-
return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`;
|
|
191
|
-
}
|
|
192
|
-
return '';
|
|
193
|
-
}
|
|
194
182
|
function getFooterContent(params) {
|
|
195
183
|
const { $table, column, _columnIndex, items, row } = params;
|
|
196
184
|
const { slots, editRender, cellRender, footerFormatter } = column;
|
|
@@ -199,42 +187,40 @@ function getFooterContent(params) {
|
|
|
199
187
|
if (footerSlot) {
|
|
200
188
|
return $table.callSlot(footerSlot, params);
|
|
201
189
|
}
|
|
190
|
+
let itemValue = '';
|
|
191
|
+
// 兼容老模式
|
|
192
|
+
if (XEUtils.isArray(items)) {
|
|
193
|
+
itemValue = items[_columnIndex];
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
itemValue = XEUtils.get(row, column.field);
|
|
197
|
+
}
|
|
198
|
+
const footParams = Object.assign(params, {
|
|
199
|
+
itemValue
|
|
200
|
+
});
|
|
201
|
+
if (footerFormatter) {
|
|
202
|
+
if (XEUtils.isFunction(footerFormatter)) {
|
|
203
|
+
return `${footerFormatter(footParams)}`;
|
|
204
|
+
}
|
|
205
|
+
const isArr = XEUtils.isArray(footerFormatter);
|
|
206
|
+
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
|
|
207
|
+
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
208
|
+
if (footerFormatMethod) {
|
|
209
|
+
return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`;
|
|
210
|
+
}
|
|
211
|
+
return '';
|
|
212
|
+
}
|
|
202
213
|
if (renderOpts) {
|
|
203
214
|
const compConf = renderer.get(renderOpts.name);
|
|
204
215
|
if (compConf) {
|
|
205
216
|
const rtFooter = compConf.renderTableFooter || compConf.renderFooter;
|
|
206
217
|
if (rtFooter) {
|
|
207
|
-
return getSlotVNs(rtFooter(renderOpts,
|
|
218
|
+
return getSlotVNs(rtFooter(renderOpts, footParams));
|
|
208
219
|
}
|
|
209
220
|
}
|
|
210
221
|
}
|
|
211
|
-
let itemValue = '';
|
|
212
|
-
// 兼容老模式
|
|
213
|
-
if (XEUtils.isArray(items)) {
|
|
214
|
-
itemValue = items[_columnIndex];
|
|
215
|
-
return [
|
|
216
|
-
footerFormatter
|
|
217
|
-
? formatFooterLabel(footerFormatter, {
|
|
218
|
-
itemValue,
|
|
219
|
-
column,
|
|
220
|
-
row,
|
|
221
|
-
items,
|
|
222
|
-
_columnIndex
|
|
223
|
-
})
|
|
224
|
-
: formatText(itemValue, 1)
|
|
225
|
-
];
|
|
226
|
-
}
|
|
227
|
-
itemValue = XEUtils.get(row, column.field);
|
|
228
222
|
return [
|
|
229
|
-
|
|
230
|
-
? formatFooterLabel(footerFormatter, {
|
|
231
|
-
itemValue,
|
|
232
|
-
column,
|
|
233
|
-
row,
|
|
234
|
-
items,
|
|
235
|
-
_columnIndex
|
|
236
|
-
})
|
|
237
|
-
: formatText(itemValue, 1)
|
|
223
|
+
formatText(itemValue, 1)
|
|
238
224
|
];
|
|
239
225
|
}
|
|
240
226
|
function getDefaultCellLabel(params) {
|
|
@@ -383,11 +369,7 @@ export const Cell = {
|
|
|
383
369
|
return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params));
|
|
384
370
|
},
|
|
385
371
|
renderDefaultFooter(params) {
|
|
386
|
-
return
|
|
387
|
-
h('span', {
|
|
388
|
-
class: 'vxe-cell--item'
|
|
389
|
-
}, getFooterContent(params))
|
|
390
|
-
];
|
|
372
|
+
return getFooterContent(params);
|
|
391
373
|
},
|
|
392
374
|
/**
|
|
393
375
|
* 树节点
|
|
@@ -823,7 +805,7 @@ export const Cell = {
|
|
|
823
805
|
const { $table, column } = params;
|
|
824
806
|
const { computeSortOpts } = $table.getComputeMaps();
|
|
825
807
|
const sortOpts = computeSortOpts.value;
|
|
826
|
-
const { showIcon, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
|
|
808
|
+
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
|
|
827
809
|
const { order } = column;
|
|
828
810
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
829
811
|
return [
|
|
@@ -835,20 +817,24 @@ export const Cell = {
|
|
|
835
817
|
'sort--active': order === 'asc'
|
|
836
818
|
}],
|
|
837
819
|
title: getI18n('vxe.table.sortAsc'),
|
|
838
|
-
onClick
|
|
839
|
-
evnt
|
|
840
|
-
|
|
841
|
-
|
|
820
|
+
onClick: allowBtn
|
|
821
|
+
? (evnt) => {
|
|
822
|
+
evnt.stopPropagation();
|
|
823
|
+
$table.triggerSortEvent(evnt, column, 'asc');
|
|
824
|
+
}
|
|
825
|
+
: undefined
|
|
842
826
|
}),
|
|
843
827
|
h('i', {
|
|
844
828
|
class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
|
|
845
829
|
'sort--active': order === 'desc'
|
|
846
830
|
}],
|
|
847
831
|
title: getI18n('vxe.table.sortDesc'),
|
|
848
|
-
onClick
|
|
849
|
-
evnt
|
|
850
|
-
|
|
851
|
-
|
|
832
|
+
onClick: allowBtn
|
|
833
|
+
? (evnt) => {
|
|
834
|
+
evnt.stopPropagation();
|
|
835
|
+
$table.triggerSortEvent(evnt, column, 'desc');
|
|
836
|
+
}
|
|
837
|
+
: undefined
|
|
852
838
|
})
|
|
853
839
|
])
|
|
854
840
|
];
|
package/es/table/src/column.js
CHANGED
|
@@ -54,6 +54,16 @@ export const columnProps = {
|
|
|
54
54
|
formatter: [Function, Array, String],
|
|
55
55
|
// 格式化表尾显示内容
|
|
56
56
|
footerFormatter: [Function, Array, String],
|
|
57
|
+
// 是否显示间距
|
|
58
|
+
padding: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: null
|
|
61
|
+
},
|
|
62
|
+
// 垂直对齐方式
|
|
63
|
+
verticalAlign: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: null
|
|
66
|
+
},
|
|
57
67
|
// 是否允许排序
|
|
58
68
|
sortable: Boolean,
|
|
59
69
|
// 自定义排序的属性
|
|
@@ -80,8 +90,10 @@ export const columnProps = {
|
|
|
80
90
|
filterRender: Object,
|
|
81
91
|
// 设置为树节点
|
|
82
92
|
treeNode: Boolean,
|
|
83
|
-
//
|
|
93
|
+
// 设置为拖拽排序
|
|
84
94
|
dragSort: Boolean,
|
|
95
|
+
// 设置为行高拖拽
|
|
96
|
+
rowResize: Boolean,
|
|
85
97
|
// 是否可视
|
|
86
98
|
visible: {
|
|
87
99
|
type: Boolean,
|
|
@@ -70,6 +70,8 @@ export class ColumnInfo {
|
|
|
70
70
|
footerClassName: _vm.footerClassName,
|
|
71
71
|
formatter: formatter,
|
|
72
72
|
footerFormatter: _vm.footerFormatter,
|
|
73
|
+
padding: _vm.padding,
|
|
74
|
+
verticalAlign: _vm.verticalAlign,
|
|
73
75
|
sortable: _vm.sortable,
|
|
74
76
|
sortBy: _vm.sortBy,
|
|
75
77
|
sortType: _vm.sortType,
|
|
@@ -81,6 +83,7 @@ export class ColumnInfo {
|
|
|
81
83
|
filterRender: _vm.filterRender,
|
|
82
84
|
treeNode: _vm.treeNode,
|
|
83
85
|
dragSort: _vm.dragSort,
|
|
86
|
+
rowResize: _vm.rowResize,
|
|
84
87
|
cellType: _vm.cellType,
|
|
85
88
|
cellRender: _vm.cellRender,
|
|
86
89
|
editRender: _vm.editRender,
|