@gridsuite/commons-ui 0.239.0 → 0.241.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 (207) hide show
  1. package/README.md +6 -2
  2. package/dist/components/composite/agGridTable/cellEditors/numericEditor.d.ts +9 -3
  3. package/dist/components/composite/agGridTable/cellEditors/numericEditor.js +24 -5
  4. package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-comparator-filter.js +2 -2
  5. package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-text-filter.js +4 -4
  6. package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-filter-icon.js +2 -2
  7. package/dist/components/composite/customAGGrid/custom-aggrid-header.js +26 -13
  8. package/dist/components/composite/customAGGrid/custom-aggrid-menu.js +2 -2
  9. package/dist/components/composite/dnd-table/dnd-table-bottom-left-buttons.js +4 -4
  10. package/dist/components/composite/dnd-table/dnd-table-bottom-right-buttons.js +6 -6
  11. package/dist/components/composite/dnd-table/dnd-table.js +4 -4
  12. package/dist/components/composite/filter/HeaderFilterForm.js +4 -4
  13. package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.d.ts +1 -1
  14. package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +2 -4
  15. package/dist/components/composite/grid/grid-item.d.ts +4 -3
  16. package/dist/components/composite/grid/grid-item.js +8 -4
  17. package/dist/components/composite/grid/grid-section.d.ts +1 -1
  18. package/dist/components/composite/grid/grid-section.js +3 -3
  19. package/dist/components/composite/grid/index.js +6 -3
  20. package/dist/components/composite/index.js +4 -3
  21. package/dist/components/composite/reactQueryBuilder/PropertyValueEditor.js +5 -5
  22. package/dist/components/composite/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +2 -2
  23. package/dist/components/composite/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +5 -5
  24. package/dist/components/index.js +4 -3
  25. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +9 -9
  26. package/dist/components/ui/dialogs/modifyElementSelection/ModifyElementSelection.js +3 -3
  27. package/dist/components/ui/reactHookForm/errorManagement/FieldErrorAlert.js +2 -2
  28. package/dist/components/ui/reactHookForm/expandableInput/DeletableRow.js +4 -4
  29. package/dist/components/ui/reactHookForm/expandableInput/ExpandableInput.js +4 -4
  30. package/dist/components/ui/reactHookForm/numbers/RangeInput.js +5 -5
  31. package/dist/components/ui/reactHookForm/utils/functions.js +2 -2
  32. package/dist/features/authentication/AuthenticationRouter.js +2 -2
  33. package/dist/features/authentication/AuthenticationRouterErrorDisplay.js +3 -3
  34. package/dist/features/index.js +6 -1
  35. package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +7 -7
  36. package/dist/features/network-modifications/battery/modification/BatteryDialogHeader.js +4 -4
  37. package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +8 -8
  38. package/dist/features/network-modifications/battery/modification/BatteryModificationForm.js +5 -5
  39. package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-form.js +1 -1
  40. package/dist/features/network-modifications/by-filter/assignment/modification-by-assignment-form.js +4 -4
  41. package/dist/features/network-modifications/by-filter/deletion/ByFilterDeletionForm.js +4 -4
  42. package/dist/features/network-modifications/common/activePowerControl/ActivePowerControlForm.js +1 -1
  43. package/dist/features/network-modifications/common/connectivity/BranchConnectivityForm.js +1 -1
  44. package/dist/features/network-modifications/common/connectivity/ConnectivityForm.js +7 -7
  45. package/dist/features/network-modifications/common/connectivity/PositionForm.js +4 -4
  46. package/dist/features/network-modifications/common/connectivity/VoltageLevelConnectivityForm.js +4 -4
  47. package/dist/features/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.js +4 -3
  48. package/dist/features/network-modifications/common/measurements/BusbarSectionVoltageMeasurementsForm.js +2 -2
  49. package/dist/features/network-modifications/common/measurements/PowerMeasurementsForm.js +4 -4
  50. package/dist/features/network-modifications/common/measurements/PowerWithValidityForm.js +4 -4
  51. package/dist/features/network-modifications/common/properties/PropertiesForm.js +1 -1
  52. package/dist/features/network-modifications/common/properties/PropertyForm.js +5 -5
  53. package/dist/features/network-modifications/common/reactiveLimits/ReactiveLimitsForm.js +3 -3
  54. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.js +1 -1
  55. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +7 -7
  56. package/dist/features/network-modifications/common/regulatingTerminal/RegulatingTerminalForm.js +2 -2
  57. package/dist/features/network-modifications/common/setpoints/SetPointsForm.js +5 -5
  58. package/dist/features/network-modifications/common/shortCircuit/ShortCircuitForm.js +3 -3
  59. package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +5 -5
  60. package/dist/features/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +6 -6
  61. package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/HvdcLccDeletionSpecificForm.js +5 -5
  62. package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js +5 -5
  63. package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +9 -9
  64. package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +5 -5
  65. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +9 -9
  66. package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.js +5 -5
  67. package/dist/features/network-modifications/load/common/LoadDialogHeader.js +5 -5
  68. package/dist/features/network-modifications/load/common/LoadDialogTabsContent.js +1 -1
  69. package/dist/features/network-modifications/load/common/LoadForm.js +5 -5
  70. package/dist/features/network-modifications/shunt-compensator/common/CharacteristicsForm.js +12 -12
  71. package/dist/features/network-modifications/shunt-compensator/common/characteristicsForm.utils.d.ts +8 -8
  72. package/dist/features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +11 -11
  73. package/dist/features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.d.ts +12 -12
  74. package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +3 -3
  75. package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.d.ts +12 -12
  76. package/dist/features/network-modifications/substation/creation/SubstationCreationForm.js +7 -7
  77. package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js +7 -7
  78. package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +7 -7
  79. package/dist/features/network-modifications/voltageLevel/creation/tabs/characteristicsTab/CharacteristicsTab.js +9 -9
  80. package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/StructureTab.js +5 -5
  81. package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/couplingOmnibus/CouplingOmnibusCreation.js +3 -3
  82. package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js +1 -1
  83. package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationCreationSection.js +7 -7
  84. package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationTab.js +5 -5
  85. package/dist/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.js +3 -3
  86. package/dist/features/network-modifications/voltageLevel/modification/voltageLevelModification.utils.d.ts +1 -1
  87. package/dist/features/parameters/common/contingency-table/contingency-table.js +4 -4
  88. package/dist/features/parameters/common/hook/use-tabs.d.ts +3 -2
  89. package/dist/features/parameters/common/hook/use-tabs.js +2 -3
  90. package/dist/features/parameters/common/index.d.ts +2 -1
  91. package/dist/features/parameters/common/index.js +6 -1
  92. package/dist/features/parameters/common/line-separator.js +2 -2
  93. package/dist/features/parameters/common/name-element-editor/name-element-editor-form.js +4 -4
  94. package/dist/features/parameters/common/parameter-field.js +5 -4
  95. package/dist/features/parameters/common/parameter-layout/index.d.ts +8 -0
  96. package/dist/features/parameters/common/parameter-layout/index.js +7 -0
  97. package/dist/features/parameters/common/parameter-layout/parameter-layout-provider.d.ts +10 -0
  98. package/dist/features/parameters/common/parameter-layout/parameter-layout-provider.js +15 -0
  99. package/dist/features/parameters/common/parameter-layout/parameter-layout.d.ts +23 -0
  100. package/dist/features/parameters/common/parameter-layout/parameter-layout.js +167 -0
  101. package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +3 -3
  102. package/dist/features/parameters/common/parameters.js +3 -3
  103. package/dist/features/parameters/common/provider-param.d.ts +10 -0
  104. package/dist/features/parameters/common/{ProviderParam.js → provider-param.js} +9 -11
  105. package/dist/features/parameters/common/widget/parameter-float.js +4 -4
  106. package/dist/features/parameters/common/widget/parameter-group.js +2 -2
  107. package/dist/features/parameters/common/widget/parameter-line-directory-items-input.js +4 -4
  108. package/dist/features/parameters/common/widget/parameter-line-slider.js +4 -4
  109. package/dist/features/parameters/common/widget/parameter-switch.js +2 -2
  110. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.d.ts +4 -5
  111. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +39 -60
  112. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +39 -101
  113. package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +2 -2
  114. package/dist/features/parameters/dynamic-margin-calculation/time-delay-parameters.js +2 -2
  115. package/dist/features/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +8 -7
  116. package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +12 -11
  117. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +38 -71
  118. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +4 -5
  119. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +39 -61
  120. package/dist/features/parameters/dynamic-security-analysis/scenario-parameters.js +2 -2
  121. package/dist/features/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +8 -7
  122. package/dist/features/parameters/dynamic-simulation/curve/common/grid-buttons.js +4 -4
  123. package/dist/features/parameters/dynamic-simulation/curve/curve-parameters.js +7 -8
  124. package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-preview.js +7 -7
  125. package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-selector-dialog.js +10 -10
  126. package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-selector.js +26 -50
  127. package/dist/features/parameters/dynamic-simulation/curve/dialog/equipment-filter.js +20 -20
  128. package/dist/features/parameters/dynamic-simulation/curve/dialog/model-filter.js +11 -10
  129. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +42 -104
  130. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.d.ts +4 -5
  131. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +75 -97
  132. package/dist/features/parameters/dynamic-simulation/mapping/mapping-parameters.js +10 -9
  133. package/dist/features/parameters/dynamic-simulation/network/network-parameters.js +2 -2
  134. package/dist/features/parameters/dynamic-simulation/solver/solver-parameters.js +2 -2
  135. package/dist/features/parameters/dynamic-simulation/time-delay/time-delay-parameters.js +2 -2
  136. package/dist/features/parameters/dynamic-simulation/use-dynamic-simulation-parameters-form.js +7 -6
  137. package/dist/features/parameters/index.js +6 -1
  138. package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -0
  139. package/dist/features/parameters/loadflow/load-flow-parameters-content.js +14 -13
  140. package/dist/features/parameters/loadflow/load-flow-parameters-dialog.js +12 -18
  141. package/dist/features/parameters/loadflow/load-flow-parameters-form.d.ts +1 -6
  142. package/dist/features/parameters/loadflow/load-flow-parameters-form.js +26 -91
  143. package/dist/features/parameters/loadflow/load-flow-parameters-header.js +29 -53
  144. package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +35 -128
  145. package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +11 -10
  146. package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +10 -9
  147. package/dist/features/parameters/network-visualizations/map-parameters.js +18 -17
  148. package/dist/features/parameters/network-visualizations/network-area-diagram-parameters.js +4 -4
  149. package/dist/features/parameters/network-visualizations/network-visualizations-form.d.ts +1 -4
  150. package/dist/features/parameters/network-visualizations/network-visualizations-form.js +19 -48
  151. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.js +13 -19
  152. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +34 -65
  153. package/dist/features/parameters/network-visualizations/single-line-diagram-parameters.js +18 -17
  154. package/dist/features/parameters/parameters-style.d.ts +0 -1
  155. package/dist/features/parameters/parameters-style.js +0 -2
  156. package/dist/features/parameters/pcc-min/pcc-min-parameters-dialog.js +13 -18
  157. package/dist/features/parameters/pcc-min/pcc-min-parameters-form.d.ts +7 -29
  158. package/dist/features/parameters/pcc-min/pcc-min-parameters-form.js +16 -109
  159. package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +27 -84
  160. package/dist/features/parameters/security-analysis/columns-definitions.js +11 -10
  161. package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +20 -20
  162. package/dist/features/parameters/security-analysis/security-analysis-parameters-form.d.ts +2 -4
  163. package/dist/features/parameters/security-analysis/security-analysis-parameters-form.js +44 -115
  164. package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +40 -109
  165. package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.js +12 -11
  166. package/dist/features/parameters/security-analysis/security-analysis-violations-hiding.js +9 -11
  167. package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +7 -6
  168. package/dist/features/parameters/sensi/columns-definitions.js +9 -8
  169. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +21 -21
  170. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.d.ts +3 -5
  171. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +33 -90
  172. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +40 -99
  173. package/dist/features/parameters/sensi/sensitivity-parameters-fields.js +8 -17
  174. package/dist/features/parameters/sensi/sensitivity-parameters-selector.js +10 -9
  175. package/dist/features/parameters/sensi/utils.js +8 -7
  176. package/dist/features/parameters/short-circuit/short-circuit-general-tab-panel.js +15 -14
  177. package/dist/features/parameters/short-circuit/short-circuit-parameters-content.js +11 -10
  178. package/dist/features/parameters/short-circuit/short-circuit-parameters-dialog.js +13 -18
  179. package/dist/features/parameters/short-circuit/short-circuit-parameters-form.d.ts +1 -4
  180. package/dist/features/parameters/short-circuit/short-circuit-parameters-form.js +5 -63
  181. package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +33 -101
  182. package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +12 -11
  183. package/dist/features/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +17 -16
  184. package/dist/features/parameters/short-circuit/short-circuit-study-area-tab-panel.js +15 -14
  185. package/dist/features/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -0
  186. package/dist/features/parameters/voltage-init/equipment-selection-parameters.js +6 -5
  187. package/dist/features/parameters/voltage-init/general-parameters.js +11 -10
  188. package/dist/features/parameters/voltage-init/voltage-init-parameters-dialog.js +13 -18
  189. package/dist/features/parameters/voltage-init/voltage-init-parameters-form.d.ts +2 -24
  190. package/dist/features/parameters/voltage-init/voltage-init-parameters-form.js +51 -108
  191. package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +34 -90
  192. package/dist/features/parameters/voltage-init/voltage-limits-parameters.js +2 -2
  193. package/dist/features/process-configs/security-analysis/update-sa-process-config.js +7 -6
  194. package/dist/features/topBar/AboutDialog.js +4 -7
  195. package/dist/index.js +13 -4
  196. package/dist/translations/en/commonButtonEn.d.ts +2 -0
  197. package/dist/translations/en/commonButtonEn.js +2 -0
  198. package/dist/translations/en/parameters.d.ts +1 -0
  199. package/dist/translations/en/parameters.js +3 -1
  200. package/dist/translations/fr/commonButtonFr.d.ts +2 -0
  201. package/dist/translations/fr/commonButtonFr.js +2 -0
  202. package/dist/translations/fr/parameters.d.ts +1 -0
  203. package/dist/translations/fr/parameters.js +3 -1
  204. package/dist/utils/types/elementType.d.ts +1 -0
  205. package/dist/utils/types/elementType.js +1 -0
  206. package/package.json +3 -2
  207. package/dist/features/parameters/common/ProviderParam.d.ts +0 -7
@@ -1,8 +1,8 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { Grid } from "@mui/material";
2
+ import { Grid2 } from "@mui/material";
3
3
  import { useEffect } from "react";
4
4
  import { useFormContext, useWatch } from "react-hook-form";
5
- import GridSection from "../../../../../../components/composite/grid/grid-section.js";
5
+ import { GridSection } from "../../../../../../components/composite/grid/grid-section.js";
6
6
  import "@mui/icons-material";
7
7
  import "react-intl";
8
8
  import "../../../../../../components/ui/overflowableText/OverflowableText.js";
@@ -44,9 +44,9 @@ function StructureTab() {
44
44
  const displayOmnibus = watchBusBarCount > 1 || watchSectionCount > 1;
45
45
  return /* @__PURE__ */ jsxs(Fragment, { children: [
46
46
  /* @__PURE__ */ jsx(GridSection, { title: "BusBarSections" }),
47
- /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
48
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(IntegerInput, { name: FieldConstants.BUS_BAR_COUNT, label: "BusBarCount" }) }),
49
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(IntegerInput, { name: FieldConstants.SECTION_COUNT, label: "numberOfSections" }) })
47
+ /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
48
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(IntegerInput, { name: FieldConstants.BUS_BAR_COUNT, label: "BusBarCount" }) }),
49
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(IntegerInput, { name: FieldConstants.SECTION_COUNT, label: "numberOfSections" }) })
50
50
  ] }),
51
51
  /* @__PURE__ */ jsx(SwitchesBetweenSections, {}),
52
52
  displayOmnibus && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1,7 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useEffect } from "react";
3
3
  import { useFormContext } from "react-hook-form";
4
- import { Grid } from "@mui/material";
4
+ import { Grid2 } from "@mui/material";
5
5
  import { AutocompleteInput } from "../../../../../../../components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js";
6
6
  import { FieldConstants } from "../../../../../../../utils/constants/fieldConstants.js";
7
7
  import "../../../../../../../utils/conversionUtils.js";
@@ -24,7 +24,7 @@ function CouplingOmnibusCreation({ index, sectionOptions }) {
24
24
  return () => unsubscribe();
25
25
  }, [subscribe, trigger, getValues, index]);
26
26
  return /* @__PURE__ */ jsxs(Fragment, { children: [
27
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
27
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
28
28
  AutocompleteInput,
29
29
  {
30
30
  allowNewValue: true,
@@ -35,7 +35,7 @@ function CouplingOmnibusCreation({ index, sectionOptions }) {
35
35
  size: "small"
36
36
  }
37
37
  ) }),
38
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
38
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
39
39
  AutocompleteInput,
40
40
  {
41
41
  allowNewValue: true,
@@ -32,7 +32,7 @@ import "../../../../../../../components/ui/snackbarProvider/SnackbarProvider.js"
32
32
  import "mui-nested-menu";
33
33
  import "react-resizable-panels";
34
34
  import "react-papaparse";
35
- import GridSection from "../../../../../../../components/composite/grid/grid-section.js";
35
+ import { GridSection } from "../../../../../../../components/composite/grid/grid-section.js";
36
36
  import { SWITCH_TYPE } from "../../../voltageLevelCreation.utils.js";
37
37
  import { MAX_SECTIONS_COUNT } from "../../../voltageLevel.constants.js";
38
38
  function SwitchesBetweenSections() {
@@ -1,6 +1,6 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useIntl } from "react-intl";
3
- import { Grid, IconButton } from "@mui/material";
3
+ import { Grid2, IconButton } from "@mui/material";
4
4
  import { Delete } from "@mui/icons-material";
5
5
  import { CustomTooltip } from "../../../../../../components/ui/tooltip/CustomTooltip.js";
6
6
  import "../../../../../../components/ui/overflowableText/OverflowableText.js";
@@ -33,7 +33,7 @@ import "../../../../../../components/ui/snackbarProvider/SnackbarProvider.js";
33
33
  import "mui-nested-menu";
34
34
  import "react-resizable-panels";
35
35
  import "react-papaparse";
36
- import GridSection from "../../../../../../components/composite/grid/grid-section.js";
36
+ import { GridSection } from "../../../../../../components/composite/grid/grid-section.js";
37
37
  import { PropertiesForm } from "../../../../common/properties/PropertiesForm.js";
38
38
  import "../../../../common/properties/propertyUtils.js";
39
39
  import "react-dom";
@@ -71,11 +71,11 @@ function SubstationCreationSection({
71
71
  const intl = useIntl();
72
72
  return /* @__PURE__ */ jsxs(Fragment, { children: [
73
73
  /* @__PURE__ */ jsx(GridSection, { title: "CreateSubstation" }),
74
- /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
75
- /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.SUBSTATION_CREATION_ID, label: "SubstationId" }) }),
76
- /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.SUBSTATION_NAME, label: "substationName" }) }),
77
- /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(CountrySelectionInput, { name: FieldConstants.COUNTRY, label: "Country", size: "small" }) }),
78
- showDeleteButton && onDelete && /* @__PURE__ */ jsx(Grid, { item: true, xs: 1, children: /* @__PURE__ */ jsx(CustomTooltip, { title: intl.formatMessage({ id: "DeleteRows" }), children: /* @__PURE__ */ jsx(IconButton, { onClick: onDelete, children: /* @__PURE__ */ jsx(Delete, {}) }) }) })
74
+ /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
75
+ /* @__PURE__ */ jsx(Grid2, { size: "grow", children: /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.SUBSTATION_CREATION_ID, label: "SubstationId" }) }),
76
+ /* @__PURE__ */ jsx(Grid2, { size: "grow", children: /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.SUBSTATION_NAME, label: "substationName" }) }),
77
+ /* @__PURE__ */ jsx(Grid2, { size: "grow", children: /* @__PURE__ */ jsx(CountrySelectionInput, { name: FieldConstants.COUNTRY, label: "Country", size: "small" }) }),
78
+ showDeleteButton && onDelete && /* @__PURE__ */ jsx(Grid2, { size: 1, children: /* @__PURE__ */ jsx(CustomTooltip, { title: intl.formatMessage({ id: "DeleteRows" }), children: /* @__PURE__ */ jsx(IconButton, { onClick: onDelete, children: /* @__PURE__ */ jsx(Delete, {}) }) }) })
79
79
  ] }),
80
80
  /* @__PURE__ */ jsx(PropertiesForm, { id: FieldConstants.SUBSTATION_CREATION, networkElementType: "substation" })
81
81
  ] });
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useWatch, useFormContext } from "react-hook-form";
3
3
  import { FormattedMessage } from "react-intl";
4
- import { Grid } from "@mui/material";
4
+ import { Grid2 } from "@mui/material";
5
5
  import { useCallback, useEffect } from "react";
6
6
  import { FieldConstants } from "../../../../../../utils/constants/fieldConstants.js";
7
7
  import "../../../../../../utils/conversionUtils.js";
@@ -56,8 +56,8 @@ function SubstationTab({ substationOptions, showDeleteButton }) {
56
56
  });
57
57
  }
58
58
  }, [setValue, getValues, watchAddSubstationCreation]);
59
- return watchAddSubstationCreation ? /* @__PURE__ */ jsx(SubstationCreationSection, { showDeleteButton, onDelete: handleDeleteSubstationCreation }) : /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, pt: 2, children: [
60
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: substationOptions ? /* @__PURE__ */ jsx(
59
+ return watchAddSubstationCreation ? /* @__PURE__ */ jsx(SubstationCreationSection, { showDeleteButton, onDelete: handleDeleteSubstationCreation }) : /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, pt: 2, children: [
60
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: substationOptions ? /* @__PURE__ */ jsx(
61
61
  AutocompleteInput,
62
62
  {
63
63
  name: FieldConstants.SUBSTATION_ID,
@@ -70,8 +70,8 @@ function SubstationTab({ substationOptions, showDeleteButton }) {
70
70
  noOptionsText: ""
71
71
  }
72
72
  ) : /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.SUBSTATION_ID, label: "SUBSTATION" }) }),
73
- /* @__PURE__ */ jsx(Grid, { item: true, mt: 0.75, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "Or" }) }),
74
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(AddButton, { label: "CreateSubstation", onClick: handleCreateSubstation }) })
73
+ /* @__PURE__ */ jsx(Grid2, { mt: 0.75, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "Or" }) }),
74
+ /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(AddButton, { label: "CreateSubstation", onClick: handleCreateSubstation }) })
75
75
  ] });
76
76
  }
77
77
  export {
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
- import { Grid2, TextField, Tabs, Tab, Box } from "@mui/material";
3
+ import { Stack, Grid2, TextField, Tabs, Tab, Box } from "@mui/material";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  import { useWatch } from "react-hook-form";
6
6
  import { VoltageAdornment, KiloAmpereAdornment } from "../../../../utils/constants/adornments.js";
@@ -37,7 +37,7 @@ import "mui-nested-menu";
37
37
  import "react-resizable-panels";
38
38
  import "react-papaparse";
39
39
  import "../../common/properties/propertyUtils.js";
40
- import GridSection from "../../../../components/composite/grid/grid-section.js";
40
+ import { GridSection } from "../../../../components/composite/grid/grid-section.js";
41
41
  import { BusbarSectionVoltageMeasurementsForm } from "../../common/measurements/BusbarSectionVoltageMeasurementsForm.js";
42
42
  import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
43
43
  import { getTabStyle, getTabIndicatorStyle } from "../../../parameters/parameters-style.js";
@@ -78,7 +78,7 @@ function VoltageLevelModificationForm({
78
78
  0
79
79
  /* CHARACTERISTICS_TAB */
80
80
  );
81
- return /* @__PURE__ */ jsxs(Grid2, { container: true, direction: "column", spacing: 2, children: [
81
+ return /* @__PURE__ */ jsxs(Stack, { spacing: 2, children: [
82
82
  /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
83
83
  /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
84
84
  TextField,
@@ -55,8 +55,8 @@ export declare const voltageLevelModificationWithMeasurementsFormSchema: import(
55
55
  } & {
56
56
  busbarSectionVMeasurements: {
57
57
  value: number | null;
58
- busbarSectionId: string;
59
58
  validity: boolean | null;
59
+ busbarSectionId: string;
60
60
  }[] | null;
61
61
  }, import('yup').AnyObject, {
62
62
  equipmentID: undefined;
@@ -1,5 +1,5 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Grid, Alert, CircularProgress } from "@mui/material";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Grid2, Stack, Alert, CircularProgress } from "@mui/material";
3
3
  import { forwardRef, useState, useImperativeHandle, useCallback, useEffect, useMemo } from "react";
4
4
  import { useIntl, FormattedMessage } from "react-intl";
5
5
  import { useFormContext } from "react-hook-form";
@@ -120,7 +120,7 @@ function ContingencyTableWithApiRef({ name, showContingencyCount = false, fetchC
120
120
  })
121
121
  );
122
122
  }, [intl]);
123
- return /* @__PURE__ */ jsxs(Grid, { container: true, direction: "column", children: [
123
+ return /* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsxs(Stack, { children: [
124
124
  /* @__PURE__ */ jsx(
125
125
  ParameterTableField,
126
126
  {
@@ -132,7 +132,7 @@ function ContingencyTableWithApiRef({ name, showContingencyCount = false, fetchC
132
132
  }
133
133
  ),
134
134
  showContingencyCount && renderContingencyCount()
135
- ] });
135
+ ] }) });
136
136
  }
137
137
  const ContingencyTable = forwardRef(ContingencyTableWithApiRef);
138
138
  export {
@@ -1,6 +1,6 @@
1
1
  import { SyntheticEvent } from 'react';
2
2
  import { FieldErrors } from 'react-hook-form';
3
- export type UseTabs<TTabValue extends string> = {
3
+ export type UseTabsReturn<TTabValue extends string> = {
4
4
  selectedTab: TTabValue;
5
5
  tabsWithError: TTabValue[];
6
6
  onTabChange: (event: SyntheticEvent, newValue: TTabValue) => void;
@@ -9,5 +9,6 @@ export type UseTabs<TTabValue extends string> = {
9
9
  export type UseTabsProps<TTabValue extends string> = {
10
10
  defaultTab: TTabValue;
11
11
  tabEnum: Record<string, TTabValue>;
12
+ errors: FieldErrors;
12
13
  };
13
- export declare function useTabs<TTabValue extends string>({ defaultTab, tabEnum, }: Readonly<UseTabsProps<TTabValue>>): UseTabs<TTabValue>;
14
+ export declare function useTabs<TTabValue extends string>({ defaultTab, tabEnum, errors, }: Readonly<UseTabsProps<TTabValue>>): UseTabsReturn<TTabValue>;
@@ -1,11 +1,10 @@
1
1
  import { useState, useCallback } from "react";
2
- import { useFormState } from "react-hook-form";
3
2
  import { isObjectEmpty } from "../../../../utils/functions.js";
4
3
  function useTabs({
5
4
  defaultTab,
6
- tabEnum
5
+ tabEnum,
6
+ errors
7
7
  }) {
8
- const { errors } = useFormState();
9
8
  const [selectedTab, setSelectedTab] = useState(defaultTab);
10
9
  const [tabsWithError, setTabsWithError] = useState([]);
11
10
  const onTabChange = useCallback(
@@ -4,13 +4,14 @@
4
4
  * License, v. 2.0. If a copy of the MPL was not distributed with this
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
+ export * from './parameter-layout';
7
8
  export * from './computing-type';
8
9
  export * from './constants';
9
10
  export * from './parameters-edition-dialog-props';
10
11
  export * from './line-separator';
11
12
  export * from './parameters';
12
13
  export * from './parameters-creation-dialog';
13
- export * from './ProviderParam';
14
+ export * from './provider-param';
14
15
  export * from './widget';
15
16
  export * from './voltage-level-table';
16
17
  export * from './limitreductions';
@@ -1,9 +1,11 @@
1
+ import { ParameterLayout } from "./parameter-layout/parameter-layout.js";
2
+ import { ParameterLayoutProvider, useParameterLayoutContext } from "./parameter-layout/parameter-layout-provider.js";
1
3
  import { formatComputingTypeLabel, isValidComputingType } from "./computing-type.js";
2
4
  import { COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./constants.js";
3
5
  import { LineSeparator } from "./line-separator.js";
4
6
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters.js";
5
7
  import { CreateParameterDialog } from "./parameters-creation-dialog.js";
6
- import { ProviderParam } from "./ProviderParam.js";
8
+ import { ProviderParam } from "./provider-param.js";
7
9
  import { ParameterFloat } from "./widget/parameter-float.js";
8
10
  import { ParameterGroup } from "./widget/parameter-group.js";
9
11
  import { ParameterLineDirectoryItemsInput } from "./widget/parameter-line-directory-items-input.js";
@@ -49,6 +51,8 @@ export {
49
51
  PROVIDER,
50
52
  ParameterFloat,
51
53
  ParameterGroup,
54
+ ParameterLayout,
55
+ ParameterLayoutProvider,
52
56
  ParameterLineDirectoryItemsInput,
53
57
  ParameterLineSlider,
54
58
  ParameterSwitch,
@@ -69,6 +73,7 @@ export {
69
73
  sanitizePercentageValue,
70
74
  toFormValuesContingencyListsInfos,
71
75
  toFormValuesLimitReductions,
76
+ useParameterLayoutContext,
72
77
  useParametersForm,
73
78
  useTabs
74
79
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { Grid, Divider } from "@mui/material";
2
+ import { Grid2, Divider } from "@mui/material";
3
3
  function LineSeparator() {
4
- return /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Divider, {}) });
4
+ return /* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(Divider, {}) });
5
5
  }
6
6
  export {
7
7
  LineSeparator
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Grid } from "@mui/material";
2
+ import { Grid2, Stack } from "@mui/material";
3
3
  import { DescriptionField } from "../../../../components/ui/reactHookForm/text/DescriptionField.js";
4
4
  import { UniqueNameInput } from "../../../../components/ui/reactHookForm/text/UniqueNameInput.js";
5
5
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
@@ -12,8 +12,8 @@ function NameElementEditorForm({
12
12
  activeDirectory,
13
13
  elementType
14
14
  }) {
15
- return /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, direction: "column", marginBottom: "8px", children: [
16
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
15
+ return /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsxs(Stack, { spacing: 2, marginBottom: "8px", children: [
16
+ /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
17
17
  UniqueNameInput,
18
18
  {
19
19
  name: FieldConstants.NAME,
@@ -25,7 +25,7 @@ function NameElementEditorForm({
25
25
  fullWidth: false
26
26
  }
27
27
  ) }),
28
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx: filterStyles.description }) })
28
+ /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx: filterStyles.description }) })
29
29
  ] }) });
30
30
  }
31
31
  export {
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Grid, Typography, Chip } from "@mui/material";
2
+ import { Grid2, Typography, Chip } from "@mui/material";
3
3
  import { FormattedMessage } from "react-intl";
4
4
  import { CustomTooltip } from "../../../components/ui/tooltip/CustomTooltip.js";
5
5
  import { parametersStyles } from "../parameters-style.js";
@@ -41,6 +41,7 @@ import "mui-nested-menu";
41
41
  import "react-resizable-panels";
42
42
  import "react-papaparse";
43
43
  import { LineSeparator } from "./line-separator.js";
44
+ import "./parameter-layout/parameter-layout-provider.js";
44
45
  import "./widget/parameter-line-slider.js";
45
46
  import "./limitreductions/columns-definitions.js";
46
47
  import "./contingency-table/contingency-table.js";
@@ -96,9 +97,9 @@ function ParameterField({ id, name, type, label, description, possibleValues, sx
96
97
  return null;
97
98
  }
98
99
  };
99
- return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, paddingTop: 1, justifyContent: "space-between", children: [
100
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 8, children: /* @__PURE__ */ jsx(CustomTooltip, { title: description, children: /* @__PURE__ */ jsx(Typography, { sx: parametersStyles.parameterName, children: label ? /* @__PURE__ */ jsx(FormattedMessage, { id: label }) : name }) }, name) }),
101
- /* @__PURE__ */ jsx(Grid, { item: true, container: true, xs: 4, sx: parametersStyles.controlItem, children: renderField() }),
100
+ return /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 1, paddingTop: 1, justifyContent: "space-between", sx: { width: "100%" }, children: [
101
+ /* @__PURE__ */ jsx(Grid2, { size: 8, children: /* @__PURE__ */ jsx(CustomTooltip, { title: description, children: /* @__PURE__ */ jsx(Typography, { sx: parametersStyles.parameterName, children: label ? /* @__PURE__ */ jsx(FormattedMessage, { id: label }) : name }) }, name) }),
102
+ /* @__PURE__ */ jsx(Grid2, { container: true, size: 4, sx: parametersStyles.controlItem, children: renderField() }),
102
103
  /* @__PURE__ */ jsx(LineSeparator, {})
103
104
  ] }, name);
104
105
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2025, 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 * from './parameter-layout';
8
+ export * from './parameter-layout-provider';
@@ -0,0 +1,7 @@
1
+ import { ParameterLayout } from "./parameter-layout.js";
2
+ import { ParameterLayoutProvider, useParameterLayoutContext } from "./parameter-layout-provider.js";
3
+ export {
4
+ ParameterLayout,
5
+ ParameterLayoutProvider,
6
+ useParameterLayoutContext
7
+ };
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ interface ParameterLayoutContextValue {
3
+ isXsScreen: boolean;
4
+ }
5
+ export declare const useParameterLayoutContext: () => ParameterLayoutContextValue;
6
+ export declare function ParameterLayoutProvider({ isXsScreen, children, }: Readonly<{
7
+ isXsScreen: boolean;
8
+ children: ReactNode;
9
+ }>): import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { createContext, useMemo, useContext } from "react";
3
+ const ParameterLayoutContext = createContext({ isXsScreen: false });
4
+ const useParameterLayoutContext = () => useContext(ParameterLayoutContext);
5
+ function ParameterLayoutProvider({
6
+ isXsScreen,
7
+ children
8
+ }) {
9
+ const isXsScreenMemo = useMemo(() => ({ isXsScreen }), [isXsScreen]);
10
+ return /* @__PURE__ */ jsx(ParameterLayoutContext.Provider, { value: isXsScreenMemo, children });
11
+ }
12
+ export {
13
+ ParameterLayoutProvider,
14
+ useParameterLayoutContext
15
+ };
@@ -0,0 +1,23 @@
1
+ import { MouseEventHandler, ReactNode } from 'react';
2
+ import { UUID } from 'node:crypto';
3
+ import { FieldValues, UseFormGetValues } from 'react-hook-form';
4
+ import { TreeViewFinderNodeProps } from '../../../../components/ui';
5
+ import { ElementType } from '../../../../utils';
6
+ export type CreateParameterDialogConfig<T extends FieldValues> = {
7
+ studyUuid: UUID | null;
8
+ getParameterValues: UseFormGetValues<T>;
9
+ parameterFormatter: (params: FieldValues) => any;
10
+ };
11
+ interface ParameterLayoutProps<T extends FieldValues> {
12
+ children: ReactNode;
13
+ title?: string;
14
+ isLoading?: boolean;
15
+ parameterType: ElementType;
16
+ createParameter?: CreateParameterDialogConfig<T>;
17
+ selectParameterHandler?: (nodes: TreeViewFinderNodeProps[]) => void;
18
+ resetHandler?: () => void;
19
+ validateHandler?: MouseEventHandler<HTMLButtonElement>;
20
+ validateDisabled?: boolean;
21
+ }
22
+ export declare function ParameterLayout<T extends FieldValues>({ children, title, isLoading, createParameter, resetHandler, validateHandler, validateDisabled, selectParameterHandler, parameterType, }: Readonly<ParameterLayoutProps<T>>): import("react").JSX.Element;
23
+ export {};
@@ -0,0 +1,167 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Stack, Box, Grid2, ButtonGroup, Tooltip, LinearProgress } from "@mui/material";
3
+ import { Upload, RestartAlt } from "@mui/icons-material";
4
+ import { useState, useCallback } from "react";
5
+ import { useIntl, FormattedMessage } from "react-intl";
6
+ import { LabelledButton } from "../parameters.js";
7
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
8
+ import "../../../../utils/conversionUtils.js";
9
+ import "../../../../utils/types/equipmentType.js";
10
+ import "react-hook-form";
11
+ import "localized-countries";
12
+ import "localized-countries/data/fr";
13
+ import "localized-countries/data/en";
14
+ import "notistack";
15
+ import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
16
+ import { SubmitButton } from "../../../../components/ui/reactHookForm/utils/SubmitButton.js";
17
+ import "yup";
18
+ import { DirectoryItemSelector } from "../../../../components/ui/directoryItemSelector/DirectoryItemSelector.js";
19
+ import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
20
+ import { PopupConfirmationDialog } from "../../../../components/ui/dialogs/popupConfirmationDialog/PopupConfirmationDialog.js";
21
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
22
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
23
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
24
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
25
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
26
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
27
+ import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
28
+ import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
29
+ import "@hello-pangea/dnd";
30
+ import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
31
+ import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
32
+ import "mui-nested-menu";
33
+ import "react-resizable-panels";
34
+ import "react-papaparse";
35
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
36
+ import { CreateParameterDialog } from "../parameters-creation-dialog.js";
37
+ import { LineSeparator } from "../line-separator.js";
38
+ import { useParameterLayoutContext } from "./parameter-layout-provider.js";
39
+ const styles = {
40
+ stack: {
41
+ height: "100%"
42
+ },
43
+ title: {
44
+ paddingBottom: 0
45
+ },
46
+ content: {
47
+ flexGrow: 1,
48
+ overflowY: "auto",
49
+ overflowX: "hidden"
50
+ }
51
+ };
52
+ function ParameterLayout({
53
+ children,
54
+ title,
55
+ isLoading,
56
+ createParameter,
57
+ resetHandler,
58
+ validateHandler,
59
+ validateDisabled,
60
+ selectParameterHandler,
61
+ parameterType
62
+ }) {
63
+ const { isXsScreen } = useParameterLayoutContext();
64
+ const [openCreateParameterDialog, setOpenCreateParameterDialog] = useState(false);
65
+ const [openSelectParameterDialog, setOpenSelectParameterDialog] = useState(false);
66
+ const [openResetConfirmation, setOpenResetConfirmation] = useState(false);
67
+ const handlePrefillClick = useCallback(() => {
68
+ setOpenSelectParameterDialog(true);
69
+ }, []);
70
+ const handleSaveClick = useCallback(() => {
71
+ setOpenCreateParameterDialog(true);
72
+ }, []);
73
+ const handleResetClick = useCallback(() => {
74
+ setOpenResetConfirmation(true);
75
+ }, []);
76
+ const handleCancelReset = useCallback(() => {
77
+ setOpenResetConfirmation(false);
78
+ }, []);
79
+ const intl = useIntl();
80
+ return /* @__PURE__ */ jsxs(Stack, { sx: styles.stack, children: [
81
+ (title || selectParameterHandler || resetHandler) && /* @__PURE__ */ jsx(Box, { sx: styles.title, children: /* @__PURE__ */ jsxs(Grid2, { container: true, sx: { alignItems: "center", justifyContent: "space-between" }, children: [
82
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: title && !isXsScreen && /* @__PURE__ */ jsx(FormattedMessage, { id: title }) }),
83
+ /* @__PURE__ */ jsx(Grid2, { size: "auto", children: /* @__PURE__ */ jsxs(ButtonGroup, { children: [
84
+ selectParameterHandler && /* @__PURE__ */ jsx(
85
+ LabelledButton,
86
+ {
87
+ callback: handlePrefillClick,
88
+ label: "button.prefill",
89
+ "data-testid": "PrefillButton",
90
+ startIcon: /* @__PURE__ */ jsx(Upload, {})
91
+ }
92
+ ),
93
+ resetHandler && /* @__PURE__ */ jsx(Tooltip, { title: /* @__PURE__ */ jsx(FormattedMessage, { id: "tooltip.reset" }), children: /* @__PURE__ */ jsx(
94
+ LabelledButton,
95
+ {
96
+ callback: handleResetClick,
97
+ label: "button.reset",
98
+ "data-testid": "ResetButton",
99
+ startIcon: /* @__PURE__ */ jsx(RestartAlt, {})
100
+ }
101
+ ) })
102
+ ] }) })
103
+ ] }) }),
104
+ /* @__PURE__ */ jsx(Box, { sx: styles.content, children: isLoading ? /* @__PURE__ */ jsx(LinearProgress, {}) : children }),
105
+ /* @__PURE__ */ jsxs(Stack, { spacing: 1, children: [
106
+ /* @__PURE__ */ jsx(LineSeparator, {}),
107
+ /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 1, children: [
108
+ createParameter && /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(LabelledButton, { label: "save", "data-testid": "SaveButton", callback: handleSaveClick }) }),
109
+ validateHandler && /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
110
+ SubmitButton,
111
+ {
112
+ variant: "contained",
113
+ "data-testid": "ValidateButton",
114
+ onClick: validateHandler,
115
+ disabled: validateDisabled
116
+ }
117
+ ) })
118
+ ] })
119
+ ] }),
120
+ openCreateParameterDialog && createParameter && /* @__PURE__ */ jsx(
121
+ CreateParameterDialog,
122
+ {
123
+ studyUuid: createParameter?.studyUuid,
124
+ open: openCreateParameterDialog,
125
+ onClose: () => setOpenCreateParameterDialog(false),
126
+ parameterValues: createParameter?.getParameterValues,
127
+ parameterFormatter: createParameter?.parameterFormatter,
128
+ parameterType
129
+ }
130
+ ),
131
+ openSelectParameterDialog && selectParameterHandler && /* @__PURE__ */ jsx(
132
+ DirectoryItemSelector,
133
+ {
134
+ open: openSelectParameterDialog,
135
+ onClose: (nodes) => {
136
+ setOpenSelectParameterDialog(false);
137
+ selectParameterHandler(nodes);
138
+ },
139
+ types: [parameterType],
140
+ title: intl.formatMessage({
141
+ id: "showSelectParameterDialog"
142
+ }),
143
+ onlyLeaves: true,
144
+ multiSelect: false,
145
+ validationButtonText: intl.formatMessage({
146
+ id: "validate"
147
+ })
148
+ }
149
+ ),
150
+ openResetConfirmation && resetHandler && /* @__PURE__ */ jsx(
151
+ PopupConfirmationDialog,
152
+ {
153
+ message: "resetParamsConfirmation",
154
+ validateButtonLabel: "validate",
155
+ openConfirmationPopup: openResetConfirmation,
156
+ setOpenConfirmationPopup: handleCancelReset,
157
+ handlePopupConfirmation: () => {
158
+ resetHandler();
159
+ setOpenResetConfirmation(false);
160
+ }
161
+ }
162
+ )
163
+ ] });
164
+ }
165
+ export {
166
+ ParameterLayout
167
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Grid, Typography } from "@mui/material";
2
+ import { Grid2, Typography } from "@mui/material";
3
3
  import { FormattedMessage } from "react-intl";
4
4
  import { useFieldArray, useFormContext } from "react-hook-form";
5
5
  import { Info } from "@mui/icons-material";
@@ -84,8 +84,8 @@ function ParameterTableField({
84
84
  },
85
85
  [isValidRow, onChange]
86
86
  );
87
- return /* @__PURE__ */ jsxs(Grid, { container: true, sx: sxContainerProps, children: [
88
- label && /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", paddingBottom: 2, paddingTop: 2, children: [
87
+ return /* @__PURE__ */ jsxs(Grid2, { container: true, sx: sxContainerProps, size: 12, children: [
88
+ label && /* @__PURE__ */ jsxs(Grid2, { container: true, alignItems: "center", paddingBottom: 2, paddingTop: 2, children: [
89
89
  /* @__PURE__ */ jsx(Typography, { component: "span", variant: "h6", children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }),
90
90
  tooltipProps && /* @__PURE__ */ jsx(
91
91
  CustomTooltip,
@@ -1,14 +1,14 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { FormattedMessage } from "react-intl";
3
- import { Typography, Box, Button, Grid, Switch } from "@mui/material";
3
+ import { Typography, Box, Button, Grid2, Switch } from "@mui/material";
4
4
  import { parametersStyles } from "../parameters-style.js";
5
5
  function LabelledButton({ callback, label, ...props }) {
6
6
  return /* @__PURE__ */ jsx(Button, { onClick: callback, ...props, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) });
7
7
  }
8
8
  function SwitchWithLabel({ value, label, callback }) {
9
9
  return /* @__PURE__ */ jsxs(Fragment, { children: [
10
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 8, sx: parametersStyles.parameterName, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }),
11
- /* @__PURE__ */ jsx(Grid, { item: true, container: true, xs: 4, sx: parametersStyles.controlItem, children: /* @__PURE__ */ jsx(
10
+ /* @__PURE__ */ jsx(Grid2, { size: 8, sx: parametersStyles.parameterName, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }),
11
+ /* @__PURE__ */ jsx(Grid2, { container: true, size: 4, sx: parametersStyles.controlItem, children: /* @__PURE__ */ jsx(
12
12
  Switch,
13
13
  {
14
14
  checked: value,
@@ -0,0 +1,10 @@
1
+ import { SxProps } from '@mui/material';
2
+ export interface ProviderParamProps {
3
+ options: {
4
+ id: string;
5
+ label: string;
6
+ }[];
7
+ id?: string;
8
+ sx?: SxProps;
9
+ }
10
+ export declare function ProviderParam({ options, id, sx }: Readonly<ProviderParamProps>): import("react").JSX.Element;