feat(components): add new content-top and content-bottom slots (#3886)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Guillaume Chau
2025-04-23 11:02:50 +02:00
committed by GitHub
parent 9ca213bd33
commit 1a46394668
9 changed files with 36 additions and 8 deletions

View File

@@ -162,6 +162,8 @@ export interface InputMenuSlots<
'item-trailing': SlotProps<T>
'tags-item-text': SlotProps<T>
'tags-item-delete': SlotProps<T>
'content-top': (props?: {}) => any
'content-bottom': (props?: {}) => any
'create-item-label'(props: { item: string }): any
}
</script>
@@ -478,6 +480,8 @@ defineExpose({
<ComboboxPortal v-bind="portalProps">
<ComboboxContent :class="ui.content({ class: props.ui?.content })" v-bind="contentProps">
<slot name="content-top" />
<ComboboxEmpty :class="ui.empty({ class: props.ui?.empty })">
<slot name="empty" :search-term="searchTerm">
{{ searchTerm ? t('inputMenu.noMatch', { searchTerm }) : t('inputMenu.noData') }}
@@ -537,6 +541,8 @@ defineExpose({
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'bottom'" />
</ComboboxViewport>
<slot name="content-bottom" />
<ComboboxArrow v-if="!!arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" />
</ComboboxContent>
</ComboboxPortal>