dtable-ui-component 0.1.94 → 0.1.95

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.
@@ -7,6 +7,7 @@
7
7
  border-width: 1px;
8
8
  border-style: solid;
9
9
  border-radius: 3px;
10
+ cursor: pointer;
10
11
  overflow: hidden;
11
12
  white-space: nowrap;
12
13
  text-overflow: ellipsis;
@@ -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: '#202428'
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.getValue = function () {
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 style = this.getStyle();
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: "cell-editor checkbox-editor"
80
- }, /*#__PURE__*/React.createElement("div", {
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: this.state.value,
87
- onBlur: this.onBlur,
88
- onPaste: this.onPaste,
89
- onKeyDown: this.onKeyDown,
90
- onChange: this.onChange,
91
- style: style,
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
  }]);
@@ -29,7 +29,6 @@
29
29
  height: 30px;
30
30
  padding-left: 12px;
31
31
  font-size: 14px;
32
- margin-left: 10px;
33
32
  cursor: pointer;
34
33
  }
35
34
 
@@ -37,6 +36,10 @@
37
36
  background-color: #f5f5f5;
38
37
  }
39
38
 
39
+ .dtable-ui-collaborator-editor-popover .dtable-ui.collaborator-item {
40
+ background: none;
41
+ }
42
+
40
43
  .dtable-ui-collaborator-editor-popover .collaborator-checked {
41
44
  width: 20px;
42
45
  text-align: center;
@@ -23,7 +23,6 @@
23
23
  padding-left: 12px;
24
24
  font-size: 14px;
25
25
  line-height: 30px;
26
- margin-left: 10px;
27
26
  cursor: pointer;
28
27
  }
29
28
 
@@ -1 +1,3 @@
1
- @import url('../css/cell-formatter.css');
1
+ .dtable-ui-mtime-formatter {
2
+ max-width: 320px;
3
+ }
@@ -36,7 +36,7 @@ var MTimeFormatter = /*#__PURE__*/function (_React$Component) {
36
36
  var _this$props = this.props,
37
37
  date = _this$props.value,
38
38
  containerClassName = _this$props.containerClassName;
39
- var classname = cn('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
39
+ var classname = cn('form-control dtable-ui-mtime-formatter', containerClassName);
40
40
 
41
41
  if (date !== '') {
42
42
  date = this.formatDate(date);
@@ -3,7 +3,12 @@
3
3
  }
4
4
 
5
5
  .dtable-ui-select-editor-container {
6
- display: inline-block;
7
- height: 30px;
8
- padding: 0 10px;
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
  }
@@ -1,5 +1,6 @@
1
1
  .dtable-ui-editor-popover {
2
- width: 320px;
2
+ width: 300px;
3
+ max-width: 100%;
3
4
  box-shadow: 0 0 5px #ccc;
4
5
  background-color: #fff;
5
6
  z-index: 10;
@@ -23,7 +23,6 @@
23
23
  padding-left: 12px;
24
24
  font-size: 14px;
25
25
  line-height: 30px;
26
- margin-left: 10px;
27
26
  cursor: pointer;
28
27
  }
29
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.1.94",
3
+ "version": "0.1.95",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "0.0.9",