@stainless-api/docs-ui 0.1.0-beta.76 → 0.1.0-beta.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -54,7 +54,7 @@ function GroupEntry({ entry, entryToIndex }) {
|
|
|
54
54
|
children: labelWithIcon
|
|
55
55
|
}), /* @__PURE__ */ jsxs(GroupElement, {
|
|
56
56
|
className: style_default.SidebarExpander,
|
|
57
|
-
...collapsible ? { open:
|
|
57
|
+
...collapsible ? { open: !entry.collapsed || isAnyItemCurrent(entry.entries) } : {},
|
|
58
58
|
children: [
|
|
59
59
|
/* @__PURE__ */ jsxs(GroupLabelElement, {
|
|
60
60
|
className: style_default.ExpanderSummary,
|
|
@@ -99,8 +99,15 @@ function computeEntryToIndex(allEntries) {
|
|
|
99
99
|
addEntries(allEntries);
|
|
100
100
|
return entryToIndex;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
102
|
+
function* walkSidebar(entries) {
|
|
103
|
+
for (const entry of entries) {
|
|
104
|
+
yield entry;
|
|
105
|
+
if (entry.type === "group") yield* walkSidebar(entry.entries);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function isAnyItemCurrent(entries) {
|
|
109
|
+
for (const e of walkSidebar(entries)) if (e.isCurrent) return true;
|
|
110
|
+
return false;
|
|
104
111
|
}
|
|
105
112
|
|
|
106
113
|
//#endregion
|