hplx-react-elements-dev 1.0.38 → 1.0.40
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 +45 -29
- 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
|
}))]
|
|
@@ -16899,13 +16904,23 @@ var DatePicker = function DatePicker(_a) {
|
|
|
16899
16904
|
|
|
16900
16905
|
var handleSelect = function handleSelect(date) {
|
|
16901
16906
|
setDate(date);
|
|
16902
|
-
setClicked(
|
|
16907
|
+
setClicked(function (prev_clicked) {
|
|
16908
|
+
return !prev_clicked;
|
|
16909
|
+
});
|
|
16903
16910
|
console.log(dayjs().format("MMM DD, YYYY"));
|
|
16904
16911
|
dateVar(date);
|
|
16905
16912
|
};
|
|
16906
16913
|
|
|
16907
16914
|
var inputClick = function inputClick() {
|
|
16908
|
-
setClicked(
|
|
16915
|
+
setClicked(function (prev_clicked) {
|
|
16916
|
+
return !prev_clicked;
|
|
16917
|
+
});
|
|
16918
|
+
};
|
|
16919
|
+
|
|
16920
|
+
var inputFocus = function inputFocus() {
|
|
16921
|
+
setClicked(function (prev_clicked) {
|
|
16922
|
+
return !prev_clicked;
|
|
16923
|
+
});
|
|
16909
16924
|
};
|
|
16910
16925
|
|
|
16911
16926
|
useEffect(function () {
|
|
@@ -16933,6 +16948,7 @@ var DatePicker = function DatePicker(_a) {
|
|
|
16933
16948
|
inputProps: {
|
|
16934
16949
|
placeholder: "Select date",
|
|
16935
16950
|
onClick: inputClick,
|
|
16951
|
+
onFocus: inputFocus,
|
|
16936
16952
|
value: date ? dayjs(date).format("MMM DD, YYYY") : selectDate === null || selectDate === void 0 ? void 0 : selectDate.toString()
|
|
16937
16953
|
},
|
|
16938
16954
|
fieldColor: fieldColor
|