1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 13:07:58 +00:00

Update ObjectGrid to not display menu in object

This commit is contained in:
Romein van Buren 2023-01-21 15:12:27 +01:00
parent 01166166e9
commit 53093681ec
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
2 changed files with 9 additions and 5 deletions

View File

@ -5,6 +5,7 @@
export let key = '_id';
export let activePath = [];
export let hideObjectIndicators = false;
export let getRootMenu = () => undefined;
const columns = [
{ key: 'key', label: 'Key' },
@ -23,7 +24,7 @@
newItem.key = item[key];
newItem.type = getType(item[key]);
newItem.children = dissectObject(item);
newItem.menu = item.menu;
newItem.menu = getRootMenu(key, item[key]);
items = [ ...items, newItem ];
}
}

View File

@ -50,10 +50,13 @@
</div>
<div class="grid">
<ObjectGrid key="name" data={indexes.map(idx => ({
...idx,
menu: [ { label: 'Drop this index', fn: () => drop(idx.name) } ],
}))} bind:activePath on:trigger={e => openJson(e.detail.itemKey)} />
<ObjectGrid
key="name"
data={indexes}
getRootMenu={(_, idx) => [ { label: 'Drop this index', fn: () => drop(idx.name) } ]}
bind:activePath
on:trigger={e => openJson(e.detail.itemKey)}
/>
</div>
</div>