Skip to content

Commit

Permalink
releases 4.11.8
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Feb 22, 2025
1 parent 5d3d0c8 commit cca28b3
Show file tree
Hide file tree
Showing 23 changed files with 61 additions and 43 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "4.11.7",
"version": "4.11.8",
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down Expand Up @@ -28,7 +28,7 @@
"style": "lib/style.css",
"typings": "types/index.d.ts",
"dependencies": {
"vxe-pc-ui": "^4.3.94"
"vxe-pc-ui": "^4.3.95"
},
"devDependencies": {
"@types/resize-observer-browser": "^0.1.11",
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/ar-EG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: '确认',
cancel: '取消'
cancel: '取消',
clear: '清除'
},
filter: {
search: '搜索'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ export default
},
button: {
confirm: 'bestätigen',
cancel: 'Stornieren'
cancel: 'Stornieren',
clear: '清除'
},
filter: {
search: 'suchen'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'confirm',
cancel: 'Cancel'
cancel: 'Cancel',
clear: '清除'
},
filter: {
search: 'search'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'Confirmar',
cancel: 'Cancelar'
cancel: 'Cancelar',
clear: '清除'
},
filter: {
search: '搜索'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: '确认',
cancel: '取消'
cancel: '取消',
clear: '清除'
},
filter: {
search: '搜索'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/hu-HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'erősítse meg',
cancel: 'Mégsem'
cancel: 'Mégsem',
clear: '清除'
},
filter: {
search: 'keresés'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/hy-AM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: '确认',
cancel: '取消'
cancel: '取消',
clear: '清除'
},
filter: {
search: '搜索'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/id-ID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: '确认',
cancel: '取消'
cancel: '取消',
clear: '清除'
},
filter: {
search: '搜索'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/it-IT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'confermare',
cancel: 'Cancellare'
cancel: 'Cancellare',
clear: '清除'
},
filter: {
search: 'ricerca'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'OK',
cancel: 'キャンセル'
cancel: 'キャンセル',
clear: '清除'
},
filter: {
search: '検索'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/ko-KR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: '확인',
cancel: '취소'
cancel: '취소',
clear: '清除'
},
filter: {
search: '검색'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/nb-NO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: '确认',
cancel: '取消'
cancel: '取消',
clear: '清除'
},
filter: {
search: '搜索'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'Confirmar',
cancel: 'Cancelar'
cancel: 'Cancelar',
clear: '清除'
},
filter: {
search: 'Buscar'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/ru-RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'подтверждать',
cancel: 'Отмена'
cancel: 'Отмена',
clear: '清除'
},
filter: {
search: 'поиск'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/th-TH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'ยืนยัน',
cancel: 'ยกเลิก'
cancel: 'ยกเลิก',
clear: '清除'
},
filter: {
search: 'ค้นหา'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/ug-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'جەزىملەش',
cancel: 'ئەمەلدىن قالدۇرۇش'
cancel: 'ئەمەلدىن قالدۇرۇش',
clear: '清除'
},
filter: {
search: 'ئىزدەش'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/uk-UA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: 'Підтвердити',
cancel: 'Скасувати'
cancel: 'Скасувати',
clear: '清除'
},
filter: {
search: 'Пошук'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/vi-VN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: '确认',
cancel: '取消'
cancel: '取消',
clear: '清除'
},
filter: {
search: '搜索'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/zh-CHT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: '確認',
cancel: '取消'
cancel: '取消',
clear: '清除'
},
filter: {
search: '搜尋'
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/lang/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default {
},
button: {
confirm: '确认',
cancel: '取消'
cancel: '取消',
clear: '清除'
},
filter: {
search: '搜索'
Expand Down
4 changes: 2 additions & 2 deletions packages/table/module/export/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ hooks.add('tableExportModule', {
isMerge: hasMerge,
useStyle: true,
current: 'current',
modes: ['current', 'selected', 'empty'].concat(proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : [])
modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []).concat(['current', 'selected', 'empty'])
}, options)
const types: string[] = defOpts.types || XEUtils.keys(exportOpts._typeMaps)
const modes: string[] = defOpts.modes || []
Expand Down Expand Up @@ -1153,7 +1153,7 @@ hooks.add('tableExportModule', {
isMerge: hasMerge,
useStyle: true,
current: 'current',
modes: ['current', 'selected', 'empty'].concat(proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []),
modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []).concat(['current', 'selected', 'empty']),
download: true,
type: 'csv'
// filename: '',
Expand Down
36 changes: 17 additions & 19 deletions packages/table/module/filter/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const tableFilterMethodKeys: (keyof TableFilterMethods)[] = ['openFilter', 'setF
hooks.add('tableFilterModule', {
setupTable ($xeTable) {
const { props, reactData, internalData } = $xeTable
const { refTableHeader, refTableBody, refTableFilter } = $xeTable.getRefMaps()
const { refElem, refTableFilter } = $xeTable.getRefMaps()
const { computeFilterOpts, computeMouseOpts } = $xeTable.getComputeMaps()

// 确认筛选
Expand Down Expand Up @@ -69,12 +69,16 @@ hooks.add('tableFilterModule', {
* @param {ColumnInfo} column 列配置
* @param {Object} params 参数
*/
triggerFilterEvent (evnt, column, params) {
triggerFilterEvent (evnt: MouseEvent, column, params) {
const { initStore, filterStore } = reactData
const { elemStore } = internalData
if (filterStore.column === column && filterStore.visible) {
filterStore.visible = false
} else {
const { target: targetElem, pageX } = evnt
const { clientY, pageX } = evnt
const el = refElem.value
const tableRect = el.getBoundingClientRect()
const targetElem = evnt.target as HTMLDivElement
const { visibleWidth } = getDomNode()
const { filters, filterMultiple, filterRender } = column
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
Expand All @@ -100,11 +104,8 @@ hooks.add('tableFilterModule', {
filterStore.visible = true
initStore.filter = true
nextTick(() => {
const tableHeader = refTableHeader.value
const tableBody = refTableBody.value
const headerElem = tableHeader ? tableHeader.$el as HTMLDivElement : null
const bodyElem = tableBody.$el as HTMLDivElement
if (!bodyElem) {
const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
if (!headerScrollElem) {
return
}
const tableFilter = refTableFilter.value
Expand All @@ -113,28 +114,25 @@ hooks.add('tableFilterModule', {
return
}
const filterWidth = filterWrapperElem.offsetWidth
const filterHeight = filterWrapperElem.offsetHeight
const filterHeadElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-header')
const filterFootElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-footer')
const centerWidth = filterWidth / 2
const minMargin = 10
const maxLeft = bodyElem.clientWidth - filterWidth - minMargin
const maxLeft = el.clientWidth - filterWidth - minMargin
let left, right
const thEl = targetElem.offsetParent as HTMLTableCellElement
const trEl = thEl.offsetParent as HTMLTableCellElement
const style: any = {
top: `${targetElem.offsetTop + targetElem.offsetParent.offsetTop + targetElem.offsetHeight}px`
top: `${targetElem.offsetTop + thEl.offsetTop + targetElem.offsetHeight}px`
}
// 判断面板不能大于表格高度
let maxHeight: number | null = null
const bodyHeight = bodyElem.clientHeight - (headerElem ? headerElem.clientHeight / 2 : 0)
if (filterHeight >= bodyHeight) {
maxHeight = Math.max(40, bodyHeight - (filterFootElem ? filterFootElem.offsetHeight : 0) - (filterHeadElem ? filterHeadElem.offsetHeight : 0))
}
const maxHeight = Math.max(40, el.clientHeight - (clientY - tableRect.y) - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14)
if (column.fixed === 'left') {
left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth
left = targetElem.offsetLeft + thEl.offsetLeft - centerWidth
} else if (column.fixed === 'right') {
right = (targetElem.offsetParent.offsetWidth - targetElem.offsetLeft) + (targetElem.offsetParent.offsetParent.offsetWidth - targetElem.offsetParent.offsetLeft) - column.renderWidth - centerWidth
right = (thEl.offsetWidth - targetElem.offsetLeft) + (trEl.offsetWidth - trEl.offsetLeft) - column.renderWidth - centerWidth
} else {
left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth - bodyElem.scrollLeft
left = targetElem.offsetLeft + thEl.offsetLeft - centerWidth - headerScrollElem.scrollLeft
}
if (left) {
const overflowWidth = (pageX + filterWidth - centerWidth + minMargin) - visibleWidth
Expand Down

0 comments on commit cca28b3

Please sign in to comment.