Skip to content

Commit e42c53e

Browse files
committed
field styles added to input
1 parent 1cd164f commit e42c53e

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Input, Section, sectionNames } from "lowcoder-design";
22
import { BoolControl } from "comps/controls/boolControl";
33
import { styleControl } from "comps/controls/styleControl";
4-
import { InputLikeStyle, InputLikeStyleType, LabelStyle, LabelStyleType } from "comps/controls/styleControlConstants";
4+
import { ComponentStyle, InputLikeStyle, InputLikeStyleType, LabelStyle, LabelStyleType } from "comps/controls/styleControlConstants";
55
import {
66
NameConfig,
77
NameConfigPlaceHolder,
@@ -53,6 +53,7 @@ const childrenMap = {
5353
labelStyle: styleControl(LabelStyle),
5454
prefixIcon: IconControl,
5555
suffixIcon: IconControl,
56+
field: styleControl(ComponentStyle),
5657
};
5758

5859
let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
@@ -72,6 +73,7 @@ let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
7273
),
7374
style: props.style,
7475
labelStyle: props.labelStyle,
76+
field:props.field,
7577
...validateState,
7678
});
7779
})
@@ -102,6 +104,7 @@ let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
102104
<>
103105
<Section name={sectionNames.style}>{children.style.getPropertyView()}</Section>
104106
<Section name={sectionNames.labelStyle}>{children.labelStyle.getPropertyView()}</Section>
107+
<Section name={sectionNames.field}>{children.field.getPropertyView()}</Section>
105108
</>
106109
)}
107110
</>

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type LabelViewProps = Pick<FormItemProps, "required" | "help" | "validateStatus"
2121
children: ReactNode;
2222
style?: Record<string, string>;
2323
labelStyle?: Record<string, string>;
24+
field?: Record<string, string>;
2425
};
2526

2627
const StyledStarIcon = styled(StarIcon)`
@@ -41,7 +42,15 @@ function getStyle(style: any) {
4142
`;
4243
}
4344

44-
const LabelViewWrapper = styled.div<{ $style: any }>`
45+
const LabelViewWrapper = styled.div<{ $style: any, field: any }>`
46+
${(props) => {
47+
return (
48+
props.field && {
49+
...props.field,
50+
borderRadius: props.field.radius,
51+
}
52+
);
53+
}}
4554
${(props) => props.$style && getStyle(props.$style)}
4655
display: flex;
4756
flex-direction: column;
@@ -159,7 +168,7 @@ export const LabelControl = (function () {
159168
};
160169

161170
return new MultiCompBuilder(childrenMap, (props) => (args: LabelViewProps) => (
162-
<LabelViewWrapper $style={args.style}>
171+
<LabelViewWrapper $style={args.style} field={args.field}>
163172
<MainWrapper
164173
$position={props.position}
165174
$hasLabel={!!props.text}

0 commit comments

Comments
 (0)