mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-01 12:47:57 +01:00
chore(SelectCustom): add preset for empty option
This commit is contained in:
@@ -63,14 +63,16 @@
|
|||||||
<ComboboxOption v-if="queryOption" v-slot="{ active, selected }" :value="queryOption" as="template">
|
<ComboboxOption v-if="queryOption" v-slot="{ active, selected }" :value="queryOption" as="template">
|
||||||
<li :class="resolveOptionClass({ active, selected })">
|
<li :class="resolveOptionClass({ active, selected })">
|
||||||
<div :class="listOptionContainerClass">
|
<div :class="listOptionContainerClass">
|
||||||
<slot name="option" :option="queryOption" :active="active" :selected="selected">
|
<slot name="option-create" :option="queryOption" :active="active" :selected="selected">
|
||||||
<span class="block truncate">Create "{{ queryOption[textAttribute] }}"</span>
|
<span class="block truncate">Create "{{ queryOption[textAttribute] }}"</span>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ComboboxOption>
|
</ComboboxOption>
|
||||||
<p v-else-if="searchable && query" class="text-sm u-text-gray-400 px-4 py-2">
|
<p v-else-if="searchable && query" :class="listOptionEmptyClass">
|
||||||
No results found for "{{ query }}".
|
<slot name="option-empty" :query="query">
|
||||||
|
No results found for "{{ query }}".
|
||||||
|
</slot>
|
||||||
</p>
|
</p>
|
||||||
</ComboboxOptions>
|
</ComboboxOptions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -212,6 +214,10 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: () => $ui.selectCustom.list.option.disabled
|
default: () => $ui.selectCustom.list.option.disabled
|
||||||
},
|
},
|
||||||
|
listOptionEmptyClass: {
|
||||||
|
type: String,
|
||||||
|
default: () => $ui.selectCustom.list.option.empty
|
||||||
|
},
|
||||||
listOptionIcon: {
|
listOptionIcon: {
|
||||||
type: String,
|
type: String,
|
||||||
default: () => 'heroicons-solid:check'
|
default: () => 'heroicons-solid:check'
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ export default (variantColors: string[]) => {
|
|||||||
selected: 'font-semibold',
|
selected: 'font-semibold',
|
||||||
unselected: 'font-normal',
|
unselected: 'font-normal',
|
||||||
disabled: 'cursor-not-allowed opacity-50',
|
disabled: 'cursor-not-allowed opacity-50',
|
||||||
|
empty: 'text-sm u-text-gray-400 px-4 py-2',
|
||||||
icon: {
|
icon: {
|
||||||
base: 'absolute inset-y-0 right-0 flex items-center pr-4',
|
base: 'absolute inset-y-0 right-0 flex items-center pr-4',
|
||||||
active: 'text-white',
|
active: 'text-white',
|
||||||
|
|||||||
Reference in New Issue
Block a user