zenno: allow styling CharaPick
This commit is contained in:
@@ -1,25 +1,38 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { character } from '$lib/data/character';
|
import { character } from '$lib/data/character';
|
||||||
|
import type { ClassValue } from 'svelte/elements';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string;
|
id: string;
|
||||||
value: number;
|
value: number;
|
||||||
label?: string;
|
label?: string;
|
||||||
|
class?: ClassValue | null;
|
||||||
|
optionClass?: ClassValue | null;
|
||||||
|
labelClass?: ClassValue | null;
|
||||||
region?: keyof typeof character;
|
region?: keyof typeof character;
|
||||||
required?: boolean;
|
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>
|
</script>
|
||||||
|
|
||||||
{#if label}
|
{#if label}
|
||||||
<label for={id}>{label}</label>
|
<label for={id} class={labelClass}>{label}</label>
|
||||||
{/if}
|
{/if}
|
||||||
<select {id} bind:value {required}>
|
<select {id} class={className} bind:value {required}>
|
||||||
{#if !required}
|
{#if !required}
|
||||||
<option value="0"></option>
|
<option value="0" class={optionClass}></option>
|
||||||
{/if}
|
{/if}
|
||||||
{#each character[region] as c}
|
{#each character[region] as c}
|
||||||
<option value={c.chara_id}>{c.name}</option>
|
<option value={c.chara_id} class={optionClass}>{c.name}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<h1>Lobby Conversations</h1>
|
<h1>Lobby Conversations</h1>
|
||||||
<div class="mt-8 flex text-center">
|
<div class="mt-8 flex text-center">
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<CharaPick id="chara" label="Character" bind:value={charaID} required />
|
<CharaPick id="chara" class="w-full" label="Character" bind:value={charaID} required />
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<label for="convo">Conversation</label>
|
<label for="convo">Conversation</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user