2021-04-12 06:18:30 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
|
|
|
import RevertIcon from "./RevertIcon.svelte";
|
|
|
|
|
|
|
|
export let label: string;
|
|
|
|
export let subLabel = "";
|
|
|
|
export let value: any;
|
|
|
|
export let defaultValue: any;
|
2021-04-17 14:53:47 +02:00
|
|
|
/// empty strings will be ignored
|
|
|
|
export let warnings: string[] = [];
|
2021-04-12 06:18:30 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.outer {
|
|
|
|
margin-top: 1em;
|
|
|
|
|
|
|
|
& > * {
|
|
|
|
margin-top: 0.3em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.label {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<div class="outer">
|
|
|
|
<span class="label">{label}</span>
|
|
|
|
<RevertIcon bind:value {defaultValue} on:revert />
|
|
|
|
<div class="sub">{subLabel}</div>
|
|
|
|
|
|
|
|
<div class="inner">
|
|
|
|
<slot />
|
|
|
|
</div>
|
2021-04-17 14:53:47 +02:00
|
|
|
|
|
|
|
{#each warnings as warning}
|
|
|
|
{#if warning}
|
|
|
|
<div class="alert alert-warning">{warning}</div>
|
|
|
|
{/if}
|
|
|
|
{/each}
|
2021-04-12 06:18:30 +02:00
|
|
|
</div>
|