@gridsuite/commons-ui 0.219.1 → 0.220.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 (30) hide show
  1. package/dist/components/composite/dnd-table/dnd-table.js +1 -1
  2. package/dist/components/composite/dnd-table/dnd-table.type.d.ts +1 -1
  3. package/dist/components/composite/dnd-table-v2/dnd-table-row.js +63 -55
  4. package/dist/components/composite/dnd-table-v2/dnd-table.type.d.ts +1 -1
  5. package/dist/components/ui/reactHookForm/chip-items-input.d.ts +1 -1
  6. package/dist/components/ui/reactHookForm/tableInputs/table-numerical-input.d.ts +2 -1
  7. package/dist/components/ui/reactHookForm/tableInputs/table-numerical-input.js +4 -0
  8. package/dist/components/ui/reactHookForm/tableInputs/table-text-input.d.ts +2 -2
  9. package/dist/components/ui/reactHookForm/tableInputs/table-text-input.js +6 -4
  10. package/dist/configureYup.js +6 -1
  11. package/dist/features/network-modifications/common/measurements/BusbarSectionVoltageMeasurementsForm.js +1 -1
  12. package/dist/features/network-modifications/common/setpoints/setPoints.utils.js +1 -2
  13. package/dist/features/parameters/common/contingency-table/columns-definitions.js +1 -1
  14. package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +2 -2
  15. package/dist/features/parameters/sensi/utils.js +13 -7
  16. package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +2 -2
  17. package/dist/index.js +4 -1
  18. package/dist/translations/en/networkModificationsEn.d.ts +3 -0
  19. package/dist/translations/en/networkModificationsEn.js +4 -1
  20. package/dist/translations/en/parameters.d.ts +1 -0
  21. package/dist/translations/en/parameters.js +1 -0
  22. package/dist/translations/fr/networkModificationsFr.d.ts +3 -0
  23. package/dist/translations/fr/networkModificationsFr.js +4 -1
  24. package/dist/translations/fr/parameters.d.ts +1 -0
  25. package/dist/translations/fr/parameters.js +1 -0
  26. package/dist/utils/constants/index.js +4 -1
  27. package/dist/utils/constants/translationKeys.d.ts +3 -0
  28. package/dist/utils/constants/translationKeys.js +6 -0
  29. package/dist/utils/index.js +4 -1
  30. package/package.json +1 -1
@@ -118,7 +118,7 @@ function EditableTableCell({
118
118
  {
119
119
  ...props,
120
120
  name: `${arrayFormName}[${rowIndex}].${column.dataKey}`,
121
- showErrorMsg: column.showErrorMsg
121
+ hideErrorMessage: column.hideErrorMessage
122
122
  }
123
123
  ),
124
124
  column.type === DndColumnType.AUTOCOMPLETE && /* @__PURE__ */ jsx(
@@ -20,10 +20,10 @@ export interface ColumnBase {
20
20
  editable?: boolean;
21
21
  type: DndColumnType;
22
22
  initialValue?: any;
23
+ hideErrorMessage?: boolean;
23
24
  }
24
25
  export interface ColumnText extends ColumnBase {
25
26
  type: DndColumnType.TEXT;
26
- showErrorMsg?: boolean;
27
27
  }
28
28
  export interface ColumnNumeric extends ColumnBase {
29
29
  type: DndColumnType.NUMERIC;
@@ -54,61 +54,69 @@ function EditableTableCell({
54
54
  onChangeCell,
55
55
  ...props
56
56
  }) {
57
- return /* @__PURE__ */ jsxs(TableCell, { sx: mergeSx({ padding: 0.5, maxWidth: column.maxWidth }, width), children: [
58
- column.type === DndColumnType.NUMERIC && /* @__PURE__ */ jsx(
59
- TableNumericalInput,
60
- {
61
- ...props,
62
- name,
63
- previousValue,
64
- valueModified,
65
- adornment: column?.adornment,
66
- isClearable: column?.clearable,
67
- style: {
68
- textAlign: column?.textAlign
69
- }
70
- }
71
- ),
72
- column.type === DndColumnType.TEXT && /* @__PURE__ */ jsx(TableTextInput, { ...props, name, showErrorMsg: column.showErrorMsg }),
73
- column.type === DndColumnType.AUTOCOMPLETE && /* @__PURE__ */ jsx(
74
- AutocompleteInput,
75
- {
76
- forcePopupIcon: true,
77
- freeSolo: true,
78
- name,
79
- options: column.options,
80
- inputTransform: (value) => value ?? "",
81
- outputTransform: (value) => value,
82
- size: "small"
83
- }
84
- ),
85
- column.type === DndColumnType.SELECT && /* @__PURE__ */ jsx(SelectInput, { options: column.options, name, size: "small", fullWidth: true, disableClearable: true }),
86
- column.type === DndColumnType.DIRECTORY_ITEMS && /* @__PURE__ */ jsx(
87
- DirectoryItemsInput,
88
- {
89
- name,
90
- equipmentTypes: column.equipmentTypes,
91
- elementType: column.elementType,
92
- titleId: column.titleId,
93
- hideErrorMessage: true,
94
- label: void 0,
95
- onChange: (value) => column.shouldHandleOnChangeCell && onChangeCell?.(value)
96
- }
97
- ),
98
- column.type === DndColumnType.CHIP_ITEMS && /* @__PURE__ */ jsx(ChipItemsInput, { name, hideErrorMessage: true }),
99
- column.type === DndColumnType.SWITCH && /* @__PURE__ */ jsx(
100
- SwitchInput,
101
- {
102
- name,
103
- formProps: {
104
- // callback to propagate a change to parent via column config
105
- onChange: (_, checked) => column.shouldHandleOnChangeCell && onChangeCell?.(checked)
106
- }
107
- }
108
- ),
109
- column.type === DndColumnType.DESCRIPTIONS && /* @__PURE__ */ jsx(DescriptionInput, { name }),
110
- column.type === DndColumnType.CUSTOM && column.component(rowIndex)
111
- ] }, column.dataKey);
57
+ return /* @__PURE__ */ jsxs(
58
+ TableCell,
59
+ {
60
+ sx: mergeSx({ padding: 0.5, maxWidth: column.maxWidth, verticalAlign: "top" }, width),
61
+ children: [
62
+ column.type === DndColumnType.NUMERIC && /* @__PURE__ */ jsx(
63
+ TableNumericalInput,
64
+ {
65
+ ...props,
66
+ name,
67
+ previousValue,
68
+ valueModified,
69
+ adornment: column?.adornment,
70
+ isClearable: column?.clearable,
71
+ style: {
72
+ textAlign: column?.textAlign
73
+ },
74
+ hideErrorMessage: column.hideErrorMessage
75
+ }
76
+ ),
77
+ column.type === DndColumnType.TEXT && /* @__PURE__ */ jsx(TableTextInput, { ...props, name, hideErrorMessage: column.hideErrorMessage }),
78
+ column.type === DndColumnType.AUTOCOMPLETE && /* @__PURE__ */ jsx(
79
+ AutocompleteInput,
80
+ {
81
+ forcePopupIcon: true,
82
+ freeSolo: true,
83
+ name,
84
+ options: column.options,
85
+ inputTransform: (value) => value ?? "",
86
+ outputTransform: (value) => value,
87
+ size: "small"
88
+ }
89
+ ),
90
+ column.type === DndColumnType.SELECT && /* @__PURE__ */ jsx(SelectInput, { options: column.options, name, size: "small", fullWidth: true, disableClearable: true }),
91
+ column.type === DndColumnType.DIRECTORY_ITEMS && /* @__PURE__ */ jsx(
92
+ DirectoryItemsInput,
93
+ {
94
+ name,
95
+ equipmentTypes: column.equipmentTypes,
96
+ elementType: column.elementType,
97
+ titleId: column.titleId,
98
+ hideErrorMessage: column.hideErrorMessage,
99
+ label: void 0,
100
+ onChange: (value) => column.shouldHandleOnChangeCell && onChangeCell?.(value)
101
+ }
102
+ ),
103
+ column.type === DndColumnType.CHIP_ITEMS && /* @__PURE__ */ jsx(ChipItemsInput, { name, hideErrorMessage: column.hideErrorMessage }),
104
+ column.type === DndColumnType.SWITCH && /* @__PURE__ */ jsx(
105
+ SwitchInput,
106
+ {
107
+ name,
108
+ formProps: {
109
+ // callback to propagate a change to parent via column config
110
+ onChange: (_, checked) => column.shouldHandleOnChangeCell && onChangeCell?.(checked)
111
+ }
112
+ }
113
+ ),
114
+ column.type === DndColumnType.DESCRIPTIONS && /* @__PURE__ */ jsx(DescriptionInput, { name }),
115
+ column.type === DndColumnType.CUSTOM && column.component(rowIndex)
116
+ ]
117
+ },
118
+ column.dataKey
119
+ );
112
120
  }
113
121
  function DndTableRow({
114
122
  rowId,
@@ -27,10 +27,10 @@ export interface ColumnBase {
27
27
  type: DndColumnType;
28
28
  initialValue?: any;
29
29
  shouldHandleOnChangeCell?: boolean;
30
+ hideErrorMessage?: boolean;
30
31
  }
31
32
  export interface ColumnText extends ColumnBase {
32
33
  type: DndColumnType.TEXT;
33
- showErrorMsg?: boolean;
34
34
  }
35
35
  export interface ColumnNumeric extends ColumnBase {
36
36
  type: DndColumnType.NUMERIC;
@@ -7,7 +7,7 @@
7
7
  interface ChipItemsInputProps {
8
8
  label?: string;
9
9
  name: string;
10
- hideErrorMessage: boolean;
10
+ hideErrorMessage?: boolean;
11
11
  }
12
12
  export declare function ChipItemsInput({ label, name, hideErrorMessage }: Readonly<ChipItemsInputProps>): import("react/jsx-runtime").JSX.Element;
13
13
  export {};
@@ -8,5 +8,6 @@ export interface TableNumericalInputProps extends StandardTextFieldProps {
8
8
  text: string;
9
9
  };
10
10
  isClearable?: boolean;
11
+ hideErrorMessage?: boolean;
11
12
  }
12
- export declare function TableNumericalInput({ name, style, inputProps, previousValue, valueModified, adornment, isClearable, ...props }: Readonly<TableNumericalInputProps>): import("react/jsx-runtime").JSX.Element;
13
+ export declare function TableNumericalInput({ name, style, inputProps, previousValue, valueModified, adornment, isClearable, hideErrorMessage, ...props }: Readonly<TableNumericalInputProps>): import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,8 @@ import { useMemo } from "react";
6
6
  import "../../../../utils/conversionUtils.js";
7
7
  import "../../../../utils/types/equipmentType.js";
8
8
  import { validateValueIsANumber } from "../../../../utils/validation-functions.js";
9
+ import "react-intl";
10
+ import { genHelperError } from "../utils/functions.js";
9
11
  function TableNumericalInput({
10
12
  name,
11
13
  style,
@@ -14,6 +16,7 @@ function TableNumericalInput({
14
16
  valueModified,
15
17
  adornment,
16
18
  isClearable = true,
19
+ hideErrorMessage,
17
20
  ...props
18
21
  }) {
19
22
  const { trigger } = useFormContext();
@@ -100,6 +103,7 @@ function TableNumericalInput({
100
103
  ...inputProps
101
104
  }
102
105
  },
106
+ ...hideErrorMessage ? {} : genHelperError(error?.message),
103
107
  ...props
104
108
  }
105
109
  );
@@ -1,8 +1,8 @@
1
1
  import { InputBaseComponentProps } from '@mui/material';
2
2
  interface TableTextInputProps {
3
3
  name: string;
4
- showErrorMsg?: boolean;
4
+ hideErrorMessage?: boolean;
5
5
  inputProps?: InputBaseComponentProps;
6
6
  }
7
- export declare function TableTextInput({ name, showErrorMsg, inputProps, ...props }: Readonly<TableTextInputProps>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function TableTextInput({ name, hideErrorMessage, inputProps, ...props }: Readonly<TableTextInputProps>): import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -1,13 +1,15 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { TextField } from "@mui/material";
3
3
  import { useController } from "react-hook-form";
4
- import { useIntl } from "react-intl";
5
- function TableTextInput({ name, showErrorMsg, inputProps, ...props }) {
4
+ import "react-intl";
5
+ import "react";
6
+ import "@mui/icons-material";
7
+ import { genHelperError } from "../utils/functions.js";
8
+ function TableTextInput({ name, hideErrorMessage, inputProps, ...props }) {
6
9
  const {
7
10
  field: { onChange, value, ref },
8
11
  fieldState: { error }
9
12
  } = useController({ name });
10
- const intl = useIntl();
11
13
  const outputTransform = (str) => {
12
14
  return str?.trim() === "" ? "" : str;
13
15
  };
@@ -20,7 +22,6 @@ function TableTextInput({ name, showErrorMsg, inputProps, ...props }) {
20
22
  value,
21
23
  onChange: handleInputChange,
22
24
  error: !!error?.message,
23
- helperText: showErrorMsg && (error?.message ? intl.formatMessage({ id: error.message }) : ""),
24
25
  size: "small",
25
26
  fullWidth: true,
26
27
  inputRef: ref,
@@ -34,6 +35,7 @@ function TableTextInput({ name, showErrorMsg, inputProps, ...props }) {
34
35
  ...inputProps
35
36
  }
36
37
  },
38
+ ...hideErrorMessage ? {} : genHelperError(error?.message),
37
39
  ...props
38
40
  }
39
41
  );
@@ -1,5 +1,5 @@
1
1
  import { setLocale } from "yup";
2
- import { YUP_REQUIRED, YUP_NOT_TYPE_NUMBER, YUP_NOT_TYPE_DEFAULT } from "./utils/constants/translationKeys.js";
2
+ import { YUP_POSITIVE, YUP_DEFAULT, YUP_NOT_NULL, YUP_REQUIRED, YUP_NOT_TYPE_NUMBER, YUP_NOT_TYPE_DEFAULT } from "./utils/constants/translationKeys.js";
3
3
  import "./utils/conversionUtils.js";
4
4
  import "./utils/types/equipmentType.js";
5
5
  import "react/jsx-runtime";
@@ -8,12 +8,17 @@ const configureYup = () => {
8
8
  setLocale({
9
9
  mixed: {
10
10
  required: YUP_REQUIRED,
11
+ notNull: YUP_NOT_NULL,
12
+ default: YUP_DEFAULT,
11
13
  notType: ({ type }) => {
12
14
  if (type === "number") {
13
15
  return YUP_NOT_TYPE_NUMBER;
14
16
  }
15
17
  return YUP_NOT_TYPE_DEFAULT;
16
18
  }
19
+ },
20
+ number: {
21
+ positive: YUP_POSITIVE
17
22
  }
18
23
  });
19
24
  };
@@ -71,7 +71,7 @@ function BusbarSectionVoltageMeasurementsForm({
71
71
  previousValidity = intl.formatMessage({ id: validity ? "ValidMeasurement" : "InvalidMeasurement" });
72
72
  }
73
73
  return /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, alignItems: "center", children: [
74
- /* @__PURE__ */ jsx(Grid2, { children: bbsId }),
74
+ /* @__PURE__ */ jsx(Grid2, { size: 3, children: bbsId }),
75
75
  /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
76
76
  FloatInput,
77
77
  {
@@ -1,6 +1,5 @@
1
1
  import { number } from "yup";
2
2
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
3
- import { YUP_REQUIRED } from "../../../../utils/constants/translationKeys.js";
4
3
  import "../../../../utils/conversionUtils.js";
5
4
  import "../../../../utils/types/equipmentType.js";
6
5
  import "react/jsx-runtime";
@@ -35,7 +34,7 @@ const getActivePowerSetPointSchema = (isEquipmentModification = false) => ({
35
34
  }).when([], {
36
35
  is: () => !isEquipmentModification,
37
36
  then: (schema) => {
38
- return schema.required().nonNullable(YUP_REQUIRED).test(
37
+ return schema.required().nonNullable().test(
39
38
  "activePowerSetPoint",
40
39
  "ActivePowerMustBeZeroOrBetweenMinAndMaxActivePower",
41
40
  testValueWithinPowerIntervalOrEqualToZero
@@ -73,7 +73,7 @@ const getContingencyListsInfosFormSchema = () => {
73
73
  [ID]: yup.string().required(),
74
74
  [NAME]: yup.string().required()
75
75
  })
76
- ).required().min(1, "FieldIsRequired"),
76
+ ).required().min(1, "ContingencyListInputMinError"),
77
77
  [DESCRIPTION]: yup.string(),
78
78
  [ACTIVATED]: yup.boolean().required()
79
79
  })
@@ -50,8 +50,8 @@ const formSchema = yup.object().shape({
50
50
  [ID]: yup.string().required(),
51
51
  [NAME]: yup.string().nullable().notRequired()
52
52
  })
53
- ).min(1),
54
- [VARIATION]: yup.number().min(0).required(),
53
+ ).min(1, "FilterInputMinError"),
54
+ [VARIATION]: yup.number().min(0, "mustBeGreaterOrEqualToZero").required(),
55
55
  [ACTIVE]: yup.boolean().nullable().notRequired()
56
56
  })
57
57
  )
@@ -50,7 +50,7 @@ const getMonitoredBranchesSchema = () => {
50
50
  })
51
51
  ).required().when([ACTIVATED], {
52
52
  is: (activated) => activated,
53
- then: (schema) => schema.min(1, "FieldIsRequired")
53
+ then: (schema) => schema.min(1, "FilterInputMinError")
54
54
  })
55
55
  };
56
56
  };
@@ -85,7 +85,7 @@ const getSensiHVDCsFormSchema = () => ({
85
85
  })
86
86
  ).required().when([ACTIVATED], {
87
87
  is: (activated) => activated,
88
- then: (schema) => schema.min(1, "FieldIsRequired")
88
+ then: (schema) => schema.min(1, "FilterInputMinError")
89
89
  }),
90
90
  ...getContingenciesSchema()
91
91
  })
@@ -130,7 +130,7 @@ const getSensiInjectionsFormSchema = () => ({
130
130
  })
131
131
  ).required().when([ACTIVATED], {
132
132
  is: (activated) => activated,
133
- then: (schema) => schema.min(1, "FieldIsRequired")
133
+ then: (schema) => schema.min(1, "FilterInputMinError")
134
134
  }),
135
135
  ...getContingenciesSchema()
136
136
  })
@@ -174,7 +174,7 @@ const getSensiInjectionsSetFormSchema = () => ({
174
174
  })
175
175
  ).required().when([ACTIVATED], {
176
176
  is: (activated) => activated,
177
- then: (schema) => schema.min(1, "FieldIsRequired")
177
+ then: (schema) => schema.min(1, "FilterInputMinError")
178
178
  }),
179
179
  [DISTRIBUTION_TYPE]: yup.mixed().oneOf(Object.values(DistributionType)).when([ACTIVATED], {
180
180
  is: (activated) => activated,
@@ -229,13 +229,19 @@ const getSensiNodesFormSchema = () => ({
229
229
  [ID]: yup.string().required(),
230
230
  [NAME]: yup.string().required()
231
231
  })
232
- ),
232
+ ).when([ACTIVATED], {
233
+ is: (activated) => activated,
234
+ then: (schema) => schema.min(1, "FilterInputMinError")
235
+ }),
233
236
  [EQUIPMENTS_IN_VOLTAGE_REGULATION]: yup.array().of(
234
237
  yup.object().shape({
235
238
  [ID]: yup.string().required(),
236
239
  [NAME]: yup.string().required()
237
240
  })
238
- ),
241
+ ).when([ACTIVATED], {
242
+ is: (activated) => activated,
243
+ then: (schema) => schema.min(1, "FilterInputMinError")
244
+ }),
239
245
  ...getContingenciesSchema()
240
246
  })
241
247
  )
@@ -281,7 +287,7 @@ const getSensiPSTsFormSchema = () => ({
281
287
  })
282
288
  ).required().when([ACTIVATED], {
283
289
  is: (activated) => activated,
284
- then: (schema) => schema.min(1, "FieldIsRequired")
290
+ then: (schema) => schema.min(1, "FilterInputMinError")
285
291
  }),
286
292
  ...getContingenciesSchema()
287
293
  })
@@ -85,10 +85,10 @@ const useVoltageInitParametersForm = ({
85
85
  [NAME]: yup.string().required()
86
86
  })
87
87
  ).min(1, "FilterInputMinError"),
88
- [LOW_VOLTAGE_LIMIT]: yup.number().min(0).nullable().test((value, context) => {
88
+ [LOW_VOLTAGE_LIMIT]: yup.number().min(0, "mustBeGreaterOrEqualToZero").nullable().test((value, context) => {
89
89
  return !isBlankOrEmpty(value) || !isBlankOrEmpty(context.parent[HIGH_VOLTAGE_LIMIT]);
90
90
  }),
91
- [HIGH_VOLTAGE_LIMIT]: yup.number().min(0).nullable().test((value, context) => {
91
+ [HIGH_VOLTAGE_LIMIT]: yup.number().min(0, "mustBeGreaterOrEqualToZero").nullable().test((value, context) => {
92
92
  return !isBlankOrEmpty(value) || !isBlankOrEmpty(context.parent[LOW_VOLTAGE_LIMIT]);
93
93
  })
94
94
  })
package/dist/index.js CHANGED
@@ -245,7 +245,7 @@ import { MAX_CHAR_DESCRIPTION } from "./utils/constants/uiConstants.js";
245
245
  import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./utils/constants/unitsConstants.js";
246
246
  import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES, LAST_SELECTED_DIRECTORY, PARAM_DEVELOPER_MODE, PARAM_LANGUAGE, PARAM_THEME } from "./utils/constants/configConstants.js";
247
247
  import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./utils/constants/filterConstant.js";
248
- import { DUPLICATED_PROPS_ERROR, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_REQUIRED } from "./utils/constants/translationKeys.js";
248
+ import { DUPLICATED_PROPS_ERROR, YUP_DEFAULT, YUP_NOT_NULL, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_REQUIRED } from "./utils/constants/translationKeys.js";
249
249
  import { GRIDSUITE_DEFAULT_PRECISION, convertInputValue, convertOutputValue, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, toModificationOperation, unitToKiloUnit, unitToMicroUnit } from "./utils/conversionUtils.js";
250
250
  import { catchErrorHandler, extractErrorMessageDescriptor, snackWithFallback } from "./utils/error.js";
251
251
  import { areArrayElementsUnique, arraysContainIdenticalStrings, isEmpty, isObjectEmpty, keyGenerator } from "./utils/functions.js";
@@ -969,8 +969,11 @@ export {
969
969
  VoltageLevelModificationForm,
970
970
  VoltageRegulationForm,
971
971
  WRITE_SLACK_BUS,
972
+ YUP_DEFAULT,
973
+ YUP_NOT_NULL,
972
974
  YUP_NOT_TYPE_DEFAULT,
973
975
  YUP_NOT_TYPE_NUMBER,
976
+ YUP_POSITIVE,
974
977
  YUP_REQUIRED,
975
978
  alertThresholdMarks,
976
979
  areArrayElementsUnique,
@@ -121,6 +121,9 @@ export declare const networkModificationsEn: {
121
121
  ShortCircuitCurrentLimitMinMaxError: string;
122
122
  DuplicatedPropsError: string;
123
123
  YupRequired: string;
124
+ YupNotNull: string;
125
+ YupDefault: string;
126
+ YupPositive: string;
124
127
  YupNotTypeNumber: string;
125
128
  YupNotTypeDefault: string;
126
129
  CreateLoad: string;
@@ -1,4 +1,4 @@
1
- import { YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_REQUIRED, DUPLICATED_PROPS_ERROR } from "../../utils/constants/translationKeys.js";
1
+ import { YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_DEFAULT, YUP_NOT_NULL, YUP_REQUIRED, DUPLICATED_PROPS_ERROR } from "../../utils/constants/translationKeys.js";
2
2
  import "../../utils/conversionUtils.js";
3
3
  import "../../utils/types/equipmentType.js";
4
4
  import "react/jsx-runtime";
@@ -126,6 +126,9 @@ const networkModificationsEn = {
126
126
  ShortCircuitCurrentLimitMinMaxError: "Low short-circuit current limit must be less than or equal to high limit",
127
127
  [DUPLICATED_PROPS_ERROR]: "Duplicated properties: each property must be unique",
128
128
  [YUP_REQUIRED]: "Required",
129
+ [YUP_NOT_NULL]: "Cannot be empty",
130
+ [YUP_DEFAULT]: "This field is invalid",
131
+ [YUP_POSITIVE]: "Must be a positive number",
129
132
  [YUP_NOT_TYPE_NUMBER]: "This field only accepts numeric values",
130
133
  [YUP_NOT_TYPE_DEFAULT]: "Field value format is incorrect",
131
134
  CreateLoad: "Create load",
@@ -169,6 +169,7 @@ export declare const parametersEn: {
169
169
  HighVoltageLimitAdjustment: string;
170
170
  VoltageLevelFilterTooltip: string;
171
171
  FilterInputMinError: string;
172
+ ContingencyListInputMinError: string;
172
173
  EquipmentSelection: string;
173
174
  ReactiveSlacksThreshold: string;
174
175
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: string;
@@ -163,6 +163,7 @@ const parametersEn = {
163
163
  HighVoltageLimitAdjustment: "High voltage limit adjustment",
164
164
  VoltageLevelFilterTooltip: "User entries are applied one after another starting at the top of the list. If a voltage level is included in more than one filter, an entry can therefore be replaced by a subsequent entry",
165
165
  FilterInputMinError: "You must pick at least one filter",
166
+ ContingencyListInputMinError: "You must pick at least one contingency list",
166
167
  EquipmentSelection: "Equipment selection",
167
168
  ReactiveSlacksThreshold: "Alert threshold on reactive slacks",
168
169
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "The threshold must be greater or equal to 0",
@@ -121,6 +121,9 @@ export declare const networkModificationsFr: {
121
121
  ShortCircuitCurrentLimitMinMaxError: string;
122
122
  DuplicatedPropsError: string;
123
123
  YupRequired: string;
124
+ YupNotNull: string;
125
+ YupDefault: string;
126
+ YupPositive: string;
124
127
  YupNotTypeNumber: string;
125
128
  YupNotTypeDefault: string;
126
129
  CreateLoad: string;
@@ -1,4 +1,4 @@
1
- import { YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_REQUIRED, DUPLICATED_PROPS_ERROR } from "../../utils/constants/translationKeys.js";
1
+ import { YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_DEFAULT, YUP_NOT_NULL, YUP_REQUIRED, DUPLICATED_PROPS_ERROR } from "../../utils/constants/translationKeys.js";
2
2
  import "../../utils/conversionUtils.js";
3
3
  import "../../utils/types/equipmentType.js";
4
4
  import "react/jsx-runtime";
@@ -126,6 +126,9 @@ const networkModificationsFr = {
126
126
  ShortCircuitCurrentLimitMinMaxError: "La limite ICC min doit être inférieure ou égale à la limite ICC max",
127
127
  [DUPLICATED_PROPS_ERROR]: "Propriétés dupliquées : chaque propriété doit être unique",
128
128
  [YUP_REQUIRED]: "Obligatoire",
129
+ [YUP_NOT_NULL]: "Ne peut pas être vide",
130
+ [YUP_DEFAULT]: "Ce champ est invalide",
131
+ [YUP_POSITIVE]: "Doit être un nombre positif",
129
132
  [YUP_NOT_TYPE_NUMBER]: "Ce champ n'accepte que des valeurs numériques",
130
133
  [YUP_NOT_TYPE_DEFAULT]: "La valeur du champ n'est pas au bon format",
131
134
  CreateLoad: "Créer une consommation",
@@ -169,6 +169,7 @@ export declare const parametersFr: {
169
169
  HighVoltageLimitAdjustment: string;
170
170
  VoltageLevelFilterTooltip: string;
171
171
  FilterInputMinError: string;
172
+ ContingencyListInputMinError: string;
172
173
  EquipmentSelection: string;
173
174
  ReactiveSlacksThreshold: string;
174
175
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: string;
@@ -163,6 +163,7 @@ const parametersFr = {
163
163
  HighVoltageLimitAdjustment: "Modification limite haute",
164
164
  VoltageLevelFilterTooltip: "Les saisies sont appliquées dans l'ordre de la liste (en remplaçant éventuellement des saisies au fur et à mesure si un poste est inclus dans plusieurs filtres)",
165
165
  FilterInputMinError: "Vous devez sélectionner au moins un filtre",
166
+ ContingencyListInputMinError: "Vous devez sélectionner au moins une liste d'aléas",
166
167
  EquipmentSelection: "Sélection des ouvrages",
167
168
  ReactiveSlacksThreshold: "Seuil d'alerte sur les investissements réactifs",
168
169
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "Le seuil doit être supérieur ou égal à 0",
@@ -5,7 +5,7 @@ import { MAX_CHAR_DESCRIPTION } from "./uiConstants.js";
5
5
  import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./unitsConstants.js";
6
6
  import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES, LAST_SELECTED_DIRECTORY, PARAM_DEVELOPER_MODE, PARAM_LANGUAGE, PARAM_THEME } from "./configConstants.js";
7
7
  import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./filterConstant.js";
8
- import { DUPLICATED_PROPS_ERROR, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_REQUIRED } from "./translationKeys.js";
8
+ import { DUPLICATED_PROPS_ERROR, YUP_DEFAULT, YUP_NOT_NULL, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_REQUIRED } from "./translationKeys.js";
9
9
  export {
10
10
  AMPERE,
11
11
  ActivePowerAdornment,
@@ -44,7 +44,10 @@ export {
44
44
  SIEMENS,
45
45
  SusceptanceAdornment,
46
46
  VoltageAdornment,
47
+ YUP_DEFAULT,
48
+ YUP_NOT_NULL,
47
49
  YUP_NOT_TYPE_DEFAULT,
48
50
  YUP_NOT_TYPE_NUMBER,
51
+ YUP_POSITIVE,
49
52
  YUP_REQUIRED
50
53
  };
@@ -1,4 +1,7 @@
1
1
  export declare const YUP_REQUIRED = "YupRequired";
2
+ export declare const YUP_NOT_NULL = "YupNotNull";
3
+ export declare const YUP_DEFAULT = "YupDefault";
4
+ export declare const YUP_POSITIVE = "YupPositive";
2
5
  export declare const YUP_NOT_TYPE_NUMBER = "YupNotTypeNumber";
3
6
  export declare const YUP_NOT_TYPE_DEFAULT = "YupNotTypeDefault";
4
7
  export declare const DUPLICATED_PROPS_ERROR = "DuplicatedPropsError";
@@ -1,10 +1,16 @@
1
1
  const YUP_REQUIRED = "YupRequired";
2
+ const YUP_NOT_NULL = "YupNotNull";
3
+ const YUP_DEFAULT = "YupDefault";
4
+ const YUP_POSITIVE = "YupPositive";
2
5
  const YUP_NOT_TYPE_NUMBER = "YupNotTypeNumber";
3
6
  const YUP_NOT_TYPE_DEFAULT = "YupNotTypeDefault";
4
7
  const DUPLICATED_PROPS_ERROR = "DuplicatedPropsError";
5
8
  export {
6
9
  DUPLICATED_PROPS_ERROR,
10
+ YUP_DEFAULT,
11
+ YUP_NOT_NULL,
7
12
  YUP_NOT_TYPE_DEFAULT,
8
13
  YUP_NOT_TYPE_NUMBER,
14
+ YUP_POSITIVE,
9
15
  YUP_REQUIRED
10
16
  };
@@ -6,7 +6,7 @@ import { MAX_CHAR_DESCRIPTION } from "./constants/uiConstants.js";
6
6
  import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./constants/unitsConstants.js";
7
7
  import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES, LAST_SELECTED_DIRECTORY, PARAM_DEVELOPER_MODE, PARAM_LANGUAGE, PARAM_THEME } from "./constants/configConstants.js";
8
8
  import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./constants/filterConstant.js";
9
- import { DUPLICATED_PROPS_ERROR, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_REQUIRED } from "./constants/translationKeys.js";
9
+ import { DUPLICATED_PROPS_ERROR, YUP_DEFAULT, YUP_NOT_NULL, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_REQUIRED } from "./constants/translationKeys.js";
10
10
  import { GRIDSUITE_DEFAULT_PRECISION, convertInputValue, convertOutputValue, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, toModificationOperation, unitToKiloUnit, unitToMicroUnit } from "./conversionUtils.js";
11
11
  import { catchErrorHandler, extractErrorMessageDescriptor, snackWithFallback } from "./error.js";
12
12
  import { areArrayElementsUnique, arraysContainIdenticalStrings, isEmpty, isObjectEmpty, keyGenerator } from "./functions.js";
@@ -134,8 +134,11 @@ export {
134
134
  VSC,
135
135
  VoltageAdornment,
136
136
  VoltageLevel,
137
+ YUP_DEFAULT,
138
+ YUP_NOT_NULL,
137
139
  YUP_NOT_TYPE_DEFAULT,
138
140
  YUP_NOT_TYPE_NUMBER,
141
+ YUP_POSITIVE,
139
142
  YUP_REQUIRED,
140
143
  areArrayElementsUnique,
141
144
  areIdsEqual,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.219.1",
3
+ "version": "0.220.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",