From 8e42d4d2749ef657576fe7452e66a704a246a201 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 1 May 2024 14:46:29 -0600 Subject: [PATCH] Framework WIP: - Fix egw not loading in time - Fix manually hiding side content meant auto-opening did not work - Some accessibility adjustments --- kdots/head.tpl | 2 +- kdots/js/EgwFramework.ts | 1 - kdots/js/EgwFrameworkApp.styles.ts | 17 ++++++++++++++++- kdots/js/EgwFrameworkApp.ts | 30 +++++++++++++++++++----------- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/kdots/head.tpl b/kdots/head.tpl index 392f420d22..094dd9dffe 100644 --- a/kdots/head.tpl +++ b/kdots/head.tpl @@ -27,8 +27,8 @@ - {java_script} + {include_wz_tooltip} diff --git a/kdots/js/EgwFramework.ts b/kdots/js/EgwFramework.ts index 0e3439f732..3b78b0d968 100644 --- a/kdots/js/EgwFramework.ts +++ b/kdots/js/EgwFramework.ts @@ -96,7 +96,6 @@ export class EgwFramework extends LitElement get egw() { return window.egw ?? { - app_name: () => "", lang: (t) => t, preference: (n, app) => "" }; diff --git a/kdots/js/EgwFrameworkApp.styles.ts b/kdots/js/EgwFrameworkApp.styles.ts index 78740438a1..061c13d692 100644 --- a/kdots/js/EgwFrameworkApp.styles.ts +++ b/kdots/js/EgwFrameworkApp.styles.ts @@ -23,6 +23,10 @@ export default css` flex: 1 1 20vw; } + .egw_fw_app__name h2 { + margin-inline-start: var(--sl-spacing-medium); + } + .egw_fw_app__header { justify-content: flex-start; align-items: center; @@ -53,7 +57,7 @@ export default css` sl-split-panel::part(divider) { grid-row: start / end; - font-size: 20px; + font-size: var(--sl-font-size-medium); } sl-split-panel > sl-icon { @@ -141,6 +145,17 @@ export default css` [end]; } + sl-split-panel { + display: contents + } + + sl-split-panel::part(divider) { + display: none; + } + + .egw_fw_app__header { + grid-column: start / end; + } .egw_fw_app__main_content { grid-row: main / aside-header; grid-column: start / end; diff --git a/kdots/js/EgwFrameworkApp.ts b/kdots/js/EgwFrameworkApp.ts index cb45eb7712..88990558e3 100644 --- a/kdots/js/EgwFrameworkApp.ts +++ b/kdots/js/EgwFrameworkApp.ts @@ -184,6 +184,10 @@ export class EgwFrameworkApp extends LitElement } // Left side is in pixels, round to 2 decimals let newPosition = Math.round(event.target.panelInfo.side == "left" ? event.target.positionInPixels * 100 : event.target.position * 100) / 100; + + // Update collapsed + this[`${event.target.panelInfo.name}Collapsed`] = newPosition == event.target.panelInfo.hiddenWidth; + let preferenceName = event.target.panelInfo.preference; if(newPosition != event.target.panelInfo.preferenceWidth) { @@ -223,10 +227,12 @@ export class EgwFrameworkApp extends LitElement
${hasLeftSlots ? html` { this.leftCollapsed = !this.leftCollapsed; + // Just in case they collapsed it manually, reset + this.leftPanelInfo.preferenceWidth = this.leftPanelInfo.preferenceWidth || this.leftPanelInfo.defaultWidth; this.requestUpdate("leftCollapsed") }} >` @@ -238,7 +244,7 @@ export class EgwFrameworkApp extends LitElement ${this.name} main-header
-
+
header -
+
main -
+
main-footer
- -
+ `; } }