@gridsuite/commons-ui 0.58.0 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/chunks/{criteria-based-filter-edition-dialog.CbhgOSRk.js → criteria-based-filter-edition-dialog.p2pUWzxc.js} +20 -65
  2. package/dist/components/AuthenticationRouter/AuthenticationRouter.d.ts +28 -9
  3. package/dist/components/AuthenticationRouter/AuthenticationRouter.js +1 -1
  4. package/dist/components/AuthenticationRouter/index.d.ts +6 -0
  5. package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +27 -13
  6. package/dist/components/CardErrorBoundary/card-error-boundary.js +7 -6
  7. package/dist/components/CardErrorBoundary/index.d.ts +6 -0
  8. package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +0 -4
  9. package/dist/components/DirectoryItemSelector/directory-item-selector.js +13 -26
  10. package/dist/components/ElementSearchDialog/equipment-item.d.ts +25 -16
  11. package/dist/components/ElementSearchDialog/equipment-item.js +5 -5
  12. package/dist/components/ElementSearchDialog/index.d.ts +6 -0
  13. package/dist/components/ElementSearchDialog/tag-renderer.d.ts +20 -10
  14. package/dist/components/ElementSearchDialog/tag-renderer.js +6 -11
  15. package/dist/components/FlatParameters/FlatParameters.d.ts +29 -9
  16. package/dist/components/FlatParameters/FlatParameters.js +3 -3
  17. package/dist/components/FlatParameters/index.d.ts +6 -0
  18. package/dist/components/Login/Login.d.ts +11 -4
  19. package/dist/components/Login/Logout.d.ts +11 -4
  20. package/dist/components/Login/index.d.ts +6 -0
  21. package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +25 -2
  22. package/dist/components/MuiVirtualizedTable/ColumnHeader.js +68 -59
  23. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +72 -61
  24. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +69 -83
  25. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +93 -113
  26. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +84 -106
  27. package/dist/components/MuiVirtualizedTable/index.d.ts +7 -1
  28. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +16 -9
  29. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +1 -1
  30. package/dist/components/MultipleSelectionDialog/index.d.ts +6 -0
  31. package/dist/components/OverflowableText/index.d.ts +6 -0
  32. package/dist/components/OverflowableText/overflowable-text.d.ts +11 -1
  33. package/dist/components/OverflowableText/overflowable-text.js +1 -18
  34. package/dist/components/ReportViewer/filter-button.d.ts +11 -1
  35. package/dist/components/ReportViewer/filter-button.js +5 -2
  36. package/dist/components/ReportViewer/index.d.ts +6 -0
  37. package/dist/components/ReportViewer/log-report-item.d.ts +14 -64
  38. package/dist/components/ReportViewer/log-report-item.js +13 -47
  39. package/dist/components/ReportViewer/log-report.d.ts +16 -17
  40. package/dist/components/ReportViewer/log-report.js +2 -1
  41. package/dist/components/ReportViewer/log-severity.d.ts +13 -0
  42. package/dist/components/ReportViewer/log-severity.js +35 -0
  43. package/dist/components/ReportViewer/log-table.d.ts +9 -6
  44. package/dist/components/ReportViewer/log-table.js +6 -4
  45. package/dist/components/ReportViewer/multi-select-list.d.ts +17 -1
  46. package/dist/components/ReportViewer/report-item.d.ts +12 -12
  47. package/dist/components/ReportViewer/report-item.js +0 -7
  48. package/dist/components/ReportViewer/report-tree-view-context.d.ts +11 -1
  49. package/dist/components/ReportViewer/report-viewer.d.ts +7 -4
  50. package/dist/components/ReportViewer/report-viewer.js +8 -6
  51. package/dist/components/ReportViewer/report.type.d.ts +22 -0
  52. package/dist/components/ReportViewer/report.type.js +1 -0
  53. package/dist/components/ReportViewerDialog/index.d.ts +6 -0
  54. package/dist/components/ReportViewerDialog/report-viewer-dialog.d.ts +9 -1
  55. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +7 -4
  56. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +4 -1
  57. package/dist/components/SignInCallbackHandler/index.d.ts +6 -0
  58. package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +7 -4
  59. package/dist/components/SilentRenewCallbackHandler/index.d.ts +6 -0
  60. package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +3 -1
  61. package/dist/components/SnackbarProvider/SnackbarProvider.js +9 -7
  62. package/dist/components/SnackbarProvider/index.d.ts +6 -0
  63. package/dist/components/TopBar/AboutDialog.d.ts +30 -23
  64. package/dist/components/TopBar/AboutDialog.js +4 -22
  65. package/dist/components/TopBar/GridLogo.d.ts +13 -32
  66. package/dist/components/TopBar/GridLogo.js +12 -15
  67. package/dist/components/TopBar/TopBar.d.ts +52 -51
  68. package/dist/components/TopBar/TopBar.js +389 -380
  69. package/dist/components/TopBar/TopBar.test.d.ts +6 -0
  70. package/dist/components/TopBar/index.d.ts +6 -0
  71. package/dist/components/dialogs/modify-element-selection.d.ts +1 -1
  72. package/dist/components/dialogs/modify-element-selection.js +5 -14
  73. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.d.ts +1 -1
  74. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +1 -1
  75. package/dist/components/filter/criteria-based/filter-free-properties.d.ts +1 -1
  76. package/dist/components/filter/criteria-based/filter-property.d.ts +1 -1
  77. package/dist/components/filter/expert/expert-filter-constants.d.ts +22 -1
  78. package/dist/components/filter/expert/expert-filter-constants.js +39 -10
  79. package/dist/components/filter/expert/expert-filter-edition-dialog.d.ts +0 -6
  80. package/dist/components/filter/expert/expert-filter-edition-dialog.js +1 -2
  81. package/dist/components/filter/expert/expert-filter-form.js +1 -1
  82. package/dist/components/filter/expert/expert-filter.type.d.ts +4 -1
  83. package/dist/components/filter/expert/expert-filter.type.js +3 -0
  84. package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +1 -1
  85. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +1 -1
  86. package/dist/components/filter/filter-creation-dialog.d.ts +0 -7
  87. package/dist/components/filter/filter-creation-dialog.js +1 -2
  88. package/dist/components/filter/filter-form.js +1 -1
  89. package/dist/components/filter/utils/filter-form-utils.js +11 -18
  90. package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +1 -1
  91. package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +5 -13
  92. package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +1 -1
  93. package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.d.ts +1 -1
  94. package/dist/components/inputs/react-hook-form/booleans/boolean-input.d.ts +9 -15
  95. package/dist/components/inputs/react-hook-form/booleans/boolean-input.js +0 -7
  96. package/dist/components/inputs/react-hook-form/booleans/checkbox-input.d.ts +8 -13
  97. package/dist/components/inputs/react-hook-form/booleans/checkbox-input.js +0 -6
  98. package/dist/components/inputs/react-hook-form/booleans/switch-input.d.ts +8 -13
  99. package/dist/components/inputs/react-hook-form/booleans/switch-input.js +0 -6
  100. package/dist/components/inputs/react-hook-form/directory-items-input.d.ts +0 -2
  101. package/dist/components/inputs/react-hook-form/directory-items-input.js +10 -14
  102. package/dist/components/inputs/react-hook-form/error-management/mid-form-error.d.ts +5 -3
  103. package/dist/components/inputs/react-hook-form/numbers/integer-input.d.ts +3 -20
  104. package/dist/components/inputs/react-hook-form/numbers/integer-input.js +1 -4
  105. package/dist/components/inputs/react-hook-form/range-input.d.ts +1 -1
  106. package/dist/components/inputs/react-hook-form/select-inputs/countries-input.js +12 -1
  107. package/dist/components/inputs/react-hook-form/select-inputs/select-input.d.ts +1 -1
  108. package/dist/components/inputs/react-hook-form/slider-input.d.ts +7 -20
  109. package/dist/components/inputs/react-hook-form/slider-input.js +4 -12
  110. package/dist/components/inputs/react-hook-form/text-input.d.ts +1 -1
  111. package/dist/components/inputs/react-hook-form/unique-name-input.d.ts +1 -1
  112. package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.d.ts +1 -1
  113. package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +1 -1
  114. package/dist/components/inputs/react-query-builder/element-value-editor.js +7 -14
  115. package/dist/components/inputs/react-query-builder/remove-button.js +1 -1
  116. package/dist/components/inputs/react-query-builder/value-editor.js +1 -1
  117. package/dist/components/translations/card-error-boundary-en.d.ts +1 -1
  118. package/dist/components/translations/card-error-boundary-fr.d.ts +1 -1
  119. package/dist/components/translations/common-button-en.d.ts +10 -4
  120. package/dist/components/translations/common-button-fr.d.ts +10 -4
  121. package/dist/components/translations/directory-items-input-en.d.ts +1 -1
  122. package/dist/components/translations/directory-items-input-fr.d.ts +1 -1
  123. package/dist/components/translations/element-search-en.d.ts +1 -1
  124. package/dist/components/translations/element-search-fr.d.ts +1 -1
  125. package/dist/components/translations/equipment-search-en.d.ts +1 -1
  126. package/dist/components/translations/equipment-search-fr.d.ts +1 -1
  127. package/dist/components/translations/filter-en.d.ts +27 -21
  128. package/dist/components/translations/filter-en.js +2 -1
  129. package/dist/components/translations/filter-expert-en.d.ts +73 -0
  130. package/dist/components/translations/filter-expert-en.js +69 -0
  131. package/dist/components/translations/filter-expert-fr.d.ts +73 -0
  132. package/dist/components/translations/filter-expert-fr.js +69 -0
  133. package/dist/components/translations/filter-fr.d.ts +27 -21
  134. package/dist/components/translations/filter-fr.js +2 -1
  135. package/dist/components/translations/flat-parameters-en.d.ts +1 -1
  136. package/dist/components/translations/flat-parameters-fr.d.ts +1 -1
  137. package/dist/components/translations/inputs-en.d.ts +1 -1
  138. package/dist/components/translations/inputs-fr.d.ts +1 -1
  139. package/dist/components/translations/login-en.d.ts +1 -1
  140. package/dist/components/translations/login-fr.d.ts +1 -1
  141. package/dist/components/translations/multiple-selection-dialog-en.d.ts +1 -1
  142. package/dist/components/translations/multiple-selection-dialog-fr.d.ts +1 -1
  143. package/dist/components/translations/report-viewer-en.d.ts +1 -1
  144. package/dist/components/translations/report-viewer-fr.d.ts +1 -1
  145. package/dist/components/translations/table-en.d.ts +1 -1
  146. package/dist/components/translations/table-fr.d.ts +1 -1
  147. package/dist/components/translations/top-bar-en.d.ts +1 -1
  148. package/dist/components/translations/top-bar-fr.d.ts +1 -1
  149. package/dist/components/translations/treeview-finder-en.d.ts +1 -1
  150. package/dist/components/translations/treeview-finder-fr.d.ts +1 -1
  151. package/dist/hooks/localized-countries-hook.d.ts +10 -4
  152. package/dist/hooks/localized-countries-hook.js +1 -1
  153. package/dist/hooks/predefined-properties-hook.d.ts +1 -15
  154. package/dist/hooks/predefined-properties-hook.js +8 -16
  155. package/dist/index.d.ts +63 -217
  156. package/dist/index.js +102 -77
  157. package/dist/redux/actions.d.ts +33 -29
  158. package/dist/services/apps-metadata.d.ts +32 -0
  159. package/dist/services/apps-metadata.js +26 -0
  160. package/dist/services/directory.d.ts +6 -0
  161. package/dist/services/directory.js +42 -0
  162. package/dist/services/explore.d.ts +2 -0
  163. package/dist/services/explore.js +29 -1
  164. package/dist/services/index.d.ts +16 -0
  165. package/dist/services/index.js +20 -0
  166. package/dist/services/utils.d.ts +1 -0
  167. package/dist/services/utils.js +5 -1
  168. package/dist/utils/AuthService.d.ts +20 -9
  169. package/dist/utils/AuthService.js +29 -13
  170. package/dist/utils/ElementIcon.d.ts +4 -1
  171. package/dist/utils/UserManagerMock.d.ts +14 -14
  172. package/dist/utils/UserManagerMock.js +9 -15
  173. package/dist/utils/algos.d.ts +1 -1
  174. package/dist/utils/equipment-types-for-predefined-properties-mapper.d.ts +1 -1
  175. package/dist/utils/functions.d.ts +0 -1
  176. package/dist/utils/functions.js +1 -3
  177. package/dist/utils/styles.d.ts +5 -3
  178. package/dist/utils/styles.js +4 -1
  179. package/dist/utils/types.d.ts +13 -3
  180. package/package.json +2 -1
  181. package/dist/components/filter/filter-context.d.ts +0 -13
  182. package/dist/components/filter/filter-context.js +0 -11
@@ -1,16 +1,11 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
1
  import { equalsArray } from "../../utils/algos.js";
8
- const CHANGE_WAYS = {
9
- SIMPLE: "Simple",
10
- TAIL: "Tail",
11
- AMEND: "Amend",
12
- REMOVE: "Remove"
13
- };
2
+ var CHANGE_WAYS = /* @__PURE__ */ ((CHANGE_WAYS2) => {
3
+ CHANGE_WAYS2["SIMPLE"] = "Simple";
4
+ CHANGE_WAYS2["TAIL"] = "Tail";
5
+ CHANGE_WAYS2["AMEND"] = "Amend";
6
+ CHANGE_WAYS2["REMOVE"] = "Remove";
7
+ return CHANGE_WAYS2;
8
+ })(CHANGE_WAYS || {});
14
9
  const noOpHelper = Object.freeze({
15
10
  debugName: "noOp",
16
11
  maintainsStats: false,
@@ -28,10 +23,10 @@ const numericHelper = Object.freeze({
28
23
  return { imin: null, imax: null };
29
24
  },
30
25
  updateStat: (colStat, value) => {
31
- if (colStat.imin === null || colStat.imin > value) {
26
+ if (colStat.imin === void 0 || colStat.imin === null || colStat.imin > value) {
32
27
  colStat.imin = value;
33
28
  }
34
- if (colStat.imax === null || colStat.imax < value) {
29
+ if (colStat.imax === void 0 || colStat.imax === null || colStat.imax < value) {
35
30
  colStat.imax = value;
36
31
  }
37
32
  },
@@ -68,13 +63,13 @@ const getHelper = (column) => {
68
63
  };
69
64
  class KeyedColumnsRowIndexer {
70
65
  constructor(isThreeState = true, singleColumnByDefault = false, delegatorCallback = null, versionSetter = null) {
71
- __publicField(this, "hasVersionSetter", () => {
66
+ this.hasVersionSetter = () => {
72
67
  return !!this._versionSetter;
73
- });
74
- __publicField(this, "getVersion", () => {
68
+ };
69
+ this.getVersion = () => {
75
70
  return this.version;
76
- });
77
- __publicField(this, "_bumpVersion", (isFilter = false) => {
71
+ };
72
+ this._bumpVersion = (isFilter = false) => {
78
73
  this.version += 1;
79
74
  if (isFilter) {
80
75
  this.filterVersion = this.version;
@@ -88,8 +83,8 @@ class KeyedColumnsRowIndexer {
88
83
  if (this._versionSetter) {
89
84
  this._versionSetter(this.version);
90
85
  }
91
- });
92
- __publicField(this, "updatePreferences", (preferences) => {
86
+ };
87
+ this.updatePreferences = (preferences) => {
93
88
  if (preferences.isThreeState === this.isThreeState && preferences.singleColumnByDefault === this.singleColumnByDefault) {
94
89
  return false;
95
90
  }
@@ -100,22 +95,8 @@ class KeyedColumnsRowIndexer {
100
95
  this.singleColumnByDefault = preferences.singleColumnByDefault;
101
96
  }
102
97
  this._bumpVersion();
103
- });
104
- // Does not mutate any internal
105
- // returns
106
- // { rowAndOrigIndex : [[row, originalRowIndex],...],
107
- // colsStats : {
108
- // colKey1 : {
109
- // seen : Map(value : count),
110
- // kept : Map(value : count)
111
- // },
112
- // colKey2 : {
113
- // imin : number,
114
- // imax : number,
115
- // }, colKeyN, ...
116
- // }
117
- // }
118
- __publicField(this, "preFilterRowMapping", (columns, rows, rowFilter) => {
98
+ };
99
+ this.preFilterRowMapping = (columns, rows, rowFilter) => {
119
100
  var _a;
120
101
  if (!(rows == null ? void 0 : rows.length) || !(columns == null ? void 0 : columns.length)) {
121
102
  return null;
@@ -151,7 +132,7 @@ class KeyedColumnsRowIndexer {
151
132
  if (helper.maintainsStats && acceptsCell) {
152
133
  acceptedOnRow[colIdx] = cellValue;
153
134
  }
154
- acceptsRow &= acceptsCell;
135
+ acceptsRow && (acceptsRow = acceptsCell);
155
136
  }
156
137
  if (acceptsRow && rowFilter) {
157
138
  acceptsRow = rowFilter(row);
@@ -169,10 +150,8 @@ class KeyedColumnsRowIndexer {
169
150
  }
170
151
  }
171
152
  return { rowAndOrigIndex: ri, colsStats: cs, rowsCount: rows.length };
172
- });
173
- // Does not mutate any internal
174
- // returns an array of indexes in rows given to preFilter
175
- __publicField(this, "makeGroupAndSortIndirector", (preFilteredRowPairs, columns) => {
153
+ };
154
+ this.makeGroupAndSortIndirector = (preFilteredRowPairs, columns) => {
176
155
  if (!preFilteredRowPairs) {
177
156
  return null;
178
157
  }
@@ -185,8 +164,8 @@ class KeyedColumnsRowIndexer {
185
164
  columns
186
165
  );
187
166
  return !indexedArray ? null : indexedArray.map((k) => k[1]);
188
- });
189
- __publicField(this, "getSortingAsKeyAndCodedRank", () => {
167
+ };
168
+ this.getSortingAsKeyAndCodedRank = () => {
190
169
  if (!this.sortingState) {
191
170
  return [];
192
171
  }
@@ -195,11 +174,11 @@ class KeyedColumnsRowIndexer {
195
174
  const codedRank = sign * (i + 1);
196
175
  return [kd[0], codedRank];
197
176
  });
198
- });
199
- // returns true if really changed (and calls versionSetter if needed)
200
- __publicField(this, "updateSortingFromUser", (colKey, change_way) => {
177
+ };
178
+ this.updateSortingFromUser = (colKey, change_way) => {
179
+ var _a, _b, _c, _d, _e, _f, _g, _h;
201
180
  const keyAndDirections = this.sortingState;
202
- if (change_way === CHANGE_WAYS.REMOVE) {
181
+ if (change_way === "Remove") {
203
182
  if (!keyAndDirections) {
204
183
  return false;
205
184
  }
@@ -215,26 +194,29 @@ class KeyedColumnsRowIndexer {
215
194
  let wasAtIdx = keyAndDirections.findIndex((p) => p[0] === colKey);
216
195
  const wasFuzzyDir = wasAtIdx < 0 ? 0 : keyAndDirections[wasAtIdx][1];
217
196
  const wasSignDir = giveDirSignFor(wasFuzzyDir);
218
- if (change_way === CHANGE_WAYS.SIMPLE) {
197
+ if (change_way === "Simple") {
219
198
  if (wasSignDir < 0 && this.isThreeState) {
220
- if (this.sortingState.length === 1) {
199
+ if (((_a = this.sortingState) == null ? void 0 : _a.length) === 1) {
221
200
  this.sortingState = null;
222
201
  } else {
223
- this.sortingState.splice(wasAtIdx, 1);
202
+ (_b = this.sortingState) == null ? void 0 : _b.splice(wasAtIdx, 1);
224
203
  }
225
204
  } else {
226
205
  if (this.singleColumnByDefault || wasAtIdx < 0) {
227
206
  this.sortingState = [];
228
207
  } else {
229
- this.sortingState.splice(wasAtIdx, 1);
208
+ (_c = this.sortingState) == null ? void 0 : _c.splice(wasAtIdx, 1);
230
209
  }
231
210
  const nextSign = wasSignDir ? -wasSignDir : 1;
232
- const nextKD = [colKey, canonicalForSign(nextSign)];
233
- this.sortingState.unshift(nextKD);
211
+ const nextKD = [
212
+ colKey,
213
+ canonicalForSign(nextSign)
214
+ ];
215
+ (_d = this.sortingState) == null ? void 0 : _d.unshift(nextKD);
234
216
  }
235
- } else if (change_way === CHANGE_WAYS.TAIL) {
217
+ } else if (change_way === "Tail") {
236
218
  if (wasAtIdx < 0) {
237
- this.sortingState.push([colKey, canonicalForSign(1)]);
219
+ (_e = this.sortingState) == null ? void 0 : _e.push([colKey, canonicalForSign(1)]);
238
220
  } else if (wasAtIdx !== keyAndDirections.length - 1) {
239
221
  return false;
240
222
  } else if (!(this.isThreeState && wasSignDir === -1)) {
@@ -242,14 +224,15 @@ class KeyedColumnsRowIndexer {
242
224
  -wasSignDir
243
225
  );
244
226
  } else {
245
- this.sortingState.splice(wasAtIdx, 1);
227
+ (_f = this.sortingState) == null ? void 0 : _f.splice(wasAtIdx, 1);
246
228
  }
247
229
  } else {
248
230
  if (wasAtIdx < 0) {
249
- if (this.lastUsedRank - 1 > this.sortingState.length) {
231
+ if (this.lastUsedRank - 1 > //@ts-ignore could be undefined, how to handle this case ?
232
+ this.sortingState.length) {
250
233
  return false;
251
234
  } else {
252
- this.sortingState.splice(this.lastUsedRank - 1, 0, [
235
+ (_g = this.sortingState) == null ? void 0 : _g.splice(this.lastUsedRank - 1, 0, [
253
236
  colKey,
254
237
  canonicalForSign(1)
255
238
  ]);
@@ -260,17 +243,17 @@ class KeyedColumnsRowIndexer {
260
243
  );
261
244
  } else {
262
245
  this.lastUsedRank = wasAtIdx + 1;
263
- this.sortingState.splice(wasAtIdx, 1);
246
+ (_h = this.sortingState) == null ? void 0 : _h.splice(wasAtIdx, 1);
264
247
  }
265
248
  }
266
249
  }
267
250
  this._bumpVersion();
268
251
  return true;
269
- });
270
- __publicField(this, "codedRankByColumnIndex", (columns) => {
252
+ };
253
+ this.codedRankByColumnIndex = (columns) => {
271
254
  return codedColumnsFromKeyAndDirection(this.sortingState, columns);
272
- });
273
- __publicField(this, "columnSortingSignedRank", (colKey) => {
255
+ };
256
+ this.columnSortingSignedRank = (colKey) => {
274
257
  var _a;
275
258
  if (!((_a = this == null ? void 0 : this.sortingState) == null ? void 0 : _a.length)) {
276
259
  return 0;
@@ -281,8 +264,8 @@ class KeyedColumnsRowIndexer {
281
264
  }
282
265
  const colSorting = this.sortingState[idx];
283
266
  return giveDirSignFor(colSorting[1]) * (idx + 1);
284
- });
285
- __publicField(this, "highestCodedColumn", (columns) => {
267
+ };
268
+ this.highestCodedColumn = (columns) => {
286
269
  var _a;
287
270
  if (!((_a = this == null ? void 0 : this.sortingState) == null ? void 0 : _a.length)) {
288
271
  return 0;
@@ -294,8 +277,8 @@ class KeyedColumnsRowIndexer {
294
277
  return 0;
295
278
  }
296
279
  return giveDirSignFor(colSorting[1]) * (idx + 1);
297
- });
298
- __publicField(this, "_getColFilterParams", (colKey, isForUser) => {
280
+ };
281
+ this._getColFilterParams = (colKey, isForUser) => {
299
282
  if (!colKey || !this.byColFilter) {
300
283
  return void 0;
301
284
  }
@@ -304,8 +287,8 @@ class KeyedColumnsRowIndexer {
304
287
  return void 0;
305
288
  }
306
289
  return colFilter[isForUser ? "userParams" : "outerParams"];
307
- });
308
- __publicField(this, "_setColFilterParams", (colKey, params, isForUser) => {
290
+ };
291
+ this._setColFilterParams = (colKey, params, isForUser) => {
309
292
  var _a;
310
293
  if (!colKey) {
311
294
  if (params) {
@@ -341,20 +324,20 @@ class KeyedColumnsRowIndexer {
341
324
  this._bumpVersion(true);
342
325
  }
343
326
  return true;
344
- });
345
- __publicField(this, "getColFilterOuterParams", (colKey) => {
327
+ };
328
+ this.getColFilterOuterParams = (colKey) => {
346
329
  return this._getColFilterParams(colKey, false);
347
- });
348
- __publicField(this, "setColFilterOuterParams", (colKey, outerParams) => {
330
+ };
331
+ this.setColFilterOuterParams = (colKey, outerParams) => {
349
332
  return this._setColFilterParams(colKey, outerParams, false);
350
- });
351
- __publicField(this, "getColFilterUserParams", (colKey) => {
333
+ };
334
+ this.getColFilterUserParams = (colKey) => {
352
335
  return this._getColFilterParams(colKey, true);
353
- });
354
- __publicField(this, "setColFilterUserParams", (colKey, params) => {
336
+ };
337
+ this.setColFilterUserParams = (colKey, params) => {
355
338
  return this._setColFilterParams(colKey, params, true);
356
- });
357
- __publicField(this, "getUserFiltering", () => {
339
+ };
340
+ this.getUserFiltering = () => {
358
341
  const ret = {};
359
342
  if (this.byColFilter) {
360
343
  Object.entries(this.byColFilter).forEach(([k, v]) => {
@@ -365,14 +348,14 @@ class KeyedColumnsRowIndexer {
365
348
  });
366
349
  }
367
350
  return ret;
368
- });
369
- __publicField(this, "updateRowFiltering", (rowFilterFunc) => {
351
+ };
352
+ this.updateRowFiltering = (rowFilterFunc) => {
370
353
  if (typeof rowFilterFunc !== "function") {
371
354
  throw new Error("row filter should be a function");
372
355
  }
373
356
  this.byRowFilter = rowFilterFunc;
374
357
  this._bumpVersion();
375
- });
358
+ };
376
359
  this._versionSetter = versionSetter;
377
360
  this.version = 0;
378
361
  this.filterVersion = 0;
@@ -482,6 +465,7 @@ const groupRows = (groupingColumnsCount, columns, indexedArray) => {
482
465
  const groupingComparator = makeCompositeComparatorFromCodedColumns(
483
466
  Array(groupingColumnsCount).map((x, i) => i + 1),
484
467
  columns,
468
+ //@ts-ignore does not match other pattern
485
469
  (ar) => ar[0]
486
470
  );
487
471
  indexedArray.sort(groupingComparator);
@@ -515,6 +499,7 @@ const groupAndSort = (preFilteredRowPairs, codedColumns, groupingColumnsCount, c
515
499
  const sortingComparator = makeCompositeComparatorFromCodedColumns(
516
500
  codedColumns,
517
501
  columns,
502
+ //@ts-ignore I don't know how to fix this one
518
503
  (ar) => ar[0]
519
504
  );
520
505
  indexedArray.sort(sortingComparator);
@@ -529,6 +514,7 @@ const groupAndSort = (preFilteredRowPairs, codedColumns, groupingColumnsCount, c
529
514
  const intraGroupSortingComparator = makeCompositeComparatorFromCodedColumns(
530
515
  codedColumns,
531
516
  columns,
517
+ //@ts-ignore I don't know how to fix this one
532
518
  (ar) => ar[0]
533
519
  );
534
520
  indexedArray = [];
@@ -1,131 +1,111 @@
1
- import { PureComponent } from 'react';
2
- import { default as PropTypes } from 'prop-types';
3
- export const DEFAULT_CELL_PADDING: 16;
4
- export const DEFAULT_HEADER_HEIGHT: 48;
5
- export const DEFAULT_ROW_HEIGHT: 48;
6
- export function generateMuiVirtualizedTableClass(className: any): string;
7
- declare const _default: import('@emotion/styled').StyledComponent<Pick<PropTypes.InferProps<{
8
- name: PropTypes.Requireable<string>;
9
- classes: PropTypes.Requireable<object>;
10
- rows: PropTypes.Requireable<any[]>;
11
- columns: PropTypes.Validator<(PropTypes.InferProps<{
12
- dataKey: PropTypes.Validator<string>;
13
- label: PropTypes.Validator<string>;
14
- numeric: PropTypes.Requireable<boolean>;
15
- width: PropTypes.Requireable<number>;
16
- minWidth: PropTypes.Requireable<number>;
17
- maxWidth: PropTypes.Requireable<number>;
18
- unit: PropTypes.Requireable<string>;
19
- fractionDigits: PropTypes.Requireable<number>;
20
- extra: PropTypes.Requireable<PropTypes.ReactElementLike>;
21
- }> | null | undefined)[]>;
22
- enableExportCSV: PropTypes.Requireable<boolean>;
23
- exportCSVDataKeys: PropTypes.Requireable<any[]>;
24
- sort: PropTypes.Requireable<(...args: any[]) => any>;
25
- sortable: PropTypes.Requireable<boolean>;
26
- indexer: PropTypes.Requireable<object>;
27
- headerHeight: PropTypes.Requireable<number>;
28
- onRowClick: PropTypes.Requireable<(...args: any[]) => any>;
29
- onCellClick: PropTypes.Requireable<(...args: any[]) => any>;
30
- rowHeight: PropTypes.Requireable<number>;
31
- filter: PropTypes.Requireable<(...args: any[]) => any>;
32
- tooltipSx: PropTypes.Requireable<object>;
33
- }>, "filter" | "columns" | "name" | "rows" | "sort" | "tooltipSx" | "indexer" | "sortable" | "exportCSVDataKeys" | "onRowClick" | "onCellClick"> & {
34
- classes?: object | null | undefined;
35
- headerHeight?: number | null | undefined;
36
- enableExportCSV?: boolean | null | undefined;
37
- rowHeight?: number | null | undefined;
38
- } & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {
39
- ref?: import("react").Ref<MuiVirtualizedTable> | undefined;
40
- }>;
41
- export default _default;
42
- declare class MuiVirtualizedTable extends PureComponent<any, any, any> {
1
+ import { KeyedColumnsRowIndexer } from './KeyedColumnsRowIndexer';
2
+ import { ColumnProps, RowMouseEventHandlerParams, TableCellProps } from 'react-virtualized';
3
+ import { SxProps } from '@mui/material';
4
+ import { PureComponent, ReactElement, MouseEvent, KeyboardEvent, MutableRefObject } from 'react';
5
+
6
+ export declare const DEFAULT_CELL_PADDING = 16;
7
+ export declare const DEFAULT_HEADER_HEIGHT = 48;
8
+ export declare const DEFAULT_ROW_HEIGHT = 48;
9
+ export declare const generateMuiVirtualizedTableClass: (className: string) => string;
10
+ export interface CustomColumnProps extends ColumnProps {
11
+ sortable?: boolean;
12
+ numeric?: boolean;
13
+ indexer?: KeyedColumnsRowIndexer;
14
+ label: string;
15
+ clickable?: boolean;
16
+ fractionDigits?: number;
17
+ unit?: number;
18
+ extra?: ReactElement;
19
+ nostat?: boolean;
20
+ }
21
+ export interface RowProps {
22
+ notClickable?: boolean;
23
+ }
24
+ export interface MuiVirtualizedTableProps extends CustomColumnProps {
25
+ headerHeight: number;
26
+ columns: CustomColumnProps[];
27
+ defersFilterChanges: (() => void) | null;
28
+ rows: RowProps[];
29
+ filter: unknown;
30
+ sort: unknown;
31
+ classes: Record<string, string>;
32
+ onRowClick?: (event: RowMouseEventHandlerParams) => void;
33
+ rowHeight: number;
34
+ onCellClick: (row: RowProps, column: ColumnProps) => void;
35
+ tooltipSx: SxProps;
36
+ name: string;
37
+ exportCSVDataKeys: unknown[];
38
+ enableExportCSV: boolean;
39
+ }
40
+ export interface MuiVirtualizedTableState {
41
+ headerHeight: number;
42
+ indexer: KeyedColumnsRowIndexer | null;
43
+ indirectionVersion: number;
44
+ popoverAnchorEl: Element | null;
45
+ popoverColKey: string | null;
46
+ deferredFilterChange: null | {
47
+ newVal: unknown[] | null;
48
+ colKey: string | null;
49
+ };
50
+ }
51
+ declare class MuiVirtualizedTable extends PureComponent<MuiVirtualizedTableProps, MuiVirtualizedTableState> {
43
52
  static defaultProps: {
44
53
  headerHeight: number;
45
54
  rowHeight: number;
46
55
  enableExportCSV: boolean;
47
56
  classes: {};
48
57
  };
49
- constructor(props: any, context: any);
50
- _computeHeaderSize(): void;
51
- _registerHeader(label: any, header: any): void;
52
- _registerObserver(element: any): void;
53
- headers: import('react').RefObject<any>;
58
+ headers: MutableRefObject<any>;
54
59
  observer: IntersectionObserver;
55
- state: {
56
- headerHeight: any;
57
- indexer: any;
58
- indirectionVersion: number;
59
- popoverAnchorEl: null;
60
- popoverColKey: null;
61
- deferredFilterChange: null;
62
- };
63
- setVersion: (v: any) => void;
64
- componentDidUpdate(oldProps: any): void;
60
+ dropDownVisible: boolean;
61
+ constructor(props: MuiVirtualizedTableProps, context: any);
62
+ setVersion: (v: number) => void;
63
+ componentDidUpdate(oldProps: MuiVirtualizedTableProps): void;
65
64
  componentDidMount(): void;
66
65
  componentWillUnmount(): void;
67
- computeDataWidth: (text: any) => any;
68
- sizes: import('memoize-one').MemoizedFn<(this: any, columns: any, rows: any, rowGetter: any) => {}>;
69
- openPopover: (popoverTarget: any, colKey: any) => void;
70
- dropDownVisible: any;
71
- handleKeyDownOnPopover: (evt: any) => void;
72
- closePopover: (evt: any, reason: any) => void;
66
+ _registerHeader(label: string, header: unknown): void;
67
+ _registerObserver(element: Element): void;
68
+ computeDataWidth: (text: string) => number;
69
+ sizes: import('memoize-one').MemoizedFn<(this: any, columns: any, rows: any, rowGetter: any) => Record<string, number>>;
70
+ openPopover: (popoverTarget: Element, colKey: string) => void;
71
+ handleKeyDownOnPopover: (evt: KeyboardEvent<HTMLDivElement>) => void;
72
+ closePopover: (_: KeyboardEvent<HTMLDivElement>, reason: string) => void;
73
73
  makeColumnFilterEditor: () => import("react/jsx-runtime").JSX.Element;
74
74
  _commitFilterChange: () => boolean;
75
- onFilterParamsChange(newVal: any, colKey: any): void;
76
- sortClickHandler: (evt: any, name: any, columnIndex: any) => void;
77
- filterClickHandler: (evt: any, target: any, columnIndex: any) => void;
78
- sortableHeader: ({ label, columnIndex }: {
79
- label: any;
80
- columnIndex: any;
75
+ onFilterParamsChange(newVal: unknown[] | null, colKey: string | null): void;
76
+ sortClickHandler: (evt: MouseEvent, _: unknown, columnIndex: number) => void;
77
+ filterClickHandler: (_: MouseEvent, target: Element | undefined, columnIndex: number) => void;
78
+ sortableHeader: ({ label, columnIndex, }: {
79
+ label: string;
80
+ columnIndex: number;
81
81
  }) => import("react/jsx-runtime").JSX.Element;
82
82
  simpleHeaderRenderer: ({ label }: {
83
- label: any;
83
+ label: string;
84
84
  }) => import("react/jsx-runtime").JSX.Element;
85
- getRowClassName: ({ index, rowGetter }: {
86
- index: any;
85
+ getRowClassName: ({ index, rowGetter, }: {
86
+ index: number;
87
87
  rowGetter: any;
88
88
  }) => string;
89
- onClickableRowClick: (event: any) => void;
90
- cellRenderer: ({ cellData, columnIndex, rowIndex }: {
91
- cellData: any;
92
- columnIndex: any;
93
- rowIndex: any;
94
- }) => import("react/jsx-runtime").JSX.Element;
95
- getDisplayValue(column: any, cellData: any): any;
96
- makeHeaderRenderer(dataKey: any, columnIndex: any): (headerProps: any) => import("react/jsx-runtime").JSX.Element;
97
- makeSizedTable: (height: any, width: any, sizes: any, reorderedIndex: any, rowGetter: any) => import("react/jsx-runtime").JSX.Element;
98
- getCSVFilename: () => any;
99
- getCSVData: () => Promise<{}[]>;
100
- csvHeaders: import('memoize-one').MemoizedFn<(this: any, columns: any, exportCSVDataKeys: any) => any[]>;
89
+ onClickableRowClick: (event: RowMouseEventHandlerParams) => void;
90
+ cellRenderer: ({ cellData, columnIndex, rowIndex }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
91
+ getDisplayValue(column: CustomColumnProps, cellData: any): any;
92
+ _computeHeaderSize(): void;
93
+ makeHeaderRenderer(dataKey: string, columnIndex: number): (headerProps: any) => import("react/jsx-runtime").JSX.Element;
94
+ makeSizedTable: (height: number, width: number, sizes: Record<string, number>, reorderedIndex: number[] | null, rowGetter: ((index: number) => RowProps) | ((index: number) => number)) => import("react/jsx-runtime").JSX.Element;
95
+ getCSVFilename: () => string;
96
+ getCSVData: () => Promise<Record<string, any>[]>;
97
+ csvHeaders: import('memoize-one').MemoizedFn<(this: any, columns: any, exportCSVDataKeys: any) => {
98
+ displayName: string;
99
+ id: string;
100
+ }[]>;
101
101
  render(): import("react/jsx-runtime").JSX.Element;
102
102
  }
103
- declare namespace MuiVirtualizedTable {
104
- namespace propTypes {
105
- let name: PropTypes.Requireable<string>;
106
- let classes: PropTypes.Requireable<object>;
107
- let rows: PropTypes.Requireable<any[]>;
108
- let columns: PropTypes.Validator<(PropTypes.InferProps<{
109
- dataKey: PropTypes.Validator<string>;
110
- label: PropTypes.Validator<string>;
111
- numeric: PropTypes.Requireable<boolean>;
112
- width: PropTypes.Requireable<number>;
113
- minWidth: PropTypes.Requireable<number>;
114
- maxWidth: PropTypes.Requireable<number>;
115
- unit: PropTypes.Requireable<string>;
116
- fractionDigits: PropTypes.Requireable<number>;
117
- extra: PropTypes.Requireable<PropTypes.ReactElementLike>;
118
- }> | null | undefined)[]>;
119
- let enableExportCSV: PropTypes.Requireable<boolean>;
120
- let exportCSVDataKeys: PropTypes.Requireable<any[]>;
121
- let sort: PropTypes.Requireable<(...args: any[]) => any>;
122
- let sortable: PropTypes.Requireable<boolean>;
123
- let indexer: PropTypes.Requireable<object>;
124
- let headerHeight: PropTypes.Requireable<number>;
125
- let onRowClick: PropTypes.Requireable<(...args: any[]) => any>;
126
- let onCellClick: PropTypes.Requireable<(...args: any[]) => any>;
127
- let rowHeight: PropTypes.Requireable<number>;
128
- let filter: PropTypes.Requireable<(...args: any[]) => any>;
129
- let tooltipSx: PropTypes.Requireable<object>;
130
- }
131
- }
103
+ declare const _default: import('@emotion/styled').StyledComponent<Pick<MuiVirtualizedTableProps, "filter" | "flexGrow" | "flexShrink" | "maxWidth" | "minWidth" | "width" | "columns" | "className" | "style" | "label" | "id" | "aria-label" | "name" | "rows" | "sort" | "numeric" | "tooltipSx" | "defersFilterChanges" | "onRowClick" | "onCellClick" | "exportCSVDataKeys" | "sortable" | "indexer" | "clickable" | "fractionDigits" | "unit" | "extra" | "nostat" | "cellDataGetter" | "cellRenderer" | "columnData" | "dataKey" | "defaultSortDirection" | "disableSort" | "headerClassName" | "headerRenderer" | "headerStyle"> & {
104
+ classes?: Record<string, string> | undefined;
105
+ headerHeight?: number | undefined;
106
+ rowHeight?: number | undefined;
107
+ enableExportCSV?: boolean | undefined;
108
+ } & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {
109
+ ref?: import("react").Ref<MuiVirtualizedTable> | undefined;
110
+ }>;
111
+ export default _default;