0026506543
- prettier's formatting has changed, so files needed to be reformatted - dart is spitting out deprecation warnings like: 254 │ 2: $spacer / 2, │ ^^^^^^^^^^^ ╵ bazel-out/darwin-fastbuild/bin/ts/sass/bootstrap/_variables.scss 254:6 @import ts/sass/button_mixins.scss 2:9 @use ts/components/ColorPicker.svelte 2:5 root stylesheet DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. Recommendation: math.div($grid-gutter-width, 2)
81 lines
1.9 KiB
Svelte
81 lines
1.9 KiB
Svelte
<!--
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
-->
|
|
<script lang="ts">
|
|
import marked from "marked";
|
|
import { slide } from "svelte/transition";
|
|
import RevertButton from "./RevertButton.svelte";
|
|
import HelpPopup from "./HelpPopup.svelte";
|
|
|
|
export let label: string;
|
|
export let tooltip = "";
|
|
export let value: any;
|
|
export let defaultValue: any;
|
|
/// empty strings will be ignored
|
|
export let warnings: string[] = [];
|
|
export let wholeLine = false;
|
|
export let id: string | undefined = undefined;
|
|
|
|
let renderedTooltip: string;
|
|
$: renderedTooltip = marked(tooltip);
|
|
</script>
|
|
|
|
<div {id} class="outer">
|
|
{#if label}
|
|
<div class="table">
|
|
<span class="vcenter">
|
|
{label}
|
|
{#if renderedTooltip}
|
|
<HelpPopup html={renderedTooltip} />
|
|
{/if}
|
|
</span>
|
|
</div>
|
|
{/if}
|
|
|
|
<div class="input-grid" class:full-grid-width={wholeLine}>
|
|
<slot />
|
|
<RevertButton bind:value {defaultValue} on:revert />
|
|
</div>
|
|
|
|
<div class="full-grid-width">
|
|
{#each warnings as warning}
|
|
{#if warning}
|
|
<div class="alert alert-warning" in:slide out:slide>{warning}</div>
|
|
{/if}
|
|
{/each}
|
|
</div>
|
|
</div>
|
|
|
|
<style lang="scss">
|
|
.outer {
|
|
display: grid;
|
|
grid-template-columns: 7fr 3fr;
|
|
grid-row-gap: 0.5em;
|
|
}
|
|
|
|
.full-grid-width {
|
|
grid-column: 1 / 6;
|
|
}
|
|
|
|
.table {
|
|
display: table;
|
|
height: 100%;
|
|
}
|
|
|
|
.vcenter {
|
|
display: table-cell;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.alert {
|
|
margin-top: 0.5em;
|
|
}
|
|
|
|
.input-grid {
|
|
display: grid;
|
|
grid-column-gap: 0.5em;
|
|
grid-template-columns: 10fr 16px;
|
|
}
|
|
</style>
|