2025-12-10 20:52:44 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { SelectTrigger as SelectTriggerPrimitive } from 'radix-vue'
|
|
|
|
|
import { ChevronDown } from 'lucide-vue-next'
|
|
|
|
|
import { cn } from '@/lib/utils'
|
|
|
|
|
import { computed } from 'vue'
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
class?: string
|
|
|
|
|
disabled?: boolean
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const props = defineProps<Props>()
|
|
|
|
|
|
|
|
|
|
const triggerClass = computed(() =>
|
|
|
|
|
cn(
|
2026-09-07 08:53:51 +08:00
|
|
|
'flex h-11 w-full min-w-0 items-center justify-between gap-2 rounded-2xl border border-border/60 bg-card/80 px-4 py-2 text-left text-sm shadow-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/60 disabled:cursor-not-allowed disabled:opacity-50 text-foreground cursor-pointer backdrop-blur transition-all',
|
2025-12-10 20:52:44 +08:00
|
|
|
props.class
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<SelectTriggerPrimitive
|
|
|
|
|
v-bind="$attrs"
|
|
|
|
|
:class="triggerClass"
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
>
|
2026-09-07 08:53:51 +08:00
|
|
|
<span class="min-w-0 flex-1 truncate">
|
2026-02-05 20:13:41 +08:00
|
|
|
<slot />
|
|
|
|
|
</span>
|
|
|
|
|
<ChevronDown class="h-4 w-4 opacity-50 pointer-events-none flex-shrink-0" />
|
2025-12-10 20:52:44 +08:00
|
|
|
</SelectTriggerPrimitive>
|
|
|
|
|
</template>
|