dtable-ui-component 0.3.8-alpha3 → 0.3.9
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.
|
@@ -8,23 +8,7 @@ import React from 'react';
|
|
|
8
8
|
import classnames from 'classnames';
|
|
9
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';
|
|
10
10
|
import { CellType } from '../constants';
|
|
11
|
-
import './index.css';
|
|
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
|
-
// };
|
|
11
|
+
import './index.css';
|
|
28
12
|
|
|
29
13
|
var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
30
14
|
_inherits(EditorFormatter, _React$Component);
|
|
@@ -98,9 +82,7 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
98
82
|
columnType = _column.type;
|
|
99
83
|
var collaborators = _this.state.collaborators;
|
|
100
84
|
var containerClassName = "dtable-".concat(columnType, "-formatter ").concat(className || '');
|
|
101
|
-
var cellValue = row[column.key] || row[column.name];
|
|
102
|
-
// return this.renderEmpty();
|
|
103
|
-
// }
|
|
85
|
+
var cellValue = row[column.key] || row[column.name];
|
|
104
86
|
|
|
105
87
|
switch (columnType) {
|
|
106
88
|
case CellType.TEXT:
|
|
@@ -115,9 +97,6 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
115
97
|
|
|
116
98
|
case CellType.COLLABORATOR:
|
|
117
99
|
{
|
|
118
|
-
// if (!cellValue || cellValue.length === 0) {
|
|
119
|
-
// return this.renderEmpty();
|
|
120
|
-
// }
|
|
121
100
|
return /*#__PURE__*/React.createElement("div", {
|
|
122
101
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
123
102
|
}, /*#__PURE__*/React.createElement(CollaboratorFormatter, {
|
|
@@ -151,9 +130,6 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
151
130
|
|
|
152
131
|
case CellType.NUMBER:
|
|
153
132
|
{
|
|
154
|
-
// if (!cellValue && cellValue !== 0) {
|
|
155
|
-
// return this.renderEmpty();
|
|
156
|
-
// }
|
|
157
133
|
return /*#__PURE__*/React.createElement("div", {
|
|
158
134
|
className: "form-control d-flex align-items-center",
|
|
159
135
|
style: {
|
|
@@ -182,9 +158,6 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
182
158
|
|
|
183
159
|
case CellType.CTIME:
|
|
184
160
|
{
|
|
185
|
-
// if (!row._ctime) {
|
|
186
|
-
// return this.renderEmpty();
|
|
187
|
-
// }
|
|
188
161
|
return /*#__PURE__*/React.createElement("div", {
|
|
189
162
|
className: "form-control d-flex align-items-center ctime-formatter-container",
|
|
190
163
|
style: {
|
|
@@ -198,9 +171,6 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
198
171
|
|
|
199
172
|
case CellType.MTIME:
|
|
200
173
|
{
|
|
201
|
-
// if (!row._mtime) {
|
|
202
|
-
// return this.renderEmpty();
|
|
203
|
-
// }
|
|
204
174
|
return /*#__PURE__*/React.createElement("div", {
|
|
205
175
|
className: "form-control d-flex align-items-center mtime-formatter-container",
|
|
206
176
|
style: {
|
|
@@ -214,9 +184,6 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
214
184
|
|
|
215
185
|
case CellType.MULTIPLE_SELECT:
|
|
216
186
|
{
|
|
217
|
-
// if (!cellValue || cellValue.length === 0) {
|
|
218
|
-
// return this.renderEmpty();
|
|
219
|
-
// }
|
|
220
187
|
var options = column.data ? column.data.options : [];
|
|
221
188
|
return /*#__PURE__*/React.createElement("div", {
|
|
222
189
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
@@ -291,9 +258,6 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
291
258
|
case CellType.FORMULA:
|
|
292
259
|
case CellType.LINK_FORMULA:
|
|
293
260
|
{
|
|
294
|
-
// if (!cellValue && cellValue !== 0 && cellValue !== false) {
|
|
295
|
-
// return this.renderEmpty();
|
|
296
|
-
// }
|
|
297
261
|
return /*#__PURE__*/React.createElement(RowExpandFormulaFormatter, {
|
|
298
262
|
value: cellValue,
|
|
299
263
|
column: column,
|
|
@@ -321,10 +285,7 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
321
285
|
}
|
|
322
286
|
})
|
|
323
287
|
});
|
|
324
|
-
}
|
|
325
|
-
// return this.renderEmpty();
|
|
326
|
-
// }
|
|
327
|
-
|
|
288
|
+
}
|
|
328
289
|
|
|
329
290
|
return /*#__PURE__*/React.createElement(RowExpandLinkFormatter, {
|
|
330
291
|
value: cellValue,
|
|
@@ -365,9 +326,6 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
365
326
|
|
|
366
327
|
case CellType.DURATION:
|
|
367
328
|
{
|
|
368
|
-
// if (!cellValue && cellValue !== 0) {
|
|
369
|
-
// return this.renderEmpty();
|
|
370
|
-
// }
|
|
371
329
|
return /*#__PURE__*/React.createElement("div", {
|
|
372
330
|
className: "form-control d-flex align-items-center",
|
|
373
331
|
style: {
|
|
@@ -138,10 +138,7 @@ var RowExpandFormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
138
138
|
var data = column.data;
|
|
139
139
|
var array_type = data.array_type,
|
|
140
140
|
result_type = data.result_type;
|
|
141
|
-
|
|
142
|
-
if (!value) {
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
141
|
+
if (!value) return null;
|
|
145
142
|
|
|
146
143
|
if (Array.isArray(value)) {
|
|
147
144
|
value = getFormulaArrayValue(value);
|