chore: update vue-input-otp

This commit is contained in:
Sadegh Barati 2024-03-08 19:26:50 +03:30
parent b4b5af7898
commit 46a363e682
4 changed files with 15 additions and 11 deletions

View File

@ -37,7 +37,7 @@
"vaul-vue": "^0.1.0", "vaul-vue": "^0.1.0",
"vee-validate": "4.12.5", "vee-validate": "4.12.5",
"vue": "^3.4.21", "vue": "^3.4.21",
"vue-input-otp": "^0.0.11", "vue-input-otp": "^0.1.0",
"vue-sonner": "^1.1.2", "vue-sonner": "^1.1.2",
"vue-wrap-balancer": "^1.1.3", "vue-wrap-balancer": "^1.1.3",
"zod": "^3.22.4" "zod": "^3.22.4"

View File

@ -1,19 +1,21 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue' import { type HTMLAttributes, computed } from 'vue'
import type { OTPInputProps } from 'vue-input-otp' import type { OTPInputEmits, OTPInputProps } from 'vue-input-otp'
import { OTPInput } from 'vue-input-otp' import { OTPInput } from 'vue-input-otp'
import { useForwardProps } from 'radix-vue' import { useForwardPropsEmits } from 'radix-vue'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
const props = defineProps<OTPInputProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<OTPInputProps & { class?: HTMLAttributes['class'] }>()
const emits = defineEmits<OTPInputEmits>()
const delegatedProps = computed(() => { const delegatedProps = computed(() => {
const { class: _, ...delegated } = props const { class: _, ...delegated } = props
return delegated return delegated
}) })
const forwardedProps = useForwardProps(delegatedProps) const forwardedProps = useForwardPropsEmits(delegatedProps, emits)
</script> </script>
<template> <template>

View File

@ -1,19 +1,21 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue' import { type HTMLAttributes, computed } from 'vue'
import type { OTPInputProps } from 'vue-input-otp' import type { OTPInputEmits, OTPInputProps } from 'vue-input-otp'
import { OTPInput } from 'vue-input-otp' import { OTPInput } from 'vue-input-otp'
import { useForwardProps } from 'radix-vue' import { useForwardPropsEmits } from 'radix-vue'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
const props = defineProps<OTPInputProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<OTPInputProps & { class?: HTMLAttributes['class'] }>()
const emits = defineEmits<OTPInputEmits>()
const delegatedProps = computed(() => { const delegatedProps = computed(() => {
const { class: _, ...delegated } = props const { class: _, ...delegated } = props
return delegated return delegated
}) })
const forwardedProps = useForwardProps(delegatedProps) const forwardedProps = useForwardPropsEmits(delegatedProps, emits)
</script> </script>
<template> <template>

View File

@ -108,8 +108,8 @@ importers:
specifier: ^3.4.21 specifier: ^3.4.21
version: 3.4.21(typescript@5.4.2) version: 3.4.21(typescript@5.4.2)
vue-input-otp: vue-input-otp:
specifier: ^0.0.11 specifier: ^0.1.0
version: 0.0.11(vue@3.4.21) version: 0.1.0(vue@3.4.21)
vue-sonner: vue-sonner:
specifier: ^1.1.2 specifier: ^1.1.2
version: 1.1.2 version: 1.1.2
@ -13638,8 +13638,8 @@ packages:
- supports-color - supports-color
dev: true dev: true
/vue-input-otp@0.0.11(vue@3.4.21): /vue-input-otp@0.1.0(vue@3.4.21):
resolution: {integrity: sha512-wy7e1zxB0R/QamWkB9lAvukVJJzQCsiUcx8Bws0Ezbh1OaddiF3wZRnk5hKKSB1Ohqv3VtWygRvB6lJTEcpJYg==} resolution: {integrity: sha512-vRkb/ECwMMPOH7YRFJBJ9lLhE3MiVuxNSqitY5l/KJ7FHzlMIjfyhAW2y9nkhE1NMY/kmtiusYjkNSfCVrFFTA==}
peerDependencies: peerDependencies:
vue: ^3.2.0 vue: ^3.2.0
dependencies: dependencies: