mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(web): coordinate input for asset location (#11291)
This commit is contained in:
parent
8725656fd2
commit
7d3db11a5c
5 changed files with 126 additions and 8 deletions
|
|
@ -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);
|
||||
}}
|
||||
/>
|
||||
Loading…
Add table
Add a link
Reference in a new issue