Skip to content

Commit 9775cb8

Browse files
authored
Merge pull request #873 from MenamAfzal/fix/style-issues
Fix/style issues
2 parents c6c2d0d + 8bba4f1 commit 9775cb8

File tree

13 files changed

+50
-29
lines changed

13 files changed

+50
-29
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ import { DateRangeUIView } from "comps/comps/dateComp/dateRangeUIView";
5050

5151
import { EditorContext } from "comps/editorState";
5252

53+
const defaultStyle = {
54+
borderStyle: 'solid',
55+
borderWidth: '1px',
56+
}
57+
5358
const EventOptions = [changeEvent, focusEvent, blurEvent] as const;
5459

5560
const validationChildren = {
@@ -76,7 +81,7 @@ const commonChildren = {
7681
suffixIcon: withDefault(IconControl, "/icon:regular/calendar"),
7782
...validationChildren,
7883
viewRef: RefControl<CommonPickerMethods>,
79-
inputFieldStyle:styleControl(DateTimeStyle)
84+
inputFieldStyle: withDefault(styleControl(DateTimeStyle), defaultStyle),
8085
};
8186
type CommonChildrenType = RecordConstructorToComp<typeof commonChildren>;
8287

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,11 @@ const childrenMap = {
257257
allowNull: BoolControl,
258258
onEvent: InputEventHandlerControl,
259259
viewRef: RefControl<HTMLInputElement>,
260-
style: styleControl(InputFieldStyle),
260+
style: withDefault(styleControl(InputFieldStyle), {borderWidth: '1px'}),
261261
labelStyle:styleControl(LabelStyle),
262262
prefixText : stringExposingStateControl("defaultValue"),
263263
prefixIcon: IconControl,
264-
inputFieldStyle:styleControl(InputLikeStyle),
264+
inputFieldStyle: withDefault(styleControl(InputLikeStyle), {borderWidth: '1px'}) ,
265265
// validation
266266
required: BoolControl,
267267
min: UndefinedNumberControl,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const SliderChildren = {
7171
label: LabelControl,
7272
disabled: BoolCodeControl,
7373
onEvent: ChangeEventHandlerControl,
74-
style: styleControl(InputFieldStyle),
74+
style: withDefault(styleControl(InputFieldStyle), {borderWidth: '1px'}),
7575
labelStyle:styleControl(LabelStyle.filter((style)=> ['accent','validate'].includes(style.name) === false)),
7676
prefixIcon: IconControl,
7777
suffixIcon: IconControl,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const RatingBasicComp = (function () {
4343
allowHalf: BoolControl,
4444
disabled: BoolCodeControl,
4545
onEvent: eventHandlerControl(EventOptions),
46-
style: styleControl(InputFieldStyle),
46+
style: withDefault(styleControl(InputFieldStyle), {borderWidth: '1px'}),
4747
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false)),
4848
inputFieldStyle:migrateOldData(styleControl(RatingStyle), fixOldData),
4949
...formDataChildren,

client/packages/lowcoder/src/comps/comps/remoteComp/loaders.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ async function npmLoader(
1313

1414
// Falk: removed "packageVersion = "latest" as default value fir packageVersion - to ensure no automatic version jumping.
1515
const localPackageVersion = remoteInfo.packageVersion || "latest";
16-
1716
const { packageName, packageVersion, compName } = remoteInfo;
1817
const entry = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${localPackageVersion}/index.js`;
19-
// const entry = `../../../../../public/package/index.js`;
20-
// console.log("Entry", entry);
18+
2119
try {
2220
const module = await import(
2321
/* @vite-ignore */

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ import { RefControl } from "comps/controls/refControl";
2525

2626
import { useContext } from "react";
2727
import { EditorContext } from "comps/editorState";
28-
import { migrateOldData } from "comps/generators/simpleGenerators";
28+
import { migrateOldData, withDefault } from "comps/generators/simpleGenerators";
2929
import { fixOldInputCompData } from "../textInputComp/textInputConstants";
3030

3131

3232
const getStyle = (style: SegmentStyleType) => {
3333
return css`
3434
&.ant-segmented:not(.ant-segmented-disabled) {
35-
background-color: ${style.background};
36-
3735
&,
3836
.ant-segmented-item-selected,
3937
.ant-segmented-thumb,
@@ -79,7 +77,7 @@ const SegmentChildrenMap = {
7977
disabled: BoolCodeControl,
8078
onEvent: ChangeEventHandlerControl,
8179
options: SelectOptionControl,
82-
style: styleControl(SegmentStyle),
80+
style: withDefault(styleControl(SegmentStyle),{borderWidth:'1px'}),
8381
viewRef: RefControl<HTMLDivElement>,
8482

8583
...SelectInputValidationChildren,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { StepOptionControl } from "comps/controls/optionsControl";
77
import { styleControl } from "comps/controls/styleControl";
88
import { StepsStyle, StepsStyleType, heightCalculator, widthCalculator, marginCalculator } from "comps/controls/styleControlConstants";
99
import styled, { css } from "styled-components";
10-
import { UICompBuilder } from "../../generators";
10+
import { UICompBuilder, withDefault } from "../../generators";
1111
import { CommonNameConfig, NameConfig, withExposingConfigs } from "../../generators/withExposing";
1212
import { selectDivRefMethods, } from "./selectInputConstants";
1313
import { Section, sectionNames } from "lowcoder-design";
@@ -91,7 +91,7 @@ const StepsChildrenMap = {
9191
disabled: BoolCodeControl,
9292
onEvent: ChangeEventHandlerControl,
9393
options: StepOptionControl,
94-
style: styleControl(StepsStyle),
94+
style: withDefault( styleControl(StepsStyle), {text:'#D7D9E0'}),
9595
viewRef: RefControl<HTMLDivElement>
9696
};
9797

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { IconControl } from "comps/controls/iconControl";
3131
import { hasIcon } from "comps/utils";
3232
import { InputRef } from "antd/es/input";
3333
import { RefControl } from "comps/controls/refControl";
34-
import { migrateOldData } from "comps/generators/simpleGenerators";
34+
import { migrateOldData, withDefault } from "comps/generators/simpleGenerators";
3535

3636
import React, { useContext } from "react";
3737
import { EditorContext } from "comps/editorState";
@@ -49,7 +49,7 @@ const childrenMap = {
4949
viewRef: RefControl<InputRef>,
5050
showCount: BoolControl,
5151
allowClear: BoolControl,
52-
style: styleControl(InputFieldStyle),
52+
style: withDefault(styleControl(InputFieldStyle), {borderWidth: '1px'}),
5353
labelStyle: styleControl(LabelStyle),
5454
prefixIcon: IconControl,
5555
suffixIcon: IconControl,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ let PasswordTmpComp = (function () {
5757
validationType: dropdownControl(TextInputValidationOptions, "Regex"),
5858
visibilityToggle: BoolControl.DEFAULT_TRUE,
5959
prefixIcon: IconControl,
60-
style: styleControl(InputFieldStyle),
60+
style: withDefault(styleControl(InputFieldStyle), {borderWidth: '1px'}),
6161
labelStyle: styleControl(LabelStyle),
6262
inputFieldStyle: styleControl(InputLikeStyle)
6363
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ let TextAreaTmpComp = (function () {
7171
viewRef: RefControl<TextAreaRef>,
7272
allowClear: BoolControl,
7373
autoHeight: withDefault(AutoHeightControl, "fixed"),
74-
style: styleControl(InputFieldStyle),
74+
style: withDefault(styleControl(InputFieldStyle), {borderWidth: '1px'}),
7575
labelStyle: styleControl(LabelStyle),
7676
inputFieldStyle: styleControl(InputLikeStyle)
7777
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ const childrenMap = {
6565
allowClear: BoolControl,
6666
showSearch: BoolControl.DEFAULT_TRUE,
6767
inputValue: stateComp<string>(""), // search value
68-
style: styleControl(InputFieldStyle),
68+
style: withDefault(styleControl(InputFieldStyle), {borderWidth: '1px'}),
6969
labelStyle:styleControl(LabelStyle),
70-
inputFieldStyle:styleControl(TreeSelectStyle),
70+
inputFieldStyle: withDefault(styleControl(TreeSelectStyle), {borderWidth: '1px'}),
7171
viewRef: RefControl<BaseSelectRef>,
7272
};
7373

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ ${(props) => {
5757
display: flex;
5858
flex-direction: column;
5959
height: 100%;
60+
border: ${(props)=>{return props.$style.borderWidth}} ${(props)=>{return props.$style.borderStyle}} ${(props)=>{return props.$style.border}} !important;
6061
`;
6162

6263
const MainWrapper = styled.div<{

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

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,9 @@ export const LabelStyle = [
899899

900900
export const InputFieldStyle = [
901901
getStaticBackground(SURFACE_COLOR),
902-
...STYLING_FIELDS_CONTAINER_SEQUENCE,
902+
getStaticBorder(),
903+
...STYLING_FIELDS_CONTAINER_SEQUENCE.filter((style) => ['border'].includes(style.name) === false),
904+
// ...STYLING_FIELDS_CONTAINER_SEQUENCE,
903905
] as const;
904906

905907
export const RatingStyle = [
@@ -1062,27 +1064,43 @@ export const RadioStyle = [
10621064
HOVER_BACKGROUND_COLOR
10631065
] as const;
10641066

1067+
10651068
export const SegmentStyle = [
10661069
LABEL,
10671070
...STYLING_FIELDS_SEQUENCE.filter((style) => ['border', 'borderWidth'].includes(style.name) === false),
1071+
// getStaticBorder(SECOND_SURFACE_COLOR),
1072+
{
1073+
name: "border",
1074+
label: trans("style.border"),
1075+
depName: "background",
1076+
transformer: backgroundToBorder,
1077+
},
1078+
{
1079+
name: "borderWidth",
1080+
label: trans("style.borderWidth"),
1081+
borderWidth: "borderWidth",
1082+
},
1083+
1084+
getStaticBackground(SURFACE_COLOR),
10681085
{
10691086
name: "indicatorBackground",
10701087
label: trans("style.indicatorBackground"),
10711088
color: SURFACE_COLOR,
10721089
},
1073-
{
1074-
name: "background",
1075-
label: trans("style.background"),
1076-
depName: "indicatorBackground",
1077-
transformer: handleToSegmentBackground,
1078-
},
1090+
// {
1091+
// name: "background",
1092+
// label: trans("style.background"),
1093+
// depName: "indicatorBackground",
1094+
// transformer: toSelf,
1095+
// },
10791096
{
10801097
name: "text",
10811098
label: trans("text"),
10821099
depName: "indicatorBackground",
10831100
depType: DEP_TYPE.CONTRAST_TEXT,
10841101
transformer: contrastText,
10851102
},
1103+
10861104
VALIDATE,
10871105
] as const;
10881106

@@ -1096,8 +1114,8 @@ export const StepsStyle = [
10961114
{
10971115
name: "titleText",
10981116
label: trans("title"),
1099-
depName: "background",
1100-
depType: DEP_TYPE.CONTRAST_TEXT,
1117+
depName: "text",
1118+
depType: DEP_TYPE.SELF,
11011119
transformer: contrastText,
11021120
},
11031121
...STYLING_FIELDS_SEQUENCE.filter((style) => ['background', 'textSize','textDecoration'].includes(style.name) === false),
@@ -1268,6 +1286,7 @@ export const IframeStyle = [getBackground(), getStaticBorder("#00000000"), RADIU
12681286

12691287
export const DateTimeStyle = [
12701288
...getStaticBgBorderRadiusByBg(SURFACE_COLOR),
1289+
getStaticBorder(SECOND_SURFACE_COLOR),
12711290
TEXT,
12721291
MARGIN,
12731292
PADDING,

0 commit comments

Comments
 (0)