dtable-ui-component 0.3.7-beta.3 → 0.3.8-alpha1
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/FormulaFormatter/index.js +2 -2
- package/lib/FormulaFormatter/utils.js +3 -3
- package/lib/RowExpandFormatter/index.js +36 -40
- package/lib/RowExpandFormulaFormatter/index.js +188 -0
- package/lib/RowExpandLinkFormatter/index.js +2 -2
- package/lib/RowExpandLinkFormatter/utils.js +1 -1
- package/lib/constants/index.js +2 -2
- package/lib/index.js +1 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import React from 'react';
|
|
|
7
7
|
import { CellType, FORMULA_RESULT_TYPE, getFormulaDisplayString } from 'dtable-utils';
|
|
8
8
|
import BaseFormatterConfig from '../formatterConfig/base-formatter-config';
|
|
9
9
|
import TextFormatter from '../TextFormatter';
|
|
10
|
-
import {
|
|
10
|
+
import { isArrayFormatColumn, isSimpleCellFormatter, isFunction, getFormulaArrayValue, convertValueToDtableLongTextValue } from './utils';
|
|
11
11
|
import cellValueValidator from './cell-value-validator';
|
|
12
12
|
import './index.css';
|
|
13
13
|
|
|
@@ -58,7 +58,7 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
58
58
|
|
|
59
59
|
var formatterProps = _this.getFormatterProps(array_type, array_data, collaborators);
|
|
60
60
|
|
|
61
|
-
if (
|
|
61
|
+
if (isArrayFormatColumn(array_type)) {
|
|
62
62
|
formatterProps.value = value;
|
|
63
63
|
return _this.createColumnFormatter(Formatter, formatterProps);
|
|
64
64
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ARRAY_FORMAT_COLUMNS, SIMPLE_CELL_COLUMNS, SIMPLE_CELL_FORMULA_RESULTS } from '../constants';
|
|
2
2
|
import getPreviewContent from '../SimpleLongTextFormatter/normalize-long-text-value';
|
|
3
3
|
export function isSimpleCellFormatter(type) {
|
|
4
4
|
return SIMPLE_CELL_COLUMNS.includes(type) || SIMPLE_CELL_FORMULA_RESULTS.includes(type);
|
|
5
5
|
}
|
|
6
|
-
export function
|
|
7
|
-
return
|
|
6
|
+
export function isArrayFormatColumn(columnType) {
|
|
7
|
+
return ARRAY_FORMAT_COLUMNS.includes(columnType);
|
|
8
8
|
}
|
|
9
9
|
export var isFunction = function isFunction(functionToCheck) {
|
|
10
10
|
var getType = {};
|
|
@@ -9,7 +9,7 @@ var _emptyTypeMap;
|
|
|
9
9
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import classnames from 'classnames';
|
|
12
|
-
import { TextFormatter, NumberFormatter, CheckboxFormatter, DateFormatter, SingleSelectFormatter, MultipleSelectFormatter, CollaboratorFormatter, LongTextFormatter, GeolocationFormatter, CTimeFormatter, CreatorFormatter, LastModifierFormatter, MTimeFormatter, AutoNumberFormatter, DurationFormatter, ButtonFormatter, RowExpandUrlFormatter, RowExpandEmailFormatter, RowExpandRateFormatter, RowExpandImageFormatter, RowExpandFileFormatter, RowExpandLinkFormatter,
|
|
12
|
+
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
13
|
import { CellType } from '../constants';
|
|
14
14
|
import './index.css';
|
|
15
15
|
var emptyTypeMap = (_emptyTypeMap = {}, _defineProperty(_emptyTypeMap, CellType.TEXT, true), _defineProperty(_emptyTypeMap, CellType.LONG_TEXT, true), _defineProperty(_emptyTypeMap, CellType.GEOLOCATION, true), _defineProperty(_emptyTypeMap, CellType.SINGLE_SELECT, true), _defineProperty(_emptyTypeMap, CellType.MULTIPLE_SELECT, true), _defineProperty(_emptyTypeMap, CellType.CTIME, true), _defineProperty(_emptyTypeMap, CellType.MTIME, true), _defineProperty(_emptyTypeMap, CellType.DATE, true), _defineProperty(_emptyTypeMap, CellType.AUTO_NUMBER, true), _defineProperty(_emptyTypeMap, CellType.URL, true), _defineProperty(_emptyTypeMap, CellType.EMAIL, true), _defineProperty(_emptyTypeMap, CellType.IMAGE, true), _defineProperty(_emptyTypeMap, CellType.FILE, true), _defineProperty(_emptyTypeMap, CellType.CREATOR, true), _defineProperty(_emptyTypeMap, CellType.LAST_MODIFIER, true), _emptyTypeMap);
|
|
@@ -74,7 +74,13 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
74
74
|
_this.renderEmpty = function () {
|
|
75
75
|
return /*#__PURE__*/React.createElement("span", {
|
|
76
76
|
className: "row-cell-empty"
|
|
77
|
-
});
|
|
77
|
+
}); // <div
|
|
78
|
+
// onClick={this.toggleEditor}
|
|
79
|
+
// className={classnames('form-control', { 'disabled': readOnly })}
|
|
80
|
+
// style={{width: 320, lineHeight: '1.625rem'}}
|
|
81
|
+
// >
|
|
82
|
+
// {formatValue}
|
|
83
|
+
// </div>
|
|
78
84
|
};
|
|
79
85
|
|
|
80
86
|
_this.renderFormatter = function () {
|
|
@@ -86,11 +92,9 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
86
92
|
columnType = _column.type;
|
|
87
93
|
var collaborators = _this.state.collaborators;
|
|
88
94
|
var containerClassName = "dtable-".concat(columnType, "-formatter ").concat(className || '');
|
|
89
|
-
var cellValue = row[column.key] || row[column.name];
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return _this.renderEmpty();
|
|
93
|
-
}
|
|
95
|
+
var cellValue = row[column.key] || row[column.name]; // if (!cellValue && emptyTypeMap[columnType]) {
|
|
96
|
+
// return this.renderEmpty();
|
|
97
|
+
// }
|
|
94
98
|
|
|
95
99
|
switch (columnType) {
|
|
96
100
|
case CellType.TEXT:
|
|
@@ -105,10 +109,9 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
105
109
|
|
|
106
110
|
case CellType.COLLABORATOR:
|
|
107
111
|
{
|
|
108
|
-
if (!cellValue || cellValue.length === 0) {
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
+
// if (!cellValue || cellValue.length === 0) {
|
|
113
|
+
// return this.renderEmpty();
|
|
114
|
+
// }
|
|
112
115
|
return /*#__PURE__*/React.createElement("div", {
|
|
113
116
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
114
117
|
}, /*#__PURE__*/React.createElement(CollaboratorFormatter, {
|
|
@@ -142,10 +145,9 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
142
145
|
|
|
143
146
|
case CellType.NUMBER:
|
|
144
147
|
{
|
|
145
|
-
if (!cellValue && cellValue !== 0) {
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
148
|
+
// if (!cellValue && cellValue !== 0) {
|
|
149
|
+
// return this.renderEmpty();
|
|
150
|
+
// }
|
|
149
151
|
return /*#__PURE__*/React.createElement("div", {
|
|
150
152
|
className: "form-control d-flex align-items-center",
|
|
151
153
|
style: {
|
|
@@ -174,10 +176,9 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
174
176
|
|
|
175
177
|
case CellType.CTIME:
|
|
176
178
|
{
|
|
177
|
-
if (!row._ctime) {
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
179
|
+
// if (!row._ctime) {
|
|
180
|
+
// return this.renderEmpty();
|
|
181
|
+
// }
|
|
181
182
|
return /*#__PURE__*/React.createElement("div", {
|
|
182
183
|
className: "form-control d-flex align-items-center ctime-formatter-container",
|
|
183
184
|
style: {
|
|
@@ -191,10 +192,9 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
191
192
|
|
|
192
193
|
case CellType.MTIME:
|
|
193
194
|
{
|
|
194
|
-
if (!row._mtime) {
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
195
|
+
// if (!row._mtime) {
|
|
196
|
+
// return this.renderEmpty();
|
|
197
|
+
// }
|
|
198
198
|
return /*#__PURE__*/React.createElement("div", {
|
|
199
199
|
className: "form-control d-flex align-items-center mtime-formatter-container",
|
|
200
200
|
style: {
|
|
@@ -208,10 +208,9 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
208
208
|
|
|
209
209
|
case CellType.MULTIPLE_SELECT:
|
|
210
210
|
{
|
|
211
|
-
if (!cellValue || cellValue.length === 0) {
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
211
|
+
// if (!cellValue || cellValue.length === 0) {
|
|
212
|
+
// return this.renderEmpty();
|
|
213
|
+
// }
|
|
215
214
|
var options = column.data ? column.data.options : [];
|
|
216
215
|
return /*#__PURE__*/React.createElement("div", {
|
|
217
216
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
@@ -286,11 +285,10 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
286
285
|
case CellType.FORMULA:
|
|
287
286
|
case CellType.LINK_FORMULA:
|
|
288
287
|
{
|
|
289
|
-
if (!cellValue && cellValue !== 0 && cellValue !== false) {
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
return /*#__PURE__*/React.createElement(FormulaFormatter, {
|
|
288
|
+
// if (!cellValue && cellValue !== 0 && cellValue !== false) {
|
|
289
|
+
// return this.renderEmpty();
|
|
290
|
+
// }
|
|
291
|
+
return /*#__PURE__*/React.createElement(RowExpandFormulaFormatter, {
|
|
294
292
|
value: cellValue,
|
|
295
293
|
column: column,
|
|
296
294
|
collaborators: collaborators,
|
|
@@ -317,11 +315,10 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
317
315
|
}
|
|
318
316
|
})
|
|
319
317
|
});
|
|
320
|
-
}
|
|
318
|
+
} // if (!Array.isArray(cellValue) || cellValue.length === 0) {
|
|
319
|
+
// return this.renderEmpty();
|
|
320
|
+
// }
|
|
321
321
|
|
|
322
|
-
if (!Array.isArray(cellValue) || cellValue.length === 0) {
|
|
323
|
-
return _this.renderEmpty();
|
|
324
|
-
}
|
|
325
322
|
|
|
326
323
|
return /*#__PURE__*/React.createElement(RowExpandLinkFormatter, {
|
|
327
324
|
value: cellValue,
|
|
@@ -362,10 +359,9 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
362
359
|
|
|
363
360
|
case CellType.DURATION:
|
|
364
361
|
{
|
|
365
|
-
if (!cellValue && cellValue !== 0) {
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
|
|
362
|
+
// if (!cellValue && cellValue !== 0) {
|
|
363
|
+
// return this.renderEmpty();
|
|
364
|
+
// }
|
|
369
365
|
return /*#__PURE__*/React.createElement("div", {
|
|
370
366
|
className: "form-control d-flex align-items-center",
|
|
371
367
|
style: {
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { CellType, FORMULA_RESULT_TYPE, getFormulaDisplayString } from 'dtable-utils';
|
|
8
|
+
import BaseFormatterConfig from '../formatterConfig/base-formatter-config';
|
|
9
|
+
import TextFormatter from '../TextFormatter';
|
|
10
|
+
import { isArrayFormatColumn, isSimpleCellFormatter, isFunction, getFormulaArrayValue, convertValueToDtableLongTextValue } from '../FormulaFormatter/utils';
|
|
11
|
+
import cellValueValidator from '../FormulaFormatter/cell-value-validator';
|
|
12
|
+
import '../FormulaFormatter/index.css';
|
|
13
|
+
|
|
14
|
+
var RowExpandFormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
15
|
+
_inherits(RowExpandFormulaFormatter, _React$Component);
|
|
16
|
+
|
|
17
|
+
var _super = _createSuper(RowExpandFormulaFormatter);
|
|
18
|
+
|
|
19
|
+
function RowExpandFormulaFormatter() {
|
|
20
|
+
var _this;
|
|
21
|
+
|
|
22
|
+
_classCallCheck(this, RowExpandFormulaFormatter);
|
|
23
|
+
|
|
24
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
|
+
args[_key] = arguments[_key];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
29
|
+
|
|
30
|
+
_this.renderBorder = function (dom) {
|
|
31
|
+
var column = _this.props.column;
|
|
32
|
+
var result_type = column.data.result_type;
|
|
33
|
+
var style = {
|
|
34
|
+
minHeight: '38px'
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
if (result_type === FORMULA_RESULT_TYPE.DATE || result_type === FORMULA_RESULT_TYPE.NUMBER) {
|
|
38
|
+
style = {
|
|
39
|
+
width: '320px'
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "d-flex align-items-center form-control disabled h-auto",
|
|
45
|
+
style: style
|
|
46
|
+
}, dom);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
_this.renderOtherColumnFormatter = function () {
|
|
50
|
+
var _this$props = _this.props,
|
|
51
|
+
value = _this$props.value,
|
|
52
|
+
column = _this$props.column,
|
|
53
|
+
collaborators = _this$props.collaborators;
|
|
54
|
+
var _column$data = column.data,
|
|
55
|
+
array_type = _column$data.array_type,
|
|
56
|
+
array_data = _column$data.array_data;
|
|
57
|
+
|
|
58
|
+
if (!array_type || array_type === CellType.LINK) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
var Formatter = BaseFormatterConfig[array_type];
|
|
63
|
+
|
|
64
|
+
var formatterProps = _this.getFormatterProps(array_type, array_data, collaborators);
|
|
65
|
+
|
|
66
|
+
if (isArrayFormatColumn(array_type)) {
|
|
67
|
+
formatterProps.value = value;
|
|
68
|
+
return _this.renderBorder(_this.createColumnFormatter(Formatter, formatterProps));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
var cellValue = value;
|
|
72
|
+
|
|
73
|
+
if (!Array.isArray(value)) {
|
|
74
|
+
cellValue = cellValueValidator(value, array_type) ? [value] : [];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return _this.renderBorder( /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: "dtable-ui formula-formatter multiple"
|
|
79
|
+
}, cellValue.map(function (v, index) {
|
|
80
|
+
formatterProps.value = v;
|
|
81
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: "formula-formatter-content-item ".concat(isSimpleCellFormatter(array_type) ? 'simple-cell-formatter' : ''),
|
|
83
|
+
key: "formula-formatter-content-item-".concat(index)
|
|
84
|
+
}, _this.createColumnFormatter(Formatter, formatterProps));
|
|
85
|
+
})));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
_this.getFormatterProps = function (array_type, array_data, collaborators) {
|
|
89
|
+
switch (array_type) {
|
|
90
|
+
case CellType.DURATION:
|
|
91
|
+
{
|
|
92
|
+
var duration_format = array_data.duration_format;
|
|
93
|
+
return {
|
|
94
|
+
format: duration_format
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
case CellType.NUMBER:
|
|
99
|
+
case CellType.RATE:
|
|
100
|
+
case CellType.GEOLOCATION:
|
|
101
|
+
{
|
|
102
|
+
return {
|
|
103
|
+
data: array_data
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
default:
|
|
108
|
+
{
|
|
109
|
+
return _objectSpread(_objectSpread({}, array_data), {}, {
|
|
110
|
+
collaborators: collaborators
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return _this;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
_createClass(RowExpandFormulaFormatter, [{
|
|
120
|
+
key: "createColumnFormatter",
|
|
121
|
+
value: function createColumnFormatter(Formatter, formatterProps) {
|
|
122
|
+
if (React.isValidElement(Formatter)) {
|
|
123
|
+
return React.cloneElement(Formatter, _objectSpread({}, formatterProps));
|
|
124
|
+
} else if (isFunction(Formatter)) {
|
|
125
|
+
return /*#__PURE__*/React.createElement(Formatter, formatterProps);
|
|
126
|
+
} else {
|
|
127
|
+
return /*#__PURE__*/React.createElement(TextFormatter, formatterProps);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "render",
|
|
132
|
+
value: function render() {
|
|
133
|
+
var _this$props2 = this.props,
|
|
134
|
+
containerClassName = _this$props2.containerClassName,
|
|
135
|
+
column = _this$props2.column,
|
|
136
|
+
collaborators = _this$props2.collaborators,
|
|
137
|
+
value = _this$props2.value;
|
|
138
|
+
var data = column.data;
|
|
139
|
+
var array_type = data.array_type,
|
|
140
|
+
result_type = data.result_type;
|
|
141
|
+
|
|
142
|
+
if (Array.isArray(value)) {
|
|
143
|
+
value = getFormulaArrayValue(value);
|
|
144
|
+
|
|
145
|
+
if (array_type === CellType.DATE || result_type === FORMULA_RESULT_TYPE.DATE) {
|
|
146
|
+
value = value.map(function (item) {
|
|
147
|
+
return item.replace('T', ' ').replace('Z', '');
|
|
148
|
+
});
|
|
149
|
+
} else if (array_type === CellType.LONG_TEXT) {
|
|
150
|
+
value = value.map(function (item) {
|
|
151
|
+
return convertValueToDtableLongTextValue(item);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
if (result_type === FORMULA_RESULT_TYPE.DATE) {
|
|
156
|
+
value = value.replace('T', ' ').replace('Z', '');
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (result_type === FORMULA_RESULT_TYPE.ARRAY) {
|
|
161
|
+
return this.renderOtherColumnFormatter();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (typeof value === 'object') {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
var formattedValue = getFormulaDisplayString(value, data, {
|
|
169
|
+
collaborators: collaborators
|
|
170
|
+
});
|
|
171
|
+
var className = "dtable-ui cell-formatter-container formula-formatter ".concat(containerClassName);
|
|
172
|
+
|
|
173
|
+
if (result_type === FORMULA_RESULT_TYPE.NUMBER) {
|
|
174
|
+
className = className + ' text-right';
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return this.renderBorder( /*#__PURE__*/React.createElement("div", {
|
|
178
|
+
className: className,
|
|
179
|
+
title: formattedValue,
|
|
180
|
+
"aria-label": formattedValue
|
|
181
|
+
}, formattedValue));
|
|
182
|
+
}
|
|
183
|
+
}]);
|
|
184
|
+
|
|
185
|
+
return RowExpandFormulaFormatter;
|
|
186
|
+
}(React.Component);
|
|
187
|
+
|
|
188
|
+
export { RowExpandFormulaFormatter as default };
|
|
@@ -7,7 +7,7 @@ import React, { Component } from 'react';
|
|
|
7
7
|
import { CellType } from '../constants';
|
|
8
8
|
import { MultipleSelectFormatter, DateFormatter, CTimeFormatter, MTimeFormatter } from '../index';
|
|
9
9
|
import CollaboratorItemFormatter from './collaborator-item-formatter';
|
|
10
|
-
import { getFormulaArrayValue,
|
|
10
|
+
import { getFormulaArrayValue, isArrayFormatColumn } from './utils';
|
|
11
11
|
import { getCellDisplayValue } from './value-display-utils';
|
|
12
12
|
import './index.css';
|
|
13
13
|
|
|
@@ -45,7 +45,7 @@ var RowExpandLinkFormatter = /*#__PURE__*/function (_Component) {
|
|
|
45
45
|
|
|
46
46
|
var displayColumnType = displayColumn.type,
|
|
47
47
|
displayColumnData = displayColumn.data;
|
|
48
|
-
var cellValue = getFormulaArrayValue(value, !
|
|
48
|
+
var cellValue = getFormulaArrayValue(value, !isArrayFormatColumn(displayColumnType));
|
|
49
49
|
|
|
50
50
|
if (!Array.isArray(cellValue) || cellValue.length === 0) {
|
|
51
51
|
return props.renderEmpty();
|
|
@@ -53,6 +53,6 @@ export var getTwoDimensionArrayValue = function getTwoDimensionArrayValue(value)
|
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
|
-
export function
|
|
56
|
+
export function isArrayFormatColumn(columnType) {
|
|
57
57
|
return [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR].includes(columnType);
|
|
58
58
|
}
|
package/lib/constants/index.js
CHANGED
|
@@ -17,6 +17,6 @@ var DATE_TYPES = {
|
|
|
17
17
|
'YYYY-MM-DD HH:mm': 'YYYY-MM-DD HH:mm'
|
|
18
18
|
};
|
|
19
19
|
var SIMPLE_CELL_COLUMNS = [CellType.TEXT, CellType.NUMBER, CellType.DATE, CellType.CTIME, CellType.MTIME, CellType.AUTO_NUMBER, CellType.URL, CellType.EMAIL, CellType.DURATION, CellType.CHECKBOX, CellType.RATE];
|
|
20
|
-
var
|
|
20
|
+
var ARRAY_FORMAT_COLUMNS = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
|
|
21
21
|
var SIMPLE_CELL_FORMULA_RESULTS = [FORMULA_RESULT_TYPE.NUMBER, FORMULA_RESULT_TYPE.STRING, FORMULA_RESULT_TYPE.DATE, FORMULA_RESULT_TYPE.BOOL];
|
|
22
|
-
export { CellType, NUMBER_TYPES, DATE_TYPES, FORMULA_RESULT_TYPE, SIMPLE_CELL_COLUMNS,
|
|
22
|
+
export { CellType, NUMBER_TYPES, DATE_TYPES, FORMULA_RESULT_TYPE, SIMPLE_CELL_COLUMNS, ARRAY_FORMAT_COLUMNS, SIMPLE_CELL_FORMULA_RESULTS };
|
package/lib/index.js
CHANGED
|
@@ -40,6 +40,7 @@ export { default as RowExpandLinkFormatter } from './RowExpandLinkFormatter';
|
|
|
40
40
|
export { default as RowExpandRateFormatter } from './RowExpandRateFormatter';
|
|
41
41
|
export { default as RowExpandEmailFormatter } from './RowExpandEmailFormatter';
|
|
42
42
|
export { default as RowExpandUrlFormatter } from './RowExpandUrlFormatter';
|
|
43
|
+
export { default as RowExpandFormulaFormatter } from './RowExpandFormulaFormatter';
|
|
43
44
|
export { default as RowExpandFormatter } from './RowExpandFormatter'; // editor
|
|
44
45
|
|
|
45
46
|
export { default as TextEditor } from './TextEditor';
|