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

56 lines
1019 B
Svelte
Raw Normal View History

<script>
import {
keys,
map,
} from "lodash/fp";
import {
pipe
} from "../common/core";
2019-08-04 23:21:16 +02:00
import {
createPropDefinitionForDerived
} from "./pagesParsing/createProps";
import {
getExactComponent
} from "./pagesParsing/searchComponents";
import Checkbox from "../common/Checkbox";
import Textbox from "../common/Textbox";
export let props;
2019-08-04 23:21:16 +02:00
export let allComponents;
let propsDefinition = createPropDefinitionForDerived(allComponents, props._component);
let fields = pipe(propsDefinition,[
keys,
map(k => propsDefinition[k])
]);
2019-08-04 23:21:16 +02:00
let component = getExactComponent(allComponents, props._component);
</script>
2019-08-04 23:21:16 +02:00
<div class="root">
<div>{props.name}</div>
{#each propsDefinition as propDef}
{#if propDef.type === "bool"}
<Checkbox label={propDef.name} />
{:else if true}
<!-- else if content here -->
{:else}
<!-- else content here -->
{/if}
{/each}
</div>
<style>
2019-08-04 23:21:16 +02:00
.root {
padding: 10px;
}
</style>