vxe-table 3.9.21 → 3.10.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/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 +50 -115
- package/es/table/src/footer.js +24 -21
- package/es/table/src/methods.js +392 -123
- package/es/table/src/table.js +68 -10
- package/es/table/src/util.js +58 -33
- package/es/table/style.css +46 -3
- 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 +46 -3
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.umd.js +672 -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 +49 -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/table.js +61 -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 +46 -3
- 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 +46 -3
- 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 +50 -118
- package/packages/table/src/footer.ts +24 -22
- package/packages/table/src/methods.ts +418 -127
- package/packages/table/src/props.ts +8 -8
- package/packages/table/src/table.ts +70 -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 +45 -6
- 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.1730347297462.ttf} +0 -0
- /package/es/{iconfont.1729992873866.woff → iconfont.1730347297462.woff} +0 -0
- /package/es/{iconfont.1729992873866.woff2 → iconfont.1730347297462.woff2} +0 -0
- /package/lib/{iconfont.1729992873866.ttf → iconfont.1730347297462.ttf} +0 -0
- /package/lib/{iconfont.1729992873866.woff → iconfont.1730347297462.woff} +0 -0
- /package/lib/{iconfont.1729992873866.woff2 → iconfont.1730347297462.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
|
// 单元格是否有边距
|
|
@@ -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 }
|
|
@@ -630,6 +630,16 @@ export default {
|
|
|
630
630
|
}
|
|
631
631
|
return false
|
|
632
632
|
},
|
|
633
|
+
computeVirtualScrollBars () {
|
|
634
|
+
const $xeTable = this
|
|
635
|
+
const reactData = $xeTable
|
|
636
|
+
|
|
637
|
+
const { overflowX, scrollXLoad, overflowY, scrollYLoad } = reactData
|
|
638
|
+
return {
|
|
639
|
+
x: overflowX && scrollXLoad,
|
|
640
|
+
y: overflowY && scrollYLoad
|
|
641
|
+
}
|
|
642
|
+
},
|
|
633
643
|
tabsResizeFlag () {
|
|
634
644
|
const $xeTable = this
|
|
635
645
|
const $xeTabs = $xeTable.$xeTabs
|
|
@@ -1024,6 +1034,8 @@ export default {
|
|
|
1024
1034
|
const VxeUILoadingComponent = VxeUI.getComponent<VxeLoadingComponent>('VxeLoading')
|
|
1025
1035
|
const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
|
|
1026
1036
|
|
|
1037
|
+
const $xeTable = this
|
|
1038
|
+
|
|
1027
1039
|
const {
|
|
1028
1040
|
_e,
|
|
1029
1041
|
$scopedSlots,
|
|
@@ -1067,10 +1079,11 @@ export default {
|
|
|
1067
1079
|
checkboxOpts,
|
|
1068
1080
|
loadingOpts,
|
|
1069
1081
|
editRules
|
|
1070
|
-
} =
|
|
1082
|
+
} = $xeTable
|
|
1071
1083
|
const { leftList, rightList } = columnStore
|
|
1072
1084
|
const currLoading = this._isLoading || loading
|
|
1073
1085
|
const vSize = computeSize
|
|
1086
|
+
const virtualScrollBars = $xeTable.computeVirtualScrollBars
|
|
1074
1087
|
return h('div', {
|
|
1075
1088
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
|
|
1076
1089
|
[`valid-msg--${validOpts.msgMode}`]: !!editRules,
|
|
@@ -1115,6 +1128,7 @@ export default {
|
|
|
1115
1128
|
ref: 'hideColumn'
|
|
1116
1129
|
}, this.$slots.default),
|
|
1117
1130
|
h('div', {
|
|
1131
|
+
key: 'tw',
|
|
1118
1132
|
class: 'vxe-table--render-wrapper'
|
|
1119
1133
|
}, [
|
|
1120
1134
|
h('div', {
|
|
@@ -1162,37 +1176,74 @@ export default {
|
|
|
1162
1176
|
h('div', {
|
|
1163
1177
|
class: 'vxe-table--fixed-wrapper'
|
|
1164
1178
|
}, [
|
|
1165
|
-
/**
|
|
1166
|
-
* 左侧固定区域
|
|
1167
|
-
*/
|
|
1168
1179
|
leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(),
|
|
1169
|
-
/**
|
|
1170
|
-
* 右侧固定区域
|
|
1171
|
-
*/
|
|
1172
1180
|
rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e()
|
|
1173
1181
|
])
|
|
1174
1182
|
]),
|
|
1183
|
+
virtualScrollBars.x
|
|
1184
|
+
? h('div', {
|
|
1185
|
+
key: 'vx',
|
|
1186
|
+
ref: 'refScrollXVirtualElem',
|
|
1187
|
+
class: 'vxe-table--scroll-x-virtual'
|
|
1188
|
+
}, [
|
|
1189
|
+
h('div', {
|
|
1190
|
+
ref: 'refScrollXHandleElem',
|
|
1191
|
+
class: 'vxe-table--scroll-x-handle',
|
|
1192
|
+
on: {
|
|
1193
|
+
scroll: $xeTable.scrollXEvent
|
|
1194
|
+
}
|
|
1195
|
+
}, [
|
|
1196
|
+
h('div', {
|
|
1197
|
+
ref: 'refScrollXSpaceElem',
|
|
1198
|
+
class: 'vxe-table--scroll-x-space'
|
|
1199
|
+
})
|
|
1200
|
+
])
|
|
1201
|
+
])
|
|
1202
|
+
: renderEmptyElement($xeTable),
|
|
1203
|
+
virtualScrollBars.y
|
|
1204
|
+
? h('div', {
|
|
1205
|
+
key: 'vy',
|
|
1206
|
+
ref: 'refScrollYVirtualElem',
|
|
1207
|
+
class: 'vxe-table--scroll-y-virtual'
|
|
1208
|
+
}, [
|
|
1209
|
+
h('div', {
|
|
1210
|
+
ref: 'refScrollYHandleElem',
|
|
1211
|
+
class: 'vxe-table--scroll-y-handle',
|
|
1212
|
+
on: {
|
|
1213
|
+
scroll: $xeTable.scrollYEvent
|
|
1214
|
+
}
|
|
1215
|
+
}, [
|
|
1216
|
+
h('div', {
|
|
1217
|
+
ref: 'refScrollYSpaceElem',
|
|
1218
|
+
class: 'vxe-table--scroll-x-space'
|
|
1219
|
+
})
|
|
1220
|
+
])
|
|
1221
|
+
])
|
|
1222
|
+
: renderEmptyElement($xeTable),
|
|
1175
1223
|
/**
|
|
1176
1224
|
* 空数据
|
|
1177
1225
|
*/
|
|
1178
1226
|
h('div', {
|
|
1227
|
+
key: 'tn',
|
|
1179
1228
|
ref: 'emptyPlaceholder',
|
|
1180
1229
|
class: 'vxe-table--empty-placeholder'
|
|
1181
1230
|
}, [
|
|
1182
1231
|
h('div', {
|
|
1183
1232
|
class: 'vxe-table--empty-content'
|
|
1184
|
-
},
|
|
1233
|
+
}, renderEmptyBody(h, this))
|
|
1185
1234
|
]),
|
|
1186
1235
|
/**
|
|
1187
1236
|
* 边框线
|
|
1188
1237
|
*/
|
|
1189
1238
|
h('div', {
|
|
1239
|
+
key: 'tl',
|
|
1190
1240
|
class: 'vxe-table--border-line'
|
|
1191
1241
|
}),
|
|
1192
1242
|
/**
|
|
1193
1243
|
* 列宽线
|
|
1194
1244
|
*/
|
|
1195
1245
|
h('div', {
|
|
1246
|
+
key: 'cl',
|
|
1196
1247
|
class: 'vxe-table--resizable-bar',
|
|
1197
1248
|
style: overflowX
|
|
1198
1249
|
? {
|
|
@@ -1206,6 +1257,7 @@ export default {
|
|
|
1206
1257
|
*/
|
|
1207
1258
|
VxeUILoadingComponent
|
|
1208
1259
|
? h(VxeUILoadingComponent, {
|
|
1260
|
+
key: 'lg',
|
|
1209
1261
|
class: 'vxe-table--loading',
|
|
1210
1262
|
props: {
|
|
1211
1263
|
value: currLoading,
|
|
@@ -1219,6 +1271,7 @@ export default {
|
|
|
1219
1271
|
*/
|
|
1220
1272
|
initStore.custom
|
|
1221
1273
|
? h(TableCustomPanelComponent, {
|
|
1274
|
+
key: 'cs',
|
|
1222
1275
|
ref: 'customWrapper',
|
|
1223
1276
|
props: {
|
|
1224
1277
|
customStore
|
|
@@ -1230,6 +1283,7 @@ export default {
|
|
|
1230
1283
|
*/
|
|
1231
1284
|
initStore.filter
|
|
1232
1285
|
? h(TableFilterPanelComponent, {
|
|
1286
|
+
key: 'tf',
|
|
1233
1287
|
ref: 'filterWrapper',
|
|
1234
1288
|
props: {
|
|
1235
1289
|
filterStore
|
|
@@ -1241,6 +1295,7 @@ export default {
|
|
|
1241
1295
|
*/
|
|
1242
1296
|
initStore.import && this.importConfig
|
|
1243
1297
|
? h(TableImportPanelComponent, {
|
|
1298
|
+
key: 'it',
|
|
1244
1299
|
props: {
|
|
1245
1300
|
defaultOptions: this.importParams,
|
|
1246
1301
|
storeData: this.importStore
|
|
@@ -1252,6 +1307,7 @@ export default {
|
|
|
1252
1307
|
*/
|
|
1253
1308
|
initStore.export && (this.exportConfig || this.printConfig)
|
|
1254
1309
|
? h(TableExportPanelComponent, {
|
|
1310
|
+
key: 'et',
|
|
1255
1311
|
props: {
|
|
1256
1312
|
defaultOptions: this.exportParams,
|
|
1257
1313
|
storeData: this.exportStore
|
|
@@ -1263,6 +1319,7 @@ export default {
|
|
|
1263
1319
|
*/
|
|
1264
1320
|
ctxMenuStore.visible && this.isCtxMenu
|
|
1265
1321
|
? h(TableMenuPanelComponent, {
|
|
1322
|
+
key: 'tm',
|
|
1266
1323
|
ref: 'ctxWrapper',
|
|
1267
1324
|
props: {
|
|
1268
1325
|
ctxMenuStore,
|
|
@@ -1276,6 +1333,7 @@ export default {
|
|
|
1276
1333
|
*/
|
|
1277
1334
|
VxeUITooltipComponent
|
|
1278
1335
|
? h(VxeUITooltipComponent, {
|
|
1336
|
+
key: 'ctp',
|
|
1279
1337
|
ref: 'commTip',
|
|
1280
1338
|
props: {
|
|
1281
1339
|
isArrow: false,
|
|
@@ -1288,6 +1346,7 @@ export default {
|
|
|
1288
1346
|
*/
|
|
1289
1347
|
VxeUITooltipComponent
|
|
1290
1348
|
? h(VxeUITooltipComponent, {
|
|
1349
|
+
key: 'btp',
|
|
1291
1350
|
ref: 'tooltip',
|
|
1292
1351
|
props: Object.assign({}, this.tipConfig, this.tooltipStore.currOpts)
|
|
1293
1352
|
})
|
|
@@ -1297,6 +1356,7 @@ export default {
|
|
|
1297
1356
|
*/
|
|
1298
1357
|
VxeUITooltipComponent && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
|
|
1299
1358
|
? h(VxeUITooltipComponent, {
|
|
1359
|
+
key: 'vtp',
|
|
1300
1360
|
ref: 'validTip',
|
|
1301
1361
|
class: [{
|
|
1302
1362
|
'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;
|
|
@@ -532,14 +532,10 @@
|
|
|
532
532
|
font-family: var(--vxe-ui-font-family);
|
|
533
533
|
direction: ltr;
|
|
534
534
|
.vxe-table--body-wrapper {
|
|
535
|
-
|
|
536
|
-
background-color: var(--vxe-ui-layout-background-color);
|
|
537
|
-
}
|
|
535
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
538
536
|
}
|
|
539
537
|
.vxe-table--footer-wrapper {
|
|
540
|
-
|
|
541
|
-
background-color: var(--vxe-ui-table-footer-background-color);
|
|
542
|
-
}
|
|
538
|
+
background-color: var(--vxe-ui-table-footer-background-color);
|
|
543
539
|
}
|
|
544
540
|
.vxe-table--header,
|
|
545
541
|
.vxe-table--body,
|
|
@@ -934,6 +930,48 @@
|
|
|
934
930
|
}
|
|
935
931
|
}
|
|
936
932
|
}
|
|
933
|
+
// 滚动条
|
|
934
|
+
.vxe-table--scroll-x-virtual,
|
|
935
|
+
.vxe-table--scroll-y-virtual {
|
|
936
|
+
position: absolute;
|
|
937
|
+
z-index: 7;
|
|
938
|
+
overflow: hidden;
|
|
939
|
+
}
|
|
940
|
+
.vxe-table--scroll-x-handle,
|
|
941
|
+
.vxe-table--scroll-y-handle {
|
|
942
|
+
position: absolute;
|
|
943
|
+
div {
|
|
944
|
+
display: block;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
.vxe-table--scroll-x-virtual,
|
|
948
|
+
.vxe-table--scroll-x-handle {
|
|
949
|
+
width: 100%;
|
|
950
|
+
left: 0;
|
|
951
|
+
bottom: 0;
|
|
952
|
+
}
|
|
953
|
+
.vxe-table--scroll-x-handle {
|
|
954
|
+
overflow-y: hidden;
|
|
955
|
+
overflow-x: auto;
|
|
956
|
+
height: 18px;
|
|
957
|
+
}
|
|
958
|
+
.vxe-table--scroll-y-virtual,
|
|
959
|
+
.vxe-table--scroll-y-handle {
|
|
960
|
+
height: 100%;
|
|
961
|
+
right: 0;
|
|
962
|
+
top: 0;
|
|
963
|
+
}
|
|
964
|
+
.vxe-table--scroll-y-handle {
|
|
965
|
+
overflow-y: auto;
|
|
966
|
+
overflow-x: hidden;
|
|
967
|
+
width: 18px;
|
|
968
|
+
}
|
|
969
|
+
.vxe-table--scroll-x-space {
|
|
970
|
+
height: 1px;
|
|
971
|
+
}
|
|
972
|
+
.vxe-table--scroll-y-space {
|
|
973
|
+
width: 1px;
|
|
974
|
+
}
|
|
937
975
|
|
|
938
976
|
&.is--padding {
|
|
939
977
|
.vxe-cell {
|
|
@@ -972,6 +1010,7 @@
|
|
|
972
1010
|
background-color: inherit;
|
|
973
1011
|
transition: 0.3s box-shadow;
|
|
974
1012
|
outline: 0;
|
|
1013
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
975
1014
|
.vxe-table--body-wrapper {
|
|
976
1015
|
overflow-x: hidden;
|
|
977
1016
|
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
|