mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 20:35:59 +00:00
column drop down in column map modal
This commit is contained in:
30
packages/web/src/elements/ColumnMapColumnDropdown.svelte
Normal file
30
packages/web/src/elements/ColumnMapColumnDropdown.svelte
Normal file
@@ -0,0 +1,30 @@
|
||||
<script alng="ts">
|
||||
import DropDownButton from '../buttons/DropDownButton.svelte';
|
||||
import TextField from '../forms/TextField.svelte';
|
||||
|
||||
export let tableInfo;
|
||||
export let onChange;
|
||||
export let value;
|
||||
</script>
|
||||
|
||||
{#if tableInfo}
|
||||
<div class="wrapper">
|
||||
<TextField {...$$restProps} {value} on:input={e => onChange(e.target.value)} />
|
||||
<DropDownButton
|
||||
menu={() => {
|
||||
return tableInfo.columns.map(opt => ({
|
||||
text: opt.columnName,
|
||||
onClick: () => onChange(opt.columnName),
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{:else}
|
||||
<TextField {value} on:input={e => onChange(e.target.value)} />
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.wrapper {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user