budibase/packages/builder/src/userInterface/PropControl.svelte

53 lines
1.2 KiB
Svelte
Raw Normal View History

2019-08-16 16:48:45 +02:00
<script>
import Checkbox from "../common/Checkbox.svelte";
import Textbox from "../common/Textbox.svelte";
import Dropdown from "../common/Dropdown.svelte";
import StateBindingControl from "./StateBindingControl.svelte";
export let setProp = () => {};
export let index;
export let prop_name;
export let prop_value;
export let prop_type = {};
$: isOdd = (index % 2 !== 0);
const setComponentProp = (props) => {
setProp(propDef.____name, props);
}
2019-08-16 16:48:45 +02:00
</script>
2019-08-19 09:51:01 +02:00
<div class="root" >
{#if prop_type !== "event" }
2019-09-20 09:01:35 +02:00
<h5>{prop_name}</h5>
<StateBindingControl value={prop_value}
type={prop_type}
options={prop_type.options}
onChanged={v => setProp(prop_name, v)}/>
2019-09-20 09:01:35 +02:00
2020-01-21 15:50:35 +01:00
{/if}
2019-08-16 16:48:45 +02:00
</div>
<style>
.root {
height: 40px;
margin-bottom: 15px;
display: grid;
grid-template-rows: 1fr;
grid-template-columns: 70px 1fr;
grid-gap: 10px;
}
h5 {
2020-02-01 00:29:49 +01:00
word-wrap: break-word;
font-size: 12px;
font-weight: 700;
color: #163057;
opacity: 0.6;
padding-top: 12px;
margin-bottom: 0;
}
2020-01-21 15:50:35 +01:00
</style>