kdots improvements:

- Fix infinite loop in updateComplete()
- hide/show sides now return updateComplete promise
- If etemplate has only 1 rendered template, and that template has a slot, move the whole etemplate (DOMContainer) not just the et2-template
This commit is contained in:
nathan 2025-03-03 13:49:16 -07:00
parent 8ab8c6f1f6
commit 48220b8b14
3 changed files with 30 additions and 7 deletions

View File

@ -667,4 +667,10 @@ div.et2_nextmatch .egwGridView_outer .egwGridView_scrollarea table tr {
div.et2_nextmatch .egwGridView_outer .egwGridView_scrollarea table tr.selected { div.et2_nextmatch .egwGridView_outer .egwGridView_scrollarea table tr.selected {
background-color: var(--highlight-background-color); background-color: var(--highlight-background-color);
} }
div.et2_toolbar .et2_toolbar_actionlist > span {
gap: var(--sl-spacing-small);
}
div.et2_toolbar .et2_toolbar_actionlist > span * {
margin-right: 0px;
}
/*** END WIDGETS ***/ /*** END WIDGETS ***/

View File

@ -652,5 +652,13 @@ div.et2_nextmatch {
} }
} }
div.et2_toolbar {
.et2_toolbar_actionlist > span {
gap: var(--sl-spacing-small);
* {
margin-right: 0px;
}
}
}
/*** END WIDGETS ***/ /*** END WIDGETS ***/

View File

@ -171,7 +171,7 @@ export class EgwFrameworkApp extends LitElement
protected async getUpdateComplete() : Promise<boolean> protected async getUpdateComplete() : Promise<boolean>
{ {
const result = await super.updateComplete; const result = await super.getUpdateComplete();
await this.loadingPromise; await this.loadingPromise;
return result return result
@ -280,22 +280,22 @@ export class EgwFrameworkApp extends LitElement
public showLeft() public showLeft()
{ {
this.showSide("left"); return this.showSide("left");
} }
public hideLeft() public hideLeft()
{ {
this.hideSide("left"); return this.hideSide("left");
} }
public showRight() public showRight()
{ {
this.showSide("right"); return this.showSide("right");
} }
public hideRight() public hideRight()
{ {
this.hideSide("right"); return this.hideSide("right");
} }
public async print() public async print()
@ -382,6 +382,7 @@ export class EgwFrameworkApp extends LitElement
const attribute = `${side}Collapsed`; const attribute = `${side}Collapsed`;
this[attribute] = false; this[attribute] = false;
this[`${side}Splitter`].position = this[`${side}PanelInfo`].preferenceWidth || this[`${side}PanelInfo`].defaultWidth; this[`${side}Splitter`].position = this[`${side}PanelInfo`].preferenceWidth || this[`${side}PanelInfo`].defaultWidth;
return this.updateComplete;
} }
protected hideSide(side : "left" | "right") protected hideSide(side : "left" | "right")
@ -391,6 +392,7 @@ export class EgwFrameworkApp extends LitElement
this[attribute] = true; this[attribute] = true;
this[`${side}Splitter`].position = this[`${side}PanelInfo`].hiddenWidth; this[`${side}Splitter`].position = this[`${side}PanelInfo`].hiddenWidth;
this.requestUpdate(attribute, oldValue); this.requestUpdate(attribute, oldValue);
return this.updateComplete;
} }
get egw() get egw()
@ -426,9 +428,16 @@ export class EgwFrameworkApp extends LitElement
return; return;
} }
// Move templates with slots // Move templates with slots (along with DOMContainer if only one template there to keep it together)
const slottedTemplates = etemplate.DOMContainer.querySelectorAll(":scope > [slot]"); const slottedTemplates = etemplate.DOMContainer.querySelectorAll(":scope > [slot]");
if(slottedTemplates.length == 1 && etemplate.DOMContainer.childElementCount == 1)
{
etemplate.DOMContainer.slot = slottedTemplates[0].slot;
}
else
{
slottedTemplates.forEach(node => {this.appendChild(node);}); slottedTemplates.forEach(node => {this.appendChild(node);});
}
// Move top level slotted components // Move top level slotted components
const slottedWidgets = etemplate.widgetContainer.querySelectorAll(":scope > [slot]") const slottedWidgets = etemplate.widgetContainer.querySelectorAll(":scope > [slot]")