@gridsuite/commons-ui 0.68.3 → 0.68.4

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.
@@ -32,7 +32,6 @@ export interface CustomMuiDialogProps {
32
32
  export declare const unscrollableDialogStyles: {
33
33
  fullHeightDialog: {
34
34
  '.MuiDialog-paper': {
35
- width: string;
36
35
  minWidth: string;
37
36
  margin: string;
38
37
  height: string;
@@ -18,8 +18,7 @@ const styles = {
18
18
  const unscrollableDialogStyles = {
19
19
  fullHeightDialog: {
20
20
  ".MuiDialog-paper": {
21
- width: "auto",
22
- minWidth: "1024px",
21
+ minWidth: "90vw",
23
22
  margin: "auto",
24
23
  height: "95vh"
25
24
  }
@@ -1,6 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { Box } from "@mui/material";
3
- import { useWatch } from "react-hook-form";
3
+ import { useFormContext, useWatch } from "react-hook-form";
4
+ import { useEffect } from "react";
4
5
  import { HeaderFilterForm } from "./HeaderFilterForm.js";
5
6
  import { FieldConstants } from "../../utils/constants/fieldConstants.js";
6
7
  import { CriteriaBasedFilterForm } from "./criteriaBased/CriteriaBasedFilterForm.js";
@@ -9,7 +10,6 @@ import { ExpertFilterForm } from "./expert/ExpertFilterForm.js";
9
10
  import { FilterType } from "./constants/FilterConstants.js";
10
11
  import { unscrollableDialogStyles } from "../dialogs/customMuiDialog/CustomMuiDialog.js";
11
12
  import "../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
12
- import "react";
13
13
  import "react-intl";
14
14
  import "@mui/icons-material";
15
15
  import "../treeViewFinder/TreeViewFinder.js";
@@ -26,7 +26,16 @@ function FilterForm({
26
26
  activeDirectory,
27
27
  elementExists
28
28
  }) {
29
+ const { setValue } = useFormContext();
29
30
  const filterType = useWatch({ name: FieldConstants.FILTER_TYPE });
31
+ const handleFilterTypeChange = (_event, value) => {
32
+ setValue(FieldConstants.FILTER_TYPE, value);
33
+ };
34
+ useEffect(() => {
35
+ if (sourceFilterForExplicitNamingConversion) {
36
+ setValue(FieldConstants.FILTER_TYPE, FilterType.EXPLICIT_NAMING.id);
37
+ }
38
+ }, [sourceFilterForExplicitNamingConversion, setValue]);
30
39
  return /* @__PURE__ */ jsxs(Fragment, { children: [
31
40
  /* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.unscrollableHeader, children: /* @__PURE__ */ jsx(
32
41
  HeaderFilterForm,
@@ -34,7 +43,8 @@ function FilterForm({
34
43
  creation,
35
44
  activeDirectory,
36
45
  elementExists,
37
- sourceFilterForExplicitNamingConversion
46
+ sourceFilterForExplicitNamingConversion,
47
+ handleFilterTypeChange
38
48
  }
39
49
  ) }),
40
50
  filterType === FilterType.CRITERIA_BASED.id && /* @__PURE__ */ jsx(CriteriaBasedFilterForm, {}),
@@ -9,5 +9,6 @@ export interface FilterFormProps {
9
9
  id: UUID;
10
10
  equipmentType: string;
11
11
  };
12
+ handleFilterTypeChange?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
12
13
  }
13
- export declare function HeaderFilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, elementExists, }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
14
+ export declare function HeaderFilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, elementExists, handleFilterTypeChange, }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,4 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { useFormContext } from "react-hook-form";
3
- import { useEffect } from "react";
4
2
  import { Grid } from "@mui/material";
5
3
  import { FieldConstants } from "../../utils/constants/fieldConstants.js";
6
4
  import { FilterType } from "./constants/FilterConstants.js";
@@ -12,17 +10,9 @@ function HeaderFilterForm({
12
10
  sourceFilterForExplicitNamingConversion,
13
11
  creation,
14
12
  activeDirectory,
15
- elementExists
13
+ elementExists,
14
+ handleFilterTypeChange
16
15
  }) {
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
16
  return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
27
17
  /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
28
18
  UniqueNameInput,
@@ -42,7 +32,7 @@ function HeaderFilterForm({
42
32
  {
43
33
  name: FieldConstants.FILTER_TYPE,
44
34
  options: Object.values(FilterType),
45
- formProps: { onChange: handleChange }
35
+ formProps: { onChange: handleFilterTypeChange }
46
36
  }
47
37
  ) })
48
38
  ] })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.68.3",
3
+ "version": "0.68.4",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",