Skip to content

Commit 1e15ddd

Browse files
committed
field styles added to switch
1 parent 347d61b commit 1e15ddd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { booleanExposingStateControl } from "comps/controls/codeStateControl";
44
import { changeEvent, eventHandlerControl } from "comps/controls/eventHandlerControl";
55
import { LabelControl } from "comps/controls/labelControl";
66
import { styleControl } from "comps/controls/styleControl";
7-
import { SwitchStyle, SwitchStyleType, LabelStyle } from "comps/controls/styleControlConstants";
7+
import { SwitchStyle, SwitchStyleType, LabelStyle, ComponentStyle } from "comps/controls/styleControlConstants";
88
import { migrateOldData } from "comps/generators/simpleGenerators";
99
import { Section, sectionNames } from "lowcoder-design";
1010
import styled, { css } from "styled-components";
@@ -92,13 +92,14 @@ let SwitchTmpComp = (function () {
9292
style: migrateOldData(styleControl(SwitchStyle), fixOldData),
9393
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false)),
9494
viewRef: RefControl<HTMLElement>,
95-
95+
field:styleControl(ComponentStyle),
9696
...formDataChildren,
9797
};
9898
return new UICompBuilder(childrenMap, (props) => {
9999
return props.label({
100100
style: props.style,
101-
labelStyle:props.labelStyle,
101+
labelStyle: props.labelStyle,
102+
field:props.field,
102103
children: (
103104
<SwitchWrapper disabled={props.disabled} $style={props.style}>
104105
<Switch
@@ -144,6 +145,9 @@ let SwitchTmpComp = (function () {
144145
<Section name={sectionNames.labelStyle}>
145146
{children.labelStyle.getPropertyView()}
146147
</Section>
148+
<Section name={sectionNames.field}>
149+
{children.field.getPropertyView()}
150+
</Section>
147151
</>
148152
)}
149153
</>

0 commit comments

Comments
 (0)