dtable-ui-component 0.1.94-test5 → 0.1.94-test6

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.
@@ -12,9 +12,27 @@ var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
12
12
  var _super = _createSuper(ButtonFormatter);
13
13
 
14
14
  function ButtonFormatter() {
15
+ var _this;
16
+
15
17
  _classCallCheck(this, ButtonFormatter);
16
18
 
17
- return _super.apply(this, arguments);
19
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20
+ args[_key] = arguments[_key];
21
+ }
22
+
23
+ _this = _super.call.apply(_super, [this].concat(args));
24
+
25
+ _this.handleClick = function () {
26
+ var _this$props$data = _this.props.data,
27
+ button_type = _this$props$data.button_type,
28
+ url_address = _this$props$data.url_address;
29
+
30
+ if (button_type == 'open_url' && url_address) {
31
+ window.open(url_address);
32
+ }
33
+ };
34
+
35
+ return _this;
18
36
  }
19
37
 
20
38
  _createClass(ButtonFormatter, [{
@@ -45,7 +63,8 @@ var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
45
63
  };
46
64
  return /*#__PURE__*/React.createElement("div", {
47
65
  className: cn('dtable-ui cell-formatter-container button-formatter', containerClassName),
48
- style: btnStyle
66
+ style: btnStyle,
67
+ onClick: this.handleClick
49
68
  }, button_name);
50
69
  }
51
70
  }]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.1.94-test5",
3
+ "version": "0.1.94-test6",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "0.0.9",