feat(web): coordinate input for asset location (#11291)

This commit is contained in:
Michel Heusschen 2024-07-23 14:01:10 +02:00 committed by GitHub
parent 8725656fd2
commit 7d3db11a5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 126 additions and 8 deletions

View file

@ -0,0 +1,28 @@
<script lang="ts">
import { clamp } from 'lodash-es';
export let id: string;
export let min: number;
export let max: number;
export let step: number | string = 'any';
export let required = true;
export let value: number | null = null;
export let onInput: (value: number | null) => void;
</script>
<input
type="number"
class="immich-form-input w-full"
{id}
{min}
{max}
{step}
{required}
bind:value
on:input={() => {
if (value !== null && (value < min || value > max)) {
value = clamp(value, min, max);
}
onInput(value);
}}
/>