diff --git a/src/runtime/components/CommandPalette.vue b/src/runtime/components/CommandPalette.vue index 73c7a23c09..386a509537 100644 --- a/src/runtime/components/CommandPalette.vue +++ b/src/runtime/components/CommandPalette.vue @@ -80,7 +80,7 @@ export interface CommandPaletteProps = CommandP * @defaultValue appConfig.ui.icons.chevronRight * @IconifyIcon */ - trailingIcon?: string + itemTrailingIcon?: string /** * The placeholder text for the input. * @defaultValue t('commandPalette.placeholder') @@ -91,6 +91,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"} @@ -149,6 +155,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 @@ -337,6 +344,7 @@ function onSelect(e: Event, item: T) { :autofocus="autofocus" v-bind="inputProps" :icon="icon || appConfig.ui.icons.search" + :trailing-icon="trailingIcon" :class="ui.input({ class: props.ui?.input })" @keydown.backspace="onBackspace" > @@ -354,7 +362,9 @@ function onSelect(e: Event, item: T) { -