2021-03-31 11:59:07 +02:00
|
|
|
<script>
|
2021-04-23 11:48:19 +02:00
|
|
|
import Icon from "../Icon/Icon.svelte"
|
2021-03-31 11:59:07 +02:00
|
|
|
|
2021-06-22 10:14:17 +02:00
|
|
|
export let name
|
2023-12-08 13:22:40 +01:00
|
|
|
export let initiallyShow = false
|
2021-06-23 08:55:33 +02:00
|
|
|
export let collapsible = true
|
2021-03-31 11:59:07 +02:00
|
|
|
|
2023-12-08 13:22:40 +01:00
|
|
|
let show = initiallyShow
|
|
|
|
|
2021-03-31 11:59:07 +02:00
|
|
|
const onHeaderClick = () => {
|
2021-06-23 08:55:33 +02:00
|
|
|
if (!collapsible) {
|
|
|
|
return
|
|
|
|
}
|
2021-03-31 11:59:07 +02:00
|
|
|
show = !show
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-06-22 10:14:17 +02:00
|
|
|
<div class="property-group-container">
|
2022-11-30 15:18:31 +01:00
|
|
|
{#if name}
|
|
|
|
<div class="property-group-name" on:click={onHeaderClick}>
|
|
|
|
<div class="name">{name}</div>
|
|
|
|
{#if collapsible}
|
|
|
|
<Icon size="S" name={show ? "Remove" : "Add"} />
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
<div
|
|
|
|
class="property-panel"
|
|
|
|
class:show={show || !collapsible}
|
|
|
|
class:no-title={!name}
|
|
|
|
>
|
2021-03-31 11:59:07 +02:00
|
|
|
<slot />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.property-group-container {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2021-06-22 10:14:17 +02:00
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: stretch;
|
|
|
|
border-bottom: var(--border-light);
|
2021-03-31 11:59:07 +02:00
|
|
|
}
|
2023-08-03 10:29:12 +02:00
|
|
|
.property-group-container:last-child {
|
|
|
|
border-bottom: 0px;
|
|
|
|
}
|
2021-03-31 11:59:07 +02:00
|
|
|
.property-group-name {
|
|
|
|
cursor: pointer;
|
|
|
|
display: flex;
|
|
|
|
flex-flow: row nowrap;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
2021-06-22 10:14:17 +02:00
|
|
|
padding: var(--spacing-m) var(--spacing-xl);
|
|
|
|
color: var(--spectrum-global-color-gray-600);
|
|
|
|
transition: color 130ms ease-in-out;
|
|
|
|
}
|
|
|
|
.property-group-name:hover {
|
|
|
|
color: var(--spectrum-global-color-gray-900);
|
2021-03-31 11:59:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
|
|
|
text-align: left;
|
2021-06-22 10:14:17 +02:00
|
|
|
font-size: var(--font-size-s);
|
2021-05-25 11:11:41 +02:00
|
|
|
font-weight: 600;
|
2021-03-31 11:59:07 +02:00
|
|
|
letter-spacing: 0.14px;
|
|
|
|
flex: 1 1 auto;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2021-06-22 10:14:17 +02:00
|
|
|
text-transform: uppercase;
|
2021-03-31 11:59:07 +02:00
|
|
|
white-space: nowrap;
|
2021-04-23 11:48:19 +02:00
|
|
|
user-select: none;
|
2021-03-31 11:59:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.property-panel {
|
|
|
|
display: none;
|
2021-06-22 10:14:17 +02:00
|
|
|
padding: var(--spacing-s) var(--spacing-xl) var(--spacing-xl)
|
|
|
|
var(--spacing-xl);
|
2021-03-31 11:59:07 +02:00
|
|
|
}
|
2022-11-30 15:18:31 +01:00
|
|
|
.property-panel.no-title {
|
2023-12-13 13:01:16 +01:00
|
|
|
padding-top: 0;
|
2022-11-30 15:18:31 +01:00
|
|
|
}
|
2021-03-31 11:59:07 +02:00
|
|
|
|
|
|
|
.show {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2021-06-22 10:14:17 +02:00
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: stretch;
|
2021-06-22 10:36:50 +02:00
|
|
|
gap: var(--spacing-l);
|
2021-03-31 11:59:07 +02:00
|
|
|
}
|
|
|
|
</style>
|