mirror of
https://github.com/immich-app/immich.git
synced 2025-11-25 18:10:48 +09:00
feat(web): coordinate input for asset location (#11291)
This commit is contained in:
@@ -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);
|
||||
}}
|
||||
/>
|
||||
Reference in New Issue
Block a user