@elliemae/ds-truncated-tooltip-text 3.0.0-next.8 → 3.0.0-rc.0
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/cjs/DSTruncatedTooltipText.js +10 -16
- package/dist/cjs/DSTruncatedTooltipText.js.map +2 -2
- package/dist/cjs/SimpleTruncatedTooltipText.js +9 -16
- package/dist/cjs/SimpleTruncatedTooltipText.js.map +1 -1
- package/dist/cjs/TooltipTextProvider.js +9 -16
- package/dist/cjs/TooltipTextProvider.js.map +1 -1
- package/dist/cjs/index.js +9 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWIthTooltipDatatestid.js +9 -16
- package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWIthTooltipDatatestid.js.map +1 -1
- package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWithTooltip.js +13 -20
- package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWithTooltip.js.map +2 -2
- package/dist/cjs/truncateTextWithTooltip/defaultProps.js +9 -16
- package/dist/cjs/truncateTextWithTooltip/defaultProps.js.map +1 -1
- package/dist/cjs/truncateTextWithTooltip/index.js +12 -18
- package/dist/cjs/truncateTextWithTooltip/index.js.map +1 -1
- package/dist/cjs/truncateTextWithTooltip/propTypes.js +12 -19
- package/dist/cjs/truncateTextWithTooltip/propTypes.js.map +2 -2
- package/dist/cjs/truncateTextWithTooltip/styles.js +9 -16
- package/dist/cjs/truncateTextWithTooltip/styles.js.map +1 -1
- package/dist/esm/DSTruncatedTooltipText.js +1 -0
- package/dist/esm/DSTruncatedTooltipText.js.map +2 -2
- package/dist/esm/SimpleTruncatedTooltipText.js.map +1 -1
- package/dist/esm/TooltipTextProvider.js.map +1 -1
- package/dist/esm/truncateTextWithTooltip/DSTruncateTextWIthTooltipDatatestid.js.map +1 -1
- package/dist/esm/truncateTextWithTooltip/DSTruncateTextWithTooltip.js +1 -1
- package/dist/esm/truncateTextWithTooltip/DSTruncateTextWithTooltip.js.map +2 -2
- package/dist/esm/truncateTextWithTooltip/defaultProps.js.map +1 -1
- package/dist/esm/truncateTextWithTooltip/propTypes.js +1 -1
- package/dist/esm/truncateTextWithTooltip/propTypes.js.map +2 -2
- package/package.json +13 -14
@@ -18,7 +18,6 @@ var __spreadValues = (a, b) => {
|
|
18
18
|
}
|
19
19
|
return a;
|
20
20
|
};
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
22
21
|
var __objRest = (source, exclude) => {
|
23
22
|
var target = {};
|
24
23
|
for (var prop in source)
|
@@ -35,28 +34,23 @@ var __export = (target, all) => {
|
|
35
34
|
for (var name in all)
|
36
35
|
__defProp(target, name, { get: all[name], enumerable: true });
|
37
36
|
};
|
38
|
-
var
|
39
|
-
if (
|
40
|
-
for (let key of __getOwnPropNames(
|
41
|
-
if (!__hasOwnProp.call(
|
42
|
-
__defProp(
|
37
|
+
var __copyProps = (to, from, except, desc) => {
|
38
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
39
|
+
for (let key of __getOwnPropNames(from))
|
40
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
41
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
43
42
|
}
|
44
|
-
return
|
45
|
-
};
|
46
|
-
var __toESM = (module2, isNodeMode) => {
|
47
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
43
|
+
return to;
|
48
44
|
};
|
49
|
-
var
|
50
|
-
|
51
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
52
|
-
};
|
53
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
45
|
+
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));
|
46
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
54
47
|
var DSTruncatedTooltipText_exports = {};
|
55
48
|
__export(DSTruncatedTooltipText_exports, {
|
56
49
|
DSTruncatedTooltipText: () => DSTruncatedTooltipText,
|
57
50
|
TruncatedTooltipTextWithSchema: () => TruncatedTooltipTextWithSchema,
|
58
51
|
default: () => DSTruncatedTooltipText_default
|
59
52
|
});
|
53
|
+
module.exports = __toCommonJS(DSTruncatedTooltipText_exports);
|
60
54
|
var React = __toESM(require("react"));
|
61
55
|
var import_react = __toESM(require("react"));
|
62
56
|
var import_react_desc = require("react-desc");
|
@@ -138,8 +132,8 @@ DSTruncatedTooltipText.defaultProps = {
|
|
138
132
|
tooltipDelay: void 0
|
139
133
|
};
|
140
134
|
DSTruncatedTooltipText.propTypes = truncatedTooltipTextProps;
|
135
|
+
DSTruncatedTooltipText.displayName = "DSTruncatedTooltipText";
|
141
136
|
const TruncatedTooltipTextWithSchema = (0, import_react_desc.describe)(DSTruncatedTooltipText);
|
142
137
|
TruncatedTooltipTextWithSchema.propTypes = truncatedTooltipTextProps;
|
143
138
|
var DSTruncatedTooltipText_default = DSTruncatedTooltipText;
|
144
|
-
module.exports = __toCommonJS(DSTruncatedTooltipText_exports);
|
145
139
|
//# sourceMappingURL=DSTruncatedTooltipText.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/DSTruncatedTooltipText.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
4
|
-
"sourcesContent": ["import React, { useContext, useEffect } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport styled from 'styled-components';\nimport { PopperPositions as positions } from '@elliemae/ds-popper';\nimport { TruncatedTooltipContext } from './TooltipTextProvider';\n\nconst isEllipsisActive = ({ offsetWidth, scrollWidth }) =>\n 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 = 110, // https://jira.elliemae.io/browse/PUI-1755\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\n ? { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }\n : {};\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(\n 'Set of Properties attached to the main container',\n ),\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\n .description('override default zIndex')\n .defaultValue(110),\n};\n\nDSTruncatedTooltipText.defaultProps = {\n containerProps: {},\n value: '',\n tooltipPlacement: undefined,\n tooltipDelay: undefined,\n};\n\nDSTruncatedTooltipText.propTypes = truncatedTooltipTextProps;\
|
5
|
-
"mappings": "
|
4
|
+
"sourcesContent": ["import React, { useContext, useEffect } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport styled from 'styled-components';\nimport { PopperPositions as positions } from '@elliemae/ds-popper';\nimport { TruncatedTooltipContext } from './TooltipTextProvider';\n\nconst isEllipsisActive = ({ offsetWidth, scrollWidth }) =>\n 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 = 110, // https://jira.elliemae.io/browse/PUI-1755\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\n ? { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }\n : {};\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(\n 'Set of Properties attached to the main container',\n ),\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\n .description('override default zIndex')\n .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,wBAAoC;AACpC,+BAAmB;AACnB,uBAA6C;AAC7C,iCAAwC;AAExC,MAAM,mBAAmB,CAAC,EAAE,aAAa,kBACvC,cAAc;AAGhB,MAAM,OAAO,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQpB,MAAM,yBAAyB,CAAC,OAK1B;AAL0B,eAC9B;AAAA,qBAAiB,CAAC;AAAA,IAClB,QAAQ;AAAA,IACR,SAAS;AAAA,MAHqB,IAI3B,2BAJ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AAA,EACxC,cAAc,4BAAU,OAAO,YAAY,2BAA2B;AAAA,EACtE,QAAQ,4BAAU,OACf,YAAY,yBAAyB,EACrC,aAAa,GAAG;AACrB;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,gCAAS,sBAAsB;AACtE,+BAA+B,YAAY;AAG3C,IAAO,iCAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -21,32 +21,26 @@ var __spreadValues = (a, b) => {
|
|
21
21
|
return a;
|
22
22
|
};
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
25
24
|
var __export = (target, all) => {
|
26
25
|
for (var name in all)
|
27
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
28
27
|
};
|
29
|
-
var
|
30
|
-
if (
|
31
|
-
for (let key of __getOwnPropNames(
|
32
|
-
if (!__hasOwnProp.call(
|
33
|
-
__defProp(
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
30
|
+
for (let key of __getOwnPropNames(from))
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
34
33
|
}
|
35
|
-
return
|
34
|
+
return to;
|
36
35
|
};
|
37
|
-
var __toESM = (
|
38
|
-
|
39
|
-
};
|
40
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
41
|
-
return (module2, temp) => {
|
42
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
43
|
-
};
|
44
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
36
|
+
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));
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
45
38
|
var SimpleTruncatedTooltipText_exports = {};
|
46
39
|
__export(SimpleTruncatedTooltipText_exports, {
|
47
40
|
SimpleTruncatedTooltipText: () => SimpleTruncatedTooltipText,
|
48
41
|
default: () => SimpleTruncatedTooltipText_default
|
49
42
|
});
|
43
|
+
module.exports = __toCommonJS(SimpleTruncatedTooltipText_exports);
|
50
44
|
var React = __toESM(require("react"));
|
51
45
|
var import_react = __toESM(require("react"));
|
52
46
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
@@ -147,5 +141,4 @@ SimpleTruncatedTooltipText.defaultProps = {
|
|
147
141
|
zIndex: 110
|
148
142
|
};
|
149
143
|
var SimpleTruncatedTooltipText_default = SimpleTruncatedTooltipText;
|
150
|
-
module.exports = __toCommonJS(SimpleTruncatedTooltipText_exports);
|
151
144
|
//# sourceMappingURL=SimpleTruncatedTooltipText.js.map
|
@@ -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, useMemo, useState } from 'react';\nimport { useCancellableDelayedCallback } from '@elliemae/ds-utilities';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\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\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 PurePopover = useMemo(\n () => (\n <>\n {tooltipState.visible ? (\n <DSPopover\n boundaries=\"window\"\n style={{ pointerEvents: 'none', zIndex }}\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 zIndex: 110,\n};\n\nexport { SimpleTruncatedTooltipText };\nexport default SimpleTruncatedTooltipText;\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
-
"mappings": "
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAsD;AACtD,0BAA8C;AAC9C,wB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BAAU;AACpB;AAEA,2BAA2B,eAAe;AAAA,EACxC,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,aAAa,CAAC;AAAA,EACd,OAAO;AAAA,EACP,WAAW,kCAAU;AAAA,EACrB,cAAc;AAAA,EACd,QAAQ;AACV;AAGA,IAAO,qCAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -21,7 +21,6 @@ var __spreadValues = (a, b) => {
|
|
21
21
|
return a;
|
22
22
|
};
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
25
24
|
var __objRest = (source, exclude) => {
|
26
25
|
var target = {};
|
27
26
|
for (var prop in source)
|
@@ -38,28 +37,23 @@ var __export = (target, all) => {
|
|
38
37
|
for (var name in all)
|
39
38
|
__defProp(target, name, { get: all[name], enumerable: true });
|
40
39
|
};
|
41
|
-
var
|
42
|
-
if (
|
43
|
-
for (let key of __getOwnPropNames(
|
44
|
-
if (!__hasOwnProp.call(
|
45
|
-
__defProp(
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
42
|
+
for (let key of __getOwnPropNames(from))
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
46
45
|
}
|
47
|
-
return
|
48
|
-
};
|
49
|
-
var __toESM = (module2, isNodeMode) => {
|
50
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
46
|
+
return to;
|
51
47
|
};
|
52
|
-
var
|
53
|
-
|
54
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
55
|
-
};
|
56
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
48
|
+
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));
|
49
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
57
50
|
var TooltipTextProvider_exports = {};
|
58
51
|
__export(TooltipTextProvider_exports, {
|
59
52
|
TooltipTextProvider: () => TooltipTextProvider,
|
60
53
|
TruncatedTooltipContext: () => TruncatedTooltipContext,
|
61
54
|
default: () => TooltipTextProvider_default
|
62
55
|
});
|
56
|
+
module.exports = __toCommonJS(TooltipTextProvider_exports);
|
63
57
|
var React = __toESM(require("react"));
|
64
58
|
var import_react = __toESM(require("react"));
|
65
59
|
var import_ds_popover = require("@elliemae/ds-popover");
|
@@ -102,5 +96,4 @@ function TooltipTextProvider(_a) {
|
|
102
96
|
TooltipTextProvider.propTypes = {};
|
103
97
|
TooltipTextProvider.defaultProps = {};
|
104
98
|
var TooltipTextProvider_default = TooltipTextProvider;
|
105
|
-
module.exports = __toCommonJS(TooltipTextProvider_exports);
|
106
99
|
//# sourceMappingURL=TooltipTextProvider.js.map
|
@@ -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({\n children,\n tooltipDelay = 200,\n placement = 'top',\n ...tooltipOptions\n}) {\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": "
|
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,IAK1B;AAL0B,eAC3B;AAAA;AAAA,IACA,eAAe;AAAA,IACf,YAAY;AAAA,MAHe,IAIxB,2BAJwB,IAIxB;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,MACL,+CAAwB,EAAE,OAAO,aAAa,CAAC;AACnD,QAAM,CAAC,QAAQ,aAAa,2BAAS,GAAG;AAExC,QAAM,QAAQ,0BACZ,MAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF,IACA,CAAC,CACH;AAEA,SACE,mDAAC;AAAA,IAAS;AAAA,KACP,UACA,aAAa,UACZ,mDAAC;AAAA,IACC,YAAW;AAAA,IACX;AAAA,IACA,WAAS;AAAA,KACL,iBACC,aAAa,WAAW,CAAC,IAL/B;AAAA,IAMC,SAAS,aAAa;AAAA,IACtB,aAAa,aAAa;AAAA,IAC1B,OAAO,EAAE,eAAe,QAAQ,OAAO;AAAA,IACvC,SAAS,aAAa;AAAA,IACxB,IACE,IACN;AAEJ;AAEA,oBAAoB,YAAY,CAAC;AACjC,oBAAoB,eAAe,CAAC;AAGpC,IAAO,8BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
11
10
|
};
|
12
|
-
var
|
13
|
-
if (
|
14
|
-
for (let key of __getOwnPropNames(
|
15
|
-
if (!__hasOwnProp.call(
|
16
|
-
__defProp(
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
16
|
}
|
18
|
-
return
|
17
|
+
return to;
|
19
18
|
};
|
20
|
-
var __toESM = (
|
21
|
-
|
22
|
-
};
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
24
|
-
return (module2, temp) => {
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
26
|
-
};
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
19
|
+
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
21
|
var src_exports = {};
|
29
22
|
__export(src_exports, {
|
30
23
|
DSTruncateTextWithTooltip: () => import_truncateTextWithTooltip.DSTruncateTextWithTooltip,
|
@@ -37,10 +30,10 @@ __export(src_exports, {
|
|
37
30
|
TruncatedTooltipTextWithSchema: () => import_DSTruncatedTooltipText.TruncatedTooltipTextWithSchema,
|
38
31
|
default: () => import_DSTruncatedTooltipText.default
|
39
32
|
});
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
40
34
|
var React = __toESM(require("react"));
|
41
35
|
var import_TooltipTextProvider = require("./TooltipTextProvider");
|
42
36
|
var import_SimpleTruncatedTooltipText = require("./SimpleTruncatedTooltipText");
|
43
37
|
var import_DSTruncatedTooltipText = __toESM(require("./DSTruncatedTooltipText"));
|
44
38
|
var import_truncateTextWithTooltip = require("./truncateTextWithTooltip");
|
45
|
-
module.exports = __toCommonJS(src_exports);
|
46
39
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
@@ -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": "
|
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
|
}
|
@@ -4,34 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
11
10
|
};
|
12
|
-
var
|
13
|
-
if (
|
14
|
-
for (let key of __getOwnPropNames(
|
15
|
-
if (!__hasOwnProp.call(
|
16
|
-
__defProp(
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
16
|
}
|
18
|
-
return
|
17
|
+
return to;
|
19
18
|
};
|
20
|
-
var __toESM = (
|
21
|
-
|
22
|
-
};
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
24
|
-
return (module2, temp) => {
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
26
|
-
};
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
19
|
+
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
21
|
var DSTruncateTextWIthTooltipDatatestid_exports = {};
|
29
22
|
__export(DSTruncateTextWIthTooltipDatatestid_exports, {
|
30
23
|
DSTruncateTextWithTooltipDatatestid: () => DSTruncateTextWithTooltipDatatestid
|
31
24
|
});
|
25
|
+
module.exports = __toCommonJS(DSTruncateTextWIthTooltipDatatestid_exports);
|
32
26
|
var React = __toESM(require("react"));
|
33
27
|
const DSTruncateTextWithTooltipDatatestid = {
|
34
28
|
TEXT: "ds-truncatetextwithtooltip-text"
|
35
29
|
};
|
36
|
-
module.exports = __toCommonJS(DSTruncateTextWIthTooltipDatatestid_exports);
|
37
30
|
//# sourceMappingURL=DSTruncateTextWIthTooltipDatatestid.js.map
|
@@ -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": "
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,sCAAsC;AAAA,EACjD,MAAM;AACR;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -18,43 +18,37 @@ var __spreadValues = (a, b) => {
|
|
18
18
|
}
|
19
19
|
return a;
|
20
20
|
};
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
22
21
|
var __export = (target, all) => {
|
23
22
|
for (var name in all)
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
25
24
|
};
|
26
|
-
var
|
27
|
-
if (
|
28
|
-
for (let key of __getOwnPropNames(
|
29
|
-
if (!__hasOwnProp.call(
|
30
|
-
__defProp(
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
27
|
+
for (let key of __getOwnPropNames(from))
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
31
30
|
}
|
32
|
-
return
|
31
|
+
return to;
|
33
32
|
};
|
34
|
-
var __toESM = (
|
35
|
-
|
36
|
-
};
|
37
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
38
|
-
return (module2, temp) => {
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
40
|
-
};
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
33
|
+
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));
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
42
35
|
var DSTruncateTextWithTooltip_exports = {};
|
43
36
|
__export(DSTruncateTextWithTooltip_exports, {
|
44
37
|
DSTruncateTextWithTooltip: () => DSTruncateTextWithTooltip,
|
45
38
|
DSTruncateTextWithTooltipWithSchema: () => DSTruncateTextWithTooltipWithSchema
|
46
39
|
});
|
40
|
+
module.exports = __toCommonJS(DSTruncateTextWithTooltip_exports);
|
47
41
|
var React = __toESM(require("react"));
|
48
42
|
var import_react = __toESM(require("react"));
|
49
43
|
var import_ds_tooltip = require("@elliemae/ds-tooltip");
|
50
|
-
var
|
44
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
51
45
|
var import_defaultProps = require("./defaultProps");
|
52
46
|
var import_DSTruncateTextWIthTooltipDatatestid = require("./DSTruncateTextWIthTooltipDatatestid");
|
53
47
|
var import_propTypes = require("./propTypes");
|
54
48
|
var import_styles = require("./styles");
|
55
49
|
const DSTruncateTextWithTooltip = (props) => {
|
56
|
-
const propsWithDefault = (0,
|
57
|
-
(0,
|
50
|
+
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_defaultProps.defaultProps);
|
51
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_propTypes.propTypes);
|
58
52
|
const { text, tooltipProps } = propsWithDefault;
|
59
53
|
const [textWrapperEl, setTextWrapperEl] = (0, import_react.useState)(null);
|
60
54
|
const [isShowingEllipsis, setIsShowingEllipsis] = (0, import_react.useState)(false);
|
@@ -89,7 +83,6 @@ const DSTruncateTextWithTooltip = (props) => {
|
|
89
83
|
"data-testid": import_DSTruncateTextWIthTooltipDatatestid.DSTruncateTextWithTooltipDatatestid.TEXT
|
90
84
|
}, text);
|
91
85
|
};
|
92
|
-
const DSTruncateTextWithTooltipWithSchema = (0,
|
86
|
+
const DSTruncateTextWithTooltipWithSchema = (0, import_ds_utilities.describe)(DSTruncateTextWithTooltip);
|
93
87
|
DSTruncateTextWithTooltipWithSchema.propTypes = import_propTypes.propTypes;
|
94
|
-
module.exports = __toCommonJS(DSTruncateTextWithTooltip_exports);
|
95
88
|
//# sourceMappingURL=DSTruncateTextWithTooltip.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/truncateTextWithTooltip/DSTruncateTextWithTooltip.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
-
"sourcesContent": ["import React, { useState, useMemo, useEffect } from 'react';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-
|
5
|
-
"mappings": "
|
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,OAAgB,eAC3B,mDAAC;AAAA,MAAK,KAAK;AAAA,MAAkB,UAAU;AAAA,MAAG,eAAa,+EAAoC;AAAA,OACxF,IACH,CACF;AAGJ,SACE,mDAAC;AAAA,IAAK,KAAK;AAAA,IAAkB,eAAa,+EAAoC;AAAA,KAC3E,IACH;AAEJ;AAEA,MAAM,sCAAsC,kCAA2C,yBAAyB;AAEhH,oCAAoC,YAAY;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -4,34 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
11
10
|
};
|
12
|
-
var
|
13
|
-
if (
|
14
|
-
for (let key of __getOwnPropNames(
|
15
|
-
if (!__hasOwnProp.call(
|
16
|
-
__defProp(
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
16
|
}
|
18
|
-
return
|
17
|
+
return to;
|
19
18
|
};
|
20
|
-
var __toESM = (
|
21
|
-
|
22
|
-
};
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
24
|
-
return (module2, temp) => {
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
26
|
-
};
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
19
|
+
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
21
|
var defaultProps_exports = {};
|
29
22
|
__export(defaultProps_exports, {
|
30
23
|
defaultProps: () => defaultProps
|
31
24
|
});
|
25
|
+
module.exports = __toCommonJS(defaultProps_exports);
|
32
26
|
var React = __toESM(require("react"));
|
33
27
|
const defaultProps = {
|
34
28
|
tooltipProps: {}
|
35
29
|
};
|
36
|
-
module.exports = __toCommonJS(defaultProps_exports);
|
37
30
|
//# sourceMappingURL=defaultProps.js.map
|
@@ -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": "
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -4,26 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
for (let key of __getOwnPropNames(from))
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
12
|
}
|
14
|
-
return
|
13
|
+
return to;
|
15
14
|
};
|
16
|
-
var
|
17
|
-
|
18
|
-
};
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
20
|
-
return (module2, temp) => {
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
22
|
-
};
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
16
|
+
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
24
18
|
var truncateTextWithTooltip_exports = {};
|
25
|
-
var React = __toESM(require("react"));
|
26
|
-
__reExport(truncateTextWithTooltip_exports, require("./DSTruncateTextWithTooltip"));
|
27
|
-
__reExport(truncateTextWithTooltip_exports, require("./DSTruncateTextWIthTooltipDatatestid"));
|
28
19
|
module.exports = __toCommonJS(truncateTextWithTooltip_exports);
|
20
|
+
var React = __toESM(require("react"));
|
21
|
+
__reExport(truncateTextWithTooltip_exports, require("./DSTruncateTextWithTooltip"), module.exports);
|
22
|
+
__reExport(truncateTextWithTooltip_exports, require("./DSTruncateTextWIthTooltipDatatestid"), module.exports);
|
29
23
|
//# sourceMappingURL=index.js.map
|
@@ -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": "
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,4CAAc,wCAAd;AACA,4CAAc,kDADd;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -4,36 +4,29 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
11
10
|
};
|
12
|
-
var
|
13
|
-
if (
|
14
|
-
for (let key of __getOwnPropNames(
|
15
|
-
if (!__hasOwnProp.call(
|
16
|
-
__defProp(
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
16
|
}
|
18
|
-
return
|
17
|
+
return to;
|
19
18
|
};
|
20
|
-
var __toESM = (
|
21
|
-
|
22
|
-
};
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
24
|
-
return (module2, temp) => {
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
26
|
-
};
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
19
|
+
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
21
|
var propTypes_exports = {};
|
29
22
|
__export(propTypes_exports, {
|
30
23
|
propTypes: () => propTypes
|
31
24
|
});
|
25
|
+
module.exports = __toCommonJS(propTypes_exports);
|
32
26
|
var React = __toESM(require("react"));
|
33
|
-
var
|
27
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
34
28
|
const propTypes = {
|
35
|
-
text:
|
36
|
-
tooltipProps:
|
29
|
+
text: import_ds_utilities.PropTypes.string.description("Text to show.").isRequired,
|
30
|
+
tooltipProps: import_ds_utilities.PropTypes.object.description("This component uses DSTooltip component, you can set properties directly to this component with this property.").defaultValue({})
|
37
31
|
};
|
38
|
-
module.exports = __toCommonJS(propTypes_exports);
|
39
32
|
//# sourceMappingURL=propTypes.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/truncateTextWithTooltip/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
-
"sourcesContent": ["/* eslint-disable max-len */\nimport { PropTypes } from '@elliemae/ds-
|
5
|
-
"mappings": "
|
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;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
11
10
|
};
|
12
|
-
var
|
13
|
-
if (
|
14
|
-
for (let key of __getOwnPropNames(
|
15
|
-
if (!__hasOwnProp.call(
|
16
|
-
__defProp(
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
16
|
}
|
18
|
-
return
|
17
|
+
return to;
|
19
18
|
};
|
20
|
-
var __toESM = (
|
21
|
-
|
22
|
-
};
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
24
|
-
return (module2, temp) => {
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
26
|
-
};
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
19
|
+
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
21
|
var styles_exports = {};
|
29
22
|
__export(styles_exports, {
|
30
23
|
Text: () => Text
|
31
24
|
});
|
25
|
+
module.exports = __toCommonJS(styles_exports);
|
32
26
|
var React = __toESM(require("react"));
|
33
27
|
var import_styled_components = __toESM(require("styled-components"));
|
34
28
|
const Text = import_styled_components.default.span`
|
@@ -43,5 +37,4 @@ const Text = import_styled_components.default.span`
|
|
43
37
|
background: ${({ theme }) => theme.colors.brand[200]};
|
44
38
|
}
|
45
39
|
`;
|
46
|
-
module.exports = __toCommonJS(styles_exports);
|
47
40
|
//# sourceMappingURL=styles.js.map
|
@@ -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 'styled-components';\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": "
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AAGZ,MAAM,OAAO,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAST,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -107,6 +107,7 @@ DSTruncatedTooltipText.defaultProps = {
|
|
107
107
|
tooltipDelay: void 0
|
108
108
|
};
|
109
109
|
DSTruncatedTooltipText.propTypes = truncatedTooltipTextProps;
|
110
|
+
DSTruncatedTooltipText.displayName = "DSTruncatedTooltipText";
|
110
111
|
const TruncatedTooltipTextWithSchema = describe(DSTruncatedTooltipText);
|
111
112
|
TruncatedTooltipTextWithSchema.propTypes = truncatedTooltipTextProps;
|
112
113
|
var DSTruncatedTooltipText_default = DSTruncatedTooltipText;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSTruncatedTooltipText.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useEffect } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport styled from 'styled-components';\nimport { PopperPositions as positions } from '@elliemae/ds-popper';\nimport { TruncatedTooltipContext } from './TooltipTextProvider';\n\nconst isEllipsisActive = ({ offsetWidth, scrollWidth }) =>\n 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 = 110, // https://jira.elliemae.io/browse/PUI-1755\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\n ? { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }\n : {};\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(\n 'Set of Properties attached to the main container',\n ),\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\n .description('override default zIndex')\n .defaultValue(110),\n};\n\nDSTruncatedTooltipText.defaultProps = {\n containerProps: {},\n value: '',\n tooltipPlacement: undefined,\n tooltipDelay: undefined,\n};\n\nDSTruncatedTooltipText.propTypes = truncatedTooltipTextProps;\
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,mBAAmB,CAAC,EAAE,aAAa,kBACvC,cAAc;AAGhB,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQpB,MAAM,yBAAyB,CAAC,OAK1B;AAL0B,eAC9B;AAAA,qBAAiB;AAAA,
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useEffect } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport styled from 'styled-components';\nimport { PopperPositions as positions } from '@elliemae/ds-popper';\nimport { TruncatedTooltipContext } from './TooltipTextProvider';\n\nconst isEllipsisActive = ({ offsetWidth, scrollWidth }) =>\n 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 = 110, // https://jira.elliemae.io/browse/PUI-1755\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\n ? { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }\n : {};\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(\n 'Set of Properties attached to the main container',\n ),\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\n .description('override default zIndex')\n .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,kBACvC,cAAc;AAGhB,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQpB,MAAM,yBAAyB,CAAC,OAK1B;AAL0B,eAC9B;AAAA,qBAAiB,CAAC;AAAA,IAClB,QAAQ;AAAA,IACR,SAAS;AAAA,MAHqB,IAI3B,2BAJ2B,IAI3B;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,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;AAC9B,gBAAY,EAAE,WAAW,EAAE,OAAO,CAAC;AAAA,EACrC;AAEA,QAAM,WAAW,cACb,EAAE,cAAc,kBAAkB,cAAc,iBAAiB,IACjE,CAAC;AACL,SACE,qCAAC,uDAAS,iBAAoB,iBAAoB,WAC/C,KACH;AAEJ;AAEA,uBAAuB,eAAe;AAAA,EACpC,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,4BAA4B;AAAA,EAChC,gBAAgB,UAAU,OAAO,YAC/B,kDACF;AAAA,EACA,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAC/D,+DACF;AAAA,EACA,kBAAkB,UAAU,MAAM;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,OACf,YAAY,yBAAyB,EACrC,aAAa,GAAG;AACrB;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
6
|
"names": []
|
7
7
|
}
|
@@ -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, useMemo, useState } from 'react';\nimport { useCancellableDelayedCallback } from '@elliemae/ds-utilities';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\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\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 PurePopover = useMemo(\n () => (\n <>\n {tooltipState.visible ? (\n <DSPopover\n boundaries=\"window\"\n style={{ pointerEvents: 'none', zIndex }}\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: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AAA,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;AAAA,EACd,QAAQ;AACV;AAGA,IAAO,qCAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -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({\n children,\n tooltipDelay = 200,\n placement = 'top',\n ...tooltipOptions\n}) {\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;
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AAEA,MAAM,0BAA0B,OAAM,cAAc;AAEpD,MAAM,EAAE,aAAa;AAErB,6BAA6B,IAK1B;AAL0B,eAC3B;AAAA;AAAA,IACA,eAAe;AAAA,IACf,YAAY;AAAA,MAHe,IAIxB,2BAJwB,IAIxB;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,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;AAAA,IACX;AAAA,IACA,WAAS;AAAA,KACL,iBACC,aAAa,WAAW,CAAC,IAL/B;AAAA,IAMC,SAAS,aAAa;AAAA,IACtB,aAAa,aAAa;AAAA,IAC1B,OAAO,EAAE,eAAe,QAAQ,OAAO;AAAA,IACvC,SAAS,aAAa;AAAA,IACxB,IACE,IACN;AAEJ;AAEA,oBAAoB,YAAY,CAAC;AACjC,oBAAoB,eAAe,CAAC;AAGpC,IAAO,8BAAQ;",
|
6
6
|
"names": []
|
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;
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,sCAAsC;AAAA,EACjD,MAAM;AACR;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
17
17
|
import * as React from "react";
|
18
18
|
import React2, { useState, useMemo, useEffect } from "react";
|
19
19
|
import { DSTooltipV3 } from "@elliemae/ds-tooltip";
|
20
|
-
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from "@elliemae/ds-
|
20
|
+
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from "@elliemae/ds-utilities";
|
21
21
|
import { defaultProps } from "./defaultProps";
|
22
22
|
import { DSTruncateTextWithTooltipDatatestid } from "./DSTruncateTextWIthTooltipDatatestid";
|
23
23
|
import { propTypes } from "./propTypes";
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/DSTruncateTextWithTooltip.tsx"],
|
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-
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,4BAA4B,CAAC,UAAyD;AAC1F,QAAM,mBAAmB,6BAA+D,OAAO;
|
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;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,qCAAC;AAAA,MAAY;AAAA,OAAgB,eAC3B,qCAAC;AAAA,MAAK,KAAK;AAAA,MAAkB,UAAU;AAAA,MAAG,eAAa,oCAAoC;AAAA,OACxF,IACH,CACF;AAGJ,SACE,qCAAC;AAAA,IAAK,KAAK;AAAA,IAAkB,eAAa,oCAAoC;AAAA,KAC3E,IACH;AAEJ;AAEA,MAAM,sCAAsC,SAA2C,yBAAyB;AAEhH,oCAAoC,YAAY;",
|
6
6
|
"names": []
|
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;
|
5
|
+
"mappings": "AAAA;ACEO,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import { PropTypes } from "@elliemae/ds-
|
2
|
+
import { PropTypes } from "@elliemae/ds-utilities";
|
3
3
|
const propTypes = {
|
4
4
|
text: PropTypes.string.description("Text to show.").isRequired,
|
5
5
|
tooltipProps: PropTypes.object.description("This component uses DSTooltip component, you can set properties directly to this component with this property.").defaultValue({})
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/propTypes.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport { PropTypes } from '@elliemae/ds-
|
5
|
-
"mappings": "AAAA;ACCA;AAcO,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,OAAO,YAAY,
|
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;",
|
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.0.0-
|
3
|
+
"version": "3.0.0-rc.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "ICE MT - Dimsum - Truncated Tooltip Text",
|
6
6
|
"files": [
|
@@ -50,12 +50,18 @@
|
|
50
50
|
"reportFile": "tests.xml",
|
51
51
|
"indent": 4
|
52
52
|
},
|
53
|
+
"scripts": {
|
54
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
55
|
+
"test": "node ../../scripts/testing/test.mjs",
|
56
|
+
"lint": "node ../../scripts/lint.mjs",
|
57
|
+
"dts": "node ../../scripts/dts.mjs",
|
58
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
59
|
+
},
|
53
60
|
"dependencies": {
|
54
|
-
"@elliemae/ds-popover": "
|
55
|
-
"@elliemae/ds-popper": "
|
56
|
-
"@elliemae/ds-
|
57
|
-
"@elliemae/ds-
|
58
|
-
"@elliemae/ds-utilities": "3.0.0-next.8",
|
61
|
+
"@elliemae/ds-popover": "workspace:*",
|
62
|
+
"@elliemae/ds-popper": "workspace:*",
|
63
|
+
"@elliemae/ds-tooltip": "workspace:*",
|
64
|
+
"@elliemae/ds-utilities": "workspace:*",
|
59
65
|
"prop-types": "~15.8.1",
|
60
66
|
"react-desc": "~4.1.3"
|
61
67
|
},
|
@@ -70,12 +76,5 @@
|
|
70
76
|
"publishConfig": {
|
71
77
|
"access": "public",
|
72
78
|
"typeSafety": false
|
73
|
-
},
|
74
|
-
"scripts": {
|
75
|
-
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
76
|
-
"test": "node ../../scripts/testing/test.mjs",
|
77
|
-
"lint": "node ../../scripts/lint.mjs",
|
78
|
-
"dts": "node ../../scripts/dts.mjs",
|
79
|
-
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
80
79
|
}
|
81
|
-
}
|
80
|
+
}
|