Skip to content

Commit

Permalink
releases 4.7.45
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Jul 5, 2024
1 parent 0f5a689 commit 0731b7f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 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.7.44",
"version": "4.7.45",
"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.0.48"
"vxe-pc-ui": "^4.0.49"
},
"devDependencies": {
"@types/resize-observer-browser": "^0.1.11",
Expand Down
28 changes: 21 additions & 7 deletions packages/table/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5882,7 +5882,7 @@ export default defineComponent({
}
tableMethods.dispatchEvent('header-cell-click', Object.assign({ triggerResizable, triggerSort, triggerFilter, cell }, params), evnt)
if (columnOpts.isCurrent || props.highlightCurrentColumn) {
tableMethods.setCurrentColumn(column)
tablePrivateMethods.triggerCurrentColumnEvent(evnt, params)
}
},
triggerHeaderCellDblclickEvent (evnt, params) {
Expand Down Expand Up @@ -6092,13 +6092,25 @@ export default defineComponent({
tableMethods.dispatchEvent('radio-change', { oldValue, newValue, ...params }, evnt)
}
},
triggerCurrentColumnEvent (evnt, params) {
const columnOpts = computeColumnOpts
const { currentMethod } = columnOpts.value
const { column } = params
if (!currentMethod || currentMethod({ column })) {
tableMethods.setCurrentColumn(column)
}
},
triggerCurrentRowEvent (evnt, params) {
const { currentRow: oldValue } = reactData
const rowOpts = computeRowOpts
const { currentMethod } = rowOpts.value
const { row: newValue } = params
const isChange = oldValue !== newValue
tableMethods.setCurrentRow(newValue)
if (isChange) {
tableMethods.dispatchEvent('current-change', { oldValue, newValue, ...params }, evnt)
if (!currentMethod || currentMethod({ row: newValue })) {
tableMethods.setCurrentRow(newValue)
if (isChange) {
tableMethods.dispatchEvent('current-change', { oldValue, newValue, ...params }, evnt)
}
}
},
/**
Expand Down Expand Up @@ -6718,9 +6730,9 @@ export default defineComponent({
if (mouseOpts.area && mouseOpts.selected) {
warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected'])
}
if (mouseOpts.area && checkboxOpts.range) {
warnLog('vxe.error.errConflicts', ['mouse-config.area', 'checkbox-config.range'])
}
// if (mouseOpts.area && checkboxOpts.range) {
// warnLog('vxe.error.errConflicts', ['mouse-config.area', 'checkbox-config.range'])
// }
if (props.treeConfig && mouseOpts.area) {
errLog('vxe.error.noTree', ['mouse-config.area'])
}
Expand Down Expand Up @@ -6843,6 +6855,7 @@ export default defineComponent({
const loadingSlot = slots.loading
const tipConfig = computeTipConfig.value
const validOpts = computeValidOpts.value
const checkboxOpts = computeCheckboxOpts.value
const treeOpts = computeTreeOpts.value
const rowOpts = computeRowOpts.value
const columnOpts = computeColumnOpts.value
Expand All @@ -6865,6 +6878,7 @@ export default defineComponent({
'cell--area': mouseConfig && mouseOpts.area,
'row--highlight': rowOpts.isHover || highlightHoverRow,
'column--highlight': columnOpts.isHover || highlightHoverColumn,
'checkbox--range': checkboxOpts.range,
'is--header': showHeader,
'is--footer': showFooter,
'is--group': isGroup,
Expand Down
9 changes: 8 additions & 1 deletion styles/components/table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,15 @@
}
}
}
&.checkbox--range,
&.cell--selected {
.vxe-body--column {
user-select: none;
}
}
&.cell--area {
.vxe-body--row {
.vxe-table--body-wrapper,
.vxe-body--column {
user-select: none;
}
}
Expand Down

0 comments on commit 0731b7f

Please sign in to comment.