Skip to content

Commit e9a17d7

Browse files
committed
Fixed issue when apply bulk margin and padding
1 parent 15ee234 commit e9a17d7

21 files changed

+54
-32
lines changed

client/packages/lowcoder-design/src/components/Label.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export const labelCss: any = css`
55
user-select: none;
66
77
font-size: 13px;
8-
color: #222222;
98
109
&:hover {
1110
cursor: default;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ let AutoCompleteCompBase = (function () {
278278
</ConfigProvider>
279279
</>
280280
),
281-
style: props.labelStyle,
281+
style: props.style,
282+
labelStyle:props.labelStyle,
282283
...validateState,
283284
});
284285
})

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
165165
}
166166
return props.label({
167167
required: props.required,
168-
style: props.labelStyle,
168+
style: props.style,
169+
labelStyle:props.labelStyle,
169170
children: (
170171
<DateUIView
171172
viewRef={props.viewRef}
@@ -315,7 +316,8 @@ export const dateRangeControl = (function () {
315316

316317
return props.label({
317318
required: props.required,
318-
style: props.labelStyle,
319+
style: props.style,
320+
labelStyle:props.labelStyle,
319321
children: children,
320322
...(startResult.validateStatus !== "success"
321323
? startResult

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ const NumberInputTmpComp = (function () {
378378
return props.label({
379379
required: props.required,
380380
children: <CustomInputNumber {...props} />,
381-
style: props.labelStyle,
381+
style: props.style,
382+
labelStyle:props.labelStyle,
382383
...validate(props),
383384
});
384385
})

client/packages/lowcoder/src/comps/comps/numberInputComp/rangeSliderComp.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const RangeSliderBasicComp = (function () {
1414
};
1515
return new UICompBuilder(childrenMap, (props) => {
1616
return props.label({
17-
style: props.labelStyle,
17+
style: props.style,
18+
labelStyle: props.labelStyle,
1819
children: (
1920
<SliderWrapper
2021
onMouseDown={(e: any) => {
@@ -28,7 +29,7 @@ const RangeSliderBasicComp = (function () {
2829
range={true}
2930
value={[props.start.value, props.end.value]}
3031
$style={props.style}
31-
style={{margin: 0}}
32+
style={{ margin: 0 }}
3233
onChange={([start, end]) => {
3334
props.start.onChange(start);
3435
props.end.onChange(end);

client/packages/lowcoder/src/comps/comps/numberInputComp/sliderComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const SliderBasicComp = (function () {
1818
};
1919
return new UICompBuilder(childrenMap, (props) => {
2020
return props.label({
21-
style: props.labelStyle,
21+
style: props.style,
22+
labelStyle:props.labelStyle,
2223
children: (
2324
<SliderWrapper
2425
onMouseDown={(e: any) => {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ const RatingBasicComp = (function () {
6464
}, [value]);
6565

6666
return props.label({
67-
style: props.labelStyle,
67+
style: props.style,
68+
labelStyle: props.labelStyle,
6869
children: (
6970
<RateStyled
7071
count={props.max}

client/packages/lowcoder/src/comps/comps/selectInputComp/cascaderComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ let CascaderBasicComp = (function () {
2020

2121
return new UICompBuilder(childrenMap, (props) => {
2222
return props.label({
23-
style: props.labelStyle,
23+
style: props.style,
24+
labelStyle:props.labelStyle,
2425
children: (
2526
<CascaderStyle
2627
ref={props.viewRef}

client/packages/lowcoder/src/comps/comps/selectInputComp/checkboxComp.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ export const getStyle = (style: CheckboxStyleType) => {
6262
&:hover .ant-checkbox-inner,
6363
.ant-checkbox:hover .ant-checkbox-inner,
6464
.ant-checkbox-input + ant-checkbox-inner {
65-
background-color:${style.hoverBackground ? style.hoverBackground :'#fff'};
65+
background-color:${style.hoverBackground ? style.hoverBackground : '#fff'};
6666
}
6767
6868
&:hover .ant-checkbox-checked .ant-checkbox-inner,
6969
.ant-checkbox:hover .ant-checkbox-inner,
7070
.ant-checkbox-input + ant-checkbox-inner {
71-
background-color:${style.hoverBackground ? style.hoverBackground:'#ffff'};
71+
background-color:${style.hoverBackground ? style.hoverBackground : '#ffff'};
7272
}
7373
7474
&:hover .ant-checkbox-inner,
@@ -135,7 +135,7 @@ const CheckboxBasicComp = (function () {
135135
onEvent: ChangeEventHandlerControl,
136136
options: SelectInputOptionControl,
137137
style: styleControl(CheckboxStyle),
138-
labelStyle:styleControl(LabelStyle),
138+
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false)),
139139
layout: dropdownControl(RadioLayoutOptions, "horizontal"),
140140
viewRef: RefControl<HTMLDivElement>,
141141

@@ -149,7 +149,8 @@ const CheckboxBasicComp = (function () {
149149
] = useSelectInputValidate(props);
150150
return props.label({
151151
required: props.required,
152-
style: props.labelStyle,
152+
style: props.style,
153+
labelStyle: props.labelStyle,
153154
children: (
154155
<CheckboxGroup
155156
ref={props.viewRef}

client/packages/lowcoder/src/comps/comps/selectInputComp/multiSelectComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const MultiSelectBasicComp = (function () {
3535

3636
return props.label({
3737
required: props.required,
38-
style: props.labelStyle,
38+
style: props.style,
39+
labelStyle:props.labelStyle,
3940
children: (
4041
<SelectUIView
4142
{...props}

client/packages/lowcoder/src/comps/comps/selectInputComp/radioComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ const RadioBasicComp = (function () {
101101
] = useSelectInputValidate(props);
102102
return props.label({
103103
required: props.required,
104-
style: props.labelStyle,
104+
style: props.style,
105+
labelStyle:props.labelStyle,
105106
children: (
106107
<Radio
107108
ref={props.viewRef}

client/packages/lowcoder/src/comps/comps/selectInputComp/selectComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const SelectBasicComp = (function () {
3939

4040
return props.label({
4141
required: props.required,
42-
style: props.labelStyle,
42+
style: props.style,
43+
labelStyle:props.labelStyle,
4344
children: (
4445
<SelectUIView
4546
{...props}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ let SignatureTmpComp = (function () {
127127
}
128128
};
129129
return props.label({
130-
style: props.labelStyle,
130+
style: props.style,
131+
labelStyle:props.labelStyle,
131132
children: (
132133
<ReactResizeDetector
133134
onResize={(width, height) => {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ let SwitchTmpComp = (function () {
9090
onEvent: eventHandlerControl(EventOptions),
9191
disabled: BoolCodeControl,
9292
style: migrateOldData(styleControl(SwitchStyle), fixOldData),
93-
labelStyle: styleControl(LabelStyle),
93+
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false)),
9494
viewRef: RefControl<HTMLElement>,
9595

9696
...formDataChildren,
9797
};
9898
return new UICompBuilder(childrenMap, (props) => {
9999
return props.label({
100-
style: props.labelStyle,
100+
style: props.style,
101+
labelStyle:props.labelStyle,
101102
children: (
102103
<SwitchWrapper disabled={props.disabled} $style={props.style}>
103104
<Switch

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { EditorContext } from "comps/editorState";
3838
* Input Comp
3939
*/
4040

41-
const InputStyle = styled(Input) <{ $style: InputLikeStyleType}>`
41+
const InputStyle = styled(Input) <{ $style: InputLikeStyleType }>`
4242
${(props) => props.$style && getStyle(props.$style)}
4343
`;
4444

@@ -68,7 +68,8 @@ export const InputComp = new UICompBuilder(childrenMap, (props) => {
6868
suffix={hasIcon(props.suffixIcon) && props.suffixIcon}
6969
/>
7070
),
71-
style: props.labelStyle,
71+
style: props.style,
72+
labelStyle: props.labelStyle,
7273
...validateState,
7374
});
7475
})

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ const PasswordTmpComp = (function () {
7171
$style={props.style}
7272
/>
7373
),
74-
style: props.labelStyle,
74+
style: props.style,
75+
labelStyle:props.labelStyle,
7576
...validateState,
7677
});
7778
})

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const Wrapper = styled.div<{
4646
$style: InputLikeStyleType;
4747
}>`
4848
height: 100% !important;
49-
49+
5050
.ant-input {
5151
height:100% !important;
5252
}
@@ -87,7 +87,8 @@ let TextAreaTmpComp = (function () {
8787
/>
8888
</Wrapper>
8989
),
90-
style: props.labelStyle,
90+
style: props.style,
91+
labelStyle: props.labelStyle,
9192
...validateState,
9293
});
9394
})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export function getStyle(style: InputLikeStyleType, labelStyle?: LabelStyleType)
250250
font-style:${style.fontStyle};
251251
text-transform:${style.textTransform};
252252
text-decoration:${style.textDecoration};
253-
background-color: ${style.background};
253+
// background-color: ${style.background};
254254
border-color: ${style.border};
255255
256256
&:focus,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ const TreeCompView = (props: RecordConstructorToView<typeof childrenMap>) => {
9696
return props.label({
9797
required: props.required,
9898
...selectInputValidate(props),
99-
style: labelStyle,
99+
style,
100+
labelStyle,
100101
children: (
101102
<ReactResizeDetector onResize={(w, h) => setHeight(h)}>
102103
<Container {...style}>

client/packages/lowcoder/src/comps/comps/treeComp/treeSelectComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ const TreeCompView = (
100100
return props.label({
101101
required: props.required,
102102
...validateState,
103-
style: labelStyle,
103+
style,
104+
labelStyle,
104105
children: (
105106
<StyledTreeSelect
106107
ref={props.viewRef}

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { LabelStyleType, heightCalculator, widthCalculator } from "./styleContro
2020
type LabelViewProps = Pick<FormItemProps, "required" | "help" | "validateStatus"> & {
2121
children: ReactNode;
2222
style?: Record<string, string>;
23+
labelStyle?: Record<string, string>;
2324
};
2425

2526
const StyledStarIcon = styled(StarIcon)`
@@ -76,18 +77,21 @@ const LabelWrapper = styled.div<{
7677
flex-shrink: 0;
7778
`;
7879
// ${(props) => props.$border && UnderlineCss};
80+
// ${(props) => props.$border && `border-bottom:${props.$labelStyle.borderWidth} ${props.$labelStyle.borderStyle} ${!!props.$validateStatus && props?.$validateStatus === 'error' ? props.$labelStyle.validate : props.$labelStyle.border};`}
81+
7982
const Label = styled.span<{ $border: boolean, $labelStyle: LabelStyleType, $validateStatus: "success" | "warning" | "error" | "validating" | null }>`
8083
${labelCss};
8184
font-family:${(props) => props.$labelStyle.fontFamily};
82-
font-weight:${(props) => props.$labelStyle.fontWeight};
85+
font-weight:${(props) => props.$labelStyle.textWeight};
8386
font-style:${(props) => props.$labelStyle.fontStyle};
8487
text-transform:${(props) => props.$labelStyle.textTransform};
8588
text-decoration:${(props) => props.$labelStyle.textDecoration};
8689
font-size:${(props) => props.$labelStyle.textSize};
87-
color:${(props) => !!props.$validateStatus && props?.$validateStatus === 'error' ? props.$labelStyle.validate : props.$labelStyle.text} !important;
88-
${(props) => props.$border && `border-bottom:${props.$labelStyle.borderWidth} ${props.$labelStyle.borderStyle} ${!!props.$validateStatus && props?.$validateStatus === 'error' ? props.$labelStyle.validate : props.$labelStyle.border};`}
90+
color:${(props) => !!props.$validateStatus && props?.$validateStatus === 'error' ? props.$labelStyle.validate : props.$labelStyle.label} !important;
91+
${(props) => `border-bottom:${props.$labelStyle.borderWidth} ${props.$labelStyle.borderStyle} ${!!props.$validateStatus && props?.$validateStatus === 'error' ? props.$labelStyle.validate : props.$labelStyle.border};`}
8992
border-radius:${(props) => props.$labelStyle.radius};
9093
padding:${(props) => props.$labelStyle.padding};
94+
margin:${(props) => props.$labelStyle.margin};
9195
width: fit-content;
9296
user-select: text;
9397
white-space: nowrap;
@@ -194,7 +198,7 @@ export const LabelControl = (function () {
194198
<Label
195199
$border={!!props.tooltip}
196200
$validateStatus={args && args.validateStatus ? args.validateStatus : null}
197-
$labelStyle={{ ...args.style }}>
201+
$labelStyle={{ ...args.labelStyle }}>
198202
{props.text}
199203
</Label>
200204
</Tooltip>

0 commit comments

Comments
 (0)