@gridsuite/commons-ui 0.167.0 → 0.169.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 (53) hide show
  1. package/dist/components/csvDownloader/csv-export.type.d.ts +1 -0
  2. package/dist/components/csvDownloader/index.js +2 -1
  3. package/dist/components/csvDownloader/use-csv-export.d.ts +2 -1
  4. package/dist/components/csvDownloader/use-csv-export.js +9 -2
  5. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.d.ts +4 -9
  6. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +39 -54
  7. package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +1 -3
  8. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +1 -2
  9. package/dist/components/filter/FilterCreationDialog.js +7 -5
  10. package/dist/components/filter/expert/ExpertFilterEditionDialog.js +7 -5
  11. package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +7 -5
  12. package/dist/components/index.js +4 -2
  13. package/dist/components/inputs/reactHookForm/text/TextInput.js +1 -1
  14. package/dist/components/inputs/reactHookForm/utils/TextFieldWithAdornment.js +1 -1
  15. package/dist/components/parameters/index.js +2 -1
  16. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +6 -4
  17. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +6 -4
  18. package/dist/components/parameters/pcc-min/pcc-min-parameters-dialog.js +6 -4
  19. package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +6 -4
  20. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +6 -4
  21. package/dist/components/parameters/short-circuit/columns-definition.d.ts +30 -0
  22. package/dist/components/parameters/short-circuit/columns-definition.js +127 -0
  23. package/dist/components/parameters/short-circuit/constants.d.ts +1 -0
  24. package/dist/components/parameters/short-circuit/constants.js +2 -0
  25. package/dist/components/parameters/short-circuit/index.js +2 -1
  26. package/dist/components/parameters/short-circuit/short-circuit-fields.js +30 -13
  27. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table-cell.d.ts +7 -0
  28. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table-cell.js +75 -0
  29. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table-row.d.ts +9 -0
  30. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table-row.js +35 -0
  31. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table.d.ts +8 -0
  32. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table.js +59 -0
  33. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-cell.d.ts +1 -1
  34. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-cell.js +3 -3
  35. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-row.d.ts +1 -1
  36. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-row.js +1 -1
  37. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table.d.ts +2 -3
  38. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table.js +27 -31
  39. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +6 -4
  40. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.d.ts +3 -2
  41. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +100 -13
  42. package/dist/components/parameters/short-circuit/short-circuit-parameters.type.d.ts +20 -1
  43. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +5 -4
  44. package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +6 -4
  45. package/dist/index.js +4 -2
  46. package/dist/translations/en/parameters.d.ts +18 -13
  47. package/dist/translations/en/parameters.js +18 -13
  48. package/dist/translations/fr/parameters.d.ts +18 -13
  49. package/dist/translations/fr/parameters.js +18 -13
  50. package/dist/utils/types/metadata.d.ts +2 -0
  51. package/package.json +1 -1
  52. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-columns-definition.d.ts +0 -18
  53. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-columns-definition.js +0 -47
@@ -25,6 +25,7 @@ export declare const SHORT_CIRCUIT_VOLTAGE_RANGES = "voltageRanges";
25
25
  export declare const SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER = "onlyStartedGeneratorsInCalculationCluster";
26
26
  export declare const SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS = "modelPowerElectronics";
27
27
  export declare const SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS = "powerElectronicsMaterials";
28
+ export declare const SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS = "powerElectronicsClusters";
28
29
  export declare const intlPredefinedParametersOptions: () => {
29
30
  id: string;
30
31
  label: string;
@@ -21,6 +21,7 @@ const SHORT_CIRCUIT_VOLTAGE_RANGES = "voltageRanges";
21
21
  const SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER = "onlyStartedGeneratorsInCalculationCluster";
22
22
  const SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS = "modelPowerElectronics";
23
23
  const SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS = "powerElectronicsMaterials";
24
+ const SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS = "powerElectronicsClusters";
24
25
  const intlPredefinedParametersOptions = () => [
25
26
  {
26
27
  id: "ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP",
@@ -63,6 +64,7 @@ export {
63
64
  SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
64
65
  SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
65
66
  SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
67
+ SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
66
68
  SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
67
69
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
68
70
  SHORT_CIRCUIT_VOLTAGE_RANGES,
@@ -1,4 +1,4 @@
1
- import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions, onlyStartedGeneratorsOptions } from "./constants.js";
1
+ import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions, onlyStartedGeneratorsOptions } from "./constants.js";
2
2
  import { ShortCircuitParametersInLine } from "./short-circuit-parameters-inline.js";
3
3
  import { ShortCircuitParametersEditionDialog } from "./short-circuit-parameters-dialog.js";
4
4
  export {
@@ -7,6 +7,7 @@ export {
7
7
  SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
8
8
  SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
9
9
  SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
10
+ SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
10
11
  SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
11
12
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
12
13
  SHORT_CIRCUIT_VOLTAGE_RANGES,
@@ -5,7 +5,7 @@ import { green, red } from "@mui/material/colors";
5
5
  import { Lens } from "@mui/icons-material";
6
6
  import { useWatch, useFormContext } from "react-hook-form";
7
7
  import { FormattedMessage } from "react-intl";
8
- import { SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, intlPredefinedParametersOptions, intlInitialVoltageProfileMode, onlyStartedGeneratorsOptions, PredefinedParameters, InitialVoltage, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS } from "./constants.js";
8
+ import { SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, intlPredefinedParametersOptions, intlInitialVoltageProfileMode, onlyStartedGeneratorsOptions, PredefinedParameters, InitialVoltage, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS } from "./constants.js";
9
9
  import { VoltageTable } from "./short-circuit-voltage-table.js";
10
10
  import GridItem from "../../grid/grid-item.js";
11
11
  import GridSection from "../../grid/grid-section.js";
@@ -47,17 +47,30 @@ import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
47
47
  import "../common/widget/parameter-line-slider.js";
48
48
  import "../common/limitreductions/columns-definitions.js";
49
49
  import { ShortCircuitIccMaterialTable } from "./short-circuit-icc-material-table.js";
50
- import { COLUMNS_DEFINITIONS_ICC_MATERIALS } from "./short-circuit-icc-material-table-columns-definition.js";
50
+ import { COLUMNS_DEFINITIONS_ICC_MATERIALS, COLUMNS_DEFINITIONS_ICC_CLUSTERS } from "./columns-definition.js";
51
+ import { ShortCircuitIccClusterTable } from "./short-circuit-icc-cluster-table.js";
51
52
  var Status = /* @__PURE__ */ ((Status2) => {
52
53
  Status2["SUCCESS"] = "SUCCESS";
53
54
  Status2["ERROR"] = "ERROR";
54
55
  return Status2;
55
56
  })(Status || {});
56
- const columnsDef = COLUMNS_DEFINITIONS_ICC_MATERIALS.map((col) => ({
57
+ const iccMaterialsColumnsDef = COLUMNS_DEFINITIONS_ICC_MATERIALS.map((col) => ({
57
58
  ...col,
58
59
  label: /* @__PURE__ */ jsx(FormattedMessage, { id: col.label }),
59
60
  tooltip: /* @__PURE__ */ jsx(FormattedMessage, { id: col.tooltip })
60
61
  }));
62
+ const iccClustersColumnsDef = COLUMNS_DEFINITIONS_ICC_CLUSTERS.map((col) => ({
63
+ ...col,
64
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: col.label }),
65
+ tooltip: /* @__PURE__ */ jsx(FormattedMessage, { id: col.tooltip })
66
+ }));
67
+ function createRows() {
68
+ const rowData = {};
69
+ iccClustersColumnsDef.forEach((column) => {
70
+ rowData[column.dataKey] = column.initialValue;
71
+ });
72
+ return rowData;
73
+ }
61
74
  function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
62
75
  const [status, setStatus] = useState(
63
76
  "SUCCESS"
@@ -188,13 +201,10 @@ function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
188
201
  }
189
202
  }
190
203
  );
191
- const modelPowerElectronics = /* @__PURE__ */ jsx(
192
- CheckboxInput,
193
- {
194
- name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS}`,
195
- label: "ShortCircuitModelPowerElectronics"
196
- }
197
- );
204
+ const modelPowerElectronics = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
205
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "ShortCircuitModelPowerElectronics" }) }),
206
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS}` }) })
207
+ ] });
198
208
  useEffect(() => {
199
209
  const isIccMaxWithNominalVoltageMap = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP;
200
210
  const isIccMinWithNominal = watchPredefinedParams === PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP;
@@ -240,13 +250,20 @@ function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
240
250
  /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: onlyStartedGeneratorsInCalculationCluster }) }),
241
251
  isDeveloperMode && /* @__PURE__ */ jsxs(Fragment, { children: [
242
252
  /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitPowerElectronicsSection", heading: 4 }),
243
- /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: modelPowerElectronics }) }),
253
+ /* @__PURE__ */ jsx(Grid, { container: true, xl: 6, children: /* @__PURE__ */ jsx(GridItem, { size: 10, children: modelPowerElectronics }) }),
244
254
  /* @__PURE__ */ jsx(
245
255
  ShortCircuitIccMaterialTable,
246
256
  {
247
257
  formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS}`,
248
- tableHeight: 300,
249
- columnsDefinition: columnsDef
258
+ columnsDefinition: iccMaterialsColumnsDef
259
+ }
260
+ ),
261
+ /* @__PURE__ */ jsx(
262
+ ShortCircuitIccClusterTable,
263
+ {
264
+ formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS}`,
265
+ columnsDefinition: iccClustersColumnsDef,
266
+ createRows
250
267
  }
251
268
  )
252
269
  ] })
@@ -0,0 +1,7 @@
1
+ import { IccClusterIColumnsDef } from './columns-definition';
2
+ export declare function ShortCircuitIccClusterTableCell({ formName, rowIndex, column, inputsDisabled, }: Readonly<{
3
+ formName: string;
4
+ rowIndex: number;
5
+ column: IccClusterIColumnsDef;
6
+ inputsDisabled?: boolean;
7
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,75 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { TableCell } from "@mui/material";
3
+ import "react-intl";
4
+ import "../../overflowableText/OverflowableText.js";
5
+ import "../../../utils/conversionUtils.js";
6
+ import "../../../utils/types/equipmentType.js";
7
+ import "@mui/icons-material";
8
+ import "../../../utils/yupConfig.js";
9
+ import "react";
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 "../../inputs/reactHookForm/provider/CustomFormProvider.js";
16
+ import "yup";
17
+ import { DirectoryItemsInput } from "../../inputs/reactHookForm/DirectoryItemsInput.js";
18
+ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
19
+ import "../../customAGGrid/customAggrid.js";
20
+ import "ag-grid-community";
21
+ import "react-papaparse";
22
+ import "react-csv-downloader";
23
+ import { SwitchInput } from "../../inputs/reactHookForm/booleans/SwitchInput.js";
24
+ import { FloatInput } from "../../inputs/reactHookForm/numbers/FloatInput.js";
25
+ import "../../inputs/reactHookForm/numbers/RangeInput.js";
26
+ import { SelectInput } from "../../inputs/reactHookForm/selectInputs/SelectInput.js";
27
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
28
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
29
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
30
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
31
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
32
+ import "@react-querybuilder/material";
33
+ import "../../filter/expert/expertFilterConstants.js";
34
+ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
35
+ import "uuid";
36
+ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
37
+ import "react-querybuilder";
38
+ import { SHORT_CIRCUIT_ICC_CLUSTER_ACTIVE, SHORT_CIRCUIT_ICC_CLUSTER_FILTERS, SHORT_CIRCUIT_ICC_CLUSTER_TYPE } from "./columns-definition.js";
39
+ function ShortCircuitIccClusterTableCell({
40
+ formName,
41
+ rowIndex,
42
+ column,
43
+ inputsDisabled
44
+ }) {
45
+ return /* @__PURE__ */ jsxs(TableCell, { align: "center", sx: { fontWeight: "bold" }, children: [
46
+ column.dataKey === SHORT_CIRCUIT_ICC_CLUSTER_ACTIVE && /* @__PURE__ */ jsx(SwitchInput, { formProps: { size: "small" }, name: `${formName}[${rowIndex}].${column.dataKey}` }),
47
+ column.dataKey === SHORT_CIRCUIT_ICC_CLUSTER_FILTERS && /* @__PURE__ */ jsx(
48
+ DirectoryItemsInput,
49
+ {
50
+ name: `${formName}[${rowIndex}].${column.dataKey}`,
51
+ equipmentTypes: column.equipmentTypes,
52
+ elementType: column.elementType ?? "",
53
+ titleId: column.titleId,
54
+ hideErrorMessage: true,
55
+ label: void 0,
56
+ itemFilter: void 0,
57
+ disable: inputsDisabled
58
+ }
59
+ ),
60
+ column.dataKey === SHORT_CIRCUIT_ICC_CLUSTER_TYPE && /* @__PURE__ */ jsx(
61
+ SelectInput,
62
+ {
63
+ size: "small",
64
+ name: `${formName}[${rowIndex}].${column.dataKey}`,
65
+ label: column.titleId,
66
+ options: ["GENERATOR", "HVDC"],
67
+ disabled: inputsDisabled
68
+ }
69
+ ),
70
+ column.dataKey !== SHORT_CIRCUIT_ICC_CLUSTER_ACTIVE && column.dataKey !== SHORT_CIRCUIT_ICC_CLUSTER_FILTERS && column.dataKey !== SHORT_CIRCUIT_ICC_CLUSTER_TYPE && /* @__PURE__ */ jsx(FloatInput, { disabled: inputsDisabled, name: `${formName}[${rowIndex}].${column.dataKey}` })
71
+ ] });
72
+ }
73
+ export {
74
+ ShortCircuitIccClusterTableCell
75
+ };
@@ -0,0 +1,9 @@
1
+ import { IccClusterIColumnsDef } from './columns-definition';
2
+ interface ShortCircuitIccClusterTableRowProps {
3
+ formName: string;
4
+ columnsDefinition: IccClusterIColumnsDef[];
5
+ index: number;
6
+ onDeleteButton: (index: number) => void;
7
+ }
8
+ export declare function ShortCircuitIccClusterTableRow({ formName, columnsDefinition, index, onDeleteButton, }: Readonly<ShortCircuitIccClusterTableRowProps>): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,35 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { TableRow, TableCell, Tooltip, IconButton } from "@mui/material";
3
+ import { Delete } from "@mui/icons-material";
4
+ import { useWatch } from "react-hook-form";
5
+ import { useState } from "react";
6
+ import { FormattedMessage } from "react-intl";
7
+ import { SHORT_CIRCUIT_ICC_CLUSTER_ACTIVE } from "./columns-definition.js";
8
+ import { ShortCircuitIccClusterTableCell } from "./short-circuit-icc-cluster-table-cell.js";
9
+ function ShortCircuitIccClusterTableRow({
10
+ formName,
11
+ columnsDefinition,
12
+ index,
13
+ onDeleteButton
14
+ }) {
15
+ const [isHover, setIsHover] = useState(false);
16
+ const watchRowActive = useWatch({
17
+ name: `${formName}[${index}].${SHORT_CIRCUIT_ICC_CLUSTER_ACTIVE}`
18
+ });
19
+ return /* @__PURE__ */ jsxs(TableRow, { onMouseEnter: () => setIsHover(true), onMouseLeave: () => setIsHover(false), children: [
20
+ columnsDefinition.map((column) => /* @__PURE__ */ jsx(
21
+ ShortCircuitIccClusterTableCell,
22
+ {
23
+ formName,
24
+ rowIndex: index,
25
+ column,
26
+ inputsDisabled: !watchRowActive
27
+ },
28
+ `${column.dataKey}`
29
+ )),
30
+ /* @__PURE__ */ jsx(TableCell, { align: "center", children: isHover && /* @__PURE__ */ jsx(Tooltip, { title: /* @__PURE__ */ jsx(FormattedMessage, { id: "DeleteRows" }), children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => onDeleteButton(index), children: /* @__PURE__ */ jsx(Delete, { fontSize: "small" }) }) }) })
31
+ ] });
32
+ }
33
+ export {
34
+ ShortCircuitIccClusterTableRow
35
+ };
@@ -0,0 +1,8 @@
1
+ import { IccClusterIColumnsDef } from './columns-definition';
2
+ interface ShortCircuitIccClusterTableProps {
3
+ columnsDefinition: IccClusterIColumnsDef[];
4
+ formName: string;
5
+ createRows: () => unknown;
6
+ }
7
+ export declare function ShortCircuitIccClusterTable({ formName, columnsDefinition, createRows, }: Readonly<ShortCircuitIccClusterTableProps>): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,59 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { TableContainer, Table, TableHead, TableRow, Tooltip, TableCell, IconButton, TableBody } from "@mui/material";
3
+ import { AddCircle } from "@mui/icons-material";
4
+ import { useFieldArray } from "react-hook-form";
5
+ import { FormattedMessage } from "react-intl";
6
+ import { useCallback } from "react";
7
+ import { ShortCircuitIccClusterTableRow } from "./short-circuit-icc-cluster-table-row.js";
8
+ const styles = {
9
+ tableContainer: (theme) => ({
10
+ width: "100%",
11
+ border: "solid 0px rgba(0,0,0,0.1)",
12
+ marginBottom: theme.spacing(2)
13
+ }),
14
+ table: {
15
+ minWidth: "65em",
16
+ tableLayout: "fixed"
17
+ }
18
+ };
19
+ function ShortCircuitIccClusterTable({
20
+ formName,
21
+ columnsDefinition,
22
+ createRows
23
+ }) {
24
+ const {
25
+ fields: rows,
26
+ append,
27
+ remove
28
+ } = useFieldArray({
29
+ name: formName
30
+ });
31
+ const handleAddRowsButton = useCallback(() => {
32
+ append(createRows());
33
+ }, [append, createRows]);
34
+ const handleDeleteButton = useCallback(
35
+ (index) => {
36
+ remove(index);
37
+ },
38
+ [remove]
39
+ );
40
+ return /* @__PURE__ */ jsx(TableContainer, { sx: styles.tableContainer, children: /* @__PURE__ */ jsxs(Table, { stickyHeader: true, size: "small", sx: styles.table, children: [
41
+ /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
42
+ columnsDefinition.map((column) => /* @__PURE__ */ jsx(Tooltip, { title: column.tooltip, children: /* @__PURE__ */ jsx(TableCell, { align: "center", sx: { width: column.width }, children: column.label }) }, column.dataKey)),
43
+ /* @__PURE__ */ jsx(TableCell, { align: "center", sx: { width: "5%" }, children: /* @__PURE__ */ jsx(Tooltip, { title: /* @__PURE__ */ jsx(FormattedMessage, { id: "AddRows" }), children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(IconButton, { size: "small", disabled: false, onClick: handleAddRowsButton, children: /* @__PURE__ */ jsx(AddCircle, { fontSize: "small" }) }) }) }) })
44
+ ] }) }),
45
+ /* @__PURE__ */ jsx(TableBody, { children: rows.map((row, index) => /* @__PURE__ */ jsx(
46
+ ShortCircuitIccClusterTableRow,
47
+ {
48
+ columnsDefinition,
49
+ index,
50
+ formName,
51
+ onDeleteButton: handleDeleteButton
52
+ },
53
+ `${row.id}`
54
+ )) })
55
+ ] }) });
56
+ }
57
+ export {
58
+ ShortCircuitIccClusterTable
59
+ };
@@ -1,4 +1,4 @@
1
- import { IccMaterialIColumnsDef } from './short-circuit-icc-material-table-columns-definition';
1
+ import { IccMaterialIColumnsDef } from './columns-definition';
2
2
  export declare function ShortCircuitIccMaterialTableCell({ formName, rowIndex, column, inputsDisabled, }: Readonly<{
3
3
  formName: string;
4
4
  rowIndex: number;
@@ -35,15 +35,15 @@ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
35
35
  import "uuid";
36
36
  import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
37
37
  import "react-querybuilder";
38
- import { SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE, SHORT_CIRCUIT_ICC_MATERIAL_TYPE } from "./short-circuit-icc-material-table-columns-definition.js";
38
+ import { SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE, SHORT_CIRCUIT_ICC_MATERIAL_TYPE } from "./columns-definition.js";
39
39
  function ShortCircuitIccMaterialTableCell({
40
40
  formName,
41
41
  rowIndex,
42
42
  column,
43
43
  inputsDisabled
44
44
  }) {
45
- return /* @__PURE__ */ jsxs(TableCell, { sx: { fontWeight: "bold" }, children: [
46
- column.dataKey === SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE && /* @__PURE__ */ jsx(SwitchInput, { name: `${formName}[${rowIndex}].${column.dataKey}` }),
45
+ return /* @__PURE__ */ jsxs(TableCell, { align: "center", sx: { fontWeight: "bold" }, children: [
46
+ column.dataKey === SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE && /* @__PURE__ */ jsx(SwitchInput, { formProps: { size: "small" }, name: `${formName}[${rowIndex}].${column.dataKey}` }),
47
47
  column.dataKey === SHORT_CIRCUIT_ICC_MATERIAL_TYPE && /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${formName}[${rowIndex}].${column.dataKey}` }),
48
48
  column.dataKey !== SHORT_CIRCUIT_ICC_MATERIAL_TYPE && column.dataKey !== SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE && /* @__PURE__ */ jsx(FloatInput, { disabled: inputsDisabled, name: `${formName}[${rowIndex}].${column.dataKey}` })
49
49
  ] });
@@ -1,4 +1,4 @@
1
- import { IccMaterialIColumnsDef } from './short-circuit-icc-material-table-columns-definition';
1
+ import { IccMaterialIColumnsDef } from './columns-definition';
2
2
  interface ShortCircuitIccMaterialTableRowProps {
3
3
  formName: string;
4
4
  columnsDefinition: IccMaterialIColumnsDef[];
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { TableRow } from "@mui/material";
3
3
  import { useWatch } from "react-hook-form";
4
- import { SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE } from "./short-circuit-icc-material-table-columns-definition.js";
4
+ import { SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE } from "./columns-definition.js";
5
5
  import { ShortCircuitIccMaterialTableCell } from "./short-circuit-icc-material-table-cell.js";
6
6
  function ShortCircuitIccMaterialTableRow({
7
7
  formName,
@@ -1,8 +1,7 @@
1
- import { IccMaterialIColumnsDef } from './short-circuit-icc-material-table-columns-definition';
1
+ import { IccMaterialIColumnsDef } from './columns-definition';
2
2
  interface ShortCircuitIccMaterialTableProps {
3
3
  columnsDefinition: IccMaterialIColumnsDef[];
4
- tableHeight: number;
5
4
  formName: string;
6
5
  }
7
- export declare function ShortCircuitIccMaterialTable({ formName, columnsDefinition, tableHeight, }: Readonly<ShortCircuitIccMaterialTableProps>): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ShortCircuitIccMaterialTable({ formName, columnsDefinition, }: Readonly<ShortCircuitIccMaterialTableProps>): import("react/jsx-runtime").JSX.Element;
8
7
  export {};
@@ -2,44 +2,40 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { TableContainer, Table, TableHead, TableRow, Tooltip, TableCell, TableBody } from "@mui/material";
3
3
  import { useFieldArray } from "react-hook-form";
4
4
  import { ShortCircuitIccMaterialTableRow } from "./short-circuit-icc-material-table-row.js";
5
+ const styles = {
6
+ tableContainer: (theme) => ({
7
+ width: "100%",
8
+ border: "solid 0px rgba(0,0,0,0.1)",
9
+ marginBottom: theme.spacing(4),
10
+ marginTop: theme.spacing(4)
11
+ }),
12
+ table: {
13
+ minWidth: "65em",
14
+ tableLayout: "fixed"
15
+ }
16
+ };
5
17
  function ShortCircuitIccMaterialTable({
6
18
  formName,
7
- columnsDefinition,
8
- tableHeight
19
+ columnsDefinition
9
20
  }) {
10
21
  const { fields: rows } = useFieldArray({
11
22
  name: formName
12
23
  });
13
- return /* @__PURE__ */ jsx(
14
- TableContainer,
15
- {
16
- sx: {
17
- height: tableHeight,
18
- width: "inherit",
19
- border: "solid 0px rgba(0,0,0,0.1)"
24
+ return /* @__PURE__ */ jsx(TableContainer, { sx: styles.tableContainer, children: /* @__PURE__ */ jsxs(Table, { stickyHeader: true, size: "small", sx: styles.table, children: [
25
+ /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
26
+ columnsDefinition.map((column) => /* @__PURE__ */ jsx(Tooltip, { title: column.tooltip, children: /* @__PURE__ */ jsx(TableCell, { align: "center", sx: { width: column.width }, children: column.label }) }, column.dataKey)),
27
+ /* @__PURE__ */ jsx(TableCell, { align: "center", sx: { visibility: "hidden", width: "5%" } })
28
+ ] }) }),
29
+ /* @__PURE__ */ jsx(TableBody, { children: rows.map((row, index) => /* @__PURE__ */ jsx(
30
+ ShortCircuitIccMaterialTableRow,
31
+ {
32
+ columnsDefinition,
33
+ index,
34
+ formName
20
35
  },
21
- children: /* @__PURE__ */ jsxs(Table, { stickyHeader: true, size: "small", sx: { tableLayout: "fixed" }, children: [
22
- /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow, { children: columnsDefinition.map((column) => /* @__PURE__ */ jsx(Tooltip, { title: column.tooltip, children: /* @__PURE__ */ jsx(
23
- TableCell,
24
- {
25
- sx: {
26
- textAlign: "center"
27
- },
28
- children: column.label
29
- }
30
- ) }, column.dataKey)) }) }),
31
- /* @__PURE__ */ jsx(TableBody, { children: rows.map((row, index) => /* @__PURE__ */ jsx(
32
- ShortCircuitIccMaterialTableRow,
33
- {
34
- columnsDefinition,
35
- index,
36
- formName
37
- },
38
- `${row.id}`
39
- )) })
40
- ] })
41
- }
42
- );
36
+ `${row.id}`
37
+ )) })
38
+ ] }) });
43
39
  }
44
40
  export {
45
41
  ShortCircuitIccMaterialTable
@@ -85,11 +85,13 @@ function ShortCircuitParametersEditionDialog({
85
85
  onClose,
86
86
  onSave: shortCircuitMethods.onSaveDialog,
87
87
  onValidationError: shortCircuitMethods.onValidationError,
88
- formSchema: shortCircuitMethods.formSchema,
89
- formMethods: shortCircuitMethods.formMethods,
88
+ formContext: {
89
+ ...shortCircuitMethods.formMethods,
90
+ validationSchema: shortCircuitMethods.formSchema,
91
+ removeOptional: true,
92
+ language
93
+ },
90
94
  titleId,
91
- removeOptional: true,
92
- language,
93
95
  disabledSave: disableSave,
94
96
  children: /* @__PURE__ */ jsx(
95
97
  ShortCircuitParametersForm,
@@ -1,6 +1,7 @@
1
1
  import { InitialVoltage } from './constants';
2
2
  import { default as yup } from '../../../utils/yupConfig';
3
3
  import { SpecificParameterInfos, SpecificParametersValues } from '../../../utils';
4
+ import { SnackInputs } from '../../../hooks';
4
5
  export declare const getCommonShortCircuitParametersFormSchema: () => yup.ObjectSchema<{
5
6
  commonParameters: {
6
7
  withFeederResult: NonNullable<boolean | undefined>;
@@ -29,6 +30,6 @@ export declare const getSpecificShortCircuitParametersFormSchema: (specificParam
29
30
  [x: string]: any;
30
31
  };
31
32
  }, "">;
32
- export declare const getDefaultShortCircuitSpecificParamsValues: (specificParametersDescriptionForProvider: SpecificParameterInfos[]) => SpecificParametersValues;
33
+ export declare const getDefaultShortCircuitSpecificParamsValues: (specificParametersDescriptionForProvider: SpecificParameterInfos[], snackError: (message: SnackInputs) => void) => SpecificParametersValues;
33
34
  export declare const getShortCircuitSpecificParametersValues: (formData: Record<string, any>, _specificParametersValues: SpecificParametersValues) => SpecificParametersValues;
34
- export declare const formatShortCircuitSpecificParameters: (specificParametersDescriptionForProvider: SpecificParameterInfos[], specificParamsList: SpecificParametersValues) => SpecificParametersValues;
35
+ export declare const formatShortCircuitSpecificParameters: (specificParametersDescriptionForProvider: SpecificParameterInfos[], specificParamsList: SpecificParametersValues, snackError: (message: SnackInputs) => void) => SpecificParametersValues;