List category collapse fix ()

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-02-13 15:36:24 +06:00 committed by GitHub
parent 351e10817b
commit 32f1f80d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,47 +122,45 @@
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
</script> </script>
{#each categories as category, i} {#each categories as category, i (category)}
{@const items = groupedDocs[category] ?? []} {@const items = groupedDocs[category] ?? []}
{#key category} <ListCategory
<ListCategory {elementByIndex}
{elementByIndex} {indexById}
{indexById} {extraHeaders}
{extraHeaders} {space}
{space} {selectedObjectIds}
{selectedObjectIds} {headerComponent}
{headerComponent} initIndex={getInitIndex(categories, i)}
initIndex={getInitIndex(categories, i)} {baseMenuClass}
{baseMenuClass} {level}
{level} {viewOptions}
{viewOptions} {groupByKey}
{groupByKey} {lookup}
{lookup} {config}
{config} {docByIndex}
{docByIndex} {itemModels}
{itemModels} {_class}
{_class} singleCat={level === 0 && categories.length === 1}
singleCat={level === 0 && categories.length === 1} {category}
{category} {items}
{items} {newObjectProps}
{newObjectProps} {createItemDialog}
{createItemDialog} {createItemLabel}
{createItemLabel} {loadingPropsLength}
{loadingPropsLength} on:check
on:check on:uncheckAll
on:uncheckAll on:row-focus
on:row-focus on:dragstart={(e) => {
on:dragstart={(e) => { dispatch('dragstart', {
dispatch('dragstart', { target: e.detail.target,
target: e.detail.target, index: e.detail.index + getInitIndex(categories, i)
index: e.detail.index + getInitIndex(categories, i) })
}) }}
}} {flatHeaders}
{flatHeaders} {disableHeader}
{disableHeader} {props}
{props} {listDiv}
{listDiv} bind:dragItem
bind:dragItem />
/>
{/key}
{/each} {/each}