vxe-table 4.13.0-beta.4 → 4.13.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/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/src/table.js +54 -39
- package/es/table/style.css +12 -0
- 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 +12 -0
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +11 -10
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/table.js +59 -39
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +12 -0
- 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 +12 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/src/table.ts +60 -40
- package/styles/components/table.scss +19 -0
- /package/es/{iconfont.1744095189878.ttf → iconfont.1744252965278.ttf} +0 -0
- /package/es/{iconfont.1744095189878.woff → iconfont.1744252965278.woff} +0 -0
- /package/es/{iconfont.1744095189878.woff2 → iconfont.1744252965278.woff2} +0 -0
- /package/lib/{iconfont.1744095189878.ttf → iconfont.1744252965278.ttf} +0 -0
- /package/lib/{iconfont.1744095189878.woff → iconfont.1744252965278.woff} +0 -0
- /package/lib/{iconfont.1744095189878.woff2 → iconfont.1744252965278.woff2} +0 -0
|
@@ -1564,10 +1564,8 @@ export default defineComponent({
|
|
|
1564
1564
|
*/
|
|
1565
1565
|
const autoCellWidth = () => {
|
|
1566
1566
|
const { elemStore } = internalData
|
|
1567
|
-
const
|
|
1568
|
-
|
|
1569
|
-
const bodyElem = tableBody ? tableBody.$el as HTMLDivElement : null
|
|
1570
|
-
if (!bodyElem) {
|
|
1567
|
+
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
|
|
1568
|
+
if (!bodyWrapperElem) {
|
|
1571
1569
|
return
|
|
1572
1570
|
}
|
|
1573
1571
|
const yHandleEl = refScrollYHandleElem.value
|
|
@@ -1580,7 +1578,7 @@ export default defineComponent({
|
|
|
1580
1578
|
}
|
|
1581
1579
|
let tWidth = 0
|
|
1582
1580
|
const minCellWidth = 40 // 列宽最少限制 40px
|
|
1583
|
-
const bodyWidth =
|
|
1581
|
+
const bodyWidth = bodyWrapperElem.clientWidth
|
|
1584
1582
|
let remainWidth = bodyWidth
|
|
1585
1583
|
let meanWidth = remainWidth / 100
|
|
1586
1584
|
const { fit } = props
|
|
@@ -1664,29 +1662,10 @@ export default defineComponent({
|
|
|
1664
1662
|
}
|
|
1665
1663
|
}
|
|
1666
1664
|
}
|
|
1667
|
-
const tableHeight = bodyElem.offsetHeight
|
|
1668
|
-
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight
|
|
1669
|
-
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth)
|
|
1670
|
-
reactData.overflowY = overflowY
|
|
1671
1665
|
reactData.scrollXWidth = tWidth
|
|
1672
|
-
internalData.tableHeight = tableHeight
|
|
1673
|
-
|
|
1674
|
-
const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
1675
|
-
const footerTableElem = getRefElem(elemStore['main-footer-table'])
|
|
1676
|
-
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0
|
|
1677
|
-
const overflowX = tWidth > bodyWidth
|
|
1678
|
-
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0
|
|
1679
|
-
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight)
|
|
1680
|
-
internalData.headerHeight = headerHeight
|
|
1681
|
-
internalData.footerHeight = footerHeight
|
|
1682
|
-
reactData.overflowX = overflowX
|
|
1683
1666
|
reactData.resizeWidthFlag++
|
|
1684
1667
|
updateColumnOffsetLeft()
|
|
1685
1668
|
updateHeight()
|
|
1686
|
-
reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight())
|
|
1687
|
-
if (overflowX) {
|
|
1688
|
-
$xeTable.checkScrolling()
|
|
1689
|
-
}
|
|
1690
1669
|
}
|
|
1691
1670
|
|
|
1692
1671
|
const calcCellAutoHeight = (rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
|
|
@@ -2775,7 +2754,9 @@ export default defineComponent({
|
|
|
2775
2754
|
}
|
|
2776
2755
|
// 计算 Y 逻辑
|
|
2777
2756
|
const rowHeight = computeRowHeight()
|
|
2778
|
-
|
|
2757
|
+
|
|
2758
|
+
;(scrollYStore as any).rowHeight = rowHeight // 已废弃
|
|
2759
|
+
|
|
2779
2760
|
reactData.rowHeight = rowHeight
|
|
2780
2761
|
const { toVisibleIndex: toYVisibleIndex, visibleSize: visibleYSize } = handleVirtualYVisible()
|
|
2781
2762
|
if (scrollYLoad) {
|
|
@@ -2792,12 +2773,46 @@ export default defineComponent({
|
|
|
2792
2773
|
} else {
|
|
2793
2774
|
$xeTable.updateScrollYSpace()
|
|
2794
2775
|
}
|
|
2795
|
-
nextTick(() => {
|
|
2796
|
-
updateStyle()
|
|
2797
|
-
})
|
|
2798
2776
|
})
|
|
2799
2777
|
}
|
|
2800
2778
|
|
|
2779
|
+
const calcScrollbar = () => {
|
|
2780
|
+
const { scrollXWidth, scrollYHeight } = reactData
|
|
2781
|
+
const { elemStore } = internalData
|
|
2782
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
2783
|
+
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
|
|
2784
|
+
const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
2785
|
+
const footerTableElem = getRefElem(elemStore['main-footer-table'])
|
|
2786
|
+
const xHandleEl = refScrollXHandleElem.value
|
|
2787
|
+
const yHandleEl = refScrollYHandleElem.value
|
|
2788
|
+
let overflowY = false
|
|
2789
|
+
let overflowX = false
|
|
2790
|
+
if (bodyWrapperElem) {
|
|
2791
|
+
overflowY = scrollYHeight > bodyWrapperElem.clientHeight
|
|
2792
|
+
if (yHandleEl) {
|
|
2793
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth)
|
|
2794
|
+
}
|
|
2795
|
+
reactData.overflowY = overflowY
|
|
2796
|
+
|
|
2797
|
+
overflowX = scrollXWidth > bodyWrapperElem.clientWidth
|
|
2798
|
+
if (xHandleEl) {
|
|
2799
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight)
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0
|
|
2803
|
+
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0
|
|
2804
|
+
internalData.tableHeight = bodyWrapperElem.offsetHeight
|
|
2805
|
+
internalData.headerHeight = headerHeight
|
|
2806
|
+
internalData.footerHeight = footerHeight
|
|
2807
|
+
|
|
2808
|
+
reactData.overflowX = overflowX
|
|
2809
|
+
reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight())
|
|
2810
|
+
}
|
|
2811
|
+
if (overflowX) {
|
|
2812
|
+
$xeTable.checkScrolling()
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2801
2816
|
const handleRecalculateLayout = (reFull: boolean) => {
|
|
2802
2817
|
const el = refElem.value
|
|
2803
2818
|
internalData.rceRunTime = Date.now()
|
|
@@ -2814,18 +2829,22 @@ export default defineComponent({
|
|
|
2814
2829
|
}
|
|
2815
2830
|
calcCellWidth()
|
|
2816
2831
|
autoCellWidth()
|
|
2832
|
+
calcScrollbar()
|
|
2817
2833
|
updateStyle()
|
|
2818
2834
|
updateRowExpandStyle()
|
|
2819
2835
|
return computeScrollLoad().then(() => {
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2836
|
+
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
2837
|
+
calcCellWidth()
|
|
2838
|
+
if (reFull) {
|
|
2823
2839
|
autoCellWidth()
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2840
|
+
}
|
|
2841
|
+
calcScrollbar()
|
|
2842
|
+
updateStyle()
|
|
2843
|
+
if (reFull) {
|
|
2844
|
+
updateRowOffsetTop()
|
|
2845
|
+
}
|
|
2846
|
+
updateRowExpandStyle()
|
|
2847
|
+
if (reFull) {
|
|
2829
2848
|
return computeScrollLoad()
|
|
2830
2849
|
}
|
|
2831
2850
|
})
|
|
@@ -9606,12 +9625,12 @@ export default defineComponent({
|
|
|
9606
9625
|
const firstRow = afterFullData[startIndex]
|
|
9607
9626
|
let rowid = getRowid($xeTable, firstRow)
|
|
9608
9627
|
let rowRest = fullAllDataRowIdData[rowid] || {}
|
|
9609
|
-
ySpaceTop = rowRest.oTop
|
|
9628
|
+
ySpaceTop = (rowRest.oTop || 0)
|
|
9610
9629
|
|
|
9611
9630
|
const lastRow = afterFullData[afterFullData.length - 1]
|
|
9612
9631
|
rowid = getRowid($xeTable, lastRow)
|
|
9613
9632
|
rowRest = fullAllDataRowIdData[rowid] || {}
|
|
9614
|
-
scrollYHeight = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight)
|
|
9633
|
+
scrollYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight)
|
|
9615
9634
|
// 是否展开行
|
|
9616
9635
|
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
9617
9636
|
scrollYHeight += rowRest.expandHeight || expandOpts.height || 0
|
|
@@ -9676,7 +9695,7 @@ export default defineComponent({
|
|
|
9676
9695
|
updateScrollXData () {
|
|
9677
9696
|
const { isAllOverflow } = reactData
|
|
9678
9697
|
handleTableColumn()
|
|
9679
|
-
$xeTable.
|
|
9698
|
+
$xeTable.updateScrollXSpace()
|
|
9680
9699
|
return nextTick().then(() => {
|
|
9681
9700
|
handleTableColumn()
|
|
9682
9701
|
$xeTable.updateScrollXSpace()
|
|
@@ -10356,7 +10375,8 @@ export default defineComponent({
|
|
|
10356
10375
|
theme: tableTipConfig.theme,
|
|
10357
10376
|
enterable: tableTipConfig.enterable,
|
|
10358
10377
|
enterDelay: tableTipConfig.enterDelay,
|
|
10359
|
-
leaveDelay: tableTipConfig.leaveDelay
|
|
10378
|
+
leaveDelay: tableTipConfig.leaveDelay,
|
|
10379
|
+
useHTML: tableTipConfig.useHTML
|
|
10360
10380
|
}),
|
|
10361
10381
|
/**
|
|
10362
10382
|
* 校验提示
|
|
@@ -820,11 +820,25 @@
|
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
}
|
|
823
|
+
.vxe-header--column {
|
|
824
|
+
&:last-child {
|
|
825
|
+
& > .vxe-cell--col-resizable {
|
|
826
|
+
right: 0;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
823
830
|
.vxe-table--fixed-right-wrapper {
|
|
824
831
|
.vxe-cell--col-resizable {
|
|
825
832
|
right: auto;
|
|
826
833
|
left: -0.3em;
|
|
827
834
|
}
|
|
835
|
+
.vxe-header--column {
|
|
836
|
+
&:last-child {
|
|
837
|
+
& > .vxe-cell--col-resizable {
|
|
838
|
+
left: 0;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
828
842
|
}
|
|
829
843
|
|
|
830
844
|
.vxe-body--column {
|
|
@@ -1024,6 +1038,11 @@
|
|
|
1024
1038
|
}
|
|
1025
1039
|
}
|
|
1026
1040
|
}
|
|
1041
|
+
&.header-cell--area {
|
|
1042
|
+
.vxe-table--header-wrapper {
|
|
1043
|
+
user-select: none;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1027
1046
|
&.body-cell--area {
|
|
1028
1047
|
.vxe-table--body-wrapper {
|
|
1029
1048
|
user-select: none;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|