dtable-ui-component 6.0.117 → 6.0.118-jh.2
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/lib/DTableToolTip/index.css +45 -0
- package/lib/DTableToolTip/index.js +67 -0
- package/lib/index.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.dtable-tooltip {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: 99999;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.dtable-tooltip .tooltip {
|
|
7
|
+
max-width: 242px;
|
|
8
|
+
min-width: max-content;
|
|
9
|
+
opacity: 1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dtable-tooltip .tooltip .tooltip-inner {
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
text-align: start;
|
|
15
|
+
background-color: var(--bs-body-color);
|
|
16
|
+
color: var(--bs-body-bg);
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
padding: 4px 8px;
|
|
19
|
+
line-height: 20px;
|
|
20
|
+
font-weight: normal;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.dtable-tooltip-shortcut-inner {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
gap: 4px;
|
|
28
|
+
line-height: 20px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dtable-tooltip-shortcut-keys {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 4px;
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dtable-tooltip-shortcut-key {
|
|
39
|
+
display: inline-block;
|
|
40
|
+
padding: 2px 8px;
|
|
41
|
+
border: 1px solid #999;
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
line-height: 14px;
|
|
45
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _reactstrap = require("reactstrap");
|
|
11
|
+
require("./index.css");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
const DTableToolTip = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
target,
|
|
16
|
+
placement = 'bottom',
|
|
17
|
+
className,
|
|
18
|
+
children,
|
|
19
|
+
shortcut
|
|
20
|
+
} = _ref;
|
|
21
|
+
const hasShortcut = Boolean(shortcut);
|
|
22
|
+
const renderContent = () => {
|
|
23
|
+
if (hasShortcut) {
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
25
|
+
className: "dtable-tooltip-shortcut-inner",
|
|
26
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
27
|
+
className: "dtable-tooltip-text",
|
|
28
|
+
children: children
|
|
29
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
30
|
+
className: "dtable-tooltip-shortcut-keys",
|
|
31
|
+
children: shortcut.map((key, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
32
|
+
className: "dtable-tooltip-shortcut-key",
|
|
33
|
+
children: key
|
|
34
|
+
}, index))
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return children;
|
|
39
|
+
};
|
|
40
|
+
const tooltipProps = {
|
|
41
|
+
target,
|
|
42
|
+
placement,
|
|
43
|
+
className: "dtable-tooltip ".concat(className ? className : ''),
|
|
44
|
+
innerClassName: hasShortcut ? 'dtable-tooltip-shortcut-inner' : '',
|
|
45
|
+
delay: {
|
|
46
|
+
show: 0,
|
|
47
|
+
hide: 0
|
|
48
|
+
},
|
|
49
|
+
hideArrow: true,
|
|
50
|
+
autohide: false,
|
|
51
|
+
modifiers: [{
|
|
52
|
+
name: 'offset',
|
|
53
|
+
options: {
|
|
54
|
+
offset: [0, -2.5]
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
name: 'preventOverflow',
|
|
58
|
+
options: {
|
|
59
|
+
boundariesElement: 'window'
|
|
60
|
+
}
|
|
61
|
+
}]
|
|
62
|
+
};
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.UncontrolledTooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, tooltipProps), {}, {
|
|
64
|
+
children: renderContent()
|
|
65
|
+
}));
|
|
66
|
+
};
|
|
67
|
+
var _default = exports.default = DTableToolTip;
|
package/lib/index.js
CHANGED
|
@@ -226,6 +226,12 @@ Object.defineProperty(exports, "DTableSwitch", {
|
|
|
226
226
|
return _DTableSwitch.default;
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
|
+
Object.defineProperty(exports, "DTableToolTip", {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function () {
|
|
232
|
+
return _DTableToolTip.default;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
229
235
|
Object.defineProperty(exports, "DateEditor", {
|
|
230
236
|
enumerable: true,
|
|
231
237
|
get: function () {
|
|
@@ -685,6 +691,7 @@ var _FileItemFormatter = _interopRequireDefault(require("./FileItemFormatter"));
|
|
|
685
691
|
var _DigitalSignFormatter = _interopRequireDefault(require("./DigitalSignFormatter"));
|
|
686
692
|
var _DepartmentSingleSelectFormatter = _interopRequireDefault(require("./DepartmentSingleSelectFormatter"));
|
|
687
693
|
var _SimpleLongTextFormatter = _interopRequireDefault(require("./SimpleLongTextFormatter"));
|
|
694
|
+
var _DTableToolTip = _interopRequireDefault(require("./DTableToolTip"));
|
|
688
695
|
var _RowExpandFormatter = _interopRequireDefault(require("./RowExpandFormatter"));
|
|
689
696
|
var _RowExpandEditor = _interopRequireDefault(require("./RowExpandEditor"));
|
|
690
697
|
var _RowExpand = _interopRequireDefault(require("./RowExpand"));
|