cell data view

This commit is contained in:
Jan Prochazka
2021-03-22 21:18:44 +01:00
parent 15c9e93e8a
commit 4e4447de8a
11 changed files with 204 additions and 19 deletions

View File

@@ -0,0 +1,41 @@
<script lang="ts">
import JSONTree from 'svelte-json-tree';
import ErrorInfo from '../elements/ErrorInfo.svelte';
export let selection;
let json = null;
let error = null;
$: try {
json = JSON.parse(selection[0].value);
error = null;
} catch (err) {
error = err.message;
}
</script>
{#if error}
<ErrorInfo message="Error parsing JSON" />
{:else}
<div class="outer">
<div class="inner">
<JSONTree value={json} />
</div>
</div>
{/if}
<style>
.outer {
flex: 1;
position: relative;
}
.inner {
overflow: scroll;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
</style>

View File

@@ -0,0 +1,5 @@
<script lang="ts">
export let selection;
</script>
<textarea class="flex1" wrap="no" readonly value={selection[0].value} />

View File

@@ -0,0 +1,5 @@
<script lang="ts">
export let selection;
</script>
<textarea class="flex1" wrap="hard" readonly value={selection[0].value} />