diff --git a/mathesar_ui/src/systems/table-view/row/GroupHeader.svelte b/mathesar_ui/src/systems/table-view/row/GroupHeader.svelte index f126e42876..69d819ff2a 100644 --- a/mathesar_ui/src/systems/table-view/row/GroupHeader.svelte +++ b/mathesar_ui/src/systems/table-view/row/GroupHeader.svelte @@ -20,6 +20,9 @@ export let recordSummariesForSheet: RecordSummariesForSheet; export let fileManifestsForSheet: AssociatedCellValuesForSheet; + let containerElement: HTMLElement; + let containerWidth = 0; + $: ({ columnIds, preprocIds } = grouping); $: preProcFunctionsForColumn = columnIds.map( (columnId) => @@ -32,10 +35,27 @@ )?.name : undefined, ); + + function handleWheel(event: WheelEvent) { + // Pass horizontal scroll to the parent sheet + if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) { + const sheetBody = containerElement?.closest( + '[data-sheet-element="body"]', + ); + if (sheetBody) { + sheetBody.scrollLeft += event.deltaX; + } + } + } -
+
{#each columnIds as columnId, index (columnId)} {@const stringColumnId = String(columnId)} @@ -49,6 +69,7 @@ preprocName={preprocNames[index]} {fileManifestsForSheet} totalColumns={columnIds.length} + {containerWidth} /> {/each}
@@ -62,18 +83,23 @@ diff --git a/mathesar_ui/src/systems/table-view/row/GroupHeaderCellValue.svelte b/mathesar_ui/src/systems/table-view/row/GroupHeaderCellValue.svelte index 059ee23e93..2d77b20d35 100644 --- a/mathesar_ui/src/systems/table-view/row/GroupHeaderCellValue.svelte +++ b/mathesar_ui/src/systems/table-view/row/GroupHeaderCellValue.svelte @@ -1,6 +1,6 @@ - - - {processedColumn?.column.name ?? ''} - {#if preprocName} - {preprocName} - {/if} - - - {#if recordSummary} - - {:else if processedColumn?.abstractType.identifier === 'file' && fileManifest} - - {fileManifest.uri} - - {:else} + + 0 ? `${maxItemWidth}px` : 'none'} + style:flex-basis={maxItemWidth > 0 ? `${maxItemWidth}px` : 'auto'} + > + - + {processedColumn?.column.name ?? ''} + {#if preprocName} + {preprocName} + {/if} - {/if} + + + {#if recordSummary} + + {:else if processedColumn?.abstractType.identifier === 'file' && fileManifest} + + {fileManifest.uri} + + {:else} + + + + {/if} + - +
{tooltipText}
+ diff --git a/mathesar_ui/src/systems/table-view/table-inspector/TableInspector.svelte b/mathesar_ui/src/systems/table-view/table-inspector/TableInspector.svelte index 795388ba7e..eb773c90e9 100644 --- a/mathesar_ui/src/systems/table-view/table-inspector/TableInspector.svelte +++ b/mathesar_ui/src/systems/table-view/table-inspector/TableInspector.svelte @@ -5,7 +5,7 @@ import InspectorTabContent from '@mathesar/components/InspectorTabContent.svelte'; import type { Table } from '@mathesar/models/Table'; import { isTableView } from '@mathesar/utils/tables'; - import { TabContainer, defined } from '@mathesar-component-library'; + import { TabContainer } from '@mathesar-component-library'; import CellMode from './cell/CellMode.svelte'; import ColumnMode from './column/ColumnMode.svelte';