Skip to content

Commit

Permalink
releases 4.6.11
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed May 9, 2024
1 parent d06e5bf commit 14f0ea2
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 25 deletions.
2 changes: 1 addition & 1 deletion examples/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div id="app" @click="clickEvent">
<div @click="clickEvent">
<header class="page-header">
<div class="left">
<a href="/vxe-table/">
Expand Down
3 changes: 0 additions & 3 deletions examples/style/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ body,
border-bottom: 1px solid #dcdfe6;
box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.12);
display: flex;
color: #fff;
background-color: #24292e;
&:after {
content: "";
display: block;
Expand All @@ -109,7 +107,6 @@ body,
.title {
padding: 0 0.4em;
font-weight: 700;
color: #fff;
}
.left {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "4.6.10",
"version": "4.6.11",
"description": "一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式...",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
4 changes: 3 additions & 1 deletion packages/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ config({
export function install (app: App, options: any) {
if (XEUtils.isPlainObject(options)) {
config(options)
setTheme(options)
if ((options as any).theme) {
setTheme(options)
}
}
components.forEach(component => component.install(app))
}
Expand Down
1 change: 1 addition & 0 deletions packages/input/src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,7 @@ export default defineComponent({
}
const { boundingTop, boundingLeft, visibleHeight, visibleWidth } = getAbsolutePos(targetElem)
let panelPlacement: VxeInputPropTypes.Placement = 'bottom'
console.log(getAbsolutePos(targetElem))
if (transfer) {
let left = boundingLeft
let top = boundingTop + targetHeight
Expand Down
8 changes: 4 additions & 4 deletions packages/pulldown/src/pulldown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ export default defineComponent({
if (!disabled) {
if (visiblePanel) {
if (getEventTargetNode(evnt, panelElem).flag) {
updatePlacement()
// updatePlacement()
} else {
hidePanel()
// hidePanel()
pulldownMethods.dispatchEvent('hide-panel', {}, evnt)
}
}
Expand All @@ -231,7 +231,7 @@ export default defineComponent({
if (!disabled) {
reactData.isActivated = getEventTargetNode(evnt, el).flag || getEventTargetNode(evnt, panelElem).flag
if (visiblePanel && !reactData.isActivated) {
hidePanel()
// hidePanel()
pulldownMethods.dispatchEvent('hide-panel', {}, evnt)
}
}
Expand All @@ -240,7 +240,7 @@ export default defineComponent({
const handleGlobalBlurEvent = (evnt: Event) => {
if (reactData.visiblePanel) {
reactData.isActivated = false
hidePanel()
// hidePanel()
pulldownMethods.dispatchEvent('hide-panel', {}, evnt)
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/table/src/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default defineComponent({

const renderLine = (params: any) => {
const { row, column } = params
const { afterFullData } = tableInternalData
const { treeConfig } = tableProps
const treeOpts = computeTreeOpts.value
const { slots, treeNode } = column
Expand All @@ -102,6 +103,7 @@ export default defineComponent({
if (slots && slots.line) {
return $xetable.callSlot(slots.line, params)
}
const isFirstRow = $xetable.eqRow(afterFullData[0], row)
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
return [
h('div', {
Expand All @@ -110,7 +112,7 @@ export default defineComponent({
h('div', {
class: 'vxe-tree--line',
style: {
height: `${calcTreeLine(params, items, rIndex)}px`,
height: `${isFirstRow ? 1 : calcTreeLine(params, items, rIndex)}px`,
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize() : 0) + 16}px`
}
})
Expand Down
15 changes: 9 additions & 6 deletions packages/table/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4524,6 +4524,7 @@ export default defineComponent({
const el = refElem.value
const editOpts = computeEditOpts.value
const validOpts = computeValidOpts.value
const areaOpts = computeAreaOpts.value
const { actived } = editStore
const $validTooltip = refValidTooltip.value
const tableFilter = refTableFilter.value
Expand Down Expand Up @@ -4613,12 +4614,14 @@ export default defineComponent({
if ($xetable.clearSelected) {
$xetable.clearSelected()
}
if ($xetable.clearCellAreas) {
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
tablePrivateMethods.preventEvent(evnt, 'event.clearAreas', {}, () => {
$xetable.clearCellAreas()
$xetable.clearCopyCellArea()
})
if (areaOpts.autoClear) {
if ($xetable.clearCellAreas) {
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
tablePrivateMethods.preventEvent(evnt, 'event.clearAreas', {}, () => {
$xetable.clearCellAreas()
$xetable.clearCopyCellArea()
})
}
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions packages/tools/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,9 @@ export function getOffsetPos (elem: any, container: any) {
}

export function getAbsolutePos (elem: any) {
// 当主页面嵌套在iframe时,elem.getBoundingClientRect()计算在当前body内的边界距离,document.body.getBoundingClientRect计算body所在的边界距离
const bodyBounding = document.body.getBoundingClientRect()
const bounding = elem.getBoundingClientRect()
const boundingTop = bounding.top - bodyBounding.top
const boundingLeft = bounding.left - bodyBounding.left
const boundingTop = bounding.top
const boundingLeft = bounding.left
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
return { boundingTop, top: scrollTop + boundingTop, boundingLeft, left: scrollLeft + boundingLeft, visibleHeight, visibleWidth }
}
Expand Down
1 change: 1 addition & 0 deletions packages/v-x-e-table/src/conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const GlobalConfig: VXETableConfigOptions = {
isEsc: true
},
areaConfig: {
autoClear: true,
selectCellByHeader: true
},
clipConfig: {
Expand Down
4 changes: 3 additions & 1 deletion packages/v-x-e-table/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { VxeGlobalConfigMethod } from '../../../types/all'
*/
export const config: VxeGlobalConfigMethod = (options) => {
if (options) {
setTheme(options)
if (options.theme) {
setTheme(options)
}
if (options.zIndex) {
DomZIndex.setCurrent(options.zIndex)
}
Expand Down
6 changes: 3 additions & 3 deletions styles/theme/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[data-vxe-table-theme="dark"] {
color-scheme: dark;

/*font*/
--vxe-font-family: #{$vxe-font-family};
--vxe-font-size: #{$vxe-font-size};
Expand Down Expand Up @@ -56,8 +56,8 @@
--vxe-table-popup-border-color: #424242;

/*table*/
--vxe-table-header-font-color: #{$vxe-table-header-font-color};
--vxe-table-footer-font-color: #{$vxe-table-footer-font-color};
--vxe-table-header-font-color: #98989E;
--vxe-table-footer-font-color: #98989E;
--vxe-table-border-radius: #{$vxe-table-border-radius};
--vxe-table-border-width: #{$vxe-table-border-width};
--vxe-table-border-color: #37373A;
Expand Down
4 changes: 4 additions & 0 deletions types/table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,10 @@ export namespace VxeTablePropTypes {
* 只对 mouse-config.extension 启用后有效,扩展区域时将自动识别数字规则进行计算
*/
extendByCalc?: boolean
/**
* 当点击表格之外,是否自动清除单元格的选取状态
*/
autoClear?: boolean
/**
* 只对 extendByCalc 启用后有效,重写单元格扩展区域计算值的方法
* @param params
Expand Down

0 comments on commit 14f0ea2

Please sign in to comment.