Skip to content

Commit 6987550

Browse files
author
FalkWolsky
committed
Taking Label out of Steps Comp
1 parent 199dca0 commit 6987550

File tree

2 files changed

+45
-50
lines changed

2 files changed

+45
-50
lines changed

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

Lines changed: 42 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { StepOptionControl } from "comps/controls/optionsControl";
88
import { styleControl } from "comps/controls/styleControl";
99
import { StepsStyle, StepsStyleType } from "comps/controls/styleControlConstants";
1010
import styled, { css } from "styled-components";
11-
import { UICompBuilder } from "../../generators";
11+
import { UICompBuilder, withDefault } from "../../generators";
1212
import { CommonNameConfig, NameConfig, withExposingConfigs } from "../../generators/withExposing";
1313
import { selectDivRefMethods, } from "./selectInputConstants";
1414
import { Section, sectionNames } from "lowcoder-design";
@@ -87,7 +87,6 @@ const StepsChildrenMap = {
8787
direction: dropdownControl(directionOptions, "horizontal"),
8888
showDots : BoolControl,
8989
showIcons : BoolControl,
90-
label: LabelControl,
9190
labelPlacement: dropdownControl(directionOptions, "horizontal"),
9291
disabled: BoolCodeControl,
9392
onEvent: ChangeEventHandlerControl,
@@ -128,48 +127,47 @@ let StepControlBasicComp = (function () {
128127
129128
`;
130129

131-
return props.label({
132-
children: (
133-
<StepsWrapper ref={props.viewRef}>
134-
<ConfigProvider
135-
theme={{
136-
components: {
137-
Steps: {
138-
colorPrimary: '#00b96b',
139-
algorithm: true,
140-
}
141-
},
142-
}}
143-
>
144-
<Steps
145-
initial={Number(props.initialValue.value) - 1}
146-
current={current}
147-
onChange={(current) => {
148-
onChange(current);
149-
}}
150-
percent={60}
151-
status={props.stepsStatus.value as "error" | "finish" | "process" | "wait"}
152-
type={props.displayType}
153-
size={props.size}
154-
labelPlacement={props.labelPlacement}
155-
progressDot={props.showDots}
156-
direction={props.direction}
157-
>
158-
{props.options.map((option, index) => (
159-
<Steps.Step
160-
key={index}
161-
title={option.label}
162-
subTitle={option.subTitle}
163-
description={option.description}
164-
status={option.status as "error" | "finish" | "wait" | "process" | undefined}
165-
icon={props.showIcons && hasIcon(option.icon) && option.icon || undefined}
166-
/>
167-
))}
168-
</Steps>
169-
</ConfigProvider>
170-
</StepsWrapper>
171-
),
172-
});
130+
return (
131+
<StepsWrapper ref={props.viewRef}>
132+
<ConfigProvider
133+
theme={{
134+
components: {
135+
Steps: {
136+
colorPrimary: '#00b96b',
137+
algorithm: true,
138+
}
139+
},
140+
}}
141+
>
142+
<Steps
143+
initial={Number(props.initialValue.value) - 1}
144+
current={current}
145+
onChange={(current) => {
146+
onChange(current);
147+
}}
148+
percent={60}
149+
status={props.stepsStatus.value as "error" | "finish" | "process" | "wait"}
150+
type={props.displayType}
151+
size={props.size}
152+
labelPlacement={props.labelPlacement}
153+
progressDot={props.showDots}
154+
direction={props.direction}
155+
>
156+
{props.options.map((option, index) => (
157+
<Steps.Step
158+
key={index}
159+
title={option.label}
160+
subTitle={option.subTitle}
161+
description={option.description}
162+
status={option.status as "error" | "finish" | "wait" | "process" | undefined}
163+
icon={props.showIcons && hasIcon(option.icon) && option.icon || undefined}
164+
/>
165+
))}
166+
</Steps>
167+
</ConfigProvider>
168+
</StepsWrapper>
169+
);
170+
173171
})
174172
.setPropertyViewFn((children) => (
175173
<>
@@ -188,10 +186,6 @@ let StepControlBasicComp = (function () {
188186
</Section></>
189187
)}
190188

191-
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
192-
children.label.getPropertyView()
193-
)}
194-
195189
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
196190
<Section name={sectionNames.layout}>
197191
{children.size.propertyView({

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ export var uiCompMap: Registry = {
550550
compPath: 'comps/meetingComp/videoMeetingControllerComp',
551551
withoutLoading: true,
552552
},
553+
553554
comment: {
554555
name: trans("uiComp.commentCompName"),
555556
enName: "comment",
@@ -561,7 +562,7 @@ export var uiCompMap: Registry = {
561562
compName: 'CommentComp',
562563
compPath: 'comps/commentComp/commentComp',
563564
layoutInfo: {
564-
w: 13,
565+
w: 12,
565566
h: 55,
566567
},
567568
},
@@ -912,7 +913,7 @@ export var uiCompMap: Registry = {
912913
compName: 'StepComp',
913914
compPath: 'comps/selectInputComp/stepControl',
914915
layoutInfo: {
915-
w: 6,
916+
w: 19,
916917
h: 6,
917918
},
918919
},

0 commit comments

Comments
 (0)