Skip to content

Commit 4ac60a2

Browse files
authored
Merge pull request #1707 from kamalqureshi/tooltip_for_buttons
Tooltips - Properties view
2 parents b19ebe7 + 937acc4 commit 4ac60a2

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ const childrenMap = {
134134
style: ButtonStyleControl,
135135
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
136136
viewRef: RefControl<HTMLElement>,
137+
tooltip: StringControl
137138
};
138139

139140
type ChildrenType = NewChildren<RecordConstructorToComp<typeof childrenMap>>;
@@ -146,6 +147,7 @@ const ButtonPropertyView = React.memo((props: {
146147
<>
147148
<Section name={sectionNames.basic}>
148149
{props.children.text.propertyView({ label: trans("text") })}
150+
{props.children.tooltip.propertyView({ label: trans("labelProp.tooltip")})}
149151
</Section>
150152

151153
{(editorModeStatus === "logic" || editorModeStatus === "both") && (
@@ -204,7 +206,7 @@ const ButtonView = React.memo((props: ToViewReturn<ChildrenType>) => {
204206
<ButtonCompWrapper $disabled={props.disabled}>
205207
<EditorContext.Consumer>
206208
{(editorState) => (
207-
<Tooltip title={props.text}>
209+
<Tooltip title={props.tooltip}>
208210
<Button100
209211
ref={props.viewRef}
210212
$buttonStyle={props.style}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const ToggleTmpComp = (function () {
6666
animationStyle: styleControl(AnimationStyle , 'animationStyle'),
6767
showBorder: withDefault(BoolControl, true),
6868
viewRef: RefControl<HTMLElement>,
69+
tooltip: StringControl,
6970
};
7071
return new UICompBuilder(childrenMap, (props) => {
7172
const text = props.showText
@@ -79,7 +80,7 @@ const ToggleTmpComp = (function () {
7980
$showBorder={props.showBorder}
8081
$animationStyle={props.animationStyle}
8182
>
82-
<Tooltip title={props.value.value ? props.trueText : props.falseText}>
83+
<Tooltip title={props.tooltip}>
8384
<Button100
8485
ref={props.viewRef}
8586
$buttonStyle={props.style}
@@ -117,6 +118,7 @@ const ToggleTmpComp = (function () {
117118
</Section>
118119
<Section name={sectionNames.advanced}>
119120
{children.showText.propertyView({ label: trans("toggleButton.showText") })}
121+
{children.tooltip.propertyView({label: trans("labelProp.tooltip")})}
120122
{children.showText.getView() &&
121123
children.trueText.propertyView({ label: trans("toggleButton.trueLabel") })}
122124
{children.showText.getView() &&

client/packages/lowcoder/src/comps/comps/meetingComp/controlButton.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ const childrenMap = {
201201
iconScoutAsset: IconscoutControl(AssetType.ICON),
202202
style: ButtonStyleControl,
203203
viewRef: RefControl<HTMLElement>,
204-
restrictPaddingOnRotation:withDefault(StringControl, 'controlButton')
204+
restrictPaddingOnRotation:withDefault(StringControl, 'controlButton'),
205+
tooltip: StringControl
205206
};
206207

207208
let ButtonTmpComp = (function () {
@@ -259,7 +260,7 @@ let ButtonTmpComp = (function () {
259260
: undefined
260261
}
261262
>
262-
<Tooltip title={trans("meeting.meetingControlCompName")}>
263+
<Tooltip title={props.tooltip}>
263264
<Button100
264265
ref={props.viewRef}
265266
$buttonStyle={props.style}
@@ -323,6 +324,9 @@ let ButtonTmpComp = (function () {
323324
{children.sourceMode.getView() === 'asset-library' &&children.iconScoutAsset.propertyView({
324325
label: trans("button.icon"),
325326
})}
327+
{children.tooltip.propertyView({
328+
label: trans("labelProp.tooltip"),
329+
})}
326330
</Section>
327331

328332
{(useContext(EditorContext).editorModeStatus === "logic" ||

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,7 @@ let CheckboxBasicComp = (function () {
231231
return props.options
232232
.filter((option) => option.value !== undefined && !option.hidden)
233233
.map((option) => ({
234-
label: (
235-
<Tooltip title={option.label}>
236-
<span>{option.label}</span>
237-
</Tooltip>
238-
),
234+
label: option.label,
239235
value: option.value,
240236
disabled: option.disabled,
241237
}));

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,7 @@ const MemoizedRadio = memo(({
134134
return options
135135
.filter((option) => option.value !== undefined && !option.hidden)
136136
.map((option) => ({
137-
label: (
138-
<Tooltip title={option.label}>
139-
<span>{option.label}</span>
140-
</Tooltip>
141-
),
137+
label: option.label,
142138
value: option.value,
143139
disabled: option.disabled,
144140
}));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy