vxe-table 4.17.0-beta.0 → 4.17.0-beta.10
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/README.md +2 -0
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +34 -32
- package/es/table/module/export/export-panel.js +22 -22
- package/es/table/module/export/import-panel.js +8 -8
- package/es/table/module/filter/hook.js +1 -1
- package/es/table/module/filter/panel.js +1 -1
- package/es/table/module/keyboard/hook.js +4 -26
- package/es/table/render/index.js +14 -2
- package/es/table/src/body.js +12 -2
- package/es/table/src/emits.js +2 -0
- package/es/table/src/header.js +1 -1
- package/es/table/src/table.js +52 -17
- package/es/table/src/util.js +3 -3
- package/es/table/style.css +3 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +6 -5
- package/es/vxe-table/style.css +3 -0
- 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 +102 -103
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/panel.js +26 -24
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/export-panel.js +19 -18
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +8 -7
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/filter/hook.js +1 -1
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/filter/panel.js +1 -0
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +3 -28
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/render/index.js +13 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +0 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/header.js +1 -1
- package/lib/table/src/table.js +13 -7
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +3 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +3 -0
- package/lib/table/style/style.min.css +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/lib/ui/src/utils.js +8 -5
- package/lib/ui/src/utils.min.js +1 -1
- package/lib/vxe-table/style/style.css +3 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/panel.ts +34 -32
- package/packages/table/module/export/export-panel.ts +22 -22
- package/packages/table/module/export/import-panel.ts +8 -8
- package/packages/table/module/filter/hook.ts +1 -1
- package/packages/table/module/filter/panel.ts +1 -1
- package/packages/table/module/keyboard/hook.ts +4 -28
- package/packages/table/render/index.ts +26 -17
- package/packages/table/src/body.ts +12 -3
- package/packages/table/src/emits.ts +2 -0
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/table.ts +50 -17
- package/packages/table/src/util.ts +3 -3
- package/packages/ui/src/utils.ts +7 -5
- package/styles/components/table.scss +3 -0
- /package/es/{iconfont.1759031444881.ttf → iconfont.1760688141383.ttf} +0 -0
- /package/es/{iconfont.1759031444881.woff → iconfont.1760688141383.woff} +0 -0
- /package/es/{iconfont.1759031444881.woff2 → iconfont.1760688141383.woff2} +0 -0
- /package/lib/{iconfont.1759031444881.ttf → iconfont.1760688141383.ttf} +0 -0
- /package/lib/{iconfont.1759031444881.woff → iconfont.1760688141383.woff} +0 -0
- /package/lib/{iconfont.1759031444881.woff2 → iconfont.1760688141383.woff2} +0 -0
|
@@ -123,7 +123,7 @@ export default defineVxeComponent({
|
|
|
123
123
|
columnIndex,
|
|
124
124
|
$columnIndex,
|
|
125
125
|
_columnIndex,
|
|
126
|
-
firstFilterOption,
|
|
126
|
+
firstFilterOption: firstFilterOption as VxeTableDefines.FilterOption,
|
|
127
127
|
fixed: fixedType,
|
|
128
128
|
type: renderType,
|
|
129
129
|
isHidden: fixedHiddenColumn,
|
|
@@ -314,7 +314,7 @@ export default defineVxeComponent({
|
|
|
314
314
|
columnIndex,
|
|
315
315
|
$columnIndex,
|
|
316
316
|
_columnIndex,
|
|
317
|
-
option: firstFilterOption,
|
|
317
|
+
option: firstFilterOption as VxeTableDefines.FilterOption,
|
|
318
318
|
fixed: fixedType,
|
|
319
319
|
type: renderType,
|
|
320
320
|
isHidden: fixedHiddenColumn,
|
|
@@ -2470,7 +2470,6 @@ export default defineVxeComponent({
|
|
|
2470
2470
|
}
|
|
2471
2471
|
|
|
2472
2472
|
const scrollbarXConf = scrollbarOpts.x || {}
|
|
2473
|
-
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
2474
2473
|
const scrollbarYConf = scrollbarOpts.y || {}
|
|
2475
2474
|
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
2476
2475
|
|
|
@@ -2522,16 +2521,28 @@ export default defineVxeComponent({
|
|
|
2522
2521
|
}
|
|
2523
2522
|
const xWrapperEl = refScrollXWrapperElem.value
|
|
2524
2523
|
if (xWrapperEl) {
|
|
2525
|
-
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : ''
|
|
2526
2524
|
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`
|
|
2525
|
+
if (scrollbarYToLeft) {
|
|
2526
|
+
xWrapperEl.style.left = `${osbWidth}px`
|
|
2527
|
+
} else {
|
|
2528
|
+
xWrapperEl.style.left = ''
|
|
2529
|
+
}
|
|
2527
2530
|
}
|
|
2528
2531
|
if (xLeftCornerEl) {
|
|
2529
|
-
|
|
2530
|
-
|
|
2532
|
+
if (scrollbarYToLeft) {
|
|
2533
|
+
xLeftCornerEl.style.width = `${osbWidth}px`
|
|
2534
|
+
xLeftCornerEl.style.display = overflowY && osbWidth ? 'block' : ''
|
|
2535
|
+
} else {
|
|
2536
|
+
xLeftCornerEl.style.display = ''
|
|
2537
|
+
}
|
|
2531
2538
|
}
|
|
2532
2539
|
if (xRightCornerEl) {
|
|
2533
|
-
|
|
2534
|
-
|
|
2540
|
+
if (scrollbarYToLeft) {
|
|
2541
|
+
xRightCornerEl.style.display = ''
|
|
2542
|
+
} else {
|
|
2543
|
+
xRightCornerEl.style.width = `${osbWidth}px`
|
|
2544
|
+
xRightCornerEl.style.display = xScrollbarVisible === 'visible' ? 'block' : ''
|
|
2545
|
+
}
|
|
2535
2546
|
}
|
|
2536
2547
|
|
|
2537
2548
|
const scrollYVirtualEl = refScrollYVirtualElem.value
|
|
@@ -4149,8 +4160,10 @@ export default defineVxeComponent({
|
|
|
4149
4160
|
updateAfterDataIndex()
|
|
4150
4161
|
return nextTick()
|
|
4151
4162
|
}).then(() => {
|
|
4163
|
+
updateTreeLineStyle()
|
|
4152
4164
|
return handleLazyRecalculate(true, true, true)
|
|
4153
4165
|
}).then(() => {
|
|
4166
|
+
updateTreeLineStyle()
|
|
4154
4167
|
setTimeout(() => {
|
|
4155
4168
|
$xeTable.updateCellAreas()
|
|
4156
4169
|
}, 30)
|
|
@@ -4418,7 +4431,9 @@ export default defineVxeComponent({
|
|
|
4418
4431
|
let countTop = 0
|
|
4419
4432
|
const step = (timestamp: number) => {
|
|
4420
4433
|
let progress = (timestamp - startTime) / duration
|
|
4421
|
-
if (progress
|
|
4434
|
+
if (progress < 0) {
|
|
4435
|
+
progress = 0
|
|
4436
|
+
} else if (progress > 1) {
|
|
4422
4437
|
progress = 1
|
|
4423
4438
|
}
|
|
4424
4439
|
const easedProgress = Math.pow(progress, 2)
|
|
@@ -4521,6 +4536,9 @@ export default defineVxeComponent({
|
|
|
4521
4536
|
}
|
|
4522
4537
|
}
|
|
4523
4538
|
|
|
4539
|
+
/**
|
|
4540
|
+
* 更新展开行样式
|
|
4541
|
+
*/
|
|
4524
4542
|
const updateRowExpandStyle = () => {
|
|
4525
4543
|
const { expandColumn, scrollYLoad, scrollYTop, isScrollYBig } = reactData
|
|
4526
4544
|
const expandOpts = computeExpandOpts.value
|
|
@@ -4576,6 +4594,13 @@ export default defineVxeComponent({
|
|
|
4576
4594
|
}
|
|
4577
4595
|
}
|
|
4578
4596
|
|
|
4597
|
+
/**
|
|
4598
|
+
* 更新树连接线样式
|
|
4599
|
+
*/
|
|
4600
|
+
const updateTreeLineStyle = () => {
|
|
4601
|
+
// 待优化
|
|
4602
|
+
}
|
|
4603
|
+
|
|
4579
4604
|
const handleRowExpandScroll = () => {
|
|
4580
4605
|
const { elemStore } = internalData
|
|
4581
4606
|
const rowExpandEl = refRowExpandElem.value
|
|
@@ -9966,8 +9991,8 @@ export default defineVxeComponent({
|
|
|
9966
9991
|
$xeTable.handleHeaderCellDragMousedownEvent(evnt, params)
|
|
9967
9992
|
}
|
|
9968
9993
|
}
|
|
9969
|
-
if (!triggerDrag && mouseConfig && mouseOpts.area && $xeTable.
|
|
9970
|
-
$xeTable.
|
|
9994
|
+
if (!triggerDrag && mouseConfig && mouseOpts.area && $xeTable.handleHeaderCellAreaMouseDnEvent) {
|
|
9995
|
+
$xeTable.handleHeaderCellAreaMouseDnEvent(evnt, Object.assign({ cell, triggerSort, triggerFilter }, params))
|
|
9971
9996
|
}
|
|
9972
9997
|
$xeTable.focus()
|
|
9973
9998
|
if ($xeTable.closeMenu) {
|
|
@@ -11358,6 +11383,10 @@ export default defineVxeComponent({
|
|
|
11358
11383
|
if (target && /^textarea$/i.test((target as HTMLElement).tagName)) {
|
|
11359
11384
|
return
|
|
11360
11385
|
}
|
|
11386
|
+
// 如果滚轮未移动或者触摸板未变化位置
|
|
11387
|
+
if (!deltaY && !deltaX) {
|
|
11388
|
+
return
|
|
11389
|
+
}
|
|
11361
11390
|
|
|
11362
11391
|
const { highlightHoverRow } = tableProps
|
|
11363
11392
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
@@ -11388,21 +11417,25 @@ export default defineVxeComponent({
|
|
|
11388
11417
|
}
|
|
11389
11418
|
|
|
11390
11419
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime)
|
|
11391
|
-
const deltaTop = shiftKey ? 0 :
|
|
11392
|
-
const deltaLeft =
|
|
11420
|
+
const deltaTop = shiftKey ? 0 : (deltaY * wheelSpeed)
|
|
11421
|
+
const deltaLeft = (shiftKey ? (deltaX || deltaY) : deltaX) * wheelSpeed
|
|
11393
11422
|
|
|
11394
|
-
const isTopWheel = deltaTop < 0
|
|
11395
11423
|
const currScrollTop = bodyScrollElem.scrollTop
|
|
11424
|
+
const currScrollLeft = bodyScrollElem.scrollLeft
|
|
11396
11425
|
|
|
11397
|
-
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
11398
|
-
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
11399
|
-
return
|
|
11400
|
-
}
|
|
11401
11426
|
const scrollTop = currScrollTop + deltaTop
|
|
11402
|
-
const scrollLeft =
|
|
11427
|
+
const scrollLeft = currScrollLeft + deltaLeft
|
|
11403
11428
|
const isRollX = scrollLeft !== lastScrollLeft
|
|
11404
11429
|
const isRollY = scrollTop !== lastScrollTop
|
|
11405
11430
|
|
|
11431
|
+
if (isRollY) {
|
|
11432
|
+
const isTopWheel = deltaTop < 0
|
|
11433
|
+
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
11434
|
+
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
11435
|
+
return
|
|
11436
|
+
}
|
|
11437
|
+
}
|
|
11438
|
+
|
|
11406
11439
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
11407
11440
|
$xeTable.clearHoverRow()
|
|
11408
11441
|
}
|
|
@@ -638,7 +638,7 @@ const lineOffsetSizes = {
|
|
|
638
638
|
large: 0
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
-
function
|
|
641
|
+
function countTreeExpandSize (prevRow: any, params: VxeTableDefines.CellRenderBodyParams) {
|
|
642
642
|
let count = 1
|
|
643
643
|
if (!prevRow) {
|
|
644
644
|
return count
|
|
@@ -655,7 +655,7 @@ function countTreeExpand (prevRow: any, params: VxeTableDefines.CellRenderBodyPa
|
|
|
655
655
|
const rowChildren = prevRow[transform ? mapChildrenField : childrenField]
|
|
656
656
|
if (rowChildren && treeExpandedFlag && treeExpandedMaps[getRowid($table, prevRow)]) {
|
|
657
657
|
for (let index = 0; index < rowChildren.length; index++) {
|
|
658
|
-
count +=
|
|
658
|
+
count += countTreeExpandSize(rowChildren[index], params)
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
661
|
return count
|
|
@@ -688,7 +688,7 @@ export function calcTreeLine (params: VxeTableDefines.CellRenderBodyParams, prev
|
|
|
688
688
|
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
689
689
|
let expandSize = 1
|
|
690
690
|
if (prevRow) {
|
|
691
|
-
expandSize =
|
|
691
|
+
expandSize = countTreeExpandSize(prevRow, params)
|
|
692
692
|
}
|
|
693
693
|
let cellHeight = currCellHeight
|
|
694
694
|
const vnHeight = rowRest.height
|
package/packages/ui/src/utils.ts
CHANGED
|
@@ -2,6 +2,8 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import { VxeUI } from '@vxe-ui/core'
|
|
3
3
|
import DomZIndex from 'dom-zindex'
|
|
4
4
|
|
|
5
|
+
const { getConfig } = VxeUI
|
|
6
|
+
|
|
5
7
|
export function isEnableConf (conf: any): boolean {
|
|
6
8
|
return conf && conf.enabled !== false
|
|
7
9
|
}
|
|
@@ -31,15 +33,15 @@ export function hasChildrenList (item: any) {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export function getFuncText (content?: string | number | boolean | null, args?: any) {
|
|
34
|
-
if (content) {
|
|
35
|
-
|
|
36
|
-
return XEUtils.toValueString(translate ? translate('' + content, args) : content)
|
|
36
|
+
if (XEUtils.eqNull(content)) {
|
|
37
|
+
return ''
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
const translate = getConfig().translate
|
|
40
|
+
return `${translate ? translate('' + content, args) : content}`
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
export function formatText (value: any, placeholder?: any) {
|
|
42
|
-
return '' + (isEmptyValue(value) ? (placeholder ?
|
|
44
|
+
return '' + (isEmptyValue(value) ? (placeholder ? getConfig().emptyCell : '') : value)
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
/**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|