mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 19:00:35 +01:00
feat(useOverlay)!: handle programmatic modals and slideovers (#3279)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -55,7 +55,9 @@ export interface SlideoverProps extends DialogRootProps {
|
||||
ui?: Partial<typeof slideover.slots>
|
||||
}
|
||||
|
||||
export interface SlideoverEmits extends DialogRootEmits {}
|
||||
export interface SlideoverEmits extends DialogRootEmits {
|
||||
'after:leave': []
|
||||
}
|
||||
|
||||
export interface SlideoverSlots {
|
||||
default(props: { open: boolean }): any
|
||||
@@ -126,7 +128,7 @@ const ui = computed(() => slideover({
|
||||
<DialogPortal :disabled="!portal">
|
||||
<DialogOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
|
||||
|
||||
<DialogContent :data-side="side" :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" v-on="contentEvents">
|
||||
<DialogContent :data-side="side" :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" @after-leave="emits('after:leave')" v-on="contentEvents">
|
||||
<VisuallyHidden v-if="!!slots.content && ((title || !!slots.title) || (description || !!slots.description))">
|
||||
<DialogTitle v-if="title || !!slots.title">
|
||||
<slot name="title">
|
||||
|
||||
Reference in New Issue
Block a user