d2coreui 23.0.52 → 23.0.53

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 (280) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +154 -0
  3. package/components/clipboard/clipboardUtils.d.ts +11 -0
  4. package/components/clipboard/clipboardUtils.js +16 -4
  5. package/components/clipboard/clipboardUtils.js.map +1 -1
  6. package/components/codemirror/SyntaxHighlighter.d.ts +13 -0
  7. package/components/codemirror/SyntaxHighlighter.js +6 -1
  8. package/components/codemirror/SyntaxHighlighter.js.map +1 -1
  9. package/components/collapse/expandable.d.ts +10 -0
  10. package/components/collapse/expandable.js +4 -0
  11. package/components/collapse/expandable.js.map +1 -1
  12. package/components/color/colorPicker.d.ts +16 -0
  13. package/components/color/colorPicker.js +4 -0
  14. package/components/color/colorPicker.js.map +1 -1
  15. package/components/color/colorSwatch.d.ts +16 -0
  16. package/components/color/colorSwatch.js +23 -2
  17. package/components/color/colorSwatch.js.map +1 -1
  18. package/components/color/colorUtils.d.ts +9 -0
  19. package/components/color/colorUtils.js +15 -0
  20. package/components/color/colorUtils.js.map +1 -1
  21. package/components/date/dateRangeInput.d.ts +76 -0
  22. package/components/date/dateRangeInput.js +63 -12
  23. package/components/date/dateRangeInput.js.map +1 -1
  24. package/components/date/dateRangeInputAdvancedPanel.d.ts +27 -0
  25. package/components/date/dateRangeInputAdvancedPanel.js +7 -0
  26. package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
  27. package/components/date/dateRangeInputConfirm.d.ts +18 -0
  28. package/components/date/dateRangeInputConfirm.js +12 -0
  29. package/components/date/dateRangeInputConfirm.js.map +1 -1
  30. package/components/date/dateTimeInput.d.ts +99 -0
  31. package/components/date/dateTimeInput.js +78 -6
  32. package/components/date/dateTimeInput.js.map +1 -1
  33. package/components/date/durationInput.d.ts +37 -0
  34. package/components/date/durationInput.js +26 -3
  35. package/components/date/durationInput.js.map +1 -1
  36. package/components/date/savedIntervals.d.ts +63 -0
  37. package/components/date/savedIntervals.js +37 -0
  38. package/components/date/savedIntervals.js.map +1 -1
  39. package/components/date/savedIntervalsDialog.d.ts +13 -0
  40. package/components/date/savedIntervalsDialog.js +7 -2
  41. package/components/date/savedIntervalsDialog.js.map +1 -1
  42. package/components/form/NiceFormItem.d.ts +9 -0
  43. package/components/form/NiceFormItem.js +4 -0
  44. package/components/form/NiceFormItem.js.map +1 -1
  45. package/components/grid/cell/beanAccessor.d.ts +12 -0
  46. package/components/grid/cell/beanAccessor.js +8 -0
  47. package/components/grid/cell/beanAccessor.js.map +1 -1
  48. package/components/grid/cell/bigNumberCellEditor.d.ts +9 -0
  49. package/components/grid/cell/bigNumberCellEditor.js +19 -0
  50. package/components/grid/cell/bigNumberCellEditor.js.map +1 -1
  51. package/components/grid/cell/cellControl.d.ts +4 -0
  52. package/components/grid/cell/cellControl.js +14 -0
  53. package/components/grid/cell/cellControl.js.map +1 -1
  54. package/components/grid/cell/cellEditorUtils.d.ts +6 -0
  55. package/components/grid/cell/cellEditorUtils.js +6 -0
  56. package/components/grid/cell/cellEditorUtils.js.map +1 -1
  57. package/components/grid/cell/customEnumCellEditor.d.ts +6 -0
  58. package/components/grid/cell/customEnumCellEditor.js +10 -0
  59. package/components/grid/cell/customEnumCellEditor.js.map +1 -1
  60. package/components/grid/cell/dataGridCellEditorComponent.d.ts +26 -0
  61. package/components/grid/cell/dataGridCellEditorComponent.js +21 -0
  62. package/components/grid/cell/dataGridCellEditorComponent.js.map +1 -1
  63. package/components/grid/cell/dateCellEditor.d.ts +6 -0
  64. package/components/grid/cell/dateCellEditor.js +10 -0
  65. package/components/grid/cell/dateCellEditor.js.map +1 -1
  66. package/components/grid/cell/dragListenerFeature.d.ts +6 -0
  67. package/components/grid/cell/dragListenerFeature.js +6 -0
  68. package/components/grid/cell/dragListenerFeature.js.map +1 -1
  69. package/components/grid/cell/durationCellEditor.d.ts +6 -0
  70. package/components/grid/cell/durationCellEditor.js +14 -0
  71. package/components/grid/cell/durationCellEditor.js.map +1 -1
  72. package/components/grid/cell/hexaOctetStringCellEditor.d.ts +6 -0
  73. package/components/grid/cell/hexaOctetStringCellEditor.js +14 -0
  74. package/components/grid/cell/hexaOctetStringCellEditor.js.map +1 -1
  75. package/components/grid/cell/hexaValueCellEditor.d.ts +6 -0
  76. package/components/grid/cell/hexaValueCellEditor.js +14 -0
  77. package/components/grid/cell/hexaValueCellEditor.js.map +1 -1
  78. package/components/grid/cell/numberCellEditor.d.ts +6 -0
  79. package/components/grid/cell/numberCellEditor.js +15 -0
  80. package/components/grid/cell/numberCellEditor.js.map +1 -1
  81. package/components/grid/cell/rangeSelector.d.ts +7 -0
  82. package/components/grid/cell/rangeSelector.js +59 -5
  83. package/components/grid/cell/rangeSelector.js.map +1 -1
  84. package/components/grid/cell/simpleStatusTextCellEditor.d.ts +7 -0
  85. package/components/grid/cell/simpleStatusTextCellEditor.js +11 -0
  86. package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
  87. package/components/grid/cell/statusTextCellEditor.d.ts +7 -0
  88. package/components/grid/cell/statusTextCellEditor.js +17 -0
  89. package/components/grid/cell/statusTextCellEditor.js.map +1 -1
  90. package/components/grid/cell/tableDefaultRowStyleRules.d.ts +31 -0
  91. package/components/grid/cell/tableDefaultRowStyleRules.js +5 -0
  92. package/components/grid/cell/tableDefaultRowStyleRules.js.map +1 -1
  93. package/components/grid/cell/textCellEditor.d.ts +6 -0
  94. package/components/grid/cell/textCellEditor.js +15 -0
  95. package/components/grid/cell/textCellEditor.js.map +1 -1
  96. package/components/grid/cell/withAgGridHooks.d.ts +8 -0
  97. package/components/grid/cell/withAgGridHooks.js +8 -0
  98. package/components/grid/cell/withAgGridHooks.js.map +1 -1
  99. package/components/grid/columnUtils.d.ts +7 -0
  100. package/components/grid/columnUtils.js +7 -0
  101. package/components/grid/columnUtils.js.map +1 -1
  102. package/components/grid/config/columnTransfer.d.ts +18 -0
  103. package/components/grid/config/columnTransfer.js +14 -3
  104. package/components/grid/config/columnTransfer.js.map +1 -1
  105. package/components/grid/config/dataGridEditor.d.ts +31 -0
  106. package/components/grid/config/dataGridEditor.js +14 -2
  107. package/components/grid/config/dataGridEditor.js.map +1 -1
  108. package/components/grid/config/rowHeightCalculator.d.ts +11 -0
  109. package/components/grid/config/rowHeightCalculator.js +11 -0
  110. package/components/grid/config/rowHeightCalculator.js.map +1 -1
  111. package/components/grid/config/rowStylePicker.d.ts +19 -0
  112. package/components/grid/config/rowStylePicker.js +12 -0
  113. package/components/grid/config/rowStylePicker.js.map +1 -1
  114. package/components/grid/dataGrid.d.ts +331 -0
  115. package/components/grid/dataGrid.js +168 -11
  116. package/components/grid/dataGrid.js.map +1 -1
  117. package/components/grid/detail/detailHeaderPanel.d.ts +11 -0
  118. package/components/grid/detail/detailHeaderPanel.js +5 -0
  119. package/components/grid/detail/detailHeaderPanel.js.map +1 -1
  120. package/components/grid/export/contextMenu.d.ts +31 -0
  121. package/components/grid/export/contextMenu.js +8 -0
  122. package/components/grid/export/contextMenu.js.map +1 -1
  123. package/components/grid/export/progressPopup.d.ts +21 -0
  124. package/components/grid/export/progressPopup.js +17 -0
  125. package/components/grid/export/progressPopup.js.map +1 -1
  126. package/components/grid/export/worker/pdfExport.js +5 -0
  127. package/components/grid/export/worker/pdfExport.js.map +1 -1
  128. package/components/grid/extendedDataGrid.d.ts +240 -0
  129. package/components/grid/extendedDataGrid.js +116 -2
  130. package/components/grid/extendedDataGrid.js.map +1 -1
  131. package/components/grid/filter/customColumnFilter.d.ts +5 -0
  132. package/components/grid/filter/customColumnFilter.js +5 -0
  133. package/components/grid/filter/customColumnFilter.js.map +1 -1
  134. package/components/grid/filter/dataGridColumnFilter.d.ts +19 -0
  135. package/components/grid/filter/dataGridColumnFilter.js +19 -0
  136. package/components/grid/filter/dataGridColumnFilter.js.map +1 -1
  137. package/components/grid/filter/dateColumnFilter.d.ts +6 -0
  138. package/components/grid/filter/dateColumnFilter.js +6 -0
  139. package/components/grid/filter/dateColumnFilter.js.map +1 -1
  140. package/components/grid/filter/textColumnFilter.d.ts +6 -0
  141. package/components/grid/filter/textColumnFilter.js +6 -0
  142. package/components/grid/filter/textColumnFilter.js.map +1 -1
  143. package/components/grid/filter/wildcardQuickFilterEngine.d.ts +21 -0
  144. package/components/grid/filter/wildcardQuickFilterEngine.js +21 -0
  145. package/components/grid/filter/wildcardQuickFilterEngine.js.map +1 -1
  146. package/components/grid/header/simpleHeader.d.ts +17 -0
  147. package/components/grid/header/simpleHeader.js +20 -0
  148. package/components/grid/header/simpleHeader.js.map +1 -1
  149. package/components/grid/panel/dataGridPagination.d.ts +10 -0
  150. package/components/grid/panel/dataGridPagination.js +5 -0
  151. package/components/grid/panel/dataGridPagination.js.map +1 -1
  152. package/components/grid/panel/loadingOverlay.d.ts +5 -0
  153. package/components/grid/panel/loadingOverlay.js +4 -0
  154. package/components/grid/panel/loadingOverlay.js.map +1 -1
  155. package/components/grid/panel/noRecordsOverlay.d.ts +6 -0
  156. package/components/grid/panel/noRecordsOverlay.js +5 -0
  157. package/components/grid/panel/noRecordsOverlay.js.map +1 -1
  158. package/components/grid/panel/tablePagination.d.ts +4 -0
  159. package/components/grid/panel/tablePagination.js +4 -0
  160. package/components/grid/panel/tablePagination.js.map +1 -1
  161. package/components/icons/dropdownArrow.d.ts +3 -0
  162. package/components/icons/dropdownArrow.js +2 -0
  163. package/components/icons/dropdownArrow.js.map +1 -1
  164. package/components/icons/undoIcon.d.ts +2 -0
  165. package/components/icons/undoIcon.js +2 -0
  166. package/components/icons/undoIcon.js.map +1 -1
  167. package/components/input/autoCompleteInput.d.ts +29 -0
  168. package/components/input/autoCompleteInput.js +7 -0
  169. package/components/input/autoCompleteInput.js.map +1 -1
  170. package/components/input/draftUtils.d.ts +7 -0
  171. package/components/input/draftUtils.js +9 -0
  172. package/components/input/draftUtils.js.map +1 -1
  173. package/components/input/hexaFormattedInput.d.ts +9 -0
  174. package/components/input/hexaFormattedInput.js +3 -0
  175. package/components/input/hexaFormattedInput.js.map +1 -1
  176. package/components/input/mask/helpers.d.ts +27 -0
  177. package/components/input/mask/helpers.js +27 -0
  178. package/components/input/mask/helpers.js.map +1 -1
  179. package/components/input/mask/inputMaskCore.d.ts +80 -0
  180. package/components/input/mask/inputMaskCore.js +90 -0
  181. package/components/input/mask/inputMaskCore.js.map +1 -1
  182. package/components/input/mask/pattern.d.ts +24 -0
  183. package/components/input/mask/pattern.js +26 -0
  184. package/components/input/mask/pattern.js.map +1 -1
  185. package/components/input/maskedInput.d.ts +53 -0
  186. package/components/input/maskedInput.js +44 -4
  187. package/components/input/maskedInput.js.map +1 -1
  188. package/components/input/passwordInput.d.ts +7 -0
  189. package/components/input/passwordInput.js +8 -0
  190. package/components/input/passwordInput.js.map +1 -1
  191. package/components/input/simpleAutoComplete.d.ts +6 -0
  192. package/components/input/simpleAutoComplete.js +6 -0
  193. package/components/input/simpleAutoComplete.js.map +1 -1
  194. package/components/input/textarea/extractSpansOfClasses.d.ts +17 -0
  195. package/components/input/textarea/extractSpansOfClasses.js +26 -1
  196. package/components/input/textarea/extractSpansOfClasses.js.map +1 -1
  197. package/components/input/textarea/getRanges.d.ts +7 -0
  198. package/components/input/textarea/getRanges.js +11 -0
  199. package/components/input/textarea/getRanges.js.map +1 -1
  200. package/components/input/textarea/getType.d.ts +5 -0
  201. package/components/input/textarea/getType.js +5 -0
  202. package/components/input/textarea/getType.js.map +1 -1
  203. package/components/input/textarea/highlighedContents.d.ts +4 -0
  204. package/components/input/textarea/highlighedContents.js +5 -0
  205. package/components/input/textarea/highlighedContents.js.map +1 -1
  206. package/components/input/textarea/mentionsWithHighlighting.d.ts +25 -0
  207. package/components/input/textarea/mentionsWithHighlighting.js +14 -0
  208. package/components/input/textarea/mentionsWithHighlighting.js.map +1 -1
  209. package/components/keyboard/keyboardUtils.d.ts +6 -0
  210. package/components/keyboard/keyboardUtils.js +6 -0
  211. package/components/keyboard/keyboardUtils.js.map +1 -1
  212. package/components/modal/draggableModalProvider.d.ts +6 -0
  213. package/components/modal/draggableModalProvider.js +7 -0
  214. package/components/modal/draggableModalProvider.js.map +1 -1
  215. package/components/modal/impl/clamp.js +1 -0
  216. package/components/modal/impl/clamp.js.map +1 -1
  217. package/components/modal/impl/draggableModal.d.ts +1 -0
  218. package/components/modal/impl/draggableModal.js +6 -0
  219. package/components/modal/impl/draggableModal.js.map +1 -1
  220. package/components/modal/impl/draggableModalContext.js +1 -0
  221. package/components/modal/impl/draggableModalContext.js.map +1 -1
  222. package/components/modal/impl/draggableModalInner.js +12 -1
  223. package/components/modal/impl/draggableModalInner.js.map +1 -1
  224. package/components/modal/impl/draggableModalReducer.d.ts +7 -1
  225. package/components/modal/impl/draggableModalReducer.js +6 -1
  226. package/components/modal/impl/draggableModalReducer.js.map +1 -1
  227. package/components/modal/impl/draggableModalStyles.d.ts +17 -0
  228. package/components/modal/impl/draggableModalStyles.js +31 -0
  229. package/components/modal/impl/draggableModalStyles.js.map +1 -1
  230. package/components/modal/impl/getWindowSize.js +1 -0
  231. package/components/modal/impl/getWindowSize.js.map +1 -1
  232. package/components/modal/impl/index.js +1 -0
  233. package/components/modal/impl/index.js.map +1 -1
  234. package/components/modal/impl/resizeHandle.d.ts +1 -0
  235. package/components/modal/impl/resizeHandle.js +4 -1
  236. package/components/modal/impl/resizeHandle.js.map +1 -1
  237. package/components/modal/impl/useDrag.js +1 -0
  238. package/components/modal/impl/useDrag.js.map +1 -1
  239. package/components/modal/impl/usePrevious.js +1 -0
  240. package/components/modal/impl/usePrevious.js.map +1 -1
  241. package/components/modal/impl/useResize.js +1 -0
  242. package/components/modal/impl/useResize.js.map +1 -1
  243. package/components/modal/modalDialog.d.ts +85 -0
  244. package/components/modal/modalDialog.js +80 -10
  245. package/components/modal/modalDialog.js.map +1 -1
  246. package/components/picker/enumValuePicker.d.ts +17 -0
  247. package/components/picker/enumValuePicker.js +4 -0
  248. package/components/picker/enumValuePicker.js.map +1 -1
  249. package/components/platformSpecific.d.ts +17 -0
  250. package/components/platformSpecific.js +16 -0
  251. package/components/platformSpecific.js.map +1 -1
  252. package/components/scrollTo/onlyText.d.ts +5 -0
  253. package/components/scrollTo/onlyText.js +5 -0
  254. package/components/scrollTo/onlyText.js.map +1 -1
  255. package/components/scrollTo/scrollTo.d.ts +56 -0
  256. package/components/scrollTo/scrollTo.js +40 -3
  257. package/components/scrollTo/scrollTo.js.map +1 -1
  258. package/components/style/withCss.d.ts +15 -0
  259. package/components/style/withCss.js +6 -0
  260. package/components/style/withCss.js.map +1 -1
  261. package/components/table/dragSortingTable.d.ts +15 -0
  262. package/components/table/dragSortingTable.js +12 -0
  263. package/components/table/dragSortingTable.js.map +1 -1
  264. package/components/text/impl/innerSize.js +2 -0
  265. package/components/text/impl/innerSize.js.map +1 -1
  266. package/components/text/impl/series.d.ts +10 -0
  267. package/components/text/impl/series.js +10 -0
  268. package/components/text/impl/series.js.map +1 -1
  269. package/components/text/impl/shallowEqual.js +1 -0
  270. package/components/text/impl/shallowEqual.js.map +1 -1
  271. package/components/text/impl/whilst.d.ts +7 -0
  272. package/components/text/impl/whilst.js +7 -0
  273. package/components/text/impl/whilst.js.map +1 -1
  274. package/components/text/textFit.d.ts +24 -0
  275. package/components/text/textFit.js +29 -1
  276. package/components/text/textFit.js.map +1 -1
  277. package/i18n/componentsLocaleHolder.d.ts +9 -0
  278. package/i18n/componentsLocaleHolder.js +9 -0
  279. package/i18n/componentsLocaleHolder.js.map +1 -1
  280. package/package.json +66 -65
@@ -3,61 +3,203 @@ import DataGrid, { DataGridFilterProps, DataGridProps, DataGridSearchProps, Sort
3
3
  import { RowStyleRule } from "d2coreui/components/grid/cell/tableDefaultRowStyleRules";
4
4
  import { ColumnState, RowDataUpdatedEvent } from "ag-grid-community";
5
5
  import { DataChangeStateEnum } from "d2core/types/dataChangeStateEnum";
6
+ /**
7
+ * Persistable user configuration of an {@link ExtendedDataGrid}: column state, paging, follow-last-record,
8
+ * row styling, date-time formatting and side panel widths.
9
+ *
10
+ * Passed in as {@link ExtendedDataGridProps.defaultGridConfiguration} and reported back through
11
+ * {@link ExtendedDataGridProps.onChangeConfiguration}, so that the caller can store it and restore it later.
12
+ */
6
13
  export interface GridConfiguration {
14
+ /**
15
+ * Format version of the configuration. A configuration whose version is set and differs from the current
16
+ * one (2) is ignored as a whole and the grid starts with defaults; omit it to always accept the configuration.
17
+ */
7
18
  version?: number;
19
+ /**
20
+ * ag-grid column state (order, visibility, width, sort, pinning). When missing, the grid takes the state
21
+ * derived from the column definitions and reports it back. Columns defined in `columnDefs` but missing here
22
+ * are merged in with their initial state.
23
+ */
8
24
  columnModel?: ColumnState[];
25
+ /**
26
+ * Page size: `-1` disables paging (scrolling only), `0` sizes pages automatically to the available height,
27
+ * a positive number is a fixed number of rows per page.
28
+ */
9
29
  pageSize: number;
30
+ /** Page size applied when the user reverts the table settings in the configuration drawer (`0` when not set). */
10
31
  defaultPageSize?: number;
32
+ /**
33
+ * Keep the last displayed row in view whenever data are loaded or rows are added. Works only with
34
+ * client-side `rowData`. It is switched off automatically when the user selects a row, scrolls backwards,
35
+ * or sorts differently than {@link GridConfiguration.followLastRecordSortModel}.
36
+ */
11
37
  followLastRecord?: boolean;
38
+ /** Sort model applied when follow-last-record is switched on; sorting differently switches the feature off. */
12
39
  followLastRecordSortModel?: SortItem[];
40
+ /** Show a toolbar button that lets the user toggle {@link GridConfiguration.followLastRecord}. */
13
41
  followLastRecordEditable?: boolean;
42
+ /** Show the floating column filters beneath the column headers. */
14
43
  columnSearchVisible?: boolean;
44
+ /** Row styling rules; defaults to {@link tableDefaultRowStyleRules}. */
15
45
  rowStyleRules?: RowStyleRule[];
46
+ /** Row styling rules restored when the user reverts row styling; defaults to {@link tableDefaultRowStyleRules}. */
16
47
  defaultRowStyleRules?: RowStyleRule[];
48
+ /**
49
+ * Show milliseconds in date-time and time columns.
50
+ * @default false
51
+ */
17
52
  showMilliseconds?: boolean;
53
+ /**
54
+ * Value of {@link GridConfiguration.showMilliseconds} restored when the user reverts the table settings.
55
+ * @default false
56
+ */
18
57
  defaultShowMilliseconds?: boolean;
58
+ /**
59
+ * Hide the year in date and date-time columns.
60
+ * @default false
61
+ */
19
62
  hideYear?: boolean;
63
+ /**
64
+ * Value of {@link GridConfiguration.hideYear} restored when the user reverts the table settings.
65
+ * @default false
66
+ */
20
67
  defaultHideYear?: boolean;
68
+ /**
69
+ * Show the UTC offset in date-time columns, so that the two readings of a DST fold stay distinguishable.
70
+ * Only an explicit `false` turns it off.
71
+ * @default true
72
+ */
21
73
  showUtcOffset?: boolean;
74
+ /**
75
+ * Value of {@link GridConfiguration.showUtcOffset} restored when the user reverts the table settings.
76
+ * @default true
77
+ */
22
78
  defaultShowUtcOffset?: boolean;
79
+ /**
80
+ * Width of the left filter panel in pixels; `0` means collapsed. When not set, the panel is shown with
81
+ * `filterPanel.defaultWidth` (220 if that is not set either) if a `filterPanel` is configured.
82
+ */
23
83
  filterPanelWidth?: number;
84
+ /** Width of the right detail panel in pixels; `0` (the default) means collapsed. */
24
85
  detailPanelWidth?: number;
25
86
  }
87
+ /** Search bar configuration of {@link ExtendedDataGrid}. */
26
88
  interface ExtendedDataGridSearchProps extends DataGridSearchProps {
89
+ /**
90
+ * Initial search history, most recent first, used while `searchHistory` is not controlled. The grid keeps
91
+ * the last 10 distinct search strings, adding one each time a search is invoked.
92
+ */
27
93
  initialSearchHistory?: string[];
28
94
  }
95
+ /** Floating filter configuration of {@link ExtendedDataGrid}. */
29
96
  interface ExtendedDataGridFilterProps extends DataGridFilterProps {
97
+ /**
98
+ * Set when the grid uses the ag-grid quick filter: rows updated by {@link ExtendedDataGrid.updateRecord}
99
+ * then get their quick filter text recomputed so the filter reflects the new values.
100
+ */
30
101
  quickFilterEnabled?: boolean;
31
102
  }
103
+ /** Parameters passed to the filter panel renderer ({@link ExtendedDataGridProps.filterPanel}). */
32
104
  export interface FilterPanelRendererParams {
105
+ /** Deep copy of `filterPanel.defaultFilter`, taken when the grid was constructed. */
33
106
  defaultFilter?: any;
107
+ /**
108
+ * Whether the last filter reported by {@link ExtendedDataGrid.onPanelFilterApplied} differs from
109
+ * {@link FilterPanelRendererParams.defaultFilter}.
110
+ */
34
111
  filterChanged: boolean;
35
112
  }
113
+ /**
114
+ * Properties of {@link ExtendedDataGrid}. All {@link DataGridProps} are forwarded to the inner {@link DataGrid},
115
+ * except those the extended grid manages itself from its {@link GridConfiguration} (paging, row style rules,
116
+ * date-time formatting, floating filter visibility, table configuration visibility); setting those
117
+ * props on the extended grid has no effect.
118
+ */
36
119
  export interface ExtendedDataGridProps extends Omit<DataGridProps, "paging"> {
120
+ /**
121
+ * Initial configuration, read only once in the constructor; later changes of this prop are ignored.
122
+ * Typically the configuration previously reported by {@link ExtendedDataGridProps.onChangeConfiguration}.
123
+ */
37
124
  defaultGridConfiguration: GridConfiguration;
125
+ /**
126
+ * Called whenever the configuration changes through the UI or API: column state (sort, order, visibility,
127
+ * width), page size, floating filter visibility, date-time formatting, follow-last-record. The same, mutated
128
+ * configuration object is passed each time. Row style rule changes are reported through
129
+ * `onChangeRowStyleRules` instead, and side panel widths are not reported on their own.
130
+ */
38
131
  onChangeConfiguration?(gridConfiguration: GridConfiguration): void;
132
+ /**
133
+ * Freeze the configuration: changes are neither stored nor reported by {@link ExtendedDataGridProps.onChangeConfiguration}
134
+ * (the change itself, e.g. a new sort order, still takes effect in the grid).
135
+ */
39
136
  disableConfigurationChange?: boolean;
137
+ /** Floating filter configuration; visibility of the floating filters comes from the configuration. */
40
138
  filter?: ExtendedDataGridFilterProps;
139
+ /**
140
+ * Search bar configuration. `searchString` and `searchHistory` are controlled when set; otherwise the grid
141
+ * keeps them in its own state.
142
+ */
41
143
  search?: ExtendedDataGridSearchProps;
144
+ /** Paging callbacks; the page size itself is taken from {@link GridConfiguration.pageSize}. */
42
145
  paging?: {
146
+ /**
147
+ * Page size change handler, called only after the first data load has finished.
148
+ * @param currentPageSize - number of rows that fit on the current page (`null` while not known yet)
149
+ * @param definedPageSize - configured page size, see {@link GridConfiguration.pageSize}
150
+ */
43
151
  onPaginationChanged?: (currentPageSize: number | null, definedPageSize: number) => void;
44
152
  };
153
+ /**
154
+ * Resizable, collapsible filter panel on the left side of the grid. When a `renderer` is set, the toolbar
155
+ * gets a button that shows/hides the panel.
156
+ */
45
157
  filterPanel?: {
158
+ /**
159
+ * Width in pixels used when the configuration does not define one and when the panel is re-opened by the
160
+ * toolbar button; if not set, 220 and 250 pixels respectively.
161
+ */
46
162
  defaultWidth?: number;
163
+ /** Intended to hide the panel initially. Currently not evaluated. */
47
164
  hidden?: boolean;
165
+ /** Default filter; its deep copy is passed to the renderer and compared by {@link ExtendedDataGrid.onPanelFilterApplied}. */
48
166
  defaultFilter?: any;
167
+ /** Renders the panel content. */
49
168
  renderer?(parameters: FilterPanelRendererParams): ReactElement;
169
+ /** Icon of the toolbar toggle button; defaults to a filter icon. */
50
170
  icon?: React.ReactNode;
51
171
  };
172
+ /**
173
+ * Resizable, collapsible detail panel on the right side of the grid, collapsed until opened by
174
+ * {@link ExtendedDataGrid.showDetailPanel} or by a stored {@link GridConfiguration.detailPanelWidth}.
175
+ */
52
176
  detailPanel?: {
177
+ /**
178
+ * Width in pixels used when the panel is opened by {@link ExtendedDataGrid.showDetailPanel}.
179
+ * @default 250
180
+ */
53
181
  defaultWidth?: number;
182
+ /** Renders the panel content, e.g. a `DetailHeaderPanel` followed by the record detail. */
54
183
  renderer(): ReactElement;
184
+ /**
185
+ * Called when the splitter collapses or expands the detail panel (collapse arrow or dragging the divider), with
186
+ * `true` when it becomes visible. Not called for {@link ExtendedDataGrid.showDetailPanel}.
187
+ */
55
188
  onVisibleChange?(visible: boolean): void;
56
189
  };
190
+ /** Panel rendered directly below the grid, usually with context buttons. */
57
191
  controlPanel?: {
192
+ /** Renders the panel content. */
58
193
  renderer?(): React.ReactElement | null;
59
194
  };
195
+ /** Called after each batch of queued record changes ({@link ExtendedDataGrid.addRecord} etc.) has been applied. */
60
196
  onDataChanged?(): void;
197
+ /**
198
+ * Interval in milliseconds for batching record changes queued by {@link ExtendedDataGrid.addRecord},
199
+ * {@link ExtendedDataGrid.updateRecord} and {@link ExtendedDataGrid.removeRecord}; a batch is applied at
200
+ * the latest after this interval. `0` applies every change immediately. Read only in the constructor.
201
+ * @default 500
202
+ */
61
203
  updateDataDebounceInterval?: number;
62
204
  }
63
205
  interface ExtendedDataGridState {
@@ -71,12 +213,38 @@ interface ExtendedDataGridState {
71
213
  sizes: (number | undefined)[];
72
214
  width: number;
73
215
  }
216
+ /**
217
+ * {@link DataGrid} with a persistable {@link GridConfiguration}, optional side panels and batched live updates.
218
+ *
219
+ * It lays out a resizable filter panel (left), the grid with an optional control panel below it, and a detail
220
+ * panel (right); keeps column state, paging, row styling and date-time formatting in a configuration reported by
221
+ * `onChangeConfiguration`; and applies record changes pushed by {@link addRecord}, {@link updateRecord} and
222
+ * {@link removeRecord} as debounced ag-grid transactions. When `rowData` is passed, those transactions also
223
+ * modify that array in place.
224
+ *
225
+ * @typeParam T - row data type; rows are identified by `id`, which is also the ag-grid row id
226
+ * @example
227
+ * ```tsx
228
+ * <ExtendedDataGrid<Row>
229
+ * ref={(grid) => this.grid = grid ?? undefined}
230
+ * columnDefs={columnDefs}
231
+ * rowData={this.state.rows}
232
+ * defaultGridConfiguration={storedConfiguration ?? {pageSize: 0}}
233
+ * onChangeConfiguration={(configuration) => store(configuration)}
234
+ * onLoadData={(callback) => callback(this.state.rows.length)}
235
+ * />
236
+ * // later, on a pushed change:
237
+ * this.grid?.updateRecord(changedRow);
238
+ * ```
239
+ */
74
240
  export default class ExtendedDataGrid<T extends {
75
241
  id: number | string;
76
242
  }> extends React.Component<ExtendedDataGridProps, ExtendedDataGridState> {
243
+ /** Fills the `rowStyleRules` prop required by {@link DataGridProps}; rendering uses the rules from the configuration instead. */
77
244
  static defaultProps: {
78
245
  rowStyleRules: RowStyleRule[];
79
246
  };
247
+ /** The inner {@link DataGrid}, available after mount. */
80
248
  dataGrid?: DataGrid;
81
249
  private gridApi?;
82
250
  private dataLoaded;
@@ -87,13 +255,24 @@ export default class ExtendedDataGrid<T extends {
87
255
  constructor(props: Readonly<ExtendedDataGridProps>);
88
256
  componentDidMount(): void;
89
257
  componentWillUnmount(): void;
258
+ /** Returns the current configuration (the live object, not a copy). */
90
259
  getConfiguration(): GridConfiguration;
260
+ /**
261
+ * Returns the internally kept search string and a copy of the search history.
262
+ * @returns the search history ordered oldest first (reverse of the internal and `initialSearchHistory` order)
263
+ */
91
264
  getSearchContext(): {
92
265
  searchString: string;
93
266
  searchHistory: string[];
94
267
  };
268
+ /**
269
+ * Reloads the grid data by calling `onLoadData`. Pending record changes are discarded once the data are loaded.
270
+ * @param callback - called after `onLoadData` reports the loaded data
271
+ */
95
272
  loadData(callback?: () => void): void;
273
+ /** Whether the inner ag-grid exists and has not been destroyed. */
96
274
  isActive(): boolean;
275
+ /** Focuses a cell of the last selected row (or the first row) of the inner grid. */
97
276
  focus(): void;
98
277
  private _changeConfiguration;
99
278
  private _onGridReady;
@@ -102,36 +281,95 @@ export default class ExtendedDataGrid<T extends {
102
281
  private _onSearchStringChanged;
103
282
  private _onSearch;
104
283
  private _reloadTableConfiguration;
284
+ /** Discards all queued, not yet applied record changes. */
105
285
  clearTransaction(): void;
286
+ /** Removes all queued, not yet applied changes of the record with the id of `item`. */
106
287
  removeFromTransaction(item: T): void;
288
+ /** Whether the record is displayed in the grid or queued to be added. */
107
289
  hasRecord(id: number | string): boolean;
290
+ /**
291
+ * Queues a record to be added; it is applied with the next debounced batch.
292
+ * If a removal of the same record is queued, the record is updated instead.
293
+ * @param addIndex - row index to insert at; applies to the whole batch (the last value wins), rows are appended when not set
294
+ */
108
295
  addRecord(data: T, addIndex?: number): void;
296
+ /**
297
+ * Queues several records to be added, see {@link addRecord}.
298
+ * Note that a non-zero `addIndex` reverses `dataArray` in place.
299
+ */
109
300
  addRecords(dataArray: T[], addIndex?: number): void;
301
+ /** Replaces all grid data and discards queued record changes. */
110
302
  setRowData(dataArray: T[]): void;
303
+ /**
304
+ * Queues removal of the record with the id of `data`; it is applied with the next debounced batch.
305
+ * If the record is only queued to be added, that addition is cancelled. A removed row is deselected first.
306
+ */
111
307
  removeRecord(data: T): void;
308
+ /** Queues removal of several records, see {@link removeRecord}. */
112
309
  removeRecords(dataList: T[]): void;
310
+ /**
311
+ * Queues a record change according to its `dataChangeState`: `CONFIGURED` adds the record, `REMOVED` removes it,
312
+ * anything else updates it. An update of a record that is not in the grid when the batch is applied adds it.
313
+ */
113
314
  updateRecord(data: (T & {
114
315
  dataChangeState?: DataChangeStateEnum;
115
316
  })): void;
317
+ /** Queues several record changes, see {@link updateRecord}. */
116
318
  updateRecords(dataList: (T & {
117
319
  dataChangeState?: DataChangeStateEnum;
118
320
  })[]): void;
119
321
  private _updateData;
322
+ /**
323
+ * Switches follow-last-record on or off and reports the change through `onChangeConfiguration`.
324
+ * Switching on applies {@link GridConfiguration.followLastRecordSortModel} (if set) and scrolls to the last row.
325
+ */
120
326
  enableFollowLastRecord(enable: boolean): void;
327
+ /** Debounced (500 ms) variant of {@link followLastRecord}; used internally. */
121
328
  _followLastRecordDebounced(): void;
329
+ /**
330
+ * Scrolls to the last displayed row if {@link GridConfiguration.followLastRecord} is on and client-side `rowData`
331
+ * is not empty.
332
+ */
122
333
  followLastRecord(): void;
334
+ /** Applies an ag-grid column state, including column order, through {@link DataGrid.setColumnState}. */
123
335
  setColumnModel(columnModel: ColumnState[]): void;
336
+ /** Sorts by the given columns in the given order; all other columns become unsorted. */
124
337
  setSortModel(sortModel: SortItem[]): void;
338
+ /** Returns the current sort columns ordered by sort priority, or an empty array before the grid is ready. */
125
339
  getSortModel(): SortItem[];
340
+ /** Internal ag-grid `rowDataUpdated` handler; forwards the event to `onRowDataUpdated`. */
126
341
  _onRowDataUpdated(event: RowDataUpdatedEvent): void;
342
+ /**
343
+ * Shows or collapses the filter panel. Showing a collapsed panel opens it with `filterPanel.defaultWidth` (250 if not set).
344
+ * The width is stored in the configuration but not reported through `onChangeConfiguration`.
345
+ */
127
346
  showFilterPanel(show: boolean): void;
347
+ /**
348
+ * Shows or collapses the detail panel. Showing a collapsed panel opens it with `detailPanel.defaultWidth` (250 if not set).
349
+ * The width is stored in the configuration but not reported through `onChangeConfiguration`.
350
+ */
128
351
  showDetailPanel(show: boolean): void;
352
+ /**
353
+ * Moves a single-row selection to the next or previous row and scrolls it into view; does nothing unless exactly one row
354
+ * is selected. Supported for client-side `rowData` and the `infinite` row model.
355
+ */
129
356
  selectNextPreviousRecord(previous: boolean): void;
357
+ /** Replaces the row style rules in the configuration and redraws the rows, without calling any change handler. */
130
358
  changeRowStyleRules(rowStyleRules: RowStyleRule[]): void;
359
+ /** Internal handler of row style rule edits; applies them and calls `onChangeRowStyleRules`. */
131
360
  _onChangeRowStyleRules(rowStyleRules: RowStyleRule[]): void;
361
+ /**
362
+ * Tells the grid which filter the filter panel has applied, so that {@link FilterPanelRendererParams.filterChanged}
363
+ * reflects whether it differs from the default filter (`null` and `undefined` values are treated as equal).
364
+ */
132
365
  onPanelFilterApplied(newFilter: any): void;
366
+ /** Returns the text of the column's applied text filter model, or an empty string. */
133
367
  getUiColumnFilterValue(colId: string): string;
368
+ /** Clears the UI of the column's text filter without applying the change to the grid. */
134
369
  removeUiColumnFilterValue(colId: string): Promise<void>;
370
+ /**
371
+ * Applies the value currently entered in the column's filter UI to its filter model, without redrawing ag-grid.
372
+ */
135
373
  applyUiColumnFilterValue(colId: string): Promise<void>;
136
374
  private equalValues;
137
375
  private _onSelectionChanged;
@@ -139,7 +377,9 @@ export default class ExtendedDataGrid<T extends {
139
377
  private renderToolbarButtons;
140
378
  private renderToolbar;
141
379
  private renderSearchBadge;
380
+ /** Whether the filter panel is expanded (has a non-zero width). */
142
381
  isFilterPanelVisible(): boolean;
382
+ /** Renders the inner {@link DataGrid}; used by {@link render}. */
143
383
  renderDataGrid(): ReactElement;
144
384
  private renderDataGridWithControlPanel;
145
385
  render(): React.JSX.Element;