vxe-table 4.10.6-beta.9 → 4.10.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/grid/src/grid.js +1 -1
- 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 +4 -3
- 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/hook.js +7 -7
- package/es/table/module/export/hook.js +97 -62
- package/es/table/module/keyboard/hook.js +63 -27
- package/es/table/src/body.js +107 -85
- package/es/table/src/cell.js +41 -55
- package/es/table/src/column.js +13 -1
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/emits.js +2 -0
- package/es/table/src/footer.js +45 -7
- package/es/table/src/header.js +67 -165
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +858 -398
- package/es/table/src/util.js +77 -62
- package/es/table/style.css +246 -191
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +20 -7
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +246 -191
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1479 -875
- 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 +4 -3
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -3
- 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-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/hook.js +7 -2
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +97 -57
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +71 -28
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +111 -81
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +32 -42
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +13 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +3 -0
- 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/footer.js +45 -5
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +51 -178
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/props.js +14 -4
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +911 -384
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +100 -82
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +246 -191
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +20 -7
- 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 +246 -191
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- 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 +4 -3
- 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/hook.ts +7 -7
- package/packages/table/module/export/hook.ts +118 -65
- package/packages/table/module/keyboard/hook.ts +59 -25
- package/packages/table/src/body.ts +126 -95
- package/packages/table/src/cell.ts +41 -63
- package/packages/table/src/column.ts +13 -1
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/emits.ts +5 -1
- package/packages/table/src/footer.ts +48 -8
- package/packages/table/src/header.ts +67 -165
- package/packages/table/src/props.ts +14 -5
- package/packages/table/src/table.ts +862 -398
- package/packages/table/src/util.ts +81 -62
- package/packages/ui/index.ts +19 -6
- package/styles/components/table.scss +313 -274
- 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 -1
- /package/es/{iconfont.1736854674495.ttf → iconfont.1739008158505.ttf} +0 -0
- /package/es/{iconfont.1736854674495.woff → iconfont.1739008158505.woff} +0 -0
- /package/es/{iconfont.1736854674495.woff2 → iconfont.1739008158505.woff2} +0 -0
- /package/lib/{iconfont.1736854674495.ttf → iconfont.1739008158505.ttf} +0 -0
- /package/lib/{iconfont.1736854674495.woff → iconfont.1739008158505.woff} +0 -0
- /package/lib/{iconfont.1736854674495.woff2 → iconfont.1739008158505.woff2} +0 -0
|
@@ -118,7 +118,7 @@ export interface XEColumnInstance {
|
|
|
118
118
|
|
|
119
119
|
export const handleFieldOrColumn = ($xeTable: VxeTableConstructor, fieldOrColumn: string | VxeTableDefines.ColumnInfo | null) => {
|
|
120
120
|
if (fieldOrColumn) {
|
|
121
|
-
return XEUtils.isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn
|
|
121
|
+
return XEUtils.isString(fieldOrColumn) || XEUtils.isNumber(fieldOrColumn) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn
|
|
122
122
|
}
|
|
123
123
|
return null
|
|
124
124
|
}
|
|
@@ -178,6 +178,13 @@ export function getRefElem (refEl: any) {
|
|
|
178
178
|
return null
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
export function getCellHeight (height: number | 'unset' | undefined | null) {
|
|
182
|
+
if (height === 'unset') {
|
|
183
|
+
return 0
|
|
184
|
+
}
|
|
185
|
+
return height || 0
|
|
186
|
+
}
|
|
187
|
+
|
|
181
188
|
/**
|
|
182
189
|
* 列宽拖动最大宽度
|
|
183
190
|
* @param params
|
|
@@ -219,7 +226,8 @@ export function getColReMinWidth (params: {
|
|
|
219
226
|
cell: HTMLTableCellElement;
|
|
220
227
|
}) {
|
|
221
228
|
const { $table, column, cell } = params
|
|
222
|
-
const
|
|
229
|
+
const tableProps = $table.props
|
|
230
|
+
const internalData = $table.internalData
|
|
223
231
|
const { computeResizableOpts } = $table.getComputeMaps()
|
|
224
232
|
const resizableOpts = computeResizableOpts.value
|
|
225
233
|
const { minWidth: reMinWidth } = resizableOpts
|
|
@@ -230,6 +238,7 @@ export function getColReMinWidth (params: {
|
|
|
230
238
|
return Math.max(1, XEUtils.toNumber(customMinWidth))
|
|
231
239
|
}
|
|
232
240
|
}
|
|
241
|
+
const { elemStore } = internalData
|
|
233
242
|
const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps
|
|
234
243
|
const { showHeaderOverflow, minWidth: colMinWidth } = column
|
|
235
244
|
const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
@@ -254,12 +263,10 @@ export function getColReMinWidth (params: {
|
|
|
254
263
|
}
|
|
255
264
|
// 如果设置最小宽
|
|
256
265
|
if (colMinWidth) {
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
const bodyElem = tableBody ? tableBody.$el as HTMLDivElement : null
|
|
260
|
-
if (bodyElem) {
|
|
266
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
267
|
+
if (bodyScrollElem) {
|
|
261
268
|
if (isScale(colMinWidth)) {
|
|
262
|
-
const bodyWidth =
|
|
269
|
+
const bodyWidth = bodyScrollElem.clientWidth - 1
|
|
263
270
|
const meanWidth = bodyWidth / 100
|
|
264
271
|
return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMinWidth) * meanWidth))
|
|
265
272
|
} else if (isPx(colMinWidth)) {
|
|
@@ -368,13 +375,33 @@ export const getOffsetSize = ($xeTable: VxeTableConstructor) => {
|
|
|
368
375
|
}
|
|
369
376
|
|
|
370
377
|
export function calcTreeLine (params: VxeTableDefines.CellRenderBodyParams, prevRow: any) {
|
|
371
|
-
const { $table } = params
|
|
378
|
+
const { $table, row } = params
|
|
379
|
+
const tableProps = $table.props
|
|
372
380
|
const tableReactData = $table.reactData
|
|
381
|
+
const tableInternalData = $table.internalData
|
|
382
|
+
|
|
383
|
+
const { showOverflow } = tableProps
|
|
384
|
+
const { scrollYLoad } = tableReactData
|
|
385
|
+
const { fullAllDataRowIdData } = tableInternalData
|
|
386
|
+
const { computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $table.getComputeMaps()
|
|
387
|
+
const rowOpts = computeRowOpts.value
|
|
388
|
+
const cellOpts = computeCellOpts.value
|
|
389
|
+
const defaultRowHeight = computeDefaultRowHeight.value
|
|
390
|
+
const rowid = getRowid($table, row)
|
|
391
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
392
|
+
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
373
393
|
let expandSize = 1
|
|
374
394
|
if (prevRow) {
|
|
375
395
|
expandSize = countTreeExpand(prevRow, params)
|
|
376
396
|
}
|
|
377
|
-
|
|
397
|
+
let cellHeight = currCellHeight
|
|
398
|
+
const vnHeight = rowRest.height
|
|
399
|
+
if (scrollYLoad) {
|
|
400
|
+
if (!showOverflow) {
|
|
401
|
+
cellHeight = vnHeight || currCellHeight
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return cellHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)))
|
|
378
405
|
}
|
|
379
406
|
|
|
380
407
|
export function mergeBodyMethod (mergeList: VxeTableDefines.MergeItem[], _rowIndex: number, _columnIndex: number) {
|
|
@@ -426,28 +453,25 @@ export function clearTableAllStatus ($xeTable: VxeTableConstructor & VxeTablePri
|
|
|
426
453
|
}
|
|
427
454
|
|
|
428
455
|
export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, row: any) {
|
|
429
|
-
const { reactData, internalData } = $xeTable
|
|
430
456
|
const tableProps = $xeTable.props
|
|
457
|
+
const reactData = $xeTable.reactData
|
|
458
|
+
const internalData = $xeTable.internalData
|
|
459
|
+
|
|
460
|
+
const { computeLeftFixedWidth, computeRightFixedWidth, computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps()
|
|
431
461
|
const { showOverflow } = tableProps
|
|
432
|
-
const {
|
|
433
|
-
const {
|
|
434
|
-
const
|
|
435
|
-
const
|
|
436
|
-
const
|
|
437
|
-
const
|
|
462
|
+
const { scrollYLoad } = reactData
|
|
463
|
+
const { elemStore, afterFullData, fullAllDataRowIdData, isResizeCellHeight } = internalData
|
|
464
|
+
const rowOpts = computeRowOpts.value
|
|
465
|
+
const cellOpts = computeCellOpts.value
|
|
466
|
+
const defaultRowHeight = computeDefaultRowHeight.value
|
|
467
|
+
const leftFixedWidth = computeLeftFixedWidth.value
|
|
468
|
+
const rightFixedWidth = computeRightFixedWidth.value
|
|
469
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
438
470
|
const rowid = getRowid($xeTable, row)
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
let offsetFixedRight = 0
|
|
444
|
-
rightList.forEach(item => {
|
|
445
|
-
offsetFixedRight += item.renderWidth
|
|
446
|
-
})
|
|
447
|
-
if (bodyElem) {
|
|
448
|
-
const bodyHeight = bodyElem.clientHeight
|
|
449
|
-
const bodyScrollTop = bodyElem.scrollTop
|
|
450
|
-
const trElem: HTMLTableRowElement | null = bodyElem.querySelector(`[rowid="${rowid}"]`)
|
|
471
|
+
if (bodyScrollElem) {
|
|
472
|
+
const bodyHeight = bodyScrollElem.clientHeight
|
|
473
|
+
const bodyScrollTop = bodyScrollElem.scrollTop
|
|
474
|
+
const trElem: HTMLTableRowElement | null = bodyScrollElem.querySelector(`[rowid="${rowid}"]`)
|
|
451
475
|
if (trElem) {
|
|
452
476
|
const trOffsetParent = trElem.offsetParent as HTMLElement
|
|
453
477
|
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0)
|
|
@@ -461,25 +485,26 @@ export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
461
485
|
} else {
|
|
462
486
|
// 如果是虚拟渲染滚动
|
|
463
487
|
if (scrollYLoad) {
|
|
464
|
-
|
|
465
|
-
|
|
488
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height
|
|
489
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
490
|
+
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight)
|
|
466
491
|
}
|
|
467
492
|
let scrollTop = 0
|
|
468
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
469
|
-
const rHeight = rowRest
|
|
493
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
494
|
+
const rHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
470
495
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
471
496
|
const currRow = afterFullData[i]
|
|
472
497
|
const currRowid = getRowid($xeTable, currRow)
|
|
473
498
|
if (currRow === row || currRowid === rowid) {
|
|
474
499
|
break
|
|
475
500
|
}
|
|
476
|
-
const
|
|
477
|
-
scrollTop +=
|
|
501
|
+
const currRowRest = fullAllDataRowIdData[currRowid] || {}
|
|
502
|
+
scrollTop += currRowRest.resizeHeight || cellOpts.height || rowOpts.height || currRowRest.height || defaultRowHeight
|
|
478
503
|
}
|
|
479
504
|
if (scrollTop < bodyScrollTop) {
|
|
480
|
-
return $xeTable.scrollTo(null, scrollTop -
|
|
505
|
+
return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1)
|
|
481
506
|
}
|
|
482
|
-
return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight -
|
|
507
|
+
return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight - rightFixedWidth - 1))
|
|
483
508
|
}
|
|
484
509
|
}
|
|
485
510
|
}
|
|
@@ -487,44 +512,38 @@ export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
487
512
|
}
|
|
488
513
|
|
|
489
514
|
export function colToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, column: VxeTableDefines.ColumnInfo, row?: any) {
|
|
490
|
-
const
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
const {
|
|
494
|
-
const {
|
|
495
|
-
const
|
|
496
|
-
const
|
|
515
|
+
const reactData = $xeTable.reactData
|
|
516
|
+
const internalData = $xeTable.internalData
|
|
517
|
+
|
|
518
|
+
const { computeLeftFixedWidth, computeRightFixedWidth } = $xeTable.getComputeMaps()
|
|
519
|
+
const { scrollXLoad } = reactData
|
|
520
|
+
const { elemStore, visibleColumn } = internalData
|
|
521
|
+
const leftFixedWidth = computeLeftFixedWidth.value
|
|
522
|
+
const rightFixedWidth = computeRightFixedWidth.value
|
|
523
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
497
524
|
if (column.fixed) {
|
|
498
525
|
return Promise.resolve()
|
|
499
526
|
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
})
|
|
504
|
-
let offsetFixedRight = 0
|
|
505
|
-
rightList.forEach(item => {
|
|
506
|
-
offsetFixedRight += item.renderWidth
|
|
507
|
-
})
|
|
508
|
-
if (bodyElem) {
|
|
509
|
-
const bodyWidth = bodyElem.clientWidth
|
|
510
|
-
const bodyScrollLeft = bodyElem.scrollLeft
|
|
527
|
+
if (bodyScrollElem) {
|
|
528
|
+
const bodyWidth = bodyScrollElem.clientWidth
|
|
529
|
+
const bodyScrollLeft = bodyScrollElem.scrollLeft
|
|
511
530
|
let tdElem: HTMLTableCellElement | null = null
|
|
512
531
|
if (row) {
|
|
513
532
|
const rowid = getRowid($xeTable, row)
|
|
514
|
-
tdElem =
|
|
533
|
+
tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`)
|
|
515
534
|
}
|
|
516
535
|
if (!tdElem) {
|
|
517
|
-
tdElem =
|
|
536
|
+
tdElem = bodyScrollElem.querySelector(`.${column.id}`)
|
|
518
537
|
}
|
|
519
538
|
if (tdElem) {
|
|
520
539
|
const tdOffsetParent = tdElem.offsetParent as HTMLElement
|
|
521
540
|
const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0)
|
|
522
541
|
const cellWidth = tdElem.clientWidth
|
|
523
542
|
// 检测是否在可视区中
|
|
524
|
-
if (tdOffsetLeft < (bodyScrollLeft +
|
|
525
|
-
return $xeTable.scrollTo(tdOffsetLeft -
|
|
526
|
-
} else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth -
|
|
527
|
-
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth -
|
|
543
|
+
if (tdOffsetLeft < (bodyScrollLeft + leftFixedWidth)) {
|
|
544
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1)
|
|
545
|
+
} else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth - rightFixedWidth)) {
|
|
546
|
+
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1))
|
|
528
547
|
}
|
|
529
548
|
} else {
|
|
530
549
|
// 检测是否在虚拟渲染可视区中
|
|
@@ -539,9 +558,9 @@ export function colToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
539
558
|
scrollLeft += currCol.renderWidth
|
|
540
559
|
}
|
|
541
560
|
if (scrollLeft < bodyScrollLeft) {
|
|
542
|
-
return $xeTable.scrollTo(scrollLeft -
|
|
561
|
+
return $xeTable.scrollTo(scrollLeft - leftFixedWidth - 1)
|
|
543
562
|
}
|
|
544
|
-
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth -
|
|
563
|
+
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1))
|
|
545
564
|
}
|
|
546
565
|
}
|
|
547
566
|
}
|
package/packages/ui/index.ts
CHANGED
|
@@ -17,7 +17,6 @@ VxeUI.setConfig({
|
|
|
17
17
|
animat: true,
|
|
18
18
|
delayHover: 250,
|
|
19
19
|
autoResize: true,
|
|
20
|
-
padding: true,
|
|
21
20
|
minHeight: 144,
|
|
22
21
|
// keepSource: false,
|
|
23
22
|
// showOverflow: null,
|
|
@@ -41,7 +40,10 @@ VxeUI.setConfig({
|
|
|
41
40
|
},
|
|
42
41
|
resizableConfig: {
|
|
43
42
|
dragMode: 'auto',
|
|
44
|
-
showDragTip: true
|
|
43
|
+
showDragTip: true,
|
|
44
|
+
isSyncAutoHeight: true,
|
|
45
|
+
isSyncAutoWidth: true,
|
|
46
|
+
minHeight: 18
|
|
45
47
|
},
|
|
46
48
|
radioConfig: {
|
|
47
49
|
// trigger: 'default'
|
|
@@ -75,6 +77,15 @@ VxeUI.setConfig({
|
|
|
75
77
|
columnConfig: {
|
|
76
78
|
maxFixedSize: 4
|
|
77
79
|
},
|
|
80
|
+
cellConfig: {
|
|
81
|
+
padding: true
|
|
82
|
+
},
|
|
83
|
+
headerCellConfig: {
|
|
84
|
+
height: 'unset'
|
|
85
|
+
},
|
|
86
|
+
footerCellConfig: {
|
|
87
|
+
height: 'unset'
|
|
88
|
+
},
|
|
78
89
|
// menuConfig: {
|
|
79
90
|
// visibleMethod () {}
|
|
80
91
|
// },
|
|
@@ -108,6 +119,8 @@ VxeUI.setConfig({
|
|
|
108
119
|
// orders: ['asc', 'desc', null],
|
|
109
120
|
// sortMethod: null,
|
|
110
121
|
showIcon: true,
|
|
122
|
+
allowClear: true,
|
|
123
|
+
allowBtn: true,
|
|
111
124
|
iconLayout: 'vertical'
|
|
112
125
|
},
|
|
113
126
|
filterConfig: {
|
|
@@ -180,20 +193,20 @@ VxeUI.setConfig({
|
|
|
180
193
|
isReplace: true
|
|
181
194
|
},
|
|
182
195
|
virtualXConfig: {
|
|
183
|
-
|
|
196
|
+
enabled: true,
|
|
184
197
|
gt: 60,
|
|
185
198
|
preSize: 0,
|
|
186
199
|
oSize: 1
|
|
187
200
|
},
|
|
188
201
|
virtualYConfig: {
|
|
189
|
-
|
|
202
|
+
enabled: true,
|
|
190
203
|
gt: 100,
|
|
191
204
|
preSize: 1,
|
|
192
205
|
oSize: 2
|
|
193
206
|
},
|
|
194
207
|
scrollbarConfig: {
|
|
195
|
-
width:
|
|
196
|
-
height:
|
|
208
|
+
// width: 0,
|
|
209
|
+
// height: 0
|
|
197
210
|
}
|
|
198
211
|
},
|
|
199
212
|
// export: {
|