diff --git a/src/runtime/components/CommandPalette.vue b/src/runtime/components/CommandPalette.vue index bb51dbff7f..b718830c62 100644 --- a/src/runtime/components/CommandPalette.vue +++ b/src/runtime/components/CommandPalette.vue @@ -81,7 +81,7 @@ export interface CommandPaletteProps = CommandP * @defaultValue appConfig.ui.icons.chevronRight * @IconifyIcon */ - trailingIcon?: IconProps['name'] + itemTrailingIcon?: IconProps['name'] /** * The placeholder text for the input. * @defaultValue t('commandPalette.placeholder') @@ -92,6 +92,12 @@ export interface CommandPaletteProps = CommandP * @defaultValue true */ autofocus?: boolean + /** + * The icon displayed in the input. + * @defaultValue appConfig.ui.icons.search + * @IconifyIcon + */ + trailingIcon?: string /** * Display a close button in the input (useful when inside a Modal for example). * `{ size: 'md', color: 'neutral', variant: 'ghost' }`{lang="ts-type"} @@ -167,6 +173,7 @@ export type CommandPaletteSlots = CommandPalett 'empty'(props: { searchTerm?: string }): any 'footer'(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): any 'back'(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): any + 'actions'(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): any 'close'(props: { ui: { [K in keyof Required]: (props?: Record) => string } }): any 'item': SlotProps 'item-leading': SlotProps @@ -437,6 +444,7 @@ function onSelect(e: Event, item: T) { v-bind="inputProps" :loading-icon="loadingIcon" :icon="icon || appConfig.ui.icons.search" + :trailing-icon="trailingIcon" :class="ui.input({ class: props.ui?.input })" @keydown.backspace="onBackspace" > @@ -454,7 +462,9 @@ function onSelect(e: Event, item: T) { -