vxe-table 3.21.5 → 3.21.7
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/src/body.js +13 -13
- package/es/table/src/group.js +3 -0
- package/es/table/src/methods.js +107 -32
- package/es/table/src/util.js +46 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +94 -39
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/body.js +13 -13
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/group.js +3 -0
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/methods.js +21 -18
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +56 -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/src/body.ts +15 -15
- package/packages/table/src/group.ts +4 -0
- package/packages/table/src/methods.ts +113 -32
- package/packages/table/src/util.ts +62 -4
- /package/es/{iconfont.1780200130470.ttf → iconfont.1780638727189.ttf} +0 -0
- /package/es/{iconfont.1780200130470.woff → iconfont.1780638727189.woff} +0 -0
- /package/es/{iconfont.1780200130470.woff2 → iconfont.1780638727189.woff2} +0 -0
- /package/lib/{iconfont.1780200130470.ttf → iconfont.1780638727189.ttf} +0 -0
- /package/lib/{iconfont.1780200130470.woff → iconfont.1780638727189.woff} +0 -0
- /package/lib/{iconfont.1780200130470.woff2 → iconfont.1780638727189.woff2} +0 -0
|
@@ -775,10 +775,66 @@ export function toFilters (filters: any, colid?: string) {
|
|
|
775
775
|
return filters
|
|
776
776
|
}
|
|
777
777
|
|
|
778
|
-
|
|
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
|
+
}) {
|
|
779
833
|
const { $table, column, cell } = params
|
|
780
|
-
const
|
|
781
|
-
const
|
|
834
|
+
const tableProps = $table
|
|
835
|
+
const internalData = $table as unknown as TableInternalData
|
|
836
|
+
const resizableOpts = $table.computeResizableOpts
|
|
837
|
+
const columnOpts = $table.computeColumnOpts
|
|
782
838
|
const { minWidth } = resizableOpts
|
|
783
839
|
// 如果自定义调整宽度逻辑
|
|
784
840
|
if (minWidth) {
|
|
@@ -788,7 +844,9 @@ export function getColReMinWidth (params: any) {
|
|
|
788
844
|
}
|
|
789
845
|
}
|
|
790
846
|
const { elemStore } = internalData
|
|
791
|
-
const { showHeaderOverflow
|
|
847
|
+
const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps
|
|
848
|
+
const { showHeaderOverflow } = column
|
|
849
|
+
const colMinWidth = column.minWidth || columnOpts.minWidth
|
|
792
850
|
const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
793
851
|
const showEllipsis = headOverflow === 'ellipsis'
|
|
794
852
|
const showTitle = headOverflow === 'title'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|