feat: 为Select组件实现DaisyUI样式
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Select as BitsSelect, type WithoutChildren } from 'bits-ui';
|
||||
import { elasticOut, cubicOut } from 'svelte/easing';
|
||||
import { cubicOut } from 'svelte/easing';
|
||||
|
||||
type Props = WithoutChildren<BitsSelect.ContentProps> & {
|
||||
items: { value: string; label: string; disabled?: boolean }[];
|
||||
@ -21,7 +21,7 @@
|
||||
) {
|
||||
const {
|
||||
delay = 0,
|
||||
duration = 1000,
|
||||
duration = 200,
|
||||
easing = cubicOut,
|
||||
y = -6,
|
||||
start = 0.95,
|
||||
@ -59,11 +59,7 @@ transform: ${existingTransform} ${translate} ${scale};
|
||||
{#snippet child({ wrapperProps, props, open })}
|
||||
{#if open}
|
||||
<div {...wrapperProps}>
|
||||
<div
|
||||
{...props}
|
||||
in:selectTransition={{ easing: elasticOut }}
|
||||
out:selectTransition={{ duration: 200 }}
|
||||
>
|
||||
<div {...props} transition:selectTransition>
|
||||
<BitsSelect.ScrollUpButton>up</BitsSelect.ScrollUpButton>
|
||||
<BitsSelect.Viewport class="p-1">
|
||||
{#each items as { value, label, disabled } (value)}
|
||||
|
||||
Reference in New Issue
Block a user