@gridsuite/commons-ui 0.58.0 → 0.59.1

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 (190) hide show
  1. package/dist/chunks/{criteria-based-filter-edition-dialog.CbhgOSRk.js → criteria-based-filter-edition-dialog.DcXcQOoT.js} +21 -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/CustomAGGrid/custom-aggrid.d.ts +11 -0
  9. package/dist/components/CustomAGGrid/custom-aggrid.js +73 -0
  10. package/dist/components/CustomAGGrid/custom-aggrid.style.d.ts +20 -0
  11. package/dist/components/CustomAGGrid/custom-aggrid.style.js +47 -0
  12. package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +0 -4
  13. package/dist/components/DirectoryItemSelector/directory-item-selector.js +13 -26
  14. package/dist/components/ElementSearchDialog/equipment-item.d.ts +25 -16
  15. package/dist/components/ElementSearchDialog/equipment-item.js +5 -5
  16. package/dist/components/ElementSearchDialog/index.d.ts +6 -0
  17. package/dist/components/ElementSearchDialog/tag-renderer.d.ts +20 -10
  18. package/dist/components/ElementSearchDialog/tag-renderer.js +6 -11
  19. package/dist/components/FlatParameters/FlatParameters.d.ts +29 -9
  20. package/dist/components/FlatParameters/FlatParameters.js +3 -3
  21. package/dist/components/FlatParameters/index.d.ts +6 -0
  22. package/dist/components/Login/Login.d.ts +11 -4
  23. package/dist/components/Login/Logout.d.ts +11 -4
  24. package/dist/components/Login/index.d.ts +6 -0
  25. package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +25 -2
  26. package/dist/components/MuiVirtualizedTable/ColumnHeader.js +68 -59
  27. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +72 -61
  28. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +69 -83
  29. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +93 -113
  30. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +84 -106
  31. package/dist/components/MuiVirtualizedTable/index.d.ts +7 -1
  32. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +16 -9
  33. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +1 -1
  34. package/dist/components/MultipleSelectionDialog/index.d.ts +6 -0
  35. package/dist/components/OverflowableText/index.d.ts +6 -0
  36. package/dist/components/OverflowableText/overflowable-text.d.ts +11 -1
  37. package/dist/components/OverflowableText/overflowable-text.js +1 -18
  38. package/dist/components/ReportViewer/filter-button.d.ts +11 -1
  39. package/dist/components/ReportViewer/filter-button.js +5 -2
  40. package/dist/components/ReportViewer/index.d.ts +6 -0
  41. package/dist/components/ReportViewer/log-report-item.d.ts +14 -64
  42. package/dist/components/ReportViewer/log-report-item.js +13 -47
  43. package/dist/components/ReportViewer/log-report.d.ts +16 -17
  44. package/dist/components/ReportViewer/log-report.js +2 -1
  45. package/dist/components/ReportViewer/log-severity.d.ts +13 -0
  46. package/dist/components/ReportViewer/log-severity.js +35 -0
  47. package/dist/components/ReportViewer/log-table.d.ts +9 -6
  48. package/dist/components/ReportViewer/log-table.js +6 -4
  49. package/dist/components/ReportViewer/multi-select-list.d.ts +17 -1
  50. package/dist/components/ReportViewer/report-item.d.ts +12 -12
  51. package/dist/components/ReportViewer/report-item.js +0 -7
  52. package/dist/components/ReportViewer/report-tree-view-context.d.ts +11 -1
  53. package/dist/components/ReportViewer/report-viewer.d.ts +7 -4
  54. package/dist/components/ReportViewer/report-viewer.js +8 -6
  55. package/dist/components/ReportViewer/report.type.d.ts +22 -0
  56. package/dist/components/ReportViewer/report.type.js +1 -0
  57. package/dist/components/ReportViewerDialog/index.d.ts +6 -0
  58. package/dist/components/ReportViewerDialog/report-viewer-dialog.d.ts +9 -1
  59. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +7 -4
  60. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +4 -1
  61. package/dist/components/SignInCallbackHandler/index.d.ts +6 -0
  62. package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +7 -4
  63. package/dist/components/SilentRenewCallbackHandler/index.d.ts +6 -0
  64. package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +3 -1
  65. package/dist/components/SnackbarProvider/SnackbarProvider.js +9 -7
  66. package/dist/components/SnackbarProvider/index.d.ts +6 -0
  67. package/dist/components/TopBar/AboutDialog.d.ts +30 -23
  68. package/dist/components/TopBar/AboutDialog.js +4 -22
  69. package/dist/components/TopBar/GridLogo.d.ts +13 -32
  70. package/dist/components/TopBar/GridLogo.js +12 -15
  71. package/dist/components/TopBar/TopBar.d.ts +52 -51
  72. package/dist/components/TopBar/TopBar.js +389 -380
  73. package/dist/components/TopBar/TopBar.test.d.ts +6 -0
  74. package/dist/components/TopBar/index.d.ts +6 -0
  75. package/dist/components/dialogs/modify-element-selection.d.ts +1 -1
  76. package/dist/components/dialogs/modify-element-selection.js +5 -14
  77. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.d.ts +1 -1
  78. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +1 -1
  79. package/dist/components/filter/criteria-based/filter-free-properties.d.ts +1 -1
  80. package/dist/components/filter/criteria-based/filter-property.d.ts +1 -1
  81. package/dist/components/filter/expert/expert-filter-constants.d.ts +22 -1
  82. package/dist/components/filter/expert/expert-filter-constants.js +39 -10
  83. package/dist/components/filter/expert/expert-filter-edition-dialog.d.ts +0 -6
  84. package/dist/components/filter/expert/expert-filter-edition-dialog.js +1 -2
  85. package/dist/components/filter/expert/expert-filter-form.js +1 -1
  86. package/dist/components/filter/expert/expert-filter.type.d.ts +4 -1
  87. package/dist/components/filter/expert/expert-filter.type.js +3 -0
  88. package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +1 -1
  89. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +1 -1
  90. package/dist/components/filter/filter-creation-dialog.d.ts +0 -7
  91. package/dist/components/filter/filter-creation-dialog.js +1 -2
  92. package/dist/components/filter/filter-form.js +1 -1
  93. package/dist/components/filter/utils/filter-form-utils.d.ts +3 -2
  94. package/dist/components/filter/utils/filter-form-utils.js +42 -28
  95. package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +1 -1
  96. package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +6 -13
  97. package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +1 -1
  98. package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.d.ts +1 -1
  99. package/dist/components/inputs/react-hook-form/booleans/boolean-input.d.ts +9 -15
  100. package/dist/components/inputs/react-hook-form/booleans/boolean-input.js +0 -7
  101. package/dist/components/inputs/react-hook-form/booleans/checkbox-input.d.ts +8 -13
  102. package/dist/components/inputs/react-hook-form/booleans/checkbox-input.js +0 -6
  103. package/dist/components/inputs/react-hook-form/booleans/switch-input.d.ts +8 -13
  104. package/dist/components/inputs/react-hook-form/booleans/switch-input.js +0 -6
  105. package/dist/components/inputs/react-hook-form/directory-items-input.d.ts +0 -2
  106. package/dist/components/inputs/react-hook-form/directory-items-input.js +10 -14
  107. package/dist/components/inputs/react-hook-form/error-management/mid-form-error.d.ts +5 -3
  108. package/dist/components/inputs/react-hook-form/numbers/integer-input.d.ts +3 -20
  109. package/dist/components/inputs/react-hook-form/numbers/integer-input.js +1 -4
  110. package/dist/components/inputs/react-hook-form/range-input.d.ts +1 -1
  111. package/dist/components/inputs/react-hook-form/select-inputs/countries-input.js +12 -1
  112. package/dist/components/inputs/react-hook-form/select-inputs/select-input.d.ts +1 -1
  113. package/dist/components/inputs/react-hook-form/slider-input.d.ts +7 -20
  114. package/dist/components/inputs/react-hook-form/slider-input.js +4 -12
  115. package/dist/components/inputs/react-hook-form/text-input.d.ts +1 -1
  116. package/dist/components/inputs/react-hook-form/unique-name-input.d.ts +1 -1
  117. package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.d.ts +1 -1
  118. package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +1 -1
  119. package/dist/components/inputs/react-query-builder/element-value-editor.js +8 -14
  120. package/dist/components/inputs/react-query-builder/remove-button.js +1 -1
  121. package/dist/components/inputs/react-query-builder/value-editor.js +1 -1
  122. package/dist/components/translations/card-error-boundary-en.d.ts +1 -1
  123. package/dist/components/translations/card-error-boundary-fr.d.ts +1 -1
  124. package/dist/components/translations/common-button-en.d.ts +10 -4
  125. package/dist/components/translations/common-button-fr.d.ts +10 -4
  126. package/dist/components/translations/directory-items-input-en.d.ts +1 -1
  127. package/dist/components/translations/directory-items-input-fr.d.ts +1 -1
  128. package/dist/components/translations/element-search-en.d.ts +1 -1
  129. package/dist/components/translations/element-search-fr.d.ts +1 -1
  130. package/dist/components/translations/equipment-search-en.d.ts +1 -1
  131. package/dist/components/translations/equipment-search-fr.d.ts +1 -1
  132. package/dist/components/translations/filter-en.d.ts +27 -21
  133. package/dist/components/translations/filter-en.js +2 -1
  134. package/dist/components/translations/filter-expert-en.d.ts +73 -0
  135. package/dist/components/translations/filter-expert-en.js +69 -0
  136. package/dist/components/translations/filter-expert-fr.d.ts +73 -0
  137. package/dist/components/translations/filter-expert-fr.js +69 -0
  138. package/dist/components/translations/filter-fr.d.ts +27 -21
  139. package/dist/components/translations/filter-fr.js +2 -1
  140. package/dist/components/translations/flat-parameters-en.d.ts +1 -1
  141. package/dist/components/translations/flat-parameters-fr.d.ts +1 -1
  142. package/dist/components/translations/inputs-en.d.ts +1 -1
  143. package/dist/components/translations/inputs-fr.d.ts +1 -1
  144. package/dist/components/translations/login-en.d.ts +1 -1
  145. package/dist/components/translations/login-fr.d.ts +1 -1
  146. package/dist/components/translations/multiple-selection-dialog-en.d.ts +1 -1
  147. package/dist/components/translations/multiple-selection-dialog-fr.d.ts +1 -1
  148. package/dist/components/translations/report-viewer-en.d.ts +1 -1
  149. package/dist/components/translations/report-viewer-fr.d.ts +1 -1
  150. package/dist/components/translations/table-en.d.ts +1 -1
  151. package/dist/components/translations/table-fr.d.ts +1 -1
  152. package/dist/components/translations/top-bar-en.d.ts +1 -1
  153. package/dist/components/translations/top-bar-fr.d.ts +1 -1
  154. package/dist/components/translations/treeview-finder-en.d.ts +1 -1
  155. package/dist/components/translations/treeview-finder-fr.d.ts +1 -1
  156. package/dist/hooks/localized-countries-hook.d.ts +10 -4
  157. package/dist/hooks/localized-countries-hook.js +1 -1
  158. package/dist/hooks/predefined-properties-hook.d.ts +1 -15
  159. package/dist/hooks/predefined-properties-hook.js +8 -16
  160. package/dist/index.d.ts +65 -217
  161. package/dist/index.js +104 -77
  162. package/dist/module-mui.d.js +1 -0
  163. package/dist/redux/actions.d.ts +33 -29
  164. package/dist/services/apps-metadata.d.ts +32 -0
  165. package/dist/services/apps-metadata.js +26 -0
  166. package/dist/services/directory.d.ts +6 -0
  167. package/dist/services/directory.js +42 -0
  168. package/dist/services/explore.d.ts +2 -0
  169. package/dist/services/explore.js +29 -1
  170. package/dist/services/index.d.ts +16 -0
  171. package/dist/services/index.js +20 -0
  172. package/dist/services/utils.d.ts +1 -0
  173. package/dist/services/utils.js +5 -1
  174. package/dist/utils/AuthService.d.ts +20 -9
  175. package/dist/utils/AuthService.js +29 -13
  176. package/dist/utils/ElementIcon.d.ts +4 -1
  177. package/dist/utils/EquipmentType.d.ts +13 -9
  178. package/dist/utils/EquipmentType.js +9 -9
  179. package/dist/utils/UserManagerMock.d.ts +14 -14
  180. package/dist/utils/UserManagerMock.js +9 -15
  181. package/dist/utils/algos.d.ts +1 -1
  182. package/dist/utils/equipment-types-for-predefined-properties-mapper.d.ts +1 -1
  183. package/dist/utils/functions.d.ts +0 -1
  184. package/dist/utils/functions.js +1 -3
  185. package/dist/utils/styles.d.ts +5 -3
  186. package/dist/utils/styles.js +4 -1
  187. package/dist/utils/types.d.ts +13 -3
  188. package/package.json +2 -1
  189. package/dist/components/filter/filter-context.d.ts +0 -13
  190. package/dist/components/filter/filter-context.js +0 -11
@@ -1,13 +1,6 @@
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 { jsx, jsxs } from "react/jsx-runtime";
8
2
  import { PureComponent, createRef } from "react";
9
3
  import { FormattedMessage } from "react-intl";
10
- import PropTypes from "prop-types";
11
4
  import clsx from "clsx";
12
5
  import memoize from "memoize-one";
13
6
  import { TableCell, IconButton, Popover, Autocomplete, TextField, Chip } from "@mui/material";
@@ -20,7 +13,11 @@ import { toNestedGlobalSelectors, makeComposeClasses } from "../../utils/styles.
20
13
  import { getHelper, collectibleHelper, CHANGE_WAYS, KeyedColumnsRowIndexer } from "./KeyedColumnsRowIndexer.js";
21
14
  import ColumnHeader from "./ColumnHeader.js";
22
15
  function getTextWidth(text) {
23
- let canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
16
+ let canvas = (
17
+ //@ts-ignore this is questioning
18
+ getTextWidth.canvas || //@ts-ignore this is questioning
19
+ (getTextWidth.canvas = document.createElement("canvas"))
20
+ );
24
21
  let context = canvas.getContext("2d");
25
22
  context.font = '14px "Roboto", "Helvetica", "Arial", sans-serif';
26
23
  let metrics = context.measureText(text);
@@ -82,7 +79,7 @@ const AmongChooser = (props) => {
82
79
  Autocomplete,
83
80
  {
84
81
  id,
85
- value: value ?? [],
82
+ value,
86
83
  multiple: true,
87
84
  onChange: (evt, newVal) => {
88
85
  setValue(newVal);
@@ -119,7 +116,7 @@ function makeIndexRecord(viewIndexToModel, rows) {
119
116
  }
120
117
  };
121
118
  }
122
- const initIndexer = (props, oldProps, versionSetter) => {
119
+ const initIndexer = (props, versionSetter) => {
123
120
  if (!props.sortable) {
124
121
  return null;
125
122
  }
@@ -176,22 +173,22 @@ const reorderIndex = memoize(
176
173
  return makeIndexRecord(reorderedIndex, rows);
177
174
  }
178
175
  if (filterFromProps) {
179
- const viewIndexToModel = rows.map((r, i) => [r, i]).filter(([r, idx]) => filterFromProps(r)).map(([r, j]) => j);
176
+ const viewIndexToModel = rows.map((r, i) => [r, i]).filter(([r, _]) => filterFromProps(r)).map(([_, j]) => j);
180
177
  return makeIndexRecord(viewIndexToModel, rows);
181
178
  }
182
179
  return makeIndexRecord(null, rows);
183
180
  }
184
181
  );
185
- class MuiVirtualizedTable extends PureComponent {
182
+ const _MuiVirtualizedTable = class _MuiVirtualizedTable extends PureComponent {
186
183
  constructor(props, context) {
187
184
  super(props, context);
188
- __publicField(this, "setVersion", (v) => {
185
+ this.setVersion = (v) => {
189
186
  this.setState({ indirectionVersion: v });
190
- });
191
- __publicField(this, "computeDataWidth", (text) => {
187
+ };
188
+ this.computeDataWidth = (text) => {
192
189
  return getTextWidth(text || "") + 2 * DEFAULT_CELL_PADDING;
193
- });
194
- __publicField(this, "sizes", memoize((columns, rows, rowGetter) => {
190
+ };
191
+ this.sizes = memoize((columns, rows, rowGetter) => {
195
192
  let sizes = {};
196
193
  columns.forEach((col) => {
197
194
  if (col.width) {
@@ -213,8 +210,8 @@ class MuiVirtualizedTable extends PureComponent {
213
210
  }
214
211
  });
215
212
  return sizes;
216
- }));
217
- __publicField(this, "openPopover", (popoverTarget, colKey) => {
213
+ });
214
+ this.openPopover = (popoverTarget, colKey) => {
218
215
  const col = this.props.columns.find((c) => c.dataKey === colKey);
219
216
  if (getHelper(col) !== collectibleHelper) {
220
217
  return;
@@ -224,18 +221,18 @@ class MuiVirtualizedTable extends PureComponent {
224
221
  popoverAnchorEl: popoverTarget,
225
222
  popoverColKey: colKey
226
223
  });
227
- });
228
- __publicField(this, "handleKeyDownOnPopover", (evt) => {
224
+ };
225
+ this.handleKeyDownOnPopover = (evt) => {
229
226
  if (evt.key === "Enter" && !this.dropDownVisible) {
230
227
  this.closePopover(evt, "enterKeyDown");
231
228
  }
232
- });
233
- __publicField(this, "closePopover", (evt, reason) => {
229
+ };
230
+ this.closePopover = (_, reason) => {
234
231
  let bumpsVersion = false;
235
232
  if (reason === "backdropClick" || reason === "enterKeyDown") {
236
233
  bumpsVersion = this._commitFilterChange();
237
234
  }
238
- this.setState((state, props) => {
235
+ this.setState((state, _2) => {
239
236
  return {
240
237
  popoverAnchorEl: null,
241
238
  popoverColKey: null,
@@ -243,12 +240,12 @@ class MuiVirtualizedTable extends PureComponent {
243
240
  indirectionVersion: state.indirectionVersion + (bumpsVersion ? 1 : 0)
244
241
  };
245
242
  });
246
- });
247
- __publicField(this, "makeColumnFilterEditor", () => {
248
- var _a;
243
+ };
244
+ this.makeColumnFilterEditor = () => {
245
+ var _a, _b, _c;
249
246
  const colKey = this.state.popoverColKey;
250
- const outerParams = this.state.indexer.getColFilterOuterParams(colKey);
251
- const userParams = !this.props.defersFilterChanges || !this.state.deferredFilterChange ? this.state.indexer.getColFilterUserParams(colKey) : this.state.deferredFilterChange.newVal;
247
+ const outerParams = (_a = this.state.indexer) == null ? void 0 : _a.getColFilterOuterParams(colKey);
248
+ const userParams = !this.props.defersFilterChanges || !this.state.deferredFilterChange ? (_b = this.state.indexer) == null ? void 0 : _b.getColFilterUserParams(colKey) : this.state.deferredFilterChange.newVal ?? void 0;
252
249
  const prefiltered = preFilterData(
253
250
  this.props.columns,
254
251
  this.props.rows,
@@ -256,48 +253,48 @@ class MuiVirtualizedTable extends PureComponent {
256
253
  this.state.indexer,
257
254
  this.state.indirectionVersion
258
255
  );
259
- let options = [];
256
+ let options2 = [];
260
257
  if (outerParams) {
261
- options.push(...outerParams);
258
+ options2.push(...outerParams);
262
259
  }
263
- const colStat = (_a = prefiltered == null ? void 0 : prefiltered.colsStats) == null ? void 0 : _a[colKey];
260
+ const colStat = (_c = prefiltered == null ? void 0 : prefiltered.colsStats) == null ? void 0 : _c[colKey];
264
261
  if (colStat == null ? void 0 : colStat.seen) {
265
262
  for (const key of Object.getOwnPropertyNames(colStat.seen)) {
266
- if (options.findIndex((o) => o === key) < 0) {
267
- options.push(key);
263
+ if (options2.findIndex((o) => o === key) < 0) {
264
+ options2.push(key);
268
265
  }
269
266
  }
270
267
  }
271
- options.sort();
272
- const col = this.props.columns.find((c) => c.dataKey === colKey);
268
+ options2.sort();
273
269
  return /* @__PURE__ */ jsx(
274
270
  AmongChooser,
275
271
  {
276
- options,
272
+ options: options2,
277
273
  value: userParams,
278
274
  id: "fielt" + colKey,
279
- label: (col == null ? void 0 : col.label) ?? "∈",
280
275
  setValue: (newVal) => {
281
276
  this.onFilterParamsChange(newVal, colKey);
282
277
  },
283
278
  onDropDownVisibility: (visible) => this.dropDownVisible = visible
284
279
  }
285
280
  );
286
- });
287
- __publicField(this, "_commitFilterChange", () => {
281
+ };
282
+ this._commitFilterChange = () => {
283
+ var _a;
288
284
  if (this.state.deferredFilterChange) {
289
285
  const colKey = this.state.deferredFilterChange.colKey;
290
286
  let newVal = this.state.deferredFilterChange.newVal;
291
287
  if ((newVal == null ? void 0 : newVal.length) === 0) {
292
288
  newVal = null;
293
289
  }
294
- if (this.state.indexer.setColFilterUserParams(colKey, newVal)) {
290
+ if ((_a = this.state.indexer) == null ? void 0 : _a.setColFilterUserParams(colKey, newVal)) {
295
291
  return true;
296
292
  }
297
293
  }
298
294
  return false;
299
- });
300
- __publicField(this, "sortClickHandler", (evt, name, columnIndex) => {
295
+ };
296
+ this.sortClickHandler = (evt, _, columnIndex) => {
297
+ var _a;
301
298
  const colKey = this.props.columns[columnIndex].dataKey;
302
299
  if (evt.altKey) {
303
300
  this.openPopover(evt.target, colKey);
@@ -311,31 +308,34 @@ class MuiVirtualizedTable extends PureComponent {
311
308
  } else if (evt.shiftKey) {
312
309
  way = CHANGE_WAYS.TAIL;
313
310
  }
314
- if (this.state.indexer.updateSortingFromUser(colKey, way)) {
311
+ if ((_a = this.state.indexer) == null ? void 0 : _a.updateSortingFromUser(colKey, way)) {
315
312
  this.setState({
316
313
  indirectionVersion: this.state.indirectionVersion + 1
317
314
  });
318
315
  }
319
- });
320
- __publicField(this, "filterClickHandler", (evt, target, columnIndex) => {
321
- const retargeted = target.parentNode ?? target;
316
+ };
317
+ this.filterClickHandler = (_, target, columnIndex) => {
318
+ const retargeted = (target == null ? void 0 : target.parentNode) ?? target;
322
319
  const colKey = this.props.columns[columnIndex].dataKey;
323
320
  this.openPopover(retargeted, colKey);
324
- });
325
- __publicField(this, "sortableHeader", ({ label, columnIndex }) => {
321
+ };
322
+ this.sortableHeader = ({
323
+ label,
324
+ columnIndex
325
+ }) => {
326
326
  var _a;
327
327
  const { columns } = this.props;
328
328
  const indexer = this.state.indexer;
329
329
  const colKey = columns[columnIndex].dataKey;
330
- const signedRank = indexer.columnSortingSignedRank(colKey);
331
- const userParams = indexer.getColFilterUserParams(colKey);
330
+ const signedRank = indexer == null ? void 0 : indexer.columnSortingSignedRank(colKey);
331
+ const userParams = indexer == null ? void 0 : indexer.getColFilterUserParams(colKey);
332
332
  const numeric = columns[columnIndex].numeric;
333
333
  const prefiltered = preFilterData(
334
334
  columns,
335
335
  this.props.rows,
336
336
  this.props.filter,
337
337
  indexer,
338
- indexer.filterVersion
338
+ indexer == null ? void 0 : indexer.filterVersion
339
339
  );
340
340
  const colStat = (_a = prefiltered == null ? void 0 : prefiltered.colsStats) == null ? void 0 : _a[colKey];
341
341
  let filterLevel = 0;
@@ -357,15 +357,15 @@ class MuiVirtualizedTable extends PureComponent {
357
357
  ref: (e) => this._registerHeader(label, e),
358
358
  sortSignedRank: signedRank,
359
359
  filterLevel,
360
- numeric,
360
+ numeric: numeric ?? false,
361
361
  onSortClick: (ev, name) => {
362
362
  this.sortClickHandler(ev, name, columnIndex);
363
363
  },
364
364
  onFilterClick
365
365
  }
366
366
  );
367
- });
368
- __publicField(this, "simpleHeaderRenderer", ({ label }) => {
367
+ };
368
+ this.simpleHeaderRenderer = ({ label }) => {
369
369
  return /* @__PURE__ */ jsx(
370
370
  "div",
371
371
  {
@@ -375,8 +375,11 @@ class MuiVirtualizedTable extends PureComponent {
375
375
  children: label
376
376
  }
377
377
  );
378
- });
379
- __publicField(this, "getRowClassName", ({ index, rowGetter }) => {
378
+ };
379
+ this.getRowClassName = ({
380
+ index,
381
+ rowGetter
382
+ }) => {
380
383
  var _a;
381
384
  const { classes, onRowClick } = this.props;
382
385
  return clsx(
@@ -390,14 +393,14 @@ class MuiVirtualizedTable extends PureComponent {
390
393
  [composeClasses(classes, cssTableRowHover)]: index !== -1 && onRowClick != null
391
394
  }
392
395
  );
393
- });
394
- __publicField(this, "onClickableRowClick", (event) => {
396
+ };
397
+ this.onClickableRowClick = (event) => {
395
398
  var _a, _b, _c;
396
399
  if (((_a = event.rowData) == null ? void 0 : _a.notClickable) !== true || ((_b = event.event) == null ? void 0 : _b.shiftKey) || ((_c = event.event) == null ? void 0 : _c.ctrlKey)) {
397
400
  this.props.onRowClick(event);
398
401
  }
399
- });
400
- __publicField(this, "cellRenderer", ({ cellData, columnIndex, rowIndex }) => {
402
+ };
403
+ this.cellRenderer = ({ cellData, columnIndex, rowIndex }) => {
401
404
  var _a, _b;
402
405
  const { columns, classes, rowHeight, onCellClick, rows, tooltipSx } = this.props;
403
406
  let displayedValue = this.getDisplayValue(
@@ -435,8 +438,8 @@ class MuiVirtualizedTable extends PureComponent {
435
438
  )
436
439
  }
437
440
  );
438
- });
439
- __publicField(this, "makeSizedTable", (height, width, sizes, reorderedIndex, rowGetter) => {
441
+ };
442
+ this.makeSizedTable = (height, width, sizes, reorderedIndex, rowGetter) => {
440
443
  const { sort, ...otherProps } = this.props;
441
444
  return /* @__PURE__ */ jsx(
442
445
  Table,
@@ -476,8 +479,8 @@ class MuiVirtualizedTable extends PureComponent {
476
479
  })
477
480
  }
478
481
  );
479
- });
480
- __publicField(this, "getCSVFilename", () => {
482
+ };
483
+ this.getCSVFilename = () => {
481
484
  var _a;
482
485
  if (((_a = this.props.name) == null ? void 0 : _a.length) > 0) {
483
486
  return this.props.name.replace(/\s/g, "_");
@@ -485,8 +488,8 @@ class MuiVirtualizedTable extends PureComponent {
485
488
  let filename = Object.entries(this.props.columns).map((p) => p[1].label).join("_");
486
489
  return filename;
487
490
  }
488
- });
489
- __publicField(this, "getCSVData", () => {
491
+ };
492
+ this.getCSVData = () => {
490
493
  var _a;
491
494
  let reorderedIndex = reorderIndex(
492
495
  this.state.indexer,
@@ -510,8 +513,8 @@ class MuiVirtualizedTable extends PureComponent {
510
513
  csvData.push(myobj);
511
514
  }
512
515
  return Promise.resolve(csvData);
513
- });
514
- __publicField(this, "csvHeaders", memoize((columns, exportCSVDataKeys) => {
516
+ };
517
+ this.csvHeaders = memoize((columns, exportCSVDataKeys) => {
515
518
  let tempHeaders = [];
516
519
  columns.forEach((col) => {
517
520
  if (exportCSVDataKeys !== void 0 && exportCSVDataKeys.find((el) => el === col.dataKey)) {
@@ -522,7 +525,7 @@ class MuiVirtualizedTable extends PureComponent {
522
525
  }
523
526
  });
524
527
  return tempHeaders;
525
- }));
528
+ });
526
529
  this._computeHeaderSize = this._computeHeaderSize.bind(this);
527
530
  this._registerHeader = this._registerHeader.bind(this);
528
531
  this._registerObserver = this._registerObserver.bind(this);
@@ -537,9 +540,10 @@ class MuiVirtualizedTable extends PureComponent {
537
540
  this._computeHeaderSize,
538
541
  options
539
542
  );
543
+ this.dropDownVisible = false;
540
544
  this.state = {
541
545
  headerHeight: this.props.headerHeight,
542
- indexer: initIndexer(props, null, this.setVersion),
546
+ indexer: initIndexer(props, this.setVersion),
543
547
  indirectionVersion: 0,
544
548
  popoverAnchorEl: null,
545
549
  popoverColKey: null,
@@ -550,7 +554,7 @@ class MuiVirtualizedTable extends PureComponent {
550
554
  if (oldProps.indexer !== this.props.indexer || oldProps.sortable !== this.props.sortable) {
551
555
  this.setState((state) => {
552
556
  return {
553
- indexer: initIndexer(this.props, oldProps, this.setVersion),
557
+ indexer: initIndexer(this.props, this.setVersion),
554
558
  indirectionVersion: ((state == null ? void 0 : state.indirectionVersion) ?? 0) + 1
555
559
  };
556
560
  });
@@ -567,7 +571,7 @@ class MuiVirtualizedTable extends PureComponent {
567
571
  this.observer.disconnect();
568
572
  }
569
573
  _registerHeader(label, header) {
570
- if (header !== null) {
574
+ if (this.headers.current) {
571
575
  this.headers.current[label] = header;
572
576
  }
573
577
  }
@@ -577,17 +581,19 @@ class MuiVirtualizedTable extends PureComponent {
577
581
  }
578
582
  }
579
583
  onFilterParamsChange(newVal, colKey) {
580
- const nonEmpty = newVal.length === 0 ? null : newVal;
584
+ var _a;
585
+ const nonEmpty = (newVal == null ? void 0 : newVal.length) === 0 ? null : newVal;
581
586
  if (this.props.defersFilterChanges) {
582
587
  this.setState({
583
588
  deferredFilterChange: { newVal, colKey }
584
589
  });
585
- } else if (this.state.indexer.setColFilterUserParams(colKey, nonEmpty)) {
590
+ } else if ((_a = this.state.indexer) == null ? void 0 : _a.setColFilterUserParams(colKey, nonEmpty)) {
586
591
  this.setState({
587
592
  indirectionVersion: this.state.indirectionVersion + 1
588
593
  });
589
594
  }
590
595
  }
596
+ // type check should be increased here
591
597
  getDisplayValue(column, cellData) {
592
598
  let displayedValue;
593
599
  if (!column.numeric) {
@@ -740,42 +746,14 @@ class MuiVirtualizedTable extends PureComponent {
740
746
  }
741
747
  );
742
748
  }
743
- }
744
- __publicField(MuiVirtualizedTable, "defaultProps", {
749
+ };
750
+ _MuiVirtualizedTable.defaultProps = {
745
751
  headerHeight: DEFAULT_HEADER_HEIGHT,
746
752
  rowHeight: DEFAULT_ROW_HEIGHT,
747
753
  enableExportCSV: false,
748
754
  classes: {}
749
- });
750
- MuiVirtualizedTable.propTypes = {
751
- name: PropTypes.string,
752
- classes: PropTypes.object,
753
- rows: PropTypes.array,
754
- columns: PropTypes.arrayOf(
755
- PropTypes.shape({
756
- dataKey: PropTypes.string.isRequired,
757
- label: PropTypes.string.isRequired,
758
- numeric: PropTypes.bool,
759
- width: PropTypes.number,
760
- minWidth: PropTypes.number,
761
- maxWidth: PropTypes.number,
762
- unit: PropTypes.string,
763
- fractionDigits: PropTypes.number,
764
- extra: PropTypes.element
765
- })
766
- ).isRequired,
767
- enableExportCSV: PropTypes.bool,
768
- exportCSVDataKeys: PropTypes.array,
769
- sort: PropTypes.func,
770
- sortable: PropTypes.bool,
771
- indexer: PropTypes.object,
772
- headerHeight: PropTypes.number,
773
- onRowClick: PropTypes.func,
774
- onCellClick: PropTypes.func,
775
- rowHeight: PropTypes.number,
776
- filter: PropTypes.func,
777
- tooltipSx: PropTypes.object
778
755
  };
756
+ let MuiVirtualizedTable = _MuiVirtualizedTable;
779
757
  const nestedGlobalSelectorsStyles = toNestedGlobalSelectors(
780
758
  defaultStyles,
781
759
  generateMuiVirtualizedTableClass
@@ -1,2 +1,8 @@
1
- export { default, generateMuiVirtualizedTableClass } from './MuiVirtualizedTable';
1
+ /**
2
+ * Copyright (c) 2021, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ export { default, generateMuiVirtualizedTableClass, } from './MuiVirtualizedTable';
2
8
  export { KeyedColumnsRowIndexer, CHANGE_WAYS } from './KeyedColumnsRowIndexer';
@@ -1,10 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2023, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ export interface MultipleSelectionDialogProps {
8
+ options: string[];
9
+ selectedOptions: string[];
10
+ open: boolean;
11
+ getOptionLabel: (option: string) => string;
12
+ handleClose: () => void;
13
+ handleValidate: (ids: string[]) => void;
14
+ titleId: string;
15
+ }
16
+ declare const MultipleSelectionDialog: ({ options, selectedOptions, open, getOptionLabel, handleClose, handleValidate, titleId, }: MultipleSelectionDialogProps) => import("react/jsx-runtime").JSX.Element;
1
17
  export default MultipleSelectionDialog;
2
- declare function MultipleSelectionDialog({ options, selectedOptions, open, getOptionLabel, handleClose, handleValidate, titleId, }: {
3
- options: any;
4
- selectedOptions: any;
5
- open: any;
6
- getOptionLabel: any;
7
- handleClose: any;
8
- handleValidate: any;
9
- titleId: any;
10
- }): import("react/jsx-runtime").JSX.Element;
@@ -50,7 +50,7 @@ const MultipleSelectionDialog = ({
50
50
  }
51
51
  ) }),
52
52
  /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(List, { children: options.map((option) => {
53
- const optionId = (option == null ? void 0 : option.id) ?? option;
53
+ const optionId = option;
54
54
  const label = getOptionLabel(option);
55
55
  return /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
56
56
  FormControlLabel,
@@ -1 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2023, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
1
7
  export { default } from './MultipleSelectionDialog';
@@ -1 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2021, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
1
7
  export { default } from './overflowable-text';
@@ -1,2 +1,12 @@
1
- export const OverflowableText: import('@emotion/styled').StyledComponent<any, {}, {}>;
1
+ import { Style } from 'node:util';
2
+ import { BoxProps, SxProps } from '@mui/material';
3
+ import { ReactElement } from 'react';
4
+
5
+ export interface OverflowableTextProps extends BoxProps {
6
+ text?: ReactElement | string;
7
+ maxLineCount?: number;
8
+ tooltipStyle?: Style;
9
+ tooltipSx?: SxProps;
10
+ }
11
+ export declare const OverflowableText: import('@emotion/styled').StyledComponent<OverflowableTextProps & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {}>;
2
12
  export default OverflowableText;
@@ -1,7 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useRef, useMemo, useState, useCallback, useLayoutEffect } from "react";
3
3
  import { Tooltip, Box } from "@mui/material";
4
- import PropTypes from "prop-types";
5
4
  import { styled } from "@mui/system";
6
5
  const overflowStyle = {
7
6
  overflow: {
@@ -29,7 +28,7 @@ const OverflowableText = styled(
29
28
  ({
30
29
  text,
31
30
  maxLineCount,
32
- // overflowable text can be displayed on several lines if this is set to a number > 1
31
+ // overflowable text can be displayed on several lines if this is set to a number > 1 tooltipStyle,
33
32
  tooltipStyle,
34
33
  tooltipSx,
35
34
  className,
@@ -95,22 +94,6 @@ const OverflowableText = styled(
95
94
  );
96
95
  }
97
96
  )({});
98
- OverflowableText.propTypes = {
99
- children: PropTypes.array,
100
- text: PropTypes.oneOfType([
101
- PropTypes.string,
102
- PropTypes.number,
103
- PropTypes.node
104
- ]),
105
- tooltipStyle: PropTypes.string,
106
- tooltipSx: PropTypes.object,
107
- sx: PropTypes.oneOfType([
108
- PropTypes.object,
109
- PropTypes.array,
110
- PropTypes.func
111
- ]),
112
- className: PropTypes.string
113
- };
114
97
  export {
115
98
  OverflowableText,
116
99
  OverflowableText as default
@@ -1 +1,11 @@
1
- export function FilterButton({ selectedItems, setSelectedItems }: Object): import("react/jsx-runtime").JSX.Element;
1
+ export interface FilterButtonProps {
2
+ selectedItems: Record<string, boolean>;
3
+ setSelectedItems: (func: (items: Record<string, boolean>) => Record<string, boolean>) => void;
4
+ }
5
+ /**
6
+ * FilterButton wraps a MultiSelectList with a button which has a visual indication to indicate when the user alters the default state of the list
7
+ *
8
+ * @param {Object} selectedItems - It serves as the model and data of the Component each entry must be formatted as a pair of string and boolean. Each key will be displayed and the corresponding boolean is updated in function of its checkbox status
9
+ * @param {Function} setSelectedItems - Setter needed to update the list underlying data
10
+ */
11
+ export declare const FilterButton: ({ selectedItems, setSelectedItems, }: FilterButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -21,9 +21,12 @@ const styles = {
21
21
  height: "0.7em"
22
22
  }
23
23
  };
24
- const FilterButton = ({ selectedItems, setSelectedItems }) => {
24
+ const FilterButton = ({
25
+ selectedItems,
26
+ setSelectedItems
27
+ }) => {
25
28
  const [initialState] = useState(selectedItems);
26
- const [anchorEl, setAnchorEl] = useState();
29
+ const [anchorEl, setAnchorEl] = useState(null);
27
30
  const handleClick = (event) => {
28
31
  setAnchorEl(event.currentTarget);
29
32
  };
@@ -1 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2021, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
1
7
  export { default } from './report-viewer';
@@ -1,68 +1,18 @@
1
- /**
2
- * Copyright (c) 2021, RTE (http://www.rte-france.com)
3
- * This Source Code Form is subject to the terms of the Mozilla Public
4
- * License, v. 2.0. If a copy of the MPL was not distributed with this
5
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
- */
1
+ import { LogSeverity } from './log-severity';
2
+ import { ReportValue, SubReport } from './report.type';
3
+
7
4
  export default class LogReportItem {
8
- static SEVERITY: {
9
- UNKNOWN: {
10
- name: string;
11
- level: number;
12
- colorName: string;
13
- colorHexCode: string;
14
- };
15
- INFO: {
16
- name: string;
17
- level: number;
18
- colorName: string;
19
- colorHexCode: string;
20
- };
21
- WARN: {
22
- name: string;
23
- level: number;
24
- colorName: string;
25
- colorHexCode: string;
26
- };
27
- ERROR: {
28
- name: string;
29
- level: number;
30
- colorName: string;
31
- colorHexCode: string;
32
- };
33
- FATAL: {
34
- name: string;
35
- level: number;
36
- colorName: string;
37
- colorHexCode: string;
38
- };
39
- };
40
- static resolveTemplateMessage(templateMessage: any, templateValues: any): any;
41
- constructor(jsonReport: any, reportId: any);
42
- key: any;
43
- log: any;
44
- reportId: any;
45
- severity: {
46
- name: string;
47
- level: number;
48
- colorName: string;
49
- colorHexCode: string;
50
- };
51
- getLog(): any;
52
- getReportId(): any;
53
- getSeverity(): {
54
- name: string;
55
- level: number;
56
- colorName: string;
57
- colorHexCode: string;
58
- };
59
- getSeverityName(): string;
5
+ key: string;
6
+ reportId: string;
7
+ severity: LogSeverity;
8
+ log: string;
9
+ static resolveTemplateMessage(templateMessage: string, templateValues: Record<string, ReportValue>): string;
10
+ constructor(jsonReport: SubReport, reportId: string);
11
+ getLog(): string;
12
+ getReportId(): string;
13
+ getSeverity(): LogSeverity;
14
+ getSeverityName(): "UNKNOWN" | "INFO" | "WARN" | "ERROR" | "FATAL";
60
15
  getColorName(): string;
61
16
  getColorHexCode(): string;
62
- initSeverity(jsonSeverity: any): {
63
- name: string;
64
- level: number;
65
- colorName: string;
66
- colorHexCode: string;
67
- };
17
+ initSeverity(jsonSeverity: ReportValue): LogSeverity;
68
18
  }