dtable-ui-component 6.0.112 → 6.0.113-iin.4
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 +3 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.dtable-tooltip {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: 1070;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.dtable-tooltip .tooltip {
|
|
7
|
+
max-width: 242px;
|
|
8
|
+
opacity: 1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dtable-tooltip .tooltip .tooltip-inner {
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
text-align: start;
|
|
14
|
+
background-color: var(--bs-body-color);
|
|
15
|
+
color: var(--bs-body-bg);
|
|
16
|
+
border-radius: 4px;
|
|
17
|
+
padding: 4px 8px;
|
|
18
|
+
line-height: 20px;
|
|
19
|
+
font-weight: normal;
|
|
20
|
+
white-space: nowrap;
|
|
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
|
@@ -202,6 +202,12 @@ Object.defineProperty(exports, "DTableSwitch", {
|
|
|
202
202
|
return _DTableSwitch.default;
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
|
+
Object.defineProperty(exports, "DTableToolTip", {
|
|
206
|
+
enumerable: true,
|
|
207
|
+
get: function () {
|
|
208
|
+
return _DTableToolTip.default;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
205
211
|
Object.defineProperty(exports, "DateEditor", {
|
|
206
212
|
enumerable: true,
|
|
207
213
|
get: function () {
|
|
@@ -691,6 +697,7 @@ var _index = _interopRequireDefault(require("./DTableGroupSelect/index"));
|
|
|
691
697
|
var _dtableSelectLabel = _interopRequireDefault(require("./DTableSelect/dtable-select-label"));
|
|
692
698
|
var _DTableSwitch = _interopRequireDefault(require("./DTableSwitch"));
|
|
693
699
|
var _DTableCustomizeSelect = _interopRequireDefault(require("./DTableCustomizeSelect"));
|
|
700
|
+
var _DTableToolTip = _interopRequireDefault(require("./DTableToolTip"));
|
|
694
701
|
var _DTableCustomizeCollaboratorSelect = _interopRequireDefault(require("./DTableCustomizeCollaboratorSelect"));
|
|
695
702
|
var _DTableSearchInput = _interopRequireDefault(require("./DTableSearchInput"));
|
|
696
703
|
var _DTableColorPicker = _interopRequireDefault(require("./DTableColorPicker"));
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-ui-component",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.113iin.4",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@seafile/react-image-lightbox": "^5.0.
|
|
6
|
+
"@seafile/react-image-lightbox": "^5.0.6",
|
|
7
7
|
"@seafile/seafile-calendar": "^1.0.10",
|
|
8
|
-
"@seafile/seafile-editor": "^3.0.
|
|
8
|
+
"@seafile/seafile-editor": "^3.0.31",
|
|
9
9
|
"classnames": "~2.5.*",
|
|
10
10
|
"dayjs": "1.10.7",
|
|
11
11
|
"dtable-utils": "~5.0.27",
|