table data grid

This commit is contained in:
Jan Prochazka
2021-02-22 17:34:24 +01:00
parent 60c1090d6c
commit 1e540b3fe9
22 changed files with 928 additions and 5678 deletions

View File

@@ -1,8 +1,27 @@
import { writable } from 'svelte/store';
interface TabDefinition {
title: string;
closedTime?: number;
icon: string;
props: any;
selected: boolean;
busy: boolean;
tabid: string;
}
export function writableWithStorage<T>(defaultValue: T, storageName) {
const init = localStorage.getItem(storageName);
const res = writable<T>(init ? JSON.parse(init) : defaultValue);
res.subscribe(value => {
localStorage.setItem(storageName, JSON.stringify(value));
});
return res;
}
export const selectedWidget = writable('database');
export const openedConnections = writable([]);
export const currentDatabase = writable(null);
export const openedTabs = writable([]);
export const openedTabs = writableWithStorage<TabDefinition[]>([], 'openedTabs');
// export const leftPanelWidth = writable(300);