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:
@@ -43,6 +43,9 @@ export class DeesAppuiMaincontent extends DeesElement {
|
||||
@property({ type: Object })
|
||||
accessor selectedTab: interfaces.IMenuItem | null = null;
|
||||
|
||||
@property({ type: Boolean })
|
||||
accessor showTabs: boolean = true;
|
||||
|
||||
public static styles = [
|
||||
themeDefaultStyles,
|
||||
cssManager.defaultStyles,
|
||||
@@ -78,6 +81,14 @@ export class DeesAppuiMaincontent extends DeesElement {
|
||||
bottom: 0;
|
||||
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>) {
|
||||
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
|
||||
// But we need to ensure the tabs component is ready
|
||||
const tabsComponent = this.shadowRoot.querySelector('dees-appui-tabs') as DeesAppuiTabs;
|
||||
|
||||
Reference in New Issue
Block a user