vxe-table 4.13.22 → 4.13.24
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/cell.js +25 -11
- package/es/table/src/util.js +16 -21
- package/es/table/style.css +15 -6
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +6 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +15 -6
- 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 +41 -32
- 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/cell.js +16 -10
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/util.js +17 -20
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +15 -6
- 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/dom.js +7 -0
- package/lib/ui/src/dom.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 +15 -6
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/src/cell.ts +25 -11
- package/packages/table/src/util.ts +16 -22
- package/packages/ui/src/dom.ts +7 -0
- package/styles/components/table.scss +23 -15
- /package/es/{iconfont.1746836522499.ttf → iconfont.1747008151774.ttf} +0 -0
- /package/es/{iconfont.1746836522499.woff → iconfont.1747008151774.woff} +0 -0
- /package/es/{iconfont.1746836522499.woff2 → iconfont.1747008151774.woff2} +0 -0
- /package/lib/{iconfont.1746836522499.ttf → iconfont.1747008151774.ttf} +0 -0
- /package/lib/{iconfont.1746836522499.woff → iconfont.1747008151774.woff} +0 -0
- /package/lib/{iconfont.1746836522499.woff2 → iconfont.1747008151774.woff2} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { watch, reactive, nextTick } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { ColumnInfo } from './columnInfo'
|
|
4
|
-
import { isPx, isScale } from '../../ui/src/dom'
|
|
4
|
+
import { isPx, isScale, queryElement } from '../../ui/src/dom'
|
|
5
5
|
import { eqEmptyValue } from '../../ui/src/utils'
|
|
6
6
|
|
|
7
7
|
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines } from '../../../types'
|
|
@@ -191,7 +191,7 @@ function getPaddingLeftRightSize (elem: HTMLElement | null) {
|
|
|
191
191
|
return 0
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
function
|
|
194
|
+
function getElementMarginAndWidth (elem: HTMLElement | null) {
|
|
195
195
|
if (elem) {
|
|
196
196
|
const computedStyle = getComputedStyle(elem)
|
|
197
197
|
const marginLeft = XEUtils.toNumber(computedStyle.marginLeft)
|
|
@@ -201,10 +201,6 @@ function getElementMarginWidth (elem: HTMLElement | null) {
|
|
|
201
201
|
return 0
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
function queryCellElement (cell: HTMLTableCellElement, selector: string) {
|
|
205
|
-
return cell.querySelector('.vxe-cell' + selector) as HTMLElement | null
|
|
206
|
-
}
|
|
207
|
-
|
|
208
204
|
export function toFilters (filters: any) {
|
|
209
205
|
if (filters && XEUtils.isArray(filters)) {
|
|
210
206
|
return filters.map(({ label, value, data, resetValue, checked }) => {
|
|
@@ -304,19 +300,19 @@ export function getColReMinWidth (params: {
|
|
|
304
300
|
const showTitle = headOverflow === 'title'
|
|
305
301
|
const showTooltip = headOverflow === true || headOverflow === 'tooltip'
|
|
306
302
|
const hasEllipsis = showTitle || showTooltip || showEllipsis
|
|
307
|
-
const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.
|
|
308
|
-
const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(
|
|
303
|
+
const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8)
|
|
304
|
+
const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, '.vxe-cell'))
|
|
309
305
|
let mWidth = minTitleWidth + paddingLeftRight
|
|
310
306
|
// 默认最小宽处理
|
|
311
307
|
if (hasEllipsis) {
|
|
312
|
-
const dragIconWidth =
|
|
313
|
-
const checkboxIconWidth =
|
|
314
|
-
const requiredIconWidth =
|
|
315
|
-
const editIconWidth =
|
|
316
|
-
const prefixIconWidth =
|
|
317
|
-
const suffixIconWidth =
|
|
318
|
-
const sortIconWidth =
|
|
319
|
-
const filterIconWidth =
|
|
308
|
+
const dragIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--drag-handle'))
|
|
309
|
+
const checkboxIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--checkbox'))
|
|
310
|
+
const requiredIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--required-icon'))
|
|
311
|
+
const editIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--edit-icon'))
|
|
312
|
+
const prefixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-prefix-icon'))
|
|
313
|
+
const suffixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-suffix-icon'))
|
|
314
|
+
const sortIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--sort'))
|
|
315
|
+
const filterIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--filter'))
|
|
320
316
|
mWidth += dragIconWidth + checkboxIconWidth + requiredIconWidth + editIconWidth + prefixIconWidth + suffixIconWidth + filterIconWidth + sortIconWidth
|
|
321
317
|
}
|
|
322
318
|
// 如果设置最小宽
|
|
@@ -505,7 +501,7 @@ export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
505
501
|
|
|
506
502
|
const { computeLeftFixedWidth, computeRightFixedWidth, computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps()
|
|
507
503
|
const { showOverflow } = tableProps
|
|
508
|
-
const { scrollYLoad } = reactData
|
|
504
|
+
const { scrollYLoad, scrollYTop } = reactData
|
|
509
505
|
const { elemStore, afterFullData, fullAllDataRowIdData, isResizeCellHeight } = internalData
|
|
510
506
|
const rowOpts = computeRowOpts.value
|
|
511
507
|
const cellOpts = computeCellOpts.value
|
|
@@ -519,8 +515,7 @@ export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
519
515
|
const bodyScrollTop = bodyScrollElem.scrollTop
|
|
520
516
|
const trElem: HTMLTableRowElement | null = bodyScrollElem.querySelector(`[rowid="${rowid}"]`)
|
|
521
517
|
if (trElem) {
|
|
522
|
-
const
|
|
523
|
-
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0)
|
|
518
|
+
const trOffsetTop = trElem.offsetTop + (scrollYLoad ? scrollYTop : 0)
|
|
524
519
|
const trHeight = trElem.clientHeight
|
|
525
520
|
// 检测行是否在可视区中
|
|
526
521
|
if (trOffsetTop < bodyScrollTop || trOffsetTop > bodyScrollTop + bodyHeight) {
|
|
@@ -562,7 +557,7 @@ export function colToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
562
557
|
const internalData = $xeTable.internalData
|
|
563
558
|
|
|
564
559
|
const { computeLeftFixedWidth, computeRightFixedWidth } = $xeTable.getComputeMaps()
|
|
565
|
-
const { scrollXLoad } = reactData
|
|
560
|
+
const { scrollXLoad, scrollXLeft } = reactData
|
|
566
561
|
const { elemStore, visibleColumn } = internalData
|
|
567
562
|
const leftFixedWidth = computeLeftFixedWidth.value
|
|
568
563
|
const rightFixedWidth = computeRightFixedWidth.value
|
|
@@ -582,8 +577,7 @@ export function colToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
582
577
|
tdElem = bodyScrollElem.querySelector(`.${column.id}`)
|
|
583
578
|
}
|
|
584
579
|
if (tdElem) {
|
|
585
|
-
const
|
|
586
|
-
const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0)
|
|
580
|
+
const tdOffsetLeft = tdElem.offsetLeft + (scrollXLoad ? scrollXLeft : 0)
|
|
587
581
|
const cellWidth = tdElem.clientWidth
|
|
588
582
|
// 检测是否在可视区中
|
|
589
583
|
if (tdOffsetLeft < (bodyScrollLeft + leftFixedWidth)) {
|
package/packages/ui/src/dom.ts
CHANGED
|
@@ -82,6 +82,13 @@ export function toCssUnit (val?: number | string, unit = 'px') {
|
|
|
82
82
|
return `${val || ''}`
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
export function queryElement (elem: HTMLTableCellElement, selector: string) {
|
|
86
|
+
if (elem) {
|
|
87
|
+
return elem.querySelector<HTMLElement>(selector)
|
|
88
|
+
}
|
|
89
|
+
return null
|
|
90
|
+
}
|
|
91
|
+
|
|
85
92
|
export function getDomNode () {
|
|
86
93
|
const documentElement = document.documentElement
|
|
87
94
|
const bodyElem = document.body
|
|
@@ -776,19 +776,25 @@ $btnThemeList: (
|
|
|
776
776
|
// user-select: none;
|
|
777
777
|
&.col--ellipsis {
|
|
778
778
|
& > .vxe-cell {
|
|
779
|
-
|
|
780
|
-
|
|
779
|
+
.vxe-cell--wrapper {
|
|
780
|
+
display: flex;
|
|
781
|
+
align-items: center;
|
|
782
|
+
.vxe-cell--drag-handle,
|
|
783
|
+
.vxe-cell--sort,
|
|
784
|
+
.vxe-cell--filter,
|
|
785
|
+
.vxe-cell-title-prefix-icon,
|
|
786
|
+
.vxe-cell-title-suffix-icon,
|
|
787
|
+
.vxe-cell--checkbox,
|
|
788
|
+
.vxe-cell-title-suffix-icon,
|
|
789
|
+
.vxe-cell--required-icon {
|
|
790
|
+
flex-shrink: 0;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
781
793
|
.vxe-cell--title {
|
|
782
794
|
overflow: hidden;
|
|
783
795
|
text-overflow: ellipsis;
|
|
784
796
|
white-space: nowrap;
|
|
785
797
|
}
|
|
786
|
-
& > i,
|
|
787
|
-
& > span {
|
|
788
|
-
&:not(.vxe-cell--title) {
|
|
789
|
-
flex-shrink: 0;
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
798
|
}
|
|
793
799
|
}
|
|
794
800
|
.vxe-cell--required-icon {
|
|
@@ -797,14 +803,16 @@ $btnThemeList: (
|
|
|
797
803
|
width: 0.8em;
|
|
798
804
|
height: 1em;
|
|
799
805
|
line-height: 1em;
|
|
800
|
-
font-family: Verdana,Arial,Tahoma;
|
|
801
|
-
font-weight: normal;
|
|
802
806
|
position: relative;
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
807
|
+
& > i {
|
|
808
|
+
font-family: Verdana,Arial,Tahoma;
|
|
809
|
+
font-weight: normal;
|
|
810
|
+
&:before {
|
|
811
|
+
content: "*";
|
|
812
|
+
position: absolute;
|
|
813
|
+
left: 0;
|
|
814
|
+
top: 0.2em;
|
|
815
|
+
}
|
|
808
816
|
}
|
|
809
817
|
}
|
|
810
818
|
// .vxe-cell--required-icon,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|