dtable-ui-component 0.1.94 → 0.1.96-test2
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.
- package/lib/ButtonFormatter/index.css +1 -0
- package/lib/ButtonFormatter/index.js +3 -3
- package/lib/CheckboxEditor/index.css +31 -0
- package/lib/CheckboxEditor/index.js +17 -44
- package/lib/CollaboratorEditor/index.css +4 -5
- package/lib/CollaboratorEditor/index.js +3 -3
- package/lib/EditEditorButton/index.css +17 -0
- package/lib/EditEditorButton/index.js +3 -26
- package/lib/LinkEditor/index.css +0 -6
- package/lib/LinkEditor/pc-link-editor-popover/index.css +0 -1
- package/lib/SingleSelectEditor/index.css +8 -3
- package/lib/css/cell-editor.css +2 -1
- package/lib/select-editor/pc-select-editor-popover/index.css +0 -1
- package/package.json +1 -1
|
@@ -54,18 +54,18 @@ var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
54
54
|
}) || optionColors[0] : {
|
|
55
55
|
COLOR: '#FFFCB5',
|
|
56
56
|
BORDER_COLOR: '#E8E79D',
|
|
57
|
-
TEXT_COLOR: '#
|
|
57
|
+
TEXT_COLOR: '#666'
|
|
58
58
|
};
|
|
59
59
|
var btnStyle = {
|
|
60
60
|
backgroundColor: colorOption.COLOR,
|
|
61
61
|
borderColor: colorOption.BORDER_COLOR,
|
|
62
62
|
color: colorOption.TEXT_COLOR
|
|
63
63
|
};
|
|
64
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
65
65
|
className: cn('dtable-ui cell-formatter-container button-formatter', containerClassName),
|
|
66
66
|
style: btnStyle,
|
|
67
67
|
onClick: this.handleClick
|
|
68
|
-
}, button_name);
|
|
68
|
+
}, button_name));
|
|
69
69
|
}
|
|
70
70
|
}]);
|
|
71
71
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.dtable-ui-checkbox-editor {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 24px;
|
|
4
|
+
height: 24px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dtable-ui-checkbox-editor .raw-checkbox {
|
|
8
|
+
position: absolute;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dtable-ui-checkbox-editor .shown-checkbox {
|
|
15
|
+
height: 100%;
|
|
16
|
+
border: 2px solid #e0e0e0;
|
|
17
|
+
border-radius: 3px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.dtable-ui-checkbox-editor .raw-checkbox:focus + .shown-checkbox {
|
|
21
|
+
border-color: #3b88fd;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dtable-ui-checkbox-editor .shown-checkbox .dtable-icon-check-mark {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
color: #20c933;
|
|
30
|
+
font-weight: 500;
|
|
31
|
+
}
|
|
@@ -3,6 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import './index.css';
|
|
6
7
|
|
|
7
8
|
var CheckboxEditor = /*#__PURE__*/function (_React$Component) {
|
|
8
9
|
_inherits(CheckboxEditor, _React$Component);
|
|
@@ -16,15 +17,10 @@ var CheckboxEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
16
17
|
|
|
17
18
|
_this = _super.call(this, props);
|
|
18
19
|
|
|
19
|
-
_this.
|
|
20
|
+
_this.onCommit = function () {
|
|
20
21
|
var updated = {};
|
|
21
22
|
var column = _this.props.column;
|
|
22
23
|
updated[column.name] = _this.state.value;
|
|
23
|
-
return updated;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
_this.onCommit = function () {
|
|
27
|
-
var updated = _this.getValue();
|
|
28
24
|
|
|
29
25
|
_this.props.onCommit(updated);
|
|
30
26
|
};
|
|
@@ -34,37 +30,13 @@ var CheckboxEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
34
30
|
return;
|
|
35
31
|
}
|
|
36
32
|
|
|
37
|
-
var value = event.target.checked;
|
|
38
|
-
|
|
39
|
-
if (value === _this.state.value) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
33
|
_this.setState({
|
|
44
|
-
value: value
|
|
34
|
+
value: !_this.state.value
|
|
45
35
|
}, function () {
|
|
46
36
|
_this.onCommit();
|
|
47
37
|
});
|
|
48
38
|
};
|
|
49
39
|
|
|
50
|
-
_this.onKeyDown = function (event) {
|
|
51
|
-
event.stopPropagation();
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
_this.onBlur = function () {// this.onCommit();
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
_this.setInputRef = function (input) {
|
|
58
|
-
_this.input = input;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
_this.getStyle = function () {
|
|
62
|
-
return {
|
|
63
|
-
marginLeft: 0,
|
|
64
|
-
transform: 'scale(1.1)'
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
|
|
68
40
|
_this.state = {
|
|
69
41
|
value: props.value ? props.value : false
|
|
70
42
|
};
|
|
@@ -74,22 +46,23 @@ var CheckboxEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
74
46
|
_createClass(CheckboxEditor, [{
|
|
75
47
|
key: "render",
|
|
76
48
|
value: function render() {
|
|
77
|
-
var
|
|
49
|
+
var value = this.state.value;
|
|
50
|
+
var isReadOnly = this.props.isReadOnly;
|
|
51
|
+
var style = {
|
|
52
|
+
cursor: isReadOnly ? 'default' : 'pointer'
|
|
53
|
+
};
|
|
78
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
79
|
-
className: "
|
|
80
|
-
|
|
81
|
-
className: "checkbox-editor-container"
|
|
55
|
+
className: "dtable-ui-checkbox-editor",
|
|
56
|
+
style: style
|
|
82
57
|
}, /*#__PURE__*/React.createElement("input", {
|
|
83
|
-
ref: this.setInputRef,
|
|
84
58
|
type: "checkbox",
|
|
85
|
-
className: "checkbox",
|
|
86
|
-
checked:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
readOnly: this.props.isReadOnly
|
|
59
|
+
className: "raw-checkbox",
|
|
60
|
+
checked: value,
|
|
61
|
+
onChange: this.onChange
|
|
62
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: "shown-checkbox"
|
|
64
|
+
}, value && /*#__PURE__*/React.createElement("span", {
|
|
65
|
+
className: "dtable-font dtable-icon-check-mark"
|
|
93
66
|
})));
|
|
94
67
|
}
|
|
95
68
|
}]);
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.dtable-ui-collaborator-editor-container .collaborators-container {
|
|
6
|
-
margin-top: 8px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
5
|
.dtable-ui-collaborator-editor-popover .collaborator-search-container {
|
|
10
6
|
padding: 10px 10px 0 10px;
|
|
11
7
|
}
|
|
@@ -29,7 +25,6 @@
|
|
|
29
25
|
height: 30px;
|
|
30
26
|
padding-left: 12px;
|
|
31
27
|
font-size: 14px;
|
|
32
|
-
margin-left: 10px;
|
|
33
28
|
cursor: pointer;
|
|
34
29
|
}
|
|
35
30
|
|
|
@@ -37,6 +32,10 @@
|
|
|
37
32
|
background-color: #f5f5f5;
|
|
38
33
|
}
|
|
39
34
|
|
|
35
|
+
.dtable-ui-collaborator-editor-popover .dtable-ui.collaborator-item {
|
|
36
|
+
background: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
40
39
|
.dtable-ui-collaborator-editor-popover .collaborator-checked {
|
|
41
40
|
width: 20px;
|
|
42
41
|
text-align: center;
|
|
@@ -197,9 +197,9 @@ var CollaboratorEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
197
197
|
}, /*#__PURE__*/React.createElement(EditEditorButton, {
|
|
198
198
|
text: getLocale('Add_a_collaborator'),
|
|
199
199
|
onClick: this.onAddOptionToggle
|
|
200
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
201
|
-
className: "collaborators-container"
|
|
202
|
-
}, selectedCollaborators.
|
|
200
|
+
}), selectedCollaborators.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
201
|
+
className: "collaborators-container mt-2"
|
|
202
|
+
}, selectedCollaborators.map(function (collaborator) {
|
|
203
203
|
return /*#__PURE__*/React.createElement(CollaboratorItem, {
|
|
204
204
|
key: collaborator.email,
|
|
205
205
|
collaborator: collaborator,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.dtable-ui-editor-button {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
padding: 0 12px;
|
|
4
|
+
height: 28px;
|
|
5
|
+
line-height: 28px;
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
background-color: #f0f0f0;
|
|
8
|
+
color: #8f8f8f;
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
user-select: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dtable-ui-editor-button:hover {
|
|
15
|
+
background-color: #dbdbdb;
|
|
16
|
+
color: #666;
|
|
17
|
+
}
|
|
@@ -3,6 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import './index.css';
|
|
6
7
|
|
|
7
8
|
var EditEditorButton = /*#__PURE__*/function (_React$Component) {
|
|
8
9
|
_inherits(EditEditorButton, _React$Component);
|
|
@@ -10,41 +11,17 @@ var EditEditorButton = /*#__PURE__*/function (_React$Component) {
|
|
|
10
11
|
var _super = _createSuper(EditEditorButton);
|
|
11
12
|
|
|
12
13
|
function EditEditorButton() {
|
|
13
|
-
var _this;
|
|
14
|
-
|
|
15
14
|
_classCallCheck(this, EditEditorButton);
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
args[_key] = arguments[_key];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
22
|
-
|
|
23
|
-
_this.getStyle = function () {
|
|
24
|
-
return {
|
|
25
|
-
display: 'inline-block',
|
|
26
|
-
padding: '0 12px',
|
|
27
|
-
height: '28px',
|
|
28
|
-
lineHeight: '28px',
|
|
29
|
-
fontSize: '14px',
|
|
30
|
-
backgroundColor: '#f0f0f0',
|
|
31
|
-
color: '#8f8f8f',
|
|
32
|
-
borderRadius: '4px',
|
|
33
|
-
cursor: 'pointer',
|
|
34
|
-
userSelect: 'none'
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return _this;
|
|
16
|
+
return _super.apply(this, arguments);
|
|
39
17
|
}
|
|
40
18
|
|
|
41
19
|
_createClass(EditEditorButton, [{
|
|
42
20
|
key: "render",
|
|
43
21
|
value: function render() {
|
|
44
22
|
var text = this.props.text;
|
|
45
|
-
var style = this.getStyle();
|
|
46
23
|
return /*#__PURE__*/React.createElement("span", {
|
|
47
|
-
|
|
24
|
+
className: "dtable-ui-editor-button",
|
|
48
25
|
onClick: this.props.onClick
|
|
49
26
|
}, text);
|
|
50
27
|
}
|
package/lib/LinkEditor/index.css
CHANGED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.dtable-ui-select-editor-container {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
height: 40px;
|
|
7
|
+
padding: 10px 5px;
|
|
8
|
+
border-radius: 3px;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dtable-ui-select-editor-container:hover {
|
|
13
|
+
background-color: #f5f5f5;
|
|
9
14
|
}
|
package/lib/css/cell-editor.css
CHANGED