mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
UBER-130: Fix expand/collapse on multiple levels (#3198)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
57b0975404
commit
55780b116a
@ -124,6 +124,7 @@
|
||||
{viewOptionsConfig}
|
||||
{selectedObjectIds}
|
||||
level={0}
|
||||
groupPersistKey={''}
|
||||
{createItemDialog}
|
||||
{createItemLabel}
|
||||
on:check
|
||||
|
@ -56,6 +56,7 @@
|
||||
}
|
||||
export let listDiv: HTMLDivElement
|
||||
export let selection: number | undefined = undefined
|
||||
export let groupPersistKey: string
|
||||
|
||||
$: groupByKey = viewOptions.groupBy[level] ?? noCategory
|
||||
let categories: CategoryType[] = []
|
||||
@ -297,6 +298,7 @@
|
||||
{config}
|
||||
{itemModels}
|
||||
{_class}
|
||||
groupPersistKey={`${groupPersistKey}_${level}_${typeof category === 'object' ? category.name : category}`}
|
||||
singleCat={level === 0 && categories.length === 1}
|
||||
oneCat={viewOptions.groupBy.length === 1}
|
||||
lastCat={i === categories.length - 1}
|
||||
@ -357,6 +359,7 @@
|
||||
{flatHeaders}
|
||||
{props}
|
||||
{level}
|
||||
groupPersistKey={`${groupPersistKey}_${level}_${typeof category === 'object' ? category.name : category}`}
|
||||
{initIndex}
|
||||
{viewOptionsConfig}
|
||||
{listDiv}
|
||||
|
@ -63,6 +63,7 @@
|
||||
}
|
||||
export let listDiv: HTMLDivElement
|
||||
export let index: number
|
||||
export let groupPersistKey: string
|
||||
|
||||
$: lastLevel = level + 1 >= viewOptions.groupBy.length
|
||||
|
||||
@ -72,9 +73,7 @@
|
||||
$: initialLimit = !lastLevel ? undefined : singleCat ? singleCategoryLimit : defaultLimit
|
||||
$: limit = initialLimit
|
||||
|
||||
$: categoryCollapseKey = `list_collapsing_${location.pathname}_${
|
||||
typeof category === 'object' ? category.name : category
|
||||
}`
|
||||
$: categoryCollapseKey = `list_collapsing_${location.pathname}_${groupPersistKey}`
|
||||
$: storedCollapseState = localStorage.getItem(categoryCollapseKey)
|
||||
|
||||
$: collapsed = storedCollapseState === 'true' || storedCollapseState === null
|
||||
@ -402,6 +401,7 @@
|
||||
{flatHeaders}
|
||||
{props}
|
||||
level={level + 1}
|
||||
{groupPersistKey}
|
||||
{viewOptionsConfig}
|
||||
{listDiv}
|
||||
dragItem
|
||||
|
Loading…
Reference in New Issue
Block a user