@gravity-ui/navigation 6.5.1 → 6.6.0
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.
- package/build/cjs/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.d.ts +2 -1
- package/build/cjs/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.js +5 -1
- package/build/cjs/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.js.map +1 -1
- package/build/cjs/components/types.d.ts +7 -0
- package/build/docs/components/AsideHeader.md +12 -11
- package/build/esm/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.d.ts +2 -1
- package/build/esm/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.js +5 -1
- package/build/esm/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.js.map +1 -1
- package/build/esm/components/types.d.ts +7 -0
- package/package.json +1 -1
|
@@ -15,7 +15,8 @@ export declare function rowsToAllPagesDisplayItems(rows: CompositeBarRow[], opti
|
|
|
15
15
|
* View-mode list: original items plus a clickable header row for each group that has
|
|
16
16
|
* its own action (`MenuGroup.onItemClick` / `href`), inserted before the group's first
|
|
17
17
|
* item; actionable groups without items are appended at the end. Groups without an
|
|
18
|
-
* action are not represented by a row, as before.
|
|
18
|
+
* action are not represented by a row, as before. When an actionable group also sets
|
|
19
|
+
* `hideItemsInAllPages`, its items are omitted and only the header row is listed.
|
|
19
20
|
*/
|
|
20
21
|
export declare function getAllPagesViewModeFlatItems(asideHeaderItems: AsideHeaderItem[], menuGroups: MenuGroup[] | undefined): AsideHeaderItem[];
|
|
21
22
|
/**
|
|
@@ -31,7 +31,8 @@ function rowsToAllPagesDisplayItems(rows, options) {
|
|
|
31
31
|
* View-mode list: original items plus a clickable header row for each group that has
|
|
32
32
|
* its own action (`MenuGroup.onItemClick` / `href`), inserted before the group's first
|
|
33
33
|
* item; actionable groups without items are appended at the end. Groups without an
|
|
34
|
-
* action are not represented by a row, as before.
|
|
34
|
+
* action are not represented by a row, as before. When an actionable group also sets
|
|
35
|
+
* `hideItemsInAllPages`, its items are omitted and only the header row is listed.
|
|
35
36
|
*/
|
|
36
37
|
function getAllPagesViewModeFlatItems(asideHeaderItems, menuGroups) {
|
|
37
38
|
const clickableGroups = (menuGroups !== null && menuGroups !== undefined ? menuGroups : []).filter((group) => group.onItemClick || group.href);
|
|
@@ -48,6 +49,9 @@ function getAllPagesViewModeFlatItems(asideHeaderItems, menuGroups) {
|
|
|
48
49
|
insertedGroupIds.add(group.id);
|
|
49
50
|
result.push(makeHeaderRow(group, item.category));
|
|
50
51
|
}
|
|
52
|
+
if (group === null || group === undefined ? undefined : group.hideItemsInAllPages) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
51
55
|
result.push(item);
|
|
52
56
|
}
|
|
53
57
|
for (const group of clickableGroups) {
|
package/build/cjs/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPagesEditDisplay.js","sources":["../../../../../../../src/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.ts"],"sourcesContent":["import type {MenuGroup} from '../../../types';\nimport {AsideHeaderItem} from '../../types';\nimport {COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX} from '../CompositeBar/constants';\nimport {\n type CompositeBarRow,\n buildCompositeBarRows,\n flattenCompositeBarRows,\n} from '../CompositeBar/grouping';\nimport {makeGroupHeaderAsideItem} from '../CompositeBar/utils';\n\n/** Options passed to {@link buildCompositeBarRows} for All pages panel (edit-mode rows). */\nexport const ALL_PAGES_PANEL_ROW_BUILD_OPTIONS = {\n includeHidden: true,\n includeHiddenGroups: true,\n} as const;\n\nexport function isCompositeBarGroupHeaderItem(item: AsideHeaderItem): boolean {\n return item.id.startsWith(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX);\n}\n\nexport function getCompositeBarHeaderGroupId(itemId: string): string | undefined {\n if (!itemId.startsWith(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX)) {\n return undefined;\n }\n return itemId.slice(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX.length);\n}\n\nexport function rowsToAllPagesDisplayItems(\n rows: CompositeBarRow[],\n options?: {enableGroupHeaderPins?: boolean},\n): AsideHeaderItem[] {\n const showPins = Boolean(options?.enableGroupHeaderPins);\n return rows.map((row) => {\n if (row.kind === 'item') {\n return row.item;\n }\n const header = makeGroupHeaderAsideItem(row.group);\n const firstCategory = row.items[0]?.category;\n return {\n ...header,\n category: firstCategory ?? row.group.title,\n hidden: Boolean(row.group.hidden),\n preventUserRemoving: !showPins,\n };\n });\n}\n\n/**\n * View-mode list: original items plus a clickable header row for each group that has\n * its own action (`MenuGroup.onItemClick` / `href`), inserted before the group's first\n * item; actionable groups without items are appended at the end. Groups without an\n * action are not represented by a row, as before.\n */\nexport function getAllPagesViewModeFlatItems(\n asideHeaderItems: AsideHeaderItem[],\n menuGroups: MenuGroup[] | undefined,\n): AsideHeaderItem[] {\n const clickableGroups = (menuGroups ?? []).filter((group) => group.onItemClick || group.href);\n\n if (clickableGroups.length === 0) {\n return asideHeaderItems;\n }\n\n const clickableGroupsById = new Map(clickableGroups.map((group) => [group.id, group]));\n\n const makeHeaderRow = (group: MenuGroup, category?: string): AsideHeaderItem => ({\n ...makeGroupHeaderAsideItem(group),\n category,\n hidden: Boolean(group.hidden),\n href: group.href,\n onItemClick: group.onItemClick,\n });\n\n const insertedGroupIds = new Set<string>();\n const result: AsideHeaderItem[] = [];\n\n for (const item of asideHeaderItems) {\n const group = item.groupId ? clickableGroupsById.get(item.groupId) : undefined;\n\n if (group && !insertedGroupIds.has(group.id)) {\n insertedGroupIds.add(group.id);\n result.push(makeHeaderRow(group, item.category));\n }\n\n result.push(item);\n }\n\n for (const group of clickableGroups) {\n if (!insertedGroupIds.has(group.id)) {\n result.push(makeHeaderRow(group));\n }\n }\n\n return result;\n}\n\n/**\n * Edit-mode list: top-level items + one row per menu group (header only), same order as CompositeBar.\n */\nexport function getAllPagesEditModeFlatItems(\n asideHeaderItems: AsideHeaderItem[],\n menuGroups: MenuGroup[] | undefined,\n options?: {enableGroupHeaderPins?: boolean},\n): AsideHeaderItem[] {\n if (!menuGroups?.length) {\n return asideHeaderItems.filter((item) => !item.groupId);\n }\n const rows = buildCompositeBarRows(\n asideHeaderItems,\n menuGroups,\n ALL_PAGES_PANEL_ROW_BUILD_OPTIONS,\n );\n return rowsToAllPagesDisplayItems(rows, options);\n}\n\nexport function reorderMenuItemsByCompositeBarRows(\n withoutAllPagesNoDividers: AsideHeaderItem[],\n menuGroups: MenuGroup[],\n oldIndex: number,\n newIndex: number,\n): AsideHeaderItem[] {\n const rows = buildCompositeBarRows(\n withoutAllPagesNoDividers,\n menuGroups,\n ALL_PAGES_PANEL_ROW_BUILD_OPTIONS,\n );\n const reordered = [...rows];\n const [moved] = reordered.splice(oldIndex, 1);\n\n if (moved === undefined) {\n return flattenCompositeBarRows(rows);\n }\n\n reordered.splice(newIndex, 0, moved);\n\n return flattenCompositeBarRows(reordered);\n}\n"],"names":["COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX","makeGroupHeaderAsideItem","buildCompositeBarRows","flattenCompositeBarRows"],"mappings":";;;;;;AAUA;AACa,MAAA,iCAAiC,GAAG;AAC7C,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,mBAAmB,EAAE,IAAI;;AAOvB,SAAU,4BAA4B,CAAC,MAAc,EAAA;IACvD,IAAI,CAAC,MAAM,CAAC,UAAU,CAACA,8CAAoC,CAAC,EAAE;AAC1D,QAAA,OAAO,SAAS;;IAEpB,OAAO,MAAM,CAAC,KAAK,CAACA,8CAAoC,CAAC,MAAM,CAAC;AACpE;AAEgB,SAAA,0BAA0B,CACtC,IAAuB,EACvB,OAA2C,EAAA;AAE3C,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,SAAA,GAAA,SAAA,GAAP,OAAO,CAAE,qBAAqB,CAAC;AACxD,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAI;;AACpB,QAAA,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE;YACrB,OAAO,GAAG,CAAC,IAAI;;QAEnB,MAAM,MAAM,GAAGC,8BAAwB,CAAC,GAAG,CAAC,KAAK,CAAC;QAClD,MAAM,aAAa,GAAG,CAAA,EAAA,GAAA,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAE,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,QAAQ;AAC5C,QAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACO,MAAM,CAAA,EAAA,EACT,QAAQ,EAAE,aAAa,KAAA,IAAA,IAAb,aAAa,KAAA,SAAA,GAAb,aAAa,GAAI,GAAG,CAAC,KAAK,CAAC,KAAK,EAC1C,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EACjC,mBAAmB,EAAE,CAAC,QAAQ,EAChC,CAAA;AACN,KAAC,CAAC;AACN;AAEA
|
|
1
|
+
{"version":3,"file":"allPagesEditDisplay.js","sources":["../../../../../../../src/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.ts"],"sourcesContent":["import type {MenuGroup} from '../../../types';\nimport {AsideHeaderItem} from '../../types';\nimport {COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX} from '../CompositeBar/constants';\nimport {\n type CompositeBarRow,\n buildCompositeBarRows,\n flattenCompositeBarRows,\n} from '../CompositeBar/grouping';\nimport {makeGroupHeaderAsideItem} from '../CompositeBar/utils';\n\n/** Options passed to {@link buildCompositeBarRows} for All pages panel (edit-mode rows). */\nexport const ALL_PAGES_PANEL_ROW_BUILD_OPTIONS = {\n includeHidden: true,\n includeHiddenGroups: true,\n} as const;\n\nexport function isCompositeBarGroupHeaderItem(item: AsideHeaderItem): boolean {\n return item.id.startsWith(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX);\n}\n\nexport function getCompositeBarHeaderGroupId(itemId: string): string | undefined {\n if (!itemId.startsWith(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX)) {\n return undefined;\n }\n return itemId.slice(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX.length);\n}\n\nexport function rowsToAllPagesDisplayItems(\n rows: CompositeBarRow[],\n options?: {enableGroupHeaderPins?: boolean},\n): AsideHeaderItem[] {\n const showPins = Boolean(options?.enableGroupHeaderPins);\n return rows.map((row) => {\n if (row.kind === 'item') {\n return row.item;\n }\n const header = makeGroupHeaderAsideItem(row.group);\n const firstCategory = row.items[0]?.category;\n return {\n ...header,\n category: firstCategory ?? row.group.title,\n hidden: Boolean(row.group.hidden),\n preventUserRemoving: !showPins,\n };\n });\n}\n\n/**\n * View-mode list: original items plus a clickable header row for each group that has\n * its own action (`MenuGroup.onItemClick` / `href`), inserted before the group's first\n * item; actionable groups without items are appended at the end. Groups without an\n * action are not represented by a row, as before. When an actionable group also sets\n * `hideItemsInAllPages`, its items are omitted and only the header row is listed.\n */\nexport function getAllPagesViewModeFlatItems(\n asideHeaderItems: AsideHeaderItem[],\n menuGroups: MenuGroup[] | undefined,\n): AsideHeaderItem[] {\n const clickableGroups = (menuGroups ?? []).filter((group) => group.onItemClick || group.href);\n\n if (clickableGroups.length === 0) {\n return asideHeaderItems;\n }\n\n const clickableGroupsById = new Map(clickableGroups.map((group) => [group.id, group]));\n\n const makeHeaderRow = (group: MenuGroup, category?: string): AsideHeaderItem => ({\n ...makeGroupHeaderAsideItem(group),\n category,\n hidden: Boolean(group.hidden),\n href: group.href,\n onItemClick: group.onItemClick,\n });\n\n const insertedGroupIds = new Set<string>();\n const result: AsideHeaderItem[] = [];\n\n for (const item of asideHeaderItems) {\n const group = item.groupId ? clickableGroupsById.get(item.groupId) : undefined;\n\n if (group && !insertedGroupIds.has(group.id)) {\n insertedGroupIds.add(group.id);\n result.push(makeHeaderRow(group, item.category));\n }\n\n if (group?.hideItemsInAllPages) {\n continue;\n }\n\n result.push(item);\n }\n\n for (const group of clickableGroups) {\n if (!insertedGroupIds.has(group.id)) {\n result.push(makeHeaderRow(group));\n }\n }\n\n return result;\n}\n\n/**\n * Edit-mode list: top-level items + one row per menu group (header only), same order as CompositeBar.\n */\nexport function getAllPagesEditModeFlatItems(\n asideHeaderItems: AsideHeaderItem[],\n menuGroups: MenuGroup[] | undefined,\n options?: {enableGroupHeaderPins?: boolean},\n): AsideHeaderItem[] {\n if (!menuGroups?.length) {\n return asideHeaderItems.filter((item) => !item.groupId);\n }\n const rows = buildCompositeBarRows(\n asideHeaderItems,\n menuGroups,\n ALL_PAGES_PANEL_ROW_BUILD_OPTIONS,\n );\n return rowsToAllPagesDisplayItems(rows, options);\n}\n\nexport function reorderMenuItemsByCompositeBarRows(\n withoutAllPagesNoDividers: AsideHeaderItem[],\n menuGroups: MenuGroup[],\n oldIndex: number,\n newIndex: number,\n): AsideHeaderItem[] {\n const rows = buildCompositeBarRows(\n withoutAllPagesNoDividers,\n menuGroups,\n ALL_PAGES_PANEL_ROW_BUILD_OPTIONS,\n );\n const reordered = [...rows];\n const [moved] = reordered.splice(oldIndex, 1);\n\n if (moved === undefined) {\n return flattenCompositeBarRows(rows);\n }\n\n reordered.splice(newIndex, 0, moved);\n\n return flattenCompositeBarRows(reordered);\n}\n"],"names":["COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX","makeGroupHeaderAsideItem","buildCompositeBarRows","flattenCompositeBarRows"],"mappings":";;;;;;AAUA;AACa,MAAA,iCAAiC,GAAG;AAC7C,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,mBAAmB,EAAE,IAAI;;AAOvB,SAAU,4BAA4B,CAAC,MAAc,EAAA;IACvD,IAAI,CAAC,MAAM,CAAC,UAAU,CAACA,8CAAoC,CAAC,EAAE;AAC1D,QAAA,OAAO,SAAS;;IAEpB,OAAO,MAAM,CAAC,KAAK,CAACA,8CAAoC,CAAC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YACjC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;;;AAIzC,IAAA,OAAO,MAAM;AACjB;AAEA;;AAEG;SACa,4BAA4B,CACxC,gBAAmC,EACnC,UAAmC,EACnC,OAA2C,EAAA;IAE3C,IAAI,EAAC,UAAU,KAAV,IAAA,IAAA,UAAU,KAAV,SAAA,GAAA,SAAA,GAAA,UAAU,CAAE,MAAM,CAAA,EAAE;AACrB,QAAA,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;;IAE3D,MAAM,IAAI,GAAGC,8BAAqB,CAC9B,gBAAgB,EAChB,UAAU,EACV,iCAAiC,CACpC;AACD,IAAA,OAAO,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC;AACpD;AAEM,SAAU,kCAAkC,CAC9C,yBAA4C,EAC5C,UAAuB,EACvB,QAAgB,EAChB,QAAgB,EAAA;IAEhB,MAAM,IAAI,GAAGA,8BAAqB,CAC9B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC;AACD,IAAA,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC;AAC3B,IAAA,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAE7C,IAAA,IAAI,KAAK,KAAK,SAAS,EAAE;AACrB,QAAA,OAAOC,gCAAuB,CAAC,IAAI,CAAC;;IAGxC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,CAAC;AAEpC,IAAA,OAAOA,gCAAuB,CAAC,SAAS,CAAC;AAC7C;;;;;;;;;"}
|
|
@@ -79,6 +79,13 @@ export interface MenuGroup {
|
|
|
79
79
|
* compact (collapsed) sidebar. The children popup keeps working as usual.
|
|
80
80
|
*/
|
|
81
81
|
hideCompactChevron?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* When `true` and the group has its own action (`onItemClick` and/or `href`),
|
|
84
|
+
* the group items are not listed in the All pages panel (view mode) — the group
|
|
85
|
+
* is represented only by its clickable header row. Has no effect for groups
|
|
86
|
+
* without an action.
|
|
87
|
+
*/
|
|
88
|
+
hideItemsInAllPages?: boolean;
|
|
82
89
|
}
|
|
83
90
|
export interface LogoProps {
|
|
84
91
|
text: (() => React.ReactNode) | string;
|
|
@@ -240,17 +240,18 @@ Inline expand/collapse (**`collapsedMenuGroupIds`** / **`onToggleMenuGroupCollap
|
|
|
240
240
|
|
|
241
241
|
Shape for entries in `menuGroups`. When `menuGroups` is set, middle-section items can reference a group with [`AsideHeaderItem.groupId`](#asideheaderitem) equal to `MenuGroup.id`. The composite bar renders group headers and nesting; visibility and collapse behavior are controlled via `AsideHeader` props (see `menuOverflow`, `onMenuGroupsChanged`, `collapsedMenuGroupIds`, etc.).
|
|
242
242
|
|
|
243
|
-
| Name
|
|
244
|
-
|
|
|
245
|
-
| `id`
|
|
246
|
-
| `title`
|
|
247
|
-
| `icon`
|
|
248
|
-
| `iconSize`
|
|
249
|
-
| `hidden`
|
|
250
|
-
| `popupTitle`
|
|
251
|
-
| `onItemClick`
|
|
252
|
-
| `href`
|
|
253
|
-
| `hideCompactChevron`
|
|
243
|
+
| Name | Description |
|
|
244
|
+
| :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
245
|
+
| `id` | Stable group identifier; must match `AsideHeaderItem.groupId` for items that belong to this group. |
|
|
246
|
+
| `title` | Group label shown on the inline group header in the expanded sidebar (and in flows that use this title). |
|
|
247
|
+
| `icon` | Optional [`Icon`](https://github.com/gravity-ui/uikit/tree/main/src/components/Icon) data for the group header. |
|
|
248
|
+
| `iconSize` | Group header icon size; set it to the same value as on menu items so the group row matches them (e.g. in the **All pages** panel). |
|
|
249
|
+
| `hidden` | When `true`, hides the group from the main navigation; items in that group are omitted there. The **All pages** panel can still surface the group row for visibility edits when callbacks like `onMenuGroupsChanged` are used. |
|
|
250
|
+
| `popupTitle` | Optional heading used **only** in the compact sidebar popup that lists a group’s children. Does not replace `title` for the inline group header or other surfaces. |
|
|
251
|
+
| `onItemClick` | Optional main action for the group header (same signature as `AsideHeaderItem.onItemClick`; receives the synthetic group-header item). When the group has its own action (`onItemClick` and/or `href`), in the inline layout (`menuOverflow="scroll"`, expanded sidebar) clicking the header row triggers the action like a regular menu item, and **only the chevron** toggles expand/collapse. Without an own action the whole header row toggles the group, as before. Such groups are also listed as a clickable row in the **All pages** panel (view mode). |
|
|
252
|
+
| `href` | Optional link for the group header; renders the header row as an anchor. Same click-behavior split as `onItemClick`. |
|
|
253
|
+
| `hideCompactChevron` | When `true`, the small chevron is not rendered on the group anchor in the compact (collapsed) sidebar. The children popup keeps working as usual. |
|
|
254
|
+
| `hideItemsInAllPages` | When `true` and the group has its own action (`onItemClick` and/or `href`), the group items are not listed in the **All pages** panel (view mode) — the group is represented only by its clickable header row. Has no effect for groups without an action. |
|
|
254
255
|
|
|
255
256
|
### `editMenuProps`
|
|
256
257
|
|
|
@@ -15,7 +15,8 @@ export declare function rowsToAllPagesDisplayItems(rows: CompositeBarRow[], opti
|
|
|
15
15
|
* View-mode list: original items plus a clickable header row for each group that has
|
|
16
16
|
* its own action (`MenuGroup.onItemClick` / `href`), inserted before the group's first
|
|
17
17
|
* item; actionable groups without items are appended at the end. Groups without an
|
|
18
|
-
* action are not represented by a row, as before.
|
|
18
|
+
* action are not represented by a row, as before. When an actionable group also sets
|
|
19
|
+
* `hideItemsInAllPages`, its items are omitted and only the header row is listed.
|
|
19
20
|
*/
|
|
20
21
|
export declare function getAllPagesViewModeFlatItems(asideHeaderItems: AsideHeaderItem[], menuGroups: MenuGroup[] | undefined): AsideHeaderItem[];
|
|
21
22
|
/**
|
|
@@ -29,7 +29,8 @@ function rowsToAllPagesDisplayItems(rows, options) {
|
|
|
29
29
|
* View-mode list: original items plus a clickable header row for each group that has
|
|
30
30
|
* its own action (`MenuGroup.onItemClick` / `href`), inserted before the group's first
|
|
31
31
|
* item; actionable groups without items are appended at the end. Groups without an
|
|
32
|
-
* action are not represented by a row, as before.
|
|
32
|
+
* action are not represented by a row, as before. When an actionable group also sets
|
|
33
|
+
* `hideItemsInAllPages`, its items are omitted and only the header row is listed.
|
|
33
34
|
*/
|
|
34
35
|
function getAllPagesViewModeFlatItems(asideHeaderItems, menuGroups) {
|
|
35
36
|
const clickableGroups = (menuGroups !== null && menuGroups !== undefined ? menuGroups : []).filter((group) => group.onItemClick || group.href);
|
|
@@ -46,6 +47,9 @@ function getAllPagesViewModeFlatItems(asideHeaderItems, menuGroups) {
|
|
|
46
47
|
insertedGroupIds.add(group.id);
|
|
47
48
|
result.push(makeHeaderRow(group, item.category));
|
|
48
49
|
}
|
|
50
|
+
if (group === null || group === undefined ? undefined : group.hideItemsInAllPages) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
49
53
|
result.push(item);
|
|
50
54
|
}
|
|
51
55
|
for (const group of clickableGroups) {
|
package/build/esm/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPagesEditDisplay.js","sources":["../../../../../../../src/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.ts"],"sourcesContent":["import type {MenuGroup} from '../../../types';\nimport {AsideHeaderItem} from '../../types';\nimport {COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX} from '../CompositeBar/constants';\nimport {\n type CompositeBarRow,\n buildCompositeBarRows,\n flattenCompositeBarRows,\n} from '../CompositeBar/grouping';\nimport {makeGroupHeaderAsideItem} from '../CompositeBar/utils';\n\n/** Options passed to {@link buildCompositeBarRows} for All pages panel (edit-mode rows). */\nexport const ALL_PAGES_PANEL_ROW_BUILD_OPTIONS = {\n includeHidden: true,\n includeHiddenGroups: true,\n} as const;\n\nexport function isCompositeBarGroupHeaderItem(item: AsideHeaderItem): boolean {\n return item.id.startsWith(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX);\n}\n\nexport function getCompositeBarHeaderGroupId(itemId: string): string | undefined {\n if (!itemId.startsWith(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX)) {\n return undefined;\n }\n return itemId.slice(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX.length);\n}\n\nexport function rowsToAllPagesDisplayItems(\n rows: CompositeBarRow[],\n options?: {enableGroupHeaderPins?: boolean},\n): AsideHeaderItem[] {\n const showPins = Boolean(options?.enableGroupHeaderPins);\n return rows.map((row) => {\n if (row.kind === 'item') {\n return row.item;\n }\n const header = makeGroupHeaderAsideItem(row.group);\n const firstCategory = row.items[0]?.category;\n return {\n ...header,\n category: firstCategory ?? row.group.title,\n hidden: Boolean(row.group.hidden),\n preventUserRemoving: !showPins,\n };\n });\n}\n\n/**\n * View-mode list: original items plus a clickable header row for each group that has\n * its own action (`MenuGroup.onItemClick` / `href`), inserted before the group's first\n * item; actionable groups without items are appended at the end. Groups without an\n * action are not represented by a row, as before.\n */\nexport function getAllPagesViewModeFlatItems(\n asideHeaderItems: AsideHeaderItem[],\n menuGroups: MenuGroup[] | undefined,\n): AsideHeaderItem[] {\n const clickableGroups = (menuGroups ?? []).filter((group) => group.onItemClick || group.href);\n\n if (clickableGroups.length === 0) {\n return asideHeaderItems;\n }\n\n const clickableGroupsById = new Map(clickableGroups.map((group) => [group.id, group]));\n\n const makeHeaderRow = (group: MenuGroup, category?: string): AsideHeaderItem => ({\n ...makeGroupHeaderAsideItem(group),\n category,\n hidden: Boolean(group.hidden),\n href: group.href,\n onItemClick: group.onItemClick,\n });\n\n const insertedGroupIds = new Set<string>();\n const result: AsideHeaderItem[] = [];\n\n for (const item of asideHeaderItems) {\n const group = item.groupId ? clickableGroupsById.get(item.groupId) : undefined;\n\n if (group && !insertedGroupIds.has(group.id)) {\n insertedGroupIds.add(group.id);\n result.push(makeHeaderRow(group, item.category));\n }\n\n result.push(item);\n }\n\n for (const group of clickableGroups) {\n if (!insertedGroupIds.has(group.id)) {\n result.push(makeHeaderRow(group));\n }\n }\n\n return result;\n}\n\n/**\n * Edit-mode list: top-level items + one row per menu group (header only), same order as CompositeBar.\n */\nexport function getAllPagesEditModeFlatItems(\n asideHeaderItems: AsideHeaderItem[],\n menuGroups: MenuGroup[] | undefined,\n options?: {enableGroupHeaderPins?: boolean},\n): AsideHeaderItem[] {\n if (!menuGroups?.length) {\n return asideHeaderItems.filter((item) => !item.groupId);\n }\n const rows = buildCompositeBarRows(\n asideHeaderItems,\n menuGroups,\n ALL_PAGES_PANEL_ROW_BUILD_OPTIONS,\n );\n return rowsToAllPagesDisplayItems(rows, options);\n}\n\nexport function reorderMenuItemsByCompositeBarRows(\n withoutAllPagesNoDividers: AsideHeaderItem[],\n menuGroups: MenuGroup[],\n oldIndex: number,\n newIndex: number,\n): AsideHeaderItem[] {\n const rows = buildCompositeBarRows(\n withoutAllPagesNoDividers,\n menuGroups,\n ALL_PAGES_PANEL_ROW_BUILD_OPTIONS,\n );\n const reordered = [...rows];\n const [moved] = reordered.splice(oldIndex, 1);\n\n if (moved === undefined) {\n return flattenCompositeBarRows(rows);\n }\n\n reordered.splice(newIndex, 0, moved);\n\n return flattenCompositeBarRows(reordered);\n}\n"],"names":[],"mappings":";;;;AAUA;AACa,MAAA,iCAAiC,GAAG;AAC7C,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,mBAAmB,EAAE,IAAI;;AAOvB,SAAU,4BAA4B,CAAC,MAAc,EAAA;IACvD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,oCAAoC,CAAC,EAAE;AAC1D,QAAA,OAAO,SAAS;;IAEpB,OAAO,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,MAAM,CAAC;AACpE;AAEgB,SAAA,0BAA0B,CACtC,IAAuB,EACvB,OAA2C,EAAA;AAE3C,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,SAAA,GAAA,SAAA,GAAP,OAAO,CAAE,qBAAqB,CAAC;AACxD,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAI;;AACpB,QAAA,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE;YACrB,OAAO,GAAG,CAAC,IAAI;;QAEnB,MAAM,MAAM,GAAG,wBAAwB,CAAC,GAAG,CAAC,KAAK,CAAC;QAClD,MAAM,aAAa,GAAG,CAAA,EAAA,GAAA,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAE,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,QAAQ;AAC5C,QAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACO,MAAM,CAAA,EAAA,EACT,QAAQ,EAAE,aAAa,KAAA,IAAA,IAAb,aAAa,KAAA,SAAA,GAAb,aAAa,GAAI,GAAG,CAAC,KAAK,CAAC,KAAK,EAC1C,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EACjC,mBAAmB,EAAE,CAAC,QAAQ,EAChC,CAAA;AACN,KAAC,CAAC;AACN;AAEA
|
|
1
|
+
{"version":3,"file":"allPagesEditDisplay.js","sources":["../../../../../../../src/components/AsideHeader/components/AllPagesPanel/allPagesEditDisplay.ts"],"sourcesContent":["import type {MenuGroup} from '../../../types';\nimport {AsideHeaderItem} from '../../types';\nimport {COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX} from '../CompositeBar/constants';\nimport {\n type CompositeBarRow,\n buildCompositeBarRows,\n flattenCompositeBarRows,\n} from '../CompositeBar/grouping';\nimport {makeGroupHeaderAsideItem} from '../CompositeBar/utils';\n\n/** Options passed to {@link buildCompositeBarRows} for All pages panel (edit-mode rows). */\nexport const ALL_PAGES_PANEL_ROW_BUILD_OPTIONS = {\n includeHidden: true,\n includeHiddenGroups: true,\n} as const;\n\nexport function isCompositeBarGroupHeaderItem(item: AsideHeaderItem): boolean {\n return item.id.startsWith(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX);\n}\n\nexport function getCompositeBarHeaderGroupId(itemId: string): string | undefined {\n if (!itemId.startsWith(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX)) {\n return undefined;\n }\n return itemId.slice(COMPOSITE_BAR_GROUP_HEADER_ID_PREFIX.length);\n}\n\nexport function rowsToAllPagesDisplayItems(\n rows: CompositeBarRow[],\n options?: {enableGroupHeaderPins?: boolean},\n): AsideHeaderItem[] {\n const showPins = Boolean(options?.enableGroupHeaderPins);\n return rows.map((row) => {\n if (row.kind === 'item') {\n return row.item;\n }\n const header = makeGroupHeaderAsideItem(row.group);\n const firstCategory = row.items[0]?.category;\n return {\n ...header,\n category: firstCategory ?? row.group.title,\n hidden: Boolean(row.group.hidden),\n preventUserRemoving: !showPins,\n };\n });\n}\n\n/**\n * View-mode list: original items plus a clickable header row for each group that has\n * its own action (`MenuGroup.onItemClick` / `href`), inserted before the group's first\n * item; actionable groups without items are appended at the end. Groups without an\n * action are not represented by a row, as before. When an actionable group also sets\n * `hideItemsInAllPages`, its items are omitted and only the header row is listed.\n */\nexport function getAllPagesViewModeFlatItems(\n asideHeaderItems: AsideHeaderItem[],\n menuGroups: MenuGroup[] | undefined,\n): AsideHeaderItem[] {\n const clickableGroups = (menuGroups ?? []).filter((group) => group.onItemClick || group.href);\n\n if (clickableGroups.length === 0) {\n return asideHeaderItems;\n }\n\n const clickableGroupsById = new Map(clickableGroups.map((group) => [group.id, group]));\n\n const makeHeaderRow = (group: MenuGroup, category?: string): AsideHeaderItem => ({\n ...makeGroupHeaderAsideItem(group),\n category,\n hidden: Boolean(group.hidden),\n href: group.href,\n onItemClick: group.onItemClick,\n });\n\n const insertedGroupIds = new Set<string>();\n const result: AsideHeaderItem[] = [];\n\n for (const item of asideHeaderItems) {\n const group = item.groupId ? clickableGroupsById.get(item.groupId) : undefined;\n\n if (group && !insertedGroupIds.has(group.id)) {\n insertedGroupIds.add(group.id);\n result.push(makeHeaderRow(group, item.category));\n }\n\n if (group?.hideItemsInAllPages) {\n continue;\n }\n\n result.push(item);\n }\n\n for (const group of clickableGroups) {\n if (!insertedGroupIds.has(group.id)) {\n result.push(makeHeaderRow(group));\n }\n }\n\n return result;\n}\n\n/**\n * Edit-mode list: top-level items + one row per menu group (header only), same order as CompositeBar.\n */\nexport function getAllPagesEditModeFlatItems(\n asideHeaderItems: AsideHeaderItem[],\n menuGroups: MenuGroup[] | undefined,\n options?: {enableGroupHeaderPins?: boolean},\n): AsideHeaderItem[] {\n if (!menuGroups?.length) {\n return asideHeaderItems.filter((item) => !item.groupId);\n }\n const rows = buildCompositeBarRows(\n asideHeaderItems,\n menuGroups,\n ALL_PAGES_PANEL_ROW_BUILD_OPTIONS,\n );\n return rowsToAllPagesDisplayItems(rows, options);\n}\n\nexport function reorderMenuItemsByCompositeBarRows(\n withoutAllPagesNoDividers: AsideHeaderItem[],\n menuGroups: MenuGroup[],\n oldIndex: number,\n newIndex: number,\n): AsideHeaderItem[] {\n const rows = buildCompositeBarRows(\n withoutAllPagesNoDividers,\n menuGroups,\n ALL_PAGES_PANEL_ROW_BUILD_OPTIONS,\n );\n const reordered = [...rows];\n const [moved] = reordered.splice(oldIndex, 1);\n\n if (moved === undefined) {\n return flattenCompositeBarRows(rows);\n }\n\n reordered.splice(newIndex, 0, moved);\n\n return flattenCompositeBarRows(reordered);\n}\n"],"names":[],"mappings":";;;;AAUA;AACa,MAAA,iCAAiC,GAAG;AAC7C,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,mBAAmB,EAAE,IAAI;;AAOvB,SAAU,4BAA4B,CAAC,MAAc,EAAA;IACvD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,oCAAoC,CAAC,EAAE;AAC1D,QAAA,OAAO,SAAS;;IAEpB,OAAO,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,MAAM,CAAC;AACpE;AAEgB,SAAA,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,CAAC,KAAK,CAAC,CAAC;;;AAIzC,IAAA,OAAO,MAAM;AACjB;AAEA;;AAEG;SACa,4BAA4B,CACxC,gBAAmC,EACnC,UAAmC,EACnC,OAA2C,EAAA;IAE3C,IAAI,EAAC,UAAU,KAAV,IAAA,IAAA,UAAU,KAAV,SAAA,GAAA,SAAA,GAAA,UAAU,CAAE,MAAM,CAAA,EAAE;AACrB,QAAA,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;;IAE3D,MAAM,IAAI,GAAG,qBAAqB,CAC9B,gBAAgB,EAChB,UAAU,EACV,iCAAiC,CACpC;AACD,IAAA,OAAO,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC;AACpD;AAEM,SAAU,kCAAkC,CAC9C,yBAA4C,EAC5C,UAAuB,EACvB,QAAgB,EAChB,QAAgB,EAAA;IAEhB,MAAM,IAAI,GAAG,qBAAqB,CAC9B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC;AACD,IAAA,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC;AAC3B,IAAA,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAE7C,IAAA,IAAI,KAAK,KAAK,SAAS,EAAE;AACrB,QAAA,OAAO,uBAAuB,CAAC,IAAI,CAAC;;IAGxC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,CAAC;AAEpC,IAAA,OAAO,uBAAuB,CAAC,SAAS,CAAC;AAC7C;;;;"}
|
|
@@ -79,6 +79,13 @@ export interface MenuGroup {
|
|
|
79
79
|
* compact (collapsed) sidebar. The children popup keeps working as usual.
|
|
80
80
|
*/
|
|
81
81
|
hideCompactChevron?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* When `true` and the group has its own action (`onItemClick` and/or `href`),
|
|
84
|
+
* the group items are not listed in the All pages panel (view mode) — the group
|
|
85
|
+
* is represented only by its clickable header row. Has no effect for groups
|
|
86
|
+
* without an action.
|
|
87
|
+
*/
|
|
88
|
+
hideItemsInAllPages?: boolean;
|
|
82
89
|
}
|
|
83
90
|
export interface LogoProps {
|
|
84
91
|
text: (() => React.ReactNode) | string;
|