Files
dbgate/packages/web/src/jsontree/JSONKey.svelte
2021-04-05 09:14:02 +02:00

20 lines
441 B
Svelte

<script>
export let key, isParentExpanded, isParentArray = false, colon = ':';
$: showKey = (isParentExpanded || !isParentArray || key != +key);
</script>
<style>
label {
display: inline-block;
color: var(--label-color);
padding: 0;
}
.spaced {
padding-right: var(--li-colon-space);
}
</style>
{#if showKey && key}
<label class:spaced={isParentExpanded} on:click>
<span>{key}{colon}</span>
</label>
{/if}