vxe-table 3.14.5 → 3.15.0-beta.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/es/style.css +1 -1
- package/es/table/module/edit/mixin.js +10 -9
- package/es/table/module/export/mixin.js +14 -11
- package/es/table/src/body.js +11 -13
- package/es/table/src/footer.js +3 -16
- package/es/table/src/methods.js +202 -67
- package/es/table/src/table.js +40 -23
- package/es/table/src/util.js +0 -13
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +318 -183
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +9 -9
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +15 -11
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/body.js +14 -15
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +4 -27
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/methods.js +231 -71
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +42 -23
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +0 -25
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +2 -2
- 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/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +10 -9
- package/packages/table/module/export/mixin.ts +14 -11
- package/packages/table/src/body.ts +11 -13
- package/packages/table/src/footer.ts +3 -17
- package/packages/table/src/methods.ts +218 -78
- package/packages/table/src/table.ts +40 -23
- package/packages/table/src/util.ts +0 -14
- package/packages/ui/index.ts +1 -1
- /package/es/{iconfont.1743479120369.ttf → iconfont.1743578536739.ttf} +0 -0
- /package/es/{iconfont.1743479120369.woff → iconfont.1743578536739.woff} +0 -0
- /package/es/{iconfont.1743479120369.woff2 → iconfont.1743578536739.woff2} +0 -0
- /package/lib/{iconfont.1743479120369.ttf → iconfont.1743578536739.ttf} +0 -0
- /package/lib/{iconfont.1743479120369.woff → iconfont.1743578536739.woff} +0 -0
- /package/lib/{iconfont.1743479120369.woff2 → iconfont.1743578536739.woff2} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import { VxeUI } from '../../../ui'
|
|
3
|
-
import { isColumnInfo,
|
|
3
|
+
import { isColumnInfo, getCellValue } from '../../src/util'
|
|
4
4
|
import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils'
|
|
5
5
|
import { hasClass } from '../../../ui/src/dom'
|
|
6
6
|
import { createHtmlPage, getExportBlobByContent } from './util'
|
|
@@ -342,9 +342,11 @@ function hasEllipsis ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, co
|
|
|
342
342
|
function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) {
|
|
343
343
|
const props = $xeTable
|
|
344
344
|
const reactData = $xeTable as unknown as TableReactData
|
|
345
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
345
346
|
|
|
346
347
|
const { id, border, treeConfig, headerAlign: allHeaderAlign, align: allAlign, footerAlign: allFooterAlign, showOverflow: allColumnOverflow, showHeaderOverflow: allColumnHeaderOverflow } = props
|
|
347
|
-
const { isAllSelected, isIndeterminate
|
|
348
|
+
const { isAllSelected, isIndeterminate } = reactData
|
|
349
|
+
const { mergeBodyCellMaps } = internalData
|
|
348
350
|
const treeOpts = $xeTable.computeTreeOpts
|
|
349
351
|
const { print: isPrint, isHeader, isFooter, isColgroup, isMerge, colgroups, original } = opts
|
|
350
352
|
const allCls = 'check-all'
|
|
@@ -442,15 +444,16 @@ function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: V
|
|
|
442
444
|
datas.forEach(item => {
|
|
443
445
|
tables.push(
|
|
444
446
|
'<tr>' + columns.map(column => {
|
|
447
|
+
const colid = column.id
|
|
445
448
|
const cellAlign = column.align || allAlign
|
|
446
449
|
const classNames = hasEllipsis($xeTable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : []
|
|
447
|
-
const cellValue = item[
|
|
450
|
+
const cellValue = item[colid]
|
|
448
451
|
let rowSpan = 1
|
|
449
452
|
let colSpan = 1
|
|
450
|
-
if (isMerge
|
|
453
|
+
if (isMerge) {
|
|
451
454
|
const _rowIndex = $xeTable.getVTRowIndex(item._row)
|
|
452
455
|
const _columnIndex = $xeTable.getVTColumnIndex(column)
|
|
453
|
-
const spanRest =
|
|
456
|
+
const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`]
|
|
454
457
|
if (spanRest) {
|
|
455
458
|
const { rowspan, colspan } = spanRest
|
|
456
459
|
if (!rowspan || !colspan) {
|
|
@@ -1071,15 +1074,15 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1071
1074
|
const $xeGrid = $xeTable.$xeGrid
|
|
1072
1075
|
|
|
1073
1076
|
const { treeConfig, showHeader, showFooter } = props
|
|
1074
|
-
const { initStore,
|
|
1075
|
-
const { collectColumn } = internalData
|
|
1077
|
+
const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData
|
|
1078
|
+
const { collectColumn, mergeBodyList, mergeFooterList } = internalData
|
|
1076
1079
|
const exportOpts = $xeTable.computeExportOpts
|
|
1077
1080
|
const hasTree = treeConfig
|
|
1078
1081
|
const customOpts = $xeTable.computeCustomOpts
|
|
1079
1082
|
const selectRecords = $xeTable.getCheckboxRecords()
|
|
1080
1083
|
const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : {}
|
|
1081
1084
|
const hasFooter = !!footerTableData.length
|
|
1082
|
-
const hasMerge = !!(
|
|
1085
|
+
const hasMerge = !!(mergeBodyList.length || mergeFooterList.length)
|
|
1083
1086
|
const defOpts = Object.assign({
|
|
1084
1087
|
message: true,
|
|
1085
1088
|
isHeader: showHeader,
|
|
@@ -1253,12 +1256,12 @@ export default {
|
|
|
1253
1256
|
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor
|
|
1254
1257
|
|
|
1255
1258
|
const { treeConfig, showHeader, showFooter } = props
|
|
1256
|
-
const {
|
|
1257
|
-
const { tableFullColumn, afterFullData, collectColumn } = internalData
|
|
1259
|
+
const { mergeFooterList, isGroup } = reactData
|
|
1260
|
+
const { tableFullColumn, afterFullData, mergeBodyList, collectColumn } = internalData
|
|
1258
1261
|
const exportOpts = $xeTable.computeExportOpts
|
|
1259
1262
|
const treeOpts = $xeTable.computeTreeOpts
|
|
1260
1263
|
const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : {}
|
|
1261
|
-
const hasMerge = !!(
|
|
1264
|
+
const hasMerge = !!(mergeBodyList.length || mergeFooterList.length)
|
|
1262
1265
|
const opts = Object.assign({
|
|
1263
1266
|
message: true,
|
|
1264
1267
|
isHeader: showHeader,
|
|
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../ui'
|
|
4
4
|
import { isEnableConf, getClass } from '../../ui/src/utils'
|
|
5
|
-
import { getOffsetSize, calcTreeLine,
|
|
5
|
+
import { getOffsetSize, calcTreeLine, getRowid, createHandleGetRowId } from './util'
|
|
6
6
|
import { updateCellTitle } from '../../ui/src/dom'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
@@ -36,14 +36,13 @@ function renderLine (h: CreateElement, _vm: any, rowid: string, params: VxeTable
|
|
|
36
36
|
if (slots && (slots as any).line) {
|
|
37
37
|
return $xeTable.callSlot((slots as any).line, params, h)
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
40
40
|
let rLevel = 0
|
|
41
41
|
let prevRow = null
|
|
42
|
-
if (
|
|
43
|
-
rLevel =
|
|
44
|
-
prevRow =
|
|
42
|
+
if (rowRest) {
|
|
43
|
+
rLevel = rowRest.level
|
|
44
|
+
prevRow = rowRest.items[rowRest.treeIndex - 1]
|
|
45
45
|
}
|
|
46
|
-
const isFirstRow = $xeTable.eqRow(afterFullData[0], row)
|
|
47
46
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
48
47
|
return [
|
|
49
48
|
h('div', {
|
|
@@ -53,7 +52,7 @@ function renderLine (h: CreateElement, _vm: any, rowid: string, params: VxeTable
|
|
|
53
52
|
h('div', {
|
|
54
53
|
class: 'vxe-tree--line',
|
|
55
54
|
style: {
|
|
56
|
-
height: `${
|
|
55
|
+
height: `${$xeTable.eqRow(afterFullData[0], row) ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
57
56
|
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
58
57
|
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
59
58
|
}
|
|
@@ -90,10 +89,9 @@ function renderTdColumn (
|
|
|
90
89
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
91
90
|
const $xeGrid = $xeTable.$xeGrid
|
|
92
91
|
|
|
93
|
-
const { fullAllDataRowIdData, fullColumnIdData, visibleColumn } = tableInternalData
|
|
94
92
|
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
95
|
-
const { tableData, dragRow, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag,
|
|
96
|
-
const { afterFullData, scrollXStore, scrollYStore } = tableInternalData
|
|
93
|
+
const { tableData, dragRow, overflowX, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
94
|
+
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore } = tableInternalData
|
|
97
95
|
const cellOpts = $xeTable.computeCellOpts
|
|
98
96
|
const validOpts = $xeTable.computeValidOpts
|
|
99
97
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
@@ -221,8 +219,8 @@ function renderTdColumn (
|
|
|
221
219
|
}
|
|
222
220
|
let isMergeCell = false
|
|
223
221
|
// 合并行或列
|
|
224
|
-
if (
|
|
225
|
-
const spanRest =
|
|
222
|
+
if (mergeBodyFlag && mergeBodyList.length) {
|
|
223
|
+
const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`]
|
|
226
224
|
if (spanRest) {
|
|
227
225
|
const { rowspan, colspan } = spanRest
|
|
228
226
|
if (!rowspan || !colspan) {
|
|
@@ -251,7 +249,7 @@ function renderTdColumn (
|
|
|
251
249
|
}
|
|
252
250
|
}
|
|
253
251
|
// 如果被合并不可隐藏
|
|
254
|
-
if (fixedHiddenColumn &&
|
|
252
|
+
if (fixedHiddenColumn && isMergeCell) {
|
|
255
253
|
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
256
254
|
fixedHiddenColumn = false
|
|
257
255
|
}
|
|
@@ -11,20 +11,6 @@ const renderType = 'footer'
|
|
|
11
11
|
|
|
12
12
|
const { renderer, renderEmptyElement } = VxeUI
|
|
13
13
|
|
|
14
|
-
function mergeFooterMethod (mergeFooterList: VxeTableDefines.MergeItem[], _rowIndex: number, _columnIndex: number) {
|
|
15
|
-
for (let mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
|
|
16
|
-
const { row: mergeRowIndex, col: mergeColIndex, rowspan: mergeRowspan, colspan: mergeColspan } = mergeFooterList[mIndex]
|
|
17
|
-
if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
|
|
18
|
-
if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
|
|
19
|
-
return { rowspan: mergeRowspan, colspan: mergeColspan }
|
|
20
|
-
}
|
|
21
|
-
if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
|
|
22
|
-
return { rowspan: 0, colspan: 0 }
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
14
|
function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.ColumnInfo[], footerTableData: any[], row: any, $rowIndex: number, _rowIndex: number) {
|
|
29
15
|
const props = _vm
|
|
30
16
|
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -35,8 +21,8 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
35
21
|
|
|
36
22
|
const { fixedType } = props
|
|
37
23
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
38
|
-
const { scrollXLoad, scrollYLoad, overflowX, currentColumn
|
|
39
|
-
const { fullColumnIdData, scrollXStore } = tableInternalData
|
|
24
|
+
const { scrollXLoad, scrollYLoad, overflowX, currentColumn } = tableReactData
|
|
25
|
+
const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore } = tableInternalData
|
|
40
26
|
const tooltipOpts = $xeTable.computeTooltipOpts
|
|
41
27
|
const { isAllColumnDrag } = $xeTable.resizableOpts
|
|
42
28
|
const columnOpts = $xeTable.computeColumnOpts
|
|
@@ -115,7 +101,7 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
115
101
|
let isMergeCell = false
|
|
116
102
|
// 合并行或列
|
|
117
103
|
if (mergeFooterList.length) {
|
|
118
|
-
const spanRest =
|
|
104
|
+
const spanRest = mergeFooterCellMaps[`${_rowIndex}:${_columnIndex}`]
|
|
119
105
|
if (spanRest) {
|
|
120
106
|
const { rowspan, colspan } = spanRest
|
|
121
107
|
if (!rowspan || !colspan) {
|