@gridsuite/commons-ui 0.132.0 → 0.134.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 (129) hide show
  1. package/dist/components/authentication/utils/authService.js +6 -9
  2. package/dist/components/checkBoxList/CheckBoxList.js +1 -1
  3. package/dist/components/checkBoxList/CheckBoxListItem.js +3 -3
  4. package/dist/components/checkBoxList/CheckBoxListItemContent.js +3 -3
  5. package/dist/components/checkBoxList/CheckBoxListItems.js +4 -4
  6. package/dist/components/checkBoxList/DraggableCheckBoxListItem.js +5 -5
  7. package/dist/components/checkBoxList/DraggableCheckBoxListItemContent.js +1 -1
  8. package/dist/components/contingencyList/criteriaBased/criteriaBasedUtils.js +7 -7
  9. package/dist/components/csvDownloader/use-csv-export.js +1 -4
  10. package/dist/components/customAGGrid/customAggrid.js +2 -2
  11. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -2
  12. package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +1 -2
  13. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +6 -6
  14. package/dist/components/dialogs/elementSaveDialog/utils.js +1 -1
  15. package/dist/components/dialogs/modifyElementSelection/ModifyElementSelection.js +1 -1
  16. package/dist/components/directoryItemSelector/DirectoryItemSelector.js +3 -4
  17. package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +2 -3
  18. package/dist/components/dnd-table/dnd-table.js +7 -7
  19. package/dist/components/elementSearch/elementItem/EquipmentItem.js +6 -7
  20. package/dist/components/elementSearch/elementSearchDialog/ElementSearchDialog.js +1 -1
  21. package/dist/components/elementSearch/tagRenderer/TagRenderer.js +3 -4
  22. package/dist/components/filter/FilterCreationDialog.js +23 -13
  23. package/dist/components/filter/FilterForm.js +2 -2
  24. package/dist/components/filter/expert/ExpertFilterEditionDialog.js +13 -6
  25. package/dist/components/filter/expert/ExpertFilterForm.d.ts +0 -1
  26. package/dist/components/filter/expert/ExpertFilterForm.js +11 -21
  27. package/dist/components/filter/expert/expertFilterConstants.d.ts +13 -12
  28. package/dist/components/filter/expert/expertFilterConstants.js +17 -48
  29. package/dist/components/filter/expert/expertFilterUtils.js +21 -25
  30. package/dist/components/filter/expert/index.js +1 -2
  31. package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +2 -4
  32. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +11 -18
  33. package/dist/components/filter/index.js +1 -2
  34. package/dist/components/filter/utils/filterApi.js +14 -6
  35. package/dist/components/flatParameters/FlatParameters.js +2 -2
  36. package/dist/components/index.js +1 -4
  37. package/dist/components/inputs/SelectClearable.js +1 -1
  38. package/dist/components/inputs/index.js +0 -2
  39. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +44 -48
  40. package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +3 -4
  41. package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js +1 -1
  42. package/dist/components/inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js +4 -4
  43. package/dist/components/inputs/reactHookForm/chip-items-input.js +3 -3
  44. package/dist/components/inputs/reactHookForm/errorManagement/ErrorInput.js +1 -2
  45. package/dist/components/inputs/reactHookForm/index.js +0 -2
  46. package/dist/components/inputs/reactHookForm/numbers/FloatInput.js +1 -1
  47. package/dist/components/inputs/reactHookForm/numbers/SliderInput.js +1 -1
  48. package/dist/components/inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js +2 -2
  49. package/dist/components/inputs/reactHookForm/selectInputs/SelectInput.js +3 -3
  50. package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.js +4 -4
  51. package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.js +3 -3
  52. package/dist/components/inputs/reactHookForm/text/ExpandingTextField.js +2 -2
  53. package/dist/components/inputs/reactHookForm/text/TextInput.js +5 -5
  54. package/dist/components/inputs/reactHookForm/text/UniqueNameInput.js +2 -2
  55. package/dist/components/inputs/reactHookForm/utils/SubmitButton.js +1 -1
  56. package/dist/components/inputs/reactHookForm/utils/functions.js +2 -3
  57. package/dist/components/inputs/reactHookForm/utils/index.d.ts +0 -1
  58. package/dist/components/inputs/reactHookForm/utils/index.js +0 -2
  59. package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +2 -2
  60. package/dist/components/inputs/reactQueryBuilder/PropertyValueEditor.js +8 -9
  61. package/dist/components/inputs/reactQueryBuilder/TextValueEditor.js +1 -1
  62. package/dist/components/inputs/reactQueryBuilder/TranslatedValueEditor.js +1 -1
  63. package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +2 -3
  64. package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +12 -15
  65. package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +3 -4
  66. package/dist/components/notifications/hooks/useListenerManager.js +2 -4
  67. package/dist/components/overflowableText/OverflowableText.js +4 -5
  68. package/dist/components/parameters/common/computing-type.d.ts +2 -1
  69. package/dist/components/parameters/common/computing-type.js +3 -0
  70. package/dist/components/parameters/common/limitreductions/columns-definitions.js +1 -1
  71. package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +1 -1
  72. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +1 -1
  73. package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
  74. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +1 -1
  75. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +3 -3
  76. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +15 -16
  77. package/dist/components/parameters/network-visualizations/map-parameters.js +13 -17
  78. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +1 -2
  79. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +2 -2
  80. package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +2 -3
  81. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +2 -3
  82. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +3 -3
  83. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +1 -1
  84. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +5 -5
  85. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -1
  86. package/dist/components/parameters/sensi/sensitivity-table.js +2 -3
  87. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +42 -54
  88. package/dist/components/parameters/sensi/utils.js +16 -27
  89. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +2 -2
  90. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
  91. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  92. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +47 -56
  93. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +1 -1
  94. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
  95. package/dist/components/snackbarProvider/SnackbarProvider.js +1 -4
  96. package/dist/components/topBar/TopBar.js +33 -36
  97. package/dist/components/topBar/UserInformationDialog.js +7 -8
  98. package/dist/components/topBar/UserSettingsDialog.js +1 -1
  99. package/dist/components/treeViewFinder/TreeViewFinder.js +13 -13
  100. package/dist/hooks/use-parameters-backend.js +5 -5
  101. package/dist/hooks/use-unique-name-validation.js +2 -3
  102. package/dist/hooks/useConfidentialityWarning.js +1 -1
  103. package/dist/hooks/usePredefinedProperties.js +1 -2
  104. package/dist/index.js +9 -5
  105. package/dist/redux/commonStore.js +1 -2
  106. package/dist/services/businessErrorCode.d.ts +11 -0
  107. package/dist/services/businessErrorCode.js +10 -0
  108. package/dist/services/index.d.ts +1 -0
  109. package/dist/services/index.js +2 -0
  110. package/dist/services/utils.js +13 -7
  111. package/dist/translations/en/businessErrorsEn.d.ts +28 -0
  112. package/dist/translations/en/businessErrorsEn.js +25 -0
  113. package/dist/translations/en/equipmentsEn.d.ts +1 -0
  114. package/dist/translations/en/equipmentsEn.js +2 -1
  115. package/dist/translations/en/index.d.ts +1 -0
  116. package/dist/translations/en/index.js +2 -0
  117. package/dist/translations/fr/businessErrorsFr.d.ts +28 -0
  118. package/dist/translations/fr/businessErrorsFr.js +25 -0
  119. package/dist/translations/fr/equipmentsFr.d.ts +1 -0
  120. package/dist/translations/fr/equipmentsFr.js +2 -1
  121. package/dist/translations/fr/index.d.ts +1 -0
  122. package/dist/translations/fr/index.js +2 -0
  123. package/dist/utils/index.js +2 -1
  124. package/dist/utils/types/equipmentType.d.ts +162 -8
  125. package/dist/utils/types/equipmentType.js +126 -22
  126. package/dist/utils/types/index.js +2 -1
  127. package/package.json +6 -6
  128. package/dist/components/inputs/reactHookForm/utils/RefreshButton.d.ts +0 -2
  129. package/dist/components/inputs/reactHookForm/utils/RefreshButton.js +0 -9
@@ -10,16 +10,13 @@ const equipmentStyles = {
10
10
  alignItems: "center",
11
11
  justifyContent: "space-between"
12
12
  },
13
- equipmentTag: (theme) => {
14
- var _a;
15
- return {
16
- borderRadius: "10px",
17
- padding: "4px",
18
- fontSize: "x-small",
19
- textAlign: "center",
20
- color: ((_a = theme == null ? void 0 : theme.palette) == null ? void 0 : _a.mode) === "light" ? "inherit" : "black"
21
- };
22
- },
13
+ equipmentTag: (theme) => ({
14
+ borderRadius: "10px",
15
+ padding: "4px",
16
+ fontSize: "x-small",
17
+ textAlign: "center",
18
+ color: theme?.palette?.mode === "light" ? "inherit" : "black"
19
+ }),
23
20
  equipmentTypeTag: {
24
21
  minWidth: TYPE_TAG_MAX_SIZE,
25
22
  maxWidth: TYPE_TAG_MAX_SIZE,
@@ -71,7 +68,7 @@ var ExtendedEquipmentType = /* @__PURE__ */ ((ExtendedEquipmentType2) => {
71
68
  ExtendedEquipmentType2["HVDC_LINE_VSC"] = "HVDC_LINE_VSC";
72
69
  return ExtendedEquipmentType2;
73
70
  })(ExtendedEquipmentType || {});
74
- const BASE_EQUIPMENTS = {
71
+ const ALL_EQUIPMENTS = {
75
72
  [
76
73
  "SUBSTATION"
77
74
  /* SUBSTATION */
@@ -148,8 +145,115 @@ const BASE_EQUIPMENTS = {
148
145
  ]: {
149
146
  id: "DANGLING_LINE",
150
147
  label: "DanglingLines"
148
+ },
149
+ [
150
+ "BUSBAR_SECTION"
151
+ /* BUSBAR_SECTION */
152
+ ]: {
153
+ id: "BUSBAR_SECTION",
154
+ label: "BusBarSections"
155
+ },
156
+ [
157
+ "HVDC_LINE"
158
+ /* HVDC_LINE */
159
+ ]: {
160
+ id: "HVDC_LINE",
161
+ label: "Hvdc"
162
+ },
163
+ [
164
+ "HVDC_LINE_LCC"
165
+ /* HVDC_LINE_LCC */
166
+ ]: {
167
+ id: "HVDC_LINE_LCC",
168
+ label: "LCC"
169
+ },
170
+ [
171
+ "HVDC_LINE_VSC"
172
+ /* HVDC_LINE_VSC */
173
+ ]: {
174
+ id: "HVDC_LINE_VSC",
175
+ label: "VSC"
151
176
  }
152
177
  };
178
+ const BASE_EQUIPMENTS = {
179
+ [
180
+ "SUBSTATION"
181
+ /* SUBSTATION */
182
+ ]: ALL_EQUIPMENTS[
183
+ "SUBSTATION"
184
+ /* SUBSTATION */
185
+ ],
186
+ [
187
+ "VOLTAGE_LEVEL"
188
+ /* VOLTAGE_LEVEL */
189
+ ]: ALL_EQUIPMENTS[
190
+ "VOLTAGE_LEVEL"
191
+ /* VOLTAGE_LEVEL */
192
+ ],
193
+ [
194
+ "LINE"
195
+ /* LINE */
196
+ ]: ALL_EQUIPMENTS[
197
+ "LINE"
198
+ /* LINE */
199
+ ],
200
+ [
201
+ "TWO_WINDINGS_TRANSFORMER"
202
+ /* TWO_WINDINGS_TRANSFORMER */
203
+ ]: ALL_EQUIPMENTS[
204
+ "TWO_WINDINGS_TRANSFORMER"
205
+ /* TWO_WINDINGS_TRANSFORMER */
206
+ ],
207
+ [
208
+ "THREE_WINDINGS_TRANSFORMER"
209
+ /* THREE_WINDINGS_TRANSFORMER */
210
+ ]: ALL_EQUIPMENTS[
211
+ "THREE_WINDINGS_TRANSFORMER"
212
+ /* THREE_WINDINGS_TRANSFORMER */
213
+ ],
214
+ [
215
+ "GENERATOR"
216
+ /* GENERATOR */
217
+ ]: ALL_EQUIPMENTS[
218
+ "GENERATOR"
219
+ /* GENERATOR */
220
+ ],
221
+ [
222
+ "BATTERY"
223
+ /* BATTERY */
224
+ ]: ALL_EQUIPMENTS[
225
+ "BATTERY"
226
+ /* BATTERY */
227
+ ],
228
+ [
229
+ "LOAD"
230
+ /* LOAD */
231
+ ]: ALL_EQUIPMENTS[
232
+ "LOAD"
233
+ /* LOAD */
234
+ ],
235
+ [
236
+ "SHUNT_COMPENSATOR"
237
+ /* SHUNT_COMPENSATOR */
238
+ ]: ALL_EQUIPMENTS[
239
+ "SHUNT_COMPENSATOR"
240
+ /* SHUNT_COMPENSATOR */
241
+ ],
242
+ [
243
+ "STATIC_VAR_COMPENSATOR"
244
+ /* STATIC_VAR_COMPENSATOR */
245
+ ]: ALL_EQUIPMENTS[
246
+ "STATIC_VAR_COMPENSATOR"
247
+ /* STATIC_VAR_COMPENSATOR */
248
+ ],
249
+ [
250
+ "DANGLING_LINE"
251
+ /* DANGLING_LINE */
252
+ ]: ALL_EQUIPMENTS[
253
+ "DANGLING_LINE"
254
+ /* DANGLING_LINE */
255
+ ]
256
+ };
153
257
  const EQUIPMENT_TYPE = {
154
258
  [
155
259
  "SUBSTATION"
@@ -290,17 +394,17 @@ const SEARCH_EQUIPMENTS = {
290
394
  [
291
395
  "HVDC_LINE_LCC"
292
396
  /* HVDC_LINE_LCC */
293
- ]: {
294
- id: "HVDC_LINE_LCC",
295
- label: "LCC"
296
- },
397
+ ]: ALL_EQUIPMENTS[
398
+ "HVDC_LINE_LCC"
399
+ /* HVDC_LINE_LCC */
400
+ ],
297
401
  [
298
402
  "HVDC_LINE_VSC"
299
403
  /* HVDC_LINE_VSC */
300
- ]: {
301
- id: "HVDC_LINE_VSC",
302
- label: "VSC"
303
- }
404
+ ]: ALL_EQUIPMENTS[
405
+ "HVDC_LINE_VSC"
406
+ /* HVDC_LINE_VSC */
407
+ ]
304
408
  };
305
409
  var OperatingStatus = /* @__PURE__ */ ((OperatingStatus2) => {
306
410
  OperatingStatus2["IN_OPERATION"] = "IN_OPERATION";
@@ -310,7 +414,6 @@ var OperatingStatus = /* @__PURE__ */ ((OperatingStatus2) => {
310
414
  })(OperatingStatus || {});
311
415
  function getEquipmentsInfosForSearchBar(equipmentsInfos, getNameOrId) {
312
416
  return equipmentsInfos.flatMap((e) => {
313
- var _a;
314
417
  const label = getNameOrId(e);
315
418
  return e.type === "SUBSTATION" ? [
316
419
  {
@@ -319,17 +422,18 @@ function getEquipmentsInfosForSearchBar(equipmentsInfos, getNameOrId) {
319
422
  key: e.id,
320
423
  type: e.type
321
424
  }
322
- ] : ((_a = e.voltageLevels) == null ? void 0 : _a.map((vli) => ({
425
+ ] : e.voltageLevels?.map((vli) => ({
323
426
  label,
324
427
  id: e.id,
325
428
  key: `${e.id}_${vli.id}`,
326
429
  type: e.type,
327
430
  voltageLevelLabel: getNameOrId(vli),
328
431
  voltageLevelId: vli.id
329
- }))) ?? [];
432
+ })) ?? [];
330
433
  });
331
434
  }
332
435
  export {
436
+ ALL_EQUIPMENTS,
333
437
  BASE_EQUIPMENTS,
334
438
  EQUIPMENT_TYPE,
335
439
  EquipmentType,
@@ -1,5 +1,5 @@
1
1
  import { ElementType } from "./elementType.js";
2
- import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
2
+ import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
3
3
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./equipmentTypes.js";
4
4
  import { AnnouncementSeverity, ArrayAction } from "./types.js";
5
5
  import { MODIFICATION_TYPES, ModificationType } from "./modificationType.js";
@@ -8,6 +8,7 @@ import { ParameterType } from "./parameters.type.js";
8
8
  import { SolverTypeInfos } from "./dynamic-simulation.type.js";
9
9
  import { DistributionType, SensitivityType } from "./sensitivity-analysis.type.js";
10
10
  export {
11
+ ALL_EQUIPMENTS,
11
12
  AnnouncementSeverity,
12
13
  ArrayAction,
13
14
  BASE_EQUIPMENTS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.132.0",
3
+ "version": "0.134.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
@@ -37,8 +37,8 @@
37
37
  "@ag-grid-community/locale": "^33.3.2",
38
38
  "@hello-pangea/dnd": "^18.0.1",
39
39
  "@material-symbols/svg-400": "^0.31.9",
40
- "@react-querybuilder/dnd": "^8.8.4",
41
- "@react-querybuilder/material": "^8.8.4",
40
+ "@react-querybuilder/dnd": "^8.11.0",
41
+ "@react-querybuilder/material": "^8.11.0",
42
42
  "autosuggest-highlight": "^3.3.4",
43
43
  "clsx": "^2.1.1",
44
44
  "jwt-decode": "^4.0.0",
@@ -49,7 +49,7 @@
49
49
  "react-csv-downloader": "^3.3.0",
50
50
  "react-dnd": "^16.0.1",
51
51
  "react-dnd-html5-backend": "^16.0.1",
52
- "react-querybuilder": "^8.2.0",
52
+ "react-querybuilder": "^8.11.0",
53
53
  "reconnecting-websocket": "^4.4.0",
54
54
  "type-fest": "^4.41.0",
55
55
  "uuid": "^13.0.0"
@@ -103,7 +103,7 @@
103
103
  "@types/react-resizable": "^3.0.8",
104
104
  "@typescript-eslint/eslint-plugin": "^7.18.0",
105
105
  "@typescript-eslint/parser": "^7.18.0",
106
- "@vitejs/plugin-react": "^4.7.0",
106
+ "@vitejs/plugin-react": "^5.0.4",
107
107
  "ag-grid-community": "^33.1.0",
108
108
  "ag-grid-react": "^33.3.2",
109
109
  "babel-eslint": "^10.1.0",
@@ -137,7 +137,7 @@
137
137
  "react-router": "^7.8.2",
138
138
  "ts-node": "^10.9.2",
139
139
  "typescript": "~5.6.3",
140
- "vite": "^6.3.6",
140
+ "vite": "^7.1.12",
141
141
  "vite-plugin-dts": "^4.5.4",
142
142
  "vite-plugin-eslint": "^1.8.1",
143
143
  "vite-plugin-lib-inject-css": "^2.2.2",
@@ -1,2 +0,0 @@
1
- import { ButtonProps } from '@mui/material';
2
- export declare function RefreshButton(buttonProps: Readonly<ButtonProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { IconButton } from "@mui/material";
3
- import { Refresh } from "@mui/icons-material";
4
- function RefreshButton(buttonProps) {
5
- return /* @__PURE__ */ jsx(IconButton, { ...buttonProps, children: /* @__PURE__ */ jsx(Refresh, { fontSize: "large" }) });
6
- }
7
- export {
8
- RefreshButton
9
- };