mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-12-06 10:34:13 +00:00
small fixes for tools
This commit is contained in:
1 parent
9c83dcafa7
commit
6db8696a36
8 files changed
+241
-196
No files matched your search
@@ -1,26 +1,45 @@
|
||||
<script lang="ts">
|
||||
import { Input } from '$lib/components/ui/input';
|
||||
|
||||
export let value: string | number;
|
||||
let {
|
||||
id,
|
||||
value = $bindable(),
|
||||
disabled,
|
||||
oninput = () => {},
|
||||
onchange = () => {},
|
||||
onkeypress = () => {},
|
||||
onfocusin = () => {},
|
||||
class: className,
|
||||
}: {
|
||||
id: string;
|
||||
value: string | number;
|
||||
disabled?: boolean;
|
||||
oninput?: (e: Event) => void;
|
||||
onchange?: (e: Event) => void;
|
||||
onkeypress?: (e: KeyboardEvent) => void;
|
||||
onfocusin?: (e: FocusEvent) => void;
|
||||
class?: string;
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<Input
|
||||
{id}
|
||||
type="text"
|
||||
step={1}
|
||||
bind:value
|
||||
on:input
|
||||
on:change
|
||||
on:keypress
|
||||
on:focusin={() => {
|
||||
{disabled}
|
||||
{oninput}
|
||||
{onchange}
|
||||
{onkeypress}
|
||||
onfocusin={(e) => {
|
||||
let input = document.activeElement;
|
||||
if (input instanceof HTMLInputElement) {
|
||||
input.select();
|
||||
}
|
||||
onfocusin(e);
|
||||
}}
|
||||
on:focusin
|
||||
class="w-[22px] {$$props.class ?? ''}"
|
||||
{...$$restProps}
|
||||
class="w-[22px] {className ?? ''}"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -29,8 +48,11 @@
|
||||
|
||||
div :global(input) {
|
||||
@apply px-0.5;
|
||||
@apply py-0;
|
||||
@apply bg-transparent;
|
||||
@apply text-right;
|
||||
@apply border-none;
|
||||
@apply shadow-none;
|
||||
@apply focus:ring-0;
|
||||
@apply focus:ring-offset-0;
|
||||
@apply focus:outline-none;
|
||||
|
||||
Reference in new issue
Block a user