dtable-ui-component 0.1.94-test4 → 0.1.94-test7

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
  }]);
@@ -73,7 +73,7 @@ var CollaboratorEditor = /*#__PURE__*/function (_React$Component) {
73
73
  _this.onCommit = function (newValue) {
74
74
  var updated = {};
75
75
  var column = _this.props.column;
76
- updated[column.key] = newValue;
76
+ updated[column.name] = newValue;
77
77
 
78
78
  _this.props.onCommit(updated);
79
79
  };
@@ -31,7 +31,7 @@ var SingleSelectEditor = /*#__PURE__*/function (_React$Component) {
31
31
  var newValue = _this.state.newValue;
32
32
 
33
33
  var option = _this.options.find(function (option) {
34
- return option.id === newValue;
34
+ return option.name === newValue;
35
35
  });
36
36
 
37
37
  return option;
@@ -64,13 +64,13 @@ var SingleSelectEditor = /*#__PURE__*/function (_React$Component) {
64
64
  _this.onCommit = function (newValue) {
65
65
  var updated = {};
66
66
  var column = _this.props.column;
67
- updated[column.key] = newValue;
67
+ updated[column.name] = newValue;
68
68
 
69
69
  _this.props.onCommit(updated);
70
70
  };
71
71
 
72
72
  _this.onOptionItemToggle = function (option) {
73
- var newValue = _this.state.newValue === option.id ? '' : option.id;
73
+ var newValue = _this.state.newValue === option.name ? '' : option.name;
74
74
 
75
75
  _this.setState({
76
76
  newValue: newValue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.1.94-test4",
3
+ "version": "0.1.94-test7",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "0.0.9",