@lemon-fe/components 1.6.4 → 1.6.6
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/component-configure/index.d.ts +2 -0
- package/es/data-grid/cell-editors/number.d.ts +6 -2
- package/es/data-grid/cell-editors/number.js +65 -49
- package/es/data-grid/cell-editors/row.js +7 -4
- package/es/data-grid/components/custom-panel/field-modal.d.ts +1 -0
- package/es/data-grid/components/custom-panel/field-modal.js +9 -3
- package/es/data-grid/components/custom-panel/index.d.ts +1 -0
- package/es/data-grid/components/custom-panel/index.js +4 -2
- package/es/data-grid/components/custom-panel/typings.d.ts +1 -0
- package/es/data-grid/index.js +2 -1
- package/es/data-grid/index.less +16 -0
- package/es/data-grid/locale/en_US.js +2 -1
- package/es/data-grid/locale/id.js +2 -1
- package/es/data-grid/locale/locale.d.ts +1 -0
- package/es/data-grid/locale/vi.js +2 -1
- package/es/data-grid/locale/zh_CN.js +2 -1
- package/es/data-grid/locale/zh_Hant_HK.js +2 -1
- package/es/data-grid/typings.d.ts +4 -0
- package/es/formula-calculator/evaluate.d.ts +10 -0
- package/es/formula-calculator/evaluate.js +217 -0
- package/es/formula-calculator/index.d.ts +24 -0
- package/es/formula-calculator/index.js +386 -0
- package/es/formula-calculator/index.less +88 -0
- package/es/index.d.ts +1 -1
- package/es/input-number/index.d.ts +11 -7
- package/es/input-number/index.js +55 -8
- package/es/input-number/index.less +36 -1
- package/es/locale/en_US.js +7 -1
- package/es/locale/id.js +7 -1
- package/es/locale/locale.d.ts +6 -0
- package/es/locale/vi.js +7 -1
- package/es/locale/zh_CN.js +7 -1
- package/es/locale/zh_Hant_HK.js +7 -1
- package/es/styles/index.less +1 -0
- package/package.json +3 -3
|
@@ -3,6 +3,7 @@ import type { ActionsProps } from '../actions';
|
|
|
3
3
|
import type { DataGridProps } from '../data-grid/typings';
|
|
4
4
|
import type { DurationPickerProps } from '../duration-picker';
|
|
5
5
|
import type { FilterProps } from '../filter/typings';
|
|
6
|
+
import type { FormulaCalculatorConfig } from '../formula-calculator';
|
|
6
7
|
import type { SelectViewProps } from '../select-view';
|
|
7
8
|
declare type PropsGetter<T> = ((props: T) => T) | Partial<T>;
|
|
8
9
|
export interface ComponentConfigureContextProps {
|
|
@@ -11,6 +12,7 @@ export interface ComponentConfigureContextProps {
|
|
|
11
12
|
Actions?: PropsGetter<ActionsProps>;
|
|
12
13
|
SelectView?: PropsGetter<SelectViewProps<unknown, unknown>>;
|
|
13
14
|
DurationPicker?: PropsGetter<DurationPickerProps>;
|
|
15
|
+
FormulaCalculator?: PropsGetter<FormulaCalculatorConfig>;
|
|
14
16
|
}
|
|
15
17
|
export declare const ComponentConfigureContext: import("react").Context<ComponentConfigureContextProps>;
|
|
16
18
|
export declare const ComponentConfigureProvider: import("react").Provider<ComponentConfigureContextProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { FormulaCalculatorConfig } from '../../formula-calculator';
|
|
2
3
|
import type { ICellEditorParams } from 'ag-grid-community';
|
|
3
4
|
import type { ICellEditorReactComp } from 'ag-grid-react';
|
|
4
5
|
export interface NumberEditorParams<TData = any> {
|
|
@@ -12,14 +13,17 @@ export interface NumberEditorParams<TData = any> {
|
|
|
12
13
|
*/
|
|
13
14
|
max?: number;
|
|
14
15
|
/**
|
|
15
|
-
* @description
|
|
16
|
-
* @default 0
|
|
16
|
+
* @description 清空后提交的值。设为 null 允许提交空值,省略时取消空值提交。
|
|
17
17
|
*/
|
|
18
18
|
emptyValue?: number | null;
|
|
19
19
|
/**
|
|
20
20
|
* @description 精度
|
|
21
21
|
*/
|
|
22
22
|
precision?: number;
|
|
23
|
+
/** 是否启用计算器,未设置时继承全局 FormulaCalculator.enabled */
|
|
24
|
+
calculator?: boolean;
|
|
25
|
+
/** 计算器弹窗位置,未设置时继承全局配置,默认 bottomRight */
|
|
26
|
+
calculatorPlacement?: FormulaCalculatorConfig['placement'];
|
|
23
27
|
/**
|
|
24
28
|
* 可以在不使用min或者max的情况下,进行数值校验,可以用于错误提示
|
|
25
29
|
* @param newValue
|
|
@@ -4,8 +4,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useEffect,
|
|
7
|
+
import React, { useEffect, useRef } from 'react';
|
|
8
8
|
import { forwardRef, useImperativeHandle, useState } from 'react';
|
|
9
|
+
import { useFormulaCalculator } from "../../formula-calculator";
|
|
9
10
|
import { editorPrefixClass, navigateCell } from "./utils";
|
|
10
11
|
import EditorWrapper from "./wrapper";
|
|
11
12
|
export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
|
|
@@ -16,69 +17,74 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
|
|
|
16
17
|
emptyValue = props.emptyValue,
|
|
17
18
|
disabled = props.disabled,
|
|
18
19
|
precision = props.precision,
|
|
20
|
+
calculatorEnabled = props.calculator,
|
|
21
|
+
calculatorPlacement = props.calculatorPlacement,
|
|
19
22
|
_isCancelAfterEnd = props.isCancelAfterEnd,
|
|
20
23
|
data = props.data;
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
var clearing = props.eventKey === 'Backspace';
|
|
25
|
+
var typedDigit = props.charPress && /^[0-9]$/.test(props.charPress) ? props.charPress : null;
|
|
26
|
+
var _useState = useState(function () {
|
|
27
|
+
var _props$value;
|
|
28
|
+
if (clearing) {
|
|
29
|
+
return '';
|
|
24
30
|
}
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
31
|
+
if (typedDigit !== null) {
|
|
32
|
+
return typedDigit;
|
|
27
33
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
shouldSelect = _useMemo2[1];
|
|
33
|
-
var _useState = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null),
|
|
34
|
+
var initialText = String((_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : '');
|
|
35
|
+
var initialNumber = Number(initialText);
|
|
36
|
+
return initialText && Number.isFinite(initialNumber) ? String(initialNumber) : '';
|
|
37
|
+
}),
|
|
34
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
39
|
value = _useState2[0],
|
|
36
40
|
setValue = _useState2[1];
|
|
41
|
+
var shouldSelect = useRef(!clearing && typedDigit === null);
|
|
37
42
|
var elm = useRef(null);
|
|
38
|
-
var dirty = useRef(!!props.charPress);
|
|
43
|
+
var dirty = useRef(clearing || !!props.charPress);
|
|
39
44
|
useEffect(function () {
|
|
40
45
|
if (elm.current === null) {
|
|
41
46
|
return;
|
|
42
47
|
}
|
|
43
48
|
var inputElm = elm.current;
|
|
44
49
|
inputElm.focus();
|
|
45
|
-
if (shouldSelect) {
|
|
50
|
+
if (shouldSelect.current) {
|
|
46
51
|
inputElm.select();
|
|
47
52
|
}
|
|
48
53
|
var handleWheel = function handleWheel(e) {
|
|
49
54
|
e.preventDefault();
|
|
50
55
|
};
|
|
51
|
-
inputElm.addEventListener('wheel', handleWheel
|
|
56
|
+
inputElm.addEventListener('wheel', handleWheel, {
|
|
57
|
+
passive: false
|
|
58
|
+
});
|
|
52
59
|
return function () {
|
|
53
60
|
inputElm.removeEventListener('wheel', handleWheel);
|
|
54
61
|
};
|
|
55
62
|
}, []);
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
val = Math.round(val * Math.pow(10, precision)) / Math.pow(10, precision);
|
|
64
|
-
}
|
|
63
|
+
var getFormattedValue = function getFormattedValue() {
|
|
64
|
+
if (value === '') {
|
|
65
|
+
return emptyValue !== null && emptyValue !== void 0 ? emptyValue : null;
|
|
66
|
+
}
|
|
67
|
+
var numericValue = Number(value);
|
|
68
|
+
if (!Number.isFinite(numericValue)) {
|
|
69
|
+
return null;
|
|
65
70
|
}
|
|
66
|
-
return
|
|
71
|
+
return precision === undefined ? numericValue : Math.round(numericValue * Math.pow(10, precision)) / Math.pow(10, precision);
|
|
67
72
|
};
|
|
68
73
|
useImperativeHandle(ref, function () {
|
|
69
74
|
return {
|
|
70
75
|
getValue: function getValue() {
|
|
71
|
-
return
|
|
76
|
+
return getFormattedValue();
|
|
72
77
|
},
|
|
73
78
|
isCancelAfterEnd: function isCancelAfterEnd() {
|
|
74
|
-
|
|
79
|
+
var _elm$current;
|
|
80
|
+
if (!dirty.current || (_elm$current = elm.current) !== null && _elm$current !== void 0 && _elm$current.validity.badInput) {
|
|
75
81
|
return true;
|
|
76
82
|
}
|
|
77
|
-
var val =
|
|
78
|
-
if (
|
|
83
|
+
var val = getFormattedValue();
|
|
84
|
+
if (value === '' && emptyValue === null) {
|
|
79
85
|
return false;
|
|
80
86
|
}
|
|
81
|
-
if (val === null || val
|
|
87
|
+
if (val === null || !(val >= min && val <= max)) {
|
|
82
88
|
return true;
|
|
83
89
|
}
|
|
84
90
|
if (_isCancelAfterEnd !== undefined) {
|
|
@@ -88,23 +94,34 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
|
|
|
88
94
|
}
|
|
89
95
|
};
|
|
90
96
|
});
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
var updateDraft = function updateDraft(nextValue) {
|
|
98
|
+
dirty.current = true;
|
|
99
|
+
setValue(nextValue);
|
|
100
|
+
};
|
|
101
|
+
var calculator = useFormulaCalculator({
|
|
102
|
+
inputRef: elm,
|
|
103
|
+
onApply: function onApply(result) {
|
|
104
|
+
if (result !== value && Number.isFinite(Number(result))) {
|
|
105
|
+
updateDraft(result);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
enabled: calculatorEnabled,
|
|
109
|
+
placement: calculatorPlacement,
|
|
110
|
+
disabled: disabled,
|
|
111
|
+
gridEditor: true
|
|
112
|
+
});
|
|
113
|
+
return /*#__PURE__*/React.createElement(EditorWrapper, null, /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: editorPrefixClass('number'),
|
|
115
|
+
"data-calculator-open": calculator.visible || undefined
|
|
116
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
104
117
|
type: "number",
|
|
105
|
-
onKeyDown: function onKeyDown(
|
|
118
|
+
onKeyDown: function onKeyDown(event) {
|
|
119
|
+
var _calculator$handleInp;
|
|
120
|
+
if ((_calculator$handleInp = calculator.handleInputKeyDown) !== null && _calculator$handleInp !== void 0 && _calculator$handleInp.call(calculator, event)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
106
123
|
navigateCell({
|
|
107
|
-
event:
|
|
124
|
+
event: event.nativeEvent,
|
|
108
125
|
api: props.api,
|
|
109
126
|
onKeyDown: props.onKeyDown
|
|
110
127
|
});
|
|
@@ -112,10 +129,9 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
|
|
|
112
129
|
disabled: disabled,
|
|
113
130
|
className: editorPrefixClass('text'),
|
|
114
131
|
ref: elm,
|
|
115
|
-
value:
|
|
132
|
+
value: value,
|
|
116
133
|
onChange: function onChange(event) {
|
|
117
|
-
|
|
118
|
-
setValue(event.target.value);
|
|
134
|
+
return updateDraft(event.currentTarget.value);
|
|
119
135
|
}
|
|
120
|
-
}));
|
|
136
|
+
}), calculator.button));
|
|
121
137
|
});
|
|
@@ -13,8 +13,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
13
13
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
14
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
15
15
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
-
import React, {
|
|
16
|
+
import React, { useEffect, useRef } from 'react';
|
|
17
17
|
import { forwardRef, useImperativeHandle, useState } from 'react';
|
|
18
|
+
import { FormulaCalculatorGridEditorContext } from "../../formula-calculator";
|
|
18
19
|
import { useGridStore } from "../hooks";
|
|
19
20
|
import EditorWrapper from "./wrapper";
|
|
20
21
|
import { get } from 'lodash';
|
|
@@ -51,12 +52,12 @@ export default /*#__PURE__*/forwardRef(function RowEditor(props, ref) {
|
|
|
51
52
|
var context = useGridStore(function (state) {
|
|
52
53
|
return state.context;
|
|
53
54
|
});
|
|
54
|
-
var getRowData =
|
|
55
|
+
var getRowData = function getRowData(target, nodeData) {
|
|
55
56
|
if (target.updateMode === 'replace') {
|
|
56
57
|
return target.value;
|
|
57
58
|
}
|
|
58
59
|
return _objectSpread(_objectSpread({}, nodeData), target.value);
|
|
59
|
-
}
|
|
60
|
+
};
|
|
60
61
|
var elm = useRef(null);
|
|
61
62
|
var value = result.value;
|
|
62
63
|
useEffect(function () {
|
|
@@ -131,9 +132,11 @@ export default /*#__PURE__*/forwardRef(function RowEditor(props, ref) {
|
|
|
131
132
|
api.tabToNextCell();
|
|
132
133
|
}
|
|
133
134
|
}
|
|
135
|
+
}, /*#__PURE__*/React.createElement(FormulaCalculatorGridEditorContext.Provider, {
|
|
136
|
+
value: true
|
|
134
137
|
}, render(field ? get(value, field) : prevValue, value === data ? data : getRowData(result, data), _objectSpread(_objectSpread({}, props), {}, {
|
|
135
138
|
context: context,
|
|
136
139
|
ref: elm,
|
|
137
140
|
onChange: handleChange
|
|
138
|
-
})));
|
|
141
|
+
}))));
|
|
139
142
|
});
|
|
@@ -29,7 +29,8 @@ export default function FieldModal(props) {
|
|
|
29
29
|
enableSummary = props.enableSummary,
|
|
30
30
|
groups = props.groups,
|
|
31
31
|
locale = props.locale,
|
|
32
|
-
supportSelectDataFormat = props.supportSelectDataFormat
|
|
32
|
+
supportSelectDataFormat = props.supportSelectDataFormat,
|
|
33
|
+
enableCustomColumnSync = props.enableCustomColumnSync;
|
|
33
34
|
var _useState = useState(false),
|
|
34
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
36
|
open = _useState2[0],
|
|
@@ -118,7 +119,8 @@ export default function FieldModal(props) {
|
|
|
118
119
|
summaryType: 1,
|
|
119
120
|
decimalPlaces: 2,
|
|
120
121
|
groupId: undefined,
|
|
121
|
-
dataFormatType: supportSelectDataFormat ? 'number' : undefined
|
|
122
|
+
dataFormatType: supportSelectDataFormat ? 'number' : undefined,
|
|
123
|
+
syncColumn: false
|
|
122
124
|
});
|
|
123
125
|
}
|
|
124
126
|
} else {
|
|
@@ -282,7 +284,11 @@ export default function FieldModal(props) {
|
|
|
282
284
|
label: fieldModal.dataSourceSummaryDataText,
|
|
283
285
|
value: 2
|
|
284
286
|
}]
|
|
285
|
-
}))) : null
|
|
287
|
+
}))) : null, enableCustomColumnSync ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
288
|
+
name: "syncColumn",
|
|
289
|
+
label: " ",
|
|
290
|
+
valuePropName: "checked"
|
|
291
|
+
}, /*#__PURE__*/React.createElement(Checkbox, null, fieldModal.syncColumnText)) : null))), /*#__PURE__*/React.createElement("div", {
|
|
286
292
|
className: prefix('column-panel-modal-gutter')
|
|
287
293
|
}), /*#__PURE__*/React.createElement("div", {
|
|
288
294
|
className: prefix('column-panel-modal-right')
|
|
@@ -31,7 +31,8 @@ export default function CustomColumnPanel(params) {
|
|
|
31
31
|
enableSave = params.enableSave,
|
|
32
32
|
enableSummary = params.enableSummary,
|
|
33
33
|
locale = params.locale,
|
|
34
|
-
customColumnPanelExtra = params.customColumnPanelExtra
|
|
34
|
+
customColumnPanelExtra = params.customColumnPanelExtra,
|
|
35
|
+
enableCustomColumnSync = params.enableCustomColumnSync;
|
|
35
36
|
var _useState = useState(false),
|
|
36
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
38
|
searching = _useState2[0],
|
|
@@ -428,6 +429,7 @@ export default function CustomColumnPanel(params) {
|
|
|
428
429
|
grid.setField(value);
|
|
429
430
|
},
|
|
430
431
|
locale: locale,
|
|
431
|
-
supportSelectDataFormat: customColumnPanelExtra === null || customColumnPanelExtra === void 0 ? void 0 : customColumnPanelExtra.supportSelectDataFormat
|
|
432
|
+
supportSelectDataFormat: customColumnPanelExtra === null || customColumnPanelExtra === void 0 ? void 0 : customColumnPanelExtra.supportSelectDataFormat,
|
|
433
|
+
enableCustomColumnSync: enableCustomColumnSync
|
|
432
434
|
}));
|
|
433
435
|
}
|
package/es/data-grid/index.js
CHANGED
|
@@ -205,7 +205,8 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
|
|
|
205
205
|
enableSave: !!_this.props.customColumnPanelStorage,
|
|
206
206
|
enableSummary: _this.isClientMode() || _this.props.enableCustomColumnSummary,
|
|
207
207
|
locale: _this.props.locale,
|
|
208
|
-
customColumnPanelExtra: _this.props.customColumnPanelExtra
|
|
208
|
+
customColumnPanelExtra: _this.props.customColumnPanelExtra,
|
|
209
|
+
enableCustomColumnSync: _this.props.enableCustomColumnSync
|
|
209
210
|
}
|
|
210
211
|
}]
|
|
211
212
|
});
|
package/es/data-grid/index.less
CHANGED
|
@@ -455,6 +455,22 @@
|
|
|
455
455
|
line-height: ~'calc(min(var(--ag-internal-calculated-line-height), var(--ag-internal-padded-row-height)) - 4px)';
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
+
&-number {
|
|
459
|
+
display: flex;
|
|
460
|
+
align-items: center;
|
|
461
|
+
width: 100%;
|
|
462
|
+
height: 100%;
|
|
463
|
+
|
|
464
|
+
> input {
|
|
465
|
+
flex: 1 1 auto;
|
|
466
|
+
min-width: 0;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
&:not(:focus-within):not([data-calculator-open]) > .@{prefixCls}-formula-calculator-trigger {
|
|
470
|
+
display: none;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
458
474
|
&-text {
|
|
459
475
|
display: block;
|
|
460
476
|
width: 100%;
|
|
@@ -47,7 +47,8 @@ var locale = {
|
|
|
47
47
|
customColumnNameTextRequired: 'Please enter the custom column name',
|
|
48
48
|
customColumnDataFormatTypeText: 'Data Format',
|
|
49
49
|
customColumnDataFormatTypeOptionsNumberText: 'Number',
|
|
50
|
-
customColumnDataFormatTypeOptionsPercentageText: 'Percentage'
|
|
50
|
+
customColumnDataFormatTypeOptionsPercentageText: 'Percentage',
|
|
51
|
+
syncColumnText: 'Sync this custom column with all other users'
|
|
51
52
|
},
|
|
52
53
|
maxWordText: '${headerName} can not exceed ${maxLength} words',
|
|
53
54
|
operationSuccessText: 'Success',
|
|
@@ -44,7 +44,8 @@ var locale = {
|
|
|
44
44
|
customColumnNameTextRequired: 'Silakan masukkan nama kolom kustom',
|
|
45
45
|
customColumnDataFormatTypeText: 'Format data',
|
|
46
46
|
customColumnDataFormatTypeOptionsNumberText: 'Angka',
|
|
47
|
-
customColumnDataFormatTypeOptionsPercentageText: 'Persentase'
|
|
47
|
+
customColumnDataFormatTypeOptionsPercentageText: 'Persentase',
|
|
48
|
+
syncColumnText: 'Sinkronkan kolom kustom ini dengan semua pengguna lain'
|
|
48
49
|
},
|
|
49
50
|
validate: {
|
|
50
51
|
fieldErrorText: 'Bidang ${field} salah dimasukkan'
|
|
@@ -27,6 +27,7 @@ export interface DataGridLocale {
|
|
|
27
27
|
customColumnDataFormatTypeText: string;
|
|
28
28
|
customColumnDataFormatTypeOptionsNumberText: string;
|
|
29
29
|
customColumnDataFormatTypeOptionsPercentageText: string;
|
|
30
|
+
syncColumnText: string;
|
|
30
31
|
};
|
|
31
32
|
maxWordText: string;
|
|
32
33
|
operationSuccessText: string;
|
|
@@ -44,7 +44,8 @@ var locale = {
|
|
|
44
44
|
customColumnNameTextRequired: 'Vui lòng nhập tên cột tùy chỉnh',
|
|
45
45
|
customColumnDataFormatTypeText: 'Định dạng dữ liệu',
|
|
46
46
|
customColumnDataFormatTypeOptionsNumberText: 'Số',
|
|
47
|
-
customColumnDataFormatTypeOptionsPercentageText: 'Phần trăm'
|
|
47
|
+
customColumnDataFormatTypeOptionsPercentageText: 'Phần trăm',
|
|
48
|
+
syncColumnText: 'Đồng bộ cột tùy chỉnh này cho tất cả người dùng khác'
|
|
48
49
|
},
|
|
49
50
|
validate: {
|
|
50
51
|
fieldErrorText: 'Nhập sai trường ${field}'
|
|
@@ -44,7 +44,8 @@ var locale = {
|
|
|
44
44
|
customColumnNameTextRequired: '请输入自定义列名',
|
|
45
45
|
customColumnDataFormatTypeText: '数据格式',
|
|
46
46
|
customColumnDataFormatTypeOptionsNumberText: '数值',
|
|
47
|
-
customColumnDataFormatTypeOptionsPercentageText: '百分比'
|
|
47
|
+
customColumnDataFormatTypeOptionsPercentageText: '百分比',
|
|
48
|
+
syncColumnText: '同步该自定义列给所有其他用户'
|
|
48
49
|
},
|
|
49
50
|
validate: {
|
|
50
51
|
fieldErrorText: '${field}输入错误'
|
|
@@ -44,7 +44,8 @@ var locale = {
|
|
|
44
44
|
customColumnNameTextRequired: '請輸入自定義列名',
|
|
45
45
|
customColumnDataFormatTypeText: '數據格式',
|
|
46
46
|
customColumnDataFormatTypeOptionsNumberText: '數值',
|
|
47
|
-
customColumnDataFormatTypeOptionsPercentageText: '百分比'
|
|
47
|
+
customColumnDataFormatTypeOptionsPercentageText: '百分比',
|
|
48
|
+
syncColumnText: '同步該自定義列給所有其他用戶'
|
|
48
49
|
},
|
|
49
50
|
validate: {
|
|
50
51
|
fieldErrorText: '${field}輸入錯誤'
|
|
@@ -299,4 +299,8 @@ export interface DataGridProps<TData> extends Omit<AgGridReactProps<TData>, 'row
|
|
|
299
299
|
* @depscription 启用预估初始列宽 启用后根据字符长度计算宽度,如果列传入了initialWidth,取两者较大值
|
|
300
300
|
*/
|
|
301
301
|
enableEstimateInitialColumnWidth?: boolean;
|
|
302
|
+
/**
|
|
303
|
+
* @depscription 启用定制列同步给其他用户
|
|
304
|
+
*/
|
|
305
|
+
enableCustomColumnSync?: boolean;
|
|
302
306
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** 表单输入框里已经是数字时,再敲加减乘除才自动唤起 */
|
|
2
|
+
export declare const getFormulaOperand: (value: string) => string | null;
|
|
3
|
+
/** 兼容主键盘、小键盘和中文输入法产生的除号 */
|
|
4
|
+
export declare const normalizeFormulaKey: (event: {
|
|
5
|
+
key: string;
|
|
6
|
+
code?: string;
|
|
7
|
+
}) => string | null;
|
|
8
|
+
export declare const isFormulaInput: (value: string) => boolean;
|
|
9
|
+
/** 忽略末尾单个运算符;不合法的公式(包括除零)返回 null。 */
|
|
10
|
+
export declare const evaluateFormula: (expression: string) => string | null;
|