Skip to content

Commit 6b778ee

Browse files
committed
chore: rename prop/emit
1 parent 6b6b359 commit 6b778ee

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

Diff for: packages/vaul-vue/src/DrawerContent.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { computed, useAttrs, watch } from 'vue'
2+
import { computed, watch } from 'vue'
33
import { DialogContent } from 'radix-vue'
44
import { injectDrawerRootContext } from './context'
55
@@ -18,8 +18,6 @@ const {
1818
closeDrawer,
1919
} = injectDrawerRootContext()
2020
21-
const attrs = useAttrs()
22-
2321
const snapPointHeight = computed(() => {
2422
if (snapPointsOffset.value && snapPointsOffset.value.length > 0)
2523
return `${snapPointsOffset.value[0]}px`
@@ -60,7 +58,7 @@ watch(
6058
ref="drawerRef"
6159
vaul-drawer=""
6260
:vaul-drawer-visible="isVisible ? 'true' : 'false'"
63-
:style="[attrs.style, { '--snap-point-height': snapPointHeight }]"
61+
:style="{ '--snap-point-height': snapPointHeight }"
6462
@pointerdown="onPress"
6563
@pointermove="onDrag"
6664
@pointerup="onRelease"

Diff for: packages/vaul-vue/src/DrawerRoot.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { type WritableComputedRef, computed, toRefs } from 'vue'
55
import { provideDrawerRootContext } from './context'
66
import {
77
CLOSE_THRESHOLD,
8-
type DialogEmits,
9-
type DialogProps,
8+
type DrawerRootEmits,
9+
type DrawerRootProps,
1010
SCROLL_LOCK_TIMEOUT,
1111
useDrawer,
1212
} from './controls'
1313
14-
const props = withDefaults(defineProps<DialogProps>(), {
14+
const props = withDefaults(defineProps<DrawerRootProps>(), {
1515
open: undefined,
1616
fixed: undefined,
1717
dismissible: true,
@@ -25,7 +25,7 @@ const props = withDefaults(defineProps<DialogProps>(), {
2525
scrollLockTimeout: SCROLL_LOCK_TIMEOUT,
2626
})
2727
28-
const emit = defineEmits<DialogEmits>()
28+
const emit = defineEmits<DrawerRootEmits>()
2929
3030
const fadeFromIndex = computed(() => props.fadeFromIndex ?? (props.snapPoints && props.snapPoints.length - 1))
3131

Diff for: packages/vaul-vue/src/DrawerRootNested.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script setup lang="ts">
22
import { useForwardPropsEmits } from 'radix-vue'
33
import DrawerRoot from './DrawerRoot.vue'
4-
import type { DialogEmits, DialogProps } from './controls'
4+
import type { DrawerRootEmits, DrawerRootProps } from './controls'
55
import { injectDrawerRootContext } from './context'
66
7-
const props = defineProps<DialogProps>()
8-
const emits = defineEmits<DialogEmits>()
7+
const props = defineProps<DrawerRootProps>()
8+
const emits = defineEmits<DrawerRootEmits>()
99
1010
const { onNestedDrag, onNestedOpenChange, onNestedRelease } = injectDrawerRootContext()
1111
function onClose() {

Diff for: packages/vaul-vue/src/controls.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface WithoutFadeFromProps {
2828
fadeFromIndex?: never
2929
}
3030

31-
export type DialogProps = {
31+
export type DrawerRootProps = {
3232
activeSnapPoint?: number | string | null
3333
closeThreshold?: number
3434
shouldScaleBackground?: boolean
@@ -55,7 +55,7 @@ export interface UseDrawerProps {
5555
scrollLockTimeout: Ref<number>
5656
}
5757

58-
export interface DialogEmits {
58+
export interface DrawerRootEmits {
5959
(e: 'drag', percentageDragged: number): void
6060
(e: 'release', open: boolean): void
6161
(e: 'close'): void

0 commit comments

Comments
 (0)