mirror of
https://github.com/immich-app/immich.git
synced 2026-01-15 06:23:00 -08:00
* chore(web): another missing translations * unused removed * more keys * lint fix * test fixed * dynamic translation fix * fixes * people search translation * params fixed * keep filter setting fix * lint fix * $t fixes * Update web/src/lib/i18n/en.json Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> * another missing * activity translation * link sharing translations * expiration dropdown fix - didn't work localized * notification title * device logout * search results * reset to default * unsaved change * select from computer * selected * select-2 * select-3 * unmerge * pluralize, force icu message * Update web/src/lib/components/asset-viewer/asset-viewer.svelte Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> * review fixes * remove user * plural fixes * ffmpeg settings * fixes * error title * plural fixes * onboarding * change password * more more * console log fix * another * api key desc * map marker * format fix * key fix * asset-utils * utils * misc --------- Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
63 lines
1.6 KiB
Svelte
63 lines
1.6 KiB
Svelte
<script lang="ts">
|
|
import { quintOut } from 'svelte/easing';
|
|
import { fly } from 'svelte/transition';
|
|
import { createEventDispatcher } from 'svelte';
|
|
import { t } from 'svelte-i18n';
|
|
|
|
export let value: string | number;
|
|
export let options: { value: string | number; text: string }[];
|
|
export let label = '';
|
|
export let desc = '';
|
|
export let name = '';
|
|
export let isEdited = false;
|
|
export let number = false;
|
|
export let disabled = false;
|
|
|
|
const dispatch = createEventDispatcher<{ select: string | number }>();
|
|
|
|
const handleChange = (e: Event) => {
|
|
value = (e.target as HTMLInputElement).value;
|
|
if (number) {
|
|
value = Number.parseInt(value);
|
|
}
|
|
dispatch('select', value);
|
|
};
|
|
</script>
|
|
|
|
<div class="mb-4 w-full">
|
|
<div class={`flex h-[26px] place-items-center gap-1`}>
|
|
<label class="font-medium text-immich-primary dark:text-immich-dark-primary text-sm" for="{name}-select"
|
|
>{label}</label
|
|
>
|
|
|
|
{#if isEdited}
|
|
<div
|
|
transition:fly={{ x: 10, duration: 200, easing: quintOut }}
|
|
class="rounded-full bg-orange-100 px-2 text-[10px] text-orange-900"
|
|
>
|
|
{$t('unsaved_change')}
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
|
|
{#if desc}
|
|
<p class="immich-form-label pb-2 text-sm" id="{name}-desc">
|
|
{desc}
|
|
</p>
|
|
{/if}
|
|
|
|
<select
|
|
class="immich-form-input w-full pb-2"
|
|
{disabled}
|
|
aria-describedby={desc ? `${name}-desc` : undefined}
|
|
{name}
|
|
id="{name}-select"
|
|
bind:value
|
|
on:change={handleChange}
|
|
>
|
|
{#each options as option}
|
|
<option value={option.value}>{option.text}</option>
|
|
{/each}
|
|
</select>
|
|
</div>
|