zenno: allow styling CharaPick
This commit is contained in:
@@ -1,25 +1,38 @@
|
||||
<script lang="ts">
|
||||
import { character } from '$lib/data/character';
|
||||
import type { ClassValue } from 'svelte/elements';
|
||||
|
||||
interface Props {
|
||||
id: string;
|
||||
value: number;
|
||||
label?: string;
|
||||
class?: ClassValue | null;
|
||||
optionClass?: ClassValue | null;
|
||||
labelClass?: ClassValue | null;
|
||||
region?: keyof typeof character;
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
let { id, value = $bindable(), label, region = 'global', required = false }: Props = $props();
|
||||
let {
|
||||
id,
|
||||
value = $bindable(),
|
||||
label,
|
||||
class: className,
|
||||
optionClass,
|
||||
labelClass,
|
||||
region = 'global',
|
||||
required = false,
|
||||
}: Props = $props();
|
||||
</script>
|
||||
|
||||
{#if label}
|
||||
<label for={id}>{label}</label>
|
||||
<label for={id} class={labelClass}>{label}</label>
|
||||
{/if}
|
||||
<select {id} bind:value {required}>
|
||||
<select {id} class={className} bind:value {required}>
|
||||
{#if !required}
|
||||
<option value="0"></option>
|
||||
<option value="0" class={optionClass}></option>
|
||||
{/if}
|
||||
{#each character[region] as c}
|
||||
<option value={c.chara_id}>{c.name}</option>
|
||||
<option value={c.chara_id} class={optionClass}>{c.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user