@gridsuite/commons-ui 0.92.3 → 0.93.1
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.
- package/dist/components/checkBoxList/CheckBoxList.js +1 -1
- package/dist/components/checkBoxList/CheckBoxListItems.js +1 -1
- package/dist/components/checkBoxList/checkBoxList.type.d.ts +1 -1
- package/dist/components/filter/FilterCreationDialog.d.ts +5 -1
- package/dist/components/filter/FilterCreationDialog.js +17 -8
- package/dist/components/filter/FilterForm.d.ts +1 -1
- package/dist/components/filter/FilterForm.js +7 -18
- package/dist/components/filter/HeaderFilterForm.d.ts +5 -3
- package/dist/components/filter/HeaderFilterForm.js +3 -22
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +2 -3
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +2 -3
- package/dist/components/index.js +2 -0
- package/dist/components/inputs/ActivableChip.d.ts +14 -0
- package/dist/components/inputs/ActivableChip.js +22 -0
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/inputs/index.js +2 -0
- package/dist/index.js +2 -0
- package/dist/translations/en/filterEn.d.ts +2 -0
- package/dist/translations/en/filterEn.js +2 -0
- package/dist/translations/fr/filterFr.d.ts +2 -0
- package/dist/translations/fr/filterFr.js +2 -0
- 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 "
|
|
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 "
|
|
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 { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { DraggableProvided, DragStart, DropResult } from '
|
|
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>;
|
|
@@ -8,5 +8,9 @@ export interface FilterCreationDialogProps {
|
|
|
8
8
|
id: UUID;
|
|
9
9
|
equipmentType: string;
|
|
10
10
|
};
|
|
11
|
+
filterType: {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
11
15
|
}
|
|
12
|
-
export declare function FilterCreationDialog({ open, onClose, activeDirectory, language, sourceFilterForExplicitNamingConversion, }: FilterCreationDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function FilterCreationDialog({ open, onClose, activeDirectory, language, sourceFilterForExplicitNamingConversion, filterType, }: FilterCreationDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
3
|
import { useForm } from "react-hook-form";
|
|
4
4
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
5
5
|
import { saveExplicitNamingFilter, saveExpertFilter } from "./utils/filterApi.js";
|
|
@@ -18,7 +18,6 @@ import * as yup from "yup";
|
|
|
18
18
|
const emptyFormData = {
|
|
19
19
|
[FieldConstants.NAME]: "",
|
|
20
20
|
[FieldConstants.DESCRIPTION]: "",
|
|
21
|
-
[FieldConstants.FILTER_TYPE]: FilterType.EXPERT.id,
|
|
22
21
|
[FieldConstants.EQUIPMENT_TYPE]: null,
|
|
23
22
|
...getExplicitNamingFilterEmptyFormData(),
|
|
24
23
|
...getExpertFilterEmptyFormData()
|
|
@@ -26,7 +25,6 @@ const emptyFormData = {
|
|
|
26
25
|
const formSchema = yup.object().shape({
|
|
27
26
|
[FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
|
|
28
27
|
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION, "descriptionLimitError"),
|
|
29
|
-
[FieldConstants.FILTER_TYPE]: yup.string().required(),
|
|
30
28
|
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
31
29
|
...explicitNamingFilterSchema,
|
|
32
30
|
...expertFilterSchema
|
|
@@ -36,7 +34,8 @@ function FilterCreationDialog({
|
|
|
36
34
|
onClose,
|
|
37
35
|
activeDirectory,
|
|
38
36
|
language,
|
|
39
|
-
sourceFilterForExplicitNamingConversion = void 0
|
|
37
|
+
sourceFilterForExplicitNamingConversion = void 0,
|
|
38
|
+
filterType
|
|
40
39
|
}) {
|
|
41
40
|
var _a;
|
|
42
41
|
const { snackError } = useSnackMessage();
|
|
@@ -51,7 +50,7 @@ function FilterCreationDialog({
|
|
|
51
50
|
const isValidating = (_a = errors.root) == null ? void 0 : _a.isValidating;
|
|
52
51
|
const onSubmit = useCallback(
|
|
53
52
|
(filterForm) => {
|
|
54
|
-
if (
|
|
53
|
+
if ((filterType == null ? void 0 : filterType.id) === FilterType.EXPLICIT_NAMING.id) {
|
|
55
54
|
saveExplicitNamingFilter(
|
|
56
55
|
filterForm[FILTER_EQUIPMENTS_ATTRIBUTES],
|
|
57
56
|
true,
|
|
@@ -67,7 +66,7 @@ function FilterCreationDialog({
|
|
|
67
66
|
onClose,
|
|
68
67
|
activeDirectory
|
|
69
68
|
);
|
|
70
|
-
} else if (
|
|
69
|
+
} else if ((filterType == null ? void 0 : filterType.id) === FilterType.EXPERT.id) {
|
|
71
70
|
saveExpertFilter(
|
|
72
71
|
null,
|
|
73
72
|
filterForm[EXPERT_FILTER_QUERY],
|
|
@@ -85,8 +84,17 @@ function FilterCreationDialog({
|
|
|
85
84
|
);
|
|
86
85
|
}
|
|
87
86
|
},
|
|
88
|
-
[activeDirectory, snackError, onClose]
|
|
87
|
+
[activeDirectory, snackError, onClose, filterType]
|
|
89
88
|
);
|
|
89
|
+
const titleId = useMemo(() => {
|
|
90
|
+
if (sourceFilterForExplicitNamingConversion) {
|
|
91
|
+
return "convertIntoExplicitNamingFilter";
|
|
92
|
+
}
|
|
93
|
+
if ((filterType == null ? void 0 : filterType.id) === FilterType.EXPERT.id) {
|
|
94
|
+
return "createNewCriteriaFilter";
|
|
95
|
+
}
|
|
96
|
+
return "createNewExplicitNamingFilter";
|
|
97
|
+
}, [sourceFilterForExplicitNamingConversion, filterType]);
|
|
90
98
|
return /* @__PURE__ */ jsx(
|
|
91
99
|
CustomMuiDialog,
|
|
92
100
|
{
|
|
@@ -95,7 +103,7 @@ function FilterCreationDialog({
|
|
|
95
103
|
onSave: onSubmit,
|
|
96
104
|
formSchema,
|
|
97
105
|
formMethods,
|
|
98
|
-
titleId
|
|
106
|
+
titleId,
|
|
99
107
|
removeOptional: true,
|
|
100
108
|
disabledSave: !!nameError || !!isValidating,
|
|
101
109
|
language,
|
|
@@ -105,6 +113,7 @@ function FilterCreationDialog({
|
|
|
105
113
|
{
|
|
106
114
|
creation: true,
|
|
107
115
|
activeDirectory,
|
|
116
|
+
filterType,
|
|
108
117
|
sourceFilterForExplicitNamingConversion
|
|
109
118
|
}
|
|
110
119
|
)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FilterFormProps } from './HeaderFilterForm';
|
|
2
|
-
export declare function FilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function FilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, filterType, }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,51 +1,40 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from "@mui/material";
|
|
3
|
-
import { useFormContext, useWatch } from "react-hook-form";
|
|
4
|
-
import { useEffect } from "react";
|
|
5
3
|
import { HeaderFilterForm } from "./HeaderFilterForm.js";
|
|
6
|
-
import { FieldConstants } from "../../utils/constants/fieldConstants.js";
|
|
7
4
|
import { ExplicitNamingFilterForm } from "./explicitNaming/ExplicitNamingFilterForm.js";
|
|
8
5
|
import { ExpertFilterForm } from "./expert/ExpertFilterForm.js";
|
|
9
6
|
import { FilterType } from "./constants/FilterConstants.js";
|
|
10
7
|
import { unscrollableDialogStyles } from "../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
11
8
|
import "../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
12
9
|
import "../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
10
|
+
import "react";
|
|
13
11
|
import "react-intl";
|
|
12
|
+
import "react-hook-form";
|
|
14
13
|
import "@mui/icons-material";
|
|
15
14
|
import "../treeViewFinder/TreeViewFinder.js";
|
|
16
15
|
import "notistack";
|
|
17
16
|
function FilterForm({
|
|
18
17
|
sourceFilterForExplicitNamingConversion,
|
|
19
18
|
creation,
|
|
20
|
-
activeDirectory
|
|
19
|
+
activeDirectory,
|
|
20
|
+
filterType
|
|
21
21
|
}) {
|
|
22
|
-
const { setValue } = useFormContext();
|
|
23
|
-
const filterType = useWatch({ name: FieldConstants.FILTER_TYPE });
|
|
24
|
-
const handleFilterTypeChange = (_event, value) => {
|
|
25
|
-
setValue(FieldConstants.FILTER_TYPE, value);
|
|
26
|
-
};
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (sourceFilterForExplicitNamingConversion) {
|
|
29
|
-
setValue(FieldConstants.FILTER_TYPE, FilterType.EXPLICIT_NAMING.id);
|
|
30
|
-
}
|
|
31
|
-
}, [sourceFilterForExplicitNamingConversion, setValue]);
|
|
32
22
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
23
|
/* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.unscrollableHeader, children: /* @__PURE__ */ jsx(
|
|
34
24
|
HeaderFilterForm,
|
|
35
25
|
{
|
|
36
26
|
creation,
|
|
37
27
|
activeDirectory,
|
|
38
|
-
sourceFilterForExplicitNamingConversion
|
|
39
|
-
handleFilterTypeChange
|
|
28
|
+
sourceFilterForExplicitNamingConversion
|
|
40
29
|
}
|
|
41
30
|
) }),
|
|
42
|
-
filterType === FilterType.EXPLICIT_NAMING.id && /* @__PURE__ */ jsx(
|
|
31
|
+
(filterType == null ? void 0 : filterType.id) === FilterType.EXPLICIT_NAMING.id && /* @__PURE__ */ jsx(
|
|
43
32
|
ExplicitNamingFilterForm,
|
|
44
33
|
{
|
|
45
34
|
sourceFilterForExplicitNamingConversion
|
|
46
35
|
}
|
|
47
36
|
),
|
|
48
|
-
filterType === FilterType.EXPERT.id && /* @__PURE__ */ jsx(ExpertFilterForm, {})
|
|
37
|
+
(filterType == null ? void 0 : filterType.id) === FilterType.EXPERT.id && /* @__PURE__ */ jsx(ExpertFilterForm, {})
|
|
49
38
|
] });
|
|
50
39
|
}
|
|
51
40
|
export {
|
|
@@ -13,16 +13,18 @@ export declare const filterStyles: {
|
|
|
13
13
|
export interface FilterFormProps {
|
|
14
14
|
creation?: boolean;
|
|
15
15
|
activeDirectory?: UUID;
|
|
16
|
+
filterType?: {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
};
|
|
16
20
|
sourceFilterForExplicitNamingConversion?: {
|
|
17
21
|
id: UUID;
|
|
18
22
|
equipmentType: string;
|
|
19
23
|
};
|
|
20
|
-
handleFilterTypeChange?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
|
|
21
24
|
}
|
|
22
25
|
export declare const HeaderFilterSchema: {
|
|
23
26
|
name: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
24
|
-
filterType: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
25
27
|
equipmentType: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
26
28
|
description: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
27
29
|
};
|
|
28
|
-
export declare function HeaderFilterForm({
|
|
30
|
+
export declare function HeaderFilterForm({ creation, activeDirectory }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs, jsx
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Grid } from "@mui/material";
|
|
3
3
|
import { FieldConstants } from "../../utils/constants/fieldConstants.js";
|
|
4
4
|
import { MAX_CHAR_DESCRIPTION } from "../../utils/constants/uiConstants.js";
|
|
@@ -7,7 +7,6 @@ import "@mui/icons-material";
|
|
|
7
7
|
import { ElementType } from "../../utils/types/elementType.js";
|
|
8
8
|
import "../../utils/types/equipmentType.js";
|
|
9
9
|
import "../../utils/yupConfig.js";
|
|
10
|
-
import { FilterType } from "./constants/FilterConstants.js";
|
|
11
10
|
import "react-intl";
|
|
12
11
|
import "react";
|
|
13
12
|
import "react-hook-form";
|
|
@@ -23,7 +22,6 @@ import "../customAGGrid/customAggrid.js";
|
|
|
23
22
|
import "ag-grid-community";
|
|
24
23
|
import "react-papaparse";
|
|
25
24
|
import "react-csv-downloader";
|
|
26
|
-
import { RadioInput } from "../inputs/reactHookForm/booleans/RadioInput.js";
|
|
27
25
|
import "../inputs/reactHookForm/numbers/RangeInput.js";
|
|
28
26
|
import "localized-countries";
|
|
29
27
|
import "localized-countries/data/fr";
|
|
@@ -48,17 +46,10 @@ const filterStyles = {
|
|
|
48
46
|
};
|
|
49
47
|
const HeaderFilterSchema = {
|
|
50
48
|
[FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
|
|
51
|
-
[FieldConstants.FILTER_TYPE]: yup.string().required(),
|
|
52
49
|
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
53
50
|
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION, "descriptionLimitError")
|
|
54
51
|
};
|
|
55
|
-
function HeaderFilterForm({
|
|
56
|
-
sourceFilterForExplicitNamingConversion,
|
|
57
|
-
creation,
|
|
58
|
-
activeDirectory,
|
|
59
|
-
handleFilterTypeChange
|
|
60
|
-
}) {
|
|
61
|
-
const filterTypes = Object.values(FilterType);
|
|
52
|
+
function HeaderFilterForm({ creation, activeDirectory }) {
|
|
62
53
|
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
63
54
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
64
55
|
UniqueNameInput,
|
|
@@ -72,17 +63,7 @@ function HeaderFilterForm({
|
|
|
72
63
|
fullWidth: false
|
|
73
64
|
}
|
|
74
65
|
) }),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx: filterStyles.description }) }),
|
|
77
|
-
creation && !sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
78
|
-
RadioInput,
|
|
79
|
-
{
|
|
80
|
-
name: FieldConstants.FILTER_TYPE,
|
|
81
|
-
options: filterTypes,
|
|
82
|
-
formProps: { onChange: handleFilterTypeChange }
|
|
83
|
-
}
|
|
84
|
-
) })
|
|
85
|
-
] })
|
|
66
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx: filterStyles.description }) })
|
|
86
67
|
] });
|
|
87
68
|
}
|
|
88
69
|
export {
|
|
@@ -7,7 +7,7 @@ import { FetchStatus } from "../../../utils/constants/fetchStatus.js";
|
|
|
7
7
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
8
8
|
import "../../../utils/yupConfig.js";
|
|
9
9
|
import { CustomMuiDialog } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
10
|
-
import {
|
|
10
|
+
import { NO_ITEM_SELECTION_FOR_COPY, FilterType } from "../constants/FilterConstants.js";
|
|
11
11
|
import { FilterForm } from "../FilterForm.js";
|
|
12
12
|
import { saveExpertFilter } from "../utils/filterApi.js";
|
|
13
13
|
import { expertFilterSchema } from "./ExpertFilterForm.js";
|
|
@@ -54,7 +54,6 @@ function ExpertFilterEditionDialog({
|
|
|
54
54
|
reset({
|
|
55
55
|
[FieldConstants.NAME]: name,
|
|
56
56
|
[FieldConstants.DESCRIPTION]: description,
|
|
57
|
-
[FieldConstants.FILTER_TYPE]: FilterType.EXPERT.id,
|
|
58
57
|
[FieldConstants.EQUIPMENT_TYPE]: response[FieldConstants.EQUIPMENT_TYPE],
|
|
59
58
|
[EXPERT_FILTER_QUERY]: importExpertRules(response[EXPERT_FILTER_QUERY])
|
|
60
59
|
});
|
|
@@ -108,7 +107,7 @@ function ExpertFilterEditionDialog({
|
|
|
108
107
|
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
109
108
|
language,
|
|
110
109
|
unscrollableFullHeight: true,
|
|
111
|
-
children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory })
|
|
110
|
+
children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory, filterType: FilterType.EXPERT })
|
|
112
111
|
}
|
|
113
112
|
);
|
|
114
113
|
}
|
|
@@ -12,7 +12,7 @@ import { saveExplicitNamingFilter } from "../utils/filterApi.js";
|
|
|
12
12
|
import { explicitNamingFilterSchema } from "./ExplicitNamingFilterForm.js";
|
|
13
13
|
import { FetchStatus } from "../../../utils/constants/fetchStatus.js";
|
|
14
14
|
import { FilterForm } from "../FilterForm.js";
|
|
15
|
-
import {
|
|
15
|
+
import { NO_ITEM_SELECTION_FOR_COPY, FilterType } from "../constants/FilterConstants.js";
|
|
16
16
|
import { HeaderFilterSchema } from "../HeaderFilterForm.js";
|
|
17
17
|
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterConstants.js";
|
|
18
18
|
import * as yup from "yup";
|
|
@@ -55,7 +55,6 @@ function ExplicitNamingFilterEditionDialog({
|
|
|
55
55
|
reset({
|
|
56
56
|
[FieldConstants.NAME]: name,
|
|
57
57
|
[FieldConstants.DESCRIPTION]: description,
|
|
58
|
-
[FieldConstants.FILTER_TYPE]: FilterType.EXPLICIT_NAMING.id,
|
|
59
58
|
[FieldConstants.EQUIPMENT_TYPE]: response[FieldConstants.EQUIPMENT_TYPE],
|
|
60
59
|
[FILTER_EQUIPMENTS_ATTRIBUTES]: (_a2 = response[FILTER_EQUIPMENTS_ATTRIBUTES]) == null ? void 0 : _a2.map((row) => ({
|
|
61
60
|
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
@@ -109,7 +108,7 @@ function ExplicitNamingFilterEditionDialog({
|
|
|
109
108
|
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
110
109
|
language,
|
|
111
110
|
unscrollableFullHeight: true,
|
|
112
|
-
children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory })
|
|
111
|
+
children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory, filterType: FilterType.EXPLICIT_NAMING })
|
|
113
112
|
}
|
|
114
113
|
);
|
|
115
114
|
}
|
package/dist/components/index.js
CHANGED
|
@@ -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
|
+
};
|
|
@@ -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,
|
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,
|
|
@@ -45,6 +45,8 @@ export declare const filterEn: {
|
|
|
45
45
|
missingDistributionKeyError: string;
|
|
46
46
|
filterCsvFileName: string;
|
|
47
47
|
createNewFilter: string;
|
|
48
|
+
createNewCriteriaFilter: string;
|
|
49
|
+
createNewExplicitNamingFilter: string;
|
|
48
50
|
nameProperty: string;
|
|
49
51
|
Countries: string;
|
|
50
52
|
Countries1: string;
|
|
@@ -39,6 +39,8 @@ const filterEn = {
|
|
|
39
39
|
missingDistributionKeyError: "Missing distribution key",
|
|
40
40
|
filterCsvFileName: "filterCreation",
|
|
41
41
|
createNewFilter: "Create a filter",
|
|
42
|
+
createNewCriteriaFilter: "Create a criteria based filter",
|
|
43
|
+
createNewExplicitNamingFilter: "Create an explicit naming filter",
|
|
42
44
|
nameProperty: "Name",
|
|
43
45
|
Countries: "Countries",
|
|
44
46
|
Countries1: "Countries 1",
|
|
@@ -45,6 +45,8 @@ export declare const filterFr: {
|
|
|
45
45
|
missingDistributionKeyError: string;
|
|
46
46
|
filterCsvFileName: string;
|
|
47
47
|
createNewFilter: string;
|
|
48
|
+
createNewCriteriaFilter: string;
|
|
49
|
+
createNewExplicitNamingFilter: string;
|
|
48
50
|
nameProperty: string;
|
|
49
51
|
Countries: string;
|
|
50
52
|
Countries1: string;
|
|
@@ -39,6 +39,8 @@ const filterFr = {
|
|
|
39
39
|
missingDistributionKeyError: "Clé de répartition manquante",
|
|
40
40
|
filterCsvFileName: "creationFiltre",
|
|
41
41
|
createNewFilter: "Créer un filtre",
|
|
42
|
+
createNewCriteriaFilter: "Créer un filtre par critères",
|
|
43
|
+
createNewExplicitNamingFilter: "Créer un filtre par nommage",
|
|
42
44
|
nameProperty: "Nom",
|
|
43
45
|
Countries: "Pays",
|
|
44
46
|
Countries1: "Pays 1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.93.1",
|
|
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",
|