vxe-table 3.9.21 → 3.10.0-beta.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/es/locale/lang/ja-JP.js +5 -5
- package/es/locale/lang/ko-KR.js +5 -5
- package/es/locale/lang/uk-UA.js +5 -5
- package/es/locale/lang/vi-VN.js +5 -5
- package/es/locale/lang/zh-CHT.js +5 -5
- package/es/locale/lang/zh-CN.js +5 -5
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +3 -3
- package/es/table/src/body.js +53 -115
- package/es/table/src/footer.js +24 -21
- package/es/table/src/methods.js +392 -123
- package/es/table/src/props.js +2 -0
- package/es/table/src/table.js +71 -10
- package/es/table/src/util.js +58 -33
- package/es/table/style.css +47 -7
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +47 -7
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.umd.js +682 -361
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +5 -5
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -5
- package/lib/locale/lang/ko-KR.js +5 -5
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +5 -5
- package/lib/locale/lang/uk-UA.js +5 -5
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +5 -5
- package/lib/locale/lang/vi-VN.js +5 -5
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +5 -5
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +5 -5
- package/lib/locale/lang/zh-CN.js +5 -5
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +5 -5
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +6 -3
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +54 -118
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +24 -33
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/methods.js +449 -148
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +2 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +64 -13
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +72 -38
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +47 -7
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +47 -7
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ja-JP.ts +5 -5
- package/packages/locale/lang/ko-KR.ts +5 -5
- package/packages/locale/lang/uk-UA.ts +5 -5
- package/packages/locale/lang/vi-VN.ts +5 -5
- package/packages/locale/lang/zh-CHT.ts +5 -5
- package/packages/locale/lang/zh-CN.ts +5 -5
- package/packages/table/module/edit/mixin.ts +3 -3
- package/packages/table/src/body.ts +53 -118
- package/packages/table/src/footer.ts +24 -22
- package/packages/table/src/methods.ts +418 -127
- package/packages/table/src/props.ts +10 -8
- package/packages/table/src/table.ts +73 -10
- package/packages/table/src/util.ts +61 -36
- package/packages/ui/index.ts +1 -1
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/components/table.scss +46 -13
- package/styles/modules.scss +0 -2
- package/styles/theme/base.scss +1 -1
- package/styles/theme/dark.scss +7 -4
- package/styles/variable.scss +5 -1
- /package/es/{iconfont.1729992873866.ttf → iconfont.1730364042434.ttf} +0 -0
- /package/es/{iconfont.1729992873866.woff → iconfont.1730364042434.woff} +0 -0
- /package/es/{iconfont.1729992873866.woff2 → iconfont.1730364042434.woff2} +0 -0
- /package/lib/{iconfont.1729992873866.ttf → iconfont.1730364042434.ttf} +0 -0
- /package/lib/{iconfont.1729992873866.woff → iconfont.1730364042434.woff} +0 -0
- /package/lib/{iconfont.1729992873866.woff2 → iconfont.1730364042434.woff2} +0 -0
|
@@ -7,31 +7,31 @@ const { getConfig } = VxeUI
|
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
/** 基本属性 */
|
|
10
|
-
id: [String, Function]
|
|
10
|
+
id: [String, Function] as PropType<VxeTablePropTypes.ID>,
|
|
11
11
|
// 数据
|
|
12
|
-
data: Array
|
|
12
|
+
data: Array as PropType<any[]>,
|
|
13
13
|
// 表格的高度
|
|
14
|
-
height: [Number, String]
|
|
14
|
+
height: [Number, String] as PropType<VxeTablePropTypes.Height>,
|
|
15
15
|
// 表格的最小高度
|
|
16
16
|
minHeight: {
|
|
17
|
-
type: [Number, String]
|
|
17
|
+
type: [Number, String] as PropType<VxeTablePropTypes.MinHeight>,
|
|
18
18
|
default: () => getConfig().table.minHeight
|
|
19
19
|
},
|
|
20
20
|
// 表格的最大高度
|
|
21
|
-
maxHeight: [Number, String]
|
|
21
|
+
maxHeight: [Number, String] as PropType<VxeTablePropTypes.MaxHeight>,
|
|
22
22
|
// 已废弃,被 column-config.resizable 替换
|
|
23
23
|
resizable: {
|
|
24
|
-
type: Boolean
|
|
24
|
+
type: Boolean as PropType<VxeTablePropTypes.Resizable>,
|
|
25
25
|
default: () => getConfig().table.resizable
|
|
26
26
|
},
|
|
27
27
|
// 是否带有斑马纹
|
|
28
28
|
stripe: {
|
|
29
|
-
type: Boolean
|
|
29
|
+
type: Boolean as PropType<VxeTablePropTypes.Stripe>,
|
|
30
30
|
default: () => getConfig().table.stripe
|
|
31
31
|
},
|
|
32
32
|
// 是否带有边框
|
|
33
33
|
border: {
|
|
34
|
-
type: [Boolean, String]
|
|
34
|
+
type: [Boolean, String] as PropType<VxeTablePropTypes.Border>,
|
|
35
35
|
default: () => getConfig().table.border
|
|
36
36
|
},
|
|
37
37
|
// 单元格是否有边距
|
|
@@ -161,6 +161,8 @@ export default {
|
|
|
161
161
|
resizeConfig: Object,
|
|
162
162
|
// 列配置信息
|
|
163
163
|
columnConfig: Object,
|
|
164
|
+
// 单元格配置信息
|
|
165
|
+
cellConfig: Object as PropType<VxeTablePropTypes.CellConfig>,
|
|
164
166
|
// 行配置信息
|
|
165
167
|
rowConfig: Object,
|
|
166
168
|
// 列调整配置项
|
|
@@ -25,7 +25,7 @@ import customMixin from '../module/custom/mixin'
|
|
|
25
25
|
|
|
26
26
|
import type { VxeLoadingComponent, VxeTooltipComponent, VxeTabsConstructor, VxeTabsPrivateMethods } from 'vxe-pc-ui'
|
|
27
27
|
|
|
28
|
-
const { getConfig, getI18n, renderer, globalResize, globalEvents, globalMixins } = VxeUI
|
|
28
|
+
const { getConfig, getI18n, renderer, globalResize, globalEvents, globalMixins, renderEmptyElement } = VxeUI
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* 渲染浮固定列
|
|
@@ -80,7 +80,7 @@ function renderFixed (h: CreateElement, $xetable: any, fixedType: any) {
|
|
|
80
80
|
])
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
function
|
|
83
|
+
function renderEmptyBody (h: CreateElement, _vm: any) {
|
|
84
84
|
const { $scopedSlots, emptyOpts } = _vm
|
|
85
85
|
let emptyContent: any = ''
|
|
86
86
|
const params = { $table: _vm }
|
|
@@ -401,6 +401,9 @@ export default {
|
|
|
401
401
|
computeColumnOpts () {
|
|
402
402
|
return Object.assign({}, getConfig().table.columnConfig, this.columnConfig)
|
|
403
403
|
},
|
|
404
|
+
computeCellOpts () {
|
|
405
|
+
return Object.assign({}, getConfig().table.cellConfig, this.rowConfig)
|
|
406
|
+
},
|
|
404
407
|
rowOpts () {
|
|
405
408
|
return this.computeRowOpts
|
|
406
409
|
},
|
|
@@ -630,6 +633,16 @@ export default {
|
|
|
630
633
|
}
|
|
631
634
|
return false
|
|
632
635
|
},
|
|
636
|
+
computeVirtualScrollBars () {
|
|
637
|
+
const $xeTable = this
|
|
638
|
+
const reactData = $xeTable
|
|
639
|
+
|
|
640
|
+
const { overflowX, scrollXLoad, overflowY, scrollYLoad } = reactData
|
|
641
|
+
return {
|
|
642
|
+
x: overflowX && scrollXLoad,
|
|
643
|
+
y: overflowY && scrollYLoad
|
|
644
|
+
}
|
|
645
|
+
},
|
|
633
646
|
tabsResizeFlag () {
|
|
634
647
|
const $xeTable = this
|
|
635
648
|
const $xeTabs = $xeTable.$xeTabs
|
|
@@ -1024,6 +1037,8 @@ export default {
|
|
|
1024
1037
|
const VxeUILoadingComponent = VxeUI.getComponent<VxeLoadingComponent>('VxeLoading')
|
|
1025
1038
|
const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
|
|
1026
1039
|
|
|
1040
|
+
const $xeTable = this
|
|
1041
|
+
|
|
1027
1042
|
const {
|
|
1028
1043
|
_e,
|
|
1029
1044
|
$scopedSlots,
|
|
@@ -1067,10 +1082,11 @@ export default {
|
|
|
1067
1082
|
checkboxOpts,
|
|
1068
1083
|
loadingOpts,
|
|
1069
1084
|
editRules
|
|
1070
|
-
} =
|
|
1085
|
+
} = $xeTable
|
|
1071
1086
|
const { leftList, rightList } = columnStore
|
|
1072
1087
|
const currLoading = this._isLoading || loading
|
|
1073
1088
|
const vSize = computeSize
|
|
1089
|
+
const virtualScrollBars = $xeTable.computeVirtualScrollBars
|
|
1074
1090
|
return h('div', {
|
|
1075
1091
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
|
|
1076
1092
|
[`valid-msg--${validOpts.msgMode}`]: !!editRules,
|
|
@@ -1115,6 +1131,7 @@ export default {
|
|
|
1115
1131
|
ref: 'hideColumn'
|
|
1116
1132
|
}, this.$slots.default),
|
|
1117
1133
|
h('div', {
|
|
1134
|
+
key: 'tw',
|
|
1118
1135
|
class: 'vxe-table--render-wrapper'
|
|
1119
1136
|
}, [
|
|
1120
1137
|
h('div', {
|
|
@@ -1162,37 +1179,74 @@ export default {
|
|
|
1162
1179
|
h('div', {
|
|
1163
1180
|
class: 'vxe-table--fixed-wrapper'
|
|
1164
1181
|
}, [
|
|
1165
|
-
/**
|
|
1166
|
-
* 左侧固定区域
|
|
1167
|
-
*/
|
|
1168
1182
|
leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(),
|
|
1169
|
-
/**
|
|
1170
|
-
* 右侧固定区域
|
|
1171
|
-
*/
|
|
1172
1183
|
rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e()
|
|
1173
1184
|
])
|
|
1174
1185
|
]),
|
|
1186
|
+
virtualScrollBars.x
|
|
1187
|
+
? h('div', {
|
|
1188
|
+
key: 'vx',
|
|
1189
|
+
ref: 'refScrollXVirtualElem',
|
|
1190
|
+
class: 'vxe-table--scroll-x-virtual'
|
|
1191
|
+
}, [
|
|
1192
|
+
h('div', {
|
|
1193
|
+
ref: 'refScrollXHandleElem',
|
|
1194
|
+
class: 'vxe-table--scroll-x-handle',
|
|
1195
|
+
on: {
|
|
1196
|
+
scroll: $xeTable.scrollXEvent
|
|
1197
|
+
}
|
|
1198
|
+
}, [
|
|
1199
|
+
h('div', {
|
|
1200
|
+
ref: 'refScrollXSpaceElem',
|
|
1201
|
+
class: 'vxe-table--scroll-x-space'
|
|
1202
|
+
})
|
|
1203
|
+
])
|
|
1204
|
+
])
|
|
1205
|
+
: renderEmptyElement($xeTable),
|
|
1206
|
+
virtualScrollBars.y
|
|
1207
|
+
? h('div', {
|
|
1208
|
+
key: 'vy',
|
|
1209
|
+
ref: 'refScrollYVirtualElem',
|
|
1210
|
+
class: 'vxe-table--scroll-y-virtual'
|
|
1211
|
+
}, [
|
|
1212
|
+
h('div', {
|
|
1213
|
+
ref: 'refScrollYHandleElem',
|
|
1214
|
+
class: 'vxe-table--scroll-y-handle',
|
|
1215
|
+
on: {
|
|
1216
|
+
scroll: $xeTable.scrollYEvent
|
|
1217
|
+
}
|
|
1218
|
+
}, [
|
|
1219
|
+
h('div', {
|
|
1220
|
+
ref: 'refScrollYSpaceElem',
|
|
1221
|
+
class: 'vxe-table--scroll-x-space'
|
|
1222
|
+
})
|
|
1223
|
+
])
|
|
1224
|
+
])
|
|
1225
|
+
: renderEmptyElement($xeTable),
|
|
1175
1226
|
/**
|
|
1176
1227
|
* 空数据
|
|
1177
1228
|
*/
|
|
1178
1229
|
h('div', {
|
|
1230
|
+
key: 'tn',
|
|
1179
1231
|
ref: 'emptyPlaceholder',
|
|
1180
1232
|
class: 'vxe-table--empty-placeholder'
|
|
1181
1233
|
}, [
|
|
1182
1234
|
h('div', {
|
|
1183
1235
|
class: 'vxe-table--empty-content'
|
|
1184
|
-
},
|
|
1236
|
+
}, renderEmptyBody(h, this))
|
|
1185
1237
|
]),
|
|
1186
1238
|
/**
|
|
1187
1239
|
* 边框线
|
|
1188
1240
|
*/
|
|
1189
1241
|
h('div', {
|
|
1242
|
+
key: 'tl',
|
|
1190
1243
|
class: 'vxe-table--border-line'
|
|
1191
1244
|
}),
|
|
1192
1245
|
/**
|
|
1193
1246
|
* 列宽线
|
|
1194
1247
|
*/
|
|
1195
1248
|
h('div', {
|
|
1249
|
+
key: 'cl',
|
|
1196
1250
|
class: 'vxe-table--resizable-bar',
|
|
1197
1251
|
style: overflowX
|
|
1198
1252
|
? {
|
|
@@ -1206,6 +1260,7 @@ export default {
|
|
|
1206
1260
|
*/
|
|
1207
1261
|
VxeUILoadingComponent
|
|
1208
1262
|
? h(VxeUILoadingComponent, {
|
|
1263
|
+
key: 'lg',
|
|
1209
1264
|
class: 'vxe-table--loading',
|
|
1210
1265
|
props: {
|
|
1211
1266
|
value: currLoading,
|
|
@@ -1219,6 +1274,7 @@ export default {
|
|
|
1219
1274
|
*/
|
|
1220
1275
|
initStore.custom
|
|
1221
1276
|
? h(TableCustomPanelComponent, {
|
|
1277
|
+
key: 'cs',
|
|
1222
1278
|
ref: 'customWrapper',
|
|
1223
1279
|
props: {
|
|
1224
1280
|
customStore
|
|
@@ -1230,6 +1286,7 @@ export default {
|
|
|
1230
1286
|
*/
|
|
1231
1287
|
initStore.filter
|
|
1232
1288
|
? h(TableFilterPanelComponent, {
|
|
1289
|
+
key: 'tf',
|
|
1233
1290
|
ref: 'filterWrapper',
|
|
1234
1291
|
props: {
|
|
1235
1292
|
filterStore
|
|
@@ -1241,6 +1298,7 @@ export default {
|
|
|
1241
1298
|
*/
|
|
1242
1299
|
initStore.import && this.importConfig
|
|
1243
1300
|
? h(TableImportPanelComponent, {
|
|
1301
|
+
key: 'it',
|
|
1244
1302
|
props: {
|
|
1245
1303
|
defaultOptions: this.importParams,
|
|
1246
1304
|
storeData: this.importStore
|
|
@@ -1252,6 +1310,7 @@ export default {
|
|
|
1252
1310
|
*/
|
|
1253
1311
|
initStore.export && (this.exportConfig || this.printConfig)
|
|
1254
1312
|
? h(TableExportPanelComponent, {
|
|
1313
|
+
key: 'et',
|
|
1255
1314
|
props: {
|
|
1256
1315
|
defaultOptions: this.exportParams,
|
|
1257
1316
|
storeData: this.exportStore
|
|
@@ -1263,6 +1322,7 @@ export default {
|
|
|
1263
1322
|
*/
|
|
1264
1323
|
ctxMenuStore.visible && this.isCtxMenu
|
|
1265
1324
|
? h(TableMenuPanelComponent, {
|
|
1325
|
+
key: 'tm',
|
|
1266
1326
|
ref: 'ctxWrapper',
|
|
1267
1327
|
props: {
|
|
1268
1328
|
ctxMenuStore,
|
|
@@ -1276,6 +1336,7 @@ export default {
|
|
|
1276
1336
|
*/
|
|
1277
1337
|
VxeUITooltipComponent
|
|
1278
1338
|
? h(VxeUITooltipComponent, {
|
|
1339
|
+
key: 'ctp',
|
|
1279
1340
|
ref: 'commTip',
|
|
1280
1341
|
props: {
|
|
1281
1342
|
isArrow: false,
|
|
@@ -1288,6 +1349,7 @@ export default {
|
|
|
1288
1349
|
*/
|
|
1289
1350
|
VxeUITooltipComponent
|
|
1290
1351
|
? h(VxeUITooltipComponent, {
|
|
1352
|
+
key: 'btp',
|
|
1291
1353
|
ref: 'tooltip',
|
|
1292
1354
|
props: Object.assign({}, this.tipConfig, this.tooltipStore.currOpts)
|
|
1293
1355
|
})
|
|
@@ -1297,6 +1359,7 @@ export default {
|
|
|
1297
1359
|
*/
|
|
1298
1360
|
VxeUITooltipComponent && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
|
|
1299
1361
|
? h(VxeUITooltipComponent, {
|
|
1362
|
+
key: 'vtp',
|
|
1300
1363
|
ref: 'validTip',
|
|
1301
1364
|
class: [{
|
|
1302
1365
|
'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete'
|
|
@@ -3,6 +3,8 @@ import { ColumnInfo } from './columnInfo'
|
|
|
3
3
|
import { isScale, isPx } from '../../ui/src/dom'
|
|
4
4
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
5
5
|
|
|
6
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
7
|
+
|
|
6
8
|
const getAllConvertColumns = (columns: any, parentColumn?: any) => {
|
|
7
9
|
const result: any[] = []
|
|
8
10
|
columns.forEach((column: any) => {
|
|
@@ -88,18 +90,6 @@ export function toTreePathSeq (path: any) {
|
|
|
88
90
|
return path.map((num: any, i: any) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
|
|
89
91
|
}
|
|
90
92
|
|
|
91
|
-
export function removeScrollListener (scrollElem: any) {
|
|
92
|
-
if (scrollElem && scrollElem._onscroll) {
|
|
93
|
-
scrollElem.onscroll = null
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function restoreScrollListener (scrollElem: any) {
|
|
98
|
-
if (scrollElem && scrollElem._onscroll) {
|
|
99
|
-
scrollElem.onscroll = scrollElem._onscroll
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
93
|
/**
|
|
104
94
|
* 生成行的唯一主键
|
|
105
95
|
*/
|
|
@@ -346,28 +336,60 @@ export function createColumn ($xeTable: any, options: any, renderOptions: any):
|
|
|
346
336
|
return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions)
|
|
347
337
|
}
|
|
348
338
|
|
|
349
|
-
export function rowToVisible ($
|
|
350
|
-
const {
|
|
351
|
-
const
|
|
339
|
+
export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, row: any) {
|
|
340
|
+
const { reactData, internalData } = $xeTable
|
|
341
|
+
const tableProps = $xeTable
|
|
342
|
+
const { showOverflow } = tableProps
|
|
343
|
+
const tableBody: any = $xeTable.$refs.tableBody
|
|
344
|
+
const { columnStore, scrollYLoad } = reactData
|
|
345
|
+
const { afterFullData, scrollYStore, fullAllDataRowIdData } = internalData
|
|
346
|
+
const { leftList, rightList } = columnStore
|
|
347
|
+
const bodyElem = tableBody ? tableBody.$el as HTMLDivElement : null
|
|
348
|
+
const rowid = getRowid($xeTable, row)
|
|
349
|
+
let offsetFixedLeft = 0
|
|
350
|
+
leftList.forEach(item => {
|
|
351
|
+
offsetFixedLeft += item.renderWidth
|
|
352
|
+
})
|
|
353
|
+
let offsetFixedRight = 0
|
|
354
|
+
rightList.forEach(item => {
|
|
355
|
+
offsetFixedRight += item.renderWidth
|
|
356
|
+
})
|
|
352
357
|
if (bodyElem) {
|
|
353
|
-
const
|
|
358
|
+
const bodyHeight = bodyElem.clientHeight
|
|
359
|
+
const bodyScrollTop = bodyElem.scrollTop
|
|
360
|
+
const trElem: HTMLTableRowElement | null = bodyElem.querySelector(`[rowid="${rowid}"]`)
|
|
354
361
|
if (trElem) {
|
|
355
|
-
const
|
|
356
|
-
const
|
|
357
|
-
const trOffsetTop = trElem.offsetTop + (trElem.offsetParent ? trElem.offsetParent.offsetTop : 0)
|
|
362
|
+
const trOffsetParent = trElem.offsetParent as HTMLElement
|
|
363
|
+
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0)
|
|
358
364
|
const trHeight = trElem.clientHeight
|
|
359
365
|
// 检测行是否在可视区中
|
|
360
|
-
if (trOffsetTop <
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
// 向下定位
|
|
365
|
-
return $xetable.scrollTo(null, bodySrcollTop + trHeight)
|
|
366
|
+
if (trOffsetTop < bodyScrollTop || trOffsetTop > bodyScrollTop + bodyHeight) {
|
|
367
|
+
return $xeTable.scrollTo(null, trOffsetTop)
|
|
368
|
+
} else if (trOffsetTop + trHeight >= bodyHeight + bodyScrollTop) {
|
|
369
|
+
return $xeTable.scrollTo(null, bodyScrollTop + trHeight)
|
|
366
370
|
}
|
|
367
371
|
} else {
|
|
368
|
-
//
|
|
369
|
-
if (
|
|
370
|
-
|
|
372
|
+
// 如果是虚拟渲染滚动
|
|
373
|
+
if (scrollYLoad) {
|
|
374
|
+
if (showOverflow) {
|
|
375
|
+
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * scrollYStore.rowHeight)
|
|
376
|
+
}
|
|
377
|
+
let scrollTop = 0
|
|
378
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
379
|
+
const rHeight = rest ? rest.height : 0
|
|
380
|
+
for (let i = 0; i < afterFullData.length; i++) {
|
|
381
|
+
const currRow = afterFullData[i]
|
|
382
|
+
const currRowid = getRowid($xeTable, currRow)
|
|
383
|
+
if (currRow === row || currRowid === rowid) {
|
|
384
|
+
break
|
|
385
|
+
}
|
|
386
|
+
const rest = fullAllDataRowIdData[currRowid]
|
|
387
|
+
scrollTop += rest ? rest.height : 0
|
|
388
|
+
}
|
|
389
|
+
if (scrollTop < bodyScrollTop) {
|
|
390
|
+
return $xeTable.scrollTo(null, scrollTop - offsetFixedLeft - 1)
|
|
391
|
+
}
|
|
392
|
+
return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight - offsetFixedRight - 1))
|
|
371
393
|
}
|
|
372
394
|
}
|
|
373
395
|
}
|
|
@@ -376,9 +398,12 @@ export function rowToVisible ($xetable: any, row: any) {
|
|
|
376
398
|
|
|
377
399
|
export function colToVisible ($xeTable: any, column: any) {
|
|
378
400
|
const { columnStore, scrollXLoad, visibleColumn } = $xeTable
|
|
379
|
-
const
|
|
401
|
+
const tableBody: any = $xeTable.$refs.tableBody
|
|
380
402
|
const { leftList, rightList } = columnStore
|
|
381
403
|
const bodyElem = tableBody ? tableBody.$el : null
|
|
404
|
+
if (column.fixed) {
|
|
405
|
+
return Promise.resolve()
|
|
406
|
+
}
|
|
382
407
|
let offsetFixedLeft = 0
|
|
383
408
|
leftList.forEach((item: any) => {
|
|
384
409
|
offsetFixedLeft += item.renderWidth
|
|
@@ -389,15 +414,15 @@ export function colToVisible ($xeTable: any, column: any) {
|
|
|
389
414
|
})
|
|
390
415
|
if (bodyElem) {
|
|
391
416
|
const bodyWidth = bodyElem.clientWidth
|
|
392
|
-
const
|
|
417
|
+
const bodyScrollLeft = bodyElem.scrollLeft
|
|
393
418
|
const tdElem = bodyElem.querySelector(`.${column.id}`)
|
|
394
419
|
if (tdElem) {
|
|
395
420
|
const tdOffsetLeft = tdElem.offsetLeft + (tdElem.offsetParent ? tdElem.offsetParent.offsetLeft : 0)
|
|
396
421
|
const cellWidth = tdElem.clientWidth
|
|
397
422
|
// 检测是否在可视区中
|
|
398
|
-
if (tdOffsetLeft < (
|
|
423
|
+
if (tdOffsetLeft < (bodyScrollLeft + offsetFixedLeft)) {
|
|
399
424
|
return $xeTable.scrollTo(tdOffsetLeft - offsetFixedLeft - 1)
|
|
400
|
-
} else if ((tdOffsetLeft + cellWidth -
|
|
425
|
+
} else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth - offsetFixedRight)) {
|
|
401
426
|
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - offsetFixedRight - 1))
|
|
402
427
|
}
|
|
403
428
|
} else {
|
|
@@ -405,13 +430,13 @@ export function colToVisible ($xeTable: any, column: any) {
|
|
|
405
430
|
if (scrollXLoad) {
|
|
406
431
|
let scrollLeft = 0
|
|
407
432
|
const cellWidth = column.renderWidth
|
|
408
|
-
for (let
|
|
409
|
-
if (visibleColumn[
|
|
433
|
+
for (let i = 0; i < visibleColumn.length; i++) {
|
|
434
|
+
if (visibleColumn[i] === column) {
|
|
410
435
|
break
|
|
411
436
|
}
|
|
412
|
-
scrollLeft += visibleColumn[
|
|
437
|
+
scrollLeft += visibleColumn[i].renderWidth
|
|
413
438
|
}
|
|
414
|
-
if (scrollLeft <
|
|
439
|
+
if (scrollLeft < bodyScrollLeft) {
|
|
415
440
|
return $xeTable.scrollTo(scrollLeft - offsetFixedLeft - 1)
|
|
416
441
|
}
|
|
417
442
|
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth - offsetFixedRight - 1))
|
package/packages/ui/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { VxeUploadDefines, VxePrintDefines, VxeGlobalConfig } from 'vxe-pc-
|
|
|
6
6
|
export const version = process.env.VUE_APP_VXE_VERSION as string
|
|
7
7
|
|
|
8
8
|
VxeUI.version = version
|
|
9
|
-
VxeUI.tableVersion =
|
|
9
|
+
VxeUI.tableVersion = version
|
|
10
10
|
|
|
11
11
|
VxeUI.setConfig({
|
|
12
12
|
emptyCell: ' ',
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
border-radius: var(--vxe-ui-border-radius);
|
|
37
37
|
background-color: var(--vxe-ui-layout-background-color);
|
|
38
38
|
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
39
|
-
box-shadow:
|
|
39
|
+
box-shadow: var(--vxe-ui-base-popup-box-shadow);
|
|
40
40
|
z-index: 10;
|
|
41
41
|
&:not(.is--multiple) {
|
|
42
42
|
text-align: center;
|
|
@@ -131,18 +131,12 @@
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
.vxe-body--column {
|
|
134
|
-
&.col--
|
|
134
|
+
&.col--vertical-top {
|
|
135
135
|
&.col--active {
|
|
136
136
|
& > .vxe-cell {
|
|
137
137
|
height: 100%;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
& > .vxe-cell {
|
|
141
|
-
& > .vxe-textarea,
|
|
142
|
-
& > .vxe-default-textarea {
|
|
143
|
-
height: 100%;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
140
|
}
|
|
147
141
|
.vxe-cell--label {
|
|
148
142
|
&.is--textarea {
|
|
@@ -532,14 +526,10 @@
|
|
|
532
526
|
font-family: var(--vxe-ui-font-family);
|
|
533
527
|
direction: ltr;
|
|
534
528
|
.vxe-table--body-wrapper {
|
|
535
|
-
|
|
536
|
-
background-color: var(--vxe-ui-layout-background-color);
|
|
537
|
-
}
|
|
529
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
538
530
|
}
|
|
539
531
|
.vxe-table--footer-wrapper {
|
|
540
|
-
|
|
541
|
-
background-color: var(--vxe-ui-table-footer-background-color);
|
|
542
|
-
}
|
|
532
|
+
background-color: var(--vxe-ui-table-footer-background-color);
|
|
543
533
|
}
|
|
544
534
|
.vxe-table--header,
|
|
545
535
|
.vxe-table--body,
|
|
@@ -934,6 +924,48 @@
|
|
|
934
924
|
}
|
|
935
925
|
}
|
|
936
926
|
}
|
|
927
|
+
// 滚动条
|
|
928
|
+
.vxe-table--scroll-x-virtual,
|
|
929
|
+
.vxe-table--scroll-y-virtual {
|
|
930
|
+
position: absolute;
|
|
931
|
+
z-index: 7;
|
|
932
|
+
overflow: hidden;
|
|
933
|
+
}
|
|
934
|
+
.vxe-table--scroll-x-handle,
|
|
935
|
+
.vxe-table--scroll-y-handle {
|
|
936
|
+
position: absolute;
|
|
937
|
+
div {
|
|
938
|
+
display: block;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
.vxe-table--scroll-x-virtual,
|
|
942
|
+
.vxe-table--scroll-x-handle {
|
|
943
|
+
width: 100%;
|
|
944
|
+
left: 0;
|
|
945
|
+
bottom: 0;
|
|
946
|
+
}
|
|
947
|
+
.vxe-table--scroll-x-handle {
|
|
948
|
+
overflow-y: hidden;
|
|
949
|
+
overflow-x: auto;
|
|
950
|
+
height: 18px;
|
|
951
|
+
}
|
|
952
|
+
.vxe-table--scroll-y-virtual,
|
|
953
|
+
.vxe-table--scroll-y-handle {
|
|
954
|
+
height: 100%;
|
|
955
|
+
right: 0;
|
|
956
|
+
top: 0;
|
|
957
|
+
}
|
|
958
|
+
.vxe-table--scroll-y-handle {
|
|
959
|
+
overflow-y: auto;
|
|
960
|
+
overflow-x: hidden;
|
|
961
|
+
width: 18px;
|
|
962
|
+
}
|
|
963
|
+
.vxe-table--scroll-x-space {
|
|
964
|
+
height: 1px;
|
|
965
|
+
}
|
|
966
|
+
.vxe-table--scroll-y-space {
|
|
967
|
+
width: 1px;
|
|
968
|
+
}
|
|
937
969
|
|
|
938
970
|
&.is--padding {
|
|
939
971
|
.vxe-cell {
|
|
@@ -972,6 +1004,7 @@
|
|
|
972
1004
|
background-color: inherit;
|
|
973
1005
|
transition: 0.3s box-shadow;
|
|
974
1006
|
outline: 0;
|
|
1007
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
975
1008
|
.vxe-table--body-wrapper {
|
|
976
1009
|
overflow-x: hidden;
|
|
977
1010
|
outline: 0;
|
package/styles/modules.scss
CHANGED
package/styles/theme/base.scss
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
--vxe-ui-table-cell-extend-area-border-color: var(--vxe-ui-table-cell-area-border-color);
|
|
69
69
|
--vxe-ui-table-cell-active-area-border-color: var(--vxe-ui-table-cell-area-border-color);
|
|
70
70
|
--vxe-ui-table-cell-area-background-color: rgba(64,158,255,0.2);
|
|
71
|
-
--vxe-ui-table-header-active-area-background-color: rgba(64,158,255,0.
|
|
71
|
+
--vxe-ui-table-header-active-area-background-color: rgba(64,158,255,0.05);
|
|
72
72
|
|
|
73
73
|
--vxe-ui-table-expand-padding-default: 16px;
|
|
74
74
|
|
package/styles/theme/dark.scss
CHANGED
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
/*font color*/
|
|
7
7
|
--vxe-ui-font-color: #a0a3a7;
|
|
8
|
+
--vxe-ui-font-tinge-color: #33353b;
|
|
9
|
+
--vxe-ui-font-lighten-color: #797b80;
|
|
10
|
+
--vxe-ui-font-darken-color: #47494c;
|
|
11
|
+
--vxe-ui-font-disabled-color: #464646;
|
|
12
|
+
|
|
13
|
+
/*font status color*/
|
|
8
14
|
--vxe-ui-font-primary-color: #409eff;
|
|
9
|
-
--vxe-ui-font-lighten-color: #babdc0;
|
|
10
|
-
--vxe-ui-font-darken-color: #86898e;
|
|
11
|
-
--vxe-ui-font-disabled-color: #BFBFBF;
|
|
12
15
|
|
|
13
16
|
/*base*/
|
|
14
|
-
--vxe-ui-base-popup-border-color:
|
|
17
|
+
--vxe-ui-base-popup-border-color: #424242;
|
|
15
18
|
--vxe-ui-base-popup-box-shadow: 0px 12px 30px 8px rgba(0, 0, 0, 0.5);
|
|
16
19
|
|
|
17
20
|
/*layout*/
|
package/styles/variable.scss
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/*font color*/
|
|
2
2
|
$vxe-ui-font-color: #606266;
|
|
3
|
-
$vxe-ui-font-
|
|
3
|
+
$vxe-ui-font-tinge-color: #d4d5d7;
|
|
4
4
|
$vxe-ui-font-lighten-color: #797b80;
|
|
5
5
|
$vxe-ui-font-darken-color: #47494c;
|
|
6
6
|
$vxe-ui-font-disabled-color: #BFBFBF;
|
|
7
7
|
|
|
8
|
+
/*font status color*/
|
|
9
|
+
$vxe-ui-font-primary-color: #409eff;
|
|
10
|
+
|
|
8
11
|
/*base*/
|
|
9
12
|
$vxe-ui-base-popup-border-color: #DADCE0;
|
|
10
13
|
$vxe-ui-base-popup-box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.16);
|
|
@@ -33,3 +36,4 @@ $vxe-ui-table-row-hover-checkbox-checked-background-color: #ffebbc;
|
|
|
33
36
|
$vxe-ui-table-row-current-background-color: #e6f7ff;
|
|
34
37
|
$vxe-ui-table-row-hover-current-background-color: #d7effb;
|
|
35
38
|
$vxe-ui-table-fixed-scrolling-box-shadow-color: rgba(0, 0, 0, 0.12);
|
|
39
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|