vxe-table 4.10.6-beta.25 → 4.10.6-beta.27
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/en-US.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +21 -19
- package/es/table/src/cell.js +25 -39
- package/es/table/src/column.js +10 -0
- package/es/table/src/columnInfo.js +2 -0
- package/es/table/src/footer.js +2 -1
- package/es/table/src/header.js +2 -2
- package/es/table/src/table.js +111 -81
- package/es/table/src/util.js +9 -3
- package/es/table/style.css +51 -26
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +51 -26
- 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 +189 -150
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +17 -18
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +24 -33
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +10 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +2 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +2 -1
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +1 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +122 -92
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +10 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +51 -26
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- 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 +51 -26
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/en-US.ts +2 -2
- package/packages/table/src/body.ts +21 -19
- package/packages/table/src/cell.ts +25 -47
- package/packages/table/src/column.ts +10 -0
- package/packages/table/src/columnInfo.ts +2 -0
- package/packages/table/src/footer.ts +2 -1
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/table.ts +116 -83
- package/packages/table/src/util.ts +10 -3
- package/styles/components/table.scss +63 -31
- /package/es/{iconfont.1737356819937.ttf → iconfont.1737446773545.ttf} +0 -0
- /package/es/{iconfont.1737356819937.woff → iconfont.1737446773545.woff} +0 -0
- /package/es/{iconfont.1737356819937.woff2 → iconfont.1737446773545.woff2} +0 -0
- /package/lib/{iconfont.1737356819937.ttf → iconfont.1737446773545.ttf} +0 -0
- /package/lib/{iconfont.1737356819937.woff → iconfont.1737446773545.woff} +0 -0
- /package/lib/{iconfont.1737356819937.woff2 → iconfont.1737446773545.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -79,7 +79,7 @@ export default defineComponent({
|
|
|
79
79
|
*/
|
|
80
80
|
const renderTdColumn = (seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) => {
|
|
81
81
|
const { fullAllDataRowIdData } = tableInternalData;
|
|
82
|
-
const { columnKey, height,
|
|
82
|
+
const { columnKey, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
|
|
83
83
|
const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData;
|
|
84
84
|
const { afterFullData, scrollXStore, scrollYStore } = tableInternalData;
|
|
85
85
|
const cellOpts = computeCellOpts.value;
|
|
@@ -96,8 +96,8 @@ export default defineComponent({
|
|
|
96
96
|
const mouseOpts = computeMouseOpts.value;
|
|
97
97
|
const areaOpts = computeAreaOpts.value;
|
|
98
98
|
const { selectCellToRow } = areaOpts;
|
|
99
|
-
const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, slots } = column;
|
|
100
|
-
const { verticalAlign } = cellOpts;
|
|
99
|
+
const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
|
|
100
|
+
const { verticalAlign: allVerticalAlign } = cellOpts;
|
|
101
101
|
const { actived } = editStore;
|
|
102
102
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
103
103
|
const colid = column.id;
|
|
@@ -111,16 +111,17 @@ export default defineComponent({
|
|
|
111
111
|
const isEdit = isEnableConf(editRender);
|
|
112
112
|
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
113
113
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
|
|
114
|
-
const
|
|
115
|
-
const cellOverflow =
|
|
114
|
+
const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding;
|
|
115
|
+
const cellOverflow = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
116
116
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
117
117
|
const showTitle = cellOverflow === 'title';
|
|
118
118
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
119
|
-
|
|
120
|
-
const
|
|
119
|
+
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
120
|
+
const isRsHeight = resizeHeight > 0;
|
|
121
121
|
let isDirty;
|
|
122
122
|
const tdOns = {};
|
|
123
123
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
124
|
+
const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
|
|
124
125
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
125
126
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline');
|
|
126
127
|
const tdAttrs = { colid };
|
|
@@ -262,14 +263,14 @@ export default defineComponent({
|
|
|
262
263
|
isVNPreEmptyStatus = true;
|
|
263
264
|
}
|
|
264
265
|
const tcStyle = {};
|
|
265
|
-
if (hasEllipsis) {
|
|
266
|
+
if (scrollYLoad || hasEllipsis || isRsHeight) {
|
|
266
267
|
tcStyle.height = `${cellHeight}px`;
|
|
267
268
|
}
|
|
268
269
|
else {
|
|
269
270
|
tcStyle.minHeight = `${cellHeight}px`;
|
|
270
271
|
}
|
|
271
272
|
const tdVNs = [];
|
|
272
|
-
if (fixedHiddenColumn &&
|
|
273
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
273
274
|
tdVNs.push(h('div', {
|
|
274
275
|
key: 'tc',
|
|
275
276
|
class: ['vxe-cell', {
|
|
@@ -345,19 +346,20 @@ export default defineComponent({
|
|
|
345
346
|
return h('td', Object.assign(Object.assign(Object.assign({ class: [
|
|
346
347
|
'vxe-body--column',
|
|
347
348
|
colid,
|
|
349
|
+
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
|
|
350
|
+
cellAlign ? `col--${cellAlign}` : '',
|
|
351
|
+
type ? `col--${type}` : '',
|
|
348
352
|
{
|
|
349
|
-
[`col--${cellAlign}`]: cellAlign,
|
|
350
|
-
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
351
|
-
[`col--${type}`]: type,
|
|
352
353
|
'col--last': isLastColumn,
|
|
353
354
|
'col--tree-node': treeNode,
|
|
354
355
|
'col--edit': isEdit,
|
|
355
356
|
'col--ellipsis': hasEllipsis,
|
|
357
|
+
'col--rs-height': isRsHeight,
|
|
356
358
|
'col--to-row': showAreaRowStatus,
|
|
357
359
|
'col--auto-height': isVNAutoHeight,
|
|
358
360
|
'fixed--width': !isAutoCellWidth,
|
|
359
361
|
'fixed--hidden': fixedHiddenColumn,
|
|
360
|
-
'is--padding':
|
|
362
|
+
'is--padding': isCellPadding,
|
|
361
363
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
362
364
|
'is--drag-disabled': isDisabledDrag,
|
|
363
365
|
'col--dirty': isDirty,
|
|
@@ -371,8 +373,8 @@ export default defineComponent({
|
|
|
371
373
|
], 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);
|
|
372
374
|
};
|
|
373
375
|
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
374
|
-
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle,
|
|
375
|
-
const { hasFixedColumn, treeExpandedMaps, scrollXLoad, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
|
|
376
|
+
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
377
|
+
const { hasFixedColumn, treeExpandedMaps, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
|
|
376
378
|
const { fullAllDataRowIdData } = tableInternalData;
|
|
377
379
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
378
380
|
const radioOpts = computeRadioOpts.value;
|
|
@@ -474,7 +476,7 @@ export default defineComponent({
|
|
|
474
476
|
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
|
|
475
477
|
}
|
|
476
478
|
const { showOverflow } = expandColumn;
|
|
477
|
-
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ?
|
|
479
|
+
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
|
|
478
480
|
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
479
481
|
rows.push(h('tr', Object.assign({ class: ['vxe-body--expanded-row', {
|
|
480
482
|
'is--padding': padding
|
|
@@ -537,7 +539,7 @@ export default defineComponent({
|
|
|
537
539
|
const renderVN = () => {
|
|
538
540
|
const { slots } = tableContext;
|
|
539
541
|
const { fixedColumn, fixedType, tableColumn } = props;
|
|
540
|
-
const {
|
|
542
|
+
const { spanMethod, footerSpanMethod, mouseConfig } = tableProps;
|
|
541
543
|
const { isGroup, tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData;
|
|
542
544
|
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData;
|
|
543
545
|
const rowOpts = computeRowOpts.value;
|
|
@@ -550,7 +552,7 @@ export default defineComponent({
|
|
|
550
552
|
let renderColumnList = tableColumn;
|
|
551
553
|
let isOptimizeMode = false;
|
|
552
554
|
// 如果是使用优化模式
|
|
553
|
-
if (scrollXLoad || scrollYLoad ||
|
|
555
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
554
556
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
555
557
|
// 如果不支持优化模式
|
|
556
558
|
}
|
|
@@ -632,7 +634,7 @@ export default defineComponent({
|
|
|
632
634
|
$xeTable.triggerBodyScrollEvent(evnt, fixedType);
|
|
633
635
|
}
|
|
634
636
|
};
|
|
635
|
-
if (leftFixedWidth || rightFixedWidth) {
|
|
637
|
+
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
636
638
|
ons.onWheel = $xeTable.triggerBodyWheelEvent;
|
|
637
639
|
}
|
|
638
640
|
return h('div', {
|
package/es/table/src/cell.js
CHANGED
|
@@ -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) {
|
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
|
// 自定义排序的属性
|
|
@@ -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,
|
package/es/table/src/footer.js
CHANGED
|
@@ -2,6 +2,7 @@ import { defineComponent, TransitionGroup, h, ref, inject, nextTick, onMounted,
|
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { VxeUI } from '../../ui';
|
|
4
4
|
import { updateCellTitle, getPropClass } from '../../ui/src/dom';
|
|
5
|
+
import { getCellHeight } from './util';
|
|
5
6
|
const { renderer, renderEmptyElement } = VxeUI;
|
|
6
7
|
const renderType = 'footer';
|
|
7
8
|
function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
@@ -57,7 +58,7 @@ export default defineComponent({
|
|
|
57
58
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
58
59
|
const cellOpts = computeCellOpts.value;
|
|
59
60
|
const footerCellOpts = computeFooterCellOpts.value;
|
|
60
|
-
const currCellHeight = footerCellOpts.height || cellOpts.height || defaultRowHeight;
|
|
61
|
+
const currCellHeight = getCellHeight(footerCellOpts.height || cellOpts.height) || defaultRowHeight;
|
|
61
62
|
return tableColumn.map((column, $columnIndex) => {
|
|
62
63
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column;
|
|
63
64
|
const colid = column.id;
|
package/es/table/src/header.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, TransitionGroup, h, ref, inject, nextTick, watch, onMounted, onUnmounted } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { VxeUI } from '../../ui';
|
|
4
|
-
import { convertHeaderColumnToRows } from './util';
|
|
4
|
+
import { getCellHeight, convertHeaderColumnToRows } from './util';
|
|
5
5
|
const { renderer, renderEmptyElement } = VxeUI;
|
|
6
6
|
const renderType = 'header';
|
|
7
7
|
export default defineComponent({
|
|
@@ -42,7 +42,7 @@ export default defineComponent({
|
|
|
42
42
|
const cellOpts = computeCellOpts.value;
|
|
43
43
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
44
44
|
const headerCellOpts = computeHeaderCellOpts.value;
|
|
45
|
-
const currCellHeight = headerCellOpts.height || cellOpts.height || defaultRowHeight;
|
|
45
|
+
const currCellHeight = getCellHeight(headerCellOpts.height || cellOpts.height) || defaultRowHeight;
|
|
46
46
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
|
|
47
47
|
return cols.map((column, $columnIndex) => {
|
|
48
48
|
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column;
|