vxe-table 3.15.22 → 3.15.23
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 +21 -7
- package/es/table/src/util.js +12 -15
- 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 +32 -23
- 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 +13 -7
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/util.js +11 -14
- 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 +21 -7
- package/packages/table/src/util.ts +12 -16
- package/packages/ui/src/dom.ts +7 -0
- package/styles/components/table.scss +23 -15
- /package/es/{iconfont.1746836465256.ttf → iconfont.1746863438419.ttf} +0 -0
- /package/es/{iconfont.1746836465256.woff → iconfont.1746863438419.woff} +0 -0
- /package/es/{iconfont.1746836465256.woff2 → iconfont.1746863438419.woff2} +0 -0
- /package/lib/{iconfont.1746836465256.ttf → iconfont.1746863438419.ttf} +0 -0
- /package/lib/{iconfont.1746836465256.woff → iconfont.1746863438419.woff} +0 -0
- /package/lib/{iconfont.1746836465256.woff2 → iconfont.1746863438419.woff2} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import { ColumnInfo } from './columnInfo'
|
|
3
|
-
import { isScale, isPx } from '../../ui/src/dom'
|
|
3
|
+
import { isScale, isPx, queryElement } from '../../ui/src/dom'
|
|
4
4
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
5
5
|
import { eqEmptyValue } from '../../ui/src/utils'
|
|
6
6
|
|
|
@@ -175,7 +175,7 @@ function getPaddingLeftRightSize (elem: any) {
|
|
|
175
175
|
return 0
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
function
|
|
178
|
+
function getElementMarginAndWidth (elem: any) {
|
|
179
179
|
if (elem) {
|
|
180
180
|
const computedStyle = getComputedStyle(elem)
|
|
181
181
|
const marginLeft = XEUtils.toNumber(computedStyle.marginLeft)
|
|
@@ -261,10 +261,6 @@ export function getRootColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMe
|
|
|
261
261
|
return column
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
function queryCellElement (cell: any, selector: any) {
|
|
265
|
-
return cell.querySelector('.vxe-cell' + selector)
|
|
266
|
-
}
|
|
267
|
-
|
|
268
264
|
export function toFilters (filters: any) {
|
|
269
265
|
if (filters && XEUtils.isArray(filters)) {
|
|
270
266
|
return filters.map(({ label, value, data, resetValue, checked }) => {
|
|
@@ -293,19 +289,19 @@ export function getColReMinWidth (params: any) {
|
|
|
293
289
|
const showTitle = headOverflow === 'title'
|
|
294
290
|
const showTooltip = headOverflow === true || headOverflow === 'tooltip'
|
|
295
291
|
const hasEllipsis = showTitle || showTooltip || showEllipsis
|
|
296
|
-
const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.
|
|
297
|
-
const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(
|
|
292
|
+
const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8)
|
|
293
|
+
const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, ''))
|
|
298
294
|
let mWidth = minTitleWidth + paddingLeftRight
|
|
299
295
|
// 默认最小宽处理
|
|
300
296
|
if (hasEllipsis) {
|
|
301
|
-
const dragIconWidth =
|
|
302
|
-
const checkboxIconWidth =
|
|
303
|
-
const requiredIconWidth =
|
|
304
|
-
const editIconWidth =
|
|
305
|
-
const prefixIconWidth =
|
|
306
|
-
const suffixIconWidth =
|
|
307
|
-
const sortIconWidth =
|
|
308
|
-
const filterIconWidth =
|
|
297
|
+
const dragIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--drag-handle'))
|
|
298
|
+
const checkboxIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--checkbox'))
|
|
299
|
+
const requiredIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--required-icon'))
|
|
300
|
+
const editIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--edit-icon'))
|
|
301
|
+
const prefixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-prefix-icon'))
|
|
302
|
+
const suffixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-suffix-icon'))
|
|
303
|
+
const sortIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--sort'))
|
|
304
|
+
const filterIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--filter'))
|
|
309
305
|
mWidth += dragIconWidth + checkboxIconWidth + requiredIconWidth + editIconWidth + prefixIconWidth + suffixIconWidth + filterIconWidth + sortIconWidth
|
|
310
306
|
}
|
|
311
307
|
// 如果设置最小宽
|
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
|