budibase/packages/builder/src/components/userInterface/PropsView.svelte

55 lines
1.2 KiB
Svelte
Raw Normal View History

<script>
2020-02-03 10:50:30 +01:00
import { some, includes, filter } from "lodash/fp"
import Textbox from "../common/Textbox.svelte"
import Dropdown from "../common/Dropdown.svelte"
import PropControl from "./PropControl.svelte"
import IconButton from "../common/IconButton.svelte"
export let component
2020-02-03 10:50:30 +01:00
export let components
let errors = []
const props_to_ignore = ["_component", "_children", "_styles", "_code", "_id"]
$: componentDef = components[component._component]
</script>
2019-08-04 23:21:16 +02:00
<div class="root">
<form on:submit|preventDefault class="uk-form-stacked form-root">
{#if componentDef}
2020-02-25 16:21:23 +01:00
{#each Object.entries(componentDef.props) as [prop_name, prop_def], index}
2020-05-07 11:53:34 +02:00
{#if prop_def !== 'event'}
<div class="prop-container">
<PropControl
{prop_name}
prop_value={component[prop_name]}
prop_definition={prop_def}
{index}
disabled={false} />
</div>
{/if}
2020-02-25 16:21:23 +01:00
{/each}
{/if}
2020-02-03 10:50:30 +01:00
</form>
2019-08-16 16:48:45 +02:00
2019-08-04 23:21:16 +02:00
</div>
<style>
2020-02-03 10:50:30 +01:00
.root {
font-size: 10pt;
width: 100%;
}
.form-root {
display: flex;
flex-wrap: wrap;
}
.prop-container {
flex: 1 1 auto;
min-width: 250px;
}
</style>