@cgi-learning-hub/ui 1.3.4-dev.1736325125 → 1.3.4-dev.1736329661

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 r=require("react/jsx-runtime"),i=require("@mui/material"),s=require("react"),a=({children:t,tooltipProps:o,typographyProps:l})=>{const[n,u]=s.useState(!1),e=s.useRef(null);return s.useEffect(()=>{if(e.current){const{scrollWidth:c,clientWidth:p}=e.current;u(c>p)}},[e,t]),r.jsx(i.Tooltip,{disableHoverListener:!n,title:t,...o,children:r.jsx(i.Typography,{ref:e,...l,noWrap:!0,overflow:"hidden",textOverflow:"ellipsis",children:t})})};module.exports=a;
1
+ "use strict";const n=require("react/jsx-runtime"),o=require("@mui/material"),t=require("react"),x=({children:r,tooltipProps:c,typographyProps:l})=>{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,...c,children:n.jsx(o.Typography,{ref:e,...l,noWrap:!0,overflow:"hidden",textOverflow:"ellipsis",children:r})})};module.exports=x;
@@ -1,37 +1,44 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { Tooltip as n, Typography as u } from "@mui/material";
3
- import { useState as a, useRef as c, useEffect as d } from "react";
4
- const h = ({
5
- children: t,
6
- tooltipProps: r,
7
- typographyProps: s
2
+ import { Tooltip as p, Typography as a } from "@mui/material";
3
+ import { useState as d, useRef as m, useEffect as v } from "react";
4
+ const T = ({
5
+ children: r,
6
+ tooltipProps: i,
7
+ typographyProps: n
8
8
  }) => {
9
- const [i, l] = a(!1), e = c(null);
10
- return d(() => {
11
- if (e.current) {
12
- const { scrollWidth: f, clientWidth: p } = e.current;
13
- l(f > p);
14
- }
15
- }, [e, t]), /* @__PURE__ */ o(
16
- n,
9
+ const [l, c] = d(!1), e = m(null);
10
+ return v(() => {
11
+ const t = () => {
12
+ if (e.current) {
13
+ const { scrollWidth: u, clientWidth: f } = e.current;
14
+ c(u > f);
15
+ }
16
+ }, s = new ResizeObserver(() => {
17
+ t();
18
+ });
19
+ return e.current && s.observe(e.current), t(), () => {
20
+ e.current && s.unobserve(e.current);
21
+ };
22
+ }, []), /* @__PURE__ */ o(
23
+ p,
17
24
  {
18
- disableHoverListener: !i,
19
- title: t,
20
- ...r,
25
+ disableHoverListener: !l,
26
+ title: r,
27
+ ...i,
21
28
  children: /* @__PURE__ */ o(
22
- u,
29
+ a,
23
30
  {
24
31
  ref: e,
25
- ...s,
32
+ ...n,
26
33
  noWrap: !0,
27
34
  overflow: "hidden",
28
35
  textOverflow: "ellipsis",
29
- children: t
36
+ children: r
30
37
  }
31
38
  )
32
39
  }
33
40
  );
34
41
  };
35
42
  export {
36
- h as default
43
+ T as default
37
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "1.3.4-dev.1736325125",
3
+ "version": "1.3.4-dev.1736329661",
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",