From f45af6c45573a2b004f73c76f83446a6bbf11172 Mon Sep 17 00:00:00 2001 From: Alexander Brown <448862+DrJKL@users.noreply.github.com> Date: Sat, 17 Jan 2026 15:35:36 -0800 Subject: [PATCH] refactor: restructure BaseModalLayout from flexbox to CSS Grid --- .../widget/layout/BaseModalLayout.vue | 210 ++++++++---------- 1 file changed, 87 insertions(+), 123 deletions(-) diff --git a/src/components/widget/layout/BaseModalLayout.vue b/src/components/widget/layout/BaseModalLayout.vue index ba5727e32..7c85528fb 100644 --- a/src/components/widget/layout/BaseModalLayout.vue +++ b/src/components/widget/layout/BaseModalLayout.vue @@ -3,101 +3,91 @@ class="base-widget-layout rounded-2xl overflow-hidden relative" @keydown.esc.capture="handleEscape" > -
- - - - -
-
-
-
- - -
- - -
- -
- - -

- {{ contentTitle }} -

-
- -
-
+
+
@@ -120,6 +110,7 @@ const isRightPanelOpen = defineModel('rightPanelOpen', { }) const slots = useSlots() +const hasLeftPanel = computed(() => !!slots.leftPanel) const hasRightPanel = computed(() => !!slots.rightPanel) const hideRightPanelButton = defineModel('hideRightPanelButton', { @@ -131,11 +122,6 @@ const showRightPanelButton = computed( ) const BREAKPOINTS = { md: 880 } -const PANEL_SIZES = { - width: 'w-1/3', - minWidth: 'min-w-40', - maxWidth: 'max-w-56' -} const closeDialog = inject(OnCloseKey, () => {}) @@ -158,6 +144,10 @@ const showLeftPanel = computed(() => { return shouldShow }) +const gridStyle = computed(() => ({ + gridTemplateColumns: `${hasLeftPanel.value && showLeftPanel.value ? 'minmax(10rem,14rem)' : '0fr'} 1fr ${isRightPanelOpen.value ? '18rem' : '0fr'}` +})) + const toggleLeftPanel = () => { if (notMobile.value) { isLeftPanelOpen.value = !isLeftPanelOpen.value @@ -197,30 +187,4 @@ function handleEscape(event: KeyboardEvent) { max-width: 1724px; } } - -/* Slide transition for left panel */ -.slide-panel-enter-active, -.slide-panel-leave-active { - transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); -} - -.slide-panel-enter-from, -.slide-panel-leave-to { - transform: translateX(-100%); -} - -/* Slide transition for right panel */ -.slide-panel-right-enter-active, -.slide-panel-right-leave-active { - position: absolute; - right: 0; - top: 0; - height: 100%; - transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); -} - -.slide-panel-right-enter-from, -.slide-panel-right-leave-to { - transform: translateX(100%); -}