Skip to content

Commit

Permalink
releases 4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Sep 23, 2024
1 parent 0adf042 commit 188fd72
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/views/form/FormTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</vxe-form-item>
</vxe-form>

<vxe-form border title-background :data="demo1.formData1" @submit="searchEvent" @reset="resetEvent" size="medium">
<vxe-form title-background :data="demo1.formData1" @submit="searchEvent" @reset="resetEvent" size="medium">
<vxe-form-item title="名称" field="name" :item-render="{}">
<template #default="{ data }">
<vxe-input v-model="data.name" placeholder="请输入名称" clearable></vxe-input>
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.2.0",
"version": "4.2.1",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
18 changes: 16 additions & 2 deletions packages/drawer/src/drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ export default defineComponent({
type: Boolean as PropType<VxeDrawerPropTypes.EscClosable>,
default: () => getConfig().drawer.escClosable
},
cancelClosable: {
type: Boolean as PropType<VxeDrawerPropTypes.CancelClosable>,
default: () => getConfig().drawer.cancelClosable
},
confirmClosable: {
type: Boolean as PropType<VxeDrawerPropTypes.ConfirmClosable>,
default: () => getConfig().drawer.confirmClosable
},
showHeader: {
type: Boolean as PropType<VxeDrawerPropTypes.ShowHeader>,
default: () => getConfig().drawer.showHeader
Expand Down Expand Up @@ -199,15 +207,21 @@ export default defineComponent({
}

const confirmEvent = (evnt: Event) => {
const { confirmClosable } = props
const type = 'confirm'
dispatchEvent(type, { type }, evnt)
closeDrawer(type)
if (confirmClosable) {
closeDrawer(type)
}
}

const cancelEvent = (evnt: Event) => {
const { cancelClosable } = props
const type = 'cancel'
dispatchEvent(type, { type }, evnt)
closeDrawer(type)
if (cancelClosable) {
closeDrawer(type)
}
}

const openDrawer = () => {
Expand Down
18 changes: 16 additions & 2 deletions packages/modal/src/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ export default defineComponent({
type: Boolean as PropType<VxeModalPropTypes.EscClosable>,
default: () => getConfig().modal.escClosable
},
cancelClosable: {
type: Boolean as PropType<VxeModalPropTypes.CancelClosable>,
default: () => getConfig().modal.cancelClosable
},
confirmClosable: {
type: Boolean as PropType<VxeModalPropTypes.ConfirmClosable>,
default: () => getConfig().modal.confirmClosable
},
resize: Boolean as PropType<VxeModalPropTypes.Resize>,
showHeader: {
type: Boolean as PropType<VxeModalPropTypes.ShowHeader>,
Expand Down Expand Up @@ -367,15 +375,21 @@ export default defineComponent({
}

const confirmEvent = (evnt: Event) => {
const { confirmClosable } = props
const type = 'confirm'
dispatchEvent(type, { type }, evnt)
closeModal(type)
if (confirmClosable) {
closeModal(type)
}
}

const cancelEvent = (evnt: Event) => {
const { cancelClosable } = props
const type = 'cancel'
dispatchEvent(type, { type }, evnt)
closeModal(type)
if (cancelClosable) {
closeModal(type)
}
}

const getStorageMap = (key: string) => {
Expand Down
6 changes: 5 additions & 1 deletion packages/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ setConfig({
mask: true,
showTitleOverflow: true,
showClose: true,
padding: true
padding: true,
cancelClosable: true,
confirmClosable: true
},
form: {
// preventSubmit: false,
Expand Down Expand Up @@ -181,6 +183,8 @@ setConfig({
padding: true,
draggable: true,
showConfirmButton: null,
cancelClosable: true,
confirmClosable: true,
zoomConfig: {
minimizeMaxSize: 10,
minimizeVerticalOffset: {
Expand Down
15 changes: 9 additions & 6 deletions styles/components/form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@
.vxe-form--item-content {
display: flex;
flex-direction: row;
align-items: flex-start;
align-items: center;
position: relative;
flex-grow: 1;
word-break: break-all;
}
.vxe-form--group-content {
align-items: flex-start;
}

.vxe-form--item-trigger-node {
font-size: 12px;
Expand Down Expand Up @@ -203,6 +206,11 @@
}
}
}
&.is--tbg {
& > .vxe-form--item-title {
background-color: var(--vxe-ui-form-title-background-color);
}
}
&.is--vertical {
flex-direction: column;
align-items: initial;
Expand Down Expand Up @@ -382,11 +390,6 @@
}
}
}
&.is--tbg {
& > .vxe-form--item-title {
background-color: var(--vxe-ui-form-title-background-color);
}
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions types/components/drawer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export namespace VxeDrawerPropTypes {
export type Mask = boolean
export type MaskClosable = boolean
export type EscClosable = boolean
export type CancelClosable = boolean
export type ConfirmClosable = boolean
export type ShowHeader = boolean
export type ShowFooter = boolean
export type ShowClose = boolean
Expand Down Expand Up @@ -82,6 +84,8 @@ export interface VxeDrawerProps {
mask?: VxeDrawerPropTypes.Mask
maskClosable?: VxeDrawerPropTypes.MaskClosable
escClosable?: VxeDrawerPropTypes.EscClosable
cancelClosable?: VxeDrawerPropTypes.CancelClosable
confirmClosable?: VxeDrawerPropTypes.ConfirmClosable
showHeader?: VxeDrawerPropTypes.ShowHeader
showFooter?: VxeDrawerPropTypes.ShowFooter
showClose?: VxeDrawerPropTypes.ShowClose
Expand Down
4 changes: 4 additions & 0 deletions types/components/modal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export namespace VxeModalPropTypes {
export type Mask = boolean
export type MaskClosable = boolean
export type EscClosable = boolean
export type CancelClosable = boolean
export type ConfirmClosable = boolean
export type Resize = boolean
export type ShowHeader = boolean
export type ShowFooter = boolean
Expand Down Expand Up @@ -143,6 +145,8 @@ export interface VxeModalProps {
mask?: VxeModalPropTypes.Mask
maskClosable?: VxeModalPropTypes.MaskClosable
escClosable?: VxeModalPropTypes.EscClosable
cancelClosable?: VxeModalPropTypes.CancelClosable
confirmClosable?: VxeModalPropTypes.ConfirmClosable
resize?: VxeModalPropTypes.Resize
showHeader?: VxeModalPropTypes.ShowHeader
showFooter?: VxeModalPropTypes.ShowFooter
Expand Down

0 comments on commit 188fd72

Please sign in to comment.