@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,6 +1,6 @@
1
1
  import '../assets/criteria-based-filter-edition-dialog.css';
2
2
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
- import React, { useState, useMemo, useEffect, useCallback, useContext } from "react";
3
+ import React, { useState, useMemo, useEffect, useCallback } from "react";
4
4
  import { FieldConstants } from "../utils/field-constants.js";
5
5
  import { backToFrontTweak, frontToBackTweak } from "../components/filter/criteria-based/criteria-based-filter-utils.js";
6
6
  import CustomMuiDialog from "../components/dialogs/custom-mui-dialog.js";
@@ -30,9 +30,8 @@ import CsvDownloader from "react-csv-downloader";
30
30
  import Alert from "@mui/material/Alert";
31
31
  import "../components/TreeViewFinder/TreeViewFinder.js";
32
32
  import "../components/TopBar/TopBar.js";
33
- import "../components/TopBar/GridLogo.js";
34
- import "../components/TopBar/AboutDialog.js";
35
- import "../components/SnackbarProvider/SnackbarProvider.js";
33
+ import "@mui/lab";
34
+ import "notistack";
36
35
  import "react-router-dom";
37
36
  import "../utils/AuthService.js";
38
37
  import "../components/MuiVirtualizedTable/MuiVirtualizedTable.js";
@@ -42,24 +41,18 @@ import "../components/ReportViewer/log-table.js";
42
41
  import "../components/ReportViewer/report-tree-view-context.js";
43
42
  import "@mui/x-tree-view";
44
43
  import "../components/OverflowableText/overflowable-text.js";
45
- import "../components/ElementSearchDialog/tag-renderer.js";
44
+ import "clsx";
46
45
  import "../components/inputs/react-hook-form/utils/submit-button.js";
47
46
  import CancelButton from "../components/inputs/react-hook-form/utils/cancel-button.js";
48
47
  import "../components/inputs/react-hook-form/provider/custom-form-provider.js";
49
48
  import "../components/dialogs/description-modification-dialog.js";
50
- import { FilterContext } from "../components/filter/filter-context.js";
51
- import "notistack";
52
49
  import * as yup from "yup";
53
50
  import "../components/dialogs/popup-confirmation-dialog.js";
54
51
  import "autosuggest-highlight/match";
55
52
  import "autosuggest-highlight/parse";
56
- import "clsx";
57
53
  import "../components/CardErrorBoundary/card-error-boundary.js";
58
- import "../components/inputs/react-hook-form/slider-input.js";
59
- import "../components/inputs/react-hook-form/numbers/integer-input.js";
60
- import "../components/inputs/react-hook-form/booleans/checkbox-input.js";
61
- import "../components/inputs/react-hook-form/booleans/switch-input.js";
62
54
  import "@mui/icons-material/Folder";
55
+ import "../components/CustomAGGrid/custom-aggrid.js";
63
56
  import { saveExplicitNamingFilter, saveCriteriaBasedFilter, saveExpertFilter } from "../components/filter/utils/filter-api.js";
64
57
  import { formatQuery, QueryBuilder } from "react-querybuilder";
65
58
  import { getNumberOfSiblings, recursiveRemove, countRules, getOperators, queryValidator, testQuery, importExpertRules } from "../components/filter/expert/expert-filter-utils.js";
@@ -76,12 +69,12 @@ import TranslatedValueEditor from "../components/inputs/react-query-builder/tran
76
69
  import TextValueEditor from "../components/inputs/react-query-builder/text-value-editor.js";
77
70
  import Box from "@mui/material/Box";
78
71
  import { Generator, Load, VoltageLevel, Substation, noSelectionForCopy as noSelectionForCopy$1 } from "../utils/equipment-types.js";
72
+ import { fetchElementsInfos, saveFilter } from "../services/explore.js";
79
73
  import { useCustomFormContext } from "../components/inputs/react-hook-form/provider/use-custom-form-context.js";
80
74
  import DirectoryItemsInput from "../components/inputs/react-hook-form/directory-items-input.js";
81
75
  import { DISTRIBUTION_KEY, FilterType } from "../components/filter/constants/filter-constants.js";
82
76
  import { FetchStatus } from "../utils/FetchStatus.js";
83
77
  import PropTypes from "prop-types";
84
- import { saveFilter } from "../services/explore.js";
85
78
  import "./filter-properties.B7-q_yPf.js";
86
79
  import "../components/inputs/react-hook-form/range-input.js";
87
80
  import "../components/inputs/react-hook-form/select-inputs/mui-select-input.js";
@@ -833,10 +826,9 @@ const RemoveButton = (props) => {
833
826
  };
834
827
  const ElementValueEditor = (props) => {
835
828
  const { setValue } = useCustomFormContext();
836
- const { fetchElementsInfos } = useContext(FilterContext);
837
829
  useEffect(() => {
838
830
  if (props.defaultValue && Array.isArray(props.defaultValue) && props.defaultValue.length > 0 && props.defaultValue[0].length > 0 && validate(props.defaultValue[0])) {
839
- fetchElementsInfos && fetchElementsInfos(props.defaultValue).then(
831
+ fetchElementsInfos(props.defaultValue).then(
840
832
  (childrenWithMetadata) => {
841
833
  setValue(
842
834
  props.name,
@@ -851,13 +843,7 @@ const ElementValueEditor = (props) => {
851
843
  }
852
844
  );
853
845
  }
854
- }, [
855
- props.name,
856
- props.defaultValue,
857
- props.elementType,
858
- setValue,
859
- fetchElementsInfos
860
- ]);
846
+ }, [props.name, props.defaultValue, props.elementType, setValue]);
861
847
  return /* @__PURE__ */ jsx(
862
848
  DirectoryItemsInput,
863
849
  {
@@ -935,10 +921,12 @@ const ValueEditor = (props) => {
935
921
  );
936
922
  } else if (props.field === FieldType.ID || props.field === FieldType.NAME || props.field === FieldType.VOLTAGE_LEVEL_ID || props.field === FieldType.VOLTAGE_LEVEL_ID_1 || props.field === FieldType.VOLTAGE_LEVEL_ID_2) {
937
923
  return /* @__PURE__ */ jsx(TextValueEditor, { ...props });
938
- } else if (props.field === FieldType.PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY_1 || props.field === FieldType.SUBSTATION_PROPERTY_2) {
924
+ } else if (props.field === FieldType.PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY_1 || props.field === FieldType.SUBSTATION_PROPERTY_2 || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_1 || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_2) {
939
925
  let equipmentType;
940
926
  if (props.field === FieldType.SUBSTATION_PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY_1 || props.field === FieldType.SUBSTATION_PROPERTY_2) {
941
927
  equipmentType = Substation.type;
928
+ } else if (props.field === FieldType.VOLTAGE_LEVEL_PROPERTY || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_1 || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_2) {
929
+ equipmentType = VoltageLevel.type;
942
930
  } else {
943
931
  equipmentType = getValues(FieldConstants.EQUIPMENT_TYPE);
944
932
  }
@@ -1218,13 +1206,8 @@ const FilterCreationDialog = ({
1218
1206
  open,
1219
1207
  onClose,
1220
1208
  activeDirectory,
1221
- fetchAppsAndUrls,
1222
1209
  elementExists,
1223
1210
  language,
1224
- fetchDirectoryContent,
1225
- fetchRootFolders,
1226
- fetchElementsInfos,
1227
- fetchPath,
1228
1211
  sourceFilterForExplicitNamingConversion = void 0
1229
1212
  }) => {
1230
1213
  var _a;
@@ -1300,24 +1283,12 @@ const FilterCreationDialog = ({
1300
1283
  disabledSave: !!nameError || !!isValidating,
1301
1284
  language,
1302
1285
  children: /* @__PURE__ */ jsx(
1303
- FilterContext.Provider,
1286
+ FilterForm,
1304
1287
  {
1305
- value: {
1306
- fetchDirectoryContent,
1307
- fetchRootFolders,
1308
- fetchElementsInfos,
1309
- fetchAppsAndUrls,
1310
- fetchPath
1311
- },
1312
- children: /* @__PURE__ */ jsx(
1313
- FilterForm,
1314
- {
1315
- creation: true,
1316
- activeDirectory,
1317
- elementExists,
1318
- sourceFilterForExplicitNamingConversion
1319
- }
1320
- )
1288
+ creation: true,
1289
+ activeDirectory,
1290
+ elementExists,
1291
+ sourceFilterForExplicitNamingConversion
1321
1292
  }
1322
1293
  )
1323
1294
  }
@@ -1341,11 +1312,7 @@ const ExpertFilterEditionDialog = ({
1341
1312
  setSelectionForCopy,
1342
1313
  activeDirectory,
1343
1314
  elementExists,
1344
- language,
1345
- fetchDirectoryContent,
1346
- fetchRootFolders,
1347
- fetchElementsInfos,
1348
- fetchAppsAndUrls
1315
+ language
1349
1316
  }) => {
1350
1317
  var _a;
1351
1318
  const { snackError } = useSnackMessage();
@@ -1429,22 +1396,11 @@ const ExpertFilterEditionDialog = ({
1429
1396
  disabledSave: !!nameError || !!isValidating,
1430
1397
  isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
1431
1398
  language,
1432
- children: /* @__PURE__ */ jsx(
1433
- FilterContext.Provider,
1399
+ children: isDataReady && /* @__PURE__ */ jsx(
1400
+ FilterForm,
1434
1401
  {
1435
- value: {
1436
- fetchDirectoryContent,
1437
- fetchRootFolders,
1438
- fetchElementsInfos,
1439
- fetchAppsAndUrls
1440
- },
1441
- children: isDataReady && /* @__PURE__ */ jsx(
1442
- FilterForm,
1443
- {
1444
- activeDirectory,
1445
- elementExists
1446
- }
1447
- )
1402
+ activeDirectory,
1403
+ elementExists
1448
1404
  }
1449
1405
  )
1450
1406
  }
@@ -1,10 +1,29 @@
1
+ import { UserManager } from 'oidc-client';
2
+ import { Dispatch } from 'react';
3
+
4
+ export interface AuthenticationRouterProps {
5
+ userManager: {
6
+ instance: UserManager;
7
+ error: string;
8
+ };
9
+ signInCallbackError: {
10
+ message: string;
11
+ };
12
+ authenticationRouterError: {
13
+ userName: string;
14
+ userValidationError?: {
15
+ error: Error;
16
+ };
17
+ logoutError?: {
18
+ error: Error;
19
+ };
20
+ unauthorizedUserInfo?: string;
21
+ error: string;
22
+ };
23
+ showAuthenticationRouterLogin: boolean;
24
+ dispatch: Dispatch<unknown>;
25
+ navigate: () => void;
26
+ location: Location;
27
+ }
28
+ declare const AuthenticationRouter: ({ userManager, signInCallbackError, authenticationRouterError, showAuthenticationRouterLogin, dispatch, navigate, location, }: AuthenticationRouterProps) => import("react/jsx-runtime").JSX.Element;
1
29
  export default AuthenticationRouter;
2
- declare function AuthenticationRouter({ userManager, signInCallbackError, authenticationRouterError, showAuthenticationRouterLogin, dispatch, navigate, location, }: {
3
- userManager: any;
4
- signInCallbackError: any;
5
- authenticationRouterError: any;
6
- showAuthenticationRouterLogin: any;
7
- dispatch: any;
8
- navigate: any;
9
- location: any;
10
- }): import("react/jsx-runtime").JSX.Element;
@@ -88,7 +88,7 @@ const AuthenticationRouter = ({
88
88
  Logout,
89
89
  {
90
90
  disabled: userManager.instance === null,
91
- onLogoutClick: () => logout(location, userManager.instance)
91
+ onLogoutClick: () => logout(dispatch, userManager.instance)
92
92
  }
93
93
  ) }),
94
94
  /* @__PURE__ */ jsxs(Grid, { item: true, xs: 4, children: [
@@ -1 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2020, 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 './AuthenticationRouter';
@@ -1,18 +1,32 @@
1
- import { Component } from 'react';
2
- export default CardErrorBoundary;
3
- declare class CardErrorBoundary extends Component<any, any, any> {
4
- static getDerivedStateFromError(error: any): {
5
- hasError: boolean;
6
- error: any;
7
- };
8
- constructor(props: any);
9
- state: {
1
+ import { Component, ErrorInfo, ReactNode } from 'react';
2
+ import { IconButtonProps } from '@mui/material';
3
+
4
+ export interface ExpandMoreProps extends IconButtonProps {
5
+ expand: boolean;
6
+ }
7
+ interface Props {
8
+ children?: ReactNode;
9
+ }
10
+ type CardErrorBoundaryStateError = {
11
+ hasError: true;
12
+ error: Error;
13
+ };
14
+ type CardErrorBoundaryStateSuccess = {
15
+ hasError: false;
16
+ };
17
+ type CardErrorBoundaryState = (CardErrorBoundaryStateError | CardErrorBoundaryStateSuccess) & {
18
+ expanded: boolean;
19
+ };
20
+ declare class CardErrorBoundary extends Component<Props, CardErrorBoundaryState> {
21
+ state: CardErrorBoundaryState;
22
+ constructor(props: Props);
23
+ static getDerivedStateFromError(error: Error): {
10
24
  hasError: boolean;
11
- expanded: boolean;
12
- error: undefined;
25
+ error: Error;
13
26
  };
27
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
14
28
  handleExpandClick(): void;
15
29
  handleReloadClick(): void;
16
- componentDidCatch(error: any, errorInfo: any): void;
17
- render(): any;
30
+ render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
18
31
  }
32
+ export default CardErrorBoundary;
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Component } from "react";
3
- import { styled, IconButton, Box, Card, CardHeader, CardContent, Typography, CardActions, Collapse } from "@mui/material";
4
2
  import { Replay, ExpandMore as ExpandMore$1 } from "@mui/icons-material";
3
+ import { styled, IconButton, Box, Card, CardHeader, CardContent, Typography, CardActions, Collapse } from "@mui/material";
4
+ import { Component } from "react";
5
5
  import { FormattedMessage } from "react-intl";
6
6
  const ExpandMore = styled((props) => {
7
7
  const { expand, ...other } = props;
@@ -18,8 +18,7 @@ class CardErrorBoundary extends Component {
18
18
  super(props);
19
19
  this.state = {
20
20
  hasError: false,
21
- expanded: false,
22
- error: void 0
21
+ expanded: false
23
22
  };
24
23
  this.handleExpandClick = this.handleExpandClick.bind(this);
25
24
  this.handleReloadClick = this.handleReloadClick.bind(this);
@@ -31,10 +30,12 @@ class CardErrorBoundary extends Component {
31
30
  console.error("CardErrorBoundary caught: ", error, errorInfo);
32
31
  }
33
32
  handleExpandClick() {
34
- this.setState((state) => ({ expanded: !state.expanded }));
33
+ this.setState((state) => ({
34
+ expanded: !state.expanded
35
+ }));
35
36
  }
36
37
  handleReloadClick() {
37
- this.setState((state) => ({
38
+ this.setState((_) => ({
38
39
  hasError: false,
39
40
  expanded: false,
40
41
  error: void 0
@@ -1 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2022, 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 './card-error-boundary';
@@ -0,0 +1,11 @@
1
+ import { AgGridReact, AgGridReactProps } from 'ag-grid-react';
2
+ import { default as React } from 'react';
3
+
4
+ interface CustomAGGGridStyleProps {
5
+ shouldHidePinnedHeaderRightBorder?: boolean;
6
+ showOverlay?: boolean;
7
+ }
8
+ interface CustomAGGridProps extends AgGridReactProps, CustomAGGGridStyleProps {
9
+ }
10
+ declare const CustomAGGrid: React.ForwardRefExoticComponent<CustomAGGridProps & React.RefAttributes<AgGridReact<any>>>;
11
+ export default CustomAGGrid;
@@ -0,0 +1,73 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React, { useCallback } from "react";
3
+ import { AgGridReact } from "ag-grid-react";
4
+ import { useIntl } from "react-intl";
5
+ import "ag-grid-community/styles/ag-grid.css";
6
+ import "ag-grid-community/styles/ag-theme-alpine.css";
7
+ import { Box } from "@mui/system";
8
+ import { mergeSx } from "../../utils/styles.js";
9
+ import { useTheme } from "@mui/material";
10
+ import { CUSTOM_AGGRID_THEME, styles } from "./custom-aggrid.style.js";
11
+ const onColumnResized = (params) => {
12
+ var _a;
13
+ const { column, finished } = params;
14
+ const colDefinedMinWidth = (_a = column == null ? void 0 : column.getColDef()) == null ? void 0 : _a.minWidth;
15
+ if (column && colDefinedMinWidth && finished) {
16
+ const newWidth = column == null ? void 0 : column.getActualWidth();
17
+ if (newWidth < colDefinedMinWidth) {
18
+ column == null ? void 0 : column.setActualWidth(colDefinedMinWidth, params.source);
19
+ }
20
+ }
21
+ };
22
+ const CustomAGGrid = React.forwardRef(
23
+ (props, ref) => {
24
+ const {
25
+ shouldHidePinnedHeaderRightBorder = false,
26
+ overlayNoRowsTemplate,
27
+ loadingOverlayComponent,
28
+ loadingOverlayComponentParams,
29
+ showOverlay = false
30
+ } = props;
31
+ const theme = useTheme();
32
+ const intl = useIntl();
33
+ const GRID_PREFIX = "grid.";
34
+ const getLocaleText = useCallback(
35
+ (params) => {
36
+ const key = GRID_PREFIX + params.key;
37
+ return intl.formatMessage({
38
+ id: key,
39
+ defaultMessage: params.defaultValue
40
+ });
41
+ },
42
+ [intl]
43
+ );
44
+ return /* @__PURE__ */ jsx(
45
+ Box,
46
+ {
47
+ sx: mergeSx(
48
+ styles.grid,
49
+ shouldHidePinnedHeaderRightBorder ? styles.noBorderRight : void 0,
50
+ showOverlay ? styles.overlayBackground : void 0
51
+ ),
52
+ className: `${theme.aggrid.theme} ${CUSTOM_AGGRID_THEME}`,
53
+ children: /* @__PURE__ */ jsx(
54
+ AgGridReact,
55
+ {
56
+ ref,
57
+ getLocaleText,
58
+ suppressPropertyNamesCheck: true,
59
+ loadingOverlayComponent,
60
+ loadingOverlayComponentParams,
61
+ overlayNoRowsTemplate,
62
+ onColumnResized,
63
+ enableCellTextSelection: true,
64
+ ...props
65
+ }
66
+ )
67
+ }
68
+ );
69
+ }
70
+ );
71
+ export {
72
+ CustomAGGrid as default
73
+ };
@@ -0,0 +1,20 @@
1
+ import { SystemStyleObject } from '@mui/system/styleFunctionSx/styleFunctionSx';
2
+ import { Theme } from '@mui/material/styles/createTheme';
3
+
4
+ export declare const CUSTOM_AGGRID_THEME = "custom-aggrid-theme";
5
+ export declare const styles: {
6
+ grid: (theme: Theme) => SystemStyleObject<Theme>;
7
+ noBorderRight: {
8
+ '& .ag-pinned-left-header': {
9
+ borderRight: string;
10
+ };
11
+ };
12
+ overlayBackground: (theme: Theme) => {
13
+ '& .ag-overlay-loading-wrapper': {
14
+ background: string;
15
+ };
16
+ '& .ag-overlay-no-rows-wrapper': {
17
+ background: string;
18
+ };
19
+ };
20
+ };
@@ -0,0 +1,47 @@
1
+ const CUSTOM_AGGRID_THEME = "custom-aggrid-theme";
2
+ const styles = {
3
+ grid: (theme) => ({
4
+ width: "auto",
5
+ height: "100%",
6
+ position: "relative",
7
+ [`&.${CUSTOM_AGGRID_THEME}`]: {
8
+ "--ag-value-change-value-highlight-background-color": theme.aggrid.valueChangeHighlightBackgroundColor,
9
+ "--ag-selected-row-background-color": theme.aggrid.highlightColor,
10
+ "--ag-row-hover-color": theme.aggrid.highlightColor
11
+ },
12
+ "& .ag-checkbox-input": {
13
+ cursor: "pointer"
14
+ },
15
+ //overrides the default computed max height for ag grid default selector editor to make it more usable
16
+ //can be removed if a custom selector editor is implemented
17
+ "& .ag-select-list": {
18
+ maxHeight: "300px !important"
19
+ },
20
+ //allows to hide the scrollbar in the pinned rows section as it is unecessary to our implementation
21
+ "& .ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-left-spacer:not(.ag-scroller-corner)": {
22
+ visibility: "hidden"
23
+ },
24
+ //removes border on focused cell - using "suppressCellFocus" Aggrid option causes side effects and breaks field edition
25
+ "& .ag-cell-focus, .ag-cell": {
26
+ border: "none !important"
27
+ }
28
+ }),
29
+ noBorderRight: {
30
+ // hides right border for header of "Edit" column due to column being pinned
31
+ "& .ag-pinned-left-header": {
32
+ borderRight: "none"
33
+ }
34
+ },
35
+ overlayBackground: (theme) => ({
36
+ "& .ag-overlay-loading-wrapper": {
37
+ background: theme.aggrid.overlay.background
38
+ },
39
+ "& .ag-overlay-no-rows-wrapper": {
40
+ background: "none"
41
+ }
42
+ })
43
+ };
44
+ export {
45
+ CUSTOM_AGGRID_THEME,
46
+ styles
47
+ };
@@ -1,4 +1,3 @@
1
- import { ElementAttributes } from '../../utils/types.ts';
2
1
  import { UUID } from 'crypto';
3
2
  import { TreeViewFinderProps } from '../TreeViewFinder/TreeViewFinder';
4
3
  import { FunctionComponent } from 'react';
@@ -8,9 +7,6 @@ interface DirectoryItemSelectorProps extends TreeViewFinderProps {
8
7
  types: string[];
9
8
  equipmentTypes?: string[];
10
9
  itemFilter?: any;
11
- fetchDirectoryContent?: (directoryUuid: UUID, elementTypes: string[]) => Promise<ElementAttributes[]>;
12
- fetchRootFolders?: (types: string[]) => Promise<ElementAttributes[]>;
13
- fetchElementsInfos?: (ids: UUID[], elementTypes: string[], equipmentTypes: string[]) => Promise<ElementAttributes[]>;
14
10
  classes?: any;
15
11
  contentText?: string;
16
12
  defaultExpanded?: string[];
@@ -4,6 +4,8 @@ import { getFileIcon } from "../../utils/ElementIcon.js";
4
4
  import { ElementType } from "../../utils/ElementType.js";
5
5
  import TreeViewFinder from "../TreeViewFinder/TreeViewFinder.js";
6
6
  import { useSnackMessage } from "../../hooks/useSnackMessage.js";
7
+ import { fetchElementsInfos } from "../../services/explore.js";
8
+ import { fetchRootFolders, fetchDirectoryContent } from "../../services/directory.js";
7
9
  const styles = {
8
10
  icon: (theme) => ({
9
11
  marginRight: theme.spacing(1),
@@ -16,9 +18,6 @@ const DirectoryItemSelector = ({
16
18
  types,
17
19
  equipmentTypes,
18
20
  itemFilter,
19
- fetchDirectoryContent,
20
- fetchRootFolders,
21
- fetchElementsInfos,
22
21
  expanded,
23
22
  ...otherTreeViewFinderProps
24
23
  }) => {
@@ -77,7 +76,7 @@ const DirectoryItemSelector = ({
77
76
  [convertRoots]
78
77
  );
79
78
  const updateRootDirectories = useCallback(() => {
80
- fetchRootFolders && fetchRootFolders(types).then((data2) => {
79
+ fetchRootFolders(types).then((data2) => {
81
80
  let [nrs, mdr] = updatedTree(
82
81
  rootsRef.current,
83
82
  nodeMap.current,
@@ -93,30 +92,26 @@ const DirectoryItemSelector = ({
93
92
  headerId: "DirectoryItemSelector"
94
93
  });
95
94
  });
96
- }, [convertRoots, types, snackError, fetchRootFolders]);
95
+ }, [convertRoots, types, snackError]);
97
96
  const fetchDirectory = useCallback(
98
97
  (nodeId) => {
99
98
  const typeList = types.includes(ElementType.DIRECTORY) ? [] : types;
100
- fetchDirectoryContent && fetchDirectoryContent(nodeId, typeList).then((children) => {
99
+ fetchDirectoryContent(nodeId, typeList).then((children) => {
101
100
  const childrenMatchedTypes = children.filter(
102
101
  (item) => contentFilter().has(item.type)
103
102
  );
104
103
  if (childrenMatchedTypes.length > 0 && equipmentTypes && equipmentTypes.length > 0) {
105
- fetchElementsInfos && fetchElementsInfos(
106
- childrenMatchedTypes.map(
107
- (e) => e.elementUuid
108
- ),
104
+ fetchElementsInfos(
105
+ childrenMatchedTypes.map((e) => e.elementUuid),
109
106
  types,
110
107
  equipmentTypes
111
108
  ).then((childrenWithMetadata) => {
112
- const children2 = itemFilter ? childrenWithMetadata.filter(
113
- (val) => {
114
- if (val.type === ElementType.DIRECTORY) {
115
- return true;
116
- }
117
- return itemFilter(val);
109
+ const children2 = itemFilter ? childrenWithMetadata.filter((val) => {
110
+ if (val.type === ElementType.DIRECTORY) {
111
+ return true;
118
112
  }
119
- ) : childrenWithMetadata;
113
+ return itemFilter(val);
114
+ }) : childrenWithMetadata;
120
115
  addToDirectory(nodeId, children2);
121
116
  });
122
117
  } else {
@@ -128,15 +123,7 @@ const DirectoryItemSelector = ({
128
123
  );
129
124
  });
130
125
  },
131
- [
132
- types,
133
- equipmentTypes,
134
- itemFilter,
135
- contentFilter,
136
- addToDirectory,
137
- fetchDirectoryContent,
138
- fetchElementsInfos
139
- ]
126
+ [types, equipmentTypes, itemFilter, contentFilter, addToDirectory]
140
127
  );
141
128
  useEffect(() => {
142
129
  if (open) {
@@ -1,16 +1,25 @@
1
- export function EquipmentItem({ inputValue, suffixRenderer, element, showsJustText, ...props }: {
2
- [x: string]: any;
3
- inputValue: any;
4
- suffixRenderer?: {
5
- ({ props, element }: {
6
- props: any;
7
- element: any;
8
- }): import("react/jsx-runtime").JSX.Element;
9
- propTypes: {
10
- element: import('prop-types').Requireable<object>;
11
- props: import('prop-types').Requireable<object>;
12
- };
13
- } | undefined;
14
- element: any;
15
- showsJustText?: boolean | undefined;
16
- }): import("react/jsx-runtime").JSX.Element;
1
+ import { SxProps } from '@mui/material';
2
+ import { EquipmentInfos } from '../../utils/EquipmentType';
3
+ import { TagRenderer } from './index';
4
+
5
+ export interface EquipmentItemProps {
6
+ inputValue: string;
7
+ suffixRenderer: typeof TagRenderer;
8
+ element: EquipmentInfos;
9
+ showsJustText: boolean;
10
+ classes?: {
11
+ result?: string;
12
+ equipmentOption?: string;
13
+ equipmentTag?: string;
14
+ equipmentTypeTag?: string;
15
+ equipmentVlTag?: string;
16
+ };
17
+ styles?: {
18
+ result?: SxProps;
19
+ equipmentOption?: SxProps;
20
+ equipmentTag?: SxProps;
21
+ equipmentTypeTag?: SxProps;
22
+ equipmentVlTag?: SxProps;
23
+ };
24
+ }
25
+ export declare const EquipmentItem: ({ inputValue, suffixRenderer, element, showsJustText, ...props }: EquipmentItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -7,8 +7,8 @@ import { TagRenderer } from "./tag-renderer.js";
7
7
  import match from "autosuggest-highlight/match";
8
8
  import parse from "autosuggest-highlight/parse";
9
9
  import clsx from "clsx";
10
- import { OverflowableText } from "../OverflowableText/overflowable-text.js";
11
10
  import { EQUIPMENT_TYPE } from "../../utils/EquipmentType.js";
11
+ import { OverflowableText } from "../OverflowableText/overflowable-text.js";
12
12
  import { mergeSx } from "../../utils/styles.js";
13
13
  const EquipmentItem = ({
14
14
  inputValue,
@@ -17,7 +17,7 @@ const EquipmentItem = ({
17
17
  showsJustText = false,
18
18
  ...props
19
19
  }) => {
20
- var _a, _b, _c, _d, _e, _f, _g, _h;
20
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
21
21
  let matches = match(element.label, inputValue, {
22
22
  insideWords: true,
23
23
  findAllOccurrences: true
@@ -44,7 +44,7 @@ const EquipmentItem = ({
44
44
  children: /* @__PURE__ */ jsx(
45
45
  FormattedMessage,
46
46
  {
47
- id: EQUIPMENT_TYPE[element.type].tagLabel
47
+ id: (_g = EQUIPMENT_TYPE[element.type]) == null ? void 0 : _g.tagLabel
48
48
  }
49
49
  )
50
50
  }
@@ -53,8 +53,8 @@ const EquipmentItem = ({
53
53
  OverflowableText,
54
54
  {
55
55
  text: parts.map((e) => e.text).join(),
56
- className: (_g = props.classes) == null ? void 0 : _g.result,
57
- sx: (_h = props.styles) == null ? void 0 : _h.result,
56
+ className: (_h = props.classes) == null ? void 0 : _h.result,
57
+ sx: (_i = props.styles) == null ? void 0 : _i.result,
58
58
  children: parts.map((part, index) => /* @__PURE__ */ jsx(
59
59
  "span",
60
60
  {