From ee2c4f26773e4aeef7773f5161debe219443c5f6 Mon Sep 17 00:00:00 2001 From: Kamal Qureshi Date: Thu, 24 Jul 2025 23:36:23 +0500 Subject: [PATCH] Updated editable styling for Text comp --- .../comps/tableComp/tableSummaryComp.tsx | 22 ++++++++++++++++++- .../lowcoder/src/comps/comps/textComp.tsx | 7 ++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/client/packages/lowcoder/src/comps/comps/tableComp/tableSummaryComp.tsx b/client/packages/lowcoder/src/comps/comps/tableComp/tableSummaryComp.tsx index 56e4584c2..e026d5aef 100644 --- a/client/packages/lowcoder/src/comps/comps/tableComp/tableSummaryComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/tableComp/tableSummaryComp.tsx @@ -7,6 +7,24 @@ import Table from "antd/es/table"; import { ReactNode, useMemo, memo, useCallback } from "react"; import Tooltip from "antd/es/tooltip"; +const CellContainer = styled.div<{ + $textAlign?: 'left' | 'center' | 'right'; +}>` + display: flex; + justify-content: ${(props) => { + switch (props.$textAlign) { + case 'left': + return 'flex-start'; + case 'center': + return 'center'; + case 'right': + return 'flex-end'; + default: + return 'flex-start'; + } + }}; +`; + const TableSummaryRow = styled(Table.Summary.Row)<{ $istoolbarPositionBelow: boolean; $background: string; @@ -170,7 +188,9 @@ const TableSummaryCellView = memo(function TableSummaryCellView(props: { $autoHeight={autoHeight} > -
{children}
+ + {children} +
); diff --git a/client/packages/lowcoder/src/comps/comps/textComp.tsx b/client/packages/lowcoder/src/comps/comps/textComp.tsx index dcc5ccdb2..708a4f4aa 100644 --- a/client/packages/lowcoder/src/comps/comps/textComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/textComp.tsx @@ -37,6 +37,9 @@ const getStyle = (style: TextStyleType) => { text-transform:${style.textTransform} !important; text-decoration:${style.textDecoration} !important; background: ${style.background}; + line-height: ${style.lineHeight}; + margin: ${style.margin} !important; + padding: ${style.padding}; .markdown-body a { color: ${style.links}; } @@ -68,7 +71,7 @@ const getStyle = (style: TextStyleType) => { h6 { color: ${style.text}; font-weight: ${style.textWeight} !important; - line-height:${style.lineHeight}; + line-height: ${style.lineHeight} !important; } img, pre { @@ -101,9 +104,9 @@ const TextContainer = React.memo(styled.div<{ margin: ${props.$styleConfig.margin}; padding: ${props.$styleConfig.padding}; `}; - ${(props) => props.$styleConfig && getStyle(props.$styleConfig)} display: flex; ${markdownCompCss}; + ${(props) => props.$styleConfig && getStyle(props.$styleConfig)} overflow-wrap: anywhere; .markdown-body { overflow-wrap: anywhere;