vxe-table 4.0.30 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/README.zh-TW.md +1 -0
- package/es/button/style.css +2 -2
- package/es/checkbox/style.css +1 -1
- package/es/edit/src/hook.js +2 -2
- package/es/export/src/hook.js +24 -0
- package/es/export/src/util.js +20 -8
- package/es/export/style.css +1 -1
- package/es/filter/src/hook.js +2 -2
- package/es/filter/style.css +2 -2
- package/es/footer/src/footer.js +4 -4
- package/es/form/src/form.js +13 -6
- package/es/form/src/render.js +4 -4
- package/es/grid/src/grid.js +48 -1
- package/es/header/src/header.js +7 -5
- package/es/header/style.css +3 -10
- package/es/input/style.css +4 -4
- package/es/menu/style.css +1 -1
- package/es/modal/style.css +1 -1
- package/es/pager/style.css +2 -2
- package/es/radio/style.css +1 -1
- package/es/select/src/select.js +5 -5
- package/es/select/style.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +18 -14
- package/es/table/src/emits.js +1 -0
- package/es/table/src/props.js +4 -1
- package/es/table/src/table.js +219 -89
- package/es/table/style.css +15 -12
- package/es/toolbar/style.css +1 -1
- package/es/v-x-e-table/src/conf.js +2 -1
- package/es/v-x-e-table/src/renderer.js +4 -4
- package/es/validator/src/hook.js +12 -5
- package/helper/vetur/attributes.json +16 -204
- package/helper/vetur/tags.json +3 -65
- package/lib/button/style/style.css +2 -2
- package/lib/button/style/style.min.css +1 -1
- package/lib/checkbox/style/style.css +1 -1
- package/lib/checkbox/style/style.min.css +1 -1
- package/lib/edit/src/hook.js +2 -2
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/export/src/hook.js +28 -0
- package/lib/export/src/hook.min.js +1 -1
- package/lib/export/src/util.js +21 -7
- package/lib/export/src/util.min.js +1 -1
- package/lib/export/style/style.css +1 -1
- package/lib/export/style/style.min.css +1 -1
- package/lib/filter/src/hook.js +8 -2
- package/lib/filter/src/hook.min.js +1 -1
- package/lib/filter/style/style.css +2 -2
- package/lib/filter/style/style.min.css +1 -1
- package/lib/footer/src/footer.js +4 -4
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form.js +23 -6
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +4 -4
- package/lib/form/src/render.min.js +1 -1
- package/lib/grid/src/grid.js +56 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +7 -5
- package/lib/header/src/header.min.js +1 -1
- package/lib/header/style/style.css +3 -10
- package/lib/header/style/style.min.css +1 -1
- package/lib/index.umd.js +561 -186
- package/lib/index.umd.min.js +1 -1
- package/lib/input/style/style.css +4 -4
- package/lib/input/style/style.min.css +1 -1
- package/lib/menu/style/style.css +1 -1
- package/lib/menu/style/style.min.css +1 -1
- package/lib/modal/style/style.css +1 -1
- package/lib/modal/style/style.min.css +1 -1
- package/lib/pager/style/style.css +2 -2
- package/lib/pager/style/style.min.css +1 -1
- package/lib/radio/style/style.css +1 -1
- package/lib/radio/style/style.min.css +1 -1
- package/lib/select/src/select.js +5 -5
- package/lib/select/style/style.css +1 -1
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +18 -14
- package/lib/table/src/body.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/props.js +4 -1
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +288 -120
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +15 -12
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/style/style.css +1 -1
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/v-x-e-table/src/conf.js +2 -1
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +4 -4
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/lib/validator/src/hook.js +12 -5
- package/lib/validator/src/hook.min.js +1 -1
- package/package.json +4 -4
- package/packages/edit/src/hook.ts +2 -2
- package/packages/export/src/hook.ts +24 -0
- package/packages/export/src/util.ts +17 -5
- package/packages/filter/src/hook.ts +2 -2
- package/packages/footer/src/footer.ts +4 -4
- package/packages/form/src/form.ts +10 -6
- package/packages/form/src/render.ts +4 -4
- package/packages/grid/src/grid.ts +48 -1
- package/packages/header/src/header.ts +7 -5
- package/packages/select/src/select.ts +5 -5
- package/packages/table/src/body.ts +18 -14
- package/packages/table/src/emits.ts +1 -0
- package/packages/table/src/props.ts +4 -1
- package/packages/table/src/table.ts +222 -88
- package/packages/v-x-e-table/src/conf.ts +2 -1
- package/packages/v-x-e-table/src/renderer.ts +4 -4
- package/packages/validator/src/hook.ts +9 -5
- package/styles/header.scss +9 -12
- package/styles/table.scss +9 -3
- package/styles/variable.scss +2 -2
- package/types/column.d.ts +5 -1
- package/types/form-item.d.ts +5 -1
- package/types/form.d.ts +5 -1
- package/types/grid.d.ts +4 -0
- package/types/modal.d.ts +4 -5
- package/types/table.d.ts +53 -11
- package/types/validator.d.ts +5 -1
package/es/table/src/body.js
CHANGED
|
@@ -40,7 +40,7 @@ export default defineComponent({
|
|
|
40
40
|
var xesize = inject('xesize', null);
|
|
41
41
|
var xID = $xetable.xID, tableProps = $xetable.props, tableContext = $xetable.context, tableReactData = $xetable.reactData, tableInternalData = $xetable.internalData;
|
|
42
42
|
var _a = $xetable.getRefMaps(), refTableHeader = _a.refTableHeader, refTableBody = _a.refTableBody, refTableFooter = _a.refTableFooter, refTableLeftBody = _a.refTableLeftBody, refTableRightBody = _a.refTableRightBody, refValidTooltip = _a.refValidTooltip;
|
|
43
|
-
var _b = $xetable.getComputeMaps(), computeEditOpts = _b.computeEditOpts, computeMouseOpts = _b.computeMouseOpts, computeSYOpts = _b.computeSYOpts, computeEmptyOpts = _b.computeEmptyOpts, computeKeyboardOpts = _b.computeKeyboardOpts, computeTooltipOpts = _b.computeTooltipOpts, computeRadioOpts = _b.computeRadioOpts, computeTreeOpts = _b.computeTreeOpts, computeCheckboxOpts = _b.computeCheckboxOpts, computeValidOpts = _b.computeValidOpts;
|
|
43
|
+
var _b = $xetable.getComputeMaps(), computeEditOpts = _b.computeEditOpts, computeMouseOpts = _b.computeMouseOpts, computeSYOpts = _b.computeSYOpts, computeEmptyOpts = _b.computeEmptyOpts, computeKeyboardOpts = _b.computeKeyboardOpts, computeTooltipOpts = _b.computeTooltipOpts, computeRadioOpts = _b.computeRadioOpts, computeTreeOpts = _b.computeTreeOpts, computeCheckboxOpts = _b.computeCheckboxOpts, computeValidOpts = _b.computeValidOpts, computeRowOpts = _b.computeRowOpts;
|
|
44
44
|
var refElem = ref();
|
|
45
45
|
var refBodyTable = ref();
|
|
46
46
|
var refBodyColgroup = ref();
|
|
@@ -113,16 +113,18 @@ export default defineComponent({
|
|
|
113
113
|
var renderColumn = function ($seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
|
|
114
114
|
var _a;
|
|
115
115
|
var columnKey = tableProps.columnKey, height = tableProps.height, allColumnOverflow = tableProps.showOverflow, cellClassName = tableProps.cellClassName, cellStyle = tableProps.cellStyle, allAlign = tableProps.align, spanMethod = tableProps.spanMethod, mouseConfig = tableProps.mouseConfig, editConfig = tableProps.editConfig, editRules = tableProps.editRules, tooltipConfig = tableProps.tooltipConfig;
|
|
116
|
-
var tableData = tableReactData.tableData, overflowX = tableReactData.overflowX,
|
|
116
|
+
var tableData = tableReactData.tableData, overflowX = tableReactData.overflowX, scrollYLoad = tableReactData.scrollYLoad, currentColumn = tableReactData.currentColumn, mergeList = tableReactData.mergeList, editStore = tableReactData.editStore, validStore = tableReactData.validStore, isAllOverflow = tableReactData.isAllOverflow;
|
|
117
117
|
var afterFullData = tableInternalData.afterFullData;
|
|
118
118
|
var validOpts = computeValidOpts.value;
|
|
119
119
|
var checkboxOpts = computeCheckboxOpts.value;
|
|
120
120
|
var editOpts = computeEditOpts.value;
|
|
121
121
|
var tooltipOpts = computeTooltipOpts.value;
|
|
122
|
+
var rowOpts = computeRowOpts.value;
|
|
122
123
|
var sYOpts = computeSYOpts.value;
|
|
123
124
|
var type = column.type, cellRender = column.cellRender, editRender = column.editRender, align = column.align, showOverflow = column.showOverflow, className = column.className, treeNode = column.treeNode;
|
|
124
125
|
var actived = editStore.actived;
|
|
125
|
-
var
|
|
126
|
+
var scrollYRHeight = sYOpts.rHeight;
|
|
127
|
+
var rowHeight = rowOpts.height;
|
|
126
128
|
var showAllTip = tooltipOpts.showAll;
|
|
127
129
|
var columnIndex = $xetable.getColumnIndex(column);
|
|
128
130
|
var _columnIndex = $xetable.getVTColumnIndex(column);
|
|
@@ -141,7 +143,7 @@ export default defineComponent({
|
|
|
141
143
|
var attrs = { colid: column.id };
|
|
142
144
|
var params = { $table: $xetable, $seq: $seq, seq: seq, rowid: rowid, row: row, rowIndex: rowIndex, $rowIndex: $rowIndex, _rowIndex: _rowIndex, column: column, columnIndex: columnIndex, $columnIndex: $columnIndex, _columnIndex: _columnIndex, fixed: fixedType, type: renderType, isHidden: fixedHiddenColumn, level: rowLevel, visibleData: afterFullData, data: tableData, items: items };
|
|
143
145
|
// 虚拟滚动不支持动态高度
|
|
144
|
-
if (
|
|
146
|
+
if (scrollYLoad && !hasEllipsis) {
|
|
145
147
|
showEllipsis = hasEllipsis = true;
|
|
146
148
|
}
|
|
147
149
|
// hover 进入事件
|
|
@@ -234,7 +236,7 @@ export default defineComponent({
|
|
|
234
236
|
'c--ellipsis': showEllipsis
|
|
235
237
|
}],
|
|
236
238
|
style: {
|
|
237
|
-
maxHeight: hasEllipsis &&
|
|
239
|
+
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? (scrollYRHeight || rowHeight) + "px" : ''
|
|
238
240
|
}
|
|
239
241
|
}));
|
|
240
242
|
}
|
|
@@ -247,7 +249,7 @@ export default defineComponent({
|
|
|
247
249
|
'c--ellipsis': showEllipsis
|
|
248
250
|
}],
|
|
249
251
|
style: {
|
|
250
|
-
maxHeight: hasEllipsis &&
|
|
252
|
+
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? (scrollYRHeight || rowHeight) + "px" : ''
|
|
251
253
|
},
|
|
252
254
|
title: showTitle ? $xetable.getCellLabel(row, column) : null
|
|
253
255
|
}, column.renderCell(params))]));
|
|
@@ -277,13 +279,13 @@ export default defineComponent({
|
|
|
277
279
|
_a['col--valid-error'] = hasValidError,
|
|
278
280
|
_a['col--current'] = currentColumn === column,
|
|
279
281
|
_a), getPropClass(className, params), getPropClass(cellClassName, params)], key: columnKey ? column.id : $columnIndex }, attrs), { style: Object.assign({
|
|
280
|
-
height: hasEllipsis &&
|
|
282
|
+
height: hasEllipsis && (scrollYRHeight || rowHeight) ? (scrollYRHeight || rowHeight) + "px" : ''
|
|
281
283
|
}, cellStyle ? (XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle) : null) }), tdOns), tdVNs);
|
|
282
284
|
};
|
|
283
|
-
var renderRows = function ($seq,
|
|
285
|
+
var renderRows = function ($seq, fixedType, tableData, tableColumn) {
|
|
284
286
|
var stripe = tableProps.stripe, rowKey = tableProps.rowKey, highlightHoverRow = tableProps.highlightHoverRow, rowClassName = tableProps.rowClassName, rowStyle = tableProps.rowStyle, allColumnOverflow = tableProps.showOverflow, editConfig = tableProps.editConfig, treeConfig = tableProps.treeConfig;
|
|
285
287
|
var hasFixedColumn = tableReactData.hasFixedColumn, treeExpandeds = tableReactData.treeExpandeds, scrollYLoad = tableReactData.scrollYLoad, editStore = tableReactData.editStore, rowExpandeds = tableReactData.rowExpandeds, expandColumn = tableReactData.expandColumn, selectRow = tableReactData.selectRow;
|
|
286
|
-
var scrollYStore = tableInternalData.scrollYStore;
|
|
288
|
+
var fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData, scrollYStore = tableInternalData.scrollYStore;
|
|
287
289
|
var checkboxOpts = computeCheckboxOpts.value;
|
|
288
290
|
var radioOpts = computeRadioOpts.value;
|
|
289
291
|
var treeOpts = computeTreeOpts.value;
|
|
@@ -315,6 +317,8 @@ export default defineComponent({
|
|
|
315
317
|
};
|
|
316
318
|
}
|
|
317
319
|
var rowid = getRowid($xetable, row);
|
|
320
|
+
var rest = fullAllDataRowIdData[rowid];
|
|
321
|
+
var rowLevel = rest ? rest.level : 0;
|
|
318
322
|
var params = { $table: $xetable, $seq: $seq, seq: seq, rowid: rowid, fixed: fixedType, type: renderType, level: rowLevel, row: row, rowIndex: rowIndex, $rowIndex: $rowIndex, _rowIndex: _rowIndex };
|
|
319
323
|
var isNewRow = false;
|
|
320
324
|
if (editConfig) {
|
|
@@ -358,10 +362,10 @@ export default defineComponent({
|
|
|
358
362
|
]));
|
|
359
363
|
}
|
|
360
364
|
// 如果是树形表格
|
|
361
|
-
if (treeConfig && treeExpandeds.length) {
|
|
365
|
+
if (treeConfig && !scrollYLoad && treeExpandeds.length) {
|
|
362
366
|
var rowChildren = row[treeOpts.children];
|
|
363
367
|
if (rowChildren && rowChildren.length && $xetable.findRowIndexOf(treeExpandeds, row) > -1) {
|
|
364
|
-
rows.push.apply(rows, renderRows($seq ? $seq + "." + seq : "" + seq,
|
|
368
|
+
rows.push.apply(rows, renderRows($seq ? $seq + "." + seq : "" + seq, fixedType, rowChildren, tableColumn));
|
|
365
369
|
}
|
|
366
370
|
}
|
|
367
371
|
});
|
|
@@ -570,7 +574,7 @@ export default defineComponent({
|
|
|
570
574
|
var renderVN = function () {
|
|
571
575
|
var fixedColumn = props.fixedColumn, fixedType = props.fixedType, tableColumn = props.tableColumn;
|
|
572
576
|
var keyboardConfig = tableProps.keyboardConfig, allColumnOverflow = tableProps.showOverflow, spanMethod = tableProps.spanMethod, mouseConfig = tableProps.mouseConfig;
|
|
573
|
-
var tableData = tableReactData.tableData, mergeList = tableReactData.mergeList,
|
|
577
|
+
var tableData = tableReactData.tableData, mergeList = tableReactData.mergeList, scrollYLoad = tableReactData.scrollYLoad, isAllOverflow = tableReactData.isAllOverflow;
|
|
574
578
|
var visibleColumn = tableInternalData.visibleColumn;
|
|
575
579
|
var slots = tableContext.slots;
|
|
576
580
|
var sYOpts = computeSYOpts.value;
|
|
@@ -581,7 +585,7 @@ export default defineComponent({
|
|
|
581
585
|
// const isMergeRightFixedExceeded = computeIsMergeRightFixedExceeded.value
|
|
582
586
|
// 如果是使用优化模式
|
|
583
587
|
if (fixedType) {
|
|
584
|
-
if (
|
|
588
|
+
if (scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
|
|
585
589
|
if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
|
|
586
590
|
tableColumn = fixedColumn;
|
|
587
591
|
}
|
|
@@ -648,7 +652,7 @@ export default defineComponent({
|
|
|
648
652
|
*/
|
|
649
653
|
h('tbody', {
|
|
650
654
|
ref: refBodyTBody
|
|
651
|
-
}, renderRows('',
|
|
655
|
+
}, renderRows('', fixedType, tableData, tableColumn))
|
|
652
656
|
]),
|
|
653
657
|
h('div', {
|
|
654
658
|
class: 'vxe-table--checkbox-range'
|
package/es/table/src/emits.js
CHANGED
package/es/table/src/props.js
CHANGED
|
@@ -94,8 +94,11 @@ export default {
|
|
|
94
94
|
autoResize: { type: Boolean, default: function () { return GlobalConfig.table.autoResize; } },
|
|
95
95
|
// 是否自动根据状态属性去更新响应式表格宽高
|
|
96
96
|
syncResize: [Boolean, String, Number],
|
|
97
|
-
//
|
|
97
|
+
// 列配置信息
|
|
98
98
|
columnConfig: Object,
|
|
99
|
+
// 行配置信息
|
|
100
|
+
rowConfig: Object,
|
|
101
|
+
// 列调整配置项
|
|
99
102
|
resizableConfig: Object,
|
|
100
103
|
// 序号配置项
|
|
101
104
|
seqConfig: Object,
|