Update form settings to be called Schema and add custom schema option
This commit is contained in:
parent
963f5e0ad8
commit
e94fb7d937
|
@ -19,6 +19,7 @@
|
||||||
let drawer
|
let drawer
|
||||||
|
|
||||||
export let value = {}
|
export let value = {}
|
||||||
|
export let otherSources
|
||||||
|
|
||||||
$: tables = $backendUiStore.tables.map(m => ({
|
$: tables = $backendUiStore.tables.map(m => ({
|
||||||
label: m.name,
|
label: m.name,
|
||||||
|
@ -88,7 +89,7 @@
|
||||||
class="dropdownbutton"
|
class="dropdownbutton"
|
||||||
bind:this={anchorRight}
|
bind:this={anchorRight}
|
||||||
on:click={dropdownRight.show}>
|
on:click={dropdownRight.show}>
|
||||||
<span>{value?.label ? value.label : 'Choose option'}</span>
|
<span>{value?.label ?? 'Choose option'}</span>
|
||||||
<Icon name="arrowdown" />
|
<Icon name="arrowdown" />
|
||||||
</div>
|
</div>
|
||||||
{#if value?.type === 'query'}
|
{#if value?.type === 'query'}
|
||||||
|
@ -175,6 +176,22 @@
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
{#if otherSources?.length}
|
||||||
|
<hr />
|
||||||
|
<div class="title">
|
||||||
|
<Heading extraSmall>Other</Heading>
|
||||||
|
</div>
|
||||||
|
<ul>
|
||||||
|
{#each otherSources as source}
|
||||||
|
<li
|
||||||
|
class:selected={value === source}
|
||||||
|
on:click={() => handleSelected(source)}>
|
||||||
|
{source.label}
|
||||||
|
</li>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<script>
|
||||||
|
import FieldSelect from "./FieldSelect.svelte"
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<FieldSelect {...$$props} multiselect />
|
|
@ -1,5 +0,0 @@
|
||||||
<script>
|
|
||||||
import TableViewFieldSelect from "./TableViewFieldSelect.svelte"
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<TableViewFieldSelect {...$$props} multiselect />
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<script>
|
||||||
|
import DatasourceSelect from "./DatasourceSelect.svelte"
|
||||||
|
|
||||||
|
const otherSources = [{ name: "Custom", label: "Custom" }]
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<DatasourceSelect on:change {...$$props} {otherSources} />
|
|
@ -11,11 +11,12 @@
|
||||||
import LayoutSelect from "./PropertyControls/LayoutSelect.svelte"
|
import LayoutSelect from "./PropertyControls/LayoutSelect.svelte"
|
||||||
import RoleSelect from "./PropertyControls/RoleSelect.svelte"
|
import RoleSelect from "./PropertyControls/RoleSelect.svelte"
|
||||||
import OptionSelect from "./PropertyControls/OptionSelect.svelte"
|
import OptionSelect from "./PropertyControls/OptionSelect.svelte"
|
||||||
import MultiTableViewFieldSelect from "./PropertyControls/MultiTableViewFieldSelect.svelte"
|
|
||||||
import Checkbox from "./PropertyControls/Checkbox.svelte"
|
import Checkbox from "./PropertyControls/Checkbox.svelte"
|
||||||
import TableSelect from "./PropertyControls/TableSelect.svelte"
|
import TableSelect from "./PropertyControls/TableSelect.svelte"
|
||||||
import TableViewSelect from "./PropertyControls/TableViewSelect.svelte"
|
import DatasourceSelect from "./PropertyControls/DatasourceSelect.svelte"
|
||||||
import TableViewFieldSelect from "./PropertyControls/TableViewFieldSelect.svelte"
|
import FieldSelect from "./PropertyControls/FieldSelect.svelte"
|
||||||
|
import MultiFieldSelect from "./PropertyControls/MultiFieldSelect.svelte"
|
||||||
|
import SchemaSelect from "./PropertyControls/SchemaSelect.svelte"
|
||||||
import EventsEditor from "./PropertyControls/EventsEditor"
|
import EventsEditor from "./PropertyControls/EventsEditor"
|
||||||
import ScreenSelect from "./PropertyControls/ScreenSelect.svelte"
|
import ScreenSelect from "./PropertyControls/ScreenSelect.svelte"
|
||||||
import DetailScreenSelect from "./PropertyControls/DetailScreenSelect.svelte"
|
import DetailScreenSelect from "./PropertyControls/DetailScreenSelect.svelte"
|
||||||
|
@ -60,7 +61,7 @@
|
||||||
const controlMap = {
|
const controlMap = {
|
||||||
text: Input,
|
text: Input,
|
||||||
select: OptionSelect,
|
select: OptionSelect,
|
||||||
datasource: TableViewSelect,
|
datasource: DatasourceSelect,
|
||||||
screen: ScreenSelect,
|
screen: ScreenSelect,
|
||||||
detailScreen: DetailScreenSelect,
|
detailScreen: DetailScreenSelect,
|
||||||
boolean: Checkbox,
|
boolean: Checkbox,
|
||||||
|
@ -69,8 +70,9 @@
|
||||||
table: TableSelect,
|
table: TableSelect,
|
||||||
color: ColorPicker,
|
color: ColorPicker,
|
||||||
icon: IconSelect,
|
icon: IconSelect,
|
||||||
field: TableViewFieldSelect,
|
field: FieldSelect,
|
||||||
multifield: MultiTableViewFieldSelect,
|
multifield: MultiFieldSelect,
|
||||||
|
schema: SchemaSelect,
|
||||||
"field/string": StringFieldSelect,
|
"field/string": StringFieldSelect,
|
||||||
"field/number": NumberFieldSelect,
|
"field/number": NumberFieldSelect,
|
||||||
"field/options": OptionsFieldSelect,
|
"field/options": OptionsFieldSelect,
|
||||||
|
|
|
@ -1045,12 +1045,11 @@
|
||||||
"styleable": true,
|
"styleable": true,
|
||||||
"hasChildren": true,
|
"hasChildren": true,
|
||||||
"dataProvider": true,
|
"dataProvider": true,
|
||||||
"datasourceSetting": "datasource",
|
|
||||||
"actions": ["ValidateForm"],
|
"actions": ["ValidateForm"],
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"type": "datasource",
|
"type": "schema",
|
||||||
"label": "Data",
|
"label": "Schema",
|
||||||
"key": "datasource"
|
"key": "datasource"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue