🧼 Updates inputs after svelte migration

This commit is contained in:
Rune Harlyk
2025-03-01 23:01:32 +01:00
committed by Rune Harlyk
parent 0b01634a20
commit 113ac1bc2c
2 changed files with 36 additions and 41 deletions
@@ -1,37 +1,34 @@
<script lang="ts"> <script lang="ts">
import { createBubbler } from 'svelte/legacy'; interface Props {
min?: number;
max?: number;
step?: number;
value?: any;
}
const bubble = createBubbler(); let {
interface Props { min = 0,
min?: number; max = 100,
max?: number; step = 1,
step?: number; value = $bindable((max - min) / 2),
value?: any; ...rest
} }: Props = $props();
let {
min = 0,
max = 100,
step = 1,
value = $bindable((max - min) / 2)
}: Props = $props();
</script> </script>
<input <input
type="range" type="range"
style="writing-mode: vertical-lr; direction: rtl" style="writing-mode: vertical-lr; direction: rtl"
class="cursor-pointer" class="cursor-pointer"
min={min} {min}
max={max} {max}
step={step} {step}
bind:value bind:value
oninput={bubble('input')} {...rest}
onchange={bubble('change')}
/> />
<style> <style>
input[type=range]::-webkit-slider-runnable-track { input[type='range']::-webkit-slider-runnable-track {
background: oklch(var(--p)/1); background: oklch(var(--p) / 1);
border-radius: var(--rounded-box, 1rem); border-radius: var(--rounded-box, 1rem);
} }
</style> </style>
+13 -15
View File
@@ -1,22 +1,20 @@
<script lang="ts"> <script lang="ts">
import { createBubbler } from 'svelte/legacy'; interface Props {
options?: string[];
selectedOption?: string;
change: () => void;
[key: string]: any;
}
const bubble = createBubbler(); let { options = [], selectedOption = $bindable(''), ...rest }: Props = $props();
interface Props {
options?: string[];
selectedOption?: string;
[key: string]: any
}
let { options = [], selectedOption = $bindable(''), ...rest }: Props = $props();
</script> </script>
<select <select
bind:value={selectedOption} bind:value={selectedOption}
onchange={bubble('change')} {...rest}
class="select select-bordered select-sm lg:select-md max-w-xs {rest.class || ''}" class="select select-bordered select-sm lg:select-md max-w-xs {rest.class || ''}"
> >
{#each options as option} {#each options as option}
<option value={option}>{option}</option> <option value={option}>{option}</option>
{/each} {/each}
</select> </select>