dtable-ui-component 6.0.122-beta.1 → 6.0.123-xms.24

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.
@@ -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), {}, {
@@ -9,25 +9,55 @@ 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
+ display: 'inline-flex',
34
+ alignItems: 'center',
35
+ justifyContent: 'center'
36
+ }, style);
37
+ const iconWrapper = /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", (0, _objectSpread2.default)((0, _objectSpread2.default)({
23
38
  className: (0, _classnames.default)('seatable-icon-btn', className, {
24
39
  'disabled': disabled
25
- })
26
- }, otherProperties), {}, {
40
+ }),
41
+ id: id,
42
+ style: iconStyle,
43
+ role: "button",
44
+ "aria-label": title,
45
+ onClick: onClick
46
+ }, others), {}, {
27
47
  children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
28
48
  className: (0, _classnames.default)('seatable-icon dtable-font', "dtable-icon-".concat(icon)),
29
49
  "aria-hidden": "true"
30
50
  }), children]
31
51
  }));
52
+ if (tooltip && id) {
53
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
54
+ children: [iconWrapper, /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableToolTip.default, {
55
+ target: id,
56
+ placement: placement,
57
+ children: tooltip
58
+ })]
59
+ });
60
+ }
61
+ return iconWrapper;
32
62
  };
33
63
  var _default = exports.default = IconButton;
@@ -127,7 +127,7 @@ function ImagePreviewerLightbox(props) {
127
127
  downloadImageTip: (0, _lang.getLocale)('Download_image'),
128
128
  preLineMetadaTip: (0, _lang.getLocale)('Pre_Line'),
129
129
  nextLineMetadaTip: (0, _lang.getLocale)('Next_Line'),
130
- closeMetadataTip: (0, _lang.getLocale)('Close')
130
+ closeTip: (0, _lang.getLocale)('Close')
131
131
  });
132
132
  }
133
133
  var _default = exports.default = ImagePreviewerLightbox;
@@ -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,9 +1,9 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.122-beta.1",
3
+ "version": "6.0.123xms.24",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
- "@seafile/react-image-lightbox": "5.0.9-beta.1",
6
+ "@seafile/react-image-lightbox": "5.0.9",
7
7
  "@seafile/seafile-calendar": "^1.0.10",
8
8
  "@seafile/seafile-editor": "^3.0.34",
9
9
  "classnames": "~2.5.*",