Skip to content

Commit 436a7ed

Browse files
authored
Merge pull request #935 from MenamAfzal/feature/update-styles
Feature/update styles
2 parents c599b75 + 76b775d commit 436a7ed

File tree

7 files changed

+22
-11
lines changed

7 files changed

+22
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const commonChildren = {
7676
hourStep: RangeControl.closed(1, 24, 1),
7777
minuteStep: RangeControl.closed(1, 60, 1),
7878
secondStep: RangeControl.closed(1, 60, 1),
79-
style: styleControl(InputFieldStyle),
79+
style: withDefault(styleControl(InputFieldStyle),{background:'transparent'}),
8080
animationStyle: styleControl(AnimationStyle),
8181
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false)),
8282
suffixIcon: withDefault(IconControl, "/icon:regular/calendar"),

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import { omit } from "lodash";
1313

1414
const { RangePicker } = DatePicker;
1515

16-
const RangePickerStyled = styled(RangePicker)<{ $style: DateTimeStyleType }>`
16+
const RangePickerStyled = styled(RangePicker)<{$style: DateTimeStyleType}>`
1717
width: 100%;
18+
box-shadow: ${(props) =>
19+
`${props.$style.boxShadow} ${props.$style.boxShadowColor}`};
1820
${(props) => props.$style && getStyle(props.$style)}
1921
`;
2022

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { default as DatePicker } from "antd/es/date-picker";
1111

1212
const DatePickerStyled = styled(DatePicker)<{ $style: DateTimeStyleType }>`
1313
width: 100%;
14+
box-shadow: ${props=>`${props.$style.boxShadow} ${props.$style.boxShadowColor}`};
1415
${(props) => props.$style && getStyle(props.$style)}
1516
`;
1617

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ import { SelectInputInvalidConfig, useSelectInputValidate } from "./selectInputC
1414

1515
import { PaddingControl } from "../../controls/paddingControl";
1616
import { MarginControl } from "../../controls/marginControl";
17-
import { migrateOldData } from "comps/generators/simpleGenerators";
17+
import { migrateOldData, withDefault } from "comps/generators/simpleGenerators";
1818
import { fixOldInputCompData } from "../textInputComp/textInputConstants";
1919

2020
let MultiSelectBasicComp = (function () {
2121
const childrenMap = {
2222
...SelectChildrenMap,
2323
defaultValue: arrayStringExposingStateControl("defaultValue", ["1", "2"]),
2424
value: arrayStringExposingStateControl("value"),
25-
style: styleControl(InputFieldStyle),
25+
style: withDefault(styleControl(InputFieldStyle),{background:'transparent'}),
2626
labelStyle:styleControl(LabelStyle),
27-
inputFieldStyle:styleControl(MultiSelectStyle),
27+
inputFieldStyle:withDefault(styleControl(MultiSelectStyle),{borderWidth:'1px'}),
2828
childrenInputFieldStyle:styleControl(ChildrenMultiSelectStyle),
2929
margin: MarginControl,
3030
padding: PaddingControl,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ import {
1818
import { useRef } from "react";
1919
import { RecordConstructorToView } from "lowcoder-core";
2020
import { fixOldInputCompData } from "../textInputComp/textInputConstants";
21-
import { migrateOldData } from "comps/generators/simpleGenerators";
21+
import { migrateOldData, withDefault } from "comps/generators/simpleGenerators";
2222

2323
let SelectBasicComp = (function () {
2424
const childrenMap = {
2525
...SelectChildrenMap,
2626
defaultValue: stringExposingStateControl("defaultValue"),
2727
value: stringExposingStateControl("value"),
28-
style: styleControl(InputFieldStyle),
28+
style: withDefault(styleControl(InputFieldStyle),{background:'transparent'}),
2929
labelStyle: styleControl(LabelStyle),
30-
inputFieldStyle: styleControl(SelectStyle),
30+
inputFieldStyle: withDefault(styleControl(SelectStyle),{borderWidth:'1px'}),
3131
childrenInputFieldStyle: styleControl(ChildrenMultiSelectStyle)
3232
};
3333
return new UICompBuilder(childrenMap, (props, dispatch) => {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export const getStyle = (
109109
background-color: ${style.background};
110110
border-color: ${style.border};
111111
border-width:${(style as SelectStyleType).borderWidth};
112+
box-shadow:${(style as SelectStyleType).boxShadow} ${(style as SelectStyleType).boxShadowColor};
112113
}
113114
114115
&.ant-select-focused,
@@ -181,10 +182,9 @@ const getDropdownStyle = (style: MultiSelectStyleType) => {
181182
`;
182183
};
183184

184-
const Select = styled(AntdSelect) <{ $style: SelectStyleType & MultiSelectStyleType }>`
185+
const Select = styled(AntdSelect) <{ $style: SelectStyleType & MultiSelectStyleType,$inputFieldStyle:SelectStyleType }>`
185186
width: 100%;
186-
187-
${(props) => props.$style && getStyle(props.$style)}
187+
${(props) => props.$inputFieldStyle && getStyle(props.$inputFieldStyle)}
188188
`;
189189

190190
const DropdownStyled = styled.div<{ $style: ChildrenMultiSelectStyleType }>`
@@ -246,13 +246,15 @@ export const SelectUIView = (
246246
value: any;
247247
style: SelectStyleType | MultiSelectStyleType;
248248
childrenInputFieldStyle: ChildrenMultiSelectStyleType;
249+
inputFieldStyle: SelectStyleType;
249250
onChange: (value: any) => void;
250251
dispatch: DispatchType;
251252
}
252253
) => {
253254
return <Select
254255
ref={props.viewRef}
255256
mode={props.mode}
257+
$inputFieldStyle={props.inputFieldStyle}
256258
$style={props.style as SelectStyleType & MultiSelectStyleType}
257259
disabled={props.disabled}
258260
allowClear={props.allowClear}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,8 @@ export const SelectStyle = [
11921192
...replaceAndMergeMultipleStyles(STYLING_FIELDS_SEQUENCE.filter(style=>style.name!=='rotation'), "border", [
11931193
...getStaticBgBorderRadiusByBg(SURFACE_COLOR, "pc"),
11941194
]),
1195+
BOXSHADOW,
1196+
BOXSHADOWCOLOR,
11951197
...ACCENT_VALIDATE,
11961198
] as const;
11971199

@@ -1225,6 +1227,8 @@ export const MultiSelectStyle = [
12251227
transformer: toSelf,
12261228
platform: "pc",
12271229
},
1230+
BOXSHADOW,
1231+
BOXSHADOWCOLOR,
12281232
...ACCENT_VALIDATE,
12291233
] as const;
12301234

@@ -1584,6 +1588,8 @@ export const DateTimeStyle = [
15841588
PADDING,
15851589
BORDER_STYLE,
15861590
BORDER_WIDTH,
1591+
BOXSHADOW,
1592+
BOXSHADOWCOLOR,
15871593
...ACCENT_VALIDATE,
15881594
] as const;
15891595

0 commit comments

Comments
 (0)