55 lines
1006 B
Vue
55 lines
1006 B
Vue
<script setup lang="ts">
|
|||
|
|
import UiIcon from '@/components/UiIcon.vue';
|
||
|
|
|
||
|
|
defineProps<{
|
||
|
|
disabled?: boolean;
|
||
|
|
}>();
|
||
|
|
|
||
|
|
const model = defineModel<string>({ default: '' });
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<label class="ui-select">
|
||
|
|
<select v-model="model" :disabled="disabled">
|
||
|
|
<slot />
|
||
|
|
</select>
|
||
|
|
<UiIcon class="chev" name="chevron" :size="16" />
|
||
|
|
</label>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<style scoped>
|
||
|
|
.ui-select {
|
||
|
|
position: relative;
|
||
|
|
display: block;
|
||
|
|
min-width: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.ui-select select {
|
||
|
|
appearance: none;
|
||
|
|
width: 100%;
|
||
|
|
min-height: var(--control-h);
|
||
|
|
padding: 0 2rem 0 0.85rem;
|
||
|
|
border: 1px solid var(--line);
|
||
|
|
border-radius: var(--radius);
|
||
|
|
background: #fff;
|
||
|
|
color: var(--ink);
|
||
|
|
font: inherit;
|
||
|
|
font-weight: 600;
|
||
|
|
cursor: pointer;
|
||
|
|
}
|
||
|
|
|
||
|
|
.ui-select select:focus {
|
||
|
|
outline: 2px solid var(--accent-soft);
|
||
|
|
border-color: var(--accent);
|
||
|
|
}
|
||
|
|
|
||
|
|
.chev {
|
||
|
|
position: absolute;
|
||
|
|
left: 0.65rem;
|
||
|
|
top: 50%;
|
||
|
|
color: var(--muted);
|
||
|
|
pointer-events: none;
|
||
|
|
transform: translateY(-50%) rotate(-90deg);
|
||
|
|
}
|
||
|
|
</style>
|