vxe-table 3.18.0 → 3.18.2
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/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +58 -20
- package/es/table/module/filter/mixin.js +12 -10
- package/es/table/module/menu/mixin.js +16 -9
- package/es/table/module/validator/mixin.js +4 -2
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/footer.js +7 -5
- package/es/table/src/header.js +67 -28
- package/es/table/src/methods.js +577 -85
- package/es/table/src/props.js +23 -6
- package/es/table/src/store.js +8 -0
- package/es/table/src/table.js +67 -26
- package/es/table/src/util.js +70 -2
- package/es/table/style.css +11 -17
- 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 +11 -17
- 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 +1002 -200
- 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/edit/mixin.js +55 -16
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/filter/mixin.js +12 -10
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +20 -13
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +4 -2
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +7 -5
- package/lib/table/src/header.js +82 -25
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +647 -94
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +11 -3
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/store.js +15 -0
- package/lib/table/src/store.min.js +1 -0
- package/lib/table/src/table.js +74 -25
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +74 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +11 -17
- 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 +11 -17
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/edit/mixin.ts +59 -23
- package/packages/table/module/filter/mixin.ts +17 -13
- package/packages/table/module/menu/mixin.ts +16 -9
- package/packages/table/module/validator/mixin.ts +8 -4
- package/packages/table/src/column.ts +4 -2
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/footer.ts +11 -9
- package/packages/table/src/header.ts +76 -34
- package/packages/table/src/methods.ts +607 -90
- package/packages/table/src/props.ts +29 -12
- package/packages/table/src/store.ts +15 -0
- package/packages/table/src/table.ts +79 -24
- package/packages/table/src/util.ts +76 -2
- package/styles/components/table.scss +33 -55
- /package/es/{iconfont.1756083626568.ttf → iconfont.1756452257212.ttf} +0 -0
- /package/es/{iconfont.1756083626568.woff → iconfont.1756452257212.woff} +0 -0
- /package/es/{iconfont.1756083626568.woff2 → iconfont.1756452257212.woff2} +0 -0
- /package/lib/{iconfont.1756083626568.ttf → iconfont.1756452257212.ttf} +0 -0
- /package/lib/{iconfont.1756083626568.woff → iconfont.1756452257212.woff} +0 -0
- /package/lib/{iconfont.1756083626568.woff2 → iconfont.1756452257212.woff2} +0 -0
|
@@ -15,7 +15,7 @@ export const tableProps = {
|
|
|
15
15
|
// 表格的最小高度
|
|
16
16
|
minHeight: {
|
|
17
17
|
type: [Number, String] as PropType<VxeTablePropTypes.MinHeight>,
|
|
18
|
-
default: () =>
|
|
18
|
+
default: () => null
|
|
19
19
|
},
|
|
20
20
|
// 表格的最大高度
|
|
21
21
|
maxHeight: [Number, String] as PropType<VxeTablePropTypes.MaxHeight>,
|
|
@@ -131,23 +131,40 @@ export const tableProps = {
|
|
|
131
131
|
// 给行附加样式
|
|
132
132
|
rowStyle: [Object, Function],
|
|
133
133
|
// 给表头行附加样式
|
|
134
|
-
headerRowStyle: [Object, Function]
|
|
134
|
+
headerRowStyle: [Object, Function] as PropType<VxeTablePropTypes.HeaderRowStyle>,
|
|
135
135
|
// 给表尾行附加样式
|
|
136
|
-
footerRowStyle: [Object, Function]
|
|
137
|
-
//
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
footerRowStyle: [Object, Function] as PropType<VxeTablePropTypes.FooterRowStyle>,
|
|
137
|
+
// 用于分组表头,显示为自定义列头,配合 mergeHeaderCells 灵活实现自定义合并
|
|
138
|
+
showCustomHeader: {
|
|
139
|
+
type: Boolean as PropType<VxeTablePropTypes.ShowCustomHeader>,
|
|
140
|
+
default: () => getConfig().table.showCustomHeader
|
|
141
|
+
},
|
|
142
|
+
// 临时合并指定的表头单元格
|
|
143
|
+
mergeHeaderCells: Array as PropType<VxeTablePropTypes.MergeHeaderCells>,
|
|
144
|
+
// 临时合并指定的单元格
|
|
145
|
+
mergeCells: Array as PropType<VxeTablePropTypes.MergeCells>,
|
|
146
|
+
// 临时合并指定的表尾单元格
|
|
147
|
+
mergeFooterCells: Array as PropType<VxeTablePropTypes.MergeFooterCells>,
|
|
148
|
+
mergeFooterItems: Array as PropType<VxeTablePropTypes.MergeFooterItems>,
|
|
141
149
|
// 自定义合并行或列的方法
|
|
142
|
-
spanMethod: Function
|
|
150
|
+
spanMethod: Function as PropType<VxeTablePropTypes.SpanMethod>,
|
|
143
151
|
// 表尾合并行或列
|
|
144
|
-
footerSpanMethod: Function
|
|
152
|
+
footerSpanMethod: Function as PropType<VxeTablePropTypes.FooterSpanMethod>,
|
|
145
153
|
// 设置所有内容过长时显示为省略号
|
|
146
|
-
showOverflow: {
|
|
154
|
+
showOverflow: {
|
|
155
|
+
type: [Boolean, String] as PropType<VxeTablePropTypes.ShowOverflow>,
|
|
156
|
+
default: () => getConfig().table.showOverflow
|
|
157
|
+
},
|
|
147
158
|
// 设置表头所有内容过长时显示为省略号
|
|
148
|
-
showHeaderOverflow: {
|
|
159
|
+
showHeaderOverflow: {
|
|
160
|
+
type: [Boolean, String] as PropType<VxeTablePropTypes.ShowHeaderOverflow>,
|
|
161
|
+
default: () => getConfig().table.showHeaderOverflow
|
|
162
|
+
},
|
|
149
163
|
// 设置表尾所有内容过长时显示为省略号
|
|
150
|
-
showFooterOverflow: {
|
|
164
|
+
showFooterOverflow: {
|
|
165
|
+
type: [Boolean, String] as PropType<VxeTablePropTypes.ShowFooterOverflow>,
|
|
166
|
+
default: () => getConfig().table.showFooterOverflow
|
|
167
|
+
},
|
|
151
168
|
|
|
152
169
|
/** 高级属性 */
|
|
153
170
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
2
|
+
|
|
3
|
+
interface CrossTableDragRowObj {
|
|
4
|
+
row: any
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// 跨表拖拽
|
|
8
|
+
export const crossTableDragRowGlobal: CrossTableDragRowObj = {
|
|
9
|
+
row: null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function getCrossTableDragRowInfo ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
13
|
+
const crossTableDragRowInfo = ($xeTable as any).crossTableDragRowInfo as CrossTableDragRowObj
|
|
14
|
+
return crossTableDragRowInfo
|
|
15
|
+
}
|
|
@@ -11,6 +11,7 @@ import TableFooterComponent from './footer'
|
|
|
11
11
|
import { tableProps } from './props'
|
|
12
12
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
13
13
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
14
|
+
import { crossTableDragRowGlobal, getCrossTableDragRowInfo } from './store'
|
|
14
15
|
import TableCustomPanelComponent from '../module/custom/panel'
|
|
15
16
|
import TableFilterPanelComponent from '../module/filter/panel'
|
|
16
17
|
import TableImportPanelComponent from '../module/export/import-panel'
|
|
@@ -39,13 +40,22 @@ function handleUpdateMergeBodyCells ($xeTable: VxeTableConstructor & VxeTablePri
|
|
|
39
40
|
$xeTable.setMergeCells(merges)
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
function handleUpdateMergeHeaderCells ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, merges: VxeTableDefines.MergeOptions | VxeTableDefines.MergeOptions[]) {
|
|
44
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
45
|
+
|
|
46
|
+
internalData.mergeHeaderList = []
|
|
47
|
+
internalData.mergeHeaderMaps = {}
|
|
48
|
+
internalData.mergeHeaderCellMaps = {}
|
|
49
|
+
$xeTable.setMergeHeaderCells(merges)
|
|
50
|
+
}
|
|
51
|
+
|
|
42
52
|
function handleUpdateMergeFooterCells ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, merges: VxeTableDefines.MergeOptions | VxeTableDefines.MergeOptions[]) {
|
|
43
53
|
const internalData = $xeTable as unknown as TableInternalData
|
|
44
54
|
|
|
45
55
|
internalData.mergeFooterList = []
|
|
46
56
|
internalData.mergeFooterMaps = {}
|
|
47
57
|
internalData.mergeFooterCellMaps = {}
|
|
48
|
-
$xeTable.
|
|
58
|
+
$xeTable.setMergeFooterCells(merges)
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
function handleKeyField ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
@@ -134,6 +144,7 @@ function renderEmptyBody (h: CreateElement, $xeTable: VxeTableConstructor & VxeT
|
|
|
134
144
|
const renderDragTipContents = (h: CreateElement, $xeTable: VxeTableConstructor & VxeTablePrivateMethods) => {
|
|
135
145
|
const props = $xeTable
|
|
136
146
|
const reactData = $xeTable as unknown as TableReactData
|
|
147
|
+
const crossTableDragRowInfo = getCrossTableDragRowInfo($xeTable)
|
|
137
148
|
|
|
138
149
|
const { dragConfig } = props
|
|
139
150
|
const { dragRow, dragCol, dragTipText } = reactData
|
|
@@ -143,9 +154,10 @@ const renderDragTipContents = (h: CreateElement, $xeTable: VxeTableConstructor &
|
|
|
143
154
|
const rTipSlot = rowDragSlots.tip || (dragConfig && dragConfig.slots ? dragConfig.slots.rowTip : null)
|
|
144
155
|
const columnDragSlots = columnDragOpts.slots || {}
|
|
145
156
|
const cTipSlot = columnDragSlots.tip
|
|
157
|
+
const dRow = dragRow || (rowDragOpts.isCrossTableDrag ? crossTableDragRowInfo.row : null)
|
|
146
158
|
|
|
147
|
-
if (
|
|
148
|
-
return $xeTable.callSlot(rTipSlot, { row:
|
|
159
|
+
if (dRow && rTipSlot) {
|
|
160
|
+
return $xeTable.callSlot(rTipSlot, { row: dRow }, h)
|
|
149
161
|
}
|
|
150
162
|
if (dragCol && cTipSlot) {
|
|
151
163
|
return $xeTable.callSlot(cTipSlot, { column: dragCol }, h)
|
|
@@ -155,12 +167,14 @@ const renderDragTipContents = (h: CreateElement, $xeTable: VxeTableConstructor &
|
|
|
155
167
|
|
|
156
168
|
const renderDragTip = (h: CreateElement, $xeTable: VxeTableConstructor & VxeTablePrivateMethods) => {
|
|
157
169
|
const reactData = $xeTable as unknown as TableReactData
|
|
170
|
+
const crossTableDragRowInfo = getCrossTableDragRowInfo($xeTable)
|
|
158
171
|
|
|
159
172
|
const { dragRow, dragCol } = reactData
|
|
160
173
|
const rowOpts = $xeTable.computeRowOpts
|
|
161
174
|
const columnOpts = $xeTable.computeColumnOpts
|
|
162
175
|
const rowDragOpts = $xeTable.computeRowDragOpts
|
|
163
176
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
177
|
+
const dRow = dragRow || (rowDragOpts.isCrossTableDrag ? crossTableDragRowInfo.row : null)
|
|
164
178
|
|
|
165
179
|
if (rowOpts.drag || columnOpts.drag) {
|
|
166
180
|
return h('div', {
|
|
@@ -178,7 +192,7 @@ const renderDragTip = (h: CreateElement, $xeTable: VxeTableConstructor & VxeTabl
|
|
|
178
192
|
'is--guides': columnDragOpts.showGuidesStatus
|
|
179
193
|
}]
|
|
180
194
|
}),
|
|
181
|
-
(
|
|
195
|
+
(dRow && rowDragOpts.showDragTip) || (dragCol && columnDragOpts.showDragTip)
|
|
182
196
|
? h('div', {
|
|
183
197
|
ref: 'refDragTipElem',
|
|
184
198
|
class: 'vxe-table--drag-sort-tip'
|
|
@@ -190,7 +204,7 @@ const renderDragTip = (h: CreateElement, $xeTable: VxeTableConstructor & VxeTabl
|
|
|
190
204
|
class: 'vxe-table--drag-sort-tip-status'
|
|
191
205
|
}, [
|
|
192
206
|
h('span', {
|
|
193
|
-
class: ['vxe-table--drag-sort-tip-normal-status',
|
|
207
|
+
class: ['vxe-table--drag-sort-tip-normal-status', dRow ? getIcon().TABLE_DRAG_STATUS_ROW : getIcon().TABLE_DRAG_STATUS_COLUMN]
|
|
194
208
|
}),
|
|
195
209
|
h('span', {
|
|
196
210
|
class: ['vxe-table--drag-sort-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
|
|
@@ -353,7 +367,10 @@ function renderScrollX (h: CreateElement, $xeTable: VxeTableConstructor & VxeTab
|
|
|
353
367
|
ref: 'refScrollXSpaceElem',
|
|
354
368
|
class: 'vxe-table--scroll-x-space'
|
|
355
369
|
})
|
|
356
|
-
])
|
|
370
|
+
]),
|
|
371
|
+
h('div', {
|
|
372
|
+
class: 'vxe-table--scroll-x-handle-appearance'
|
|
373
|
+
})
|
|
357
374
|
]),
|
|
358
375
|
h('div', {
|
|
359
376
|
ref: 'refScrollXRightCornerElem',
|
|
@@ -503,9 +520,8 @@ export default {
|
|
|
503
520
|
},
|
|
504
521
|
data () {
|
|
505
522
|
const xID = XEUtils.uniqueId()
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
tId: xID,
|
|
523
|
+
|
|
524
|
+
const reactData: TableReactData = {
|
|
509
525
|
// 低性能的静态列
|
|
510
526
|
staticColumns: [],
|
|
511
527
|
// 渲染的列分组
|
|
@@ -526,6 +542,8 @@ export default {
|
|
|
526
542
|
scrollbarWidth: 0,
|
|
527
543
|
// 横向滚动条的高度
|
|
528
544
|
scrollbarHeight: 0,
|
|
545
|
+
// 最后滚动时间戳
|
|
546
|
+
lastScrollTime: 0,
|
|
529
547
|
// 行高
|
|
530
548
|
rowHeight: 0,
|
|
531
549
|
// 表格父容器的高度
|
|
@@ -551,9 +569,13 @@ export default {
|
|
|
551
569
|
expandColumn: null,
|
|
552
570
|
checkboxColumn: null,
|
|
553
571
|
radioColumn: null,
|
|
554
|
-
hasFixedColumn: false,
|
|
555
572
|
// 树节点列信息
|
|
556
573
|
treeNodeColumn: null,
|
|
574
|
+
hasFixedColumn: false,
|
|
575
|
+
// 刷新列标识,当列筛选被改变时,触发表格刷新数据
|
|
576
|
+
upDataFlag: 0,
|
|
577
|
+
// 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
|
578
|
+
reColumnFlag: 0,
|
|
557
579
|
// 初始化标识
|
|
558
580
|
initStore: {
|
|
559
581
|
filter: false,
|
|
@@ -561,11 +583,6 @@ export default {
|
|
|
561
583
|
export: false,
|
|
562
584
|
custom: false
|
|
563
585
|
},
|
|
564
|
-
customColumnList: [],
|
|
565
|
-
// 刷新列标识,当列筛选被改变时,触发表格刷新数据
|
|
566
|
-
upDataFlag: 0,
|
|
567
|
-
// 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
|
568
|
-
reColumnFlag: 0,
|
|
569
586
|
// 自定义列相关的信息
|
|
570
587
|
customStore: {
|
|
571
588
|
btnEl: null,
|
|
@@ -579,6 +596,7 @@ export default {
|
|
|
579
596
|
oldFixedMaps: {},
|
|
580
597
|
oldVisibleMaps: {}
|
|
581
598
|
},
|
|
599
|
+
customColumnList: [],
|
|
582
600
|
// 当前选中的筛选列
|
|
583
601
|
filterStore: {
|
|
584
602
|
isAllSelected: false,
|
|
@@ -647,6 +665,7 @@ export default {
|
|
|
647
665
|
tooltipStore: {
|
|
648
666
|
row: null,
|
|
649
667
|
column: null,
|
|
668
|
+
content: null,
|
|
650
669
|
visible: false,
|
|
651
670
|
currOpts: {}
|
|
652
671
|
},
|
|
@@ -679,8 +698,8 @@ export default {
|
|
|
679
698
|
columns: [],
|
|
680
699
|
isPrint: false,
|
|
681
700
|
hasFooter: false,
|
|
682
|
-
hasTree: false,
|
|
683
701
|
hasMerge: false,
|
|
702
|
+
hasTree: false,
|
|
684
703
|
hasColgroup: false,
|
|
685
704
|
visible: false
|
|
686
705
|
},
|
|
@@ -714,6 +733,8 @@ export default {
|
|
|
714
733
|
pendingRowFlag: 1,
|
|
715
734
|
insertRowFlag: 1,
|
|
716
735
|
removeRowFlag: 1,
|
|
736
|
+
|
|
737
|
+
mergeHeadFlag: 1,
|
|
717
738
|
mergeBodyFlag: 1,
|
|
718
739
|
mergeFootFlag: 1,
|
|
719
740
|
|
|
@@ -733,6 +754,8 @@ export default {
|
|
|
733
754
|
scrollXWidth: 0,
|
|
734
755
|
isScrollXBig: false,
|
|
735
756
|
|
|
757
|
+
lazScrollLoading: false,
|
|
758
|
+
|
|
736
759
|
rowExpandHeightFlag: 1,
|
|
737
760
|
calcCellHeightFlag: 1,
|
|
738
761
|
resizeHeightFlag: 1,
|
|
@@ -740,19 +763,27 @@ export default {
|
|
|
740
763
|
|
|
741
764
|
isCustomStatus: false,
|
|
742
765
|
|
|
743
|
-
|
|
766
|
+
isCrossDragRow: false,
|
|
744
767
|
dragRow: null,
|
|
745
|
-
|
|
768
|
+
isCrossDragCol: false,
|
|
746
769
|
dragCol: null,
|
|
747
770
|
dragTipText: '',
|
|
748
771
|
|
|
749
772
|
isDragResize: false,
|
|
750
773
|
isRowLoading: false,
|
|
751
|
-
isColLoading: false
|
|
774
|
+
isColLoading: false
|
|
775
|
+
}
|
|
752
776
|
|
|
777
|
+
return {
|
|
778
|
+
xID,
|
|
779
|
+
...reactData,
|
|
780
|
+
|
|
781
|
+
// 私有属性
|
|
753
782
|
reScrollFlag: 0,
|
|
754
783
|
reLayoutFlag: 0,
|
|
755
|
-
footFlag: 0
|
|
784
|
+
footFlag: 0,
|
|
785
|
+
mergeFooteCellFlag: 0,
|
|
786
|
+
crossTableDragRowInfo: crossTableDragRowGlobal
|
|
756
787
|
}
|
|
757
788
|
},
|
|
758
789
|
computed: {
|
|
@@ -1492,10 +1523,23 @@ export default {
|
|
|
1492
1523
|
|
|
1493
1524
|
handleUpdateMergeBodyCells($xeTable, value)
|
|
1494
1525
|
},
|
|
1495
|
-
|
|
1526
|
+
mergeHeaderCells (value: any) {
|
|
1496
1527
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1497
1528
|
|
|
1498
|
-
|
|
1529
|
+
handleUpdateMergeHeaderCells($xeTable, value)
|
|
1530
|
+
},
|
|
1531
|
+
mergeFooterCells () {
|
|
1532
|
+
this.mergeFooteCellFlag++
|
|
1533
|
+
},
|
|
1534
|
+
mergeFooterItems () {
|
|
1535
|
+
this.mergeFooteCellFlag++
|
|
1536
|
+
},
|
|
1537
|
+
mergeFooteCellFlag () {
|
|
1538
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1539
|
+
const props = $xeTable
|
|
1540
|
+
|
|
1541
|
+
const mFooterCells = props.mergeFooterCells || props.mergeFooterItems
|
|
1542
|
+
handleUpdateMergeFooterCells($xeTable, mFooterCells || [])
|
|
1499
1543
|
},
|
|
1500
1544
|
|
|
1501
1545
|
computeRowGroupFields (val: any) {
|
|
@@ -1545,6 +1589,7 @@ export default {
|
|
|
1545
1589
|
const currentColumnOpts = $xeTable.computeCurrentColumnOpts
|
|
1546
1590
|
const keyboardOpts = $xeTable.computeKeyboardOpts
|
|
1547
1591
|
const aggregateOpts = $xeTable.computeAggregateOpts
|
|
1592
|
+
const rowDragOpts = $xeTable.computeRowDragOpts
|
|
1548
1593
|
const { groupFields } = aggregateOpts
|
|
1549
1594
|
|
|
1550
1595
|
if (props.rowId) {
|
|
@@ -1652,7 +1697,10 @@ export default {
|
|
|
1652
1697
|
}
|
|
1653
1698
|
}
|
|
1654
1699
|
if (treeConfig && rowOpts.drag && !treeOpts.transform) {
|
|
1655
|
-
warnLog('vxe.error.notSupportProp', ['
|
|
1700
|
+
warnLog('vxe.error.notSupportProp', ['row-config.drag', 'tree-config.transform=false', 'tree-config.transform=true'])
|
|
1701
|
+
}
|
|
1702
|
+
if (treeConfig && rowDragOpts.isCrossTableDrag && !rowDragOpts.isCrossDrag) {
|
|
1703
|
+
errLog('vxe.error.reqSupportProp', ['tree-config & row-drag-config.isCrossTableDrag', 'row-drag-config.isCrossDrag'])
|
|
1656
1704
|
}
|
|
1657
1705
|
if (props.dragConfig) {
|
|
1658
1706
|
warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config'])
|
|
@@ -1973,6 +2021,7 @@ export default {
|
|
|
1973
2021
|
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore } = reactData
|
|
1974
2022
|
const { leftList, rightList } = columnStore
|
|
1975
2023
|
const loadingSlot = slots.loading
|
|
2024
|
+
const rowDragOpts = $xeTable.computeRowDragOpts
|
|
1976
2025
|
const tableTipConfig = $xeTable.computeTableTipConfig
|
|
1977
2026
|
const validTipConfig = $xeTable.computeValidTipConfig
|
|
1978
2027
|
const validOpts = $xeTable.computeValidOpts
|
|
@@ -1992,6 +2041,11 @@ export default {
|
|
|
1992
2041
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
1993
2042
|
const scrollbarXToTop = $xeTable.computeScrollbarXToTop
|
|
1994
2043
|
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft
|
|
2044
|
+
const { isCrossTableDrag } = rowDragOpts
|
|
2045
|
+
const rwOns: Record<string, any> = {}
|
|
2046
|
+
if (isCrossTableDrag && !tableData.length) {
|
|
2047
|
+
rwOns.onDragover = $xeTable.handleCrossTableRowDragoverEmptyEvent
|
|
2048
|
+
}
|
|
1995
2049
|
return h('div', {
|
|
1996
2050
|
ref: 'refElem',
|
|
1997
2051
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
@@ -2058,7 +2112,8 @@ export default {
|
|
|
2058
2112
|
]),
|
|
2059
2113
|
h('div', {
|
|
2060
2114
|
key: 'tw',
|
|
2061
|
-
class: 'vxe-table--render-wrapper'
|
|
2115
|
+
class: 'vxe-table--render-wrapper',
|
|
2116
|
+
on: rwOns
|
|
2062
2117
|
}, scrollbarXToTop
|
|
2063
2118
|
? [
|
|
2064
2119
|
renderScrollX(h, $xeTable),
|
|
@@ -73,6 +73,7 @@ export function createInternalData (): TableInternalData {
|
|
|
73
73
|
tableFullColumn: [],
|
|
74
74
|
// 渲染所有列
|
|
75
75
|
visibleColumn: [],
|
|
76
|
+
|
|
76
77
|
// 全量数据集(包括当前和已删除)
|
|
77
78
|
fullAllDataRowIdData: {},
|
|
78
79
|
// 数据集(仅当前)
|
|
@@ -84,16 +85,22 @@ export function createInternalData (): TableInternalData {
|
|
|
84
85
|
fullColumnIdData: {},
|
|
85
86
|
fullColumnFieldData: {},
|
|
86
87
|
|
|
88
|
+
// 合并表头单元格的数据
|
|
89
|
+
mergeHeaderList: [],
|
|
90
|
+
mergeHeaderMaps: {},
|
|
91
|
+
// 已合并单元格数据集合
|
|
92
|
+
mergeHeaderCellMaps: {},
|
|
87
93
|
// 合并单元格的数据
|
|
88
94
|
mergeBodyList: [],
|
|
89
95
|
mergeBodyMaps: {},
|
|
96
|
+
// 已合并单元格数据集合
|
|
97
|
+
mergeBodyCellMaps: {},
|
|
90
98
|
// 合并表尾的数据
|
|
91
99
|
mergeFooterList: [],
|
|
92
100
|
mergeFooterMaps: {},
|
|
93
|
-
// 已合并单元格数据集合
|
|
94
|
-
mergeBodyCellMaps: {},
|
|
95
101
|
// 已合并表尾数据集合
|
|
96
102
|
mergeFooterCellMaps: {},
|
|
103
|
+
|
|
97
104
|
// 已展开的行集合
|
|
98
105
|
rowExpandedMaps: {},
|
|
99
106
|
// 懒加载中的展开行的集合
|
|
@@ -194,6 +201,73 @@ export const convertHeaderColumnToRows = (originColumns: any) => {
|
|
|
194
201
|
return rows
|
|
195
202
|
}
|
|
196
203
|
|
|
204
|
+
export function convertHeaderToGridRows (spanColumns: VxeTableDefines.ColumnInfo[][]) {
|
|
205
|
+
const rSize = spanColumns.length
|
|
206
|
+
const cSize = spanColumns[0].reduce((sum, cell) => sum + cell.colSpan, 0)
|
|
207
|
+
|
|
208
|
+
const occupiedRows: boolean[][] = []
|
|
209
|
+
const fullRows: any[][] = []
|
|
210
|
+
for (let rIndex = 0; rIndex < rSize; rIndex++) {
|
|
211
|
+
const oCols: boolean[] = []
|
|
212
|
+
const dCols: string[] = []
|
|
213
|
+
for (let cIndex = 0; cIndex < cSize; cIndex++) {
|
|
214
|
+
oCols.push(false)
|
|
215
|
+
dCols.push('')
|
|
216
|
+
}
|
|
217
|
+
occupiedRows.push(oCols)
|
|
218
|
+
fullRows.push(dCols)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
for (let rIndex = 0; rIndex < rSize; rIndex++) {
|
|
222
|
+
let currColIndex = 0
|
|
223
|
+
for (const column of spanColumns[rIndex]) {
|
|
224
|
+
const { colSpan, rowSpan } = column
|
|
225
|
+
let startColIndex = -1
|
|
226
|
+
for (let ccIndex = currColIndex; ccIndex <= cSize - colSpan; ccIndex++) {
|
|
227
|
+
let oFlag = true
|
|
228
|
+
for (let csIndex = 0; csIndex < colSpan; csIndex++) {
|
|
229
|
+
if (occupiedRows[rIndex][ccIndex + csIndex]) {
|
|
230
|
+
oFlag = false
|
|
231
|
+
break
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (oFlag) {
|
|
235
|
+
startColIndex = ccIndex
|
|
236
|
+
break
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (startColIndex === -1) {
|
|
240
|
+
for (let j = 0; j <= cSize - colSpan; j++) {
|
|
241
|
+
let oFlag = true
|
|
242
|
+
for (let k = 0; k < colSpan; k++) {
|
|
243
|
+
if (occupiedRows[rIndex][j + k]) {
|
|
244
|
+
oFlag = false
|
|
245
|
+
break
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (oFlag) {
|
|
249
|
+
startColIndex = j
|
|
250
|
+
break
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (startColIndex === -1) {
|
|
254
|
+
// error
|
|
255
|
+
break
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
for (let srIndex = rIndex; srIndex < rIndex + rowSpan; srIndex++) {
|
|
260
|
+
for (let scIndex = startColIndex; scIndex < startColIndex + colSpan; scIndex++) {
|
|
261
|
+
occupiedRows[srIndex][scIndex] = true
|
|
262
|
+
fullRows[srIndex][scIndex] = column
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
currColIndex = startColIndex + colSpan
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return fullRows
|
|
269
|
+
}
|
|
270
|
+
|
|
197
271
|
export function restoreScrollLocation ($xeTable: VxeTableConstructor, scrollLeft: number, scrollTop: number) {
|
|
198
272
|
const internalData = $xeTable as unknown as TableInternalData
|
|
199
273
|
|
|
@@ -645,9 +645,6 @@ $btnThemeList: (
|
|
|
645
645
|
overflow-x: scroll;
|
|
646
646
|
height: 18px;
|
|
647
647
|
}
|
|
648
|
-
.vxe-table--scroll-x-wrapper {
|
|
649
|
-
height: 100%;
|
|
650
|
-
}
|
|
651
648
|
.vxe-table--scroll-y-handle,
|
|
652
649
|
.vxe-table--scroll-y-wrapper {
|
|
653
650
|
width: 100%;
|
|
@@ -891,13 +888,6 @@ $btnThemeList: (
|
|
|
891
888
|
right: auto;
|
|
892
889
|
left: -0.3em;
|
|
893
890
|
}
|
|
894
|
-
.vxe-header--column {
|
|
895
|
-
&:last-child {
|
|
896
|
-
& > .vxe-cell--col-resizable {
|
|
897
|
-
left: 0;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
891
|
}
|
|
902
892
|
|
|
903
893
|
.vxe-body--column {
|
|
@@ -1415,32 +1405,25 @@ $btnThemeList: (
|
|
|
1415
1405
|
.vxe-table--scroll-y-bottom-corner {
|
|
1416
1406
|
border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1417
1407
|
}
|
|
1418
|
-
.vxe-table--scroll-x-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
z-index: 1;
|
|
1426
|
-
pointer-events: none;
|
|
1427
|
-
}
|
|
1408
|
+
.vxe-table--scroll-x-handle-appearance {
|
|
1409
|
+
position: absolute;
|
|
1410
|
+
left: 0;
|
|
1411
|
+
width: 100%;
|
|
1412
|
+
height: 100%;
|
|
1413
|
+
z-index: 1;
|
|
1414
|
+
pointer-events: none;
|
|
1428
1415
|
}
|
|
1429
1416
|
&.sx-pos--top {
|
|
1430
|
-
.vxe-table--scroll-x-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
border-bottom: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1434
|
-
}
|
|
1417
|
+
.vxe-table--scroll-x-handle-appearance {
|
|
1418
|
+
top: 0;
|
|
1419
|
+
border-bottom: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1435
1420
|
}
|
|
1436
1421
|
}
|
|
1437
1422
|
&.sx-pos--bottom {
|
|
1438
|
-
.vxe-table--scroll-x-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1443
|
-
}
|
|
1423
|
+
.vxe-table--scroll-x-handle-appearance {
|
|
1424
|
+
bottom: 0;
|
|
1425
|
+
height: calc(100% + var(--vxe-ui-table-border-width));
|
|
1426
|
+
border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1444
1427
|
}
|
|
1445
1428
|
}
|
|
1446
1429
|
}
|
|
@@ -1514,32 +1497,25 @@ $btnThemeList: (
|
|
|
1514
1497
|
}
|
|
1515
1498
|
}
|
|
1516
1499
|
}
|
|
1517
|
-
.vxe-table--scroll-y-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
z-index: 1;
|
|
1525
|
-
pointer-events: none;
|
|
1526
|
-
}
|
|
1500
|
+
.vxe-table--scroll-y-handle-appearance {
|
|
1501
|
+
position: absolute;
|
|
1502
|
+
top: 0;
|
|
1503
|
+
width: 100%;
|
|
1504
|
+
height: 100%;
|
|
1505
|
+
z-index: 1;
|
|
1506
|
+
pointer-events: none;
|
|
1527
1507
|
}
|
|
1528
1508
|
&.sy-pos--left {
|
|
1529
|
-
.vxe-table--scroll-y-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
border-right: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1533
|
-
}
|
|
1509
|
+
.vxe-table--scroll-y-handle-appearance {
|
|
1510
|
+
left: 0;
|
|
1511
|
+
border-right: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1534
1512
|
}
|
|
1535
1513
|
}
|
|
1536
1514
|
&.sy-pos--right {
|
|
1537
|
-
.vxe-table--scroll-y-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
border-left: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1542
|
-
}
|
|
1515
|
+
.vxe-table--scroll-y-handle-appearance {
|
|
1516
|
+
right: 0;
|
|
1517
|
+
width: calc(100% + var(--vxe-ui-table-border-width));
|
|
1518
|
+
border-left: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1543
1519
|
}
|
|
1544
1520
|
}
|
|
1545
1521
|
}
|
|
@@ -2159,8 +2135,8 @@ $btnThemeList: (
|
|
|
2159
2135
|
position: absolute;
|
|
2160
2136
|
left: 50%;
|
|
2161
2137
|
font-size: 12px;
|
|
2162
|
-
line-height:
|
|
2163
|
-
transform:
|
|
2138
|
+
line-height: 1em;
|
|
2139
|
+
transform: translate(-50%, -50%);
|
|
2164
2140
|
text-align: left;
|
|
2165
2141
|
z-index: 4;
|
|
2166
2142
|
padding: 0 var(--vxe-ui-table-cell-padding-default);
|
|
@@ -2172,7 +2148,7 @@ $btnThemeList: (
|
|
|
2172
2148
|
pointer-events: auto;
|
|
2173
2149
|
}
|
|
2174
2150
|
.vxe-cell--valid-error-theme-beautify {
|
|
2175
|
-
padding: 0.2em 0.6em 0.
|
|
2151
|
+
padding: 0.2em 0.6em 0.25em 0.6em;
|
|
2176
2152
|
color: #fff;
|
|
2177
2153
|
background-color: var(--vxe-ui-table-validate-error-color);
|
|
2178
2154
|
.vxe-cell--valid-error-msg {
|
|
@@ -2204,10 +2180,12 @@ $btnThemeList: (
|
|
|
2204
2180
|
&:last-child {
|
|
2205
2181
|
.vxe-cell--valid-error-tip {
|
|
2206
2182
|
bottom: calc(100%);
|
|
2183
|
+
transform: translate(-50%, 50%);
|
|
2207
2184
|
}
|
|
2208
2185
|
&:first-child {
|
|
2209
2186
|
.vxe-cell--valid-error-tip {
|
|
2210
2187
|
bottom: auto;
|
|
2188
|
+
transform: translate(-50%, -50%);
|
|
2211
2189
|
}
|
|
2212
2190
|
}
|
|
2213
2191
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|