2019-08-02 15:54:10 +02:00
|
|
|
<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";
|
2019-08-02 15:54:10 +02:00
|
|
|
|
|
|
|
export let props;
|
2019-08-04 23:21:16 +02:00
|
|
|
export let allComponents;
|
|
|
|
|
|
|
|
let propsDefinition = createPropDefinitionForDerived(allComponents, props._component);
|
2019-08-02 15:54:10 +02:00
|
|
|
|
|
|
|
let fields = pipe(propsDefinition,[
|
|
|
|
keys,
|
|
|
|
map(k => propsDefinition[k])
|
|
|
|
]);
|
|
|
|
|
2019-08-04 23:21:16 +02:00
|
|
|
let component = getExactComponent(allComponents, props._component);
|
|
|
|
|
2019-08-02 15:54:10 +02:00
|
|
|
</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>
|
2019-08-02 15:54:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
<style>
|
2019-08-04 23:21:16 +02:00
|
|
|
|
|
|
|
.root {
|
|
|
|
padding: 10px;
|
|
|
|
}
|
|
|
|
|
2019-08-02 15:54:10 +02:00
|
|
|
</style>
|