@gridsuite/commons-ui 0.132.0 → 0.134.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 (129) hide show
  1. package/dist/components/authentication/utils/authService.js +6 -9
  2. package/dist/components/checkBoxList/CheckBoxList.js +1 -1
  3. package/dist/components/checkBoxList/CheckBoxListItem.js +3 -3
  4. package/dist/components/checkBoxList/CheckBoxListItemContent.js +3 -3
  5. package/dist/components/checkBoxList/CheckBoxListItems.js +4 -4
  6. package/dist/components/checkBoxList/DraggableCheckBoxListItem.js +5 -5
  7. package/dist/components/checkBoxList/DraggableCheckBoxListItemContent.js +1 -1
  8. package/dist/components/contingencyList/criteriaBased/criteriaBasedUtils.js +7 -7
  9. package/dist/components/csvDownloader/use-csv-export.js +1 -4
  10. package/dist/components/customAGGrid/customAggrid.js +2 -2
  11. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -2
  12. package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +1 -2
  13. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +6 -6
  14. package/dist/components/dialogs/elementSaveDialog/utils.js +1 -1
  15. package/dist/components/dialogs/modifyElementSelection/ModifyElementSelection.js +1 -1
  16. package/dist/components/directoryItemSelector/DirectoryItemSelector.js +3 -4
  17. package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +2 -3
  18. package/dist/components/dnd-table/dnd-table.js +7 -7
  19. package/dist/components/elementSearch/elementItem/EquipmentItem.js +6 -7
  20. package/dist/components/elementSearch/elementSearchDialog/ElementSearchDialog.js +1 -1
  21. package/dist/components/elementSearch/tagRenderer/TagRenderer.js +3 -4
  22. package/dist/components/filter/FilterCreationDialog.js +23 -13
  23. package/dist/components/filter/FilterForm.js +2 -2
  24. package/dist/components/filter/expert/ExpertFilterEditionDialog.js +13 -6
  25. package/dist/components/filter/expert/ExpertFilterForm.d.ts +0 -1
  26. package/dist/components/filter/expert/ExpertFilterForm.js +11 -21
  27. package/dist/components/filter/expert/expertFilterConstants.d.ts +13 -12
  28. package/dist/components/filter/expert/expertFilterConstants.js +17 -48
  29. package/dist/components/filter/expert/expertFilterUtils.js +21 -25
  30. package/dist/components/filter/expert/index.js +1 -2
  31. package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +2 -4
  32. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +11 -18
  33. package/dist/components/filter/index.js +1 -2
  34. package/dist/components/filter/utils/filterApi.js +14 -6
  35. package/dist/components/flatParameters/FlatParameters.js +2 -2
  36. package/dist/components/index.js +1 -4
  37. package/dist/components/inputs/SelectClearable.js +1 -1
  38. package/dist/components/inputs/index.js +0 -2
  39. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +44 -48
  40. package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +3 -4
  41. package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js +1 -1
  42. package/dist/components/inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js +4 -4
  43. package/dist/components/inputs/reactHookForm/chip-items-input.js +3 -3
  44. package/dist/components/inputs/reactHookForm/errorManagement/ErrorInput.js +1 -2
  45. package/dist/components/inputs/reactHookForm/index.js +0 -2
  46. package/dist/components/inputs/reactHookForm/numbers/FloatInput.js +1 -1
  47. package/dist/components/inputs/reactHookForm/numbers/SliderInput.js +1 -1
  48. package/dist/components/inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js +2 -2
  49. package/dist/components/inputs/reactHookForm/selectInputs/SelectInput.js +3 -3
  50. package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.js +4 -4
  51. package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.js +3 -3
  52. package/dist/components/inputs/reactHookForm/text/ExpandingTextField.js +2 -2
  53. package/dist/components/inputs/reactHookForm/text/TextInput.js +5 -5
  54. package/dist/components/inputs/reactHookForm/text/UniqueNameInput.js +2 -2
  55. package/dist/components/inputs/reactHookForm/utils/SubmitButton.js +1 -1
  56. package/dist/components/inputs/reactHookForm/utils/functions.js +2 -3
  57. package/dist/components/inputs/reactHookForm/utils/index.d.ts +0 -1
  58. package/dist/components/inputs/reactHookForm/utils/index.js +0 -2
  59. package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +2 -2
  60. package/dist/components/inputs/reactQueryBuilder/PropertyValueEditor.js +8 -9
  61. package/dist/components/inputs/reactQueryBuilder/TextValueEditor.js +1 -1
  62. package/dist/components/inputs/reactQueryBuilder/TranslatedValueEditor.js +1 -1
  63. package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +2 -3
  64. package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +12 -15
  65. package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +3 -4
  66. package/dist/components/notifications/hooks/useListenerManager.js +2 -4
  67. package/dist/components/overflowableText/OverflowableText.js +4 -5
  68. package/dist/components/parameters/common/computing-type.d.ts +2 -1
  69. package/dist/components/parameters/common/computing-type.js +3 -0
  70. package/dist/components/parameters/common/limitreductions/columns-definitions.js +1 -1
  71. package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +1 -1
  72. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +1 -1
  73. package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
  74. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +1 -1
  75. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +3 -3
  76. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +15 -16
  77. package/dist/components/parameters/network-visualizations/map-parameters.js +13 -17
  78. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +1 -2
  79. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +2 -2
  80. package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +2 -3
  81. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +2 -3
  82. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +3 -3
  83. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +1 -1
  84. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +5 -5
  85. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -1
  86. package/dist/components/parameters/sensi/sensitivity-table.js +2 -3
  87. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +42 -54
  88. package/dist/components/parameters/sensi/utils.js +16 -27
  89. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +2 -2
  90. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
  91. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  92. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +47 -56
  93. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +1 -1
  94. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
  95. package/dist/components/snackbarProvider/SnackbarProvider.js +1 -4
  96. package/dist/components/topBar/TopBar.js +33 -36
  97. package/dist/components/topBar/UserInformationDialog.js +7 -8
  98. package/dist/components/topBar/UserSettingsDialog.js +1 -1
  99. package/dist/components/treeViewFinder/TreeViewFinder.js +13 -13
  100. package/dist/hooks/use-parameters-backend.js +5 -5
  101. package/dist/hooks/use-unique-name-validation.js +2 -3
  102. package/dist/hooks/useConfidentialityWarning.js +1 -1
  103. package/dist/hooks/usePredefinedProperties.js +1 -2
  104. package/dist/index.js +9 -5
  105. package/dist/redux/commonStore.js +1 -2
  106. package/dist/services/businessErrorCode.d.ts +11 -0
  107. package/dist/services/businessErrorCode.js +10 -0
  108. package/dist/services/index.d.ts +1 -0
  109. package/dist/services/index.js +2 -0
  110. package/dist/services/utils.js +13 -7
  111. package/dist/translations/en/businessErrorsEn.d.ts +28 -0
  112. package/dist/translations/en/businessErrorsEn.js +25 -0
  113. package/dist/translations/en/equipmentsEn.d.ts +1 -0
  114. package/dist/translations/en/equipmentsEn.js +2 -1
  115. package/dist/translations/en/index.d.ts +1 -0
  116. package/dist/translations/en/index.js +2 -0
  117. package/dist/translations/fr/businessErrorsFr.d.ts +28 -0
  118. package/dist/translations/fr/businessErrorsFr.js +25 -0
  119. package/dist/translations/fr/equipmentsFr.d.ts +1 -0
  120. package/dist/translations/fr/equipmentsFr.js +2 -1
  121. package/dist/translations/fr/index.d.ts +1 -0
  122. package/dist/translations/fr/index.js +2 -0
  123. package/dist/utils/index.js +2 -1
  124. package/dist/utils/types/equipmentType.d.ts +162 -8
  125. package/dist/utils/types/equipmentType.js +126 -22
  126. package/dist/utils/types/index.js +2 -1
  127. package/package.json +6 -6
  128. package/dist/components/inputs/reactHookForm/utils/RefreshButton.d.ts +0 -2
  129. package/dist/components/inputs/reactHookForm/utils/RefreshButton.js +0 -9
@@ -42,7 +42,7 @@ import { DISTRIBUTION_KEY, FilterType, NO_ITEM_SELECTION_FOR_COPY } from "./filt
42
42
  import { CriteriaBasedForm } from "./contingencyList/criteriaBased/CriteriaBasedForm.js";
43
43
  import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "./contingencyList/criteriaBased/criteriaBasedUtils.js";
44
44
  import { ExpertFilterEditionDialog } from "./filter/expert/ExpertFilterEditionDialog.js";
45
- import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./filter/expert/ExpertFilterForm.js";
45
+ import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData } from "./filter/expert/ExpertFilterForm.js";
46
46
  import { CombinatorType, DataType, OperatorType } from "./filter/expert/expertFilter.type.js";
47
47
  import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./filter/expert/expertFilterConstants.js";
48
48
  import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./filter/expert/expertFilterUtils.js";
@@ -92,7 +92,6 @@ import { UniqueNameInput } from "./inputs/reactHookForm/text/UniqueNameInput.js"
92
92
  import { CancelButton } from "./inputs/reactHookForm/utils/CancelButton.js";
93
93
  import { FieldLabel } from "./inputs/reactHookForm/utils/FieldLabel.js";
94
94
  import { SubmitButton } from "./inputs/reactHookForm/utils/SubmitButton.js";
95
- import { RefreshButton } from "./inputs/reactHookForm/utils/RefreshButton.js";
96
95
  import { TextFieldWithAdornment } from "./inputs/reactHookForm/utils/TextFieldWithAdornment.js";
97
96
  import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./inputs/reactHookForm/utils/functions.js";
98
97
  import { HelperPreviousValue } from "./inputs/reactHookForm/utils/HelperPreviousValue.js";
@@ -397,7 +396,6 @@ export {
397
396
  RangeType,
398
397
  RawReadOnlyInput,
399
398
  ReactivePowerAdornment,
400
- RefreshButton,
401
399
  RemoveButton,
402
400
  RuleValueEditor,
403
401
  SELECTED,
@@ -516,7 +514,6 @@ export {
516
514
  logout,
517
515
  queryValidator,
518
516
  recursiveRemove,
519
- rqbQuerySchemaValidator,
520
517
  sanitizePercentageValue,
521
518
  saveExpertFilter,
522
519
  saveExplicitNamingFilter,
@@ -9,7 +9,7 @@ function SelectClearable(props) {
9
9
  return value && options.find((option) => option.id === inputValue) || null;
10
10
  };
11
11
  const outputTransform = (option) => {
12
- return (option == null ? void 0 : option.id) ?? null;
12
+ return option?.id ?? null;
13
13
  };
14
14
  return /* @__PURE__ */ jsx(
15
15
  Autocomplete,
@@ -35,7 +35,6 @@ import { UniqueNameInput } from "./reactHookForm/text/UniqueNameInput.js";
35
35
  import { CancelButton } from "./reactHookForm/utils/CancelButton.js";
36
36
  import { FieldLabel } from "./reactHookForm/utils/FieldLabel.js";
37
37
  import { SubmitButton } from "./reactHookForm/utils/SubmitButton.js";
38
- import { RefreshButton } from "./reactHookForm/utils/RefreshButton.js";
39
38
  import { TextFieldWithAdornment } from "./reactHookForm/utils/TextFieldWithAdornment.js";
40
39
  import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./reactHookForm/utils/functions.js";
41
40
  import { HelperPreviousValue } from "./reactHookForm/utils/HelperPreviousValue.js";
@@ -99,7 +98,6 @@ export {
99
98
  RangeInput,
100
99
  RangeType,
101
100
  RawReadOnlyInput,
102
- RefreshButton,
103
101
  RemoveButton,
104
102
  RuleValueEditor,
105
103
  SelectClearable,
@@ -97,22 +97,22 @@ function DirectoryItemsInput({
97
97
  if (!values) {
98
98
  return;
99
99
  }
100
- if ((selected == null ? void 0 : selected.length) > 0 && (values == null ? void 0 : values.length) > 0) {
100
+ if (selected?.length > 0 && values?.length > 0) {
101
101
  selected.forEach((chip) => {
102
102
  remove(getValues(name).findIndex((item) => item.id === chip));
103
103
  });
104
104
  }
105
105
  values.forEach((value) => {
106
106
  const { icon, children, ...otherElementAttributes } = value;
107
- if (getValues(name).find((v) => (v == null ? void 0 : v.id) === otherElementAttributes.id) !== void 0) {
107
+ if (getValues(name).find((v) => v?.id === otherElementAttributes.id) !== void 0) {
108
108
  snackError({
109
109
  messageTxt: "",
110
110
  headerId: "directory_items_input/ElementAlreadyUsed"
111
111
  });
112
112
  } else {
113
113
  append(otherElementAttributes);
114
- onRowChanged == null ? void 0 : onRowChanged(true);
115
- onChange == null ? void 0 : onChange(getValues(name), ArrayAction.ADD, otherElementAttributes);
114
+ onRowChanged?.(true);
115
+ onChange?.(getValues(name), ArrayAction.ADD, otherElementAttributes);
116
116
  }
117
117
  });
118
118
  setDirectoryItemSelectorOpen(false);
@@ -124,16 +124,15 @@ function DirectoryItemsInput({
124
124
  (index) => {
125
125
  const currentValues = getValues(name);
126
126
  remove(index);
127
- onRowChanged == null ? void 0 : onRowChanged(true);
128
- onChange == null ? void 0 : onChange(currentValues, ArrayAction.REMOVE, currentValues[index]);
127
+ onRowChanged?.(true);
128
+ onChange?.(currentValues, ArrayAction.REMOVE, currentValues[index]);
129
129
  },
130
130
  [onRowChanged, remove, getValues, name, onChange]
131
131
  );
132
132
  const handleChipClick = useCallback(
133
133
  (index) => {
134
- var _a;
135
134
  const chips = getValues(name);
136
- const chip = (_a = chips.at(index)) == null ? void 0 : _a.id;
135
+ const chip = chips.at(index)?.id;
137
136
  if (chip) {
138
137
  fetchDirectoryElementPath(chip).then((response) => {
139
138
  const path = response.filter((e) => e.elementUuid !== chip).map((e) => e.elementUuid);
@@ -147,7 +146,7 @@ function DirectoryItemsInput({
147
146
  [getValues, name]
148
147
  );
149
148
  const shouldReplaceElement = useMemo(() => {
150
- return allowMultiSelect === false && (elements == null ? void 0 : elements.length) === 1;
149
+ return allowMultiSelect === false && elements?.length === 1;
151
150
  }, [allowMultiSelect, elements]);
152
151
  return /* @__PURE__ */ jsxs(Fragment, { children: [
153
152
  /* @__PURE__ */ jsxs(
@@ -156,53 +155,50 @@ function DirectoryItemsInput({
156
155
  sx: mergeSx(
157
156
  styles.formDirectoryElements1,
158
157
  // @ts-expect-error
159
- (error == null ? void 0 : error.message) && styles.formDirectoryElementsError
158
+ error?.message && styles.formDirectoryElementsError
160
159
  ),
161
- error: !!(error == null ? void 0 : error.message),
160
+ error: !!error?.message,
162
161
  children: [
163
- (elements == null ? void 0 : elements.length) === 0 && label && /* @__PURE__ */ jsx(
162
+ elements?.length === 0 && label && /* @__PURE__ */ jsx(
164
163
  FieldLabel,
165
164
  {
166
165
  label,
167
166
  optional: labelRequiredFromContext && !isFieldRequired(name, validationSchema, getValues())
168
167
  }
169
168
  ),
170
- (elements == null ? void 0 : elements.length) > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) => {
171
- var _a, _b, _c;
172
- return /* @__PURE__ */ jsxs(
173
- Box,
174
- {
175
- sx: { display: "flex", alignItems: "center", flexDirection: "column", gap: 1 },
176
- children: [
177
- /* @__PURE__ */ jsx(
178
- Chip,
179
- {
180
- size: "small",
181
- sx: {
182
- backgroundColor: ((_a = item == null ? void 0 : item.specificMetadata) == null ? void 0 : _a.equipmentType) && (equipmentColorsMap == null ? void 0 : equipmentColorsMap.get((_b = item == null ? void 0 : item.specificMetadata) == null ? void 0 : _b.equipmentType))
183
- },
184
- onDelete: () => removeElements(index),
185
- onClick: () => handleChipClick(index),
186
- label: /* @__PURE__ */ jsx(
187
- OverflowableText,
188
- {
189
- text: getValues(`${name}.${index}.${NAME}`) ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}.${NAME}` }) : intl.formatMessage({ id: "elementNotFound" }),
190
- sx: { width: "100%" }
191
- }
192
- )
193
- }
194
- ),
195
- equipmentColorsMap && /* @__PURE__ */ jsx(FormHelperText, { children: ((_c = item == null ? void 0 : item.specificMetadata) == null ? void 0 : _c.equipmentType) ? /* @__PURE__ */ jsx(
196
- FormattedMessage,
197
- {
198
- id: getFilterEquipmentTypeLabel(item.specificMetadata.equipmentType)
199
- }
200
- ) : "" })
201
- ]
202
- },
203
- item.id
204
- );
205
- }) }),
169
+ elements?.length > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) => /* @__PURE__ */ jsxs(
170
+ Box,
171
+ {
172
+ sx: { display: "flex", alignItems: "center", flexDirection: "column", gap: 1 },
173
+ children: [
174
+ /* @__PURE__ */ jsx(
175
+ Chip,
176
+ {
177
+ size: "small",
178
+ sx: {
179
+ backgroundColor: item?.specificMetadata?.equipmentType && equipmentColorsMap?.get(item?.specificMetadata?.equipmentType)
180
+ },
181
+ onDelete: () => removeElements(index),
182
+ onClick: () => handleChipClick(index),
183
+ label: /* @__PURE__ */ jsx(
184
+ OverflowableText,
185
+ {
186
+ text: getValues(`${name}.${index}.${NAME}`) ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}.${NAME}` }) : intl.formatMessage({ id: "elementNotFound" }),
187
+ sx: { width: "100%" }
188
+ }
189
+ )
190
+ }
191
+ ),
192
+ equipmentColorsMap && /* @__PURE__ */ jsx(FormHelperText, { children: item?.specificMetadata?.equipmentType ? /* @__PURE__ */ jsx(
193
+ FormattedMessage,
194
+ {
195
+ id: getFilterEquipmentTypeLabel(item.specificMetadata.equipmentType)
196
+ }
197
+ ) : "" })
198
+ ]
199
+ },
200
+ item.id
201
+ )) }),
206
202
  /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(Grid, { container: true, direction: "row-reverse", children: /* @__PURE__ */ jsx(Tooltip, { title: intl.formatMessage({ id: titleId }), children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
207
203
  IconButton,
208
204
  {
@@ -72,7 +72,6 @@ function CustomAgGridTable({
72
72
  rowSelection,
73
73
  ...props
74
74
  }) {
75
- var _a, _b;
76
75
  const theme = useTheme();
77
76
  const [gridApi, setGridApi] = useState(null);
78
77
  const [selectedRows, setSelectedRows] = useState([]);
@@ -86,10 +85,10 @@ function CustomAgGridTable({
86
85
  const { append, remove, update, swap, move } = useFieldArrayOutput;
87
86
  const rowData = watch(name);
88
87
  const isFirstSelected = Boolean(
89
- (rowData == null ? void 0 : rowData.length) && ((_a = gridApi == null ? void 0 : gridApi.api.getRowNode(rowData[0][FieldConstants.AG_GRID_ROW_UUID])) == null ? void 0 : _a.isSelected())
88
+ rowData?.length && gridApi?.api.getRowNode(rowData[0][FieldConstants.AG_GRID_ROW_UUID])?.isSelected()
90
89
  );
91
90
  const isLastSelected = Boolean(
92
- (rowData == null ? void 0 : rowData.length) && ((_b = gridApi == null ? void 0 : gridApi.api.getRowNode(rowData[rowData.length - 1][FieldConstants.AG_GRID_ROW_UUID])) == null ? void 0 : _b.isSelected())
91
+ rowData?.length && gridApi?.api.getRowNode(rowData[rowData.length - 1][FieldConstants.AG_GRID_ROW_UUID])?.isSelected()
93
92
  );
94
93
  const noRowSelected = selectedRows.length === 0;
95
94
  const getIndex = useCallback(
@@ -136,7 +135,7 @@ function CustomAgGridTable({
136
135
  };
137
136
  const onRowDataUpdated = () => {
138
137
  setNewRowAdded(false);
139
- if (gridApi == null ? void 0 : gridApi.api) {
138
+ if (gridApi?.api) {
140
139
  const lastIndex = rowData.length - 1;
141
140
  gridApi.api.paginationGoToLastPage();
142
141
  gridApi.api.ensureIndexVisible(lastIndex, "bottom");
@@ -62,7 +62,7 @@ function CsvUploader({
62
62
  if (row[0].startsWith("#")) {
63
63
  return false;
64
64
  }
65
- return row.some((column) => !!(column == null ? void 0 : column.trim()));
65
+ return row.some((column) => !!column?.trim());
66
66
  });
67
67
  };
68
68
  const handleFileSubmit = (keepTableValues) => {
@@ -34,13 +34,13 @@ function AutocompleteInput({
34
34
  } = useController({ name });
35
35
  const handleChange = (newValue) => {
36
36
  const currentValue = getValues(name);
37
- if ((currentValue == null ? void 0 : currentValue.id) === newValue) {
37
+ if (currentValue?.id === newValue) {
38
38
  return;
39
39
  }
40
40
  if (onCheckNewValue && !onCheckNewValue(newValue)) {
41
41
  return;
42
42
  }
43
- onChangeCallback == null ? void 0 : onChangeCallback();
43
+ onChangeCallback?.();
44
44
  if (!allowNewValue || typeof newValue !== "string") {
45
45
  onChange(outputTransform(newValue));
46
46
  return;
@@ -74,7 +74,7 @@ function AutocompleteInput({
74
74
  ...label && {
75
75
  label: FieldLabel({
76
76
  label,
77
- optional: !isFieldRequired(name, validationSchema, getValues()) && !(props == null ? void 0 : props.disabled) && !removeOptional
77
+ optional: !isFieldRequired(name, validationSchema, getValues()) && !props?.disabled && !removeOptional
78
78
  })
79
79
  },
80
80
  inputRef: ref,
@@ -87,7 +87,7 @@ function AutocompleteInput({
87
87
  disabledTooltip: disabledTooltip || !isUpdate && isNodeBuilt
88
88
  }
89
89
  ),
90
- ...genHelperError(error == null ? void 0 : error.message),
90
+ ...genHelperError(error?.message),
91
91
  ...formProps,
92
92
  ...rest
93
93
  }
@@ -83,15 +83,15 @@ function ChipItemsInput({ label, name, hideErrorMessage }) {
83
83
  const handleChange = (e) => {
84
84
  setTextEntered(e.target.value);
85
85
  };
86
- const hasError = !!(error == null ? void 0 : error.message);
86
+ const hasError = !!error?.message;
87
87
  const containerStyle = useMemo(
88
88
  () => ({ ...styles.chipContainer, borderColor: hasError ? "error.main" : null }),
89
89
  [hasError]
90
90
  );
91
91
  return /* @__PURE__ */ jsxs(Fragment, { children: [
92
92
  /* @__PURE__ */ jsxs(FormControl, { sx: containerStyle, error: hasError, children: [
93
- (elements == null ? void 0 : elements.length) === 0 && label && /* @__PURE__ */ jsx(FieldLabel, { label, optional: !isFieldRequired(name, validationSchema, getValues()) }),
94
- (elements == null ? void 0 : elements.length) > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.chipItem, children: elements.map((item, index) => /* @__PURE__ */ jsx(
93
+ elements?.length === 0 && label && /* @__PURE__ */ jsx(FieldLabel, { label, optional: !isFieldRequired(name, validationSchema, getValues()) }),
94
+ elements?.length > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.chipItem, children: elements.map((item, index) => /* @__PURE__ */ jsx(
95
95
  Chip,
96
96
  {
97
97
  size: "small",
@@ -3,7 +3,6 @@ import { useRef, useEffect } from "react";
3
3
  import { FormattedMessage } from "react-intl";
4
4
  import { useController } from "react-hook-form";
5
5
  function ErrorInput({ name, InputField }) {
6
- var _a;
7
6
  const {
8
7
  fieldState: { error },
9
8
  formState: { isSubmitting }
@@ -32,7 +31,7 @@ function ErrorInput({ name, InputField }) {
32
31
  errorRef.current.scrollIntoView({ behavior: "smooth" });
33
32
  }
34
33
  }, [isSubmitting]);
35
- const errorMsg = (error == null ? void 0 : error.message) || ((_a = error == null ? void 0 : error.root) == null ? void 0 : _a.message);
34
+ const errorMsg = error?.message || error?.root?.message;
36
35
  return errorMsg && /* @__PURE__ */ jsx("div", { ref: errorRef, children: InputField({
37
36
  message: /* @__PURE__ */ jsx(FormattedMessage, { ...errorProps(errorMsg) })
38
37
  }) });
@@ -34,7 +34,6 @@ import { UniqueNameInput } from "./text/UniqueNameInput.js";
34
34
  import { CancelButton } from "./utils/CancelButton.js";
35
35
  import { FieldLabel } from "./utils/FieldLabel.js";
36
36
  import { SubmitButton } from "./utils/SubmitButton.js";
37
- import { RefreshButton } from "./utils/RefreshButton.js";
38
37
  import { TextFieldWithAdornment } from "./utils/TextFieldWithAdornment.js";
39
38
  import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./utils/functions.js";
40
39
  import { HelperPreviousValue } from "./utils/HelperPreviousValue.js";
@@ -72,7 +71,6 @@ export {
72
71
  RangeInput,
73
72
  RangeType,
74
73
  RawReadOnlyInput,
75
- RefreshButton,
76
74
  SelectInput,
77
75
  SliderInput,
78
76
  SubmitButton,
@@ -27,7 +27,7 @@ function FloatInput(props) {
27
27
  if (value === "") {
28
28
  return null;
29
29
  }
30
- const tmp = (value == null ? void 0 : value.replace(",", ".")) || "";
30
+ const tmp = value?.replace(",", ".") || "";
31
31
  if (tmp.endsWith(".") || tmp.includes(".") && tmp.endsWith("0")) {
32
32
  return tmp;
33
33
  }
@@ -18,7 +18,7 @@ function SliderInput({
18
18
  field: { onChange, value }
19
19
  } = useController({ name });
20
20
  const handleValueChange = (event, newValue, activeThumb) => {
21
- onValueChanged == null ? void 0 : onValueChanged(newValue);
21
+ onValueChanged?.(newValue);
22
22
  onChange(newValue);
23
23
  };
24
24
  return /* @__PURE__ */ jsx(
@@ -29,7 +29,7 @@ function InputWithPopupConfirmation({
29
29
  }
30
30
  };
31
31
  const handlePopupConfirmation = () => {
32
- resetOnConfirmation == null ? void 0 : resetOnConfirmation();
32
+ resetOnConfirmation?.();
33
33
  onChange(newValue);
34
34
  setOpenPopup(false);
35
35
  };
@@ -40,7 +40,7 @@ function InputWithPopupConfirmation({
40
40
  name,
41
41
  ...props,
42
42
  onChange: (e, value) => {
43
- handleOnChange(e, (value == null ? void 0 : value.id) ?? value);
43
+ handleOnChange(e, value?.id ?? value);
44
44
  }
45
45
  }
46
46
  ),
@@ -11,15 +11,15 @@ function SelectInput(props) {
11
11
  return null;
12
12
  }
13
13
  if (typeof value === "string") {
14
- return options.find((option) => typeof option !== "string" && (option == null ? void 0 : option.id) === value) || null;
14
+ return options.find((option) => typeof option !== "string" && option?.id === value) || null;
15
15
  }
16
- return options.find((option) => typeof option !== "string" && (option == null ? void 0 : option.id) === value.id) || null;
16
+ return options.find((option) => typeof option !== "string" && option?.id === value.id) || null;
17
17
  };
18
18
  const outputTransform = (value) => {
19
19
  if (typeof value === "string") {
20
20
  return value;
21
21
  }
22
- return (value == null ? void 0 : value.id) ?? null;
22
+ return value?.id ?? null;
23
23
  };
24
24
  const getOptionLabel = (option) => {
25
25
  if (typeof option === "string") {
@@ -46,7 +46,7 @@ function TableNumericalInput({
46
46
  if (str === "") {
47
47
  return null;
48
48
  }
49
- const tmp = (str == null ? void 0 : str.replace(",", ".")) || "";
49
+ const tmp = str?.replace(",", ".") || "";
50
50
  if (tmp.endsWith(".") || tmp.endsWith("0")) {
51
51
  return str;
52
52
  }
@@ -67,13 +67,13 @@ function TableNumericalInput({
67
67
  {
68
68
  value: transformedValue,
69
69
  onChange: handleInputChange,
70
- error: !!(error == null ? void 0 : error.message),
70
+ error: !!error?.message,
71
71
  size: "small",
72
72
  fullWidth: true,
73
73
  inputRef: ref,
74
74
  InputProps: {
75
75
  endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
76
- transformedValue && (adornment == null ? void 0 : adornment.text),
76
+ transformedValue && adornment?.text,
77
77
  clearable && /* @__PURE__ */ jsx(
78
78
  IconButton,
79
79
  {
@@ -92,7 +92,7 @@ function TableNumericalInput({
92
92
  fontSize: "small",
93
93
  color: previousValue !== void 0 && previousValue === parseFloat(value) && !valueModified ? "grey" : void 0,
94
94
  // grey out the value if it is the same as the previous one
95
- textAlign: (style == null ? void 0 : style.textAlign) ?? "left"
95
+ textAlign: style?.textAlign ?? "left"
96
96
  },
97
97
  inputMode: "numeric",
98
98
  pattern: "[0-9]*",
@@ -9,7 +9,7 @@ function TableTextInput({ name, showErrorMsg, inputProps, ...props }) {
9
9
  } = useController({ name });
10
10
  const intl = useIntl();
11
11
  const outputTransform = (str) => {
12
- return (str == null ? void 0 : str.trim()) === "" ? "" : str;
12
+ return str?.trim() === "" ? "" : str;
13
13
  };
14
14
  const handleInputChange = (e) => {
15
15
  onChange(outputTransform(e.target.value));
@@ -19,8 +19,8 @@ function TableTextInput({ name, showErrorMsg, inputProps, ...props }) {
19
19
  {
20
20
  value,
21
21
  onChange: handleInputChange,
22
- error: !!(error == null ? void 0 : error.message),
23
- helperText: showErrorMsg && ((error == null ? void 0 : error.message) ? intl.formatMessage({ id: error.message }) : ""),
22
+ error: !!error?.message,
23
+ helperText: showErrorMsg && (error?.message ? intl.formatMessage({ id: error.message }) : ""),
24
24
  size: "small",
25
25
  fullWidth: true,
26
26
  inputRef: ref,
@@ -23,8 +23,8 @@ function ExpandingTextField({
23
23
  const handleBlur = () => {
24
24
  setIsFocused(false);
25
25
  };
26
- const isOverTheLimit = (descriptionWatch == null ? void 0 : descriptionWatch.length) > maxCharactersNumber;
27
- const descriptionLength = (descriptionWatch == null ? void 0 : descriptionWatch.length) ?? 0;
26
+ const isOverTheLimit = descriptionWatch?.length > maxCharactersNumber;
27
+ const descriptionLength = descriptionWatch?.length ?? 0;
28
28
  const descriptionCounter = `${descriptionLength}/${maxCharactersNumber}`;
29
29
  const rowsToDisplay = isFocused ? rows : minRows;
30
30
  const formProps = {
@@ -35,8 +35,8 @@ function TextInput({
35
35
  } = useController({ name });
36
36
  const Field = adornment ? TextFieldWithAdornment : TextField;
37
37
  const finalAdornment = {
38
- adornmentPosition: (adornment == null ? void 0 : adornment.position) ?? "",
39
- adornmentText: (adornment == null ? void 0 : adornment.text) ?? ""
38
+ adornmentPosition: adornment?.position ?? "",
39
+ adornmentText: adornment?.text ?? ""
40
40
  };
41
41
  const handleClearValue = () => {
42
42
  onChange(outputTransform(""));
@@ -50,7 +50,7 @@ function TextInput({
50
50
  const fieldLabel = !label ? null : FieldLabel({
51
51
  label,
52
52
  values: labelValues,
53
- optional: !isFieldRequired(name, validationSchema, getValues()) && !(formProps == null ? void 0 : formProps.disabled) && !removeOptional
53
+ optional: !isFieldRequired(name, validationSchema, getValues()) && !formProps?.disabled && !removeOptional
54
54
  });
55
55
  return /* @__PURE__ */ jsx(
56
56
  Field,
@@ -78,10 +78,10 @@ function TextInput({
78
78
  previousValue,
79
79
  isNodeBuilt,
80
80
  disabledTooltip: disabledTooltip || !isUpdate && isNodeBuilt,
81
- adornmentText: adornment == null ? void 0 : adornment.text
81
+ adornmentText: adornment?.text
82
82
  }
83
83
  ),
84
- ...genHelperError(error == null ? void 0 : error.message),
84
+ ...genHelperError(error?.message),
85
85
  ...formProps,
86
86
  ...adornment && { ...finalAdornment }
87
87
  },
@@ -32,11 +32,11 @@ function UniqueNameInput({
32
32
  });
33
33
  const handleManualChange = (e) => {
34
34
  onChange(e.target.value);
35
- onManualChangeCallback == null ? void 0 : onManualChangeCallback();
35
+ onManualChangeCallback?.();
36
36
  };
37
37
  const translatedLabel = /* @__PURE__ */ jsx(FormattedMessage, { id: label });
38
38
  const translatedError = error && /* @__PURE__ */ jsx(FormattedMessage, { id: error.message });
39
- const showOk = (value == null ? void 0 : value.trim()) && !isValidating && !error;
39
+ const showOk = value?.trim() && !isValidating && !error;
40
40
  const endAdornment = /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
41
41
  isValidating && /* @__PURE__ */ jsx(CircularProgress, { size: "1rem" }),
42
42
  showOk && /* @__PURE__ */ jsx(Check, { style: { color: "green" } })
@@ -4,7 +4,7 @@ import { useFormState } from "react-hook-form";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  function SubmitButton(buttonProps) {
6
6
  const { isDirty } = useFormState();
7
- return /* @__PURE__ */ jsx(Button, { ...buttonProps, disabled: !isDirty || ((buttonProps == null ? void 0 : buttonProps.disabled) ?? false), children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" }) });
7
+ return /* @__PURE__ */ jsx(Button, { ...buttonProps, disabled: !isDirty || (buttonProps?.disabled ?? false), children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" }) });
8
8
  }
9
9
  export {
10
10
  SubmitButton
@@ -16,9 +16,8 @@ function identity(x) {
16
16
  return x;
17
17
  }
18
18
  const isFieldRequired = (fieldName, schema, values) => {
19
- var _a;
20
19
  const { schema: fieldSchema, parent: parentValues } = getIn(schema, fieldName, values) || {};
21
- return ((_a = fieldSchema.describe({ parent: parentValues })) == null ? void 0 : _a.optional) === false;
20
+ return fieldSchema.describe({ parent: parentValues })?.optional === false;
22
21
  };
23
22
  const gridItem = (field, size = 6) => {
24
23
  return /* @__PURE__ */ jsx(Grid, { item: true, xs: size, alignItems: "start", children: field });
@@ -30,7 +29,7 @@ const toFloatOrNullValue = (value) => {
30
29
  if (value === "0") {
31
30
  return 0;
32
31
  }
33
- const tmp = (value == null ? void 0 : value.replace(",", ".")) || "";
32
+ const tmp = value?.replace(",", ".") || "";
34
33
  return parseFloat(tmp) || null;
35
34
  };
36
35
  export {
@@ -7,7 +7,6 @@
7
7
  export * from './CancelButton';
8
8
  export * from './FieldLabel';
9
9
  export * from './SubmitButton';
10
- export * from './RefreshButton';
11
10
  export * from './TextFieldWithAdornment';
12
11
  export * from './functions';
13
12
  export * from './HelperPreviousValue';
@@ -1,7 +1,6 @@
1
1
  import { CancelButton } from "./CancelButton.js";
2
2
  import { FieldLabel } from "./FieldLabel.js";
3
3
  import { SubmitButton } from "./SubmitButton.js";
4
- import { RefreshButton } from "./RefreshButton.js";
5
4
  import { TextFieldWithAdornment } from "./TextFieldWithAdornment.js";
6
5
  import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./functions.js";
7
6
  import { HelperPreviousValue } from "./HelperPreviousValue.js";
@@ -9,7 +8,6 @@ export {
9
8
  CancelButton,
10
9
  FieldLabel,
11
10
  HelperPreviousValue,
12
- RefreshButton,
13
11
  SubmitButton,
14
12
  TextFieldWithAdornment,
15
13
  genHelperError,
@@ -15,8 +15,8 @@ import { useSelectAppearance } from "../../../hooks/useSelectAppearance.js";
15
15
  import "react-hook-form";
16
16
  function OperatorSelector(props) {
17
17
  const { options } = props;
18
- const selectAppearance = useSelectAppearance((options == null ? void 0 : options.length) || 0);
19
- if (!(options == null ? void 0 : options.length)) {
18
+ const selectAppearance = useSelectAppearance(options?.length || 0);
19
+ if (!options?.length) {
20
20
  return null;
21
21
  }
22
22
  return /* @__PURE__ */ jsx(MaterialValueSelector, { ...props, ...selectAppearance, sx: { border: "none" } });