@gridsuite/commons-ui 0.63.4 → 0.63.5
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/_mocks_/svg.js +1 -3
- package/dist/assets/expert-filter-form.css +18 -8
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +88 -97
- package/dist/components/CardErrorBoundary/card-error-boundary.js +6 -20
- package/dist/components/CustomAGGrid/custom-aggrid.js +47 -49
- package/dist/components/DirectoryItemSelector/directory-item-selector.js +10 -40
- package/dist/components/ElementSearchDialog/element-search-dialog.js +1 -17
- package/dist/components/ElementSearchDialog/equipment-item.js +29 -47
- package/dist/components/ElementSearchDialog/tag-renderer.js +2 -8
- package/dist/components/ElementSearchDialog/use-element-search.js +1 -4
- package/dist/components/FlatParameters/FlatParameters.js +13 -77
- package/dist/components/Login/Login.js +9 -34
- package/dist/components/Login/Logout.js +3 -26
- package/dist/components/MuiVirtualizedTable/ColumnHeader.js +35 -64
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +4 -17
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +1 -1
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +19 -95
- package/dist/components/MuiVirtualizedTable/index.d.ts +1 -1
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +2 -6
- package/dist/components/OverflowableText/overflowable-text.js +3 -10
- package/dist/components/ReportViewer/filter-button.d.ts +1 -1
- package/dist/components/ReportViewer/filter-button.js +2 -7
- package/dist/components/ReportViewer/log-report-item.js +7 -17
- package/dist/components/ReportViewer/log-report.js +4 -13
- package/dist/components/ReportViewer/log-table.d.ts +1 -1
- package/dist/components/ReportViewer/log-table.js +3 -16
- package/dist/components/ReportViewer/multi-select-list.d.ts +1 -1
- package/dist/components/ReportViewer/multi-select-list.js +2 -14
- package/dist/components/ReportViewer/report-item.js +4 -10
- package/dist/components/ReportViewer/report-viewer.d.ts +1 -1
- package/dist/components/ReportViewer/report-viewer.js +2 -7
- package/dist/components/ReportViewerDialog/report-viewer-dialog.js +1 -13
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +1 -1
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +1 -4
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +1 -1
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +1 -4
- package/dist/components/SnackbarProvider/SnackbarProvider.js +4 -11
- package/dist/components/TopBar/AboutDialog.js +51 -152
- package/dist/components/TopBar/GridLogo.d.ts +2 -2
- package/dist/components/TopBar/GridLogo.js +8 -41
- package/dist/components/TopBar/TopBar.js +197 -328
- package/dist/components/TreeViewFinder/TreeViewFinder.js +23 -66
- package/dist/components/TreeViewFinder/index.d.ts +2 -2
- package/dist/components/dialogs/custom-mui-dialog.d.ts +2 -1
- package/dist/components/dialogs/custom-mui-dialog.js +64 -39
- package/dist/components/dialogs/modify-element-selection.js +1 -3
- package/dist/components/dialogs/popup-confirmation-dialog.d.ts +1 -1
- package/dist/components/dialogs/popup-confirmation-dialog.js +8 -15
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +3 -18
- package/dist/components/filter/criteria-based/criteria-based-filter-utils.js +3 -9
- package/dist/components/filter/criteria-based/criteria-based-form.d.ts +1 -1
- package/dist/components/filter/criteria-based/criteria-based-form.js +7 -15
- package/dist/components/filter/criteria-based/filter-free-properties.d.ts +1 -1
- package/dist/components/filter/criteria-based/filter-free-properties.js +1 -4
- package/dist/components/filter/criteria-based/filter-properties.js +16 -24
- package/dist/components/filter/criteria-based/filter-property.js +1 -4
- package/dist/components/filter/expert/expert-filter-constants.d.ts +10 -3
- package/dist/components/filter/expert/expert-filter-constants.js +16 -12
- package/dist/components/filter/expert/expert-filter-edition-dialog.js +3 -18
- package/dist/components/filter/expert/expert-filter-form.js +1 -7
- package/dist/components/filter/expert/expert-filter-utils.js +10 -30
- package/dist/components/filter/expert/expert-filter.type.d.ts +3 -1
- package/dist/components/filter/expert/expert-filter.type.js +2 -0
- package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +2 -15
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.d.ts +1 -1
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +10 -35
- package/dist/components/filter/filter-creation-dialog.js +5 -10
- package/dist/components/filter/filter-form.js +1 -6
- package/dist/components/filter/utils/filter-api.js +1 -7
- package/dist/components/inputs/react-hook-form/ExpandingTextField.js +1 -9
- package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +14 -52
- package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +14 -62
- package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +29 -40
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.js +2 -8
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js +1 -3
- package/dist/components/inputs/react-hook-form/booleans/boolean-input.js +1 -7
- package/dist/components/inputs/react-hook-form/booleans/checkbox-input.js +1 -9
- package/dist/components/inputs/react-hook-form/booleans/switch-input.js +1 -9
- package/dist/components/inputs/react-hook-form/directory-items-input.js +5 -29
- package/dist/components/inputs/react-hook-form/error-management/error-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/provider/custom-form-provider.js +1 -7
- package/dist/components/inputs/react-hook-form/radio-input.js +8 -18
- package/dist/components/inputs/react-hook-form/range-input.js +1 -4
- package/dist/components/inputs/react-hook-form/select-inputs/countries-input.js +1 -9
- package/dist/components/inputs/react-hook-form/select-inputs/mui-select-input.js +2 -13
- package/dist/components/inputs/react-hook-form/select-inputs/select-input.js +2 -6
- package/dist/components/inputs/react-hook-form/slider-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/slider-input.js +2 -19
- package/dist/components/inputs/react-hook-form/unique-name-input.js +1 -9
- package/dist/components/inputs/react-hook-form/utils/field-label.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/utils/field-label.js +1 -5
- package/dist/components/inputs/react-hook-form/utils/submit-button.js +1 -8
- package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.js +18 -47
- package/dist/components/inputs/react-query-builder/add-button.js +1 -10
- package/dist/components/inputs/react-query-builder/autocomplete-with-favorites.d.ts +12 -0
- package/dist/components/inputs/react-query-builder/autocomplete-with-favorites.js +43 -0
- package/dist/components/inputs/react-query-builder/composite-rule-editor/group-value-editor.js +14 -27
- package/dist/components/inputs/react-query-builder/composite-rule-editor/rule-value-editor.js +1 -3
- package/dist/components/inputs/react-query-builder/country-value-editor.js +27 -28
- package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +25 -31
- package/dist/components/inputs/react-query-builder/element-value-editor.js +1 -10
- package/dist/components/inputs/react-query-builder/property-value-editor.js +6 -11
- package/dist/components/inputs/react-query-builder/remove-button.js +1 -9
- package/dist/components/inputs/react-query-builder/text-value-editor.js +2 -1
- package/dist/components/inputs/react-query-builder/translated-value-editor.js +3 -4
- package/dist/components/inputs/react-query-builder/use-convert-value.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/use-convert-value.js +1 -6
- package/dist/components/inputs/react-query-builder/value-editor.js +4 -20
- package/dist/components/translations/filter-expert-en.d.ts +2 -0
- package/dist/components/translations/filter-expert-en.js +3 -1
- package/dist/components/translations/filter-expert-fr.d.ts +2 -0
- package/dist/components/translations/filter-expert-fr.js +3 -1
- package/dist/hooks/localized-countries-hook.js +1 -3
- package/dist/hooks/useConfidentialityWarning.d.ts +8 -0
- package/dist/hooks/useConfidentialityWarning.js +14 -0
- package/dist/hooks/useDebounce.js +1 -4
- package/dist/hooks/useSnackMessage.js +3 -12
- package/dist/index.d.ts +10 -9
- package/dist/index.js +77 -73
- package/dist/services/apps-metadata.d.ts +7 -0
- package/dist/services/apps-metadata.js +13 -0
- package/dist/services/directory.js +3 -11
- package/dist/services/explore.js +2 -8
- package/dist/services/index.js +3 -1
- package/dist/services/utils.js +4 -12
- package/dist/utils/AuthService.js +8 -29
- package/dist/utils/UserManagerMock.js +6 -23
- package/dist/utils/styles.js +1 -6
- package/package.json +1 -1
package/dist/components/inputs/react-query-builder/composite-rule-editor/group-value-editor.js
CHANGED
|
@@ -29,33 +29,20 @@ function GroupValueEditor(props) {
|
|
|
29
29
|
},
|
|
30
30
|
[handleOnChange, combinator, value]
|
|
31
31
|
);
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
...props,
|
|
47
|
-
key: fieldData.name,
|
|
48
|
-
field: fieldData.name,
|
|
49
|
-
fieldData,
|
|
50
|
-
rule: (_a = value == null ? void 0 : value.rules) == null ? void 0 : _a[fieldData.name],
|
|
51
|
-
handleOnChangeRule: generateOnChangeRuleHandler(
|
|
52
|
-
fieldData.name
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
);
|
|
32
|
+
return /* @__PURE__ */ jsx(Grid, { container: true, direction: "column", sx: styles.group, paddingLeft: 1, paddingRight: 1, paddingBottom: 1, children: children && Object.values(children).map((fieldData) => {
|
|
33
|
+
var _a;
|
|
34
|
+
return /* @__PURE__ */ createElement(
|
|
35
|
+
RuleValueEditor,
|
|
36
|
+
{
|
|
37
|
+
...props,
|
|
38
|
+
key: fieldData.name,
|
|
39
|
+
field: fieldData.name,
|
|
40
|
+
fieldData,
|
|
41
|
+
rule: (_a = value == null ? void 0 : value.rules) == null ? void 0 : _a[fieldData.name],
|
|
42
|
+
handleOnChangeRule: generateOnChangeRuleHandler(fieldData.name)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}) });
|
|
59
46
|
}
|
|
60
47
|
export {
|
|
61
48
|
GroupValueEditor as default
|
package/dist/components/inputs/react-query-builder/composite-rule-editor/rule-value-editor.js
CHANGED
|
@@ -44,9 +44,7 @@ function RuleValueEditor(props) {
|
|
|
44
44
|
handleOnChangeOperator(event.target.value);
|
|
45
45
|
},
|
|
46
46
|
variant: "standard",
|
|
47
|
-
children: (_b = fieldData.operators) == null ? void 0 : _b.map(
|
|
48
|
-
(option) => /* @__PURE__ */ jsx(MenuItem, { value: option.name, children: intl.formatMessage({ id: option.label }) }, option.name)
|
|
49
|
-
)
|
|
47
|
+
children: (_b = fieldData.operators) == null ? void 0 : _b.map((option) => /* @__PURE__ */ jsx(MenuItem, { value: option.name, children: intl.formatMessage({ id: option.label }) }, option.name))
|
|
50
48
|
}
|
|
51
49
|
) }),
|
|
52
50
|
/* @__PURE__ */ jsx(Grid, { container: true, item: true, xs: 5.5, sx: styles.gridItem, paddingLeft: 1, children: /* @__PURE__ */ jsx(
|
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { Autocomplete, TextField } from "@mui/material";
|
|
4
|
-
import { useMemo } from "react";
|
|
5
|
-
import useConvertValue from "./use-convert-value.js";
|
|
6
|
-
import useValid from "./use-valid.js";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
7
3
|
import { useLocalizedCountries } from "../../../hooks/localized-countries-hook.js";
|
|
8
4
|
import useCustomFormContext from "../react-hook-form/provider/use-custom-form-context.js";
|
|
5
|
+
import { fetchFavoriteAndDefaultCountries } from "../../../services/apps-metadata.js";
|
|
6
|
+
import AutocompleteWithFavorites from "./autocomplete-with-favorites.js";
|
|
7
|
+
import useConvertValue from "./use-convert-value.js";
|
|
8
|
+
import useValid from "./use-valid.js";
|
|
9
9
|
function CountryValueEditor(props) {
|
|
10
|
+
const { value, handleOnChange } = props;
|
|
10
11
|
const { language } = useCustomFormContext();
|
|
11
12
|
const { translate, countryCodes } = useLocalizedCountries(language);
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const [favoriteCountryCodes, setFavoriteCountryCodes] = useState([]);
|
|
14
|
+
const [initialized, setInitialized] = useState(false);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!initialized) {
|
|
17
|
+
fetchFavoriteAndDefaultCountries().then(({ favoriteCountries, defaultCountry }) => {
|
|
18
|
+
setFavoriteCountryCodes(favoriteCountries);
|
|
19
|
+
if (defaultCountry && !value) {
|
|
20
|
+
handleOnChange(defaultCountry);
|
|
21
|
+
}
|
|
22
|
+
setInitialized(true);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}, [initialized, setInitialized, handleOnChange, value]);
|
|
19
26
|
useConvertValue(props);
|
|
20
27
|
const valid = useValid(props);
|
|
21
|
-
if (!Array.isArray(value)) {
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
23
|
-
MaterialValueEditor,
|
|
24
|
-
{
|
|
25
|
-
...props,
|
|
26
|
-
values: countriesList,
|
|
27
|
-
title: void 0
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
28
|
return /* @__PURE__ */ jsx(
|
|
32
|
-
|
|
29
|
+
AutocompleteWithFavorites,
|
|
33
30
|
{
|
|
34
31
|
value,
|
|
35
32
|
options: countryCodes,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
favorites: favoriteCountryCodes,
|
|
34
|
+
getOptionLabel: (code) => code ? translate(code) : "",
|
|
35
|
+
valid,
|
|
36
|
+
onChange: (event, newValue) => {
|
|
37
|
+
handleOnChange(newValue);
|
|
38
|
+
},
|
|
39
|
+
fullWidth: true
|
|
41
40
|
}
|
|
42
41
|
);
|
|
43
42
|
}
|
|
@@ -53,39 +53,33 @@ function CustomReactQueryBuilder(props) {
|
|
|
53
53
|
}));
|
|
54
54
|
}, [intl]);
|
|
55
55
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(QueryBuilderMaterial, { children: /* @__PURE__ */ jsx(
|
|
57
|
-
|
|
56
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(QueryBuilderMaterial, { children: /* @__PURE__ */ jsx(QueryBuilderDnD, { dnd: { ...ReactDnD, ...ReactDndHtml5Backend }, children: /* @__PURE__ */ jsx(
|
|
57
|
+
QueryBuilder,
|
|
58
58
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
fieldSelector: ValueSelector,
|
|
82
|
-
valueSourceSelector: ValueSelector
|
|
83
|
-
},
|
|
84
|
-
listsAsArrays: true
|
|
85
|
-
}
|
|
86
|
-
)
|
|
59
|
+
fields,
|
|
60
|
+
query,
|
|
61
|
+
addRuleToNewGroups: true,
|
|
62
|
+
combinators,
|
|
63
|
+
onQueryChange: handleQueryChange,
|
|
64
|
+
getOperators: (fieldName) => getOperators(fieldName, intl),
|
|
65
|
+
validator: queryValidator,
|
|
66
|
+
controlClassnames: {
|
|
67
|
+
queryBuilder: "queryBuilder-branches"
|
|
68
|
+
},
|
|
69
|
+
controlElements: {
|
|
70
|
+
addRuleAction: RuleAddButton,
|
|
71
|
+
addGroupAction: GroupAddButton,
|
|
72
|
+
combinatorSelector: CombinatorSelector,
|
|
73
|
+
removeRuleAction: RemoveButton,
|
|
74
|
+
removeGroupAction: RemoveButton,
|
|
75
|
+
valueEditor: ValueEditor,
|
|
76
|
+
operatorSelector: ValueSelector,
|
|
77
|
+
fieldSelector: ValueSelector,
|
|
78
|
+
valueSourceSelector: ValueSelector
|
|
79
|
+
},
|
|
80
|
+
listsAsArrays: true
|
|
87
81
|
}
|
|
88
|
-
) }) }),
|
|
82
|
+
) }) }) }),
|
|
89
83
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert }) })
|
|
90
84
|
] });
|
|
91
85
|
}
|
|
@@ -5,16 +5,7 @@ import useCustomFormContext from "../react-hook-form/provider/use-custom-form-co
|
|
|
5
5
|
import { fetchElementsInfos } from "../../../services/explore.js";
|
|
6
6
|
import DirectoryItemsInput from "../react-hook-form/directory-items-input.js";
|
|
7
7
|
function ElementValueEditor(props) {
|
|
8
|
-
const {
|
|
9
|
-
defaultValue,
|
|
10
|
-
name,
|
|
11
|
-
elementType,
|
|
12
|
-
equipmentTypes,
|
|
13
|
-
titleId,
|
|
14
|
-
hideErrorMessage,
|
|
15
|
-
itemFilter,
|
|
16
|
-
onChange
|
|
17
|
-
} = props;
|
|
8
|
+
const { defaultValue, name, elementType, equipmentTypes, titleId, hideErrorMessage, itemFilter, onChange } = props;
|
|
18
9
|
const { setValue } = useCustomFormContext();
|
|
19
10
|
useEffect(() => {
|
|
20
11
|
if (defaultValue && Array.isArray(defaultValue) && defaultValue.length > 0 && defaultValue[0].length > 0 && validate(defaultValue[0])) {
|
|
@@ -57,26 +57,20 @@ function PropertyValueEditor(props) {
|
|
|
57
57
|
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: !valid }),
|
|
58
58
|
onChange: (event, value) => {
|
|
59
59
|
onChange(FieldConstants.PROPERTY_NAME, value);
|
|
60
|
-
}
|
|
60
|
+
},
|
|
61
|
+
size: "small"
|
|
61
62
|
}
|
|
62
63
|
) }),
|
|
63
64
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2.5, children: /* @__PURE__ */ jsx(
|
|
64
65
|
Select,
|
|
65
66
|
{
|
|
66
67
|
value: propertyOperator ?? PROPERTY_VALUE_OPERATORS[0].customName,
|
|
67
|
-
size: "
|
|
68
|
+
size: "small",
|
|
68
69
|
error: !valid,
|
|
69
70
|
onChange: (event, value) => {
|
|
70
71
|
onChange(FieldConstants.PROPERTY_OPERATOR, value);
|
|
71
72
|
},
|
|
72
|
-
children: PROPERTY_VALUE_OPERATORS.map((operator) => /* @__PURE__ */ jsx(
|
|
73
|
-
MenuItem,
|
|
74
|
-
{
|
|
75
|
-
value: operator.customName,
|
|
76
|
-
children: intl.formatMessage({ id: operator.label })
|
|
77
|
-
},
|
|
78
|
-
operator.customName
|
|
79
|
-
))
|
|
73
|
+
children: PROPERTY_VALUE_OPERATORS.map((operator) => /* @__PURE__ */ jsx(MenuItem, { value: operator.customName, children: intl.formatMessage({ id: operator.label }) }, operator.customName))
|
|
80
74
|
}
|
|
81
75
|
) }),
|
|
82
76
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 4.5, children: /* @__PURE__ */ jsx(
|
|
@@ -90,7 +84,8 @@ function PropertyValueEditor(props) {
|
|
|
90
84
|
autoSelect: true,
|
|
91
85
|
onChange: (event, value) => {
|
|
92
86
|
onChange(FieldConstants.PROPERTY_VALUES, value);
|
|
93
|
-
}
|
|
87
|
+
},
|
|
88
|
+
size: "small"
|
|
94
89
|
}
|
|
95
90
|
) })
|
|
96
91
|
] });
|
|
@@ -13,15 +13,7 @@ function RemoveButton(props) {
|
|
|
13
13
|
onChange(recursiveRemove(query, path));
|
|
14
14
|
}
|
|
15
15
|
const isLastRuleOrGroup = path.toString() === [0].toString() && getNumberOfSiblings(path, query) === 1;
|
|
16
|
-
return /* @__PURE__ */ jsx(
|
|
17
|
-
IconButton,
|
|
18
|
-
{
|
|
19
|
-
size: "small",
|
|
20
|
-
onClick: () => handleDelete(),
|
|
21
|
-
className,
|
|
22
|
-
children: !isLastRuleOrGroup && /* @__PURE__ */ jsx(DeleteIcon, {})
|
|
23
|
-
}
|
|
24
|
-
);
|
|
16
|
+
return /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => handleDelete(), className, children: !isLastRuleOrGroup && /* @__PURE__ */ jsx(DeleteIcon, {}) });
|
|
25
17
|
}
|
|
26
18
|
export {
|
|
27
19
|
RemoveButton as default
|
|
@@ -25,7 +25,8 @@ function TextValueEditor(props) {
|
|
|
25
25
|
onChange: (event, newValue) => handleOnChange(newValue),
|
|
26
26
|
multiple: true,
|
|
27
27
|
fullWidth: true,
|
|
28
|
-
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: !valid })
|
|
28
|
+
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: !valid }),
|
|
29
|
+
size: "small"
|
|
29
30
|
}
|
|
30
31
|
);
|
|
31
32
|
}
|
|
@@ -20,9 +20,7 @@ function TranslatedValueEditor(props) {
|
|
|
20
20
|
if (!values) {
|
|
21
21
|
return {};
|
|
22
22
|
}
|
|
23
|
-
return Object.fromEntries(
|
|
24
|
-
values.map((v) => [v.name, intl.formatMessage({ id: v.label })])
|
|
25
|
-
);
|
|
23
|
+
return Object.fromEntries(values.map((v) => [v.name, intl.formatMessage({ id: v.label })]));
|
|
26
24
|
}, [intl, values]);
|
|
27
25
|
useConvertValue(props);
|
|
28
26
|
const valid = useValid(props);
|
|
@@ -45,7 +43,8 @@ function TranslatedValueEditor(props) {
|
|
|
45
43
|
onChange: (event, newValue) => handleOnChange(newValue),
|
|
46
44
|
multiple: true,
|
|
47
45
|
fullWidth: true,
|
|
48
|
-
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: !valid })
|
|
46
|
+
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: !valid }),
|
|
47
|
+
size: "small"
|
|
49
48
|
}
|
|
50
49
|
);
|
|
51
50
|
}
|
|
@@ -5,5 +5,5 @@ import { ValueEditorProps } from 'react-querybuilder';
|
|
|
5
5
|
* PS : can be extended to manage more than the IN operator
|
|
6
6
|
* PS 2 : don't use this if the operator can be another array operator (like BETWEEN) or change a bit the conditions
|
|
7
7
|
*/
|
|
8
|
-
declare const useConvertValue: ({ operator, value, fieldData: { defaultValue }, handleOnChange
|
|
8
|
+
declare const useConvertValue: ({ operator, value, fieldData: { defaultValue }, handleOnChange }: ValueEditorProps) => void;
|
|
9
9
|
export default useConvertValue;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { OPERATOR_OPTIONS } from "../../filter/expert/expert-filter-constants.js";
|
|
3
|
-
const useConvertValue = ({
|
|
4
|
-
operator,
|
|
5
|
-
value,
|
|
6
|
-
fieldData: { defaultValue },
|
|
7
|
-
handleOnChange
|
|
8
|
-
}) => {
|
|
3
|
+
const useConvertValue = ({ operator, value, fieldData: { defaultValue }, handleOnChange }) => {
|
|
9
4
|
useEffect(
|
|
10
5
|
() => {
|
|
11
6
|
if (operator === OPERATOR_OPTIONS.IN.name && !Array.isArray(value)) {
|
|
@@ -26,15 +26,7 @@ const styles = {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
function ValueEditor(props) {
|
|
29
|
-
const {
|
|
30
|
-
field,
|
|
31
|
-
operator,
|
|
32
|
-
value,
|
|
33
|
-
rule,
|
|
34
|
-
handleOnChange,
|
|
35
|
-
inputType,
|
|
36
|
-
fieldData
|
|
37
|
-
} = props;
|
|
29
|
+
const { field, operator, value, rule, handleOnChange, inputType, fieldData } = props;
|
|
38
30
|
const formContext = useFormContext();
|
|
39
31
|
const { getValues } = formContext;
|
|
40
32
|
const itemFilter = useCallback(
|
|
@@ -54,9 +46,7 @@ function ValueEditor(props) {
|
|
|
54
46
|
if (operator === OPERATOR_OPTIONS.EXISTS.name || operator === OPERATOR_OPTIONS.NOT_EXISTS.name) {
|
|
55
47
|
return null;
|
|
56
48
|
}
|
|
57
|
-
if ([FieldType.COUNTRY, FieldType.COUNTRY_1, FieldType.COUNTRY_2].includes(
|
|
58
|
-
field
|
|
59
|
-
)) {
|
|
49
|
+
if ([FieldType.COUNTRY, FieldType.COUNTRY_1, FieldType.COUNTRY_2].includes(field)) {
|
|
60
50
|
return /* @__PURE__ */ jsx(CountryValueEditor, { ...props });
|
|
61
51
|
}
|
|
62
52
|
if (fieldData.dataType === DataType.ENUM) {
|
|
@@ -85,7 +75,7 @@ function ValueEditor(props) {
|
|
|
85
75
|
}
|
|
86
76
|
);
|
|
87
77
|
}
|
|
88
|
-
if (
|
|
78
|
+
if (fieldData.dataType === DataType.STRING) {
|
|
89
79
|
return /* @__PURE__ */ jsx(TextValueEditor, { ...props });
|
|
90
80
|
}
|
|
91
81
|
if (fieldData.dataType === DataType.PROPERTY) {
|
|
@@ -97,13 +87,7 @@ function ValueEditor(props) {
|
|
|
97
87
|
} else {
|
|
98
88
|
equipmentType = getValues(FieldConstants.EQUIPMENT_TYPE);
|
|
99
89
|
}
|
|
100
|
-
return /* @__PURE__ */ jsx(
|
|
101
|
-
PropertyValueEditor,
|
|
102
|
-
{
|
|
103
|
-
equipmentType,
|
|
104
|
-
valueEditorProps: props
|
|
105
|
-
}
|
|
106
|
-
);
|
|
90
|
+
return /* @__PURE__ */ jsx(PropertyValueEditor, { equipmentType, valueEditorProps: props });
|
|
107
91
|
}
|
|
108
92
|
if (fieldData.dataType === DataType.COMBINATOR) {
|
|
109
93
|
return /* @__PURE__ */ jsx(GroupValueEditor, { ...props });
|
|
@@ -167,7 +167,9 @@ const filterExpertEn = {
|
|
|
167
167
|
shuntConductance1: "Shunt conductance 1 (μS)",
|
|
168
168
|
shuntSusceptance1: "Shunt susceptance 1 (μS)",
|
|
169
169
|
shuntConductance2: "Shunt conductance 2 (μS)",
|
|
170
|
-
shuntSusceptance2: "Shunt susceptance 2 (μS)"
|
|
170
|
+
shuntSusceptance2: "Shunt susceptance 2 (μS)",
|
|
171
|
+
pairingKey: "Xnode",
|
|
172
|
+
tieLineId: "Tie line ID"
|
|
171
173
|
};
|
|
172
174
|
export {
|
|
173
175
|
filterExpertEn as default
|
|
@@ -167,7 +167,9 @@ const filterExpertFr = {
|
|
|
167
167
|
shuntConductance1: "Conductance parallèle 1 (μS)",
|
|
168
168
|
shuntSusceptance1: "Susceptance parallèle 1 (μS)",
|
|
169
169
|
shuntConductance2: "Conductance parallèle 2 (μS)",
|
|
170
|
-
shuntSusceptance2: "Susceptance parallèle 2 (μS)"
|
|
170
|
+
shuntSusceptance2: "Susceptance parallèle 2 (μS)",
|
|
171
|
+
pairingKey: "Xnode",
|
|
172
|
+
tieLineId: "ID de l'interconnexion"
|
|
171
173
|
};
|
|
172
174
|
export {
|
|
173
175
|
filterExpertFr as default
|
|
@@ -21,9 +21,7 @@ const useLocalizedCountries = (language) => {
|
|
|
21
21
|
} else if (lang === "en") {
|
|
22
22
|
localizedCountriesResult = localizedCountries(countriesEn);
|
|
23
23
|
} else {
|
|
24
|
-
console.warn(
|
|
25
|
-
`Unsupported language "${lang}" for countries translation, we use english as default`
|
|
26
|
-
);
|
|
24
|
+
console.warn(`Unsupported language "${lang}" for countries translation, we use english as default`);
|
|
27
25
|
localizedCountriesResult = localizedCountries(countriesEn);
|
|
28
26
|
}
|
|
29
27
|
setLocalizedCountriesModule(localizedCountriesResult);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024, 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
|
+
declare const useConfidentialityWarning: () => string | undefined;
|
|
8
|
+
export default useConfidentialityWarning;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
import { fetchEnv } from "../services/apps-metadata.js";
|
|
3
|
+
const useConfidentialityWarning = () => {
|
|
4
|
+
const [confidentialityWarningKey, setConfidentialityWarningKey] = useState();
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
fetchEnv().then((res) => {
|
|
7
|
+
setConfidentialityWarningKey(res == null ? void 0 : res.confidentialityMessageKey);
|
|
8
|
+
});
|
|
9
|
+
}, []);
|
|
10
|
+
return confidentialityWarningKey;
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
useConfidentialityWarning as default
|
|
14
|
+
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { useMemo, useEffect } from "react";
|
|
2
2
|
import { debounce } from "@mui/material";
|
|
3
3
|
const useDebounce = (func, delay = 700) => {
|
|
4
|
-
const debouncedChangeHandler = useMemo(
|
|
5
|
-
() => debounce(func, delay),
|
|
6
|
-
[func, delay]
|
|
7
|
-
);
|
|
4
|
+
const debouncedChangeHandler = useMemo(() => debounce(func, delay), [func, delay]);
|
|
8
5
|
useEffect(() => {
|
|
9
6
|
return () => {
|
|
10
7
|
debouncedChangeHandler.clear();
|
|
@@ -57,18 +57,9 @@ function useSnackMessage() {
|
|
|
57
57
|
},
|
|
58
58
|
[enqueueSnackbar, intlRef]
|
|
59
59
|
);
|
|
60
|
-
const snackError = useCallback(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
64
|
-
const snackWarning = useCallback(
|
|
65
|
-
(snackInputs) => enqueue(snackInputs, "warning"),
|
|
66
|
-
[enqueue]
|
|
67
|
-
);
|
|
68
|
-
const snackInfo = useCallback(
|
|
69
|
-
(snackInputs) => enqueue(snackInputs, "info"),
|
|
70
|
-
[enqueue]
|
|
71
|
-
);
|
|
60
|
+
const snackError = useCallback((snackInputs) => enqueue(snackInputs, "error"), [enqueue]);
|
|
61
|
+
const snackWarning = useCallback((snackInputs) => enqueue(snackInputs, "warning"), [enqueue]);
|
|
62
|
+
const snackInfo = useCallback((snackInputs) => enqueue(snackInputs, "info"), [enqueue]);
|
|
72
63
|
return { snackError, snackInfo, snackWarning, closeSnackbar };
|
|
73
64
|
}
|
|
74
65
|
export {
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { default as SnackbarProvider } from './components/SnackbarProvider';
|
|
|
12
12
|
export { default as AuthenticationRouter } from './components/AuthenticationRouter';
|
|
13
13
|
export type { AuthenticationRouterErrorState, AuthenticationRouterProps, UserManagerState, } from './components/AuthenticationRouter';
|
|
14
14
|
export { MuiVirtualizedTable } from './components/MuiVirtualizedTable';
|
|
15
|
-
export { KeyedColumnsRowIndexer, ChangeWays
|
|
15
|
+
export { KeyedColumnsRowIndexer, ChangeWays } from './components/MuiVirtualizedTable';
|
|
16
16
|
export { default as ReportViewer } from './components/ReportViewer';
|
|
17
17
|
export { default as ReportViewerDialog } from './components/ReportViewerDialog';
|
|
18
18
|
export { default as OverflowableText } from './components/OverflowableText';
|
|
@@ -34,19 +34,19 @@ export { default as FieldConstants } from './utils/field-constants';
|
|
|
34
34
|
export { fields as EXPERT_FILTER_FIELDS } from './components/filter/expert/expert-filter-constants';
|
|
35
35
|
export { default as CustomReactQueryBuilder } from './components/inputs/react-query-builder/custom-react-query-builder';
|
|
36
36
|
export { EXPERT_FILTER_QUERY, rqbQuerySchemaValidator, getExpertFilterEmptyFormData, } from './components/filter/expert/expert-filter-form';
|
|
37
|
-
export { importExpertRules, exportExpertRules
|
|
38
|
-
export type { RuleTypeExport, RuleGroupTypeExport
|
|
37
|
+
export { importExpertRules, exportExpertRules } from './components/filter/expert/expert-filter-utils';
|
|
38
|
+
export type { RuleTypeExport, RuleGroupTypeExport } from './components/filter/expert/expert-filter.type';
|
|
39
39
|
export { formatQuery } from 'react-querybuilder';
|
|
40
40
|
export { default as yup } from './utils/yup-config';
|
|
41
41
|
export type { TreeViewFinderNodeProps } from './components/TreeViewFinder/TreeViewFinder';
|
|
42
42
|
export { GRIDSUITE_DEFAULT_PRECISION, roundToPrecision, roundToDefaultPrecision, isBlankOrEmpty, unitToMicroUnit, microUnitToUnit, } from './utils/conversion-utils';
|
|
43
43
|
export { ElementType } from './utils/ElementType';
|
|
44
44
|
export type { ElementAttributes, Option, Equipment } from './utils/types';
|
|
45
|
-
export { EQUIPMENT_TYPE, EquipmentType, getEquipmentsInfosForSearchBar, equipmentStyles
|
|
45
|
+
export { EQUIPMENT_TYPE, EquipmentType, getEquipmentsInfosForSearchBar, equipmentStyles } from './utils/EquipmentType';
|
|
46
46
|
export { initializeAuthenticationDev, initializeAuthenticationProd, logout, dispatchUser, getPreLoginPath, } from './utils/AuthService';
|
|
47
47
|
export { default as getFileIcon } from './utils/ElementIcon';
|
|
48
48
|
export { DEFAULT_CELL_PADDING, DEFAULT_HEADER_HEIGHT, DEFAULT_ROW_HEIGHT, } from './components/MuiVirtualizedTable/MuiVirtualizedTable';
|
|
49
|
-
export { DARK_THEME, LIGHT_THEME, LANG_SYSTEM, LANG_ENGLISH, LANG_FRENCH
|
|
49
|
+
export { DARK_THEME, LIGHT_THEME, LANG_SYSTEM, LANG_ENGLISH, LANG_FRENCH } from './components/TopBar/TopBar';
|
|
50
50
|
export type { GsLang, GsLangUser, GsTheme } from './components/TopBar/TopBar';
|
|
51
51
|
export { USER, setLoggedUser, SIGNIN_CALLBACK_ERROR, setSignInCallbackError, UNAUTHORIZED_USER_INFO, LOGOUT_ERROR, USER_VALIDATION_ERROR, RESET_AUTHENTICATION_ROUTER_ERROR, SHOW_AUTH_INFO_LOGIN, } from './redux/authActions';
|
|
52
52
|
export type { AuthenticationActions, AuthenticationRouterErrorBase, AuthenticationRouterErrorAction, LogoutErrorAction, ShowAuthenticationRouterLoginAction, SignInCallbackErrorAction, UnauthorizedUserAction, UserAction, UserValidationErrorAction, } from './redux/authActions';
|
|
@@ -78,7 +78,7 @@ export { default as common_button_en } from './components/translations/common-bu
|
|
|
78
78
|
export { default as common_button_fr } from './components/translations/common-button-fr';
|
|
79
79
|
export { default as directory_items_input_en } from './components/translations/directory-items-input-en';
|
|
80
80
|
export { default as directory_items_input_fr } from './components/translations/directory-items-input-fr';
|
|
81
|
-
export { TagRenderer, ElementSearchInput, useElementSearch
|
|
81
|
+
export { TagRenderer, ElementSearchInput, useElementSearch } from './components/ElementSearchDialog';
|
|
82
82
|
export type { Paginated } from './components/ElementSearchDialog';
|
|
83
83
|
export type { TagRendererProps } from './components/ElementSearchDialog';
|
|
84
84
|
export { EquipmentItem } from './components/ElementSearchDialog/equipment-item';
|
|
@@ -87,6 +87,7 @@ export { default as useIntlRef } from './hooks/useIntlRef';
|
|
|
87
87
|
export { useSnackMessage } from './hooks/useSnackMessage';
|
|
88
88
|
export { default as useDebounce } from './hooks/useDebounce';
|
|
89
89
|
export { default as usePrevious } from './hooks/usePrevious';
|
|
90
|
+
export { default as useConfidentialityWarning } from './hooks/useConfidentialityWarning';
|
|
90
91
|
export { default as SelectClearable } from './components/inputs/select-clearable';
|
|
91
92
|
export { default as useCustomFormContext } from './components/inputs/react-hook-form/provider/use-custom-form-context';
|
|
92
93
|
export { default as CustomFormProvider } from './components/inputs/react-hook-form/provider/custom-form-provider';
|
|
@@ -108,7 +109,7 @@ export { default as FieldLabel } from './components/inputs/react-hook-form/utils
|
|
|
108
109
|
export { default as SubmitButton } from './components/inputs/react-hook-form/utils/submit-button';
|
|
109
110
|
export { default as CancelButton } from './components/inputs/react-hook-form/utils/cancel-button';
|
|
110
111
|
export { genHelperPreviousValue, genHelperError, identity, isFieldRequired, gridItem, isFloatNumber, toFloatOrNullValue, } from './components/inputs/react-hook-form/utils/functions';
|
|
111
|
-
export { keyGenerator, areArrayElementsUnique, isObjectEmpty
|
|
112
|
+
export { keyGenerator, areArrayElementsUnique, isObjectEmpty } from './utils/functions';
|
|
112
113
|
export { default as DirectoryItemsInput } from './components/inputs/react-hook-form/directory-items-input';
|
|
113
114
|
export { default as DirectoryItemSelector } from './components/DirectoryItemSelector/directory-item-selector';
|
|
114
115
|
export { default as CustomAGGrid } from './components/CustomAGGrid/custom-aggrid';
|
|
@@ -122,12 +123,12 @@ export { default as RangeInput, DEFAULT_RANGE_VALUE, getRangeInputDataForm, getR
|
|
|
122
123
|
export { default as InputWithPopupConfirmation } from './components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation';
|
|
123
124
|
export { default as MuiSelectInput } from './components/inputs/react-hook-form/select-inputs/mui-select-input';
|
|
124
125
|
export { default as CountriesInput } from './components/inputs/react-hook-form/select-inputs/countries-input';
|
|
125
|
-
export { getSystemLanguage, getComputedLanguage, useLocalizedCountries
|
|
126
|
+
export { getSystemLanguage, getComputedLanguage, useLocalizedCountries } from './hooks/localized-countries-hook';
|
|
126
127
|
export { default as MultipleAutocompleteInput } from './components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input';
|
|
127
128
|
export { default as CsvUploader } from './components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader';
|
|
128
129
|
export { default as UniqueNameInput } from './components/inputs/react-hook-form/unique-name-input';
|
|
129
130
|
export { default as UserManagerMock } from './utils/UserManagerMock';
|
|
130
|
-
export { FILTER_EQUIPMENTS, CONTINGENCY_LIST_EQUIPMENTS
|
|
131
|
+
export { FILTER_EQUIPMENTS, CONTINGENCY_LIST_EQUIPMENTS } from './components/filter/utils/filter-form-utils';
|
|
131
132
|
export type { FormEquipment } from './components/filter/utils/filter-form-utils';
|
|
132
133
|
export { getCriteriaBasedFormData, getCriteriaBasedSchema, } from './components/filter/criteria-based/criteria-based-filter-utils';
|
|
133
134
|
export { mergeSx } from './utils/styles';
|