@lemon-fe/components 1.4.8 → 1.4.9-alpha.0
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/data-grid/components/custom-panel/field-modal.js +15 -4
- package/es/data-grid/components/custom-panel/typings.d.ts +1 -0
- package/es/data-grid/index.js +2 -1
- package/es/data-grid/locale/en_US.js +2 -0
- package/es/data-grid/locale/locale.d.ts +2 -0
- package/es/data-grid/locale/zh_CN.js +2 -0
- package/package.json +2 -2
|
@@ -17,6 +17,7 @@ import { Checkbox, Form, Input, Modal, Select } from 'antd';
|
|
|
17
17
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
18
18
|
import FormLayout from "../../../form-layout";
|
|
19
19
|
import Icons from "../../../icons";
|
|
20
|
+
import InputNumber from "../../../input-number";
|
|
20
21
|
import { useLocaleReceiver } from "../../../locale-receiver";
|
|
21
22
|
import TipMark from "../../../tip-mark";
|
|
22
23
|
import { isCustomField, prefix } from "../../utils";
|
|
@@ -111,13 +112,16 @@ export default function FieldModal(props) {
|
|
|
111
112
|
name: '',
|
|
112
113
|
expression: '',
|
|
113
114
|
summary: false,
|
|
114
|
-
summaryType: 1
|
|
115
|
+
summaryType: 1,
|
|
116
|
+
decimalPlaces: 2
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
119
|
} else {
|
|
120
|
+
var _openProp$decimalPlac;
|
|
118
121
|
setOpen(true);
|
|
119
122
|
form.setFieldsValue(_objectSpread(_objectSpread({}, openProp), {}, {
|
|
120
|
-
expression: formatExpression(openProp.expression)
|
|
123
|
+
expression: formatExpression(openProp.expression),
|
|
124
|
+
decimalPlaces: (_openProp$decimalPlac = openProp.decimalPlaces) !== null && _openProp$decimalPlac !== void 0 ? _openProp$decimalPlac : 2
|
|
121
125
|
}));
|
|
122
126
|
}
|
|
123
127
|
} else {
|
|
@@ -185,10 +189,17 @@ export default function FieldModal(props) {
|
|
|
185
189
|
}, /*#__PURE__*/React.createElement(Input.TextArea, {
|
|
186
190
|
ref: ref,
|
|
187
191
|
maxLength: 300,
|
|
188
|
-
showCount: true,
|
|
189
192
|
style: {
|
|
190
193
|
height: 120
|
|
191
|
-
}
|
|
194
|
+
},
|
|
195
|
+
placeholder: fieldModal.customColumnExpressionPlaceholder
|
|
196
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
197
|
+
label: fieldModal.customColumnDecimalPlacesText,
|
|
198
|
+
name: "decimalPlaces"
|
|
199
|
+
}, /*#__PURE__*/React.createElement(InputNumber, {
|
|
200
|
+
min: 0,
|
|
201
|
+
max: 10,
|
|
202
|
+
precision: 0
|
|
192
203
|
})), enableSummary ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
193
204
|
label: " ",
|
|
194
205
|
name: "summary",
|
package/es/data-grid/index.js
CHANGED
|
@@ -1197,7 +1197,8 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
|
|
|
1197
1197
|
if (params.value !== undefined && params.value !== null) {
|
|
1198
1198
|
var val = params.value;
|
|
1199
1199
|
if (typeof val === 'number' || BigNumber.isBigNumber(val)) {
|
|
1200
|
-
|
|
1200
|
+
var _field$decimalPlaces;
|
|
1201
|
+
val = new BigNumber(val).toFixed((_field$decimalPlaces = field.decimalPlaces) !== null && _field$decimalPlaces !== void 0 ? _field$decimalPlaces : 2);
|
|
1201
1202
|
}
|
|
1202
1203
|
return "".concat(val).concat(expressionSuffix);
|
|
1203
1204
|
}
|
|
@@ -30,6 +30,8 @@ var locale = {
|
|
|
30
30
|
addCustomColumnText: 'Add Custom Column',
|
|
31
31
|
customColumnNameText: 'Name',
|
|
32
32
|
customColumnExpressionText: 'Expression',
|
|
33
|
+
customColumnExpressionPlaceholder: 'Custom Expression length limit of 300',
|
|
34
|
+
customColumnDecimalPlacesText: 'Decimal places',
|
|
33
35
|
summaryText: 'Summary or not',
|
|
34
36
|
summaryTypeText: 'Rule',
|
|
35
37
|
summaryTypeContentText: "\n <div>\n <p>1. The sum of custom column data values to get the total value</p>\n <p>\n 2. The total value is calculated based on the formula from the data source\n <br />\n Fields added in the formula are summed first, then the total is calculated based on the formula\n </p>\n </div>\n ",
|
|
@@ -9,6 +9,8 @@ export interface DataGridLocale {
|
|
|
9
9
|
addCustomColumnText: string;
|
|
10
10
|
customColumnNameText: string;
|
|
11
11
|
customColumnExpressionText: string;
|
|
12
|
+
customColumnExpressionPlaceholder: string;
|
|
13
|
+
customColumnDecimalPlacesText: string;
|
|
12
14
|
summaryText: string;
|
|
13
15
|
summaryTypeText: string;
|
|
14
16
|
summaryTypeContentText: string;
|
|
@@ -27,6 +27,8 @@ var locale = {
|
|
|
27
27
|
addCustomColumnText: '添加自定义列',
|
|
28
28
|
customColumnNameText: '自定义列名',
|
|
29
29
|
customColumnExpressionText: '自定义公式',
|
|
30
|
+
customColumnExpressionPlaceholder: '自定义公式长度上限300',
|
|
31
|
+
customColumnDecimalPlacesText: '小数位数',
|
|
30
32
|
summaryText: '是否统计合计',
|
|
31
33
|
summaryTypeText: '合计规则',
|
|
32
34
|
summaryTypeContentText: "\n <div>\n <p>1\u3001\u81EA\u5B9A\u4E49\u5217\u6570\u636E\u503C\u6C42\u548C\u5F97\u51FA\u5408\u8BA1\u503C</p>\n <p>\n 2\u3001\u6570\u636E\u6E90\u6839\u636E\u8BA1\u7B97\u516C\u5F0F\u5F97\u51FA\u5408\u8BA1\u503C\n <br />\n \u516C\u5F0F\u4E2D\u6DFB\u52A0\u7684\u5B57\u6BB5\u5148\u6C42\u548C\uFF0C\u518D\u6839\u636E\u8BA1\u7B97\u516C\u5F0F\u8BA1\u7B97\u51FA\u5408\u8BA1\n </p>\n </div>\n ",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9-alpha.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"registry": "https://registry.npmjs.org"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "29faa8aacec00efe7765a91c10f83cf302affca7"
|
|
62
62
|
}
|