@gridsuite/commons-ui 0.92.2 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/components/checkBoxList/CheckBoxList.js +1 -1
  2. package/dist/components/checkBoxList/CheckBoxListItems.js +1 -1
  3. package/dist/components/checkBoxList/DraggableClickableCheckBoxItem.js +2 -2
  4. package/dist/components/checkBoxList/DraggableClickableRowItem.js +2 -3
  5. package/dist/components/checkBoxList/checkBoxList.type.d.ts +1 -1
  6. package/dist/components/contingencyList/criteriaBased/CriteriaBasedForm.js +0 -5
  7. package/dist/components/customAGGrid/customAggrid.style.d.ts +26 -5
  8. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +1 -13
  9. package/dist/components/dialogs/popupConfirmationDialog/PopupConfirmationDialog.js +1 -6
  10. package/dist/components/filter/FilterForm.js +0 -5
  11. package/dist/components/filter/HeaderFilterForm.js +0 -12
  12. package/dist/components/filter/expert/ExpertFilterForm.js +0 -5
  13. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +0 -5
  14. package/dist/components/index.js +2 -0
  15. package/dist/components/inputs/ActivableChip.d.ts +14 -0
  16. package/dist/components/inputs/ActivableChip.js +22 -0
  17. package/dist/components/inputs/SelectClearable.d.ts +1 -1
  18. package/dist/components/inputs/index.d.ts +1 -0
  19. package/dist/components/inputs/index.js +2 -0
  20. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +2 -2
  21. package/dist/components/inputs/reactHookForm/agGridTable/BottomRightButtons.js +4 -8
  22. package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js +1 -8
  23. package/dist/components/inputs/reactHookForm/booleans/BooleanInput.d.ts +10 -6
  24. package/dist/components/inputs/reactHookForm/booleans/BooleanInput.js +8 -5
  25. package/dist/components/inputs/reactHookForm/text/DescriptionField.js +3 -5
  26. package/dist/components/inputs/reactHookForm/text/UniqueNameInput.js +3 -6
  27. package/dist/components/inputs/reactQueryBuilder/AddButton.js +2 -2
  28. package/dist/components/inputs/reactQueryBuilder/AutocompleteWithFavorites.d.ts +1 -1
  29. package/dist/components/inputs/reactQueryBuilder/PropertyValueEditor.js +1 -2
  30. package/dist/components/inputs/reactQueryBuilder/RemoveButton.js +3 -3
  31. package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +1 -1
  32. package/dist/components/snackbarProvider/SnackbarProvider.js +2 -2
  33. package/dist/index.js +2 -0
  34. package/dist/module-mui.d.js +1 -1
  35. package/package.json +2 -3
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { Box } from "@mui/material";
4
- import { DragDropContext, Droppable } from "react-beautiful-dnd";
4
+ import { DragDropContext, Droppable } from "@hello-pangea/dnd";
5
5
  import { CheckBoxListItems } from "./CheckBoxListItems.js";
6
6
  function CheckBoxList({
7
7
  isDndDragAndDropActive = false,
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useCallback, useMemo } from "react";
3
3
  import { List, ListItem, ListItemButton, ListItemIcon, Checkbox, ListItemText } from "@mui/material";
4
4
  import { FormattedMessage } from "react-intl";
5
- import { Draggable } from "react-beautiful-dnd";
5
+ import { Draggable } from "@hello-pangea/dnd";
6
6
  import { CheckBoxListItem } from "./CheckBoxListItem.js";
7
7
  import { OverflowableText } from "../overflowableText/OverflowableText.js";
8
8
  import { DraggableCheckBoxListItem } from "./DraggableCheckBoxListItem.js";
@@ -1,5 +1,5 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import DragIndicatorIcon from "@mui/icons-material/DragIndicator";
2
+ import { DragIndicator } from "@mui/icons-material";
3
3
  import { IconButton, ListItemIcon, Checkbox, ListItemText } from "@mui/material";
4
4
  import { OverflowableText } from "../overflowableText/OverflowableText.js";
5
5
  const styles = {
@@ -29,7 +29,7 @@ function DraggableClickableCheckBoxItem({
29
29
  padding: "unset",
30
30
  ...styles.dragIcon
31
31
  },
32
- children: /* @__PURE__ */ jsx(DragIndicatorIcon, { spacing: 0 })
32
+ children: /* @__PURE__ */ jsx(DragIndicator, { spacing: 0 })
33
33
  }
34
34
  ),
35
35
  /* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 0, ...sx == null ? void 0 : sx.checkBoxIcon }, children: /* @__PURE__ */ jsx(Checkbox, { disableRipple: true, sx: { paddingLeft: 0, ...sx == null ? void 0 : sx.checkbox }, ...props }) }),
@@ -1,9 +1,8 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import DragIndicatorIcon from "@mui/icons-material/DragIndicator";
2
+ import { DragIndicator } from "@mui/icons-material";
3
3
  import { ListItemButton, IconButton, ListItemIcon, Checkbox, ListItemText } from "@mui/material";
4
4
  import { OverflowableText } from "../overflowableText/OverflowableText.js";
5
5
  import "../../utils/conversionUtils.js";
6
- import "@mui/icons-material";
7
6
  import { mergeSx } from "../../utils/styles.js";
8
7
  import "../../utils/types/equipmentType.js";
9
8
  import "../../utils/yupConfig.js";
@@ -55,7 +54,7 @@ function DraggableClickableRowItem({
55
54
  padding: "unset",
56
55
  ...styles.dragIcon
57
56
  },
58
- children: /* @__PURE__ */ jsx(DragIndicatorIcon, { spacing: 0 })
57
+ children: /* @__PURE__ */ jsx(DragIndicator, { spacing: 0 })
59
58
  }
60
59
  ),
61
60
  /* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 0, ...sx == null ? void 0 : sx.checkBoxIcon }, children: /* @__PURE__ */ jsx(Checkbox, { disableRipple: true, sx: { paddingLeft: 0, ...sx == null ? void 0 : sx.checkbox }, onClick: onCheckboxClick, ...props }) }),
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
- import { DraggableProvided, DragStart, DropResult } from 'react-beautiful-dnd';
2
+ import { DraggableProvided, DragStart, DropResult } from '@hello-pangea/dnd';
3
3
  import { SxProps, Theme } from '@mui/material';
4
4
  export type CheckBoxListItemSx = {
5
5
  checkBoxIcon?: SxProps<Theme>;
@@ -12,11 +12,6 @@ import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
12
12
  import "react-intl";
13
13
  import "@mui/icons-material";
14
14
  import "../../treeViewFinder/TreeViewFinder.js";
15
- import "@mui/material/Dialog";
16
- import "@mui/material/DialogTitle";
17
- import "@mui/material/DialogContent";
18
- import "@mui/material/DialogActions";
19
- import "@mui/material/Button";
20
15
  function CriteriaBasedForm({ equipments, defaultValues, children }) {
21
16
  const { getValues, setValue } = useFormContext();
22
17
  const { snackError } = useSnackMessage();
@@ -1,11 +1,32 @@
1
1
  import { Theme } from '@mui/material';
2
- import { SystemStyleObject } from '@mui/system';
3
2
  export declare const CUSTOM_AGGRID_THEME = "custom-aggrid-theme";
4
3
  export declare const styles: {
5
- grid: (theme: Theme) => SystemStyleObject<Theme>;
6
- noBorderRight: {
7
- '& .ag-pinned-left-header': {
8
- borderRight: string;
4
+ readonly grid: (theme: Theme) => {
5
+ width: string;
6
+ height: string;
7
+ position: "relative";
8
+ "&.custom-aggrid-theme": {
9
+ '--ag-value-change-value-highlight-background-color': string;
10
+ '--ag-selected-row-background-color': string;
11
+ '--ag-row-hover-color': string;
12
+ };
13
+ '& .ag-checkbox-input': {
14
+ cursor: "pointer";
15
+ scale: "2.5";
16
+ };
17
+ '& .ag-select-list': {
18
+ maxHeight: string;
19
+ };
20
+ '& .ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-left-spacer:not(.ag-scroller-corner)': {
21
+ visibility: "hidden";
22
+ };
23
+ '& .ag-cell-focus, .ag-cell': {
24
+ border: "none !important";
25
+ };
26
+ };
27
+ readonly noBorderRight: {
28
+ readonly '& .ag-pinned-left-header': {
29
+ readonly borderRight: "none";
9
30
  };
10
31
  };
11
32
  };
@@ -5,7 +5,7 @@ import { Grid, Button, Typography, Box, CircularProgress } from "@mui/material";
5
5
  import { useForm } from "react-hook-form";
6
6
  import { yupResolver } from "@hookform/resolvers/yup";
7
7
  import "../../../utils/yupConfig.js";
8
- import "@mui/icons-material/Folder";
8
+ import "@mui/icons-material";
9
9
  import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
10
10
  import * as yup from "yup";
11
11
  import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
@@ -18,16 +18,8 @@ import "ag-grid-community/styles/ag-theme-alpine.css";
18
18
  import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
19
19
  import "../../customAGGrid/customAggrid.js";
20
20
  import "ag-grid-community";
21
- import "@mui/material/Dialog";
22
- import "@mui/material/DialogTitle";
23
- import "@mui/material/DialogContent";
24
- import "@mui/material/DialogActions";
25
21
  import "react-papaparse";
26
- import "@mui/material/Button";
27
- import "@mui/material/Grid";
28
22
  import "react-csv-downloader";
29
- import "@mui/material/Alert";
30
- import "@mui/icons-material";
31
23
  import { RadioInput } from "../../inputs/reactHookForm/booleans/RadioInput.js";
32
24
  import "../../inputs/reactHookForm/numbers/RangeInput.js";
33
25
  import "localized-countries";
@@ -35,17 +27,13 @@ import "localized-countries/data/fr";
35
27
  import "localized-countries/data/en";
36
28
  import { DescriptionField } from "../../inputs/reactHookForm/text/DescriptionField.js";
37
29
  import { UniqueNameInput } from "../../inputs/reactHookForm/text/UniqueNameInput.js";
38
- import "@mui/icons-material/ControlPoint";
39
30
  import "@react-querybuilder/material";
40
31
  import "../../filter/expert/expertFilterConstants.js";
41
32
  import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
42
33
  import "uuid";
43
34
  import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
44
- import "@mui/material/IconButton";
45
- import "@mui/icons-material/Delete";
46
35
  import "react-querybuilder";
47
36
  import "../../../utils/conversionUtils.js";
48
- import "@mui/material/Box";
49
37
  import { ElementType } from "../../../utils/types/elementType.js";
50
38
  import { CustomMuiDialog } from "../customMuiDialog/CustomMuiDialog.js";
51
39
  import { MAX_CHAR_DESCRIPTION } from "../../../utils/constants/uiConstants.js";
@@ -1,10 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import Dialog from "@mui/material/Dialog";
3
- import DialogTitle from "@mui/material/DialogTitle";
4
- import DialogContent from "@mui/material/DialogContent";
5
- import { DialogContentText } from "@mui/material";
6
- import DialogActions from "@mui/material/DialogActions";
7
- import Button from "@mui/material/Button";
2
+ import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button } from "@mui/material";
8
3
  import { FormattedMessage } from "react-intl";
9
4
  import { CancelButton } from "../../inputs/reactHookForm/utils/CancelButton.js";
10
5
  function PopupConfirmationDialog({
@@ -14,11 +14,6 @@ import "react-intl";
14
14
  import "@mui/icons-material";
15
15
  import "../treeViewFinder/TreeViewFinder.js";
16
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
17
  function FilterForm({
23
18
  sourceFilterForExplicitNamingConversion,
24
19
  creation,
@@ -9,7 +9,6 @@ import "../../utils/types/equipmentType.js";
9
9
  import "../../utils/yupConfig.js";
10
10
  import { FilterType } from "./constants/FilterConstants.js";
11
11
  import "react-intl";
12
- import "@mui/icons-material/Folder";
13
12
  import "react";
14
13
  import "react-hook-form";
15
14
  import "../inputs/reactHookForm/provider/CustomFormProvider.js";
@@ -22,15 +21,8 @@ import "ag-grid-community/styles/ag-grid.css";
22
21
  import "ag-grid-community/styles/ag-theme-alpine.css";
23
22
  import "../customAGGrid/customAggrid.js";
24
23
  import "ag-grid-community";
25
- import "@mui/material/Dialog";
26
- import "@mui/material/DialogTitle";
27
- import "@mui/material/DialogContent";
28
- import "@mui/material/DialogActions";
29
24
  import "react-papaparse";
30
- import "@mui/material/Button";
31
- import "@mui/material/Grid";
32
25
  import "react-csv-downloader";
33
- import "@mui/material/Alert";
34
26
  import { RadioInput } from "../inputs/reactHookForm/booleans/RadioInput.js";
35
27
  import "../inputs/reactHookForm/numbers/RangeInput.js";
36
28
  import "localized-countries";
@@ -38,16 +30,12 @@ import "localized-countries/data/fr";
38
30
  import "localized-countries/data/en";
39
31
  import { DescriptionField } from "../inputs/reactHookForm/text/DescriptionField.js";
40
32
  import { UniqueNameInput } from "../inputs/reactHookForm/text/UniqueNameInput.js";
41
- import "@mui/icons-material/ControlPoint";
42
33
  import "@react-querybuilder/material";
43
34
  import "./expert/expertFilterConstants.js";
44
35
  import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
45
36
  import "uuid";
46
37
  import "../inputs/reactQueryBuilder/PropertyValueEditor.js";
47
- import "@mui/material/IconButton";
48
- import "@mui/icons-material/Delete";
49
38
  import "react-querybuilder";
50
- import "@mui/material/Box";
51
39
  const filterStyles = {
52
40
  textField: {
53
41
  minWidth: "250px",
@@ -19,11 +19,6 @@ import "react-intl";
19
19
  import "@mui/icons-material";
20
20
  import "../../treeViewFinder/TreeViewFinder.js";
21
21
  import "notistack";
22
- import "@mui/material/Dialog";
23
- import "@mui/material/DialogTitle";
24
- import "@mui/material/DialogContent";
25
- import "@mui/material/DialogActions";
26
- import "@mui/material/Button";
27
22
  import { FieldType } from "../../../utils/types/fieldType.js";
28
23
  import { useFormatLabelWithUnit } from "../../../hooks/useFormatLabelWithUnit.js";
29
24
  import { filterStyles } from "../HeaderFilterForm.js";
@@ -21,11 +21,6 @@ import { exportFilter } from "../../../services/study.js";
21
21
  import { unscrollableDialogStyles } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
22
22
  import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
23
23
  import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
24
- import "@mui/material/Dialog";
25
- import "@mui/material/DialogTitle";
26
- import "@mui/material/DialogContent";
27
- import "@mui/material/DialogActions";
28
- import "@mui/material/Button";
29
24
  import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterConstants.js";
30
25
  import { filterStyles } from "../HeaderFilterForm.js";
31
26
  import * as yup from "yup";
@@ -93,6 +93,7 @@ import { GroupValueEditor } from "./inputs/reactQueryBuilder/compositeRuleEditor
93
93
  import { RuleValueEditor } from "./inputs/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js";
94
94
  import { useConvertValue } from "./inputs/reactQueryBuilder/hooks/useConvertValue.js";
95
95
  import { useValid } from "./inputs/reactQueryBuilder/hooks/useValid.js";
96
+ import { ActivableChip } from "./inputs/ActivableChip.js";
96
97
  import { MultipleSelectionDialog } from "./multipleSelectionDialog/MultipleSelectionDialog.js";
97
98
  import { OverflowableText } from "./overflowableText/OverflowableText.js";
98
99
  import { SnackbarProvider } from "./snackbarProvider/SnackbarProvider.js";
@@ -106,6 +107,7 @@ import { useNotificationsListener } from "./notifications/hooks/useNotifications
106
107
  import { useListenerManager } from "./notifications/hooks/useListenerManager.js";
107
108
  export {
108
109
  AboutDialog,
110
+ ActivableChip,
109
111
  AddButton,
110
112
  AuthenticationRouter,
111
113
  default2 as AuthenticationRouterErrorDisplay,
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright (c) 2025, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ export interface ActivableChipProps {
8
+ isActivated: boolean;
9
+ label: string;
10
+ tooltipMessage: string;
11
+ onClick: () => void;
12
+ isDisabled?: boolean;
13
+ }
14
+ export declare function ActivableChip(props: Readonly<ActivableChipProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Tooltip, Chip } from "@mui/material";
3
+ import { CheckCircleOutline, Cancel } from "@mui/icons-material";
4
+ function ActivableChip(props) {
5
+ const { isActivated, label, tooltipMessage, onClick, isDisabled } = props;
6
+ return /* @__PURE__ */ jsx(Tooltip, { title: tooltipMessage, arrow: true, children: /* @__PURE__ */ jsx(
7
+ Chip,
8
+ {
9
+ label,
10
+ deleteIcon: isActivated ? /* @__PURE__ */ jsx(CheckCircleOutline, {}) : /* @__PURE__ */ jsx(Cancel, {}),
11
+ color: "primary",
12
+ size: "small",
13
+ variant: isActivated ? "filled" : "outlined",
14
+ onDelete: onClick,
15
+ onClick,
16
+ disabled: isDisabled
17
+ }
18
+ ) });
19
+ }
20
+ export {
21
+ ActivableChip
22
+ };
@@ -1,4 +1,4 @@
1
- import { AutocompleteProps } from '@mui/material/Autocomplete/Autocomplete';
1
+ import { AutocompleteProps } from '@mui/material';
2
2
  type SelectOption = {
3
3
  id: string;
4
4
  label?: string;
@@ -7,3 +7,4 @@
7
7
  export * from './SelectClearable';
8
8
  export * from './reactHookForm';
9
9
  export * from './reactQueryBuilder';
10
+ export * from './ActivableChip';
@@ -51,7 +51,9 @@ import { GroupValueEditor } from "./reactQueryBuilder/compositeRuleEditor/GroupV
51
51
  import { RuleValueEditor } from "./reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js";
52
52
  import { useConvertValue } from "./reactQueryBuilder/hooks/useConvertValue.js";
53
53
  import { useValid } from "./reactQueryBuilder/hooks/useValid.js";
54
+ import { ActivableChip } from "./ActivableChip.js";
54
55
  export {
56
+ ActivableChip,
55
57
  AddButton,
56
58
  AutocompleteInput,
57
59
  AutocompleteWithFavorites,
@@ -1,6 +1,6 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { FormControl, Chip, Grid, Tooltip, IconButton } from "@mui/material";
3
- import FolderIcon from "@mui/icons-material/Folder";
3
+ import { Folder } from "@mui/icons-material";
4
4
  import { useState, useMemo, useCallback } from "react";
5
5
  import { useFieldArray, useController } from "react-hook-form";
6
6
  import { useIntl } from "react-intl";
@@ -178,7 +178,7 @@ function DirectoryItemsInput({
178
178
  setDirectoryItemSelectorOpen(true);
179
179
  setMultiSelect(true);
180
180
  },
181
- children: /* @__PURE__ */ jsx(FolderIcon, {})
181
+ children: /* @__PURE__ */ jsx(Folder, {})
182
182
  }
183
183
  ) }) }) }) })
184
184
  ]
@@ -1,12 +1,8 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { Grid, Tooltip, Box } from "@mui/material";
3
- import IconButton from "@mui/material/IconButton";
4
- import { Upload, ArrowCircleUp, ArrowCircleDown } from "@mui/icons-material";
5
- import AddIcon from "@mui/icons-material/ControlPoint";
6
- import DeleteIcon from "@mui/icons-material/Delete";
2
+ import { styled, IconButton, Grid, Tooltip, Box } from "@mui/material";
3
+ import { Upload, ControlPoint, Delete, ArrowCircleUp, ArrowCircleDown } from "@mui/icons-material";
7
4
  import { useState } from "react";
8
5
  import { useIntl } from "react-intl";
9
- import { styled } from "@mui/material/styles";
10
6
  import { ErrorInput } from "../errorManagement/ErrorInput.js";
11
7
  import { FieldErrorAlert } from "../errorManagement/FieldErrorAlert.js";
12
8
  import { CsvUploader } from "./csvUploader/CsvUploader.js";
@@ -42,8 +38,8 @@ function BottomRightButtons({
42
38
  }
43
39
  ) }) }),
44
40
  /* @__PURE__ */ jsxs(Grid, { item: true, xs: 11, sx: { display: "flex", justifyContent: "right" }, children: [
45
- /* @__PURE__ */ jsx(InnerColoredButton, { onClick: handleAddRow, children: /* @__PURE__ */ jsx(AddIcon, {}) }, "addButton"),
46
- /* @__PURE__ */ jsx(InnerColoredButton, { onClick: handleDeleteRows, disabled: disableDelete, children: /* @__PURE__ */ jsx(DeleteIcon, {}) }, "DeleteButton"),
41
+ /* @__PURE__ */ jsx(InnerColoredButton, { onClick: handleAddRow, children: /* @__PURE__ */ jsx(ControlPoint, {}) }, "addButton"),
42
+ /* @__PURE__ */ jsx(InnerColoredButton, { onClick: handleDeleteRows, disabled: disableDelete, children: /* @__PURE__ */ jsx(Delete, {}) }, "DeleteButton"),
47
43
  /* @__PURE__ */ jsx(InnerColoredButton, { disabled: disableUp, onClick: handleMoveRowUp, children: /* @__PURE__ */ jsx(ArrowCircleUp, {}) }, "upButton"),
48
44
  /* @__PURE__ */ jsx(InnerColoredButton, { disabled: disableDown, onClick: handleMoveRowDown, children: /* @__PURE__ */ jsx(ArrowCircleDown, {}) }, "downButton")
49
45
  ] })
@@ -1,16 +1,9 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import Dialog from "@mui/material/Dialog";
3
- import DialogTitle from "@mui/material/DialogTitle";
4
- import DialogContent from "@mui/material/DialogContent";
5
- import DialogActions from "@mui/material/DialogActions";
2
+ import { Dialog, DialogTitle, DialogContent, Grid, Button, Alert, DialogActions, DialogContentText } from "@mui/material";
6
3
  import { useCSVReader, RECORD_SEP, UNIT_SEP } from "react-papaparse";
7
- import Button from "@mui/material/Button";
8
4
  import React, { useState, useMemo } from "react";
9
- import Grid from "@mui/material/Grid";
10
5
  import { useIntl, FormattedMessage } from "react-intl";
11
6
  import CsvDownloader from "react-csv-downloader";
12
- import Alert from "@mui/material/Alert";
13
- import { DialogContentText } from "@mui/material";
14
7
  import { useWatch } from "react-hook-form";
15
8
  import { FieldConstants } from "../../../../../utils/constants/fieldConstants.js";
16
9
  import { CancelButton } from "../../utils/CancelButton.js";
@@ -1,8 +1,12 @@
1
- import { Checkbox, CheckboxProps, Switch, SwitchProps } from '@mui/material';
2
- export interface BooleanInputProps {
1
+ import { JSX } from 'react';
2
+ import { Checkbox, Switch } from '@mui/material';
3
+ type InputTypes = typeof Switch | typeof Checkbox;
4
+ type InputProps<TInput> = TInput extends (props: infer Props) => JSX.Element ? Props : never;
5
+ export type BooleanInputProps<TInput extends InputTypes> = {
3
6
  name: string;
4
7
  label?: string;
5
- formProps?: SwitchProps | CheckboxProps;
6
- Input: typeof Switch | typeof Checkbox;
7
- }
8
- export declare function BooleanInput({ name, label, formProps, Input }: BooleanInputProps): import("react/jsx-runtime").JSX.Element;
8
+ formProps?: InputProps<TInput>;
9
+ Input: TInput;
10
+ };
11
+ export declare function BooleanInput<TInput extends InputTypes>({ name, label, formProps, Input, }: Readonly<BooleanInputProps<TInput>>): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -3,7 +3,12 @@ import { useCallback } from "react";
3
3
  import { useIntl } from "react-intl";
4
4
  import { FormControlLabel } from "@mui/material";
5
5
  import { useController } from "react-hook-form";
6
- function BooleanInput({ name, label, formProps, Input }) {
6
+ function BooleanInput({
7
+ name,
8
+ label,
9
+ formProps,
10
+ Input
11
+ }) {
7
12
  const {
8
13
  field: { onChange, value, ref }
9
14
  } = useController({ name });
@@ -18,11 +23,9 @@ function BooleanInput({ name, label, formProps, Input }) {
18
23
  Input,
19
24
  {
20
25
  checked: value,
21
- onChange: (e) => handleChangeValue(e),
26
+ onChange: handleChangeValue,
22
27
  inputRef: ref,
23
- inputProps: {
24
- "aria-label": "primary checkbox"
25
- },
28
+ inputProps: { "aria-label": "primary checkbox" },
26
29
  ...formProps
27
30
  }
28
31
  );
@@ -2,12 +2,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
3
  import { FormattedMessage } from "react-intl";
4
4
  import { Box, Button } from "@mui/material";
5
- import AddIcon from "@mui/icons-material/ControlPoint";
6
- import DeleteIcon from "@mui/icons-material/Delete";
5
+ import { ControlPoint, Delete } from "@mui/icons-material";
7
6
  import { useFormContext } from "react-hook-form";
8
7
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
9
8
  import "../../../../utils/conversionUtils.js";
10
- import "@mui/icons-material";
11
9
  import "../../../../utils/types/equipmentType.js";
12
10
  import "../../../../utils/yupConfig.js";
13
11
  import { ExpandingTextField } from "./ExpandingTextField.js";
@@ -27,7 +25,7 @@ function DescriptionField({ expandingTextSx }) {
27
25
  setIsDescriptionFieldVisible(true);
28
26
  }
29
27
  }, [description]);
30
- return /* @__PURE__ */ jsx(Box, { children: !isDescriptionFieldVisible ? /* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(AddIcon, {}), onClick: handleOpenDescription, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "AddDescription" }) }) : /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "flex-start" }, children: [
28
+ return /* @__PURE__ */ jsx(Box, { children: !isDescriptionFieldVisible ? /* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(ControlPoint, {}), onClick: handleOpenDescription, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "AddDescription" }) }) : /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "flex-start" }, children: [
31
29
  /* @__PURE__ */ jsx(
32
30
  ExpandingTextField,
33
31
  {
@@ -48,7 +46,7 @@ function DescriptionField({ expandingTextSx }) {
48
46
  marginBottom: 2
49
47
  },
50
48
  onClick: handleCloseDescription,
51
- children: /* @__PURE__ */ jsx(DeleteIcon, {})
49
+ children: /* @__PURE__ */ jsx(Delete, {})
52
50
  }
53
51
  )
54
52
  ] }) });
@@ -1,11 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect } from "react";
3
3
  import { FormattedMessage } from "react-intl";
4
- import { InputAdornment } from "@mui/material";
5
- import CheckIcon from "@mui/icons-material/Check";
4
+ import { TextField, InputAdornment, CircularProgress } from "@mui/material";
5
+ import { Check } from "@mui/icons-material";
6
6
  import { useController, useFormContext } from "react-hook-form";
7
- import CircularProgress from "@mui/material/CircularProgress";
8
- import TextField from "@mui/material/TextField";
9
7
  import "../../../../utils/types/equipmentType.js";
10
8
  import { elementAlreadyExists } from "../../../../services/directory.js";
11
9
  import { useDebounce } from "../../../../hooks/useDebounce.js";
@@ -15,7 +13,6 @@ import "localized-countries/data/en";
15
13
  import "notistack";
16
14
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
17
15
  import "../../../../utils/conversionUtils.js";
18
- import "@mui/icons-material";
19
16
  import "../../../../utils/yupConfig.js";
20
17
  function UniqueNameInput({
21
18
  name,
@@ -109,7 +106,7 @@ function UniqueNameInput({
109
106
  const showOk = (value == null ? void 0 : value.trim()) && !isValidating && !error;
110
107
  const endAdornment = /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
111
108
  isValidating && /* @__PURE__ */ jsx(CircularProgress, { size: "1rem" }),
112
- showOk && /* @__PURE__ */ jsx(CheckIcon, { style: { color: "green" } })
109
+ showOk && /* @__PURE__ */ jsx(Check, { style: { color: "green" } })
113
110
  ] });
114
111
  return /* @__PURE__ */ jsx(
115
112
  TextField,
@@ -1,10 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Button } from "@mui/material";
3
- import AddIcon from "@mui/icons-material/ControlPoint";
3
+ import { ControlPoint } from "@mui/icons-material";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  function AddButton(props) {
6
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 }) }) });
7
+ return /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(ControlPoint, {}), onClick: handleOnClick, size: "small", className: "add-button", title, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }) });
8
8
  }
9
9
  export {
10
10
  AddButton
@@ -1,4 +1,4 @@
1
- import { AutocompleteProps } from '@mui/material/Autocomplete/Autocomplete';
1
+ import { AutocompleteProps } from '@mui/material';
2
2
  interface AutocompleteWithFavoritesProps<Value> extends Omit<AutocompleteProps<Value, boolean, false, boolean>, 'multiple' | 'renderInput' | 'renderGroup' | 'groupBy'> {
3
3
  favorites: Value[];
4
4
  valid: boolean;
@@ -1,7 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useCallback } from "react";
3
- import Grid from "@mui/material/Grid";
4
- import { Autocomplete, TextField, FormControl, Select, MenuItem } from "@mui/material";
3
+ import { Grid, Autocomplete, TextField, FormControl, Select, MenuItem } from "@mui/material";
5
4
  import { useIntl } from "react-intl";
6
5
  import { useValid } from "./hooks/useValid.js";
7
6
  import { OPERATOR_OPTIONS } from "../../filter/expert/expertFilterConstants.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import IconButton from "@mui/material/IconButton";
3
- import DeleteIcon from "@mui/icons-material/Delete";
2
+ import { IconButton } from "@mui/material";
3
+ import { Delete } from "@mui/icons-material";
4
4
  import { useController } from "react-hook-form";
5
5
  import { recursiveRemove } from "../../filter/expert/expertFilterUtils.js";
6
6
  const EXPERT_FILTER_QUERY = "rules";
@@ -12,7 +12,7 @@ function RemoveButton(props) {
12
12
  function handleDelete() {
13
13
  onChange(recursiveRemove(query, path));
14
14
  }
15
- return /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => handleDelete(), className, title, children: /* @__PURE__ */ jsx(DeleteIcon, {}) });
15
+ return /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => handleDelete(), className, title, children: /* @__PURE__ */ jsx(Delete, {}) });
16
16
  }
17
17
  export {
18
18
  RemoveButton
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useCallback, createElement } from "react";
3
3
  import { MaterialValueEditor } from "@react-querybuilder/material";
4
- import Box from "@mui/material/Box";
4
+ import { Box } from "@mui/material";
5
5
  import { useFormContext } from "react-hook-form";
6
6
  import { CountryValueEditor } from "./CountryValueEditor.js";
7
7
  import { TranslatedValueEditor } from "./TranslatedValueEditor.js";
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useRef } from "react";
3
3
  import { styled, IconButton } from "@mui/material";
4
- import ClearIcon from "@mui/icons-material/Clear";
4
+ import { Clear } from "@mui/icons-material";
5
5
  import { SnackbarProvider as SnackbarProvider$1 } from "notistack";
6
6
  const StyledOrigSnackbarProvider = styled(SnackbarProvider$1)(() => ({
7
7
  "&.notistack-MuiContent": {
@@ -29,7 +29,7 @@ function SnackbarProvider(props) {
29
29
  "aria-label": "clear-snack",
30
30
  size: "small",
31
31
  sx: styles.buttonColor,
32
- children: /* @__PURE__ */ jsx(ClearIcon, { fontSize: "small" })
32
+ children: /* @__PURE__ */ jsx(Clear, { fontSize: "small" })
33
33
  }
34
34
  );
35
35
  return /* @__PURE__ */ jsx(
package/dist/index.js CHANGED
@@ -94,6 +94,7 @@ import { GroupValueEditor } from "./components/inputs/reactQueryBuilder/composit
94
94
  import { RuleValueEditor } from "./components/inputs/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js";
95
95
  import { useConvertValue } from "./components/inputs/reactQueryBuilder/hooks/useConvertValue.js";
96
96
  import { useValid } from "./components/inputs/reactQueryBuilder/hooks/useValid.js";
97
+ import { ActivableChip } from "./components/inputs/ActivableChip.js";
97
98
  import { MultipleSelectionDialog } from "./components/multipleSelectionDialog/MultipleSelectionDialog.js";
98
99
  import { OverflowableText } from "./components/overflowableText/OverflowableText.js";
99
100
  import { SnackbarProvider } from "./components/snackbarProvider/SnackbarProvider.js";
@@ -189,6 +190,7 @@ import * as yup from "yup";
189
190
  export {
190
191
  AMPERE,
191
192
  AboutDialog,
193
+ ActivableChip,
192
194
  AddButton,
193
195
  AuthenticationRouter,
194
196
  default3 as AuthenticationRouterErrorDisplay,
@@ -1 +1 @@
1
- import "@mui/material/Switch";
1
+ import "@mui/material";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.92.2",
3
+ "version": "0.93.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
@@ -34,6 +34,7 @@
34
34
  "licenses-check": "license-checker --summary --excludePrivatePackages --production --onlyAllow \"$( jq -r .onlyAllow[] license-checker-config.json | tr '\n' ';')\" --excludePackages \"$( jq -r .excludePackages[] license-checker-config.json | tr '\n' ';')\""
35
35
  },
36
36
  "dependencies": {
37
+ "@hello-pangea/dnd": "^18.0.1",
37
38
  "@react-querybuilder/dnd": "^8.2.0",
38
39
  "@react-querybuilder/material": "^8.2.0",
39
40
  "autosuggest-highlight": "^3.3.4",
@@ -42,7 +43,6 @@
42
43
  "localized-countries": "^2.0.0",
43
44
  "oidc-client": "^1.11.5",
44
45
  "prop-types": "^15.8.1",
45
- "react-beautiful-dnd": "^13.1.1",
46
46
  "react-csv-downloader": "^3.3.0",
47
47
  "react-dnd": "^16.0.1",
48
48
  "react-dnd-html5-backend": "^16.0.1",
@@ -96,7 +96,6 @@
96
96
  "@types/node": "^22.13.4",
97
97
  "@types/prop-types": "^15.7.14",
98
98
  "@types/react": "^18.3.18",
99
- "@types/react-beautiful-dnd": "^13.1.8",
100
99
  "@types/react-dom": "^18.3.5",
101
100
  "@types/react-resizable": "^3.0.8",
102
101
  "@typescript-eslint/eslint-plugin": "^7.18.0",