Files
gpx.studio/website/src/lib/components/ui/time-picker/TimeComponentInput.svelte
T

41 lines
940 B
Svelte
Raw Normal View History

2024-06-13 17:36:43 +02:00
<script lang="ts">
2025-06-21 21:07:36 +02:00
import { Input } from '$lib/components/ui/input';
2024-06-13 17:36:43 +02:00
2025-06-21 21:07:36 +02:00
export let value: string | number;
2024-06-13 17:36:43 +02:00
</script>
<div>
2025-06-21 21:07:36 +02:00
<Input
type="text"
step={1}
bind:value
on:input
on:change
on:keypress
on:focusin={() => {
let input = document.activeElement;
if (input instanceof HTMLInputElement) {
input.select();
}
}}
on:focusin
class="w-[22px] {$$props.class ?? ''}"
{...$$restProps}
/>
2024-06-13 17:36:43 +02:00
</div>
<style lang="postcss">
2025-06-21 21:07:36 +02:00
@reference "tailwindcss";
div :global(input) {
@apply px-0.5;
@apply text-right;
@apply border-none;
@apply focus:ring-0;
@apply focus:ring-offset-0;
@apply focus:outline-none;
@apply focus-visible:ring-0;
@apply focus-visible:ring-offset-0;
@apply focus-visible:outline-none;
}
2024-06-13 17:36:43 +02:00
</style>