Skip to content

Commit 108879e

Browse files
author
JeanRobin
committed
Revert "hover_text not working on tgb.number control (#2792)"
This reverts commit 4968106.
1 parent 7958357 commit 108879e

File tree

12 files changed

+1260
-1112
lines changed

12 files changed

+1260
-1112
lines changed

frontend/taipy-gui/dom/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/taipy-gui/package-lock.json

Lines changed: 604 additions & 545 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/taipy-gui/src/components/Taipy/Field.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,32 @@ const Field = (props: TaipyFieldProps) => {
4747

4848
const style = useMemo(
4949
() => ({ overflow: "auto", width: props.width ? getCssSize(props.width) : undefined }),
50-
[props.width],
50+
[props.width]
5151
);
5252
const typoSx = useMemo(
5353
() =>
5454
props.width
5555
? { ...unsetWeightSx, overflow: "auto", width: getCssSize(props.width), display: "inline-block" }
5656
: unsetWeightSx,
57-
[props.width],
57+
[props.width]
5858
);
5959

6060
const value = useMemo(() => {
6161
return formatWSValue(
6262
props.value !== undefined ? props.value : defaultValue || "",
6363
dataType,
6464
format,
65-
formatConfig,
65+
formatConfig
6666
);
6767
}, [defaultValue, props.value, dataType, format, formatConfig]);
6868

6969
return (
70-
<>
71-
<Tooltip title={hover || ""}>
70+
<Tooltip title={hover || ""}>
71+
<>
7272
{mode == "pre" ? (
7373
<pre
7474
className={`${className} ${getSuffixedClassNames(className, "-pre")} ${getComponentClassName(
75-
props.children,
75+
props.children
7676
)}`}
7777
id={id}
7878
style={style}
@@ -83,7 +83,7 @@ const Field = (props: TaipyFieldProps) => {
8383
<div
8484
className={`${className} ${getSuffixedClassNames(
8585
className,
86-
"-markdown",
86+
"-markdown"
8787
)} ${getComponentClassName(props.children)}`}
8888
>
8989
<Suspense fallback={<div>Loading Markdown...</div>}>
@@ -93,7 +93,7 @@ const Field = (props: TaipyFieldProps) => {
9393
) : raw || mode == "raw" ? (
9494
<span
9595
className={`${className} ${getSuffixedClassNames(className, "-raw")} ${getComponentClassName(
96-
props.children,
96+
props.children
9797
)}`}
9898
id={id}
9999
style={style}
@@ -103,7 +103,7 @@ const Field = (props: TaipyFieldProps) => {
103103
) : mode == "latex" ? (
104104
<MathJax
105105
className={`${className} ${getSuffixedClassNames(className, "-latex")} ${getComponentClassName(
106-
props.children,
106+
props.children
107107
)}`}
108108
id={id}
109109
dynamic={true}
@@ -122,9 +122,9 @@ const Field = (props: TaipyFieldProps) => {
122122
{value}
123123
</Typography>
124124
)}
125-
</Tooltip>
126-
{props.children}
127-
</>
125+
{props.children}
126+
</>
127+
</Tooltip>
128128
);
129129
};
130130

frontend/taipy-gui/src/components/Taipy/Image.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const Image = (props: ImageProps) => {
6666
display: inlineSvg ? "inline-flex" : undefined,
6767
verticalAlign: inlineSvg ? "middle" : undefined,
6868
}),
69-
[width, height, inlineSvg],
69+
[width, height, inlineSvg]
7070
);
7171

7272
useEffect(() => {
@@ -78,8 +78,8 @@ const Image = (props: ImageProps) => {
7878
}, [svg, svgContent]);
7979

8080
return (
81-
<>
82-
<Tooltip title={hover || label}>
81+
<Tooltip title={hover || label}>
82+
<>
8383
{onAction ? (
8484
<span>
8585
<Button
@@ -115,9 +115,9 @@ const Image = (props: ImageProps) => {
115115
alt={label}
116116
/>
117117
)}
118-
</Tooltip>
119-
{props.children}
120-
</>
118+
{props.children}
119+
</>
120+
</Tooltip>
121121
);
122122
};
123123

frontend/taipy-gui/src/components/Taipy/Input.tsx

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const Input = (props: TaipyInputProps) => {
9797
maxWidth: getCssSize(props.width),
9898
}
9999
: numberSx,
100-
[props.width],
100+
[props.width]
101101
);
102102

103103
// 0 if value is not a number, 1 means general number, 2 means integer
@@ -128,7 +128,7 @@ const Input = (props: TaipyInputProps) => {
128128
dispatch(createSendUpdateAction(updateVarName, value, module, onChange, propagate));
129129
}, changeDelay);
130130
},
131-
[changeDelay, numberType, dispatch, updateVarName, module, onChange, propagate],
131+
[changeDelay, numberType, dispatch, updateVarName, module, onChange, propagate]
132132
);
133133

134134
const handleInput = useCallback(
@@ -144,13 +144,7 @@ const Input = (props: TaipyInputProps) => {
144144
if (changeDelay === 0) {
145145
Promise.resolve().then(() => {
146146
dispatch(
147-
createSendUpdateAction(
148-
updateVarName,
149-
valToNumber(val, numberType),
150-
module,
151-
onChange,
152-
propagate,
153-
),
147+
createSendUpdateAction(updateVarName, valToNumber(val, numberType), module, onChange, propagate)
154148
);
155149
});
156150
}
@@ -160,11 +154,11 @@ const Input = (props: TaipyInputProps) => {
160154
delayCall.current = window.setTimeout(() => {
161155
delayCall.current = -1;
162156
dispatch(
163-
createSendUpdateAction(updateVarName, valToNumber(val, numberType), module, onChange, propagate),
157+
createSendUpdateAction(updateVarName, valToNumber(val, numberType), module, onChange, propagate)
164158
);
165159
}, changeDelay);
166160
},
167-
[changeDelay, numberType, dispatch, updateVarName, module, onChange, propagate],
161+
[changeDelay, numberType, dispatch, updateVarName, module, onChange, propagate]
168162
);
169163

170164
const handleBlur = useCallback(
@@ -195,7 +189,7 @@ const Input = (props: TaipyInputProps) => {
195189
});
196190
evt.preventDefault();
197191
},
198-
[dispatch, numberType, min, max, updateVarName, module, onChange, propagate, changeDelay, id, onAction],
192+
[dispatch, numberType, min, max, updateVarName, module, onChange, propagate, changeDelay, id, onAction]
199193
);
200194

201195
const handleAction = useCallback(
@@ -226,10 +220,10 @@ const Input = (props: TaipyInputProps) => {
226220
const val = multiline
227221
? evt.currentTarget.querySelector("textarea")?.value
228222
: numberType
229-
? numberType === IsInteger
230-
? Math.round(Number(evt.currentTarget.querySelector("input")?.value))
231-
: Number(evt.currentTarget.querySelector("input")?.value)
232-
: evt.currentTarget.querySelector("input")?.value;
223+
? numberType === IsInteger
224+
? Math.round(Number(evt.currentTarget.querySelector("input")?.value))
225+
: Number(evt.currentTarget.querySelector("input")?.value)
226+
: evt.currentTarget.querySelector("input")?.value;
233227

234228
if (changeDelay > 0 && delayCall.current > 0) {
235229
clearTimeout(delayCall.current);
@@ -259,7 +253,7 @@ const Input = (props: TaipyInputProps) => {
259253
changeDelay,
260254
onChange,
261255
propagate,
262-
],
256+
]
263257
);
264258

265259
const roundBasedOnStep = useMemo(() => {
@@ -285,7 +279,7 @@ const Input = (props: TaipyInputProps) => {
285279
step || 1,
286280
stepMultiplier || 10,
287281
event.shiftKey,
288-
increment,
282+
increment
289283
);
290284

291285
if (min !== undefined && Number(newValue) < min) {
@@ -302,29 +296,29 @@ const Input = (props: TaipyInputProps) => {
302296
return newValue;
303297
});
304298
},
305-
[calculateNewValue, step, stepMultiplier, min, max, updateValueWithDelay],
299+
[calculateNewValue, step, stepMultiplier, min, max, updateValueWithDelay]
306300
);
307301

308302
const handleUpStepperMouseDown = useCallback(
309303
(event: React.MouseEvent<HTMLButtonElement>) => {
310304
handleStepperMouseDown(event, true);
311305
},
312-
[handleStepperMouseDown],
306+
[handleStepperMouseDown]
313307
);
314308

315309
const handleDownStepperMouseDown = useCallback(
316310
(event: React.MouseEvent<HTMLButtonElement>) => {
317311
handleStepperMouseDown(event, false);
318312
},
319-
[handleStepperMouseDown],
313+
[handleStepperMouseDown]
320314
);
321315

322316
// password
323317
const [showPassword, setShowPassword] = useState(false);
324318
const handleClickShowPassword = useCallback(() => setShowPassword((show) => !show), []);
325319
const handleMouseDownPassword = useCallback(
326320
(event: React.MouseEvent<HTMLButtonElement>) => event.preventDefault(),
327-
[],
321+
[]
328322
);
329323
const inputProps = useMemo(
330324
() =>
@@ -361,22 +355,22 @@ const Input = (props: TaipyInputProps) => {
361355
},
362356
}
363357
: type == "password"
364-
? {
365-
htmlInput: { autoComplete: "current-password" },
366-
input: {
367-
endAdornment: (
368-
<IconButton
369-
aria-label="Toggle password visibility"
370-
onClick={handleClickShowPassword}
371-
onMouseDown={handleMouseDownPassword}
372-
edge="end"
373-
>
374-
{showPassword ? <VisibilityOff /> : <Visibility />}
375-
</IconButton>
376-
),
377-
},
378-
}
379-
: undefined,
358+
? {
359+
htmlInput: { autoComplete: "current-password" },
360+
input: {
361+
endAdornment: (
362+
<IconButton
363+
aria-label="Toggle password visibility"
364+
onClick={handleClickShowPassword}
365+
onMouseDown={handleMouseDownPassword}
366+
edge="end"
367+
>
368+
{showPassword ? <VisibilityOff /> : <Visibility />}
369+
</IconButton>
370+
),
371+
},
372+
}
373+
: undefined,
380374
[
381375
active,
382376
type,
@@ -388,7 +382,7 @@ const Input = (props: TaipyInputProps) => {
388382
handleMouseDownPassword,
389383
handleUpStepperMouseDown,
390384
handleDownStepperMouseDown,
391-
],
385+
]
392386
);
393387

394388
useEffect(() => {
@@ -398,8 +392,8 @@ const Input = (props: TaipyInputProps) => {
398392
}, [props.value]);
399393

400394
return (
401-
<>
402-
<Tooltip title={hover || ""}>
395+
<Tooltip title={hover || ""}>
396+
<>
403397
<TextField
404398
sx={textSx}
405399
margin="dense"
@@ -419,9 +413,9 @@ const Input = (props: TaipyInputProps) => {
419413
maxRows={linesShown}
420414
size={size}
421415
/>
422-
</Tooltip>
423-
{props.children}
424-
</>
416+
{props.children}
417+
</>
418+
</Tooltip>
425419
);
426420
};
427421
export default Input;

frontend/taipy-gui/src/components/Taipy/Menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* specific language governing permissions and limitations under the License.
1212
*/
1313

14-
import React, { useCallback, useMemo, useState, MouseEvent, CSSProperties, useEffect } from "react";
14+
import React, { useCallback, useMemo, useState, MouseEvent, CSSProperties,useEffect } from "react";
1515
import MenuIco from "@mui/icons-material/Menu";
1616
import ListItemButton from "@mui/material/ListItemButton";
1717
import Drawer from "@mui/material/Drawer";

0 commit comments

Comments
 (0)