diff --git a/frontend/src/components/grid-items.svelte b/frontend/src/components/grid-items.svelte index f21782c..598d809 100644 --- a/frontend/src/components/grid-items.svelte +++ b/frontend/src/components/grid-items.svelte @@ -11,14 +11,20 @@ export let activePath = []; export let level = 0; export let striped = true; + export let hideObjectIndicators = false; const dispatch = createEventDispatcher(); let childrenOpen = {}; + let _items = []; - $: _items = objectToArray(items).map(item => { - item.children = objectToArray(item.children); - return item; - }); + $: refresh(hideObjectIndicators, items); + + function refresh(hideObjectIndicators, items) { + _items = objectToArray(items).map(item => { + item.children = objectToArray(item.children); + return item; + }); + } function objectToArray(obj) { if (Array.isArray(obj)) { @@ -56,7 +62,7 @@ } function doubleClick(itemKey) { - toggleChildren(itemKey, false); + // toggleChildren(itemKey, false); dispatch('trigger', { level, itemKey }); } @@ -67,17 +73,20 @@ function formatValue(value) { if (Array.isArray(value)) { - return '[...]'; - } - if (typeof value === 'object') { - return '{...}'; - } - if (value === undefined || value === null) { - return ''; + return hideObjectIndicators ? '' : '[...]'; } if (typeof value === 'number' || typeof value === 'boolean') { return String(value); } + if ((value === undefined) || (value === null)) { + return ''; + } + if (new Date(value).toString() !== 'Invalid Date') { + return new Date(value); + } + if (typeof value === 'object') { + return hideObjectIndicators ? '' : '{...}'; + } if (String(value).length <= 1000) { return value; } @@ -118,6 +127,7 @@ {#if item.children && childrenOpen[item[key]]}
@@ -24,7 +25,16 @@ - +
diff --git a/frontend/src/components/icon.svelte b/frontend/src/components/icon.svelte index 05b851e..1c18de1 100644 --- a/frontend/src/components/icon.svelte +++ b/frontend/src/components/icon.svelte @@ -2,28 +2,36 @@ export let name = ''; -{#if name === 'radio'} - -{:else if name === 'chev-l'} - -{:else if name === 'chev-r'} - -{:else if name === 'chev-d'} - -{:else if name === 'db'} - -{:else if name === 'x'} - -{:else if name === '+'} - -{:else if name === '-'} - -{:else if name === 'reload'} - -{:else if name === 'clipboard'} - -{:else if name === 'edit'} - -{:else if name === 'check'} - -{/if} + + {#if name === 'radio'} + + {:else if name === 'chev-l'} + + {:else if name === 'chev-r'} + + {:else if name === 'chev-d'} + + {:else if name === 'db'} + + {:else if name === 'x'} + + {:else if name === '+'} + + {:else if name === '-'} + + {:else if name === 'reload'} + + {:else if name === 'clipboard'} + + {:else if name === 'edit'} + + {:else if name === 'check'} + + {:else if name === 'list'} + + {:else if name === 'table'} + + {:else if name === 'cog'} + + {/if} + diff --git a/frontend/src/components/modal.svelte b/frontend/src/components/modal.svelte index a410964..266b666 100644 --- a/frontend/src/components/modal.svelte +++ b/frontend/src/components/modal.svelte @@ -26,12 +26,13 @@ function keydown(event) { if ((event.key === 'Escape') && (level === numberOfModalsOpen)) { + event.preventDefault(); show = false; } } - + {#if show}