Skip to content

Commit ab9d93d

Browse files
committed
formating removed-18
1 parent 3fa1b0f commit ab9d93d

File tree

1 file changed

+38
-21
lines changed

1 file changed

+38
-21
lines changed

client/packages/lowcoder/src/comps/comps/buttonComp/toggleButtonComp.tsx

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@ const ToggleTmpComp = (function () {
8282
loading={props.loading}
8383
disabled={props.disabled}
8484
onClick={() => {
85-
props.onEvent("change");
85+
props.onEvent('change');
8686
props.value.onChange(!props.value.value);
8787
}}
8888
>
89-
{props.iconPosition === "right" && text}
90-
{<IconWrapper>{props.value.value ? props.trueIcon : props.falseIcon}</IconWrapper>}
91-
{props.iconPosition === "left" && text}
89+
{props.iconPosition === 'right' && text}
90+
{
91+
<IconWrapper>
92+
{props.value.value ? props.trueIcon : props.falseIcon}
93+
</IconWrapper>
94+
}
95+
{props.iconPosition === 'left' && text}
9296
</Button100>
9397
</ButtonCompWrapperStyled>
9498
);
@@ -97,53 +101,66 @@ const ToggleTmpComp = (function () {
97101
<>
98102
<Section name={sectionNames.basic}>
99103
{children.value.propertyView({
100-
label: trans("prop.defaultValue"),
101-
tooltip: trans("toggleButton.valueDesc"),
104+
label: trans('prop.defaultValue'),
105+
tooltip: trans('toggleButton.valueDesc'),
102106
})}
103107
</Section>
104108

105-
{(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && (
106-
<><Section name={sectionNames.interaction}>
109+
{(useContext(EditorContext).editorModeStatus === 'logic' ||
110+
useContext(EditorContext).editorModeStatus === 'both') && (
111+
<>
112+
<Section name={sectionNames.interaction}>
107113
{children.onEvent.getPropertyView()}
108114
{disabledPropertyView(children)}
109115
{hiddenPropertyView(children)}
110116
{loadingPropertyView(children)}
111117
</Section>
112118
<Section name={sectionNames.advanced}>
113-
{children.showText.propertyView({ label: trans("toggleButton.showText") })}
114-
{children.showText.getView() &&
115-
children.trueText.propertyView({ label: trans("toggleButton.trueLabel") })}
119+
{children.showText.propertyView({
120+
label: trans('toggleButton.showText'),
121+
})}
116122
{children.showText.getView() &&
117-
children.falseText.propertyView({ label: trans("toggleButton.falseLabel") })}
118-
{children.trueIcon.propertyView({ label: trans("toggleButton.trueIconLabel") })}
119-
{children.falseIcon.propertyView({ label: trans("toggleButton.falseIconLabel") })}
123+
children.trueText.propertyView({
124+
label: trans('toggleButton.trueLabel'),
125+
})}
126+
{children.showText.getView() &&
127+
children.falseText.propertyView({
128+
label: trans('toggleButton.falseLabel'),
129+
})}
130+
{children.trueIcon.propertyView({
131+
label: trans('toggleButton.trueIconLabel'),
132+
})}
133+
{children.falseIcon.propertyView({
134+
label: trans('toggleButton.falseIconLabel'),
135+
})}
120136
{children.showText.getView() &&
121137
children.iconPosition.propertyView({
122-
label: trans("toggleButton.iconPosition"),
138+
label: trans('toggleButton.iconPosition'),
123139
radioButton: true,
124-
})}
140+
})}
125141
{children.alignment.propertyView({
126-
label: trans("toggleButton.alignment"),
142+
label: trans('toggleButton.alignment'),
127143
radioButton: true,
128144
})}
129145
</Section>
130146
</>
131147
)}
132148

133-
{(useContext(EditorContext).editorModeStatus === "layout" ||
134-
useContext(EditorContext).editorModeStatus === "both") && (
149+
{(useContext(EditorContext).editorModeStatus === 'layout' ||
150+
useContext(EditorContext).editorModeStatus === 'both') && (
135151
<>
136152
<Section name={sectionNames.style}>
137153
{children.showBorder.propertyView({
138-
label: trans("toggleButton.showBorder"),
154+
label: trans('toggleButton.showBorder'),
139155
})}
140156
{children.style.getPropertyView()}
141157
</Section>
142158
<Section name={sectionNames.animationStyle}>
143159
{children.animationStyle.getPropertyView()}
144160
</Section>
145161
</>
146-
)}
162+
)}
163+
147164
</>
148165
))
149166
.setExposeMethodConfigs(buttonRefMethods)

0 commit comments

Comments
 (0)