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.
Files changed (295) hide show
  1. package/components/clipboard/clipboardUtils.d.ts +4 -3
  2. package/components/clipboard/clipboardUtils.js +47 -22
  3. package/components/clipboard/clipboardUtils.js.map +1 -1
  4. package/components/codemirror/SyntaxHighlighter.d.ts +21 -21
  5. package/components/codemirror/SyntaxHighlighter.js +45 -44
  6. package/components/codemirror/SyntaxHighlighter.js.map +1 -1
  7. package/components/collapse/expandable.d.ts +13 -12
  8. package/components/collapse/expandable.js +20 -20
  9. package/components/collapse/expandable.js.map +1 -1
  10. package/components/color/colorPicker.d.ts +20 -20
  11. package/components/color/colorPicker.js +53 -53
  12. package/components/color/colorPicker.js.map +1 -1
  13. package/components/color/colorSwatch.d.ts +13 -12
  14. package/components/color/colorSwatch.js +62 -62
  15. package/components/color/colorSwatch.js.map +1 -1
  16. package/components/color/colorUtils.d.ts +7 -7
  17. package/components/color/colorUtils.js +43 -43
  18. package/components/color/colorUtils.js.map +1 -1
  19. package/components/date/dateRangeInput.d.ts +66 -64
  20. package/components/date/dateRangeInput.js +292 -297
  21. package/components/date/dateRangeInput.js.map +1 -1
  22. package/components/date/dateRangeInputAdvancedPanel.d.ts +27 -26
  23. package/components/date/dateRangeInputAdvancedPanel.js +130 -115
  24. package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
  25. package/components/date/dateRangeInputConfirm.d.ts +31 -29
  26. package/components/date/dateRangeInputConfirm.js +132 -121
  27. package/components/date/dateRangeInputConfirm.js.map +1 -1
  28. package/components/date/dateTimeInput.d.ts +72 -69
  29. package/components/date/dateTimeInput.js +440 -412
  30. package/components/date/dateTimeInput.js.map +1 -1
  31. package/components/date/durationInput.d.ts +59 -56
  32. package/components/date/durationInput.js +269 -280
  33. package/components/date/durationInput.js.map +1 -1
  34. package/components/form/NiceFormItem.d.ts +14 -14
  35. package/components/form/NiceFormItem.js +28 -31
  36. package/components/form/NiceFormItem.js.map +1 -1
  37. package/components/grid/cell/beanAccessor.d.ts +9 -0
  38. package/components/grid/cell/beanAccessor.js +13 -0
  39. package/components/grid/cell/beanAccessor.js.map +1 -0
  40. package/components/grid/cell/cellEditorUtils.d.ts +4 -4
  41. package/components/grid/cell/cellEditorUtils.js +8 -8
  42. package/components/grid/cell/customEnumCellEditor.d.ts +4 -26
  43. package/components/grid/cell/customEnumCellEditor.js +82 -91
  44. package/components/grid/cell/customEnumCellEditor.js.map +1 -1
  45. package/components/grid/cell/dataGridCellEditorComponent.d.ts +14 -0
  46. package/components/grid/cell/dataGridCellEditorComponent.js +49 -0
  47. package/components/grid/cell/dataGridCellEditorComponent.js.map +1 -0
  48. package/components/grid/cell/dateCellEditor.d.ts +4 -25
  49. package/components/grid/cell/dateCellEditor.js +53 -72
  50. package/components/grid/cell/dateCellEditor.js.map +1 -1
  51. package/components/grid/cell/durationCellEditor.d.ts +4 -24
  52. package/components/grid/cell/durationCellEditor.js +74 -97
  53. package/components/grid/cell/durationCellEditor.js.map +1 -1
  54. package/components/grid/cell/hexaOctetStringCellEditor.d.ts +4 -24
  55. package/components/grid/cell/hexaOctetStringCellEditor.js +70 -94
  56. package/components/grid/cell/hexaOctetStringCellEditor.js.map +1 -1
  57. package/components/grid/cell/hexaValueCellEditor.d.ts +4 -24
  58. package/components/grid/cell/hexaValueCellEditor.js +65 -89
  59. package/components/grid/cell/hexaValueCellEditor.js.map +1 -1
  60. package/components/grid/cell/numberCellEditor.d.ts +4 -27
  61. package/components/grid/cell/numberCellEditor.js +73 -95
  62. package/components/grid/cell/numberCellEditor.js.map +1 -1
  63. package/components/grid/cell/rangeSelector.d.ts +78 -78
  64. package/components/grid/cell/rangeSelector.js +526 -518
  65. package/components/grid/cell/rangeSelector.js.map +1 -1
  66. package/components/grid/cell/simpleStatusTextCellEditor.d.ts +4 -32
  67. package/components/grid/cell/simpleStatusTextCellEditor.js +106 -116
  68. package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
  69. package/components/grid/cell/statusTextCellEditor.d.ts +4 -32
  70. package/components/grid/cell/statusTextCellEditor.js +136 -159
  71. package/components/grid/cell/statusTextCellEditor.js.map +1 -1
  72. package/components/grid/cell/tableDefaultRowStyleRules.d.ts +20 -20
  73. package/components/grid/cell/tableDefaultRowStyleRules.js +29 -18
  74. package/components/grid/cell/tableDefaultRowStyleRules.js.map +1 -1
  75. package/components/grid/cell/textCellEditor.d.ts +4 -21
  76. package/components/grid/cell/textCellEditor.js +63 -85
  77. package/components/grid/cell/textCellEditor.js.map +1 -1
  78. package/components/grid/cell/withAgGridHooks.d.ts +3 -0
  79. package/components/grid/cell/withAgGridHooks.js +15 -0
  80. package/components/grid/cell/withAgGridHooks.js.map +1 -0
  81. package/components/grid/columnUtils.d.ts +5 -5
  82. package/components/grid/columnUtils.js +26 -26
  83. package/components/grid/columnUtils.js.map +1 -1
  84. package/components/grid/config/columnTransfer.d.ts +21 -22
  85. package/components/grid/config/columnTransfer.js +205 -201
  86. package/components/grid/config/columnTransfer.js.map +1 -1
  87. package/components/grid/config/dataGridEditor.d.ts +41 -41
  88. package/components/grid/config/dataGridEditor.js +181 -160
  89. package/components/grid/config/dataGridEditor.js.map +1 -1
  90. package/components/grid/config/rowHeightCalculator.d.ts +8 -0
  91. package/components/grid/config/rowHeightCalculator.js +20 -0
  92. package/components/grid/config/rowHeightCalculator.js.map +1 -0
  93. package/components/grid/config/rowStylePicker.d.ts +27 -25
  94. package/components/grid/config/rowStylePicker.js +127 -109
  95. package/components/grid/config/rowStylePicker.js.map +1 -1
  96. package/components/grid/dataGrid.d.ts +218 -206
  97. package/components/grid/dataGrid.js +1629 -1538
  98. package/components/grid/dataGrid.js.map +1 -1
  99. package/components/grid/detail/detailHeaderPanel.d.ts +13 -13
  100. package/components/grid/detail/detailHeaderPanel.js +25 -25
  101. package/components/grid/detail/detailHeaderPanel.js.map +1 -1
  102. package/components/grid/export/contextMenu.d.ts +18 -24
  103. package/components/grid/export/contextMenu.js +116 -113
  104. package/components/grid/export/contextMenu.js.map +1 -1
  105. package/components/grid/export/progressPopup.d.ts +29 -29
  106. package/components/grid/export/progressPopup.js +93 -93
  107. package/components/grid/export/progressPopup.js.map +1 -1
  108. package/components/grid/export/worker/clipboardExport.d.ts +1 -1
  109. package/components/grid/export/worker/clipboardExport.js +8 -8
  110. package/components/grid/export/worker/csvExport.d.ts +1 -1
  111. package/components/grid/export/worker/csvExport.js +8 -8
  112. package/components/grid/export/worker/pdfExport.d.ts +1 -1
  113. package/components/grid/export/worker/pdfExport.js +81 -81
  114. package/components/grid/export/worker/pdfExport.js.map +1 -1
  115. package/components/grid/export/worker/txtExport.d.ts +1 -1
  116. package/components/grid/export/worker/txtExport.js +19 -19
  117. package/components/grid/extendedDataGrid.d.ts +140 -140
  118. package/components/grid/extendedDataGrid.js +704 -695
  119. package/components/grid/extendedDataGrid.js.map +1 -1
  120. package/components/grid/filter/customColumnFilter.d.ts +5 -21
  121. package/components/grid/filter/customColumnFilter.js +11 -82
  122. package/components/grid/filter/customColumnFilter.js.map +1 -1
  123. package/components/grid/filter/dataGridColumnFilter.d.ts +17 -0
  124. package/components/grid/filter/dataGridColumnFilter.js +49 -0
  125. package/components/grid/filter/dataGridColumnFilter.js.map +1 -0
  126. package/components/grid/filter/dateColumnFilter.d.ts +7 -11
  127. package/components/grid/filter/dateColumnFilter.js +22 -56
  128. package/components/grid/filter/dateColumnFilter.js.map +1 -1
  129. package/components/grid/filter/textColumnFilter.d.ts +8 -20
  130. package/components/grid/filter/textColumnFilter.js +24 -76
  131. package/components/grid/filter/textColumnFilter.js.map +1 -1
  132. package/components/grid/filter/wildcardQuickFilterEngine.d.ts +7 -0
  133. package/components/grid/filter/wildcardQuickFilterEngine.js +48 -0
  134. package/components/grid/filter/wildcardQuickFilterEngine.js.map +1 -0
  135. package/components/grid/header/simpleHeader.d.ts +17 -16
  136. package/components/grid/header/simpleHeader.js +230 -186
  137. package/components/grid/header/simpleHeader.js.map +1 -1
  138. package/components/grid/panel/dataGridPagination.d.ts +16 -16
  139. package/components/grid/panel/dataGridPagination.js +58 -58
  140. package/components/grid/panel/dataGridPagination.js.map +1 -1
  141. package/components/grid/panel/loadingOverlay.d.ts +6 -6
  142. package/components/grid/panel/loadingOverlay.js +10 -10
  143. package/components/grid/panel/loadingOverlay.js.map +1 -1
  144. package/components/grid/panel/noRecordsOverlay.d.ts +6 -6
  145. package/components/grid/panel/noRecordsOverlay.js +10 -10
  146. package/components/grid/panel/noRecordsOverlay.js.map +1 -1
  147. package/components/grid/panel/tablePagination.d.ts +10 -10
  148. package/components/grid/panel/tablePagination.js +45 -45
  149. package/components/grid/panel/tablePagination.js.map +1 -1
  150. package/components/icons/dropdownArrow.d.ts +8 -0
  151. package/components/icons/dropdownArrow.js +59 -0
  152. package/components/icons/dropdownArrow.js.map +1 -0
  153. package/components/icons/undoIcon.d.ts +8 -8
  154. package/components/icons/undoIcon.js +6 -6
  155. package/components/input/autoCompleteInput.d.ts +35 -35
  156. package/components/input/autoCompleteInput.js +122 -121
  157. package/components/input/autoCompleteInput.js.map +1 -1
  158. package/components/input/draftUtils.d.ts +4 -4
  159. package/components/input/draftUtils.js +48 -48
  160. package/components/input/draftUtils.js.map +1 -1
  161. package/components/input/draftail.d.ts +1 -1
  162. package/components/input/draftail.js +1 -1
  163. package/components/input/hexaFormattedInput.d.ts +16 -16
  164. package/components/input/hexaFormattedInput.js +54 -54
  165. package/components/input/hexaFormattedInput.js.map +1 -1
  166. package/components/input/mask/helpers.d.ts +28 -28
  167. package/components/input/mask/helpers.js +112 -112
  168. package/components/input/mask/helpers.js.map +1 -1
  169. package/components/input/mask/inputMaskCore.d.ts +46 -46
  170. package/components/input/mask/inputMaskCore.js +278 -278
  171. package/components/input/mask/inputMaskCore.js.map +1 -1
  172. package/components/input/mask/pattern.d.ts +20 -20
  173. package/components/input/mask/pattern.js +78 -78
  174. package/components/input/mask/pattern.js.map +1 -1
  175. package/components/input/maskedInput.d.ts +373 -351
  176. package/components/input/maskedInput.js +224 -224
  177. package/components/input/maskedInput.js.map +1 -1
  178. package/components/input/passwordInput.d.ts +9 -9
  179. package/components/input/passwordInput.js +55 -55
  180. package/components/input/passwordInput.js.map +1 -1
  181. package/components/input/simpleAutoComplete.d.ts +12 -12
  182. package/components/input/simpleAutoComplete.js +41 -43
  183. package/components/input/simpleAutoComplete.js.map +1 -1
  184. package/components/input/textarea/extractSpansOfClasses.d.ts +15 -15
  185. package/components/input/textarea/extractSpansOfClasses.js +96 -96
  186. package/components/input/textarea/extractSpansOfClasses.js.map +1 -1
  187. package/components/input/textarea/getRanges.d.ts +1 -1
  188. package/components/input/textarea/getRanges.js +73 -73
  189. package/components/input/textarea/getRanges.js.map +1 -1
  190. package/components/input/textarea/getType.d.ts +1 -1
  191. package/components/input/textarea/getType.js +26 -26
  192. package/components/input/textarea/getType.js.map +1 -1
  193. package/components/input/textarea/highlighedContents.d.ts +6 -6
  194. package/components/input/textarea/highlighedContents.js +10 -10
  195. package/components/input/textarea/mentionsWithHighlighting.d.ts +27 -27
  196. package/components/input/textarea/mentionsWithHighlighting.js +60 -60
  197. package/components/input/textarea/mentionsWithHighlighting.js.map +1 -1
  198. package/components/keyboard/keyboardUtils.d.ts +5 -5
  199. package/components/keyboard/keyboardUtils.js +32 -32
  200. package/components/modal/draggableModalProvider.d.ts +4 -4
  201. package/components/modal/draggableModalProvider.js +21 -21
  202. package/components/modal/draggableModalProvider.js.map +1 -1
  203. package/components/modal/impl/clamp.d.ts +1 -1
  204. package/components/modal/impl/clamp.js +1 -1
  205. package/components/modal/impl/clamp.js.map +1 -1
  206. package/components/modal/impl/draggableModal.d.ts +12 -12
  207. package/components/modal/impl/draggableModal.js +17 -17
  208. package/components/modal/impl/draggableModal.js.map +1 -1
  209. package/components/modal/impl/draggableModalContext.d.ts +9 -9
  210. package/components/modal/impl/draggableModalContext.js +2 -2
  211. package/components/modal/impl/draggableModalContext.js.map +1 -1
  212. package/components/modal/impl/draggableModalInner.d.ts +15 -13
  213. package/components/modal/impl/draggableModalInner.js +57 -55
  214. package/components/modal/impl/draggableModalInner.js.map +1 -1
  215. package/components/modal/impl/draggableModalReducer.d.ts +66 -62
  216. package/components/modal/impl/draggableModalReducer.js +77 -78
  217. package/components/modal/impl/draggableModalReducer.js.map +1 -1
  218. package/components/modal/impl/getWindowSize.d.ts +4 -4
  219. package/components/modal/impl/getWindowSize.js +4 -4
  220. package/components/modal/impl/getWindowSize.js.map +1 -1
  221. package/components/modal/impl/index.d.ts +3 -3
  222. package/components/modal/impl/index.js +3 -3
  223. package/components/modal/impl/index.js.map +1 -1
  224. package/components/modal/impl/resizeHandle.d.ts +3 -3
  225. package/components/modal/impl/resizeHandle.js +4 -4
  226. package/components/modal/impl/resizeHandle.js.map +1 -1
  227. package/components/modal/impl/useDrag.d.ts +5 -5
  228. package/components/modal/impl/useDrag.js +42 -42
  229. package/components/modal/impl/useDrag.js.map +1 -1
  230. package/components/modal/impl/usePrevious.d.ts +1 -1
  231. package/components/modal/impl/usePrevious.js +8 -8
  232. package/components/modal/impl/usePrevious.js.map +1 -1
  233. package/components/modal/impl/useResize.d.ts +7 -7
  234. package/components/modal/impl/useResize.js +46 -46
  235. package/components/modal/impl/useResize.js.map +1 -1
  236. package/components/modal/modalDialog.d.ts +49 -49
  237. package/components/modal/modalDialog.js +152 -152
  238. package/components/modal/modalDialog.js.map +1 -1
  239. package/components/picker/enumValuePicker.d.ts +16 -16
  240. package/components/picker/enumValuePicker.js +34 -34
  241. package/components/picker/enumValuePicker.js.map +1 -1
  242. package/components/platformSpecific.d.ts +10 -10
  243. package/components/platformSpecific.js +27 -27
  244. package/components/scrollTo/onlyText.d.ts +4 -4
  245. package/components/scrollTo/onlyText.js +30 -30
  246. package/components/scrollTo/onlyText.js.map +1 -1
  247. package/components/scrollTo/scrollTo.d.ts +41 -39
  248. package/components/scrollTo/scrollTo.js +264 -264
  249. package/components/scrollTo/scrollTo.js.map +1 -1
  250. package/components/style/withCss.d.ts +9 -0
  251. package/components/style/withCss.js +6 -0
  252. package/components/style/withCss.js.map +1 -0
  253. package/components/style/withInputNumberCss.d.ts +6 -0
  254. package/components/style/withInputNumberCss.js +13 -0
  255. package/components/style/withInputNumberCss.js.map +1 -0
  256. package/components/table/dragSortingTable.d.ts +13 -14
  257. package/components/table/dragSortingTable.js +96 -82
  258. package/components/table/dragSortingTable.js.map +1 -1
  259. package/components/text/impl/innerSize.d.ts +2 -2
  260. package/components/text/impl/innerSize.js +12 -12
  261. package/components/text/impl/series.d.ts +1 -1
  262. package/components/text/impl/series.js +28 -28
  263. package/components/text/impl/shallowEqual.d.ts +1 -1
  264. package/components/text/impl/shallowEqual.js +18 -18
  265. package/components/text/impl/shallowEqual.js.map +1 -1
  266. package/components/text/impl/uniqueId.d.ts +1 -1
  267. package/components/text/impl/uniqueId.js +4 -4
  268. package/components/text/impl/whilst.d.ts +1 -1
  269. package/components/text/impl/whilst.js +19 -19
  270. package/components/text/impl/whilst.js.map +1 -1
  271. package/components/text/textFit.d.ts +38 -38
  272. package/components/text/textFit.js +165 -168
  273. package/components/text/textFit.js.map +1 -1
  274. package/i18n/components.cs.json +101 -100
  275. package/i18n/components.sk.json +101 -100
  276. package/i18n/components.uk.json +101 -100
  277. package/i18n/componentsLocaleHolder.d.ts +3 -3
  278. package/i18n/componentsLocaleHolder.js +28 -28
  279. package/i18n/componentsLocaleHolder.js.map +1 -1
  280. package/package.json +71 -70
  281. package/style/index.less +274 -298
  282. package/style/modal/DraggableModal.css +43 -40
  283. package/style/modal/ResizeHandle.css +27 -19
  284. package/tsconfig.build.json +24 -24
  285. package/tsconfig.json +11 -11
  286. package/components/grid/cell/wildcardQuickFilter.d.ts +0 -11
  287. package/components/grid/cell/wildcardQuickFilter.js +0 -61
  288. package/components/grid/cell/wildcardQuickFilter.js.map +0 -1
  289. package/components/table/dataTable.d.ts +0 -17
  290. package/components/table/dataTable.js +0 -79
  291. package/components/table/dataTable.js.map +0 -1
  292. package/style/antd/antd-tree-showline.css +0 -25
  293. package/style/antd/full-height-tabs.scss +0 -63
  294. package/style/draftail/draftail-editor.css +0 -179
  295. package/style/table/dragSortingTable.css +0 -7
@@ -1,96 +1,74 @@
1
- import React from 'react';
2
- import { InputNumber } from "antd";
3
- import { Key } from "ts-key-enum";
4
- import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
5
- import { CellEditorUtils } from "./cellEditorUtils";
6
- const KEY_BACKSPACE = 8;
7
- const KEY_DELETE = 46;
8
- const KEY_F2 = 113;
9
- export default class NumberCellEditor extends React.Component {
10
- constructor(props) {
11
- super(props);
12
- this.inputComponent = null;
13
- this.focusOpId = null;
14
- this.state = this.getInitialState(props);
15
- }
16
- getInitialState(props) {
17
- let value;
18
- let highlightAllOnFocus = true;
19
- if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {
20
- value = null;
21
- }
22
- else if (props.charPress) {
23
- const parsedValue = Number.parseInt(props.charPress);
24
- value = isNaN(parsedValue) ? props.value : parsedValue;
25
- highlightAllOnFocus = false;
26
- }
27
- else {
28
- value = props.value;
29
- if (props.keyPress === KEY_F2) {
30
- highlightAllOnFocus = false;
31
- }
32
- }
33
- return {
34
- value: value,
35
- highlightAllOnFocus,
36
- cancelEdit: false
37
- };
38
- }
39
- componentWillUnmount() {
40
- if (this.focusOpId) {
41
- clearTimeout(this.focusOpId);
42
- }
43
- }
44
- afterGuiAttached() {
45
- this.focusOpId = window.setTimeout(() => {
46
- var _a, _b, _c, _d, _e;
47
- (_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.focus();
48
- if (this.state.highlightAllOnFocus) {
49
- (_b = this.inputComponent) === null || _b === void 0 ? void 0 : _b.select();
50
- this.setState({
51
- highlightAllOnFocus: false,
52
- });
53
- }
54
- else {
55
- const length = ((_c = this.inputComponent) === null || _c === void 0 ? void 0 : _c.value) ? (_d = this.inputComponent) === null || _d === void 0 ? void 0 : _d.value.length : 0;
56
- if (length > 0) {
57
- (_e = this.inputComponent) === null || _e === void 0 ? void 0 : _e.setSelectionRange(length, length);
58
- }
59
- }
60
- }, 200);
61
- }
62
- getValue() {
63
- return this.state.value;
64
- }
65
- isPopup() {
66
- return true;
67
- }
68
- isCancelBeforeStart() {
69
- return !!this.props.charPress && '1234567890'.indexOf(this.props.charPress) < 0;
70
- }
71
- isCancelAfterEnd() {
72
- return false;
73
- }
74
- render() {
75
- return (React.createElement(InputNumber, { ref: (component) => {
76
- this.inputComponent = component;
77
- }, size: "small", autoFocus: true, decimalSeparator: this.props.decimalSeparator, precision: this.props.precision, min: this.props.min, max: this.props.max, placeholder: this.state.value === null ? "NULL" : "", value: this.state.value !== null ? this.state.value : undefined, onChange: value => {
78
- if (KeyboardUtils.isKeyPressed(Key.Alt)) {
79
- return;
80
- }
81
- if (typeof value === "number") {
82
- this.setState({ value: value });
83
- }
84
- else if (value === null || value === "") {
85
- this.setState({ value: null });
86
- }
87
- }, onKeyDown: (e) => {
88
- if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {
89
- e.preventDefault();
90
- e.nativeEvent.stopImmediatePropagation();
91
- e.nativeEvent.preventDefault();
92
- }
93
- }, style: { width: '100%' } }));
94
- }
95
- }
1
+ import React from 'react';
2
+ import { InputNumber } from "antd";
3
+ import { Key } from "ts-key-enum";
4
+ import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
5
+ import { CellEditorUtils } from "./cellEditorUtils";
6
+ import { DataGridCellEditorComponent, withAgGridHooks } from "./dataGridCellEditorComponent";
7
+ class NumberCellEditor extends DataGridCellEditorComponent {
8
+ constructor(props) {
9
+ super(props);
10
+ this.inputComponent = null;
11
+ this.state = this.getInitialState(props);
12
+ }
13
+ getInitialState(props) {
14
+ let value;
15
+ if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {
16
+ value = null;
17
+ props.onValueChange(null);
18
+ }
19
+ else if (props.eventKey && props.eventKey.length === 1) {
20
+ const parsedValue = Number.parseInt(props.eventKey);
21
+ value = isNaN(parsedValue) ? props.value : parsedValue;
22
+ props.onValueChange(value);
23
+ }
24
+ else {
25
+ value = props.value;
26
+ }
27
+ return {
28
+ value: value,
29
+ };
30
+ }
31
+ focus() {
32
+ var _a;
33
+ (_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.focus();
34
+ }
35
+ select() {
36
+ var _a;
37
+ (_a = this.inputComponent) === null || _a === void 0 ? void 0 : _a.select();
38
+ }
39
+ placeCursorToEnd() {
40
+ var _a, _b, _c;
41
+ 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;
42
+ if (length > 0) {
43
+ (_c = this.inputComponent) === null || _c === void 0 ? void 0 : _c.setSelectionRange(length, length);
44
+ }
45
+ }
46
+ isCancelBeforeStart() {
47
+ return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;
48
+ }
49
+ render() {
50
+ return (React.createElement(InputNumber, { ref: (component) => {
51
+ this.inputComponent = component;
52
+ }, size: "small", autoFocus: true, decimalSeparator: this.props.decimalSeparator, precision: this.props.precision, min: this.props.min, max: this.props.max, placeholder: this.state.value === null ? "NULL" : "", value: this.state.value !== null ? this.state.value : undefined, onChange: value => {
53
+ if (KeyboardUtils.isKeyPressed(Key.Alt)) {
54
+ return;
55
+ }
56
+ if (typeof value === "number") {
57
+ this.setState({ value: value });
58
+ this.props.onValueChange(value);
59
+ }
60
+ else if (value === null || value === "") {
61
+ this.setState({ value: null });
62
+ this.props.onValueChange(null);
63
+ }
64
+ }, onKeyDown: (e) => {
65
+ if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {
66
+ e.preventDefault();
67
+ e.nativeEvent.stopImmediatePropagation();
68
+ e.nativeEvent.preventDefault();
69
+ }
70
+ }, style: { width: '100%' } }));
71
+ }
72
+ }
73
+ export default withAgGridHooks(NumberCellEditor);
96
74
  //# sourceMappingURL=numberCellEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"number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CAAC,wBAAwB,EAAE,CAAC;oBACzC,CAAC,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;iBAClC;YACL,CAAC,EACD,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,GACxB,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React from 'react';\nimport {InputNumber} from \"antd\";\nimport {ICellEditor, ICellEditorParams} from \"ag-grid-community\";\nimport {Key} from \"ts-key-enum\";\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\nimport {CellEditorUtils} from \"./cellEditorUtils\";\n\nconst KEY_BACKSPACE = 8;\nconst KEY_DELETE = 46;\nconst KEY_F2 = 113;\n\ninterface NumberCellEditorProperties extends ICellEditorParams {\n decimalSeparator?: string\n precision?: number\n min?: number\n max?: number\n}\n\ninterface NumericCellEditorState {\n value: number | null\n highlightAllOnFocus: boolean\n cancelEdit: boolean\n}\n\nexport default class NumberCellEditor extends React.Component<NumberCellEditorProperties, NumericCellEditorState> implements ICellEditor {\n private inputComponent: HTMLInputElement | null = null;\n private focusOpId: number | null = null;\n\n constructor(props: Readonly<NumberCellEditorProperties>) {\n super(props);\n this.state = this.getInitialState(props);\n }\n\n getInitialState(props: Readonly<NumberCellEditorProperties>): NumericCellEditorState {\n let value: number | null;\n let highlightAllOnFocus = true;\n\n if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {\n // if backspace or delete pressed, we clear the cell\n value = null;\n } else if (props.charPress) {\n // if a letter was pressed, we start with the letter\n const parsedValue = Number.parseInt(props.charPress);\n value = isNaN(parsedValue) ? props.value : parsedValue;\n highlightAllOnFocus = false;\n } else {\n // otherwise we start with the current value\n value = props.value;\n if (props.keyPress === KEY_F2) {\n highlightAllOnFocus = false;\n }\n }\n return {\n value: value,\n highlightAllOnFocus,\n cancelEdit: false\n } as NumericCellEditorState;\n }\n\n componentWillUnmount() {\n if (this.focusOpId) {\n clearTimeout(this.focusOpId);\n }\n }\n\n afterGuiAttached() {\n this.focusOpId = window.setTimeout(() => {\n this.inputComponent?.focus();\n if (this.state.highlightAllOnFocus) {\n this.inputComponent?.select();\n this.setState({\n highlightAllOnFocus: false,\n });\n } else {\n // when we started editing, we want the carot at the end, not the start.\n // this comes into play in two scenarios: a) when user hits F2 and b)\n // when user hits a printable character, then on IE (and only IE) the carot\n // was placed after the first character, thus 'apply' would end up as 'pplea'\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\n if (length > 0) {\n this.inputComponent?.setSelectionRange(length, length);\n }\n }\n }, 200);\n }\n\n getValue() {\n return this.state.value;\n }\n\n isPopup(): boolean {\n return true;\n }\n\n isCancelBeforeStart(): boolean {\n return !!this.props.charPress && '1234567890'.indexOf(this.props.charPress) < 0;\n }\n\n isCancelAfterEnd() {\n return false;\n }\n\n render() {\n return (\n <InputNumber\n ref={(component) => {\n this.inputComponent = component;\n }}\n size=\"small\"\n autoFocus\n decimalSeparator={this.props.decimalSeparator}\n precision={this.props.precision}\n min={this.props.min}\n max={this.props.max}\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\n value={this.state.value !== null ? this.state.value : undefined}\n onChange={value => {\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\n // ignore navigational keystrokes ALT+cursor arrow\n return;\n }\n if (typeof value === \"number\") {\n this.setState({value: value});\n } else if (value === null || value === \"\") {\n this.setState({value: null});\n }\n }}\n onKeyDown={(e) => {\n if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {\n // this.props.onKeyDown(e.nativeEvent);\n e.preventDefault();\n e.nativeEvent.stopImmediatePropagation();\n e.nativeEvent.preventDefault();\n }\n }}\n style={{width: '100%'}}\n />\n );\n }\n}"]}
1
+ {"version":3,"file":"numberCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/numberCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,MAAM,CAAC;AACjC,OAAO,EAAC,GAAG,E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AAC,EAAE;gBACd,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBAEtC,OAAO;gBACX,CAAC;gBACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;oBAC5B,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;oBAC9B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBACpC,CAAC;qBAAM,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;oBACxC,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;oBAC7B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;gBACnC,CAAC;YACL,CAAC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,IAAI,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;oBAE1C,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,CAAC,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC;oBACzC,CAAC,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;gBACnC,CAAC;YACL,CAAC,EACD,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,GACxB,CACL,CAAC;IACN,CAAC;CACJ;AAED,eAAe,eAAe,CAAC,gBAAgB,CAAC,CAAA","sourcesContent":["import React from 'react';\r\nimport {InputNumber} from \"antd\";\r\nimport {Key} from \"ts-key-enum\";\r\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\r\nimport {CellEditorUtils} from \"./cellEditorUtils\";\r\nimport {DataGridCellEditorComponent, withAgGridHooks} from \"./dataGridCellEditorComponent\";\r\nimport {CustomCellEditorProps} from \"ag-grid-react\";\r\n\r\ninterface NumberCellEditorProperties extends CustomCellEditorProps {\r\n decimalSeparator?: string\r\n precision?: number\r\n min?: number\r\n max?: number\r\n}\r\n\r\ninterface NumericCellEditorState {\r\n value: number | null\r\n}\r\n\r\nclass NumberCellEditor extends DataGridCellEditorComponent<NumberCellEditorProperties, NumericCellEditorState> {\r\n private inputComponent: HTMLInputElement | null = null;\r\n\r\n constructor(props: Readonly<NumberCellEditorProperties>) {\r\n super(props);\r\n this.state = this.getInitialState(props);\r\n }\r\n\r\n getInitialState(props: Readonly<NumberCellEditorProperties>): NumericCellEditorState {\r\n let value: number | null;\r\n\r\n if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n props.onValueChange(null);\r\n } else if (props.eventKey && props.eventKey.length === 1) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.eventKey);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n props.onValueChange(value);\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.value;\r\n }\r\n return {\r\n value: value,\r\n } as NumericCellEditorState;\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\r\n isCancelBeforeStart(): boolean {\r\n return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;\r\n }\r\n\r\n\r\n render() {\r\n return (\r\n <InputNumber\r\n ref={(component) => {\r\n this.inputComponent = component;\r\n }}\r\n size=\"small\"\r\n autoFocus\r\n decimalSeparator={this.props.decimalSeparator}\r\n precision={this.props.precision}\r\n min={this.props.min}\r\n max={this.props.max}\r\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\r\n value={this.state.value !== null ? this.state.value : undefined}\r\n onChange={value => {\r\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\r\n // ignore navigational keystrokes ALT+cursor arrow\r\n return;\r\n }\r\n if (typeof value === \"number\") {\r\n this.setState({value: value});\r\n this.props.onValueChange(value);\r\n } else if (value === null || value === \"\") {\r\n this.setState({value: null});\r\n this.props.onValueChange(null);\r\n }\r\n }}\r\n onKeyDown={(e) => {\r\n if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {\r\n // this.props.onKeyDown(e.nativeEvent);\r\n e.preventDefault();\r\n e.nativeEvent.stopImmediatePropagation();\r\n e.nativeEvent.preventDefault();\r\n }\r\n }}\r\n style={{width: '100%'}}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default withAgGridHooks(NumberCellEditor)"]}
@@ -1,78 +1,78 @@
1
- export class RangeSelector {
2
- constructor(wrappingDiv: any);
3
- wrappingDiv: any;
4
- init(gridApi: any, gridColumnApi: any): void;
5
- rowModel: any;
6
- mouseEventService: any;
7
- columnApi: any;
8
- columnModel: any;
9
- gridApi: any;
10
- cellNavigationService: any;
11
- pinnedRowModel: any;
12
- rowPositionUtils: any;
13
- rowRenderer: any;
14
- eventService: any;
15
- gridOptionsWrapper: any;
16
- focusService: any;
17
- cellPositionUtils: any;
18
- ctrlsService: any;
19
- cellRanges: any[] | undefined;
20
- bodyScrollListener: (() => void) | undefined;
21
- dragging: boolean | undefined;
22
- gridPanel: any;
23
- autoScrollService: AutoScrollService | undefined;
24
- dragService: any;
25
- cellPositionEquals(cellA: any, cellB: any): boolean;
26
- onColumnVisibleChange(): void;
27
- refreshLastRangeStart(): void;
28
- isContiguousRange(cellRange: any): boolean;
29
- getRangeStartRow(cellRange: any): any;
30
- getRangeEndRow(cellRange: any): any;
31
- setRangeToCell(cell: any, appendRange?: boolean): void;
32
- newestRangeStartCell: any;
33
- extendLatestRangeToCell(cellPosition: any): void;
34
- updateRangeEnd(cellRange: any, cellPosition: any, silent: any): void;
35
- refreshRangeStart(cellRange: any): void;
36
- getRangeEdgeColumns(cellRange: any): {
37
- left: any;
38
- right: any;
39
- };
40
- extendLatestRangeInDirection(key: any): any;
41
- setCellRange(params: any): void;
42
- setCellRanges(cellRanges: any): void;
43
- createCellRangeFromCellRangeParams(params: any): {
44
- startRow: {
45
- rowIndex: any;
46
- rowPinned: any;
47
- } | undefined;
48
- endRow: {
49
- rowIndex: any;
50
- rowPinned: any;
51
- } | undefined;
52
- columns: any;
53
- startColumn: any;
54
- } | undefined;
55
- addCellRange(params: any): void;
56
- getCellRanges(): any[] | undefined;
57
- isEmpty(): boolean;
58
- isMoreThanOneCell(): boolean;
59
- removeAllCellRanges(silent: any): void;
60
- onBodyScroll(): void;
61
- isCellInAnyRange(cell: any): boolean;
62
- isCellInSpecificRange(cell: any, range: any): any;
63
- isLastCellOfRange(cellRange: any, cell: any): boolean;
64
- isBottomRightCell(cellRange: any, cell: any): boolean;
65
- getCellRangeCount(cell: any): number;
66
- isRowInRange(rowIndex: any, floating: any, cellRange: any): any;
67
- getDraggingRange(): any;
68
- onDragStart(mouseEvent: any): void;
69
- draggingCell: any;
70
- lastMouseEvent: any;
71
- draggingRange: any;
72
- onDragging(mouseEvent: any): void;
73
- focusCell(cellPosition: any): void;
74
- onDragStop(): void;
75
- dispatchChangedEvent(started: any, finished: any, id: any): void;
76
- calculateColumnsBetween(columnFrom: any, columnTo: any): any[] | undefined;
77
- }
78
- import { AutoScrollService } from "ag-grid-community/dist/lib/main";
1
+ export class RangeSelector extends BeanStub<"destroyed"> {
2
+ constructor();
3
+ beanName: string;
4
+ wireBeans(beans: any): void;
5
+ rowModel: any;
6
+ dragService: any;
7
+ columnModel: any;
8
+ visibleColsService: any;
9
+ cellNavigationService: any;
10
+ pinnedRowModel: any;
11
+ rowPositionUtils: any;
12
+ cellPositionUtils: any;
13
+ ctrlsService: any;
14
+ valueService: any;
15
+ mouseEventService: any;
16
+ gridApi: any;
17
+ eGridDiv: any;
18
+ focusService: any;
19
+ postConstruct(): void;
20
+ cellRanges: any[] | undefined;
21
+ bodyScrollListener: (() => void) | undefined;
22
+ dragging: boolean | undefined;
23
+ autoScrollService: AutoScrollService | undefined;
24
+ cellPositionEquals(cellA: any, cellB: any): boolean;
25
+ onColumnVisibleChange(): void;
26
+ refreshLastRangeStart(): void;
27
+ isContiguousRange(cellRange: any): boolean;
28
+ getRangeStartRow(cellRange: any): any;
29
+ getRangeEndRow(cellRange: any): any;
30
+ setRangeToCell(cell: any, appendRange?: boolean): void;
31
+ newestRangeStartCell: any;
32
+ extendLatestRangeToCell(cellPosition: any): void;
33
+ updateRangeEnd(cellRange: any, cellPosition: any, silent: any): void;
34
+ refreshRangeStart(cellRange: any): void;
35
+ getRangeEdgeColumns(cellRange: any): {
36
+ left: any;
37
+ right: any;
38
+ };
39
+ extendLatestRangeInDirection(key: any): any;
40
+ setCellRange(params: any): void;
41
+ setCellRanges(cellRanges: any): void;
42
+ createCellRangeFromCellRangeParams(params: any): {
43
+ startRow: {
44
+ rowIndex: any;
45
+ rowPinned: any;
46
+ } | undefined;
47
+ endRow: {
48
+ rowIndex: any;
49
+ rowPinned: any;
50
+ } | undefined;
51
+ columns: any;
52
+ startColumn: any;
53
+ } | undefined;
54
+ addCellRange(params: any): void;
55
+ getCellRanges(): any[] | undefined;
56
+ isEmpty(): boolean;
57
+ isMoreThanOneCell(): boolean;
58
+ removeAllCellRanges(silent: any): void;
59
+ onBodyScroll(): void;
60
+ isCellInAnyRange(cell: any): boolean;
61
+ isCellInSpecificRange(cell: any, range: any): any;
62
+ isLastCellOfRange(cellRange: any, cell: any): boolean;
63
+ isBottomRightCell(cellRange: any, cell: any): boolean;
64
+ getCellRangeCount(cell: any): number;
65
+ isRowInRange(rowIndex: any, floating: any, cellRange: any): any;
66
+ getDraggingRange(): any;
67
+ onDragStart(mouseEvent: any): void;
68
+ draggingCell: any;
69
+ lastMouseEvent: any;
70
+ draggingRange: any;
71
+ onDragging(mouseEvent: any): void;
72
+ focusCell(cellPosition: any): void;
73
+ onDragStop(): void;
74
+ dispatchChangedEvent(started: any, finished: any, id: any): void;
75
+ calculateColumnsBetween(columnFrom: any, columnTo: any): any[] | undefined;
76
+ }
77
+ import { BeanStub } from "ag-grid-community";
78
+ import { AutoScrollService } from "ag-grid-community";