Skip to content

Commit 0886f58

Browse files
committed
Controls added to divider, button comp, dropdown, nav ,link & mention componente
1 parent a603a57 commit 0886f58

File tree

7 files changed

+70
-23
lines changed

7 files changed

+70
-23
lines changed

client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function getButtonStyle(buttonStyle: ButtonStyleType) {
2222
font-size: ${buttonStyle.textSize};
2323
font-weight: ${buttonStyle.textWeight};
2424
font-family: ${buttonStyle.fontFamily};
25+
font-style: ${buttonStyle.fontStyle};
2526
background-color: ${buttonStyle.background};
2627
border-radius: ${buttonStyle.radius};
2728
margin: ${buttonStyle.margin};

client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ const LeftButtonWrapper = styled.div<{ $buttonStyle: ButtonStyleType }>`
4242
margin: 0 !important;
4343
${(props) => `border-radius: ${props.$buttonStyle.radius} 0 0 ${props.$buttonStyle.radius};`}
4444
}
45+
${(props) => `background-color: ${props.$buttonStyle.background};`}
46+
${(props) => `color: ${props.$buttonStyle.text};`}
47+
${(props) => `padding: ${props.$buttonStyle.padding};`}
48+
${(props) => `font-size: ${props.$buttonStyle.textSize};`}
49+
${(props) => `font-style: ${props.$buttonStyle.fontStyle};`}
4550
width: 100%;
4651
}
4752
`;

client/packages/lowcoder/src/comps/comps/buttonComp/linkComp.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ const Link = styled(Button)<{ $style: LinkStyleType }>`
2929
margin: ${props.$style.margin};
3030
padding: ${props.$style.padding};
3131
font-size: ${props.$style.textSize};
32+
font-style:${props.$style.fontStyle};
33+
font-family:${props.$style.fontFamily};
34+
border: ${props.$style.borderWidth} solid ${props.$style.border};
35+
background-color: ${props.$style.background};
3236
&:hover {
3337
color: ${props.$style.hoverText} !important;
3438
}

client/packages/lowcoder/src/comps/comps/dividerComp.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type IProps = DividerProps & { $style: DividerStyleType; dashed: boolean };
2121
// TODO: find out how to set border style when text is active
2222
// TODO: enable type "vertical" https://ant.design/components/divider
2323

24-
const StyledDivider = styled(Divider)<IProps>`
24+
const StyledDivider = styled(Divider) <IProps>`
2525
margin-top: 3.5px;
2626
.ant-divider-inner-text {
2727
height: 32px;
@@ -30,16 +30,17 @@ const StyledDivider = styled(Divider)<IProps>`
3030
font-size: ${(props) => props.$style.textSize};
3131
font-weight: ${(props) => props.$style.textWeight};
3232
font-family: ${(props) => props.$style.fontFamily};
33+
font-style:${(props) => props.$style.fontStyle}
3334
}
3435
min-width: 0;
35-
width: ${(props) => {
36-
return widthCalculator(props.$style.margin);
36+
width: ${(props) => {
37+
return widthCalculator(props.$style.margin);
3738
}};
38-
min-height: ${(props) => {
39-
return heightCalculator(props.$style.margin);
39+
min-height: ${(props) => {
40+
return heightCalculator(props.$style.margin);
4041
}};
41-
margin: ${(props) => {
42-
return props.$style.margin;
42+
margin: ${(props) => {
43+
return props.$style.margin;
4344
}};
4445
padding: ${(props) => props.$style.padding};
4546

client/packages/lowcoder/src/comps/comps/navComp/navComp.tsx

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ type IProps = {
2323
$justify: boolean;
2424
$bgColor: string;
2525
$borderColor: string;
26+
$borderWidth: string;
2627
};
2728

28-
const Wrapper = styled("div")<Pick<IProps, "$bgColor" | "$borderColor">>`
29+
const Wrapper = styled("div") <Pick<IProps, "$bgColor" | "$borderColor" | "$borderWidth">>`
2930
height: 100%;
3031
border-radius: 2px;
3132
box-sizing: border-box;
32-
border: 1px solid ${(props) => props.$borderColor};
33+
border: ${(props) => props.$borderWidth ? `${props.$borderWidth}` : '1px'} solid ${(props) => props.$borderColor};
3334
background-color: ${(props) => props.$bgColor};
3435
`;
3536

36-
const NavInner = styled("div")<Pick<IProps, "$justify">>`
37+
const NavInner = styled("div") <Pick<IProps, "$justify">>`
3738
margin: 0 -16px;
3839
height: 100%;
3940
display: flex;
@@ -44,12 +45,20 @@ const Item = styled.div<{
4445
$active: boolean;
4546
$activeColor: string;
4647
$color: string;
48+
$fontFamily: string;
49+
$fontStyle: string;
50+
$textWeight: string;
51+
$textSize: string;
4752
}>`
4853
height: 30px;
4954
line-height: 30px;
5055
padding: 0 16px;
5156
color: ${(props) => (props.$active ? props.$activeColor : props.$color)};
52-
font-weight: 500;
57+
font-weight: ${(props) => (props.$textWeight ? props.$textWeight : 500)};
58+
font-family:${(props) => (props.$fontFamily ? props.$fontFamily : 'sans-serif')};
59+
font-style:${(props) => (props.$fontStyle ? props.$fontStyle : 'normal')};
60+
font-size:${(props) => (props.$textSize ? props.$textSize : '14px')}
61+
5362
5463
&:hover {
5564
color: ${(props) => props.$activeColor};
@@ -79,7 +88,7 @@ const ItemList = styled.div<{ $align: string }>`
7988
justify-content: ${(props) => props.$align};
8089
`;
8190

82-
const StyledMenu = styled(Menu)<MenuProps>`
91+
const StyledMenu = styled(Menu) <MenuProps>`
8392
&.ant-dropdown-menu {
8493
min-width: 160px;
8594
}
@@ -144,6 +153,10 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
144153
$active={active || subMenuSelectedKeys.length > 0}
145154
$color={props.style.text}
146155
$activeColor={props.style.accent}
156+
$fontFamily={props.style.fontFamily}
157+
$fontStyle={props.style.fontStyle}
158+
$textWeight={props.style.textWeight}
159+
$textSize={props.style.textSize}
147160
onClick={() => onEvent("click")}
148161
>
149162
{label}
@@ -178,7 +191,11 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
178191
const justify = props.horizontalAlignment === "justify";
179192

180193
return (
181-
<Wrapper $borderColor={props.style.border} $bgColor={props.style.background}>
194+
<Wrapper
195+
$borderColor={props.style.border}
196+
$bgColor={props.style.background}
197+
$borderWidth={props.style.borderWidth}
198+
>
182199
<NavInner $justify={justify}>
183200
{props.logoUrl && (
184201
<LogoWrapper onClick={() => props.logoEvent("click")}>
@@ -220,7 +237,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
220237
</Section>
221238
)}
222239

223-
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
240+
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
224241
<Section name={sectionNames.style}>
225242
{children.style.getPropertyView()}
226243
</Section>

client/packages/lowcoder/src/comps/comps/textInputComp/mentionComp.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ let MentionTmpComp = (function () {
101101
const [activationFlag, setActivationFlag] = useState(false);
102102
const [prefix, setPrefix] = useState<PrefixType>("@");
103103
type PrefixType = "@" | keyof typeof mentionList;
104-
104+
105105
const onSearch = (_: string, newPrefix: PrefixType) => {
106106
setPrefix(newPrefix);
107107
};
@@ -192,7 +192,7 @@ let MentionTmpComp = (function () {
192192
label: value,
193193
}))}
194194
autoSize={props.autoHeight}
195-
style={{ height: "100%", maxHeight: "100%", resize: "none", padding: props.style.padding }}
195+
style={{ height: "100%", maxHeight: "100%", resize: "none", padding: props.style.padding, fontStyle: props.style.fontStyle, fontFamily: props.style.fontFamily, borderWidth: props.style.borderWidth, fontWeight: props.style.textWeight }}
196196
readOnly={props.readOnly}
197197
/>
198198
</ConfigProvider>
@@ -222,12 +222,12 @@ let MentionTmpComp = (function () {
222222
)}
223223

224224
{["logic", "both"].includes(useContext(EditorContext).editorModeStatus) && (
225-
<><Section name={sectionNames.interaction}>
225+
<><Section name={sectionNames.interaction}>
226226
{children.onEvent.getPropertyView()}
227227
{disabledPropertyView(children)}
228228
</Section>
229-
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
230-
<Section name={sectionNames.advanced}>
229+
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
230+
<Section name={sectionNames.advanced}>
231231
{readOnlyPropertyView(children)}
232232
</Section><Section name={sectionNames.validation}>
233233
{requiredPropertyView(children)}
@@ -241,9 +241,9 @@ let MentionTmpComp = (function () {
241241
)}
242242

243243
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
244-
<><Section name={sectionNames.style}>
245-
{children.style.getPropertyView()}
246-
</Section></>
244+
<><Section name={sectionNames.style}>
245+
{children.style.getPropertyView()}
246+
</Section></>
247247
)}
248248
</>
249249
))

client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ export const ButtonStyle = [
455455
TEXT_SIZE,
456456
TEXT_WEIGHT,
457457
FONT_FAMILY,
458+
FONT_STYLE,
458459
MARGIN,
459460
PADDING
460461
] as const;
@@ -474,6 +475,7 @@ export const ToggleButtonStyle = [
474475
TEXT_SIZE,
475476
TEXT_WEIGHT,
476477
FONT_FAMILY,
478+
FONT_STYLE,
477479
MARGIN,
478480
PADDING,
479481
] as const;
@@ -1045,8 +1047,19 @@ function handleToHoverLink(color: string) {
10451047

10461048
export const LinkStyle = [
10471049
...LinkTextStyle,
1050+
{
1051+
name: "background",
1052+
label: trans("style.background"),
1053+
depTheme: "canvas",
1054+
depType: DEP_TYPE.SELF,
1055+
transformer: toSelf,
1056+
},
10481057
MARGIN,
10491058
PADDING,
1059+
FONT_FAMILY,
1060+
FONT_STYLE,
1061+
BORDER,
1062+
BORDER_WIDTH,
10501063
TEXT_SIZE
10511064
] as const;
10521065

@@ -1067,7 +1080,8 @@ export const DividerStyle = [
10671080
},
10681081
TEXT_SIZE,
10691082
TEXT_WEIGHT,
1070-
FONT_FAMILY
1083+
FONT_FAMILY,
1084+
FONT_STYLE
10711085
] as const;
10721086

10731087
export const ProgressStyle = [
@@ -1098,6 +1112,11 @@ export const NavigationStyle = [
10981112
getStaticBorder("#FFFFFF00"),
10991113
MARGIN,
11001114
PADDING,
1115+
FONT_FAMILY,
1116+
FONT_STYLE,
1117+
TEXT_WEIGHT,
1118+
TEXT_SIZE,
1119+
BORDER_WIDTH
11011120
] as const;
11021121

11031122
export const ImageStyle = [getStaticBorder("#00000000"), RADIUS, BORDER_WIDTH, MARGIN, PADDING] as const;

0 commit comments

Comments
 (0)