@gridsuite/commons-ui 0.166.0 → 0.167.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 (55) hide show
  1. package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +2 -2
  2. package/dist/components/dnd-table/dnd-table.d.ts +1 -2
  3. package/dist/components/dnd-table/dnd-table.js +2 -0
  4. package/dist/components/dnd-table/dnd-table.type.d.ts +6 -1
  5. package/dist/components/dnd-table/dnd-table.type.js +1 -0
  6. package/dist/components/index.js +15 -0
  7. package/dist/components/parameters/common/ProviderParam.js +2 -2
  8. package/dist/components/parameters/common/parameter-dnd-table-field.d.ts +9 -0
  9. package/dist/components/parameters/common/parameter-dnd-table-field.js +85 -0
  10. package/dist/components/parameters/common/parameter-field.d.ts +15 -0
  11. package/dist/components/parameters/{loadflow/load-flow-parameter-field.js → common/parameter-field.js} +7 -13
  12. package/dist/components/parameters/dynamic-margin-calculation/constants.d.ts +18 -0
  13. package/dist/components/parameters/dynamic-margin-calculation/constants.js +26 -0
  14. package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-dialog.d.ts +6 -0
  15. package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-dialog.js +1 -0
  16. package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.d.ts +9 -0
  17. package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +95 -0
  18. package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.d.ts +10 -0
  19. package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +176 -0
  20. package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation.type.d.ts +10 -0
  21. package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation.type.js +8 -0
  22. package/dist/components/parameters/dynamic-margin-calculation/index.d.ts +8 -0
  23. package/dist/components/parameters/dynamic-margin-calculation/index.js +17 -0
  24. package/dist/components/parameters/dynamic-margin-calculation/loads-variations-parameters.d.ts +29 -0
  25. package/dist/components/parameters/dynamic-margin-calculation/loads-variations-parameters.js +154 -0
  26. package/dist/components/parameters/dynamic-margin-calculation/time-delay-parameters.d.ts +24 -0
  27. package/dist/components/parameters/dynamic-margin-calculation/time-delay-parameters.js +62 -0
  28. package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.d.ts +30 -0
  29. package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +179 -0
  30. package/dist/components/parameters/index.d.ts +1 -0
  31. package/dist/components/parameters/index.js +15 -0
  32. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +4 -4
  33. package/dist/index.js +22 -0
  34. package/dist/services/dynamic-margin-calculation.d.ts +5 -0
  35. package/dist/services/dynamic-margin-calculation.js +35 -0
  36. package/dist/services/index.d.ts +1 -0
  37. package/dist/services/index.js +4 -0
  38. package/dist/translations/en/businessErrorsEn.d.ts +2 -0
  39. package/dist/translations/en/businessErrorsEn.js +3 -1
  40. package/dist/translations/en/parameters.d.ts +20 -0
  41. package/dist/translations/en/parameters.js +22 -1
  42. package/dist/translations/fr/businessErrorsFr.d.ts +2 -0
  43. package/dist/translations/fr/businessErrorsFr.js +3 -1
  44. package/dist/translations/fr/parameters.d.ts +20 -0
  45. package/dist/translations/fr/parameters.js +22 -1
  46. package/dist/utils/index.js +3 -0
  47. package/dist/utils/types/dynamic-margin-calculation.type.d.ts +32 -0
  48. package/dist/utils/types/dynamic-margin-calculation.type.js +14 -0
  49. package/dist/utils/types/elementType.d.ts +1 -0
  50. package/dist/utils/types/elementType.js +1 -0
  51. package/dist/utils/types/index.d.ts +1 -0
  52. package/dist/utils/types/index.js +3 -0
  53. package/dist/utils/types/parameters.type.d.ts +2 -1
  54. package/package.json +1 -1
  55. package/dist/components/parameters/loadflow/load-flow-parameter-field.d.ts +0 -19
@@ -19,8 +19,8 @@ function DndTableBottomRightButtons({
19
19
  name: arrayFormName
20
20
  });
21
21
  const noRowsSelected = currentRows ? !currentRows.some((row) => row[SELECTED]) : true;
22
- const firstRowSelected = currentRows[0]?.[SELECTED];
23
- const lastRowSelected = currentRows[currentRows.length - 1]?.[SELECTED];
22
+ const firstRowSelected = noRowsSelected ? void 0 : currentRows[0]?.[SELECTED];
23
+ const lastRowSelected = noRowsSelected ? void 0 : currentRows[currentRows.length - 1]?.[SELECTED];
24
24
  return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, xs: true, spacing: 1, sx: { justifyContent: "flex-end" }, children: [
25
25
  /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
26
26
  Tooltip,
@@ -1,6 +1,6 @@
1
1
  import { UseFieldArrayReturn } from 'react-hook-form';
2
2
  import { DndColumn } from './dnd-table.type';
3
- interface DndTableProps {
3
+ export interface DndTableProps {
4
4
  arrayFormName: string;
5
5
  useFieldArrayOutput: UseFieldArrayReturn;
6
6
  columnsDefinition: DndColumn[];
@@ -26,4 +26,3 @@ interface DndTableProps {
26
26
  maxRows?: number;
27
27
  }
28
28
  export declare function DndTable(props: Readonly<DndTableProps>): import("react/jsx-runtime").JSX.Element;
29
- export {};
@@ -24,6 +24,7 @@ import "react-csv-downloader";
24
24
  import "yup";
25
25
  import { AutocompleteInput } from "../inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js";
26
26
  import { CheckboxInput } from "../inputs/reactHookForm/booleans/CheckboxInput.js";
27
+ import { SwitchInput } from "../inputs/reactHookForm/booleans/SwitchInput.js";
27
28
  import { ErrorInput } from "../inputs/reactHookForm/errorManagement/ErrorInput.js";
28
29
  import { FieldErrorAlert } from "../inputs/reactHookForm/errorManagement/FieldErrorAlert.js";
29
30
  import "../inputs/reactHookForm/provider/CustomFormProvider.js";
@@ -145,6 +146,7 @@ function EditableTableCell({
145
146
  }
146
147
  ),
147
148
  column.type === DndColumnType.CHIP_ITEMS && /* @__PURE__ */ jsx(ChipItemsInput, { name: `${arrayFormName}[${rowIndex}].${column.dataKey}`, hideErrorMessage: true }),
149
+ column.type === DndColumnType.SWITCH && /* @__PURE__ */ jsx(SwitchInput, { name: `${arrayFormName}[${rowIndex}].${column.dataKey}` }),
148
150
  column.type === DndColumnType.CUSTOM && column.component(rowIndex)
149
151
  ] }, column.dataKey);
150
152
  }
@@ -8,6 +8,7 @@ export declare enum DndColumnType {
8
8
  AUTOCOMPLETE = "AUTOCOMPLETE",
9
9
  CHIP_ITEMS = "CHIP_ITEMS",
10
10
  DIRECTORY_ITEMS = "DIRECTORY_ITEMS",
11
+ SWITCH = "SWITCH",
11
12
  CUSTOM = "CUSTOM"
12
13
  }
13
14
  export interface ColumnBase {
@@ -18,6 +19,7 @@ export interface ColumnBase {
18
19
  extra?: JSX.Element;
19
20
  editable?: boolean;
20
21
  type: DndColumnType;
22
+ initialValue?: any;
21
23
  }
22
24
  export interface ColumnText extends ColumnBase {
23
25
  type: DndColumnType.TEXT;
@@ -44,8 +46,11 @@ export interface ColumnDirectoryItem extends ColumnBase {
44
46
  export interface ColumnChipsItem extends ColumnBase {
45
47
  type: DndColumnType.CHIP_ITEMS;
46
48
  }
49
+ export interface ColumnSwitchItem extends ColumnBase {
50
+ type: DndColumnType.SWITCH;
51
+ }
47
52
  export interface ColumnCustom extends ColumnBase {
48
53
  type: DndColumnType.CUSTOM;
49
54
  component: (rowIndex: number) => ReactNode;
50
55
  }
51
- export type DndColumn = ColumnNumeric | ColumnAutocomplete | ColumnText | ColumnDirectoryItem | ColumnChipsItem | ColumnCustom;
56
+ export type DndColumn = ColumnNumeric | ColumnAutocomplete | ColumnText | ColumnDirectoryItem | ColumnChipsItem | ColumnSwitchItem | ColumnCustom;
@@ -6,6 +6,7 @@ var DndColumnType = /* @__PURE__ */ ((DndColumnType2) => {
6
6
  DndColumnType2["AUTOCOMPLETE"] = "AUTOCOMPLETE";
7
7
  DndColumnType2["CHIP_ITEMS"] = "CHIP_ITEMS";
8
8
  DndColumnType2["DIRECTORY_ITEMS"] = "DIRECTORY_ITEMS";
9
+ DndColumnType2["SWITCH"] = "SWITCH";
9
10
  DndColumnType2["CUSTOM"] = "CUSTOM";
10
11
  return DndColumnType2;
11
12
  })(DndColumnType || {});
@@ -174,6 +174,8 @@ import { SecurityAnalysisParametersDialog } from "./parameters/security-analysis
174
174
  import { SensitivityAnalysisParametersInline } from "./parameters/sensi/sensitivity-analysis-parameters-inline.js";
175
175
  import { SensitivityAnalysisParametersDialog } from "./parameters/sensi/sensitivity-analysis-parameters-dialog.js";
176
176
  import { COLUMNS_DEFINITIONS_HVDCS, COLUMNS_DEFINITIONS_INJECTIONS, COLUMNS_DEFINITIONS_INJECTIONS_SET, COLUMNS_DEFINITIONS_NODES, COLUMNS_DEFINITIONS_PSTS, EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES, HVDC_EQUIPMENT_TYPES, INJECTIONS_EQUIPMENT_TYPES, INJECTION_DISTRIBUTION_TYPES, MONITORED_BRANCHES_EQUIPMENT_TYPES, MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES, PSTS_EQUIPMENT_TYPES, SENSITIVITY_TYPES, SensiBranchesTabValues, SensiHvdcs, SensiInjection, SensiInjectionsSet, SensiNodes, SensiPsts, SensiTabValues } from "./parameters/sensi/columns-definitions.js";
177
+ import { ACCURACY, ACTIVE, CALCULATION_TYPE, LOADS_VARIATIONS, LOAD_FILTERS, LOAD_INCREASE_START_TIME, LOAD_INCREASE_STOP_TIME, LOAD_MODELS_RULE, MARGIN_CALCULATION_START_TIME, START_TIME, STOP_TIME, VARIATION } from "./parameters/dynamic-margin-calculation/constants.js";
178
+ import { DynamicMarginCalculationInline } from "./parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js";
177
179
  import { CustomMenuItem, CustomNestedMenuItem } from "./menus/custom-nested-menu.js";
178
180
  import { OverflowableTableCell } from "./muiTable/OverflowableTableCell.js";
179
181
  import { OverflowableTableCellWithCheckbox } from "./muiTable/OverflowableTableCellWithCheckbox.js";
@@ -185,6 +187,8 @@ import { filledTextField, italicFontTextField, standardTextField } from "./netwo
185
187
  import { SubstationCreationForm } from "./network-modifications/substation/creation/SubstationCreationForm.js";
186
188
  import { substationCreationDtoToForm, substationCreationEmptyFormData, substationCreationFormSchema, substationCreationFormToDto } from "./network-modifications/substation/creation/substationCreation.utils.js";
187
189
  export {
190
+ ACCURACY,
191
+ ACTIVE,
188
192
  AboutDialog,
189
193
  ActivableChip,
190
194
  AddButton,
@@ -200,6 +204,7 @@ export {
200
204
  BooleanInput,
201
205
  BooleanNullableCellRenderer,
202
206
  BottomRightButtons,
207
+ CALCULATION_TYPE,
203
208
  CENTER_LABEL,
204
209
  COLUMNS_DEFINITIONS_HVDCS,
205
210
  COLUMNS_DEFINITIONS_INJECTIONS,
@@ -270,6 +275,7 @@ export {
270
275
  DndTableAddRowsDialog,
271
276
  DndTableBottomLeftButtons,
272
277
  DndTableBottomRightButtons,
278
+ DynamicMarginCalculationInline,
273
279
  ENERGY_SOURCE_OPTIONS,
274
280
  EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES,
275
281
  EXPERT_FILTER_EQUIPMENTS,
@@ -324,6 +330,11 @@ export {
324
330
  LIMIT_DURATION_FORM,
325
331
  LIMIT_REDUCTIONS_FORM,
326
332
  LINE_FLOW_MODE,
333
+ LOADS_VARIATIONS,
334
+ LOAD_FILTERS,
335
+ LOAD_INCREASE_START_TIME,
336
+ LOAD_INCREASE_STOP_TIME,
337
+ LOAD_MODELS_RULE,
327
338
  LOAD_TYPE_OPTIONS,
328
339
  LOW_VOLTAGE_LIMIT,
329
340
  LabelledButton,
@@ -345,6 +356,7 @@ export {
345
356
  MAP_BASEMAP_MAPBOX,
346
357
  MAP_BASE_MAP,
347
358
  MAP_MANUAL_REFRESH,
359
+ MARGIN_CALCULATION_START_TIME,
348
360
  MAX_ROWS_NUMBER,
349
361
  MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
350
362
  MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
@@ -445,6 +457,8 @@ export {
445
457
  SHUNT_COMPENSATOR_TYPE_OPTIONS,
446
458
  SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
447
459
  SPECIFIC_PARAMETERS,
460
+ START_TIME,
461
+ STOP_TIME,
448
462
  SUBSTATION_LAYOUT,
449
463
  SVAR_REGULATION_MODE_OPTIONS,
450
464
  SecurityAnalysisParametersDialog,
@@ -494,6 +508,7 @@ export {
494
508
  VARIABLE_Q_GENERATORS,
495
509
  VARIABLE_SHUNT_COMPENSATORS,
496
510
  VARIABLE_TRANSFORMERS,
511
+ VARIATION,
497
512
  VERSION_PARAMETER,
498
513
  VOLTAGE_INIT_MODE,
499
514
  VOLTAGE_LEVEL,
@@ -44,11 +44,11 @@ const styles = {
44
44
  };
45
45
  function ProviderParam({ options }) {
46
46
  return /* @__PURE__ */ jsxs(Fragment, { children: [
47
- /* @__PURE__ */ jsxs(Grid, { xl: 8, container: true, sx: styles.providerParam, paddingRight: 1, children: [
47
+ /* @__PURE__ */ jsxs(Grid, { container: true, sx: styles.providerParam, paddingRight: 1, children: [
48
48
  /* @__PURE__ */ jsx(Grid, { item: true, xs: true, sx: parametersStyles.parameterName, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "Provider" }) }),
49
49
  /* @__PURE__ */ jsx(Grid, { item: true, container: true, xs: 2, sx: parametersStyles.controlItem, children: /* @__PURE__ */ jsx(MuiSelectInput, { name: PROVIDER, size: "small", fullWidth: true, options }) })
50
50
  ] }),
51
- /* @__PURE__ */ jsx(Grid, { container: true, paddingTop: 1, paddingRight: 1, xl: 8, children: /* @__PURE__ */ jsx(LineSeparator, {}) })
51
+ /* @__PURE__ */ jsx(Grid, { container: true, paddingTop: 1, paddingRight: 1, children: /* @__PURE__ */ jsx(LineSeparator, {}) })
52
52
  ] });
53
53
  }
54
54
  export {
@@ -0,0 +1,9 @@
1
+ import { SxProps, TooltipProps } from '@mui/material';
2
+ import { DndTableProps } from '../../dnd-table';
3
+ export type ParameterDndTableFieldProps = {
4
+ name: string;
5
+ label: string;
6
+ tooltipProps?: Omit<TooltipProps, 'children'>;
7
+ sxContainerProps?: SxProps;
8
+ } & Omit<DndTableProps, 'arrayFormName' | 'useFieldArrayOutput'>;
9
+ export default function ParameterDndTableField({ name, label, columnsDefinition, tooltipProps, sxContainerProps, ...otherProps }: Readonly<ParameterDndTableFieldProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,85 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Grid, Typography, Tooltip } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
4
+ import { useFieldArray } from "react-hook-form";
5
+ import { Info } from "@mui/icons-material";
6
+ import { useMemo, useCallback } from "react";
7
+ import { DndTable } from "../../dnd-table/dnd-table.js";
8
+ import "../../overflowableText/OverflowableText.js";
9
+ import "../../../utils/conversionUtils.js";
10
+ import "../../../utils/types/equipmentType.js";
11
+ import "../../../utils/yupConfig.js";
12
+ import "localized-countries";
13
+ import "localized-countries/data/fr";
14
+ import "localized-countries/data/en";
15
+ import "notistack";
16
+ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
17
+ import "yup";
18
+ import "../../treeViewFinder/TreeViewFinder.js";
19
+ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
20
+ import "../../customAGGrid/customAggrid.js";
21
+ import "ag-grid-community";
22
+ import "react-papaparse";
23
+ import "react-csv-downloader";
24
+ import "../../inputs/reactHookForm/numbers/RangeInput.js";
25
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
26
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
27
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
28
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
29
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
30
+ import "@react-querybuilder/material";
31
+ import "../../filter/expert/expertFilterConstants.js";
32
+ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
33
+ import "uuid";
34
+ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
35
+ import "react-querybuilder";
36
+ function ParameterDndTableField({
37
+ name,
38
+ label,
39
+ columnsDefinition,
40
+ tooltipProps,
41
+ sxContainerProps,
42
+ ...otherProps
43
+ }) {
44
+ const useFieldArrayOutput = useFieldArray({
45
+ name
46
+ });
47
+ const newDefaultRowData = useMemo(() => {
48
+ const newRowData = {};
49
+ columnsDefinition.forEach((columnDefinition) => {
50
+ newRowData[columnDefinition.dataKey] = columnDefinition.initialValue || null;
51
+ });
52
+ return newRowData;
53
+ }, [columnsDefinition]);
54
+ const createRows = useCallback(() => [newDefaultRowData], [newDefaultRowData]);
55
+ const { title, ...otherTooltipProps } = tooltipProps || {};
56
+ return /* @__PURE__ */ jsxs(Grid, { container: true, sx: sxContainerProps, children: [
57
+ /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", paddingBottom: 2, paddingTop: 2, children: [
58
+ /* @__PURE__ */ jsx(Typography, { component: "span", variant: "h6", children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }),
59
+ tooltipProps && /* @__PURE__ */ jsx(
60
+ Tooltip,
61
+ {
62
+ title: typeof title === "string" ? /* @__PURE__ */ jsx(FormattedMessage, { id: title }) : title,
63
+ placement: "right-start",
64
+ sx: { marginLeft: 1 },
65
+ ...otherTooltipProps,
66
+ children: /* @__PURE__ */ jsx(Info, {})
67
+ }
68
+ )
69
+ ] }),
70
+ /* @__PURE__ */ jsx(
71
+ DndTable,
72
+ {
73
+ arrayFormName: name,
74
+ useFieldArrayOutput,
75
+ columnsDefinition,
76
+ createRows,
77
+ withAddRowsDialog: false,
78
+ ...otherProps
79
+ }
80
+ )
81
+ ] });
82
+ }
83
+ export {
84
+ ParameterDndTableField as default
85
+ };
@@ -0,0 +1,15 @@
1
+ import { SxProps } from '@mui/material';
2
+ interface ParameterFieldProps {
3
+ id: string;
4
+ name: string;
5
+ type: string;
6
+ label?: string;
7
+ description?: string;
8
+ possibleValues?: {
9
+ id: string;
10
+ label: string;
11
+ }[] | string[];
12
+ sx?: SxProps;
13
+ }
14
+ declare function ParameterField({ id, name, type, label, description, possibleValues, sx }: Readonly<ParameterFieldProps>): import("react/jsx-runtime").JSX.Element;
15
+ export default ParameterField;
@@ -42,18 +42,11 @@ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
42
42
  import "uuid";
43
43
  import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
44
44
  import "react-querybuilder";
45
- import { LineSeparator } from "../common/line-separator.js";
45
+ import { LineSeparator } from "./line-separator.js";
46
46
  import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
47
- import "../common/widget/parameter-line-slider.js";
48
- import "../common/limitreductions/columns-definitions.js";
49
- function LoadFlowParameterField({
50
- id,
51
- name,
52
- type,
53
- label,
54
- description,
55
- possibleValues
56
- }) {
47
+ import "./widget/parameter-line-slider.js";
48
+ import "./limitreductions/columns-definitions.js";
49
+ function ParameterField({ id, name, type, label, description, possibleValues, sx }) {
57
50
  const renderField = () => {
58
51
  switch (type) {
59
52
  case ParameterType.STRING:
@@ -63,7 +56,8 @@ function LoadFlowParameterField({
63
56
  name: `${id}.${name}`,
64
57
  options: possibleValues,
65
58
  size: "small",
66
- "data-testid": `${id}.${name}`
59
+ "data-testid": `${id}.${name}`,
60
+ sx
67
61
  }
68
62
  ) : /* @__PURE__ */ jsx(TextInput, { name: `${id}.${name}`, dataTestId: `${id}.${name}` });
69
63
  case ParameterType.BOOLEAN:
@@ -108,5 +102,5 @@ function LoadFlowParameterField({
108
102
  ] }, name);
109
103
  }
110
104
  export {
111
- LoadFlowParameterField as default
105
+ ParameterField as default
112
106
  };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 declare const START_TIME = "startTime";
8
+ export declare const STOP_TIME = "stopTime";
9
+ export declare const MARGIN_CALCULATION_START_TIME = "marginCalculationStartTime";
10
+ export declare const LOAD_INCREASE_START_TIME = "loadIncreaseStartTime";
11
+ export declare const LOAD_INCREASE_STOP_TIME = "loadIncreaseStopTime";
12
+ export declare const CALCULATION_TYPE = "calculationType";
13
+ export declare const ACCURACY = "accuracy";
14
+ export declare const LOAD_MODELS_RULE = "loadModelsRule";
15
+ export declare const LOADS_VARIATIONS = "loadsVariations";
16
+ export declare const LOAD_FILTERS = "loadFilters";
17
+ export declare const VARIATION = "variation";
18
+ export declare const ACTIVE = "active";
@@ -0,0 +1,26 @@
1
+ const START_TIME = "startTime";
2
+ const STOP_TIME = "stopTime";
3
+ const MARGIN_CALCULATION_START_TIME = "marginCalculationStartTime";
4
+ const LOAD_INCREASE_START_TIME = "loadIncreaseStartTime";
5
+ const LOAD_INCREASE_STOP_TIME = "loadIncreaseStopTime";
6
+ const CALCULATION_TYPE = "calculationType";
7
+ const ACCURACY = "accuracy";
8
+ const LOAD_MODELS_RULE = "loadModelsRule";
9
+ const LOADS_VARIATIONS = "loadsVariations";
10
+ const LOAD_FILTERS = "loadFilters";
11
+ const VARIATION = "variation";
12
+ const ACTIVE = "active";
13
+ export {
14
+ ACCURACY,
15
+ ACTIVE,
16
+ CALCULATION_TYPE,
17
+ LOADS_VARIATIONS,
18
+ LOAD_FILTERS,
19
+ LOAD_INCREASE_START_TIME,
20
+ LOAD_INCREASE_STOP_TIME,
21
+ LOAD_MODELS_RULE,
22
+ MARGIN_CALCULATION_START_TIME,
23
+ START_TIME,
24
+ STOP_TIME,
25
+ VARIATION
26
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) 2026, 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
+ */
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { UseDynamicMarginCalculationParametersFormReturn } from './use-dynamic-margin-calculation-parameters-form';
3
+ type DynamicMarginCalculationFormProps = {
4
+ dynamicMarginCalculationMethods: UseDynamicMarginCalculationParametersFormReturn;
5
+ renderTitleFields?: () => ReactNode;
6
+ renderActions?: () => ReactNode;
7
+ };
8
+ export declare function DynamicMarginCalculationForm({ dynamicMarginCalculationMethods, renderTitleFields, renderActions, }: Readonly<DynamicMarginCalculationFormProps>): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,95 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Grid, Tabs, Tab, LinearProgress } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
4
+ import "../../../utils/conversionUtils.js";
5
+ import "../../../utils/types/equipmentType.js";
6
+ import "@mui/icons-material";
7
+ import { mergeSx } from "../../../utils/styles.js";
8
+ import "../../../utils/yupConfig.js";
9
+ import "../../overflowableText/OverflowableText.js";
10
+ import "react";
11
+ import "react-hook-form";
12
+ import "localized-countries";
13
+ import "localized-countries/data/fr";
14
+ import "localized-countries/data/en";
15
+ import "notistack";
16
+ import { CustomFormProvider } from "../../inputs/reactHookForm/provider/CustomFormProvider.js";
17
+ import "yup";
18
+ import "../../treeViewFinder/TreeViewFinder.js";
19
+ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
20
+ import "../../customAGGrid/customAggrid.js";
21
+ import "ag-grid-community";
22
+ import "react-papaparse";
23
+ import "react-csv-downloader";
24
+ import "../../inputs/reactHookForm/numbers/RangeInput.js";
25
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
26
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
27
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
28
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
29
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
30
+ import "@react-querybuilder/material";
31
+ import "../../filter/expert/expertFilterConstants.js";
32
+ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
33
+ import "uuid";
34
+ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
35
+ import "react-querybuilder";
36
+ import { TabPanel } from "../common/parameters.js";
37
+ import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
38
+ import { ProviderParam } from "../common/ProviderParam.js";
39
+ import { getTabStyle, parametersStyles } from "../parameters-style.js";
40
+ import "../common/widget/parameter-line-slider.js";
41
+ import "../common/limitreductions/columns-definitions.js";
42
+ import TimeDelayParameters from "./time-delay-parameters.js";
43
+ import LoadsVariationsParameters from "./loads-variations-parameters.js";
44
+ import { TabValues } from "./dynamic-margin-calculation.type.js";
45
+ function DynamicMarginCalculationForm({
46
+ dynamicMarginCalculationMethods,
47
+ renderTitleFields,
48
+ renderActions
49
+ }) {
50
+ const { formMethods, formSchema, paramsLoaded, formattedProviders, selectedTab, onTabChange, tabsWithError } = dynamicMarginCalculationMethods;
51
+ return /* @__PURE__ */ jsxs(CustomFormProvider, { validationSchema: formSchema, ...formMethods, children: [
52
+ renderTitleFields?.(),
53
+ paramsLoaded ? /* @__PURE__ */ jsxs(Grid, { container: true, sx: { height: "100%" }, direction: "column", children: [
54
+ /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(ProviderParam, { options: formattedProviders }) }),
55
+ /* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsxs(Tabs, { value: selectedTab, variant: "scrollable", onChange: onTabChange, "aria-label": "parameters", children: [
56
+ /* @__PURE__ */ jsx(
57
+ Tab,
58
+ {
59
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: "DynamicMarginCalculationTimeDelayTab" }),
60
+ value: TabValues.TAB_TIME_DELAY,
61
+ sx: getTabStyle(tabsWithError, TabValues.TAB_TIME_DELAY)
62
+ }
63
+ ),
64
+ /* @__PURE__ */ jsx(
65
+ Tab,
66
+ {
67
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: "DynamicMarginCalculationLoadsVariationsTab" }),
68
+ value: TabValues.TAB_LOADS_VARIATIONS,
69
+ sx: getTabStyle(tabsWithError, TabValues.TAB_LOADS_VARIATIONS)
70
+ }
71
+ )
72
+ ] }) }),
73
+ /* @__PURE__ */ jsxs(
74
+ Grid,
75
+ {
76
+ container: true,
77
+ xs: true,
78
+ sx: mergeSx(parametersStyles.scrollableGrid, {
79
+ paddingTop: 0,
80
+ width: "100%"
81
+ }),
82
+ children: [
83
+ /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.TAB_TIME_DELAY, children: /* @__PURE__ */ jsx(TimeDelayParameters, { path: TabValues.TAB_TIME_DELAY }) }),
84
+ /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.TAB_LOADS_VARIATIONS, children: /* @__PURE__ */ jsx(LoadsVariationsParameters, { path: TabValues.TAB_LOADS_VARIATIONS }) })
85
+ ]
86
+ },
87
+ "dmcParameters"
88
+ ),
89
+ renderActions?.()
90
+ ] }) : /* @__PURE__ */ jsx(LinearProgress, {})
91
+ ] });
92
+ }
93
+ export {
94
+ DynamicMarginCalculationForm
95
+ };
@@ -0,0 +1,10 @@
1
+ import { UUID } from 'node:crypto';
2
+ import { UseParametersBackendReturnProps } from '../../../utils/types/parameters.type';
3
+ import { ComputingType } from '../common/computing-type';
4
+ type DynamicMarginCalculationInlineProps = {
5
+ studyUuid: UUID | null;
6
+ parametersBackend: UseParametersBackendReturnProps<ComputingType.DYNAMIC_MARGIN_CALCULATION>;
7
+ setHaveDirtyFields: (isDirty: boolean) => void;
8
+ };
9
+ export declare function DynamicMarginCalculationInline({ studyUuid, parametersBackend, setHaveDirtyFields, }: Readonly<DynamicMarginCalculationInlineProps>): import("react/jsx-runtime").JSX.Element;
10
+ export {};