Skip to content

Commit b8256e1

Browse files
committed
StepControl: Added min width and a horizontal scroll
1 parent b153e17 commit b8256e1

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ConfigProvider, Steps} from "antd";
2-
import { BoolCodeControl } from "comps/controls/codeControl";
2+
import { BoolCodeControl, RadiusControl } from "comps/controls/codeControl";
33
import { BoolControl } from "comps/controls/boolControl";
44
import { stringExposingStateControl, numberExposingStateControl } from "comps/controls/codeStateControl";
55
import { ChangeEventHandlerControl } from "comps/controls/eventHandlerControl";
@@ -96,10 +96,19 @@ const StepsChildrenMap = {
9696
viewRef: RefControl<HTMLDivElement>,
9797
animationStyle: styleControl(AnimationStyle ,'animationStyle' ),
9898
showVerticalScrollbar: withDefault(BoolControl, false),
99+
minHorizontalWidth: withDefault(RadiusControl, ''),
99100
};
100101

101102
let StepControlBasicComp = (function () {
102103
return new UICompBuilder(StepsChildrenMap, (props) => {
104+
105+
const ScrollWrapper = styled.div<{ $showHorizontalScroll: boolean }>`
106+
overflow-x: scroll;
107+
::-webkit-scrollbar {
108+
display: ${props => props.$showHorizontalScroll ? "block" : "none"};
109+
}
110+
`;
111+
103112
const StyledWrapper = styled.div<{ style: StepsStyleType, $animationStyle: AnimationStyleType }>`
104113
${props=>props.$animationStyle}
105114
height: 100%;
@@ -176,6 +185,7 @@ let StepControlBasicComp = (function () {
176185
<ScrollBar
177186
style={{
178187
height: props.autoHeight ? "auto" : "100%",
188+
minWidth: props.minHorizontalWidth,
179189
margin: "0px",
180190
padding: "0px",
181191
}}
@@ -232,6 +242,18 @@ let StepControlBasicComp = (function () {
232242
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
233243
<Section name={sectionNames.layout}>
234244
{children.autoHeight.getPropertyView()}
245+
<<<<<<< Updated upstream
246+
=======
247+
{!children.autoHeight.getView() && (
248+
children.showVerticalScrollbar.propertyView({
249+
label: trans("prop.showVerticalScrollbar"),
250+
})
251+
)}
252+
{children.minHorizontalWidth.propertyView({
253+
label: trans("prop.minHorizontalWidth"),
254+
placeholder: '100px',
255+
})}
256+
>>>>>>> Stashed changes
235257
{children.size.propertyView({
236258
label: trans("step.size"),
237259
radioButton: true,

0 commit comments

Comments
 (0)