@cgi-learning-hub/ui 1.3.4-dev.1736334416 → 1.3.4-dev.1736340048
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),o=require("@mui/material"),t=require("react"),x=({children:r,tooltipProps:l,typographyProps:c})=>{const[u,f]=t.useState(!1),e=t.useRef(null);return t.useEffect(()=>{const s=()=>{if(e.current){const{scrollWidth:p,clientWidth:a}=e.current;f(p>a)}},i=new ResizeObserver(()=>{s()});return e.current&&i.observe(e.current),s(),()=>{e.current&&i.unobserve(e.current)}},[]),n.jsx(o.Tooltip,{disableHoverListener:!u,title:r,...l,children:n.jsx(o.Typography,{ref:e,noWrap:!0,overflow:"hidden",textOverflow:"ellipsis",...c,children:r})})};module.exports=x;
|
|
@@ -2,7 +2,7 @@ import { TooltipProps, TypographyProps } from '@mui/material';
|
|
|
2
2
|
import { FC, ReactNode } from 'react';
|
|
3
3
|
export type EllipsisWithTooltipProps = {
|
|
4
4
|
tooltipProps?: Omit<TooltipProps, "children" | "title">;
|
|
5
|
-
typographyProps?: TypographyProps
|
|
5
|
+
typographyProps?: Omit<TypographyProps, "noWrap" | "overflow" | "textOverflow">;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
};
|
|
8
8
|
declare const EllipsisWithTooltip: FC<EllipsisWithTooltipProps>;
|
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Tooltip as
|
|
3
|
-
import { useState as
|
|
4
|
-
const
|
|
5
|
-
children:
|
|
6
|
-
tooltipProps:
|
|
7
|
-
typographyProps: l
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as p, Typography as d } from "@mui/material";
|
|
3
|
+
import { useState as a, useRef as v, useEffect as h } from "react";
|
|
4
|
+
const E = ({
|
|
5
|
+
children: t,
|
|
6
|
+
tooltipProps: o,
|
|
7
|
+
typographyProps: l
|
|
8
8
|
}) => {
|
|
9
|
-
const [n, c] =
|
|
10
|
-
|
|
11
|
-
const
|
|
9
|
+
const [n, c] = a(!1), e = v(null);
|
|
10
|
+
return h(() => {
|
|
11
|
+
const r = () => {
|
|
12
12
|
if (e.current) {
|
|
13
13
|
const { scrollWidth: f, clientWidth: u } = e.current;
|
|
14
14
|
c(f > u);
|
|
15
15
|
}
|
|
16
|
-
},
|
|
17
|
-
|
|
16
|
+
}, s = new ResizeObserver(() => {
|
|
17
|
+
r();
|
|
18
18
|
});
|
|
19
|
-
return e.current &&
|
|
20
|
-
e.current &&
|
|
19
|
+
return e.current && s.observe(e.current), r(), () => {
|
|
20
|
+
e.current && s.unobserve(e.current);
|
|
21
21
|
};
|
|
22
|
-
}, [])
|
|
23
|
-
|
|
24
|
-
return /* @__PURE__ */ s(
|
|
25
|
-
a,
|
|
22
|
+
}, []), /* @__PURE__ */ i(
|
|
23
|
+
p,
|
|
26
24
|
{
|
|
27
25
|
disableHoverListener: !n,
|
|
28
|
-
title:
|
|
29
|
-
...
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
|
|
26
|
+
title: t,
|
|
27
|
+
...o,
|
|
28
|
+
children: /* @__PURE__ */ i(
|
|
29
|
+
d,
|
|
32
30
|
{
|
|
33
31
|
ref: e,
|
|
34
32
|
noWrap: !0,
|
|
35
33
|
overflow: "hidden",
|
|
36
34
|
textOverflow: "ellipsis",
|
|
37
|
-
...
|
|
38
|
-
children:
|
|
35
|
+
...l,
|
|
36
|
+
children: t
|
|
39
37
|
}
|
|
40
38
|
)
|
|
41
39
|
}
|
|
42
40
|
);
|
|
43
41
|
};
|
|
44
42
|
export {
|
|
45
|
-
|
|
43
|
+
E as default
|
|
46
44
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgi-learning-hub/ui",
|
|
3
|
-
"version": "1.3.4-dev.
|
|
3
|
+
"version": "1.3.4-dev.1736340048",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "CGI Learning-hub Team",
|
|
6
6
|
"description": "@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features",
|