@gridsuite/commons-ui 0.167.0 → 0.168.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 (37) 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/index.js +5 -2
  6. package/dist/components/parameters/index.js +3 -1
  7. package/dist/components/parameters/short-circuit/columns-definition.d.ts +30 -0
  8. package/dist/components/parameters/short-circuit/columns-definition.js +127 -0
  9. package/dist/components/parameters/short-circuit/constants.d.ts +2 -0
  10. package/dist/components/parameters/short-circuit/constants.js +4 -0
  11. package/dist/components/parameters/short-circuit/index.js +3 -1
  12. package/dist/components/parameters/short-circuit/short-circuit-fields.js +25 -5
  13. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table-cell.d.ts +7 -0
  14. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table-cell.js +75 -0
  15. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table-row.d.ts +9 -0
  16. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table-row.js +35 -0
  17. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table.d.ts +8 -0
  18. package/dist/components/parameters/short-circuit/short-circuit-icc-cluster-table.js +59 -0
  19. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-cell.d.ts +1 -1
  20. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-cell.js +3 -3
  21. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-row.d.ts +1 -1
  22. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-row.js +1 -1
  23. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table.d.ts +2 -3
  24. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table.js +26 -31
  25. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.d.ts +3 -2
  26. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +100 -13
  27. package/dist/components/parameters/short-circuit/short-circuit-parameters.type.d.ts +20 -1
  28. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +5 -4
  29. package/dist/index.js +5 -2
  30. package/dist/translations/en/parameters.d.ts +18 -10
  31. package/dist/translations/en/parameters.js +18 -10
  32. package/dist/translations/fr/parameters.d.ts +18 -10
  33. package/dist/translations/fr/parameters.js +18 -10
  34. package/dist/utils/types/metadata.d.ts +1 -0
  35. package/package.json +1 -1
  36. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-columns-definition.d.ts +0 -18
  37. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-columns-definition.js +0 -47
@@ -8,6 +8,7 @@ export type CsvDownloadProps = {
8
8
  skipPinnedBottom?: boolean;
9
9
  language: GsLangUser;
10
10
  getData: (params?: CsvExportParams) => string | undefined | void;
11
+ isCopyCsv?: boolean;
11
12
  };
12
13
  export type CsvExportProps = CsvDownloadProps & {
13
14
  disabled: boolean;
@@ -1,8 +1,9 @@
1
1
  import { CsvExport } from "./csv-export.js";
2
2
  import { ExportCsvButton } from "./export-csv-button.js";
3
- import { useCsvExport } from "./use-csv-export.js";
3
+ import { fetchCsvSeparator, useCsvExport } from "./use-csv-export.js";
4
4
  export {
5
5
  CsvExport,
6
6
  ExportCsvButton,
7
+ fetchCsvSeparator,
7
8
  useCsvExport
8
9
  };
@@ -1,4 +1,5 @@
1
1
  import { CsvDownloadProps } from './csv-export.type';
2
+ export declare const fetchCsvSeparator: () => Promise<string | undefined>;
2
3
  export declare const useCsvExport: () => {
3
- getData: (props: CsvDownloadProps) => string | undefined | void;
4
+ getData: (props: CsvDownloadProps) => Promise<string | undefined | void>;
4
5
  };
@@ -6,11 +6,15 @@ import { LANG_FRENCH } from "../../utils/langs.js";
6
6
  import "react/jsx-runtime";
7
7
  import "@mui/icons-material";
8
8
  import "../../utils/yupConfig.js";
9
+ import { fetchStudyMetadata } from "../../services/appsMetadata.js";
9
10
  const NA_VALUE = "N/A";
11
+ const fetchCsvSeparator = async () => {
12
+ return fetchStudyMetadata().then((metadata) => metadata.copyCsvSeparator);
13
+ };
10
14
  const useCsvExport = () => {
11
15
  const intl = useIntl();
12
16
  const getData = useCallback(
13
- (props) => {
17
+ async (props) => {
14
18
  const formatNAValue = (value) => {
15
19
  return value === NA_VALUE ? intl.formatMessage({ id: "export/undefined" }) : value;
16
20
  };
@@ -30,10 +34,12 @@ const useCsvExport = () => {
30
34
  return tableName.trim().replace(/[\\/:"*?<>|\s]/g, "-").substring(0, 27);
31
35
  };
32
36
  const prefix = props.tableNamePrefix ?? "";
37
+ const defaultSeparator = props.language === LANG_FRENCH ? ";" : ",";
38
+ const columnSeparatorValue = props.isCopyCsv ? await fetchCsvSeparator() ?? defaultSeparator : defaultSeparator;
33
39
  return props.getData({
34
40
  suppressQuotes: false,
35
41
  skipPinnedBottom: props.skipPinnedBottom,
36
- columnSeparator: props.language === LANG_FRENCH ? ";" : ",",
42
+ columnSeparator: columnSeparatorValue,
37
43
  columnKeys: props.columns.map((col) => col.colId).filter(hasColId),
38
44
  skipColumnHeaders: props.skipColumnHeaders,
39
45
  processHeaderCallback: (params) => params.column.getColDef().headerComponentParams?.displayName ?? params.column.getColDef().headerName ?? params.column.getColId(),
@@ -46,5 +52,6 @@ const useCsvExport = () => {
46
52
  return { getData };
47
53
  };
48
54
  export {
55
+ fetchCsvSeparator,
49
56
  useCsvExport
50
57
  };
@@ -16,7 +16,7 @@ import { CardErrorBoundary } from "./cardErrorBoundary/CardErrorBoundary.js";
16
16
  import { CheckBoxList } from "./checkBoxList/CheckBoxList.js";
17
17
  import { CsvExport } from "./csvDownloader/csv-export.js";
18
18
  import { ExportCsvButton } from "./csvDownloader/export-csv-button.js";
19
- import { useCsvExport } from "./csvDownloader/use-csv-export.js";
19
+ import { fetchCsvSeparator, useCsvExport } from "./csvDownloader/use-csv-export.js";
20
20
  import { CUSTOM_AGGRID_THEME, styles } from "./customAGGrid/customAggrid.style.js";
21
21
  import { CustomAGGrid } from "./customAGGrid/customAggrid.js";
22
22
  import { SeparatorCellRenderer } from "./customAGGrid/separatorCellRenderer.js";
@@ -160,7 +160,7 @@ import { NetworkVisualizationsParametersEditionDialog } from "./parameters/netwo
160
160
  import { BALANCE_TYPE, CONNECTED_MODE, COUNTRIES_TO_BALANCE, DC, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, DEFAULT_LIMIT_REDUCTION_VALUE, DISTRIBUTED_SLACK, HVDC_AC_EMULATION, MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW, PHASE_SHIFTER_REGULATION_ON, READ_SLACK_BUS, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, WRITE_SLACK_BUS, alertThresholdMarks } from "./parameters/loadflow/constants.js";
161
161
  import { LoadFlowParametersInline } from "./parameters/loadflow/load-flow-parameters-inline.js";
162
162
  import { LoadFlowParametersEditionDialog } from "./parameters/loadflow/load-flow-parameters-dialog.js";
163
- 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 "./parameters/short-circuit/constants.js";
163
+ 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_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 "./parameters/short-circuit/constants.js";
164
164
  import { ShortCircuitParametersInLine } from "./parameters/short-circuit/short-circuit-parameters-inline.js";
165
165
  import { ShortCircuitParametersEditionDialog } from "./parameters/short-circuit/short-circuit-parameters-dialog.js";
166
166
  import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD, DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, DEFAULT_UPDATE_BUS_VOLTAGE, GENERAL, GENERAL_APPLY_MODIFICATIONS, GENERATORS_SELECTION_TYPE, HIGH_VOLTAGE_LIMIT, LEG_SIDE, LOW_VOLTAGE_LIMIT, PRIORITY, RATIO_TAP_CHANGER_POSITION, RATIO_TAP_CHANGER_TARGET_V, REACTIVE_SLACKS_THRESHOLD, SELECTION_TYPE, SHUNT_COMPENSATORS_SELECTION_TYPE, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, TRANSFORMERS_SELECTION_TYPE, UPDATE_BUS_VOLTAGE, VARIABLE_Q_GENERATORS, VARIABLE_SHUNT_COMPENSATORS, VARIABLE_TRANSFORMERS, VOLTAGE_LIMITS_DEFAULT, VOLTAGE_LIMITS_MODIFICATION, VoltageInitTabValues } from "./parameters/voltage-init/constants.js";
@@ -444,6 +444,8 @@ export {
444
444
  SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
445
445
  SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
446
446
  SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
447
+ SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTER,
448
+ SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
447
449
  SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
448
450
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
449
451
  SHORT_CIRCUIT_VOLTAGE_RANGES,
@@ -533,6 +535,7 @@ export {
533
535
  explicitNamingFilterSchema,
534
536
  exportExpertRules,
535
537
  extractDefault,
538
+ fetchCsvSeparator,
536
539
  fetchPredefinedProperties,
537
540
  filledTextField,
538
541
  formatComputingTypeLabel,
@@ -23,7 +23,7 @@ import { NetworkVisualizationsParametersEditionDialog } from "./network-visualiz
23
23
  import { BALANCE_TYPE, CONNECTED_MODE, COUNTRIES_TO_BALANCE, DC, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, DEFAULT_LIMIT_REDUCTION_VALUE, DISTRIBUTED_SLACK, HVDC_AC_EMULATION, MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW, PHASE_SHIFTER_REGULATION_ON, READ_SLACK_BUS, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, WRITE_SLACK_BUS, alertThresholdMarks } from "./loadflow/constants.js";
24
24
  import { LoadFlowParametersInline } from "./loadflow/load-flow-parameters-inline.js";
25
25
  import { LoadFlowParametersEditionDialog } from "./loadflow/load-flow-parameters-dialog.js";
26
- 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 "./short-circuit/constants.js";
26
+ 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_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 "./short-circuit/constants.js";
27
27
  import { ShortCircuitParametersInLine } from "./short-circuit/short-circuit-parameters-inline.js";
28
28
  import { ShortCircuitParametersEditionDialog } from "./short-circuit/short-circuit-parameters-dialog.js";
29
29
  import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD, DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, DEFAULT_UPDATE_BUS_VOLTAGE, GENERAL, GENERAL_APPLY_MODIFICATIONS, GENERATORS_SELECTION_TYPE, HIGH_VOLTAGE_LIMIT, LEG_SIDE, LOW_VOLTAGE_LIMIT, PRIORITY, RATIO_TAP_CHANGER_POSITION, RATIO_TAP_CHANGER_TARGET_V, REACTIVE_SLACKS_THRESHOLD, SELECTION_TYPE, SHUNT_COMPENSATORS_SELECTION_TYPE, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, TRANSFORMERS_SELECTION_TYPE, UPDATE_BUS_VOLTAGE, VARIABLE_Q_GENERATORS, VARIABLE_SHUNT_COMPENSATORS, VARIABLE_TRANSFORMERS, VOLTAGE_LIMITS_DEFAULT, VOLTAGE_LIMITS_MODIFICATION, VoltageInitTabValues } from "./voltage-init/constants.js";
@@ -163,6 +163,8 @@ export {
163
163
  SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
164
164
  SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
165
165
  SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
166
+ SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTER,
167
+ SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
166
168
  SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
167
169
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
168
170
  SHORT_CIRCUIT_VOLTAGE_RANGES,
@@ -0,0 +1,30 @@
1
+ import { EquipmentType } from '../../../utils';
2
+ export declare const SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE = "active";
3
+ export declare const SHORT_CIRCUIT_ICC_MATERIAL_TYPE = "type";
4
+ export declare const SHORT_CIRCUIT_ICC_MATERIAL_ALPHA = "alpha";
5
+ export declare const SHORT_CIRCUIT_ICC_MATERIAL_USMIN = "usMin";
6
+ export declare const SHORT_CIRCUIT_ICC_MATERIAL_USMAX = "usMax";
7
+ export declare const SHORT_CIRCUIT_ICC_MATERIAL_U0 = "u0";
8
+ export declare const SHORT_CIRCUIT_ICC_CLUSTER_ACTIVE = "active";
9
+ export declare const SHORT_CIRCUIT_ICC_CLUSTER_FILTERS = "filters";
10
+ export declare const SHORT_CIRCUIT_ICC_CLUSTER_TYPE = "type";
11
+ export declare const SHORT_CIRCUIT_ICC_CLUSTER_ALPHA = "alpha";
12
+ export declare const SHORT_CIRCUIT_ICC_CLUSTER_USMIN = "usMin";
13
+ export declare const SHORT_CIRCUIT_ICC_CLUSTER_USMAX = "usMax";
14
+ export declare const SHORT_CIRCUIT_ICC_CLUSTER_U0 = "u0";
15
+ export interface IccCommonIColumnsDef {
16
+ label: React.ReactNode;
17
+ dataKey: string;
18
+ tooltip: React.ReactNode;
19
+ width?: string;
20
+ }
21
+ export interface IccMaterialIColumnsDef extends IccCommonIColumnsDef {
22
+ }
23
+ export interface IccClusterIColumnsDef extends IccCommonIColumnsDef {
24
+ equipmentTypes?: EquipmentType[];
25
+ elementType?: string;
26
+ titleId?: string;
27
+ initialValue?: any;
28
+ }
29
+ export declare const COLUMNS_DEFINITIONS_ICC_MATERIALS: IccMaterialIColumnsDef[];
30
+ export declare const COLUMNS_DEFINITIONS_ICC_CLUSTERS: IccClusterIColumnsDef[];
@@ -0,0 +1,127 @@
1
+ import "../../../utils/conversionUtils.js";
2
+ import { ElementType } from "../../../utils/types/elementType.js";
3
+ import { EquipmentType } from "../../../utils/types/equipmentType.js";
4
+ import "react/jsx-runtime";
5
+ import "@mui/icons-material";
6
+ import "../../../utils/yupConfig.js";
7
+ const SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE = "active";
8
+ const SHORT_CIRCUIT_ICC_MATERIAL_TYPE = "type";
9
+ const SHORT_CIRCUIT_ICC_MATERIAL_ALPHA = "alpha";
10
+ const SHORT_CIRCUIT_ICC_MATERIAL_USMIN = "usMin";
11
+ const SHORT_CIRCUIT_ICC_MATERIAL_USMAX = "usMax";
12
+ const SHORT_CIRCUIT_ICC_MATERIAL_U0 = "u0";
13
+ const SHORT_CIRCUIT_ICC_CLUSTER_ACTIVE = SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE;
14
+ const SHORT_CIRCUIT_ICC_CLUSTER_FILTERS = "filters";
15
+ const SHORT_CIRCUIT_ICC_CLUSTER_TYPE = SHORT_CIRCUIT_ICC_MATERIAL_TYPE;
16
+ const SHORT_CIRCUIT_ICC_CLUSTER_ALPHA = SHORT_CIRCUIT_ICC_MATERIAL_ALPHA;
17
+ const SHORT_CIRCUIT_ICC_CLUSTER_USMIN = SHORT_CIRCUIT_ICC_MATERIAL_USMIN;
18
+ const SHORT_CIRCUIT_ICC_CLUSTER_USMAX = SHORT_CIRCUIT_ICC_MATERIAL_USMAX;
19
+ const SHORT_CIRCUIT_ICC_CLUSTER_U0 = SHORT_CIRCUIT_ICC_MATERIAL_U0;
20
+ const COLUMNS_DEFINITIONS_ICC_MATERIALS = [
21
+ {
22
+ label: "ShortCircuitIccActive",
23
+ dataKey: SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE,
24
+ tooltip: "ShortCircuitIccMaterialActiveTooltip",
25
+ width: "8%"
26
+ },
27
+ {
28
+ label: "ShortCircuitIccMaterialType",
29
+ dataKey: SHORT_CIRCUIT_ICC_MATERIAL_TYPE,
30
+ tooltip: "ShortCircuitIccMaterialTypeTooltip"
31
+ },
32
+ {
33
+ label: "ShortCircuitIccAlpha",
34
+ dataKey: SHORT_CIRCUIT_ICC_MATERIAL_ALPHA,
35
+ tooltip: "ShortCircuitIccAlphaTooltip",
36
+ width: "8%"
37
+ },
38
+ {
39
+ label: "ShortCircuitIccUsmin",
40
+ dataKey: SHORT_CIRCUIT_ICC_MATERIAL_USMIN,
41
+ tooltip: "ShortCircuitIccUsminTooltip",
42
+ width: "8%"
43
+ },
44
+ {
45
+ label: "ShortCircuitIccUsmax",
46
+ dataKey: SHORT_CIRCUIT_ICC_MATERIAL_USMAX,
47
+ tooltip: "ShortCircuitIccUsmaxTooltip",
48
+ width: "8%"
49
+ },
50
+ {
51
+ label: "ShortCircuitIccU0",
52
+ dataKey: SHORT_CIRCUIT_ICC_MATERIAL_U0,
53
+ tooltip: "ShortCircuitIccU0Tooltip",
54
+ width: "8%"
55
+ }
56
+ ];
57
+ const COLUMNS_DEFINITIONS_ICC_CLUSTERS = [
58
+ {
59
+ label: "ShortCircuitIccActive",
60
+ dataKey: SHORT_CIRCUIT_ICC_CLUSTER_ACTIVE,
61
+ tooltip: "ShortCircuitIccClusterActiveTooltip",
62
+ initialValue: false,
63
+ width: "8%"
64
+ },
65
+ {
66
+ label: "ShortCircuitIccClusterFilters",
67
+ dataKey: SHORT_CIRCUIT_ICC_CLUSTER_FILTERS,
68
+ tooltip: "ShortCircuitIccClusterFiltersTooltip",
69
+ equipmentTypes: [EquipmentType.GENERATOR, EquipmentType.BATTERY],
70
+ elementType: ElementType.FILTER,
71
+ titleId: "FiltersListsSelection",
72
+ initialValue: []
73
+ },
74
+ {
75
+ label: "ShortCircuitIccClusterType",
76
+ dataKey: SHORT_CIRCUIT_ICC_CLUSTER_TYPE,
77
+ tooltip: "ShortCircuitIccClusterTypeTooltip",
78
+ titleId: "ShortCircuitIccClusterTypeListsSelection",
79
+ initialValue: [],
80
+ width: "15%"
81
+ },
82
+ {
83
+ label: "ShortCircuitIccAlpha",
84
+ dataKey: SHORT_CIRCUIT_ICC_CLUSTER_ALPHA,
85
+ tooltip: "ShortCircuitIccAlphaTooltip",
86
+ initialValue: 1,
87
+ width: "8%"
88
+ },
89
+ {
90
+ label: "ShortCircuitIccUsmin",
91
+ dataKey: SHORT_CIRCUIT_ICC_CLUSTER_USMIN,
92
+ tooltip: "ShortCircuitIccUsminTooltip",
93
+ initialValue: 0,
94
+ width: "8%"
95
+ },
96
+ {
97
+ label: "ShortCircuitIccUsmax",
98
+ dataKey: SHORT_CIRCUIT_ICC_CLUSTER_USMAX,
99
+ tooltip: "ShortCircuitIccUsmaxTooltip",
100
+ initialValue: 100,
101
+ width: "8%"
102
+ },
103
+ {
104
+ label: "ShortCircuitIccU0",
105
+ dataKey: SHORT_CIRCUIT_ICC_CLUSTER_U0,
106
+ tooltip: "ShortCircuitIccU0Tooltip",
107
+ initialValue: 100,
108
+ width: "8%"
109
+ }
110
+ ];
111
+ export {
112
+ COLUMNS_DEFINITIONS_ICC_CLUSTERS,
113
+ COLUMNS_DEFINITIONS_ICC_MATERIALS,
114
+ SHORT_CIRCUIT_ICC_CLUSTER_ACTIVE,
115
+ SHORT_CIRCUIT_ICC_CLUSTER_ALPHA,
116
+ SHORT_CIRCUIT_ICC_CLUSTER_FILTERS,
117
+ SHORT_CIRCUIT_ICC_CLUSTER_TYPE,
118
+ SHORT_CIRCUIT_ICC_CLUSTER_U0,
119
+ SHORT_CIRCUIT_ICC_CLUSTER_USMAX,
120
+ SHORT_CIRCUIT_ICC_CLUSTER_USMIN,
121
+ SHORT_CIRCUIT_ICC_MATERIAL_ACTIVE,
122
+ SHORT_CIRCUIT_ICC_MATERIAL_ALPHA,
123
+ SHORT_CIRCUIT_ICC_MATERIAL_TYPE,
124
+ SHORT_CIRCUIT_ICC_MATERIAL_U0,
125
+ SHORT_CIRCUIT_ICC_MATERIAL_USMAX,
126
+ SHORT_CIRCUIT_ICC_MATERIAL_USMIN
127
+ };
@@ -25,6 +25,8 @@ 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_CLUSTER = "powerElectronicsCluster";
29
+ export declare const SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS = "powerElectronicsClusters";
28
30
  export declare const intlPredefinedParametersOptions: () => {
29
31
  id: string;
30
32
  label: string;
@@ -21,6 +21,8 @@ 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_CLUSTER = "powerElectronicsCluster";
25
+ const SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS = "powerElectronicsClusters";
24
26
  const intlPredefinedParametersOptions = () => [
25
27
  {
26
28
  id: "ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP",
@@ -63,6 +65,8 @@ export {
63
65
  SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
64
66
  SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
65
67
  SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
68
+ SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTER,
69
+ SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
66
70
  SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
67
71
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
68
72
  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_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,8 @@ 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_CLUSTER,
11
+ SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
10
12
  SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
11
13
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
12
14
  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"
@@ -245,8 +258,15 @@ function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
245
258
  ShortCircuitIccMaterialTable,
246
259
  {
247
260
  formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS}`,
248
- tableHeight: 300,
249
- columnsDefinition: columnsDef
261
+ columnsDefinition: iccMaterialsColumnsDef
262
+ }
263
+ ),
264
+ /* @__PURE__ */ jsx(
265
+ ShortCircuitIccClusterTable,
266
+ {
267
+ formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS}`,
268
+ columnsDefinition: iccClustersColumnsDef,
269
+ createRows
250
270
  }
251
271
  )
252
272
  ] })
@@ -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: ["WIND", "SOLAR", "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(4)
13
+ }),
14
+ table: {
15
+ minWidth: "80em",
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,