@elliemae/ds-truncated-tooltip-text 3.5.0-rc.3 → 3.5.0-rc.6

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.
Files changed (36) hide show
  1. package/dist/cjs/DSTruncatedTooltipText.js +14 -6
  2. package/dist/cjs/DSTruncatedTooltipText.js.map +2 -2
  3. package/dist/cjs/SimpleTruncatedTooltipText.js +51 -30
  4. package/dist/cjs/SimpleTruncatedTooltipText.js.map +2 -2
  5. package/dist/cjs/TooltipTextProvider.js +12 -6
  6. package/dist/cjs/TooltipTextProvider.js.map +2 -2
  7. package/dist/cjs/index.js +4 -1
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWIthTooltipDatatestid.js +4 -1
  10. package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWIthTooltipDatatestid.js.map +1 -1
  11. package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWithTooltip.js +14 -8
  12. package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWithTooltip.js.map +2 -2
  13. package/dist/cjs/truncateTextWithTooltip/defaultProps.js +4 -1
  14. package/dist/cjs/truncateTextWithTooltip/defaultProps.js.map +1 -1
  15. package/dist/cjs/truncateTextWithTooltip/index.js +4 -1
  16. package/dist/cjs/truncateTextWithTooltip/index.js.map +1 -1
  17. package/dist/cjs/truncateTextWithTooltip/propTypes.js +7 -2
  18. package/dist/cjs/truncateTextWithTooltip/propTypes.js.map +1 -1
  19. package/dist/cjs/truncateTextWithTooltip/styles.js +4 -1
  20. package/dist/cjs/truncateTextWithTooltip/styles.js.map +1 -1
  21. package/dist/esm/DSTruncatedTooltipText.js +10 -5
  22. package/dist/esm/DSTruncatedTooltipText.js.map +2 -2
  23. package/dist/esm/SimpleTruncatedTooltipText.js +47 -29
  24. package/dist/esm/SimpleTruncatedTooltipText.js.map +2 -2
  25. package/dist/esm/TooltipTextProvider.js +8 -5
  26. package/dist/esm/TooltipTextProvider.js.map +2 -2
  27. package/dist/esm/index.js.map +2 -2
  28. package/dist/esm/truncateTextWithTooltip/DSTruncateTextWIthTooltipDatatestid.js.map +1 -1
  29. package/dist/esm/truncateTextWithTooltip/DSTruncateTextWithTooltip.js +10 -7
  30. package/dist/esm/truncateTextWithTooltip/DSTruncateTextWithTooltip.js.map +2 -2
  31. package/dist/esm/truncateTextWithTooltip/defaultProps.js.map +1 -1
  32. package/dist/esm/truncateTextWithTooltip/index.js.map +1 -1
  33. package/dist/esm/truncateTextWithTooltip/propTypes.js +3 -1
  34. package/dist/esm/truncateTextWithTooltip/propTypes.js.map +1 -1
  35. package/dist/esm/truncateTextWithTooltip/styles.js.map +1 -1
  36. package/package.json +6 -6
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var DSTruncatedTooltipText_exports = {};
23
26
  __export(DSTruncatedTooltipText_exports, {
@@ -57,10 +60,13 @@ const DSTruncatedTooltipText = ({
57
60
  const handleMouseEnter = (e) => {
58
61
  const { target } = e;
59
62
  if (target && isEllipsisActive(target, target.getBoundingClientRect())) {
60
- showTooltip({
61
- value,
62
- reference: target
63
- }, e);
63
+ showTooltip(
64
+ {
65
+ value,
66
+ reference: target
67
+ },
68
+ e
69
+ );
64
70
  }
65
71
  };
66
72
  const handleMouseLeave = (e) => {
@@ -79,7 +85,9 @@ DSTruncatedTooltipText.defaultProps = {
79
85
  };
80
86
  const truncatedTooltipTextProps = {
81
87
  containerProps: import_ds_utilities.PropTypes.object.description("Set of Properties attached to the main container"),
82
- value: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.string, import_ds_utilities.PropTypes.number]).description("Text that when truncated will trigger the tooltip interaction"),
88
+ value: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.string, import_ds_utilities.PropTypes.number]).description(
89
+ "Text that when truncated will trigger the tooltip interaction"
90
+ ),
83
91
  tooltipPlacement: import_ds_utilities.PropTypes.oneOf([
84
92
  import_ds_popper.PopperPositions.AUTO_START,
85
93
  import_ds_popper.PopperPositions.AUTO_END,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSTruncatedTooltipText.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { useContext, useEffect } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport { styled } from '@elliemae/ds-system';\nimport { PopperPositions as positions } from '@elliemae/ds-popper';\nimport { TruncatedTooltipContext } from './TooltipTextProvider';\n\nconst isEllipsisActive = ({ offsetWidth, scrollWidth }) => offsetWidth < scrollWidth;\n\n// reduce the possibility of error showing the tooltip (text-overflow: ellipsis) https://jira.elliemae.io/browse/PUI-1755\nconst Text = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\nconst DSTruncatedTooltipText = ({\n containerProps = {},\n value = '',\n zIndex = 3000, // https://jira.elliemae.io/browse/PUI-1755 https://jira.elliemae.io/browse/PUI-8732\n ...otherTextProps\n}) => {\n const tooltipContext = useContext(TruncatedTooltipContext);\n useEffect(() => {\n if (zIndex && tooltipContext) tooltipContext.setZIndex(zIndex);\n }, [zIndex]);\n\n if (!tooltipContext) return value;\n\n const { showTooltip, hideTooltip } = tooltipContext;\n\n const handleMouseEnter = (e) => {\n const { target } = e;\n if (target && isEllipsisActive(target, target.getBoundingClientRect())) {\n showTooltip(\n {\n value,\n reference: target,\n },\n e,\n );\n }\n };\n\n const handleMouseLeave = (e) => {\n hideTooltip({ reference: e.target });\n };\n\n const handlers = showTooltip ? { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave } : {};\n return (\n <Text {...containerProps} {...otherTextProps} {...handlers}>\n {value}\n </Text>\n );\n};\n\nDSTruncatedTooltipText.defaultProps = {\n value: '',\n zIndex: 110,\n};\n\nconst truncatedTooltipTextProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'Text that when truncated will trigger the tooltip interaction',\n ),\n tooltipPlacement: PropTypes.oneOf([\n positions.AUTO_START,\n positions.AUTO_END,\n positions.AUTO,\n positions.TOP_START,\n positions.TOP,\n positions.TOP_END,\n positions.RIGHT_START,\n positions.RIGHT,\n positions.RIGHT_END,\n positions.BOTTOM_START,\n positions.BOTTOM,\n positions.BOTTOM_END,\n positions.LEFT_START,\n positions.LEFT,\n positions.LEFT_END,\n ]).description('Position of the tooltip'),\n tooltipDelay: PropTypes.number.description('Delay to show the tooltip'),\n zIndex: PropTypes.number.description('override default zIndex').defaultValue(110),\n};\n\nDSTruncatedTooltipText.defaultProps = {\n containerProps: {},\n value: '',\n tooltipPlacement: undefined,\n tooltipDelay: undefined,\n};\n\nDSTruncatedTooltipText.propTypes = truncatedTooltipTextProps;\nDSTruncatedTooltipText.displayName = 'DSTruncatedTooltipText';\nconst TruncatedTooltipTextWithSchema = describe(DSTruncatedTooltipText);\nTruncatedTooltipTextWithSchema.propTypes = truncatedTooltipTextProps;\n\nexport { DSTruncatedTooltipText, TruncatedTooltipTextWithSchema };\nexport default DSTruncatedTooltipText;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAC7C,0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O,YAAY,2BAA2B;AAAA,EACtE,QAAQ,8BAAU,OAAO,YAAY,yBAAyB,EAAE,aAAa,GAAG;AAClF;AAEA,uBAAuB,eAAe;AAAA,EACpC,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,cAAc;AAChB;AAEA,uBAAuB,YAAY;AACnC,uBAAuB,cAAc;AACrC,MAAM,qCAAiC,8BAAS,sBAAsB;AACtE,+BAA+B,YAAY;AAG3C,IAAO,iCAAQ;",
6
+ "names": ["React", "positions"]
7
7
  }
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var SimpleTruncatedTooltipText_exports = {};
23
26
  __export(SimpleTruncatedTooltipText_exports, {
@@ -49,20 +52,29 @@ const Text = import_ds_system.styled.span`
49
52
  const SimpleTruncatedTooltipText = (props) => {
50
53
  const { containerProps, tooltipDelay, placement, value, zIndex, tooltipOptions, textOptions } = props;
51
54
  const [tooltipState, setTooltipState] = (0, import_react.useState)(initialTooltipState(value, tooltipOptions));
52
- const show = (0, import_react.useCallback)((newState) => {
53
- setTooltipState({ ...tooltipState, ...newState, visible: true });
54
- }, [tooltipState]);
55
- const hideTooltip = (0, import_react.useCallback)((newState) => {
56
- setTooltipState({ ...tooltipState, ...newState, visible: false });
57
- }, [tooltipState]);
55
+ const show = (0, import_react.useCallback)(
56
+ (newState) => {
57
+ setTooltipState({ ...tooltipState, ...newState, visible: true });
58
+ },
59
+ [tooltipState]
60
+ );
61
+ const hideTooltip = (0, import_react.useCallback)(
62
+ (newState) => {
63
+ setTooltipState({ ...tooltipState, ...newState, visible: false });
64
+ },
65
+ [tooltipState]
66
+ );
58
67
  const [showTooltip, cancelShowTooltip] = (0, import_ds_utilities.useCancellableDelayedCallback)(show, tooltipDelay);
59
- const handleMouseEnter = (0, import_react.useCallback)((e) => {
60
- const { target } = e;
61
- const SimpleTruncatedTextEl = target.closest(`[data-testid="${dsTestId}"]`);
62
- if (SimpleTruncatedTextEl && isEllipsisActive(SimpleTruncatedTextEl)) {
63
- showTooltip({ value, reference: SimpleTruncatedTextEl });
64
- }
65
- }, [showTooltip, value]);
68
+ const handleMouseEnter = (0, import_react.useCallback)(
69
+ (e) => {
70
+ const { target } = e;
71
+ const SimpleTruncatedTextEl = target.closest(`[data-testid="${dsTestId}"]`);
72
+ if (SimpleTruncatedTextEl && isEllipsisActive(SimpleTruncatedTextEl)) {
73
+ showTooltip({ value, reference: SimpleTruncatedTextEl });
74
+ }
75
+ },
76
+ [showTooltip, value]
77
+ );
66
78
  const handleMouseLeave = (0, import_react.useCallback)(() => {
67
79
  cancelShowTooltip();
68
80
  hideTooltip({ reference: null });
@@ -76,22 +88,31 @@ const SimpleTruncatedTooltipText = (props) => {
76
88
  };
77
89
  }, [showTooltip, handleMouseEnter, handleMouseLeave]);
78
90
  const theme = (0, import_react.useContext)(import_ds_system.ThemeContext);
79
- const PurePopover = (0, import_react.useMemo)(() => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, tooltipState.visible ? /* @__PURE__ */ import_react.default.createElement(import_ds_popover.DSPopover, {
80
- boundaries: "window",
81
- style: { pointerEvents: "none", zIndex: zIndex ?? theme.zIndex.tooltip },
82
- placement,
83
- content: tooltipState.value,
84
- referenceEl: tooltipState.reference,
85
- visible: tooltipState.visible,
86
- showArrow: true
87
- }) : null), [tooltipState, placement, zIndex]);
88
- const PureText = (0, import_react.useMemo)(() => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(Text, {
89
- ...containerProps && { ...containerProps },
90
- ...textOptions && { ...textOptions },
91
- ...handlers && { ...handlers },
92
- "data-testid": dsTestId
93
- }, value)), [containerProps, textOptions, handlers, value]);
94
- const PureSimpleTruncatedTooltipText = (0, import_react.useMemo)(() => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, PureText, PurePopover), [PureText, PurePopover]);
91
+ const PurePopover = (0, import_react.useMemo)(
92
+ () => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, tooltipState.visible ? /* @__PURE__ */ import_react.default.createElement(import_ds_popover.DSPopover, {
93
+ boundaries: "window",
94
+ style: { pointerEvents: "none", zIndex: zIndex ?? theme.zIndex.tooltip },
95
+ placement,
96
+ content: tooltipState.value,
97
+ referenceEl: tooltipState.reference,
98
+ visible: tooltipState.visible,
99
+ showArrow: true
100
+ }) : null),
101
+ [tooltipState, placement, zIndex]
102
+ );
103
+ const PureText = (0, import_react.useMemo)(
104
+ () => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(Text, {
105
+ ...containerProps && { ...containerProps },
106
+ ...textOptions && { ...textOptions },
107
+ ...handlers && { ...handlers },
108
+ "data-testid": dsTestId
109
+ }, value)),
110
+ [containerProps, textOptions, handlers, value]
111
+ );
112
+ const PureSimpleTruncatedTooltipText = (0, import_react.useMemo)(
113
+ () => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, PureText, PurePopover),
114
+ [PureText, PurePopover]
115
+ );
95
116
  return PureSimpleTruncatedTooltipText;
96
117
  };
97
118
  SimpleTruncatedTooltipText.propTypes = {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/SimpleTruncatedTooltipText.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useCallback, useContext, useMemo, useState } from 'react';\nimport { useCancellableDelayedCallback } from '@elliemae/ds-utilities';\nimport PropTypes from 'prop-types';\nimport { styled, ThemeContext } from '@elliemae/ds-system';\nimport { DSPopover, PopperPositions as positions } from '@elliemae/ds-popover';\n\nconst dsTestId = 'DS-SimpleTruncateText';\n\nconst isEllipsisActive = ({ offsetWidth, scrollWidth }) => offsetWidth < scrollWidth;\n\nconst initialTooltipState = (value = '', options = {}) => ({\n reference: null,\n visible: false,\n value,\n options,\n});\n// reduce the possibility of error showing the tooltip(text-overflow: ellipsis) https://jira.elliemae.io/browse/PUI-1755\nconst Text = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\nconst SimpleTruncatedTooltipText = (props) => {\n const { containerProps, tooltipDelay, placement, value, zIndex, tooltipOptions, textOptions } = props;\n // not using \"usePopoverProviderState\" because usePopoverState has memory leak issues\n const [tooltipState, setTooltipState] = useState(initialTooltipState(value, tooltipOptions));\n const show = useCallback(\n (newState) => {\n setTooltipState({ ...tooltipState, ...newState, visible: true });\n },\n [tooltipState],\n );\n const hideTooltip = useCallback(\n (newState) => {\n setTooltipState({ ...tooltipState, ...newState, visible: false });\n },\n [tooltipState],\n );\n const [showTooltip, cancelShowTooltip] = useCancellableDelayedCallback(show, tooltipDelay);\n\n const handleMouseEnter = useCallback(\n (e) => {\n const { target } = e;\n // we search for the closest parent with data-testid matching this component\n // this is required because the target may not be this component itself\n // when the user gives JSX as a value.\n // JSX as a value is required for features like text highlight during research\n // wich would still allow the truncation behaviour (see tree view for example)\n // when the target has the test-id itself target===SimpleTruncatedTextEl\n const SimpleTruncatedTextEl = target.closest(`[data-testid=\"${dsTestId}\"]`);\n if (SimpleTruncatedTextEl && isEllipsisActive(SimpleTruncatedTextEl)) {\n showTooltip({ value, reference: SimpleTruncatedTextEl });\n }\n },\n [showTooltip, value],\n );\n\n const handleMouseLeave = useCallback(() => {\n cancelShowTooltip();\n hideTooltip({ reference: null });\n }, [hideTooltip, cancelShowTooltip]);\n\n const handlers = useMemo(() => {\n if (!showTooltip) return {};\n return {\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n };\n }, [showTooltip, handleMouseEnter, handleMouseLeave]);\n\n const theme = useContext(ThemeContext);\n\n const PurePopover = useMemo(\n () => (\n <>\n {tooltipState.visible ? (\n <DSPopover\n boundaries=\"window\"\n style={{ pointerEvents: 'none', zIndex: zIndex ?? theme.zIndex.tooltip }}\n placement={placement}\n content={tooltipState.value}\n referenceEl={tooltipState.reference}\n visible={tooltipState.visible}\n showArrow\n />\n ) : null}\n </>\n ),\n [tooltipState, placement, zIndex],\n );\n const PureText = useMemo(\n () => (\n <>\n <Text\n {...(containerProps && { ...containerProps })}\n {...(textOptions && { ...textOptions })}\n {...(handlers && { ...handlers })}\n data-testid={dsTestId} // this is used by mouse enter too. required to support value as JSX\n >\n {value}\n </Text>\n </>\n ),\n [containerProps, textOptions, handlers, value],\n );\n\n const PureSimpleTruncatedTooltipText = useMemo(\n () => (\n <>\n {PureText}\n {PurePopover}\n </>\n ),\n [PureText, PurePopover],\n );\n\n return PureSimpleTruncatedTooltipText;\n};\n\nSimpleTruncatedTooltipText.propTypes = {\n containerProps: PropTypes.object,\n tooltipOptions: PropTypes.object,\n textOptions: PropTypes.object,\n /** Text that when truncated will trigger the tooltip interaction */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node]),\n /** Position of the tooltip */\n placement: PropTypes.oneOf([\n positions.AUTO_START,\n positions.AUTO_END,\n positions.AUTO,\n positions.TOP_START,\n positions.TOP,\n positions.TOP_END,\n positions.RIGHT_START,\n positions.RIGHT,\n positions.RIGHT_END,\n positions.BOTTOM_START,\n positions.BOTTOM,\n positions.BOTTOM_END,\n positions.LEFT_START,\n positions.LEFT,\n positions.LEFT_END,\n ]),\n /** Delay to show the tooltip */\n tooltipDelay: PropTypes.number,\n /** override default zIndex */\n zIndex: PropTypes.number,\n};\n\nSimpleTruncatedTooltipText.defaultProps = {\n containerProps: {},\n tooltipOptions: {},\n textOptions: {},\n value: '',\n placement: positions.TOP,\n tooltipDelay: 200,\n};\n\nexport { SimpleTruncatedTooltipText };\nexport default SimpleTruncatedTooltipText;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkE;AAClE,0BAA8C;AAC9C,wBAAsB;AACtB,uBAAqC;AACrC,wBAAwD;AAExD,MAAM,WAAW;AAEjB,MAAM,mBAAmB,CAAC,EAAE,aAAa,kBAAkB,cAAc;AAEzE,MAAM,sBAAsB,CAAC,QAAQ,IAAI,UAAU,CAAC,MAAO;AAAA,EACzD,WAAW;AAAA,EACX,SAAS;AAAA,EACT;AAAA,EACA;AACF;AAEA,MAAM,OAAO,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQpB,MAAM,6BAA6B,CAAC,UAAU;AAC5C,QAAM,EAAE,gBAAgB,cAAc,WAAW,OAAO,QAAQ,gBAAgB,gBAAgB;AAEhG,QAAM,CAAC,cAAc,mBAAmB,2BAAS,oBAAoB,OAAO,cAAc,CAAC;AAC3F,QAAM,OAAO,8BACX,CAAC,aAAa;AACZ,oBAAgB,EAAE,GAAG,cAAc,GAAG,UAAU,SAAS,KAAK,CAAC;AAAA,EACjE,GACA,CAAC,YAAY,CACf;AACA,QAAM,cAAc,8BAClB,CAAC,aAAa;AACZ,oBAAgB,EAAE,GAAG,cAAc,GAAG,UAAU,SAAS,MAAM,CAAC;AAAA,EAClE,GACA,CAAC,YAAY,CACf;AACA,QAAM,CAAC,aAAa,qBAAqB,uDAA8B,MAAM,YAAY;AAEzF,QAAM,mBAAmB,8BACvB,CAAC,MAAM;AACL,UAAM,EAAE,WAAW;AAOnB,UAAM,wBAAwB,OAAO,QAAQ,iBAAiB,YAAY;AAC1E,QAAI,yB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AAAA,gBAAU;AAAA,IACV,kBAAAA,gBAAU;AAAA,EACZ,CAAC;AAAA,EAED,cAAc,kBAAAD,QAAU;AAAA,EAExB,QAAQ,kBAAAA,QAAU;AACpB;AAEA,2BAA2B,eAAe;AAAA,EACxC,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,aAAa,CAAC;AAAA,EACd,OAAO;AAAA,EACP,WAAW,kBAAAC,gBAAU;AAAA,EACrB,cAAc;AAChB;AAGA,IAAO,qCAAQ;",
6
+ "names": ["React", "PropTypes", "positions"]
7
7
  }
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var TooltipTextProvider_exports = {};
23
26
  __export(TooltipTextProvider_exports, {
@@ -38,11 +41,14 @@ function TooltipTextProvider({ children, tooltipDelay = 200, placement = "top",
38
41
  state: tooltipState
39
42
  } = (0, import_ds_popover.usePopoverProviderState)({ delay: tooltipDelay });
40
43
  const [zIndex, setZIndex] = (0, import_react.useState)(110);
41
- const value = (0, import_react.useMemo)(() => ({
42
- showTooltip,
43
- hideTooltip,
44
- setZIndex
45
- }), []);
44
+ const value = (0, import_react.useMemo)(
45
+ () => ({
46
+ showTooltip,
47
+ hideTooltip,
48
+ setZIndex
49
+ }),
50
+ []
51
+ );
46
52
  return /* @__PURE__ */ import_react.default.createElement(Provider, {
47
53
  value
48
54
  }, children, tooltipState.visible ? /* @__PURE__ */ import_react.default.createElement(import_ds_popover.DSPopover, {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/TooltipTextProvider.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useMemo, useState } from 'react';\nimport { DSPopover, usePopoverProviderState } from '@elliemae/ds-popover';\n\nconst TruncatedTooltipContext = React.createContext();\n\nconst { Provider } = TruncatedTooltipContext;\n\nfunction TooltipTextProvider({ children, tooltipDelay = 200, placement = 'top', ...tooltipOptions }) {\n const {\n show: showTooltip,\n hide: hideTooltip,\n state: tooltipState,\n } = usePopoverProviderState({ delay: tooltipDelay });\n const [zIndex, setZIndex] = useState(110);\n\n const value = useMemo(\n () => ({\n showTooltip,\n hideTooltip,\n setZIndex,\n }),\n [],\n );\n\n return (\n <Provider value={value}>\n {children}\n {tooltipState.visible ? (\n <DSPopover\n boundaries=\"window\"\n placement={placement}\n showArrow\n {...tooltipOptions}\n {...(tooltipState.options || {})}\n content={tooltipState.value}\n referenceEl={tooltipState.reference}\n style={{ pointerEvents: 'none', zIndex }}\n visible={tooltipState.visible}\n />\n ) : null}\n </Provider>\n );\n}\n\nTooltipTextProvider.propTypes = {};\nTooltipTextProvider.defaultProps = {};\n\nexport { TooltipTextProvider, TruncatedTooltipContext };\nexport default TooltipTextProvider;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAyC;AACzC,wBAAmD;AAEnD,MAAM,0BAA0B,qBAAM,cAAc;AAEpD,MAAM,EAAE,aAAa;AAErB,6BAA6B,EAAE,UAAU,eAAe,KAAK,YAAY,UAAU,kBAAkB;AACnG,QAAM;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,MACL,+CAAwB,EAAE,OAAO,aAAa,CAAC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H,GAAI,aAAa,WAAW,CAAC;AAAA,IAC9B,SAAS,aAAa;AAAA,IACtB,aAAa,aAAa;AAAA,IAC1B,OAAO,EAAE,eAAe,QAAQ,OAAO;AAAA,IACvC,SAAS,aAAa;AAAA,GACxB,IACE,IACN;AAEJ;AAEA,oBAAoB,YAAY,CAAC;AACjC,oBAAoB,eAAe,CAAC;AAGpC,IAAO,8BAAQ;",
6
+ "names": ["React"]
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var src_exports = {};
23
26
  __export(src_exports, {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export { TooltipTextProvider, TruncatedTooltipContext } from './TooltipTextProvider';\nexport { SimpleTruncatedTooltipText } from './SimpleTruncatedTooltipText';\nexport { DSTruncatedTooltipText, TruncatedTooltipTextWithSchema, default } from './DSTruncatedTooltipText';\nexport { DSTruncateTextWithTooltipDatatestid, DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema } from './truncateTextWithTooltip';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAA6D;AAC7D,wCAA2C;AAC3C,oCAAgF;AAChF,qCAAoH;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAA6D;AAC7D,wCAA2C;AAC3C,oCAAgF;AAChF,qCAAoH;",
6
6
  "names": []
7
7
  }
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var DSTruncateTextWIthTooltipDatatestid_exports = {};
23
26
  __export(DSTruncateTextWIthTooltipDatatestid_exports, {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/truncateTextWithTooltip/DSTruncateTextWIthTooltipDatatestid.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export const DSTruncateTextWithTooltipDatatestid = {\n TEXT: 'ds-truncatetextwithtooltip-text',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,sCAAsC;AAAA,EACjD,MAAM;AACR;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,sCAAsC;AAAA,EACjD,MAAM;AACR;",
6
6
  "names": []
7
7
  }
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var DSTruncateTextWithTooltip_exports = {};
23
26
  __export(DSTruncateTextWithTooltip_exports, {
@@ -39,13 +42,16 @@ const DSTruncateTextWithTooltip = (props) => {
39
42
  const { text, tooltipProps } = propsWithDefault;
40
43
  const [textWrapperEl, setTextWrapperEl] = (0, import_react.useState)(null);
41
44
  const [isShowingEllipsis, setIsShowingEllipsis] = (0, import_react.useState)(false);
42
- const resizeObserver = (0, import_react.useMemo)(() => new ResizeObserver((entries) => {
43
- if (entries.length) {
44
- const [textWrapperEntry] = entries;
45
- const el = textWrapperEntry.target;
46
- setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);
47
- }
48
- }), []);
45
+ const resizeObserver = (0, import_react.useMemo)(
46
+ () => new ResizeObserver((entries) => {
47
+ if (entries.length) {
48
+ const [textWrapperEntry] = entries;
49
+ const el = textWrapperEntry.target;
50
+ setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);
51
+ }
52
+ }),
53
+ []
54
+ );
49
55
  (0, import_react.useEffect)(() => {
50
56
  if (textWrapperEl) {
51
57
  setIsShowingEllipsis(textWrapperEl?.scrollWidth > textWrapperEl?.clientWidth);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/truncateTextWithTooltip/DSTruncateTextWithTooltip.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { useState, useMemo, useEffect } from 'react';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-utilities';\nimport { defaultProps } from './defaultProps';\nimport { DSTruncateTextWithTooltipDatatestid } from './DSTruncateTextWIthTooltipDatatestid';\nimport { propTypes } from './propTypes';\nimport { Text } from './styles';\nimport type { DSTruncateTextWithTooltipT } from './propTypes';\n\nconst DSTruncateTextWithTooltip = (props: DSTruncateTextWithTooltipT.Props): JSX.Element => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSTruncateTextWithTooltipT.Props>(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes);\n\n const { text, tooltipProps } = propsWithDefault;\n\n const [textWrapperEl, setTextWrapperEl] = useState<HTMLSpanElement | null>(null);\n const [isShowingEllipsis, setIsShowingEllipsis] = useState<boolean>(false);\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n if (entries.length) {\n const [textWrapperEntry] = entries;\n const el = textWrapperEntry.target;\n setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);\n }\n }),\n [],\n );\n\n useEffect(() => {\n if (textWrapperEl) {\n setIsShowingEllipsis(textWrapperEl?.scrollWidth > textWrapperEl?.clientWidth);\n resizeObserver.observe(textWrapperEl);\n }\n return () => {\n if (textWrapperEl) {\n resizeObserver.unobserve(textWrapperEl);\n }\n };\n }, [resizeObserver, textWrapperEl]);\n\n if (isShowingEllipsis)\n return (\n <DSTooltipV3 text={text} {...tooltipProps}>\n <Text ref={setTextWrapperEl} tabIndex={0} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n </DSTooltipV3>\n );\n\n return (\n <Text ref={setTextWrapperEl} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n );\n};\n\nconst DSTruncateTextWithTooltipWithSchema = describe<DSTruncateTextWithTooltipT.Props>(DSTruncateTextWithTooltip);\n\nDSTruncateTextWithTooltipWithSchema.propTypes = propTypes;\n\nexport { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoD;AACpD,wBAA4B;AAC5B,0BAAuF;AACvF,0BAA6B;AAC7B,iDAAoD;AACpD,uBAA0B;AAC1B,oBAAqB;AAGrB,MAAM,4BAA4B,CAAC,UAAyD;AAC1F,QAAM,mBAAmB,sDAA+D,OAAO,gCAAY;AAE3G,0DAA+B,kBAAkB,0BAAS;AAE1D,QAAM,EAAE,MAAM,iBAAiB;AAE/B,QAAM,CAAC,eAAe,oBAAoB,2BAAiC,IAAI;AAC/E,QAAM,CAAC,mBAAmB,wBAAwB,2BAAkB,KAAK;AAEzE,QAAM,iBAAiB,0BACrB,MACE,IAAI,eAAe,CAAC,YAAY;AAC9B,QAAI,QAAQ,QAAQ;AAClB,YAAM,CAAC,oBAAoB;AAC3B,YAAM,KAAK,iBAAiB;AAC5B,2BAAqB,IAAI,cAAc,IAAI,WAAW;AAAA,IACxD;AAAA,EACF,CAAC,GACH,CAAC,CACH;AAEA,8BAAU,MAAM;AACd,QAAI,eAAe;AACjB,2BAAqB,eAAe,cAAc,eAAe,WAAW;AAC5E,qBAAe,QAAQ,aAAa;AAAA,IACtC;AACA,WAAO,MAAM;AACX,UAAI,eAAe;AACjB,uBAAe,UAAU,aAAa;AAAA,MACxC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,gBAAgB,aAAa,CAAC;AAElC,MAAI;AACF,WACE,mDAAC;AAAA,MAAY;AAAA,MAAa,GAAG;AAAA,OAC3B,mDAAC;AAAA,MAAK,KAAK;AAAA,MAAkB,UAA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C3B,6BAAAA,QAAA,cAAC;AAAA,MAAK,KAAK;AAAA,MAAkB,UAAU;AAAA,MAAG,eAAa,+EAAoC;AAAA,OACxF,IACH,CACF;AAGJ,SACE,6BAAAA,QAAA,cAAC;AAAA,IAAK,KAAK;AAAA,IAAkB,eAAa,+EAAoC;AAAA,KAC3E,IACH;AAEJ;AAEA,MAAM,0CAAsC,8BAA2C,yBAAyB;AAEhH,oCAAoC,YAAY;",
6
+ "names": ["React"]
7
7
  }
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var defaultProps_exports = {};
23
26
  __export(defaultProps_exports, {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/truncateTextWithTooltip/defaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { DSTruncateTextWithTooltipT } from './propTypes';\n\nexport const defaultProps: DSTruncateTextWithTooltipT.DefaultProps = {\n tooltipProps: {},\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;",
6
6
  "names": []
7
7
  }
@@ -14,7 +14,10 @@ var __copyProps = (to, from, except, desc) => {
14
14
  return to;
15
15
  };
16
16
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
19
+ mod
20
+ ));
18
21
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
22
  var truncateTextWithTooltip_exports = {};
20
23
  module.exports = __toCommonJS(truncateTextWithTooltip_exports);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/truncateTextWithTooltip/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export * from './DSTruncateTextWithTooltip';\nexport * from './DSTruncateTextWIthTooltipDatatestid';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,4CAAc,wCAAd;AACA,4CAAc,kDADd;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,4CAAc,wCAAd;AACA,4CAAc,kDADd;",
6
6
  "names": []
7
7
  }
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var propTypes_exports = {};
23
26
  __export(propTypes_exports, {
@@ -28,6 +31,8 @@ var React = __toESM(require("react"));
28
31
  var import_ds_utilities = require("@elliemae/ds-utilities");
29
32
  const propTypes = {
30
33
  text: import_ds_utilities.PropTypes.string.description("Text to show.").isRequired,
31
- tooltipProps: import_ds_utilities.PropTypes.object.description("This component uses DSTooltip component, you can set properties directly to this component with this property.").defaultValue({})
34
+ tooltipProps: import_ds_utilities.PropTypes.object.description(
35
+ "This component uses DSTooltip component, you can set properties directly to this component with this property."
36
+ ).defaultValue({})
32
37
  };
33
38
  //# sourceMappingURL=propTypes.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/truncateTextWithTooltip/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable max-len */\nimport { PropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSTruncateTextWithTooltipT {\n export interface PropsRequired {\n text: string;\n }\n\n export interface DefaultProps {\n tooltipProps: Record<string, unknown>;\n }\n\n export interface Props extends DefaultProps, PropsRequired {}\n}\n\nexport const propTypes = {\n text: PropTypes.string.description('Text to show.').isRequired,\n tooltipProps: PropTypes.object\n .description(\n 'This component uses DSTooltip component, you can set properties directly to this component with this property.',\n )\n .defaultValue({}),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA0B;AAcnB,MAAM,YAAY;AAAA,EACvB,MAAM,8BAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACpD,cAAc,8BAAU,OACrB,YACC,gHACF,EACC,aAAa,CAAC,CAAC;AACpB;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA0B;AAcnB,MAAM,YAAY;AAAA,EACvB,MAAM,8BAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACpD,cAAc,8BAAU,OACrB;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,CAAC;AACpB;",
6
6
  "names": []
7
7
  }
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var styles_exports = {};
23
26
  __export(styles_exports, {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/truncateTextWithTooltip/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { styled } from '@elliemae/ds-system';\n\n// reduce the possibility of error showing the tooltip(text-overflow: ellipsis) https://jira.elliemae.io/browse/PUI-1755\nexport const Text = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n &:focus {\n border: none;\n outline: none;\n background: ${({ theme }) => theme.colors.brand[200]};\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AAGhB,MAAM,OAAO,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAST,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AAGhB,MAAM,OAAO,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAST,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -29,10 +29,13 @@ const DSTruncatedTooltipText = ({
29
29
  const handleMouseEnter = (e) => {
30
30
  const { target } = e;
31
31
  if (target && isEllipsisActive(target, target.getBoundingClientRect())) {
32
- showTooltip({
33
- value,
34
- reference: target
35
- }, e);
32
+ showTooltip(
33
+ {
34
+ value,
35
+ reference: target
36
+ },
37
+ e
38
+ );
36
39
  }
37
40
  };
38
41
  const handleMouseLeave = (e) => {
@@ -51,7 +54,9 @@ DSTruncatedTooltipText.defaultProps = {
51
54
  };
52
55
  const truncatedTooltipTextProps = {
53
56
  containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
54
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description("Text that when truncated will trigger the tooltip interaction"),
57
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(
58
+ "Text that when truncated will trigger the tooltip interaction"
59
+ ),
55
60
  tooltipPlacement: PropTypes.oneOf([
56
61
  positions.AUTO_START,
57
62
  positions.AUTO_END,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSTruncatedTooltipText.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useEffect } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport { styled } from '@elliemae/ds-system';\nimport { PopperPositions as positions } from '@elliemae/ds-popper';\nimport { TruncatedTooltipContext } from './TooltipTextProvider';\n\nconst isEllipsisActive = ({ offsetWidth, scrollWidth }) => offsetWidth < scrollWidth;\n\n// reduce the possibility of error showing the tooltip (text-overflow: ellipsis) https://jira.elliemae.io/browse/PUI-1755\nconst Text = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\nconst DSTruncatedTooltipText = ({\n containerProps = {},\n value = '',\n zIndex = 3000, // https://jira.elliemae.io/browse/PUI-1755 https://jira.elliemae.io/browse/PUI-8732\n ...otherTextProps\n}) => {\n const tooltipContext = useContext(TruncatedTooltipContext);\n useEffect(() => {\n if (zIndex && tooltipContext) tooltipContext.setZIndex(zIndex);\n }, [zIndex]);\n\n if (!tooltipContext) return value;\n\n const { showTooltip, hideTooltip } = tooltipContext;\n\n const handleMouseEnter = (e) => {\n const { target } = e;\n if (target && isEllipsisActive(target, target.getBoundingClientRect())) {\n showTooltip(\n {\n value,\n reference: target,\n },\n e,\n );\n }\n };\n\n const handleMouseLeave = (e) => {\n hideTooltip({ reference: e.target });\n };\n\n const handlers = showTooltip ? { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave } : {};\n return (\n <Text {...containerProps} {...otherTextProps} {...handlers}>\n {value}\n </Text>\n );\n};\n\nDSTruncatedTooltipText.defaultProps = {\n value: '',\n zIndex: 110,\n};\n\nconst truncatedTooltipTextProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'Text that when truncated will trigger the tooltip interaction',\n ),\n tooltipPlacement: PropTypes.oneOf([\n positions.AUTO_START,\n positions.AUTO_END,\n positions.AUTO,\n positions.TOP_START,\n positions.TOP,\n positions.TOP_END,\n positions.RIGHT_START,\n positions.RIGHT,\n positions.RIGHT_END,\n positions.BOTTOM_START,\n positions.BOTTOM,\n positions.BOTTOM_END,\n positions.LEFT_START,\n positions.LEFT,\n positions.LEFT_END,\n ]).description('Position of the tooltip'),\n tooltipDelay: PropTypes.number.description('Delay to show the tooltip'),\n zIndex: PropTypes.number.description('override default zIndex').defaultValue(110),\n};\n\nDSTruncatedTooltipText.defaultProps = {\n containerProps: {},\n value: '',\n tooltipPlacement: undefined,\n tooltipDelay: undefined,\n};\n\nDSTruncatedTooltipText.propTypes = truncatedTooltipTextProps;\nDSTruncatedTooltipText.displayName = 'DSTruncatedTooltipText';\nconst TruncatedTooltipTextWithSchema = describe(DSTruncatedTooltipText);\nTruncatedTooltipTextWithSchema.propTypes = truncatedTooltipTextProps;\n\nexport { DSTruncatedTooltipText, TruncatedTooltipTextWithSchema };\nexport default DSTruncatedTooltipText;\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,mBAAmB,CAAC,EAAE,aAAa,kBAAkB,cAAc;AAGzE,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQpB,MAAM,yBAAyB,CAAC;AAAA,EAC9B,iBAAiB,CAAC;AAAA,EAClB,QAAQ;AAAA,EACR,SAAS;AAAA,KACN;AAAA,MACC;AACJ,QAAM,iBAAiB,WAAW,uBAAuB;AACzD,YAAU,MAAM;AACd,QAAI,UAAU;AAAgB,qBAAe,UAAU,MAAM;AAAA,EAC/D,GAAG,CAAC,MAAM,CAAC;AAEX,MAAI,CAAC;AAAgB,WAAO;AAE5B,QAAM,EAAE,aAAa,gBAAgB;AAErC,QAAM,mBAAmB,CAAC,MAAM;AAC9B,UAAM,EAAE,WAAW;AACnB,QAAI,UAAU,iBAAiB,QAAQ,OAAO,sBAAsB,CAAC,GAAG;AACtE,kBACE;AAAA,QACE;AAAA,QACA,WAAW;AAAA,MACb,GACA,CACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,mBAAmB,CAAC,MAAM;A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AM;AAAA,IAChC,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,EACZ,CAAC,EAAE,YAAY,yBAAyB;AAAA,EACxC,cAAc,UAAU,OAAO,YAAY,2BAA2B;AAAA,EACtE,QAAQ,UAAU,OAAO,YAAY,yBAAyB,EAAE,aAAa,GAAG;AAClF;AAEA,uBAAuB,eAAe;AAAA,EACpC,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,cAAc;AAChB;AAEA,uBAAuB,YAAY;AACnC,uBAAuB,cAAc;AACrC,MAAM,iCAAiC,SAAS,sBAAsB;AACtE,+BAA+B,YAAY;AAG3C,IAAO,iCAAQ;",
6
+ "names": ["React"]
7
7
  }
@@ -22,20 +22,29 @@ const Text = styled.span`
22
22
  const SimpleTruncatedTooltipText = (props) => {
23
23
  const { containerProps, tooltipDelay, placement, value, zIndex, tooltipOptions, textOptions } = props;
24
24
  const [tooltipState, setTooltipState] = useState(initialTooltipState(value, tooltipOptions));
25
- const show = useCallback((newState) => {
26
- setTooltipState({ ...tooltipState, ...newState, visible: true });
27
- }, [tooltipState]);
28
- const hideTooltip = useCallback((newState) => {
29
- setTooltipState({ ...tooltipState, ...newState, visible: false });
30
- }, [tooltipState]);
25
+ const show = useCallback(
26
+ (newState) => {
27
+ setTooltipState({ ...tooltipState, ...newState, visible: true });
28
+ },
29
+ [tooltipState]
30
+ );
31
+ const hideTooltip = useCallback(
32
+ (newState) => {
33
+ setTooltipState({ ...tooltipState, ...newState, visible: false });
34
+ },
35
+ [tooltipState]
36
+ );
31
37
  const [showTooltip, cancelShowTooltip] = useCancellableDelayedCallback(show, tooltipDelay);
32
- const handleMouseEnter = useCallback((e) => {
33
- const { target } = e;
34
- const SimpleTruncatedTextEl = target.closest(`[data-testid="${dsTestId}"]`);
35
- if (SimpleTruncatedTextEl && isEllipsisActive(SimpleTruncatedTextEl)) {
36
- showTooltip({ value, reference: SimpleTruncatedTextEl });
37
- }
38
- }, [showTooltip, value]);
38
+ const handleMouseEnter = useCallback(
39
+ (e) => {
40
+ const { target } = e;
41
+ const SimpleTruncatedTextEl = target.closest(`[data-testid="${dsTestId}"]`);
42
+ if (SimpleTruncatedTextEl && isEllipsisActive(SimpleTruncatedTextEl)) {
43
+ showTooltip({ value, reference: SimpleTruncatedTextEl });
44
+ }
45
+ },
46
+ [showTooltip, value]
47
+ );
39
48
  const handleMouseLeave = useCallback(() => {
40
49
  cancelShowTooltip();
41
50
  hideTooltip({ reference: null });
@@ -49,22 +58,31 @@ const SimpleTruncatedTooltipText = (props) => {
49
58
  };
50
59
  }, [showTooltip, handleMouseEnter, handleMouseLeave]);
51
60
  const theme = useContext(ThemeContext);
52
- const PurePopover = useMemo(() => /* @__PURE__ */ React2.createElement(React2.Fragment, null, tooltipState.visible ? /* @__PURE__ */ React2.createElement(DSPopover, {
53
- boundaries: "window",
54
- style: { pointerEvents: "none", zIndex: zIndex ?? theme.zIndex.tooltip },
55
- placement,
56
- content: tooltipState.value,
57
- referenceEl: tooltipState.reference,
58
- visible: tooltipState.visible,
59
- showArrow: true
60
- }) : null), [tooltipState, placement, zIndex]);
61
- const PureText = useMemo(() => /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(Text, {
62
- ...containerProps && { ...containerProps },
63
- ...textOptions && { ...textOptions },
64
- ...handlers && { ...handlers },
65
- "data-testid": dsTestId
66
- }, value)), [containerProps, textOptions, handlers, value]);
67
- const PureSimpleTruncatedTooltipText = useMemo(() => /* @__PURE__ */ React2.createElement(React2.Fragment, null, PureText, PurePopover), [PureText, PurePopover]);
61
+ const PurePopover = useMemo(
62
+ () => /* @__PURE__ */ React2.createElement(React2.Fragment, null, tooltipState.visible ? /* @__PURE__ */ React2.createElement(DSPopover, {
63
+ boundaries: "window",
64
+ style: { pointerEvents: "none", zIndex: zIndex ?? theme.zIndex.tooltip },
65
+ placement,
66
+ content: tooltipState.value,
67
+ referenceEl: tooltipState.reference,
68
+ visible: tooltipState.visible,
69
+ showArrow: true
70
+ }) : null),
71
+ [tooltipState, placement, zIndex]
72
+ );
73
+ const PureText = useMemo(
74
+ () => /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(Text, {
75
+ ...containerProps && { ...containerProps },
76
+ ...textOptions && { ...textOptions },
77
+ ...handlers && { ...handlers },
78
+ "data-testid": dsTestId
79
+ }, value)),
80
+ [containerProps, textOptions, handlers, value]
81
+ );
82
+ const PureSimpleTruncatedTooltipText = useMemo(
83
+ () => /* @__PURE__ */ React2.createElement(React2.Fragment, null, PureText, PurePopover),
84
+ [PureText, PurePopover]
85
+ );
68
86
  return PureSimpleTruncatedTooltipText;
69
87
  };
70
88
  SimpleTruncatedTooltipText.propTypes = {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/SimpleTruncatedTooltipText.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useCallback, useContext, useMemo, useState } from 'react';\nimport { useCancellableDelayedCallback } from '@elliemae/ds-utilities';\nimport PropTypes from 'prop-types';\nimport { styled, ThemeContext } from '@elliemae/ds-system';\nimport { DSPopover, PopperPositions as positions } from '@elliemae/ds-popover';\n\nconst dsTestId = 'DS-SimpleTruncateText';\n\nconst isEllipsisActive = ({ offsetWidth, scrollWidth }) => offsetWidth < scrollWidth;\n\nconst initialTooltipState = (value = '', options = {}) => ({\n reference: null,\n visible: false,\n value,\n options,\n});\n// reduce the possibility of error showing the tooltip(text-overflow: ellipsis) https://jira.elliemae.io/browse/PUI-1755\nconst Text = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\nconst SimpleTruncatedTooltipText = (props) => {\n const { containerProps, tooltipDelay, placement, value, zIndex, tooltipOptions, textOptions } = props;\n // not using \"usePopoverProviderState\" because usePopoverState has memory leak issues\n const [tooltipState, setTooltipState] = useState(initialTooltipState(value, tooltipOptions));\n const show = useCallback(\n (newState) => {\n setTooltipState({ ...tooltipState, ...newState, visible: true });\n },\n [tooltipState],\n );\n const hideTooltip = useCallback(\n (newState) => {\n setTooltipState({ ...tooltipState, ...newState, visible: false });\n },\n [tooltipState],\n );\n const [showTooltip, cancelShowTooltip] = useCancellableDelayedCallback(show, tooltipDelay);\n\n const handleMouseEnter = useCallback(\n (e) => {\n const { target } = e;\n // we search for the closest parent with data-testid matching this component\n // this is required because the target may not be this component itself\n // when the user gives JSX as a value.\n // JSX as a value is required for features like text highlight during research\n // wich would still allow the truncation behaviour (see tree view for example)\n // when the target has the test-id itself target===SimpleTruncatedTextEl\n const SimpleTruncatedTextEl = target.closest(`[data-testid=\"${dsTestId}\"]`);\n if (SimpleTruncatedTextEl && isEllipsisActive(SimpleTruncatedTextEl)) {\n showTooltip({ value, reference: SimpleTruncatedTextEl });\n }\n },\n [showTooltip, value],\n );\n\n const handleMouseLeave = useCallback(() => {\n cancelShowTooltip();\n hideTooltip({ reference: null });\n }, [hideTooltip, cancelShowTooltip]);\n\n const handlers = useMemo(() => {\n if (!showTooltip) return {};\n return {\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n };\n }, [showTooltip, handleMouseEnter, handleMouseLeave]);\n\n const theme = useContext(ThemeContext);\n\n const PurePopover = useMemo(\n () => (\n <>\n {tooltipState.visible ? (\n <DSPopover\n boundaries=\"window\"\n style={{ pointerEvents: 'none', zIndex: zIndex ?? theme.zIndex.tooltip }}\n placement={placement}\n content={tooltipState.value}\n referenceEl={tooltipState.reference}\n visible={tooltipState.visible}\n showArrow\n />\n ) : null}\n </>\n ),\n [tooltipState, placement, zIndex],\n );\n const PureText = useMemo(\n () => (\n <>\n <Text\n {...(containerProps && { ...containerProps })}\n {...(textOptions && { ...textOptions })}\n {...(handlers && { ...handlers })}\n data-testid={dsTestId} // this is used by mouse enter too. required to support value as JSX\n >\n {value}\n </Text>\n </>\n ),\n [containerProps, textOptions, handlers, value],\n );\n\n const PureSimpleTruncatedTooltipText = useMemo(\n () => (\n <>\n {PureText}\n {PurePopover}\n </>\n ),\n [PureText, PurePopover],\n );\n\n return PureSimpleTruncatedTooltipText;\n};\n\nSimpleTruncatedTooltipText.propTypes = {\n containerProps: PropTypes.object,\n tooltipOptions: PropTypes.object,\n textOptions: PropTypes.object,\n /** Text that when truncated will trigger the tooltip interaction */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node]),\n /** Position of the tooltip */\n placement: PropTypes.oneOf([\n positions.AUTO_START,\n positions.AUTO_END,\n positions.AUTO,\n positions.TOP_START,\n positions.TOP,\n positions.TOP_END,\n positions.RIGHT_START,\n positions.RIGHT,\n positions.RIGHT_END,\n positions.BOTTOM_START,\n positions.BOTTOM,\n positions.BOTTOM_END,\n positions.LEFT_START,\n positions.LEFT,\n positions.LEFT_END,\n ]),\n /** Delay to show the tooltip */\n tooltipDelay: PropTypes.number,\n /** override default zIndex */\n zIndex: PropTypes.number,\n};\n\nSimpleTruncatedTooltipText.defaultProps = {\n containerProps: {},\n tooltipOptions: {},\n textOptions: {},\n value: '',\n placement: positions.TOP,\n tooltipDelay: 200,\n};\n\nexport { SimpleTruncatedTooltipText };\nexport default SimpleTruncatedTooltipText;\n"],
5
- "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AAEA,MAAM,WAAW;AAEjB,MAAM,mBAAmB,CAAC,EAAE,aAAa,kBAAkB,cAAc;AAEzE,MAAM,sBAAsB,CAAC,QAAQ,IAAI,UAAU,CAAC,MAAO;AAAA,EACzD,WAAW;AAAA,EACX,SAAS;AAAA,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AEA,SAAO;AACT;AAEA,2BAA2B,YAAY;AAAA,EACrC,gBAAgB,UAAU;AAAA,EAC1B,gBAAgB,UAAU;AAAA,EAC1B,aAAa,UAAU;AAAA,EAEvB,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,QAAQ,UAAU,IAAI,CAAC;AAAA,EAE/E,WAAW,UAAU,MAAM;AAAA,IACzB,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,EACZ,CAAC;AAAA,EAED,cAAc,UAAU;AAAA,EAExB,QAAQ,UAAU;AACpB;AAEA,2BAA2B,eAAe;AAAA,EACxC,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,aAAa,CAAC;AAAA,EACd,OAAO;AAAA,EACP,WAAW,UAAU;AAAA,EACrB,cAAc;AAChB;AAGA,IAAO,qCAAQ;",
6
+ "names": ["React"]
7
7
  }
@@ -10,11 +10,14 @@ function TooltipTextProvider({ children, tooltipDelay = 200, placement = "top",
10
10
  state: tooltipState
11
11
  } = usePopoverProviderState({ delay: tooltipDelay });
12
12
  const [zIndex, setZIndex] = useState(110);
13
- const value = useMemo(() => ({
14
- showTooltip,
15
- hideTooltip,
16
- setZIndex
17
- }), []);
13
+ const value = useMemo(
14
+ () => ({
15
+ showTooltip,
16
+ hideTooltip,
17
+ setZIndex
18
+ }),
19
+ []
20
+ );
18
21
  return /* @__PURE__ */ React2.createElement(Provider, {
19
22
  value
20
23
  }, children, tooltipState.visible ? /* @__PURE__ */ React2.createElement(DSPopover, {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/TooltipTextProvider.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useMemo, useState } from 'react';\nimport { DSPopover, usePopoverProviderState } from '@elliemae/ds-popover';\n\nconst TruncatedTooltipContext = React.createContext();\n\nconst { Provider } = TruncatedTooltipContext;\n\nfunction TooltipTextProvider({ children, tooltipDelay = 200, placement = 'top', ...tooltipOptions }) {\n const {\n show: showTooltip,\n hide: hideTooltip,\n state: tooltipState,\n } = usePopoverProviderState({ delay: tooltipDelay });\n const [zIndex, setZIndex] = useState(110);\n\n const value = useMemo(\n () => ({\n showTooltip,\n hideTooltip,\n setZIndex,\n }),\n [],\n );\n\n return (\n <Provider value={value}>\n {children}\n {tooltipState.visible ? (\n <DSPopover\n boundaries=\"window\"\n placement={placement}\n showArrow\n {...tooltipOptions}\n {...(tooltipState.options || {})}\n content={tooltipState.value}\n referenceEl={tooltipState.reference}\n style={{ pointerEvents: 'none', zIndex }}\n visible={tooltipState.visible}\n />\n ) : null}\n </Provider>\n );\n}\n\nTooltipTextProvider.propTypes = {};\nTooltipTextProvider.defaultProps = {};\n\nexport { TooltipTextProvider, TruncatedTooltipContext };\nexport default TooltipTextProvider;\n"],
5
- "mappings": "AAAA;ACCA;AACA;AAEA,MAAM,0BAA0B,OAAM,cAAc;AAEpD,MAAM,EAAE,aAAa;AAErB,6BAA6B,EAAE,UAAU,eAAe,KAAK,YAAY,UAAU,kBAAkB;AACnG,QAAM;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,MACL,wBAAwB,EAAE,OAAO,aAAa,CAAC;AACnD,QAAM,CAAC,QAAQ,aAAa,SAAS,GAAG;AAExC,QAAM,QAAQ,QACZ,MAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF,IACA,CAAC,CACH;AAEA,SACE,qCAAC;AAAA,IAAS;AAAA,KACP,UACA,aAAa,UACZ,qCAAC;AAAA,IACC,YAAW;AA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]
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { TooltipTextProvider, TruncatedTooltipContext } from './TooltipTextProvider';\nexport { SimpleTruncatedTooltipText } from './SimpleTruncatedTooltipText';\nexport { DSTruncatedTooltipText, TruncatedTooltipTextWithSchema, default } from './DSTruncatedTooltipText';\nexport { DSTruncateTextWithTooltipDatatestid, DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema } from './truncateTextWithTooltip';\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;",
6
- "names": []
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB,+BAA+B;AAC7D,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB,gCAAgC,WAAAA,gBAAe;AAChF,SAAS,qCAAqC,2BAA2B,2CAA2C;",
6
+ "names": ["default"]
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/DSTruncateTextWIthTooltipDatatestid.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSTruncateTextWithTooltipDatatestid = {\n TEXT: 'ds-truncatetextwithtooltip-text',\n};\n"],
5
- "mappings": "AAAA;ACAO,MAAM,sCAAsC;AAAA,EACjD,MAAM;AACR;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,sCAAsC;AAAA,EACjD,MAAM;AACR;",
6
6
  "names": []
7
7
  }
@@ -12,13 +12,16 @@ const DSTruncateTextWithTooltip = (props) => {
12
12
  const { text, tooltipProps } = propsWithDefault;
13
13
  const [textWrapperEl, setTextWrapperEl] = useState(null);
14
14
  const [isShowingEllipsis, setIsShowingEllipsis] = useState(false);
15
- const resizeObserver = useMemo(() => new ResizeObserver((entries) => {
16
- if (entries.length) {
17
- const [textWrapperEntry] = entries;
18
- const el = textWrapperEntry.target;
19
- setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);
20
- }
21
- }), []);
15
+ const resizeObserver = useMemo(
16
+ () => new ResizeObserver((entries) => {
17
+ if (entries.length) {
18
+ const [textWrapperEntry] = entries;
19
+ const el = textWrapperEntry.target;
20
+ setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);
21
+ }
22
+ }),
23
+ []
24
+ );
22
25
  useEffect(() => {
23
26
  if (textWrapperEl) {
24
27
  setIsShowingEllipsis(textWrapperEl?.scrollWidth > textWrapperEl?.clientWidth);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/DSTruncateTextWithTooltip.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useMemo, useEffect } from 'react';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-utilities';\nimport { defaultProps } from './defaultProps';\nimport { DSTruncateTextWithTooltipDatatestid } from './DSTruncateTextWIthTooltipDatatestid';\nimport { propTypes } from './propTypes';\nimport { Text } from './styles';\nimport type { DSTruncateTextWithTooltipT } from './propTypes';\n\nconst DSTruncateTextWithTooltip = (props: DSTruncateTextWithTooltipT.Props): JSX.Element => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSTruncateTextWithTooltipT.Props>(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes);\n\n const { text, tooltipProps } = propsWithDefault;\n\n const [textWrapperEl, setTextWrapperEl] = useState<HTMLSpanElement | null>(null);\n const [isShowingEllipsis, setIsShowingEllipsis] = useState<boolean>(false);\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n if (entries.length) {\n const [textWrapperEntry] = entries;\n const el = textWrapperEntry.target;\n setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);\n }\n }),\n [],\n );\n\n useEffect(() => {\n if (textWrapperEl) {\n setIsShowingEllipsis(textWrapperEl?.scrollWidth > textWrapperEl?.clientWidth);\n resizeObserver.observe(textWrapperEl);\n }\n return () => {\n if (textWrapperEl) {\n resizeObserver.unobserve(textWrapperEl);\n }\n };\n }, [resizeObserver, textWrapperEl]);\n\n if (isShowingEllipsis)\n return (\n <DSTooltipV3 text={text} {...tooltipProps}>\n <Text ref={setTextWrapperEl} tabIndex={0} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n </DSTooltipV3>\n );\n\n return (\n <Text ref={setTextWrapperEl} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n );\n};\n\nconst DSTruncateTextWithTooltipWithSchema = describe<DSTruncateTextWithTooltipT.Props>(DSTruncateTextWithTooltip);\n\nDSTruncateTextWithTooltipWithSchema.propTypes = propTypes;\n\nexport { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,4BAA4B,CAAC,UAAyD;AAC1F,QAAM,mBAAmB,6BAA+D,OAAO,YAAY;AAE3G,iCAA+B,kBAAkB,SAAS;AAE1D,QAAM,EAAE,MAAM,iBAAiB;AAE/B,QAAM,CAAC,eAAe,oBAAoB,SAAiC,IAAI;AAC/E,QAAM,CAAC,mBAAmB,wBAAwB,SAAkB,KAAK;AAEzE,QAAM,iBAAiB,QACrB,MACE,IAAI,eAAe,CAAC,YAAY;AAC9B,QAAI,QAAQ,QAAQ;AAClB,YAAM,CAAC,oBAAoB;AAC3B,YAAM,KAAK,iBAAiB;AAC5B,2BAAqB,IAAI,cAAc,IAAI,WAAW;AAAA,IACxD;AAAA,EACF,CAAC,GACH,CAAC,CACH;AAEA,YAAU,MAAM;AACd,QAAI,eAAe;AACjB,2BAAqB,eAAe,cAAc,eAAe,WAAW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AAe;AACjB,2BAAqB,eAAe,cAAc,eAAe,WAAW;AAC5E,qBAAe,QAAQ,aAAa;AAAA,IACtC;AACA,WAAO,MAAM;AACX,UAAI,eAAe;AACjB,uBAAe,UAAU,aAAa;AAAA,MACxC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,gBAAgB,aAAa,CAAC;AAElC,MAAI;AACF,WACE,gBAAAA,OAAA,cAAC;AAAA,MAAY;AAAA,MAAa,GAAG;AAAA,OAC3B,gBAAAA,OAAA,cAAC;AAAA,MAAK,KAAK;AAAA,MAAkB,UAAU;AAAA,MAAG,eAAa,oCAAoC;AAAA,OACxF,IACH,CACF;AAGJ,SACE,gBAAAA,OAAA,cAAC;AAAA,IAAK,KAAK;AAAA,IAAkB,eAAa,oCAAoC;AAAA,KAC3E,IACH;AAEJ;AAEA,MAAM,sCAAsC,SAA2C,yBAAyB;AAEhH,oCAAoC,YAAY;",
6
+ "names": ["React"]
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/defaultProps.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSTruncateTextWithTooltipT } from './propTypes';\n\nexport const defaultProps: DSTruncateTextWithTooltipT.DefaultProps = {\n tooltipProps: {},\n};\n"],
5
- "mappings": "AAAA;ACEO,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSTruncateTextWithTooltip';\nexport * from './DSTruncateTextWIthTooltipDatatestid';\n"],
5
- "mappings": "AAAA;ACAA;AACA;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -2,7 +2,9 @@ import * as React from "react";
2
2
  import { PropTypes } from "@elliemae/ds-utilities";
3
3
  const propTypes = {
4
4
  text: PropTypes.string.description("Text to show.").isRequired,
5
- tooltipProps: PropTypes.object.description("This component uses DSTooltip component, you can set properties directly to this component with this property.").defaultValue({})
5
+ tooltipProps: PropTypes.object.description(
6
+ "This component uses DSTooltip component, you can set properties directly to this component with this property."
7
+ ).defaultValue({})
6
8
  };
7
9
  export {
8
10
  propTypes
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/propTypes.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport { PropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSTruncateTextWithTooltipT {\n export interface PropsRequired {\n text: string;\n }\n\n export interface DefaultProps {\n tooltipProps: Record<string, unknown>;\n }\n\n export interface Props extends DefaultProps, PropsRequired {}\n}\n\nexport const propTypes = {\n text: PropTypes.string.description('Text to show.').isRequired,\n tooltipProps: PropTypes.object\n .description(\n 'This component uses DSTooltip component, you can set properties directly to this component with this property.',\n )\n .defaultValue({}),\n};\n"],
5
- "mappings": "AAAA;ACCA;AAcO,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACpD,cAAc,UAAU,OACrB,YACC,gHACF,EACC,aAAa,CAAC,CAAC;AACpB;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AAcnB,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACpD,cAAc,UAAU,OACrB;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,CAAC;AACpB;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/styles.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\n\n// reduce the possibility of error showing the tooltip(text-overflow: ellipsis) https://jira.elliemae.io/browse/PUI-1755\nexport const Text = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n &:focus {\n border: none;\n outline: none;\n background: ${({ theme }) => theme.colors.brand[200]};\n }\n`;\n"],
5
- "mappings": "AAAA;ACAA;AAGO,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAST,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AAGhB,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAST,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-truncated-tooltip-text",
3
- "version": "3.5.0-rc.3",
3
+ "version": "3.5.0-rc.6",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Truncated Tooltip Text",
6
6
  "files": [
@@ -51,11 +51,11 @@
51
51
  "indent": 4
52
52
  },
53
53
  "dependencies": {
54
- "@elliemae/ds-popover": "3.5.0-rc.3",
55
- "@elliemae/ds-popper": "3.5.0-rc.3",
56
- "@elliemae/ds-system": "3.5.0-rc.3",
57
- "@elliemae/ds-tooltip": "3.5.0-rc.3",
58
- "@elliemae/ds-utilities": "3.5.0-rc.3",
54
+ "@elliemae/ds-popover": "3.5.0-rc.6",
55
+ "@elliemae/ds-popper": "3.5.0-rc.6",
56
+ "@elliemae/ds-system": "3.5.0-rc.6",
57
+ "@elliemae/ds-tooltip": "3.5.0-rc.6",
58
+ "@elliemae/ds-utilities": "3.5.0-rc.6",
59
59
  "prop-types": "~15.8.1"
60
60
  },
61
61
  "devDependencies": {