vxe-table 3.17.6 → 3.17.8
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 +47 -29
- package/es/style.css +1 -1
- package/es/table/module/export/mixin.js +3 -1
- package/es/table/src/methods.js +147 -48
- package/es/table/src/props.js +1 -1
- package/es/table/src/table.js +12 -12
- package/es/table/src/util.js +0 -4
- package/es/toolbar/src/toolbar.js +2 -2
- package/es/ui/index.js +13 -4
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +49 -26
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +13627 -13483
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/mixin.js +5 -1
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/methods.js +158 -49
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +13 -13
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +0 -4
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +2 -0
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +12 -3
- 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 +49 -30
- package/packages/table/module/export/mixin.ts +5 -3
- package/packages/table/src/methods.ts +157 -52
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +12 -14
- package/packages/table/src/util.ts +0 -4
- package/packages/toolbar/src/toolbar.ts +2 -2
- package/packages/ui/index.ts +12 -2
- package/packages/ui/src/dom.ts +1 -1
- package/styles/cssvar.scss +0 -2
- /package/es/{iconfont.1754534807189.ttf → iconfont.1754905462391.ttf} +0 -0
- /package/es/{iconfont.1754534807189.woff → iconfont.1754905462391.woff} +0 -0
- /package/es/{iconfont.1754534807189.woff2 → iconfont.1754905462391.woff2} +0 -0
- /package/lib/{iconfont.1754534807189.ttf → iconfont.1754905462391.ttf} +0 -0
- /package/lib/{iconfont.1754534807189.woff → iconfont.1754905462391.woff} +0 -0
- /package/lib/{iconfont.1754534807189.woff2 → iconfont.1754905462391.woff2} +0 -0
|
@@ -8,7 +8,7 @@ import { getSlotVNs } from '../../ui/src/vn'
|
|
|
8
8
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from './anime'
|
|
9
9
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
10
10
|
|
|
11
|
-
import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, TableReactData, VxeTableConstructor, VxeToolbarConstructor, TableInternalData, VxeGridConstructor, GridPrivateMethods, VxeTablePrivateMethods, VxeTooltipInstance, VxeTablePropTypes } from '../../../types'
|
|
11
|
+
import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, TableReactData, VxeTableConstructor, VxeToolbarConstructor, VxeToolbarInstance, TableInternalData, VxeGridConstructor, GridPrivateMethods, VxeTablePrivateMethods, VxeTooltipInstance, VxeTablePropTypes } from '../../../types'
|
|
12
12
|
|
|
13
13
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI
|
|
14
14
|
|
|
@@ -971,14 +971,15 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
971
971
|
const internalData = $xeTable as unknown as TableInternalData
|
|
972
972
|
|
|
973
973
|
const { showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props
|
|
974
|
-
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading } = reactData
|
|
975
|
-
const { visibleColumn, tableHeight,
|
|
974
|
+
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading, tHeaderHeight, tFooterHeight } = reactData
|
|
975
|
+
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData
|
|
976
|
+
const $xeGanttView = internalData.xeGanttView
|
|
976
977
|
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
977
|
-
if (!el) {
|
|
978
|
+
if (!el || !el.clientHeight) {
|
|
978
979
|
return
|
|
979
980
|
}
|
|
980
981
|
const containerList = ['main', 'left', 'right']
|
|
981
|
-
|
|
982
|
+
let osbWidth = overflowY ? scrollbarWidth : 0
|
|
982
983
|
const osbHeight = overflowX ? scrollbarHeight : 0
|
|
983
984
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder as HTMLDivElement
|
|
984
985
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
@@ -986,39 +987,49 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
986
987
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
|
|
987
988
|
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
988
989
|
if (emptyPlaceholderElem) {
|
|
989
|
-
emptyPlaceholderElem.style.top = `${
|
|
990
|
+
emptyPlaceholderElem.style.top = `${tHeaderHeight}px`
|
|
990
991
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : ''
|
|
991
992
|
}
|
|
992
993
|
|
|
993
|
-
|
|
994
|
+
const scrollbarXToTop = $xeTable.computeScrollbarXToTop
|
|
995
|
+
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft
|
|
996
|
+
|
|
997
|
+
const xScrollbarVisible = overflowX ? 'visible' : 'hidden'
|
|
998
|
+
let yScrollbarVisible = overflowY ? 'visible' : 'hidden'
|
|
999
|
+
if ($xeGanttView) {
|
|
1000
|
+
if (!scrollbarYToLeft) {
|
|
1001
|
+
osbWidth = 0
|
|
1002
|
+
yScrollbarVisible = 'hidden'
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
let tbHeight = 0
|
|
994
1007
|
let bodyMaxHeight = 0
|
|
995
|
-
const bodyMinHeight = customMinHeight -
|
|
1008
|
+
const bodyMinHeight = customMinHeight - tHeaderHeight - tFooterHeight - osbHeight
|
|
996
1009
|
if (customMaxHeight) {
|
|
997
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight -
|
|
1010
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - tHeaderHeight - tFooterHeight - osbHeight)
|
|
998
1011
|
}
|
|
999
1012
|
if (customHeight) {
|
|
1000
|
-
|
|
1013
|
+
tbHeight = customHeight - tHeaderHeight - tFooterHeight - osbHeight
|
|
1001
1014
|
}
|
|
1002
|
-
if (!
|
|
1015
|
+
if (!tbHeight) {
|
|
1003
1016
|
if (bodyTableElem) {
|
|
1004
|
-
|
|
1017
|
+
tbHeight = bodyTableElem.clientHeight
|
|
1005
1018
|
}
|
|
1006
1019
|
}
|
|
1007
|
-
if (
|
|
1020
|
+
if (tbHeight) {
|
|
1008
1021
|
if (bodyMaxHeight) {
|
|
1009
|
-
|
|
1022
|
+
tbHeight = Math.min(bodyMaxHeight, tbHeight)
|
|
1010
1023
|
}
|
|
1011
|
-
|
|
1024
|
+
tbHeight = Math.max(bodyMinHeight, tbHeight)
|
|
1012
1025
|
}
|
|
1013
1026
|
|
|
1014
|
-
const scrollbarXToTop = $xeTable.$refs.computeScrollbarXToTop
|
|
1015
|
-
|
|
1016
1027
|
const xLeftCornerEl = $xeTable.$refs.refScrollXLeftCornerElem as HTMLDivElement
|
|
1017
1028
|
const xRightCornerEl = $xeTable.$refs.refScrollXRightCornerElem as HTMLDivElement
|
|
1018
1029
|
const scrollXVirtualEl = $xeTable.$refs.refScrollXVirtualElem as HTMLDivElement
|
|
1019
1030
|
if (scrollXVirtualEl) {
|
|
1020
1031
|
scrollXVirtualEl.style.height = `${osbHeight}px`
|
|
1021
|
-
scrollXVirtualEl.style.visibility =
|
|
1032
|
+
scrollXVirtualEl.style.visibility = xScrollbarVisible
|
|
1022
1033
|
}
|
|
1023
1034
|
const xWrapperEl = $xeTable.$refs.refScrollXWrapperElem as HTMLDivElement
|
|
1024
1035
|
if (xWrapperEl) {
|
|
@@ -1037,32 +1048,34 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1037
1048
|
const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem as HTMLDivElement
|
|
1038
1049
|
if (scrollYVirtualEl) {
|
|
1039
1050
|
scrollYVirtualEl.style.width = `${osbWidth}px`
|
|
1040
|
-
scrollYVirtualEl.style.height = `${
|
|
1041
|
-
scrollYVirtualEl.style.visibility =
|
|
1051
|
+
scrollYVirtualEl.style.height = `${tbHeight + tHeaderHeight + tFooterHeight}px`
|
|
1052
|
+
scrollYVirtualEl.style.visibility = yScrollbarVisible
|
|
1042
1053
|
}
|
|
1043
1054
|
const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem as HTMLDivElement
|
|
1044
1055
|
if (yTopCornerEl) {
|
|
1045
|
-
yTopCornerEl.style.height = `${
|
|
1046
|
-
yTopCornerEl.style.display = overflowY &&
|
|
1056
|
+
yTopCornerEl.style.height = `${tHeaderHeight}px`
|
|
1057
|
+
yTopCornerEl.style.display = overflowY && tHeaderHeight ? 'block' : ''
|
|
1047
1058
|
}
|
|
1048
1059
|
const yWrapperEl = $xeTable.$refs.refScrollYWrapperElem as HTMLDivElement
|
|
1049
1060
|
if (yWrapperEl) {
|
|
1050
|
-
yWrapperEl.style.height = `${
|
|
1051
|
-
yWrapperEl.style.top = `${
|
|
1061
|
+
yWrapperEl.style.height = `${tbHeight}px`
|
|
1062
|
+
yWrapperEl.style.top = `${tHeaderHeight}px`
|
|
1052
1063
|
}
|
|
1053
1064
|
const yBottomCornerEl = $xeTable.$refs.refScrollYBottomCornerElem as HTMLDivElement
|
|
1054
1065
|
if (yBottomCornerEl) {
|
|
1055
|
-
yBottomCornerEl.style.height = `${
|
|
1056
|
-
yBottomCornerEl.style.top = `${
|
|
1057
|
-
yBottomCornerEl.style.display = overflowY &&
|
|
1066
|
+
yBottomCornerEl.style.height = `${tFooterHeight}px`
|
|
1067
|
+
yBottomCornerEl.style.top = `${tHeaderHeight + tbHeight}px`
|
|
1068
|
+
yBottomCornerEl.style.display = overflowY && tFooterHeight ? 'block' : ''
|
|
1058
1069
|
}
|
|
1059
1070
|
|
|
1060
1071
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem as HTMLDivElement
|
|
1061
1072
|
if (rowExpandEl) {
|
|
1062
|
-
rowExpandEl.style.height = `${
|
|
1063
|
-
rowExpandEl.style.top = `${
|
|
1073
|
+
rowExpandEl.style.height = `${tbHeight}px`
|
|
1074
|
+
rowExpandEl.style.top = `${tHeaderHeight}px`
|
|
1064
1075
|
}
|
|
1065
1076
|
|
|
1077
|
+
reactData.tBodyHeight = tbHeight
|
|
1078
|
+
|
|
1066
1079
|
containerList.forEach((name, index) => {
|
|
1067
1080
|
const fixedType = index > 0 ? name : ''
|
|
1068
1081
|
const layoutList = ['header', 'body', 'footer']
|
|
@@ -1128,7 +1141,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1128
1141
|
}
|
|
1129
1142
|
|
|
1130
1143
|
if (currScrollElem) {
|
|
1131
|
-
currScrollElem.style.height = `${
|
|
1144
|
+
currScrollElem.style.height = `${tHeaderHeight}px`
|
|
1132
1145
|
}
|
|
1133
1146
|
|
|
1134
1147
|
if (tableElem) {
|
|
@@ -1137,16 +1150,16 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1137
1150
|
} else if (layout === 'body') {
|
|
1138
1151
|
if (currScrollElem) {
|
|
1139
1152
|
currScrollElem.style.maxHeight = customMaxHeight ? `${bodyMaxHeight}px` : ''
|
|
1140
|
-
currScrollElem.style.height = customHeight ? `${
|
|
1153
|
+
currScrollElem.style.height = customHeight ? `${tbHeight}px` : ''
|
|
1141
1154
|
currScrollElem.style.minHeight = `${bodyMinHeight}px`
|
|
1142
1155
|
}
|
|
1143
1156
|
|
|
1144
1157
|
// 如果是固定列
|
|
1145
1158
|
if (fixedWrapperElem) {
|
|
1146
1159
|
if (wrapperElem) {
|
|
1147
|
-
wrapperElem.style.top = `${
|
|
1160
|
+
wrapperElem.style.top = `${tHeaderHeight}px`
|
|
1148
1161
|
}
|
|
1149
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight +
|
|
1162
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + tHeaderHeight + tFooterHeight + osbHeight)}px`
|
|
1150
1163
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`
|
|
1151
1164
|
}
|
|
1152
1165
|
|
|
@@ -1229,11 +1242,11 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1229
1242
|
}
|
|
1230
1243
|
|
|
1231
1244
|
if (currScrollElem) {
|
|
1232
|
-
currScrollElem.style.height = `${
|
|
1245
|
+
currScrollElem.style.height = `${tFooterHeight}px`
|
|
1233
1246
|
// 如果是固定列
|
|
1234
1247
|
if (fixedWrapperElem) {
|
|
1235
1248
|
if (wrapperElem) {
|
|
1236
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight -
|
|
1249
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - tFooterHeight - osbHeight : tableHeight + tHeaderHeight}px`
|
|
1237
1250
|
}
|
|
1238
1251
|
}
|
|
1239
1252
|
}
|
|
@@ -1249,6 +1262,9 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1249
1262
|
if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
|
|
1250
1263
|
$xeTable.addCellSelectedClass()
|
|
1251
1264
|
}
|
|
1265
|
+
if ($xeGanttView) {
|
|
1266
|
+
$xeGanttView.handleUpdateStyle()
|
|
1267
|
+
}
|
|
1252
1268
|
return $xeTable.$nextTick()
|
|
1253
1269
|
}
|
|
1254
1270
|
|
|
@@ -2332,12 +2348,17 @@ function autoCellWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
|
|
|
2332
2348
|
const calcCellAutoHeight = (rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
|
|
2333
2349
|
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`)
|
|
2334
2350
|
let colHeight = rowRest.height
|
|
2351
|
+
let firstCellStyle: CSSStyleDeclaration | null = null
|
|
2352
|
+
let topBottomPadding = 0
|
|
2335
2353
|
for (let i = 0; i < cellElemList.length; i++) {
|
|
2336
|
-
const
|
|
2337
|
-
const
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2354
|
+
const wrapperElem = cellElemList[i] as HTMLElement
|
|
2355
|
+
const cellElem = wrapperElem.parentElement as HTMLTableCellElement
|
|
2356
|
+
if (!firstCellStyle) {
|
|
2357
|
+
firstCellStyle = getComputedStyle(cellElem)
|
|
2358
|
+
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0
|
|
2359
|
+
}
|
|
2360
|
+
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0
|
|
2361
|
+
colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding))
|
|
2341
2362
|
}
|
|
2342
2363
|
return colHeight
|
|
2343
2364
|
}
|
|
@@ -2757,13 +2778,13 @@ function calcScrollbar ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
|
|
|
2757
2778
|
}
|
|
2758
2779
|
reactData.overflowX = overflowX
|
|
2759
2780
|
|
|
2760
|
-
const
|
|
2761
|
-
const
|
|
2781
|
+
const hHeight = headerTableElem ? headerTableElem.clientHeight : 0
|
|
2782
|
+
const fHeight = footerTableElem ? footerTableElem.clientHeight : 0
|
|
2762
2783
|
internalData.tableHeight = bodyWrapperElem.offsetHeight
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
reactData.parentHeight = Math.max(
|
|
2784
|
+
reactData.tHeaderHeight = hHeight
|
|
2785
|
+
reactData.tFooterHeight = fHeight
|
|
2786
|
+
reactData.overflowX = overflowX
|
|
2787
|
+
reactData.parentHeight = Math.max(hHeight + fHeight + 20, $xeTable.getParentHeight())
|
|
2767
2788
|
}
|
|
2768
2789
|
if (overflowX) {
|
|
2769
2790
|
$xeTable.checkScrolling()
|
|
@@ -2823,6 +2844,7 @@ function handleLazyRecalculate ($xeTable: VxeTableConstructor & VxeTablePrivateM
|
|
|
2823
2844
|
|
|
2824
2845
|
return new Promise<void>(resolve => {
|
|
2825
2846
|
const { rceTimeout, rceRunTime } = internalData
|
|
2847
|
+
const $xeGanttView = internalData.xeGanttView
|
|
2826
2848
|
const resizeOpts = $xeTable.computeResizeOpts
|
|
2827
2849
|
const refreshDelay = resizeOpts.refreshDelay || 20
|
|
2828
2850
|
const el = $xeTable.$refs.refElem as HTMLElement
|
|
@@ -2846,6 +2868,9 @@ function handleLazyRecalculate ($xeTable: VxeTableConstructor & VxeTablePrivateM
|
|
|
2846
2868
|
handleRecalculateStyle($xeTable, reFull, reWidth, reHeight)
|
|
2847
2869
|
)
|
|
2848
2870
|
}
|
|
2871
|
+
if ($xeGanttView) {
|
|
2872
|
+
$xeGanttView.handleLazyRecalculate()
|
|
2873
|
+
}
|
|
2849
2874
|
internalData.rceTimeout = setTimeout(() => {
|
|
2850
2875
|
internalData.rceTimeout = undefined
|
|
2851
2876
|
handleRecalculateStyle($xeTable, reFull, reWidth, reHeight)
|
|
@@ -3653,6 +3678,20 @@ const wheelScrollTopTo = (diffNum: number, cb: (progress: number) => void) => {
|
|
|
3653
3678
|
requestAnimationFrame(step)
|
|
3654
3679
|
}
|
|
3655
3680
|
|
|
3681
|
+
const syncGanttScrollTop = ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, scrollTop: number) => {
|
|
3682
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
3683
|
+
|
|
3684
|
+
const $xeGanttView = internalData.xeGanttView
|
|
3685
|
+
if ($xeGanttView) {
|
|
3686
|
+
const ganttInternalData = $xeGanttView.internalData
|
|
3687
|
+
const { elemStore: ganttElemStore } = ganttInternalData
|
|
3688
|
+
const ganttBodyScrollElem = getRefElem(ganttElemStore['main-body-scroll'])
|
|
3689
|
+
if (ganttBodyScrollElem) {
|
|
3690
|
+
ganttBodyScrollElem.scrollTop = scrollTop
|
|
3691
|
+
}
|
|
3692
|
+
}
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3656
3695
|
function updateHeight ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
3657
3696
|
const reactData = $xeTable as unknown as TableReactData
|
|
3658
3697
|
const internalData = $xeTable as unknown as TableInternalData
|
|
@@ -3983,6 +4022,7 @@ const Methods = {
|
|
|
3983
4022
|
|
|
3984
4023
|
const { scrollYLoad } = reactData
|
|
3985
4024
|
const { scrollYStore, fullDataRowIdData } = internalData
|
|
4025
|
+
const $xeGanttView = internalData.xeGanttView
|
|
3986
4026
|
let fullList: any[] = internalData.afterFullData
|
|
3987
4027
|
// 是否进行数据处理
|
|
3988
4028
|
if (force) {
|
|
@@ -4003,6 +4043,9 @@ const Methods = {
|
|
|
4003
4043
|
})
|
|
4004
4044
|
reactData.tableData = tableData
|
|
4005
4045
|
internalData.visibleDataRowIdData = visibleDataRowIdMaps
|
|
4046
|
+
if ($xeGanttView) {
|
|
4047
|
+
$xeGanttView.updateViewData()
|
|
4048
|
+
}
|
|
4006
4049
|
return $xeTable.$nextTick()
|
|
4007
4050
|
},
|
|
4008
4051
|
/**
|
|
@@ -5792,12 +5835,14 @@ const Methods = {
|
|
|
5792
5835
|
},
|
|
5793
5836
|
handleRowResizeMousedownEvent (evnt: MouseEvent, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
5794
5837
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
5838
|
+
const props = $xeTable
|
|
5795
5839
|
const reactData = $xeTable as unknown as TableReactData
|
|
5796
5840
|
const internalData = $xeTable as unknown as TableInternalData
|
|
5797
5841
|
|
|
5798
5842
|
evnt.stopPropagation()
|
|
5799
5843
|
evnt.preventDefault()
|
|
5800
5844
|
const { row } = params
|
|
5845
|
+
const { showOverflow } = props
|
|
5801
5846
|
const { overflowX, scrollbarWidth, overflowY, scrollbarHeight } = reactData
|
|
5802
5847
|
const { elemStore, fullAllDataRowIdData } = internalData
|
|
5803
5848
|
const osbWidth = overflowY ? scrollbarWidth : 0
|
|
@@ -5826,7 +5871,10 @@ const Methods = {
|
|
|
5826
5871
|
return
|
|
5827
5872
|
}
|
|
5828
5873
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight
|
|
5829
|
-
|
|
5874
|
+
let currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
5875
|
+
if (!showOverflow) {
|
|
5876
|
+
currCellHeight = tdEl.clientHeight
|
|
5877
|
+
}
|
|
5830
5878
|
const tableRect = tableEl.getBoundingClientRect()
|
|
5831
5879
|
const trRect = trEl.getBoundingClientRect()
|
|
5832
5880
|
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight
|
|
@@ -5992,6 +6040,29 @@ const Methods = {
|
|
|
5992
6040
|
})
|
|
5993
6041
|
return rest
|
|
5994
6042
|
},
|
|
6043
|
+
recalcRowHeight (rowOrId: any | any[]) {
|
|
6044
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6045
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
6046
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
6047
|
+
|
|
6048
|
+
const { fullAllDataRowIdData } = internalData
|
|
6049
|
+
const rows = XEUtils.isArray(rowOrId) ? rowOrId : [rowOrId]
|
|
6050
|
+
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
6051
|
+
if (el) {
|
|
6052
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
6053
|
+
el.setAttribute('data-calc-row', 'Y')
|
|
6054
|
+
rows.forEach(row => {
|
|
6055
|
+
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row)
|
|
6056
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
6057
|
+
if (rowRest) {
|
|
6058
|
+
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el)
|
|
6059
|
+
}
|
|
6060
|
+
el.removeAttribute('data-calc-row')
|
|
6061
|
+
})
|
|
6062
|
+
reactData.calcCellHeightFlag++
|
|
6063
|
+
}
|
|
6064
|
+
return $xeTable.$nextTick()
|
|
6065
|
+
},
|
|
5995
6066
|
setRowHeight (rowOrId: any | any[], height: number) {
|
|
5996
6067
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
5997
6068
|
const reactData = $xeTable as unknown as TableReactData
|
|
@@ -10256,6 +10327,7 @@ const Methods = {
|
|
|
10256
10327
|
}
|
|
10257
10328
|
setScrollTop(yHandleEl, scrollTop)
|
|
10258
10329
|
setScrollTop(rowExpandEl, scrollTop)
|
|
10330
|
+
syncGanttScrollTop($xeTable, scrollTop)
|
|
10259
10331
|
if (scrollYLoad) {
|
|
10260
10332
|
$xeTable.triggerScrollYEvent(evnt)
|
|
10261
10333
|
}
|
|
@@ -10460,6 +10532,7 @@ const Methods = {
|
|
|
10460
10532
|
setScrollTop(leftScrollElem, currTopNum)
|
|
10461
10533
|
setScrollTop(rightScrollElem, currTopNum)
|
|
10462
10534
|
setScrollTop(rowExpandEl, currTopNum)
|
|
10535
|
+
syncGanttScrollTop($xeTable, currTopNum)
|
|
10463
10536
|
if (scrollYLoad) {
|
|
10464
10537
|
$xeTable.triggerScrollYEvent(evnt)
|
|
10465
10538
|
}
|
|
@@ -10476,6 +10549,7 @@ const Methods = {
|
|
|
10476
10549
|
setScrollTop(leftScrollElem, currTopNum)
|
|
10477
10550
|
setScrollTop(rightScrollElem, currTopNum)
|
|
10478
10551
|
setScrollTop(rowExpandEl, currTopNum)
|
|
10552
|
+
syncGanttScrollTop($xeTable, currTopNum)
|
|
10479
10553
|
if (scrollYLoad) {
|
|
10480
10554
|
$xeTable.triggerScrollYEvent(evnt)
|
|
10481
10555
|
}
|
|
@@ -10559,6 +10633,7 @@ const Methods = {
|
|
|
10559
10633
|
setScrollTop(leftScrollElem, scrollTop)
|
|
10560
10634
|
setScrollTop(rightScrollElem, scrollTop)
|
|
10561
10635
|
setScrollTop(rowExpandEl, scrollTop)
|
|
10636
|
+
syncGanttScrollTop($xeTable, scrollTop)
|
|
10562
10637
|
if (scrollYLoad) {
|
|
10563
10638
|
$xeTable.triggerScrollYEvent(evnt)
|
|
10564
10639
|
}
|
|
@@ -10590,6 +10665,7 @@ const Methods = {
|
|
|
10590
10665
|
|
|
10591
10666
|
const { scrollXLoad, overflowX, scrollXWidth } = reactData
|
|
10592
10667
|
const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData
|
|
10668
|
+
const $xeGanttView = internalData.xeGanttView
|
|
10593
10669
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
10594
10670
|
const tableBody = $xeTable.$refs.refTableBody
|
|
10595
10671
|
const tableBodyElem = tableBody ? (tableBody as any).$el as HTMLDivElement : null
|
|
@@ -10657,10 +10733,13 @@ const Methods = {
|
|
|
10657
10733
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`
|
|
10658
10734
|
}
|
|
10659
10735
|
|
|
10736
|
+
calcScrollbar($xeTable)
|
|
10660
10737
|
if (isScrollXBig && mouseOpts.area) {
|
|
10661
10738
|
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
10662
10739
|
}
|
|
10663
|
-
|
|
10740
|
+
if ($xeGanttView) {
|
|
10741
|
+
$xeGanttView.updateScrollXSpace()
|
|
10742
|
+
}
|
|
10664
10743
|
return $xeTable.$nextTick(() => {
|
|
10665
10744
|
updateStyle($xeTable)
|
|
10666
10745
|
})
|
|
@@ -10684,6 +10763,7 @@ const Methods = {
|
|
|
10684
10763
|
|
|
10685
10764
|
const { isAllOverflow, scrollYLoad, expandColumn } = reactData
|
|
10686
10765
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData
|
|
10766
|
+
const $xeGanttView = internalData.xeGanttView
|
|
10687
10767
|
const { startIndex } = scrollYStore
|
|
10688
10768
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
10689
10769
|
const expandOpts = $xeTable.computeExpandOpts
|
|
@@ -10778,10 +10858,13 @@ const Methods = {
|
|
|
10778
10858
|
reactData.scrollYHeight = scrollYHeight
|
|
10779
10859
|
reactData.isScrollYBig = isScrollYBig
|
|
10780
10860
|
|
|
10861
|
+
calcScrollbar($xeTable)
|
|
10781
10862
|
if (isScrollYBig && mouseOpts.area) {
|
|
10782
10863
|
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
10783
10864
|
}
|
|
10784
|
-
|
|
10865
|
+
if ($xeGanttView) {
|
|
10866
|
+
$xeGanttView.updateScrollYSpace()
|
|
10867
|
+
}
|
|
10785
10868
|
return $xeTable.$nextTick().then(() => {
|
|
10786
10869
|
updateStyle($xeTable)
|
|
10787
10870
|
})
|
|
@@ -11160,16 +11243,38 @@ const Methods = {
|
|
|
11160
11243
|
this.isActivated = false
|
|
11161
11244
|
return this.$nextTick()
|
|
11162
11245
|
},
|
|
11163
|
-
|
|
11164
|
-
|
|
11246
|
+
/**
|
|
11247
|
+
* 已废弃,被 connectToolbar 替换
|
|
11248
|
+
* @deprecated
|
|
11249
|
+
*/
|
|
11250
|
+
connect ($toolbar: VxeToolbarConstructor | VxeToolbarInstance) {
|
|
11251
|
+
return this.connectToolbar($toolbar)
|
|
11252
|
+
},
|
|
11253
|
+
/**
|
|
11254
|
+
* 连接工具栏
|
|
11255
|
+
* @param $toolbar
|
|
11256
|
+
*/
|
|
11257
|
+
connectToolbar ($toolbar: VxeToolbarConstructor | VxeToolbarInstance) {
|
|
11258
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11259
|
+
|
|
11165
11260
|
if ($toolbar && $toolbar.syncUpdate) {
|
|
11166
|
-
$toolbar.syncUpdate({ collectColumn: this.collectColumn, $table:
|
|
11261
|
+
$toolbar.syncUpdate({ collectColumn: this.collectColumn, $table: $xeTable })
|
|
11167
11262
|
this.$toolbar = $toolbar
|
|
11168
11263
|
} else {
|
|
11169
11264
|
errLog('vxe.error.barUnableLink')
|
|
11170
11265
|
}
|
|
11171
11266
|
return this.$nextTick()
|
|
11172
11267
|
},
|
|
11268
|
+
handleConnectGanttView ($ganttView: any) {
|
|
11269
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11270
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
11271
|
+
|
|
11272
|
+
if ($ganttView && $ganttView.connectUpdate) {
|
|
11273
|
+
$ganttView.connectUpdate({ $table: $xeTable })
|
|
11274
|
+
internalData.xeGanttView = $ganttView
|
|
11275
|
+
}
|
|
11276
|
+
return $xeTable.$nextTick()
|
|
11277
|
+
},
|
|
11173
11278
|
|
|
11174
11279
|
/*************************
|
|
11175
11280
|
* Publish methods
|
|
@@ -8,7 +8,7 @@ import methods from './methods'
|
|
|
8
8
|
import TableBodyComponent from './body'
|
|
9
9
|
import TableHeaderComponent from './header'
|
|
10
10
|
import TableFooterComponent from './footer'
|
|
11
|
-
import tableProps from './props'
|
|
11
|
+
import { tableProps } from './props'
|
|
12
12
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
13
13
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
14
14
|
import TableCustomPanelComponent from '../module/custom/panel'
|
|
@@ -522,6 +522,12 @@ export default {
|
|
|
522
522
|
scrollbarHeight: 0,
|
|
523
523
|
// 行高
|
|
524
524
|
rowHeight: 0,
|
|
525
|
+
// 表头高度
|
|
526
|
+
tHeaderHeight: 0,
|
|
527
|
+
// 表体高度
|
|
528
|
+
tBodyHeight: 0,
|
|
529
|
+
// 表尾高度
|
|
530
|
+
tFooterHeight: 0,
|
|
525
531
|
// 表格父容器的高度
|
|
526
532
|
parentHeight: 0,
|
|
527
533
|
// 是否使用分组表头
|
|
@@ -1410,28 +1416,20 @@ export default {
|
|
|
1410
1416
|
},
|
|
1411
1417
|
|
|
1412
1418
|
computeSize () {
|
|
1413
|
-
this.
|
|
1419
|
+
this.reLayoutFlag++
|
|
1414
1420
|
},
|
|
1415
1421
|
showHeader () {
|
|
1416
|
-
this.
|
|
1422
|
+
this.reLayoutFlag++
|
|
1417
1423
|
},
|
|
1418
1424
|
showFooter () {
|
|
1419
|
-
this.
|
|
1425
|
+
this.reLayoutFlag++
|
|
1420
1426
|
},
|
|
1421
1427
|
overflowX () {
|
|
1422
|
-
this.
|
|
1428
|
+
this.reLayoutFlag++
|
|
1423
1429
|
},
|
|
1424
1430
|
overflowY () {
|
|
1425
|
-
this.
|
|
1426
|
-
},
|
|
1427
|
-
reScrollFlag () {
|
|
1428
|
-
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1429
|
-
|
|
1430
|
-
$xeTable.$nextTick(() => {
|
|
1431
|
-
$xeTable.recalculate(true).then(() => $xeTable.refreshScroll())
|
|
1432
|
-
})
|
|
1431
|
+
this.reLayoutFlag++
|
|
1433
1432
|
},
|
|
1434
|
-
|
|
1435
1433
|
height () {
|
|
1436
1434
|
this.reLayoutFlag++
|
|
1437
1435
|
},
|
|
@@ -367,7 +367,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
367
367
|
$xeGrid.triggerToolbarBtnEvent(item, $event)
|
|
368
368
|
} else {
|
|
369
369
|
const gCommandOpts = commands.get(code)
|
|
370
|
-
const params = { code, button: item, $table: $table
|
|
370
|
+
const params = { code, button: item, $table: $table as VxeTableConstructor, $grid: $xeGrid, $gantt: null, $event }
|
|
371
371
|
if (gCommandOpts) {
|
|
372
372
|
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
|
|
373
373
|
if (tCommandMethod) {
|
|
@@ -396,7 +396,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
396
396
|
$xeGrid.triggerToolbarTolEvent(item, $event)
|
|
397
397
|
} else {
|
|
398
398
|
const gCommandOpts = commands.get(code)
|
|
399
|
-
const params = { code, button: null, tool: item, $table: $table
|
|
399
|
+
const params = { code, button: null, tool: item, $table: $table as VxeTableConstructor, $grid: $xeGrid, $gantt: null, $event }
|
|
400
400
|
if (gCommandOpts) {
|
|
401
401
|
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
|
|
402
402
|
if (tCommandMethod) {
|
package/packages/ui/index.ts
CHANGED
|
@@ -235,7 +235,15 @@ VxeUI.setConfig({
|
|
|
235
235
|
},
|
|
236
236
|
scrollbarConfig: {
|
|
237
237
|
// width: 14,
|
|
238
|
-
// height: 14
|
|
238
|
+
// height: 14,
|
|
239
|
+
x: {
|
|
240
|
+
// position: 'bottom',
|
|
241
|
+
visible: true
|
|
242
|
+
},
|
|
243
|
+
y: {
|
|
244
|
+
// position: 'right',
|
|
245
|
+
visible: true
|
|
246
|
+
}
|
|
239
247
|
}
|
|
240
248
|
},
|
|
241
249
|
// export: {
|
|
@@ -288,7 +296,9 @@ VxeUI.setConfig({
|
|
|
288
296
|
// types: ['csv', 'html', 'xml', 'txt']
|
|
289
297
|
// },
|
|
290
298
|
// buttons: []
|
|
291
|
-
}
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
gantt: {}
|
|
292
302
|
})
|
|
293
303
|
|
|
294
304
|
const iconPrefix = 'vxe-table-icon-'
|
package/packages/ui/src/dom.ts
CHANGED
package/styles/cssvar.scss
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|