vxe-table 4.19.4 → 4.19.6
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/dist/all.esm.js +188 -31
- package/dist/style.css +1 -1
- package/es/style.css +1 -1
- package/es/table/module/export/hook.js +3 -3
- package/es/table/src/cell.js +8 -7
- package/es/table/src/columnInfo.js +1 -4
- package/es/table/src/emits.js +1 -0
- package/es/table/src/table.js +135 -12
- package/es/table/src/util.js +28 -8
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +65 -43
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/hook.js +3 -3
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/cell.js +8 -8
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -5
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/table.js +17 -14
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +31 -7
- package/lib/table/src/util.min.js +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/package.json +2 -2
- package/packages/table/module/export/hook.ts +3 -3
- package/packages/table/src/cell.ts +8 -7
- package/packages/table/src/columnInfo.ts +1 -5
- package/packages/table/src/emits.ts +1 -0
- package/packages/table/src/table.ts +137 -13
- package/packages/table/src/util.ts +27 -8
- /package/es/{iconfont.1779936744129.ttf → iconfont.1780293024194.ttf} +0 -0
- /package/es/{iconfont.1779936744129.woff → iconfont.1780293024194.woff} +0 -0
- /package/es/{iconfont.1779936744129.woff2 → iconfont.1780293024194.woff2} +0 -0
- /package/lib/{iconfont.1779936744129.ttf → iconfont.1780293024194.ttf} +0 -0
- /package/lib/{iconfont.1779936744129.woff → iconfont.1780293024194.woff} +0 -0
- /package/lib/{iconfont.1779936744129.woff2 → iconfont.1780293024194.woff2} +0 -0
|
@@ -83,6 +83,7 @@ export function createInternalData (): TableInternalData {
|
|
|
83
83
|
|
|
84
84
|
keepUpdateFieldMaps: {},
|
|
85
85
|
|
|
86
|
+
headerFullDataColData: {},
|
|
86
87
|
footerFullDataRowData: {},
|
|
87
88
|
|
|
88
89
|
// 渲染中缓存数据
|
|
@@ -750,8 +751,6 @@ export function getCalcHeight (height: number | 'unset' | undefined | null) {
|
|
|
750
751
|
|
|
751
752
|
/**
|
|
752
753
|
* 列宽拖动最大宽度
|
|
753
|
-
* @param params
|
|
754
|
-
* @returns
|
|
755
754
|
*/
|
|
756
755
|
export function getColReMaxWidth (params: {
|
|
757
756
|
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
@@ -761,10 +760,14 @@ export function getColReMaxWidth (params: {
|
|
|
761
760
|
$rowIndex: number;
|
|
762
761
|
cell: HTMLTableCellElement;
|
|
763
762
|
}) {
|
|
764
|
-
const { $table } = params
|
|
765
|
-
const
|
|
763
|
+
const { $table, column, cell } = params
|
|
764
|
+
const internalData = $table.internalData
|
|
765
|
+
const { elemStore } = internalData
|
|
766
|
+
const { computeColumnOpts, computeResizableOpts } = $table.getComputeMaps()
|
|
766
767
|
const resizableOpts = computeResizableOpts.value
|
|
768
|
+
const columnOpts = computeColumnOpts.value
|
|
767
769
|
const { maxWidth: reMaxWidth } = resizableOpts
|
|
770
|
+
const colMaxWidth = column.maxWidth || columnOpts.maxWidth
|
|
768
771
|
// 如果自定义调整宽度逻辑
|
|
769
772
|
if (reMaxWidth) {
|
|
770
773
|
const customMaxWidth = XEUtils.isFunction(reMaxWidth) ? reMaxWidth(params) : reMaxWidth
|
|
@@ -772,13 +775,27 @@ export function getColReMaxWidth (params: {
|
|
|
772
775
|
return Math.max(1, XEUtils.toNumber(customMaxWidth))
|
|
773
776
|
}
|
|
774
777
|
}
|
|
778
|
+
const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8)
|
|
779
|
+
const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, '.vxe-cell'))
|
|
780
|
+
const mWidth = minTitleWidth + paddingLeftRight
|
|
781
|
+
// 如果设置最小宽
|
|
782
|
+
if (colMaxWidth) {
|
|
783
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
784
|
+
if (bodyScrollElem) {
|
|
785
|
+
if (isScale(colMaxWidth)) {
|
|
786
|
+
const bodyWidth = bodyScrollElem.clientWidth - 1
|
|
787
|
+
const meanWidth = bodyWidth / 100
|
|
788
|
+
return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMaxWidth) * meanWidth))
|
|
789
|
+
} else if (isPx(colMaxWidth)) {
|
|
790
|
+
return Math.max(mWidth, XEUtils.toInteger(colMaxWidth))
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}
|
|
775
794
|
return -1
|
|
776
795
|
}
|
|
777
796
|
|
|
778
797
|
/**
|
|
779
798
|
* 列宽拖动最小宽度
|
|
780
|
-
* @param params
|
|
781
|
-
* @returns
|
|
782
799
|
*/
|
|
783
800
|
export function getColReMinWidth (params: {
|
|
784
801
|
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
@@ -791,8 +808,9 @@ export function getColReMinWidth (params: {
|
|
|
791
808
|
const { $table, column, cell } = params
|
|
792
809
|
const tableProps = $table.props
|
|
793
810
|
const internalData = $table.internalData
|
|
794
|
-
const { computeResizableOpts } = $table.getComputeMaps()
|
|
811
|
+
const { computeColumnOpts, computeResizableOpts } = $table.getComputeMaps()
|
|
795
812
|
const resizableOpts = computeResizableOpts.value
|
|
813
|
+
const columnOpts = computeColumnOpts.value
|
|
796
814
|
const { minWidth: reMinWidth } = resizableOpts
|
|
797
815
|
// 如果自定义调整宽度逻辑
|
|
798
816
|
if (reMinWidth) {
|
|
@@ -803,7 +821,8 @@ export function getColReMinWidth (params: {
|
|
|
803
821
|
}
|
|
804
822
|
const { elemStore } = internalData
|
|
805
823
|
const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps
|
|
806
|
-
const { showHeaderOverflow
|
|
824
|
+
const { showHeaderOverflow } = column
|
|
825
|
+
const colMinWidth = column.minWidth || columnOpts.minWidth
|
|
807
826
|
const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
808
827
|
const showEllipsis = headOverflow === 'ellipsis'
|
|
809
828
|
const showTitle = headOverflow === 'title'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|