@deque/cauldron-react 6.17.1-canary.0d77c457 → 6.17.1-canary.2cd0a593
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.
|
@@ -10,6 +10,7 @@ interface TextEllipsisBaseProps extends PolymorphicProps<React.HTMLAttributes<HT
|
|
|
10
10
|
* Only use this prop if you have an alternative way to make the full text accessible.
|
|
11
11
|
*/
|
|
12
12
|
hideTooltip?: boolean;
|
|
13
|
+
onOverflowChange?: (hasOverflow: boolean) => void;
|
|
13
14
|
}
|
|
14
15
|
interface TextEllipsisWithTooltipProps extends TextEllipsisBaseProps {
|
|
15
16
|
tooltipProps?: Omit<TooltipProps, 'target' | 'association' | 'children'>;
|
package/lib/index.js
CHANGED
|
@@ -4685,7 +4685,7 @@ function TimelineItem(_a) {
|
|
|
4685
4685
|
}
|
|
4686
4686
|
|
|
4687
4687
|
var TextEllipsis = React__default["default"].forwardRef(function (_a, ref) {
|
|
4688
|
-
var className = _a.className, children = _a.children, maxLines = _a.maxLines, as = _a.as, tooltipProps = _a.tooltipProps, hideTooltip = _a.hideTooltip, props = tslib.__rest(_a, ["className", "children", "maxLines", "as", "tooltipProps", "hideTooltip"]);
|
|
4688
|
+
var className = _a.className, children = _a.children, maxLines = _a.maxLines, as = _a.as, tooltipProps = _a.tooltipProps, hideTooltip = _a.hideTooltip, onOverflowChange = _a.onOverflowChange, props = tslib.__rest(_a, ["className", "children", "maxLines", "as", "tooltipProps", "hideTooltip", "onOverflowChange"]);
|
|
4689
4689
|
var Element = 'div';
|
|
4690
4690
|
var sharedRef = useSharedRef(ref);
|
|
4691
4691
|
var _b = tslib.__read(React.useState(false), 2), hasOverflow = _b[0], setHasOverflow = _b[1];
|
|
@@ -4724,6 +4724,11 @@ var TextEllipsis = React__default["default"].forwardRef(function (_a, ref) {
|
|
|
4724
4724
|
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
4725
4725
|
};
|
|
4726
4726
|
}, [hideTooltip]);
|
|
4727
|
+
React.useEffect(function () {
|
|
4728
|
+
if (typeof onOverflowChange === 'function') {
|
|
4729
|
+
onOverflowChange(hasOverflow);
|
|
4730
|
+
}
|
|
4731
|
+
}, [hasOverflow]);
|
|
4727
4732
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4728
4733
|
React__default["default"].createElement(Element, tslib.__assign({ className: classNames__default["default"]('TextEllipsis', className, {
|
|
4729
4734
|
'TextEllipsis--multiline': !!maxLines
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deque/cauldron-react",
|
|
3
|
-
"version": "6.17.1-canary.
|
|
3
|
+
"version": "6.17.1-canary.2cd0a593",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Fully accessible react components library for Deque Cauldron",
|
|
6
6
|
"homepage": "https://cauldron.dequelabs.com/",
|