d2coreui 21.0.33 → 23.0.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/components/clipboard/clipboardUtils.d.ts +4 -3
- package/components/clipboard/clipboardUtils.js +47 -22
- package/components/clipboard/clipboardUtils.js.map +1 -1
- package/components/codemirror/SyntaxHighlighter.d.ts +21 -21
- package/components/codemirror/SyntaxHighlighter.js +45 -44
- package/components/codemirror/SyntaxHighlighter.js.map +1 -1
- package/components/collapse/expandable.d.ts +13 -12
- package/components/collapse/expandable.js +20 -20
- package/components/collapse/expandable.js.map +1 -1
- package/components/color/colorPicker.d.ts +20 -20
- package/components/color/colorPicker.js +53 -53
- package/components/color/colorPicker.js.map +1 -1
- package/components/color/colorSwatch.d.ts +13 -12
- package/components/color/colorSwatch.js +62 -62
- package/components/color/colorSwatch.js.map +1 -1
- package/components/color/colorUtils.d.ts +7 -7
- package/components/color/colorUtils.js +43 -43
- package/components/color/colorUtils.js.map +1 -1
- package/components/date/dateRangeInput.d.ts +66 -64
- package/components/date/dateRangeInput.js +292 -297
- package/components/date/dateRangeInput.js.map +1 -1
- package/components/date/dateRangeInputAdvancedPanel.d.ts +27 -26
- package/components/date/dateRangeInputAdvancedPanel.js +130 -115
- package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
- package/components/date/dateRangeInputConfirm.d.ts +31 -29
- package/components/date/dateRangeInputConfirm.js +132 -121
- package/components/date/dateRangeInputConfirm.js.map +1 -1
- package/components/date/dateTimeInput.d.ts +72 -69
- package/components/date/dateTimeInput.js +440 -412
- package/components/date/dateTimeInput.js.map +1 -1
- package/components/date/durationInput.d.ts +59 -56
- package/components/date/durationInput.js +269 -280
- package/components/date/durationInput.js.map +1 -1
- package/components/form/NiceFormItem.d.ts +14 -14
- package/components/form/NiceFormItem.js +28 -31
- package/components/form/NiceFormItem.js.map +1 -1
- package/components/grid/cell/beanAccessor.d.ts +9 -0
- package/components/grid/cell/beanAccessor.js +13 -0
- package/components/grid/cell/beanAccessor.js.map +1 -0
- package/components/grid/cell/cellEditorUtils.d.ts +4 -4
- package/components/grid/cell/cellEditorUtils.js +8 -8
- package/components/grid/cell/customEnumCellEditor.d.ts +4 -26
- package/components/grid/cell/customEnumCellEditor.js +82 -91
- package/components/grid/cell/customEnumCellEditor.js.map +1 -1
- package/components/grid/cell/dataGridCellEditorComponent.d.ts +14 -0
- package/components/grid/cell/dataGridCellEditorComponent.js +49 -0
- package/components/grid/cell/dataGridCellEditorComponent.js.map +1 -0
- package/components/grid/cell/dateCellEditor.d.ts +4 -25
- package/components/grid/cell/dateCellEditor.js +53 -72
- package/components/grid/cell/dateCellEditor.js.map +1 -1
- package/components/grid/cell/durationCellEditor.d.ts +4 -24
- package/components/grid/cell/durationCellEditor.js +74 -97
- package/components/grid/cell/durationCellEditor.js.map +1 -1
- package/components/grid/cell/hexaOctetStringCellEditor.d.ts +4 -24
- package/components/grid/cell/hexaOctetStringCellEditor.js +70 -94
- package/components/grid/cell/hexaOctetStringCellEditor.js.map +1 -1
- package/components/grid/cell/hexaValueCellEditor.d.ts +4 -24
- package/components/grid/cell/hexaValueCellEditor.js +65 -89
- package/components/grid/cell/hexaValueCellEditor.js.map +1 -1
- package/components/grid/cell/numberCellEditor.d.ts +4 -27
- package/components/grid/cell/numberCellEditor.js +73 -95
- package/components/grid/cell/numberCellEditor.js.map +1 -1
- package/components/grid/cell/rangeSelector.d.ts +78 -78
- package/components/grid/cell/rangeSelector.js +526 -518
- package/components/grid/cell/rangeSelector.js.map +1 -1
- package/components/grid/cell/simpleStatusTextCellEditor.d.ts +4 -32
- package/components/grid/cell/simpleStatusTextCellEditor.js +106 -116
- package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
- package/components/grid/cell/statusTextCellEditor.d.ts +4 -32
- package/components/grid/cell/statusTextCellEditor.js +136 -159
- package/components/grid/cell/statusTextCellEditor.js.map +1 -1
- package/components/grid/cell/tableDefaultRowStyleRules.d.ts +20 -20
- package/components/grid/cell/tableDefaultRowStyleRules.js +29 -18
- package/components/grid/cell/tableDefaultRowStyleRules.js.map +1 -1
- package/components/grid/cell/textCellEditor.d.ts +4 -21
- package/components/grid/cell/textCellEditor.js +63 -85
- package/components/grid/cell/textCellEditor.js.map +1 -1
- package/components/grid/cell/withAgGridHooks.d.ts +3 -0
- package/components/grid/cell/withAgGridHooks.js +15 -0
- package/components/grid/cell/withAgGridHooks.js.map +1 -0
- package/components/grid/columnUtils.d.ts +5 -5
- package/components/grid/columnUtils.js +26 -26
- package/components/grid/columnUtils.js.map +1 -1
- package/components/grid/config/columnTransfer.d.ts +21 -22
- package/components/grid/config/columnTransfer.js +205 -201
- package/components/grid/config/columnTransfer.js.map +1 -1
- package/components/grid/config/dataGridEditor.d.ts +41 -41
- package/components/grid/config/dataGridEditor.js +181 -160
- package/components/grid/config/dataGridEditor.js.map +1 -1
- package/components/grid/config/rowHeightCalculator.d.ts +8 -0
- package/components/grid/config/rowHeightCalculator.js +20 -0
- package/components/grid/config/rowHeightCalculator.js.map +1 -0
- package/components/grid/config/rowStylePicker.d.ts +27 -25
- package/components/grid/config/rowStylePicker.js +127 -109
- package/components/grid/config/rowStylePicker.js.map +1 -1
- package/components/grid/dataGrid.d.ts +218 -206
- package/components/grid/dataGrid.js +1629 -1538
- package/components/grid/dataGrid.js.map +1 -1
- package/components/grid/detail/detailHeaderPanel.d.ts +13 -13
- package/components/grid/detail/detailHeaderPanel.js +25 -25
- package/components/grid/detail/detailHeaderPanel.js.map +1 -1
- package/components/grid/export/contextMenu.d.ts +18 -24
- package/components/grid/export/contextMenu.js +116 -113
- package/components/grid/export/contextMenu.js.map +1 -1
- package/components/grid/export/progressPopup.d.ts +29 -29
- package/components/grid/export/progressPopup.js +93 -93
- package/components/grid/export/progressPopup.js.map +1 -1
- package/components/grid/export/worker/clipboardExport.d.ts +1 -1
- package/components/grid/export/worker/clipboardExport.js +8 -8
- package/components/grid/export/worker/csvExport.d.ts +1 -1
- package/components/grid/export/worker/csvExport.js +8 -8
- package/components/grid/export/worker/pdfExport.d.ts +1 -1
- package/components/grid/export/worker/pdfExport.js +81 -81
- package/components/grid/export/worker/pdfExport.js.map +1 -1
- package/components/grid/export/worker/txtExport.d.ts +1 -1
- package/components/grid/export/worker/txtExport.js +19 -19
- package/components/grid/extendedDataGrid.d.ts +140 -140
- package/components/grid/extendedDataGrid.js +704 -695
- package/components/grid/extendedDataGrid.js.map +1 -1
- package/components/grid/filter/customColumnFilter.d.ts +5 -21
- package/components/grid/filter/customColumnFilter.js +11 -82
- package/components/grid/filter/customColumnFilter.js.map +1 -1
- package/components/grid/filter/dataGridColumnFilter.d.ts +17 -0
- package/components/grid/filter/dataGridColumnFilter.js +49 -0
- package/components/grid/filter/dataGridColumnFilter.js.map +1 -0
- package/components/grid/filter/dateColumnFilter.d.ts +7 -11
- package/components/grid/filter/dateColumnFilter.js +22 -56
- package/components/grid/filter/dateColumnFilter.js.map +1 -1
- package/components/grid/filter/textColumnFilter.d.ts +8 -20
- package/components/grid/filter/textColumnFilter.js +24 -76
- package/components/grid/filter/textColumnFilter.js.map +1 -1
- package/components/grid/filter/wildcardQuickFilterEngine.d.ts +7 -0
- package/components/grid/filter/wildcardQuickFilterEngine.js +48 -0
- package/components/grid/filter/wildcardQuickFilterEngine.js.map +1 -0
- package/components/grid/header/simpleHeader.d.ts +17 -16
- package/components/grid/header/simpleHeader.js +230 -186
- package/components/grid/header/simpleHeader.js.map +1 -1
- package/components/grid/panel/dataGridPagination.d.ts +16 -16
- package/components/grid/panel/dataGridPagination.js +58 -58
- package/components/grid/panel/dataGridPagination.js.map +1 -1
- package/components/grid/panel/loadingOverlay.d.ts +6 -6
- package/components/grid/panel/loadingOverlay.js +10 -10
- package/components/grid/panel/loadingOverlay.js.map +1 -1
- package/components/grid/panel/noRecordsOverlay.d.ts +6 -6
- package/components/grid/panel/noRecordsOverlay.js +10 -10
- package/components/grid/panel/noRecordsOverlay.js.map +1 -1
- package/components/grid/panel/tablePagination.d.ts +10 -10
- package/components/grid/panel/tablePagination.js +45 -45
- package/components/grid/panel/tablePagination.js.map +1 -1
- package/components/icons/dropdownArrow.d.ts +8 -0
- package/components/icons/dropdownArrow.js +59 -0
- package/components/icons/dropdownArrow.js.map +1 -0
- package/components/icons/undoIcon.d.ts +8 -8
- package/components/icons/undoIcon.js +6 -6
- package/components/input/autoCompleteInput.d.ts +35 -35
- package/components/input/autoCompleteInput.js +122 -121
- package/components/input/autoCompleteInput.js.map +1 -1
- package/components/input/draftUtils.d.ts +4 -4
- package/components/input/draftUtils.js +48 -48
- package/components/input/draftUtils.js.map +1 -1
- package/components/input/draftail.d.ts +1 -1
- package/components/input/draftail.js +1 -1
- package/components/input/hexaFormattedInput.d.ts +16 -16
- package/components/input/hexaFormattedInput.js +54 -54
- package/components/input/hexaFormattedInput.js.map +1 -1
- package/components/input/mask/helpers.d.ts +28 -28
- package/components/input/mask/helpers.js +112 -112
- package/components/input/mask/helpers.js.map +1 -1
- package/components/input/mask/inputMaskCore.d.ts +46 -46
- package/components/input/mask/inputMaskCore.js +278 -278
- package/components/input/mask/inputMaskCore.js.map +1 -1
- package/components/input/mask/pattern.d.ts +20 -20
- package/components/input/mask/pattern.js +78 -78
- package/components/input/mask/pattern.js.map +1 -1
- package/components/input/maskedInput.d.ts +373 -351
- package/components/input/maskedInput.js +224 -224
- package/components/input/maskedInput.js.map +1 -1
- package/components/input/passwordInput.d.ts +9 -9
- package/components/input/passwordInput.js +55 -55
- package/components/input/passwordInput.js.map +1 -1
- package/components/input/simpleAutoComplete.d.ts +12 -12
- package/components/input/simpleAutoComplete.js +41 -43
- package/components/input/simpleAutoComplete.js.map +1 -1
- package/components/input/textarea/extractSpansOfClasses.d.ts +15 -15
- package/components/input/textarea/extractSpansOfClasses.js +96 -96
- package/components/input/textarea/extractSpansOfClasses.js.map +1 -1
- package/components/input/textarea/getRanges.d.ts +1 -1
- package/components/input/textarea/getRanges.js +73 -73
- package/components/input/textarea/getRanges.js.map +1 -1
- package/components/input/textarea/getType.d.ts +1 -1
- package/components/input/textarea/getType.js +26 -26
- package/components/input/textarea/getType.js.map +1 -1
- package/components/input/textarea/highlighedContents.d.ts +6 -6
- package/components/input/textarea/highlighedContents.js +10 -10
- package/components/input/textarea/mentionsWithHighlighting.d.ts +27 -27
- package/components/input/textarea/mentionsWithHighlighting.js +60 -60
- package/components/input/textarea/mentionsWithHighlighting.js.map +1 -1
- package/components/keyboard/keyboardUtils.d.ts +5 -5
- package/components/keyboard/keyboardUtils.js +32 -32
- package/components/modal/draggableModalProvider.d.ts +4 -4
- package/components/modal/draggableModalProvider.js +21 -21
- package/components/modal/draggableModalProvider.js.map +1 -1
- package/components/modal/impl/clamp.d.ts +1 -1
- package/components/modal/impl/clamp.js +1 -1
- package/components/modal/impl/clamp.js.map +1 -1
- package/components/modal/impl/draggableModal.d.ts +12 -12
- package/components/modal/impl/draggableModal.js +17 -17
- package/components/modal/impl/draggableModal.js.map +1 -1
- package/components/modal/impl/draggableModalContext.d.ts +9 -9
- package/components/modal/impl/draggableModalContext.js +2 -2
- package/components/modal/impl/draggableModalContext.js.map +1 -1
- package/components/modal/impl/draggableModalInner.d.ts +15 -13
- package/components/modal/impl/draggableModalInner.js +57 -55
- package/components/modal/impl/draggableModalInner.js.map +1 -1
- package/components/modal/impl/draggableModalReducer.d.ts +66 -62
- package/components/modal/impl/draggableModalReducer.js +77 -78
- package/components/modal/impl/draggableModalReducer.js.map +1 -1
- package/components/modal/impl/getWindowSize.d.ts +4 -4
- package/components/modal/impl/getWindowSize.js +4 -4
- package/components/modal/impl/getWindowSize.js.map +1 -1
- package/components/modal/impl/index.d.ts +3 -3
- package/components/modal/impl/index.js +3 -3
- package/components/modal/impl/index.js.map +1 -1
- package/components/modal/impl/resizeHandle.d.ts +3 -3
- package/components/modal/impl/resizeHandle.js +4 -4
- package/components/modal/impl/resizeHandle.js.map +1 -1
- package/components/modal/impl/useDrag.d.ts +5 -5
- package/components/modal/impl/useDrag.js +42 -42
- package/components/modal/impl/useDrag.js.map +1 -1
- package/components/modal/impl/usePrevious.d.ts +1 -1
- package/components/modal/impl/usePrevious.js +8 -8
- package/components/modal/impl/usePrevious.js.map +1 -1
- package/components/modal/impl/useResize.d.ts +7 -7
- package/components/modal/impl/useResize.js +46 -46
- package/components/modal/impl/useResize.js.map +1 -1
- package/components/modal/modalDialog.d.ts +49 -49
- package/components/modal/modalDialog.js +152 -152
- package/components/modal/modalDialog.js.map +1 -1
- package/components/picker/enumValuePicker.d.ts +16 -16
- package/components/picker/enumValuePicker.js +34 -34
- package/components/picker/enumValuePicker.js.map +1 -1
- package/components/platformSpecific.d.ts +10 -10
- package/components/platformSpecific.js +27 -27
- package/components/scrollTo/onlyText.d.ts +4 -4
- package/components/scrollTo/onlyText.js +30 -30
- package/components/scrollTo/onlyText.js.map +1 -1
- package/components/scrollTo/scrollTo.d.ts +41 -39
- package/components/scrollTo/scrollTo.js +264 -264
- package/components/scrollTo/scrollTo.js.map +1 -1
- package/components/style/withCss.d.ts +9 -0
- package/components/style/withCss.js +6 -0
- package/components/style/withCss.js.map +1 -0
- package/components/style/withInputNumberCss.d.ts +6 -0
- package/components/style/withInputNumberCss.js +13 -0
- package/components/style/withInputNumberCss.js.map +1 -0
- package/components/table/dragSortingTable.d.ts +13 -14
- package/components/table/dragSortingTable.js +96 -82
- package/components/table/dragSortingTable.js.map +1 -1
- package/components/text/impl/innerSize.d.ts +2 -2
- package/components/text/impl/innerSize.js +12 -12
- package/components/text/impl/series.d.ts +1 -1
- package/components/text/impl/series.js +28 -28
- package/components/text/impl/shallowEqual.d.ts +1 -1
- package/components/text/impl/shallowEqual.js +18 -18
- package/components/text/impl/shallowEqual.js.map +1 -1
- package/components/text/impl/uniqueId.d.ts +1 -1
- package/components/text/impl/uniqueId.js +4 -4
- package/components/text/impl/whilst.d.ts +1 -1
- package/components/text/impl/whilst.js +19 -19
- package/components/text/impl/whilst.js.map +1 -1
- package/components/text/textFit.d.ts +38 -38
- package/components/text/textFit.js +165 -168
- package/components/text/textFit.js.map +1 -1
- package/i18n/components.cs.json +101 -100
- package/i18n/components.sk.json +101 -100
- package/i18n/components.uk.json +101 -100
- package/i18n/componentsLocaleHolder.d.ts +3 -3
- package/i18n/componentsLocaleHolder.js +28 -28
- package/i18n/componentsLocaleHolder.js.map +1 -1
- package/package.json +71 -70
- package/style/index.less +274 -298
- package/style/modal/DraggableModal.css +43 -40
- package/style/modal/ResizeHandle.css +27 -19
- package/tsconfig.build.json +24 -24
- package/tsconfig.json +11 -11
- package/components/grid/cell/wildcardQuickFilter.d.ts +0 -11
- package/components/grid/cell/wildcardQuickFilter.js +0 -61
- package/components/grid/cell/wildcardQuickFilter.js.map +0 -1
- package/components/table/dataTable.d.ts +0 -17
- package/components/table/dataTable.js +0 -79
- package/components/table/dataTable.js.map +0 -1
- package/style/antd/antd-tree-showline.css +0 -25
- package/style/antd/full-height-tabs.scss +0 -63
- package/style/draftail/draftail-editor.css +0 -179
- package/style/table/dragSortingTable.css +0 -7
|
@@ -1,1539 +1,1630 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { ColumnWidthOutlined, ControlOutlined, DownloadOutlined, FileSearchOutlined, LoadingOutlined, ReloadOutlined, SearchOutlined, SettingOutlined, TableOutlined } from "@ant-design/icons";
|
|
14
|
-
import { Button, Card, Dropdown, Empty,
|
|
15
|
-
import { AgGridReact } from "ag-grid-react";
|
|
16
|
-
import 'ag-grid-community/
|
|
17
|
-
import 'ag-grid-community/
|
|
18
|
-
import 'd2coreui/style/ag-grid/aggrid-adaptations.css';
|
|
19
|
-
import TextColumnFilter from "d2coreui/components/grid/filter/textColumnFilter";
|
|
20
|
-
import CustomColumnFilter from "d2coreui/components/grid/filter/customColumnFilter";
|
|
21
|
-
import SimpleHeader from "d2coreui/components/grid/header/simpleHeader";
|
|
22
|
-
import DataGridEditor from "d2coreui/components/grid/config/dataGridEditor";
|
|
23
|
-
import i18n from "d2core/i18n/i18n";
|
|
24
|
-
import AutoCompleteInput from "d2coreui/components/input/autoCompleteInput";
|
|
25
|
-
import isEqual from "lodash/isEqual";
|
|
26
|
-
import
|
|
27
|
-
import LoadingOverlay from "d2coreui/components/grid/panel/loadingOverlay";
|
|
28
|
-
import NoRecordsOverlay from "d2coreui/components/grid/panel/noRecordsOverlay";
|
|
29
|
-
import at from "lodash/at";
|
|
30
|
-
import ColumnTransfer from "d2coreui/components/grid/config/columnTransfer";
|
|
31
|
-
import cloneDeep from "lodash/cloneDeep";
|
|
32
|
-
import escape from "lodash/escape";
|
|
33
|
-
import { RangeSelector } from "d2coreui/components/grid/cell/rangeSelector";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import {
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import {
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
125
|
-
this.
|
|
126
|
-
this.
|
|
127
|
-
this.
|
|
128
|
-
this.
|
|
129
|
-
this.
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
133
|
-
this.
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
this.
|
|
143
|
-
this.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const value = DataGrid.getCellValue(params);
|
|
166
|
-
if (value !== undefined) {
|
|
167
|
-
return value.map((s) => i18n(s)).join(",");
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return "";
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
this.
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
this.
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
if (this.
|
|
587
|
-
this.
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
this.
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
if (this.props.paging
|
|
635
|
-
this.props.paging.onPaginationChanged(
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
});
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
if (!this.
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
if (
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
return {
|
|
841
|
-
rowIndex:
|
|
842
|
-
column: previousCell.column,
|
|
843
|
-
rowPinned: previousCell.rowPinned
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
this.
|
|
907
|
-
this.
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
break;
|
|
1022
|
-
case "
|
|
1023
|
-
if (params.event.ctrlKey
|
|
1024
|
-
const focusedCell = this.gridApi.getFocusedCell();
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
row.
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
if (
|
|
1180
|
-
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
if (
|
|
1256
|
-
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
const
|
|
1311
|
-
if (
|
|
1312
|
-
|
|
1313
|
-
}
|
|
1314
|
-
else
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
}
|
|
1336
|
-
return
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from "react";
|
|
13
|
+
import { ColumnWidthOutlined, ControlOutlined, DownloadOutlined, FileSearchOutlined, LoadingOutlined, ReloadOutlined, SearchOutlined, SettingOutlined, TableOutlined } from "@ant-design/icons";
|
|
14
|
+
import { Button, Card, Dropdown, Empty, Space } from "antd";
|
|
15
|
+
import { AgGridReact } from "ag-grid-react";
|
|
16
|
+
import 'ag-grid-community/styles/ag-grid.css';
|
|
17
|
+
import 'ag-grid-community/styles/ag-theme-balham.css';
|
|
18
|
+
import 'd2coreui/style/ag-grid/aggrid-adaptations.css';
|
|
19
|
+
import TextColumnFilter from "d2coreui/components/grid/filter/textColumnFilter";
|
|
20
|
+
import CustomColumnFilter from "d2coreui/components/grid/filter/customColumnFilter";
|
|
21
|
+
import SimpleHeader from "d2coreui/components/grid/header/simpleHeader";
|
|
22
|
+
import DataGridEditor from "d2coreui/components/grid/config/dataGridEditor";
|
|
23
|
+
import i18n from "d2core/i18n/i18n";
|
|
24
|
+
import AutoCompleteInput from "d2coreui/components/input/autoCompleteInput";
|
|
25
|
+
import isEqual from "lodash/isEqual";
|
|
26
|
+
import getContextMenu from "d2coreui/components/grid/export/contextMenu";
|
|
27
|
+
import LoadingOverlay from "d2coreui/components/grid/panel/loadingOverlay";
|
|
28
|
+
import NoRecordsOverlay from "d2coreui/components/grid/panel/noRecordsOverlay";
|
|
29
|
+
import at from "lodash/at";
|
|
30
|
+
import ColumnTransfer from "d2coreui/components/grid/config/columnTransfer";
|
|
31
|
+
import cloneDeep from "lodash/cloneDeep";
|
|
32
|
+
import escape from "lodash/escape";
|
|
33
|
+
import { RangeSelector } from "d2coreui/components/grid/cell/rangeSelector";
|
|
34
|
+
import { _defineModule, CellCtrl, ModuleRegistry } from "ag-grid-community";
|
|
35
|
+
import { LocaleHolder } from "d2core/i18n/localeHolder";
|
|
36
|
+
import tableDefaultRowStyleRules from "d2coreui/components/grid/cell/tableDefaultRowStyleRules";
|
|
37
|
+
import { ModalDialog } from "d2coreui/components/modal/modalDialog";
|
|
38
|
+
import debounce from "lodash/debounce";
|
|
39
|
+
import { Key } from "ts-key-enum";
|
|
40
|
+
import { ClipboardUtils } from "d2coreui/components/clipboard/clipboardUtils";
|
|
41
|
+
import TimeUtils from "d2core/utils/timeUtils";
|
|
42
|
+
import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
|
|
43
|
+
import NumberCellEditor from "d2coreui/components/grid/cell/numberCellEditor";
|
|
44
|
+
import TextCellEditor from "d2coreui/components/grid/cell/textCellEditor";
|
|
45
|
+
import StatusTextCellEditor from "d2coreui/components/grid/cell/statusTextCellEditor";
|
|
46
|
+
import DateCellEditor from "d2coreui/components/grid/cell/dateCellEditor";
|
|
47
|
+
import memoizeOne from "memoize-one";
|
|
48
|
+
import SimpleStatusTextCellEditor from "d2coreui/components/grid/cell/simpleStatusTextCellEditor";
|
|
49
|
+
import DurationCellEditor from "d2coreui/components/grid/cell/durationCellEditor";
|
|
50
|
+
import CustomEnumCellEditor from "d2coreui/components/grid/cell/customEnumCellEditor";
|
|
51
|
+
import HexaValueCellEditor from "d2coreui/components/grid/cell/hexaValueCellEditor";
|
|
52
|
+
import HexaOctetStringCellEditor from "d2coreui/components/grid/cell/hexaOctetStringCellEditor";
|
|
53
|
+
import ReactDOM from "react-dom";
|
|
54
|
+
import { D2000UnixTimeNullValue, unixTimeToMoment } from "d2core/types/unixTimeUtils";
|
|
55
|
+
import { compileExpression } from "filtrex";
|
|
56
|
+
import DataGridPagination from "./panel/dataGridPagination";
|
|
57
|
+
import { calculateLineHeight, calculateRowHeight, getFontSize, getLineHeight, getRowHeightDelta, GRID_DEFAULT_FONT_SIZE, GRID_DEFAULT_ROW_HEIGHT_DELTA } from "./config/rowHeightCalculator";
|
|
58
|
+
import BeanAccessor from "./cell/beanAccessor";
|
|
59
|
+
import WildcardQuickFilterEngine from "./filter/wildcardQuickFilterEngine";
|
|
60
|
+
const gridFrameworkComponents = {
|
|
61
|
+
customColumnFilter: CustomColumnFilter,
|
|
62
|
+
textColumnFilter: TextColumnFilter,
|
|
63
|
+
numberCellEditor: NumberCellEditor,
|
|
64
|
+
textCellEditor: TextCellEditor,
|
|
65
|
+
simpleStatusTextCellEditor: SimpleStatusTextCellEditor,
|
|
66
|
+
statusTextCellEditor: StatusTextCellEditor,
|
|
67
|
+
dateCellEditor: DateCellEditor,
|
|
68
|
+
durationCellEditor: DurationCellEditor,
|
|
69
|
+
customEnumCellEditor: CustomEnumCellEditor,
|
|
70
|
+
hexaValueCellEditor: HexaValueCellEditor,
|
|
71
|
+
hexaOctetStringCellEditor: HexaOctetStringCellEditor,
|
|
72
|
+
simpleHeader: SimpleHeader,
|
|
73
|
+
loadingOverlay: LoadingOverlay,
|
|
74
|
+
noRecordsOverlay: NoRecordsOverlay
|
|
75
|
+
};
|
|
76
|
+
const DataGridModule = _defineModule({
|
|
77
|
+
version: "32.2.0",
|
|
78
|
+
moduleName: `dataGridModule`,
|
|
79
|
+
beans: [RangeSelector, BeanAccessor],
|
|
80
|
+
dependantModules: [],
|
|
81
|
+
});
|
|
82
|
+
ModuleRegistry.__register(DataGridModule, false, undefined);
|
|
83
|
+
CellCtrl.prototype.onPopupEditorClosed = function () {
|
|
84
|
+
if (!this.isEditing()) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this.stopEditingAndFocus(true);
|
|
88
|
+
};
|
|
89
|
+
function getRowId(item) {
|
|
90
|
+
return item.data.id + "";
|
|
91
|
+
}
|
|
92
|
+
const rowStyleRuleCompiledExpressions = {};
|
|
93
|
+
export const EXPORT_SEPARATOR = "\n";
|
|
94
|
+
var NavigationEventEnum;
|
|
95
|
+
(function (NavigationEventEnum) {
|
|
96
|
+
NavigationEventEnum[NavigationEventEnum["KEYBOARD"] = 0] = "KEYBOARD";
|
|
97
|
+
NavigationEventEnum[NavigationEventEnum["MOUSE"] = 1] = "MOUSE";
|
|
98
|
+
})(NavigationEventEnum || (NavigationEventEnum = {}));
|
|
99
|
+
class DataGrid extends React.Component {
|
|
100
|
+
constructor(props) {
|
|
101
|
+
super(props);
|
|
102
|
+
this.lastPaginationEvent = null;
|
|
103
|
+
this.wrappingDiv = null;
|
|
104
|
+
this.state = {
|
|
105
|
+
pageIndex: 0,
|
|
106
|
+
pageSize: null,
|
|
107
|
+
recordsCount: undefined,
|
|
108
|
+
columnModel: [],
|
|
109
|
+
sortModel: [],
|
|
110
|
+
tableConfigVisible: !!this.props.tableConfigVisible,
|
|
111
|
+
columnsConfigVisible: !!this.props.columnsConfigVisible,
|
|
112
|
+
fontSize: GRID_DEFAULT_FONT_SIZE,
|
|
113
|
+
rowHeight: calculateRowHeight(GRID_DEFAULT_FONT_SIZE, GRID_DEFAULT_ROW_HEIGHT_DELTA),
|
|
114
|
+
viewport: [0, 0],
|
|
115
|
+
contextMenuVisible: false,
|
|
116
|
+
firstLoadDone: false,
|
|
117
|
+
loading: false,
|
|
118
|
+
columnTransferHeight: 500,
|
|
119
|
+
pageOrientation: "PORTRAIT",
|
|
120
|
+
exporting: false
|
|
121
|
+
};
|
|
122
|
+
this.indexToJump = null;
|
|
123
|
+
this.columnToJump = null;
|
|
124
|
+
this.onGridReady = this.onGridReady.bind(this);
|
|
125
|
+
this.onPaginationChanged = this.onPaginationChanged.bind(this);
|
|
126
|
+
this.onViewportChanged = this.onViewportChanged.bind(this);
|
|
127
|
+
this.onCellContextMenu = this.onCellContextMenu.bind(this);
|
|
128
|
+
this.onCellFocused = this.onCellFocused.bind(this);
|
|
129
|
+
this.onCellMouseDown = this.onCellMouseDown.bind(this);
|
|
130
|
+
this.setFocusedCellDebounced = debounce(this.setFocusedCellDebounced.bind(this), 200);
|
|
131
|
+
this.noRecordsOverlayRenderer = this.noRecordsOverlayRenderer.bind(this);
|
|
132
|
+
this.loadingOverlayRenderer = this.loadingOverlayRenderer.bind(this);
|
|
133
|
+
this.changePagination = this.changePagination.bind(this);
|
|
134
|
+
this.onColumnsChanged = this.onColumnsChanged.bind(this);
|
|
135
|
+
this.onFilterModified = this.onFilterModified.bind(this);
|
|
136
|
+
this.onFilterChanged = this.onFilterChanged.bind(this);
|
|
137
|
+
this.onFilterConfirmed = this.onFilterConfirmed.bind(this);
|
|
138
|
+
this.onSortChanged = this.onSortChanged.bind(this);
|
|
139
|
+
this.showTableConfiguration = this.showTableConfiguration.bind(this);
|
|
140
|
+
this.showColumnsConfig = this.showColumnsConfig.bind(this);
|
|
141
|
+
this.navigateToNextCell = this.navigateToNextCell.bind(this);
|
|
142
|
+
this.suppressKeyboardEvent = this.suppressKeyboardEvent.bind(this);
|
|
143
|
+
this.onRowDataUpdated = this.onRowDataUpdated.bind(this);
|
|
144
|
+
this._getRowStyle = this._getRowStyle.bind(this);
|
|
145
|
+
this._getRowHeight = this._getRowHeight.bind(this);
|
|
146
|
+
this._getCellStyle = this._getCellStyle.bind(this);
|
|
147
|
+
this.textCustomComparator = this.textCustomComparator.bind(this);
|
|
148
|
+
this.onPageOrientationChange = this.onPageOrientationChange.bind(this);
|
|
149
|
+
this.onExport = this.onExport.bind(this);
|
|
150
|
+
this.getExportContent = this.getExportContent.bind(this);
|
|
151
|
+
this.getDefaultColDefinition = memoizeOne(this.getDefaultColDefinition.bind(this));
|
|
152
|
+
this.getAdaptedColumnDefs = memoizeOne(this.getAdaptedColumnDefs.bind(this));
|
|
153
|
+
this.getCustomComponents = memoizeOne(this.getCustomComponents.bind(this));
|
|
154
|
+
this.table_context = {
|
|
155
|
+
loadingOverlayRenderer: this.loadingOverlayRenderer,
|
|
156
|
+
noRecordsOverlayRenderer: this.noRecordsOverlayRenderer,
|
|
157
|
+
onFilterConfirmed: this.onFilterConfirmed,
|
|
158
|
+
fontSize: this.state.fontSize,
|
|
159
|
+
lineHeight: getLineHeight(this.state.rowHeight)
|
|
160
|
+
};
|
|
161
|
+
this.wildcardQuickFilter = new WildcardQuickFilterEngine();
|
|
162
|
+
this.columnTypes = {
|
|
163
|
+
"localizedArrayColumn": {
|
|
164
|
+
cellRenderer: (params) => {
|
|
165
|
+
const value = DataGrid.getCellValue(params);
|
|
166
|
+
if (value !== undefined) {
|
|
167
|
+
return value.map((s) => i18n(s)).join(",");
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
return "";
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
filterParams: {
|
|
174
|
+
textCustomComparator: this.textCustomComparator
|
|
175
|
+
},
|
|
176
|
+
filterValueGetter: function (params) {
|
|
177
|
+
const value = DataGrid.getCellValue(params);
|
|
178
|
+
if (value !== undefined) {
|
|
179
|
+
return value.map((s) => i18n(s)).join(",");
|
|
180
|
+
}
|
|
181
|
+
return null;
|
|
182
|
+
},
|
|
183
|
+
getQuickFilterText: function (params) {
|
|
184
|
+
const value = DataGrid.getCellValue(params);
|
|
185
|
+
if (value !== undefined) {
|
|
186
|
+
return value.map((s) => i18n(s)).join(",");
|
|
187
|
+
}
|
|
188
|
+
return "";
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"numberColumn": {
|
|
192
|
+
cellRenderer: (params) => {
|
|
193
|
+
var _a, _b;
|
|
194
|
+
const value = DataGrid.getCellValue(params);
|
|
195
|
+
if (value !== undefined && value !== null) {
|
|
196
|
+
return LocaleHolder.formatNumber(value, (_b = (_a = params.colDef) === null || _a === void 0 ? void 0 : _a.cellRendererParams) === null || _b === void 0 ? void 0 : _b.fractionDigits);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
return "";
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
filterParams: {
|
|
203
|
+
textCustomComparator: this.textCustomComparator
|
|
204
|
+
},
|
|
205
|
+
filterValueGetter: function (params) {
|
|
206
|
+
var _a, _b;
|
|
207
|
+
const value = DataGrid.getCellValue(params);
|
|
208
|
+
if (value) {
|
|
209
|
+
return LocaleHolder.formatNumber(value, (_b = (_a = params.colDef) === null || _a === void 0 ? void 0 : _a.cellRendererParams) === null || _b === void 0 ? void 0 : _b.fractionDigits);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
return "";
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
getQuickFilterText: function (params) {
|
|
216
|
+
var _a, _b;
|
|
217
|
+
const value = DataGrid.getCellValue(params);
|
|
218
|
+
if (value !== undefined) {
|
|
219
|
+
return LocaleHolder.formatNumber(value, (_b = (_a = params.colDef) === null || _a === void 0 ? void 0 : _a.cellRendererParams) === null || _b === void 0 ? void 0 : _b.fractionDigits);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
return "";
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"dateColumn": {
|
|
227
|
+
cellRenderer: (params) => {
|
|
228
|
+
const value = DataGrid.getCellValue(params);
|
|
229
|
+
if (value !== undefined) {
|
|
230
|
+
if (value === D2000UnixTimeNullValue) {
|
|
231
|
+
return "---";
|
|
232
|
+
}
|
|
233
|
+
let tooltipValue;
|
|
234
|
+
tooltipValue = unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(true, true, true));
|
|
235
|
+
return React.createElement("span", { title: tooltipValue }, unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear)));
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
return "---";
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
valueFormatter: (params) => {
|
|
242
|
+
const value = DataGrid.getCellValue(params);
|
|
243
|
+
if (value !== undefined) {
|
|
244
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear));
|
|
245
|
+
}
|
|
246
|
+
return "---";
|
|
247
|
+
},
|
|
248
|
+
filterParams: {
|
|
249
|
+
textCustomComparator: this.textCustomComparator
|
|
250
|
+
},
|
|
251
|
+
filterValueGetter: (params) => {
|
|
252
|
+
const value = DataGrid.getCellValue(params);
|
|
253
|
+
if (value !== undefined) {
|
|
254
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear));
|
|
255
|
+
}
|
|
256
|
+
return null;
|
|
257
|
+
},
|
|
258
|
+
getQuickFilterText: (params) => {
|
|
259
|
+
const value = DataGrid.getCellValue(params);
|
|
260
|
+
if (value !== undefined) {
|
|
261
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear));
|
|
262
|
+
}
|
|
263
|
+
return "";
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"dateTimeColumn": {
|
|
267
|
+
cellRenderer: (params) => {
|
|
268
|
+
const value = DataGrid.getCellValue(params);
|
|
269
|
+
if (value) {
|
|
270
|
+
if (value === D2000UnixTimeNullValue) {
|
|
271
|
+
return "Null Time";
|
|
272
|
+
}
|
|
273
|
+
let tooltipValue;
|
|
274
|
+
tooltipValue = unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(true, true, true));
|
|
275
|
+
return React.createElement("span", { title: tooltipValue }, unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds)));
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
return "---";
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
valueFormatter: (params) => {
|
|
282
|
+
const value = DataGrid.getCellValue(params);
|
|
283
|
+
if (value !== undefined) {
|
|
284
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
285
|
+
}
|
|
286
|
+
return "---";
|
|
287
|
+
},
|
|
288
|
+
filterParams: {
|
|
289
|
+
textCustomComparator: this.textCustomComparator
|
|
290
|
+
},
|
|
291
|
+
filterValueGetter: (params) => {
|
|
292
|
+
const value = DataGrid.getCellValue(params);
|
|
293
|
+
if (value !== undefined) {
|
|
294
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
295
|
+
}
|
|
296
|
+
return null;
|
|
297
|
+
},
|
|
298
|
+
getQuickFilterText: (params) => {
|
|
299
|
+
const value = DataGrid.getCellValue(params);
|
|
300
|
+
if (value !== undefined) {
|
|
301
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
302
|
+
}
|
|
303
|
+
return "";
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"fromNowDateTimeColumn": {
|
|
307
|
+
cellRenderer: (params) => {
|
|
308
|
+
const value = DataGrid.getCellValue(params);
|
|
309
|
+
if (value !== undefined) {
|
|
310
|
+
let tooltipValue;
|
|
311
|
+
tooltipValue = unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(true, true, true));
|
|
312
|
+
return React.createElement("span", { title: tooltipValue }, unixTimeToMoment(value).fromNow());
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
return "---";
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
valueFormatter: (params) => {
|
|
319
|
+
const value = DataGrid.getCellValue(params);
|
|
320
|
+
if (value !== undefined) {
|
|
321
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
322
|
+
}
|
|
323
|
+
return "---";
|
|
324
|
+
},
|
|
325
|
+
filterParams: {
|
|
326
|
+
textCustomComparator: this.textCustomComparator
|
|
327
|
+
},
|
|
328
|
+
filterValueGetter: (params) => {
|
|
329
|
+
const value = DataGrid.getCellValue(params);
|
|
330
|
+
if (value !== undefined) {
|
|
331
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
},
|
|
335
|
+
getQuickFilterText: (params) => {
|
|
336
|
+
const value = DataGrid.getCellValue(params);
|
|
337
|
+
if (value !== undefined) {
|
|
338
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
339
|
+
}
|
|
340
|
+
return "";
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
"escapedValueColumn": {
|
|
344
|
+
cellRenderer: (params) => {
|
|
345
|
+
const value = DataGrid.getCellValue(params);
|
|
346
|
+
if (value !== undefined) {
|
|
347
|
+
return React.createElement("span", { style: { whiteSpace: "pre" }, title: escape(value) }, typeof value === "string" ? escape(value.replace(/[\r\n]+/g, ' ')) : value);
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
return "";
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
valueFormatter: (params) => {
|
|
354
|
+
const value = DataGrid.getCellValue(params);
|
|
355
|
+
if (value !== undefined) {
|
|
356
|
+
return typeof value === "string" ? value.replace(/[\r\n]+/g, ' ') : value;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
return "";
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"textColumnFilter": {
|
|
364
|
+
filter: "agTextColumnFilter",
|
|
365
|
+
floatingFilter: true,
|
|
366
|
+
floatingFilterComponent: "textColumnFilter",
|
|
367
|
+
filterParams: {
|
|
368
|
+
textCustomComparator: this.textCustomComparator
|
|
369
|
+
},
|
|
370
|
+
suppressFloatingFilterButton: true,
|
|
371
|
+
},
|
|
372
|
+
"textColumnServerFilter": {
|
|
373
|
+
filter: "agTextColumnFilter",
|
|
374
|
+
floatingFilter: true,
|
|
375
|
+
floatingFilterComponent: "textColumnFilter",
|
|
376
|
+
filterParams: {
|
|
377
|
+
buttons: ['apply'],
|
|
378
|
+
textCustomComparator: this.textCustomComparator
|
|
379
|
+
},
|
|
380
|
+
suppressFloatingFilterButton: true,
|
|
381
|
+
},
|
|
382
|
+
"customColumnServerFilter": {
|
|
383
|
+
filter: "agTextColumnFilter",
|
|
384
|
+
floatingFilter: true,
|
|
385
|
+
floatingFilterComponent: "customColumnFilter",
|
|
386
|
+
filterParams: {
|
|
387
|
+
buttons: ['apply'],
|
|
388
|
+
textCustomComparator: this.textCustomComparator
|
|
389
|
+
},
|
|
390
|
+
suppressFloatingFilterButton: true,
|
|
391
|
+
},
|
|
392
|
+
"alignRight": {}
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
static getCellValue(props) {
|
|
396
|
+
if (props) {
|
|
397
|
+
if (props.colDef.field && typeof props.getValue === "function") {
|
|
398
|
+
return props.getValue(props.colDef.field);
|
|
399
|
+
}
|
|
400
|
+
if (props.data && props.colDef && props.colDef.field) {
|
|
401
|
+
return at(props.data, props.colDef.field)[0];
|
|
402
|
+
}
|
|
403
|
+
if (props.value !== undefined) {
|
|
404
|
+
return props.value;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return undefined;
|
|
408
|
+
}
|
|
409
|
+
textCustomComparator(filter, value, filterText) {
|
|
410
|
+
const filterTextLowerCase = filterText.toLowerCase();
|
|
411
|
+
const valueLowerCase = value.toString().toLowerCase();
|
|
412
|
+
switch (filter) {
|
|
413
|
+
case 'contains':
|
|
414
|
+
if (filterTextLowerCase.indexOf("*") >= 0 || filterTextLowerCase.indexOf("?") >= 0) {
|
|
415
|
+
const wildcardFilterRegExp = this.wildcardQuickFilter.getWildcardFilterRegExp(filterTextLowerCase);
|
|
416
|
+
if (typeof wildcardFilterRegExp == "string") {
|
|
417
|
+
return valueLowerCase.indexOf(filterTextLowerCase) >= 0;
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
return wildcardFilterRegExp.test(valueLowerCase);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
else {
|
|
424
|
+
return valueLowerCase.indexOf(filterTextLowerCase) >= 0;
|
|
425
|
+
}
|
|
426
|
+
case 'notContains':
|
|
427
|
+
return valueLowerCase.indexOf(filterTextLowerCase) === -1;
|
|
428
|
+
case 'equals':
|
|
429
|
+
return valueLowerCase === filterTextLowerCase;
|
|
430
|
+
case 'notEqual':
|
|
431
|
+
return valueLowerCase != filterTextLowerCase;
|
|
432
|
+
case 'startsWith':
|
|
433
|
+
return valueLowerCase.indexOf(filterTextLowerCase) === 0;
|
|
434
|
+
case 'endsWith':
|
|
435
|
+
var index = valueLowerCase.lastIndexOf(filterTextLowerCase);
|
|
436
|
+
return index >= 0 && index === (valueLowerCase.length - filterTextLowerCase.length);
|
|
437
|
+
default:
|
|
438
|
+
console.warn('invalid filter type ' + filter);
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
componentDidUpdate(prevProps) {
|
|
443
|
+
if (!this.gridApi) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
if (this.props.filter && prevProps.filter && this.props.filter.columnSearchVisible !== prevProps.filter.columnSearchVisible) {
|
|
447
|
+
setTimeout(() => {
|
|
448
|
+
if (this.gridApi) {
|
|
449
|
+
this.gridApi.refreshHeader();
|
|
450
|
+
if (this.props.filter && !this.props.filter.columnSearchVisible) {
|
|
451
|
+
this.gridApi.setFilterModel(null);
|
|
452
|
+
this.gridApi.onFilterChanged();
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}, 0);
|
|
456
|
+
}
|
|
457
|
+
if (this.props.rowData && this.props.rowData !== prevProps.rowData) {
|
|
458
|
+
if (this.props.filter && this.props.filter.getFilterModel) {
|
|
459
|
+
this.gridApi.setFilterModel(this.props.filter.getFilterModel());
|
|
460
|
+
this.gridApi.onFilterChanged();
|
|
461
|
+
}
|
|
462
|
+
this.setSortModel(this.state.sortModel);
|
|
463
|
+
this.gridApi.refreshClientSideRowModel("group");
|
|
464
|
+
this.gridApi.redrawRows();
|
|
465
|
+
const selectedObjectsVisibleInGrid = this.props.rowData.filter((object) => {
|
|
466
|
+
return this.props.selectedIds ? this.props.selectedIds.indexOf(object.id) >= 0 : false;
|
|
467
|
+
});
|
|
468
|
+
if (selectedObjectsVisibleInGrid.length > 0) {
|
|
469
|
+
selectedObjectsVisibleInGrid.forEach((object) => {
|
|
470
|
+
const rowNode = this.gridApi ? this.gridApi.getRowNode(object.id + "") : null;
|
|
471
|
+
if (rowNode && !rowNode.isSelected()) {
|
|
472
|
+
rowNode.setSelected(true, true);
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
this.gridApi.deselectAll();
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
if (this.props.datasource && this.props.datasource !== prevProps.datasource) {
|
|
481
|
+
this.gridApi.updateGridOptions({ datasource: this.props.datasource });
|
|
482
|
+
}
|
|
483
|
+
this.updateRowHeight();
|
|
484
|
+
}
|
|
485
|
+
setColumnState(columnModel) {
|
|
486
|
+
var _a;
|
|
487
|
+
const columnStates = [];
|
|
488
|
+
if (columnModel) {
|
|
489
|
+
columnModel.forEach((item) => {
|
|
490
|
+
const columnState = Object.assign({}, item);
|
|
491
|
+
item.sortIndex = undefined;
|
|
492
|
+
item.sort = undefined;
|
|
493
|
+
columnStates.push(columnState);
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.applyColumnState({ state: columnStates, defaultState: { sort: null }, applyOrder: true });
|
|
497
|
+
}
|
|
498
|
+
setSortModel(sortModel) {
|
|
499
|
+
var _a;
|
|
500
|
+
const columnState = [];
|
|
501
|
+
if (sortModel) {
|
|
502
|
+
sortModel.forEach((item, index) => {
|
|
503
|
+
columnState.push({
|
|
504
|
+
colId: item.colId,
|
|
505
|
+
sort: item.sort,
|
|
506
|
+
sortIndex: index
|
|
507
|
+
});
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.applyColumnState({ state: columnState, defaultState: { sort: null }, applyOrder: true });
|
|
511
|
+
}
|
|
512
|
+
getSortModel() {
|
|
513
|
+
var _a, _b;
|
|
514
|
+
const columnState = (_b = (_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.getColumnState()) !== null && _b !== void 0 ? _b : [];
|
|
515
|
+
const filteredStates = columnState === null || columnState === void 0 ? void 0 : columnState.filter(item => item.sort != null);
|
|
516
|
+
const indexes = {};
|
|
517
|
+
filteredStates.forEach((state) => {
|
|
518
|
+
if (state.colId) {
|
|
519
|
+
indexes[state.colId] = state.sortIndex;
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
const res = filteredStates.map(s => {
|
|
523
|
+
return { colId: s.colId, sort: s.sort };
|
|
524
|
+
});
|
|
525
|
+
res.sort((a, b) => indexes[a.colId] - indexes[b.colId]);
|
|
526
|
+
return res;
|
|
527
|
+
}
|
|
528
|
+
updateRowHeight() {
|
|
529
|
+
let rowAndFontHeight = this.calculateRowAndFontHeight(this.props.rowStyleRules);
|
|
530
|
+
if (rowAndFontHeight.rowHeight !== this.state.rowHeight) {
|
|
531
|
+
this.changeRowHeight(rowAndFontHeight.fontSize, rowAndFontHeight.rowHeight);
|
|
532
|
+
}
|
|
533
|
+
if (rowAndFontHeight.fontSize !== this.state.fontSize) {
|
|
534
|
+
this.setState({ fontSize: rowAndFontHeight.fontSize });
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
calculateRowAndFontHeight(rowStyleRules) {
|
|
538
|
+
let rowHeightDelta = GRID_DEFAULT_ROW_HEIGHT_DELTA;
|
|
539
|
+
let fontSize = GRID_DEFAULT_FONT_SIZE;
|
|
540
|
+
let rowHeight = calculateRowHeight(fontSize, rowHeightDelta);
|
|
541
|
+
if (rowStyleRules) {
|
|
542
|
+
for (let i = 0; i < rowStyleRules.length; i++) {
|
|
543
|
+
if (rowStyleRules[i].key === "table-font-size") {
|
|
544
|
+
const currentFontSize = rowStyleRules[i].style.fontSize;
|
|
545
|
+
fontSize = getFontSize(currentFontSize);
|
|
546
|
+
rowHeight = calculateRowHeight(currentFontSize, rowHeightDelta);
|
|
547
|
+
}
|
|
548
|
+
if (rowStyleRules[i].key === "table-line-indentation") {
|
|
549
|
+
const currentRowHeightDelta = rowStyleRules[i].style.rowHeightDelta;
|
|
550
|
+
rowHeightDelta = getRowHeightDelta(currentRowHeightDelta);
|
|
551
|
+
rowHeight = calculateRowHeight(fontSize, currentRowHeightDelta);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return { rowHeight: rowHeight, fontSize: fontSize };
|
|
556
|
+
}
|
|
557
|
+
static getDerivedStateFromProps(props, state) {
|
|
558
|
+
const newState = {};
|
|
559
|
+
if (props.tableConfigVisible === true || props.tableConfigVisible === false) {
|
|
560
|
+
if (props.tableConfigVisible !== state.tableConfigVisible) {
|
|
561
|
+
newState.tableConfigVisible = props.tableConfigVisible;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return newState;
|
|
565
|
+
}
|
|
566
|
+
onGridReady(gridReadyEvent) {
|
|
567
|
+
const gridApi = gridReadyEvent.api;
|
|
568
|
+
if (!this.gridApi || this.gridApi !== gridApi) {
|
|
569
|
+
this.gridApi = gridApi;
|
|
570
|
+
if (this.props.onGridReady) {
|
|
571
|
+
this.props.onGridReady(gridReadyEvent);
|
|
572
|
+
}
|
|
573
|
+
this.setState({
|
|
574
|
+
sortModel: this.getSortModel(),
|
|
575
|
+
columnModel: this.gridApi.getColumnState(),
|
|
576
|
+
});
|
|
577
|
+
this.updateRowHeight();
|
|
578
|
+
}
|
|
579
|
+
setTimeout(() => {
|
|
580
|
+
if (!!this.lastPaginationEvent) {
|
|
581
|
+
this.onPaginationChanged(this.lastPaginationEvent);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
onPaginationChanged(event) {
|
|
586
|
+
if (this.gridApi) {
|
|
587
|
+
const currentPage = this.gridApi.paginationGetCurrentPage();
|
|
588
|
+
const currentPageSize = this.gridApi.paginationGetPageSize();
|
|
589
|
+
let recordsCount = this.props.paging.pageSize >= 0 ? (this.gridApi.paginationIsLastPageFound() ? this.gridApi.paginationGetRowCount() : 0) : this.gridApi.getDisplayedRowCount();
|
|
590
|
+
if (this.state.pageSize !== currentPageSize) {
|
|
591
|
+
if (this.props.paging.onPaginationChanged) {
|
|
592
|
+
this.props.paging.onPaginationChanged(currentPageSize, this.props.paging.pageSize);
|
|
593
|
+
}
|
|
594
|
+
if (!this.state.firstLoadDone) {
|
|
595
|
+
this.loadData();
|
|
596
|
+
this.setState({ firstLoadDone: true });
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
this.setState({ pageSize: currentPageSize, recordsCount: recordsCount, pageIndex: currentPage });
|
|
600
|
+
if (this.indexToJump !== null && this.columnToJump !== null) {
|
|
601
|
+
this.gridApi.setFocusedCell(this.indexToJump, this.columnToJump);
|
|
602
|
+
this.indexToJump = null;
|
|
603
|
+
}
|
|
604
|
+
this.lastPaginationEvent = null;
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
this.lastPaginationEvent = event;
|
|
608
|
+
}
|
|
609
|
+
if (this.props.onPaginationChanged) {
|
|
610
|
+
this.props.onPaginationChanged(event);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
onViewportChanged(event) {
|
|
614
|
+
const dataGridEvent = event;
|
|
615
|
+
const rowsScrollingDelta = this.state.viewport[1] ? event.lastRow + 1 - this.state.viewport[1] : event.lastRow + 1;
|
|
616
|
+
dataGridEvent.rowsScrollingDelta = rowsScrollingDelta;
|
|
617
|
+
this.setState({ viewport: [event.firstRow + 1, event.lastRow + 1] });
|
|
618
|
+
if (this.props.onViewportChanged) {
|
|
619
|
+
this.props.onViewportChanged(event);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
changePagination(pageSize) {
|
|
623
|
+
var _a, _b, _c;
|
|
624
|
+
if (!this.gridApi) {
|
|
625
|
+
return;
|
|
626
|
+
}
|
|
627
|
+
const gridApiWithPrivateAccess = this.gridApi;
|
|
628
|
+
if (pageSize > 0) {
|
|
629
|
+
this.gridApi.updateGridOptions({
|
|
630
|
+
pagination: true,
|
|
631
|
+
paginationAutoPageSize: false,
|
|
632
|
+
paginationPageSize: pageSize
|
|
633
|
+
});
|
|
634
|
+
if (this.props.paging.onPaginationChanged) {
|
|
635
|
+
this.props.paging.onPaginationChanged(pageSize, pageSize);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
else if (pageSize === 0) {
|
|
639
|
+
this.gridApi.updateGridOptions({ pagination: true, paginationAutoPageSize: true });
|
|
640
|
+
const rowHeight = (_c = (_b = (_a = gridApiWithPrivateAccess.beans.gos).getRowHeightAsNumber) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : 1;
|
|
641
|
+
const bodyHeight = gridApiWithPrivateAccess.beans.ctrlsService.params.center.viewportSizeFeature.getBodyHeight();
|
|
642
|
+
let availablePageSize = 1000;
|
|
643
|
+
if (bodyHeight > 0) {
|
|
644
|
+
availablePageSize = Math.floor(bodyHeight / rowHeight);
|
|
645
|
+
}
|
|
646
|
+
if (this.props.paging.pageSize > availablePageSize) {
|
|
647
|
+
this.gridApi.updateGridOptions({ paginationPageSize: 1 });
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
this.gridApi.updateGridOptions({ paginationPageSize: null });
|
|
651
|
+
}
|
|
652
|
+
if (this.props.paging && this.props.paging.onPaginationChanged) {
|
|
653
|
+
this.props.paging.onPaginationChanged(this.state.pageSize, 0);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
this.gridApi.updateGridOptions({ pagination: false, paginationAutoPageSize: false });
|
|
658
|
+
if (this.props.paging && this.props.paging.onPaginationChanged) {
|
|
659
|
+
this.props.paging.onPaginationChanged(this.state.pageSize, -1);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
showMilliseconds(showMilis) {
|
|
664
|
+
var _a, _b;
|
|
665
|
+
(_b = (_a = this.props).onShowMilliseconds) === null || _b === void 0 ? void 0 : _b.call(_a, showMilis, () => {
|
|
666
|
+
if (!this.gridApi) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
if (!this.props.rowModelType || this.props.rowModelType === "clientSide") {
|
|
670
|
+
this.gridApi.refreshClientSideRowModel("group");
|
|
671
|
+
}
|
|
672
|
+
this.gridApi.redrawRows();
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
showYear(showYear) {
|
|
676
|
+
var _a, _b;
|
|
677
|
+
(_b = (_a = this.props).onShowYear) === null || _b === void 0 ? void 0 : _b.call(_a, showYear, () => {
|
|
678
|
+
if (!this.gridApi) {
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
if (!this.props.rowModelType || this.props.rowModelType === "clientSide") {
|
|
682
|
+
this.gridApi.refreshClientSideRowModel("group");
|
|
683
|
+
}
|
|
684
|
+
this.gridApi.redrawRows();
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
changeRowHeight(fontSize, rowHeight) {
|
|
688
|
+
this.setState({ rowHeight: rowHeight }, () => {
|
|
689
|
+
if (this.gridApi) {
|
|
690
|
+
if (this.props.headerHeight === undefined) {
|
|
691
|
+
this.gridApi.updateGridOptions({ headerHeight: calculateRowHeight(fontSize, GRID_DEFAULT_ROW_HEIGHT_DELTA + 2) });
|
|
692
|
+
}
|
|
693
|
+
if (this.props.floatingFiltersHeight === undefined) {
|
|
694
|
+
this.gridApi.updateGridOptions({ floatingFiltersHeight: calculateRowHeight(fontSize, GRID_DEFAULT_ROW_HEIGHT_DELTA + 2) });
|
|
695
|
+
}
|
|
696
|
+
this.gridApi.updateGridOptions({ rowHeight: rowHeight });
|
|
697
|
+
this.gridApi.resetRowHeights();
|
|
698
|
+
this.gridApi.refreshHeader();
|
|
699
|
+
this.gridApi.redrawRows();
|
|
700
|
+
if (this.props.rowModelType === "infinite" && this.props.datasource) {
|
|
701
|
+
this.gridApi.getModel().rowHeight = rowHeight;
|
|
702
|
+
this.gridApi.updateGridOptions({ datasource: this.props.datasource });
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if (this.props.onRowHeightChanged) {
|
|
706
|
+
this.props.onRowHeightChanged(rowHeight);
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
onGoToPage(pageIndex) {
|
|
711
|
+
if (this.gridApi) {
|
|
712
|
+
this.gridApi.paginationGoToPage(pageIndex);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
loadData(callback) {
|
|
716
|
+
if (!this.gridApi) {
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
this.setState({ loading: true });
|
|
720
|
+
if (!this.props.loadingOverlayRenderer) {
|
|
721
|
+
this.gridApi.setGridOption("loading", true);
|
|
722
|
+
}
|
|
723
|
+
this.props.onLoadData((totalRecords) => {
|
|
724
|
+
if (!this.gridApi) {
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
this.gridApi.setGridOption("loading", false);
|
|
728
|
+
this.gridApi.hideOverlay();
|
|
729
|
+
this.setState({ loading: false });
|
|
730
|
+
if (callback) {
|
|
731
|
+
callback();
|
|
732
|
+
}
|
|
733
|
+
if (totalRecords === 0) {
|
|
734
|
+
setTimeout(() => {
|
|
735
|
+
var _a;
|
|
736
|
+
if (!this.isActive()) {
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.showNoRowsOverlay();
|
|
740
|
+
}, 400);
|
|
741
|
+
}
|
|
742
|
+
if (this.props.autofocus) {
|
|
743
|
+
this.focus();
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
focus() {
|
|
748
|
+
setTimeout(() => {
|
|
749
|
+
var _a, _b, _c, _d;
|
|
750
|
+
if (!this.isActive()) {
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
const columnModel = (_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.getColumnState();
|
|
754
|
+
let columnIdToFocus = ((_b = columnModel === null || columnModel === void 0 ? void 0 : columnModel[0]) === null || _b === void 0 ? void 0 : _b.colId) || "name";
|
|
755
|
+
const selectedNodes = (_c = this.gridApi) === null || _c === void 0 ? void 0 : _c.getSelectedNodes();
|
|
756
|
+
const selectedRowIndex = (selectedNodes && selectedNodes.length > 0 && selectedNodes[selectedNodes.length - 1].rowIndex) || 0;
|
|
757
|
+
(_d = this.gridApi) === null || _d === void 0 ? void 0 : _d.setFocusedCell(selectedRowIndex, columnIdToFocus);
|
|
758
|
+
}, 200);
|
|
759
|
+
}
|
|
760
|
+
isActive() {
|
|
761
|
+
return !!this.gridApi && !this.gridApi.isDestroyed();
|
|
762
|
+
}
|
|
763
|
+
onColumnsChanged(event) {
|
|
764
|
+
const columnModel = event.api.getColumnState();
|
|
765
|
+
if (this.props.onColumnsChanged) {
|
|
766
|
+
this.props.onColumnsChanged(columnModel, event);
|
|
767
|
+
}
|
|
768
|
+
this.setState({ columnModel: columnModel });
|
|
769
|
+
}
|
|
770
|
+
setColumnSearchVisible(visible) {
|
|
771
|
+
if (this.gridApi && this.props.filter && this.props.filter.getFilterModel) {
|
|
772
|
+
this.gridApi.setFilterModel(this.props.filter.getFilterModel());
|
|
773
|
+
}
|
|
774
|
+
if (this.props.filter && this.props.filter.onColumnSearchVisible) {
|
|
775
|
+
this.props.filter.onColumnSearchVisible(visible);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
onFilterModified(event) {
|
|
779
|
+
if (this.props.filter && this.props.filter.onFilterModified) {
|
|
780
|
+
this.props.filter.onFilterModified(event);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
onFilterChanged(event) {
|
|
784
|
+
if (this.props.filter && this.props.filter.onFilterChanged) {
|
|
785
|
+
this.props.filter.onFilterChanged(event);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
onFilterConfirmed() {
|
|
789
|
+
if (this.props.filter && this.props.filter.onFilterConfirmed) {
|
|
790
|
+
this.props.filter.onFilterConfirmed();
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
onSortChanged(event) {
|
|
794
|
+
if (this.props.onSortChanged && this.gridApi) {
|
|
795
|
+
const currentSortModel = this.getSortModel();
|
|
796
|
+
if (!isEqual(this.state.sortModel, currentSortModel)) {
|
|
797
|
+
this.setState({ sortModel: currentSortModel }, () => {
|
|
798
|
+
if (this.props.onSortChanged) {
|
|
799
|
+
this.props.onSortChanged(event);
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
showTableConfiguration(show) {
|
|
806
|
+
if (this.props.onTableConfigVisible) {
|
|
807
|
+
this.props.onTableConfigVisible(show);
|
|
808
|
+
}
|
|
809
|
+
this.setState({ tableConfigVisible: show }, () => {
|
|
810
|
+
if (this.gridApi && !this.state.tableConfigVisible) {
|
|
811
|
+
if (!this.props.rowModelType || this.props.rowModelType === "clientSide") {
|
|
812
|
+
this.gridApi.refreshClientSideRowModel("group");
|
|
813
|
+
}
|
|
814
|
+
this.gridApi.redrawRows();
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
showColumnsConfig(show) {
|
|
819
|
+
if (this.props.onColumnsConfigVisible) {
|
|
820
|
+
this.props.onColumnsConfigVisible(show);
|
|
821
|
+
}
|
|
822
|
+
this.columnModelBeforeEdit = cloneDeep(this.state.columnModel);
|
|
823
|
+
this.setState({ columnsConfigVisible: show });
|
|
824
|
+
}
|
|
825
|
+
navigateToNextCell(params) {
|
|
826
|
+
var _a;
|
|
827
|
+
this.lastNavigationEvent = 0;
|
|
828
|
+
var suggestedNextCell = params.nextCellPosition;
|
|
829
|
+
if (!this.gridApi) {
|
|
830
|
+
return suggestedNextCell !== null && suggestedNextCell !== void 0 ? suggestedNextCell : params.previousCellPosition;
|
|
831
|
+
}
|
|
832
|
+
const pageIndex = this.gridApi.paginationGetCurrentPage();
|
|
833
|
+
const totalPages = this.gridApi.paginationGetTotalPages();
|
|
834
|
+
var previousCell = params.previousCellPosition;
|
|
835
|
+
switch ((_a = params.event) === null || _a === void 0 ? void 0 : _a.code) {
|
|
836
|
+
case Key.ArrowDown:
|
|
837
|
+
if ((previousCell.rowIndex + 1) >= this.gridApi.getModel().getRowCount()) {
|
|
838
|
+
if (pageIndex < (totalPages - 1)) {
|
|
839
|
+
this.onGoToPage(pageIndex + 1);
|
|
840
|
+
return {
|
|
841
|
+
rowIndex: 0,
|
|
842
|
+
column: previousCell.column,
|
|
843
|
+
rowPinned: previousCell.rowPinned
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
return {
|
|
848
|
+
rowIndex: previousCell.rowIndex,
|
|
849
|
+
column: previousCell.column,
|
|
850
|
+
rowPinned: previousCell.rowPinned
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
break;
|
|
855
|
+
case Key.ArrowUp:
|
|
856
|
+
if ((previousCell.rowIndex - 1) < 0) {
|
|
857
|
+
if (pageIndex > 0) {
|
|
858
|
+
this.onGoToPage(pageIndex - 1);
|
|
859
|
+
return {
|
|
860
|
+
rowIndex: this.gridApi.getModel().getRowCount() - 1,
|
|
861
|
+
column: previousCell.column,
|
|
862
|
+
rowPinned: previousCell.rowPinned
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
else {
|
|
866
|
+
return {
|
|
867
|
+
rowIndex: previousCell.rowIndex,
|
|
868
|
+
column: previousCell.column,
|
|
869
|
+
rowPinned: previousCell.rowPinned
|
|
870
|
+
};
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
break;
|
|
874
|
+
}
|
|
875
|
+
return suggestedNextCell !== null && suggestedNextCell !== void 0 ? suggestedNextCell : params.previousCellPosition;
|
|
876
|
+
}
|
|
877
|
+
suppressKeyboardEvent(params) {
|
|
878
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
879
|
+
if (!this.gridApi || params.event.type === "keypress") {
|
|
880
|
+
return false;
|
|
881
|
+
}
|
|
882
|
+
const pageIndex = this.gridApi.paginationGetCurrentPage();
|
|
883
|
+
const totalPages = this.gridApi.paginationGetTotalPages();
|
|
884
|
+
switch (params.event.code) {
|
|
885
|
+
case Key.ArrowDown:
|
|
886
|
+
case Key.ArrowUp:
|
|
887
|
+
case Key.ArrowLeft:
|
|
888
|
+
case Key.ArrowRight:
|
|
889
|
+
if (params.editing && params.event.altKey) {
|
|
890
|
+
const focusedCell = this.gridApi.getFocusedCell();
|
|
891
|
+
if (focusedCell) {
|
|
892
|
+
let indexToJump;
|
|
893
|
+
let columnToJump;
|
|
894
|
+
if (params.event.code === Key.ArrowDown) {
|
|
895
|
+
indexToJump = focusedCell.rowIndex + 1;
|
|
896
|
+
columnToJump = focusedCell.column;
|
|
897
|
+
if (indexToJump >= this.gridApi.getModel().getRowCount()) {
|
|
898
|
+
if (pageIndex < (totalPages - 1)) {
|
|
899
|
+
this.onGoToPage(pageIndex + 1);
|
|
900
|
+
indexToJump = 0;
|
|
901
|
+
}
|
|
902
|
+
else {
|
|
903
|
+
indexToJump = focusedCell.rowIndex;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
this.lastNavigationEvent = 0;
|
|
907
|
+
this.indexToJump = indexToJump;
|
|
908
|
+
this.columnToJump = columnToJump;
|
|
909
|
+
setTimeout(() => {
|
|
910
|
+
var _a;
|
|
911
|
+
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.startEditingCell({
|
|
912
|
+
rowIndex: indexToJump,
|
|
913
|
+
colKey: columnToJump,
|
|
914
|
+
key: Key.Enter
|
|
915
|
+
});
|
|
916
|
+
}, 0);
|
|
917
|
+
return true;
|
|
918
|
+
}
|
|
919
|
+
else if (params.event.code === Key.ArrowUp) {
|
|
920
|
+
indexToJump = focusedCell.rowIndex - 1;
|
|
921
|
+
columnToJump = focusedCell.column;
|
|
922
|
+
if (indexToJump < 0) {
|
|
923
|
+
if (pageIndex > 0) {
|
|
924
|
+
this.onGoToPage(pageIndex - 1);
|
|
925
|
+
indexToJump = this.gridApi.getModel().getRowCount() - 1;
|
|
926
|
+
}
|
|
927
|
+
else {
|
|
928
|
+
indexToJump = focusedCell.rowIndex;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
this.lastNavigationEvent = 0;
|
|
932
|
+
this.indexToJump = indexToJump;
|
|
933
|
+
this.columnToJump = columnToJump;
|
|
934
|
+
setTimeout(() => {
|
|
935
|
+
var _a;
|
|
936
|
+
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.startEditingCell({
|
|
937
|
+
rowIndex: indexToJump,
|
|
938
|
+
colKey: columnToJump,
|
|
939
|
+
key: Key.Enter
|
|
940
|
+
});
|
|
941
|
+
}, 0);
|
|
942
|
+
return true;
|
|
943
|
+
}
|
|
944
|
+
else if (params.event.code === Key.ArrowLeft) {
|
|
945
|
+
this.gridApi.tabToPreviousCell();
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
948
|
+
else {
|
|
949
|
+
this.gridApi.tabToNextCell();
|
|
950
|
+
break;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
break;
|
|
955
|
+
case Key.PageDown:
|
|
956
|
+
this.lastNavigationEvent = 0;
|
|
957
|
+
if (pageIndex < (totalPages - 1)) {
|
|
958
|
+
this.gridApi.paginationGoToNextPage();
|
|
959
|
+
const focusedCell = this.gridApi.getFocusedCell();
|
|
960
|
+
if (focusedCell) {
|
|
961
|
+
this.indexToJump = Math.min(focusedCell.rowIndex + this.gridApi.paginationGetPageSize(), this.gridApi.paginationGetRowCount());
|
|
962
|
+
this.columnToJump = focusedCell.column;
|
|
963
|
+
return true;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
break;
|
|
967
|
+
case Key.PageUp:
|
|
968
|
+
this.lastNavigationEvent = 0;
|
|
969
|
+
if (pageIndex > 0) {
|
|
970
|
+
this.gridApi.paginationGoToPreviousPage();
|
|
971
|
+
const focusedCell = this.gridApi.getFocusedCell();
|
|
972
|
+
if (focusedCell) {
|
|
973
|
+
this.indexToJump = Math.max(focusedCell.rowIndex - this.gridApi.paginationGetPageSize(), 0);
|
|
974
|
+
this.columnToJump = focusedCell.column;
|
|
975
|
+
return true;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
break;
|
|
979
|
+
case Key.End:
|
|
980
|
+
this.lastNavigationEvent = 0;
|
|
981
|
+
if (pageIndex < (totalPages - 1)) {
|
|
982
|
+
this.gridApi.paginationGoToLastPage();
|
|
983
|
+
const focusedCell = this.gridApi.getFocusedCell();
|
|
984
|
+
if (focusedCell) {
|
|
985
|
+
this.indexToJump = this.gridApi.paginationGetRowCount() - 1;
|
|
986
|
+
this.columnToJump = focusedCell.column;
|
|
987
|
+
return true;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
break;
|
|
991
|
+
case Key.Home:
|
|
992
|
+
this.lastNavigationEvent = 0;
|
|
993
|
+
if (pageIndex > 0) {
|
|
994
|
+
this.gridApi.paginationGoToFirstPage();
|
|
995
|
+
const focusedCell = this.gridApi.getFocusedCell();
|
|
996
|
+
if (focusedCell) {
|
|
997
|
+
this.indexToJump = 0;
|
|
998
|
+
this.columnToJump = focusedCell.column;
|
|
999
|
+
return true;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
break;
|
|
1003
|
+
case "KeyA":
|
|
1004
|
+
if (params.event.ctrlKey && !params.editing) {
|
|
1005
|
+
var firstRow = this.gridApi.getFirstDisplayedRowIndex();
|
|
1006
|
+
var lastRow = this.gridApi.getLastDisplayedRowIndex();
|
|
1007
|
+
this.gridApi.deselectAll();
|
|
1008
|
+
if (this.props.rowModelType === "infinite") {
|
|
1009
|
+
for (let i = firstRow; i <= lastRow; i++) {
|
|
1010
|
+
(_a = this.gridApi.getDisplayedRowAtIndex(i)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
this.gridApi.forEachNodeAfterFilter(function (node, index) {
|
|
1015
|
+
if (index >= firstRow && index <= lastRow) {
|
|
1016
|
+
node.setSelected(true);
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
break;
|
|
1022
|
+
case "KeyI":
|
|
1023
|
+
if (params.event.ctrlKey) {
|
|
1024
|
+
const focusedCell = this.gridApi.getFocusedCell();
|
|
1025
|
+
const column = (_c = (_b = this.gridApi) === null || _b === void 0 ? void 0 : _b.getColumn("objectId")) !== null && _c !== void 0 ? _c : (_d = this.gridApi) === null || _d === void 0 ? void 0 : _d.getColumn("id");
|
|
1026
|
+
if (focusedCell && column) {
|
|
1027
|
+
const displayedRowAtIndex = this.gridApi.getDisplayedRowAtIndex(focusedCell.rowIndex);
|
|
1028
|
+
if (displayedRowAtIndex) {
|
|
1029
|
+
ClipboardUtils.copyToClipboard(this.getValue(column, displayedRowAtIndex));
|
|
1030
|
+
}
|
|
1031
|
+
this.gridApi.setFocusedCell(focusedCell.rowIndex, focusedCell.column.getId());
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
break;
|
|
1035
|
+
case "KeyB":
|
|
1036
|
+
if (params.event.ctrlKey) {
|
|
1037
|
+
const focusedCell = this.gridApi.getFocusedCell();
|
|
1038
|
+
const column = (_f = (_e = this.gridApi) === null || _e === void 0 ? void 0 : _e.getColumn("objectName")) !== null && _f !== void 0 ? _f : (_g = this.gridApi) === null || _g === void 0 ? void 0 : _g.getColumn("name");
|
|
1039
|
+
if (focusedCell && column) {
|
|
1040
|
+
const displayedRowAtIndex1 = this.gridApi.getDisplayedRowAtIndex(focusedCell.rowIndex);
|
|
1041
|
+
if (displayedRowAtIndex1) {
|
|
1042
|
+
ClipboardUtils.copyToClipboard(this.getValue(column, displayedRowAtIndex1));
|
|
1043
|
+
}
|
|
1044
|
+
this.gridApi.setFocusedCell(focusedCell.rowIndex, focusedCell.column.getId());
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
break;
|
|
1048
|
+
case "KeyC":
|
|
1049
|
+
if (params.event.ctrlKey && !params.editing) {
|
|
1050
|
+
const focusedCell = this.gridApi.getFocusedCell();
|
|
1051
|
+
if (focusedCell) {
|
|
1052
|
+
const displayedRowAtIndex2 = this.gridApi.getDisplayedRowAtIndex(focusedCell.rowIndex);
|
|
1053
|
+
if (displayedRowAtIndex2) {
|
|
1054
|
+
ClipboardUtils.copyToClipboard(this.getValue(focusedCell.column, displayedRowAtIndex2, true));
|
|
1055
|
+
}
|
|
1056
|
+
this.gridApi.setFocusedCell(focusedCell.rowIndex, focusedCell.column.getId());
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
break;
|
|
1060
|
+
case Key.Enter:
|
|
1061
|
+
(_j = (_h = this.props).onEnter) === null || _j === void 0 ? void 0 : _j.call(_h);
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
(_l = (_k = this.props).onKeyPressed) === null || _l === void 0 ? void 0 : _l.call(_k, params.event);
|
|
1065
|
+
return false;
|
|
1066
|
+
}
|
|
1067
|
+
getValue(column, row, doNotReplaceNewline) {
|
|
1068
|
+
var _a, _b;
|
|
1069
|
+
let formattedValue = (_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.getCellValue({ rowNode: row, colKey: column });
|
|
1070
|
+
if (formattedValue && typeof formattedValue === "string" && formattedValue.indexOf(EXPORT_SEPARATOR) > 0 && !doNotReplaceNewline) {
|
|
1071
|
+
formattedValue = formattedValue.replace(/[\n\r]+/, ' ');
|
|
1072
|
+
}
|
|
1073
|
+
const valueFormatter = column.getColDef().valueFormatter;
|
|
1074
|
+
if (valueFormatter) {
|
|
1075
|
+
const params = {
|
|
1076
|
+
data: row.data,
|
|
1077
|
+
node: row,
|
|
1078
|
+
column: column,
|
|
1079
|
+
colDef: column.getColDef(),
|
|
1080
|
+
api: this.gridApi,
|
|
1081
|
+
context: (_b = this.gridApi) === null || _b === void 0 ? void 0 : _b.getGridOption('context'),
|
|
1082
|
+
value: formattedValue
|
|
1083
|
+
};
|
|
1084
|
+
if (typeof valueFormatter === 'function') {
|
|
1085
|
+
formattedValue = valueFormatter === null || valueFormatter === void 0 ? void 0 : valueFormatter(params);
|
|
1086
|
+
}
|
|
1087
|
+
else if (typeof valueFormatter === 'string') {
|
|
1088
|
+
formattedValue = at(row.data, valueFormatter)[0];
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
return formattedValue;
|
|
1092
|
+
}
|
|
1093
|
+
async getExportContent(progressPopup, props) {
|
|
1094
|
+
if (!this.gridApi) {
|
|
1095
|
+
return [];
|
|
1096
|
+
}
|
|
1097
|
+
const model = this.gridApi.getModel();
|
|
1098
|
+
const tableContent = [];
|
|
1099
|
+
const columns = this.gridApi.getAllDisplayedColumns().map((column) => {
|
|
1100
|
+
const columnTypes = column.getColDef().type;
|
|
1101
|
+
return {
|
|
1102
|
+
column: column,
|
|
1103
|
+
displayName: column.getColDef().headerName,
|
|
1104
|
+
isDateField: columnTypes && columnTypes.indexOf("dateColumn") >= 0,
|
|
1105
|
+
isDateTimeField: columnTypes && columnTypes.indexOf("dateTimeColumn") >= 0
|
|
1106
|
+
};
|
|
1107
|
+
});
|
|
1108
|
+
if (columns.length === 0) {
|
|
1109
|
+
return tableContent;
|
|
1110
|
+
}
|
|
1111
|
+
tableContent.push(columns.map((column) => { var _a; return (_a = column.displayName) !== null && _a !== void 0 ? _a : ""; }));
|
|
1112
|
+
let rowCount;
|
|
1113
|
+
let tableNodes = [];
|
|
1114
|
+
if (model.getType() === "clientSide") {
|
|
1115
|
+
if (props.onlySelectedNodes) {
|
|
1116
|
+
rowCount = 0;
|
|
1117
|
+
this.gridApi.forEachNodeAfterFilterAndSort((node) => {
|
|
1118
|
+
if (node.isSelected()) {
|
|
1119
|
+
tableNodes.push(node);
|
|
1120
|
+
rowCount++;
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
else {
|
|
1125
|
+
rowCount = model.getRowCount();
|
|
1126
|
+
this.gridApi.forEachNodeAfterFilterAndSort((node) => {
|
|
1127
|
+
tableNodes.push(node);
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
else {
|
|
1132
|
+
if (props.onlySelectedNodes) {
|
|
1133
|
+
const selectedNodes = this.gridApi.getSelectedNodes();
|
|
1134
|
+
rowCount = selectedNodes.length;
|
|
1135
|
+
selectedNodes.forEach((node) => {
|
|
1136
|
+
tableNodes.push(node);
|
|
1137
|
+
});
|
|
1138
|
+
tableNodes.sort((a, b) => { var _a, _b; return ((_a = a.rowIndex) !== null && _a !== void 0 ? _a : 0) > ((_b = b.rowIndex) !== null && _b !== void 0 ? _b : 0) ? 1 : (a.rowIndex === b.rowIndex) ? 0 : -1; });
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
const virtualRowCount = model.getRowCount();
|
|
1142
|
+
rowCount = virtualRowCount ? virtualRowCount : 0;
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
progressPopup === null || progressPopup === void 0 ? void 0 : progressPopup.setRecordCount(rowCount);
|
|
1146
|
+
let percentStep = Math.floor(rowCount / 100);
|
|
1147
|
+
if (percentStep < 100) {
|
|
1148
|
+
percentStep = 100;
|
|
1149
|
+
}
|
|
1150
|
+
if (model.getType() === "clientSide" || props.onlySelectedNodes) {
|
|
1151
|
+
for (let index = 0; index < tableNodes.length; index++) {
|
|
1152
|
+
const record = [];
|
|
1153
|
+
columns.forEach((column) => {
|
|
1154
|
+
let value = this.getValue(column.column, tableNodes[index]);
|
|
1155
|
+
record.push(value);
|
|
1156
|
+
});
|
|
1157
|
+
tableContent.push(record);
|
|
1158
|
+
if (index % percentStep === 0) {
|
|
1159
|
+
progressPopup === null || progressPopup === void 0 ? void 0 : progressPopup.update(Math.floor(index / rowCount * 100) - 1);
|
|
1160
|
+
await TimeUtils.sleep(100);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
else {
|
|
1165
|
+
for (let index = 0; index < rowCount; index++) {
|
|
1166
|
+
let row = undefined;
|
|
1167
|
+
let record = [];
|
|
1168
|
+
do {
|
|
1169
|
+
record = [];
|
|
1170
|
+
do {
|
|
1171
|
+
row = model.getRow(index);
|
|
1172
|
+
if (!row || !row.data) {
|
|
1173
|
+
await TimeUtils.sleep(100);
|
|
1174
|
+
}
|
|
1175
|
+
} while (!row || !row.data);
|
|
1176
|
+
columns.forEach((column) => {
|
|
1177
|
+
record.push(this.getValue(column.column, row));
|
|
1178
|
+
});
|
|
1179
|
+
if (record.filter((cell) => !!cell).length === 0) {
|
|
1180
|
+
await TimeUtils.sleep(100);
|
|
1181
|
+
}
|
|
1182
|
+
} while (record.filter((cell) => !!cell).length === 0);
|
|
1183
|
+
tableContent.push(record);
|
|
1184
|
+
if (index % percentStep === 0) {
|
|
1185
|
+
progressPopup === null || progressPopup === void 0 ? void 0 : progressPopup.update(Math.floor(index / rowCount * 100) - 1);
|
|
1186
|
+
await TimeUtils.sleep(100);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
progressPopup === null || progressPopup === void 0 ? void 0 : progressPopup.update(99);
|
|
1191
|
+
await TimeUtils.sleep(300);
|
|
1192
|
+
return tableContent;
|
|
1193
|
+
}
|
|
1194
|
+
onCellFocused(event) {
|
|
1195
|
+
var _a, _b, _c, _d, _e;
|
|
1196
|
+
const row = event.rowIndex !== null ? (_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.getDisplayedRowAtIndex(event.rowIndex) : undefined;
|
|
1197
|
+
if (row) {
|
|
1198
|
+
if (this.lastNavigationEvent === 0 && KeyboardUtils.isKeyPressed(Key.Shift) && this.lastCellFocus && this.lastCellFocus.rowIndex !== event.rowIndex) {
|
|
1199
|
+
if (!row.isSelected()) {
|
|
1200
|
+
row.setSelected(true, false);
|
|
1201
|
+
}
|
|
1202
|
+
else if (((_b = this.lastCellFocus) === null || _b === void 0 ? void 0 : _b.rowIndex) !== null) {
|
|
1203
|
+
const lastFocusedRow = (_c = this.gridApi) === null || _c === void 0 ? void 0 : _c.getDisplayedRowAtIndex(this.lastCellFocus.rowIndex);
|
|
1204
|
+
if (lastFocusedRow === null || lastFocusedRow === void 0 ? void 0 : lastFocusedRow.isSelected()) {
|
|
1205
|
+
lastFocusedRow.setSelected(false, false);
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
else if (!row.isSelected() && !KeyboardUtils.isKeyPressed(Key.Control) && !KeyboardUtils.isKeyPressed(Key.Shift)) {
|
|
1210
|
+
row.setSelected(true, true);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
(_e = (_d = this.props).onCellFocused) === null || _e === void 0 ? void 0 : _e.call(_d, event);
|
|
1214
|
+
this.lastCellFocus = event;
|
|
1215
|
+
}
|
|
1216
|
+
onCellMouseDown(e) {
|
|
1217
|
+
var _a, _b;
|
|
1218
|
+
this.lastNavigationEvent = 1;
|
|
1219
|
+
if (e.rowIndex !== null) {
|
|
1220
|
+
this.setFocusedCellDebounced(e.rowIndex, e.column, e.rowPinned !== null ? e.rowPinned : undefined);
|
|
1221
|
+
}
|
|
1222
|
+
(_b = (_a = this.props).onCellMouseDown) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
1223
|
+
}
|
|
1224
|
+
setFocusedCellDebounced(rowIndex, column, rowPinned) {
|
|
1225
|
+
var _a;
|
|
1226
|
+
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.setFocusedCell(rowIndex, column, rowPinned);
|
|
1227
|
+
}
|
|
1228
|
+
onCellContextMenu(event) {
|
|
1229
|
+
this.setState({ contextMenuVisible: !!event });
|
|
1230
|
+
if (event.node) {
|
|
1231
|
+
if (!event.node.isSelected()) {
|
|
1232
|
+
event.node.setSelected(true, true);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
loadingOverlayRenderer() {
|
|
1237
|
+
if (this.props.loadingOverlayRenderer) {
|
|
1238
|
+
const loadingOverlay = this.props.loadingOverlayRenderer();
|
|
1239
|
+
if (loadingOverlay) {
|
|
1240
|
+
return loadingOverlay;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
return React.createElement("div", null,
|
|
1244
|
+
React.createElement(LoadingOutlined, { style: { fontSize: 40, color: "#1890ff" } }));
|
|
1245
|
+
}
|
|
1246
|
+
noRecordsOverlayRenderer() {
|
|
1247
|
+
if (this.props.noRecordsOverlayRenderer) {
|
|
1248
|
+
const noRecordsOverlay = this.props.noRecordsOverlayRenderer();
|
|
1249
|
+
if (noRecordsOverlay) {
|
|
1250
|
+
return noRecordsOverlay;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
return (React.createElement(Empty, { description: i18n("No records found."), imageStyle: { height: "8vh" } },
|
|
1254
|
+
React.createElement(Button, { type: "primary", onClick: () => {
|
|
1255
|
+
if (this.props.search && this.props.search.onSearch) {
|
|
1256
|
+
this.props.search.onSearch();
|
|
1257
|
+
}
|
|
1258
|
+
} },
|
|
1259
|
+
React.createElement(SearchOutlined, null),
|
|
1260
|
+
" ",
|
|
1261
|
+
i18n("Search"))));
|
|
1262
|
+
}
|
|
1263
|
+
setRowData(dataArray) {
|
|
1264
|
+
var _a;
|
|
1265
|
+
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.updateGridOptions({ rowData: dataArray });
|
|
1266
|
+
}
|
|
1267
|
+
onRowDataUpdated(event) {
|
|
1268
|
+
if (!this.gridApi) {
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1271
|
+
const currentPage = this.gridApi.paginationGetCurrentPage();
|
|
1272
|
+
const recordsCount = this.props.paging.pageSize >= 0 ? (this.gridApi.paginationIsLastPageFound() ? this.gridApi.paginationGetRowCount() : 0) : this.gridApi.getDisplayedRowCount();
|
|
1273
|
+
this.setState({ recordsCount: recordsCount, pageIndex: currentPage });
|
|
1274
|
+
if (this.props.onRowDataUpdated) {
|
|
1275
|
+
this.props.onRowDataUpdated(event);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
_getRowStyle(params) {
|
|
1279
|
+
const rowStyleRules = this.props.rowStyleRules;
|
|
1280
|
+
if (rowStyleRules) {
|
|
1281
|
+
const style = {};
|
|
1282
|
+
rowStyleRules.forEach((rowStyleRule) => {
|
|
1283
|
+
if (rowStyleRule.expression) {
|
|
1284
|
+
if (!rowStyleRuleCompiledExpressions[rowStyleRule.expression]) {
|
|
1285
|
+
rowStyleRuleCompiledExpressions[rowStyleRule.expression] = compileExpression(rowStyleRule.expression);
|
|
1286
|
+
}
|
|
1287
|
+
if (rowStyleRuleCompiledExpressions[rowStyleRule.expression](params.node.data)) {
|
|
1288
|
+
Object.assign(style, rowStyleRule.style);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
else {
|
|
1292
|
+
Object.assign(style, rowStyleRule.style);
|
|
1293
|
+
}
|
|
1294
|
+
});
|
|
1295
|
+
if (!style.color) {
|
|
1296
|
+
style.color = null;
|
|
1297
|
+
}
|
|
1298
|
+
else if (typeof style.color === "object") {
|
|
1299
|
+
style.color = `rgba(${style.color.r},${style.color.g},${style.color.b},${style.color.a})`;
|
|
1300
|
+
}
|
|
1301
|
+
if (!style.backgroundColor) {
|
|
1302
|
+
style.backgroundColor = "inherit";
|
|
1303
|
+
}
|
|
1304
|
+
else if (typeof style.backgroundColor === "object") {
|
|
1305
|
+
style.backgroundColor = `rgba(${style.backgroundColor.r},${style.backgroundColor.g},${style.backgroundColor.b},${style.backgroundColor.a})`;
|
|
1306
|
+
}
|
|
1307
|
+
if (!style.fontWeight) {
|
|
1308
|
+
style.fontWeight = "inherit";
|
|
1309
|
+
}
|
|
1310
|
+
const fontSize = style.fontSize;
|
|
1311
|
+
if (style.fontSize) {
|
|
1312
|
+
style.fontSize = style.fontSize + "px";
|
|
1313
|
+
}
|
|
1314
|
+
else {
|
|
1315
|
+
style.fontSize = "inherit";
|
|
1316
|
+
}
|
|
1317
|
+
if (style.rowHeightDelta) {
|
|
1318
|
+
const lineHeight = calculateLineHeight(fontSize, style.rowHeightDelta);
|
|
1319
|
+
if (style.rowHeightDelta) {
|
|
1320
|
+
delete style.rowHeightDelta;
|
|
1321
|
+
}
|
|
1322
|
+
style.lineHeight = lineHeight + "px";
|
|
1323
|
+
}
|
|
1324
|
+
else {
|
|
1325
|
+
const lineHeight = calculateLineHeight(fontSize, GRID_DEFAULT_ROW_HEIGHT_DELTA);
|
|
1326
|
+
style.lineHeight = lineHeight + "px";
|
|
1327
|
+
}
|
|
1328
|
+
if (this.props.getRowStyle) {
|
|
1329
|
+
const rowStyle = this.props.getRowStyle(params);
|
|
1330
|
+
if (rowStyle) {
|
|
1331
|
+
return Object.assign(style, rowStyle);
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
return style;
|
|
1335
|
+
}
|
|
1336
|
+
return DataGrid.EMPTY_STYLE;
|
|
1337
|
+
}
|
|
1338
|
+
_getRowHeight() {
|
|
1339
|
+
return this.state.rowHeight;
|
|
1340
|
+
}
|
|
1341
|
+
_getCellStyle(params) {
|
|
1342
|
+
var _a;
|
|
1343
|
+
const fontSize = this.state.fontSize;
|
|
1344
|
+
const cellStyles = { "fontSize": fontSize + "px" };
|
|
1345
|
+
if (params.colDef.type && params.colDef.type.indexOf("alignRight") >= 0) {
|
|
1346
|
+
cellStyles["textAlign"] = "right";
|
|
1347
|
+
}
|
|
1348
|
+
if ((_a = params.colDef.cellRendererParams) === null || _a === void 0 ? void 0 : _a.originalCellStyle) {
|
|
1349
|
+
const originalCellStylesOrHandler = params.colDef.cellRendererParams.originalCellStyle;
|
|
1350
|
+
if (typeof originalCellStylesOrHandler === "object") {
|
|
1351
|
+
Object.assign(cellStyles, originalCellStylesOrHandler);
|
|
1352
|
+
}
|
|
1353
|
+
else if (typeof originalCellStylesOrHandler === "function") {
|
|
1354
|
+
const originalCellStyles = originalCellStylesOrHandler(params);
|
|
1355
|
+
if (originalCellStyles) {
|
|
1356
|
+
Object.assign(cellStyles, originalCellStyles);
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
return cellStyles;
|
|
1361
|
+
}
|
|
1362
|
+
getDefaultColDefinition(colDef) {
|
|
1363
|
+
if (colDef) {
|
|
1364
|
+
return Object.assign(Object.assign({}, colDef), { suppressKeyboardEvent: this.suppressKeyboardEvent });
|
|
1365
|
+
}
|
|
1366
|
+
else {
|
|
1367
|
+
return { suppressKeyboardEvent: this.suppressKeyboardEvent };
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
getCustomComponents(components) {
|
|
1371
|
+
let customComponents = gridFrameworkComponents;
|
|
1372
|
+
if (components) {
|
|
1373
|
+
customComponents = Object.assign(gridFrameworkComponents, components);
|
|
1374
|
+
}
|
|
1375
|
+
return customComponents;
|
|
1376
|
+
}
|
|
1377
|
+
onPageOrientationChange(pageOrientation) {
|
|
1378
|
+
this.setState({ pageOrientation: pageOrientation });
|
|
1379
|
+
}
|
|
1380
|
+
onExport(start) {
|
|
1381
|
+
this.setState({ exporting: start });
|
|
1382
|
+
}
|
|
1383
|
+
renderNavigationPanel() {
|
|
1384
|
+
var _a, _b;
|
|
1385
|
+
return (React.createElement(React.Fragment, null,
|
|
1386
|
+
this.props.toolbar && this.props.toolbar.renderToolbar ? this.props.toolbar.renderToolbar(this.renderToolBarWithSearch()) : this.renderToolBarWithSearch(),
|
|
1387
|
+
this.props.paging.pageSize >= 0 &&
|
|
1388
|
+
React.createElement(DataGridPagination, { disabled: this.state.loading, current: this.state.pageIndex ? this.state.pageIndex + 1 : 1, pageSize: this.state.pageSize ? this.state.pageSize : 20, total: (_a = this.state.recordsCount) !== null && _a !== void 0 ? _a : 1, onGoToPage: page => {
|
|
1389
|
+
this.onGoToPage(page - 1);
|
|
1390
|
+
} }),
|
|
1391
|
+
this.props.paging.pageSize < 0 && this.state.recordsCount && !((_b = this.props.toolbar) === null || _b === void 0 ? void 0 : _b.hideRecordCount) ?
|
|
1392
|
+
React.createElement("span", { style: {
|
|
1393
|
+
flex: "0 1 auto",
|
|
1394
|
+
textAlign: "right",
|
|
1395
|
+
whiteSpace: "nowrap",
|
|
1396
|
+
margin: "0 12px",
|
|
1397
|
+
lineHeight: "32px",
|
|
1398
|
+
} }, `${this.state.viewport[0]}-${this.state.viewport[1]} ${i18n('of')} ${this.state.recordsCount}`)
|
|
1399
|
+
: undefined));
|
|
1400
|
+
}
|
|
1401
|
+
renderToolBarWithSearch() {
|
|
1402
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1403
|
+
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 :
|
|
1404
|
+
_a.toolbarButtons,
|
|
1405
|
+
React.createElement(Dropdown, { trigger: ["click"], menu: getContextMenu({
|
|
1406
|
+
showMilliseconds: !!this.props.showMilliseconds,
|
|
1407
|
+
showYear: !this.props.hideYear,
|
|
1408
|
+
renderer: (_b = this.props.exportMenu) === null || _b === void 0 ? void 0 : _b.renderer,
|
|
1409
|
+
onClick: (_c = this.props.exportMenu) === null || _c === void 0 ? void 0 : _c.onClick,
|
|
1410
|
+
getExportContent: this.getExportContent,
|
|
1411
|
+
pageOrientation: this.state.pageOrientation,
|
|
1412
|
+
exporting: this.state.exporting,
|
|
1413
|
+
onPageOrientationChange: this.onPageOrientationChange,
|
|
1414
|
+
onExport: this.onExport
|
|
1415
|
+
}), disabled: this.state.loading },
|
|
1416
|
+
React.createElement(Button, { title: i18n("Export") },
|
|
1417
|
+
React.createElement(DownloadOutlined, null))),
|
|
1418
|
+
React.createElement(Dropdown, { trigger: ["click"], menu: this.getSettingsMenu() },
|
|
1419
|
+
React.createElement(Button, { title: i18n("Extended table features"), disabled: this.state.loading },
|
|
1420
|
+
React.createElement(TableOutlined, null))),
|
|
1421
|
+
!((_d = this.props.search) === null || _d === void 0 ? void 0 : _d.hidden) && !((_e = this.props.search) === null || _e === void 0 ? void 0 : _e.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, inputReadonly: this.props.search ? this.props.search.inputReadonly : 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) }), (_g = (_f = this.props.search) === null || _f === void 0 ? void 0 : _f.searchRenderer) === null || _g === void 0 ? void 0 :
|
|
1422
|
+
_g.call(_f),
|
|
1423
|
+
React.createElement(Button, { title: ((_h = this.props.search) === null || _h === void 0 ? void 0 : _h.hidden) ? i18n("Refresh") : i18n("Search"), className: "search-btn " + (this.props.search && this.props.search.searchButtonClassName ? this.props.search.searchButtonClassName : ""), disabled: (_j = this.props.search) === null || _j === void 0 ? void 0 : _j.searchButtonDisabled, type: "primary", onClick: () => {
|
|
1424
|
+
if (this.props.search && this.props.search.onSearch) {
|
|
1425
|
+
this.props.search.onSearch();
|
|
1426
|
+
}
|
|
1427
|
+
} }, this.state.loading ? React.createElement(LoadingOutlined, null) : (((_k = this.props.search) === null || _k === void 0 ? void 0 : _k.hidden) ? React.createElement(ReloadOutlined, null) :
|
|
1428
|
+
React.createElement(SearchOutlined, null)))));
|
|
1429
|
+
}
|
|
1430
|
+
getSettingsMenu() {
|
|
1431
|
+
var _a;
|
|
1432
|
+
let menuItems = [
|
|
1433
|
+
{
|
|
1434
|
+
key: "columnFilter",
|
|
1435
|
+
icon: React.createElement(FileSearchOutlined, null),
|
|
1436
|
+
className: this.props.filter && this.props.filter.columnSearchVisible ? "ant-dropdown-menu-item-selected" : "",
|
|
1437
|
+
title: i18n("Turn on/off column filter"),
|
|
1438
|
+
label: i18n("Column Filter"),
|
|
1439
|
+
},
|
|
1440
|
+
{
|
|
1441
|
+
key: "autosizeAllColumns",
|
|
1442
|
+
icon: React.createElement(ColumnWidthOutlined, null),
|
|
1443
|
+
label: i18n("Autosize All Columns"),
|
|
1444
|
+
},
|
|
1445
|
+
{
|
|
1446
|
+
key: "columnsConfig",
|
|
1447
|
+
icon: React.createElement(ControlOutlined, null),
|
|
1448
|
+
label: i18n("Columns Configuration"),
|
|
1449
|
+
},
|
|
1450
|
+
{
|
|
1451
|
+
key: "columnsAndAdvancedConfigDivider",
|
|
1452
|
+
type: "divider"
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
key: "advancedConfig",
|
|
1456
|
+
icon: React.createElement(SettingOutlined, null),
|
|
1457
|
+
label: i18n("Advanced Settings"),
|
|
1458
|
+
}
|
|
1459
|
+
];
|
|
1460
|
+
if ((_a = this.props.settingsMenu) === null || _a === void 0 ? void 0 : _a.renderer) {
|
|
1461
|
+
menuItems = this.props.settingsMenu.renderer(menuItems);
|
|
1462
|
+
}
|
|
1463
|
+
return {
|
|
1464
|
+
items: menuItems,
|
|
1465
|
+
onClick: (menuInfo) => {
|
|
1466
|
+
var _a, _b;
|
|
1467
|
+
switch (menuInfo.key) {
|
|
1468
|
+
case "columnFilter":
|
|
1469
|
+
const visible = !(this.props.filter && this.props.filter.columnSearchVisible);
|
|
1470
|
+
this.setColumnSearchVisible(visible);
|
|
1471
|
+
break;
|
|
1472
|
+
case "autosizeAllColumns":
|
|
1473
|
+
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.autoSizeAllColumns();
|
|
1474
|
+
break;
|
|
1475
|
+
case "columnsConfig":
|
|
1476
|
+
this.showColumnsConfig(true);
|
|
1477
|
+
break;
|
|
1478
|
+
case "advancedConfig":
|
|
1479
|
+
this.showTableConfiguration(true);
|
|
1480
|
+
break;
|
|
1481
|
+
default:
|
|
1482
|
+
if ((_b = this.props.settingsMenu) === null || _b === void 0 ? void 0 : _b.onClick) {
|
|
1483
|
+
this.props.settingsMenu.onClick(menuInfo.key + "");
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1489
|
+
getAdaptedColumnDefs(columnDefs, floatingFilterEnabled, disableColumnDefsPreprocessing) {
|
|
1490
|
+
if (columnDefs.length === 0) {
|
|
1491
|
+
return undefined;
|
|
1492
|
+
}
|
|
1493
|
+
if (disableColumnDefsPreprocessing) {
|
|
1494
|
+
return columnDefs;
|
|
1495
|
+
}
|
|
1496
|
+
const adaptedColumnDefs = columnDefs ? columnDefs.map((columnDef) => {
|
|
1497
|
+
var _a, _b;
|
|
1498
|
+
const _c = columnDef, { group, floatingFilter, hide, cellEditorPopup, editable } = _c, rest = __rest(_c, ["group", "floatingFilter", "hide", "cellEditorPopup", "editable"]);
|
|
1499
|
+
let floatingFilterEnabledForColumn = !!floatingFilter;
|
|
1500
|
+
if (typeof columnDef.type === "string") {
|
|
1501
|
+
if (!!((_a = this.columnTypes[columnDef.type]) === null || _a === void 0 ? void 0 : _a.floatingFilter)) {
|
|
1502
|
+
floatingFilterEnabledForColumn = true;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
else {
|
|
1506
|
+
(_b = columnDef.type) === null || _b === void 0 ? void 0 : _b.forEach((type) => {
|
|
1507
|
+
var _a;
|
|
1508
|
+
if (!!((_a = this.columnTypes[type]) === null || _a === void 0 ? void 0 : _a.floatingFilter)) {
|
|
1509
|
+
floatingFilterEnabledForColumn = true;
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1512
|
+
}
|
|
1513
|
+
return Object.assign(Object.assign({}, rest), { floatingFilter: floatingFilterEnabledForColumn && floatingFilterEnabled, resizable: true, headerComponent: "simpleHeader", headerComponentParams: {
|
|
1514
|
+
onColumnsConfigVisible: this.showColumnsConfig
|
|
1515
|
+
}, hide: hide === undefined ? rest.initialHide : hide, cellStyle: this._getCellStyle, cellRendererParams: columnDef.cellStyle ? Object.assign(columnDef.cellRendererParams !== undefined ? columnDef.cellRendererParams : {}, { originalCellStyle: columnDef.cellStyle }) : columnDef.cellRendererParams, editable: editable, cellEditorPopup: !editable ? undefined : cellEditorPopup !== false });
|
|
1516
|
+
}) : undefined;
|
|
1517
|
+
if (adaptedColumnDefs) {
|
|
1518
|
+
setTimeout(() => {
|
|
1519
|
+
var _a, _b;
|
|
1520
|
+
(_b = (_a = this.props).onColumnDefsAdapted) === null || _b === void 0 ? void 0 : _b.call(_a, adaptedColumnDefs);
|
|
1521
|
+
}, 0);
|
|
1522
|
+
}
|
|
1523
|
+
return adaptedColumnDefs;
|
|
1524
|
+
}
|
|
1525
|
+
render() {
|
|
1526
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1527
|
+
const _g = this.props, { onGridReady, columnDefs, disableColumnDefsPreprocessing, onColumnsChanged, paging, onPaginationChanged, onViewportChanged, selectedIds, search, toolbar, filter, onFilterChanged, onFilterModified, onCellFocused, onSortChanged, components, tableConfigVisible, onTableConfigVisible, noRecordsOverlayRenderer, loadingOverlayRenderer, onRowDataUpdated, rowStyleRules, onChangeRowStyleRules, defaultShowMilliseconds, onShowMilliseconds, defaultHideYear, onShowYear, suppressLoadingOverlay, defaultColDef, headerHeight, rowData, rowDataManualMode, gridRef, quickFilterParser, quickFilterMatcher } = _g, passedProperties = __rest(_g, ["onGridReady", "columnDefs", "disableColumnDefsPreprocessing", "onColumnsChanged", "paging", "onPaginationChanged", "onViewportChanged", "selectedIds", "search", "toolbar", "filter", "onFilterChanged", "onFilterModified", "onCellFocused", "onSortChanged", "components", "tableConfigVisible", "onTableConfigVisible", "noRecordsOverlayRenderer", "loadingOverlayRenderer", "onRowDataUpdated", "rowStyleRules", "onChangeRowStyleRules", "defaultShowMilliseconds", "onShowMilliseconds", "defaultHideYear", "onShowYear", "suppressLoadingOverlay", "defaultColDef", "headerHeight", "rowData", "rowDataManualMode", "gridRef", "quickFilterParser", "quickFilterMatcher"]);
|
|
1528
|
+
let key;
|
|
1529
|
+
let paginationPageSize = undefined;
|
|
1530
|
+
if (paging.pageSize > 0) {
|
|
1531
|
+
paginationPageSize = paging.pageSize;
|
|
1532
|
+
passedProperties.pagination = true;
|
|
1533
|
+
key = "paginated-table";
|
|
1534
|
+
}
|
|
1535
|
+
else if (paging.pageSize === 0) {
|
|
1536
|
+
passedProperties.paginationAutoPageSize = true;
|
|
1537
|
+
passedProperties.pagination = true;
|
|
1538
|
+
key = "paginated-table";
|
|
1539
|
+
}
|
|
1540
|
+
else {
|
|
1541
|
+
passedProperties.pagination = false;
|
|
1542
|
+
key = "non-paginated-table";
|
|
1543
|
+
}
|
|
1544
|
+
const floatingFilterEnabled = !!filter && !!filter.columnSearchVisible;
|
|
1545
|
+
const adaptedColumnDefs = this.getAdaptedColumnDefs(columnDefs, floatingFilterEnabled, !!disableColumnDefsPreprocessing);
|
|
1546
|
+
const customComponents = this.getCustomComponents(components);
|
|
1547
|
+
const debugMode = process.env.NODE_ENV === 'development';
|
|
1548
|
+
const panelStyle = {
|
|
1549
|
+
display: "flex",
|
|
1550
|
+
flexFlow: "column",
|
|
1551
|
+
height: "100%",
|
|
1552
|
+
width: "100%",
|
|
1553
|
+
paddingBottom: 8,
|
|
1554
|
+
};
|
|
1555
|
+
if (this.props.panelStyle) {
|
|
1556
|
+
Object.assign(panelStyle, this.props.panelStyle);
|
|
1557
|
+
}
|
|
1558
|
+
const tablePanelStyle = { flex: "1 1 auto", marginTop: 16, overflow: "auto" };
|
|
1559
|
+
if (this.props.tablePanelStyle) {
|
|
1560
|
+
Object.assign(tablePanelStyle, this.props.tablePanelStyle);
|
|
1561
|
+
}
|
|
1562
|
+
const headerFilterRowHeight = calculateRowHeight(this.state.fontSize, GRID_DEFAULT_ROW_HEIGHT_DELTA + 2);
|
|
1563
|
+
return (React.createElement(React.Fragment, null,
|
|
1564
|
+
React.createElement(Card, { size: "small", bordered: false, style: { height: "100%" }, styles: { body: panelStyle } },
|
|
1565
|
+
React.createElement("div", { style: { display: "flex" } }, this.renderNavigationPanel()),
|
|
1566
|
+
React.createElement("div", { style: tablePanelStyle },
|
|
1567
|
+
React.createElement(Dropdown, { trigger: ["contextMenu"], getPopupContainer: () => {
|
|
1568
|
+
var _a, _b;
|
|
1569
|
+
const parentNode = ((_b = (_a = ReactDOM.findDOMNode(this)) === null || _a === void 0 ? void 0 : _a.parentNode) !== null && _b !== void 0 ? _b : document.body);
|
|
1570
|
+
return parentNode;
|
|
1571
|
+
}, menu: getContextMenu({
|
|
1572
|
+
onlySelectedNodes: true,
|
|
1573
|
+
showMilliseconds: !!this.props.showMilliseconds,
|
|
1574
|
+
showYear: !this.props.hideYear,
|
|
1575
|
+
renderer: (_a = this.props.contextMenu) === null || _a === void 0 ? void 0 : _a.renderer,
|
|
1576
|
+
onClick: (_b = this.props.contextMenu) === null || _b === void 0 ? void 0 : _b.onClick,
|
|
1577
|
+
getExportContent: this.getExportContent,
|
|
1578
|
+
hideNotificationOnClipboardCopy: true,
|
|
1579
|
+
pageOrientation: this.state.pageOrientation,
|
|
1580
|
+
exporting: this.state.exporting,
|
|
1581
|
+
onPageOrientationChange: this.onPageOrientationChange,
|
|
1582
|
+
onExport: this.onExport
|
|
1583
|
+
}), open: this.state.contextMenuVisible, onOpenChange: (visible) => {
|
|
1584
|
+
if (!visible) {
|
|
1585
|
+
this.setState({ contextMenuVisible: false });
|
|
1586
|
+
}
|
|
1587
|
+
} },
|
|
1588
|
+
React.createElement("div", { className: "ag-theme-balham", style: { width: "100%", height: "100%" }, ref: (wrapingDiv) => {
|
|
1589
|
+
this.wrappingDiv = wrapingDiv;
|
|
1590
|
+
} },
|
|
1591
|
+
React.createElement(AgGridReact, Object.assign({ key: key, debug: debugMode, ref: gridRef, paginationPageSize: paginationPageSize, maxConcurrentDatasourceRequests: this.props.rowModelType === "infinite" ? 1 : undefined, onGridReady: this.onGridReady, onPaginationChanged: this.onPaginationChanged, onFilterModified: this.onFilterModified, onFilterChanged: this.onFilterChanged, onSortChanged: this.onSortChanged, defaultColDef: this.getDefaultColDefinition(defaultColDef), columnDefs: adaptedColumnDefs, rowData: !rowDataManualMode ? rowData : undefined }, passedProperties, { onCellFocused: this.onCellFocused, suppressPaginationPanel: true, getRowId: getRowId, components: customComponents, columnTypes: this.columnTypes, onColumnVisible: this.onColumnsChanged, onColumnPinned: this.onColumnsChanged, onColumnResized: this.onColumnsChanged, onColumnMoved: this.onColumnsChanged, onCellMouseDown: this.onCellMouseDown, navigateToNextCell: this.navigateToNextCell, onViewportChanged: this.onViewportChanged, onCellContextMenu: this.onCellContextMenu, loadingOverlayComponent: 'loadingOverlay', noRowsOverlayComponent: 'noRecordsOverlay', onRowDataUpdated: this.onRowDataUpdated, context: this.table_context, rowHeight: this.state.rowHeight, getRowStyle: this._getRowStyle, getRowHeight: this._getRowHeight, headerHeight: headerHeight !== undefined ? headerHeight : headerFilterRowHeight, floatingFiltersHeight: headerFilterRowHeight, suppressLoadingOverlay: this.props.loadingOverlayRenderer ? true : this.props.suppressLoadingOverlay, quickFilterParser: this.wildcardQuickFilter.quickFilterParser, quickFilterMatcher: this.wildcardQuickFilter.quickFilterMatcher })),
|
|
1592
|
+
this.state.loading && this.props.loadingOverlayRenderer &&
|
|
1593
|
+
React.createElement("div", { className: "ag-overlay", "aria-hidden": "true", ref: "overlayWrapper" },
|
|
1594
|
+
React.createElement("div", { className: "ag-overlay-panel" },
|
|
1595
|
+
React.createElement("div", { className: "ag-overlay-wrapper ag-layout-normal ag-overlay-loading-wrapper" },
|
|
1596
|
+
React.createElement("div", { className: "ag-react-container" }, (_d = (_c = this.props).loadingOverlayRenderer) === null || _d === void 0 ? void 0 : _d.call(_c))))))), (_f = (_e = this.props).tableOverlayRenderer) === null || _f === void 0 ? void 0 :
|
|
1597
|
+
_f.call(_e))),
|
|
1598
|
+
!!this.gridApi && !!this.gridApi && this.state.pageSize !== null &&
|
|
1599
|
+
React.createElement(DataGridEditor, { dataGrid: this, gridApi: this.gridApi, columnDefinitions: columnDefs, columnModel: this.state.columnModel, visible: !!this.props.tableConfigVisible, onTableConfigVisible: this.showTableConfiguration, paginationPageSize: paging.pageSize, paginationDefaultPageSize: paging.defaultPageSize, currentPageSize: this.state.pageSize, showMilliseconds: !!this.props.showMilliseconds, defaultShowMilliseconds: !!this.props.defaultShowMilliseconds, showYear: !this.props.hideYear, defaultShowYear: !this.props.defaultHideYear, rowStyleRules: this.props.rowStyleRules, defaultRowStyleRules: this.props.defaultRowStyleRules, onChangeRowStyleRules: onChangeRowStyleRules }),
|
|
1600
|
+
!!this.gridApi && React.createElement(ModalDialog, { mode: "OK_CANCEL", open: this.state.columnsConfigVisible, initialWidth: 700, initialHeight: this.state.columnTransferHeight, title: React.createElement("span", null,
|
|
1601
|
+
React.createElement(ControlOutlined, { style: {
|
|
1602
|
+
color: "#faad14",
|
|
1603
|
+
fontSize: 22,
|
|
1604
|
+
marginRight: 16
|
|
1605
|
+
} }),
|
|
1606
|
+
i18n("Columns Configuration")), cancelText: i18n("Cancel"), onCancel: () => {
|
|
1607
|
+
if (this.gridApi && this.columnModelBeforeEdit) {
|
|
1608
|
+
this.gridApi.applyColumnState({ state: this.columnModelBeforeEdit, applyOrder: true });
|
|
1609
|
+
delete this.columnModelBeforeEdit;
|
|
1610
|
+
this.showColumnsConfig(false);
|
|
1611
|
+
}
|
|
1612
|
+
}, onOk: () => {
|
|
1613
|
+
delete this.columnModelBeforeEdit;
|
|
1614
|
+
this.showColumnsConfig(false);
|
|
1615
|
+
}, onResize: ({ height }) => {
|
|
1616
|
+
this.setState({ columnTransferHeight: height });
|
|
1617
|
+
}, zIndex: 100 },
|
|
1618
|
+
React.createElement(ColumnTransfer, { columnDefinitions: columnDefs, columnModel: this.state.columnModel, gridApi: this.gridApi, height: this.state.columnTransferHeight - 154 }))));
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
DataGrid.defaultProps = {
|
|
1622
|
+
paging: {
|
|
1623
|
+
pageSize: 0,
|
|
1624
|
+
defaultPageSize: 0
|
|
1625
|
+
},
|
|
1626
|
+
rowStyleRules: tableDefaultRowStyleRules()
|
|
1627
|
+
};
|
|
1628
|
+
DataGrid.EMPTY_STYLE = {};
|
|
1629
|
+
export default DataGrid;
|
|
1539
1630
|
//# sourceMappingURL=dataGrid.js.map
|