vxe-table 4.15.3 → 4.15.4
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/grid/src/grid.js +8 -0
- package/es/style.css +1 -1
- package/es/table/src/table.js +7 -121
- package/es/table/src/util.js +116 -0
- package/es/toolbar/src/toolbar.js +10 -4
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +8 -0
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +139 -48
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +4 -43
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +117 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +9 -3
- package/lib/toolbar/src/toolbar.min.js +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/package.json +1 -1
- package/packages/grid/src/grid.ts +11 -1
- package/packages/table/src/table.ts +10 -125
- package/packages/table/src/util.ts +121 -1
- package/packages/toolbar/src/toolbar.ts +12 -4
- /package/es/{iconfont.1754441841476.ttf → iconfont.1754457119712.ttf} +0 -0
- /package/es/{iconfont.1754441841476.woff → iconfont.1754457119712.woff} +0 -0
- /package/es/{iconfont.1754441841476.woff2 → iconfont.1754457119712.woff2} +0 -0
- /package/lib/{iconfont.1754441841476.ttf → iconfont.1754457119712.ttf} +0 -0
- /package/lib/{iconfont.1754441841476.woff → iconfont.1754457119712.woff} +0 -0
- /package/lib/{iconfont.1754441841476.woff2 → iconfont.1754457119712.woff2} +0 -0
|
@@ -4,7 +4,127 @@ import { ColumnInfo } from './columnInfo'
|
|
|
4
4
|
import { isPx, isScale, queryElement } from '../../ui/src/dom'
|
|
5
5
|
import { eqEmptyValue } from '../../ui/src/utils'
|
|
6
6
|
|
|
7
|
-
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, VxeTablePropTypes } from '../../../types'
|
|
7
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, VxeTablePropTypes, TableInternalData } from '../../../types'
|
|
8
|
+
|
|
9
|
+
export function createInternalData (): TableInternalData {
|
|
10
|
+
return {
|
|
11
|
+
tZindex: 0,
|
|
12
|
+
currKeyField: '',
|
|
13
|
+
isCurrDeepKey: false,
|
|
14
|
+
elemStore: {},
|
|
15
|
+
// 存放横向 X 虚拟滚动相关的信息
|
|
16
|
+
scrollXStore: {
|
|
17
|
+
preloadSize: 0,
|
|
18
|
+
offsetSize: 0,
|
|
19
|
+
visibleSize: 0,
|
|
20
|
+
visibleStartIndex: 0,
|
|
21
|
+
visibleEndIndex: 0,
|
|
22
|
+
startIndex: 0,
|
|
23
|
+
endIndex: 0
|
|
24
|
+
},
|
|
25
|
+
// 存放纵向 Y 虚拟滚动相关信息
|
|
26
|
+
scrollYStore: {
|
|
27
|
+
preloadSize: 0,
|
|
28
|
+
offsetSize: 0,
|
|
29
|
+
visibleSize: 0,
|
|
30
|
+
visibleStartIndex: 0,
|
|
31
|
+
visibleEndIndex: 0,
|
|
32
|
+
startIndex: 0,
|
|
33
|
+
endIndex: 0
|
|
34
|
+
},
|
|
35
|
+
// 表格宽度
|
|
36
|
+
tableWidth: 0,
|
|
37
|
+
// 表格高度
|
|
38
|
+
tableHeight: 0,
|
|
39
|
+
// 表头高度
|
|
40
|
+
headerHeight: 0,
|
|
41
|
+
// 表尾高度
|
|
42
|
+
footerHeight: 0,
|
|
43
|
+
customHeight: 0,
|
|
44
|
+
customMinHeight: 0,
|
|
45
|
+
customMaxHeight: 0,
|
|
46
|
+
// 当前 hover 行
|
|
47
|
+
hoverRow: null,
|
|
48
|
+
// 最后滚动位置
|
|
49
|
+
lastScrollLeft: 0,
|
|
50
|
+
lastScrollTop: 0,
|
|
51
|
+
// 单选框属性,已选中保留的行
|
|
52
|
+
radioReserveRow: null,
|
|
53
|
+
// 复选框属性,已选中保留的行集合
|
|
54
|
+
checkboxReserveRowMap: {},
|
|
55
|
+
// 行数据,已展开保留的行集合
|
|
56
|
+
rowExpandedReserveRowMap: {},
|
|
57
|
+
// 树结构数据,已展开保留的行集合
|
|
58
|
+
treeExpandedReserveRowMap: {},
|
|
59
|
+
// 树结构数据,不确定状态的集合
|
|
60
|
+
treeIndeterminateRowMaps: {},
|
|
61
|
+
// 列表完整数据、条件处理后
|
|
62
|
+
tableFullData: [],
|
|
63
|
+
afterFullData: [],
|
|
64
|
+
afterTreeFullData: [],
|
|
65
|
+
afterGroupFullData: [],
|
|
66
|
+
// 列表条件处理后数据集合
|
|
67
|
+
afterFullRowMaps: {},
|
|
68
|
+
// 树结构完整数据、条件处理后
|
|
69
|
+
tableFullTreeData: [],
|
|
70
|
+
// 行分组全量数据、条件处理后
|
|
71
|
+
tableFullGroupData: [],
|
|
72
|
+
tableSynchData: [],
|
|
73
|
+
tableSourceData: [],
|
|
74
|
+
// 收集的列配置(带分组)
|
|
75
|
+
collectColumn: [],
|
|
76
|
+
// 完整所有列(不带分组)
|
|
77
|
+
tableFullColumn: [],
|
|
78
|
+
// 渲染所有列
|
|
79
|
+
visibleColumn: [],
|
|
80
|
+
// 全量数据集(包括当前和已删除)
|
|
81
|
+
fullAllDataRowIdData: {},
|
|
82
|
+
// 数据集(仅当前)
|
|
83
|
+
fullDataRowIdData: {},
|
|
84
|
+
// 数据集(仅可视)
|
|
85
|
+
visibleDataRowIdData: {},
|
|
86
|
+
// 渲染中缓存数据
|
|
87
|
+
sourceDataRowIdData: {},
|
|
88
|
+
fullColumnIdData: {},
|
|
89
|
+
fullColumnFieldData: {},
|
|
90
|
+
|
|
91
|
+
// 合并单元格的数据
|
|
92
|
+
mergeBodyList: [],
|
|
93
|
+
mergeBodyMaps: {},
|
|
94
|
+
// 合并表尾的数据
|
|
95
|
+
mergeFooterList: [],
|
|
96
|
+
mergeFooterMaps: {},
|
|
97
|
+
// 已合并单元格数据集合
|
|
98
|
+
mergeBodyCellMaps: {},
|
|
99
|
+
// 已合并表尾数据集合
|
|
100
|
+
mergeFooterCellMaps: {},
|
|
101
|
+
// 已展开的行集合
|
|
102
|
+
rowExpandedMaps: {},
|
|
103
|
+
// 懒加载中的展开行的集合
|
|
104
|
+
rowExpandLazyLoadedMaps: {},
|
|
105
|
+
// 已展开的分组行
|
|
106
|
+
rowGroupExpandedMaps: {},
|
|
107
|
+
// 已展开树节点集合
|
|
108
|
+
treeExpandedMaps: {},
|
|
109
|
+
// 懒加载中的树节点的集合
|
|
110
|
+
treeExpandLazyLoadedMaps: {},
|
|
111
|
+
// 复选框属性,已选中的行集合
|
|
112
|
+
selectCheckboxMaps: {},
|
|
113
|
+
// 已标记的对象集
|
|
114
|
+
pendingRowMaps: {},
|
|
115
|
+
// 已新增的临时行
|
|
116
|
+
insertRowMaps: {},
|
|
117
|
+
// 已删除行
|
|
118
|
+
removeRowMaps: {},
|
|
119
|
+
|
|
120
|
+
cvCacheMaps: {},
|
|
121
|
+
|
|
122
|
+
inited: false,
|
|
123
|
+
tooltipTimeout: null,
|
|
124
|
+
initStatus: false,
|
|
125
|
+
isActivated: false
|
|
126
|
+
}
|
|
127
|
+
}
|
|
8
128
|
|
|
9
129
|
const getAllConvertColumns = (columns: any, parentColumn?: any) => {
|
|
10
130
|
const result: any[] = []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, ref, computed, inject, createCommentVNode, VNode, reactive, nextTick, PropType } from 'vue'
|
|
1
|
+
import { h, ref, computed, inject, createCommentVNode, VNode, reactive, nextTick, PropType, onUnmounted } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
@@ -10,6 +10,12 @@ import type { VxeGridConstructor, GridPrivateMethods, ToolbarMethods, ToolbarInt
|
|
|
10
10
|
|
|
11
11
|
const { getConfig, getIcon, getI18n, renderer, commands, createEvent, useFns } = VxeUI
|
|
12
12
|
|
|
13
|
+
function createInternalData (): ToolbarInternalData {
|
|
14
|
+
return {
|
|
15
|
+
connectTable: null
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
export default defineVxeComponent({
|
|
14
20
|
name: 'VxeToolbar',
|
|
15
21
|
props: {
|
|
@@ -64,9 +70,7 @@ export default defineVxeComponent({
|
|
|
64
70
|
columns: []
|
|
65
71
|
})
|
|
66
72
|
|
|
67
|
-
const internalData
|
|
68
|
-
connectTable: null
|
|
69
|
-
}
|
|
73
|
+
const internalData = createInternalData()
|
|
70
74
|
|
|
71
75
|
const refElem = ref<HTMLDivElement>()
|
|
72
76
|
|
|
@@ -708,6 +712,10 @@ export default defineVxeComponent({
|
|
|
708
712
|
}
|
|
709
713
|
})
|
|
710
714
|
|
|
715
|
+
onUnmounted(() => {
|
|
716
|
+
XEUtils.assign(internalData, createInternalData())
|
|
717
|
+
})
|
|
718
|
+
|
|
711
719
|
return $xeToolbar
|
|
712
720
|
},
|
|
713
721
|
render () {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|