gradio/js/html/static/HTML.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
551 B
Svelte
Raw Normal View History

2022-03-03 00:42:43 +08:00
<script lang="ts">
2022-03-17 00:34:30 +08:00
import { createEventDispatcher } from "svelte";
export let elem_id = "";
export let elem_classes: string[] = [];
2022-03-03 00:42:43 +08:00
export let value: string;
export let visible = true;
export let min_height = false;
2022-03-17 00:34:30 +08:00
const dispatch = createEventDispatcher<{ change: undefined }>();
$: value, dispatch("change");
2022-03-03 00:42:43 +08:00
</script>
<div
class="prose {elem_classes.join(' ')}"
class:min={min_height}
id={elem_id}
class:hide={!visible}
>
2022-03-03 00:42:43 +08:00
{@html value}
</div>
<style>
.min {
min-height: var(--size-24);
}
.hide {
display: none;
}
</style>