-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
feat(VCommandPalette): add new command palette component #22403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
- Added VCommandPalette component for a keyboard-driven command interface. - Implemented props for items, search, hotkeys, and dialog configuration. - Included examples and documentation for usage, API, and accessibility features. - Enhanced navigation and filtering capabilities
- Removed unnecessary comments in VCommandPalette and its related files. - Updated slot descriptions in VList.json for better guidance. - Changes to useCommandPaletteNavigation for improved item selection. - Simplified props handling in VCommandPaletteItem
- Simplified item rendering logic in VCommandPaletteItemComponent. - Enhanced navigation logic to prevent unnecessary index resets in useCommandPaletteNavigation.
- Revised localization strings for clarity and conciseness in VCommandPalette.json. - Updated examples and documentation to reflect changes in hotkey usage and item properties. - Improved descriptions for props, events, and slots in the command palette documentation.
J-Sek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how slim it got. Great job.
These are just some quick comments.
Hopefully, I will have some time next week to go through examples and maybe add some more.
| prependInnerIcon="mdi-magnify" | ||
| singleLine | ||
| hideDetails | ||
| variant="solo" | ||
| flat | ||
| bgColor="transparent" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably supplement a slot #input and input-icon prop
| > | ||
| { slots.prepend?.() } | ||
|
|
||
| <div class="px-4 py-2"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v-command-palette__input-container?
Hard to name it, but we need some class to push the padding to Scss
| key={ `item-${props.index}` } | ||
| item={ props } | ||
| index={ props.index } | ||
| onExecute={ navigation.executeSelected } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat wrong - assumes the item is selected, but gets passed down directly to onClick inside.. clearly a bug when I mouse-click on an unselected item (the selected is executed instead).
I'd probably just bind straight to onClick here and call navigation.execute(props.item.key) or *.index if we are sure it will never be virtualized (or out of sync for any reason).
| }} | ||
| /> | ||
| ) : ( | ||
| <div key="no-data" class="pa-4 text-center text-disabled"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v-command-palette__no-data to push the utilities to Scss
- Added `inputIcon` property to customize the search input icon in VCommandPalette. - Introduced custom input slot for more flexible search input implementations. - Updated styles for input container and no-data display for improved UI consistency.
- Implemented cleanup for the hotkey listener to prevent memory leaks. - Added `onUnmounted` lifecycle hook to clear the DOM reference and unsubscribe from hotkey events.
Description
Adds a new VCommandPalette component
Markup: