d2coreui 23.0.25 → 23.0.27
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/components/grid/cell/bigNumberCellEditor.d.ts +4 -0
- package/components/grid/cell/bigNumberCellEditor.js +82 -0
- package/components/grid/cell/bigNumberCellEditor.js.map +1 -0
- package/components/grid/dataGrid.d.ts +3 -0
- package/components/grid/dataGrid.js +21 -8
- package/components/grid/dataGrid.js.map +1 -1
- package/components/grid/export/contextMenu.d.ts +1 -0
- package/components/grid/export/contextMenu.js +13 -3
- package/components/grid/export/contextMenu.js.map +1 -1
- package/components/grid/extendedDataGrid.js +2 -0
- package/components/grid/extendedDataGrid.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputNumber } from "antd";
|
|
3
|
+
import { Key } from "ts-key-enum";
|
|
4
|
+
import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
|
|
5
|
+
import { CellEditorUtils } from "./cellEditorUtils";
|
|
6
|
+
import { DataGridCellEditorComponent, withAgGridHooks } from "./dataGridCellEditorComponent";
|
|
7
|
+
import { MAX_SIGNED_64_BIT_INT, MIN_SIGNED_64_BIT_INT } from "d2api/constants";
|
|
8
|
+
class BigNumberCellEditor extends DataGridCellEditorComponent {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.inputComponent = null;
|
|
12
|
+
this.state = this.getInitialState(props);
|
|
13
|
+
}
|
|
14
|
+
getInitialState(props) {
|
|
15
|
+
let value;
|
|
16
|
+
if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {
|
|
17
|
+
value = null;
|
|
18
|
+
props.onValueChange(null);
|
|
19
|
+
}
|
|
20
|
+
else if (props.eventKey && props.eventKey.length === 1) {
|
|
21
|
+
const parsedValue = Number.parseInt(props.eventKey);
|
|
22
|
+
value = isNaN(parsedValue) ? props.value : parsedValue;
|
|
23
|
+
props.onValueChange(value);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
value = props.value;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
value: value,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
focus() {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.focus();
|
|
35
|
+
}
|
|
36
|
+
select() {
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.select();
|
|
39
|
+
}
|
|
40
|
+
placeCursorToEnd() {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
const length = ((_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.value) ? (_b = this.inputComponent) === null || _b === void 0 ? void 0 : _b.value.length : 0;
|
|
43
|
+
if (length > 0) {
|
|
44
|
+
(_c = this.inputComponent) === null || _c === void 0 ? void 0 : _c.setSelectionRange(length, length);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
isCancelBeforeStart() {
|
|
48
|
+
return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return (React.createElement(InputNumber, { ref: (component) => {
|
|
52
|
+
this.inputComponent = component;
|
|
53
|
+
}, size: "small", autoFocus: true, stringMode: true, decimalSeparator: this.props.decimalSeparator, precision: this.props.precision, min: this.props.min ? String(this.props.min) : MIN_SIGNED_64_BIT_INT.toString(), max: this.props.max ? String(this.props.max) : MAX_SIGNED_64_BIT_INT.toString(), placeholder: this.state.value === null ? "NULL" : "", value: this.state.value !== null ? this.state.value : undefined, onChange: value => {
|
|
54
|
+
if (KeyboardUtils.isKeyPressed(Key.Alt)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (typeof value === "string" && value !== "") {
|
|
58
|
+
this.setState({ value: value });
|
|
59
|
+
if (value !== null && /^(?:-?\d+)?$/.test(value)) {
|
|
60
|
+
if (BigInt(value) > Number.MAX_SAFE_INTEGER || BigInt(value) < Number.MIN_SAFE_INTEGER) {
|
|
61
|
+
this.props.onValueChange(value);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.props.onValueChange(parseInt(value, 10));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else if (value === null || value === "") {
|
|
69
|
+
this.setState({ value: null });
|
|
70
|
+
this.props.onValueChange(null);
|
|
71
|
+
}
|
|
72
|
+
}, onKeyDown: (e) => {
|
|
73
|
+
if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
76
|
+
e.nativeEvent.preventDefault();
|
|
77
|
+
}
|
|
78
|
+
}, style: { width: '100%' } }));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export default withAgGridHooks(BigNumberCellEditor);
|
|
82
|
+
//# sourceMappingURL=bigNumberCellEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigNumberCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/bigNumberCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,MAAM,CAAC;AACjC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,2BAA2B,EAAE,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAC,qBAAqB,EAAE,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAe7E,MAAM,mBAAoB,SAAQ,2BAAkF;IAGhH,YAAY,KAA8C;QACtD,KAAK,CAAC,KAAK,CAAC,C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AAC;CACJ;AAED,eAAe,eAAe,CAAC,mBAAmB,CAAC,CAAA","sourcesContent":["import React from 'react';\r\nimport {InputNumber} from \"antd\";\r\nimport {Key} from \"ts-key-enum\";\r\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\r\nimport {CellEditorUtils} from \"./cellEditorUtils\";\r\nimport {DataGridCellEditorComponent, withAgGridHooks} from \"./dataGridCellEditorComponent\";\r\nimport {MAX_SIGNED_64_BIT_INT, MIN_SIGNED_64_BIT_INT} from \"d2api/constants\";\r\nimport {CustomCellEditorProps} from \"ag-grid-react\";\r\n\r\ninterface BigNumberCellEditorProperties extends CustomCellEditorProps {\r\n decimalSeparator?: string\r\n precision?: number\r\n min?: number\r\n max?: number\r\n}\r\n\r\ninterface NumericCellEditorState {\r\n value: string | null\r\n}\r\n\r\n// same as NumberCellEditor, but values that are not in range of safe integer values are returned as string\r\nclass BigNumberCellEditor extends DataGridCellEditorComponent<BigNumberCellEditorProperties, NumericCellEditorState> {\r\n private inputComponent: HTMLInputElement | null = null;\r\n\r\n constructor(props: Readonly<BigNumberCellEditorProperties>) {\r\n super(props);\r\n this.state = this.getInitialState(props);\r\n }\r\n\r\n getInitialState(props: Readonly<BigNumberCellEditorProperties>): NumericCellEditorState {\r\n let value: string | null;\r\n\r\n if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n props.onValueChange(null);\r\n } else if (props.eventKey && props.eventKey.length === 1) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.eventKey);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n props.onValueChange(value);\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.value;\r\n }\r\n return {\r\n value: value,\r\n };\r\n }\r\n\r\n focus() {\r\n this.inputComponent?.focus();\r\n }\r\n\r\n select() {\r\n this.inputComponent?.select();\r\n }\r\n\r\n placeCursorToEnd() {\r\n // when we started editing, we want the carot at the end, not the start.\r\n // this comes into play in two scenarios: a) when user hits F2 and b)\r\n // when user hits a printable character, then on IE (and only IE) the carot\r\n // was placed after the first character, thus 'apply' would end up as 'pplea'\r\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\r\n if (length > 0) {\r\n this.inputComponent?.setSelectionRange(length, length);\r\n }\r\n }\r\n\r\n isCancelBeforeStart(): boolean {\r\n return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;\r\n }\r\n\r\n\r\n render() {\r\n return (\r\n <InputNumber<string>\r\n ref={(component) => {\r\n this.inputComponent = component;\r\n }}\r\n size=\"small\"\r\n autoFocus\r\n stringMode\r\n decimalSeparator={this.props.decimalSeparator}\r\n precision={this.props.precision}\r\n min={this.props.min ? String(this.props.min) : MIN_SIGNED_64_BIT_INT.toString()}\r\n max={this.props.max ? String(this.props.max) : MAX_SIGNED_64_BIT_INT.toString()}\r\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\r\n value={this.state.value !== null ? this.state.value : undefined}\r\n onChange={value => {\r\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\r\n // ignore navigational keystrokes ALT+cursor arrow\r\n return;\r\n }\r\n if (typeof value === \"string\" && value !== \"\") {\r\n this.setState({value: value});\r\n if (value !== null && /^(?:-?\\d+)?$/.test(value)) {\r\n if (BigInt(value) > Number.MAX_SAFE_INTEGER || BigInt(value) < Number.MIN_SAFE_INTEGER) {\r\n this.props.onValueChange(value);\r\n } else {\r\n this.props.onValueChange(parseInt(value, 10));\r\n }\r\n }\r\n } else if (value === null || value === \"\") {\r\n this.setState({value: null});\r\n this.props.onValueChange(null);\r\n }\r\n }}\r\n onKeyDown={(e) => {\r\n if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {\r\n // this.props.onKeyDown(e.nativeEvent);\r\n e.preventDefault();\r\n e.nativeEvent.stopImmediatePropagation();\r\n e.nativeEvent.preventDefault();\r\n }\r\n }}\r\n style={{width: '100%'}}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default withAgGridHooks(BigNumberCellEditor)"]}
|
|
@@ -49,6 +49,8 @@ export interface DataGridSearchProps {
|
|
|
49
49
|
searchButtonClassName?: string;
|
|
50
50
|
searchButtonDisabled?: boolean;
|
|
51
51
|
searchButtonHidden?: boolean;
|
|
52
|
+
searchButtonIcon?: React.ReactNode;
|
|
53
|
+
searchButtonDanger?: boolean;
|
|
52
54
|
hidden?: boolean;
|
|
53
55
|
searchRenderer?(): React.ReactNode;
|
|
54
56
|
stringFormatter?(rawString: string): string;
|
|
@@ -103,6 +105,7 @@ export interface DataGridProps extends Omit<GridOptions, "columnDefs" | "paginat
|
|
|
103
105
|
exportMenu?: {
|
|
104
106
|
renderer?(menuElements: MenuElement[]): MenuElement[];
|
|
105
107
|
onClick?(key: string): void;
|
|
108
|
+
onExported?(rowCount: number, destination: string): void;
|
|
106
109
|
};
|
|
107
110
|
settingsMenu?: {
|
|
108
111
|
renderer?(menuElements: MenuElement[]): MenuElement[];
|
|
@@ -41,6 +41,7 @@ import { ClipboardUtils } from "d2coreui/components/clipboard/clipboardUtils";
|
|
|
41
41
|
import TimeUtils from "d2core/utils/timeUtils";
|
|
42
42
|
import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
|
|
43
43
|
import NumberCellEditor from "d2coreui/components/grid/cell/numberCellEditor";
|
|
44
|
+
import BigNumberCellEditor from "d2coreui/components/grid/cell/bigNumberCellEditor";
|
|
44
45
|
import TextCellEditor from "d2coreui/components/grid/cell/textCellEditor";
|
|
45
46
|
import StatusTextCellEditor from "d2coreui/components/grid/cell/statusTextCellEditor";
|
|
46
47
|
import DateCellEditor from "d2coreui/components/grid/cell/dateCellEditor";
|
|
@@ -61,6 +62,7 @@ const gridFrameworkComponents = {
|
|
|
61
62
|
customColumnFilter: CustomColumnFilter,
|
|
62
63
|
textColumnFilter: TextColumnFilter,
|
|
63
64
|
numberCellEditor: NumberCellEditor,
|
|
65
|
+
bigNumberCellEditor: BigNumberCellEditor,
|
|
64
66
|
textCellEditor: TextCellEditor,
|
|
65
67
|
simpleStatusTextCellEditor: SimpleStatusTextCellEditor,
|
|
66
68
|
statusTextCellEditor: StatusTextCellEditor,
|
|
@@ -199,6 +201,16 @@ class DataGrid extends React.Component {
|
|
|
199
201
|
return "";
|
|
200
202
|
}
|
|
201
203
|
},
|
|
204
|
+
valueFormatter: (params) => {
|
|
205
|
+
var _a, _b;
|
|
206
|
+
const value = DataGrid.getCellValue(params);
|
|
207
|
+
if (value !== undefined && value !== null) {
|
|
208
|
+
return LocaleHolder.formatNumber(value, (_b = (_a = params.colDef) === null || _a === void 0 ? void 0 : _a.cellRendererParams) === null || _b === void 0 ? void 0 : _b.fractionDigits);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
return "";
|
|
212
|
+
}
|
|
213
|
+
},
|
|
202
214
|
filterParams: {
|
|
203
215
|
textCustomComparator: this.textCustomComparator
|
|
204
216
|
},
|
|
@@ -1102,7 +1114,7 @@ class DataGrid extends React.Component {
|
|
|
1102
1114
|
var _a, _b;
|
|
1103
1115
|
let formattedValue = (_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.getCellValue({ rowNode: row, colKey: column });
|
|
1104
1116
|
if (formattedValue && typeof formattedValue === "string" && formattedValue.indexOf(EXPORT_SEPARATOR) > 0 && !doNotReplaceNewline) {
|
|
1105
|
-
formattedValue = formattedValue.replace(/[\n\r]
|
|
1117
|
+
formattedValue = formattedValue.replace(/[\n\r]+/g, ' ');
|
|
1106
1118
|
}
|
|
1107
1119
|
const valueFormatter = column.getColDef().valueFormatter;
|
|
1108
1120
|
if (valueFormatter) {
|
|
@@ -1434,7 +1446,7 @@ class DataGrid extends React.Component {
|
|
|
1434
1446
|
_c.extraContent));
|
|
1435
1447
|
}
|
|
1436
1448
|
renderToolBarWithSearch() {
|
|
1437
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1449
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1438
1450
|
return (React.createElement(Space.Compact, { key: "filter-panel", className: "datagrid-autocomplete-input-group", style: { whiteSpace: "nowrap", flexGrow: 1, display: "flex" } }, (_a = this.props.toolbar) === null || _a === void 0 ? void 0 :
|
|
1439
1451
|
_a.toolbarButtons,
|
|
1440
1452
|
React.createElement(Dropdown, { trigger: ["click"], menu: getContextMenu({
|
|
@@ -1442,6 +1454,7 @@ class DataGrid extends React.Component {
|
|
|
1442
1454
|
showYear: !this.props.hideYear,
|
|
1443
1455
|
renderer: (_b = this.props.exportMenu) === null || _b === void 0 ? void 0 : _b.renderer,
|
|
1444
1456
|
onClick: (_c = this.props.exportMenu) === null || _c === void 0 ? void 0 : _c.onClick,
|
|
1457
|
+
onExported: (_d = this.props.exportMenu) === null || _d === void 0 ? void 0 : _d.onExported,
|
|
1445
1458
|
getExportContent: this.getExportContent,
|
|
1446
1459
|
pageOrientation: this.state.pageOrientation,
|
|
1447
1460
|
exporting: this.state.exporting,
|
|
@@ -1453,15 +1466,15 @@ class DataGrid extends React.Component {
|
|
|
1453
1466
|
React.createElement(Dropdown, { trigger: ["click"], menu: this.getSettingsMenu() },
|
|
1454
1467
|
React.createElement(Button, { title: i18n("Extended table features"), disabled: this.state.loading },
|
|
1455
1468
|
React.createElement(TableOutlined, null))),
|
|
1456
|
-
!((
|
|
1457
|
-
|
|
1458
|
-
!((
|
|
1459
|
-
React.createElement(Button, { title: ((
|
|
1469
|
+
!((_e = this.props.search) === null || _e === void 0 ? void 0 : _e.hidden) && !((_f = this.props.search) === null || _f === void 0 ? void 0 : _f.searchRenderer) && React.createElement(AutoCompleteInput, { style: { minWidth: 100, flexGrow: 1 }, placeholder: this.props.search ? this.props.search.placeholder : undefined, stringFormatter: this.props.search ? this.props.search.stringFormatter : undefined, value: this.props.search ? this.props.search.searchString : undefined, options: this.props.search ? this.props.search.searchHistory : undefined, onChange: this.props.search ? this.props.search.onChange : undefined, onSearch: this.props.search ? this.props.search.onSearch : undefined, disabled: this.state.loading || (this.props.filter && this.props.filter.columnSearchVisible) }), (_h = (_g = this.props.search) === null || _g === void 0 ? void 0 : _g.searchRenderer) === null || _h === void 0 ? void 0 :
|
|
1470
|
+
_h.call(_g),
|
|
1471
|
+
!((_j = this.props.search) === null || _j === void 0 ? void 0 : _j.searchButtonHidden) &&
|
|
1472
|
+
React.createElement(Button, { title: ((_k = this.props.search) === null || _k === void 0 ? void 0 : _k.hidden) ? i18n("Refresh") : i18n("Search"), className: "search-btn " + (this.props.search && this.props.search.searchButtonClassName ? this.props.search.searchButtonClassName : ""), disabled: (_l = this.props.search) === null || _l === void 0 ? void 0 : _l.searchButtonDisabled, type: "primary", danger: (_m = this.props.search) === null || _m === void 0 ? void 0 : _m.searchButtonDanger, onClick: () => {
|
|
1460
1473
|
if (this.props.search && this.props.search.onSearch) {
|
|
1461
1474
|
this.props.search.onSearch();
|
|
1462
1475
|
}
|
|
1463
|
-
} }, this.state.loading ? React.createElement(LoadingOutlined, null) : (((
|
|
1464
|
-
React.createElement(SearchOutlined, null)))));
|
|
1476
|
+
} }, this.state.loading ? React.createElement(LoadingOutlined, null) : ((_p = (_o = this.props.search) === null || _o === void 0 ? void 0 : _o.searchButtonIcon) !== null && _p !== void 0 ? _p : (((_q = this.props.search) === null || _q === void 0 ? void 0 : _q.hidden) ? React.createElement(ReloadOutlined, null) :
|
|
1477
|
+
React.createElement(SearchOutlined, null))))));
|
|
1465
1478
|
}
|
|
1466
1479
|
getSettingsMenu() {
|
|
1467
1480
|
var _a;
|