Skip to content

Commit 4d1062a

Browse files
committed
releases 4.23.0
1 parent a6a07e5 commit 4d1062a

5 files changed

Lines changed: 99 additions & 70 deletions

File tree

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vxe-table",
3-
"version": "4.23.0-beta.0",
3+
"version": "4.23.0-beta.1",
44
"description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
55
"scripts": {
66
"update": "npm install --legacy-peer-deps",
@@ -66,7 +66,7 @@
6666
"typescript": "~5.9.3",
6767
"vue": "3.4.27",
6868
"vue-router": "~4.5.1",
69-
"vxe-pc-ui": "4.20.0"
69+
"vxe-pc-ui": "4.20.1"
7070
},
7171
"vetur": {
7272
"tags": "helper/vetur/tags.json",

‎packages/locale/lang/fr-FR.ts‎

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default {
172172
cstmDragTarget: 'Déplacer: {0}',
173173
setting: {
174174
colSort: 'Trier',
175-
sortHelpTip: '点击图标开始拖动',
175+
sortHelpTip: "Cliquez sur l'icône pour commencer à faire glisser",
176176
colTitle: 'Title',
177177
colResizable: 'Width (pixels)',
178178
colVisible: 'Visible',
@@ -709,7 +709,7 @@ export default {
709709
groupPlaceholder: '拖至此处进行分组',
710710
valuesPlaceholder: '拖至此处进行聚合',
711711
dragExistCol: '该列已存在',
712-
sortHelpTip: '点击图标开始拖动'
712+
sortHelpTip: "Cliquez sur l'icône pour commencer à faire glisser",
713713
},
714714
aggFuncs: {
715715
sum: '求和',
@@ -753,7 +753,7 @@ export default {
753753
clearFilter: 'Filtre effacer',
754754
textOption: 'Filtre à texte',
755755
numberOption: 'Filtre numérique',
756-
dateOption: '日期筛选'
756+
dateOption: 'Filtre par date',
757757
},
758758
popup: {
759759
title: 'Méthodes de filtrage personnalisées',
@@ -776,28 +776,28 @@ export default {
776776
include: 'Inclure',
777777
exclude: 'Pas inclus',
778778
between: 'Entre',
779-
isAfter: '在以下日期之后',
780-
eqAfter: '在以下日期之后或与之相同',
781-
isBefore: '在以下日期之前',
782-
eqBefore: '在以下日期之前或与之相同',
783-
top10: '前10项',
784-
aboveAverage: '高于平均值',
785-
belowAverage: '低于平均值',
786-
before: '之前',
787-
after: '之后',
788-
tomorrow: '明天',
789-
today: '今天',
790-
yesterday: '昨天',
791-
nextWeek: '下周',
792-
thisWeek: '本周',
793-
lastWeek: '上周',
794-
nextMonth: '下月',
795-
thisMonth: '本月',
796-
lastMonth: '上月',
797-
nextYear: '明年',
798-
thisYear: '今年',
799-
lastYear: '去年',
800-
yearToDate: '本年度截止到现在',
779+
isAfter: 'Après la date suivante',
780+
eqAfter: 'Après la date suivante ou à la même date',
781+
isBefore: 'Avant la date suivante',
782+
eqBefore: 'Avant la date suivante ou à la même date',
783+
top10: 'Top 10',
784+
aboveAverage: 'Supérieur à la moyenne',
785+
belowAverage: 'Inférieur à la moyenne',
786+
before: 'Avant',
787+
after: 'Après',
788+
tomorrow: 'Demain',
789+
today: "Aujourd'hui",
790+
yesterday: 'Hier',
791+
nextWeek: 'La semaine prochaine',
792+
thisWeek: 'Cette semaine',
793+
lastWeek: 'La semaine dernière',
794+
nextMonth: 'Le mois prochain',
795+
thisMonth: 'Ce mois-ci',
796+
lastMonth: 'Le mois dernier',
797+
nextYear: "L'année prochaine",
798+
thisYear: 'Cette année',
799+
lastYear: "L'année dernière",
800+
yearToDate: "Depuis le début de l'année jusqu'à présent",
801801
custom: 'Filtre personnalisé',
802802
insensitive: 'Cas insensible au cas',
803803
isSensitive: 'sensible aux majuscules et minuscules'
@@ -865,9 +865,9 @@ export default {
865865
include: 'Inclure',
866866
exclude: 'Pas inclus',
867867
between: 'Entre',
868-
top10: '前10项',
869-
aboveAverage: '高于平均值',
870-
belowAverage: '低于平均值',
868+
top10: 'Top 10',
869+
aboveAverage: 'Supérieur à la moyenne',
870+
belowAverage: 'Inférieur à la moyenne',
871871
custom: 'Filtre personnalisé',
872872
insensitive: 'Cas insensible au cas',
873873
isSensitive: 'sensible aux majuscules et minuscules'
@@ -886,7 +886,7 @@ export default {
886886
clearFilter: 'Filtre effacer',
887887
textOption: 'Filtrage de texte',
888888
numberOption: 'Filtrage numérique',
889-
dateOption: '日期筛选'
889+
dateOption: 'Filtre par date',
890890
},
891891
popup: {
892892
title: 'Méthodes de filtrage personnalisées',

‎packages/table/src/props.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ export const tableProps = {
305305
virtualXConfig: Object as PropType<VxeTablePropTypes.VirtualXConfig>,
306306
// 纵向虚拟滚动配置项
307307
virtualYConfig: Object as PropType<VxeTablePropTypes.VirtualYConfig>,
308+
useScrollbar: {
309+
type: Boolean as PropType<VxeTablePropTypes.UseScrollbar>,
310+
default: () => getConfig().table.useScrollbar
311+
},
308312
// 滚动条配置项
309313
scrollbarConfig: Object as PropType<VxeTablePropTypes.ScrollbarConfig>,
310314
// 撤销/恢复历史配置项

‎packages/table/src/table.ts‎

Lines changed: 56 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { h, ComponentPublicInstance, reactive, ref, Ref, provide, inject, nextTi
22
import { defineVxeComponent } from '../../ui/src/comp'
33
import XEUtils from 'xe-utils'
44
import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollTopTo, wheelScrollLeftTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasAxternalInputTarget } from '../../ui/src/dom'
5-
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue, hasEnableConf } from '../../ui/src/utils'
5+
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue, hasEnableConf, getDefaultConfig } from '../../ui/src/utils'
66
import { VxeUI } from '../../ui'
77
import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig, encodeRowid } from './util'
88
import { getSlotVNs } from '../../ui/src/vn'
@@ -60,6 +60,8 @@ export default defineVxeComponent({
6060

6161
const browseObj = XEUtils.browse()
6262

63+
const scrollDefaultConf = Object.assign({}, getConfig().scrollbar)
64+
6365
// 使用已安装的组件,如果未安装则不渲染
6466
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading')
6567
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip')
@@ -227,12 +229,12 @@ export default defineVxeComponent({
227229

228230
const computeScrollbarXOpts = computed(() => {
229231
const scrollbarOpts = computeScrollbarOpts.value
230-
return Object.assign({}, scrollbarOpts.x, props.scrollbarConfig?.x || {})
232+
return scrollbarOpts.x ? Object.assign({}, scrollbarOpts.x, scrollbarOpts.xConfig) : (scrollbarOpts.xConfig || {})
231233
})
232234

233235
const computeScrollbarYOpts = computed(() => {
234236
const scrollbarOpts = computeScrollbarOpts.value
235-
return Object.assign({}, scrollbarOpts.y, props.scrollbarConfig?.y || {})
237+
return scrollbarOpts.y ? Object.assign({}, scrollbarOpts.y, scrollbarOpts.yConfig) : (scrollbarOpts.yConfig || {})
236238
})
237239

238240
const computeScrollbarXToTop = computed(() => {
@@ -638,15 +640,18 @@ export default defineVxeComponent({
638640

639641
const computeTableStyle = computed(() => {
640642
const scrollbarOpts = computeScrollbarOpts.value
641-
const { width, height } = scrollbarOpts
642-
const tStys: VxeComponentStyleType = {}
643-
if (width) {
644-
tStys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(width)
645-
}
646-
if (height) {
647-
tStys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(height)
643+
const scrollbarXOpts = computeScrollbarXOpts.value
644+
const scrollbarYOpts = computeScrollbarYOpts.value
645+
const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width)
646+
const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height)
647+
const stys: VxeComponentStyleType = {}
648+
if (barWidth || barHeight) {
649+
stys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(barWidth || barHeight)
650+
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(barWidth || barHeight)
651+
stys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(barHeight || barWidth)
652+
stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(barHeight || barWidth)
648653
}
649-
return tStys
654+
return stys
650655
})
651656

652657
const computeTableRowExpandedList = computed(() => {
@@ -2600,7 +2605,6 @@ export default defineVxeComponent({
26002605
const isHeaderRenderOptimize = computeIsHeaderRenderOptimize.value
26012606
const isBodyRenderOptimize = computeIsBodyRenderOptimize.value
26022607
const isFooterRenderOptimize = computeIsFooterRenderOptimize.value
2603-
const scrollbarOpts = computeScrollbarOpts.value
26042608
const mouseOpts = computeMouseOpts.value
26052609
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
26062610
const bodyTableElem = getRefElem(elemStore['main-body-table'])
@@ -2609,24 +2613,26 @@ export default defineVxeComponent({
26092613
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : ''
26102614
}
26112615

2612-
const scrollbarXConf = scrollbarOpts.x || {}
2613-
const scrollbarYConf = scrollbarOpts.y || {}
2616+
const scrollbarXOpts = computeScrollbarXOpts.value
2617+
const scrollbarYOpts = computeScrollbarYOpts.value
26142618
const scrollbarYToLeft = computeScrollbarYToLeft.value
26152619

26162620
let xScrollbarVisible = overflowX ? 'visible' : 'hidden'
2617-
if (scrollbarXConf.visible === 'visible' || $xeGanttView) {
2621+
const hideXScroll = scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden'
2622+
if (!hideXScroll || $xeGanttView) {
26182623
osbHeight = scrollbarHeight
26192624
xScrollbarVisible = 'visible'
2620-
} else if (scrollbarXConf.visible === 'hidden' || scrollbarXConf.visible === false) {
2625+
} else if (hideXScroll) {
26212626
osbHeight = 0
26222627
xScrollbarVisible = 'hidden'
26232628
}
26242629

26252630
let yScrollbarVisible = overflowY ? 'visible' : 'hidden'
2626-
if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
2631+
const showYScroll = !(scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden')
2632+
if (!showYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
26272633
osbWidth = 0
26282634
yScrollbarVisible = 'hidden'
2629-
} else if (scrollbarYConf.visible === 'visible') {
2635+
} else if (showYScroll) {
26302636
osbWidth = scrollbarWidth
26312637
yScrollbarVisible = 'visible'
26322638
}
@@ -3469,15 +3475,19 @@ export default defineVxeComponent({
34693475
let overflowY = false
34703476
let overflowX = false
34713477
if (bodyWrapperElem) {
3478+
const scrollbarXOpts = computeScrollbarXOpts.value
3479+
const scrollbarYOpts = computeScrollbarYOpts.value
3480+
const barWidth = XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width))
3481+
const barHeight = XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height))
34723482
overflowY = scrollYHeight > bodyWrapperElem.clientHeight
34733483
if (yHandleEl) {
3474-
reactData.scrollbarWidth = scrollbarOpts.width || (yHandleEl.offsetWidth - yHandleEl.clientWidth) || 14
3484+
reactData.scrollbarWidth = (barWidth || barHeight) || (yHandleEl.offsetWidth - yHandleEl.clientWidth) || 14
34753485
}
34763486
reactData.overflowY = overflowY
34773487

34783488
overflowX = scrollXWidth > bodyWrapperElem.clientWidth
34793489
if (xHandleEl) {
3480-
reactData.scrollbarHeight = scrollbarOpts.height || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14
3490+
reactData.scrollbarHeight = (barHeight || barWidth) || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14
34813491
}
34823492

34833493
const hHeight = headerTableElem ? headerTableElem.clientHeight : 0
@@ -13059,14 +13069,14 @@ export default defineVxeComponent({
1305913069

1306013070
if (isRollX) {
1306113071
// 如果禁用滚动
13062-
if (scrollbarXOpts.visible === 'hidden') {
13072+
if (scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden') {
1306313073
evnt.preventDefault()
1306413074
return
1306513075
}
1306613076
}
1306713077
if (isRollY) {
1306813078
// 如果禁用滚动
13069-
if (scrollbarYOpts.visible === 'hidden') {
13079+
if (scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden') {
1307013080
evnt.preventDefault()
1307113081
return
1307213082
}
@@ -13674,10 +13684,15 @@ export default defineVxeComponent({
1367413684
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior
1367513685
return h('div', {
1367613686
ref: isFixedLeft ? refLeftContainer : refRightContainer,
13677-
class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
13678-
[`x-ob--${osXBehavior}`]: osXBehavior,
13679-
[`y-ob--${osYBehavior}`]: osYBehavior
13680-
}]
13687+
class: [
13688+
`vxe-table--fixed-${fixedType}-wrapper`,
13689+
`sx--${(scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden') ? 'hidden' : 'visible'}`,
13690+
`sy--${(scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden') ? 'hidden' : 'visible'}`,
13691+
{
13692+
[`x-ob--${osXBehavior}`]: osXBehavior,
13693+
[`y-ob--${osYBehavior}`]: osYBehavior
13694+
}
13695+
]
1368113696
}, [
1368213697
showHeader
1368313698
? h(TableHeaderComponent, {
@@ -13997,7 +14012,11 @@ export default defineVxeComponent({
1399714012
}]
1399814013
}, [
1399914014
h('div', {
14000-
class: ['vxe-table--main-wrapper', `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`]
14015+
class: [
14016+
'vxe-table--main-wrapper',
14017+
`sx--${(scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden') ? 'hidden' : 'visible'}`,
14018+
`sy--${(scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden') ? 'hidden' : 'visible'}`
14019+
]
1400114020
}, [
1400214021
/**
1400314022
* 表头
@@ -14055,7 +14074,7 @@ export default defineVxeComponent({
1405514074
}
1405614075

1405714076
const renderVN = () => {
14058-
const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props
14077+
const { loading, stripe, useScrollbar, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props
1405914078
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData
1406014079
const { teleportToWrapperElem, popupToWrapperElem, customPopupToElem } = internalData
1406114080
const { leftList, rightList } = columnStore
@@ -14104,7 +14123,7 @@ export default defineVxeComponent({
1410414123
}
1410514124
return h('div', {
1410614125
ref: refElem,
14107-
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
14126+
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, useScrollbar ? 'is--virtual-scrollbar' : 'is--native-scrollbar', `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
1410814127
[`size--${vSize}`]: vSize,
1410914128
[`valid-msg--${validOpts.msgMode}`]: !!editRules,
1411014129
'vxe-editable': !!editConfig,
@@ -14722,6 +14741,7 @@ export default defineVxeComponent({
1472214741
const areaOpts = computeAreaOpts.value
1472314742
const sortOpts = computeSortOpts.value
1472414743
const filterOpts = computeFilterOpts.value
14744+
const scrollbarOpts = computeScrollbarOpts.value
1472514745
const { groupFields } = aggregateOpts
1472614746

1472714747
if ($xeGantt) {
@@ -14963,6 +14983,13 @@ export default defineVxeComponent({
1496314983
// errLog('vxe.error.reqModule', ['Export'])
1496414984
// }
1496514985

14986+
if (scrollbarOpts.x) {
14987+
warnLog('vxe.error.delProp', ['scrollbar-config.x', 'scrollbar-config.xConfig'])
14988+
}
14989+
if (scrollbarOpts.y) {
14990+
warnLog('vxe.error.delProp', ['scrollbar-config.y', 'scrollbar-config.yConfig'])
14991+
}
14992+
1496614993
Object.assign(scrollYStore, {
1496714994
startIndex: 0,
1496814995
endIndex: 0,

‎packages/ui/index.ts‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,14 @@ VxeUI.setConfig({
269269
oSize: 0
270270
},
271271
scrollbarConfig: {
272-
// width: 14,
273-
// height: 14,
274-
x: {
275-
// position: 'bottom',
276-
visible: true
277-
},
278-
y: {
279-
// position: 'right',
280-
visible: true
281-
}
272+
// xConfig: {
273+
// // position: 'bottom',
274+
// // visible: true
275+
// },
276+
// yConfig: {
277+
// // position: 'right',
278+
// // visible: true
279+
// }
282280
},
283281
undoRedoHistoryConfig: {
284282
stackSize: 50

0 commit comments

Comments
 (0)