Skip to content

Commit 76a28c1

Browse files
committed
refactored variable name
1 parent 972c633 commit 76a28c1

26 files changed

+145
-137
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,6 @@ export const sectionNames = {
148148
labelStyle:trans("prop.labelStyle"),
149149
data: trans("prop.data"),
150150
meetings: trans("prop.meetings"), // added by Falk Wolsky
151-
field:trans("prop.field")
151+
field: trans("prop.field"),
152+
inputFieldStyle:trans("prop.inputFieldStyle")
152153
};

client/packages/lowcoder-design/src/i18n/design/locales/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export const en = {
2727
style: "Style",
2828
meetings: "Meeting Settings",
2929
data: "Data",
30-
field:'Field'
30+
field: 'Field',
31+
inputFieldStyle:'Input Field Style'
3132
},
3233
passwordInput: {
3334
label: "Password:",

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Input, Section, sectionNames } from "lowcoder-design";
33
import { BoolControl } from "comps/controls/boolControl";
44
import { styleControl } from "comps/controls/styleControl";
55
import {
6-
ComponentStyle,
6+
InputFieldStyle,
77
InputLikeStyle,
88
InputLikeStyleType,
99
LabelStyle,
@@ -74,7 +74,7 @@ const childrenMap = {
7474
...textInputChildren,
7575
viewRef: RefControl<InputRef>,
7676
allowClear: BoolControl.DEFAULT_TRUE,
77-
style: styleControl(InputLikeStyle),
77+
style: styleControl(InputFieldStyle),
7878
labelStyle:styleControl(LabelStyle),
7979
prefixIcon: IconControl,
8080
suffixIcon: IconControl,
@@ -88,7 +88,7 @@ const childrenMap = {
8888
autocompleteIconColor: dropdownControl(autocompleteIconColor, "blue"),
8989
componentSize: dropdownControl(componentSize, "small"),
9090
valueInItems: booleanExposingStateControl("valueInItems"),
91-
field: styleControl(ComponentStyle),
91+
inputFieldStyle: styleControl(InputLikeStyle),
9292
};
9393

9494
const getValidate = (value: any): "" | "warning" | "error" | undefined => {
@@ -157,11 +157,11 @@ let AutoCompleteCompBase = (function () {
157157
<ConfigProvider
158158
theme={{
159159
token: {
160-
colorBgContainer: props.style.background,
161-
colorBorder: props.style.border,
162-
borderRadius: parseInt(props.style.radius),
163-
colorText: props.style.text,
164-
colorPrimary: props.style.accent,
160+
colorBgContainer: props.inputFieldStyle.background,
161+
colorBorder: props.inputFieldStyle.border,
162+
borderRadius: parseInt(props.inputFieldStyle.radius),
163+
colorText: props.inputFieldStyle.text,
164+
colorPrimary: props.inputFieldStyle.accent,
165165
controlHeight: componentSize === "small" ? 30 : 38,
166166
},
167167
}}
@@ -270,7 +270,7 @@ let AutoCompleteCompBase = (function () {
270270
ref={props.viewRef}
271271
placeholder={placeholder}
272272
allowClear={props.allowClear}
273-
$style={props.style}
273+
$style={props.inputFieldStyle}
274274
prefix={hasIcon(props.prefixIcon) && props.prefixIcon}
275275
suffix={hasIcon(props.suffixIcon) && props.suffixIcon}
276276
status={getValidate(validateState)}
@@ -282,7 +282,7 @@ let AutoCompleteCompBase = (function () {
282282
),
283283
style: props.style,
284284
labelStyle: props.labelStyle,
285-
field:props.field,
285+
inputFieldStyle:props.inputFieldStyle,
286286
...validateState,
287287
});
288288
})
@@ -344,8 +344,8 @@ let AutoCompleteCompBase = (function () {
344344
<Section name={sectionNames.labelStyle}>
345345
{children.labelStyle.getPropertyView()}
346346
</Section>
347-
<Section name={sectionNames.field}>
348-
{children.field.getPropertyView()}
347+
<Section name={sectionNames.inputFieldStyle}>
348+
{children.inputFieldStyle.getPropertyView()}
349349
</Section>
350350
</>
351351
);

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { UICompBuilder, withDefault } from "../../generators";
2020
import { CommonNameConfig, depsConfig, withExposingConfigs } from "../../generators/withExposing";
2121
import { formDataChildren, FormDataPropertyView } from "../formComp/formDataConstants";
2222
import { styleControl } from "comps/controls/styleControl";
23-
import { ComponentStyle, DateTimeStyle, DateTimeStyleType, LabelStyle } from "comps/controls/styleControlConstants";
23+
import { DateTimeStyle, DateTimeStyleType, InputFieldStyle, LabelStyle } from "comps/controls/styleControlConstants";
2424
import { withMethodExposing } from "../../generators/withMethodExposing";
2525
import {
2626
disabledPropertyView,
@@ -71,12 +71,12 @@ const commonChildren = {
7171
hourStep: RangeControl.closed(1, 24, 1),
7272
minuteStep: RangeControl.closed(1, 60, 1),
7373
secondStep: RangeControl.closed(1, 60, 1),
74-
style: styleControl(DateTimeStyle),
74+
style: styleControl(InputFieldStyle),
7575
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false)),
7676
suffixIcon: withDefault(IconControl, "/icon:regular/calendar"),
7777
...validationChildren,
7878
viewRef: RefControl<CommonPickerMethods>,
79-
field:styleControl(ComponentStyle)
79+
inputFieldStyle:styleControl(DateTimeStyle)
8080
};
8181
type CommonChildrenType = RecordConstructorToComp<typeof commonChildren>;
8282

@@ -168,12 +168,12 @@ export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
168168
required: props.required,
169169
style: props.style,
170170
labelStyle: props.labelStyle,
171-
field:props.field,
171+
inputFieldStyle:props.inputFieldStyle,
172172
children: (
173173
<DateUIView
174174
viewRef={props.viewRef}
175175
disabledTime={() => disabledTime(props.minTime, props.maxTime)}
176-
$style={props.style}
176+
$style={props.inputFieldStyle}
177177
disabled={props.disabled}
178178
{...datePickerProps(props)}
179179
minDate={props.minDate}
@@ -255,8 +255,8 @@ export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
255255
<Section name={sectionNames.labelStyle}>
256256
{children.labelStyle.getPropertyView()}
257257
</Section>
258-
<Section name={sectionNames.field}>
259-
{children.field.getPropertyView()}
258+
<Section name={sectionNames.inputFieldStyle}>
259+
{children.inputFieldStyle.getPropertyView()}
260260
</Section>
261261
</>
262262
)}
@@ -286,7 +286,7 @@ export const dateRangeControl = (function () {
286286
const children = (
287287
<DateRangeUIView
288288
viewRef={props.viewRef}
289-
$style={props.style}
289+
$style={props.inputFieldStyle}
290290
disabled={props.disabled}
291291
{...datePickerProps(props)}
292292
start={start.isValid() ? start : null}
@@ -324,7 +324,7 @@ export const dateRangeControl = (function () {
324324
style: props.style,
325325
labelStyle:props.labelStyle,
326326
children: children,
327-
field:props.field,
327+
inputFieldStyle:props.inputFieldStyle,
328328
...(startResult.validateStatus !== "success"
329329
? startResult
330330
: endResult.validateStatus !== "success"
@@ -389,8 +389,8 @@ export const dateRangeControl = (function () {
389389
<Section name={sectionNames.labelStyle}>
390390
{children.labelStyle.getPropertyView()}
391391
</Section>
392-
<Section name={sectionNames.field}>
393-
{children.field.getPropertyView()}
392+
<Section name={sectionNames.inputFieldStyle}>
393+
{children.inputFieldStyle.getPropertyView()}
394394
</Section>
395395
</>
396396
)}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { formDataChildren, FormDataPropertyView } from "../formComp/formDataCons
3030
import { withMethodExposing, refMethods } from "../../generators/withMethodExposing";
3131
import { RefControl } from "../../controls/refControl";
3232
import { styleControl } from "comps/controls/styleControl";
33-
import { ComponentStyle, InputLikeStyle, InputLikeStyleType, LabelStyle, heightCalculator, widthCalculator } from "comps/controls/styleControlConstants";
33+
import { InputFieldStyle, InputLikeStyle, InputLikeStyleType, LabelStyle, heightCalculator, widthCalculator } from "comps/controls/styleControlConstants";
3434
import {
3535
disabledPropertyView,
3636
hiddenPropertyView,
@@ -257,10 +257,10 @@ const childrenMap = {
257257
allowNull: BoolControl,
258258
onEvent: InputEventHandlerControl,
259259
viewRef: RefControl<HTMLInputElement>,
260-
style: styleControl(InputLikeStyle),
260+
style: styleControl(InputFieldStyle),
261261
labelStyle:styleControl(LabelStyle),
262262
prefixIcon: IconControl,
263-
field:styleControl(ComponentStyle),
263+
inputFieldStyle:styleControl(InputLikeStyle),
264264
// validation
265265
required: BoolControl,
266266
min: UndefinedNumberControl,
@@ -322,7 +322,7 @@ const CustomInputNumber = (props: RecordConstructorToView<typeof childrenMap>) =
322322
placeholder={props.placeholder}
323323
stringMode={true}
324324
precision={props.precision}
325-
$style={props.style}
325+
$style={props.inputFieldStyle}
326326
prefix={hasIcon(props.prefixIcon) && props.prefixIcon}
327327
onPressEnter={() => {
328328
handleFinish();
@@ -382,7 +382,7 @@ let NumberInputTmpComp = (function () {
382382
children: <CustomInputNumber {...props} />,
383383
style: props.style,
384384
labelStyle: props.labelStyle,
385-
field:props.field,
385+
inputFieldStyle:props.inputFieldStyle,
386386
...validate(props),
387387
});
388388
})
@@ -437,8 +437,8 @@ let NumberInputTmpComp = (function () {
437437
<Section name={sectionNames.labelStyle}>
438438
{children.labelStyle.getPropertyView()}
439439
</Section>
440-
<Section name={sectionNames.field}>
441-
{children.field.getPropertyView()}
440+
<Section name={sectionNames.inputFieldStyle}>
441+
{children.inputFieldStyle.getPropertyView()}
442442
</Section>
443443
</>
444444
)}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const RangeSliderBasicComp = (function () {
1616
return props.label({
1717
style: props.style,
1818
labelStyle: props.labelStyle,
19-
field:props.field,
19+
inputFieldStyle:props.inputFieldStyle,
2020
children: (
2121
<SliderWrapper
2222
onMouseDown={(e: any) => {
@@ -29,7 +29,7 @@ const RangeSliderBasicComp = (function () {
2929
{...props}
3030
range={true}
3131
value={[props.start.value, props.end.value]}
32-
$style={props.style}
32+
$style={props.inputFieldStyle}
3333
style={{ margin: 0 }}
3434
onChange={([start, end]) => {
3535
props.start.onChange(start);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const SliderBasicComp = (function () {
2020
return props.label({
2121
style: props.style,
2222
labelStyle: props.labelStyle,
23-
field:props.field,
23+
inputFieldStyle:props.inputFieldStyle,
2424
children: (
2525
<SliderWrapper
2626
onMouseDown={(e: any) => {
@@ -32,7 +32,7 @@ const SliderBasicComp = (function () {
3232
<SliderStyled
3333
{...props}
3434
value={props.value.value}
35-
$style={props.style}
35+
$style={props.inputFieldStyle}
3636
style={{margin: 0}}
3737
// FALK TODO : vertical={true}
3838
onChange={(e) => {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ChangeEventHandlerControl } from "../../controls/eventHandlerControl";
55
import { Section, sectionNames } from "lowcoder-design";
66
import { RecordConstructorToComp } from "lowcoder-core";
77
import { styleControl } from "comps/controls/styleControl";
8-
import { ComponentStyle, LabelStyle, SliderStyle, SliderStyleType } from "comps/controls/styleControlConstants";
8+
import { InputFieldStyle, LabelStyle, SliderStyle, SliderStyleType } from "comps/controls/styleControlConstants";
99
import styled, { css } from "styled-components";
1010
import { default as Slider } from "antd/es/slider";
1111
import { darkenColor, fadeColor } from "lowcoder-design";
@@ -67,11 +67,11 @@ export const SliderChildren = {
6767
label: LabelControl,
6868
disabled: BoolCodeControl,
6969
onEvent: ChangeEventHandlerControl,
70-
style: styleControl(SliderStyle),
70+
style: styleControl(InputFieldStyle),
7171
labelStyle:styleControl(LabelStyle.filter((style)=> ['accent','validate'].includes(style.name) === false)),
7272
prefixIcon: IconControl,
7373
suffixIcon: IconControl,
74-
field:styleControl(ComponentStyle)
74+
inputFieldStyle:styleControl(SliderStyle)
7575
};
7676

7777
export const SliderPropertyView = (
@@ -102,8 +102,8 @@ export const SliderPropertyView = (
102102
<Section name={sectionNames.labelStyle}>
103103
{children.labelStyle.getPropertyView()}
104104
</Section>
105-
<Section name={sectionNames.field}>
106-
{children.field.getPropertyView()}
105+
<Section name={sectionNames.inputFieldStyle}>
106+
{children.inputFieldStyle.getPropertyView()}
107107
</Section>
108108
</>
109109
)}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { UICompBuilder, withDefault } from "../generators";
1010
import { CommonNameConfig, NameConfig, withExposingConfigs } from "../generators/withExposing";
1111
import { formDataChildren, FormDataPropertyView } from "./formComp/formDataConstants";
1212
import { styleControl } from "comps/controls/styleControl";
13-
import { ComponentStyle, LabelStyle, RatingStyle, RatingStyleType } from "comps/controls/styleControlConstants";
13+
import { InputFieldStyle, LabelStyle, RatingStyle, RatingStyleType } from "comps/controls/styleControlConstants";
1414
import { migrateOldData } from "comps/generators/simpleGenerators";
1515
import { disabledPropertyView, hiddenPropertyView } from "comps/utils/propertyUtils";
1616
import { trans } from "i18n";
@@ -43,9 +43,9 @@ const RatingBasicComp = (function () {
4343
allowHalf: BoolControl,
4444
disabled: BoolCodeControl,
4545
onEvent: eventHandlerControl(EventOptions),
46-
style: migrateOldData(styleControl(RatingStyle), fixOldData),
46+
style: styleControl(InputFieldStyle),
4747
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false)),
48-
field:styleControl(ComponentStyle),
48+
inputFieldStyle:migrateOldData(styleControl(RatingStyle), fixOldData),
4949
...formDataChildren,
5050
};
5151
return new UICompBuilder(childrenMap, (props) => {
@@ -67,7 +67,7 @@ const RatingBasicComp = (function () {
6767
return props.label({
6868
style: props.style,
6969
labelStyle: props.labelStyle,
70-
field:props.field,
70+
inputFieldStyle:props.inputFieldStyle,
7171
children: (
7272
<RateStyled
7373
count={props.max}
@@ -78,7 +78,7 @@ const RatingBasicComp = (function () {
7878
}}
7979
allowHalf={props.allowHalf}
8080
disabled={props.disabled}
81-
$style={props.style}
81+
$style={props.inputFieldStyle}
8282
/>
8383
),
8484
});
@@ -121,8 +121,8 @@ const RatingBasicComp = (function () {
121121
<Section name={sectionNames.labelStyle}>
122122
{children.labelStyle.getPropertyView()}
123123
</Section>
124-
<Section name={sectionNames.field}>
125-
{children.field.getPropertyView()}
124+
<Section name={sectionNames.inputFieldStyle}>
125+
{children.inputFieldStyle.getPropertyView()}
126126
</Section>
127127
</>
128128
)}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ let CascaderBasicComp = (function () {
1919
const childrenMap = CascaderChildren;
2020

2121
return new UICompBuilder(childrenMap, (props) => {
22+
console.log("🚀 ~ returnnewUICompBuilder ~ props:", props)
2223
return props.label({
2324
style: props.style,
2425
labelStyle: props.labelStyle,
25-
field:props.field,
26+
inputFieldStyle:props.inputFieldStyle,
2627
children: (
2728
<CascaderStyle
2829
ref={props.viewRef}
@@ -33,7 +34,7 @@ let CascaderBasicComp = (function () {
3334
allowClear={props.allowClear}
3435
placeholder={props.placeholder}
3536
showSearch={props.showSearch}
36-
$style={props.style}
37+
$style={props.inputFieldStyle}
3738
onFocus={() => props.onEvent("focus")}
3839
onBlur={() => props.onEvent("blur")}
3940
onChange={(value: (string | number)[]) => {

0 commit comments

Comments
 (0)