expanded cell view

This commit is contained in:
SPRINX0\prochazka
2025-02-07 14:34:56 +01:00
parent 8103c26ca8
commit 93895f3d6f
4 changed files with 17 additions and 5 deletions

View File

@@ -190,10 +190,6 @@ export interface DatabaseInfo extends DatabaseInfoObjects {
engine?: string; engine?: string;
} }
type DeepPartial<T> = {
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
};
export interface ColumnReferenceTiny { export interface ColumnReferenceTiny {
n: string; // name n: string; // name
r?: string; // ref name r?: string; // ref name
@@ -217,6 +213,8 @@ export interface TableInfoTiny {
n: string; //name n: string; //name
o: string; // comment o: string; // comment
c: ColumnInfoTiny[]; // columns c: ColumnInfoTiny[]; // columns
p?: PrimaryKeyInfoTiny; // primary key
f?: ForeignKeyInfoTiny[]; // foreign keys
} }
export interface DatabaseInfoTiny { export interface DatabaseInfoTiny {

View File

@@ -5,6 +5,7 @@
export let selection; export let selection;
export let showWholeRow = false; export let showWholeRow = false;
export let expandAll = false;
let json = null; let json = null;
let error = null; let error = null;
@@ -31,7 +32,7 @@
{:else} {:else}
<div class="outer"> <div class="outer">
<div class="inner"> <div class="inner">
<JSONTree value={json} expanded /> <JSONTree value={json} {expandAll} expanded />
</div> </div>
</div> </div>
{/if} {/if}

View File

@@ -0,0 +1,6 @@
<script lang="ts">
import JsonCellView from './JsonCellView.svelte';
export let selection;
</script>
<JsonCellView {selection} expandAll />

View File

@@ -20,6 +20,12 @@
component: JsonCellView, component: JsonCellView,
single: true, single: true,
}, },
{
type: 'jsonExpanded',
title: 'Json - expanded',
component: JsonExpandedCellView,
single: true,
},
{ {
type: 'jsonRow', type: 'jsonRow',
title: 'Json - Row', title: 'Json - Row',
@@ -84,6 +90,7 @@
import SelectField from '../forms/SelectField.svelte'; import SelectField from '../forms/SelectField.svelte';
import { selectedCellsCallback } from '../stores'; import { selectedCellsCallback } from '../stores';
import WidgetTitle from './WidgetTitle.svelte'; import WidgetTitle from './WidgetTitle.svelte';
import JsonExpandedCellView from '../celldata/JsonExpandedCellView.svelte';
let selectedFormatType = 'autodetect'; let selectedFormatType = 'autodetect';