dtable-ui-component 6.0.119 → 6.0.120-xms.21

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.
@@ -78,6 +78,12 @@ const DTableDropdownItem = _ref => {
78
78
  }), tooltip && id && /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableToolTip.default, {
79
79
  target: id,
80
80
  placement: "right",
81
+ modifiers: [{
82
+ name: 'offset',
83
+ options: {
84
+ offset: [0, 8]
85
+ }
86
+ }],
81
87
  children: tooltip
82
88
  })]
83
89
  }));
@@ -10,6 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _reactstrap = require("reactstrap");
12
12
  var _IconButton = _interopRequireDefault(require("../IconButton"));
13
+ var _lang = require("../lang");
13
14
  require("./index.css");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  const _excluded = ["children"];
@@ -26,7 +27,10 @@ const DTableModalHeader = _ref => {
26
27
  onClick: props.toggle,
27
28
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
28
29
  icon: "x",
29
- className: "dtable-modal-close-inner"
30
+ className: "dtable-modal-close-inner",
31
+ id: "seatable-modal-x",
32
+ tooltip: (0, _lang.getLocale)('Close'),
33
+ title: (0, _lang.getLocale)('Close')
30
34
  })
31
35
  });
32
36
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.ModalHeader, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
@@ -16,7 +16,8 @@ const DTableToolTip = _ref => {
16
16
  placement = 'bottom',
17
17
  className,
18
18
  children,
19
- shortcut
19
+ shortcut,
20
+ modifiers
20
21
  } = _ref;
21
22
  const hasShortcut = Boolean(shortcut);
22
23
  const renderContent = () => {
@@ -58,7 +59,7 @@ const DTableToolTip = _ref => {
58
59
  options: {
59
60
  boundariesElement: 'window'
60
61
  }
61
- }]
62
+ }, ...(modifiers || [])]
62
63
  };
63
64
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.UncontrolledTooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, tooltipProps), {}, {
64
65
  children: renderContent()
@@ -9,25 +9,52 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _classnames = _interopRequireDefault(require("classnames"));
12
+ var _DTableToolTip = _interopRequireDefault(require("../DTableToolTip"));
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
- const _excluded = ["disabled", "className", "icon", "children"];
14
+ const _excluded = ["disabled", "className", "id", "icon", "title", "placement", "tooltip", "children", "style", "onClick", "size"];
14
15
  const IconButton = _ref => {
15
16
  let {
16
17
  disabled,
17
18
  className,
19
+ id,
18
20
  icon,
19
- children
21
+ title,
22
+ placement,
23
+ tooltip,
24
+ children,
25
+ style,
26
+ onClick,
27
+ size
20
28
  } = _ref,
21
- otherProperties = (0, _objectWithoutProperties2.default)(_ref, _excluded);
22
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
29
+ others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
30
+ const iconFontSize = size === 'sm' ? '12px' : size === 'middle' ? '14px' : '16px';
31
+ const iconStyle = (0, _objectSpread2.default)({
32
+ fontSize: iconFontSize
33
+ }, style);
34
+ const iconWrapper = /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", (0, _objectSpread2.default)((0, _objectSpread2.default)({
23
35
  className: (0, _classnames.default)('seatable-icon-btn', className, {
24
36
  'disabled': disabled
25
- })
26
- }, otherProperties), {}, {
37
+ }),
38
+ id: id,
39
+ style: iconStyle,
40
+ role: "button",
41
+ "aria-label": title,
42
+ onClick: onClick
43
+ }, others), {}, {
27
44
  children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
28
45
  className: (0, _classnames.default)('seatable-icon dtable-font', "dtable-icon-".concat(icon)),
29
46
  "aria-hidden": "true"
30
47
  }), children]
31
48
  }));
49
+ if (tooltip && id) {
50
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
51
+ children: [iconWrapper, /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableToolTip.default, {
52
+ target: id,
53
+ placement: placement,
54
+ children: tooltip
55
+ })]
56
+ });
57
+ }
58
+ return iconWrapper;
32
59
  };
33
60
  var _default = exports.default = IconButton;
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _reactstrap = require("reactstrap");
10
10
  var _IconButton = _interopRequireDefault(require("../IconButton"));
11
+ var _lang = require("../lang");
11
12
  require("./index.css");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  class NotificationPopover extends _react.default.Component {
@@ -62,7 +63,10 @@ class NotificationPopover extends _react.default.Component {
62
63
  className: "notification-header",
63
64
  children: [headerText, /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
64
65
  icon: "x",
65
- onClick: this.props.onNotificationListToggle
66
+ onClick: this.props.onNotificationListToggle,
67
+ id: "notification-popover-x",
68
+ tooltip: (0, _lang.getLocale)('Close'),
69
+ title: (0, _lang.getLocale)('Close')
66
70
  })]
67
71
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
68
72
  className: "notification-body",
@@ -43,13 +43,15 @@ const Header = _ref => {
43
43
  children: [copyURL && /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
44
44
  icon: "url",
45
45
  onClick: () => copyURL(),
46
- "aria-label": (0, _lang.getLocale)('Get_URL'),
47
- title: (0, _lang.getLocale)('Get_URL')
46
+ tooltip: (0, _lang.getLocale)('Get_URL'),
47
+ title: (0, _lang.getLocale)('Get_URL'),
48
+ id: "row-expand-url"
48
49
  }), children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
49
50
  icon: "x",
50
51
  onClick: onToggle,
51
52
  title: (0, _lang.getLocale)('Close_expanded_record'),
52
- "aria-label": (0, _lang.getLocale)('Close_expanded_record')
53
+ tooltip: (0, _lang.getLocale)('Close_expanded_record'),
54
+ id: "row-expand-x"
53
55
  })]
54
56
  }),
55
57
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.119",
3
+ "version": "6.0.120xms.21",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.8",