dtable-ui-component 0.1.94-test3 → 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
|
-
|
|
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
|
}]);
|
|
@@ -19,7 +19,7 @@ var CheckboxEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
19
19
|
_this.getValue = function () {
|
|
20
20
|
var updated = {};
|
|
21
21
|
var column = _this.props.column;
|
|
22
|
-
updated[column.
|
|
22
|
+
updated[column.name] = _this.state.value;
|
|
23
23
|
return updated;
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
73
|
+
var newValue = _this.state.newValue === option.name ? '' : option.name;
|
|
74
74
|
|
|
75
75
|
_this.setState({
|
|
76
76
|
newValue: newValue
|