fix(Modal/Popover/Slideover)!: rename prevent-close to dismissible + uniformize docs

This commit is contained in:
Benjamin Canac
2024-12-16 13:11:10 +01:00
parent fdaff6630f
commit 6fb426fc17
10 changed files with 148 additions and 73 deletions

View File

@@ -46,10 +46,10 @@ export interface SlideoverProps extends DialogRootProps {
*/
closeIcon?: string
/**
* When `true`, the slideover will not close when clicking outside.
* @defaultValue false
* When `false`, the slideover will not close when clicking outside or pressing escape.
* @defaultValue true
*/
preventClose?: boolean
dismissible?: boolean
class?: any
ui?: Partial<typeof slideover.slots>
}
@@ -84,6 +84,7 @@ const props = withDefaults(defineProps<SlideoverProps>(), {
overlay: true,
transition: true,
modal: true,
dismissible: true,
side: 'right'
})
const emits = defineEmits<SlideoverEmits>()
@@ -95,7 +96,7 @@ const appConfig = useAppConfig()
const rootProps = useForwardPropsEmits(reactivePick(props, 'open', 'defaultOpen', 'modal'), emits)
const contentProps = toRef(() => props.content)
const contentEvents = computed(() => {
if (props.preventClose) {
if (!props.dismissible) {
return {
pointerDownOutside: (e: Event) => e.preventDefault(),
interactOutside: (e: Event) => e.preventDefault(),