dtable-ui-component 0.3.8-alpha1 → 0.3.8-alpha3
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.
|
@@ -1,18 +1,30 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
6
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
|
|
8
|
-
var _emptyTypeMap;
|
|
9
|
-
|
|
10
7
|
import React from 'react';
|
|
11
8
|
import classnames from 'classnames';
|
|
12
9
|
import { TextFormatter, NumberFormatter, CheckboxFormatter, DateFormatter, SingleSelectFormatter, MultipleSelectFormatter, CollaboratorFormatter, LongTextFormatter, GeolocationFormatter, CTimeFormatter, CreatorFormatter, LastModifierFormatter, MTimeFormatter, AutoNumberFormatter, DurationFormatter, ButtonFormatter, RowExpandUrlFormatter, RowExpandEmailFormatter, RowExpandRateFormatter, RowExpandImageFormatter, RowExpandFileFormatter, RowExpandLinkFormatter, RowExpandFormulaFormatter, DigitalSignFormatter } from '../index';
|
|
13
10
|
import { CellType } from '../constants';
|
|
14
|
-
import './index.css';
|
|
15
|
-
|
|
11
|
+
import './index.css'; // const emptyTypeMap = {
|
|
12
|
+
// [CellType.TEXT]: true,
|
|
13
|
+
// [CellType.LONG_TEXT]: true,
|
|
14
|
+
// [CellType.GEOLOCATION]: true,
|
|
15
|
+
// [CellType.SINGLE_SELECT]: true,
|
|
16
|
+
// [CellType.MULTIPLE_SELECT]: true,
|
|
17
|
+
// [CellType.CTIME]: true,
|
|
18
|
+
// [CellType.MTIME]: true,
|
|
19
|
+
// [CellType.DATE]: true,
|
|
20
|
+
// [CellType.AUTO_NUMBER]: true,
|
|
21
|
+
// [CellType.URL]: true,
|
|
22
|
+
// [CellType.EMAIL]: true,
|
|
23
|
+
// [CellType.IMAGE]: true,
|
|
24
|
+
// [CellType.FILE]: true,
|
|
25
|
+
// [CellType.CREATOR]: true,
|
|
26
|
+
// [CellType.LAST_MODIFIER]: true,
|
|
27
|
+
// };
|
|
16
28
|
|
|
17
29
|
var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
18
30
|
_inherits(EditorFormatter, _React$Component);
|
|
@@ -72,15 +84,9 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
72
84
|
};
|
|
73
85
|
|
|
74
86
|
_this.renderEmpty = function () {
|
|
75
|
-
return /*#__PURE__*/React.createElement("
|
|
76
|
-
className: "
|
|
77
|
-
});
|
|
78
|
-
// onClick={this.toggleEditor}
|
|
79
|
-
// className={classnames('form-control', { 'disabled': readOnly })}
|
|
80
|
-
// style={{width: 320, lineHeight: '1.625rem'}}
|
|
81
|
-
// >
|
|
82
|
-
// {formatValue}
|
|
83
|
-
// </div>
|
|
87
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: "d-flex align-items-center form-control disabled h-auto"
|
|
89
|
+
});
|
|
84
90
|
};
|
|
85
91
|
|
|
86
92
|
_this.renderFormatter = function () {
|
|
@@ -139,6 +139,10 @@ var RowExpandFormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
139
139
|
var array_type = data.array_type,
|
|
140
140
|
result_type = data.result_type;
|
|
141
141
|
|
|
142
|
+
if (!value) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
142
146
|
if (Array.isArray(value)) {
|
|
143
147
|
value = getFormulaArrayValue(value);
|
|
144
148
|
|
|
@@ -152,7 +156,7 @@ var RowExpandFormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
152
156
|
});
|
|
153
157
|
}
|
|
154
158
|
} else {
|
|
155
|
-
if (result_type === FORMULA_RESULT_TYPE.DATE) {
|
|
159
|
+
if (result_type === FORMULA_RESULT_TYPE.DATE && typeof value === 'string') {
|
|
156
160
|
value = value.replace('T', ' ').replace('Z', '');
|
|
157
161
|
}
|
|
158
162
|
}
|