Skip to content

Commit c30ffdd

Browse files
committed
add borders
1 parent 6f5f5c5 commit c30ffdd

File tree

3 files changed

+18
-41
lines changed

3 files changed

+18
-41
lines changed

client/packages/lowcoder/src/comps/comps/tableLiteComp/parts/TableContainer.tsx

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import styled from 'styled-components';
44

55
const MainContainer = styled.div<{
66
$mode: 'AUTO' | 'FIXED';
7-
$height?: number;
87
}>`
98
display: flex;
109
flex-direction: column;
1110
height: 100%;
1211
overflow: hidden;
1312
position: relative;
13+
border: 4px solid red;
1414
`;
1515

1616
const StickyToolbar = styled.div<{
@@ -33,14 +33,12 @@ const DefaultToolbar = styled.div`
3333
const TableSection = styled.div<{
3434
$mode: 'AUTO' | 'FIXED';
3535
}>`
36-
flex: 1;
37-
min-height: 0;
3836
overflow: ${props => props.$mode === 'FIXED' ? 'auto' : 'visible'};
37+
border: 4px solid blue;
3938
`;
4039

4140
interface TableContainerProps {
4241
mode: 'AUTO' | 'FIXED';
43-
containerHeight?: number;
4442
toolbarPosition: 'above' | 'below' | 'close';
4543
stickyToolbar: boolean;
4644
showToolbar: boolean;
@@ -51,51 +49,30 @@ interface TableContainerProps {
5149

5250
export const TableContainer: React.FC<TableContainerProps> = ({
5351
mode,
54-
containerHeight,
5552
toolbarPosition,
5653
stickyToolbar,
5754
showToolbar,
5855
toolbar,
5956
children,
6057
containerRef
6158
}) => {
62-
const ToolbarComponent = stickyToolbar ? StickyToolbar : DefaultToolbar;
63-
64-
const renderToolbarOutside = stickyToolbar && showToolbar;
65-
const renderToolbarInside = !stickyToolbar && showToolbar;
59+
6660

6761
return (
68-
<MainContainer $mode={mode} $height={containerHeight} ref={containerRef}>
69-
{/* Above toolbar (sticky) */}
70-
{renderToolbarOutside && toolbarPosition === 'above' && (
71-
<ToolbarComponent $position="above">
72-
{toolbar}
73-
</ToolbarComponent>
62+
<MainContainer $mode={mode} ref={containerRef}>
63+
<TableSection $mode={mode}>
64+
{showToolbar && toolbarPosition === 'above' && (
65+
stickyToolbar
66+
? <StickyToolbar $position="above">{toolbar}</StickyToolbar>
67+
: <DefaultToolbar>{toolbar}</DefaultToolbar>
7468
)}
75-
76-
{/* Table content + optional non-sticky toolbar inside scrollable area */}
77-
<TableSection $mode={mode}>
78-
{/* Non-sticky toolbar ABOVE inside scrollable area */}
79-
{renderToolbarInside && toolbarPosition === 'above' && (
80-
<DefaultToolbar>
81-
{toolbar}
82-
</DefaultToolbar>
83-
)}
84-
{children}
85-
{/* Non-sticky toolbar BELOW inside scrollable area */}
86-
{renderToolbarInside && toolbarPosition === 'below' && (
87-
<DefaultToolbar>
88-
{toolbar}
89-
</DefaultToolbar>
90-
)}
91-
</TableSection>
92-
93-
{/* Below toolbar (sticky) */}
94-
{renderToolbarOutside && toolbarPosition === 'below' && (
95-
<ToolbarComponent $position="below">
96-
{toolbar}
97-
</ToolbarComponent>
69+
{children}
70+
{showToolbar && toolbarPosition === 'below' && (
71+
stickyToolbar
72+
? <StickyToolbar $position="below">{toolbar}</StickyToolbar>
73+
: <DefaultToolbar>{toolbar}</DefaultToolbar>
9874
)}
99-
</MainContainer>
75+
</TableSection>
76+
</MainContainer>
10077
);
10178
};

client/packages/lowcoder/src/comps/comps/tableLiteComp/parts/TableRenderer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ function TableRendererComp<RecordType extends object>(props: TableRendererProps<
9494
// VIRTUALIZED: High performance for large datasets
9595
if (virtualizationConfig.enabled && heights.canVirtualize) {
9696
console.log('VirtualizedTable');
97+
console.log('VirtualizedTable scrollConfig', { x: totalWidth, y: bodyHeight });
9798
const scrollConfig = { x: totalWidth, y: bodyHeight };
9899
return (
99100
<VirtualizedTable
@@ -117,6 +118,7 @@ function TableRendererComp<RecordType extends object>(props: TableRendererProps<
117118

118119
// FIXED: Regular height-constrained mode without internal vertical scroll
119120
// Let the outer container handle vertical scrolling so the footer appears right after the table
121+
console.log('FixedModeTable', 'scrollConfig', { x: totalWidth, y: bodyHeight });
120122
return (
121123
<FixedModeTable
122124
{...baseTableProps}

client/packages/lowcoder/src/comps/comps/tableLiteComp/tableCompView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ export const TableCompView = React.memo((props: {
177177
return (
178178
<TableContainer
179179
mode={mode as 'AUTO' | 'FIXED'}
180-
containerHeight={mode === 'FIXED' ? containerHeight : undefined}
181180
toolbarPosition={toolbar.position}
182181
stickyToolbar={stickyToolbar}
183182
showToolbar={!hideToolbar}
@@ -195,7 +194,6 @@ export const TableCompView = React.memo((props: {
195194
return (
196195
<TableContainer
197196
mode={mode as 'AUTO' | 'FIXED'}
198-
containerHeight={mode === 'FIXED' ? containerHeight : undefined}
199197
toolbarPosition={toolbar.position}
200198
stickyToolbar={stickyToolbar}
201199
showToolbar={!hideToolbar}

0 commit comments

Comments
 (0)