Skip to content

Commit

Permalink
releases 4.9.19
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Dec 9, 2024
1 parent 13c2270 commit 1f6419f
Show file tree
Hide file tree
Showing 34 changed files with 332 additions and 60 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.9.18",
"version": "4.9.19",
"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.19"
"vxe-pc-ui": "^4.3.22"
},
"devDependencies": {
"@types/resize-observer-browser": "^0.1.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/src/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const { getConfig, getI18n, commands, hooks, useFns, createEvent, globalEvents,

const tableComponentPropKeys = Object.keys(tableComponentProps as any)

const tableComponentMethodKeys: (keyof VxeTableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'isCheckedByCheckboxRow', 'isIndeterminateByCheckboxRow', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'setRadioRow', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'openTooltip', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect']
const tableComponentMethodKeys: (keyof VxeTableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'isCheckedByCheckboxRow', 'isIndeterminateByCheckboxRow', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'setRadioRow', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'openTooltip', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect']

const gridComponentEmits: VxeGridEmits = [
...tableComponentEmits,
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/ar-EG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '该浏览器不支持导入/导出功能',
impFields: '导入失败,请检查字段名和数据格式是否正确',
treeNotImp: '树表格不支持导入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '该浏览器不支持导入/导出功能',
impFields: '导入失败,请检查字段名和数据格式是否正确',
treeNotImp: '树表格不支持导入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
4 changes: 3 additions & 1 deletion packages/locale/lang/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export default {
notExp: 'The browser does not support import / export.',
impFields: 'Import failed, please check that the field name and data format are correct.',
treeNotImp: 'Tree table does not support import.',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
treeCrossDrag: 'Only drag and drop data from the first level',
treeDragChild: 'Parent data cannot be dragged and dropped into children',
reqPlugin: 'Optional extensions "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
emptyText: 'No Data',
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: 'El navegador no es compatible con la importación / exportación.',
impFields: 'Error de importación, por favor revise que el nombre del campo y el formato de datos sean correctos.',
treeNotImp: 'La tabla de árbol no soporta importación.',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: 'Optional extension "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '该浏览器不支持导入/导出功能',
impFields: '导入失败,请检查字段名和数据格式是否正确',
treeNotImp: '树表格不支持导入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/hu-HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: 'Ez a böngésző nem támogatja az importálási/exportálási funkciókat',
impFields: 'Az importálás nem sikerült, ellenőrizze, hogy a mezőnév és az adatformátum helyes-e',
treeNotImp: 'A fatáblák nem támogatják az importálást',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/hy-AM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '该浏览器不支持导入/导出功能',
impFields: '导入失败,请检查字段名和数据格式是否正确',
treeNotImp: '树表格不支持导入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: 'ご利用のブラウザはインポート/エクスポート機能を利用できません',
impFields: 'インポートに失敗しました。フィールド名とデータ形式を確認してください',
treeNotImp: 'ツリーテーブルはインポートをサポートしていません',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/ko-KR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '该浏览器不支持导入/导出功能',
impFields: '导入失败,请检查字段名和数据格式是否正确',
treeNotImp: '树表格不支持导入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/nb-NO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '该浏览器不支持导入/导出功能',
impFields: '导入失败,请检查字段名和数据格式是否正确',
treeNotImp: '树表格不支持导入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: 'O navegador não suporta importação/exportação.',
impFields: 'Falha na importação, verifique se o nome do campo e o formato dos dados estão corretos.',
treeNotImp: 'A tabela de árvore não suporta importação.',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/ru-RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: 'Этот браузер не поддерживает функцию импорта/экспорта.',
impFields: 'Не удалось выполнить импорт. Проверьте правильность имени поля и формата данных.',
treeNotImp: 'Древовидные таблицы не поддерживают импорт.',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/ug-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: 'بۇ تور كۆرگۈچ ئەكىرىش/ئاچىقىشنى قوللىمايدۇ',
impFields: 'ئەكىرىشى مەغلۇپ بولدى،سۆز ھەم ئۇچۇر فورماتىنى تەكشۈرۈڭ',
treeNotImp: 'دەرەخ شەكىللىك جەدىۋەلنى ئەكىرىشنى قوللىمايدۇ',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/uk-UA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '该浏览器不支持导入/导出功能',
impFields: '导入失败,请检查字段名和数据格式是否正确',
treeNotImp: '树表格不支持导入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/vi-VN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '该浏览器不支持导入/导出功能',
impFields: '导入失败,请检查字段名和数据格式是否正确',
treeNotImp: '树表格不支持导入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/zh-CHT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '該瀏覽器不支援匯入/匯出功能',
impFields: '匯入失敗,請檢查欄位名稱和資料格式是否正確',
treeNotImp: '樹表格不支援導入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可選擴展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/locale/lang/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default {
notExp: '该浏览器不支持导入/导出功能',
impFields: '导入失败,请检查字段名和数据格式是否正确',
treeNotImp: '树表格不支持导入',
treeCrossDrag: '只能拖拽第一层级的数据',
treeDragChild: '父级数据不能拖拽到子级中',
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
},
table: {
Expand Down
2 changes: 2 additions & 0 deletions packages/table/module/custom/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ VxeUI.hooks.add('tableCustomModule', {
column.visible = column.renderVisible
}
})
reactData.isCustomStatus = true
reactData.isDragColMove = true
setTimeout(() => {
reactData.isDragColMove = false
Expand Down Expand Up @@ -194,6 +195,7 @@ VxeUI.hooks.add('tableCustomModule', {
}
column.renderResizeWidth = column.renderWidth
})
reactData.isCustomStatus = false
$xeTable.saveCustomStore('reset')
return $xeTable.handleCustom()
},
Expand Down
12 changes: 8 additions & 4 deletions packages/table/module/custom/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export default defineComponent({

const renderSimplePanel = () => {
const { customStore } = props
const { customColumnList } = reactData
const { isCustomStatus, customColumnList } = reactData
const customOpts = computeCustomOpts.value
const { maxHeight } = customStore
const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts
Expand All @@ -311,7 +311,8 @@ export default defineComponent({
$grid: $xeTable.xegrid,
columns: customColumnList,
isAllChecked,
isAllIndeterminate
isAllIndeterminate,
isCustomStatus
}
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
const isVisible = visibleMethod ? visibleMethod({ column }) : true
Expand Down Expand Up @@ -509,6 +510,7 @@ export default defineComponent({
? h(VxeUIButtonComponent, {
mode: 'text',
content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
disabled: !isCustomStatus,
onClick: resetCustomEvent
})
: createCommentVNode(),
Expand Down Expand Up @@ -547,7 +549,7 @@ export default defineComponent({
const renderPopupPanel = () => {
const { customStore } = props
const { resizable: allResizable } = tableProps
const { customColumnList } = reactData
const { isCustomStatus, customColumnList } = reactData
const customOpts = computeCustomOpts.value
const { mode, modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts
const columnOpts = computeColumnOpts.value
Expand All @@ -572,7 +574,8 @@ export default defineComponent({
$grid: $xeTable.xegrid,
columns: customColumnList,
isAllChecked,
isAllIndeterminate
isAllIndeterminate,
isCustomStatus
}
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
const isVisible = visibleMethod ? visibleMethod({ column }) : true
Expand Down Expand Up @@ -853,6 +856,7 @@ export default defineComponent({
VxeUIButtonComponent
? h(VxeUIButtonComponent, {
content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore'),
disabled: !isCustomStatus,
onClick: resetCustomEvent
})
: createCommentVNode(),
Expand Down
2 changes: 1 addition & 1 deletion packages/table/src/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export default defineComponent({
isExpandTree = rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid]
}
// 拖拽行事件
if (rowOpts.drag && !rowLevel) {
if (rowOpts.drag && (!treeConfig || transform)) {
trOn.onDragstart = $xeTable.handleRowDragDragstartEvent
trOn.onDragend = $xeTable.handleRowDragDragendEvent
trOn.onDragover = $xeTable.handleRowDragDragoverEvent
Expand Down
10 changes: 8 additions & 2 deletions packages/table/src/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,17 @@ function renderCellBaseVNs (params: VxeTableDefines.CellRenderBodyParams, conten
const { computeRowOpts, computeRowDragOpts } = $table.getComputeMaps()
const rowOpts = computeRowOpts.value
const rowDragOpts = computeRowDragOpts.value
const { showIcon, visibleMethod } = rowDragOpts
const { showIcon, isCrossDrag, visibleMethod } = rowDragOpts
const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null)
const vns: VxeComponentSlotType[] = XEUtils.isArray(content) ? content : [content]
if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
if (!treeConfig || !level) {
if (treeConfig) {
if (isCrossDrag || !level) {
vns.unshift(
renderCellDragIcon(params)
)
}
} else {
vns.unshift(
renderCellDragIcon(params)
)
Expand Down
2 changes: 1 addition & 1 deletion packages/table/src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default defineComponent({
thOns.onMousedown = (evnt: MouseEvent) => $xeTable.triggerHeaderCellMousedownEvent(evnt, params)
}
// 拖拽行事件
if (columnOpts.drag && !column.parentId) {
if (columnOpts.drag) {
thOns.onDragstart = $xeTable.handleHeaderCellDragDragstartEvent
thOns.onDragend = $xeTable.handleHeaderCellDragDragendEvent
thOns.onDragover = $xeTable.handleHeaderCellDragDragoverEvent
Expand Down
Loading

0 comments on commit 1f6419f

Please sign in to comment.