dtable-ui-component 0.1.100 → 0.1.101
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.
|
@@ -122,6 +122,11 @@ var SimpleLongTextFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
_createClass(SimpleLongTextFormatter, [{
|
|
125
|
+
key: "componentWillUnmount",
|
|
126
|
+
value: function componentWillUnmount() {
|
|
127
|
+
this.clearTimer();
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
125
130
|
key: "render",
|
|
126
131
|
value: function render() {
|
|
127
132
|
var _this2 = this;
|
package/lib/constants/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-case-declarations */
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import NP from './number-precision';
|
|
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';
|
|
4
|
+
import { CellType, NUMBER_TYPES, 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
5
|
import { getFloatNumber } from './utils';
|
|
6
6
|
NP.enableBoundaryChecking(false);
|
|
7
7
|
var _separatorMap = {
|
|
@@ -126,27 +126,27 @@ export var getNumberDisplayString = function getNumberDisplayString(value, forma
|
|
|
126
126
|
format = _ref2$format === void 0 ? DEFAULT_NUMBER_FORMAT : _ref2$format;
|
|
127
127
|
|
|
128
128
|
switch (format) {
|
|
129
|
-
case
|
|
129
|
+
case NUMBER_TYPES.NUMBER:
|
|
130
130
|
{
|
|
131
131
|
return _toThousands(value, false, formatData);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
case
|
|
134
|
+
case NUMBER_TYPES.PERCENT:
|
|
135
135
|
{
|
|
136
136
|
return "".concat(_toThousands(Number.parseFloat((value * 100).toFixed(8)), false, formatData), "%");
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
case
|
|
139
|
+
case NUMBER_TYPES.YUAN:
|
|
140
140
|
{
|
|
141
141
|
return "\uFFE5".concat(_toThousands(value, true, formatData));
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
case
|
|
144
|
+
case NUMBER_TYPES.DOLLAR:
|
|
145
145
|
{
|
|
146
146
|
return "$".concat(_toThousands(value, true, formatData));
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
case
|
|
149
|
+
case NUMBER_TYPES.EURO:
|
|
150
150
|
{
|
|
151
151
|
return "\u20AC".concat(_toThousands(value, true, formatData));
|
|
152
152
|
}
|
|
@@ -156,7 +156,7 @@ export var getNumberDisplayString = function getNumberDisplayString(value, forma
|
|
|
156
156
|
return getDurationDisplayString(value, formatData);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
case
|
|
159
|
+
case NUMBER_TYPES.CUSTOM_CURRENCY:
|
|
160
160
|
{
|
|
161
161
|
if (formatData.currency_symbol_position === 'after') {
|
|
162
162
|
return "".concat(_toThousands(value, true, formatData)).concat(formatData.currency_symbol || '');
|
|
@@ -213,32 +213,33 @@ export var replaceNumberNotAllowInput = function replaceNumberNotAllowInput(valu
|
|
|
213
213
|
value = value.replace(/。/g, '.');
|
|
214
214
|
|
|
215
215
|
switch (format) {
|
|
216
|
-
case
|
|
216
|
+
case NUMBER_TYPES.NUMBER:
|
|
217
|
+
case NUMBER_TYPES.NUMBER_WITH_COMMAS:
|
|
217
218
|
{
|
|
218
219
|
return value.replace(/[^.-\d,]/g, '');
|
|
219
220
|
}
|
|
220
221
|
|
|
221
|
-
case
|
|
222
|
+
case NUMBER_TYPES.PERCENT:
|
|
222
223
|
{
|
|
223
224
|
return value.replace(/[^.-\d,%]/g, '');
|
|
224
225
|
}
|
|
225
226
|
|
|
226
|
-
case
|
|
227
|
+
case NUMBER_TYPES.YUAN:
|
|
227
228
|
{
|
|
228
229
|
return value.replace(/[^.-\d¥¥,]/g, '');
|
|
229
230
|
}
|
|
230
231
|
|
|
231
|
-
case
|
|
232
|
+
case NUMBER_TYPES.DOLLAR:
|
|
232
233
|
{
|
|
233
234
|
return value.replace(/[^.-\d$,]/g, '');
|
|
234
235
|
}
|
|
235
236
|
|
|
236
|
-
case
|
|
237
|
+
case NUMBER_TYPES.EURO:
|
|
237
238
|
{
|
|
238
239
|
return value.replace(/[^.-\d€,]/g, '');
|
|
239
240
|
}
|
|
240
241
|
|
|
241
|
-
case
|
|
242
|
+
case NUMBER_TYPES.CUSTOM_CURRENCY:
|
|
242
243
|
{
|
|
243
244
|
// eslint-disable-next-line
|
|
244
245
|
var reg = new RegExp('[^.-\d' + currency_symbol + ',]', 'g');
|
|
@@ -250,7 +251,7 @@ export var replaceNumberNotAllowInput = function replaceNumberNotAllowInput(valu
|
|
|
250
251
|
}
|
|
251
252
|
};
|
|
252
253
|
export var getDateDisplayString = function getDateDisplayString(value, format) {
|
|
253
|
-
if (
|
|
254
|
+
if (!value || typeof value !== 'string') {
|
|
254
255
|
return '';
|
|
255
256
|
}
|
|
256
257
|
|