@gridsuite/commons-ui 0.68.1 → 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 (47) 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/index.js +5 -2
  40. package/dist/translations/en/filterExpertEn.d.ts +2 -0
  41. package/dist/translations/en/filterExpertEn.js +3 -1
  42. package/dist/translations/fr/filterExpertFr.d.ts +2 -0
  43. package/dist/translations/fr/filterExpertFr.js +3 -1
  44. package/dist/utils/conversionUtils.d.ts +2 -0
  45. package/dist/utils/conversionUtils.js +4 -0
  46. package/dist/utils/index.js +3 -1
  47. package/package.json +1 -1
@@ -129,11 +129,6 @@
129
129
  border-bottom: 2px solid #ba000d;
130
130
  }
131
131
 
132
- .queryBuilder {
133
- overflow: auto;
134
- max-height: 600px;
135
- }
136
-
137
132
  /* DnD section, copied from original, just 'border-bottom-color: lightgrey' change */
138
133
  [data-inlinecombinators='disabled'] .dndOver.rule,
139
134
  [data-inlinecombinators='disabled'] .dndOver.ruleGroup-header {
@@ -18,5 +18,39 @@ export interface CustomMuiDialogProps {
18
18
  isDataFetching?: boolean;
19
19
  language?: string;
20
20
  confirmationMessageKey?: string;
21
+ unscrollableFullHeight?: boolean;
21
22
  }
22
- export declare function CustomMuiDialog({ open, formSchema, formMethods, onClose, onSave, isDataFetching, onValidationError, titleId, disabledSave, removeOptional, onCancel, children, language, confirmationMessageKey, }: Readonly<CustomMuiDialogProps>): import("react/jsx-runtime").JSX.Element;
23
+ /**
24
+ * all those styles are made to work with each other in order to control the scroll behavior:
25
+ * <fullHeightDialog>
26
+ * <unscrollableContainer>
27
+ * <unscrollableHeader/> => there may be several unscrollableHeader one after another
28
+ * <scrollableContent/>
29
+ * </unscrollableContainer>
30
+ * </fullHeightDialog>
31
+ */
32
+ export declare const unscrollableDialogStyles: {
33
+ fullHeightDialog: {
34
+ '.MuiDialog-paper': {
35
+ width: string;
36
+ minWidth: string;
37
+ margin: string;
38
+ height: string;
39
+ };
40
+ };
41
+ unscrollableContainer: {
42
+ display: string;
43
+ flexDirection: string;
44
+ overflowY: string;
45
+ };
46
+ unscrollableHeader: {
47
+ flex: string;
48
+ padding: number;
49
+ };
50
+ scrollableContent: {
51
+ flex: string;
52
+ overflowY: string;
53
+ padding: number;
54
+ };
55
+ };
56
+ export declare function CustomMuiDialog({ open, formSchema, formMethods, onClose, onSave, isDataFetching, onValidationError, titleId, disabledSave, removeOptional, onCancel, children, language, confirmationMessageKey, unscrollableFullHeight, }: Readonly<CustomMuiDialogProps>): import("react/jsx-runtime").JSX.Element;
@@ -15,6 +15,30 @@ const styles = {
15
15
  }
16
16
  }
17
17
  };
18
+ const unscrollableDialogStyles = {
19
+ fullHeightDialog: {
20
+ ".MuiDialog-paper": {
21
+ width: "auto",
22
+ minWidth: "1024px",
23
+ margin: "auto",
24
+ height: "95vh"
25
+ }
26
+ },
27
+ unscrollableContainer: {
28
+ display: "flex",
29
+ flexDirection: "column",
30
+ overflowY: "hidden"
31
+ },
32
+ unscrollableHeader: {
33
+ flex: "none",
34
+ padding: 1
35
+ },
36
+ scrollableContent: {
37
+ flex: "auto",
38
+ overflowY: "auto",
39
+ padding: 1
40
+ }
41
+ };
18
42
  function CustomMuiDialog({
19
43
  open,
20
44
  formSchema,
@@ -29,7 +53,8 @@ function CustomMuiDialog({
29
53
  onCancel,
30
54
  children,
31
55
  language,
32
- confirmationMessageKey
56
+ confirmationMessageKey,
57
+ unscrollableFullHeight = false
33
58
  }) {
34
59
  const [openConfirmationPopup, setOpenConfirmationPopup] = useState(false);
35
60
  const [validatedData, setValidatedData] = useState(void 0);
@@ -80,22 +105,31 @@ function CustomMuiDialog({
80
105
  removeOptional,
81
106
  language,
82
107
  children: [
83
- /* @__PURE__ */ jsxs(Dialog, { sx: styles.dialogPaper, open, onClose: handleClose, fullWidth: true, children: [
84
- isDataFetching && /* @__PURE__ */ jsx(LinearProgress, {}),
85
- /* @__PURE__ */ jsx(DialogTitle, { children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 11, children: /* @__PURE__ */ jsx(FormattedMessage, { id: titleId }) }) }),
86
- /* @__PURE__ */ jsx(DialogContent, { children }),
87
- /* @__PURE__ */ jsxs(DialogActions, { children: [
88
- /* @__PURE__ */ jsx(CancelButton, { onClick: handleCancel }),
89
- /* @__PURE__ */ jsx(
90
- SubmitButton,
91
- {
92
- variant: "outlined",
93
- disabled: disabledSave,
94
- onClick: handleSubmit(handleValidate, handleValidationError)
95
- }
96
- )
97
- ] })
98
- ] }),
108
+ /* @__PURE__ */ jsxs(
109
+ Dialog,
110
+ {
111
+ sx: unscrollableFullHeight ? unscrollableDialogStyles.fullHeightDialog : styles.dialogPaper,
112
+ open,
113
+ onClose: handleClose,
114
+ fullWidth: true,
115
+ children: [
116
+ isDataFetching && /* @__PURE__ */ jsx(LinearProgress, {}),
117
+ /* @__PURE__ */ jsx(DialogTitle, { children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 11, children: /* @__PURE__ */ jsx(FormattedMessage, { id: titleId }) }) }),
118
+ /* @__PURE__ */ jsx(DialogContent, { sx: unscrollableFullHeight ? unscrollableDialogStyles.unscrollableContainer : null, children }),
119
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
120
+ /* @__PURE__ */ jsx(CancelButton, { onClick: handleCancel }),
121
+ /* @__PURE__ */ jsx(
122
+ SubmitButton,
123
+ {
124
+ variant: "outlined",
125
+ disabled: disabledSave,
126
+ onClick: handleSubmit(handleValidate, handleValidationError)
127
+ }
128
+ )
129
+ ] })
130
+ ]
131
+ }
132
+ ),
99
133
  confirmationMessageKey && /* @__PURE__ */ jsx(
100
134
  PopupConfirmationDialog,
101
135
  {
@@ -110,5 +144,6 @@ function CustomMuiDialog({
110
144
  );
111
145
  }
112
146
  export {
113
- CustomMuiDialog
147
+ CustomMuiDialog,
148
+ unscrollableDialogStyles
114
149
  };
@@ -1,4 +1,4 @@
1
- import { CustomMuiDialog } from "./customMuiDialog/CustomMuiDialog.js";
1
+ import { CustomMuiDialog, unscrollableDialogStyles } from "./customMuiDialog/CustomMuiDialog.js";
2
2
  import { DescriptionModificationDialog } from "./descriptionModificationDialog/DescriptionModificationDialog.js";
3
3
  import { ModifyElementSelection } from "./modifyElementSelection/ModifyElementSelection.js";
4
4
  import { PopupConfirmationDialog } from "./popupConfirmationDialog/PopupConfirmationDialog.js";
@@ -6,5 +6,6 @@ export {
6
6
  CustomMuiDialog,
7
7
  DescriptionModificationDialog,
8
8
  ModifyElementSelection,
9
- PopupConfirmationDialog
9
+ PopupConfirmationDialog,
10
+ unscrollableDialogStyles
10
11
  };
@@ -106,6 +106,7 @@ function FilterCreationDialog({
106
106
  removeOptional: true,
107
107
  disabledSave: !!nameError || !!isValidating,
108
108
  language,
109
+ unscrollableFullHeight: true,
109
110
  children: /* @__PURE__ */ jsx(
110
111
  FilterForm,
111
112
  {
@@ -1,13 +1,3 @@
1
- import { ElementExistsType } from '../../utils/types/elementType';
2
- import { UUID } from 'crypto';
1
+ import { FilterFormProps } from './HeaderFilterForm';
3
2
 
4
- export interface FilterFormProps {
5
- creation?: boolean;
6
- activeDirectory?: UUID;
7
- elementExists?: ElementExistsType;
8
- sourceFilterForExplicitNamingConversion?: {
9
- id: UUID;
10
- equipmentType: string;
11
- };
12
- }
13
- export declare function FilterForm(props: FilterFormProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, elementExists, }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,51 +1,42 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { useEffect } from "react";
3
- import { useFormContext, useWatch } from "react-hook-form";
4
- import { Grid } from "@mui/material";
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { Box } from "@mui/material";
3
+ import { useWatch } from "react-hook-form";
4
+ import { HeaderFilterForm } from "./HeaderFilterForm.js";
5
5
  import { FieldConstants } from "../../utils/constants/fieldConstants.js";
6
6
  import { CriteriaBasedFilterForm } from "./criteriaBased/CriteriaBasedFilterForm.js";
7
7
  import { ExplicitNamingFilterForm } from "./explicitNaming/ExplicitNamingFilterForm.js";
8
8
  import { ExpertFilterForm } from "./expert/ExpertFilterForm.js";
9
9
  import { FilterType } from "./constants/FilterConstants.js";
10
- import { RadioInput } from "../inputs/reactHookForm/booleans/RadioInput.js";
11
- import { ElementType } from "../../utils/types/elementType.js";
12
- import { UniqueNameInput } from "../inputs/reactHookForm/text/UniqueNameInput.js";
13
- import { DescriptionField } from "../inputs/reactHookForm/text/DescriptionField.js";
14
- function FilterForm(props) {
15
- const { sourceFilterForExplicitNamingConversion, creation, activeDirectory, elementExists } = props;
16
- const { setValue } = useFormContext();
10
+ import { unscrollableDialogStyles } from "../dialogs/customMuiDialog/CustomMuiDialog.js";
11
+ import "../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
12
+ import "react";
13
+ import "react-intl";
14
+ import "@mui/icons-material";
15
+ import "../treeViewFinder/TreeViewFinder.js";
16
+ import "notistack";
17
+ import "@mui/material/Dialog";
18
+ import "@mui/material/DialogTitle";
19
+ import "@mui/material/DialogContent";
20
+ import "@mui/material/DialogActions";
21
+ import "@mui/material/Button";
22
+ import "@mui/material/styles";
23
+ function FilterForm({
24
+ sourceFilterForExplicitNamingConversion,
25
+ creation,
26
+ activeDirectory,
27
+ elementExists
28
+ }) {
17
29
  const filterType = useWatch({ name: FieldConstants.FILTER_TYPE });
18
- const handleChange = (_event, value) => {
19
- setValue(FieldConstants.FILTER_TYPE, value);
20
- };
21
- useEffect(() => {
22
- if (sourceFilterForExplicitNamingConversion) {
23
- setValue(FieldConstants.FILTER_TYPE, FilterType.EXPLICIT_NAMING.id);
24
- }
25
- }, [sourceFilterForExplicitNamingConversion, setValue]);
26
- return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
27
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
28
- UniqueNameInput,
30
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
31
+ /* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.unscrollableHeader, children: /* @__PURE__ */ jsx(
32
+ HeaderFilterForm,
29
33
  {
30
- name: FieldConstants.NAME,
31
- label: "nameProperty",
32
- elementType: ElementType.FILTER,
33
- autoFocus: creation,
34
+ creation,
34
35
  activeDirectory,
35
- elementExists
36
+ elementExists,
37
+ sourceFilterForExplicitNamingConversion
36
38
  }
37
39
  ) }),
38
- creation && /* @__PURE__ */ jsxs(Fragment, { children: [
39
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(DescriptionField, {}) }),
40
- !sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
41
- RadioInput,
42
- {
43
- name: FieldConstants.FILTER_TYPE,
44
- options: Object.values(FilterType),
45
- formProps: { onChange: handleChange }
46
- }
47
- ) })
48
- ] }),
49
40
  filterType === FilterType.CRITERIA_BASED.id && /* @__PURE__ */ jsx(CriteriaBasedFilterForm, {}),
50
41
  filterType === FilterType.EXPLICIT_NAMING.id && /* @__PURE__ */ jsx(
51
42
  ExplicitNamingFilterForm,
@@ -0,0 +1,13 @@
1
+ import { ElementExistsType } from '../../utils/types/elementType';
2
+ import { UUID } from 'crypto';
3
+
4
+ export interface FilterFormProps {
5
+ creation?: boolean;
6
+ activeDirectory?: UUID;
7
+ elementExists?: ElementExistsType;
8
+ sourceFilterForExplicitNamingConversion?: {
9
+ id: UUID;
10
+ equipmentType: string;
11
+ };
12
+ }
13
+ export declare function HeaderFilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, elementExists, }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { useFormContext } from "react-hook-form";
3
+ import { useEffect } from "react";
4
+ import { Grid } from "@mui/material";
5
+ import { FieldConstants } from "../../utils/constants/fieldConstants.js";
6
+ import { FilterType } from "./constants/FilterConstants.js";
7
+ import { UniqueNameInput } from "../inputs/reactHookForm/text/UniqueNameInput.js";
8
+ import { ElementType } from "../../utils/types/elementType.js";
9
+ import { DescriptionField } from "../inputs/reactHookForm/text/DescriptionField.js";
10
+ import { RadioInput } from "../inputs/reactHookForm/booleans/RadioInput.js";
11
+ function HeaderFilterForm({
12
+ sourceFilterForExplicitNamingConversion,
13
+ creation,
14
+ activeDirectory,
15
+ elementExists
16
+ }) {
17
+ const { setValue } = useFormContext();
18
+ useEffect(() => {
19
+ if (sourceFilterForExplicitNamingConversion) {
20
+ setValue(FieldConstants.FILTER_TYPE, FilterType.EXPLICIT_NAMING.id);
21
+ }
22
+ }, [sourceFilterForExplicitNamingConversion, setValue]);
23
+ const handleChange = (_event, value) => {
24
+ setValue(FieldConstants.FILTER_TYPE, value);
25
+ };
26
+ return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
27
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
28
+ UniqueNameInput,
29
+ {
30
+ name: FieldConstants.NAME,
31
+ label: "nameProperty",
32
+ elementType: ElementType.FILTER,
33
+ autoFocus: creation,
34
+ activeDirectory,
35
+ elementExists
36
+ }
37
+ ) }),
38
+ creation && /* @__PURE__ */ jsxs(Fragment, { children: [
39
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(DescriptionField, {}) }),
40
+ !sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
41
+ RadioInput,
42
+ {
43
+ name: FieldConstants.FILTER_TYPE,
44
+ options: Object.values(FilterType),
45
+ formProps: { onChange: handleChange }
46
+ }
47
+ ) })
48
+ ] })
49
+ ] });
50
+ }
51
+ export {
52
+ HeaderFilterForm
53
+ };
@@ -95,6 +95,7 @@ function CriteriaBasedFilterEditionDialog({
95
95
  disabledSave: !!nameError || !!isValidating,
96
96
  isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
97
97
  language,
98
+ unscrollableFullHeight: true,
98
99
  children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory, elementExists })
99
100
  }
100
101
  );
@@ -1,5 +1,4 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import Grid from "@mui/material/Grid";
1
+ import { jsx } from "react/jsx-runtime";
3
2
  import { filterPropertiesYupSchema, FilterProperties } from "./FilterProperties.js";
4
3
  import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
5
4
  import "../../../utils/yupConfig.js";
@@ -18,16 +17,14 @@ const criteriaBasedFilterEmptyFormData = getCriteriaBasedFormData(null, {
18
17
  [FreePropertiesTypes.FREE_FILTER_PROPERTIES]: []
19
18
  });
20
19
  function CriteriaBasedFilterForm() {
21
- return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 1, children: [
22
- /* @__PURE__ */ jsx(
23
- CriteriaBasedForm,
24
- {
25
- equipments: FILTER_EQUIPMENTS,
26
- defaultValues: criteriaBasedFilterEmptyFormData[FieldConstants.CRITERIA_BASED]
27
- }
28
- ),
29
- /* @__PURE__ */ jsx(FilterProperties, {})
30
- ] });
20
+ return /* @__PURE__ */ jsx(
21
+ CriteriaBasedForm,
22
+ {
23
+ equipments: FILTER_EQUIPMENTS,
24
+ defaultValues: criteriaBasedFilterEmptyFormData[FieldConstants.CRITERIA_BASED],
25
+ children: /* @__PURE__ */ jsx(FilterProperties, {})
26
+ }
27
+ );
31
28
  }
32
29
  export {
33
30
  CriteriaBasedFilterForm,
@@ -1,7 +1,9 @@
1
1
  import { FormEquipment } from '../utils/filterFormUtils';
2
+ import { ReactElement } from 'react';
2
3
 
3
4
  export interface CriteriaBasedFormProps {
4
5
  equipments: Record<string, FormEquipment>;
5
6
  defaultValues: Record<string, any>;
7
+ children?: ReactElement;
6
8
  }
7
- export declare function CriteriaBasedForm({ equipments, defaultValues }: CriteriaBasedFormProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function CriteriaBasedForm({ equipments, defaultValues, children }: Readonly<CriteriaBasedFormProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,23 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useFormContext, useWatch } from "react-hook-form";
3
- import { Grid } from "@mui/material";
3
+ import { Box, Grid } from "@mui/material";
4
4
  import { useEffect } from "react";
5
5
  import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
6
6
  import { SelectInput } from "../../inputs/reactHookForm/selectInputs/SelectInput.js";
7
7
  import { InputWithPopupConfirmation } from "../../inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js";
8
8
  import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
9
- function CriteriaBasedForm({ equipments, defaultValues }) {
9
+ import { unscrollableDialogStyles } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
10
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
11
+ import "react-intl";
12
+ import "@mui/icons-material";
13
+ import "../../treeViewFinder/TreeViewFinder.js";
14
+ import "@mui/material/Dialog";
15
+ import "@mui/material/DialogTitle";
16
+ import "@mui/material/DialogContent";
17
+ import "@mui/material/DialogActions";
18
+ import "@mui/material/Button";
19
+ import "@mui/material/styles";
20
+ function CriteriaBasedForm({ equipments, defaultValues, children }) {
10
21
  const { getValues, setValue } = useFormContext();
11
22
  const { snackError } = useSnackMessage();
12
23
  const watchEquipmentType = useWatch({
@@ -27,8 +38,8 @@ function CriteriaBasedForm({ equipments, defaultValues }) {
27
38
  (field) => setValue(`${FieldConstants.CRITERIA_BASED}.${field}`, defaultValues[field])
28
39
  );
29
40
  };
30
- return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 2, children: [
31
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
41
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
42
+ /* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.unscrollableHeader, children: /* @__PURE__ */ jsx(
32
43
  InputWithPopupConfirmation,
33
44
  {
34
45
  Input: SelectInput,
@@ -41,11 +52,14 @@ function CriteriaBasedForm({ equipments, defaultValues }) {
41
52
  validateButtonLabel: "button.changeType"
42
53
  }
43
54
  ) }),
44
- watchEquipmentType && equipments[watchEquipmentType] && equipments[watchEquipmentType].fields.map((equipment, index) => {
45
- const EquipmentForm = equipment.renderer;
46
- const uniqueKey = `${watchEquipmentType}-${index}`;
47
- return /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, flexGrow: 1, children: /* @__PURE__ */ jsx(EquipmentForm, { ...equipment.props }) }, uniqueKey);
48
- })
55
+ /* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.scrollableContent, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
56
+ watchEquipmentType && equipments[watchEquipmentType] && equipments[watchEquipmentType].fields.map((equipment, index) => {
57
+ const EquipmentForm = equipment.renderer;
58
+ const uniqueKey = `${watchEquipmentType}-${index}`;
59
+ return /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, flexGrow: 1, children: /* @__PURE__ */ jsx(EquipmentForm, { ...equipment.props }) }, uniqueKey);
60
+ }),
61
+ children
62
+ ] }) })
49
63
  ] });
50
64
  }
51
65
  export {
@@ -106,6 +106,7 @@ function ExpertFilterEditionDialog({
106
106
  disabledSave: !!nameError || !!isValidating,
107
107
  isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
108
108
  language,
109
+ unscrollableFullHeight: true,
109
110
  children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory, elementExists })
110
111
  }
111
112
  );
@@ -1,12 +1,12 @@
1
1
  import '../../../assets/ExpertFilterForm.css';
2
- import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
3
  import { useCallback, useMemo } from "react";
4
- import Grid from "@mui/material/Grid";
5
4
  import { formatQuery } from "react-querybuilder";
6
5
  import { useFormContext, useWatch } from "react-hook-form";
7
6
  import * as yup from "yup";
8
7
  import { v4 } from "uuid";
9
8
  import { useIntl } from "react-intl";
9
+ import { Box } from "@mui/material";
10
10
  import { testQuery } from "./expertFilterUtils.js";
11
11
  import { COMBINATOR_OPTIONS, OPERATOR_OPTIONS, EXPERT_FILTER_EQUIPMENTS, RULES, EXPERT_FILTER_FIELDS } from "./expertFilterConstants.js";
12
12
  import { FieldType } from "./expertFilter.type.js";
@@ -15,6 +15,17 @@ import { InputWithPopupConfirmation } from "../../inputs/reactHookForm/selectInp
15
15
  import { SelectInput } from "../../inputs/reactHookForm/selectInputs/SelectInput.js";
16
16
  import { FilterType } from "../constants/FilterConstants.js";
17
17
  import { CustomReactQueryBuilder } from "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
18
+ import { unscrollableDialogStyles } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
19
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
20
+ import "@mui/icons-material";
21
+ import "../../treeViewFinder/TreeViewFinder.js";
22
+ import "notistack";
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";
18
29
  yup.setLocale({
19
30
  mixed: {
20
31
  required: "YupRequired",
@@ -85,8 +96,8 @@ function ExpertFilterForm() {
85
96
  };
86
97
  });
87
98
  }, [intl, watchEquipmentType]);
88
- return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 2, children: [
89
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
99
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
100
+ /* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.unscrollableHeader, children: /* @__PURE__ */ jsx(
90
101
  InputWithPopupConfirmation,
91
102
  {
92
103
  Input: SelectInput,
@@ -99,7 +110,7 @@ function ExpertFilterForm() {
99
110
  validateButtonLabel: "button.changeType"
100
111
  }
101
112
  ) }),
102
- watchEquipmentType && isSupportedEquipmentType(watchEquipmentType) && /* @__PURE__ */ jsx(CustomReactQueryBuilder, { name: EXPERT_FILTER_QUERY, fields: translatedFields })
113
+ /* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.scrollableContent, children: watchEquipmentType && isSupportedEquipmentType(watchEquipmentType) && /* @__PURE__ */ jsx(CustomReactQueryBuilder, { name: EXPERT_FILTER_QUERY, fields: translatedFields }) })
103
114
  ] });
104
115
  }
105
116
  export {
@@ -156,7 +156,9 @@ export declare enum FieldType {
156
156
  CONVERTER_STATION_NOMINAL_VOLTAGE_2 = "CONVERTER_STATION_NOMINAL_VOLTAGE_2",
157
157
  DC_NOMINAL_VOLTAGE = "DC_NOMINAL_VOLTAGE",
158
158
  PAIRING_KEY = "PAIRING_KEY",
159
- TIE_LINE_ID = "TIE_LINE_ID"
159
+ TIE_LINE_ID = "TIE_LINE_ID",
160
+ LOW_SHORT_CIRCUIT_CURRENT_LIMIT = "LOW_SHORT_CIRCUIT_CURRENT_LIMIT",
161
+ HIGH_SHORT_CIRCUIT_CURRENT_LIMIT = "HIGH_SHORT_CIRCUIT_CURRENT_LIMIT"
160
162
  }
161
163
  export declare enum DataType {
162
164
  STRING = "STRING",
@@ -156,6 +156,8 @@ var FieldType = /* @__PURE__ */ ((FieldType2) => {
156
156
  FieldType2["DC_NOMINAL_VOLTAGE"] = "DC_NOMINAL_VOLTAGE";
157
157
  FieldType2["PAIRING_KEY"] = "PAIRING_KEY";
158
158
  FieldType2["TIE_LINE_ID"] = "TIE_LINE_ID";
159
+ FieldType2["LOW_SHORT_CIRCUIT_CURRENT_LIMIT"] = "LOW_SHORT_CIRCUIT_CURRENT_LIMIT";
160
+ FieldType2["HIGH_SHORT_CIRCUIT_CURRENT_LIMIT"] = "HIGH_SHORT_CIRCUIT_CURRENT_LIMIT";
159
161
  return FieldType2;
160
162
  })(FieldType || {});
161
163
  var DataType = /* @__PURE__ */ ((DataType2) => {
@@ -1076,5 +1076,17 @@ export declare const FIELDS_OPTIONS: {
1076
1076
  label: string;
1077
1077
  dataType: DataType;
1078
1078
  };
1079
+ LOW_SHORT_CIRCUIT_CURRENT_LIMIT: {
1080
+ name: FieldType;
1081
+ label: string;
1082
+ dataType: DataType;
1083
+ inputType: string;
1084
+ };
1085
+ HIGH_SHORT_CIRCUIT_CURRENT_LIMIT: {
1086
+ name: FieldType;
1087
+ label: string;
1088
+ dataType: DataType;
1089
+ inputType: string;
1090
+ };
1079
1091
  };
1080
1092
  export declare const EXPERT_FILTER_FIELDS: Record<string, Field[]>;
@@ -1019,6 +1019,18 @@ const FIELDS_OPTIONS = {
1019
1019
  name: FieldType.TIE_LINE_ID,
1020
1020
  label: "tieLineId",
1021
1021
  dataType: DataType.STRING
1022
+ },
1023
+ LOW_SHORT_CIRCUIT_CURRENT_LIMIT: {
1024
+ name: FieldType.LOW_SHORT_CIRCUIT_CURRENT_LIMIT,
1025
+ label: "lowShortCircuitCurrentLimit",
1026
+ dataType: DataType.NUMBER,
1027
+ inputType: "number"
1028
+ },
1029
+ HIGH_SHORT_CIRCUIT_CURRENT_LIMIT: {
1030
+ name: FieldType.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT,
1031
+ label: "highShortCircuitCurrentLimit",
1032
+ dataType: DataType.NUMBER,
1033
+ inputType: "number"
1022
1034
  }
1023
1035
  };
1024
1036
  const EXPERT_FILTER_FIELDS = {
@@ -1031,7 +1043,9 @@ const EXPERT_FILTER_FIELDS = {
1031
1043
  FIELDS_OPTIONS.LOW_VOLTAGE_LIMIT,
1032
1044
  FIELDS_OPTIONS.HIGH_VOLTAGE_LIMIT,
1033
1045
  FIELDS_OPTIONS.PROPERTY,
1034
- FIELDS_OPTIONS.SUBSTATION_PROPERTY
1046
+ FIELDS_OPTIONS.SUBSTATION_PROPERTY,
1047
+ FIELDS_OPTIONS.LOW_SHORT_CIRCUIT_CURRENT_LIMIT,
1048
+ FIELDS_OPTIONS.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT
1035
1049
  ],
1036
1050
  LINE: [
1037
1051
  FIELDS_OPTIONS.ID,
@@ -2,13 +2,14 @@ import { defaultOperators, getParentPath, findPath, remove } from "react-querybu
2
2
  import { validate } from "uuid";
3
3
  import { FieldType, DataType } from "./expertFilter.type.js";
4
4
  import { FIELDS_OPTIONS, OPERATOR_OPTIONS, RULES } from "./expertFilterConstants.js";
5
- import { isBlankOrEmpty, microUnitToUnit, unitToMicroUnit } from "../../../utils/conversionUtils.js";
5
+ import { isBlankOrEmpty, microUnitToUnit, kiloUnitToUnit, unitToMicroUnit, unitToKiloUnit } from "../../../utils/conversionUtils.js";
6
6
  const microUnits = [
7
7
  FieldType.SHUNT_CONDUCTANCE_1,
8
8
  FieldType.SHUNT_CONDUCTANCE_2,
9
9
  FieldType.SHUNT_SUSCEPTANCE_1,
10
10
  FieldType.SHUNT_SUSCEPTANCE_2
11
11
  ];
12
+ const kiloUnits = [FieldType.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT, FieldType.LOW_SHORT_CIRCUIT_CURRENT_LIMIT];
12
13
  const searchTree = (tree, key, value) => {
13
14
  const stack = Object.values(tree);
14
15
  while (stack.length) {
@@ -131,6 +132,12 @@ function changeValueUnit(value, field) {
131
132
  }
132
133
  return value.map((a) => microUnitToUnit(a));
133
134
  }
135
+ if (kiloUnits.includes(field)) {
136
+ if (!Array.isArray(value)) {
137
+ return kiloUnitToUnit(value);
138
+ }
139
+ return value.map((a) => kiloUnitToUnit(a));
140
+ }
134
141
  return value;
135
142
  }
136
143
  function exportExpertRules(query) {
@@ -202,11 +209,19 @@ function importExpertRules(query) {
202
209
  if (rule.dataType === DataType.NUMBER) {
203
210
  return rule.values.map((value) => parseFloat(value)).map((numberValue) => {
204
211
  return microUnits.includes(rule.field) ? unitToMicroUnit(numberValue) : numberValue;
212
+ }).map((numberValue) => {
213
+ return kiloUnits.includes(rule.field) ? unitToKiloUnit(numberValue) : numberValue;
205
214
  }).sort((a, b) => a - b);
206
215
  }
207
216
  return rule.values.sort();
208
217
  }
209
- return microUnits.includes(rule.field) ? unitToMicroUnit(parseFloat(rule.value)) : rule.value;
218
+ if (microUnits.includes(rule.field)) {
219
+ return unitToMicroUnit(parseFloat(rule.value));
220
+ }
221
+ if (kiloUnits.includes(rule.field)) {
222
+ return unitToKiloUnit(parseFloat(rule.value));
223
+ }
224
+ return rule.value;
210
225
  }
211
226
  function transformRule(rule) {
212
227
  var _a;
@@ -109,6 +109,7 @@ function ExplicitNamingFilterEditionDialog({
109
109
  disabledSave: !!nameError || !!isValidating,
110
110
  isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
111
111
  language,
112
+ unscrollableFullHeight: true,
112
113
  children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory, elementExists })
113
114
  }
114
115
  );
@@ -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
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
@@ -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
@@ -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
  };
@@ -2,7 +2,7 @@ import { equalsArray } from "./algos.js";
2
2
  import { DARK_THEME, LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM, LIGHT_THEME } from "./constants/browserConstants.js";
3
3
  import { FetchStatus } from "./constants/fetchStatus.js";
4
4
  import { FieldConstants } from "./constants/fieldConstants.js";
5
- import { GRIDSUITE_DEFAULT_PRECISION, isBlankOrEmpty, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToMicroUnit } from "./conversionUtils.js";
5
+ import { GRIDSUITE_DEFAULT_PRECISION, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToKiloUnit, unitToMicroUnit } from "./conversionUtils.js";
6
6
  import { areArrayElementsUnique, isObjectEmpty, keyGenerator } from "./functions.js";
7
7
  import { getFileIcon } from "./mapper/getFileIcon.js";
8
8
  import { equipmentTypesForPredefinedPropertiesMapper } from "./mapper/equipmentTypesForPredefinedPropertiesMapper.js";
@@ -50,12 +50,14 @@ export {
50
50
  isBlankOrEmpty,
51
51
  isObjectEmpty,
52
52
  keyGenerator,
53
+ kiloUnitToUnit,
53
54
  makeComposeClasses,
54
55
  mergeSx,
55
56
  microUnitToUnit,
56
57
  roundToDefaultPrecision,
57
58
  roundToPrecision,
58
59
  toNestedGlobalSelectors,
60
+ unitToKiloUnit,
59
61
  unitToMicroUnit,
60
62
  yup as yupConfig
61
63
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.68.1",
3
+ "version": "0.68.2",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",