vxe-table 3.12.10-beta.2 → 3.12.10-beta.21
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/locale/lang/ar-EG.js +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +2 -1
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +4 -3
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +518 -517
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +7 -7
- package/es/table/module/export/mixin.js +55 -32
- package/es/table/module/keyboard/mixin.js +68 -25
- package/es/table/module/menu/mixin.js +3 -1
- package/es/table/src/body.js +96 -64
- package/es/table/src/cell.js +3 -7
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/footer.js +31 -6
- package/es/table/src/header.js +45 -141
- package/es/table/src/methods.js +918 -456
- package/es/table/src/props.js +6 -2
- package/es/table/src/table.js +299 -149
- package/es/table/src/util.js +67 -57
- package/es/table/style.css +299 -191
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +20 -10
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +299 -191
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1735 -1025
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +4 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -3
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +518 -517
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +518 -517
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +12 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +52 -27
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +73 -27
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +3 -1
- package/lib/table/src/body.js +89 -60
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +3 -5
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +26 -6
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +38 -153
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1076 -551
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +6 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +269 -129
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +80 -70
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +299 -191
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +20 -10
- 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/lib/vxe-table/style/style.css +299 -191
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +2 -1
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +4 -3
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +518 -517
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/edit/mixin.ts +7 -7
- package/packages/table/module/export/mixin.ts +50 -27
- package/packages/table/module/keyboard/mixin.ts +65 -24
- package/packages/table/module/menu/mixin.ts +4 -1
- package/packages/table/src/body.ts +102 -61
- package/packages/table/src/cell.ts +3 -7
- package/packages/table/src/column.ts +7 -2
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/footer.ts +31 -6
- package/packages/table/src/header.ts +45 -141
- package/packages/table/src/methods.ts +957 -461
- package/packages/table/src/props.ts +6 -2
- package/packages/table/src/table.ts +325 -149
- package/packages/table/src/util.ts +75 -62
- package/packages/ui/index.ts +21 -9
- package/styles/components/table.scss +352 -260
- package/styles/theme/base.scss +4 -6
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -0
- /package/es/{iconfont.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
- /package/es/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
- /package/es/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
- /package/lib/{iconfont.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
- /package/lib/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
- /package/lib/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
|
@@ -3,7 +3,7 @@ import { ColumnInfo } from './columnInfo'
|
|
|
3
3
|
import { isScale, isPx } from '../../ui/src/dom'
|
|
4
4
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
5
5
|
|
|
6
|
-
import type { VxeTableDefines, VxeTableConstructor, TableReactData } from '../../../types'
|
|
6
|
+
import type { VxeTableDefines, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePrivateMethods } from '../../../types'
|
|
7
7
|
|
|
8
8
|
const getAllConvertColumns = (columns: any, parentColumn?: any) => {
|
|
9
9
|
const result: any[] = []
|
|
@@ -134,7 +134,7 @@ function getElementMarginWidth (elem: any) {
|
|
|
134
134
|
|
|
135
135
|
export function handleFieldOrColumn (_vm: any, fieldOrColumn: any) {
|
|
136
136
|
if (fieldOrColumn) {
|
|
137
|
-
return XEUtils.isString(fieldOrColumn) ? _vm.getColumnByField(fieldOrColumn) : fieldOrColumn
|
|
137
|
+
return XEUtils.isString(fieldOrColumn) || XEUtils.isNumber(fieldOrColumn) ? _vm.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn
|
|
138
138
|
}
|
|
139
139
|
return null
|
|
140
140
|
}
|
|
@@ -200,6 +200,7 @@ export function toFilters (filters: any) {
|
|
|
200
200
|
|
|
201
201
|
export function getColReMinWidth (params: any) {
|
|
202
202
|
const { $table, column, cell } = params
|
|
203
|
+
const internalData = $table
|
|
203
204
|
const { showHeaderOverflow: allColumnHeaderOverflow, resizableOpts } = $table
|
|
204
205
|
const { minWidth } = resizableOpts
|
|
205
206
|
// 如果自定义调整宽度逻辑
|
|
@@ -209,6 +210,7 @@ export function getColReMinWidth (params: any) {
|
|
|
209
210
|
return Math.max(1, XEUtils.toNumber(customMinWidth))
|
|
210
211
|
}
|
|
211
212
|
}
|
|
213
|
+
const { elemStore } = internalData
|
|
212
214
|
const { showHeaderOverflow, minWidth: colMinWidth } = column
|
|
213
215
|
const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
214
216
|
const showEllipsis = headOverflow === 'ellipsis'
|
|
@@ -232,11 +234,10 @@ export function getColReMinWidth (params: any) {
|
|
|
232
234
|
}
|
|
233
235
|
// 如果设置最小宽
|
|
234
236
|
if (colMinWidth) {
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
if (bodyElem) {
|
|
237
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
238
|
+
if (bodyScrollElem) {
|
|
238
239
|
if (isScale(colMinWidth)) {
|
|
239
|
-
const bodyWidth =
|
|
240
|
+
const bodyWidth = bodyScrollElem.clientWidth - 1
|
|
240
241
|
const meanWidth = bodyWidth / 100
|
|
241
242
|
return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMinWidth) * meanWidth))
|
|
242
243
|
} else if (isPx(colMinWidth)) {
|
|
@@ -280,13 +281,32 @@ export function getOffsetSize ($xeTable: VxeTableConstructor) {
|
|
|
280
281
|
}
|
|
281
282
|
|
|
282
283
|
export function calcTreeLine (params: VxeTableDefines.CellRenderBodyParams, prevRow: any) {
|
|
283
|
-
const { $table } = params
|
|
284
|
+
const { $table, row } = params
|
|
285
|
+
const tableProps = $table
|
|
284
286
|
const tableReactData = $table as unknown as TableReactData
|
|
287
|
+
const tableInternalData = $table as unknown as TableInternalData
|
|
288
|
+
|
|
289
|
+
const { showOverflow } = tableProps
|
|
290
|
+
const { scrollYLoad } = tableReactData
|
|
291
|
+
const { fullAllDataRowIdData } = tableInternalData
|
|
292
|
+
const rowOpts = $table.computeRowOpts
|
|
293
|
+
const cellOpts = $table.computeCellOpts
|
|
294
|
+
const defaultRowHeight = $table.computeDefaultRowHeight
|
|
295
|
+
const rowid = getRowid($table, row)
|
|
296
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
297
|
+
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
285
298
|
let expandSize = 1
|
|
286
299
|
if (prevRow) {
|
|
287
300
|
expandSize = countTreeExpand(prevRow, params)
|
|
288
301
|
}
|
|
289
|
-
|
|
302
|
+
let cellHeight = currCellHeight
|
|
303
|
+
const vnHeight = rowRest.height
|
|
304
|
+
if (scrollYLoad) {
|
|
305
|
+
if (!showOverflow) {
|
|
306
|
+
cellHeight = vnHeight || currCellHeight
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return cellHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)))
|
|
290
310
|
}
|
|
291
311
|
|
|
292
312
|
export function mergeBodyMethod (mergeList: any, _rowIndex: any, _columnIndex: any) {
|
|
@@ -354,34 +374,29 @@ export function isColumnInfo (column: any) {
|
|
|
354
374
|
return column instanceof ColumnInfo
|
|
355
375
|
}
|
|
356
376
|
|
|
357
|
-
export function createColumn ($xeTable:
|
|
377
|
+
export function createColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, options: any, renderOptions: any): any {
|
|
358
378
|
return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions)
|
|
359
379
|
}
|
|
360
380
|
|
|
361
|
-
export function rowToVisible ($xeTable:
|
|
362
|
-
const reactData = $xeTable
|
|
363
|
-
const internalData = $xeTable
|
|
381
|
+
export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, row: any) {
|
|
364
382
|
const tableProps = $xeTable
|
|
383
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
384
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
385
|
+
|
|
365
386
|
const { showOverflow } = tableProps
|
|
366
|
-
const
|
|
367
|
-
const {
|
|
368
|
-
const
|
|
369
|
-
const
|
|
370
|
-
const
|
|
371
|
-
const
|
|
387
|
+
const { scrollYLoad } = reactData
|
|
388
|
+
const { elemStore, afterFullData, fullAllDataRowIdData, isResizeCellHeight } = internalData
|
|
389
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
390
|
+
const cellOpts = $xeTable.computeCellOpts
|
|
391
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight
|
|
392
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth
|
|
393
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth
|
|
394
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
372
395
|
const rowid = getRowid($xeTable, row)
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
let offsetFixedRight = 0
|
|
378
|
-
rightList.forEach((item: any) => {
|
|
379
|
-
offsetFixedRight += item.renderWidth
|
|
380
|
-
})
|
|
381
|
-
if (bodyElem) {
|
|
382
|
-
const bodyHeight = bodyElem.clientHeight
|
|
383
|
-
const bodyScrollTop = bodyElem.scrollTop
|
|
384
|
-
const trElem: HTMLTableRowElement | null = bodyElem.querySelector(`[rowid="${rowid}"]`)
|
|
396
|
+
if (bodyScrollElem) {
|
|
397
|
+
const bodyHeight = bodyScrollElem.clientHeight
|
|
398
|
+
const bodyScrollTop = bodyScrollElem.scrollTop
|
|
399
|
+
const trElem: HTMLTableRowElement | null = bodyScrollElem.querySelector(`[rowid="${rowid}"]`)
|
|
385
400
|
if (trElem) {
|
|
386
401
|
const trOffsetParent = trElem.offsetParent as HTMLElement
|
|
387
402
|
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0)
|
|
@@ -395,12 +410,13 @@ export function rowToVisible ($xeTable: any, row: any) {
|
|
|
395
410
|
} else {
|
|
396
411
|
// 如果是虚拟渲染滚动
|
|
397
412
|
if (scrollYLoad) {
|
|
398
|
-
|
|
399
|
-
|
|
413
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height
|
|
414
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
415
|
+
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight)
|
|
400
416
|
}
|
|
401
417
|
let scrollTop = 0
|
|
402
418
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
403
|
-
const rHeight = rowRest ? (rowRest.height ||
|
|
419
|
+
const rHeight = rowRest ? (rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight) : defaultRowHeight
|
|
404
420
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
405
421
|
const currRow = afterFullData[i]
|
|
406
422
|
const currRowid = getRowid($xeTable, currRow)
|
|
@@ -408,54 +424,50 @@ export function rowToVisible ($xeTable: any, row: any) {
|
|
|
408
424
|
break
|
|
409
425
|
}
|
|
410
426
|
const rowRest = fullAllDataRowIdData[currRowid]
|
|
411
|
-
scrollTop += rowRest ? (rowRest.height ||
|
|
427
|
+
scrollTop += rowRest ? (rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight) : defaultRowHeight
|
|
412
428
|
}
|
|
413
429
|
if (scrollTop < bodyScrollTop) {
|
|
414
|
-
return $xeTable.scrollTo(null, scrollTop -
|
|
430
|
+
return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1)
|
|
415
431
|
}
|
|
416
|
-
return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight -
|
|
432
|
+
return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight - rightFixedWidth - 1))
|
|
417
433
|
}
|
|
418
434
|
}
|
|
419
435
|
}
|
|
420
436
|
return Promise.resolve()
|
|
421
437
|
}
|
|
422
438
|
|
|
423
|
-
export function colToVisible ($xeTable:
|
|
424
|
-
const
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
const
|
|
439
|
+
export function colToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, column: VxeTableDefines.ColumnInfo, row?: any) {
|
|
440
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
441
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
442
|
+
|
|
443
|
+
const { scrollXLoad } = reactData
|
|
444
|
+
const { elemStore, visibleColumn } = internalData
|
|
445
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth
|
|
446
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth
|
|
447
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
428
448
|
if (column.fixed) {
|
|
429
449
|
return Promise.resolve()
|
|
430
450
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
})
|
|
435
|
-
let offsetFixedRight = 0
|
|
436
|
-
rightList.forEach((item: any) => {
|
|
437
|
-
offsetFixedRight += item.renderWidth
|
|
438
|
-
})
|
|
439
|
-
if (bodyElem) {
|
|
440
|
-
const bodyWidth = bodyElem.clientWidth
|
|
441
|
-
const bodyScrollLeft = bodyElem.scrollLeft
|
|
451
|
+
if (bodyScrollElem) {
|
|
452
|
+
const bodyWidth = bodyScrollElem.clientWidth
|
|
453
|
+
const bodyScrollLeft = bodyScrollElem.scrollLeft
|
|
442
454
|
let tdElem: HTMLTableCellElement | null = null
|
|
443
455
|
if (row) {
|
|
444
456
|
const rowid = getRowid($xeTable, row)
|
|
445
|
-
tdElem =
|
|
457
|
+
tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`)
|
|
446
458
|
}
|
|
447
459
|
if (!tdElem) {
|
|
448
|
-
tdElem =
|
|
460
|
+
tdElem = bodyScrollElem.querySelector(`.${column.id}`)
|
|
449
461
|
}
|
|
450
462
|
if (tdElem) {
|
|
451
463
|
const tdOffsetParent = tdElem.offsetParent as HTMLElement
|
|
452
464
|
const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0)
|
|
453
465
|
const cellWidth = tdElem.clientWidth
|
|
454
466
|
// 检测是否在可视区中
|
|
455
|
-
if (tdOffsetLeft < (bodyScrollLeft +
|
|
456
|
-
return $xeTable.scrollTo(tdOffsetLeft -
|
|
457
|
-
} else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth -
|
|
458
|
-
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth -
|
|
467
|
+
if (tdOffsetLeft < (bodyScrollLeft + leftFixedWidth)) {
|
|
468
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1)
|
|
469
|
+
} else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth - rightFixedWidth)) {
|
|
470
|
+
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1))
|
|
459
471
|
}
|
|
460
472
|
} else {
|
|
461
473
|
// 检测是否在虚拟渲染可视区中
|
|
@@ -463,15 +475,16 @@ export function colToVisible ($xeTable: any, column: any, row?: any) {
|
|
|
463
475
|
let scrollLeft = 0
|
|
464
476
|
const cellWidth = column.renderWidth
|
|
465
477
|
for (let i = 0; i < visibleColumn.length; i++) {
|
|
466
|
-
|
|
478
|
+
const currCol = visibleColumn[i]
|
|
479
|
+
if (currCol === column || currCol.id === column.id) {
|
|
467
480
|
break
|
|
468
481
|
}
|
|
469
|
-
scrollLeft +=
|
|
482
|
+
scrollLeft += currCol.renderWidth
|
|
470
483
|
}
|
|
471
484
|
if (scrollLeft < bodyScrollLeft) {
|
|
472
|
-
return $xeTable.scrollTo(scrollLeft -
|
|
485
|
+
return $xeTable.scrollTo(scrollLeft - leftFixedWidth - 1)
|
|
473
486
|
}
|
|
474
|
-
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth -
|
|
487
|
+
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1))
|
|
475
488
|
}
|
|
476
489
|
}
|
|
477
490
|
}
|
package/packages/ui/index.ts
CHANGED
|
@@ -41,7 +41,10 @@ VxeUI.setConfig({
|
|
|
41
41
|
},
|
|
42
42
|
resizableConfig: {
|
|
43
43
|
dragMode: 'auto',
|
|
44
|
-
showDragTip: true
|
|
44
|
+
showDragTip: true,
|
|
45
|
+
isSyncAutoHeight: true,
|
|
46
|
+
isSyncAutoWidth: true,
|
|
47
|
+
minHeight: 18
|
|
45
48
|
},
|
|
46
49
|
radioConfig: {
|
|
47
50
|
// trigger: 'default'
|
|
@@ -75,6 +78,13 @@ VxeUI.setConfig({
|
|
|
75
78
|
columnConfig: {
|
|
76
79
|
maxFixedSize: 4
|
|
77
80
|
},
|
|
81
|
+
cellConfig: {
|
|
82
|
+
padding: true
|
|
83
|
+
},
|
|
84
|
+
headerCellConfig: {
|
|
85
|
+
},
|
|
86
|
+
footerCellConfig: {
|
|
87
|
+
},
|
|
78
88
|
// menuConfig: {
|
|
79
89
|
// visibleMethod () {}
|
|
80
90
|
// },
|
|
@@ -180,18 +190,20 @@ VxeUI.setConfig({
|
|
|
180
190
|
isReplace: true
|
|
181
191
|
},
|
|
182
192
|
virtualXConfig: {
|
|
183
|
-
|
|
184
|
-
gt: 60
|
|
185
|
-
|
|
193
|
+
enabled: true,
|
|
194
|
+
gt: 60,
|
|
195
|
+
preSize: 0,
|
|
196
|
+
oSize: 1
|
|
186
197
|
},
|
|
187
198
|
virtualYConfig: {
|
|
188
|
-
|
|
189
|
-
gt: 100
|
|
190
|
-
|
|
199
|
+
enabled: true,
|
|
200
|
+
gt: 100,
|
|
201
|
+
preSize: 1,
|
|
202
|
+
oSize: 2
|
|
191
203
|
},
|
|
192
204
|
scrollbarConfig: {
|
|
193
|
-
width:
|
|
194
|
-
height:
|
|
205
|
+
// width: 0,
|
|
206
|
+
// height: 0
|
|
195
207
|
}
|
|
196
208
|
},
|
|
197
209
|
// export: {
|