feat: add interfaces for secondary menu items with various types and functionalities

This commit is contained in:
2026-01-03 01:24:36 +00:00
parent c41268cd4e
commit 57b323b53c
23 changed files with 1069 additions and 240 deletions

View File

@@ -2,6 +2,7 @@ import type { TemplateResult } from '@design.estate/dees-element';
import type { IAppBarMenuItem } from './appbarmenuitem.js';
import type { IMenuItem } from './tab.js';
import type { IMenuGroup } from './menugroup.js';
import type { ISecondaryMenuGroup, ISecondaryMenuItem } from './secondarymenu.js';
// Forward declaration for circular reference
export type TDeesAppui = HTMLElement & {
@@ -25,9 +26,9 @@ export type TDeesAppui = HTMLElement & {
setContentTabsAutoHide: (enabled: boolean, threshold?: number) => void;
setMainMenuBadge: (tabKey: string, badge: string | number) => void;
clearMainMenuBadge: (tabKey: string) => void;
setSecondaryMenu: (config: { heading?: string; groups: IMenuGroup[] }) => void;
updateSecondaryMenuGroup: (groupName: string, update: Partial<IMenuGroup>) => void;
addSecondaryMenuItem: (groupName: string, item: IMenuGroup['items'][0]) => void;
setSecondaryMenu: (config: { heading?: string; groups: ISecondaryMenuGroup[] }) => void;
updateSecondaryMenuGroup: (groupName: string, update: Partial<ISecondaryMenuGroup>) => void;
addSecondaryMenuItem: (groupName: string, item: ISecondaryMenuItem) => void;
setSecondaryMenuSelection: (itemKey: string) => void;
clearSecondaryMenu: () => void;
setContentTabs: (tabs: IMenuItem[]) => void;
@@ -36,6 +37,9 @@ export type TDeesAppui = HTMLElement & {
selectContentTab: (tabKey: string) => void;
getSelectedContentTab: () => IMenuItem | undefined;
activityLog: IActivityLogAPI;
setActivityLogVisible: (visible: boolean) => void;
toggleActivityLog: () => void;
getActivityLogVisible: () => boolean;
navigateToView: (viewId: string, params?: Record<string, string>) => Promise<boolean>;
getCurrentView: () => IViewDefinition | undefined;
};
@@ -136,7 +140,7 @@ export interface IViewDefinition {
| (() => TemplateResult)
| (() => Promise<string | (new () => HTMLElement) | (() => TemplateResult)>);
/** Secondary menu items specific to this view */
secondaryMenu?: IMenuGroup[];
secondaryMenu?: ISecondaryMenuGroup[];
/** Content tabs specific to this view */
contentTabs?: IMenuItem[];
/** Optional route path (defaults to id). Supports params like 'settings/:section' */