@gridsuite/commons-ui 0.123.0 → 0.125.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 (27) hide show
  1. package/dist/components/flatParameters/FlatParameters.js +19 -3
  2. package/dist/components/parameters/common/computing-type.js +2 -0
  3. package/dist/components/parameters/common/limitreductions/columns-definitions.d.ts +2 -2
  4. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.d.ts +3 -2
  5. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +20 -4
  6. package/dist/components/parameters/common/limitreductions/limit-reduction-table-row.d.ts +3 -2
  7. package/dist/components/parameters/common/limitreductions/limit-reduction-table-row.js +2 -2
  8. package/dist/components/parameters/common/limitreductions/limit-reductions-label-column.d.ts +6 -0
  9. package/dist/components/parameters/common/limitreductions/limit-reductions-label-column.js +22 -0
  10. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +11 -34
  11. package/dist/components/parameters/common/limitreductions/limit-reductions-tooltip-column.d.ts +6 -0
  12. package/dist/components/parameters/common/limitreductions/limit-reductions-tooltip-column.js +24 -0
  13. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table.d.ts +3 -2
  14. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table.js +24 -19
  15. package/dist/components/parameters/loadflow/load-flow-parameters-inline.d.ts +1 -2
  16. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.d.ts +1 -2
  17. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +1 -2
  18. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +1 -2
  19. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.d.ts +1 -1
  20. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.d.ts +1 -2
  21. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.d.ts +1 -2
  22. package/dist/hooks/use-unique-name-validation.js +7 -5
  23. package/dist/translations/en/parameters.d.ts +3 -1
  24. package/dist/translations/en/parameters.js +5 -3
  25. package/dist/translations/fr/parameters.d.ts +3 -1
  26. package/dist/translations/fr/parameters.js +4 -2
  27. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
- import { useState, useCallback, Fragment } from "react";
2
+ import { useState, useCallback, Fragment, createElement } from "react";
3
3
  import { List, ListItem, Tooltip, Typography, Divider, Select, MenuItem, TextField, IconButton, Autocomplete, Chip, Switch } from "@mui/material";
4
4
  import { Tune } from "@mui/icons-material";
5
5
  import { useIntl, FormattedMessage } from "react-intl";
@@ -274,7 +274,14 @@ function FlatParameters({
274
274
  onChange: (e, value) => onFieldChange(value, param),
275
275
  value: fieldValue,
276
276
  renderTags: (values, getTagProps) => {
277
- return values.map((value, index) => /* @__PURE__ */ jsx(Chip, { label: getTranslatedValue(param.name, value), ...getTagProps({ index }) }));
277
+ return values.map((value, index) => /* @__PURE__ */ createElement(
278
+ Chip,
279
+ {
280
+ label: getTranslatedValue(param.name, value),
281
+ ...getTagProps({ index }),
282
+ key: `chip_${value}`
283
+ }
284
+ ));
278
285
  },
279
286
  renderInput: (inputProps) => /* @__PURE__ */ jsx(TextField, { ...inputProps, variant })
280
287
  }
@@ -292,7 +299,16 @@ function FlatParameters({
292
299
  onChange: (e, value) => onFieldChange(value, param),
293
300
  value: fieldValue,
294
301
  renderTags: (values, getTagProps) => {
295
- return values.map((value, index) => /* @__PURE__ */ jsx(Chip, { id: `chip_${value}`, size: "small", label: value, ...getTagProps({ index }) }));
302
+ return values.map((value, index) => /* @__PURE__ */ createElement(
303
+ Chip,
304
+ {
305
+ id: `chip_${value}`,
306
+ size: "small",
307
+ label: value,
308
+ ...getTagProps({ index }),
309
+ key: `chip_${value}`
310
+ }
311
+ ));
296
312
  },
297
313
  renderInput: (inputProps) => /* @__PURE__ */ jsx(TextField, { ...inputProps, variant })
298
314
  }
@@ -26,6 +26,8 @@ const formatComputingTypeLabel = (type) => {
26
26
  return "NonEvacuatedEnergy";
27
27
  case "SHORT_CIRCUIT":
28
28
  return "ShortCircuit";
29
+ case "SHORT_CIRCUIT_ONE_BUS":
30
+ return "OneBusShortCircuitAnalysis";
29
31
  case "VOLTAGE_INITIALIZATION":
30
32
  return "VoltageInit";
31
33
  case "DYNAMIC_SIMULATION":
@@ -44,9 +44,9 @@ export declare const TAB_INFO: {
44
44
  developerModeOnly: boolean;
45
45
  }[];
46
46
  export interface LimitReductionIColumnsDef {
47
- label: string;
47
+ label: React.ReactNode;
48
48
  dataKey: string;
49
- tooltip: string;
49
+ tooltip: React.ReactNode;
50
50
  width?: string;
51
51
  }
52
52
  export declare const COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS: LimitReductionIColumnsDef[];
@@ -1,5 +1,6 @@
1
- import { LimitReductionIColumnsDef } from './columns-definitions';
2
- export declare function LimitReductionTableCell({ rowIndex, column, }: Readonly<{
1
+ import { LimitReductionIColumnsDef, ILimitReductionsByVoltageLevel } from './columns-definitions';
2
+ export declare function LimitReductionTableCell({ rowIndex, column, limits, }: Readonly<{
3
3
  rowIndex: number;
4
4
  column: LimitReductionIColumnsDef;
5
+ limits: ILimitReductionsByVoltageLevel[];
5
6
  }>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { TableCell } from "@mui/material";
2
+ import { Tooltip, TableCell } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
3
4
  import { VOLTAGE_LEVELS_FORM, LIMIT_REDUCTIONS_FORM } from "./columns-definitions.js";
4
- import "react-intl";
5
5
  import "react";
6
6
  import "react-hook-form";
7
7
  import "../../../../utils/types/equipmentType.js";
@@ -32,9 +32,25 @@ import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
32
32
  import "react-querybuilder";
33
33
  function LimitReductionTableCell({
34
34
  rowIndex,
35
- column
35
+ column,
36
+ limits
36
37
  }) {
37
- return /* @__PURE__ */ jsx(TableCell, { sx: { fontWeight: "bold" }, children: column.dataKey === VOLTAGE_LEVELS_FORM ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${LIMIT_REDUCTIONS_FORM}[${rowIndex}].${column.dataKey}` }) : /* @__PURE__ */ jsx(FloatInput, { name: `${LIMIT_REDUCTIONS_FORM}[${rowIndex}].${column.dataKey}` }) });
38
+ return column.dataKey === VOLTAGE_LEVELS_FORM && limits[rowIndex] ? /* @__PURE__ */ jsx(
39
+ Tooltip,
40
+ {
41
+ title: /* @__PURE__ */ jsx(
42
+ FormattedMessage,
43
+ {
44
+ id: "VoltageRangeInterval",
45
+ values: {
46
+ lowBound: `${limits[rowIndex].voltageLevel.lowBound}`,
47
+ highBound: `${limits[rowIndex].voltageLevel.highBound}`
48
+ }
49
+ }
50
+ ),
51
+ children: /* @__PURE__ */ jsx(TableCell, { sx: { fontWeight: "bold" }, children: /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${LIMIT_REDUCTIONS_FORM}[${rowIndex}].${column.dataKey}` }) })
52
+ }
53
+ ) : /* @__PURE__ */ jsx(TableCell, { sx: { fontWeight: "bold" }, children: column.dataKey === VOLTAGE_LEVELS_FORM ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${LIMIT_REDUCTIONS_FORM}[${rowIndex}].${column.dataKey}` }) : /* @__PURE__ */ jsx(FloatInput, { name: `${LIMIT_REDUCTIONS_FORM}[${rowIndex}].${column.dataKey}` }) });
38
54
  }
39
55
  export {
40
56
  LimitReductionTableCell
@@ -1,7 +1,8 @@
1
- import { LimitReductionIColumnsDef } from './columns-definitions';
1
+ import { ILimitReductionsByVoltageLevel, LimitReductionIColumnsDef } from './columns-definitions';
2
2
  interface TableRowComponentProps {
3
3
  columnsDefinition: LimitReductionIColumnsDef[];
4
4
  index: number;
5
+ limits: ILimitReductionsByVoltageLevel[];
5
6
  }
6
- export declare function LimitReductionTableRow({ columnsDefinition, index }: Readonly<TableRowComponentProps>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function LimitReductionTableRow({ columnsDefinition, index, limits }: Readonly<TableRowComponentProps>): import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -1,8 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { TableRow } from "@mui/material";
3
3
  import { LimitReductionTableCell } from "./limit-reduction-table-cell.js";
4
- function LimitReductionTableRow({ columnsDefinition, index }) {
5
- return /* @__PURE__ */ jsx(TableRow, { children: columnsDefinition.map((column) => /* @__PURE__ */ jsx(LimitReductionTableCell, { rowIndex: index, column }, `${column.dataKey}`)) });
4
+ function LimitReductionTableRow({ columnsDefinition, index, limits }) {
5
+ return /* @__PURE__ */ jsx(TableRow, { children: columnsDefinition.map((column) => /* @__PURE__ */ jsx(LimitReductionTableCell, { rowIndex: index, column, limits }, `${column.dataKey}`)) });
6
6
  }
7
7
  export {
8
8
  LimitReductionTableRow
@@ -0,0 +1,6 @@
1
+ import { ITemporaryLimitReduction } from './columns-definitions';
2
+ type LimitReductionsLabelColumnProps = {
3
+ limits: ITemporaryLimitReduction;
4
+ };
5
+ export declare function LimitReductionsLabelColumn({ limits }: Readonly<LimitReductionsLabelColumnProps>): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,22 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { FormattedMessage } from "react-intl";
3
+ function LimitReductionsLabelColumn({ limits }) {
4
+ const highBound = Math.trunc(limits.limitDuration.lowBound / 60);
5
+ const lowBound = Math.trunc(limits.limitDuration.highBound / 60);
6
+ if (lowBound === 0) {
7
+ return /* @__PURE__ */ jsx(FormattedMessage, { id: "LimitVoltageAfterIST", values: { highBound: `${highBound}` } });
8
+ }
9
+ return /* @__PURE__ */ jsx(
10
+ FormattedMessage,
11
+ {
12
+ id: "LimitVoltageInterval",
13
+ values: {
14
+ lowBound: `${lowBound}`,
15
+ highBound: `${highBound}`
16
+ }
17
+ }
18
+ );
19
+ }
20
+ export {
21
+ LimitReductionsLabelColumn
22
+ };
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useCallback, useMemo } from "react";
3
- import { useIntl } from "react-intl";
2
+ import { useMemo } from "react";
3
+ import { FormattedMessage } from "react-intl";
4
4
  import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM } from "./columns-definitions.js";
5
5
  import { CustomVoltageLevelTable } from "../voltage-level-table/custom-voltage-level-table.js";
6
6
  import "@mui/material";
@@ -29,56 +29,33 @@ import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
29
29
  import "uuid";
30
30
  import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
31
31
  import "react-querybuilder";
32
- const getLabelColumn = (limit) => {
33
- const lowBound = `${Math.trunc(limit.limitDuration.lowBound / 60)} min`;
34
- const highBoundValue = Math.trunc(limit.limitDuration.highBound / 60);
35
- const highBound = highBoundValue === 0 ? "∞" : `${Math.trunc(limit.limitDuration.highBound / 60)} min`;
36
- const lowerBoundClosed = limit.limitDuration.lowClosed ? "[" : "]";
37
- const highBoundClosed = limit.limitDuration.highClosed || null ? "]" : "[";
38
- return `${lowerBoundClosed}${lowBound}, ${highBound}${highBoundClosed}`;
39
- };
32
+ import { LimitReductionsToolTipColumn } from "./limit-reductions-tooltip-column.js";
33
+ import { LimitReductionsLabelColumn } from "./limit-reductions-label-column.js";
40
34
  function LimitReductionsTableForm({ limits }) {
41
- const intl = useIntl();
42
- const getToolTipColumn = useCallback(
43
- (limit) => {
44
- const lowBound = Math.trunc(limit.limitDuration.lowBound / 60);
45
- const highBound = Math.trunc(limit.limitDuration.highBound / 60);
46
- if (lowBound === 0) {
47
- return intl.formatMessage({ id: "LimitDurationAfterIST" }, { value: highBound });
48
- }
49
- return intl.formatMessage(
50
- { id: "LimitDurationInterval" },
51
- {
52
- lowBound: `IT${lowBound}`,
53
- highBound: highBound === 0 ? "IST" : `IT${highBound}`
54
- }
55
- );
56
- },
57
- [intl]
58
- );
59
35
  const columnsDefinition = useMemo(() => {
60
36
  const columnsDef = COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS.map((column) => ({
61
37
  ...column,
62
- label: intl.formatMessage({ id: column.label }),
63
- tooltip: intl.formatMessage({ id: column.tooltip })
38
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: column.label }),
39
+ tooltip: /* @__PURE__ */ jsx(FormattedMessage, { id: column.tooltip })
64
40
  }));
65
41
  if (limits !== null && limits.length > 0) {
66
42
  limits[0].temporaryLimitReductions.forEach((tlimit, index) => {
67
43
  columnsDef.push({
68
- label: getLabelColumn(tlimit),
44
+ label: /* @__PURE__ */ jsx(LimitReductionsLabelColumn, { limits: tlimit }),
69
45
  dataKey: LIMIT_DURATION_FORM + index,
70
- tooltip: getToolTipColumn(tlimit)
46
+ tooltip: /* @__PURE__ */ jsx(LimitReductionsToolTipColumn, { limits: tlimit })
71
47
  });
72
48
  });
73
49
  }
74
50
  return columnsDef;
75
- }, [intl, limits, getToolTipColumn]);
51
+ }, [limits]);
76
52
  return /* @__PURE__ */ jsx(
77
53
  CustomVoltageLevelTable,
78
54
  {
79
55
  formName: LIMIT_REDUCTIONS_FORM,
80
56
  columnsDefinition,
81
- tableHeight: 450
57
+ tableHeight: 450,
58
+ limits
82
59
  }
83
60
  );
84
61
  }
@@ -0,0 +1,6 @@
1
+ import { ITemporaryLimitReduction } from './columns-definitions';
2
+ type LimitReductionsLabelColumnProps = {
3
+ limits: ITemporaryLimitReduction;
4
+ };
5
+ export declare function LimitReductionsToolTipColumn({ limits }: Readonly<LimitReductionsLabelColumnProps>): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { FormattedMessage } from "react-intl";
3
+ function LimitReductionsToolTipColumn({ limits }) {
4
+ const lowBound = `${Math.trunc(limits.limitDuration.lowBound / 60)} min`;
5
+ const highBoundValue = Math.trunc(limits.limitDuration.highBound / 60);
6
+ const highBound = highBoundValue === 0 ? "∞" : `${Math.trunc(limits.limitDuration.highBound / 60)} min`;
7
+ const lowerBoundClosed = limits.limitDuration.lowClosed ? "[" : "]";
8
+ const higherBoundClosed = limits.limitDuration.highClosed || null ? "]" : "[";
9
+ return /* @__PURE__ */ jsx(
10
+ FormattedMessage,
11
+ {
12
+ id: "LimitDurationInterval",
13
+ values: {
14
+ lowBound: `${lowBound}`,
15
+ highBound: `${highBound}`,
16
+ higherBoundClosed: `${higherBoundClosed}`,
17
+ lowerBoundClosed: `${lowerBoundClosed}`
18
+ }
19
+ }
20
+ );
21
+ }
22
+ export {
23
+ LimitReductionsToolTipColumn
24
+ };
@@ -1,8 +1,9 @@
1
- import { LimitReductionIColumnsDef } from '../limitreductions/columns-definitions';
1
+ import { LimitReductionIColumnsDef, ILimitReductionsByVoltageLevel } from '../limitreductions/columns-definitions';
2
2
  interface LimitReductionsTableProps {
3
3
  columnsDefinition: LimitReductionIColumnsDef[];
4
4
  tableHeight: number;
5
5
  formName: string;
6
+ limits?: ILimitReductionsByVoltageLevel[];
6
7
  }
7
- export declare function CustomVoltageLevelTable({ formName, columnsDefinition, tableHeight, }: Readonly<LimitReductionsTableProps>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function CustomVoltageLevelTable({ formName, columnsDefinition, tableHeight, limits, }: Readonly<LimitReductionsTableProps>): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,6 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from "@mui/material";
3
- import { useMemo } from "react";
2
+ import { TableContainer, Table, TableHead, TableRow, Tooltip, TableCell, TableBody } from "@mui/material";
4
3
  import { useFieldArray } from "react-hook-form";
5
4
  import { LIMIT_REDUCTIONS_FORM } from "../limitreductions/columns-definitions.js";
6
5
  import { LimitReductionTableRow } from "../limitreductions/limit-reduction-table-row.js";
@@ -8,15 +7,12 @@ import { CustomVoltageLevelTableRow } from "./custom-voltage-level-table-row.js"
8
7
  function CustomVoltageLevelTable({
9
8
  formName,
10
9
  columnsDefinition,
11
- tableHeight
10
+ tableHeight,
11
+ limits
12
12
  }) {
13
13
  const { fields: rows } = useFieldArray({
14
14
  name: formName
15
15
  });
16
- const TableRowComponent = useMemo(
17
- () => formName === LIMIT_REDUCTIONS_FORM ? LimitReductionTableRow : CustomVoltageLevelTableRow,
18
- [formName]
19
- );
20
16
  return /* @__PURE__ */ jsx(
21
17
  TableContainer,
22
18
  {
@@ -26,26 +22,35 @@ function CustomVoltageLevelTable({
26
22
  border: "solid 0px rgba(0,0,0,0.1)"
27
23
  },
28
24
  children: /* @__PURE__ */ jsxs(Table, { stickyHeader: true, size: "small", sx: { tableLayout: "fixed" }, children: [
29
- /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow, { children: columnsDefinition.map((column) => /* @__PURE__ */ jsx(
25
+ /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow, { children: columnsDefinition.map((column) => /* @__PURE__ */ jsx(Tooltip, { title: column.tooltip, children: /* @__PURE__ */ jsx(
30
26
  TableCell,
31
27
  {
32
28
  sx: {
33
29
  textAlign: "center"
34
30
  },
35
- title: column.tooltip,
36
31
  children: column.label
37
32
  },
38
33
  column.dataKey
39
- )) }) }),
40
- /* @__PURE__ */ jsx(TableBody, { children: rows.map((row, index) => /* @__PURE__ */ jsx(
41
- TableRowComponent,
42
- {
43
- columnsDefinition,
44
- index,
45
- formName
46
- },
47
- `${row.id}`
48
- )) })
34
+ ) })) }) }),
35
+ /* @__PURE__ */ jsx(TableBody, { children: rows.map(
36
+ (row, index) => formName === LIMIT_REDUCTIONS_FORM && limits ? /* @__PURE__ */ jsx(
37
+ LimitReductionTableRow,
38
+ {
39
+ columnsDefinition,
40
+ index,
41
+ limits
42
+ },
43
+ `${row.id}`
44
+ ) : /* @__PURE__ */ jsx(
45
+ CustomVoltageLevelTableRow,
46
+ {
47
+ columnsDefinition,
48
+ index,
49
+ formName
50
+ },
51
+ `${row.id}`
52
+ )
53
+ ) })
49
54
  ] })
50
55
  }
51
56
  );
@@ -1,4 +1,3 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
1
  import { UUID } from 'crypto';
3
2
  import { UseParametersBackendReturnProps } from '../../../utils/types/parameters.type';
4
3
  import { ComputingType } from '../common/computing-type';
@@ -7,6 +6,6 @@ export declare function LoadFlowParametersInline({ studyUuid, language, paramete
7
6
  studyUuid: UUID | null;
8
7
  language: GsLang;
9
8
  parametersBackend: UseParametersBackendReturnProps<ComputingType.LOAD_FLOW>;
10
- setHaveDirtyFields: Dispatch<SetStateAction<boolean>>;
9
+ setHaveDirtyFields: (isDirty: boolean) => void;
11
10
  enableDeveloperMode: boolean;
12
11
  }>): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,9 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
1
  import { UUID } from 'crypto';
3
2
  import { User } from 'oidc-client';
4
3
  import { NetworkVisualizationParameters } from './network-visualizations.types';
5
4
  export declare function NetworkVisualizationParametersInline({ studyUuid, setHaveDirtyFields, user, parameters, }: Readonly<{
6
5
  studyUuid: UUID | null;
7
- setHaveDirtyFields: Dispatch<SetStateAction<boolean>>;
6
+ setHaveDirtyFields: (isDirty: boolean) => void;
8
7
  user: User | null;
9
8
  parameters: NetworkVisualizationParameters | null;
10
9
  }>): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,9 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
1
  import { UUID } from 'crypto';
3
2
  import { UseParametersBackendReturnProps } from '../../../utils';
4
3
  import { ComputingType } from '../common';
5
4
  export declare function SecurityAnalysisParametersInline({ studyUuid, parametersBackend, setHaveDirtyFields, enableDeveloperMode, }: Readonly<{
6
5
  studyUuid: UUID | null;
7
6
  parametersBackend: UseParametersBackendReturnProps<ComputingType.SECURITY_ANALYSIS>;
8
- setHaveDirtyFields: Dispatch<SetStateAction<boolean>>;
7
+ setHaveDirtyFields: (isDirty: boolean) => void;
9
8
  enableDeveloperMode: boolean;
10
9
  }>): import("react/jsx-runtime").JSX.Element;
@@ -66,8 +66,7 @@ function SecurityAnalysisParametersSelector({
66
66
  value: index,
67
67
  sx: {
68
68
  fontSize: 17,
69
- fontWeight: "bold",
70
- textTransform: "capitalize"
69
+ fontWeight: "bold"
71
70
  }
72
71
  },
73
72
  tab.label
@@ -6,7 +6,7 @@ interface SensitivityAnalysisParametersProps {
6
6
  currentNodeUuid: UUID | null;
7
7
  currentRootNetworkUuid: UUID | null;
8
8
  parametersBackend: UseParametersBackendReturnProps<ComputingType.SENSITIVITY_ANALYSIS>;
9
- setHaveDirtyFields: any;
9
+ setHaveDirtyFields: (isDirty: boolean) => void;
10
10
  enableDeveloperMode: boolean;
11
11
  }
12
12
  export declare function SensitivityAnalysisParametersInline({ studyUuid, currentNodeUuid, currentRootNetworkUuid, parametersBackend, setHaveDirtyFields, enableDeveloperMode, }: Readonly<SensitivityAnalysisParametersProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,7 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
1
  import { UUID } from 'crypto';
3
2
  import { ShortCircuitParametersInfos } from './short-circuit-parameters.type';
4
3
  export declare function ShortCircuitParametersInLine({ studyUuid, setHaveDirtyFields, shortCircuitParameters, }: Readonly<{
5
4
  studyUuid: UUID | null;
6
- setHaveDirtyFields: Dispatch<SetStateAction<boolean>>;
5
+ setHaveDirtyFields: (isDirty: boolean) => void;
7
6
  shortCircuitParameters: ShortCircuitParametersInfos | null;
8
7
  }>): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,7 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
1
  import { UUID } from 'crypto';
3
2
  import { VoltageInitStudyParameters } from './voltage-init.type';
4
3
  export declare function VoltageInitParametersInLine({ studyUuid, setHaveDirtyFields, voltageInitParameters, }: Readonly<{
5
4
  studyUuid: UUID | null;
6
- setHaveDirtyFields: Dispatch<SetStateAction<boolean>>;
5
+ setHaveDirtyFields: (isDirty: boolean) => void;
7
6
  voltageInitParameters: VoltageInitStudyParameters | null;
8
7
  }>): import("react/jsx-runtime").JSX.Element;
@@ -20,11 +20,10 @@ function useUniqueNameValidation({
20
20
  setError,
21
21
  clearErrors,
22
22
  trigger,
23
- formState: { errors, defaultValues }
23
+ formState: { errors, defaultValues, isDirty: formIsDirty }
24
24
  } = useFormContext();
25
25
  const {
26
- field: { value },
27
- fieldState: { isDirty }
26
+ field: { value }
28
27
  } = useController({ name });
29
28
  const {
30
29
  field: { value: selectedDirectory }
@@ -65,10 +64,13 @@ function useUniqueNameValidation({
65
64
  if (selectedDirectory) {
66
65
  debouncedHandleCheckName(trimmedValue);
67
66
  }
68
- if (!isDirty) {
67
+ if (!formIsDirty) {
69
68
  clearErrors(name);
70
69
  return;
71
70
  }
71
+ if (trimmedValue === defaultFieldValue && trimmedValue.length > 0) {
72
+ return;
73
+ }
72
74
  if (trimmedValue) {
73
75
  clearErrors(name);
74
76
  setError("root.isValidating", {
@@ -89,7 +91,7 @@ function useUniqueNameValidation({
89
91
  setError,
90
92
  clearErrors,
91
93
  name,
92
- isDirty,
94
+ formIsDirty,
93
95
  defaultFieldValue,
94
96
  directory,
95
97
  selectedDirectory
@@ -55,9 +55,11 @@ export declare const parametersEn: {
55
55
  General: string;
56
56
  LimitReductions: string;
57
57
  IST: string;
58
+ LimitVoltageInterval: string;
59
+ LimitVoltageAfterIST: string;
58
60
  LimitDurationInterval: string;
59
- LimitDurationAfterIST: string;
60
61
  voltageRange: string;
62
+ VoltageRangeInterval: string;
61
63
  Provider: string;
62
64
  LimitReduction: string;
63
65
  Default: string;
@@ -48,10 +48,12 @@ const parametersEn = {
48
48
  RealPercentage: "This value must be between 0 and 1",
49
49
  General: "General",
50
50
  LimitReductions: "Limit reductions",
51
- IST: "IST",
52
- LimitDurationInterval: "Between {highBound} and {lowBound}",
53
- LimitDurationAfterIST: "Beyond IT{value}",
51
+ IST: "PATL",
52
+ LimitVoltageInterval: "Between TATL{lowBound} and TATL{highBound}",
53
+ LimitVoltageAfterIST: "Between PATL and TATL{highBound}",
54
+ LimitDurationInterval: "Duration {lowerBoundClosed}{lowBound}, {highBound}{higherBoundClosed}",
54
55
  voltageRange: "Voltage range",
56
+ VoltageRangeInterval: "Voltage interval ]{lowBound} kV,{highBound} kV]",
55
57
  Provider: "Provider",
56
58
  LimitReduction: "Limit reduction",
57
59
  Default: "Default",
@@ -55,9 +55,11 @@ export declare const parametersFr: {
55
55
  General: string;
56
56
  LimitReductions: string;
57
57
  IST: string;
58
+ LimitVoltageInterval: string;
59
+ LimitVoltageAfterIST: string;
58
60
  LimitDurationInterval: string;
59
- LimitDurationAfterIST: string;
60
61
  voltageRange: string;
62
+ VoltageRangeInterval: string;
61
63
  Provider: string;
62
64
  LimitReduction: string;
63
65
  Default: string;
@@ -49,9 +49,11 @@ const parametersFr = {
49
49
  General: "Général",
50
50
  LimitReductions: "Abattements",
51
51
  IST: "IST",
52
- LimitDurationInterval: "Entre {highBound} et {lowBound}",
53
- LimitDurationAfterIST: "Au-delà de IT{value}",
52
+ LimitVoltageInterval: "Entre IT{lowBound} et IT{highBound}",
53
+ LimitVoltageAfterIST: "Entre IST et IT{highBound}",
54
+ LimitDurationInterval: "Tempo {lowerBoundClosed}{lowBound}, {highBound}{higherBoundClosed}",
54
55
  voltageRange: "Niveau de tension",
56
+ VoltageRangeInterval: "Plage de tension ]{lowBound} kV,{highBound} kV]",
55
57
  Provider: "Simulateur",
56
58
  LimitReduction: "Abattement des seuils",
57
59
  Default: "Défaut",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.123.0",
3
+ "version": "0.125.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",