Browse Source

Remove hover_text from Indicator (#1282)

* Added myself to contributors.txt

* Remove hover_text from the Indicator component

* Updated factory.py and viselments.json accordingly

* Add 'hide':true attribute
Satoshi S 11 months ago
parent
commit
fc6d311771

+ 1 - 0
contributors.txt

@@ -15,3 +15,4 @@ bobbyshermi
 Forchapeatl
 Forchapeatl
 yarikoptic
 yarikoptic
 Luke-0162
 Luke-0162
+Satoshi-Sh

+ 3 - 7
frontend/taipy-gui/src/components/Taipy/Indicator.tsx

@@ -13,13 +13,12 @@
 
 
 import React, { useCallback, useMemo } from "react";
 import React, { useCallback, useMemo } from "react";
 import Slider from "@mui/material/Slider";
 import Slider from "@mui/material/Slider";
-import Tooltip from "@mui/material/Tooltip";
 import { sprintf } from "sprintf-js";
 import { sprintf } from "sprintf-js";
 
 
-import { TaipyBaseProps, TaipyHoverProps } from "./utils";
-import { useClassNames, useDynamicProperty } from "../../utils/hooks";
+import { TaipyBaseProps } from "./utils";
+import { useClassNames } from "../../utils/hooks";
 
 
-interface IndicatorProps extends TaipyBaseProps, TaipyHoverProps {
+interface IndicatorProps extends TaipyBaseProps {
     min?: number;
     min?: number;
     max?: number;
     max?: number;
     value?: number;
     value?: number;
@@ -43,7 +42,6 @@ const Indicator = (props: IndicatorProps) => {
 
 
     const horizontalOrientation = props.orientation ? props.orientation.charAt(0).toLowerCase() !== "v" : true;
     const horizontalOrientation = props.orientation ? props.orientation.charAt(0).toLowerCase() !== "v" : true;
     const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
     const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
-    const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);
 
 
     const getLabel = useCallback(() => {
     const getLabel = useCallback(() => {
         const dsp = display === undefined ? (defaultDisplay === undefined ? "" : defaultDisplay) : display;
         const dsp = display === undefined ? (defaultDisplay === undefined ? "" : defaultDisplay) : display;
@@ -95,7 +93,6 @@ const Indicator = (props: IndicatorProps) => {
     );
     );
 
 
     return (
     return (
-        <Tooltip title={hover || ""}>
             <Slider
             <Slider
                 id={props.id}
                 id={props.id}
                 className={className}
                 className={className}
@@ -109,7 +106,6 @@ const Indicator = (props: IndicatorProps) => {
                 orientation={horizontalOrientation ? undefined : "vertical"}
                 orientation={horizontalOrientation ? undefined : "vertical"}
                 sx={sliderSx}
                 sx={sliderSx}
             ></Slider>
             ></Slider>
-        </Tooltip>
     );
     );
 };
 };
 
 

+ 1 - 2
taipy/gui/_renderers/factory.py

@@ -57,7 +57,7 @@ class _Factory:
         "text": "value",
         "text": "value",
         "toggle": "value",
         "toggle": "value",
         "tree": "value",
         "tree": "value",
-        "metric": "value"
+        "metric": "value",
     }
     }
 
 
     _TEXT_ATTRIBUTES = ["format", "id", "hover_text", "raw"]
     _TEXT_ATTRIBUTES = ["format", "id", "hover_text", "raw"]
@@ -280,7 +280,6 @@ class _Factory:
                 ("value", PropertyType.dynamic_number),
                 ("value", PropertyType.dynamic_number),
                 ("format",),
                 ("format",),
                 ("orientation"),
                 ("orientation"),
-                ("hover_text", PropertyType.dynamic_string),
                 ("width",),
                 ("width",),
                 ("height",),
                 ("height",),
             ]
             ]

+ 5 - 0
taipy/gui/viselements.json

@@ -833,6 +833,11 @@
                         "type": "str",
                         "type": "str",
                         "default_value": "None",
                         "default_value": "None",
                         "doc": "The height, in CSS units, of the indicator (used when orientation is vertical)."
                         "doc": "The height, in CSS units, of the indicator (used when orientation is vertical)."
+                    },
+                    {
+                        "name": "hover_text",
+                        "doc": "TODO not implemented",
+                        "hide": true
                     }
                     }
                 ]
                 ]
             }
             }