1
0
Fork 0
mirror of synced 2024-09-10 22:46:09 +12:00

Added condition count to the component settings panel

This commit is contained in:
Dean 2022-07-05 09:05:23 +01:00
parent bc4b099da5
commit 4808789aca

View file

@ -28,12 +28,18 @@
}
drawer.hide()
}
$: conditionCount = componentInstance?._conditions?.length
$: conditionText = `${conditionCount || "No"} condition${
conditionCount !== 1 ? "s" : ""
} set`
</script>
<DetailSummary
name={`Conditions${componentInstance?._conditions ? " *" : ""}`}
name={`Conditions${conditionCount ? " *" : ""}`}
collapsible={false}
>
<div class="conditionCount">{conditionText}</div>
<div>
<ActionButton on:click={openDrawer}>Configure conditions</ActionButton>
</div>
@ -45,3 +51,9 @@
<Button cta slot="buttons" on:click={() => save()}>Save</Button>
<ConditionalUIDrawer slot="body" bind:conditions={tempValue} {bindings} />
</Drawer>
<style>
.conditionCount {
font-weight: 600;
}
</style>