d2coreui 23.0.15 → 23.0.17

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 (438) hide show
  1. package/components/codemirror/SyntaxHighlighter.js.map +1 -0
  2. package/components/color/colorSwatch.d.ts +13 -18
  3. package/components/color/colorSwatch.js.map +1 -0
  4. package/{lib/esm/components → components}/date/dateRangeInput.js +1 -1
  5. package/components/date/dateRangeInput.js.map +1 -0
  6. package/{lib/esm/components → components}/date/dateTimeInput.js +1 -1
  7. package/components/date/dateTimeInput.js.map +1 -0
  8. package/{lib/esm/components → components}/date/durationInput.js +2 -2
  9. package/components/date/durationInput.js.map +1 -0
  10. package/{lib/esm/components → components}/grid/cell/cellEditorUtils.js.map +1 -1
  11. package/components/grid/cell/rangeSelector.d.ts +78 -9
  12. package/components/grid/cell/rangeSelector.js +527 -674
  13. package/components/grid/columnUtils.js.map +1 -0
  14. package/{lib/esm/components → components}/grid/export/contextMenu.js +4 -4
  15. package/components/grid/export/progressPopup.js.map +1 -0
  16. package/{lib/esm/components → components}/grid/export/worker/clipboardExport.js.map +1 -1
  17. package/{lib/esm/components → components}/grid/export/worker/csvExport.js.map +1 -1
  18. package/{lib/esm/components → components}/grid/export/worker/txtExport.js.map +1 -1
  19. package/components/icons/ant-design-double-right-outline.svg +5 -5
  20. package/components/icons/ant-design_close-outline.svg +5 -5
  21. package/components/icons/undoIcon.js.map +1 -0
  22. package/components/input/draftUtils.js.map +1 -0
  23. package/components/input/draftail.d.ts +1 -186
  24. package/components/input/draftail.js +2 -1
  25. package/{lib/esm/components → components}/input/draftail.js.map +1 -1
  26. package/components/input/mask/inputMaskCore.js.map +1 -0
  27. package/components/input/mask/pattern.js.map +1 -0
  28. package/components/input/passwordInput.js.map +1 -0
  29. package/components/input/textarea/extractSpansOfClasses.js.map +1 -0
  30. package/components/input/textarea/getRanges.js.map +1 -0
  31. package/{lib/esm/components → components}/input/textarea/getType.js.map +1 -1
  32. package/{lib/esm/components → components}/input/textarea/highlighedContents.js.map +1 -1
  33. package/components/input/textarea/mentionsWithHighlighting.js.map +1 -0
  34. package/{lib/esm/components → components}/keyboard/keyboardUtils.js.map +1 -1
  35. package/components/platformSpecific.js.map +1 -0
  36. package/{lib/esm/components → components}/text/impl/innerSize.js.map +1 -1
  37. package/components/text/impl/series.js.map +1 -0
  38. package/{lib/esm/components → components}/text/impl/shallowEqual.js.map +1 -1
  39. package/{lib/esm/components → components}/text/impl/uniqueId.js.map +1 -1
  40. package/components/text/impl/whilst.js.map +1 -0
  41. package/i18n/components.cs.json +101 -101
  42. package/i18n/components.sk.json +101 -101
  43. package/i18n/components.uk.json +101 -101
  44. package/i18n/componentsLocaleHolder.js +29 -24
  45. package/i18n/componentsLocaleHolder.js.map +1 -0
  46. package/package.json +1 -1
  47. package/style/ag-grid/_ag-theme-antd-vars.scss +194 -194
  48. package/style/ag-grid/ag-theme-antd.scss +87 -87
  49. package/style/ag-grid/aggrid-adaptations.css +42 -42
  50. package/style/ag-grid/aggrid.scss +11 -11
  51. package/style/flexLayout/flexLayout.scss +130 -130
  52. package/style/flexLayout/flexLayoutBase.scss +623 -623
  53. package/style/flexLayout/new/_base.scss +616 -616
  54. package/style/flexLayout/new/flexLayoutBase.scss +621 -621
  55. package/style/flexLayout/new/light.scss +107 -107
  56. package/style/flexLayout/old/_base.scss +551 -551
  57. package/style/flexLayout/old/light.scss +16 -16
  58. package/style/form/niceFormItem.css +38 -38
  59. package/style/loading.css +31 -31
  60. package/style/splitPane/splitPane.css +48 -48
  61. package/tsconfig.build.json +24 -24
  62. package/tsconfig.json +11 -11
  63. package/components/clipboard/clipboardUtils.ts +0 -53
  64. package/components/codemirror/SyntaxHighlighter.tsx +0 -58
  65. package/components/collapse/expandable.tsx +0 -48
  66. package/components/color/colorPicker.tsx +0 -121
  67. package/components/color/colorSwatch.jsx +0 -87
  68. package/components/color/colorUtils.ts +0 -60
  69. package/components/date/dateRangeInput.tsx +0 -468
  70. package/components/date/dateRangeInputAdvancedPanel.tsx +0 -238
  71. package/components/date/dateRangeInputConfirm.tsx +0 -200
  72. package/components/date/dateTimeInput.tsx +0 -633
  73. package/components/date/durationInput.tsx +0 -375
  74. package/components/form/NiceFormItem.tsx +0 -32
  75. package/components/grid/cell/beanAccessor.ts +0 -17
  76. package/components/grid/cell/cellEditorUtils.ts +0 -12
  77. package/components/grid/cell/customEnumCellEditor.tsx +0 -130
  78. package/components/grid/cell/dataGridCellEditorComponent.tsx +0 -61
  79. package/components/grid/cell/dateCellEditor.tsx +0 -83
  80. package/components/grid/cell/durationCellEditor.tsx +0 -105
  81. package/components/grid/cell/hexaOctetStringCellEditor.tsx +0 -101
  82. package/components/grid/cell/hexaValueCellEditor.tsx +0 -92
  83. package/components/grid/cell/numberCellEditor.tsx +0 -115
  84. package/components/grid/cell/simpleStatusTextCellEditor.tsx +0 -168
  85. package/components/grid/cell/statusTextCellEditor.tsx +0 -198
  86. package/components/grid/cell/tableDefaultRowStyleRules.ts +0 -51
  87. package/components/grid/cell/textCellEditor.tsx +0 -94
  88. package/components/grid/cell/withAgGridHooks.tsx +0 -15
  89. package/components/grid/columnUtils.ts +0 -29
  90. package/components/grid/config/columnTransfer.tsx +0 -258
  91. package/components/grid/config/dataGridEditor.tsx +0 -328
  92. package/components/grid/config/rowHeightCalculator.tsx +0 -29
  93. package/components/grid/config/rowStylePicker.tsx +0 -196
  94. package/components/grid/dataGrid.tsx +0 -2183
  95. package/components/grid/detail/detailHeaderPanel.tsx +0 -59
  96. package/components/grid/export/contextMenu.tsx +0 -154
  97. package/components/grid/export/progressPopup.tsx +0 -106
  98. package/components/grid/export/worker/clipboardExport.ts +0 -10
  99. package/components/grid/export/worker/csvExport.ts +0 -10
  100. package/components/grid/export/worker/pdfExport.ts +0 -98
  101. package/components/grid/export/worker/txtExport.ts +0 -21
  102. package/components/grid/extendedDataGrid.tsx +0 -974
  103. package/components/grid/filter/customColumnFilter.tsx +0 -14
  104. package/components/grid/filter/dataGridColumnFilter.tsx +0 -70
  105. package/components/grid/filter/dateColumnFilter.tsx +0 -34
  106. package/components/grid/filter/textColumnFilter.tsx +0 -37
  107. package/components/grid/filter/wildcardQuickFilterEngine.ts +0 -50
  108. package/components/grid/header/simpleHeader.tsx +0 -270
  109. package/components/grid/panel/dataGridPagination.tsx +0 -123
  110. package/components/grid/panel/loadingOverlay.tsx +0 -14
  111. package/components/grid/panel/noRecordsOverlay.tsx +0 -16
  112. package/components/grid/panel/tablePagination.tsx +0 -77
  113. package/components/icons/dropdownArrow.tsx +0 -67
  114. package/components/icons/undoIcon.tsx +0 -16
  115. package/components/input/autoCompleteInput.tsx +0 -174
  116. package/components/input/draftUtils.tsx +0 -62
  117. package/components/input/hexaFormattedInput.tsx +0 -64
  118. package/components/input/mask/helpers.ts +0 -154
  119. package/components/input/mask/inputMaskCore.ts +0 -452
  120. package/components/input/mask/pattern.ts +0 -122
  121. package/components/input/maskedInput.tsx +0 -275
  122. package/components/input/passwordInput.tsx +0 -62
  123. package/components/input/simpleAutoComplete.tsx +0 -60
  124. package/components/input/textarea/extractSpansOfClasses.tsx +0 -125
  125. package/components/input/textarea/getRanges.ts +0 -82
  126. package/components/input/textarea/getType.ts +0 -23
  127. package/components/input/textarea/highlighedContents.tsx +0 -20
  128. package/components/input/textarea/highlightedTextarea.css +0 -61
  129. package/components/input/textarea/mentionsWithHighlighting.tsx +0 -95
  130. package/components/keyboard/keyboardUtils.ts +0 -42
  131. package/components/modal/draggableModalProvider.tsx +0 -37
  132. package/components/modal/impl/clamp.ts +0 -4
  133. package/components/modal/impl/draggableModal.tsx +0 -36
  134. package/components/modal/impl/draggableModalContext.ts +0 -14
  135. package/components/modal/impl/draggableModalInner.tsx +0 -114
  136. package/components/modal/impl/draggableModalReducer.ts +0 -285
  137. package/components/modal/impl/getWindowSize.ts +0 -6
  138. package/components/modal/impl/index.ts +0 -5
  139. package/components/modal/impl/resizeHandle.tsx +0 -12
  140. package/components/modal/impl/useDrag.ts +0 -57
  141. package/components/modal/impl/usePrevious.ts +0 -11
  142. package/components/modal/impl/useResize.ts +0 -79
  143. package/components/modal/modalDialog.tsx +0 -172
  144. package/components/picker/enumValuePicker.tsx +0 -48
  145. package/components/platformSpecific.ts +0 -39
  146. package/components/scrollTo/dom-scroll-into-view.d.ts +0 -1
  147. package/components/scrollTo/onlyText.ts +0 -36
  148. package/components/scrollTo/scrollTo.tsx +0 -324
  149. package/components/style/withCss.tsx +0 -14
  150. package/components/style/withInputNumberCss.tsx +0 -18
  151. package/components/svg.d.ts +0 -1
  152. package/components/table/dragSortingTable.tsx +0 -123
  153. package/components/text/impl/innerSize.ts +0 -15
  154. package/components/text/impl/series.ts +0 -37
  155. package/components/text/impl/shallowEqual.ts +0 -19
  156. package/components/text/impl/uniqueId.ts +0 -5
  157. package/components/text/impl/whilst.ts +0 -25
  158. package/components/text/textFit.tsx +0 -229
  159. package/i18n/componentsLocaleLoader.d.ts +0 -9
  160. package/lib/esm/components/codemirror/SyntaxHighlighter.js.map +0 -1
  161. package/lib/esm/components/color/colorSwatch.d.ts +0 -13
  162. package/lib/esm/components/color/colorSwatch.js.map +0 -1
  163. package/lib/esm/components/date/dateRangeInput.js.map +0 -1
  164. package/lib/esm/components/date/dateTimeInput.js.map +0 -1
  165. package/lib/esm/components/date/durationInput.js.map +0 -1
  166. package/lib/esm/components/grid/cell/rangeSelector.d.ts +0 -78
  167. package/lib/esm/components/grid/cell/rangeSelector.js +0 -527
  168. package/lib/esm/components/grid/columnUtils.js.map +0 -1
  169. package/lib/esm/components/grid/export/progressPopup.js.map +0 -1
  170. package/lib/esm/components/icons/undoIcon.js.map +0 -1
  171. package/lib/esm/components/input/draftUtils.js.map +0 -1
  172. package/lib/esm/components/input/draftail.d.ts +0 -1
  173. package/lib/esm/components/input/draftail.js +0 -2
  174. package/lib/esm/components/input/mask/inputMaskCore.js.map +0 -1
  175. package/lib/esm/components/input/mask/pattern.js.map +0 -1
  176. package/lib/esm/components/input/passwordInput.js.map +0 -1
  177. package/lib/esm/components/input/textarea/extractSpansOfClasses.js.map +0 -1
  178. package/lib/esm/components/input/textarea/getRanges.js.map +0 -1
  179. package/lib/esm/components/input/textarea/mentionsWithHighlighting.js.map +0 -1
  180. package/lib/esm/components/platformSpecific.js.map +0 -1
  181. package/lib/esm/components/text/impl/series.js.map +0 -1
  182. package/lib/esm/components/text/impl/whilst.js.map +0 -1
  183. package/lib/esm/i18n/components.cs.json +0 -101
  184. package/lib/esm/i18n/components.sk.json +0 -101
  185. package/lib/esm/i18n/components.uk.json +0 -101
  186. package/lib/esm/i18n/componentsLocaleHolder.js +0 -29
  187. package/lib/esm/i18n/componentsLocaleHolder.js.map +0 -1
  188. package/lib/esm/package.json +0 -70
  189. package/lib/esm/tsconfig.build.json +0 -24
  190. package/lib/esm/tsconfig.json +0 -11
  191. /package/{lib/esm/components → components}/clipboard/clipboardUtils.d.ts +0 -0
  192. /package/{lib/esm/components → components}/clipboard/clipboardUtils.js +0 -0
  193. /package/{lib/esm/components → components}/clipboard/clipboardUtils.js.map +0 -0
  194. /package/{lib/esm/components → components}/codemirror/SyntaxHighlighter.d.ts +0 -0
  195. /package/{lib/esm/components → components}/codemirror/SyntaxHighlighter.js +0 -0
  196. /package/{lib/esm/components → components}/collapse/expandable.d.ts +0 -0
  197. /package/{lib/esm/components → components}/collapse/expandable.js +0 -0
  198. /package/{lib/esm/components → components}/collapse/expandable.js.map +0 -0
  199. /package/{lib/esm/components → components}/color/colorPicker.d.ts +0 -0
  200. /package/{lib/esm/components → components}/color/colorPicker.js +0 -0
  201. /package/{lib/esm/components → components}/color/colorPicker.js.map +0 -0
  202. /package/{lib/esm/components → components}/color/colorSwatch.js +0 -0
  203. /package/{lib/esm/components → components}/color/colorUtils.d.ts +0 -0
  204. /package/{lib/esm/components → components}/color/colorUtils.js +0 -0
  205. /package/{lib/esm/components → components}/color/colorUtils.js.map +0 -0
  206. /package/{lib/esm/components → components}/date/dateRangeInput.d.ts +0 -0
  207. /package/{lib/esm/components → components}/date/dateRangeInputAdvancedPanel.d.ts +0 -0
  208. /package/{lib/esm/components → components}/date/dateRangeInputAdvancedPanel.js +0 -0
  209. /package/{lib/esm/components → components}/date/dateRangeInputAdvancedPanel.js.map +0 -0
  210. /package/{lib/esm/components → components}/date/dateRangeInputConfirm.d.ts +0 -0
  211. /package/{lib/esm/components → components}/date/dateRangeInputConfirm.js +0 -0
  212. /package/{lib/esm/components → components}/date/dateRangeInputConfirm.js.map +0 -0
  213. /package/{lib/esm/components → components}/date/dateTimeInput.d.ts +0 -0
  214. /package/{lib/esm/components → components}/date/durationInput.d.ts +0 -0
  215. /package/{lib/esm/components → components}/form/NiceFormItem.d.ts +0 -0
  216. /package/{lib/esm/components → components}/form/NiceFormItem.js +0 -0
  217. /package/{lib/esm/components → components}/form/NiceFormItem.js.map +0 -0
  218. /package/{lib/esm/components → components}/grid/cell/beanAccessor.d.ts +0 -0
  219. /package/{lib/esm/components → components}/grid/cell/beanAccessor.js +0 -0
  220. /package/{lib/esm/components → components}/grid/cell/beanAccessor.js.map +0 -0
  221. /package/{lib/esm/components → components}/grid/cell/cellEditorUtils.d.ts +0 -0
  222. /package/{lib/esm/components → components}/grid/cell/cellEditorUtils.js +0 -0
  223. /package/{lib/esm/components → components}/grid/cell/customEnumCellEditor.d.ts +0 -0
  224. /package/{lib/esm/components → components}/grid/cell/customEnumCellEditor.js +0 -0
  225. /package/{lib/esm/components → components}/grid/cell/customEnumCellEditor.js.map +0 -0
  226. /package/{lib/esm/components → components}/grid/cell/dataGridCellEditorComponent.d.ts +0 -0
  227. /package/{lib/esm/components → components}/grid/cell/dataGridCellEditorComponent.js +0 -0
  228. /package/{lib/esm/components → components}/grid/cell/dataGridCellEditorComponent.js.map +0 -0
  229. /package/{lib/esm/components → components}/grid/cell/dateCellEditor.d.ts +0 -0
  230. /package/{lib/esm/components → components}/grid/cell/dateCellEditor.js +0 -0
  231. /package/{lib/esm/components → components}/grid/cell/dateCellEditor.js.map +0 -0
  232. /package/{lib/esm/components → components}/grid/cell/durationCellEditor.d.ts +0 -0
  233. /package/{lib/esm/components → components}/grid/cell/durationCellEditor.js +0 -0
  234. /package/{lib/esm/components → components}/grid/cell/durationCellEditor.js.map +0 -0
  235. /package/{lib/esm/components → components}/grid/cell/hexaOctetStringCellEditor.d.ts +0 -0
  236. /package/{lib/esm/components → components}/grid/cell/hexaOctetStringCellEditor.js +0 -0
  237. /package/{lib/esm/components → components}/grid/cell/hexaOctetStringCellEditor.js.map +0 -0
  238. /package/{lib/esm/components → components}/grid/cell/hexaValueCellEditor.d.ts +0 -0
  239. /package/{lib/esm/components → components}/grid/cell/hexaValueCellEditor.js +0 -0
  240. /package/{lib/esm/components → components}/grid/cell/hexaValueCellEditor.js.map +0 -0
  241. /package/{lib/esm/components → components}/grid/cell/numberCellEditor.d.ts +0 -0
  242. /package/{lib/esm/components → components}/grid/cell/numberCellEditor.js +0 -0
  243. /package/{lib/esm/components → components}/grid/cell/numberCellEditor.js.map +0 -0
  244. /package/{lib/esm/components → components}/grid/cell/rangeSelector.js.map +0 -0
  245. /package/{lib/esm/components → components}/grid/cell/simpleStatusTextCellEditor.d.ts +0 -0
  246. /package/{lib/esm/components → components}/grid/cell/simpleStatusTextCellEditor.js +0 -0
  247. /package/{lib/esm/components → components}/grid/cell/simpleStatusTextCellEditor.js.map +0 -0
  248. /package/{lib/esm/components → components}/grid/cell/statusTextCellEditor.d.ts +0 -0
  249. /package/{lib/esm/components → components}/grid/cell/statusTextCellEditor.js +0 -0
  250. /package/{lib/esm/components → components}/grid/cell/statusTextCellEditor.js.map +0 -0
  251. /package/{lib/esm/components → components}/grid/cell/tableDefaultRowStyleRules.d.ts +0 -0
  252. /package/{lib/esm/components → components}/grid/cell/tableDefaultRowStyleRules.js +0 -0
  253. /package/{lib/esm/components → components}/grid/cell/tableDefaultRowStyleRules.js.map +0 -0
  254. /package/{lib/esm/components → components}/grid/cell/textCellEditor.d.ts +0 -0
  255. /package/{lib/esm/components → components}/grid/cell/textCellEditor.js +0 -0
  256. /package/{lib/esm/components → components}/grid/cell/textCellEditor.js.map +0 -0
  257. /package/{lib/esm/components → components}/grid/cell/withAgGridHooks.d.ts +0 -0
  258. /package/{lib/esm/components → components}/grid/cell/withAgGridHooks.js +0 -0
  259. /package/{lib/esm/components → components}/grid/cell/withAgGridHooks.js.map +0 -0
  260. /package/{lib/esm/components → components}/grid/columnUtils.d.ts +0 -0
  261. /package/{lib/esm/components → components}/grid/columnUtils.js +0 -0
  262. /package/{lib/esm/components → components}/grid/config/columnTransfer.d.ts +0 -0
  263. /package/{lib/esm/components → components}/grid/config/columnTransfer.js +0 -0
  264. /package/{lib/esm/components → components}/grid/config/columnTransfer.js.map +0 -0
  265. /package/{lib/esm/components → components}/grid/config/dataGridEditor.d.ts +0 -0
  266. /package/{lib/esm/components → components}/grid/config/dataGridEditor.js +0 -0
  267. /package/{lib/esm/components → components}/grid/config/dataGridEditor.js.map +0 -0
  268. /package/{lib/esm/components → components}/grid/config/rowHeightCalculator.d.ts +0 -0
  269. /package/{lib/esm/components → components}/grid/config/rowHeightCalculator.js +0 -0
  270. /package/{lib/esm/components → components}/grid/config/rowHeightCalculator.js.map +0 -0
  271. /package/{lib/esm/components → components}/grid/config/rowStylePicker.d.ts +0 -0
  272. /package/{lib/esm/components → components}/grid/config/rowStylePicker.js +0 -0
  273. /package/{lib/esm/components → components}/grid/config/rowStylePicker.js.map +0 -0
  274. /package/{lib/esm/components → components}/grid/dataGrid.d.ts +0 -0
  275. /package/{lib/esm/components → components}/grid/dataGrid.js +0 -0
  276. /package/{lib/esm/components → components}/grid/dataGrid.js.map +0 -0
  277. /package/{lib/esm/components → components}/grid/detail/detailHeaderPanel.d.ts +0 -0
  278. /package/{lib/esm/components → components}/grid/detail/detailHeaderPanel.js +0 -0
  279. /package/{lib/esm/components → components}/grid/detail/detailHeaderPanel.js.map +0 -0
  280. /package/{lib/esm/components → components}/grid/export/contextMenu.d.ts +0 -0
  281. /package/{lib/esm/components → components}/grid/export/contextMenu.js.map +0 -0
  282. /package/{lib/esm/components → components}/grid/export/progressPopup.d.ts +0 -0
  283. /package/{lib/esm/components → components}/grid/export/progressPopup.js +0 -0
  284. /package/{lib/esm/components → components}/grid/export/worker/clipboardExport.d.ts +0 -0
  285. /package/{lib/esm/components → components}/grid/export/worker/clipboardExport.js +0 -0
  286. /package/{lib/esm/components → components}/grid/export/worker/csvExport.d.ts +0 -0
  287. /package/{lib/esm/components → components}/grid/export/worker/csvExport.js +0 -0
  288. /package/{lib/esm/components → components}/grid/export/worker/pdfExport.d.ts +0 -0
  289. /package/{lib/esm/components → components}/grid/export/worker/pdfExport.js +0 -0
  290. /package/{lib/esm/components → components}/grid/export/worker/pdfExport.js.map +0 -0
  291. /package/{lib/esm/components → components}/grid/export/worker/txtExport.d.ts +0 -0
  292. /package/{lib/esm/components → components}/grid/export/worker/txtExport.js +0 -0
  293. /package/{lib/esm/components → components}/grid/extendedDataGrid.d.ts +0 -0
  294. /package/{lib/esm/components → components}/grid/extendedDataGrid.js +0 -0
  295. /package/{lib/esm/components → components}/grid/extendedDataGrid.js.map +0 -0
  296. /package/{lib/esm/components → components}/grid/filter/customColumnFilter.d.ts +0 -0
  297. /package/{lib/esm/components → components}/grid/filter/customColumnFilter.js +0 -0
  298. /package/{lib/esm/components → components}/grid/filter/customColumnFilter.js.map +0 -0
  299. /package/{lib/esm/components → components}/grid/filter/dataGridColumnFilter.d.ts +0 -0
  300. /package/{lib/esm/components → components}/grid/filter/dataGridColumnFilter.js +0 -0
  301. /package/{lib/esm/components → components}/grid/filter/dataGridColumnFilter.js.map +0 -0
  302. /package/{lib/esm/components → components}/grid/filter/dateColumnFilter.d.ts +0 -0
  303. /package/{lib/esm/components → components}/grid/filter/dateColumnFilter.js +0 -0
  304. /package/{lib/esm/components → components}/grid/filter/dateColumnFilter.js.map +0 -0
  305. /package/{lib/esm/components → components}/grid/filter/textColumnFilter.d.ts +0 -0
  306. /package/{lib/esm/components → components}/grid/filter/textColumnFilter.js +0 -0
  307. /package/{lib/esm/components → components}/grid/filter/textColumnFilter.js.map +0 -0
  308. /package/{lib/esm/components → components}/grid/filter/wildcardQuickFilterEngine.d.ts +0 -0
  309. /package/{lib/esm/components → components}/grid/filter/wildcardQuickFilterEngine.js +0 -0
  310. /package/{lib/esm/components → components}/grid/filter/wildcardQuickFilterEngine.js.map +0 -0
  311. /package/{lib/esm/components → components}/grid/header/simpleHeader.d.ts +0 -0
  312. /package/{lib/esm/components → components}/grid/header/simpleHeader.js +0 -0
  313. /package/{lib/esm/components → components}/grid/header/simpleHeader.js.map +0 -0
  314. /package/{lib/esm/components → components}/grid/panel/dataGridPagination.d.ts +0 -0
  315. /package/{lib/esm/components → components}/grid/panel/dataGridPagination.js +0 -0
  316. /package/{lib/esm/components → components}/grid/panel/dataGridPagination.js.map +0 -0
  317. /package/{lib/esm/components → components}/grid/panel/loadingOverlay.d.ts +0 -0
  318. /package/{lib/esm/components → components}/grid/panel/loadingOverlay.js +0 -0
  319. /package/{lib/esm/components → components}/grid/panel/loadingOverlay.js.map +0 -0
  320. /package/{lib/esm/components → components}/grid/panel/noRecordsOverlay.d.ts +0 -0
  321. /package/{lib/esm/components → components}/grid/panel/noRecordsOverlay.js +0 -0
  322. /package/{lib/esm/components → components}/grid/panel/noRecordsOverlay.js.map +0 -0
  323. /package/{lib/esm/components → components}/grid/panel/tablePagination.d.ts +0 -0
  324. /package/{lib/esm/components → components}/grid/panel/tablePagination.js +0 -0
  325. /package/{lib/esm/components → components}/grid/panel/tablePagination.js.map +0 -0
  326. /package/{lib/esm/components → components}/icons/dropdownArrow.d.ts +0 -0
  327. /package/{lib/esm/components → components}/icons/dropdownArrow.js +0 -0
  328. /package/{lib/esm/components → components}/icons/dropdownArrow.js.map +0 -0
  329. /package/{lib/esm/components → components}/icons/undoIcon.d.ts +0 -0
  330. /package/{lib/esm/components → components}/icons/undoIcon.js +0 -0
  331. /package/{lib/esm/components → components}/input/autoCompleteInput.d.ts +0 -0
  332. /package/{lib/esm/components → components}/input/autoCompleteInput.js +0 -0
  333. /package/{lib/esm/components → components}/input/autoCompleteInput.js.map +0 -0
  334. /package/{lib/esm/components → components}/input/draftUtils.d.ts +0 -0
  335. /package/{lib/esm/components → components}/input/draftUtils.js +0 -0
  336. /package/{lib/esm/components → components}/input/hexaFormattedInput.d.ts +0 -0
  337. /package/{lib/esm/components → components}/input/hexaFormattedInput.js +0 -0
  338. /package/{lib/esm/components → components}/input/hexaFormattedInput.js.map +0 -0
  339. /package/{lib/esm/components → components}/input/mask/helpers.d.ts +0 -0
  340. /package/{lib/esm/components → components}/input/mask/helpers.js +0 -0
  341. /package/{lib/esm/components → components}/input/mask/helpers.js.map +0 -0
  342. /package/{lib/esm/components → components}/input/mask/inputMaskCore.d.ts +0 -0
  343. /package/{lib/esm/components → components}/input/mask/inputMaskCore.js +0 -0
  344. /package/{lib/esm/components → components}/input/mask/pattern.d.ts +0 -0
  345. /package/{lib/esm/components → components}/input/mask/pattern.js +0 -0
  346. /package/{lib/esm/components → components}/input/maskedInput.d.ts +0 -0
  347. /package/{lib/esm/components → components}/input/maskedInput.js +0 -0
  348. /package/{lib/esm/components → components}/input/maskedInput.js.map +0 -0
  349. /package/{lib/esm/components → components}/input/passwordInput.d.ts +0 -0
  350. /package/{lib/esm/components → components}/input/passwordInput.js +0 -0
  351. /package/{lib/esm/components → components}/input/simpleAutoComplete.d.ts +0 -0
  352. /package/{lib/esm/components → components}/input/simpleAutoComplete.js +0 -0
  353. /package/{lib/esm/components → components}/input/simpleAutoComplete.js.map +0 -0
  354. /package/{lib/esm/components → components}/input/textarea/extractSpansOfClasses.d.ts +0 -0
  355. /package/{lib/esm/components → components}/input/textarea/extractSpansOfClasses.js +0 -0
  356. /package/{lib/esm/components → components}/input/textarea/getRanges.d.ts +0 -0
  357. /package/{lib/esm/components → components}/input/textarea/getRanges.js +0 -0
  358. /package/{lib/esm/components → components}/input/textarea/getType.d.ts +0 -0
  359. /package/{lib/esm/components → components}/input/textarea/getType.js +0 -0
  360. /package/{lib/esm/components → components}/input/textarea/highlighedContents.d.ts +0 -0
  361. /package/{lib/esm/components → components}/input/textarea/highlighedContents.js +0 -0
  362. /package/{lib/esm/components → components}/input/textarea/mentionsWithHighlighting.d.ts +0 -0
  363. /package/{lib/esm/components → components}/input/textarea/mentionsWithHighlighting.js +0 -0
  364. /package/{lib/esm/components → components}/keyboard/keyboardUtils.d.ts +0 -0
  365. /package/{lib/esm/components → components}/keyboard/keyboardUtils.js +0 -0
  366. /package/{lib/esm/components → components}/modal/draggableModalProvider.d.ts +0 -0
  367. /package/{lib/esm/components → components}/modal/draggableModalProvider.js +0 -0
  368. /package/{lib/esm/components → components}/modal/draggableModalProvider.js.map +0 -0
  369. /package/{lib/esm/components → components}/modal/impl/clamp.d.ts +0 -0
  370. /package/{lib/esm/components → components}/modal/impl/clamp.js +0 -0
  371. /package/{lib/esm/components → components}/modal/impl/clamp.js.map +0 -0
  372. /package/{lib/esm/components → components}/modal/impl/draggableModal.d.ts +0 -0
  373. /package/{lib/esm/components → components}/modal/impl/draggableModal.js +0 -0
  374. /package/{lib/esm/components → components}/modal/impl/draggableModal.js.map +0 -0
  375. /package/{lib/esm/components → components}/modal/impl/draggableModalContext.d.ts +0 -0
  376. /package/{lib/esm/components → components}/modal/impl/draggableModalContext.js +0 -0
  377. /package/{lib/esm/components → components}/modal/impl/draggableModalContext.js.map +0 -0
  378. /package/{lib/esm/components → components}/modal/impl/draggableModalInner.d.ts +0 -0
  379. /package/{lib/esm/components → components}/modal/impl/draggableModalInner.js +0 -0
  380. /package/{lib/esm/components → components}/modal/impl/draggableModalInner.js.map +0 -0
  381. /package/{lib/esm/components → components}/modal/impl/draggableModalReducer.d.ts +0 -0
  382. /package/{lib/esm/components → components}/modal/impl/draggableModalReducer.js +0 -0
  383. /package/{lib/esm/components → components}/modal/impl/draggableModalReducer.js.map +0 -0
  384. /package/{lib/esm/components → components}/modal/impl/getWindowSize.d.ts +0 -0
  385. /package/{lib/esm/components → components}/modal/impl/getWindowSize.js +0 -0
  386. /package/{lib/esm/components → components}/modal/impl/getWindowSize.js.map +0 -0
  387. /package/{lib/esm/components → components}/modal/impl/index.d.ts +0 -0
  388. /package/{lib/esm/components → components}/modal/impl/index.js +0 -0
  389. /package/{lib/esm/components → components}/modal/impl/index.js.map +0 -0
  390. /package/{lib/esm/components → components}/modal/impl/resizeHandle.d.ts +0 -0
  391. /package/{lib/esm/components → components}/modal/impl/resizeHandle.js +0 -0
  392. /package/{lib/esm/components → components}/modal/impl/resizeHandle.js.map +0 -0
  393. /package/{lib/esm/components → components}/modal/impl/useDrag.d.ts +0 -0
  394. /package/{lib/esm/components → components}/modal/impl/useDrag.js +0 -0
  395. /package/{lib/esm/components → components}/modal/impl/useDrag.js.map +0 -0
  396. /package/{lib/esm/components → components}/modal/impl/usePrevious.d.ts +0 -0
  397. /package/{lib/esm/components → components}/modal/impl/usePrevious.js +0 -0
  398. /package/{lib/esm/components → components}/modal/impl/usePrevious.js.map +0 -0
  399. /package/{lib/esm/components → components}/modal/impl/useResize.d.ts +0 -0
  400. /package/{lib/esm/components → components}/modal/impl/useResize.js +0 -0
  401. /package/{lib/esm/components → components}/modal/impl/useResize.js.map +0 -0
  402. /package/{lib/esm/components → components}/modal/modalDialog.d.ts +0 -0
  403. /package/{lib/esm/components → components}/modal/modalDialog.js +0 -0
  404. /package/{lib/esm/components → components}/modal/modalDialog.js.map +0 -0
  405. /package/{lib/esm/components → components}/picker/enumValuePicker.d.ts +0 -0
  406. /package/{lib/esm/components → components}/picker/enumValuePicker.js +0 -0
  407. /package/{lib/esm/components → components}/picker/enumValuePicker.js.map +0 -0
  408. /package/{lib/esm/components → components}/platformSpecific.d.ts +0 -0
  409. /package/{lib/esm/components → components}/platformSpecific.js +0 -0
  410. /package/{lib/esm/components → components}/scrollTo/onlyText.d.ts +0 -0
  411. /package/{lib/esm/components → components}/scrollTo/onlyText.js +0 -0
  412. /package/{lib/esm/components → components}/scrollTo/onlyText.js.map +0 -0
  413. /package/{lib/esm/components → components}/scrollTo/scrollTo.d.ts +0 -0
  414. /package/{lib/esm/components → components}/scrollTo/scrollTo.js +0 -0
  415. /package/{lib/esm/components → components}/scrollTo/scrollTo.js.map +0 -0
  416. /package/{lib/esm/components → components}/style/withCss.d.ts +0 -0
  417. /package/{lib/esm/components → components}/style/withCss.js +0 -0
  418. /package/{lib/esm/components → components}/style/withCss.js.map +0 -0
  419. /package/{lib/esm/components → components}/style/withInputNumberCss.d.ts +0 -0
  420. /package/{lib/esm/components → components}/style/withInputNumberCss.js +0 -0
  421. /package/{lib/esm/components → components}/style/withInputNumberCss.js.map +0 -0
  422. /package/{lib/esm/components → components}/table/dragSortingTable.d.ts +0 -0
  423. /package/{lib/esm/components → components}/table/dragSortingTable.js +0 -0
  424. /package/{lib/esm/components → components}/table/dragSortingTable.js.map +0 -0
  425. /package/{lib/esm/components → components}/text/impl/innerSize.d.ts +0 -0
  426. /package/{lib/esm/components → components}/text/impl/innerSize.js +0 -0
  427. /package/{lib/esm/components → components}/text/impl/series.d.ts +0 -0
  428. /package/{lib/esm/components → components}/text/impl/series.js +0 -0
  429. /package/{lib/esm/components → components}/text/impl/shallowEqual.d.ts +0 -0
  430. /package/{lib/esm/components → components}/text/impl/shallowEqual.js +0 -0
  431. /package/{lib/esm/components → components}/text/impl/uniqueId.d.ts +0 -0
  432. /package/{lib/esm/components → components}/text/impl/uniqueId.js +0 -0
  433. /package/{lib/esm/components → components}/text/impl/whilst.d.ts +0 -0
  434. /package/{lib/esm/components → components}/text/impl/whilst.js +0 -0
  435. /package/{lib/esm/components → components}/text/textFit.d.ts +0 -0
  436. /package/{lib/esm/components → components}/text/textFit.js +0 -0
  437. /package/{lib/esm/components → components}/text/textFit.js.map +0 -0
  438. /package/{lib/esm/i18n → i18n}/componentsLocaleHolder.d.ts +0 -0
@@ -1,974 +0,0 @@
1
- import React, {ReactElement} from "react";
2
- import * as FlexLayout from "flexlayout-react";
3
- import {Actions} from "flexlayout-react";
4
- import {ExclamationOutlined, EyeInvisibleOutlined, EyeOutlined, FilterOutlined} from "@ant-design/icons";
5
- import {Badge, Button, Empty} from "antd";
6
- import DataGrid, {
7
- DataGridFilterProps,
8
- DataGridProps,
9
- DataGridSearchProps,
10
- DataGridViewportChangedEvent,
11
- OnLoadDataCallback,
12
- SortItem
13
- } from "./dataGrid";
14
- import debounce from "lodash/debounce";
15
- import i18n from "d2core/i18n/i18n";
16
- import isEqual from "lodash/isEqual"
17
- import isEqualWith from "lodash/isEqualWith"
18
- import cloneDeep from "lodash/cloneDeep";
19
- import tableDefaultRowStyleRules, {RowStyleRule} from "d2coreui/components/grid/cell/tableDefaultRowStyleRules";
20
- import {
21
- ColDef,
22
- ColumnState,
23
- GridApi,
24
- GridReadyEvent,
25
- RowDataUpdatedEvent,
26
- SelectionChangedEvent,
27
- TextFilter,
28
- TextFilterModel,
29
- ViewportChangedEvent
30
- } from "ag-grid-community";
31
- import {Model} from "flexlayout-react/declarations/model/Model";
32
- import {ColumnUtils} from "./columnUtils";
33
- import {DataChangeStateEnum} from "d2core/types/dataChangeStateEnum";
34
-
35
- const CONFIGURATION_VERSION = 1;
36
-
37
- export interface GridConfiguration {
38
- // version of configuration
39
- version?: number
40
- // current layout model of panels (filter, table, detail)
41
- layoutModel?: any
42
- // current state of table columns
43
- columnModel?: ColumnState[]
44
- //current page size of the table
45
- pageSize: number
46
- // default page size, applied when user reverts configuration
47
- defaultPageSize?: number
48
- // table scrolls to lastly added record automatically
49
- followLastRecord?: boolean;
50
- // table sort model applied/required for follow last record functionality
51
- followLastRecordSortModel?: SortItem[]
52
- // flag if follow last record feature could be turned on/off by user
53
- followLastRecordEditable?: boolean
54
- // allow showing floating column filters beneath column names
55
- columnSearchVisible?: boolean
56
- // rules which apply to table rows
57
- rowStyleRules?: RowStyleRule[]
58
- // default rules which apply to table rows
59
- defaultRowStyleRules?: RowStyleRule[]
60
- // show milliseconds in datetime, time columns
61
- showMilliseconds?: boolean
62
- defaultShowMilliseconds?: boolean
63
- // hide year in date columns
64
- hideYear?: boolean
65
- defaultHideYear?: boolean
66
- }
67
-
68
- interface ExtendedDataGridSearchProps extends DataGridSearchProps {
69
- initialSearchHistory?: string[]
70
- }
71
-
72
- interface ExtendedDataGridFilterProps extends DataGridFilterProps {
73
- quickFilterEnabled?: boolean
74
- }
75
-
76
- export interface FilterPanelRendererParams {
77
- defaultFilter?: any,
78
- // flag if filter is different than default filter
79
- filterChanged: boolean
80
- }
81
-
82
- export interface ExtendedDataGridProps extends Omit<DataGridProps, "paging"> {
83
- defaultGridConfiguration: GridConfiguration
84
-
85
- // handler called during changes to data grid configuration
86
- onChangeConfiguration?(gridConfiguration: GridConfiguration): void
87
-
88
- // allow changing configuration
89
- disableConfigurationChange?: boolean
90
-
91
- filter?: ExtendedDataGridFilterProps
92
- search?: ExtendedDataGridSearchProps
93
-
94
- paging?: {
95
- /**
96
- * Page size change handler
97
- * @param currentPageSize - current page size represents number rows available
98
- * @param definedPageSize -
99
- */
100
- onPaginationChanged?: (currentPageSize: number | null, definedPageSize: number) => void;
101
- }
102
- // configuration of filter panel on the left side
103
- filterPanel?: {
104
- // default width of filter panel
105
- defaultWidth?: number
106
- // flag if panel is hidden, by default it is shown
107
- hidden?: boolean
108
- // default filter parameters
109
- defaultFilter?: any
110
- // filter panel render function
111
- renderer?(parameters: FilterPanelRendererParams): ReactElement
112
- }
113
- // configuration of detail panel on the right side
114
- detailPanel?: {
115
- // default width of detail panel on the left side
116
- defaultWidth?: number
117
- // detail panel render function
118
- renderer(): ReactElement
119
- }
120
- // panel placed directly below table, usually contains context buttons
121
- controlPanel?: {
122
- // control panel render function
123
- renderer?(): React.ReactElement | null
124
- }
125
-
126
- // handler notifying data of the table has changed
127
- onDataChanged?(): void
128
-
129
- // time between value updates in ms, 0 means no debounce
130
- updateDataDebounceInterval?: number
131
- }
132
-
133
- interface ExtendedDataGridState {
134
- // current layout model of panels (filter, table, detail)
135
- layoutModel: Model
136
- // current table configuration
137
- gridConfiguration: GridConfiguration
138
- // currently entered search string
139
- searchString: string
140
- // history of entered search strings
141
- searchHistory: string[]
142
- // default filter parameters
143
- defaultFilter: any
144
- // flag if advanced table configuration is visible
145
- tableConfigVisible: boolean
146
- // flag if filter has changed, so data doesn't correspond to current filter (color of search button changes to yellow)
147
- filterChanged: boolean
148
- // flag renders badge with exclamation after search button to notify user that table data are not actual
149
- tableNeedToBeReloaded: boolean
150
- }
151
-
152
- /**
153
- * Transaction class (more correct than RowDataTransaction)
154
- */
155
- interface DataGridTransaction<T> {
156
- addIndex?: number;
157
- add: T[];
158
- remove: T[];
159
- update: T[];
160
- }
161
-
162
- export default class ExtendedDataGrid<T extends {
163
- id: number | string
164
- }> extends React.Component<ExtendedDataGridProps, ExtendedDataGridState> {
165
- public static defaultProps = {
166
- rowStyleRules: tableDefaultRowStyleRules()
167
- };
168
-
169
- dataGrid?: DataGrid;
170
- private gridApi?: GridApi;
171
- // flag if data are loaded
172
- private dataLoaded: boolean;
173
- // transaction object used to update data from class
174
- private dataTransaction: DataGridTransaction<T>;
175
- private flexLayout: any = null;
176
-
177
- private _updateDataDebounced?(): void;
178
-
179
- constructor(props: Readonly<ExtendedDataGridProps>) {
180
- super(props);
181
- let gridConfiguration: GridConfiguration = {
182
- version: CONFIGURATION_VERSION,
183
- pageSize: 0
184
- };
185
- const gridConfigurationOk = props.defaultGridConfiguration && (!props.defaultGridConfiguration.version || props.defaultGridConfiguration.version === CONFIGURATION_VERSION);
186
- const layoutModelExists = gridConfigurationOk && !!props.defaultGridConfiguration.layoutModel;
187
- gridConfiguration.layoutModel = layoutModelExists ? props.defaultGridConfiguration.layoutModel : this._getInitialLayoutModel(props);
188
- gridConfiguration.columnModel = gridConfigurationOk && props.defaultGridConfiguration.columnModel ? props.defaultGridConfiguration.columnModel : undefined;
189
- gridConfiguration.pageSize = gridConfigurationOk && props.defaultGridConfiguration.pageSize ? props.defaultGridConfiguration.pageSize : 0;
190
- gridConfiguration.defaultPageSize = gridConfigurationOk && props.defaultGridConfiguration.defaultPageSize ? props.defaultGridConfiguration.defaultPageSize : undefined;
191
- gridConfiguration.followLastRecord = gridConfigurationOk && props.defaultGridConfiguration.followLastRecord;
192
- gridConfiguration.followLastRecordSortModel = gridConfigurationOk && props.defaultGridConfiguration.followLastRecordSortModel ? props.defaultGridConfiguration.followLastRecordSortModel : undefined;
193
- gridConfiguration.followLastRecordEditable = gridConfigurationOk && props.defaultGridConfiguration.followLastRecordEditable;
194
- gridConfiguration.columnSearchVisible = gridConfigurationOk && props.defaultGridConfiguration.columnSearchVisible;
195
- gridConfiguration.rowStyleRules = gridConfigurationOk && props.defaultGridConfiguration.rowStyleRules ? props.defaultGridConfiguration.rowStyleRules : tableDefaultRowStyleRules();
196
- gridConfiguration.defaultRowStyleRules = gridConfigurationOk && props.defaultGridConfiguration.defaultRowStyleRules ? props.defaultGridConfiguration.defaultRowStyleRules : tableDefaultRowStyleRules();
197
- gridConfiguration.showMilliseconds = gridConfigurationOk && props.defaultGridConfiguration.showMilliseconds ? props.defaultGridConfiguration.showMilliseconds : false;
198
- gridConfiguration.defaultShowMilliseconds = gridConfigurationOk && props.defaultGridConfiguration.defaultShowMilliseconds ? props.defaultGridConfiguration.defaultShowMilliseconds : false;
199
- gridConfiguration.hideYear = gridConfigurationOk && props.defaultGridConfiguration.hideYear ? props.defaultGridConfiguration.hideYear : false;
200
- gridConfiguration.defaultHideYear = gridConfigurationOk && props.defaultGridConfiguration.defaultHideYear ? props.defaultGridConfiguration.defaultHideYear : false;
201
-
202
- // nasty fix to define ids for tabsets due to react-flexlayout library fix: https://github.com/caplin/FlexLayout/commit/3a21b21f6cd5c2a7b52d46084dce6a3880f9af58#diff-92c133bf427754ff04deeab6751b083b7c97ca955e7cc57c740eef5433fd0129
203
- const layoutLength = gridConfiguration.layoutModel?.layout?.children?.length ?? 0;
204
- if (layoutLength > 0) {
205
- for (let i = 0; i < layoutLength; i++) {
206
- if (!gridConfiguration.layoutModel.layout.children[i].id) {
207
- gridConfiguration.layoutModel.layout.children[i].id = `#${(i + 1) * 2}`
208
- }
209
- }
210
- }
211
-
212
- this.state = {
213
- layoutModel: FlexLayout.Model.fromJson(gridConfiguration.layoutModel),
214
- gridConfiguration: gridConfiguration,
215
- // search context
216
- searchString: "",
217
- searchHistory: props.search && props.search.initialSearchHistory ? [...props.search.initialSearchHistory] : [],
218
- // visibility flags
219
- tableConfigVisible: false,
220
-
221
- defaultFilter: this.props.filterPanel && this.props.filterPanel.defaultFilter ? cloneDeep(this.props.filterPanel.defaultFilter) : undefined,
222
- filterChanged: false,
223
- tableNeedToBeReloaded: false
224
- };
225
-
226
- if (!layoutModelExists && props.filterPanel && props.filterPanel.hidden) {
227
- // hide filter panel if it is not explicitly shown
228
- this.state.layoutModel.doAction(FlexLayout.Actions.updateNodeAttributes("#2", {width: 0}));
229
- this.state.gridConfiguration.layoutModel.layout.children[0].width = 0;
230
- }
231
- if (props.detailPanel) {
232
- this.state.layoutModel.doAction(FlexLayout.Actions.updateNodeAttributes(props.filterPanel ? "#6" : "#4", {width: 0}));
233
- }
234
-
235
- this.dataLoaded = false;
236
- this.dataTransaction = {add: [], remove: [], update: []};
237
-
238
- const debounceInterval: number = props.updateDataDebounceInterval ?? 500;
239
- if (debounceInterval > 0) {
240
- this._updateDataDebounced = debounce(this._updateData.bind(this), debounceInterval, {maxWait: debounceInterval});
241
- } else {
242
- this._updateDataDebounced = this._updateData.bind(this);
243
- }
244
-
245
- this.renderToolbarButtons = this.renderToolbarButtons.bind(this);
246
- this._onLoadData = this._onLoadData.bind(this);
247
- this._onGridReady = this._onGridReady.bind(this);
248
- this._onPaginationChanged = this._onPaginationChanged.bind(this);
249
- this._onSearch = this._onSearch.bind(this);
250
- this._onSearchStringChanged = this._onSearchStringChanged.bind(this);
251
- this.renderToolbar = this.renderToolbar.bind(this);
252
- this._followLastRecordDebounced = debounce(this._followLastRecordDebounced.bind(this), 500, {maxWait: 500});
253
- this._onRowDataUpdated = this._onRowDataUpdated.bind(this);
254
- this._onChangeRowStyleRules = this._onChangeRowStyleRules.bind(this);
255
- this.showFilterPanel = this.showFilterPanel.bind(this);
256
- this.showDetailPanel = this.showDetailPanel.bind(this);
257
- this.selectNextPreviousRecord = this.selectNextPreviousRecord.bind(this);
258
- this._onSelectionChanged = this._onSelectionChanged.bind(this);
259
- this._onViewportChanged = this._onViewportChanged.bind(this);
260
- }
261
-
262
- _getInitialLayoutModel(props: ExtendedDataGridProps) {
263
- const renderFilter = props.filterPanel && props.filterPanel.renderer;
264
- const renderDetail = props.detailPanel;
265
- const layoutModel: any = {
266
- global: {
267
- tabSetEnableTabStrip: false,
268
- splitterSize: 4,
269
- },
270
- borders: [],
271
- layout: {
272
- "type": "row",
273
- "weight": 100,
274
- "children": [{
275
- "type": "tabset",
276
- "weight": 100,
277
- "selected": 0,
278
- "children": [
279
- {
280
- "type": "tab",
281
- "name": "Data",
282
- "component": "data-panel",
283
- }
284
- ]
285
- }]
286
- }
287
- };
288
- if (renderFilter) {
289
- layoutModel.layout["children"].unshift({
290
- "id": "#2",
291
- "type": "tabset",
292
- "width": props.filterPanel && props.filterPanel.defaultWidth ? props.filterPanel.defaultWidth : 228,
293
- "selected": 0,
294
- "children": [
295
- {
296
- "type": "tab",
297
- "name": "Filter",
298
- "component": "filter-panel",
299
- }
300
- ]
301
- });
302
- }
303
- if (renderDetail) {
304
- layoutModel.layout["children"].push({
305
- "id": props.filterPanel ? "#6" : "#4",
306
- "type": "tabset",
307
- "width": props.detailPanel ? (props.detailPanel.defaultWidth ? props.detailPanel.defaultWidth : 220) : 0,
308
- "selected": 0,
309
- "children": [
310
- {
311
- "type": "tab",
312
- "name": "Detail",
313
- "component": "detail-panel",
314
- }
315
- ]
316
- },);
317
- }
318
- return layoutModel;
319
- }
320
-
321
- getConfiguration(): GridConfiguration {
322
- return this.state.gridConfiguration;
323
- }
324
-
325
- getSearchContext(): { searchString: string, searchHistory: string[] } {
326
- // reverse searchHistory before storing it
327
- const searchHistory = [...this.state.searchHistory];
328
- searchHistory.reverse();
329
- return {
330
- searchString: this.state.searchString,
331
- searchHistory: searchHistory
332
- };
333
- }
334
-
335
- loadData(callback?: () => void): void {
336
- this.dataGrid?.loadData(callback);
337
- }
338
-
339
- isActive(): boolean {
340
- return !!this.dataGrid && this.dataGrid.isActive();
341
- }
342
-
343
- focus() {
344
- this.dataGrid?.focus();
345
- }
346
-
347
- private _changeConfiguration(configuration: Partial<GridConfiguration>, callback?: () => void): void {
348
- if (this.props.disableConfigurationChange) {
349
- return;
350
- }
351
- const newConfiguration = Object.assign(this.state.gridConfiguration, configuration);
352
- this.setState({gridConfiguration: newConfiguration}, callback);
353
- if (this.props.onChangeConfiguration) {
354
- this.props.onChangeConfiguration(this.state.gridConfiguration);
355
- }
356
- }
357
-
358
- private _onGridReady(event: GridReadyEvent): void {
359
- this.gridApi = event.api;
360
- this._reloadTableConfiguration();
361
- if (this.props.onGridReady) {
362
- this.props.onGridReady(event);
363
- }
364
- }
365
-
366
- private _onLoadData(callback: OnLoadDataCallback): void {
367
- if (this.state.tableNeedToBeReloaded) {
368
- this.setState({tableNeedToBeReloaded: false});
369
- }
370
- this.props.onLoadData((recordsCount) => {
371
- this.dataLoaded = true;
372
- // clear meanwhile dynamically added/removed/updated data records
373
- this.dataTransaction = {add: [], remove: [], update: []};
374
- this.followLastRecord();
375
- callback(recordsCount);
376
- })
377
- }
378
-
379
- private _onPaginationChanged(currentPageSize: number | null, definedPageSize: number): void {
380
- if (this.dataLoaded) {
381
- const definedPageSizeChanged = this.state.gridConfiguration.pageSize !== definedPageSize;
382
- if (definedPageSizeChanged) {
383
- this._changeConfiguration({pageSize: definedPageSize});
384
- this._followLastRecordDebounced();
385
- }
386
- if (this.props.paging && this.props.paging.onPaginationChanged) {
387
- this.props.paging.onPaginationChanged(currentPageSize, definedPageSize);
388
- }
389
- }
390
- }
391
-
392
- private _onSearchStringChanged(searchString: string): void {
393
- this.setState({searchString: searchString});
394
- if (this.props.search && this.props.search.onChange) {
395
- this.props.search.onChange(searchString);
396
- }
397
- }
398
-
399
- private _onSearch(): void {
400
- const currentSearchString = this.state.searchString;
401
- let searchHistory: string[] = this.state.searchHistory;
402
-
403
- // remove search string from history
404
- searchHistory = searchHistory.filter((searchString) => searchString !== currentSearchString);
405
- // add new search string to first position in history
406
- searchHistory.unshift(currentSearchString);
407
- searchHistory = searchHistory.slice(0, 10);
408
- this.setState({
409
- searchHistory: searchHistory,
410
- });
411
- if (this.props.search && this.props.search.onSearch) {
412
- this.props.search.onSearch();
413
- }
414
- }
415
-
416
- private _reloadTableConfiguration(): void {
417
- if (this.gridApi) {
418
- if (this.state.gridConfiguration.columnModel) {
419
- ColumnUtils.mergeColumnsState(this.state.gridConfiguration.columnModel, this.props.columnDefs as ColDef[]);
420
- this.gridApi.applyColumnState({state: this.state.gridConfiguration.columnModel, applyOrder: true});
421
- } else {
422
- this.gridApi.resetColumnState();
423
- const columnState = this.gridApi.getColumnState();
424
- this._changeConfiguration({columnModel: columnState});
425
- }
426
- }
427
- }
428
-
429
- clearTransaction() {
430
- this.dataTransaction.add = [];
431
- this.dataTransaction.remove = [];
432
- this.dataTransaction.update = [];
433
- this.dataTransaction.addIndex = undefined;
434
- }
435
-
436
- removeFromTransaction(item: T) {
437
- this.dataTransaction.add = this.dataTransaction.add.filter(value => value.id !== item.id);
438
- this.dataTransaction.remove = this.dataTransaction.remove.filter(value => value.id !== item.id);
439
- this.dataTransaction.update = this.dataTransaction.update.filter(value => value.id !== item.id);
440
- }
441
-
442
- addRecord(data: T, addIndex?: number): void {
443
- const markedToRemove = this.dataTransaction.remove.find((value => value.id === data.id));
444
- if (markedToRemove) {
445
- this.removeFromTransaction(data);
446
- this.dataTransaction.update.push(data);
447
- } else {
448
- this.removeFromTransaction(data);
449
- this.dataTransaction.add.push(data);
450
- if (addIndex !== undefined) {
451
- this.dataTransaction.addIndex = addIndex;
452
- }
453
- }
454
- if (this._updateDataDebounced) {
455
- this._updateDataDebounced();
456
- }
457
- }
458
-
459
- addRecords(dataArray: T[], addIndex?: number): void {
460
- (addIndex ? dataArray.reverse() : dataArray).forEach(data => this.addRecord(data, addIndex));
461
- }
462
-
463
- /** Set new data to the grid */
464
- setRowData(dataArray: T[]): void {
465
- // reset transaction data received till this new data list is loaded,
466
- // we can do it here, because communication is serialized in one thread
467
- // and all push changes to new list data will come only after this method is finished
468
- this.dataTransaction = {add: [], remove: [], update: []};
469
- this.dataGrid?.setRowData(dataArray);
470
- }
471
-
472
- removeRecord(data: T): void {
473
- const markedToAdd = this.dataTransaction.add.find((value => value.id === data.id));
474
- if (markedToAdd) {
475
- this.removeFromTransaction(data);
476
- } else {
477
- this.removeFromTransaction(data);
478
- this.dataTransaction.remove.push(data);
479
- }
480
- if (this._updateDataDebounced) {
481
- this._updateDataDebounced();
482
- }
483
- }
484
-
485
- removeRecords(dataList: T[]): void {
486
- dataList.forEach((data) => {
487
- this.removeRecord(data);
488
- })
489
- }
490
-
491
- updateRecord(data: (T & { dataChangeState?: DataChangeStateEnum })) {
492
- switch (data.dataChangeState) {
493
- case DataChangeStateEnum.CONFIGURED:
494
- this.addRecord(data);
495
- break;
496
- case DataChangeStateEnum.REMOVED:
497
- this.removeRecord(data);
498
- break;
499
- default:
500
- const markedToAdd = this.dataTransaction.add.find((value => value.id === data.id));
501
- if (markedToAdd) {
502
- this.addRecord(data);
503
- } else {
504
- this.removeFromTransaction(data);
505
- this.dataTransaction.update.push(data);
506
- if (this._updateDataDebounced) {
507
- this._updateDataDebounced();
508
- }
509
- }
510
- break;
511
- }
512
- }
513
-
514
- updateRecords(dataList: (T & { dataChangeState?: DataChangeStateEnum })[]) {
515
- dataList.forEach((data) => {
516
- this.updateRecord(data);
517
- });
518
- }
519
-
520
- private _updateData(): void {
521
- // remove duplicates, preserve last version of object
522
- this.dataTransaction.update.forEach(data => {
523
- const rowNode = this.gridApi ? this.gridApi.getRowNode(data.id + "") : null;
524
- if (rowNode) {
525
- rowNode.updateData(data);
526
- if (this.props.filter && this.props.filter.quickFilterEnabled) {
527
- rowNode.resetQuickFilterAggregateText();
528
- }
529
- } else {
530
- this.dataTransaction.add.push(data);
531
- }
532
- });
533
- // we have already processed them
534
- this.dataTransaction.update = [];
535
- if (this.dataTransaction.add.length > 0 || this.dataTransaction.remove.length > 0) {
536
- this.dataTransaction.remove.forEach((object) => {
537
- const node = this.gridApi ? this.gridApi.getRowNode(object.id + "") : null;
538
- if (node && node.isSelected()) {
539
- node.setSelected(false);
540
- }
541
- });
542
- // upgrade grid
543
- if (this.gridApi) {
544
- this.gridApi.applyTransaction(this.dataTransaction);
545
- }
546
- if (this.props.rowData) {
547
- // automatically updating client side array of records
548
- if (this.dataTransaction.addIndex !== undefined) {
549
- this.props.rowData.splice(this.dataTransaction.addIndex, 0, ...this.dataTransaction.add);
550
- } else {
551
- this.props.rowData.push(...this.dataTransaction.add);
552
- }
553
- this.dataTransaction.remove.forEach((object) => {
554
- const index = this.props.rowData ? this.props.rowData.indexOf(object) : -1;
555
- if (index >= 0 && this.props.rowData) {
556
- this.props.rowData.splice(index, 1);
557
- }
558
- });
559
- }
560
- this.dataTransaction = {add: [], remove: [], update: []};
561
- }
562
- if (this.props.onDataChanged) {
563
- this.props.onDataChanged();
564
- }
565
- }
566
-
567
- enableFollowLastRecord(enable: boolean): void {
568
- if (enable) {
569
- if (this.gridApi && this.state.gridConfiguration.followLastRecordSortModel) {
570
- this.dataGrid?.setSortModel(this.state.gridConfiguration.followLastRecordSortModel);
571
- this.gridApi.onSortChanged();
572
- }
573
- this._changeConfiguration({followLastRecord: true});
574
- this._followLastRecordDebounced();
575
- } else {
576
- if (this.state.gridConfiguration.followLastRecord) {
577
- this._changeConfiguration({followLastRecord: false});
578
- }
579
- }
580
- }
581
-
582
- _followLastRecordDebounced(): void {
583
- if (this.state.gridConfiguration.followLastRecord && this.props.rowData && this.props.rowData.length > 0) {
584
- this.followLastRecord();
585
- }
586
- }
587
-
588
- /**
589
- * Scrolls table to last record added to the tail of the table
590
- */
591
- followLastRecord(): void {
592
- if (this.state.gridConfiguration.followLastRecord && this.props.rowData && this.props.rowData.length > 0) {
593
- if (this.gridApi) {
594
- let lastIndex = -1;
595
- this.gridApi.forEachNodeAfterFilterAndSort((_, index) => {
596
- lastIndex = index;
597
- });
598
- if (lastIndex >= 0) {
599
- this.gridApi.ensureIndexVisible(lastIndex);
600
- }
601
- }
602
- }
603
- }
604
-
605
- public setColumnModel(columnModel: ColumnState[]) {
606
- this.dataGrid?.setColumnState(columnModel);
607
- }
608
-
609
- public setSortModel(sortModel: SortItem[]) {
610
- this.dataGrid?.setSortModel(sortModel);
611
- }
612
-
613
- public getSortModel(): SortItem[] {
614
- return this.dataGrid?.getSortModel() ?? [];
615
- }
616
-
617
- _onRowDataUpdated(event: RowDataUpdatedEvent): void {
618
- this._followLastRecordDebounced();
619
- if (this.props.onRowDataUpdated) {
620
- this.props.onRowDataUpdated(event);
621
- }
622
- }
623
-
624
- showFilterPanel(show: boolean): void {
625
- if (show) {
626
- this.state.layoutModel.doAction(FlexLayout.Actions.updateNodeAttributes("#2", {width: this.props.filterPanel && this.props.filterPanel.defaultWidth ? this.props.filterPanel.defaultWidth : 250}));
627
- } else {
628
- this.state.layoutModel.doAction(FlexLayout.Actions.updateNodeAttributes("#2", {width: 0}));
629
- }
630
- }
631
-
632
- showDetailPanel(show: boolean): void {
633
- if (show) {
634
- this.state.layoutModel.doAction(FlexLayout.Actions.updateNodeAttributes(this.props.filterPanel ? "#6" : "#4", {width: this.props.detailPanel && this.props.detailPanel.defaultWidth ? this.props.detailPanel.defaultWidth : 250}));
635
- } else {
636
- this.state.layoutModel.doAction(FlexLayout.Actions.updateNodeAttributes(this.props.filterPanel ? "#6" : "#4", {width: 0}));
637
- }
638
- }
639
-
640
- selectNextPreviousRecord(previous: boolean): void {
641
- let selectedNodes = this.gridApi?.getSelectedNodes();
642
- if (selectedNodes && selectedNodes.length === 1) {
643
- let selectedNode = selectedNodes[0];
644
- if (this.props.rowData && this.props.rowData.length > 0) {
645
- this.gridApi?.forEachNodeAfterFilterAndSort((node) => {
646
- if ((!previous && node.childIndex === (selectedNode.childIndex + 1)) || (previous && node.childIndex === (selectedNode.childIndex - 1))) {
647
- node.setSelected(true, true);
648
- this.gridApi?.ensureNodeVisible(node);
649
- }
650
- });
651
- } else if (this.props.rowModelType === "infinite" && selectedNode.rowIndex !== null) {
652
- const nextRowIndex = !previous ? selectedNode.rowIndex + 1 : (selectedNode.rowIndex !== 0 ? selectedNode.rowIndex - 1 : 0);
653
- const nextNode = this.gridApi?.getDisplayedRowAtIndex(nextRowIndex);
654
- if (nextNode) {
655
- nextNode.setSelected(true, true);
656
- this.gridApi?.ensureNodeVisible(nextNode);
657
- }
658
- }
659
- }
660
- }
661
-
662
- changeRowStyleRules(rowStyleRules: RowStyleRule[]): void {
663
- this.state.gridConfiguration.rowStyleRules = rowStyleRules;
664
- this.setState({gridConfiguration: this.state.gridConfiguration}, () => {
665
- this.gridApi?.redrawRows();
666
- });
667
- }
668
-
669
- _onChangeRowStyleRules(rowStyleRules: RowStyleRule[]): void {
670
- this.changeRowStyleRules(rowStyleRules);
671
- if (this.props.onChangeRowStyleRules) {
672
- this.props.onChangeRowStyleRules(rowStyleRules);
673
- }
674
- }
675
-
676
- onPanelFilterApplied(newFilter: any): void {
677
- const filterChanged = !isEqualWith(newFilter, this.state.defaultFilter, this.equalValues);
678
- if (filterChanged !== this.state.filterChanged) {
679
- this.setState({filterChanged: filterChanged});
680
- }
681
- }
682
-
683
- getUiColumnFilterValue(colId: string): string {
684
- const nameFilterModel: TextFilterModel = this.gridApi?.getColumnFilterModel(colId) as TextFilterModel;
685
- return nameFilterModel && nameFilterModel.filter ? nameFilterModel.filter : "";
686
- }
687
-
688
- async removeUiColumnFilterValue(colId: string) {
689
- const filterInstance = await this.gridApi?.getColumnFilterInstance(colId);
690
- const textFilterInstance = filterInstance as TextFilter;
691
- const nameFilterModel: TextFilterModel = textFilterInstance.getModelFromUi() as TextFilterModel;
692
- if (nameFilterModel) {
693
- nameFilterModel.filter = "";
694
- // we need to hack this typescript protected declaration
695
- // @ts-ignore
696
- textFilterInstance.resetUiToDefaults(false);
697
- }
698
- }
699
-
700
- /**
701
- * Applies UI column filter values silently without redrawing ag-grid
702
- * @param colId
703
- */
704
- async applyUiColumnFilterValue(colId: string) {
705
- const filterInstance = await this.gridApi?.getColumnFilterInstance(colId);
706
- ((filterInstance) as TextFilter)?.applyModel?.();
707
- }
708
-
709
- private equalValues(value: any, otherValue: any): (boolean | undefined) {
710
- if ((value === undefined || value === null) && (otherValue === undefined || otherValue === null)) {
711
- return true;
712
- }
713
- return undefined;
714
- }
715
-
716
- private _onSelectionChanged(event: SelectionChangedEvent): void {
717
- if (this.state.gridConfiguration.followLastRecord && this.gridApi && this.gridApi.getSelectedRows().length > 0) {
718
- this.enableFollowLastRecord(false);
719
- }
720
- if (this.props.onSelectionChanged) {
721
- this.props.onSelectionChanged(event);
722
- }
723
- }
724
-
725
- private _onViewportChanged(event: ViewportChangedEvent) {
726
- const dataGridEvent = event as DataGridViewportChangedEvent;
727
- if (this.state.gridConfiguration.followLastRecord && dataGridEvent.rowsScrollingDelta < 0) {
728
- this.enableFollowLastRecord(false);
729
- }
730
- if (this.props.onViewportChanged) {
731
- this.props.onViewportChanged(dataGridEvent);
732
- }
733
- }
734
-
735
- private renderToolbarButtons(): ReactElement {
736
- const renderFilter = this.props.filterPanel && this.props.filterPanel.renderer;
737
- const filterPanelVisible = renderFilter && this.isFilterPanelVisible();
738
- return (
739
- <React.Fragment>
740
- {renderFilter && <Button type={filterPanelVisible ? "primary" : "default"} key="filter-button"
741
- title={i18n("Show/Hide filter panel")}
742
- onClick={() => {
743
- this.showFilterPanel(!filterPanelVisible);
744
- }}>
745
- <FilterOutlined/>
746
- </Button>}
747
- {this.props.toolbar?.toolbarButtons}
748
- {this.state.gridConfiguration.followLastRecordEditable &&
749
- <Button key="track-button"
750
- title={i18n("Track last added record to table")}
751
- onClick={(e) => {
752
- this.enableFollowLastRecord(!this.state.gridConfiguration.followLastRecord);
753
- (e.target as HTMLButtonElement).blur();
754
- }}>
755
- {this.state.gridConfiguration.followLastRecord ? <EyeOutlined/> : <EyeInvisibleOutlined/>}
756
- </Button>}
757
- </React.Fragment>
758
- );
759
- }
760
-
761
- private renderToolbar(originalToolbar: ReactElement): ReactElement {
762
- let toolbarToRender = originalToolbar;
763
- if (this.props.toolbar && this.props.toolbar.renderToolbar) {
764
- const searchBar = this.props.toolbar.renderToolbar(originalToolbar);
765
- if (searchBar) {
766
- toolbarToRender = searchBar;
767
- }
768
- }
769
-
770
- const statsBadge = this.renderSearchBadge();
771
- return (<div style={{whiteSpace: "nowrap", flexGrow: 1, display: "flex"}}>
772
- {toolbarToRender}
773
- {statsBadge}
774
- </div>);
775
- }
776
-
777
- private renderSearchBadge(): ReactElement | undefined {
778
- if (this.state.tableNeedToBeReloaded) {
779
- return (
780
- <Badge count={
781
- <span className="ant-badge-count"
782
- title={i18n("Records has been added or removed, table need to be reloaded in order to see actual records")}
783
- style={{color: "#fa541c", background: "#fff2e8", borderColor: "#ffbb96"}}>
784
- <ExclamationOutlined style={{color: '#fa541c'}}/>
785
- </span>
786
- } style={{cursor: "hand"}} offset={[10, -10]}/>
787
- );
788
- }
789
- return undefined;
790
- }
791
-
792
- isFilterPanelVisible(): boolean {
793
- return this.state.gridConfiguration.layoutModel ? this.state.gridConfiguration.layoutModel.layout.children[0].width > 0 : true;
794
- }
795
-
796
- renderDataGrid(): ReactElement {
797
- const {
798
- defaultGridConfiguration,
799
- onGridReady, onLoadData, onSortChanged, onColumnsChanged, onSelectionChanged, onViewportChanged,
800
- onTableConfigVisible, toolbar,
801
- paging, filter, search, onChangeConfiguration, onDataChanged, onChangeRowStyleRules,
802
- filterPanel, controlPanel,
803
- ...rest
804
- } = this.props;
805
-
806
- return (
807
- <DataGrid
808
- {...rest}
809
- ref={(dataGrid) => {
810
- this.dataGrid = dataGrid ? dataGrid : undefined;
811
- }}
812
- onLoadData={this._onLoadData}
813
- onGridReady={this._onGridReady}
814
- paging={{
815
- pageSize: this.state.gridConfiguration.pageSize,
816
- defaultPageSize: this.state.gridConfiguration.defaultPageSize,
817
- onPaginationChanged: this._onPaginationChanged,
818
- }}
819
- filter={{
820
- columnSearchVisible: this.state.gridConfiguration.columnSearchVisible,
821
- getFilterModel: filter ? filter.getFilterModel : undefined,
822
- onColumnSearchVisible: (visible) => {
823
- this._changeConfiguration({columnSearchVisible: visible});
824
- if (filter?.onColumnSearchVisible) {
825
- filter.onColumnSearchVisible(visible);
826
- }
827
- },
828
- onFilterModified: filter ? filter.onFilterModified : undefined,
829
- onFilterChanged: filter ? filter.onFilterChanged : undefined,
830
- onFilterConfirmed: filter ? filter.onFilterConfirmed : undefined,
831
- }}
832
- search={{
833
- hidden: !!search ? search.hidden : undefined,
834
- placeholder: !!search ? search.placeholder : undefined,
835
- searchString: !!search && search.searchString !== undefined ? search.searchString : this.state.searchString,
836
- stringFormatter: !!search ? search.stringFormatter : undefined,
837
- searchHistory: !!search && search.searchHistory !== undefined ? search.searchHistory : this.state.searchHistory,
838
- searchButtonClassName: !!search ? search.searchButtonClassName : undefined,
839
- searchButtonDisabled: !!search ? search.searchButtonDisabled : undefined,
840
- searchButtonHidden: !!search ? search.searchButtonHidden : undefined,
841
- searchRenderer: search?.searchRenderer,
842
- onChange: this._onSearchStringChanged,
843
- onSearch: this._onSearch
844
- }}
845
- toolbar={{
846
- renderToolbar: this.renderToolbar,
847
- toolbarButtons: this.renderToolbarButtons(),
848
- hideRecordCount: toolbar?.hideRecordCount
849
- }}
850
- onSortChanged={(event) => {
851
- const sortModel = this.dataGrid?.getSortModel();
852
- if (this.state.gridConfiguration.followLastRecord && this.state.gridConfiguration.followLastRecordSortModel && !isEqual(this.state.gridConfiguration.followLastRecordSortModel, sortModel)) {
853
- this.enableFollowLastRecord(false);
854
- }
855
- const columnState = this.gridApi?.getColumnState();
856
- this._changeConfiguration({columnModel: columnState});
857
- if (onSortChanged) {
858
- onSortChanged(event);
859
- }
860
- }}
861
- onColumnsChanged={(columnModel, event) => {
862
- this._changeConfiguration({columnModel: columnModel});
863
- if (onColumnsChanged) {
864
- onColumnsChanged(columnModel, event);
865
- }
866
- }}
867
- onRowDataUpdated={this._onRowDataUpdated}
868
- tableConfigVisible={this.state.tableConfigVisible}
869
- onTableConfigVisible={(visible) => {
870
- this.setState({tableConfigVisible: visible});
871
- if (onTableConfigVisible) {
872
- onTableConfigVisible(visible);
873
- }
874
- }}
875
- onSelectionChanged={this._onSelectionChanged}
876
- rowStyleRules={this.state.gridConfiguration.rowStyleRules as RowStyleRule[]}
877
- defaultRowStyleRules={this.state.gridConfiguration.defaultRowStyleRules}
878
- onChangeRowStyleRules={this._onChangeRowStyleRules}
879
- onViewportChanged={this._onViewportChanged}
880
- showMilliseconds={this.state.gridConfiguration.showMilliseconds}
881
- defaultShowMilliseconds={this.state.gridConfiguration.defaultShowMilliseconds}
882
- onShowMilliseconds={(showMillis, callback) => {
883
- this._changeConfiguration({showMilliseconds: showMillis}, callback);
884
- }}
885
- hideYear={this.state.gridConfiguration.hideYear}
886
- defaultHideYear={this.state.gridConfiguration.defaultHideYear}
887
- onShowYear={(showYear, callback) => {
888
- this._changeConfiguration({hideYear: !showYear}, callback);
889
- }}
890
- />
891
- );
892
- }
893
-
894
- private renderDataGridWithControlPanel() {
895
- if (this.props.controlPanel && this.props.controlPanel.renderer) {
896
- return (
897
- <div key="table-with-control-panel" style={{
898
- display: "flex",
899
- flexFlow: "column",
900
- height: "100%",
901
- width: "100%"
902
- }}>
903
- <div key="table-with-control-panel-wrapper" style={{flex: "1 1 auto", overflow: "auto"}}>
904
- {this.renderDataGrid()}
905
- </div>
906
- {this.props.controlPanel.renderer()}
907
- </div>);
908
- }
909
- return this.renderDataGrid();
910
- }
911
-
912
- componentDidUpdate() {
913
- // very important nasty fix with flexlayout
914
- // in AlarmWindow or ObjectHistoryWindow there is ExtendedDataGrid(FlexLayout) placed in upper FlexLayout
915
- // resize event handling doesn't work in inner FlexLayout(ExtendedDataGrid)
916
- // I suppose it has something to do wit usage of multiple ResizeObservers, but I am not sure
917
- // therefore here on any change of state/props we will invoke recalculation of flexlayout size
918
- // internal logic of this method updateRect is fast and do resize only when it is needed
919
- this.flexLayout?.updateRect();
920
- }
921
-
922
- render() {
923
- const {filterPanel, detailPanel} = this.props;
924
- if (filterPanel || detailPanel) {
925
- return (
926
- <FlexLayout.Layout
927
- ref={(flexLayout) => {
928
- this.flexLayout = flexLayout;
929
- }}
930
- model={this.state.layoutModel}
931
- onModelChange={(model) => {
932
- this._changeConfiguration({layoutModel: model.toJson()});
933
- }}
934
- onAction={(action) => {
935
- const node1 = action.data.node1;
936
- const node2 = action.data.node2;
937
- let tabset;
938
- // disable moving splitter if filter or detail panel is hidden (width=0)
939
- if (action.type === Actions.ADJUST_SPLIT) {
940
- if (node1 === "#4" && node2 === "#6") {
941
- tabset = this.state.layoutModel.getNodeById('#6');
942
- } else if (node1 === "#2" && node2 === "#4") {
943
- tabset = this.state.layoutModel.getNodeById('#2');
944
- }
945
- if (tabset) {
946
- const width = (tabset as any)?._attributes?.width;
947
- if (width === 0) {
948
- return undefined;
949
- }
950
- }
951
- }
952
- return action;
953
- }}
954
- factory={(node) => {
955
- const component = node.getComponent();
956
- if (component === "filter-panel") {
957
- return filterPanel && filterPanel.renderer && filterPanel.renderer({
958
- defaultFilter: this.state.defaultFilter,
959
- filterChanged: this.state.filterChanged
960
- });
961
- } else if (component === "data-panel") {
962
- return this.renderDataGridWithControlPanel();
963
- } else if (component === "detail-panel") {
964
- return detailPanel && detailPanel.renderer();
965
- }
966
- return <Empty/>
967
- }}
968
- />
969
- );
970
- } else {
971
- return this.renderDataGridWithControlPanel();
972
- }
973
- }
974
- }