|
|
|
@ -13,6 +13,7 @@ |
|
|
|
export let key = "" |
|
|
|
export let type = "" |
|
|
|
export let value = null |
|
|
|
export let defaultValue = null |
|
|
|
export let props = {} |
|
|
|
export let onChange = () => {} |
|
|
|
export let bindings = [] |
|
|
|
@ -20,8 +21,9 @@ |
|
|
|
export let nested = false |
|
|
|
export let highlighted = false |
|
|
|
|
|
|
|
$: nullishValue = value == null || value === "" |
|
|
|
$: allBindings = getAllBindings(bindings, componentBindings, nested) |
|
|
|
$: safeValue = getSafeValue(value, props.defaultValue, allBindings) |
|
|
|
$: safeValue = getSafeValue(value, defaultValue, allBindings) |
|
|
|
$: tempValue = safeValue |
|
|
|
$: replaceBindings = val => readableToRuntimeBinding(allBindings, val) |
|
|
|
|
|
|
|
@ -71,7 +73,11 @@ |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
|
<div class="property-control" data-cy={`setting-${key}`} class:highlighted> |
|
|
|
<div |
|
|
|
class="property-control" |
|
|
|
class:highlighted={highlighted && nullishValue} |
|
|
|
data-cy={`setting-${key}`} |
|
|
|
> |
|
|
|
{#if type !== "boolean" && label} |
|
|
|
<div class="label"> |
|
|
|
<Label>{label}</Label> |
|
|
|
@ -104,12 +110,11 @@ |
|
|
|
align-items: stretch; |
|
|
|
transition: background 130ms ease-out, border-color 130ms ease-out; |
|
|
|
border-left: 4px solid transparent; |
|
|
|
margin-left: -4px; |
|
|
|
margin: -6px calc(-1 * var(--spacing-xl)); |
|
|
|
padding: 6px var(--spacing-xl) 6px calc(var(--spacing-xl) - 4px); |
|
|
|
} |
|
|
|
.property-control.highlighted { |
|
|
|
background: var(--spectrum-global-color-gray-300); |
|
|
|
margin: -6px calc(-1 * var(--spacing-xl)); |
|
|
|
padding: 6px var(--spacing-xl) 6px calc(var(--spacing-xl) - 4px); |
|
|
|
border-color: var(--spectrum-global-color-blue-400); |
|
|
|
} |
|
|
|
.label { |
|
|
|
|