feat(dees-appui): add visibility toggles for main/secondary menus and ability to show/hide content tabs; expose corresponding setters and appconfig entries
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-12-29 - 3.6.0 - feat(dees-appui)
|
||||||
|
add visibility toggles for main/secondary menus and ability to show/hide content tabs; expose corresponding setters and appconfig entries
|
||||||
|
|
||||||
|
- ts_web/elements/00group-appui/dees-appui-base: added boolean properties mainmenuVisible, secondarymenuVisible, maincontentTabsVisible; render main and secondary menus conditionally; pass showTabs to dees-appui-maincontent; added setter methods: setMainMenuVisible, setSecondaryMenuCollapsed, setSecondaryMenuVisible, setContentTabsVisible.
|
||||||
|
- ts_web/elements/00group-appui/dees-appui-maincontent: added showTabs property, support for a notabs attribute via styles, updated() and firstUpdated() to apply notabs state so tabs can be hidden/shown dynamically.
|
||||||
|
- ts_web/elements/interfaces/appconfig.ts: expanded appconfig interface to include setMainMenuVisible, setSecondaryMenuCollapsed, setSecondaryMenuVisible, setContentTabsVisible so host app can control visibility programmatically.
|
||||||
|
- No breaking changes: defaults preserve existing behavior (menus and tabs remain visible by default).
|
||||||
|
|
||||||
## 2025-12-29 - 3.5.1 - fix(dees-appui-view)
|
## 2025-12-29 - 3.5.1 - fix(dees-appui-view)
|
||||||
remove DeesAppuiView component, its demo, documentation snippet, and related exports
|
remove DeesAppuiView component, its demo, documentation snippet, and related exports
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-catalog',
|
name: '@design.estate/dees-catalog',
|
||||||
version: '3.5.1',
|
version: '3.6.0',
|
||||||
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,16 @@ export class DeesAppuiBase extends DeesElement {
|
|||||||
@property({ type: Boolean })
|
@property({ type: Boolean })
|
||||||
accessor secondarymenuCollapsed: boolean = false;
|
accessor secondarymenuCollapsed: boolean = false;
|
||||||
|
|
||||||
|
// Visibility states
|
||||||
|
@property({ type: Boolean })
|
||||||
|
accessor mainmenuVisible: boolean = true;
|
||||||
|
|
||||||
|
@property({ type: Boolean })
|
||||||
|
accessor secondarymenuVisible: boolean = true;
|
||||||
|
|
||||||
|
@property({ type: Boolean })
|
||||||
|
accessor maincontentTabsVisible: boolean = true;
|
||||||
|
|
||||||
// Properties for maincontent
|
// Properties for maincontent
|
||||||
@property({ type: Array })
|
@property({ type: Array })
|
||||||
accessor maincontentTabs: interfaces.IMenuItem[] = [];
|
accessor maincontentTabs: interfaces.IMenuItem[] = [];
|
||||||
@@ -213,6 +223,7 @@ export class DeesAppuiBase extends DeesElement {
|
|||||||
@profile-menu-select=${(e: CustomEvent) => this.handleAppbarProfileMenuSelect(e)}
|
@profile-menu-select=${(e: CustomEvent) => this.handleAppbarProfileMenuSelect(e)}
|
||||||
></dees-appui-appbar>
|
></dees-appui-appbar>
|
||||||
<div class="maingrid">
|
<div class="maingrid">
|
||||||
|
${this.mainmenuVisible ? html`
|
||||||
<dees-appui-mainmenu
|
<dees-appui-mainmenu
|
||||||
.logoIcon=${this.mainmenuLogoIcon}
|
.logoIcon=${this.mainmenuLogoIcon}
|
||||||
.logoText=${this.mainmenuLogoText}
|
.logoText=${this.mainmenuLogoText}
|
||||||
@@ -224,6 +235,8 @@ export class DeesAppuiBase extends DeesElement {
|
|||||||
@tab-select=${(e: CustomEvent) => this.handleMainmenuTabSelect(e)}
|
@tab-select=${(e: CustomEvent) => this.handleMainmenuTabSelect(e)}
|
||||||
@collapse-change=${(e: CustomEvent) => this.handleMainmenuCollapseChange(e)}
|
@collapse-change=${(e: CustomEvent) => this.handleMainmenuCollapseChange(e)}
|
||||||
></dees-appui-mainmenu>
|
></dees-appui-mainmenu>
|
||||||
|
` : ''}
|
||||||
|
${this.secondarymenuVisible ? html`
|
||||||
<dees-appui-secondarymenu
|
<dees-appui-secondarymenu
|
||||||
.heading=${this.secondarymenuHeading}
|
.heading=${this.secondarymenuHeading}
|
||||||
.groups=${this.secondarymenuGroups}
|
.groups=${this.secondarymenuGroups}
|
||||||
@@ -232,9 +245,11 @@ export class DeesAppuiBase extends DeesElement {
|
|||||||
@item-select=${(e: CustomEvent) => this.handleSecondarymenuItemSelect(e)}
|
@item-select=${(e: CustomEvent) => this.handleSecondarymenuItemSelect(e)}
|
||||||
@collapse-change=${(e: CustomEvent) => this.handleSecondarymenuCollapseChange(e)}
|
@collapse-change=${(e: CustomEvent) => this.handleSecondarymenuCollapseChange(e)}
|
||||||
></dees-appui-secondarymenu>
|
></dees-appui-secondarymenu>
|
||||||
|
` : ''}
|
||||||
<dees-appui-maincontent
|
<dees-appui-maincontent
|
||||||
.tabs=${this.maincontentTabs}
|
.tabs=${this.maincontentTabs}
|
||||||
.selectedTab=${this.maincontentSelectedTab}
|
.selectedTab=${this.maincontentSelectedTab}
|
||||||
|
.showTabs=${this.maincontentTabsVisible}
|
||||||
@tab-select=${(e: CustomEvent) => this.handleContentTabSelect(e)}
|
@tab-select=${(e: CustomEvent) => this.handleContentTabSelect(e)}
|
||||||
>
|
>
|
||||||
<div class="view-container"></div>
|
<div class="view-container"></div>
|
||||||
@@ -425,6 +440,34 @@ export class DeesAppuiBase extends DeesElement {
|
|||||||
this.mainmenuCollapsed = collapsed;
|
this.mainmenuCollapsed = collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set main menu visibility
|
||||||
|
*/
|
||||||
|
public setMainMenuVisible(visible: boolean): void {
|
||||||
|
this.mainmenuVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set secondary menu collapsed state
|
||||||
|
*/
|
||||||
|
public setSecondaryMenuCollapsed(collapsed: boolean): void {
|
||||||
|
this.secondarymenuCollapsed = collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set secondary menu visibility
|
||||||
|
*/
|
||||||
|
public setSecondaryMenuVisible(visible: boolean): void {
|
||||||
|
this.secondarymenuVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set content tabs visibility
|
||||||
|
*/
|
||||||
|
public setContentTabsVisible(visible: boolean): void {
|
||||||
|
this.maincontentTabsVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a badge on a main menu item
|
* Set a badge on a main menu item
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ export class DeesAppuiMaincontent extends DeesElement {
|
|||||||
@property({ type: Object })
|
@property({ type: Object })
|
||||||
accessor selectedTab: interfaces.IMenuItem | null = null;
|
accessor selectedTab: interfaces.IMenuItem | null = null;
|
||||||
|
|
||||||
|
@property({ type: Boolean })
|
||||||
|
accessor showTabs: boolean = true;
|
||||||
|
|
||||||
public static styles = [
|
public static styles = [
|
||||||
themeDefaultStyles,
|
themeDefaultStyles,
|
||||||
cssManager.defaultStyles,
|
cssManager.defaultStyles,
|
||||||
@@ -78,6 +81,14 @@ export class DeesAppuiMaincontent extends DeesElement {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host([notabs]) .topbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host([notabs]) .content-area {
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -112,8 +123,23 @@ export class DeesAppuiMaincontent extends DeesElement {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updated(changedProperties: Map<string | number | symbol, unknown>) {
|
||||||
|
super.updated(changedProperties);
|
||||||
|
if (changedProperties.has('showTabs')) {
|
||||||
|
if (this.showTabs) {
|
||||||
|
this.removeAttribute('notabs');
|
||||||
|
} else {
|
||||||
|
this.setAttribute('notabs', '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
|
async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
|
||||||
await super.firstUpdated(_changedProperties);
|
await super.firstUpdated(_changedProperties);
|
||||||
|
// Apply initial notabs state
|
||||||
|
if (!this.showTabs) {
|
||||||
|
this.setAttribute('notabs', '');
|
||||||
|
}
|
||||||
// Tab selection is now handled by the dees-appui-tabs component
|
// Tab selection is now handled by the dees-appui-tabs component
|
||||||
// But we need to ensure the tabs component is ready
|
// But we need to ensure the tabs component is ready
|
||||||
const tabsComponent = this.shadowRoot.querySelector('dees-appui-tabs') as DeesAppuiTabs;
|
const tabsComponent = this.shadowRoot.querySelector('dees-appui-tabs') as DeesAppuiTabs;
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ export type TDeesAppuiBase = HTMLElement & {
|
|||||||
removeMainMenuItem: (groupName: string, tabKey: string) => void;
|
removeMainMenuItem: (groupName: string, tabKey: string) => void;
|
||||||
setMainMenuSelection: (tabKey: string) => void;
|
setMainMenuSelection: (tabKey: string) => void;
|
||||||
setMainMenuCollapsed: (collapsed: boolean) => void;
|
setMainMenuCollapsed: (collapsed: boolean) => void;
|
||||||
|
setMainMenuVisible: (visible: boolean) => void;
|
||||||
|
setSecondaryMenuCollapsed: (collapsed: boolean) => void;
|
||||||
|
setSecondaryMenuVisible: (visible: boolean) => void;
|
||||||
|
setContentTabsVisible: (visible: boolean) => void;
|
||||||
setMainMenuBadge: (tabKey: string, badge: string | number) => void;
|
setMainMenuBadge: (tabKey: string, badge: string | number) => void;
|
||||||
clearMainMenuBadge: (tabKey: string) => void;
|
clearMainMenuBadge: (tabKey: string) => void;
|
||||||
setSecondaryMenu: (config: { heading?: string; groups: IMenuGroup[] }) => void;
|
setSecondaryMenu: (config: { heading?: string; groups: IMenuGroup[] }) => void;
|
||||||
|
|||||||
Reference in New Issue
Block a user