vxe-table 3.12.10-beta.9 → 3.12.11
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/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/mixin.js +7 -7
- package/es/table/module/export/mixin.js +105 -69
- package/es/table/module/keyboard/mixin.js +68 -25
- package/es/table/module/menu/mixin.js +3 -1
- package/es/table/src/body.js +114 -87
- package/es/table/src/cell.js +43 -57
- package/es/table/src/column.js +43 -8
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/footer.js +47 -6
- package/es/table/src/header.js +67 -165
- package/es/table/src/methods.js +962 -480
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +114 -33
- package/es/table/src/util.js +74 -58
- package/es/table/style.css +246 -191
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +20 -6
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +246 -191
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1725 -1022
- 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-CHT.umd.js +2 -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/mixin.js +7 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +105 -64
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +73 -27
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +3 -1
- package/lib/table/src/body.js +114 -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 +12 -0
- 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/footer.js +43 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +49 -172
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1072 -538
- package/lib/table/src/methods.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 +113 -36
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +88 -71
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +246 -191
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +20 -6
- 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 +246 -191
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- 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/mixin.ts +7 -7
- package/packages/table/module/export/mixin.ts +138 -80
- package/packages/table/module/keyboard/mixin.ts +65 -24
- package/packages/table/module/menu/mixin.ts +4 -1
- package/packages/table/src/body.ts +126 -90
- package/packages/table/src/cell.ts +45 -67
- package/packages/table/src/column.ts +48 -10
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/footer.ts +50 -7
- package/packages/table/src/header.ts +67 -166
- package/packages/table/src/methods.ts +1007 -492
- package/packages/table/src/props.ts +16 -6
- package/packages/table/src/table.ts +124 -33
- package/packages/table/src/util.ts +83 -63
- package/packages/ui/index.ts +19 -5
- package/styles/components/table.scss +313 -274
- 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 -0
- /package/es/{iconfont.1736854649055.ttf → iconfont.1739008141486.ttf} +0 -0
- /package/es/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
- /package/es/{iconfont.1736854649055.woff2 → iconfont.1739008141486.woff2} +0 -0
- /package/lib/{iconfont.1736854649055.ttf → iconfont.1739008141486.ttf} +0 -0
- /package/lib/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
- /package/lib/{iconfont.1736854649055.woff2 → iconfont.1739008141486.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -11,10 +11,10 @@ const isVMScrollProcess = ($xeTable) => {
|
|
|
11
11
|
const tableProps = $xeTable;
|
|
12
12
|
const tableReactData = $xeTable;
|
|
13
13
|
const { delayHover } = tableProps;
|
|
14
|
-
const { lastScrollTime,
|
|
15
|
-
return !!(
|
|
14
|
+
const { lastScrollTime, isDragResize } = tableReactData;
|
|
15
|
+
return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + delayHover));
|
|
16
16
|
};
|
|
17
|
-
function renderLine(h, _vm, params) {
|
|
17
|
+
function renderLine(h, _vm, params, cellHeight) {
|
|
18
18
|
const $xeTable = _vm.$parent;
|
|
19
19
|
const tableProps = $xeTable;
|
|
20
20
|
const tableInternalData = $xeTable;
|
|
@@ -39,12 +39,14 @@ function renderLine(h, _vm, params) {
|
|
|
39
39
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
40
40
|
return [
|
|
41
41
|
h('div', {
|
|
42
|
+
key: 'tl',
|
|
42
43
|
class: 'vxe-tree--line-wrapper'
|
|
43
44
|
}, [
|
|
44
45
|
h('div', {
|
|
45
46
|
class: 'vxe-tree--line',
|
|
46
47
|
style: {
|
|
47
48
|
height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
49
|
+
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
48
50
|
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
49
51
|
}
|
|
50
52
|
})
|
|
@@ -62,26 +64,28 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
62
64
|
const tableReactData = $xeTable;
|
|
63
65
|
const tableInternalData = $xeTable;
|
|
64
66
|
const { fullAllDataRowIdData } = tableInternalData;
|
|
65
|
-
const { columnKey,
|
|
66
|
-
const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad,
|
|
67
|
+
const { columnKey, resizable: allResizable, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
|
|
68
|
+
const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData;
|
|
67
69
|
const { afterFullData, scrollXStore, scrollYStore } = tableInternalData;
|
|
68
70
|
const cellOpts = $xeTable.computeCellOpts;
|
|
69
71
|
const validOpts = $xeTable.computeValidOpts;
|
|
70
72
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
71
73
|
const editOpts = $xeTable.computeEditOpts;
|
|
72
74
|
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
75
|
+
const { isAllColumnDrag, isAllRowDrag } = $xeTable.resizableOpts;
|
|
73
76
|
const rowOpts = $xeTable.computeRowOpts;
|
|
74
77
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
75
78
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
79
|
+
const customCellHeight = cellOpts.height || rowOpts.height;
|
|
76
80
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts;
|
|
77
81
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
78
82
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
79
83
|
const areaOpts = $xeTable.computeAreaOpts;
|
|
80
84
|
const { selectCellToRow } = areaOpts;
|
|
81
|
-
const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column;
|
|
82
|
-
const { verticalAlign } = cellOpts;
|
|
85
|
+
const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
|
|
86
|
+
const { verticalAlign: allVerticalAlign } = cellOpts;
|
|
83
87
|
const { actived } = editStore;
|
|
84
|
-
const
|
|
88
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
85
89
|
const colid = column.id;
|
|
86
90
|
const renderOpts = editRender || cellRender;
|
|
87
91
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
@@ -91,21 +95,25 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
91
95
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
92
96
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
93
97
|
const isEdit = isEnableConf(editRender);
|
|
98
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
94
99
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
|
|
95
|
-
const
|
|
100
|
+
const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding;
|
|
101
|
+
const cellOverflow = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
96
102
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
97
103
|
const showTitle = cellOverflow === 'title';
|
|
98
104
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
99
|
-
|
|
100
|
-
const
|
|
105
|
+
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
106
|
+
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
|
|
107
|
+
const isCsHeight = !!customCellHeight;
|
|
108
|
+
const isRsHeight = resizeHeight > 0;
|
|
101
109
|
let isDirty;
|
|
102
110
|
const tdOns = {};
|
|
103
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
104
111
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
112
|
+
const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
|
|
105
113
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
106
114
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline');
|
|
107
|
-
const
|
|
108
|
-
const
|
|
115
|
+
const tdAttrs = { colid };
|
|
116
|
+
const cellParams = {
|
|
109
117
|
$table: $xeTable,
|
|
110
118
|
$grid: $xeTable.xegrid,
|
|
111
119
|
isEdit: false,
|
|
@@ -133,7 +141,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
133
141
|
isRowDragCell = rowDragOpts.trigger === 'row' || (column.dragSort && rowDragOpts.trigger === 'cell');
|
|
134
142
|
}
|
|
135
143
|
if (isRowDragCell) {
|
|
136
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
144
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
137
145
|
}
|
|
138
146
|
// hover 进入事件
|
|
139
147
|
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
@@ -146,9 +154,9 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
146
154
|
}
|
|
147
155
|
else if (showTooltip || showAllTip) {
|
|
148
156
|
// 如果配置了显示 tooltip
|
|
149
|
-
$xeTable.triggerBodyTooltipEvent(evnt,
|
|
157
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams);
|
|
150
158
|
}
|
|
151
|
-
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget },
|
|
159
|
+
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
152
160
|
};
|
|
153
161
|
}
|
|
154
162
|
// hover 退出事件
|
|
@@ -160,13 +168,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
160
168
|
if (showTooltip || showAllTip) {
|
|
161
169
|
$xeTable.handleTargetLeaveEvent(evnt);
|
|
162
170
|
}
|
|
163
|
-
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget },
|
|
171
|
+
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
164
172
|
};
|
|
165
173
|
}
|
|
166
174
|
// 按下事件处理
|
|
167
175
|
if (isRowDragCell || checkboxOpts.range || mouseConfig) {
|
|
168
176
|
tdOns.mousedown = (evnt) => {
|
|
169
|
-
$xeTable.triggerCellMousedownEvent(evnt,
|
|
177
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams);
|
|
170
178
|
};
|
|
171
179
|
}
|
|
172
180
|
// 拖拽列事件
|
|
@@ -175,11 +183,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
175
183
|
}
|
|
176
184
|
// 点击事件处理
|
|
177
185
|
tdOns.click = (evnt) => {
|
|
178
|
-
$xeTable.triggerCellClickEvent(evnt,
|
|
186
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams);
|
|
179
187
|
};
|
|
180
188
|
// 双击事件处理
|
|
181
189
|
tdOns.dblclick = (evnt) => {
|
|
182
|
-
$xeTable.triggerCellDblclickEvent(evnt,
|
|
190
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
183
191
|
};
|
|
184
192
|
// 合并行或列
|
|
185
193
|
if (mergeList.length) {
|
|
@@ -190,29 +198,29 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
190
198
|
return null;
|
|
191
199
|
}
|
|
192
200
|
if (rowspan > 1) {
|
|
193
|
-
|
|
201
|
+
tdAttrs.rowspan = rowspan;
|
|
194
202
|
}
|
|
195
203
|
if (colspan > 1) {
|
|
196
|
-
|
|
204
|
+
tdAttrs.colspan = colspan;
|
|
197
205
|
}
|
|
198
206
|
}
|
|
199
207
|
}
|
|
200
208
|
else if (spanMethod) {
|
|
201
209
|
// 自定义合并行或列的方法
|
|
202
|
-
const { rowspan = 1, colspan = 1 } = spanMethod(
|
|
210
|
+
const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {};
|
|
203
211
|
if (!rowspan || !colspan) {
|
|
204
212
|
return null;
|
|
205
213
|
}
|
|
206
214
|
if (rowspan > 1) {
|
|
207
|
-
|
|
215
|
+
tdAttrs.rowspan = rowspan;
|
|
208
216
|
}
|
|
209
217
|
if (colspan > 1) {
|
|
210
|
-
|
|
218
|
+
tdAttrs.colspan = colspan;
|
|
211
219
|
}
|
|
212
220
|
}
|
|
213
221
|
// 如果被合并不可隐藏
|
|
214
222
|
if (fixedHiddenColumn && mergeList) {
|
|
215
|
-
if (
|
|
223
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
216
224
|
fixedHiddenColumn = false;
|
|
217
225
|
}
|
|
218
226
|
}
|
|
@@ -221,31 +229,27 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
221
229
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
222
230
|
}
|
|
223
231
|
const isVNAutoHeight = scrollYLoad && !hasEllipsis;
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
else if (!isAllOverflow) {
|
|
231
|
-
cellHeight = vnHeight || defaultRowHeight || 18;
|
|
232
|
-
}
|
|
232
|
+
const cellHeight = calcCellHeightFlag ? (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight) : defaultRowHeight;
|
|
233
|
+
const isLastColumn = $columnIndex === columns.length - 1;
|
|
234
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
235
|
+
let isVNPreEmptyStatus = false;
|
|
236
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
237
|
+
isVNPreEmptyStatus = true;
|
|
233
238
|
}
|
|
234
|
-
else {
|
|
235
|
-
|
|
239
|
+
else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
240
|
+
isVNPreEmptyStatus = true;
|
|
236
241
|
}
|
|
237
242
|
const tcStyle = {};
|
|
238
|
-
if (
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
tcStyle.height = `${cellHeight}px`;
|
|
244
|
-
}
|
|
243
|
+
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
244
|
+
tcStyle.height = `${cellHeight}px`;
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
tcStyle.minHeight = `${cellHeight}px`;
|
|
245
248
|
}
|
|
246
249
|
const tdVNs = [];
|
|
247
|
-
if (fixedHiddenColumn &&
|
|
250
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
248
251
|
tdVNs.push(h('div', {
|
|
252
|
+
key: 'tc',
|
|
249
253
|
class: ['vxe-cell', {
|
|
250
254
|
'c--title': showTitle,
|
|
251
255
|
'c--tooltip': showTooltip,
|
|
@@ -256,7 +260,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
256
260
|
}
|
|
257
261
|
else {
|
|
258
262
|
// 渲染单元格
|
|
259
|
-
tdVNs.push(...renderLine(h, _vm,
|
|
263
|
+
tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
|
|
264
|
+
key: 'tc',
|
|
260
265
|
class: ['vxe-cell', {
|
|
261
266
|
'c--title': showTitle,
|
|
262
267
|
'c--tooltip': showTooltip,
|
|
@@ -266,18 +271,23 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
266
271
|
attrs: {
|
|
267
272
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
268
273
|
}
|
|
269
|
-
},
|
|
270
|
-
? [
|
|
274
|
+
}, isVNPreEmptyStatus
|
|
275
|
+
? []
|
|
276
|
+
: [
|
|
271
277
|
h('div', {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
278
|
+
attrs: {
|
|
279
|
+
colid,
|
|
280
|
+
rowid
|
|
281
|
+
},
|
|
282
|
+
class: 'vxe-cell--wrapper'
|
|
283
|
+
}, column.renderCell(h, cellParams))
|
|
284
|
+
]));
|
|
276
285
|
if (showValidTip && errorValidItem) {
|
|
277
286
|
const errRule = errorValidItem.rule;
|
|
278
287
|
const validSlot = slots ? slots.valid : null;
|
|
279
|
-
const validParams = Object.assign(Object.assign(Object.assign({},
|
|
288
|
+
const validParams = Object.assign(Object.assign(Object.assign({}, cellParams), errorValidItem), { rule: errorValidItem });
|
|
280
289
|
tdVNs.push(h('div', {
|
|
290
|
+
key: 'tcv',
|
|
281
291
|
class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
|
|
282
292
|
style: errRule && errRule.maxWidth
|
|
283
293
|
? {
|
|
@@ -299,38 +309,54 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
299
309
|
]));
|
|
300
310
|
}
|
|
301
311
|
}
|
|
312
|
+
let showAreaRowStatus = false;
|
|
302
313
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
303
|
-
if ((
|
|
314
|
+
if ((!_columnIndex && selectCellToRow === true) ||
|
|
304
315
|
(selectCellToRow === column.field)) {
|
|
305
|
-
|
|
306
|
-
class: 'vxe-cell--area-status'
|
|
307
|
-
}));
|
|
316
|
+
showAreaRowStatus = true;
|
|
308
317
|
}
|
|
309
318
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
319
|
+
if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
|
|
320
|
+
tdVNs.push(h('div', {
|
|
321
|
+
key: 'tcc',
|
|
322
|
+
class: ['vxe-cell--col-resizable', {
|
|
323
|
+
'is--line': !border || border === 'none'
|
|
324
|
+
}],
|
|
325
|
+
on: {
|
|
326
|
+
mousedown: (evnt) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
327
|
+
dblclick: (evnt) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
328
|
+
}
|
|
329
|
+
}));
|
|
315
330
|
}
|
|
316
|
-
|
|
317
|
-
|
|
331
|
+
if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
|
|
332
|
+
tdVNs.push(h('div', {
|
|
333
|
+
key: 'tcr',
|
|
334
|
+
class: 'vxe-cell--row-resizable',
|
|
335
|
+
on: {
|
|
336
|
+
mousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
337
|
+
dblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
338
|
+
}
|
|
339
|
+
}));
|
|
318
340
|
}
|
|
319
341
|
return h('td', {
|
|
320
342
|
class: [
|
|
321
343
|
'vxe-body--column',
|
|
322
|
-
|
|
344
|
+
colid,
|
|
345
|
+
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
|
|
346
|
+
cellAlign ? `col--${cellAlign}` : '',
|
|
347
|
+
type ? `col--${type}` : '',
|
|
323
348
|
{
|
|
324
|
-
[`col--${cellAlign}`]: cellAlign,
|
|
325
|
-
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
326
|
-
[`col--${type}`]: type,
|
|
327
349
|
'col--last': isLastColumn,
|
|
328
350
|
'col--tree-node': treeNode,
|
|
329
351
|
'col--edit': isEdit,
|
|
330
352
|
'col--ellipsis': hasEllipsis,
|
|
353
|
+
'col--cs-height': isCsHeight,
|
|
354
|
+
'col--rs-height': isRsHeight,
|
|
355
|
+
'col--to-row': showAreaRowStatus,
|
|
331
356
|
'col--auto-height': isVNAutoHeight,
|
|
332
357
|
'fixed--width': !isAutoCellWidth,
|
|
333
358
|
'fixed--hidden': fixedHiddenColumn,
|
|
359
|
+
'is--padding': isCellPadding,
|
|
334
360
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
335
361
|
'is--drag-disabled': isDisabledDrag,
|
|
336
362
|
'col--dirty': isDirty,
|
|
@@ -338,25 +364,23 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
338
364
|
'col--valid-error': !!errorValidItem,
|
|
339
365
|
'col--current': currentColumn === column
|
|
340
366
|
},
|
|
341
|
-
getClass(compCellClassName,
|
|
342
|
-
getClass(className,
|
|
343
|
-
getClass(allCellClassName,
|
|
367
|
+
getClass(compCellClassName, cellParams),
|
|
368
|
+
getClass(className, cellParams),
|
|
369
|
+
getClass(allCellClassName, cellParams)
|
|
344
370
|
],
|
|
345
371
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
|
|
346
|
-
attrs,
|
|
347
|
-
style: Object.assign({
|
|
348
|
-
height: cellHeight ? `${cellHeight}px` : ''
|
|
349
|
-
}, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
|
|
372
|
+
attrs: tdAttrs,
|
|
373
|
+
style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
|
|
350
374
|
on: tdOns
|
|
351
|
-
},
|
|
375
|
+
}, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
|
|
352
376
|
}
|
|
353
377
|
function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
354
378
|
const $xeTable = _vm.$parent;
|
|
355
379
|
const tableProps = $xeTable;
|
|
356
380
|
const tableReactData = $xeTable;
|
|
357
381
|
const tableInternalData = $xeTable;
|
|
358
|
-
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle,
|
|
359
|
-
const { hasFixedColumn, treeExpandedMaps, scrollXLoad, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
|
|
382
|
+
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
383
|
+
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
|
|
360
384
|
const { fullAllDataRowIdData } = tableInternalData;
|
|
361
385
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
362
386
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
@@ -442,7 +466,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
442
466
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
443
467
|
return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
444
468
|
});
|
|
445
|
-
rows.push(columnOpts.drag && columnDragOpts.animation
|
|
469
|
+
rows.push(!isColLoading && (columnOpts.drag && columnDragOpts.animation)
|
|
446
470
|
? h('transition-group', {
|
|
447
471
|
props: {
|
|
448
472
|
tag: 'tr',
|
|
@@ -477,7 +501,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
477
501
|
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
|
|
478
502
|
}
|
|
479
503
|
const { showOverflow } = expandColumn;
|
|
480
|
-
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ?
|
|
504
|
+
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
|
|
481
505
|
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
482
506
|
rows.push(h('tr', {
|
|
483
507
|
class: ['vxe-body--expanded-row', {
|
|
@@ -568,8 +592,8 @@ export default {
|
|
|
568
592
|
const tableInternalData = $xeTable;
|
|
569
593
|
const { xID, $scopedSlots } = $xeTable;
|
|
570
594
|
const { fixedColumn, fixedType, tableColumn } = props;
|
|
571
|
-
const {
|
|
572
|
-
const { isGroup, tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData;
|
|
595
|
+
const { spanMethod, footerSpanMethod, mouseConfig } = tableProps;
|
|
596
|
+
const { isGroup, tableData, isRowLoading, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData;
|
|
573
597
|
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData;
|
|
574
598
|
const rowOpts = $xeTable.computeRowOpts;
|
|
575
599
|
const emptyOpts = $xeTable.computeEmptyOpts;
|
|
@@ -581,7 +605,7 @@ export default {
|
|
|
581
605
|
let renderColumnList = tableColumn;
|
|
582
606
|
let isOptimizeMode = false;
|
|
583
607
|
// 如果是使用优化模式
|
|
584
|
-
if (scrollXLoad || scrollYLoad ||
|
|
608
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
585
609
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
586
610
|
// 如果不支持优化模式
|
|
587
611
|
}
|
|
@@ -711,9 +735,9 @@ export default {
|
|
|
711
735
|
});
|
|
712
736
|
})),
|
|
713
737
|
/**
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
rowOpts.drag && rowDragOpts.animation
|
|
738
|
+
* 内容
|
|
739
|
+
*/
|
|
740
|
+
!(isRowLoading || isColLoading) && (rowOpts.drag && rowDragOpts.animation)
|
|
717
741
|
? h('transition-group', {
|
|
718
742
|
ref: 'refBodyTBody',
|
|
719
743
|
props: {
|
|
@@ -759,6 +783,9 @@ export default {
|
|
|
759
783
|
}),
|
|
760
784
|
h('span', {
|
|
761
785
|
class: 'vxe-table--cell-active-area'
|
|
786
|
+
}),
|
|
787
|
+
h('span', {
|
|
788
|
+
class: 'vxe-table--cell-row-status-area'
|
|
762
789
|
})
|
|
763
790
|
])
|
|
764
791
|
: renderEmptyElement($xeTable),
|
package/es/table/src/cell.js
CHANGED
|
@@ -156,7 +156,7 @@ function renderTitleContent(h, params, content) {
|
|
|
156
156
|
const ons = {};
|
|
157
157
|
if (showTitle || showTooltip || showAllTip) {
|
|
158
158
|
ons.mouseenter = (evnt) => {
|
|
159
|
-
if (tableReactData.
|
|
159
|
+
if (tableReactData.isDragResize) {
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
if (showTitle) {
|
|
@@ -169,7 +169,7 @@ function renderTitleContent(h, params, content) {
|
|
|
169
169
|
}
|
|
170
170
|
if (showTooltip || showAllTip) {
|
|
171
171
|
ons.mouseleave = (evnt) => {
|
|
172
|
-
if (tableReactData.
|
|
172
|
+
if (tableReactData.isDragResize) {
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
if (showTooltip || showAllTip) {
|
|
@@ -192,18 +192,6 @@ function renderTitleContent(h, params, content) {
|
|
|
192
192
|
}, getSlotVNs(content))
|
|
193
193
|
];
|
|
194
194
|
}
|
|
195
|
-
function formatFooterLabel(footerFormatter, params) {
|
|
196
|
-
if (XEUtils.isFunction(footerFormatter)) {
|
|
197
|
-
return `${footerFormatter(params)}`;
|
|
198
|
-
}
|
|
199
|
-
const isArr = XEUtils.isArray(footerFormatter);
|
|
200
|
-
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
|
|
201
|
-
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
202
|
-
if (footerFormatMethod) {
|
|
203
|
-
return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`;
|
|
204
|
-
}
|
|
205
|
-
return '';
|
|
206
|
-
}
|
|
207
195
|
function getFooterContent(h, params) {
|
|
208
196
|
const { $table, column, _columnIndex, row, items } = params;
|
|
209
197
|
const { slots, editRender, cellRender, footerFormatter } = column;
|
|
@@ -211,40 +199,38 @@ function getFooterContent(h, params) {
|
|
|
211
199
|
if (slots && slots.footer) {
|
|
212
200
|
return $table.callSlot(slots.footer, params, h);
|
|
213
201
|
}
|
|
202
|
+
let itemValue = '';
|
|
203
|
+
// 兼容老模式
|
|
204
|
+
if (XEUtils.isArray(items)) {
|
|
205
|
+
itemValue = items[_columnIndex];
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
itemValue = XEUtils.get(row, column.field);
|
|
209
|
+
}
|
|
210
|
+
const footParams = Object.assign(params, {
|
|
211
|
+
itemValue
|
|
212
|
+
});
|
|
213
|
+
if (footerFormatter) {
|
|
214
|
+
if (XEUtils.isFunction(footerFormatter)) {
|
|
215
|
+
return `${footerFormatter(footParams)}`;
|
|
216
|
+
}
|
|
217
|
+
const isArr = XEUtils.isArray(footerFormatter);
|
|
218
|
+
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
|
|
219
|
+
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
220
|
+
if (footerFormatMethod) {
|
|
221
|
+
return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`;
|
|
222
|
+
}
|
|
223
|
+
return '';
|
|
224
|
+
}
|
|
214
225
|
if (renderOpts) {
|
|
215
226
|
const compConf = renderer.get(renderOpts.name);
|
|
216
227
|
const rtFooter = compConf ? (compConf.renderTableFooter || compConf.renderFooter) : null;
|
|
217
228
|
if (rtFooter) {
|
|
218
|
-
return getSlotVNs(rtFooter.call($table, h, renderOpts,
|
|
229
|
+
return getSlotVNs(rtFooter.call($table, h, renderOpts, footParams));
|
|
219
230
|
}
|
|
220
231
|
}
|
|
221
|
-
let itemValue = '';
|
|
222
|
-
// 兼容老模式
|
|
223
|
-
if (XEUtils.isArray(items)) {
|
|
224
|
-
itemValue = items[_columnIndex];
|
|
225
|
-
return [
|
|
226
|
-
footerFormatter
|
|
227
|
-
? formatFooterLabel(footerFormatter, {
|
|
228
|
-
itemValue,
|
|
229
|
-
column,
|
|
230
|
-
row,
|
|
231
|
-
items,
|
|
232
|
-
_columnIndex
|
|
233
|
-
})
|
|
234
|
-
: formatText(itemValue, 1)
|
|
235
|
-
];
|
|
236
|
-
}
|
|
237
|
-
itemValue = XEUtils.get(row, column.field);
|
|
238
232
|
return [
|
|
239
|
-
|
|
240
|
-
? formatFooterLabel(footerFormatter, {
|
|
241
|
-
itemValue,
|
|
242
|
-
column,
|
|
243
|
-
row,
|
|
244
|
-
items,
|
|
245
|
-
_columnIndex
|
|
246
|
-
})
|
|
247
|
-
: formatText(itemValue, 1)
|
|
233
|
+
formatText(itemValue, 1)
|
|
248
234
|
];
|
|
249
235
|
}
|
|
250
236
|
function getDefaultCellLabel(params) {
|
|
@@ -386,11 +372,7 @@ export const Cell = {
|
|
|
386
372
|
return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
|
|
387
373
|
},
|
|
388
374
|
renderDefaultFooter(h, params) {
|
|
389
|
-
return
|
|
390
|
-
h('span', {
|
|
391
|
-
class: 'vxe-cell--item'
|
|
392
|
-
}, getFooterContent(h, params))
|
|
393
|
-
];
|
|
375
|
+
return getFooterContent(h, params);
|
|
394
376
|
},
|
|
395
377
|
/**
|
|
396
378
|
* 树节点
|
|
@@ -834,7 +816,7 @@ export const Cell = {
|
|
|
834
816
|
renderSortIcon(h, params) {
|
|
835
817
|
const { $table, column } = params;
|
|
836
818
|
const sortOpts = $table.computeSortOpts;
|
|
837
|
-
const { showIcon, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
|
|
819
|
+
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
|
|
838
820
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
839
821
|
return [
|
|
840
822
|
h('span', {
|
|
@@ -847,12 +829,14 @@ export const Cell = {
|
|
|
847
829
|
attrs: {
|
|
848
830
|
title: getI18n('vxe.table.sortAsc')
|
|
849
831
|
},
|
|
850
|
-
on:
|
|
851
|
-
|
|
852
|
-
evnt
|
|
853
|
-
|
|
832
|
+
on: allowBtn
|
|
833
|
+
? {
|
|
834
|
+
click(evnt) {
|
|
835
|
+
evnt.stopPropagation();
|
|
836
|
+
$table.triggerSortEvent(evnt, column, 'asc');
|
|
837
|
+
}
|
|
854
838
|
}
|
|
855
|
-
|
|
839
|
+
: undefined
|
|
856
840
|
}),
|
|
857
841
|
h('i', {
|
|
858
842
|
class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
|
|
@@ -861,12 +845,14 @@ export const Cell = {
|
|
|
861
845
|
attrs: {
|
|
862
846
|
title: getI18n('vxe.table.sortDesc')
|
|
863
847
|
},
|
|
864
|
-
on:
|
|
865
|
-
|
|
866
|
-
evnt
|
|
867
|
-
|
|
848
|
+
on: allowBtn
|
|
849
|
+
? {
|
|
850
|
+
click(evnt) {
|
|
851
|
+
evnt.stopPropagation();
|
|
852
|
+
$table.triggerSortEvent(evnt, column, 'desc');
|
|
853
|
+
}
|
|
868
854
|
}
|
|
869
|
-
|
|
855
|
+
: undefined
|
|
870
856
|
})
|
|
871
857
|
])
|
|
872
858
|
];
|