|
@@ -20,6 +20,7 @@ import DialogOverlay from './DialogOverlay.vue';
|
|
|
const props = withDefaults(
|
|
|
defineProps<
|
|
|
DialogContentProps & {
|
|
|
+ animationType?: 'scale' | 'slide';
|
|
|
appendTo?: HTMLElement | string;
|
|
|
class?: ClassType;
|
|
|
closeClass?: ClassType;
|
|
@@ -31,7 +32,12 @@ const props = withDefaults(
|
|
|
zIndex?: number;
|
|
|
}
|
|
|
>(),
|
|
|
- { appendTo: 'body', closeDisabled: false, showClose: true },
|
|
|
+ {
|
|
|
+ appendTo: 'body',
|
|
|
+ animationType: 'slide',
|
|
|
+ closeDisabled: false,
|
|
|
+ showClose: true,
|
|
|
+ },
|
|
|
);
|
|
|
const emits = defineEmits<
|
|
|
DialogContentEmits & { close: []; closed: []; opened: [] }
|
|
@@ -43,6 +49,7 @@ const delegatedProps = computed(() => {
|
|
|
modal: _modal,
|
|
|
open: _open,
|
|
|
showClose: __,
|
|
|
+ animationType: ___,
|
|
|
...delegated
|
|
|
} = props;
|
|
|
|
|
@@ -100,7 +107,11 @@ defineExpose({
|
|
|
v-bind="forwarded"
|
|
|
:class="
|
|
|
cn(
|
|
|
- 'z-popup bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] w-full p-6 shadow-lg outline-none sm:rounded-xl',
|
|
|
+ 'z-popup bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 w-full p-6 shadow-lg outline-none sm:rounded-xl',
|
|
|
+ {
|
|
|
+ 'data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%]':
|
|
|
+ animationType === 'slide',
|
|
|
+ },
|
|
|
props.class,
|
|
|
)
|
|
|
"
|