hplx-react-elements-dev 1.0.37 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +33 -28
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2067,6 +2067,18 @@ var DropdownItems = function DropdownItems(_a) {
|
|
|
2067
2067
|
setHover(false);
|
|
2068
2068
|
};
|
|
2069
2069
|
|
|
2070
|
+
var ref = useRef(null);
|
|
2071
|
+
|
|
2072
|
+
var checkOverFlow = function checkOverFlow() {
|
|
2073
|
+
var element = ref.current;
|
|
2074
|
+
|
|
2075
|
+
if (element) {
|
|
2076
|
+
return element.scrollWidth > element.offsetWidth;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
return false;
|
|
2080
|
+
};
|
|
2081
|
+
|
|
2070
2082
|
return jsxRuntime.exports.jsxs("div", __assign({
|
|
2071
2083
|
onClick: function onClick() {
|
|
2072
2084
|
!disabled && onSelect && onSelect(value);
|
|
@@ -2081,12 +2093,15 @@ var DropdownItems = function DropdownItems(_a) {
|
|
|
2081
2093
|
children: jsxRuntime.exports.jsx("span", {
|
|
2082
2094
|
className: start_icon
|
|
2083
2095
|
})
|
|
2084
|
-
})), jsxRuntime.exports.jsx(
|
|
2085
|
-
|
|
2096
|
+
})), jsxRuntime.exports.jsx(Typography, __assign({
|
|
2097
|
+
variant: hover && !disabled ? 'Medium' : 'Regular',
|
|
2098
|
+
type: "Text md",
|
|
2099
|
+
className: "hplxt-truncate"
|
|
2086
2100
|
}, {
|
|
2087
|
-
children: jsxRuntime.exports.jsx(
|
|
2088
|
-
|
|
2089
|
-
|
|
2101
|
+
children: jsxRuntime.exports.jsx("div", __assign({
|
|
2102
|
+
className: "hplxt-flex-1 ".concat(disabled ? 'hplxt-text-Gray-200' : 'hplxt-text-Gray-700', " ").concat(className),
|
|
2103
|
+
title: checkOverFlow() ? label : undefined,
|
|
2104
|
+
ref: ref
|
|
2090
2105
|
}, {
|
|
2091
2106
|
children: label
|
|
2092
2107
|
}))
|
|
@@ -2936,33 +2951,23 @@ var getTheme = function getTheme(theme) {
|
|
|
2936
2951
|
};
|
|
2937
2952
|
|
|
2938
2953
|
var Tooltip = function Tooltip(props) {
|
|
2939
|
-
var _a =
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
_d = _b.theme,
|
|
2948
|
-
theme = _d === void 0 ? "dark" : _d,
|
|
2949
|
-
text = _b.text,
|
|
2950
|
-
supportingText = _b.supportingText;
|
|
2954
|
+
var _a = props || {},
|
|
2955
|
+
_b = _a.variant,
|
|
2956
|
+
variant = _b === void 0 ? "Bottom" : _b,
|
|
2957
|
+
children = _a.children,
|
|
2958
|
+
_c = _a.theme,
|
|
2959
|
+
theme = _c === void 0 ? "dark" : _c,
|
|
2960
|
+
text = _a.text,
|
|
2961
|
+
supportingText = _a.supportingText;
|
|
2951
2962
|
|
|
2952
2963
|
return jsxRuntime.exports.jsxs("div", __assign({
|
|
2953
|
-
className: "hplxt-relative hplxt-inline-block"
|
|
2954
|
-
onMouseEnter: function onMouseEnter() {
|
|
2955
|
-
return setActive(true);
|
|
2956
|
-
},
|
|
2957
|
-
onMouseLeave: function onMouseLeave() {
|
|
2958
|
-
return setActive(false);
|
|
2959
|
-
}
|
|
2964
|
+
className: "hplxt-group hplxt-relative hplxt-inline-block"
|
|
2960
2965
|
}, {
|
|
2961
2966
|
children: [children, jsxRuntime.exports.jsxs("div", __assign({
|
|
2962
|
-
className: "hplxt-w-max hplxt-text-left hplxt-max-w-xs ".concat(getVariantPlacement(variant))
|
|
2967
|
+
className: " hplxt-invisible group-hover:hplxt-visible hplxt-opacity-0 group-hover:hplxt-opacity-100 hplxt-transition hplxt-delay-1000\t hplxt-w-max hplxt-text-left hplxt-max-w-xs ".concat(getVariantPlacement(variant))
|
|
2963
2968
|
}, {
|
|
2964
2969
|
children: [// using short circuit operator to show the tooltip //{`${getVariantMessagePlacement(variant)}`}
|
|
2965
|
-
|
|
2970
|
+
(text || supportingText) && jsxRuntime.exports.jsxs("div", __assign({
|
|
2966
2971
|
className: "hplxt-px-3 hplxt-py-2 hplxt-shadow-lg hplxt-rounded-lg ".concat(getTheme(theme), " ").concat(getVariantMessagePlacement(variant))
|
|
2967
2972
|
}, {
|
|
2968
2973
|
children: [jsxRuntime.exports.jsx(Typography, __assign({
|
|
@@ -2977,7 +2982,7 @@ var Tooltip = function Tooltip(props) {
|
|
|
2977
2982
|
children: supportingText
|
|
2978
2983
|
}))]
|
|
2979
2984
|
})), // using short circuit operator to show the tooltip arrow
|
|
2980
|
-
|
|
2985
|
+
variant && (text || supportingText) && jsxRuntime.exports.jsx("div", {
|
|
2981
2986
|
className: "hplxt-absolute hplxt-w-3 hplxt-h-3 hplxt-rotate-45 ".concat(getTheme(theme), " ").concat(getVariantArrowPlacement(variant))
|
|
2982
2987
|
})]
|
|
2983
2988
|
}))]
|
|
@@ -5472,7 +5477,7 @@ var MessageToast = function MessageToast(_a) {
|
|
|
5472
5477
|
setList = _b[1];
|
|
5473
5478
|
|
|
5474
5479
|
return jsxRuntime.exports.jsx("div", __assign({
|
|
5475
|
-
className: "hplxt-fixed hplxt-z-90 hplxt-bottom-
|
|
5480
|
+
className: "hplxt-fixed hplxt-z-90 hplxt-bottom-16 hplxt-right-8 hplxt-flex hplxt-flex-col hplxt-justify-center hplxt-items-center"
|
|
5476
5481
|
}, {
|
|
5477
5482
|
children: list.map(function (item) {
|
|
5478
5483
|
return jsxRuntime.exports.jsx(Toast, {
|