@ceed/ads 1.8.2 → 1.8.3

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/index.cjs CHANGED
@@ -2989,7 +2989,42 @@ var TextEllipsis = ({ children }) => {
2989
2989
  }, [children]);
2990
2990
  const content = /* @__PURE__ */ import_react25.default.createElement(EllipsisDiv, { ref: textRef }, children);
2991
2991
  if (showTooltip) {
2992
- return /* @__PURE__ */ import_react25.default.createElement(Tooltip_default, { title: children, placement: "top" }, content);
2992
+ return /* @__PURE__ */ import_react25.default.createElement(
2993
+ Tooltip_default,
2994
+ {
2995
+ title: children,
2996
+ placement: "top",
2997
+ onClick: (e) => e.stopPropagation()
2998
+ },
2999
+ content
3000
+ );
3001
+ }
3002
+ return content;
3003
+ };
3004
+ var CellTextEllipsis = ({ children }) => {
3005
+ const textRef = (0, import_react25.useRef)(null);
3006
+ const [showTooltip, setShowTooltip] = (0, import_react25.useState)(false);
3007
+ (0, import_react25.useLayoutEffect)(() => {
3008
+ const element = textRef.current;
3009
+ if (element) {
3010
+ const isTextTruncated = element.scrollWidth > element.clientWidth;
3011
+ setShowTooltip(isTextTruncated);
3012
+ }
3013
+ }, [children]);
3014
+ const content = /* @__PURE__ */ import_react25.default.createElement(EllipsisDiv, { ref: textRef }, children);
3015
+ if (showTooltip) {
3016
+ return /* @__PURE__ */ import_react25.default.createElement(
3017
+ Tooltip_default,
3018
+ {
3019
+ variant: "plain",
3020
+ title: children,
3021
+ placement: "top",
3022
+ enterDelay: 1500,
3023
+ enterNextDelay: 1500,
3024
+ onClick: (e) => e.stopPropagation()
3025
+ },
3026
+ content
3027
+ );
2993
3028
  }
2994
3029
  return content;
2995
3030
  };
@@ -3483,26 +3518,7 @@ var BodyCell = (props) => {
3483
3518
  className: isLastStartPinnedColumn && "is-last-left" || isLastEndPinnedColumn && "is-last-right" || ""
3484
3519
  },
3485
3520
  (0, import_react25.useMemo)(
3486
- () => showTooltip ? /* @__PURE__ */ import_react25.default.createElement(
3487
- Tooltip_default,
3488
- {
3489
- title: value,
3490
- placement: "bottom",
3491
- style: { maxWidth: "100%" },
3492
- enterDelay: 1500,
3493
- enterNextDelay: 1500
3494
- },
3495
- /* @__PURE__ */ import_react25.default.createElement(
3496
- "div",
3497
- {
3498
- style: {
3499
- overflow: "hidden",
3500
- textOverflow: "ellipsis"
3501
- }
3502
- },
3503
- CellComponent
3504
- )
3505
- ) : CellComponent,
3521
+ () => showTooltip ? /* @__PURE__ */ import_react25.default.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
3506
3522
  [CellComponent, showTooltip, value]
3507
3523
  )
3508
3524
  );
package/dist/index.js CHANGED
@@ -2945,7 +2945,42 @@ var TextEllipsis = ({ children }) => {
2945
2945
  }, [children]);
2946
2946
  const content = /* @__PURE__ */ React23.createElement(EllipsisDiv, { ref: textRef }, children);
2947
2947
  if (showTooltip) {
2948
- return /* @__PURE__ */ React23.createElement(Tooltip_default, { title: children, placement: "top" }, content);
2948
+ return /* @__PURE__ */ React23.createElement(
2949
+ Tooltip_default,
2950
+ {
2951
+ title: children,
2952
+ placement: "top",
2953
+ onClick: (e) => e.stopPropagation()
2954
+ },
2955
+ content
2956
+ );
2957
+ }
2958
+ return content;
2959
+ };
2960
+ var CellTextEllipsis = ({ children }) => {
2961
+ const textRef = useRef4(null);
2962
+ const [showTooltip, setShowTooltip] = useState6(false);
2963
+ useLayoutEffect(() => {
2964
+ const element = textRef.current;
2965
+ if (element) {
2966
+ const isTextTruncated = element.scrollWidth > element.clientWidth;
2967
+ setShowTooltip(isTextTruncated);
2968
+ }
2969
+ }, [children]);
2970
+ const content = /* @__PURE__ */ React23.createElement(EllipsisDiv, { ref: textRef }, children);
2971
+ if (showTooltip) {
2972
+ return /* @__PURE__ */ React23.createElement(
2973
+ Tooltip_default,
2974
+ {
2975
+ variant: "plain",
2976
+ title: children,
2977
+ placement: "top",
2978
+ enterDelay: 1500,
2979
+ enterNextDelay: 1500,
2980
+ onClick: (e) => e.stopPropagation()
2981
+ },
2982
+ content
2983
+ );
2949
2984
  }
2950
2985
  return content;
2951
2986
  };
@@ -3439,26 +3474,7 @@ var BodyCell = (props) => {
3439
3474
  className: isLastStartPinnedColumn && "is-last-left" || isLastEndPinnedColumn && "is-last-right" || ""
3440
3475
  },
3441
3476
  useMemo8(
3442
- () => showTooltip ? /* @__PURE__ */ React23.createElement(
3443
- Tooltip_default,
3444
- {
3445
- title: value,
3446
- placement: "bottom",
3447
- style: { maxWidth: "100%" },
3448
- enterDelay: 1500,
3449
- enterNextDelay: 1500
3450
- },
3451
- /* @__PURE__ */ React23.createElement(
3452
- "div",
3453
- {
3454
- style: {
3455
- overflow: "hidden",
3456
- textOverflow: "ellipsis"
3457
- }
3458
- },
3459
- CellComponent
3460
- )
3461
- ) : CellComponent,
3477
+ () => showTooltip ? /* @__PURE__ */ React23.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
3462
3478
  [CellComponent, showTooltip, value]
3463
3479
  )
3464
3480
  );