@gridsuite/commons-ui 0.68.1 → 0.68.3

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 (49) 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 +2 -3
  24. package/dist/components/filter/utils/filterFormUtils.js +20 -0
  25. package/dist/components/index.js +2 -1
  26. package/dist/components/inputs/reactHookForm/agGridTable/BottomRightButtons.js +2 -2
  27. package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +4 -5
  28. package/dist/components/inputs/reactQueryBuilder/AddButton.js +2 -2
  29. package/dist/components/inputs/reactQueryBuilder/CombinatorSelector.js +0 -1
  30. package/dist/components/inputs/reactQueryBuilder/CountryValueEditor.js +2 -1
  31. package/dist/components/inputs/reactQueryBuilder/CustomReactQueryBuilder.js +20 -6
  32. package/dist/components/inputs/reactQueryBuilder/FieldSelector.d.ts +1 -1
  33. package/dist/components/inputs/reactQueryBuilder/FieldSelector.js +9 -1
  34. package/dist/components/inputs/reactQueryBuilder/PropertyValueEditor.js +2 -0
  35. package/dist/components/inputs/reactQueryBuilder/RemoveButton.js +2 -2
  36. package/dist/components/inputs/reactQueryBuilder/TextValueEditor.js +4 -9
  37. package/dist/components/inputs/reactQueryBuilder/TranslatedValueEditor.js +3 -9
  38. package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +3 -9
  39. package/dist/components/inputs/reactQueryBuilder/ValueSelector.js +1 -7
  40. package/dist/index.js +5 -2
  41. package/dist/services/explore.js +25 -19
  42. package/dist/translations/en/filterExpertEn.d.ts +2 -0
  43. package/dist/translations/en/filterExpertEn.js +3 -1
  44. package/dist/translations/fr/filterExpertFr.d.ts +2 -0
  45. package/dist/translations/fr/filterExpertFr.js +3 -1
  46. package/dist/utils/conversionUtils.d.ts +2 -0
  47. package/dist/utils/conversionUtils.js +4 -0
  48. package/dist/utils/index.js +3 -1
  49. 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
  );