mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-21 15:31:46 +01:00
docs: improve props types (#588)
This commit is contained in:
@@ -58,7 +58,7 @@ import ULink from '../elements/Link.vue'
|
||||
import { usePopper } from '../../composables/usePopper'
|
||||
import { defuTwMerge } from '../../utils'
|
||||
import type { DropdownItem } from '../../types/dropdown'
|
||||
import type { PopperOptions } from '../../types'
|
||||
import type { PopperOptions } from '../../types/popper'
|
||||
import { useAppConfig } from '#imports'
|
||||
// TODO: Remove
|
||||
// @ts-expect-error
|
||||
@@ -84,11 +84,9 @@ export default defineComponent({
|
||||
default: () => []
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
type: String as PropType<'click' | 'hover'>,
|
||||
default: 'click',
|
||||
validator: (value: string) => {
|
||||
return ['click', 'hover'].includes(value)
|
||||
}
|
||||
validator: (value: string) => ['click', 'hover'].includes(value)
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { useEventBus } from '@vueuse/core'
|
||||
import type { ZodSchema } from 'zod'
|
||||
import type { ValidationError as JoiError, Schema as JoiSchema } from 'joi'
|
||||
import type { ObjectSchema as YupObjectSchema, ValidationError as YupError } from 'yup'
|
||||
import type { FormError, FormEvent, FormEventType, FormSubmitEvent, Form } from '../../types'
|
||||
import type { FormError, FormEvent, FormEventType, FormSubmitEvent, Form } from '../../types/form'
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
|
||||
@@ -23,7 +23,7 @@ import { computed, defineComponent, provide, inject } from 'vue'
|
||||
import type { PropType } from 'vue'
|
||||
import { omit } from 'lodash-es'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
import type { FormError } from '../../types'
|
||||
import type { FormError } from '../../types/form'
|
||||
import { defuTwMerge } from '../../utils'
|
||||
import { useAppConfig } from '#imports'
|
||||
// TODO: Remove
|
||||
|
||||
@@ -138,7 +138,7 @@ import UAvatar from '../elements/Avatar.vue'
|
||||
import { defuTwMerge } from '../../utils'
|
||||
import { usePopper } from '../../composables/usePopper'
|
||||
import { useFormGroup } from '../../composables/useFormGroup'
|
||||
import type { PopperOptions } from '../../types'
|
||||
import type { PopperOptions } from '../../types/popper'
|
||||
import { useAppConfig } from '#imports'
|
||||
// TODO: Remove
|
||||
// @ts-expect-error
|
||||
|
||||
@@ -173,7 +173,7 @@ export default defineComponent({
|
||||
default: 200
|
||||
},
|
||||
fuse: {
|
||||
type: Object as PropType<Partial<UseFuseOptions<Command>>>,
|
||||
type: Object as PropType<UseFuseOptions<Command>>,
|
||||
default: () => ({})
|
||||
},
|
||||
ui: {
|
||||
|
||||
@@ -18,7 +18,7 @@ import { omit } from 'lodash-es'
|
||||
import { twMerge, twJoin } from 'tailwind-merge'
|
||||
import { usePopper } from '../../composables/usePopper'
|
||||
import { defuTwMerge } from '../../utils'
|
||||
import type { PopperOptions } from '../../types'
|
||||
import type { PopperOptions } from '../../types/popper'
|
||||
import { useAppConfig } from '#imports'
|
||||
// TODO: Remove
|
||||
// @ts-expect-error
|
||||
|
||||
@@ -47,7 +47,7 @@ import UIcon from '../elements/Icon.vue'
|
||||
import UAvatar from '../elements/Avatar.vue'
|
||||
import UButton from '../elements/Button.vue'
|
||||
import { useTimer } from '../../composables/useTimer'
|
||||
import type { NotificationAction } from '../../types'
|
||||
import type { NotificationAction } from '../../types/notification'
|
||||
import type { Avatar } from '../../types/avatar'
|
||||
import type { Button } from '../../types/button'
|
||||
import { defuTwMerge } from '../../utils'
|
||||
|
||||
@@ -25,7 +25,7 @@ import { twMerge, twJoin } from 'tailwind-merge'
|
||||
import UNotification from './Notification.vue'
|
||||
import { useToast } from '../../composables/useToast'
|
||||
import { defuTwMerge } from '../../utils'
|
||||
import type { Notification } from '../../types'
|
||||
import type { Notification } from '../../types/notification'
|
||||
import { useState, useAppConfig } from '#imports'
|
||||
// TODO: Remove
|
||||
// @ts-expect-error
|
||||
|
||||
@@ -34,7 +34,7 @@ import { twMerge } from 'tailwind-merge'
|
||||
import { Popover as HPopover, PopoverButton as HPopoverButton, PopoverPanel as HPopoverPanel } from '@headlessui/vue'
|
||||
import { usePopper } from '../../composables/usePopper'
|
||||
import { defuTwMerge } from '../../utils'
|
||||
import type { PopperOptions } from '../../types'
|
||||
import type { PopperOptions } from '../../types/popper'
|
||||
import { useAppConfig } from '#imports'
|
||||
// TODO: Remove
|
||||
// @ts-expect-error
|
||||
@@ -51,11 +51,9 @@ export default defineComponent({
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
mode: {
|
||||
type: String,
|
||||
type: String as PropType<'click' | 'hover'>,
|
||||
default: 'click',
|
||||
validator: (value: string) => {
|
||||
return ['click', 'hover'].includes(value)
|
||||
}
|
||||
validator: (value: string) => ['click', 'hover'].includes(value)
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
|
||||
@@ -46,7 +46,7 @@ export default defineComponent({
|
||||
default: false
|
||||
},
|
||||
side: {
|
||||
type: String,
|
||||
type: String as PropType<'left' | 'right'>,
|
||||
default: 'right',
|
||||
validator: (value: string) => ['left', 'right'].includes(value)
|
||||
},
|
||||
|
||||
@@ -32,7 +32,7 @@ import { twMerge } from 'tailwind-merge'
|
||||
import UKbd from '../elements/Kbd.vue'
|
||||
import { usePopper } from '../../composables/usePopper'
|
||||
import { defuTwMerge } from '../../utils'
|
||||
import type { PopperOptions } from '../../types'
|
||||
import type { PopperOptions } from '../../types/popper'
|
||||
import { useAppConfig } from '#imports'
|
||||
// TODO: Remove
|
||||
// @ts-expect-error
|
||||
|
||||
Reference in New Issue
Block a user