chore(components): improve props

This commit is contained in:
Benjamin Canac
2024-06-28 18:13:03 +02:00
parent c9f9a248b7
commit 673064dee5
38 changed files with 260 additions and 137 deletions

View File

@@ -39,33 +39,33 @@ export interface CommandPaletteGroup<T> {
export interface CommandPaletteProps<G, T> extends Pick<ComboboxRootProps, 'as' | 'multiple' | 'disabled' | 'modelValue' | 'defaultValue'>, Pick<UseComponentIconsProps, 'loading' | 'loadingIcon'> {
/**
* The icon displayed in the input.
* @defaultValue `appConfig.ui.icons.search`
* @defaultValue appConfig.ui.icons.search
*/
icon?: string
/**
* The icon displayed when an item is selected.
* @defaultValue `appConfig.ui.icons.check`
* @defaultValue appConfig.ui.icons.check
*/
selectedIcon?: string
/**
* The placeholder text for the input.
* @defaultValue `'Type a command or search...'`
* @defaultValue 'Type a command or search...'
*/
placeholder?: InputProps['placeholder']
/**
* Display a close button in the input (useful when inside a `UModal`).
* @defaultValue `false` (`{ size: 'md', color: 'gray', variant: 'ghost' }`)
* @defaultValue false ({ size: 'md', color: 'gray', variant: 'ghost' })
*/
close?: ButtonProps | boolean
/**
* The icon displayed in the close button.
* @defaultValue `appConfig.ui.icons.close`
* @defaultValue appConfig.ui.icons.close
*/
closeIcon?: string
groups?: G[]
/**
* Options for [useFuse](https://vueuse.org/integrations/useFuse).
* @defaultValue `{ ignoreLocation: true, threshold: 0.1, keys: ['label', 'suffix'], resultLimit: 12, matchAllWhenSearchEmpty: true }`
* @defaultValue { ignoreLocation: true, threshold: 0.1, keys: ['label', 'suffix'], resultLimit: 12, matchAllWhenSearchEmpty: true }
*/
fuse?: UseFuseOptions<T>
class?: any