vxe-table 3.21.4 → 3.21.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/es/style.css +1 -1
- package/es/table/module/export/mixin.js +3 -3
- package/es/table/src/cell.js +8 -7
- package/es/table/src/columnInfo.js +1 -4
- package/es/table/src/methods.js +152 -22
- package/es/table/src/util.js +47 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +87 -38
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/mixin.js +3 -3
- package/lib/table/module/export/mixin.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/methods.js +17 -14
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +57 -6
- 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/mixin.ts +3 -3
- package/packages/table/src/cell.ts +8 -7
- package/packages/table/src/columnInfo.ts +1 -5
- package/packages/table/src/methods.ts +157 -22
- package/packages/table/src/util.ts +63 -4
- /package/es/{iconfont.1779936730544.ttf → iconfont.1780293000244.ttf} +0 -0
- /package/es/{iconfont.1779936730544.woff → iconfont.1780293000244.woff} +0 -0
- /package/es/{iconfont.1779936730544.woff2 → iconfont.1780293000244.woff2} +0 -0
- /package/lib/{iconfont.1779936730544.ttf → iconfont.1780293000244.ttf} +0 -0
- /package/lib/{iconfont.1779936730544.woff → iconfont.1780293000244.woff} +0 -0
- /package/lib/{iconfont.1779936730544.woff2 → iconfont.1780293000244.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
|
// 渲染中缓存数据
|
|
@@ -774,10 +775,66 @@ export function toFilters (filters: any, colid?: string) {
|
|
|
774
775
|
return filters
|
|
775
776
|
}
|
|
776
777
|
|
|
777
|
-
|
|
778
|
+
/**
|
|
779
|
+
* 列宽拖动最大宽度
|
|
780
|
+
*/
|
|
781
|
+
export function getColReMaxWidth (params: {
|
|
782
|
+
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
783
|
+
column: VxeTableDefines.ColumnInfo;
|
|
784
|
+
columnIndex: number;
|
|
785
|
+
$columnIndex: number;
|
|
786
|
+
$rowIndex: number;
|
|
787
|
+
cell: HTMLTableCellElement;
|
|
788
|
+
}) {
|
|
789
|
+
const { $table, column, cell } = params
|
|
790
|
+
const internalData = $table as unknown as TableInternalData
|
|
791
|
+
const { elemStore } = internalData
|
|
792
|
+
const resizableOpts = $table.computeResizableOpts
|
|
793
|
+
const columnOpts = $table.computeColumnOpts
|
|
794
|
+
const { maxWidth: reMaxWidth } = resizableOpts
|
|
795
|
+
const colMaxWidth = column.maxWidth || columnOpts.maxWidth
|
|
796
|
+
// 如果自定义调整宽度逻辑
|
|
797
|
+
if (reMaxWidth) {
|
|
798
|
+
const customMaxWidth = XEUtils.isFunction(reMaxWidth) ? reMaxWidth(params) : reMaxWidth
|
|
799
|
+
if (customMaxWidth !== 'auto') {
|
|
800
|
+
return Math.max(1, XEUtils.toNumber(customMaxWidth))
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8)
|
|
804
|
+
const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, '.vxe-cell'))
|
|
805
|
+
const mWidth = minTitleWidth + paddingLeftRight
|
|
806
|
+
// 如果设置最小宽
|
|
807
|
+
if (colMaxWidth) {
|
|
808
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
809
|
+
if (bodyScrollElem) {
|
|
810
|
+
if (isScale(colMaxWidth)) {
|
|
811
|
+
const bodyWidth = bodyScrollElem.clientWidth - 1
|
|
812
|
+
const meanWidth = bodyWidth / 100
|
|
813
|
+
return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMaxWidth) * meanWidth))
|
|
814
|
+
} else if (isPx(colMaxWidth)) {
|
|
815
|
+
return Math.max(mWidth, XEUtils.toInteger(colMaxWidth))
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
return -1
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* 列宽拖动最小宽度
|
|
824
|
+
*/
|
|
825
|
+
export function getColReMinWidth (params: {
|
|
826
|
+
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
827
|
+
column: VxeTableDefines.ColumnInfo;
|
|
828
|
+
columnIndex: number;
|
|
829
|
+
$columnIndex: number;
|
|
830
|
+
$rowIndex: number;
|
|
831
|
+
cell: HTMLTableCellElement;
|
|
832
|
+
}) {
|
|
778
833
|
const { $table, column, cell } = params
|
|
779
|
-
const
|
|
780
|
-
const
|
|
834
|
+
const tableProps = $table
|
|
835
|
+
const internalData = $table as unknown as TableInternalData
|
|
836
|
+
const resizableOpts = $table.computeResizableOpts
|
|
837
|
+
const columnOpts = $table.computeColumnOpts
|
|
781
838
|
const { minWidth } = resizableOpts
|
|
782
839
|
// 如果自定义调整宽度逻辑
|
|
783
840
|
if (minWidth) {
|
|
@@ -787,7 +844,9 @@ export function getColReMinWidth (params: any) {
|
|
|
787
844
|
}
|
|
788
845
|
}
|
|
789
846
|
const { elemStore } = internalData
|
|
790
|
-
const { showHeaderOverflow
|
|
847
|
+
const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps
|
|
848
|
+
const { showHeaderOverflow } = column
|
|
849
|
+
const colMinWidth = column.minWidth || columnOpts.minWidth
|
|
791
850
|
const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
792
851
|
const showEllipsis = headOverflow === 'ellipsis'
|
|
793
852
|
const showTitle = headOverflow === 'title'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|