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:
parent
01166166e9
commit
53093681ec
@ -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 ];
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user