2020-05-04 17:07:04 +02:00
|
|
|
<script>
|
2020-05-05 15:45:52 +02:00
|
|
|
import { excludeProps } from "./propertyCategories.js"
|
2020-05-07 15:30:04 +02:00
|
|
|
import PropertyControl from "./PropertyControl.svelte"
|
2020-06-09 11:00:50 +02:00
|
|
|
import { DetailSummary } from "@budibase/bbui"
|
2020-05-08 21:29:15 +02:00
|
|
|
|
2020-05-05 11:02:10 +02:00
|
|
|
export let name = ""
|
2020-05-22 16:30:29 +02:00
|
|
|
export let styleCategory = "normal"
|
2020-05-18 17:32:00 +02:00
|
|
|
export let properties = []
|
2020-05-04 17:07:04 +02:00
|
|
|
export let componentInstance = {}
|
2020-05-18 17:32:00 +02:00
|
|
|
export let onStyleChanged = () => {}
|
2020-05-04 17:07:04 +02:00
|
|
|
|
2020-05-25 16:23:56 +02:00
|
|
|
$: style = componentInstance["_styles"][styleCategory] || {}
|
2020-05-04 17:07:04 +02:00
|
|
|
</script>
|
|
|
|
|
2020-06-09 11:00:50 +02:00
|
|
|
<DetailSummary {name}>
|
|
|
|
{#each properties as props}
|
|
|
|
<PropertyControl
|
|
|
|
label={props.label}
|
|
|
|
control={props.control}
|
|
|
|
key={props.key}
|
|
|
|
value={style[props.key]}
|
|
|
|
onChange={(key, value) => onStyleChanged(styleCategory, key, value)}
|
|
|
|
props={{ ...excludeProps(props, ['control', 'label']) }} />
|
|
|
|
{/each}
|
|
|
|
</DetailSummary>
|