Skip to content

Commit

Permalink
releases 4.2.43
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Nov 6, 2024
1 parent ced75a1 commit d4a5d32
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 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.8.1",
"version": "4.8.2",
"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.2.42"
"vxe-pc-ui": "^4.2.43"
},
"devDependencies": {
"@types/resize-observer-browser": "^0.1.11",
Expand Down
21 changes: 15 additions & 6 deletions packages/table/src/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,19 @@ function renderTitleSuffixIcon (params: VxeTableDefines.CellRenderHeaderParams)

function renderCellDragIcon (params: VxeTableDefines.CellRenderBodyParams) {
const { $table } = params
const { computeDragOpts } = $table.getComputeMaps()
const dragOpts = computeDragOpts.value
const { rowDisabledMethod } = dragOpts
const isDisabled = rowDisabledMethod && rowDisabledMethod(params)
return h('span', {
key: 'dg',
class: 'vxe-cell--drag-handle',
class: ['vxe-cell--drag-handle', {
'is--disabled': isDisabled
}],
onMousedown (evnt) {
$table.handleCellDragMousedownEvent(evnt, params)
if (!isDisabled) {
$table.handleCellDragMousedownEvent(evnt, params)
}
},
onMouseup: $table.handleCellDragMouseupEvent
}, [
Expand All @@ -69,7 +77,8 @@ function renderCellBaseVNs (params: VxeTableDefines.CellRenderBodyParams, conten
const { computeRowOpts, computeDragOpts } = $table.getComputeMaps()
const rowOpts = computeRowOpts.value
const dragOpts = computeDragOpts.value
if (dragSort && rowOpts.drag && dragOpts.showIcon) {
const { showRowIcon, rowVisibleMethod } = dragOpts
if (dragSort && rowOpts.drag && (showRowIcon && (!rowVisibleMethod || rowVisibleMethod(params)))) {
vns.unshift(
renderCellDragIcon(params)
)
Expand Down Expand Up @@ -939,14 +948,14 @@ export const Cell = {
return []
}
if (defaultSlot) {
return $table.callSlot(defaultSlot, cellParams)
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, cellParams))
}
if (formatter) {
return [
return renderCellBaseVNs(params, [
h('span', {
class: 'vxe-cell--label'
}, getDefaultCellLabel(cellParams))
]
])
}
return Cell.renderDefaultCell(cellParams)
}
Expand Down
8 changes: 4 additions & 4 deletions packages/table/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6642,8 +6642,8 @@ export default defineComponent({
},
handleRowDragDragendEvent (evnt) {
const { treeConfig } = props
const rowOpts = computeRowOpts.value
const { dragEndMethod } = rowOpts
const dragOpts = computeDragOpts.value
const { dragEndMethod } = dragOpts
const treeOpts = computeTreeOpts.value
const { transform } = treeOpts
const { dragRow } = reactData
Expand Down Expand Up @@ -6739,8 +6739,8 @@ export default defineComponent({
},
handleCellDragMousedownEvent (evnt, params) {
evnt.stopPropagation()
const rowOpts = computeRowOpts.value
const { dragStartMethod } = rowOpts
const dragOpts = computeDragOpts.value
const { dragStartMethod } = dragOpts
const { row } = params
const dragEl = evnt.currentTarget as HTMLElement
const tdEl = dragEl.parentNode?.parentNode as HTMLElement
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ VxeUI.setConfig({
strict: true
},
dragConfig: {
showIcon: true
showRowIcon: true
},
checkboxConfig: {
// trigger: 'default',
Expand Down
5 changes: 5 additions & 0 deletions styles/components/table-module/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@
}

.vxe-table-custom-popup--row {
&.active--drag-origin {
.vxe-table-custom-popup--column-item {
opacity: 0.5;
}
}
&.active--drag-target {
&[drag-pos="top"] {
.vxe-table-custom-popup--column-item {
Expand Down

0 comments on commit d4a5d32

Please sign in to comment.