data type editor

This commit is contained in:
Jan Prochazka
2021-06-17 08:54:11 +02:00
parent 8874589ed0
commit 112f310d13
5 changed files with 78 additions and 3 deletions

View File

@@ -0,0 +1,31 @@
<script lang="ts">
import FontIcon from '../icons/FontIcon.svelte';
import InlineButton from '../elements/InlineButton.svelte';
import { getFormContext } from './FormProviderCore.svelte';
import TextField from './TextField.svelte';
import DropDownButton from '../elements/DropDownButton.svelte';
export let name;
export let disabled = false;
export let defaultValue;
export let menu;
const { values, setFieldValue } = getFormContext();
let showPassword = false;
$: value = $values[name];
$: isCrypted = value && value.startsWith('crypt:');
</script>
<div class="flex">
<TextField
{...$$restProps}
value={$values[name] ?? defaultValue}
on:input={e => setFieldValue(name, e.target['value'])}
/>
<DropDownButton {menu} {disabled} />
</div>