Skip to content

Commit

Permalink
releases 4.0.75
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Jul 18, 2024
1 parent 141ae4d commit a75e5d1
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 26 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ npm run serve
npm run lib
```

## PR

1. 如果是修复 bug,必须有示例的复现链接
2. 如果新功能,涉及代码风格、质量、还需有对应的示例页面

## Contributors

Thank you to everyone who contributed to this project.
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-pc-ui",
"version": "4.0.74",
"version": "4.0.75",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
26 changes: 21 additions & 5 deletions packages/modal/src/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ export default defineComponent({
return props.type === 'message' || props.type === 'notification'
})

const computeIsMinimizeStatus = computed(() => {
return reactData.zoomStatus === 'minimize'
})

const computeIsMaximizeStatus = computed(() => {
return reactData.zoomStatus === 'maximize'
})

const computeZoomOpts = computed(() => {
return Object.assign({}, getConfig().modal.zoomConfig, props.zoomConfig)
})
Expand Down Expand Up @@ -897,14 +905,22 @@ export default defineComponent({
const { zoomStatus } = reactData
const titleSlot = slots.title || propSlots.title
const cornerSlot = slots.corner || propSlots.corner
const isMinimizeStatus = computeIsMinimizeStatus.value
const isMaximizeStatus = computeIsMaximizeStatus.value
return [
h('div', {
class: 'vxe-modal--header-title'
}, titleSlot ? getSlotVNs(titleSlot({ $modal: $xeModal })) : (title ? getFuncText(title) : getI18n('vxe.alert.title'))),
}, titleSlot
? getSlotVNs(titleSlot({
$modal: $xeModal,
minimized: isMinimizeStatus,
maximized: isMaximizeStatus
}))
: (title ? getFuncText(title) : getI18n('vxe.alert.title'))),
h('div', {
class: 'vxe-modal--header-right'
}, [
cornerSlot
cornerSlot && !isMinimizeStatus
? h('div', {
class: 'vxe-modal--corner-wrapper'
}, getSlotVNs(cornerSlot({ $modal: $xeModal })))
Expand Down Expand Up @@ -1069,10 +1085,11 @@ export default defineComponent({

const renderVN = () => {
const { slots: propSlots = {}, className, type, animat, draggable, iconStatus, position, loading, destroyOnClose, status, lockScroll, padding, lockView, mask, resize } = props
const { initialized, revertLocat, modalTop, contentVisible, visible, zoomStatus } = reactData
const { initialized, modalTop, contentVisible, visible, zoomStatus } = reactData
const asideSlot = slots.aside || propSlots.aside
const vSize = computeSize.value
const isMsg = computeIsMsg.value
const isMinimizeStatus = computeIsMinimizeStatus.value
const ons: Record<string, any> = {}
if (isMsg) {
ons.onMouseover = selfMouseoverEvent
Expand All @@ -1094,7 +1111,6 @@ export default defineComponent({
'is--draggable': draggable,
'is--resize': resize,
'is--mask': mask,
'is--maximize': revertLocat,
'is--visible': contentVisible,
'is--active': visible,
'is--loading': loading
Expand All @@ -1111,7 +1127,7 @@ export default defineComponent({
class: 'vxe-modal--box',
onMousedown: boxMousedownEvent
}, [
isMsg || asideSlot
(isMsg || asideSlot) && !isMinimizeStatus
? h('div', {
class: 'vxe-modal--aside'
},
Expand Down
39 changes: 20 additions & 19 deletions styles/components/modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,32 @@
}
}
}
&.zoom--minimize,
&.zoom--maximize {
& > .vxe-modal--box {
& > .vxe-modal--container {
& > .vxe-modal--resize {
.wl-resize,
.wr-resize,
.swst-resize,
.sest-resize,
.st-resize,
.swlb-resize,
.selb-resize,
.sb-resize {
display: none;
}
}
}
}
}
&.zoom--maximize {
& > .vxe-modal--box {
border-radius: 0;
& > .vxe-modal--container {
& > .vxe-modal--header {
border-radius: 0;
cursor: default;
}
}
}
Expand Down Expand Up @@ -446,25 +466,6 @@
}
}
}
&.is--maximize {
.vxe-modal--box {
.vxe-modal--header {
cursor: default;
}
}
.vxe-modal--resize {
.wl-resize,
.wr-resize,
.swst-resize,
.sest-resize,
.st-resize,
.swlb-resize,
.selb-resize,
.sb-resize {
display: none;
}
}
}
}

.vxe-modal--wrapper {
Expand Down
5 changes: 4 additions & 1 deletion types/components/modal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,10 @@ export namespace VxeModalSlotTypes {
export interface RightSlotParams extends DefaultSlotParams { }
export interface AsideSlotParams extends DefaultSlotParams { }
export interface HeaderSlotParams extends DefaultSlotParams { }
export interface TitleSlotParams extends DefaultSlotParams { }
export interface TitleSlotParams extends DefaultSlotParams {
minimized: boolean
maximized: boolean
}
export interface CornerSlotParams extends DefaultSlotParams { }
export interface FooterSlotParams extends DefaultSlotParams { }
export interface LeftfootSlotParams extends DefaultSlotParams { }
Expand Down

0 comments on commit a75e5d1

Please sign in to comment.