@gridsuite/commons-ui 0.68.0 → 0.68.2

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 (54) hide show
  1. package/dist/assets/ExpertFilterForm.css +0 -5
  2. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.d.ts +35 -1
  3. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +53 -18
  4. package/dist/components/dialogs/index.js +3 -2
  5. package/dist/components/filter/FilterCreationDialog.js +1 -0
  6. package/dist/components/filter/FilterForm.d.ts +2 -12
  7. package/dist/components/filter/FilterForm.js +29 -38
  8. package/dist/components/filter/HeaderFilterForm.d.ts +13 -0
  9. package/dist/components/filter/HeaderFilterForm.js +53 -0
  10. package/dist/components/filter/criteriaBased/CriteriaBasedFilterEditionDialog.js +1 -0
  11. package/dist/components/filter/criteriaBased/CriteriaBasedFilterForm.js +9 -12
  12. package/dist/components/filter/criteriaBased/CriteriaBasedForm.d.ts +3 -1
  13. package/dist/components/filter/criteriaBased/CriteriaBasedForm.js +24 -10
  14. package/dist/components/filter/expert/ExpertFilterEditionDialog.js +1 -0
  15. package/dist/components/filter/expert/ExpertFilterForm.js +16 -5
  16. package/dist/components/filter/expert/expertFilter.type.d.ts +3 -1
  17. package/dist/components/filter/expert/expertFilter.type.js +2 -0
  18. package/dist/components/filter/expert/expertFilterConstants.d.ts +12 -0
  19. package/dist/components/filter/expert/expertFilterConstants.js +15 -1
  20. package/dist/components/filter/expert/expertFilterUtils.js +17 -2
  21. package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +1 -0
  22. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +16 -7
  23. package/dist/components/filter/utils/filterFormUtils.d.ts +1 -2
  24. package/dist/components/index.js +2 -1
  25. package/dist/components/inputs/reactHookForm/agGridTable/BottomRightButtons.js +2 -2
  26. package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +4 -5
  27. package/dist/components/inputs/reactQueryBuilder/AddButton.js +2 -2
  28. package/dist/components/inputs/reactQueryBuilder/CombinatorSelector.js +0 -1
  29. package/dist/components/inputs/reactQueryBuilder/CountryValueEditor.js +2 -1
  30. package/dist/components/inputs/reactQueryBuilder/CustomReactQueryBuilder.js +20 -6
  31. package/dist/components/inputs/reactQueryBuilder/FieldSelector.d.ts +1 -1
  32. package/dist/components/inputs/reactQueryBuilder/FieldSelector.js +9 -1
  33. package/dist/components/inputs/reactQueryBuilder/PropertyValueEditor.js +2 -0
  34. package/dist/components/inputs/reactQueryBuilder/RemoveButton.js +2 -2
  35. package/dist/components/inputs/reactQueryBuilder/TextValueEditor.js +4 -9
  36. package/dist/components/inputs/reactQueryBuilder/TranslatedValueEditor.js +3 -9
  37. package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +3 -9
  38. package/dist/components/inputs/reactQueryBuilder/ValueSelector.js +1 -7
  39. package/dist/components/topBar/TopBar.js +9 -2
  40. package/dist/components/topBar/UserInformationDialog.js +5 -8
  41. package/dist/index.js +5 -2
  42. package/dist/translations/en/filterExpertEn.d.ts +2 -0
  43. package/dist/translations/en/filterExpertEn.js +3 -1
  44. package/dist/translations/en/topBarEn.d.ts +1 -1
  45. package/dist/translations/en/topBarEn.js +1 -1
  46. package/dist/translations/fr/filterExpertFr.d.ts +2 -0
  47. package/dist/translations/fr/filterExpertFr.js +3 -1
  48. package/dist/translations/fr/topBarFr.d.ts +1 -1
  49. package/dist/translations/fr/topBarFr.js +2 -2
  50. package/dist/utils/conversionUtils.d.ts +2 -0
  51. package/dist/utils/conversionUtils.js +4 -0
  52. package/dist/utils/index.js +3 -1
  53. package/dist/utils/types/metadata.d.ts +1 -0
  54. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useCallback } from "react";
3
3
  import { useIntl } from "react-intl";
4
4
  import { useFormContext, useWatch } from "react-hook-form";
5
- import Grid from "@mui/material/Grid";
5
+ import { Box } from "@mui/material";
6
6
  import { v4 } from "uuid";
7
7
  import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
8
8
  import "../../../utils/yupConfig.js";
@@ -18,6 +18,14 @@ import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
18
18
  import { ElementType } from "../../../utils/types/elementType.js";
19
19
  import { ModifyElementSelection } from "../../dialogs/modifyElementSelection/ModifyElementSelection.js";
20
20
  import { exportFilter } from "../../../services/study.js";
21
+ import { unscrollableDialogStyles } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
22
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
23
+ import "@mui/material/Dialog";
24
+ import "@mui/material/DialogTitle";
25
+ import "@mui/material/DialogContent";
26
+ import "@mui/material/DialogActions";
27
+ import "@mui/material/Button";
28
+ import "@mui/material/styles";
21
29
  import * as yup from "yup";
22
30
  const FILTER_EQUIPMENTS_ATTRIBUTES = "filterEquipmentsAttributes";
23
31
  function isGeneratorOrLoad(equipmentType) {
@@ -155,8 +163,8 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
155
163
  })
156
164
  );
157
165
  };
158
- return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 2, children: [
159
- /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
166
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
167
+ /* @__PURE__ */ jsxs(Box, { sx: unscrollableDialogStyles.unscrollableHeader, children: [
160
168
  /* @__PURE__ */ jsx(
161
169
  InputWithPopupConfirmation,
162
170
  {
@@ -183,7 +191,7 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
183
191
  }
184
192
  )
185
193
  ] }),
186
- watchEquipmentType && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
194
+ watchEquipmentType && /* @__PURE__ */ jsx(
187
195
  CustomAgGridTable,
188
196
  {
189
197
  name: FILTER_EQUIPMENTS_ATTRIBUTES,
@@ -203,12 +211,13 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
203
211
  getDataFromCsv: getDataFromCsvFile
204
212
  },
205
213
  cssProps: {
214
+ padding: 1,
206
215
  "& .ag-root-wrapper-body": {
207
- maxHeight: "430px"
216
+ maxHeight: "unset"
208
217
  }
209
218
  }
210
219
  }
211
- ) })
220
+ )
212
221
  ] });
213
222
  }
214
223
  export {
@@ -1,7 +1,7 @@
1
1
  import { EquipmentType } from '../../../utils/types/equipmentType';
2
2
  import { FunctionComponent } from 'react';
3
3
 
4
- type FormField = {
4
+ export type FormField = {
5
5
  renderer: FunctionComponent<any>;
6
6
  props: {
7
7
  label: string;
@@ -15,4 +15,3 @@ export type FormEquipment = {
15
15
  };
16
16
  export declare const CONTINGENCY_LIST_EQUIPMENTS: Record<EquipmentType.BUSBAR_SECTION | EquipmentType.LINE | EquipmentType.TWO_WINDINGS_TRANSFORMER | EquipmentType.GENERATOR | EquipmentType.SHUNT_COMPENSATOR | EquipmentType.HVDC_LINE | EquipmentType.DANGLING_LINE, FormEquipment>;
17
17
  export declare const FILTER_EQUIPMENTS: Record<EquipmentType.SUBSTATION | EquipmentType.VOLTAGE_LEVEL | EquipmentType.LINE | EquipmentType.TWO_WINDINGS_TRANSFORMER | EquipmentType.THREE_WINDINGS_TRANSFORMER | EquipmentType.GENERATOR | EquipmentType.BATTERY | EquipmentType.LOAD | EquipmentType.SHUNT_COMPENSATOR | EquipmentType.STATIC_VAR_COMPENSATOR | EquipmentType.HVDC_LINE | EquipmentType.DANGLING_LINE, FormEquipment>;
18
- export {};
@@ -13,7 +13,7 @@ import { CardErrorBoundary } from "./cardErrorBoundary/CardErrorBoundary.js";
13
13
  import { CheckBoxList } from "./checkBoxList/CheckBoxList.js";
14
14
  import { CUSTOM_AGGRID_THEME, styles } from "./customAGGrid/customAggrid.style.js";
15
15
  import { CustomAGGrid } from "./customAGGrid/customAggrid.js";
16
- import { CustomMuiDialog } from "./dialogs/customMuiDialog/CustomMuiDialog.js";
16
+ import { CustomMuiDialog, unscrollableDialogStyles } from "./dialogs/customMuiDialog/CustomMuiDialog.js";
17
17
  import { DescriptionModificationDialog } from "./dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
18
18
  import { ModifyElementSelection } from "./dialogs/modifyElementSelection/ModifyElementSelection.js";
19
19
  import { PopupConfirmationDialog } from "./dialogs/popupConfirmationDialog/PopupConfirmationDialog.js";
@@ -286,6 +286,7 @@ export {
286
286
  styles,
287
287
  testQuery,
288
288
  toFloatOrNullValue,
289
+ unscrollableDialogStyles,
289
290
  useConvertValue,
290
291
  useCustomFormContext,
291
292
  useElementSearch,
@@ -1,5 +1,5 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { Grid, Tooltip } from "@mui/material";
2
+ import { Grid, Tooltip, Box } from "@mui/material";
3
3
  import IconButton from "@mui/material/IconButton";
4
4
  import { Upload, ArrowCircleUp, ArrowCircleDown } from "@mui/icons-material";
5
5
  import AddIcon from "@mui/icons-material/ControlPoint";
@@ -48,7 +48,7 @@ function BottomRightButtons({
48
48
  /* @__PURE__ */ jsx(InnerColoredButton, { disabled: disableDown, onClick: handleMoveRowDown, children: /* @__PURE__ */ jsx(ArrowCircleDown, {}) }, "downButton")
49
49
  ] })
50
50
  ] }),
51
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert }) }),
51
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert }) }),
52
52
  /* @__PURE__ */ jsx(
53
53
  CsvUploader,
54
54
  {
@@ -1,10 +1,10 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useState, useCallback, useEffect } from "react";
3
3
  import { useFormContext, useFieldArray } from "react-hook-form";
4
4
  import { AgGridReact } from "ag-grid-react";
5
5
  import "ag-grid-community/styles/ag-grid.css";
6
6
  import "ag-grid-community/styles/ag-theme-alpine.css";
7
- import { useTheme, Grid } from "@mui/material";
7
+ import { useTheme, Box } from "@mui/material";
8
8
  import { useIntl } from "react-intl";
9
9
  import { BottomRightButtons } from "./BottomRightButtons.js";
10
10
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
@@ -182,8 +182,8 @@ function CustomAgGridTable({
182
182
  const isAnycolumnhasSort = event.api.getColumnState().some((col) => col.sort);
183
183
  setIsSortApplied(isAnycolumnhasSort);
184
184
  }, []);
185
- return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
186
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, className: theme.aggrid.theme, sx: style(cssProps).grid, children: /* @__PURE__ */ jsx(
185
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
186
+ /* @__PURE__ */ jsx(Box, { className: theme.aggrid.theme, sx: style(cssProps).grid, children: /* @__PURE__ */ jsx(
187
187
  AgGridReact,
188
188
  {
189
189
  rowData,
@@ -191,7 +191,6 @@ function CustomAgGridTable({
191
191
  getLocaleText,
192
192
  cacheOverflowSize: 10,
193
193
  rowSelection: "multiple",
194
- domLayout: "autoHeight",
195
194
  rowDragEntireRow: true,
196
195
  rowDragManaged: true,
197
196
  onRowDragEnd: (e) => move(getIndex(e.node.data), e.overIndex),
@@ -3,8 +3,8 @@ import { Button } from "@mui/material";
3
3
  import AddIcon from "@mui/icons-material/ControlPoint";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  function AddButton(props) {
6
- const { label, handleOnClick } = props;
7
- return /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(AddIcon, {}), onClick: handleOnClick, size: "small", className: "add-button", children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }) });
6
+ const { label, handleOnClick, title } = props;
7
+ return /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(AddIcon, {}), onClick: handleOnClick, size: "small", className: "add-button", title, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }) });
8
8
  }
9
9
  export {
10
10
  AddButton
@@ -25,7 +25,6 @@ function CombinatorSelector(props) {
25
25
  MaterialValueSelector,
26
26
  {
27
27
  ...props,
28
- title: void 0,
29
28
  handleOnChange: (newCombinator) => {
30
29
  setTempCombinator(newCombinator);
31
30
  setOpenPopup(true);
@@ -7,7 +7,7 @@ import { AutocompleteWithFavorites } from "./AutocompleteWithFavorites.js";
7
7
  import { useConvertValue } from "./hooks/useConvertValue.js";
8
8
  import { useValid } from "./hooks/useValid.js";
9
9
  function CountryValueEditor(props) {
10
- const { value, handleOnChange } = props;
10
+ const { value, handleOnChange, title } = props;
11
11
  const { language } = useCustomFormContext();
12
12
  const { translate, countryCodes } = useLocalizedCountries(language);
13
13
  const [favoriteCountryCodes, setFavoriteCountryCodes] = useState([]);
@@ -33,6 +33,7 @@ function CountryValueEditor(props) {
33
33
  favorites: favoriteCountryCodes,
34
34
  getOptionLabel: (code) => code ? translate(code) : "",
35
35
  valid,
36
+ title,
36
37
  onChange: (event, newValue) => {
37
38
  handleOnChange(newValue);
38
39
  },
@@ -1,10 +1,10 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import Grid from "@mui/material/Grid";
2
+ import { Box } from "@mui/material";
3
3
  import { QueryBuilderDnD } from "@react-querybuilder/dnd";
4
4
  import * as ReactDnD from "react-dnd";
5
5
  import * as ReactDndHtml5Backend from "react-dnd-html5-backend";
6
6
  import { QueryBuilderMaterial } from "@react-querybuilder/material";
7
- import { formatQuery, QueryBuilder } from "react-querybuilder";
7
+ import { defaultTranslations, formatQuery, QueryBuilder } from "react-querybuilder";
8
8
  import { useIntl } from "react-intl";
9
9
  import { useFormContext } from "react-hook-form";
10
10
  import { useCallback, useMemo } from "react";
@@ -24,6 +24,18 @@ function RuleAddButton(props) {
24
24
  function GroupAddButton(props) {
25
25
  return /* @__PURE__ */ jsx(AddButton, { ...props, label: "subGroup" });
26
26
  }
27
+ const customTranslations = {
28
+ ...defaultTranslations,
29
+ fields: { ...defaultTranslations.fields, title: "" },
30
+ operators: { ...defaultTranslations.operators, title: "" },
31
+ dragHandle: { ...defaultTranslations.dragHandle, title: "" },
32
+ addRule: { ...defaultTranslations.addRule, title: "" },
33
+ addGroup: { ...defaultTranslations.addGroup, title: "" },
34
+ removeRule: { ...defaultTranslations.removeRule, title: "" },
35
+ removeGroup: { ...defaultTranslations.removeGroup, title: "" },
36
+ value: { title: "" },
37
+ combinators: { title: "" }
38
+ };
27
39
  function CustomReactQueryBuilder(props) {
28
40
  const { name, fields } = props;
29
41
  const {
@@ -54,7 +66,7 @@ function CustomReactQueryBuilder(props) {
54
66
  }));
55
67
  }, [intl]);
56
68
  return /* @__PURE__ */ jsxs(Fragment, { children: [
57
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(QueryBuilderMaterial, { children: /* @__PURE__ */ jsx(QueryBuilderDnD, { dnd: { ...ReactDnD, ...ReactDndHtml5Backend }, children: /* @__PURE__ */ jsx(
69
+ /* @__PURE__ */ jsx(QueryBuilderMaterial, { children: /* @__PURE__ */ jsx(QueryBuilderDnD, { dnd: { ...ReactDnD, ...ReactDndHtml5Backend }, children: /* @__PURE__ */ jsx(
58
70
  QueryBuilder,
59
71
  {
60
72
  fields,
@@ -78,10 +90,12 @@ function CustomReactQueryBuilder(props) {
78
90
  fieldSelector: FieldSelector,
79
91
  valueSourceSelector: ValueSelector
80
92
  },
81
- listsAsArrays: true
93
+ listsAsArrays: true,
94
+ accessibleDescriptionGenerator: () => "",
95
+ translations: customTranslations
82
96
  }
83
- ) }) }) }),
84
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert }) })
97
+ ) }) }),
98
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert }) })
85
99
  ] });
86
100
  }
87
101
  export {
@@ -1,3 +1,3 @@
1
1
  import { ValueSelectorProps } from 'react-querybuilder';
2
2
 
3
- export declare function FieldSelector({ options, className, value, disabled, handleOnChange }: Readonly<ValueSelectorProps>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FieldSelector({ options, className, value, disabled, handleOnChange, title, }: Readonly<ValueSelectorProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,14 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { toFlatOptionArray } from "react-querybuilder";
3
3
  import { Autocomplete, TextField } from "@mui/material";
4
- function FieldSelector({ options, className, value, disabled, handleOnChange }) {
4
+ function FieldSelector({
5
+ options,
6
+ className,
7
+ value,
8
+ disabled,
9
+ handleOnChange,
10
+ title
11
+ }) {
5
12
  const optionList = toFlatOptionArray(options);
6
13
  return /* @__PURE__ */ jsx(
7
14
  Autocomplete,
@@ -17,6 +24,7 @@ function FieldSelector({ options, className, value, disabled, handleOnChange })
17
24
  options: optionList,
18
25
  disableClearable: true,
19
26
  size: "small",
27
+ title,
20
28
  renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, label: "", variant: "standard" }),
21
29
  autoHighlight: true,
22
30
  getOptionLabel: (option) => option.label
@@ -66,6 +66,7 @@ function PropertyValueEditor(props) {
66
66
  {
67
67
  value: propertyOperator ?? PROPERTY_VALUE_OPERATORS[0].customName,
68
68
  size: "small",
69
+ title: valueEditorProps == null ? void 0 : valueEditorProps.title,
69
70
  error: !valid,
70
71
  onChange: (event, value) => {
71
72
  onChange(FieldConstants.PROPERTY_OPERATOR, value);
@@ -78,6 +79,7 @@ function PropertyValueEditor(props) {
78
79
  {
79
80
  value: propertyValues ?? [],
80
81
  options: predefinedValues ?? [],
82
+ title: valueEditorProps == null ? void 0 : valueEditorProps.title,
81
83
  multiple: true,
82
84
  renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: !valid }),
83
85
  freeSolo: true,
@@ -5,7 +5,7 @@ import { useController } from "react-hook-form";
5
5
  import { getNumberOfSiblings, recursiveRemove } from "../../filter/expert/expertFilterUtils.js";
6
6
  const EXPERT_FILTER_QUERY = "rules";
7
7
  function RemoveButton(props) {
8
- const { path, className } = props;
8
+ const { path, className, title } = props;
9
9
  const {
10
10
  field: { value: query, onChange }
11
11
  } = useController({ name: EXPERT_FILTER_QUERY });
@@ -13,7 +13,7 @@ function RemoveButton(props) {
13
13
  onChange(recursiveRemove(query, path));
14
14
  }
15
15
  const isLastRuleOrGroup = path.toString() === [0].toString() && getNumberOfSiblings(path, query) === 1;
16
- return /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => handleDelete(), className, children: !isLastRuleOrGroup && /* @__PURE__ */ jsx(DeleteIcon, {}) });
16
+ return /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => handleDelete(), className, title, children: !isLastRuleOrGroup && /* @__PURE__ */ jsx(DeleteIcon, {}) });
17
17
  }
18
18
  export {
19
19
  RemoveButton
@@ -6,15 +6,9 @@ import { useValid } from "./hooks/useValid.js";
6
6
  function TextValueEditor(props) {
7
7
  useConvertValue(props);
8
8
  const valid = useValid(props);
9
- const { value, handleOnChange } = props;
9
+ const { value, handleOnChange, title } = props;
10
10
  if (!Array.isArray(value)) {
11
- return /* @__PURE__ */ jsx(
12
- MaterialValueEditor,
13
- {
14
- ...props,
15
- title: void 0
16
- }
17
- );
11
+ return /* @__PURE__ */ jsx(MaterialValueEditor, { ...props });
18
12
  }
19
13
  return /* @__PURE__ */ jsx(
20
14
  Autocomplete,
@@ -26,7 +20,8 @@ function TextValueEditor(props) {
26
20
  multiple: true,
27
21
  fullWidth: true,
28
22
  renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: !valid }),
29
- size: "small"
23
+ size: "small",
24
+ title
30
25
  }
31
26
  );
32
27
  }
@@ -7,7 +7,7 @@ import { useConvertValue } from "./hooks/useConvertValue.js";
7
7
  import { useValid } from "./hooks/useValid.js";
8
8
  function TranslatedValueEditor(props) {
9
9
  const intl = useIntl();
10
- const { values, value, handleOnChange } = props;
10
+ const { values, value, handleOnChange, title } = props;
11
11
  const translatedValues = useMemo(() => {
12
12
  return values == null ? void 0 : values.map((v) => {
13
13
  return {
@@ -25,20 +25,14 @@ function TranslatedValueEditor(props) {
25
25
  useConvertValue(props);
26
26
  const valid = useValid(props);
27
27
  if (!Array.isArray(value)) {
28
- return /* @__PURE__ */ jsx(
29
- MaterialValueEditor,
30
- {
31
- ...props,
32
- values: translatedValues,
33
- title: void 0
34
- }
35
- );
28
+ return /* @__PURE__ */ jsx(MaterialValueEditor, { ...props, values: translatedValues });
36
29
  }
37
30
  return /* @__PURE__ */ jsx(
38
31
  Autocomplete,
39
32
  {
40
33
  value,
41
34
  options: Object.keys(translatedValuesAutocomplete),
35
+ title,
42
36
  getOptionLabel: (code) => translatedValuesAutocomplete[code],
43
37
  onChange: (event, newValue) => handleOnChange(newValue),
44
38
  multiple: true,
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useCallback } from "react";
2
+ import { useCallback, createElement } from "react";
3
3
  import { MaterialValueEditor } from "@react-querybuilder/material";
4
4
  import Box from "@mui/material/Box";
5
5
  import { useFormContext } from "react-hook-form";
@@ -47,7 +47,7 @@ function ValueEditor(props) {
47
47
  return null;
48
48
  }
49
49
  if ([FieldType.COUNTRY, FieldType.COUNTRY_1, FieldType.COUNTRY_2].includes(field)) {
50
- return /* @__PURE__ */ jsx(CountryValueEditor, { ...props });
50
+ return /* @__PURE__ */ createElement(CountryValueEditor, { ...props, key: field });
51
51
  }
52
52
  if (fieldData.dataType === DataType.ENUM) {
53
53
  return /* @__PURE__ */ jsx(TranslatedValueEditor, { ...props });
@@ -92,13 +92,7 @@ function ValueEditor(props) {
92
92
  if (fieldData.dataType === DataType.COMBINATOR) {
93
93
  return /* @__PURE__ */ jsx(GroupValueEditor, { ...props });
94
94
  }
95
- return /* @__PURE__ */ jsx(Box, { sx: inputType === "number" ? styles.noArrows : void 0, children: /* @__PURE__ */ jsx(
96
- MaterialValueEditor,
97
- {
98
- ...props,
99
- title: void 0
100
- }
101
- ) });
95
+ return /* @__PURE__ */ jsx(Box, { sx: inputType === "number" ? styles.noArrows : void 0, children: /* @__PURE__ */ jsx(MaterialValueEditor, { ...props }) });
102
96
  }
103
97
  export {
104
98
  ValueEditor
@@ -1,13 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { MaterialValueSelector } from "@react-querybuilder/material";
3
3
  function ValueSelector(props) {
4
- return /* @__PURE__ */ jsx(
5
- MaterialValueSelector,
6
- {
7
- ...props,
8
- title: void 0
9
- }
10
- );
4
+ return /* @__PURE__ */ jsx(MaterialValueSelector, { ...props });
11
5
  }
12
6
  export {
13
7
  ValueSelector
@@ -183,6 +183,13 @@ function TopBar({
183
183
  setAboutDialogOpen(true);
184
184
  }
185
185
  };
186
+ const isHiddenUserInformation = () => {
187
+ if (appsAndUrls) {
188
+ const app = appsAndUrls.find((item) => item.name === appName);
189
+ return (app == null ? void 0 : app.hiddenUserInformation) ?? false;
190
+ }
191
+ return false;
192
+ };
186
193
  const onUserInformationDialogClicked = () => {
187
194
  setAnchorElSettingsMenu(null);
188
195
  openUserInformationDialog();
@@ -438,7 +445,7 @@ function TopBar({
438
445
  }
439
446
  ) }) })
440
447
  ] }),
441
- /* @__PURE__ */ jsxs(
448
+ !isHiddenUserInformation() && /* @__PURE__ */ jsxs(
442
449
  StyledMenuItem,
443
450
  {
444
451
  sx: styles.borderBottom,
@@ -487,7 +494,7 @@ function TopBar({
487
494
  /* @__PURE__ */ jsx(
488
495
  AboutDialog,
489
496
  {
490
- open: isAboutDialogOpen,
497
+ open: isAboutDialogOpen && !!user,
491
498
  onClose: () => setAboutDialogOpen(false),
492
499
  appName,
493
500
  appVersion,
@@ -22,15 +22,12 @@ function UserInformationDialog({ openDialog, user, onClose }) {
22
22
  });
23
23
  };
24
24
  useEffect(() => {
25
- if (!user || user.expired) {
26
- onClose();
27
- }
28
- if (user == null ? void 0 : user.profile.sub) {
25
+ if (openDialog && (user == null ? void 0 : user.profile.sub)) {
29
26
  getUserDetails(user == null ? void 0 : user.profile.sub);
30
27
  }
31
- }, [user, onClose]);
32
- return /* @__PURE__ */ jsxs(Dialog, { open: openDialog && !!userDetails, onClose, children: [
33
- /* @__PURE__ */ jsx(DialogTitle, { sx: styles.DialogTitle, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/title" }) }),
28
+ }, [openDialog, user]);
29
+ return /* @__PURE__ */ jsxs(Dialog, { open: openDialog && !!user && !!userDetails, onClose, children: [
30
+ /* @__PURE__ */ jsx(DialogTitle, { fontWeight: "bold", sx: styles.DialogTitle, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/title" }) }),
34
31
  /* @__PURE__ */ jsxs(DialogContent, { children: [
35
32
  /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, sx: styles.DialogContent, children: [
36
33
  /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/role" }) }) }),
@@ -40,7 +37,7 @@ function UserInformationDialog({ openDialog, user, onClose }) {
40
37
  id: (userDetails == null ? void 0 : userDetails.isAdmin) ? "user-information-dialog/role-admin" : "user-information-dialog/role-user"
41
38
  }
42
39
  ) }) }),
43
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/profil" }) }) }),
40
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/profile" }) }) }),
44
41
  /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: (userDetails == null ? void 0 : userDetails.profileName) === null ? /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/no-profile" }) : /* @__PURE__ */ jsx(Typography, { children: userDetails == null ? void 0 : userDetails.profileName }) })
45
42
  ] }),
46
43
  /* @__PURE__ */ jsxs(Box, { mt: 3, sx: styles.quotasBox, children: [
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { CardErrorBoundary } from "./components/cardErrorBoundary/CardErrorBound
14
14
  import { CheckBoxList } from "./components/checkBoxList/CheckBoxList.js";
15
15
  import { CUSTOM_AGGRID_THEME, styles } from "./components/customAGGrid/customAggrid.style.js";
16
16
  import { CustomAGGrid } from "./components/customAGGrid/customAggrid.js";
17
- import { CustomMuiDialog } from "./components/dialogs/customMuiDialog/CustomMuiDialog.js";
17
+ import { CustomMuiDialog, unscrollableDialogStyles } from "./components/dialogs/customMuiDialog/CustomMuiDialog.js";
18
18
  import { DescriptionModificationDialog } from "./components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
19
19
  import { ModifyElementSelection } from "./components/dialogs/modifyElementSelection/ModifyElementSelection.js";
20
20
  import { PopupConfirmationDialog } from "./components/dialogs/popupConfirmationDialog/PopupConfirmationDialog.js";
@@ -125,7 +125,7 @@ import { equalsArray } from "./utils/algos.js";
125
125
  import { DARK_THEME, LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM, LIGHT_THEME } from "./utils/constants/browserConstants.js";
126
126
  import { FetchStatus } from "./utils/constants/fetchStatus.js";
127
127
  import { FieldConstants } from "./utils/constants/fieldConstants.js";
128
- import { GRIDSUITE_DEFAULT_PRECISION, isBlankOrEmpty, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToMicroUnit } from "./utils/conversionUtils.js";
128
+ import { GRIDSUITE_DEFAULT_PRECISION, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToKiloUnit, unitToMicroUnit } from "./utils/conversionUtils.js";
129
129
  import { areArrayElementsUnique, isObjectEmpty, keyGenerator } from "./utils/functions.js";
130
130
  import { getFileIcon } from "./utils/mapper/getFileIcon.js";
131
131
  import { equipmentTypesForPredefinedPropertiesMapper } from "./utils/mapper/equipmentTypesForPredefinedPropertiesMapper.js";
@@ -426,6 +426,7 @@ export {
426
426
  isIntegerNumber,
427
427
  isObjectEmpty,
428
428
  keyGenerator,
429
+ kiloUnitToUnit,
429
430
  login,
430
431
  loginEn,
431
432
  loginFr,
@@ -466,7 +467,9 @@ export {
466
467
  topBarFr,
467
468
  treeviewFinderEn,
468
469
  treeviewFinderFr,
470
+ unitToKiloUnit,
469
471
  unitToMicroUnit,
472
+ unscrollableDialogStyles,
470
473
  useConfidentialityWarning,
471
474
  useConvertValue,
472
475
  useCustomFormContext,
@@ -186,4 +186,6 @@ export declare const filterExpertEn: {
186
186
  YupNotTypeNumber: string;
187
187
  YupNotTypeDefault: string;
188
188
  changeOperatorMessage: string;
189
+ lowShortCircuitCurrentLimit: string;
190
+ highShortCircuitCurrentLimit: string;
189
191
  };
@@ -179,7 +179,9 @@ const filterExpertEn = {
179
179
  lessOrEqual: "<=",
180
180
  YupNotTypeNumber: "This field only accepts numeric values",
181
181
  YupNotTypeDefault: "Field value format is incorrect",
182
- changeOperatorMessage: "The operator will be changed and will be applied to all the rules already created in the group."
182
+ changeOperatorMessage: "The operator will be changed and will be applied to all the rules already created in the group.",
183
+ lowShortCircuitCurrentLimit: "Low short-circuit current limit (kA)",
184
+ highShortCircuitCurrentLimit: "High short-circuit current limit (kA)"
183
185
  };
184
186
  export {
185
187
  filterExpertEn
@@ -31,7 +31,7 @@ export declare const topBarEn: {
31
31
  'user-information-dialog/role': string;
32
32
  'user-information-dialog/role-user': string;
33
33
  'user-information-dialog/role-admin': string;
34
- 'user-information-dialog/profil': string;
34
+ 'user-information-dialog/profile': string;
35
35
  'user-information-dialog/no-profile': string;
36
36
  'user-information-dialog/quotas': string;
37
37
  'user-information-dialog/number-of-cases-or-studies': string;
@@ -25,7 +25,7 @@ const topBarEn = {
25
25
  "user-information-dialog/role": "Role",
26
26
  "user-information-dialog/role-user": "Basic user",
27
27
  "user-information-dialog/role-admin": "Admin",
28
- "user-information-dialog/profil": "Profil",
28
+ "user-information-dialog/profile": "Profile",
29
29
  "user-information-dialog/no-profile": "No profile",
30
30
  "user-information-dialog/quotas": "User quotas",
31
31
  "user-information-dialog/number-of-cases-or-studies": "Number of cases or studies",
@@ -186,4 +186,6 @@ export declare const filterExpertFr: {
186
186
  YupNotTypeNumber: string;
187
187
  YupNotTypeDefault: string;
188
188
  changeOperatorMessage: string;
189
+ lowShortCircuitCurrentLimit: string;
190
+ highShortCircuitCurrentLimit: string;
189
191
  };
@@ -179,7 +179,9 @@ const filterExpertFr = {
179
179
  lessOrEqual: "<=",
180
180
  YupNotTypeNumber: "Ce champ n'accepte que des valeurs numériques",
181
181
  YupNotTypeDefault: "La valeur du champ n'est pas au bon format",
182
- changeOperatorMessage: "L'opérateur sera modifié et s'appliquera sur toutes les règles déjà créées dans le groupe."
182
+ changeOperatorMessage: "L'opérateur sera modifié et s'appliquera sur toutes les règles déjà créées dans le groupe.",
183
+ lowShortCircuitCurrentLimit: "Limite ICC min (kA)",
184
+ highShortCircuitCurrentLimit: "Limite ICC max (kA)"
183
185
  };
184
186
  export {
185
187
  filterExpertFr
@@ -31,7 +31,7 @@ export declare const topBarFr: {
31
31
  'user-information-dialog/role': string;
32
32
  'user-information-dialog/role-user': string;
33
33
  'user-information-dialog/role-admin': string;
34
- 'user-information-dialog/profil': string;
34
+ 'user-information-dialog/profile': string;
35
35
  'user-information-dialog/no-profile': string;
36
36
  'user-information-dialog/quotas': string;
37
37
  'user-information-dialog/number-of-cases-or-studies': string;
@@ -25,8 +25,8 @@ const topBarFr = {
25
25
  "user-information-dialog/role": "Rôle",
26
26
  "user-information-dialog/role-user": "Utilisateur simple",
27
27
  "user-information-dialog/role-admin": "Admin",
28
- "user-information-dialog/profil": "Profile",
29
- "user-information-dialog/no-profile": "Pas de profile",
28
+ "user-information-dialog/profile": "Profil",
29
+ "user-information-dialog/no-profile": "Pas de profil",
30
30
  "user-information-dialog/quotas": "Quotas",
31
31
  "user-information-dialog/number-of-cases-or-studies": "Nombre situations ou études",
32
32
  "user-information-dialog/used": "Utilisé",
@@ -10,3 +10,5 @@ export declare const roundToDefaultPrecision: (num: number) => number;
10
10
  export declare function isBlankOrEmpty(value: unknown): boolean;
11
11
  export declare const unitToMicroUnit: (num: number) => number | undefined;
12
12
  export declare const microUnitToUnit: (num: number) => number | undefined;
13
+ export declare const unitToKiloUnit: (num: number) => number | undefined;
14
+ export declare const kiloUnitToUnit: (num: number) => number | undefined;
@@ -12,11 +12,15 @@ function isBlankOrEmpty(value) {
12
12
  }
13
13
  const unitToMicroUnit = (num) => isBlankOrEmpty(num) ? void 0 : roundToDefaultPrecision(num * 1e6);
14
14
  const microUnitToUnit = (num) => isBlankOrEmpty(num) ? void 0 : roundToDefaultPrecision(num / 1e6);
15
+ const unitToKiloUnit = (num) => isBlankOrEmpty(num) ? void 0 : roundToDefaultPrecision(num / 1e3);
16
+ const kiloUnitToUnit = (num) => isBlankOrEmpty(num) ? void 0 : roundToDefaultPrecision(num * 1e3);
15
17
  export {
16
18
  GRIDSUITE_DEFAULT_PRECISION,
17
19
  isBlankOrEmpty,
20
+ kiloUnitToUnit,
18
21
  microUnitToUnit,
19
22
  roundToDefaultPrecision,
20
23
  roundToPrecision,
24
+ unitToKiloUnit,
21
25
  unitToMicroUnit
22
26
  };