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,95 +1,71 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Key } from "ts-key-enum";
|
|
3
|
-
import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
|
|
4
|
-
import MaskInput from 'react-maskinput';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (props.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
render() {
|
|
74
|
-
let mask = "";
|
|
75
|
-
for (let i = 0; i < this.props.hexaStringMaxLength; i++) {
|
|
76
|
-
mask += "** ";
|
|
77
|
-
}
|
|
78
|
-
return (React.createElement(MaskInput, { getReference: component => {
|
|
79
|
-
this.inputComponent = component;
|
|
80
|
-
component.className = "ant-input ant-input-sm";
|
|
81
|
-
}, value: this.state.value !== undefined && this.state.value !== null ? this.state.value.toUpperCase() : "", onValueChange: event => {
|
|
82
|
-
const value = event.value;
|
|
83
|
-
if (KeyboardUtils.isKeyPressed(Key.Alt)) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (/^[0-9A-Fa-f ]+$/.test(value)) {
|
|
87
|
-
this.setState({ value: value.toUpperCase() });
|
|
88
|
-
}
|
|
89
|
-
else if (value === "") {
|
|
90
|
-
this.setState({ value: "" });
|
|
91
|
-
}
|
|
92
|
-
}, mask: mask.trim(), maskChar: " ", showMask: false }));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Key } from "ts-key-enum";
|
|
3
|
+
import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
|
|
4
|
+
import MaskInput from 'react-maskinput';
|
|
5
|
+
import { DataGridCellEditorComponent, withAgGridHooks } from "./dataGridCellEditorComponent";
|
|
6
|
+
class HexaOctetStringCellEditor extends DataGridCellEditorComponent {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.inputComponent = null;
|
|
10
|
+
this.state = this.getInitialState(props);
|
|
11
|
+
}
|
|
12
|
+
getInitialState(props) {
|
|
13
|
+
let value;
|
|
14
|
+
if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {
|
|
15
|
+
value = null;
|
|
16
|
+
props.onValueChange(null);
|
|
17
|
+
}
|
|
18
|
+
else if (props.eventKey && props.eventKey.length === 1) {
|
|
19
|
+
const parsedValue = Number.parseInt(props.eventKey);
|
|
20
|
+
value = isNaN(parsedValue) ? props.value : parsedValue;
|
|
21
|
+
props.onValueChange(value);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
value = props.initialValue;
|
|
25
|
+
}
|
|
26
|
+
return { value: value };
|
|
27
|
+
}
|
|
28
|
+
focus() {
|
|
29
|
+
var _a;
|
|
30
|
+
(_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.focus();
|
|
31
|
+
}
|
|
32
|
+
select() {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.select();
|
|
35
|
+
}
|
|
36
|
+
placeCursorToEnd() {
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
const length = ((_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.value) ? (_b = this.inputComponent) === null || _b === void 0 ? void 0 : _b.value.length : 0;
|
|
39
|
+
if (length > 0) {
|
|
40
|
+
(_c = this.inputComponent) === null || _c === void 0 ? void 0 : _c.setSelectionRange(length, length);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
isCancelBeforeStart() {
|
|
44
|
+
return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
let mask = "";
|
|
48
|
+
for (let i = 0; i < this.props.hexaStringMaxLength; i++) {
|
|
49
|
+
mask += "** ";
|
|
50
|
+
}
|
|
51
|
+
return (React.createElement(MaskInput, { getReference: component => {
|
|
52
|
+
this.inputComponent = component;
|
|
53
|
+
component.className = "ant-input ant-input-sm";
|
|
54
|
+
}, value: this.state.value !== undefined && this.state.value !== null ? this.state.value.toUpperCase() : "", onValueChange: event => {
|
|
55
|
+
const value = event.value;
|
|
56
|
+
if (KeyboardUtils.isKeyPressed(Key.Alt)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (/^[0-9A-Fa-f ]+$/.test(value)) {
|
|
60
|
+
this.setState({ value: value.toUpperCase() });
|
|
61
|
+
this.props.onValueChange(value.toUpperCase());
|
|
62
|
+
}
|
|
63
|
+
else if (value === "") {
|
|
64
|
+
this.setState({ value: "" });
|
|
65
|
+
this.props.onValueChange("");
|
|
66
|
+
}
|
|
67
|
+
}, mask: mask.trim(), maskChar: " ", showMask: false }));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export default withAgGridHooks(HexaOctetStringCellEditor);
|
|
95
71
|
//# sourceMappingURL=hexaOctetStringCellEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hexaOctetStringCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/hexaOctetStringCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"hexaOctetStringCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/hexaOctetStringCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,OAAO,EAAC,2BAA2B,EAAE,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAU3F,MAAM,yBAA0B,SAAQ,2BAA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AC,EAAC,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAC,CAAC,CAAC;oBAC5C,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;gBAClD,CAAC;qBAAM,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;oBACtB,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC;oBAC3B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBACjC,CAAC;YACL,CAAC,EACD,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EACjB,QAAQ,EAAC,GAAG,EACZ,QAAQ,EAAE,KAAK,GACjB,CACL,CAAC;IACN,CAAC;CACJ;AAED,eAAe,eAAe,CAAC,yBAAyB,CAAC,CAAA","sourcesContent":["import React from 'react';\r\nimport {Key} from \"ts-key-enum\";\r\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\r\nimport MaskInput from 'react-maskinput';\r\nimport {CustomCellEditorProps} from 'ag-grid-react';\r\nimport {DataGridCellEditorComponent, withAgGridHooks} from \"./dataGridCellEditorComponent\";\r\n\r\ninterface HexaOctetStringCellEditorProps extends CustomCellEditorProps {\r\n hexaStringMaxLength: number\r\n}\r\n\r\ninterface HexaOctetStringCellEditorState {\r\n value: string | null\r\n}\r\n\r\nclass HexaOctetStringCellEditor extends DataGridCellEditorComponent<HexaOctetStringCellEditorProps, HexaOctetStringCellEditorState> {\r\n private inputComponent: HTMLInputElement | null = null;\r\n\r\n constructor(props: Readonly<HexaOctetStringCellEditorProps>) {\r\n super(props);\r\n this.state = this.getInitialState(props);\r\n }\r\n\r\n getInitialState(props: Readonly<HexaOctetStringCellEditorProps>): HexaOctetStringCellEditorState {\r\n let value: number | null;\r\n if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n props.onValueChange(null);\r\n } else if (props.eventKey && props.eventKey.length === 1) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.eventKey);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n props.onValueChange(value);\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.initialValue;\r\n }\r\n return {value: value} as HexaOctetStringCellEditorState;\r\n }\r\n\r\n focus() {\r\n this.inputComponent?.focus();\r\n }\r\n\r\n select() {\r\n this.inputComponent?.select();\r\n }\r\n\r\n placeCursorToEnd() {\r\n // when we started editing, we want the carot at the end, not the start.\r\n // this comes into play in two scenarios: a) when user hits F2 and b)\r\n // when user hits a printable character, then on IE (and only IE) the carot\r\n // was placed after the first character, thus 'apply' would end up as 'pplea'\r\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\r\n if (length > 0) {\r\n this.inputComponent?.setSelectionRange(length, length);\r\n }\r\n }\r\n\r\n isCancelBeforeStart(): boolean {\r\n return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;\r\n }\r\n\r\n render() {\r\n let mask = \"\";\r\n for (let i = 0; i < this.props.hexaStringMaxLength; i++) {\r\n mask += \"** \";\r\n }\r\n\r\n return (\r\n <MaskInput\r\n getReference={component => {\r\n this.inputComponent = component;\r\n component.className = \"ant-input ant-input-sm\";\r\n }}\r\n value={this.state.value !== undefined && this.state.value !== null ? this.state.value.toUpperCase() : \"\"}\r\n onValueChange={event => {\r\n const value = event.value;\r\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\r\n // ignore navigational keystrokes ALT+cursor arrow\r\n return;\r\n }\r\n\r\n if (/^[0-9A-Fa-f ]+$/.test(value)) {\r\n this.setState({value: value.toUpperCase()});\r\n this.props.onValueChange(value.toUpperCase());\r\n } else if (value === \"\") {\r\n this.setState({value: \"\"});\r\n this.props.onValueChange(\"\");\r\n }\r\n }}\r\n mask={mask.trim()}\r\n maskChar=\" \"\r\n showMask={false}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default withAgGridHooks(HexaOctetStringCellEditor)"]}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
interface HexaValueCellEditorState {
|
|
7
|
-
value: string | null;
|
|
8
|
-
highlightAllOnFocus: boolean;
|
|
9
|
-
cancelEdit: boolean;
|
|
10
|
-
}
|
|
11
|
-
export default class HexaValueCellEditor extends React.Component<HexaValueCellEditorProps, HexaValueCellEditorState> implements ICellEditor {
|
|
12
|
-
private inputComponent;
|
|
13
|
-
private focusOpId;
|
|
14
|
-
constructor(props: Readonly<HexaValueCellEditorProps>);
|
|
15
|
-
getInitialState(props: Readonly<HexaValueCellEditorProps>): HexaValueCellEditorState;
|
|
16
|
-
componentWillUnmount(): void;
|
|
17
|
-
afterGuiAttached(): void;
|
|
18
|
-
getValue(): string | null;
|
|
19
|
-
isPopup(): boolean;
|
|
20
|
-
isCancelBeforeStart(): boolean;
|
|
21
|
-
isCancelAfterEnd(): boolean;
|
|
22
|
-
render(): JSX.Element;
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CustomCellEditorProps } from "ag-grid-react";
|
|
3
|
+
declare const _default: (props: CustomCellEditorProps) => React.JSX.Element;
|
|
4
|
+
export default _default;
|
|
@@ -1,90 +1,66 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Key } from "ts-key-enum";
|
|
3
|
-
import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
|
|
4
|
-
import HexaFormattedInput from "d2coreui/components/input/hexaFormattedInput";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (props.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
isCancelBeforeStart() {
|
|
68
|
-
return !!this.props.charPress && '1234567890'.indexOf(this.props.charPress) < 0;
|
|
69
|
-
}
|
|
70
|
-
isCancelAfterEnd() {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
render() {
|
|
74
|
-
var _a;
|
|
75
|
-
return (React.createElement(HexaFormattedInput, { ref: (component) => {
|
|
76
|
-
this.inputComponent = component;
|
|
77
|
-
}, value: (_a = this.state.value) !== null && _a !== void 0 ? _a : "", maxLength: this.props.maxLength, onChange: value => {
|
|
78
|
-
if (KeyboardUtils.isKeyPressed(Key.Alt)) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (value) {
|
|
82
|
-
this.setState({ value: value });
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
this.setState({ value: null });
|
|
86
|
-
}
|
|
87
|
-
}, size: "small" }));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Key } from "ts-key-enum";
|
|
3
|
+
import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
|
|
4
|
+
import HexaFormattedInput from "d2coreui/components/input/hexaFormattedInput";
|
|
5
|
+
import { DataGridCellEditorComponent, withAgGridHooks } from "./dataGridCellEditorComponent";
|
|
6
|
+
class HexaValueCellEditor extends DataGridCellEditorComponent {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.inputComponent = null;
|
|
10
|
+
this.state = this.getInitialState(props);
|
|
11
|
+
}
|
|
12
|
+
getInitialState(props) {
|
|
13
|
+
let value;
|
|
14
|
+
if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {
|
|
15
|
+
value = null;
|
|
16
|
+
props.onValueChange(null);
|
|
17
|
+
}
|
|
18
|
+
else if (props.eventKey && props.eventKey.length === 1) {
|
|
19
|
+
const parsedValue = Number.parseInt(props.eventKey);
|
|
20
|
+
value = isNaN(parsedValue) ? props.value : parsedValue;
|
|
21
|
+
props.onValueChange(value);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
value = props.value;
|
|
25
|
+
}
|
|
26
|
+
return { value: value };
|
|
27
|
+
}
|
|
28
|
+
focus() {
|
|
29
|
+
var _a;
|
|
30
|
+
(_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.focus();
|
|
31
|
+
}
|
|
32
|
+
select() {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
(_b = (_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.select();
|
|
35
|
+
}
|
|
36
|
+
placeCursorToEnd() {
|
|
37
|
+
var _a, _b, _c, _d, _e;
|
|
38
|
+
const length = ((_b = (_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value) ? (_c = this.inputComponent) === null || _c === void 0 ? void 0 : _c.input.value.length : 0;
|
|
39
|
+
if (length > 0) {
|
|
40
|
+
(_e = (_d = this.inputComponent) === null || _d === void 0 ? void 0 : _d.input) === null || _e === void 0 ? void 0 : _e.setSelectionRange(length, length);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
isCancelBeforeStart() {
|
|
44
|
+
return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
var _a;
|
|
48
|
+
return (React.createElement(HexaFormattedInput, { ref: (component) => {
|
|
49
|
+
this.inputComponent = component;
|
|
50
|
+
}, value: (_a = this.state.value) !== null && _a !== void 0 ? _a : "", maxLength: this.props.maxLength, onChange: value => {
|
|
51
|
+
if (KeyboardUtils.isKeyPressed(Key.Alt)) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (value) {
|
|
55
|
+
this.setState({ value: value });
|
|
56
|
+
this.props.onValueChange(value);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.setState({ value: null });
|
|
60
|
+
this.props.onValueChange(null);
|
|
61
|
+
}
|
|
62
|
+
}, size: "small" }));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export default withAgGridHooks(HexaValueCellEditor);
|
|
90
66
|
//# sourceMappingURL=hexaValueCellEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hexaValueCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/hexaValueCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"hexaValueCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/hexaValueCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,kBAAkB,MAAM,8CAA8C,CAAC;AAE9E,OAAO,EAAC,2BAA2B,EAAE,eAAe,EAAC,M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ACnC,CAAC;YACL,CAAC,EACD,IAAI,EAAE,OAAO,GACf,CACL,CAAA;IACL,CAAC;CACJ;AAED,eAAe,eAAe,CAAC,mBAAmB,CAAC,CAAA","sourcesContent":["import React from 'react';\r\nimport {Key} from \"ts-key-enum\";\r\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\r\nimport HexaFormattedInput from \"d2coreui/components/input/hexaFormattedInput\";\r\nimport {CustomCellEditorProps} from \"ag-grid-react\";\r\nimport {DataGridCellEditorComponent, withAgGridHooks} from \"./dataGridCellEditorComponent\";\r\n\r\ninterface HexaValueCellEditorProps extends CustomCellEditorProps {\r\n maxLength: number\r\n}\r\n\r\ninterface HexaValueCellEditorState {\r\n value: string | null\r\n}\r\n\r\nclass HexaValueCellEditor extends DataGridCellEditorComponent<HexaValueCellEditorProps, HexaValueCellEditorState> {\r\n private inputComponent: HexaFormattedInput | null = null;\r\n\r\n constructor(props: Readonly<HexaValueCellEditorProps>) {\r\n super(props);\r\n this.state = this.getInitialState(props);\r\n }\r\n\r\n getInitialState(props: Readonly<HexaValueCellEditorProps>): HexaValueCellEditorState {\r\n let value: number | null;\r\n if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n props.onValueChange(null);\r\n } else if (props.eventKey && props.eventKey.length === 1) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.eventKey);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n props.onValueChange(value);\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.value;\r\n }\r\n return {value: value} as HexaValueCellEditorState;\r\n }\r\n\r\n focus() {\r\n this.inputComponent?.focus();\r\n }\r\n\r\n select() {\r\n this.inputComponent?.input?.select();\r\n }\r\n\r\n placeCursorToEnd() {\r\n // when we started editing, we want the carot at the end, not the start.\r\n // this comes into play in two scenarios: a) when user hits F2 and b)\r\n // when user hits a printable character, then on IE (and only IE) the carot\r\n // was placed after the first character, thus 'apply' would end up as 'pplea'\r\n const length = this.inputComponent?.input?.value ? this.inputComponent?.input.value.length : 0;\r\n if (length > 0) {\r\n this.inputComponent?.input?.setSelectionRange(length, length);\r\n }\r\n }\r\n\r\n isCancelBeforeStart(): boolean {\r\n return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;\r\n }\r\n\r\n render() {\r\n return (\r\n <HexaFormattedInput\r\n ref={(component) => {\r\n this.inputComponent = component;\r\n }}\r\n value={this.state.value ?? \"\"}\r\n maxLength={this.props.maxLength}\r\n onChange={value => {\r\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\r\n // ignore navigational keystrokes ALT+cursor arrow\r\n return;\r\n }\r\n if (value) {\r\n this.setState({value: value});\r\n this.props.onValueChange(value);\r\n } else {\r\n this.setState({value: null});\r\n this.props.onValueChange(null);\r\n }\r\n }}\r\n size={\"small\"}\r\n />\r\n )\r\n }\r\n}\r\n\r\nexport default withAgGridHooks(HexaValueCellEditor)"]}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
precision?: number;
|
|
6
|
-
min?: number;
|
|
7
|
-
max?: number;
|
|
8
|
-
}
|
|
9
|
-
interface NumericCellEditorState {
|
|
10
|
-
value: number | null;
|
|
11
|
-
highlightAllOnFocus: boolean;
|
|
12
|
-
cancelEdit: boolean;
|
|
13
|
-
}
|
|
14
|
-
export default class NumberCellEditor extends React.Component<NumberCellEditorProperties, NumericCellEditorState> implements ICellEditor {
|
|
15
|
-
private inputComponent;
|
|
16
|
-
private focusOpId;
|
|
17
|
-
constructor(props: Readonly<NumberCellEditorProperties>);
|
|
18
|
-
getInitialState(props: Readonly<NumberCellEditorProperties>): NumericCellEditorState;
|
|
19
|
-
componentWillUnmount(): void;
|
|
20
|
-
afterGuiAttached(): void;
|
|
21
|
-
getValue(): number | null;
|
|
22
|
-
isPopup(): boolean;
|
|
23
|
-
isCancelBeforeStart(): boolean;
|
|
24
|
-
isCancelAfterEnd(): boolean;
|
|
25
|
-
render(): JSX.Element;
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CustomCellEditorProps } from "ag-grid-react";
|
|
3
|
+
declare const _default: (props: CustomCellEditorProps) => React.JSX.Element;
|
|
4
|
+
export default _default;
|