Customize Proclamations Admin page

This commit is contained in:
NeilClack
2026-03-16 13:23:25 -05:00
parent 0fd901b01f
commit 52c740b986
15 changed files with 294 additions and 160 deletions
+6 -2
View File
@@ -2,9 +2,8 @@
import { fieldNameToLabel } from '$lib/svelte-admin/introspect';
import type { PrismaScalarType, RelationOptionConfig } from '$lib/svelte-admin/types';
import ComboBox from './ComboBox.svelte';
import TipTap from '$lib/components/tiptap/TipTap.svelte';
type RelationOptionsData = Record<string, { label: string; value: string | number }[]>;
type Props = {
fields: string[];
fieldTypes: Record<string, PrismaScalarType>;
@@ -56,6 +55,11 @@
placeholder="Select {label}"
value={getValue(field) as string | number | undefined}
/>
{:else if type === 'Tiptap'}
<TipTap
name={field}
initialContent={String(getValue(field) ?? '')}
/>
{:else if type === 'Boolean'}
<input
type="checkbox"
+1 -1
View File
@@ -60,7 +60,6 @@
const related = e.relatedTarget as HTMLElement | null;
if (related?.closest(`[data-combobox="${id}"]`)) return;
open = false;
search = '';
highlightIndex = -1;
}
@@ -97,6 +96,7 @@
<div class="relative" data-combobox={id}>
<input type="hidden" {name} value={selectedValue ?? ''} />
<input type="hidden" name={name + 'Label'} value={selectedValue != null && selectedValue !== '' ? selectedLabel() : search} />
{#if selectedValue != null && selectedValue !== ''}
<div