vxe-table 3.10.16 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +5 -1
- package/es/table/module/edit/mixin.js +24 -15
- package/es/table/src/body.js +40 -24
- package/es/table/src/cell.js +75 -32
- package/es/table/src/footer.js +159 -131
- package/es/table/src/header.js +128 -90
- package/es/table/src/methods.js +284 -65
- package/es/table/src/props.js +5 -1
- package/es/table/src/table.js +64 -20
- 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 +906 -449
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +5 -1
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/edit/mixin.js +24 -15
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +31 -15
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +82 -35
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +198 -161
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +169 -128
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +313 -68
- package/lib/table/src/methods.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 +70 -20
- package/lib/table/src/table.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/table/module/custom/mixin.ts +5 -1
- package/packages/table/module/edit/mixin.ts +24 -15
- package/packages/table/src/body.ts +43 -25
- package/packages/table/src/cell.ts +120 -67
- package/packages/table/src/footer.ts +164 -150
- package/packages/table/src/header.ts +136 -90
- package/packages/table/src/methods.ts +296 -67
- package/packages/table/src/props.ts +5 -1
- package/packages/table/src/table.ts +71 -19
- package/packages/ui/index.ts +8 -3
- package/styles/components/table.scss +42 -35
- /package/es/{iconfont.1731633464058.ttf → iconfont.1731890707082.ttf} +0 -0
- /package/es/{iconfont.1731633464058.woff → iconfont.1731890707082.woff} +0 -0
- /package/es/{iconfont.1731633464058.woff2 → iconfont.1731890707082.woff2} +0 -0
- /package/lib/{iconfont.1731633464058.ttf → iconfont.1731890707082.ttf} +0 -0
- /package/lib/{iconfont.1731633464058.woff → iconfont.1731890707082.woff} +0 -0
- /package/lib/{iconfont.1731633464058.woff2 → iconfont.1731890707082.woff2} +0 -0
package/lib/table/src/footer.js
CHANGED
|
@@ -37,6 +37,203 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex) {
|
|
41
|
+
const {
|
|
42
|
+
$parent: $xetable,
|
|
43
|
+
fixedType
|
|
44
|
+
} = _vm;
|
|
45
|
+
const {
|
|
46
|
+
$listeners: tableListeners,
|
|
47
|
+
footerCellClassName,
|
|
48
|
+
footerCellStyle,
|
|
49
|
+
footerAlign: allFooterAlign,
|
|
50
|
+
mergeFooterList,
|
|
51
|
+
footerSpanMethod,
|
|
52
|
+
align: allAlign,
|
|
53
|
+
scrollXLoad,
|
|
54
|
+
columnKey,
|
|
55
|
+
columnOpts,
|
|
56
|
+
showFooterOverflow: allColumnFooterOverflow,
|
|
57
|
+
currentColumn,
|
|
58
|
+
overflowX,
|
|
59
|
+
scrollbarWidth,
|
|
60
|
+
tooltipOpts
|
|
61
|
+
} = $xetable;
|
|
62
|
+
return tableColumn.map((column, $columnIndex) => {
|
|
63
|
+
const {
|
|
64
|
+
type,
|
|
65
|
+
showFooterOverflow,
|
|
66
|
+
footerAlign,
|
|
67
|
+
align,
|
|
68
|
+
footerClassName,
|
|
69
|
+
editRender,
|
|
70
|
+
cellRender
|
|
71
|
+
} = column;
|
|
72
|
+
const renderOpts = editRender || cellRender;
|
|
73
|
+
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
74
|
+
const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
|
|
75
|
+
const isColGroup = column.children && column.children.length;
|
|
76
|
+
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
77
|
+
const footOverflow = _xeUtils.default.isUndefined(showFooterOverflow) || _xeUtils.default.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
78
|
+
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
79
|
+
let showEllipsis = footOverflow === 'ellipsis';
|
|
80
|
+
const showTitle = footOverflow === 'title';
|
|
81
|
+
const showTooltip = footOverflow === true || footOverflow === 'tooltip';
|
|
82
|
+
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
83
|
+
const attrs = {
|
|
84
|
+
colid: column.id
|
|
85
|
+
};
|
|
86
|
+
const tfOns = {};
|
|
87
|
+
const columnIndex = $xetable.getColumnIndex(column);
|
|
88
|
+
const _columnIndex = $xetable.getVTColumnIndex(column);
|
|
89
|
+
const itemIndex = _columnIndex;
|
|
90
|
+
const cellParams = {
|
|
91
|
+
$table: $xetable,
|
|
92
|
+
$grid: $xetable.xegrid,
|
|
93
|
+
row,
|
|
94
|
+
_rowIndex,
|
|
95
|
+
$rowIndex,
|
|
96
|
+
column,
|
|
97
|
+
columnIndex,
|
|
98
|
+
$columnIndex,
|
|
99
|
+
_columnIndex,
|
|
100
|
+
itemIndex,
|
|
101
|
+
items: row,
|
|
102
|
+
fixed: fixedType,
|
|
103
|
+
type: renderType,
|
|
104
|
+
data: footerTableData
|
|
105
|
+
};
|
|
106
|
+
// 虚拟滚动不支持动态高度
|
|
107
|
+
if (scrollXLoad && !hasEllipsis) {
|
|
108
|
+
showEllipsis = hasEllipsis = true;
|
|
109
|
+
}
|
|
110
|
+
if (showTitle || showTooltip || showAllTip) {
|
|
111
|
+
tfOns.mouseenter = evnt => {
|
|
112
|
+
if (showTitle) {
|
|
113
|
+
(0, _dom.updateCellTitle)(evnt.currentTarget, column);
|
|
114
|
+
} else if (showTooltip || showAllTip) {
|
|
115
|
+
$xetable.triggerFooterTooltipEvent(evnt, cellParams);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (showTooltip || showAllTip) {
|
|
120
|
+
tfOns.mouseleave = evnt => {
|
|
121
|
+
if (showTooltip || showAllTip) {
|
|
122
|
+
$xetable.handleTargetLeaveEvent(evnt);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (tableListeners['footer-cell-click']) {
|
|
127
|
+
tfOns.click = evnt => {
|
|
128
|
+
$xetable.emitEvent('footer-cell-click', Object.assign({
|
|
129
|
+
cell: evnt.currentTarget
|
|
130
|
+
}, cellParams), evnt);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (tableListeners['footer-cell-dblclick']) {
|
|
134
|
+
tfOns.dblclick = evnt => {
|
|
135
|
+
$xetable.emitEvent('footer-cell-dblclick', Object.assign({
|
|
136
|
+
cell: evnt.currentTarget
|
|
137
|
+
}, cellParams), evnt);
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// 合并行或列
|
|
141
|
+
if (mergeFooterList.length) {
|
|
142
|
+
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
143
|
+
if (spanRest) {
|
|
144
|
+
const {
|
|
145
|
+
rowspan,
|
|
146
|
+
colspan
|
|
147
|
+
} = spanRest;
|
|
148
|
+
if (!rowspan || !colspan) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
if (rowspan > 1) {
|
|
152
|
+
attrs.rowspan = rowspan;
|
|
153
|
+
}
|
|
154
|
+
if (colspan > 1) {
|
|
155
|
+
attrs.colspan = colspan;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
} else if (footerSpanMethod) {
|
|
159
|
+
// 自定义合并方法
|
|
160
|
+
const {
|
|
161
|
+
rowspan = 1,
|
|
162
|
+
colspan = 1
|
|
163
|
+
} = footerSpanMethod(cellParams) || {};
|
|
164
|
+
if (!rowspan || !colspan) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
if (rowspan > 1) {
|
|
168
|
+
attrs.rowspan = rowspan;
|
|
169
|
+
}
|
|
170
|
+
if (colspan > 1) {
|
|
171
|
+
attrs.colspan = colspan;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return h('td', {
|
|
175
|
+
class: ['vxe-footer--column', column.id, {
|
|
176
|
+
[`col--${footAlign}`]: footAlign,
|
|
177
|
+
[`col--${type}`]: type,
|
|
178
|
+
'col--last': $columnIndex === tableColumn.length - 1,
|
|
179
|
+
'fixed--hidden': fixedHiddenColumn,
|
|
180
|
+
'col--ellipsis': hasEllipsis,
|
|
181
|
+
'col--current': currentColumn === column
|
|
182
|
+
}, (0, _utils.getClass)(footerClassName, cellParams), (0, _utils.getClass)(footerCellClassName, cellParams)],
|
|
183
|
+
attrs,
|
|
184
|
+
style: footerCellStyle ? _xeUtils.default.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle : null,
|
|
185
|
+
on: tfOns,
|
|
186
|
+
key: columnKey || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex
|
|
187
|
+
}, [h('div', {
|
|
188
|
+
class: ['vxe-cell', {
|
|
189
|
+
'c--title': showTitle,
|
|
190
|
+
'c--tooltip': showTooltip,
|
|
191
|
+
'c--ellipsis': showEllipsis
|
|
192
|
+
}]
|
|
193
|
+
}, column.renderFooter(h, cellParams))]);
|
|
194
|
+
}).concat(scrollbarWidth ? [h('td', {
|
|
195
|
+
key: `gr${$rowIndex}`,
|
|
196
|
+
class: 'vxe-footer--gutter col--gutter'
|
|
197
|
+
})] : []);
|
|
198
|
+
}
|
|
199
|
+
function renderHeads(h, _vm, footerTableData) {
|
|
200
|
+
const {
|
|
201
|
+
$parent: $xetable,
|
|
202
|
+
fixedType,
|
|
203
|
+
tableColumn
|
|
204
|
+
} = _vm;
|
|
205
|
+
const {
|
|
206
|
+
footerRowClassName,
|
|
207
|
+
footerRowStyle,
|
|
208
|
+
isDragColMove
|
|
209
|
+
} = $xetable;
|
|
210
|
+
const columnOpts = $xetable.columnOpts;
|
|
211
|
+
return footerTableData.map((row, $rowIndex) => {
|
|
212
|
+
const _rowIndex = $rowIndex;
|
|
213
|
+
const rowParams = {
|
|
214
|
+
$table: $xetable,
|
|
215
|
+
row,
|
|
216
|
+
_rowIndex,
|
|
217
|
+
$rowIndex,
|
|
218
|
+
fixed: fixedType,
|
|
219
|
+
type: renderType
|
|
220
|
+
};
|
|
221
|
+
if (columnOpts.drag) {
|
|
222
|
+
return h('transition-group', {
|
|
223
|
+
props: {
|
|
224
|
+
tag: 'tr',
|
|
225
|
+
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
226
|
+
class: ['vxe-footer--row', footerRowClassName ? _xeUtils.default.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
|
|
227
|
+
style: footerRowStyle ? _xeUtils.default.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
|
|
228
|
+
}
|
|
229
|
+
}, renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex));
|
|
230
|
+
}
|
|
231
|
+
return h('tr', {
|
|
232
|
+
class: ['vxe-footer--row', footerRowClassName ? _xeUtils.default.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
|
|
233
|
+
style: footerRowStyle ? _xeUtils.default.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
|
|
234
|
+
}, renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex));
|
|
235
|
+
});
|
|
236
|
+
}
|
|
40
237
|
var _default = exports.default = {
|
|
41
238
|
name: 'VxeTableFooter',
|
|
42
239
|
props: {
|
|
@@ -88,24 +285,12 @@ var _default = exports.default = {
|
|
|
88
285
|
footerTableData
|
|
89
286
|
} = this;
|
|
90
287
|
const {
|
|
91
|
-
$listeners: tableListeners,
|
|
92
288
|
tId,
|
|
93
|
-
footerRowClassName,
|
|
94
|
-
footerCellClassName,
|
|
95
|
-
footerRowStyle,
|
|
96
|
-
footerCellStyle,
|
|
97
|
-
footerAlign: allFooterAlign,
|
|
98
289
|
mergeFooterList,
|
|
99
290
|
footerSpanMethod,
|
|
100
|
-
align: allAlign,
|
|
101
291
|
scrollXLoad,
|
|
102
|
-
columnKey,
|
|
103
|
-
columnOpts,
|
|
104
292
|
showFooterOverflow: allColumnFooterOverflow,
|
|
105
|
-
currentColumn,
|
|
106
|
-
overflowX,
|
|
107
293
|
scrollbarWidth,
|
|
108
|
-
tooltipOpts,
|
|
109
294
|
visibleColumn,
|
|
110
295
|
expandColumn
|
|
111
296
|
} = $xetable;
|
|
@@ -165,155 +350,7 @@ var _default = exports.default = {
|
|
|
165
350
|
*/
|
|
166
351
|
h('tfoot', {
|
|
167
352
|
ref: 'tfoot'
|
|
168
|
-
},
|
|
169
|
-
const $rowIndex = _rowIndex;
|
|
170
|
-
const rowParams = {
|
|
171
|
-
$table: $xetable,
|
|
172
|
-
row: list,
|
|
173
|
-
_rowIndex,
|
|
174
|
-
$rowIndex,
|
|
175
|
-
fixed: fixedType,
|
|
176
|
-
type: renderType
|
|
177
|
-
};
|
|
178
|
-
return h('tr', {
|
|
179
|
-
class: ['vxe-footer--row', footerRowClassName ? _xeUtils.default.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
|
|
180
|
-
style: footerRowStyle ? _xeUtils.default.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
|
|
181
|
-
}, tableColumn.map((column, $columnIndex) => {
|
|
182
|
-
const {
|
|
183
|
-
type,
|
|
184
|
-
showFooterOverflow,
|
|
185
|
-
footerAlign,
|
|
186
|
-
align,
|
|
187
|
-
footerClassName,
|
|
188
|
-
editRender,
|
|
189
|
-
cellRender
|
|
190
|
-
} = column;
|
|
191
|
-
const renderOpts = editRender || cellRender;
|
|
192
|
-
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
193
|
-
const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
|
|
194
|
-
const isColGroup = column.children && column.children.length;
|
|
195
|
-
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
196
|
-
const footOverflow = _xeUtils.default.isUndefined(showFooterOverflow) || _xeUtils.default.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
197
|
-
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
198
|
-
let showEllipsis = footOverflow === 'ellipsis';
|
|
199
|
-
const showTitle = footOverflow === 'title';
|
|
200
|
-
const showTooltip = footOverflow === true || footOverflow === 'tooltip';
|
|
201
|
-
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
202
|
-
const attrs = {
|
|
203
|
-
colid: column.id
|
|
204
|
-
};
|
|
205
|
-
const tfOns = {};
|
|
206
|
-
const columnIndex = $xetable.getColumnIndex(column);
|
|
207
|
-
const _columnIndex = $xetable.getVTColumnIndex(column);
|
|
208
|
-
const itemIndex = _columnIndex;
|
|
209
|
-
const cellParams = {
|
|
210
|
-
$table: $xetable,
|
|
211
|
-
$grid: $xetable.xegrid,
|
|
212
|
-
row: list,
|
|
213
|
-
_rowIndex,
|
|
214
|
-
$rowIndex,
|
|
215
|
-
column,
|
|
216
|
-
columnIndex,
|
|
217
|
-
$columnIndex,
|
|
218
|
-
_columnIndex,
|
|
219
|
-
itemIndex,
|
|
220
|
-
items: list,
|
|
221
|
-
fixed: fixedType,
|
|
222
|
-
type: renderType,
|
|
223
|
-
data: footerTableData
|
|
224
|
-
};
|
|
225
|
-
// 虚拟滚动不支持动态高度
|
|
226
|
-
if (scrollXLoad && !hasEllipsis) {
|
|
227
|
-
showEllipsis = hasEllipsis = true;
|
|
228
|
-
}
|
|
229
|
-
if (showTitle || showTooltip || showAllTip) {
|
|
230
|
-
tfOns.mouseenter = evnt => {
|
|
231
|
-
if (showTitle) {
|
|
232
|
-
(0, _dom.updateCellTitle)(evnt.currentTarget, column);
|
|
233
|
-
} else if (showTooltip || showAllTip) {
|
|
234
|
-
$xetable.triggerFooterTooltipEvent(evnt, cellParams);
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
if (showTooltip || showAllTip) {
|
|
239
|
-
tfOns.mouseleave = evnt => {
|
|
240
|
-
if (showTooltip || showAllTip) {
|
|
241
|
-
$xetable.handleTargetLeaveEvent(evnt);
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
if (tableListeners['footer-cell-click']) {
|
|
246
|
-
tfOns.click = evnt => {
|
|
247
|
-
$xetable.emitEvent('footer-cell-click', Object.assign({
|
|
248
|
-
cell: evnt.currentTarget
|
|
249
|
-
}, cellParams), evnt);
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
if (tableListeners['footer-cell-dblclick']) {
|
|
253
|
-
tfOns.dblclick = evnt => {
|
|
254
|
-
$xetable.emitEvent('footer-cell-dblclick', Object.assign({
|
|
255
|
-
cell: evnt.currentTarget
|
|
256
|
-
}, cellParams), evnt);
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
// 合并行或列
|
|
260
|
-
if (mergeFooterList.length) {
|
|
261
|
-
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
262
|
-
if (spanRest) {
|
|
263
|
-
const {
|
|
264
|
-
rowspan,
|
|
265
|
-
colspan
|
|
266
|
-
} = spanRest;
|
|
267
|
-
if (!rowspan || !colspan) {
|
|
268
|
-
return null;
|
|
269
|
-
}
|
|
270
|
-
if (rowspan > 1) {
|
|
271
|
-
attrs.rowspan = rowspan;
|
|
272
|
-
}
|
|
273
|
-
if (colspan > 1) {
|
|
274
|
-
attrs.colspan = colspan;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
} else if (footerSpanMethod) {
|
|
278
|
-
// 自定义合并方法
|
|
279
|
-
const {
|
|
280
|
-
rowspan = 1,
|
|
281
|
-
colspan = 1
|
|
282
|
-
} = footerSpanMethod(cellParams) || {};
|
|
283
|
-
if (!rowspan || !colspan) {
|
|
284
|
-
return null;
|
|
285
|
-
}
|
|
286
|
-
if (rowspan > 1) {
|
|
287
|
-
attrs.rowspan = rowspan;
|
|
288
|
-
}
|
|
289
|
-
if (colspan > 1) {
|
|
290
|
-
attrs.colspan = colspan;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return h('td', {
|
|
294
|
-
class: ['vxe-footer--column', column.id, {
|
|
295
|
-
[`col--${footAlign}`]: footAlign,
|
|
296
|
-
[`col--${type}`]: type,
|
|
297
|
-
'col--last': $columnIndex === tableColumn.length - 1,
|
|
298
|
-
'fixed--hidden': fixedHiddenColumn,
|
|
299
|
-
'col--ellipsis': hasEllipsis,
|
|
300
|
-
'col--current': currentColumn === column
|
|
301
|
-
}, (0, _utils.getClass)(footerClassName, cellParams), (0, _utils.getClass)(footerCellClassName, cellParams)],
|
|
302
|
-
attrs,
|
|
303
|
-
style: footerCellStyle ? _xeUtils.default.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle : null,
|
|
304
|
-
on: tfOns,
|
|
305
|
-
key: columnKey || columnOpts.useKey ? column.id : $columnIndex
|
|
306
|
-
}, [h('div', {
|
|
307
|
-
class: ['vxe-cell', {
|
|
308
|
-
'c--title': showTitle,
|
|
309
|
-
'c--tooltip': showTooltip,
|
|
310
|
-
'c--ellipsis': showEllipsis
|
|
311
|
-
}]
|
|
312
|
-
}, column.renderFooter(h, cellParams))]);
|
|
313
|
-
}).concat(scrollbarWidth ? [h('td', {
|
|
314
|
-
class: 'vxe-footer--gutter col--gutter'
|
|
315
|
-
})] : []));
|
|
316
|
-
}))])]);
|
|
353
|
+
}, renderHeads(h, this, footerTableData))])]);
|
|
317
354
|
},
|
|
318
355
|
methods: {
|
|
319
356
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let renderType="footer",renderer=_ui.VxeUI.renderer;function mergeFooterMethod(l,t,r){for(let e=0;e<l.length;e++){var{row:o,col:n,rowspan:a,colspan:i}=l[e];if(-1<n&&-1<o&&a&&i){if(o===t&&n===r)return{rowspan:a,colspan:i};if(o<=t&&t<o+a&&n<=r&&r<n+i)return{rowspan:0,colspan:0}}}}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let renderType="footer",renderer=_ui.VxeUI.renderer;function mergeFooterMethod(l,t,r){for(let e=0;e<l.length;e++){var{row:o,col:n,rowspan:a,colspan:i}=l[e];if(-1<n&&-1<o&&a&&i){if(o===t&&n===r)return{rowspan:a,colspan:i};if(o<=t&&t<o+a&&n<=r&&r<n+i)return{rowspan:0,colspan:0}}}}function renderRows(v,e,b,w,y,_,h){let{$parent:T,fixedType:$}=e,{$listeners:C,footerCellClassName:F,footerCellStyle:S,footerAlign:I,mergeFooterList:U,footerSpanMethod:k,align:L,scrollXLoad:O,columnKey:R,columnOpts:A,showFooterOverflow:E,currentColumn:M,overflowX:q,scrollbarWidth:l,tooltipOpts:D}=T;return b.map((l,e)=>{var{type:t,showFooterOverflow:r,footerAlign:o,align:n,footerClassName:a,editRender:i,cellRender:s}=l,i=i||s,s=i?renderer.get(i.name):null;let d=D.showAll||D.enabled;i=l.children&&l.children.length,i=$?l.fixed!==$&&!i:l.fixed&&q,r=_xeUtils.default.isUndefined(r)||_xeUtils.default.isNull(r)?E:r,o=o||(s?s.tableFooterCellAlign:"")||I||n||(s?s.tableCellAlign:"")||L;let c="ellipsis"===r,u="title"===r,f=!0===r||"tooltip"===r,p=u||f||c;var n={colid:l.id},s={},r=T.getColumnIndex(l),x=T.getVTColumnIndex(l),m=x;let g={$table:T,$grid:T.xegrid,row:y,_rowIndex:h,$rowIndex:_,column:l,columnIndex:r,$columnIndex:e,_columnIndex:x,itemIndex:m,items:y,fixed:$,type:renderType,data:w};if(O&&!p&&(c=p=!0),(u||f||d)&&(s.mouseenter=e=>{u?(0,_dom.updateCellTitle)(e.currentTarget,l):(f||d)&&T.triggerFooterTooltipEvent(e,g)}),(f||d)&&(s.mouseleave=e=>{(f||d)&&T.handleTargetLeaveEvent(e)}),C["footer-cell-click"]&&(s.click=e=>{T.emitEvent("footer-cell-click",Object.assign({cell:e.currentTarget},g),e)}),C["footer-cell-dblclick"]&&(s.dblclick=e=>{T.emitEvent("footer-cell-dblclick",Object.assign({cell:e.currentTarget},g),e)}),U.length){r=mergeFooterMethod(U,h,x);if(r){var{rowspan:m,colspan:x}=r;if(!m||!x)return null;1<m&&(n.rowspan=m),1<x&&(n.colspan=x)}}else if(k){var{rowspan:r=1,colspan:m=1}=k(g)||{};if(!r||!m)return null;1<r&&(n.rowspan=r),1<m&&(n.colspan=m)}return v("td",{class:["vxe-footer--column",l.id,{["col--"+o]:o,["col--"+t]:t,"col--last":e===b.length-1,"fixed--hidden":i,"col--ellipsis":p,"col--current":M===l},(0,_utils.getClass)(a,g),(0,_utils.getClass)(F,g)],attrs:n,style:S?_xeUtils.default.isFunction(S)?S(g):S:null,on:s,key:R||A.useKey||A.drag?l.id:e},[v("div",{class:["vxe-cell",{"c--title":u,"c--tooltip":f,"c--ellipsis":c}]},l.renderFooter(v,g))])}).concat(l?[v("td",{key:"gr"+_,class:"vxe-footer--gutter col--gutter"})]:[])}function renderHeads(o,n,a){let{$parent:i,fixedType:s,tableColumn:d}=n,{footerRowClassName:c,footerRowStyle:u,isDragColMove:f}=i,p=i.columnOpts;return a.map((e,l)=>{var t=l,r={$table:i,row:e,_rowIndex:t,$rowIndex:l,fixed:s,type:renderType};return p.drag?o("transition-group",{props:{tag:"tr",name:"vxe-header--col-list"+(f?"":"-disabled"),class:["vxe-footer--row",c?_xeUtils.default.isFunction(c)?c(r):c:""],style:u?_xeUtils.default.isFunction(u)?u(r):u:null}},renderRows(o,n,d,a,e,l,t)):o("tr",{class:["vxe-footer--row",c?_xeUtils.default.isFunction(c)?c(r):c:""],style:u?_xeUtils.default.isFunction(u)?u(r):u:null},renderRows(o,n,d,a,e,l,t))})}var _default=exports.default={name:"VxeTableFooter",props:{footerTableData:Array,tableColumn:Array,fixedColumn:Array,fixedType:String,size:String},mounted(){var{$parent:e,$el:l,$refs:t,fixedType:r}=this,e=e.elemStore,r=`${r||"main"}-footer-`;e[r+"wrapper"]=l,e[r+"table"]=t.table,e[r+"colgroup"]=t.colgroup,e[r+"list"]=t.tfoot,e[r+"xSpace"]=t.xSpace},destroyed(){var{$parent:e,fixedType:l}=this,e=e.elemStore,l=`${l||"main"}-footer-`;e[l+"wrapper"]=null,e[l+"table"]=null,e[l+"colgroup"]=null,e[l+"list"]=null,e[l+"xSpace"]=null},render(t){let{_e:e,$parent:l,fixedType:r,fixedColumn:o,tableColumn:n,footerTableData:a}=this;var{tId:i,mergeFooterList:s,footerSpanMethod:d,scrollXLoad:c,showFooterOverflow:u,scrollbarWidth:f,visibleColumn:p,expandColumn:x}=l;return r&&(n=x||!c&&!u||s.length&&d?p:o),t("div",{class:["vxe-table--footer-wrapper",r?`fixed-${r}--wrapper`:"body--wrapper"],attrs:{xid:i},on:{scroll:this.scrollEvent}},[r?e():t("div",{class:"vxe-body--x-space",ref:"xSpace"}),t("table",{class:"vxe-table--footer",attrs:{xid:i,cellspacing:0,cellpadding:0,border:0},ref:"table"},[t("colgroup",{ref:"colgroup"},n.map((e,l)=>t("col",{attrs:{name:e.id},key:l})).concat(f?[t("col",{attrs:{name:"col_gutter"}})]:[])),t("tfoot",{ref:"tfoot"},renderHeads(t,this,a))])])},methods:{scrollEvent(e){var{$parent:l,fixedType:t}=this,r=l.$refs,{tableHeader:o,tableBody:n,tableFooter:a}=r,o=o?o.$el:null,a=a?a.$el:null,n=n.$el,a=a?a.scrollLeft:0,r=r.refScrollXHandleElem;r?r.scrollLeft=a:(r=n.scrollTop,(!!0,_dom.setScrollLeft)(o,a),(0,_dom.setScrollLeft)(n,a),l.handleScrollEvent(e,!1,!0,r,a,{type:renderType,fixed:t}))}}};
|