dtable-ui-component 0.3.7-beta.1 → 0.3.7-beta.3

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.
@@ -6,6 +6,7 @@ import React from 'react';
6
6
  import classnames from 'classnames';
7
7
  import { SELECT_OPTION_COLORS } from 'dtable-utils';
8
8
  import './index.css';
9
+ var WHITE = '#FFFFFF';
9
10
 
10
11
  var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
11
12
  _inherits(ButtonFormatter, _React$Component);
@@ -48,7 +49,8 @@ var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
48
49
  }) || SELECT_OPTION_COLORS[0];
49
50
  var btnStyle = {
50
51
  backgroundColor: colorObj.COLOR,
51
- borderColor: colorObj.BORDER_COLOR
52
+ borderColor: colorObj.BORDER_COLOR,
53
+ color: colorObj.TEXT_COLOR === WHITE ? WHITE : '#666666'
52
54
  };
53
55
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
54
56
  className: classnames('dtable-ui cell-formatter-container button-formatter', containerClassName),
@@ -2,4 +2,9 @@
2
2
 
3
3
  .dtable-ui.checkbox-formatter .checkbox-checked-mark {
4
4
  color: #20c933;
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ font-size: 14px;
9
+ font-weight: 600;
5
10
  }
@@ -20,7 +20,7 @@
20
20
  display: flex;
21
21
  align-items: center;
22
22
  justify-content: center;
23
- margin: 0 4px 0 2px;
23
+ margin: 0 5px 0 2px;
24
24
  }
25
25
 
26
26
  .dtable-ui.collaborator-item .collaborator-avatar img {
@@ -5,6 +5,10 @@
5
5
  margin-right: 10px;
6
6
  }
7
7
 
8
+ .dtable-ui.dtable-row-expand-formatter .formula-formatter-content-item {
9
+ margin-top: 0.5rem;
10
+ margin-bottom: 5px;
11
+ }
8
12
 
9
13
  .dtable-ui.formula-formatter.multiple .formula-formatter-content-item.simple-cell-formatter {
10
14
  height: 20px;
@@ -76,7 +76,4 @@ RateFormatter.defaultProps = {
76
76
  value: '',
77
77
  containerClassName: ''
78
78
  };
79
- RateFormatter.defaultProps = {
80
- editable: true
81
- };
82
79
  export default RateFormatter;
@@ -4,6 +4,7 @@ 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
6
  import classnames from 'classnames';
7
+ import { getTrimmedString } from '../utils/editor-utils';
7
8
  import './index.css';
8
9
 
9
10
  var RowExpandEmailFormatter = /*#__PURE__*/function (_React$Component) {
@@ -22,11 +23,6 @@ var RowExpandEmailFormatter = /*#__PURE__*/function (_React$Component) {
22
23
 
23
24
  _this = _super.call.apply(_super, [this].concat(args));
24
25
 
25
- _this.getTrimmedString = function () {
26
- var value = _this.props.value;
27
- return typeof value === 'string' ? value.trim() : '';
28
- };
29
-
30
26
  _this.onOpenEmailLink = function () {
31
27
  var value = _this.props.value;
32
28
  var newValue = value.trim();
@@ -47,7 +43,7 @@ var RowExpandEmailFormatter = /*#__PURE__*/function (_React$Component) {
47
43
  className: classname
48
44
  }, /*#__PURE__*/React.createElement("span", {
49
45
  className: "email-formatter-value text-truncate"
50
- }, value), this.getTrimmedString() && /*#__PURE__*/React.createElement("span", {
46
+ }, value), getTrimmedString(value) && /*#__PURE__*/React.createElement("span", {
51
47
  className: "dtable-font dtable-icon-email row-expand-jump-link",
52
48
  onClick: this.onOpenEmailLink
53
49
  }));
@@ -43,6 +43,14 @@
43
43
 
44
44
  .dtable-ui.dtable-row-expand-formatter .form-control {
45
45
  background-color: #f8f9fa;
46
+ padding: 0 10px;
47
+ height: fit-content;
48
+ min-height: 2.375rem;
49
+ }
50
+
51
+ .dtable-ui.dtable-row-expand-formatter .ctime-formatter-container,
52
+ .dtable-ui.dtable-row-expand-formatter .mtime-formatter-container {
53
+ padding: 0.375rem 0.75rem;
46
54
  }
47
55
 
48
56
  .dtable-ui.dtable-row-expand-formatter .checkbox-formatter-container {
@@ -54,6 +62,32 @@
54
62
  justify-content: center;
55
63
  }
56
64
 
65
+ .dtable-ui.dtable-row-expand-formatter .checkbox-formatter-container .cell-formatter-container {
66
+ line-height: inherit;
67
+ }
68
+
69
+ .dtable-ui.dtable-row-expand-formatter .button-formatter {
70
+ margin-top: 6px;
71
+ text-align: center;
72
+ height: 26px;
73
+ line-height: 14px;
74
+ min-width: 80px;
75
+ max-width: 100%;
76
+ width: fit-content;
77
+ display: inline-flex;
78
+ justify-content: center;
79
+ align-items: center;
80
+ padding-left: 0.5rem;
81
+ padding-right: 0.5rem;
82
+ border-radius: 3px;
83
+ border-width: 2px;
84
+ font-weight: 500;
85
+ font-size: 14px;
86
+ font-family: inherit;
87
+ cursor: pointer;
88
+ letter-spacing: .03em;
89
+ }
90
+
57
91
  .dtable-ui.dtable-row-expand-formatter .longtext-formatter-container {
58
92
  border: 1px solid rgba(0, 40, 100, 0.12);
59
93
  border-radius: 3px;
@@ -63,7 +97,7 @@
63
97
  }
64
98
 
65
99
  .dtable-ui.dtable-row-expand-formatter .geolocation-formatter-container {
66
- height: 38px;
100
+ margin-top: 0.5rem;
67
101
  display: flex;
68
102
  align-items: center;
69
103
  }
@@ -179,7 +179,10 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
179
179
  }
180
180
 
181
181
  return /*#__PURE__*/React.createElement("div", {
182
- className: "form-control d-flex align-items-center w-100"
182
+ className: "form-control d-flex align-items-center ctime-formatter-container",
183
+ style: {
184
+ width: 320
185
+ }
183
186
  }, /*#__PURE__*/React.createElement(CTimeFormatter, {
184
187
  value: row._ctime,
185
188
  containerClassName: containerClassName
@@ -193,7 +196,10 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
193
196
  }
194
197
 
195
198
  return /*#__PURE__*/React.createElement("div", {
196
- className: "form-control d-flex align-items-center w-100"
199
+ className: "form-control d-flex align-items-center mtime-formatter-container",
200
+ style: {
201
+ width: 320
202
+ }
197
203
  }, /*#__PURE__*/React.createElement(MTimeFormatter, {
198
204
  value: row._mtime,
199
205
  containerClassName: containerClassName
@@ -1 +1,5 @@
1
1
  @import url('../css/cell-formatter.css');
2
+
3
+ .dtable-ui.dtable-row-expand-formatter .dtable-rate-formatter .dtable-icon-rate {
4
+ padding-right: 5px;
5
+ }
@@ -73,7 +73,4 @@ RateExpendRateFormatter.defaultProps = {
73
73
  value: '',
74
74
  containerClassName: ''
75
75
  };
76
- RateExpendRateFormatter.defaultProps = {
77
- editable: true
78
- };
79
76
  export default RateExpendRateFormatter;
@@ -4,6 +4,8 @@ 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
6
  import classnames from 'classnames';
7
+ import toaster from '../toaster';
8
+ import { isValidUrl, getTrimmedString } from '../utils/editor-utils';
7
9
  import './index.css';
8
10
 
9
11
  var UrlFormatter = /*#__PURE__*/function (_React$Component) {
@@ -22,22 +24,10 @@ var UrlFormatter = /*#__PURE__*/function (_React$Component) {
22
24
 
23
25
  _this = _super.call.apply(_super, [this].concat(args));
24
26
 
25
- _this.isValidUrl = function (url) {
26
- var reg = /^(([-a-zA-Z0-9+.]+):\/\/)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
27
- return reg.test(url);
28
- };
29
-
30
- _this.getTrimmedString = function () {
31
- var value = _this.props.value;
32
- return typeof value === 'string' ? value.trim() : '';
33
- };
34
-
35
27
  _this.onOpenUrlLink = function () {
36
28
  var value = _this.props.value;
37
-
38
- var url = _this.getTrimmedString(value);
39
-
40
- var validUrl = _this.isValidUrl(url) ? url : "http://".concat(url);
29
+ var url = getTrimmedString(value);
30
+ var validUrl = isValidUrl(url) ? url : "http://".concat(url);
41
31
 
42
32
  try {
43
33
  var a = document.createElement('a');
@@ -48,7 +38,7 @@ var UrlFormatter = /*#__PURE__*/function (_React$Component) {
48
38
  a.click();
49
39
  document.body.removeChild(a);
50
40
  } catch (_unused) {
51
- throw new Error('The url is invalid');
41
+ toaster.danger('The url is invalid');
52
42
  }
53
43
  };
54
44
 
@@ -66,7 +56,7 @@ var UrlFormatter = /*#__PURE__*/function (_React$Component) {
66
56
  className: classname
67
57
  }, /*#__PURE__*/React.createElement("span", {
68
58
  className: "url-formatter-value text-truncate"
69
- }, value), this.getTrimmedString() && /*#__PURE__*/React.createElement("span", {
59
+ }, value), getTrimmedString(value) && /*#__PURE__*/React.createElement("span", {
70
60
  className: "dtable-font dtable-icon-url row-expand-jump-link",
71
61
  onClick: this.onOpenUrlLink
72
62
  }));
@@ -68,4 +68,11 @@ export var getSelectOptionItem = function getSelectOptionItem(options, optionId)
68
68
  return options.find(function (option) {
69
69
  return option.id === optionId;
70
70
  });
71
+ };
72
+ export var isValidUrl = function isValidUrl(url) {
73
+ var reg = /^(([-a-zA-Z0-9+.]+):\/\/)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
74
+ return reg.test(url);
75
+ };
76
+ export var getTrimmedString = function getTrimmedString(value) {
77
+ return typeof value === 'string' ? value.trim() : '';
71
78
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.3.7-beta.1",
3
+ "version": "0.3.7-beta.3",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "dtable-utils": "0.0.2",