Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
deae9ec
feat(CommandPalette): add `input-trailing-icon` prop and slot
HugoRCD Jun 25, 2025
b3e8852
up
HugoRCD Jun 25, 2025
801375d
Merge remote-tracking branch 'origin/v3' into feat/3880
HugoRCD Jul 1, 2025
48077c1
Merge branch 'v3' into feat/3880
HugoRCD Jul 2, 2025
7be03e0
Merge branch 'v3' into feat/3880
HugoRCD Jul 3, 2025
c82828d
up
HugoRCD Jul 3, 2025
c025fbf
up
HugoRCD Jul 3, 2025
c3ec805
up
HugoRCD Jul 3, 2025
203a36a
Merge remote-tracking branch 'origin/v3' into feat/3880
HugoRCD Jul 8, 2025
d6fe4dc
up
HugoRCD Jul 8, 2025
0bc7158
Merge branch 'v3' into feat/3880
HugoRCD Jul 21, 2025
3635fad
up
HugoRCD Jul 21, 2025
b559d4f
Merge branch 'v3' into feat/3880
HugoRCD Aug 4, 2025
5b712cc
up
HugoRCD Aug 4, 2025
9ffacce
Merge remote-tracking branch 'origin/v4' into feat/3880
HugoRCD Oct 9, 2025
910cce6
fix tests
HugoRCD Oct 9, 2025
93184c1
Merge remote-tracking branch 'origin/v4' into feat/3880
HugoRCD Oct 10, 2025
0f0202b
update itemTrailingIcon to childrenIcon
HugoRCD Oct 10, 2025
7360b77
add documentation example
HugoRCD Oct 10, 2025
2863ad9
Merge branch 'v4' into feat/3880
HugoRCD Oct 10, 2025
0621b27
up
HugoRCD Oct 10, 2025
04429a0
Merge remote-tracking branch 'origin/v4' into feat/3880
HugoRCD Oct 15, 2025
2cf800b
Merge remote-tracking branch 'origin/v4' into feat/3880
HugoRCD Oct 20, 2025
1943fb5
fix tests
HugoRCD Oct 20, 2025
c6b2945
Merge remote-tracking branch 'origin/v4' into feat/3880
HugoRCD Oct 20, 2025
03b6873
remove actions slot
HugoRCD Oct 20, 2025
4613a73
up
HugoRCD Oct 21, 2025
fb72859
Merge remote-tracking branch 'origin/v4' into feat/3880
HugoRCD Oct 21, 2025
72c4ba5
fix test
HugoRCD Oct 21, 2025
5cc5da9
fix agent review
HugoRCD Oct 21, 2025
f9bd5c3
Remove children-icon prop from command-palette.vue
HugoRCD Oct 21, 2025
750df69
use trailing-icon prop
benjamincanac Oct 21, 2025
bcf3e2f
test: update snapshots
benjamincanac Oct 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/runtime/components/CommandPalette.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export interface CommandPaletteProps<G extends CommandPaletteGroup<T> = CommandP
* @IconifyIcon
*/
icon?: IconProps['name']
/**
* The icon displayed on the right side of the input.
* @defaultValue appConfig.ui.icons.search
* @IconifyIcon
*/
trailingIcon?: IconProps['name']
/**
* The icon displayed when an item is selected.
* @defaultValue appConfig.ui.icons.check
Expand All @@ -82,7 +88,7 @@ export interface CommandPaletteProps<G extends CommandPaletteGroup<T> = CommandP
* @defaultValue appConfig.ui.icons.chevronRight
* @IconifyIcon
*/
trailingIcon?: IconProps['name']
childrenIcon?: IconProps['name']
/**
* The placeholder text for the input.
* @defaultValue t('commandPalette.placeholder')
Expand Down Expand Up @@ -423,7 +429,7 @@ function onSelect(e: Event, item: T) {
<slot :name="((item.slot ? `${item.slot}-trailing` : group?.slot ? `${group.slot}-trailing` : `item-trailing`) as keyof CommandPaletteSlots<G, T>)" :item="(item as any)" :index="index" :ui="ui">
<UIcon
v-if="item.children && item.children.length > 0"
:name="trailingIcon || appConfig.ui.icons.chevronRight"
:name="childrenIcon || appConfig.ui.icons.chevronRight"
:class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, item.ui?.itemTrailingIcon] })"
/>

Expand Down Expand Up @@ -452,6 +458,7 @@ function onSelect(e: Event, item: T) {
:autofocus="autofocus"
v-bind="inputProps"
:loading-icon="loadingIcon"
:trailing-icon="trailingIcon"
:icon="icon || appConfig.ui.icons.search"
:class="ui.input({ class: props.ui?.input })"
@keydown.backspace="onBackspace"
Expand Down
2 changes: 2 additions & 0 deletions test/components/CommandPalette.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ describe('CommandPalette', () => {
['with placeholder', { props: { ...props, placeholder: 'Search...' } }],
['with disabled', { props: { ...props, disabled: true } }],
['with icon', { props: { ...props, icon: 'i-lucide-terminal' } }],
['with trailingIcon', { props: { ...props, trailingIcon: 'i-lucide-settings' } }],
['with childrenIcon', { props: { ...props, childrenIcon: 'i-lucide-arrow-right' } }],
['with loading', { props: { ...props, loading: true } }],
['with loadingIcon', { props: { ...props, loading: true, loadingIcon: 'i-lucide-loader' } }],
['with selectedIcon', { props: { ...props, selectedIcon: 'i-lucide-badge-check', modelValue: groups[2]?.items[0] } }],
Expand Down
Loading
Loading