@elliemae/ds-truncated-tooltip-text 2.2.0-alpha.3 → 3.0.0-next.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/cjs/DSTruncateTextWithTooltip.js +57 -68
- package/cjs/DSTruncatedTooltipText.js +93 -100
- package/cjs/SimpleTruncatedTooltipText.js +125 -114
- package/cjs/TooltipTextProvider.js +64 -60
- package/cjs/index.js +19 -45
- package/esm/DSTruncateTextWithTooltip.js +46 -38
- package/esm/DSTruncatedTooltipText.js +78 -68
- package/esm/SimpleTruncatedTooltipText.js +111 -83
- package/esm/TooltipTextProvider.js +48 -29
- package/esm/index.js +4 -16
- package/package.json +5 -5
- package/types/index.d.ts +5 -4
- package/cjs/DSTruncateTextWithTooltip.js.map +0 -7
- package/cjs/DSTruncatedTooltipText.js.map +0 -7
- package/cjs/SimpleTruncatedTooltipText.js.map +0 -7
- package/cjs/TooltipTextProvider.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/esm/DSTruncateTextWithTooltip.js.map +0 -7
- package/esm/DSTruncatedTooltipText.js.map +0 -7
- package/esm/SimpleTruncatedTooltipText.js.map +0 -7
- package/esm/TooltipTextProvider.js.map +0 -7
- package/esm/index.js.map +0 -7
@@ -1,74 +1,78 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
var
|
6
|
-
var
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
var
|
21
|
-
|
22
|
-
|
23
|
-
var
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
var
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}) {
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var _jsx2 = require('@babel/runtime/helpers/jsx');
|
6
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
8
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
14
|
+
var React = require('react');
|
15
|
+
var DSPopover = require('@elliemae/ds-popover');
|
16
|
+
var jsxRuntime = require('react/jsx-runtime');
|
17
|
+
|
18
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
19
|
+
|
20
|
+
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
21
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
22
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
23
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
24
|
+
var DSPopover__default = /*#__PURE__*/_interopDefaultLegacy(DSPopover);
|
25
|
+
|
26
|
+
const _excluded = ["children", "tooltipDelay", "placement"];
|
27
|
+
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
29
|
+
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
31
|
+
const TruncatedTooltipContext = /*#__PURE__*/React__default["default"].createContext();
|
32
|
+
const {
|
33
|
+
Provider
|
34
|
+
} = TruncatedTooltipContext;
|
35
|
+
|
36
|
+
function TooltipTextProvider(_ref) {
|
37
|
+
let {
|
38
|
+
children,
|
39
|
+
tooltipDelay = 200,
|
40
|
+
placement = 'top'
|
41
|
+
} = _ref,
|
42
|
+
tooltipOptions = _objectWithoutProperties__default["default"](_ref, _excluded);
|
43
|
+
|
45
44
|
const {
|
46
45
|
show: showTooltip,
|
47
46
|
hide: hideTooltip,
|
48
47
|
state: tooltipState
|
49
|
-
} =
|
50
|
-
|
51
|
-
|
48
|
+
} = DSPopover.usePopoverProviderState({
|
49
|
+
delay: tooltipDelay
|
50
|
+
});
|
51
|
+
const [zIndex, setZIndex] = React.useState(110);
|
52
|
+
const value = React.useMemo(() => ({
|
52
53
|
showTooltip,
|
53
54
|
hideTooltip,
|
54
55
|
setZIndex
|
55
56
|
}), []);
|
56
|
-
return
|
57
|
-
value
|
58
|
-
}, children, tooltipState.visible ?
|
57
|
+
return /*#__PURE__*/_jsx2__default["default"](Provider, {
|
58
|
+
value: value
|
59
|
+
}, void 0, children, tooltipState.visible ? /*#__PURE__*/jsxRuntime.jsx(DSPopover__default["default"], _objectSpread(_objectSpread(_objectSpread({
|
59
60
|
boundaries: "window",
|
60
|
-
placement,
|
61
|
-
showArrow: true
|
62
|
-
|
63
|
-
...tooltipState.options || {},
|
61
|
+
placement: placement,
|
62
|
+
showArrow: true
|
63
|
+
}, tooltipOptions), tooltipState.options || {}), {}, {
|
64
64
|
content: tooltipState.value,
|
65
65
|
referenceEl: tooltipState.reference,
|
66
|
-
style: {
|
66
|
+
style: {
|
67
|
+
pointerEvents: 'none',
|
68
|
+
zIndex
|
69
|
+
},
|
67
70
|
visible: tooltipState.visible
|
68
|
-
}) : null);
|
71
|
+
})) : null);
|
69
72
|
}
|
70
|
-
|
73
|
+
|
71
74
|
TooltipTextProvider.defaultProps = {};
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
+
|
76
|
+
exports.TooltipTextProvider = TooltipTextProvider;
|
77
|
+
exports.TruncatedTooltipContext = TruncatedTooltipContext;
|
78
|
+
exports["default"] = TooltipTextProvider;
|
package/cjs/index.js
CHANGED
@@ -1,45 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
var
|
6
|
-
var
|
7
|
-
var
|
8
|
-
var
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
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);
|
28
|
-
var src_exports = {};
|
29
|
-
__export(src_exports, {
|
30
|
-
DSTruncateTextWithTooltip: () => import_DSTruncateTextWithTooltip.DSTruncateTextWithTooltip,
|
31
|
-
DSTruncateTextWithTooltipDatatestId: () => import_DSTruncateTextWithTooltip.DSTruncateTextWithTooltipDatatestId,
|
32
|
-
DSTruncatedTooltipText: () => import_DSTruncatedTooltipText.DSTruncatedTooltipText,
|
33
|
-
SimpleTruncatedTooltipText: () => import_SimpleTruncatedTooltipText.SimpleTruncatedTooltipText,
|
34
|
-
TooltipTextProvider: () => import_TooltipTextProvider.TooltipTextProvider,
|
35
|
-
TruncatedTooltipContext: () => import_TooltipTextProvider.TruncatedTooltipContext,
|
36
|
-
TruncatedTooltipTextWithSchema: () => import_DSTruncatedTooltipText.TruncatedTooltipTextWithSchema,
|
37
|
-
default: () => import_DSTruncatedTooltipText.default
|
38
|
-
});
|
39
|
-
var React = __toESM(require("react"));
|
40
|
-
var import_TooltipTextProvider = __toESM(require("./TooltipTextProvider"));
|
41
|
-
var import_SimpleTruncatedTooltipText = __toESM(require("./SimpleTruncatedTooltipText"));
|
42
|
-
var import_DSTruncatedTooltipText = __toESM(require("./DSTruncatedTooltipText"));
|
43
|
-
var import_DSTruncateTextWithTooltip = __toESM(require("./DSTruncateTextWithTooltip"));
|
44
|
-
module.exports = __toCommonJS(src_exports);
|
45
|
-
//# sourceMappingURL=index.js.map
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var TooltipTextProvider = require('./TooltipTextProvider.js');
|
6
|
+
var SimpleTruncatedTooltipText = require('./SimpleTruncatedTooltipText.js');
|
7
|
+
var DSTruncatedTooltipText = require('./DSTruncatedTooltipText.js');
|
8
|
+
var DSTruncateTextWithTooltip = require('./DSTruncateTextWithTooltip.js');
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
exports.TooltipTextProvider = TooltipTextProvider.TooltipTextProvider;
|
13
|
+
exports.TruncatedTooltipContext = TooltipTextProvider.TruncatedTooltipContext;
|
14
|
+
exports.SimpleTruncatedTooltipText = SimpleTruncatedTooltipText.SimpleTruncatedTooltipText;
|
15
|
+
exports.DSTruncatedTooltipText = DSTruncatedTooltipText.DSTruncatedTooltipText;
|
16
|
+
exports.TruncatedTooltipTextWithSchema = DSTruncatedTooltipText.TruncatedTooltipTextWithSchema;
|
17
|
+
exports["default"] = DSTruncatedTooltipText.DSTruncatedTooltipText;
|
18
|
+
exports.DSTruncateTextWithTooltip = DSTruncateTextWithTooltip.DSTruncateTextWithTooltip;
|
19
|
+
exports.DSTruncateTextWithTooltipDatatestId = DSTruncateTextWithTooltip.DSTruncateTextWithTooltipDatatestId;
|
@@ -1,57 +1,65 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
7
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
8
|
+
import { useState, useMemo, useEffect } from 'react';
|
9
|
+
import { DSTooltipV3 } from '@elliemae/ds-tooltip';
|
10
|
+
import styled from 'styled-components';
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
12
|
+
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
14
|
+
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
16
|
+
const Text = /*#__PURE__*/styled.span.withConfig({
|
17
|
+
componentId: "sc-1w57q5j-0"
|
18
|
+
})(["text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:inline-block;max-width:100%;:focus{border:none;outline:none;background:", ";}"], props => props.theme.colors.brand['200']);
|
19
|
+
const DSTruncateTextWithTooltipDatatestId = 'DS-TruncateTextWithTooltip';
|
20
|
+
const DSTruncateTextWithTooltip = _ref => {
|
21
|
+
let {
|
22
|
+
text,
|
23
|
+
tooltipProps = {}
|
24
|
+
} = _ref;
|
25
|
+
const [textWrapperEl, setTextWrapperEl] = useState(); // const textWrapperEl = useRef<HTMLSpanElement>();
|
26
|
+
|
27
|
+
const [isShowingEllipsis, setIsShowingEllipsis] = useState(false); // const isShowingEllipsis = textWrapperEl?.scrollWidth > textWrapperEl?.clientWidth;
|
28
|
+
|
29
|
+
const resizeObserver = useMemo(() => new ResizeObserver(entries => {
|
22
30
|
if (entries.length) {
|
23
31
|
const [textWrapperEntry] = entries;
|
24
32
|
const el = textWrapperEntry.target;
|
25
|
-
setIsShowingEllipsis(el
|
33
|
+
setIsShowingEllipsis((el === null || el === void 0 ? void 0 : el.scrollWidth) > (el === null || el === void 0 ? void 0 : el.clientWidth));
|
26
34
|
}
|
27
35
|
}), []);
|
28
36
|
useEffect(() => {
|
29
37
|
if (textWrapperEl) {
|
30
|
-
setIsShowingEllipsis(textWrapperEl
|
38
|
+
setIsShowingEllipsis((textWrapperEl === null || textWrapperEl === void 0 ? void 0 : textWrapperEl.scrollWidth) > (textWrapperEl === null || textWrapperEl === void 0 ? void 0 : textWrapperEl.clientWidth));
|
31
39
|
resizeObserver.observe(textWrapperEl);
|
32
40
|
}
|
41
|
+
|
33
42
|
return () => {
|
34
43
|
if (textWrapperEl) {
|
35
44
|
resizeObserver.unobserve(textWrapperEl);
|
36
45
|
}
|
37
46
|
};
|
38
47
|
}, [resizeObserver, textWrapperEl]);
|
39
|
-
if (isShowingEllipsis)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
}, /* @__PURE__ */ React2.createElement(Text, {
|
48
|
+
if (isShowingEllipsis) return /*#__PURE__*/jsx(DSTooltipV3, _objectSpread(_objectSpread({
|
49
|
+
text: text
|
50
|
+
}, tooltipProps), {}, {
|
51
|
+
children: /*#__PURE__*/jsx(Text, {
|
44
52
|
ref: setTextWrapperEl,
|
45
53
|
tabIndex: 0,
|
46
|
-
"data-testid": DSTruncateTextWithTooltipDatatestId
|
47
|
-
|
48
|
-
|
54
|
+
"data-testid": DSTruncateTextWithTooltipDatatestId,
|
55
|
+
children: text
|
56
|
+
})
|
57
|
+
}));
|
58
|
+
return /*#__PURE__*/jsx(Text, {
|
49
59
|
ref: setTextWrapperEl,
|
50
|
-
"data-testid": DSTruncateTextWithTooltipDatatestId
|
51
|
-
|
60
|
+
"data-testid": DSTruncateTextWithTooltipDatatestId,
|
61
|
+
children: text
|
62
|
+
});
|
52
63
|
};
|
53
|
-
|
54
|
-
|
55
|
-
DSTruncateTextWithTooltipDatatestId
|
56
|
-
};
|
57
|
-
//# sourceMappingURL=DSTruncateTextWithTooltip.js.map
|
64
|
+
|
65
|
+
export { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipDatatestId };
|
@@ -1,33 +1,59 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
const
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
7
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
8
|
+
import { useContext, useEffect } from 'react';
|
9
|
+
import { PropTypes, describe } from 'react-desc';
|
10
|
+
import styled from 'styled-components';
|
11
|
+
import { PopperPositions } from '@elliemae/ds-popper';
|
12
|
+
import { TruncatedTooltipContext } from './TooltipTextProvider.js';
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
14
|
+
|
15
|
+
const _excluded = ["containerProps", "value", "zIndex"];
|
16
|
+
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
18
|
+
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
20
|
+
|
21
|
+
const isEllipsisActive = _ref => {
|
22
|
+
let {
|
23
|
+
offsetWidth,
|
24
|
+
scrollWidth
|
25
|
+
} = _ref;
|
26
|
+
return offsetWidth < scrollWidth;
|
27
|
+
}; // reduce the possibility of error showing the tooltip (text-overflow: ellipsis) https://jira.elliemae.io/browse/PUI-1755
|
28
|
+
|
29
|
+
|
30
|
+
const Text = /*#__PURE__*/styled.span.withConfig({
|
31
|
+
componentId: "sc-1olo1o7-0"
|
32
|
+
})(["text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:inline-block;max-width:100%;"]);
|
33
|
+
|
34
|
+
const DSTruncatedTooltipText = _ref2 => {
|
35
|
+
let {
|
36
|
+
containerProps = {},
|
37
|
+
value = '',
|
38
|
+
zIndex = 110
|
39
|
+
} = _ref2,
|
40
|
+
otherTextProps = _objectWithoutProperties(_ref2, _excluded);
|
41
|
+
|
21
42
|
const tooltipContext = useContext(TruncatedTooltipContext);
|
22
43
|
useEffect(() => {
|
23
|
-
if (zIndex && tooltipContext)
|
24
|
-
tooltipContext.setZIndex(zIndex);
|
44
|
+
if (zIndex && tooltipContext) tooltipContext.setZIndex(zIndex);
|
25
45
|
}, [zIndex]);
|
26
|
-
if (!tooltipContext)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
46
|
+
if (!tooltipContext) return value;
|
47
|
+
const {
|
48
|
+
showTooltip,
|
49
|
+
hideTooltip
|
50
|
+
} = tooltipContext;
|
51
|
+
|
52
|
+
const handleMouseEnter = e => {
|
53
|
+
const {
|
54
|
+
target
|
55
|
+
} = e;
|
56
|
+
|
31
57
|
if (target && isEllipsisActive(target, target.getBoundingClientRect())) {
|
32
58
|
showTooltip({
|
33
59
|
value,
|
@@ -35,56 +61,40 @@ const DSTruncatedTooltipText = ({
|
|
35
61
|
}, e);
|
36
62
|
}
|
37
63
|
};
|
38
|
-
|
39
|
-
|
64
|
+
|
65
|
+
const handleMouseLeave = e => {
|
66
|
+
hideTooltip({
|
67
|
+
reference: e.target
|
68
|
+
});
|
40
69
|
};
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
},
|
70
|
+
|
71
|
+
const handlers = showTooltip ? {
|
72
|
+
onMouseEnter: handleMouseEnter,
|
73
|
+
onMouseLeave: handleMouseLeave
|
74
|
+
} : {};
|
75
|
+
return /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, containerProps), otherTextProps), handlers), {}, {
|
76
|
+
children: value
|
77
|
+
}));
|
47
78
|
};
|
79
|
+
|
48
80
|
DSTruncatedTooltipText.defaultProps = {
|
49
|
-
value:
|
81
|
+
value: '',
|
50
82
|
zIndex: 110
|
51
83
|
};
|
52
84
|
const truncatedTooltipTextProps = {
|
53
|
-
containerProps: PropTypes.object.description(
|
54
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(
|
55
|
-
tooltipPlacement: PropTypes.oneOf([
|
56
|
-
|
57
|
-
|
58
|
-
positions.AUTO,
|
59
|
-
positions.TOP_START,
|
60
|
-
positions.TOP,
|
61
|
-
positions.TOP_END,
|
62
|
-
positions.RIGHT_START,
|
63
|
-
positions.RIGHT,
|
64
|
-
positions.RIGHT_END,
|
65
|
-
positions.BOTTOM_START,
|
66
|
-
positions.BOTTOM,
|
67
|
-
positions.BOTTOM_END,
|
68
|
-
positions.LEFT_START,
|
69
|
-
positions.LEFT,
|
70
|
-
positions.LEFT_END
|
71
|
-
]).description("Position of the tooltip"),
|
72
|
-
tooltipDelay: PropTypes.number.description("Delay to show the tooltip"),
|
73
|
-
zIndex: PropTypes.number.description("override default zIndex").defaultValue(110)
|
85
|
+
containerProps: PropTypes.object.description('Set of Properties attached to the main container'),
|
86
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Text that when truncated will trigger the tooltip interaction'),
|
87
|
+
tooltipPlacement: PropTypes.oneOf([PopperPositions.AUTO_START, PopperPositions.AUTO_END, PopperPositions.AUTO, PopperPositions.TOP_START, PopperPositions.TOP, PopperPositions.TOP_END, PopperPositions.RIGHT_START, PopperPositions.RIGHT, PopperPositions.RIGHT_END, PopperPositions.BOTTOM_START, PopperPositions.BOTTOM, PopperPositions.BOTTOM_END, PopperPositions.LEFT_START, PopperPositions.LEFT, PopperPositions.LEFT_END]).description('Position of the tooltip'),
|
88
|
+
tooltipDelay: PropTypes.number.description('Delay to show the tooltip'),
|
89
|
+
zIndex: PropTypes.number.description('override default zIndex').defaultValue(110)
|
74
90
|
};
|
75
91
|
DSTruncatedTooltipText.defaultProps = {
|
76
92
|
containerProps: {},
|
77
|
-
value:
|
78
|
-
tooltipPlacement:
|
79
|
-
tooltipDelay:
|
93
|
+
value: '',
|
94
|
+
tooltipPlacement: undefined,
|
95
|
+
tooltipDelay: undefined
|
80
96
|
};
|
81
|
-
DSTruncatedTooltipText.propTypes = truncatedTooltipTextProps;
|
82
97
|
const TruncatedTooltipTextWithSchema = describe(DSTruncatedTooltipText);
|
83
98
|
TruncatedTooltipTextWithSchema.propTypes = truncatedTooltipTextProps;
|
84
|
-
|
85
|
-
export {
|
86
|
-
DSTruncatedTooltipText,
|
87
|
-
TruncatedTooltipTextWithSchema,
|
88
|
-
DSTruncatedTooltipText_default as default
|
89
|
-
};
|
90
|
-
//# sourceMappingURL=DSTruncatedTooltipText.js.map
|
99
|
+
|
100
|
+
export { DSTruncatedTooltipText, TruncatedTooltipTextWithSchema, DSTruncatedTooltipText as default };
|