@cgi-learning-hub/ui 1.3.4-dev.1736334416 → 1.3.4-dev.1736335071

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