|
1 |
| -import { ContainerStyleType } from "comps/controls/styleControlConstants"; |
| 1 | +import { ContainerStyleType, widthCalculator } from "comps/controls/styleControlConstants"; |
2 | 2 | import { EditorContext } from "comps/editorState";
|
3 | 3 | import { BackgroundColorContext } from "comps/utils/backgroundColorContext";
|
4 | 4 | import { HintPlaceHolder, ScrollBar } from "lowcoder-design";
|
@@ -41,6 +41,10 @@ const Wrapper = styled.div<{ $style: ContainerStyleType }>`
|
41 | 41 | ${(props) => props.$style && getStyle(props.$style)}
|
42 | 42 | `;
|
43 | 43 |
|
| 44 | +const StylesShape = styled(Coolshape)<{ $style: ContainerStyleType }>`; |
| 45 | + ${(props) => props.$style && getStyle(props.$style)} |
| 46 | +`; |
| 47 | + |
44 | 48 | const BodyInnerGrid = styled(InnerGrid)<{
|
45 | 49 | $showBorder: boolean;
|
46 | 50 | $backgroundColor: string;
|
@@ -81,15 +85,13 @@ export type TriContainerProps = TriContainerViewProps & {
|
81 | 85 |
|
82 | 86 | export function ShapeTriContainer(props: TriContainerProps) {
|
83 | 87 | const { container, icon } = props;
|
84 |
| - const { showHeader, showFooter } = container; |
| 88 | + // const { showHeader, showFooter } = container; |
85 | 89 | // When the header and footer are not displayed, the body must be displayed
|
86 |
| - const showBody = container.showBody || (!showHeader && !showFooter); |
| 90 | + const showBody = true; |
87 | 91 | const scrollbars = container.scrollbars;
|
88 | 92 |
|
89 |
| - const { items: headerItems, ...otherHeaderProps } = container.header; |
90 | 93 | const { items: bodyItems, ...otherBodyProps } =
|
91 |
| - container.body["0"].children.view.getView(); |
92 |
| - const { items: footerItems, ...otherFooterProps } = container.footer; |
| 94 | + container.body["0"].children.view.getView(); |
93 | 95 | const { style, headerStyle, bodyStyle, footerStyle } = container;
|
94 | 96 |
|
95 | 97 | const editorState = useContext(EditorContext);
|
@@ -121,14 +123,18 @@ export function ShapeTriContainer(props: TriContainerProps) {
|
121 | 123 | hideScrollbar={!scrollbars}
|
122 | 124 | >
|
123 | 125 | <div style={{ position: "relative", height: "100%" }}>
|
124 |
| - <Coolshape |
| 126 | + <StylesShape |
| 127 | + $style={style} |
125 | 128 | type={shape?.value as any}
|
| 129 | + noise={false} |
126 | 130 | index={shape.index}
|
127 | 131 | styles={{
|
128 | 132 | position: "absolute",
|
129 | 133 | top: "0",
|
130 | 134 | left: "50%",
|
131 | 135 | transform: "translateX(-50%)",
|
| 136 | + width: widthCalculator(style.margin), |
| 137 | + height: "100%", |
132 | 138 | }}
|
133 | 139 | />
|
134 | 140 | <BodyInnerGrid
|
|
0 commit comments