|
|
|
|
@ -10,6 +10,7 @@ import {
|
|
|
|
|
} from '@vben-core/composables';
|
|
|
|
|
import { X } from '@vben-core/icons';
|
|
|
|
|
import {
|
|
|
|
|
Separator,
|
|
|
|
|
Sheet,
|
|
|
|
|
SheetClose,
|
|
|
|
|
SheetContent,
|
|
|
|
|
@ -33,6 +34,7 @@ interface Props extends DrawerProps {
|
|
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
|
|
appendToMain: false,
|
|
|
|
|
closeIconPlacement: 'right',
|
|
|
|
|
drawerApi: undefined,
|
|
|
|
|
zIndex: 1000,
|
|
|
|
|
});
|
|
|
|
|
@ -155,11 +157,29 @@ const getAppendTo = computed(() => {
|
|
|
|
|
headerClass,
|
|
|
|
|
{
|
|
|
|
|
'px-4 py-3': closable,
|
|
|
|
|
'pl-2': closable && closeIconPlacement === 'left',
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="flex items-center">
|
|
|
|
|
<SheetClose
|
|
|
|
|
v-if="closable && closeIconPlacement === 'left'"
|
|
|
|
|
as-child
|
|
|
|
|
class="data-[state=open]:bg-secondary ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none"
|
|
|
|
|
>
|
|
|
|
|
<slot name="close-icon">
|
|
|
|
|
<VbenIconButton>
|
|
|
|
|
<X class="size-4" />
|
|
|
|
|
</VbenIconButton>
|
|
|
|
|
</slot>
|
|
|
|
|
</SheetClose>
|
|
|
|
|
<Separator
|
|
|
|
|
v-if="closable && closeIconPlacement === 'left'"
|
|
|
|
|
class="ml-1 mr-2 h-8"
|
|
|
|
|
decorative
|
|
|
|
|
orientation="vertical"
|
|
|
|
|
/>
|
|
|
|
|
<SheetTitle v-if="title" class="text-left">
|
|
|
|
|
<slot name="title">
|
|
|
|
|
{{ title }}
|
|
|
|
|
@ -184,13 +204,15 @@ const getAppendTo = computed(() => {
|
|
|
|
|
<div class="flex-center">
|
|
|
|
|
<slot name="extra"></slot>
|
|
|
|
|
<SheetClose
|
|
|
|
|
v-if="closable"
|
|
|
|
|
v-if="closable && closeIconPlacement === 'right'"
|
|
|
|
|
as-child
|
|
|
|
|
class="data-[state=open]:bg-secondary ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none"
|
|
|
|
|
>
|
|
|
|
|
<VbenIconButton>
|
|
|
|
|
<X class="size-4" />
|
|
|
|
|
</VbenIconButton>
|
|
|
|
|
<slot name="close-icon">
|
|
|
|
|
<VbenIconButton>
|
|
|
|
|
<X class="size-4" />
|
|
|
|
|
</VbenIconButton>
|
|
|
|
|
</slot>
|
|
|
|
|
</SheetClose>
|
|
|
|
|
</div>
|
|
|
|
|
</SheetHeader>
|
|
|
|
|
|