add user edition to admin panel
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import UserSearch from '@components/admin/search/UserSearch.svelte';
|
||||
import Checkbox from '@components/input/Checkbox.svelte';
|
||||
import type { user } from '@db/schema/user.ts';
|
||||
import Select from '@components/input/Select.svelte';
|
||||
|
||||
// html bindings
|
||||
let modal: HTMLDialogElement;
|
||||
@@ -44,6 +45,7 @@
|
||||
| 'datetime-local'
|
||||
| 'number'
|
||||
| 'password'
|
||||
| 'select'
|
||||
| 'tel'
|
||||
| 'text'
|
||||
| 'textarea'
|
||||
@@ -56,6 +58,7 @@
|
||||
['datetime-local']: string;
|
||||
['number']: number;
|
||||
['password']: string;
|
||||
['select']: string;
|
||||
['tel']: string;
|
||||
['text']: string;
|
||||
['textarea']: string;
|
||||
@@ -71,6 +74,9 @@
|
||||
['datetime-local']: {};
|
||||
['number']: {};
|
||||
['password']: {};
|
||||
['select']: {
|
||||
options: Record<string, string>;
|
||||
};
|
||||
['tel']: {};
|
||||
['text']: {};
|
||||
['textarea']: {
|
||||
@@ -203,6 +209,14 @@
|
||||
label={k.label}
|
||||
required={k.options?.required}
|
||||
/>
|
||||
{:else if k.type === 'select'}
|
||||
<Select
|
||||
bind:value={() => target[k.key] ?? k.default, (v) => onBindChange(k.key, v, k.options)}
|
||||
label={k.label}
|
||||
values={k.options.values}
|
||||
required={k.options?.required}
|
||||
dynamicWidth={k.options?.dynamicWidth}
|
||||
/>
|
||||
{:else if k.type === 'user-search'}
|
||||
<UserSearch
|
||||
bind:value={
|
||||
|
||||
Reference in New Issue
Block a user