Fix button groups not working in design panel
This commit is contained in:
parent
12fa20de8d
commit
580d5b6478
|
@ -9,12 +9,17 @@
|
|||
export let onStyleChanged = () => {}
|
||||
export let open = false
|
||||
|
||||
$: style = componentInstance["_styles"][styleCategory] || {}
|
||||
$: changed = properties.some(prop => hasPropChanged(style, prop))
|
||||
|
||||
const hasPropChanged = (style, prop) => {
|
||||
return style[prop.key] != null && style[prop.key] !== ""
|
||||
}
|
||||
|
||||
$: style = componentInstance["_styles"][styleCategory] || {}
|
||||
$: changed = properties.some(prop => hasPropChanged(style, prop))
|
||||
const getControlProps = props => {
|
||||
const { label, key, control, ...otherProps } = props || {}
|
||||
return otherProps || {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<DetailSummary name={`${name}${changed ? ' *' : ''}`} on:open show={open} thin>
|
||||
|
@ -28,7 +33,7 @@
|
|||
key={prop.key}
|
||||
value={style[prop.key]}
|
||||
onChange={value => onStyleChanged(styleCategory, prop.key, value)}
|
||||
props={{ options: prop.options, placeholder: prop.placeholder }} />
|
||||
props={getControlProps(prop)} />
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
|
Loading…
Reference in New Issue