dtable-ui-component 0.1.99 → 0.1.100
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/DurationFormatter/index.js +3 -1
- package/lib/NumberEditor/index.js +13 -5
- package/lib/constants/index.js +6 -3
- package/lib/index.js +1 -1
- package/lib/utils/utils.js +19 -0
- package/lib/utils/value-format-utils.js +130 -92
- package/package.json +1 -1
|
@@ -28,7 +28,9 @@ var DurationFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
28
28
|
var classname = cn('dtable-ui cell-formatter-container duration-formatter', containerClassName);
|
|
29
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
30
30
|
className: classname
|
|
31
|
-
}, getDurationDisplayString(value,
|
|
31
|
+
}, getDurationDisplayString(value, {
|
|
32
|
+
duration_format: format
|
|
33
|
+
}));
|
|
32
34
|
}
|
|
33
35
|
}]);
|
|
34
36
|
|
|
@@ -5,7 +5,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import isHotkey from 'is-hotkey';
|
|
7
7
|
import { NUMBER_TYPES } from '../constants';
|
|
8
|
-
import { getNumberDisplayString, formatStringToNumber,
|
|
8
|
+
import { getNumberDisplayString, formatStringToNumber, replaceNumberNotAllowInput } from '../utils/value-format-utils';
|
|
9
|
+
import { isMac } from '../utils/utils';
|
|
9
10
|
|
|
10
11
|
var NumberEditor = /*#__PURE__*/function (_React$Component) {
|
|
11
12
|
_inherits(NumberEditor, _React$Component);
|
|
@@ -51,12 +52,19 @@ var NumberEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
_this.onChange = function (event) {
|
|
55
|
+
var data = _this.props.column.data; // data maybe 'null'
|
|
56
|
+
|
|
54
57
|
var value = event.target.value.trim();
|
|
55
|
-
|
|
58
|
+
var currency_symbol = null;
|
|
56
59
|
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
+
if (data && data.format === 'custom_currency') {
|
|
61
|
+
currency_symbol = data['currency_symbol'];
|
|
62
|
+
} //Prevent the repetition of periods bug in the Chinese input method of the Windows system
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
if (!isMac() && value.indexOf('.。') > -1) return;
|
|
66
|
+
value = replaceNumberNotAllowInput(value, _this.dataFormat, currency_symbol);
|
|
67
|
+
if (value === _this.state.inputValue) return;
|
|
60
68
|
|
|
61
69
|
_this.setState({
|
|
62
70
|
inputValue: value
|
package/lib/constants/index.js
CHANGED
|
@@ -35,7 +35,10 @@ var DEFAULT_NUMBER_FORMAT = 'number';
|
|
|
35
35
|
var DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
|
|
36
36
|
var DURATION_FORMATS_MAP = {
|
|
37
37
|
H_MM: 'h:mm',
|
|
38
|
-
H_MM_SS: 'h:mm:ss'
|
|
38
|
+
H_MM_SS: 'h:mm:ss',
|
|
39
|
+
H_MM_SS_S: 'h:mm:ss.s',
|
|
40
|
+
H_MM_SS_SS: 'h:mm:ss.ss',
|
|
41
|
+
H_MM_SS_SSS: 'h:mm:ss.sss'
|
|
39
42
|
};
|
|
40
43
|
var DURATION_FORMATS = [{
|
|
41
44
|
name: DURATION_FORMATS_MAP.H_MM,
|
|
@@ -44,6 +47,6 @@ var DURATION_FORMATS = [{
|
|
|
44
47
|
name: DURATION_FORMATS_MAP.H_MM_SS,
|
|
45
48
|
type: DURATION_FORMATS_MAP.H_MM_SS
|
|
46
49
|
}];
|
|
47
|
-
var DURATION_ZERO_DISPLAY = (_DURATION_ZERO_DISPLA = {}, _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM, '0:00'), _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM_SS, '0:00'), _DURATION_ZERO_DISPLA);
|
|
48
|
-
var DURATION_DECIMAL_DIGITS = (_DURATION_DECIMAL_DIG = {}, _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM, 0), _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM_SS, 0), _DURATION_DECIMAL_DIG);
|
|
50
|
+
var DURATION_ZERO_DISPLAY = (_DURATION_ZERO_DISPLA = {}, _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM, '0:00'), _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM_SS, '0:00'), _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM_SS_S, '0:00.0'), _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM_SS_SS, '0:00.00'), _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM_SS_SSS, '0:00.000'), _DURATION_ZERO_DISPLA);
|
|
51
|
+
var DURATION_DECIMAL_DIGITS = (_DURATION_DECIMAL_DIG = {}, _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM, 0), _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM_SS, 0), _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM_SS_S, 1), _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM_SS_SS, 2), _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM_SS_SSS, 3), _DURATION_DECIMAL_DIG);
|
|
49
52
|
export { CellType, NUMBER_TYPES, DATE_TYPES, FORMULA_RESULT_TYPE, SIMPLE_CELL_COLUMNS, ARRAY_FORMAL_COLUMNS, SIMPLE_CELL_FORMULA_RESULTS, COLLABORATOR_COLUMN_TYPES, ARRAY_FORMAL_COLUMNS_TYPES, DEFAULT_NUMBER_FORMAT, DEFAULT_DATE_FORMAT, DURATION_FORMATS_MAP, DURATION_FORMATS, DURATION_ZERO_DISPLAY, DURATION_DECIMAL_DIGITS };
|
package/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { default as toaster } from './toaster'; // Loading
|
|
|
4
4
|
export { default as Loading } from './Loading';
|
|
5
5
|
export { setLocale } from './lang'; // utils
|
|
6
6
|
|
|
7
|
-
export { getDateDisplayString, getNumberDisplayString, formatStringToNumber
|
|
7
|
+
export { getDateDisplayString, getNumberDisplayString, formatStringToNumber } from './utils/value-format-utils'; // formatter
|
|
8
8
|
|
|
9
9
|
export { default as CheckboxFormatter } from './CheckboxFormatter';
|
|
10
10
|
export { default as ImageFormatter } from './ImageFormatter';
|
package/lib/utils/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import NP from './number-precision';
|
|
1
2
|
export var debounce = function debounce(fn, wait) {
|
|
2
3
|
var timeout = null;
|
|
3
4
|
return function () {
|
|
@@ -22,4 +23,22 @@ export var throttle = function throttle(func, delay) {
|
|
|
22
23
|
timer = setTimeout(func, remaining);
|
|
23
24
|
}
|
|
24
25
|
};
|
|
26
|
+
};
|
|
27
|
+
export var getFloatNumber = function getFloatNumber(data, format) {
|
|
28
|
+
if (!data && data !== 0) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var newData = parseFloat(data.replace(/[^.-\d]/g, ''));
|
|
33
|
+
|
|
34
|
+
if (format === 'percent' && !isNaN(newData)) {
|
|
35
|
+
return NP.divide(newData, 100);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return isNaN(newData) ? null : newData;
|
|
39
|
+
};
|
|
40
|
+
export var isMac = function isMac() {
|
|
41
|
+
var platform = navigator.platform; // eslint-disable-next-line eqeqeq
|
|
42
|
+
|
|
43
|
+
return platform == 'Mac68K' || platform == 'MacPPC' || platform == 'Macintosh' || platform == 'MacIntel';
|
|
25
44
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* eslint-disable no-case-declarations */
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import NP from './number-precision';
|
|
4
|
-
import { CellType,
|
|
4
|
+
import { CellType, DEFAULT_NUMBER_FORMAT, DURATION_FORMATS_MAP, DURATION_FORMATS, DURATION_ZERO_DISPLAY, DURATION_DECIMAL_DIGITS, FORMULA_RESULT_TYPE, COLLABORATOR_COLUMN_TYPES, ARRAY_FORMAL_COLUMNS_TYPES, DEFAULT_DATE_FORMAT } from '../constants';
|
|
5
|
+
import { getFloatNumber } from './utils';
|
|
5
6
|
NP.enableBoundaryChecking(false);
|
|
6
7
|
var _separatorMap = {
|
|
7
8
|
'comma': ',',
|
|
@@ -168,53 +169,89 @@ export var getNumberDisplayString = function getNumberDisplayString(value, forma
|
|
|
168
169
|
return '' + value;
|
|
169
170
|
}
|
|
170
171
|
};
|
|
171
|
-
export var formatStringToNumber = function formatStringToNumber(
|
|
172
|
-
var
|
|
173
|
-
|
|
172
|
+
export var formatStringToNumber = function formatStringToNumber(numberString, formatData) {
|
|
173
|
+
var _ref3 = formatData || {},
|
|
174
|
+
format = _ref3.format,
|
|
175
|
+
decimal = _ref3.decimal,
|
|
176
|
+
thousands = _ref3.thousands,
|
|
177
|
+
enable_precision = _ref3.enable_precision,
|
|
178
|
+
precision = _ref3.precision;
|
|
179
|
+
|
|
180
|
+
var value = numberString;
|
|
181
|
+
|
|
182
|
+
if (decimal && thousands && decimal === 'comma') {
|
|
183
|
+
if (thousands === 'dot') {
|
|
184
|
+
value = value.replace(/,/, '@');
|
|
185
|
+
value = value.replace(/\./g, ',');
|
|
186
|
+
value = value.replace(/@/, '.');
|
|
187
|
+
} else {
|
|
188
|
+
value = value.replace(/\./g, '');
|
|
189
|
+
value = value.replace(/,/, '.');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
174
192
|
|
|
175
|
-
|
|
176
|
-
|
|
193
|
+
value = getFloatNumber(value, format);
|
|
194
|
+
|
|
195
|
+
if (enable_precision && value) {
|
|
196
|
+
if (format === 'percent') {
|
|
197
|
+
precision += 2;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
value = Number(parseFloat(value).toFixed(precision));
|
|
177
201
|
}
|
|
178
202
|
|
|
179
|
-
return
|
|
203
|
+
return value;
|
|
180
204
|
};
|
|
181
|
-
export var
|
|
182
|
-
var
|
|
205
|
+
export var replaceNumberNotAllowInput = function replaceNumberNotAllowInput(value) {
|
|
206
|
+
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_NUMBER_FORMAT;
|
|
207
|
+
var currency_symbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
208
|
+
|
|
209
|
+
if (!value) {
|
|
210
|
+
return '';
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
value = value.replace(/。/g, '.');
|
|
183
214
|
|
|
184
215
|
switch (format) {
|
|
185
|
-
case
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
216
|
+
case 'number':
|
|
217
|
+
{
|
|
218
|
+
return value.replace(/[^.-\d,]/g, '');
|
|
219
|
+
}
|
|
189
220
|
|
|
190
|
-
case
|
|
191
|
-
|
|
192
|
-
|
|
221
|
+
case 'percent':
|
|
222
|
+
{
|
|
223
|
+
return value.replace(/[^.-\d,%]/g, '');
|
|
224
|
+
}
|
|
193
225
|
|
|
194
|
-
case
|
|
195
|
-
|
|
196
|
-
|
|
226
|
+
case 'yuan':
|
|
227
|
+
{
|
|
228
|
+
return value.replace(/[^.-\d¥¥,]/g, '');
|
|
229
|
+
}
|
|
197
230
|
|
|
198
|
-
case
|
|
199
|
-
|
|
200
|
-
|
|
231
|
+
case 'dollar':
|
|
232
|
+
{
|
|
233
|
+
return value.replace(/[^.-\d$,]/g, '');
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
case 'euro':
|
|
237
|
+
{
|
|
238
|
+
return value.replace(/[^.-\d€,]/g, '');
|
|
239
|
+
}
|
|
201
240
|
|
|
202
|
-
case
|
|
203
|
-
|
|
204
|
-
|
|
241
|
+
case 'custom_currency':
|
|
242
|
+
{
|
|
243
|
+
// eslint-disable-next-line
|
|
244
|
+
var reg = new RegExp('[^.-\d' + currency_symbol + ',]', 'g');
|
|
245
|
+
return value.replace(reg, '');
|
|
246
|
+
}
|
|
205
247
|
|
|
206
248
|
default:
|
|
207
|
-
|
|
249
|
+
return value.replace(/[^.-\d,]/g, '');
|
|
208
250
|
}
|
|
209
|
-
|
|
210
|
-
return formattedValue;
|
|
211
251
|
};
|
|
212
252
|
export var getDateDisplayString = function getDateDisplayString(value, format) {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
if (!value) {
|
|
216
|
-
// value === '', value === undefine, value === null
|
|
217
|
-
return formattedValue;
|
|
253
|
+
if (value === '' || !value || typeof value !== 'string') {
|
|
254
|
+
return '';
|
|
218
255
|
}
|
|
219
256
|
|
|
220
257
|
var date = dayjs(value);
|
|
@@ -247,8 +284,46 @@ export var getDateDisplayString = function getDateDisplayString(value, format) {
|
|
|
247
284
|
return date.format('YYYY-MM-DD');
|
|
248
285
|
}
|
|
249
286
|
};
|
|
250
|
-
|
|
287
|
+
|
|
288
|
+
var _getMathRoundedDuration = function _getMathRoundedDuration(num, duration_format) {
|
|
289
|
+
var decimalDigits = DURATION_DECIMAL_DIGITS[duration_format];
|
|
290
|
+
|
|
291
|
+
if (decimalDigits < 1) {
|
|
292
|
+
return num;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
var ratio = Math.pow(10, decimalDigits);
|
|
296
|
+
return Math.round(num * ratio) / ratio;
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
var _getDurationDecimalSuffix = function _getDurationDecimalSuffix(duration_format, decimal) {
|
|
300
|
+
if (duration_format === DURATION_FORMATS_MAP.H_MM_SS_S) {
|
|
301
|
+
return decimal === 0 ? '.0' : '';
|
|
302
|
+
} else if (duration_format === DURATION_FORMATS_MAP.H_MM_SS_SS) {
|
|
303
|
+
if (decimal === 0) {
|
|
304
|
+
return '.00';
|
|
305
|
+
} else if (decimal < 10) {
|
|
306
|
+
return '0';
|
|
307
|
+
}
|
|
308
|
+
} else if (duration_format === DURATION_FORMATS_MAP.H_MM_SS_SSS) {
|
|
309
|
+
if (decimal === 0) {
|
|
310
|
+
return '.000';
|
|
311
|
+
} else if (decimal < 10) {
|
|
312
|
+
return '00';
|
|
313
|
+
} else if (decimal < 100) {
|
|
314
|
+
return '0';
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return '';
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
export var getDurationDisplayString = function getDurationDisplayString(value, data) {
|
|
251
322
|
if (!value && value !== 0) return '';
|
|
323
|
+
|
|
324
|
+
var _ref4 = data || {},
|
|
325
|
+
duration_format = _ref4.duration_format;
|
|
326
|
+
|
|
252
327
|
duration_format = duration_format || DURATION_FORMATS_MAP.H_MM;
|
|
253
328
|
|
|
254
329
|
if (DURATION_FORMATS.findIndex(function (format) {
|
|
@@ -268,7 +343,7 @@ export var getDurationDisplayString = function getDurationDisplayString(value, d
|
|
|
268
343
|
positiveValue = Math.round(positiveValue);
|
|
269
344
|
}
|
|
270
345
|
|
|
271
|
-
positiveValue =
|
|
346
|
+
positiveValue = _getMathRoundedDuration(positiveValue, duration_format);
|
|
272
347
|
var decimalParts = (positiveValue + '').split('.');
|
|
273
348
|
var decimalPartsLen = decimalParts.length;
|
|
274
349
|
var decimal = 0;
|
|
@@ -279,7 +354,9 @@ export var getDurationDisplayString = function getDurationDisplayString(value, d
|
|
|
279
354
|
}
|
|
280
355
|
|
|
281
356
|
var decimalDigits = DURATION_DECIMAL_DIGITS[duration_format];
|
|
282
|
-
|
|
357
|
+
|
|
358
|
+
var decimalSuffix = _getDurationDecimalSuffix(duration_format, decimal);
|
|
359
|
+
|
|
283
360
|
var displayString = value < 0 ? '-' : '';
|
|
284
361
|
var hours = parseInt(positiveValue / 3600);
|
|
285
362
|
var minutes = parseInt((positiveValue - hours * 3600) / 60);
|
|
@@ -290,50 +367,11 @@ export var getDurationDisplayString = function getDurationDisplayString(value, d
|
|
|
290
367
|
}
|
|
291
368
|
|
|
292
369
|
var seconds = Number.parseFloat((positiveValue - hours * 3600 - minutes * 60).toFixed(decimalDigits));
|
|
293
|
-
|
|
294
|
-
if (hours > 0) {
|
|
295
|
-
displayString += "".concat(hours, ":");
|
|
296
|
-
minutes = minutes > 9 ? minutes : "0".concat(minutes);
|
|
297
|
-
}
|
|
298
|
-
|
|
370
|
+
minutes = minutes > 9 ? minutes : "0".concat(minutes);
|
|
299
371
|
seconds = seconds > 9 ? seconds : "0".concat(seconds);
|
|
300
|
-
displayString += "".concat(minutes, ":").concat(seconds).concat(decimalSuffix);
|
|
372
|
+
displayString += "".concat(hours, ":").concat(minutes, ":").concat(seconds).concat(decimalSuffix);
|
|
301
373
|
return displayString;
|
|
302
374
|
};
|
|
303
|
-
|
|
304
|
-
var getMathRoundedDuration = function getMathRoundedDuration(num, duration_format) {
|
|
305
|
-
var decimalDigits = DURATION_DECIMAL_DIGITS[duration_format];
|
|
306
|
-
|
|
307
|
-
if (decimalDigits < 1) {
|
|
308
|
-
return num;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
var ratio = Math.pow(10, decimalDigits);
|
|
312
|
-
return Math.round(num * ratio) / ratio;
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
var getDurationDecimalSuffix = function getDurationDecimalSuffix(duration_format, decimal) {
|
|
316
|
-
if (duration_format === DURATION_FORMATS_MAP.H_MM_SS_S) {
|
|
317
|
-
return decimal === 0 ? '.0' : '';
|
|
318
|
-
} else if (duration_format === DURATION_FORMATS_MAP.H_MM_SS_SS) {
|
|
319
|
-
if (decimal === 0) {
|
|
320
|
-
return '.00';
|
|
321
|
-
} else if (decimal < 10) {
|
|
322
|
-
return '0';
|
|
323
|
-
}
|
|
324
|
-
} else if (duration_format === DURATION_FORMATS_MAP.H_MM_SS_SSS) {
|
|
325
|
-
if (decimal === 0) {
|
|
326
|
-
return '.000';
|
|
327
|
-
} else if (decimal < 10) {
|
|
328
|
-
return '00';
|
|
329
|
-
} else if (decimal < 100) {
|
|
330
|
-
return '0';
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return '';
|
|
335
|
-
};
|
|
336
|
-
|
|
337
375
|
export var getOptionName = function getOptionName(options, targetOptionID) {
|
|
338
376
|
if (!targetOptionID || !options || !Array.isArray(options)) return null;
|
|
339
377
|
var option = options.find(function (option) {
|
|
@@ -352,8 +390,8 @@ export var getMultipleOptionName = function getMultipleOptionName(options, cellV
|
|
|
352
390
|
}).join(', ');
|
|
353
391
|
};
|
|
354
392
|
export var getLongtextDisplayString = function getLongtextDisplayString(value) {
|
|
355
|
-
var
|
|
356
|
-
text =
|
|
393
|
+
var _ref5 = value || {},
|
|
394
|
+
text = _ref5.text;
|
|
357
395
|
|
|
358
396
|
if (!text) {
|
|
359
397
|
return null;
|
|
@@ -384,13 +422,13 @@ export var getCollaboratorsName = function getCollaboratorsName(collaborators, c
|
|
|
384
422
|
return null;
|
|
385
423
|
};
|
|
386
424
|
export var getGeolocationDisplayString = function getGeolocationDisplayString(value, columnData) {
|
|
387
|
-
var
|
|
388
|
-
geo_format =
|
|
425
|
+
var _ref6 = columnData || {},
|
|
426
|
+
geo_format = _ref6.geo_format;
|
|
389
427
|
|
|
390
428
|
var cellValue = value || {};
|
|
391
429
|
|
|
392
430
|
if (!value) {
|
|
393
|
-
return
|
|
431
|
+
return '';
|
|
394
432
|
}
|
|
395
433
|
|
|
396
434
|
if (geo_format === 'lng_lat' && value.lng && value.lat) {
|
|
@@ -417,9 +455,9 @@ export var getGeolocationDisplayString = function getGeolocationDisplayString(va
|
|
|
417
455
|
return "".concat(province || '').concat(city || '').concat(district || '').concat(detail || '');
|
|
418
456
|
};
|
|
419
457
|
export var getFormulaDisplayString = function getFormulaDisplayString(cellValue, columnData) {
|
|
420
|
-
var
|
|
421
|
-
|
|
422
|
-
collaborators =
|
|
458
|
+
var _ref7 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
459
|
+
_ref7$collaborators = _ref7.collaborators,
|
|
460
|
+
collaborators = _ref7$collaborators === void 0 ? [] : _ref7$collaborators;
|
|
423
461
|
|
|
424
462
|
if (!columnData) {
|
|
425
463
|
return null;
|
|
@@ -470,10 +508,10 @@ export var getFormulaDisplayString = function getFormulaDisplayString(cellValue,
|
|
|
470
508
|
return cellValue;
|
|
471
509
|
};
|
|
472
510
|
export function getCellValueDisplayString(cellValue, type) {
|
|
473
|
-
var
|
|
474
|
-
data =
|
|
475
|
-
|
|
476
|
-
collaborators =
|
|
511
|
+
var _ref8 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
512
|
+
data = _ref8.data,
|
|
513
|
+
_ref8$collaborators = _ref8.collaborators,
|
|
514
|
+
collaborators = _ref8$collaborators === void 0 ? [] : _ref8$collaborators;
|
|
477
515
|
|
|
478
516
|
var newData = data || {};
|
|
479
517
|
|
|
@@ -517,9 +555,9 @@ export function getCellValueDisplayString(cellValue, type) {
|
|
|
517
555
|
|
|
518
556
|
case CellType.DATE:
|
|
519
557
|
{
|
|
520
|
-
var
|
|
521
|
-
|
|
522
|
-
format =
|
|
558
|
+
var _ref9 = newData || {},
|
|
559
|
+
_ref9$format = _ref9.format,
|
|
560
|
+
format = _ref9$format === void 0 ? DEFAULT_DATE_FORMAT : _ref9$format;
|
|
523
561
|
|
|
524
562
|
return getDateDisplayString(cellValue, format);
|
|
525
563
|
}
|