dtable-ui-component 6.0.113-mba.4 → 6.0.114

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/index.js CHANGED
@@ -202,12 +202,6 @@ 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
- });
211
205
  Object.defineProperty(exports, "DateEditor", {
212
206
  enumerable: true,
213
207
  get: function () {
@@ -697,7 +691,6 @@ var _index = _interopRequireDefault(require("./DTableGroupSelect/index"));
697
691
  var _dtableSelectLabel = _interopRequireDefault(require("./DTableSelect/dtable-select-label"));
698
692
  var _DTableSwitch = _interopRequireDefault(require("./DTableSwitch"));
699
693
  var _DTableCustomizeSelect = _interopRequireDefault(require("./DTableCustomizeSelect"));
700
- var _DTableToolTip = _interopRequireDefault(require("./DTableToolTip"));
701
694
  var _DTableCustomizeCollaboratorSelect = _interopRequireDefault(require("./DTableCustomizeCollaboratorSelect"));
702
695
  var _DTableSearchInput = _interopRequireDefault(require("./DTableSearchInput"));
703
696
  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.113mba.4",
3
+ "version": "6.0.114",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
- "@seafile/react-image-lightbox": "^5.0.6",
6
+ "@seafile/react-image-lightbox": "^5.0.7",
7
7
  "@seafile/seafile-calendar": "^1.0.10",
8
- "@seafile/seafile-editor": "^3.0.31",
8
+ "@seafile/seafile-editor": "^3.0.32",
9
9
  "classnames": "~2.5.*",
10
10
  "dayjs": "1.10.7",
11
11
  "dtable-utils": "~5.0.27",
@@ -1,123 +0,0 @@
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 = exports.WithShortcut = exports.Simple = exports.LongTextWithShortcut = exports.LongText = exports.DifferentPlacements = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _index = _interopRequireDefault(require("./index"));
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- var _default = exports.default = {
12
- title: 'Components/DTableToolTip',
13
- component: _index.default
14
- };
15
- const TooltipContainer = _ref => {
16
- let {
17
- children
18
- } = _ref;
19
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
20
- style: {
21
- padding: '40px',
22
- minHeight: '300px',
23
- background: '#f5f5f5'
24
- },
25
- children: children
26
- });
27
- };
28
- const Simple = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(TooltipContainer, {
29
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
30
- id: "simple-tooltip",
31
- children: "Hover me"
32
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
33
- target: "simple-tooltip",
34
- placement: "bottom",
35
- children: "This is a simple tooltip"
36
- })]
37
- });
38
- exports.Simple = Simple;
39
- const WithShortcut = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(TooltipContainer, {
40
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
41
- id: "shortcut-tooltip",
42
- children: "Hover me"
43
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
44
- target: "shortcut-tooltip",
45
- placement: "bottom",
46
- shortcut: ['Ctrl', 'S'],
47
- children: "Save changes"
48
- })]
49
- });
50
- exports.WithShortcut = WithShortcut;
51
- const LongText = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(TooltipContainer, {
52
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
53
- id: "long-text-tooltip",
54
- children: "Hover me"
55
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
56
- target: "long-text-tooltip",
57
- placement: "bottom",
58
- children: "\u663E\u793A\u8BBE\u7F6E\u51B3\u5B9A\u6253\u5F00/\u5237\u65B0\u9875\u9762\u65F6\u6570\u636E\u7684\u663E\u793A\u65B9\u5F0F\u3002\u5E94\u7528\u4E2D\u7684\u7528\u6237\u53EF\u4EE5\u4FEE\u6539\u3002"
59
- })]
60
- });
61
- exports.LongText = LongText;
62
- const LongTextWithShortcut = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(TooltipContainer, {
63
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
64
- id: "long-shortcut-tooltip",
65
- children: "Hover me"
66
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
67
- target: "long-shortcut-tooltip",
68
- placement: "bottom",
69
- shortcut: ['Ctrl', 'P'],
70
- children: "\u663E\u793A\u8BBE\u7F6E\u51B3\u5B9A\u6253\u5F00/\u5237\u65B0\u9875\u9762\u65F6\u6570\u636E\u7684\u663E\u793A\u65B9\u5F0F\u3002\u5E94\u7528\u4E2D\u7684\u7528\u6237\u53EF\u4EE5\u4FEE\u6539\u3002"
71
- })]
72
- });
73
- exports.LongTextWithShortcut = LongTextWithShortcut;
74
- const DifferentPlacements = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(TooltipContainer, {
75
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
76
- style: {
77
- display: 'grid',
78
- gridTemplateColumns: 'repeat(3, 1fr)',
79
- gap: '40px'
80
- },
81
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
82
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
83
- id: "top-tooltip",
84
- children: "Top"
85
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
86
- target: "top-tooltip",
87
- placement: "top",
88
- children: "Top placement"
89
- })]
90
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
91
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
92
- id: "bottom-tooltip",
93
- children: "Bottom"
94
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
95
- target: "bottom-tooltip",
96
- placement: "bottom",
97
- children: "Bottom placement"
98
- })]
99
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
100
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
101
- id: "left-tooltip",
102
- children: "Left"
103
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
104
- target: "left-tooltip",
105
- placement: "left",
106
- children: "Left placement"
107
- })]
108
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
109
- style: {
110
- gridColumn: '2'
111
- },
112
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
113
- id: "right-tooltip",
114
- children: "Right"
115
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
116
- target: "right-tooltip",
117
- placement: "right",
118
- children: "Right placement"
119
- })]
120
- })]
121
- })
122
- });
123
- exports.DifferentPlacements = DifferentPlacements;
@@ -1,44 +0,0 @@
1
- .dtable-tooltip {
2
- position: absolute;
3
- z-index: 1070;
4
- }
5
-
6
- .dtable-tooltip .tooltip {
7
- opacity: 1;
8
- }
9
-
10
- .dtable-tooltip .tooltip .tooltip-inner {
11
- font-size: 14px;
12
- text-align: start;
13
- background-color: var(--bs-body-color);
14
- color: var(--bs-body-bg);
15
- border-radius: 4px;
16
- padding: 4px 8px;
17
- line-height: 20px;
18
- font-weight: normal;
19
- white-space: pre-wrap;
20
- }
21
-
22
- .dtable-tooltip-shortcut-inner {
23
- display: flex;
24
- align-items: center;
25
- justify-content: space-between;
26
- gap: 4px;
27
- line-height: 20px;
28
- }
29
-
30
- .dtable-tooltip-shortcut-keys {
31
- display: inline-flex;
32
- align-items: center;
33
- gap: 4px;
34
- flex-shrink: 0;
35
- }
36
-
37
- .dtable-tooltip-shortcut-key {
38
- display: inline-block;
39
- padding: 2px 8px;
40
- border: 1px solid #999;
41
- border-radius: 4px;
42
- white-space: nowrap;
43
- line-height: 14px;
44
- }
@@ -1,67 +0,0 @@
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;