🧼 Updates inputs after svelte migration
This commit is contained in:
@@ -1,7 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createBubbler } from 'svelte/legacy';
|
|
||||||
|
|
||||||
const bubble = createBubbler();
|
|
||||||
interface Props {
|
interface Props {
|
||||||
min?: number;
|
min?: number;
|
||||||
max?: number;
|
max?: number;
|
||||||
@@ -13,7 +10,8 @@
|
|||||||
min = 0,
|
min = 0,
|
||||||
max = 100,
|
max = 100,
|
||||||
step = 1,
|
step = 1,
|
||||||
value = $bindable((max - min) / 2)
|
value = $bindable((max - min) / 2),
|
||||||
|
...rest
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -21,17 +19,16 @@
|
|||||||
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>
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createBubbler } from 'svelte/legacy';
|
|
||||||
|
|
||||||
const bubble = createBubbler();
|
|
||||||
interface Props {
|
interface Props {
|
||||||
options?: string[];
|
options?: string[];
|
||||||
selectedOption?: string;
|
selectedOption?: string;
|
||||||
[key: string]: any
|
change: () => void;
|
||||||
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { options = [], selectedOption = $bindable(''), ...rest }: Props = $props();
|
let { options = [], selectedOption = $bindable(''), ...rest }: Props = $props();
|
||||||
@@ -13,7 +11,7 @@
|
|||||||
|
|
||||||
<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}
|
||||||
|
|||||||
Reference in New Issue
Block a user