dtable-ui-component 0.1.52 → 0.1.60
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/es/components/cell-editor/index.js +1 -1
- package/es/components/cell-formatter/formula-formatter.js +31 -7
- package/es/components/cell-formatter/multiple-select-formatter.js +9 -10
- package/es/components/cell-formatter/text-formatter.js +22 -2
- package/es/index.js +1 -1
- package/lib/components/cell-editor/index.js +2 -2
- package/lib/components/cell-formatter/formula-formatter.js +30 -9
- package/lib/components/cell-formatter/index.js +1 -1
- package/lib/components/cell-formatter/multiple-select-formatter.js +9 -10
- package/lib/components/cell-formatter/text-formatter.js +24 -2
- package/lib/constants/cell-types.js +1 -1
- package/lib/constants/index.js +1 -1
- package/lib/index.js +2 -2
- package/lib/lang/index.js +1 -1
- package/lib/utils/column-utils.js +1 -1
- package/lib/utils/editor-utils.js +1 -1
- package/lib/utils/number-precision.js +8 -8
- package/lib/utils/utils.js +1 -1
- package/lib/utils/value-format-utils.js +2 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import "../../css/cell-editor.css";
|
|
|
2
2
|
export { default as NumberEditor } from './number-editor';
|
|
3
3
|
export { default as TextEditor } from './text-editor';
|
|
4
4
|
export { default as CheckboxEditor } from './checkbox-editor';
|
|
5
|
-
export { default as
|
|
5
|
+
export { default as SingleSelectEditor } from './single-select-editor';
|
|
6
6
|
export { default as MultipleSelectEditor } from './multiple-select-editor';
|
|
7
7
|
export { default as CollaboratorEditor } from './collaborator-editor';
|
|
8
8
|
export { default as LinkEditor } from './link-editor';
|
|
@@ -57,12 +57,8 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
var Formatter = cellFormatterFactory.createFormatter(array_type);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
data: array_data
|
|
63
|
-
},
|
|
64
|
-
collaborators: collaborators
|
|
65
|
-
};
|
|
60
|
+
|
|
61
|
+
var formatterProps = _this.getFormatterProps(array_type, array_data, collaborators);
|
|
66
62
|
|
|
67
63
|
if (isArrayFormalColumn(array_type)) {
|
|
68
64
|
formatterProps.value = value;
|
|
@@ -79,7 +75,7 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
79
75
|
|
|
80
76
|
var contentItemClassName = "formula-formatter-content-item ".concat(_isSimpleCellFormatterColumn ? 'simple-cell-formatter' : '');
|
|
81
77
|
return /*#__PURE__*/React.createElement("div", {
|
|
82
|
-
className: "formula-formatter
|
|
78
|
+
className: "dtable-ui formula-formatter multiple"
|
|
83
79
|
}, cellValue.map(function (v, index) {
|
|
84
80
|
formatterProps.value = v;
|
|
85
81
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -89,6 +85,34 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
89
85
|
}));
|
|
90
86
|
};
|
|
91
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
|
+
|
|
92
116
|
return _this;
|
|
93
117
|
}
|
|
94
118
|
|
|
@@ -26,17 +26,16 @@ var MultipleSelectFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
26
26
|
var _this$props = _this.props,
|
|
27
27
|
value = _this$props.value,
|
|
28
28
|
options = _this$props.options;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
if (!Array.isArray(value) || !Array.isArray(options)) return [];
|
|
30
|
+
var selectedOptions = options.filter(function (option) {
|
|
31
|
+
return value.includes(option.id);
|
|
32
|
+
});
|
|
33
|
+
if (selectedOptions.length === 0) return [];
|
|
34
|
+
return selectedOptions.map(function (option) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(SelectItem, {
|
|
36
|
+
key: "multiple-".concat(option.id),
|
|
37
|
+
option: option
|
|
32
38
|
});
|
|
33
|
-
|
|
34
|
-
if (option) {
|
|
35
|
-
return /*#__PURE__*/React.createElement(SelectItem, {
|
|
36
|
-
key: item,
|
|
37
|
-
option: option
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
39
|
});
|
|
41
40
|
};
|
|
42
41
|
|
|
@@ -11,9 +11,29 @@ var TextFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
11
11
|
var _super = _createSuper(TextFormatter);
|
|
12
12
|
|
|
13
13
|
function TextFormatter() {
|
|
14
|
+
var _this;
|
|
15
|
+
|
|
14
16
|
_classCallCheck(this, TextFormatter);
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
|
+
args[_key] = arguments[_key];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
23
|
+
|
|
24
|
+
_this.getFormattedValue = function (val) {
|
|
25
|
+
if (typeof val === 'object') {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (Object.prototype.toString.call(val) === '[object Boolean]') {
|
|
30
|
+
return val + '';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return val;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return _this;
|
|
17
37
|
}
|
|
18
38
|
|
|
19
39
|
_createClass(TextFormatter, [{
|
|
@@ -25,7 +45,7 @@ var TextFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
25
45
|
var classname = cn('dtable-ui cell-formatter-container text-formatter', containerClassName);
|
|
26
46
|
return /*#__PURE__*/React.createElement("div", {
|
|
27
47
|
className: classname
|
|
28
|
-
}, value);
|
|
48
|
+
}, this.getFormattedValue(value));
|
|
29
49
|
}
|
|
30
50
|
}]);
|
|
31
51
|
|
package/es/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export { setLocale } from './lang';
|
|
|
3
3
|
export { getDateDisplayString, getNumberDisplayString, formatStringToNumber, formatNumberString } from './utils/value-format-utils';
|
|
4
4
|
export { default as Loading } from './components/loading';
|
|
5
5
|
export { TextFormatter, NumberFormatter, CheckboxFormatter, DateFormatter, SingleSelectFormatter, MultipleSelectFormatter, CollaboratorFormatter, ImageFormatter, FileFormatter, LongTextFormatter, GeolocationFormatter, LinkFormatter, FormulaFormatter, CTimeFormatter, CreatorFormatter, LastModifierFormatter, MTimeFormatter, AutoNumberFormatter, UrlFormatter, EmailFormatter, DurationFormatter, RateFormatter, ButtonFormatter, FileItemFormatter, ImagePreviewerLightbox, CollaboratorItem } from './components/cell-formatter';
|
|
6
|
-
export { TextEditor, NumberEditor, CheckboxEditor,
|
|
6
|
+
export { TextEditor, NumberEditor, CheckboxEditor, SingleSelectEditor, CollaboratorEditor, DateEditor, LinkEditor } from './components/cell-editor';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports.
|
|
6
|
+
exports.TextEditor = exports.SingleSelectEditor = exports.NumberEditor = exports.MultipleSelectEditor = exports.LinkEditor = exports.DateEditor = exports.CollaboratorEditor = exports.CheckboxEditor = void 0;
|
|
7
7
|
|
|
8
8
|
require("../../css/cell-editor.css");
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@ exports.CheckboxEditor = _checkboxEditor.default;
|
|
|
21
21
|
|
|
22
22
|
var _singleSelectEditor = _interopRequireDefault(require("./single-select-editor"));
|
|
23
23
|
|
|
24
|
-
exports.
|
|
24
|
+
exports.SingleSelectEditor = _singleSelectEditor.default;
|
|
25
25
|
|
|
26
26
|
var _multipleSelectEditor = _interopRequireDefault(require("./multiple-select-editor"));
|
|
27
27
|
|
|
@@ -43,8 +43,7 @@ var propTypes = {
|
|
|
43
43
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.object, _propTypes.default.bool]),
|
|
44
44
|
column: _propTypes.default.Object,
|
|
45
45
|
containerClassName: _propTypes.default.string,
|
|
46
|
-
collaborators: _propTypes.default.array
|
|
47
|
-
tables: _propTypes.default.array
|
|
46
|
+
collaborators: _propTypes.default.array
|
|
48
47
|
};
|
|
49
48
|
|
|
50
49
|
var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
@@ -86,12 +85,7 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
86
85
|
|
|
87
86
|
var Formatter = _cellFormatterFactory.default.createFormatter(array_type);
|
|
88
87
|
|
|
89
|
-
var formatterProps =
|
|
90
|
-
column: {
|
|
91
|
-
data: array_data
|
|
92
|
-
},
|
|
93
|
-
collaborators: collaborators
|
|
94
|
-
};
|
|
88
|
+
var formatterProps = _this.getFormatterProps(array_type, array_data, collaborators);
|
|
95
89
|
|
|
96
90
|
if ((0, _columnUtils.isArrayFormalColumn)(array_type)) {
|
|
97
91
|
formatterProps.value = value;
|
|
@@ -108,7 +102,7 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
108
102
|
|
|
109
103
|
var contentItemClassName = "formula-formatter-content-item " + (_isSimpleCellFormatterColumn ? 'simple-cell-formatter' : '');
|
|
110
104
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
111
|
-
className: "formula-formatter
|
|
105
|
+
className: "dtable-ui formula-formatter multiple"
|
|
112
106
|
}, cellValue.map(function (v, index) {
|
|
113
107
|
formatterProps.value = v;
|
|
114
108
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -117,6 +111,33 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
117
111
|
}, _this.createColumnFormatter(Formatter, formatterProps));
|
|
118
112
|
}));
|
|
119
113
|
});
|
|
114
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFormatterProps", function (array_type, array_data, collaborators) {
|
|
115
|
+
switch (array_type) {
|
|
116
|
+
case CellType.DURATION:
|
|
117
|
+
{
|
|
118
|
+
var duration_format = array_data.duration_format;
|
|
119
|
+
return {
|
|
120
|
+
format: duration_format
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
case CellType.NUMBER:
|
|
125
|
+
case CellType.RATE:
|
|
126
|
+
case CellType.GEOLOCATION:
|
|
127
|
+
{
|
|
128
|
+
return {
|
|
129
|
+
data: array_data
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
default:
|
|
134
|
+
{
|
|
135
|
+
return _objectSpread(_objectSpread({}, array_data), {}, {
|
|
136
|
+
collaborators: collaborators
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
});
|
|
120
141
|
return _this;
|
|
121
142
|
}
|
|
122
143
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports.
|
|
6
|
+
exports.UrlFormatter = exports.TextFormatter = exports.SingleSelectFormatter = exports.RateFormatter = exports.NumberFormatter = exports.MultipleSelectFormatter = exports.MTimeFormatter = exports.LongTextFormatter = exports.LinkFormatter = exports.LastModifierFormatter = exports.ImagePreviewerLightbox = exports.ImageFormatter = exports.GeolocationFormatter = exports.FormulaFormatter = exports.FileItemFormatter = exports.FileFormatter = exports.EmailFormatter = exports.DurationFormatter = exports.DateFormatter = exports.CreatorFormatter = exports.CollaboratorItem = exports.CollaboratorFormatter = exports.CheckboxFormatter = exports.CTimeFormatter = exports.ButtonFormatter = exports.AutoNumberFormatter = void 0;
|
|
7
7
|
|
|
8
8
|
require("../../css/cell-formatter.css");
|
|
9
9
|
|
|
@@ -41,17 +41,16 @@ var MultipleSelectFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
41
41
|
var _this$props = _this.props,
|
|
42
42
|
value = _this$props.value,
|
|
43
43
|
options = _this$props.options;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
if (!Array.isArray(value) || !Array.isArray(options)) return [];
|
|
45
|
+
var selectedOptions = options.filter(function (option) {
|
|
46
|
+
return value.includes(option.id);
|
|
47
|
+
});
|
|
48
|
+
if (selectedOptions.length === 0) return [];
|
|
49
|
+
return selectedOptions.map(function (option) {
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_selectItem.default, {
|
|
51
|
+
key: "multiple-" + option.id,
|
|
52
|
+
option: option
|
|
47
53
|
});
|
|
48
|
-
|
|
49
|
-
if (option) {
|
|
50
|
-
return /*#__PURE__*/_react.default.createElement(_selectItem.default, {
|
|
51
|
-
key: item,
|
|
52
|
-
option: option
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
54
|
});
|
|
56
55
|
});
|
|
57
56
|
return _this;
|
|
@@ -5,8 +5,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
+
|
|
8
10
|
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
11
|
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
10
14
|
var _react = _interopRequireDefault(require("react"));
|
|
11
15
|
|
|
12
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -22,7 +26,25 @@ var TextFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
22
26
|
(0, _inheritsLoose2.default)(TextFormatter, _React$Component);
|
|
23
27
|
|
|
24
28
|
function TextFormatter() {
|
|
25
|
-
|
|
29
|
+
var _this;
|
|
30
|
+
|
|
31
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
|
+
args[_key] = arguments[_key];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
36
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFormattedValue", function (val) {
|
|
37
|
+
if (typeof val === 'object') {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (Object.prototype.toString.call(val) === '[object Boolean]') {
|
|
42
|
+
return val + '';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return val;
|
|
46
|
+
});
|
|
47
|
+
return _this;
|
|
26
48
|
}
|
|
27
49
|
|
|
28
50
|
var _proto = TextFormatter.prototype;
|
|
@@ -34,7 +56,7 @@ var TextFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
34
56
|
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container text-formatter', containerClassName);
|
|
35
57
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
58
|
className: classname
|
|
37
|
-
}, value);
|
|
59
|
+
}, this.getFormattedValue(value));
|
|
38
60
|
};
|
|
39
61
|
|
|
40
62
|
return TextFormatter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.URL = exports.TEXT = exports.SINGLE_SELECT = exports.RATE = exports.NUMBER = exports.MULTIPLE_SELECT = exports.MTIME = exports.LONG_TEXT = exports.LINK_FORMULA = exports.LINK = exports.LAST_MODIFIER = exports.IMAGE = exports.GEOLOCATION = exports.FORMULA = exports.FILE = exports.EMAIL = exports.DURATION = exports.DEFAULT = exports.DATE = exports.CTIME = exports.CREATOR = exports.COLLABORATOR = exports.CHECKBOX = exports.BUTTON = exports.AUTO_NUMBER = void 0;
|
|
5
5
|
var DEFAULT = 'default';
|
|
6
6
|
exports.DEFAULT = DEFAULT;
|
|
7
7
|
var NUMBER = 'number';
|
package/lib/constants/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.SIMPLE_CELL_FORMULA_RESULTS = exports.SIMPLE_CELL_COLUMNS = exports.NUMBER_TYPES = exports.FORMULA_RESULT_TYPE = exports.DURATION_ZERO_DISPLAY = exports.DURATION_FORMATS_MAP = exports.DURATION_FORMATS = exports.DURATION_DECIMAL_DIGITS = exports.DEFAULT_NUMBER_FORMAT = exports.DEFAULT_DATE_FORMAT = exports.DATE_TYPES = exports.COLLABORATOR_COLUMN_TYPES = exports.ARRAY_FORMAL_COLUMNS_TYPES = exports.ARRAY_FORMAL_COLUMNS = void 0;
|
|
5
5
|
|
|
6
6
|
var CellType = _interopRequireWildcard(require("./cell-types"));
|
|
7
7
|
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports.
|
|
6
|
+
exports.toaster = exports.setLocale = exports.getNumberDisplayString = exports.getDateDisplayString = exports.formatStringToNumber = exports.formatNumberString = exports.UrlFormatter = exports.TextFormatter = exports.TextEditor = exports.SingleSelectFormatter = exports.SingleSelectEditor = exports.RateFormatter = exports.NumberFormatter = exports.NumberEditor = exports.MultipleSelectFormatter = exports.MTimeFormatter = exports.LongTextFormatter = exports.Loading = exports.LinkFormatter = exports.LinkEditor = exports.LastModifierFormatter = exports.ImagePreviewerLightbox = exports.ImageFormatter = exports.GeolocationFormatter = exports.FormulaFormatter = exports.FileItemFormatter = exports.FileFormatter = exports.EmailFormatter = exports.DurationFormatter = exports.DateFormatter = exports.DateEditor = exports.CreatorFormatter = exports.CollaboratorItem = exports.CollaboratorFormatter = exports.CollaboratorEditor = exports.CheckboxFormatter = exports.CheckboxEditor = exports.CTimeFormatter = exports.ButtonFormatter = exports.AutoNumberFormatter = void 0;
|
|
7
7
|
|
|
8
8
|
var _toast = _interopRequireDefault(require("./components/toast"));
|
|
9
9
|
|
|
@@ -58,7 +58,7 @@ var _cellEditor = require("./components/cell-editor");
|
|
|
58
58
|
exports.TextEditor = _cellEditor.TextEditor;
|
|
59
59
|
exports.NumberEditor = _cellEditor.NumberEditor;
|
|
60
60
|
exports.CheckboxEditor = _cellEditor.CheckboxEditor;
|
|
61
|
-
exports.
|
|
61
|
+
exports.SingleSelectEditor = _cellEditor.SingleSelectEditor;
|
|
62
62
|
exports.CollaboratorEditor = _cellEditor.CollaboratorEditor;
|
|
63
63
|
exports.DateEditor = _cellEditor.DateEditor;
|
|
64
64
|
exports.LinkEditor = _cellEditor.LinkEditor;
|
package/lib/lang/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports.setLocale = setLocale;
|
|
7
6
|
exports.getLocale = getLocale;
|
|
7
|
+
exports.setLocale = setLocale;
|
|
8
8
|
exports.substitute = substitute;
|
|
9
9
|
|
|
10
10
|
var _de = _interopRequireDefault(require("../locals/de"));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
5
|
-
exports.plus = plus;
|
|
6
|
-
exports.minus = minus;
|
|
7
|
-
exports.times = times;
|
|
8
|
-
exports.divide = divide;
|
|
9
|
-
exports.round = round;
|
|
4
|
+
exports.default = void 0;
|
|
10
5
|
exports.digitLength = digitLength;
|
|
11
|
-
exports.
|
|
6
|
+
exports.divide = divide;
|
|
12
7
|
exports.enableBoundaryChecking = enableBoundaryChecking;
|
|
13
|
-
exports.
|
|
8
|
+
exports.float2Fixed = float2Fixed;
|
|
9
|
+
exports.minus = minus;
|
|
10
|
+
exports.plus = plus;
|
|
11
|
+
exports.round = round;
|
|
12
|
+
exports.strip = strip;
|
|
13
|
+
exports.times = times;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @desc Solve the problem of floating calculation, avoid multiple digits after the decimal point and loss of calculation accuracy.
|
package/lib/utils/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.throttle = exports.isInternalImg = exports.isFunction = exports.getImageThumbnailUrl = exports.getFileIconUrl = exports.debounce = exports.checkSVGImage = void 0;
|
|
5
5
|
var FILEEXT_ICON_MAP = {
|
|
6
6
|
// text file
|
|
7
7
|
md: "txt.png",
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
+
exports.formatStringToNumber = exports.formatNumberString = void 0;
|
|
6
7
|
exports.getCellValueDisplayString = getCellValueDisplayString;
|
|
7
|
-
exports.
|
|
8
|
+
exports.getOptionName = exports.getNumberDisplayString = exports.getMultipleOptionName = exports.getLongtextDisplayString = exports.getGeolocationDisplayString = exports.getFormulaDisplayString = exports.getDurationDisplayString = exports.getDateDisplayString = exports.getCollaboratorsName = void 0;
|
|
8
9
|
|
|
9
10
|
var _moment = _interopRequireDefault(require("moment"));
|
|
10
11
|
|