vxe-table 4.14.0-beta.0 → 4.14.0-beta.10
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.en.md +1 -70
- package/README.ja-JP.md +1 -70
- package/README.md +9 -18
- package/README.zh-TW.md +1 -69
- package/es/grid/src/grid.js +129 -96
- package/es/index.css +1 -1
- package/es/index.esm.js +2 -2
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +4 -1
- package/es/locale/lang/de-DE.js +4 -1
- package/es/locale/lang/en-US.js +4 -1
- package/es/locale/lang/es-ES.js +4 -1
- package/es/locale/lang/fr-FR.js +4 -1
- package/es/locale/lang/hu-HU.js +4 -1
- package/es/locale/lang/hy-AM.js +4 -1
- package/es/locale/lang/id-ID.js +4 -1
- package/es/locale/lang/it-IT.js +4 -1
- package/es/locale/lang/ja-JP.js +4 -1
- package/es/locale/lang/ko-KR.js +4 -1
- package/es/locale/lang/ms-MY.js +4 -1
- package/es/locale/lang/nb-NO.js +4 -1
- package/es/locale/lang/pt-BR.js +4 -1
- package/es/locale/lang/ru-RU.js +4 -1
- package/es/locale/lang/th-TH.js +4 -1
- package/es/locale/lang/ug-CN.js +4 -1
- package/es/locale/lang/uk-UA.js +4 -1
- package/es/locale/lang/uz-UZ.js +4 -1
- package/es/locale/lang/vi-VN.js +4 -1
- package/es/locale/lang/zh-CHT.js +4 -1
- package/es/locale/lang/zh-CN.js +4 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +0 -4
- package/es/table/module/custom/panel.js +0 -1
- package/es/table/module/edit/hook.js +31 -1
- package/es/table/module/filter/hook.js +1 -1
- package/es/table/module/keyboard/hook.js +2 -2
- package/es/table/src/anime.js +46 -0
- package/es/table/src/body.js +13 -27
- package/es/table/src/cell.js +1 -1
- package/es/table/src/columnInfo.js +5 -0
- package/es/table/src/footer.js +8 -25
- package/es/table/src/header.js +5 -22
- package/es/table/src/table.js +610 -382
- package/es/table/src/util.js +6 -2
- package/es/table/style.css +8 -8
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +8 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +8 -8
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +145 -100
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.common.js +5 -5
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +325 -234
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +4 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +4 -1
- package/lib/locale/lang/de-DE.js +4 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +4 -1
- package/lib/locale/lang/en-US.js +4 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -1
- package/lib/locale/lang/es-ES.js +4 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +4 -1
- package/lib/locale/lang/fr-FR.js +4 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +4 -1
- package/lib/locale/lang/hu-HU.js +4 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +4 -1
- package/lib/locale/lang/hy-AM.js +4 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +4 -1
- package/lib/locale/lang/id-ID.js +4 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +4 -1
- package/lib/locale/lang/it-IT.js +4 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +4 -1
- package/lib/locale/lang/ja-JP.js +4 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +4 -1
- package/lib/locale/lang/ko-KR.js +4 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +4 -1
- package/lib/locale/lang/ms-MY.js +4 -1
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +4 -1
- package/lib/locale/lang/nb-NO.js +4 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +4 -1
- package/lib/locale/lang/pt-BR.js +4 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +4 -1
- package/lib/locale/lang/ru-RU.js +4 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -1
- package/lib/locale/lang/th-TH.js +4 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +4 -1
- package/lib/locale/lang/ug-CN.js +4 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +4 -1
- package/lib/locale/lang/uk-UA.js +4 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +4 -1
- package/lib/locale/lang/uz-UZ.js +4 -1
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +4 -1
- package/lib/locale/lang/vi-VN.js +4 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +4 -1
- package/lib/locale/lang/zh-CHT.js +4 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +4 -1
- package/lib/locale/lang/zh-CN.js +4 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +4 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/hook.js +0 -4
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +0 -1
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/hook.js +30 -1
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/filter/hook.js +1 -1
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +2 -2
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/anime.js +56 -0
- package/lib/table/src/anime.min.js +1 -0
- package/lib/table/src/body.js +6 -29
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +1 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +5 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +6 -23
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +3 -20
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +57 -46
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +11 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +8 -8
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +8 -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/lib/vxe-table/style/style.css +8 -8
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +138 -103
- package/packages/index.ts +2 -2
- package/packages/locale/lang/ar-EG.ts +4 -1
- package/packages/locale/lang/de-DE.ts +4 -1
- package/packages/locale/lang/en-US.ts +4 -1
- package/packages/locale/lang/es-ES.ts +4 -1
- package/packages/locale/lang/fr-FR.ts +4 -1
- package/packages/locale/lang/hu-HU.ts +4 -1
- package/packages/locale/lang/hy-AM.ts +4 -1
- package/packages/locale/lang/id-ID.ts +4 -1
- package/packages/locale/lang/it-IT.ts +4 -1
- package/packages/locale/lang/ja-JP.ts +4 -1
- package/packages/locale/lang/ko-KR.ts +4 -1
- package/packages/locale/lang/ms-MY.ts +4 -1
- package/packages/locale/lang/nb-NO.ts +4 -1
- package/packages/locale/lang/pt-BR.ts +4 -1
- package/packages/locale/lang/ru-RU.ts +4 -1
- package/packages/locale/lang/th-TH.ts +4 -1
- package/packages/locale/lang/ug-CN.ts +4 -1
- package/packages/locale/lang/uk-UA.ts +4 -1
- package/packages/locale/lang/uz-UZ.ts +4 -1
- package/packages/locale/lang/vi-VN.ts +4 -1
- package/packages/locale/lang/zh-CHT.ts +4 -1
- package/packages/locale/lang/zh-CN.ts +4 -1
- package/packages/table/module/custom/hook.ts +0 -4
- package/packages/table/module/custom/panel.ts +0 -1
- package/packages/table/module/edit/hook.ts +29 -1
- package/packages/table/module/filter/hook.ts +1 -1
- package/packages/table/module/keyboard/hook.ts +2 -2
- package/packages/table/src/anime.ts +52 -0
- package/packages/table/src/body.ts +20 -41
- package/packages/table/src/cell.ts +1 -1
- package/packages/table/src/columnInfo.ts +5 -0
- package/packages/table/src/footer.ts +8 -25
- package/packages/table/src/header.ts +5 -22
- package/packages/table/src/table.ts +621 -385
- package/packages/table/src/util.ts +6 -2
- package/packages/ui/index.ts +7 -1
- package/styles/components/table.scss +9 -9
- package/types/all.d.ts +3 -18
- /package/es/{iconfont.1750770364548.ttf → iconfont.1751970630744.ttf} +0 -0
- /package/es/{iconfont.1750770364548.woff → iconfont.1751970630744.woff} +0 -0
- /package/es/{iconfont.1750770364548.woff2 → iconfont.1751970630744.woff2} +0 -0
- /package/lib/{iconfont.1750770364548.ttf → iconfont.1751970630744.ttf} +0 -0
- /package/lib/{iconfont.1750770364548.woff → iconfont.1751970630744.woff} +0 -0
- /package/lib/{iconfont.1750770364548.woff2 → iconfont.1751970630744.woff2} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, ref, Ref, PropType, inject, nextTick, onMounted, onUnmounted } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
@@ -28,7 +28,7 @@ export default defineVxeComponent({
|
|
|
28
28
|
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTablePrivateMethods)
|
|
29
29
|
|
|
30
30
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
31
|
-
const { computeEditOpts, computeMouseOpts, computeCellOffsetWidth, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts,
|
|
31
|
+
const { computeEditOpts, computeMouseOpts, computeCellOffsetWidth, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeResizableOpts, computeVirtualXOpts, computeVirtualYOpts } = $xeTable.getComputeMaps()
|
|
32
32
|
|
|
33
33
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
34
34
|
const refBodyScroll = ref() as Ref<HTMLDivElement>
|
|
@@ -47,7 +47,7 @@ export default defineVxeComponent({
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const renderLine = (rowid: string, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number): VxeComponentSlotType[] => {
|
|
50
|
-
const {
|
|
50
|
+
const { column } = params
|
|
51
51
|
const { afterFullData } = tableInternalData
|
|
52
52
|
const { treeConfig } = tableProps
|
|
53
53
|
const treeOpts = computeTreeOpts.value
|
|
@@ -72,7 +72,7 @@ export default defineVxeComponent({
|
|
|
72
72
|
h('div', {
|
|
73
73
|
class: 'vxe-tree--line',
|
|
74
74
|
style: {
|
|
75
|
-
height: `${$xeTable
|
|
75
|
+
height: `${getRowid($xeTable, afterFullData[0]) === rowid ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
76
76
|
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
77
77
|
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
78
78
|
}
|
|
@@ -330,6 +330,8 @@ export default defineVxeComponent({
|
|
|
330
330
|
tcStyle.minHeight = `${cellHeight}px`
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
// console.log(lastScrollTime)
|
|
334
|
+
|
|
333
335
|
const tdVNs: VxeComponentSlotType[] = []
|
|
334
336
|
if (fixedHiddenColumn && isAllOverflow) {
|
|
335
337
|
tdVNs.push(
|
|
@@ -364,7 +366,7 @@ export default defineVxeComponent({
|
|
|
364
366
|
h('div', {
|
|
365
367
|
colid,
|
|
366
368
|
rowid,
|
|
367
|
-
class: 'vxe-cell--wrapper'
|
|
369
|
+
class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
|
|
368
370
|
}, column.renderCell(cellParams))
|
|
369
371
|
])
|
|
370
372
|
)
|
|
@@ -434,7 +436,7 @@ export default defineVxeComponent({
|
|
|
434
436
|
|
|
435
437
|
return h('td', {
|
|
436
438
|
class: [
|
|
437
|
-
'vxe-body--column',
|
|
439
|
+
'vxe-table--column vxe-body--column',
|
|
438
440
|
colid,
|
|
439
441
|
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
|
|
440
442
|
cellAlign ? `col--${cellAlign}` : '',
|
|
@@ -474,7 +476,7 @@ export default defineVxeComponent({
|
|
|
474
476
|
const $xeGrid = $xeTable.xeGrid
|
|
475
477
|
|
|
476
478
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
|
|
477
|
-
const { hasFixedColumn, treeExpandedFlag,
|
|
479
|
+
const { hasFixedColumn, treeExpandedFlag, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
|
|
478
480
|
const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData
|
|
479
481
|
const checkboxOpts = computeCheckboxOpts.value
|
|
480
482
|
const radioOpts = computeRadioOpts.value
|
|
@@ -482,7 +484,6 @@ export default defineVxeComponent({
|
|
|
482
484
|
const editOpts = computeEditOpts.value
|
|
483
485
|
const rowOpts = computeRowOpts.value
|
|
484
486
|
const columnOpts = computeColumnOpts.value
|
|
485
|
-
const columnDragOpts = computeColumnDragOpts.value
|
|
486
487
|
const { transform, seqMode } = treeOpts
|
|
487
488
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
488
489
|
const rows: any[] = []
|
|
@@ -562,25 +563,13 @@ export default defineVxeComponent({
|
|
|
562
563
|
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
563
564
|
})
|
|
564
565
|
rows.push(
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
|
|
573
|
-
...trOn
|
|
574
|
-
}, {
|
|
575
|
-
default: () => tdVNs
|
|
576
|
-
})
|
|
577
|
-
: h('tr', {
|
|
578
|
-
class: trClass,
|
|
579
|
-
rowid: rowid,
|
|
580
|
-
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
581
|
-
key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
|
|
582
|
-
...trOn
|
|
583
|
-
}, tdVNs)
|
|
566
|
+
h('tr', {
|
|
567
|
+
class: trClass,
|
|
568
|
+
rowid: rowid,
|
|
569
|
+
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
570
|
+
key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
|
|
571
|
+
...trOn
|
|
572
|
+
}, tdVNs)
|
|
584
573
|
)
|
|
585
574
|
// 如果行被展开了
|
|
586
575
|
if (isExpandRow) {
|
|
@@ -715,12 +704,10 @@ export default defineVxeComponent({
|
|
|
715
704
|
|
|
716
705
|
const { fixedColumn, fixedType, tableColumn } = props
|
|
717
706
|
const { spanMethod, footerSpanMethod, mouseConfig } = tableProps
|
|
718
|
-
const { isGroup, tableData,
|
|
707
|
+
const { isGroup, tableData, isColLoading, overflowX, scrollXLoad, scrollYLoad, isAllOverflow, expandColumn, dragRow, dragCol } = tableReactData
|
|
719
708
|
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData
|
|
720
|
-
const rowOpts = computeRowOpts.value
|
|
721
709
|
const emptyOpts = computeEmptyOpts.value
|
|
722
710
|
const mouseOpts = computeMouseOpts.value
|
|
723
|
-
const rowDragOpts = computeRowDragOpts.value
|
|
724
711
|
const expandOpts = computeExpandOpts.value
|
|
725
712
|
|
|
726
713
|
let renderDataList = tableData
|
|
@@ -860,17 +847,9 @@ export default defineVxeComponent({
|
|
|
860
847
|
/**
|
|
861
848
|
* 内容
|
|
862
849
|
*/
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
867
|
-
tag: 'tbody'
|
|
868
|
-
}, {
|
|
869
|
-
default: () => renderRows(fixedType, isOptimizeMode, renderDataList, renderColumnList)
|
|
870
|
-
})
|
|
871
|
-
: h('tbody', {
|
|
872
|
-
ref: refBodyTBody
|
|
873
|
-
}, renderRows(fixedType, isOptimizeMode, renderDataList, renderColumnList))
|
|
850
|
+
h('tbody', {
|
|
851
|
+
ref: refBodyTBody
|
|
852
|
+
}, renderRows(fixedType, isOptimizeMode, renderDataList, renderColumnList))
|
|
874
853
|
]),
|
|
875
854
|
h('div', {
|
|
876
855
|
class: 'vxe-table--checkbox-range'
|
|
@@ -189,7 +189,7 @@ function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams & {
|
|
|
189
189
|
const { showHeaderOverflow } = column
|
|
190
190
|
const tooltipOpts = computeTooltipOpts.value
|
|
191
191
|
const showAllTip = tooltipOpts.showAll
|
|
192
|
-
const headOverflow = XEUtils.
|
|
192
|
+
const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
193
193
|
const showTitle = headOverflow === 'title'
|
|
194
194
|
const showTooltip = headOverflow === true || headOverflow === 'tooltip'
|
|
195
195
|
const ons: Record<string, any> = {}
|
|
@@ -47,6 +47,11 @@ export class ColumnInfo {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
+
if (_vm.aggFunc) {
|
|
51
|
+
if (!$xeTable.handlePivotTableAggregateData && _vm.aggFunc !== true) {
|
|
52
|
+
errLog('vxe.error.errProp', [`column.agg-func=${_vm.aggFunc}`, 'column.agg-func=true'])
|
|
53
|
+
}
|
|
54
|
+
}
|
|
50
55
|
|
|
51
56
|
Object.assign(this, {
|
|
52
57
|
// 基本属性
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, ref, Ref, PropType, inject, nextTick, onMounted, onUnmounted } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
5
5
|
import { updateCellTitle, getPropClass } from '../../ui/src/dom'
|
|
6
|
-
import {
|
|
6
|
+
import { getCalcHeight } from './util'
|
|
7
7
|
|
|
8
8
|
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeTableDefines } from '../../../types'
|
|
9
9
|
|
|
@@ -35,7 +35,7 @@ export default defineVxeComponent({
|
|
|
35
35
|
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
|
|
36
36
|
|
|
37
37
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
38
|
-
const { computeTooltipOpts, computeColumnOpts,
|
|
38
|
+
const { computeTooltipOpts, computeColumnOpts, computeCellOpts, computeFooterCellOpts, computeDefaultRowHeight, computeResizableOpts, computeVirtualXOpts } = $xeTable.getComputeMaps()
|
|
39
39
|
|
|
40
40
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
41
41
|
const refFooterScroll = ref() as Ref<HTMLDivElement>
|
|
@@ -49,7 +49,7 @@ export default defineVxeComponent({
|
|
|
49
49
|
|
|
50
50
|
const { fixedType } = props
|
|
51
51
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
52
|
-
const { scrollXLoad, scrollYLoad, overflowX, currentColumn } = tableReactData
|
|
52
|
+
const { scrollXLoad, scrollYLoad, overflowX, currentColumn, mergeFootFlag } = tableReactData
|
|
53
53
|
const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore } = tableInternalData
|
|
54
54
|
const virtualXOpts = computeVirtualXOpts.value
|
|
55
55
|
const tooltipOpts = computeTooltipOpts.value
|
|
@@ -59,7 +59,7 @@ export default defineVxeComponent({
|
|
|
59
59
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
60
60
|
const cellOpts = computeCellOpts.value
|
|
61
61
|
const footerCellOpts = computeFooterCellOpts.value
|
|
62
|
-
const currCellHeight =
|
|
62
|
+
const currCellHeight = getCalcHeight(footerCellOpts.height) || defaultRowHeight
|
|
63
63
|
|
|
64
64
|
return tableColumn.map((column, $columnIndex) => {
|
|
65
65
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column
|
|
@@ -126,7 +126,7 @@ export default defineVxeComponent({
|
|
|
126
126
|
}
|
|
127
127
|
let isMergeCell = false
|
|
128
128
|
// 合并行或列
|
|
129
|
-
if (mergeFooterList.length) {
|
|
129
|
+
if (mergeFootFlag && mergeFooterList.length) {
|
|
130
130
|
const spanRest = mergeFooterCellMaps[`${_rowIndex}:${_columnIndex}`]
|
|
131
131
|
if (spanRest) {
|
|
132
132
|
const { rowspan, colspan } = spanRest
|
|
@@ -173,7 +173,7 @@ export default defineVxeComponent({
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
return h('td', {
|
|
176
|
-
class: ['vxe-footer--column', column.id, {
|
|
176
|
+
class: ['vxe-table--column vxe-footer--column', column.id, {
|
|
177
177
|
[`col--${footAlign}`]: footAlign,
|
|
178
178
|
[`col--${type}`]: type,
|
|
179
179
|
'col--last': isLastColumn,
|
|
@@ -200,7 +200,7 @@ export default defineVxeComponent({
|
|
|
200
200
|
: [
|
|
201
201
|
h('div', {
|
|
202
202
|
colid,
|
|
203
|
-
class: 'vxe-cell--wrapper'
|
|
203
|
+
class: 'vxe-cell--wrapper vxe-footer-cell--wrapper'
|
|
204
204
|
}, column.renderFooter(cellParams))
|
|
205
205
|
]),
|
|
206
206
|
/**
|
|
@@ -222,28 +222,11 @@ export default defineVxeComponent({
|
|
|
222
222
|
const renderHeads = (isOptimizeMode: boolean, renderColumnList: VxeTableDefines.ColumnInfo[]) => {
|
|
223
223
|
const { fixedType, footerTableData } = props
|
|
224
224
|
const { footerRowClassName, footerRowStyle } = tableProps
|
|
225
|
-
const { isColLoading, isDragColMove } = tableReactData
|
|
226
|
-
const columnOpts = computeColumnOpts.value
|
|
227
|
-
const columnDragOpts = computeColumnDragOpts.value
|
|
228
225
|
|
|
229
226
|
return footerTableData.map((row, $rowIndex) => {
|
|
230
227
|
const _rowIndex = $rowIndex
|
|
231
228
|
const rowParams = { $table: $xeTable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType }
|
|
232
229
|
|
|
233
|
-
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
234
|
-
return h(TransitionGroup, {
|
|
235
|
-
key: $rowIndex,
|
|
236
|
-
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
237
|
-
tag: 'tr',
|
|
238
|
-
class: [
|
|
239
|
-
'vxe-footer--row',
|
|
240
|
-
footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
|
|
241
|
-
],
|
|
242
|
-
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : null
|
|
243
|
-
}, {
|
|
244
|
-
default: () => renderRows(isOptimizeMode, renderColumnList, footerTableData, row, $rowIndex, _rowIndex)
|
|
245
|
-
})
|
|
246
|
-
}
|
|
247
230
|
return h('tr', {
|
|
248
231
|
key: $rowIndex,
|
|
249
232
|
class: [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, ref, Ref, PropType, inject, nextTick, watch, onMounted, onUnmounted } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
5
|
-
import {
|
|
5
|
+
import { getCalcHeight, convertHeaderColumnToRows } from './util'
|
|
6
6
|
|
|
7
7
|
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeTableDefines, VxeColumnPropTypes } from '../../../types'
|
|
8
8
|
|
|
@@ -56,7 +56,7 @@ export default defineVxeComponent({
|
|
|
56
56
|
const cellOpts = computeCellOpts.value
|
|
57
57
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
58
58
|
const headerCellOpts = computeHeaderCellOpts.value
|
|
59
|
-
const currCellHeight =
|
|
59
|
+
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight
|
|
60
60
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts
|
|
61
61
|
|
|
62
62
|
return cols.map((column, $columnIndex) => {
|
|
@@ -146,7 +146,7 @@ export default defineVxeComponent({
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
return h('th', {
|
|
149
|
-
class: ['vxe-header--column', colid, {
|
|
149
|
+
class: ['vxe-table--column vxe-header--column', colid, {
|
|
150
150
|
[`col--${headAlign}`]: headAlign,
|
|
151
151
|
[`col--${type}`]: type,
|
|
152
152
|
'col--last': isLastColumn,
|
|
@@ -183,7 +183,7 @@ export default defineVxeComponent({
|
|
|
183
183
|
: [
|
|
184
184
|
h('div', {
|
|
185
185
|
colid,
|
|
186
|
-
class: 'vxe-cell--wrapper'
|
|
186
|
+
class: 'vxe-cell--wrapper vxe-header-cell--wrapper'
|
|
187
187
|
}, column.renderHeader(cellParams))
|
|
188
188
|
]),
|
|
189
189
|
/**
|
|
@@ -203,27 +203,10 @@ export default defineVxeComponent({
|
|
|
203
203
|
const renderHeads = (isGroup: boolean, isOptimizeMode: boolean, headerGroups: VxeTableDefines.ColumnInfo[][]) => {
|
|
204
204
|
const { fixedType } = props
|
|
205
205
|
const { headerRowClassName, headerRowStyle } = tableProps
|
|
206
|
-
const { isColLoading, isDragColMove } = tableReactData
|
|
207
|
-
const columnOpts = computeColumnOpts.value
|
|
208
|
-
const columnDragOpts = computeColumnDragOpts.value
|
|
209
206
|
|
|
210
207
|
return headerGroups.map((cols, $rowIndex) => {
|
|
211
208
|
const params = { $table: $xeTable, $rowIndex, fixed: fixedType, type: renderType }
|
|
212
209
|
|
|
213
|
-
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
214
|
-
return h(TransitionGroup, {
|
|
215
|
-
key: $rowIndex,
|
|
216
|
-
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
217
|
-
tag: 'tr',
|
|
218
|
-
class: [
|
|
219
|
-
'vxe-header--row',
|
|
220
|
-
headerRowClassName ? (XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName) : ''
|
|
221
|
-
],
|
|
222
|
-
style: headerRowStyle ? (XEUtils.isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle) : null
|
|
223
|
-
}, {
|
|
224
|
-
default: () => renderRows(isGroup, isOptimizeMode, cols, $rowIndex)
|
|
225
|
-
})
|
|
226
|
-
}
|
|
227
210
|
return h('tr', {
|
|
228
211
|
key: $rowIndex,
|
|
229
212
|
class: [
|