@gridsuite/commons-ui 0.58.0 → 0.59.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/chunks/{criteria-based-filter-edition-dialog.CbhgOSRk.js → criteria-based-filter-edition-dialog.DcXcQOoT.js} +21 -65
- package/dist/components/AuthenticationRouter/AuthenticationRouter.d.ts +28 -9
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +1 -1
- package/dist/components/AuthenticationRouter/index.d.ts +6 -0
- package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +27 -13
- package/dist/components/CardErrorBoundary/card-error-boundary.js +7 -6
- package/dist/components/CardErrorBoundary/index.d.ts +6 -0
- package/dist/components/CustomAGGrid/custom-aggrid.d.ts +11 -0
- package/dist/components/CustomAGGrid/custom-aggrid.js +73 -0
- package/dist/components/CustomAGGrid/custom-aggrid.style.d.ts +20 -0
- package/dist/components/CustomAGGrid/custom-aggrid.style.js +47 -0
- package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +0 -4
- package/dist/components/DirectoryItemSelector/directory-item-selector.js +13 -26
- package/dist/components/ElementSearchDialog/equipment-item.d.ts +25 -16
- package/dist/components/ElementSearchDialog/equipment-item.js +5 -5
- package/dist/components/ElementSearchDialog/index.d.ts +6 -0
- package/dist/components/ElementSearchDialog/tag-renderer.d.ts +20 -10
- package/dist/components/ElementSearchDialog/tag-renderer.js +6 -11
- package/dist/components/FlatParameters/FlatParameters.d.ts +29 -9
- package/dist/components/FlatParameters/FlatParameters.js +3 -3
- package/dist/components/FlatParameters/index.d.ts +6 -0
- package/dist/components/Login/Login.d.ts +11 -4
- package/dist/components/Login/Logout.d.ts +11 -4
- package/dist/components/Login/index.d.ts +6 -0
- package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +25 -2
- package/dist/components/MuiVirtualizedTable/ColumnHeader.js +68 -59
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +72 -61
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +69 -83
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +93 -113
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +84 -106
- package/dist/components/MuiVirtualizedTable/index.d.ts +7 -1
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +16 -9
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +1 -1
- package/dist/components/MultipleSelectionDialog/index.d.ts +6 -0
- package/dist/components/OverflowableText/index.d.ts +6 -0
- package/dist/components/OverflowableText/overflowable-text.d.ts +11 -1
- package/dist/components/OverflowableText/overflowable-text.js +1 -18
- package/dist/components/ReportViewer/filter-button.d.ts +11 -1
- package/dist/components/ReportViewer/filter-button.js +5 -2
- package/dist/components/ReportViewer/index.d.ts +6 -0
- package/dist/components/ReportViewer/log-report-item.d.ts +14 -64
- package/dist/components/ReportViewer/log-report-item.js +13 -47
- package/dist/components/ReportViewer/log-report.d.ts +16 -17
- package/dist/components/ReportViewer/log-report.js +2 -1
- package/dist/components/ReportViewer/log-severity.d.ts +13 -0
- package/dist/components/ReportViewer/log-severity.js +35 -0
- package/dist/components/ReportViewer/log-table.d.ts +9 -6
- package/dist/components/ReportViewer/log-table.js +6 -4
- package/dist/components/ReportViewer/multi-select-list.d.ts +17 -1
- package/dist/components/ReportViewer/report-item.d.ts +12 -12
- package/dist/components/ReportViewer/report-item.js +0 -7
- package/dist/components/ReportViewer/report-tree-view-context.d.ts +11 -1
- package/dist/components/ReportViewer/report-viewer.d.ts +7 -4
- package/dist/components/ReportViewer/report-viewer.js +8 -6
- package/dist/components/ReportViewer/report.type.d.ts +22 -0
- package/dist/components/ReportViewer/report.type.js +1 -0
- package/dist/components/ReportViewerDialog/index.d.ts +6 -0
- package/dist/components/ReportViewerDialog/report-viewer-dialog.d.ts +9 -1
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +7 -4
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +4 -1
- package/dist/components/SignInCallbackHandler/index.d.ts +6 -0
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +7 -4
- package/dist/components/SilentRenewCallbackHandler/index.d.ts +6 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +3 -1
- package/dist/components/SnackbarProvider/SnackbarProvider.js +9 -7
- package/dist/components/SnackbarProvider/index.d.ts +6 -0
- package/dist/components/TopBar/AboutDialog.d.ts +30 -23
- package/dist/components/TopBar/AboutDialog.js +4 -22
- package/dist/components/TopBar/GridLogo.d.ts +13 -32
- package/dist/components/TopBar/GridLogo.js +12 -15
- package/dist/components/TopBar/TopBar.d.ts +52 -51
- package/dist/components/TopBar/TopBar.js +389 -380
- package/dist/components/TopBar/TopBar.test.d.ts +6 -0
- package/dist/components/TopBar/index.d.ts +6 -0
- package/dist/components/dialogs/modify-element-selection.d.ts +1 -1
- package/dist/components/dialogs/modify-element-selection.js +5 -14
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.d.ts +1 -1
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +1 -1
- package/dist/components/filter/criteria-based/filter-free-properties.d.ts +1 -1
- package/dist/components/filter/criteria-based/filter-property.d.ts +1 -1
- package/dist/components/filter/expert/expert-filter-constants.d.ts +22 -1
- package/dist/components/filter/expert/expert-filter-constants.js +39 -10
- package/dist/components/filter/expert/expert-filter-edition-dialog.d.ts +0 -6
- package/dist/components/filter/expert/expert-filter-edition-dialog.js +1 -2
- package/dist/components/filter/expert/expert-filter-form.js +1 -1
- package/dist/components/filter/expert/expert-filter.type.d.ts +4 -1
- package/dist/components/filter/expert/expert-filter.type.js +3 -0
- package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +1 -1
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +1 -1
- package/dist/components/filter/filter-creation-dialog.d.ts +0 -7
- package/dist/components/filter/filter-creation-dialog.js +1 -2
- package/dist/components/filter/filter-form.js +1 -1
- package/dist/components/filter/utils/filter-form-utils.d.ts +3 -2
- package/dist/components/filter/utils/filter-form-utils.js +42 -28
- package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +1 -1
- package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +6 -13
- package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +1 -1
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/booleans/boolean-input.d.ts +9 -15
- package/dist/components/inputs/react-hook-form/booleans/boolean-input.js +0 -7
- package/dist/components/inputs/react-hook-form/booleans/checkbox-input.d.ts +8 -13
- package/dist/components/inputs/react-hook-form/booleans/checkbox-input.js +0 -6
- package/dist/components/inputs/react-hook-form/booleans/switch-input.d.ts +8 -13
- package/dist/components/inputs/react-hook-form/booleans/switch-input.js +0 -6
- package/dist/components/inputs/react-hook-form/directory-items-input.d.ts +0 -2
- package/dist/components/inputs/react-hook-form/directory-items-input.js +10 -14
- package/dist/components/inputs/react-hook-form/error-management/mid-form-error.d.ts +5 -3
- package/dist/components/inputs/react-hook-form/numbers/integer-input.d.ts +3 -20
- package/dist/components/inputs/react-hook-form/numbers/integer-input.js +1 -4
- package/dist/components/inputs/react-hook-form/range-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/select-inputs/countries-input.js +12 -1
- package/dist/components/inputs/react-hook-form/select-inputs/select-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/slider-input.d.ts +7 -20
- package/dist/components/inputs/react-hook-form/slider-input.js +4 -12
- package/dist/components/inputs/react-hook-form/text-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/unique-name-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +1 -1
- package/dist/components/inputs/react-query-builder/element-value-editor.js +8 -14
- package/dist/components/inputs/react-query-builder/remove-button.js +1 -1
- package/dist/components/inputs/react-query-builder/value-editor.js +1 -1
- package/dist/components/translations/card-error-boundary-en.d.ts +1 -1
- package/dist/components/translations/card-error-boundary-fr.d.ts +1 -1
- package/dist/components/translations/common-button-en.d.ts +10 -4
- package/dist/components/translations/common-button-fr.d.ts +10 -4
- package/dist/components/translations/directory-items-input-en.d.ts +1 -1
- package/dist/components/translations/directory-items-input-fr.d.ts +1 -1
- package/dist/components/translations/element-search-en.d.ts +1 -1
- package/dist/components/translations/element-search-fr.d.ts +1 -1
- package/dist/components/translations/equipment-search-en.d.ts +1 -1
- package/dist/components/translations/equipment-search-fr.d.ts +1 -1
- package/dist/components/translations/filter-en.d.ts +27 -21
- package/dist/components/translations/filter-en.js +2 -1
- package/dist/components/translations/filter-expert-en.d.ts +73 -0
- package/dist/components/translations/filter-expert-en.js +69 -0
- package/dist/components/translations/filter-expert-fr.d.ts +73 -0
- package/dist/components/translations/filter-expert-fr.js +69 -0
- package/dist/components/translations/filter-fr.d.ts +27 -21
- package/dist/components/translations/filter-fr.js +2 -1
- package/dist/components/translations/flat-parameters-en.d.ts +1 -1
- package/dist/components/translations/flat-parameters-fr.d.ts +1 -1
- package/dist/components/translations/inputs-en.d.ts +1 -1
- package/dist/components/translations/inputs-fr.d.ts +1 -1
- package/dist/components/translations/login-en.d.ts +1 -1
- package/dist/components/translations/login-fr.d.ts +1 -1
- package/dist/components/translations/multiple-selection-dialog-en.d.ts +1 -1
- package/dist/components/translations/multiple-selection-dialog-fr.d.ts +1 -1
- package/dist/components/translations/report-viewer-en.d.ts +1 -1
- package/dist/components/translations/report-viewer-fr.d.ts +1 -1
- package/dist/components/translations/table-en.d.ts +1 -1
- package/dist/components/translations/table-fr.d.ts +1 -1
- package/dist/components/translations/top-bar-en.d.ts +1 -1
- package/dist/components/translations/top-bar-fr.d.ts +1 -1
- package/dist/components/translations/treeview-finder-en.d.ts +1 -1
- package/dist/components/translations/treeview-finder-fr.d.ts +1 -1
- package/dist/hooks/localized-countries-hook.d.ts +10 -4
- package/dist/hooks/localized-countries-hook.js +1 -1
- package/dist/hooks/predefined-properties-hook.d.ts +1 -15
- package/dist/hooks/predefined-properties-hook.js +8 -16
- package/dist/index.d.ts +65 -217
- package/dist/index.js +104 -77
- package/dist/module-mui.d.js +1 -0
- package/dist/redux/actions.d.ts +33 -29
- package/dist/services/apps-metadata.d.ts +32 -0
- package/dist/services/apps-metadata.js +26 -0
- package/dist/services/directory.d.ts +6 -0
- package/dist/services/directory.js +42 -0
- package/dist/services/explore.d.ts +2 -0
- package/dist/services/explore.js +29 -1
- package/dist/services/index.d.ts +16 -0
- package/dist/services/index.js +20 -0
- package/dist/services/utils.d.ts +1 -0
- package/dist/services/utils.js +5 -1
- package/dist/utils/AuthService.d.ts +20 -9
- package/dist/utils/AuthService.js +29 -13
- package/dist/utils/ElementIcon.d.ts +4 -1
- package/dist/utils/EquipmentType.d.ts +13 -9
- package/dist/utils/EquipmentType.js +9 -9
- package/dist/utils/UserManagerMock.d.ts +14 -14
- package/dist/utils/UserManagerMock.js +9 -15
- package/dist/utils/algos.d.ts +1 -1
- package/dist/utils/equipment-types-for-predefined-properties-mapper.d.ts +1 -1
- package/dist/utils/functions.d.ts +0 -1
- package/dist/utils/functions.js +1 -3
- package/dist/utils/styles.d.ts +5 -3
- package/dist/utils/styles.js +4 -1
- package/dist/utils/types.d.ts +13 -3
- package/package.json +2 -1
- package/dist/components/filter/filter-context.d.ts +0 -13
- package/dist/components/filter/filter-context.js +0 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../assets/criteria-based-filter-edition-dialog.css';
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
-
import React, { useState, useMemo, useEffect, useCallback
|
|
3
|
+
import React, { useState, useMemo, useEffect, useCallback } from "react";
|
|
4
4
|
import { FieldConstants } from "../utils/field-constants.js";
|
|
5
5
|
import { backToFrontTweak, frontToBackTweak } from "../components/filter/criteria-based/criteria-based-filter-utils.js";
|
|
6
6
|
import CustomMuiDialog from "../components/dialogs/custom-mui-dialog.js";
|
|
@@ -30,9 +30,8 @@ import CsvDownloader from "react-csv-downloader";
|
|
|
30
30
|
import Alert from "@mui/material/Alert";
|
|
31
31
|
import "../components/TreeViewFinder/TreeViewFinder.js";
|
|
32
32
|
import "../components/TopBar/TopBar.js";
|
|
33
|
-
import "
|
|
34
|
-
import "
|
|
35
|
-
import "../components/SnackbarProvider/SnackbarProvider.js";
|
|
33
|
+
import "@mui/lab";
|
|
34
|
+
import "notistack";
|
|
36
35
|
import "react-router-dom";
|
|
37
36
|
import "../utils/AuthService.js";
|
|
38
37
|
import "../components/MuiVirtualizedTable/MuiVirtualizedTable.js";
|
|
@@ -42,24 +41,18 @@ import "../components/ReportViewer/log-table.js";
|
|
|
42
41
|
import "../components/ReportViewer/report-tree-view-context.js";
|
|
43
42
|
import "@mui/x-tree-view";
|
|
44
43
|
import "../components/OverflowableText/overflowable-text.js";
|
|
45
|
-
import "
|
|
44
|
+
import "clsx";
|
|
46
45
|
import "../components/inputs/react-hook-form/utils/submit-button.js";
|
|
47
46
|
import CancelButton from "../components/inputs/react-hook-form/utils/cancel-button.js";
|
|
48
47
|
import "../components/inputs/react-hook-form/provider/custom-form-provider.js";
|
|
49
48
|
import "../components/dialogs/description-modification-dialog.js";
|
|
50
|
-
import { FilterContext } from "../components/filter/filter-context.js";
|
|
51
|
-
import "notistack";
|
|
52
49
|
import * as yup from "yup";
|
|
53
50
|
import "../components/dialogs/popup-confirmation-dialog.js";
|
|
54
51
|
import "autosuggest-highlight/match";
|
|
55
52
|
import "autosuggest-highlight/parse";
|
|
56
|
-
import "clsx";
|
|
57
53
|
import "../components/CardErrorBoundary/card-error-boundary.js";
|
|
58
|
-
import "../components/inputs/react-hook-form/slider-input.js";
|
|
59
|
-
import "../components/inputs/react-hook-form/numbers/integer-input.js";
|
|
60
|
-
import "../components/inputs/react-hook-form/booleans/checkbox-input.js";
|
|
61
|
-
import "../components/inputs/react-hook-form/booleans/switch-input.js";
|
|
62
54
|
import "@mui/icons-material/Folder";
|
|
55
|
+
import "../components/CustomAGGrid/custom-aggrid.js";
|
|
63
56
|
import { saveExplicitNamingFilter, saveCriteriaBasedFilter, saveExpertFilter } from "../components/filter/utils/filter-api.js";
|
|
64
57
|
import { formatQuery, QueryBuilder } from "react-querybuilder";
|
|
65
58
|
import { getNumberOfSiblings, recursiveRemove, countRules, getOperators, queryValidator, testQuery, importExpertRules } from "../components/filter/expert/expert-filter-utils.js";
|
|
@@ -76,12 +69,12 @@ import TranslatedValueEditor from "../components/inputs/react-query-builder/tran
|
|
|
76
69
|
import TextValueEditor from "../components/inputs/react-query-builder/text-value-editor.js";
|
|
77
70
|
import Box from "@mui/material/Box";
|
|
78
71
|
import { Generator, Load, VoltageLevel, Substation, noSelectionForCopy as noSelectionForCopy$1 } from "../utils/equipment-types.js";
|
|
72
|
+
import { fetchElementsInfos, saveFilter } from "../services/explore.js";
|
|
79
73
|
import { useCustomFormContext } from "../components/inputs/react-hook-form/provider/use-custom-form-context.js";
|
|
80
74
|
import DirectoryItemsInput from "../components/inputs/react-hook-form/directory-items-input.js";
|
|
81
75
|
import { DISTRIBUTION_KEY, FilterType } from "../components/filter/constants/filter-constants.js";
|
|
82
76
|
import { FetchStatus } from "../utils/FetchStatus.js";
|
|
83
77
|
import PropTypes from "prop-types";
|
|
84
|
-
import { saveFilter } from "../services/explore.js";
|
|
85
78
|
import "./filter-properties.B7-q_yPf.js";
|
|
86
79
|
import "../components/inputs/react-hook-form/range-input.js";
|
|
87
80
|
import "../components/inputs/react-hook-form/select-inputs/mui-select-input.js";
|
|
@@ -833,10 +826,9 @@ const RemoveButton = (props) => {
|
|
|
833
826
|
};
|
|
834
827
|
const ElementValueEditor = (props) => {
|
|
835
828
|
const { setValue } = useCustomFormContext();
|
|
836
|
-
const { fetchElementsInfos } = useContext(FilterContext);
|
|
837
829
|
useEffect(() => {
|
|
838
830
|
if (props.defaultValue && Array.isArray(props.defaultValue) && props.defaultValue.length > 0 && props.defaultValue[0].length > 0 && validate(props.defaultValue[0])) {
|
|
839
|
-
fetchElementsInfos
|
|
831
|
+
fetchElementsInfos(props.defaultValue).then(
|
|
840
832
|
(childrenWithMetadata) => {
|
|
841
833
|
setValue(
|
|
842
834
|
props.name,
|
|
@@ -851,13 +843,7 @@ const ElementValueEditor = (props) => {
|
|
|
851
843
|
}
|
|
852
844
|
);
|
|
853
845
|
}
|
|
854
|
-
}, [
|
|
855
|
-
props.name,
|
|
856
|
-
props.defaultValue,
|
|
857
|
-
props.elementType,
|
|
858
|
-
setValue,
|
|
859
|
-
fetchElementsInfos
|
|
860
|
-
]);
|
|
846
|
+
}, [props.name, props.defaultValue, props.elementType, setValue]);
|
|
861
847
|
return /* @__PURE__ */ jsx(
|
|
862
848
|
DirectoryItemsInput,
|
|
863
849
|
{
|
|
@@ -935,10 +921,12 @@ const ValueEditor = (props) => {
|
|
|
935
921
|
);
|
|
936
922
|
} else if (props.field === FieldType.ID || props.field === FieldType.NAME || props.field === FieldType.VOLTAGE_LEVEL_ID || props.field === FieldType.VOLTAGE_LEVEL_ID_1 || props.field === FieldType.VOLTAGE_LEVEL_ID_2) {
|
|
937
923
|
return /* @__PURE__ */ jsx(TextValueEditor, { ...props });
|
|
938
|
-
} else if (props.field === FieldType.PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY_1 || props.field === FieldType.SUBSTATION_PROPERTY_2) {
|
|
924
|
+
} else if (props.field === FieldType.PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY_1 || props.field === FieldType.SUBSTATION_PROPERTY_2 || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_1 || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_2) {
|
|
939
925
|
let equipmentType;
|
|
940
926
|
if (props.field === FieldType.SUBSTATION_PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY_1 || props.field === FieldType.SUBSTATION_PROPERTY_2) {
|
|
941
927
|
equipmentType = Substation.type;
|
|
928
|
+
} else if (props.field === FieldType.VOLTAGE_LEVEL_PROPERTY || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_1 || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_2) {
|
|
929
|
+
equipmentType = VoltageLevel.type;
|
|
942
930
|
} else {
|
|
943
931
|
equipmentType = getValues(FieldConstants.EQUIPMENT_TYPE);
|
|
944
932
|
}
|
|
@@ -1218,13 +1206,8 @@ const FilterCreationDialog = ({
|
|
|
1218
1206
|
open,
|
|
1219
1207
|
onClose,
|
|
1220
1208
|
activeDirectory,
|
|
1221
|
-
fetchAppsAndUrls,
|
|
1222
1209
|
elementExists,
|
|
1223
1210
|
language,
|
|
1224
|
-
fetchDirectoryContent,
|
|
1225
|
-
fetchRootFolders,
|
|
1226
|
-
fetchElementsInfos,
|
|
1227
|
-
fetchPath,
|
|
1228
1211
|
sourceFilterForExplicitNamingConversion = void 0
|
|
1229
1212
|
}) => {
|
|
1230
1213
|
var _a;
|
|
@@ -1300,24 +1283,12 @@ const FilterCreationDialog = ({
|
|
|
1300
1283
|
disabledSave: !!nameError || !!isValidating,
|
|
1301
1284
|
language,
|
|
1302
1285
|
children: /* @__PURE__ */ jsx(
|
|
1303
|
-
|
|
1286
|
+
FilterForm,
|
|
1304
1287
|
{
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
fetchAppsAndUrls,
|
|
1310
|
-
fetchPath
|
|
1311
|
-
},
|
|
1312
|
-
children: /* @__PURE__ */ jsx(
|
|
1313
|
-
FilterForm,
|
|
1314
|
-
{
|
|
1315
|
-
creation: true,
|
|
1316
|
-
activeDirectory,
|
|
1317
|
-
elementExists,
|
|
1318
|
-
sourceFilterForExplicitNamingConversion
|
|
1319
|
-
}
|
|
1320
|
-
)
|
|
1288
|
+
creation: true,
|
|
1289
|
+
activeDirectory,
|
|
1290
|
+
elementExists,
|
|
1291
|
+
sourceFilterForExplicitNamingConversion
|
|
1321
1292
|
}
|
|
1322
1293
|
)
|
|
1323
1294
|
}
|
|
@@ -1341,11 +1312,7 @@ const ExpertFilterEditionDialog = ({
|
|
|
1341
1312
|
setSelectionForCopy,
|
|
1342
1313
|
activeDirectory,
|
|
1343
1314
|
elementExists,
|
|
1344
|
-
language
|
|
1345
|
-
fetchDirectoryContent,
|
|
1346
|
-
fetchRootFolders,
|
|
1347
|
-
fetchElementsInfos,
|
|
1348
|
-
fetchAppsAndUrls
|
|
1315
|
+
language
|
|
1349
1316
|
}) => {
|
|
1350
1317
|
var _a;
|
|
1351
1318
|
const { snackError } = useSnackMessage();
|
|
@@ -1429,22 +1396,11 @@ const ExpertFilterEditionDialog = ({
|
|
|
1429
1396
|
disabledSave: !!nameError || !!isValidating,
|
|
1430
1397
|
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
1431
1398
|
language,
|
|
1432
|
-
children: /* @__PURE__ */ jsx(
|
|
1433
|
-
|
|
1399
|
+
children: isDataReady && /* @__PURE__ */ jsx(
|
|
1400
|
+
FilterForm,
|
|
1434
1401
|
{
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
fetchRootFolders,
|
|
1438
|
-
fetchElementsInfos,
|
|
1439
|
-
fetchAppsAndUrls
|
|
1440
|
-
},
|
|
1441
|
-
children: isDataReady && /* @__PURE__ */ jsx(
|
|
1442
|
-
FilterForm,
|
|
1443
|
-
{
|
|
1444
|
-
activeDirectory,
|
|
1445
|
-
elementExists
|
|
1446
|
-
}
|
|
1447
|
-
)
|
|
1402
|
+
activeDirectory,
|
|
1403
|
+
elementExists
|
|
1448
1404
|
}
|
|
1449
1405
|
)
|
|
1450
1406
|
}
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
+
import { UserManager } from 'oidc-client';
|
|
2
|
+
import { Dispatch } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface AuthenticationRouterProps {
|
|
5
|
+
userManager: {
|
|
6
|
+
instance: UserManager;
|
|
7
|
+
error: string;
|
|
8
|
+
};
|
|
9
|
+
signInCallbackError: {
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
authenticationRouterError: {
|
|
13
|
+
userName: string;
|
|
14
|
+
userValidationError?: {
|
|
15
|
+
error: Error;
|
|
16
|
+
};
|
|
17
|
+
logoutError?: {
|
|
18
|
+
error: Error;
|
|
19
|
+
};
|
|
20
|
+
unauthorizedUserInfo?: string;
|
|
21
|
+
error: string;
|
|
22
|
+
};
|
|
23
|
+
showAuthenticationRouterLogin: boolean;
|
|
24
|
+
dispatch: Dispatch<unknown>;
|
|
25
|
+
navigate: () => void;
|
|
26
|
+
location: Location;
|
|
27
|
+
}
|
|
28
|
+
declare const AuthenticationRouter: ({ userManager, signInCallbackError, authenticationRouterError, showAuthenticationRouterLogin, dispatch, navigate, location, }: AuthenticationRouterProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
29
|
export default AuthenticationRouter;
|
|
2
|
-
declare function AuthenticationRouter({ userManager, signInCallbackError, authenticationRouterError, showAuthenticationRouterLogin, dispatch, navigate, location, }: {
|
|
3
|
-
userManager: any;
|
|
4
|
-
signInCallbackError: any;
|
|
5
|
-
authenticationRouterError: any;
|
|
6
|
-
showAuthenticationRouterLogin: any;
|
|
7
|
-
dispatch: any;
|
|
8
|
-
navigate: any;
|
|
9
|
-
location: any;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -88,7 +88,7 @@ const AuthenticationRouter = ({
|
|
|
88
88
|
Logout,
|
|
89
89
|
{
|
|
90
90
|
disabled: userManager.instance === null,
|
|
91
|
-
onLogoutClick: () => logout(
|
|
91
|
+
onLogoutClick: () => logout(dispatch, userManager.instance)
|
|
92
92
|
}
|
|
93
93
|
) }),
|
|
94
94
|
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 4, children: [
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020, 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
|
+
*/
|
|
1
7
|
export { default } from './AuthenticationRouter';
|
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Component, ErrorInfo, ReactNode } from 'react';
|
|
2
|
+
import { IconButtonProps } from '@mui/material';
|
|
3
|
+
|
|
4
|
+
export interface ExpandMoreProps extends IconButtonProps {
|
|
5
|
+
expand: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
type CardErrorBoundaryStateError = {
|
|
11
|
+
hasError: true;
|
|
12
|
+
error: Error;
|
|
13
|
+
};
|
|
14
|
+
type CardErrorBoundaryStateSuccess = {
|
|
15
|
+
hasError: false;
|
|
16
|
+
};
|
|
17
|
+
type CardErrorBoundaryState = (CardErrorBoundaryStateError | CardErrorBoundaryStateSuccess) & {
|
|
18
|
+
expanded: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare class CardErrorBoundary extends Component<Props, CardErrorBoundaryState> {
|
|
21
|
+
state: CardErrorBoundaryState;
|
|
22
|
+
constructor(props: Props);
|
|
23
|
+
static getDerivedStateFromError(error: Error): {
|
|
10
24
|
hasError: boolean;
|
|
11
|
-
|
|
12
|
-
error: undefined;
|
|
25
|
+
error: Error;
|
|
13
26
|
};
|
|
27
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
14
28
|
handleExpandClick(): void;
|
|
15
29
|
handleReloadClick(): void;
|
|
16
|
-
|
|
17
|
-
render(): any;
|
|
30
|
+
render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
|
|
18
31
|
}
|
|
32
|
+
export default CardErrorBoundary;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Component } from "react";
|
|
3
|
-
import { styled, IconButton, Box, Card, CardHeader, CardContent, Typography, CardActions, Collapse } from "@mui/material";
|
|
4
2
|
import { Replay, ExpandMore as ExpandMore$1 } from "@mui/icons-material";
|
|
3
|
+
import { styled, IconButton, Box, Card, CardHeader, CardContent, Typography, CardActions, Collapse } from "@mui/material";
|
|
4
|
+
import { Component } from "react";
|
|
5
5
|
import { FormattedMessage } from "react-intl";
|
|
6
6
|
const ExpandMore = styled((props) => {
|
|
7
7
|
const { expand, ...other } = props;
|
|
@@ -18,8 +18,7 @@ class CardErrorBoundary extends Component {
|
|
|
18
18
|
super(props);
|
|
19
19
|
this.state = {
|
|
20
20
|
hasError: false,
|
|
21
|
-
expanded: false
|
|
22
|
-
error: void 0
|
|
21
|
+
expanded: false
|
|
23
22
|
};
|
|
24
23
|
this.handleExpandClick = this.handleExpandClick.bind(this);
|
|
25
24
|
this.handleReloadClick = this.handleReloadClick.bind(this);
|
|
@@ -31,10 +30,12 @@ class CardErrorBoundary extends Component {
|
|
|
31
30
|
console.error("CardErrorBoundary caught: ", error, errorInfo);
|
|
32
31
|
}
|
|
33
32
|
handleExpandClick() {
|
|
34
|
-
this.setState((state) => ({
|
|
33
|
+
this.setState((state) => ({
|
|
34
|
+
expanded: !state.expanded
|
|
35
|
+
}));
|
|
35
36
|
}
|
|
36
37
|
handleReloadClick() {
|
|
37
|
-
this.setState((
|
|
38
|
+
this.setState((_) => ({
|
|
38
39
|
hasError: false,
|
|
39
40
|
expanded: false,
|
|
40
41
|
error: void 0
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, 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
|
+
*/
|
|
1
7
|
export { default } from './card-error-boundary';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AgGridReact, AgGridReactProps } from 'ag-grid-react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
interface CustomAGGGridStyleProps {
|
|
5
|
+
shouldHidePinnedHeaderRightBorder?: boolean;
|
|
6
|
+
showOverlay?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface CustomAGGridProps extends AgGridReactProps, CustomAGGGridStyleProps {
|
|
9
|
+
}
|
|
10
|
+
declare const CustomAGGrid: React.ForwardRefExoticComponent<CustomAGGridProps & React.RefAttributes<AgGridReact<any>>>;
|
|
11
|
+
export default CustomAGGrid;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useCallback } from "react";
|
|
3
|
+
import { AgGridReact } from "ag-grid-react";
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
5
|
+
import "ag-grid-community/styles/ag-grid.css";
|
|
6
|
+
import "ag-grid-community/styles/ag-theme-alpine.css";
|
|
7
|
+
import { Box } from "@mui/system";
|
|
8
|
+
import { mergeSx } from "../../utils/styles.js";
|
|
9
|
+
import { useTheme } from "@mui/material";
|
|
10
|
+
import { CUSTOM_AGGRID_THEME, styles } from "./custom-aggrid.style.js";
|
|
11
|
+
const onColumnResized = (params) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const { column, finished } = params;
|
|
14
|
+
const colDefinedMinWidth = (_a = column == null ? void 0 : column.getColDef()) == null ? void 0 : _a.minWidth;
|
|
15
|
+
if (column && colDefinedMinWidth && finished) {
|
|
16
|
+
const newWidth = column == null ? void 0 : column.getActualWidth();
|
|
17
|
+
if (newWidth < colDefinedMinWidth) {
|
|
18
|
+
column == null ? void 0 : column.setActualWidth(colDefinedMinWidth, params.source);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const CustomAGGrid = React.forwardRef(
|
|
23
|
+
(props, ref) => {
|
|
24
|
+
const {
|
|
25
|
+
shouldHidePinnedHeaderRightBorder = false,
|
|
26
|
+
overlayNoRowsTemplate,
|
|
27
|
+
loadingOverlayComponent,
|
|
28
|
+
loadingOverlayComponentParams,
|
|
29
|
+
showOverlay = false
|
|
30
|
+
} = props;
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
const intl = useIntl();
|
|
33
|
+
const GRID_PREFIX = "grid.";
|
|
34
|
+
const getLocaleText = useCallback(
|
|
35
|
+
(params) => {
|
|
36
|
+
const key = GRID_PREFIX + params.key;
|
|
37
|
+
return intl.formatMessage({
|
|
38
|
+
id: key,
|
|
39
|
+
defaultMessage: params.defaultValue
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
[intl]
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Box,
|
|
46
|
+
{
|
|
47
|
+
sx: mergeSx(
|
|
48
|
+
styles.grid,
|
|
49
|
+
shouldHidePinnedHeaderRightBorder ? styles.noBorderRight : void 0,
|
|
50
|
+
showOverlay ? styles.overlayBackground : void 0
|
|
51
|
+
),
|
|
52
|
+
className: `${theme.aggrid.theme} ${CUSTOM_AGGRID_THEME}`,
|
|
53
|
+
children: /* @__PURE__ */ jsx(
|
|
54
|
+
AgGridReact,
|
|
55
|
+
{
|
|
56
|
+
ref,
|
|
57
|
+
getLocaleText,
|
|
58
|
+
suppressPropertyNamesCheck: true,
|
|
59
|
+
loadingOverlayComponent,
|
|
60
|
+
loadingOverlayComponentParams,
|
|
61
|
+
overlayNoRowsTemplate,
|
|
62
|
+
onColumnResized,
|
|
63
|
+
enableCellTextSelection: true,
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
export {
|
|
72
|
+
CustomAGGrid as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SystemStyleObject } from '@mui/system/styleFunctionSx/styleFunctionSx';
|
|
2
|
+
import { Theme } from '@mui/material/styles/createTheme';
|
|
3
|
+
|
|
4
|
+
export declare const CUSTOM_AGGRID_THEME = "custom-aggrid-theme";
|
|
5
|
+
export declare const styles: {
|
|
6
|
+
grid: (theme: Theme) => SystemStyleObject<Theme>;
|
|
7
|
+
noBorderRight: {
|
|
8
|
+
'& .ag-pinned-left-header': {
|
|
9
|
+
borderRight: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
overlayBackground: (theme: Theme) => {
|
|
13
|
+
'& .ag-overlay-loading-wrapper': {
|
|
14
|
+
background: string;
|
|
15
|
+
};
|
|
16
|
+
'& .ag-overlay-no-rows-wrapper': {
|
|
17
|
+
background: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const CUSTOM_AGGRID_THEME = "custom-aggrid-theme";
|
|
2
|
+
const styles = {
|
|
3
|
+
grid: (theme) => ({
|
|
4
|
+
width: "auto",
|
|
5
|
+
height: "100%",
|
|
6
|
+
position: "relative",
|
|
7
|
+
[`&.${CUSTOM_AGGRID_THEME}`]: {
|
|
8
|
+
"--ag-value-change-value-highlight-background-color": theme.aggrid.valueChangeHighlightBackgroundColor,
|
|
9
|
+
"--ag-selected-row-background-color": theme.aggrid.highlightColor,
|
|
10
|
+
"--ag-row-hover-color": theme.aggrid.highlightColor
|
|
11
|
+
},
|
|
12
|
+
"& .ag-checkbox-input": {
|
|
13
|
+
cursor: "pointer"
|
|
14
|
+
},
|
|
15
|
+
//overrides the default computed max height for ag grid default selector editor to make it more usable
|
|
16
|
+
//can be removed if a custom selector editor is implemented
|
|
17
|
+
"& .ag-select-list": {
|
|
18
|
+
maxHeight: "300px !important"
|
|
19
|
+
},
|
|
20
|
+
//allows to hide the scrollbar in the pinned rows section as it is unecessary to our implementation
|
|
21
|
+
"& .ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-left-spacer:not(.ag-scroller-corner)": {
|
|
22
|
+
visibility: "hidden"
|
|
23
|
+
},
|
|
24
|
+
//removes border on focused cell - using "suppressCellFocus" Aggrid option causes side effects and breaks field edition
|
|
25
|
+
"& .ag-cell-focus, .ag-cell": {
|
|
26
|
+
border: "none !important"
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
noBorderRight: {
|
|
30
|
+
// hides right border for header of "Edit" column due to column being pinned
|
|
31
|
+
"& .ag-pinned-left-header": {
|
|
32
|
+
borderRight: "none"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
overlayBackground: (theme) => ({
|
|
36
|
+
"& .ag-overlay-loading-wrapper": {
|
|
37
|
+
background: theme.aggrid.overlay.background
|
|
38
|
+
},
|
|
39
|
+
"& .ag-overlay-no-rows-wrapper": {
|
|
40
|
+
background: "none"
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
CUSTOM_AGGRID_THEME,
|
|
46
|
+
styles
|
|
47
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ElementAttributes } from '../../utils/types.ts';
|
|
2
1
|
import { UUID } from 'crypto';
|
|
3
2
|
import { TreeViewFinderProps } from '../TreeViewFinder/TreeViewFinder';
|
|
4
3
|
import { FunctionComponent } from 'react';
|
|
@@ -8,9 +7,6 @@ interface DirectoryItemSelectorProps extends TreeViewFinderProps {
|
|
|
8
7
|
types: string[];
|
|
9
8
|
equipmentTypes?: string[];
|
|
10
9
|
itemFilter?: any;
|
|
11
|
-
fetchDirectoryContent?: (directoryUuid: UUID, elementTypes: string[]) => Promise<ElementAttributes[]>;
|
|
12
|
-
fetchRootFolders?: (types: string[]) => Promise<ElementAttributes[]>;
|
|
13
|
-
fetchElementsInfos?: (ids: UUID[], elementTypes: string[], equipmentTypes: string[]) => Promise<ElementAttributes[]>;
|
|
14
10
|
classes?: any;
|
|
15
11
|
contentText?: string;
|
|
16
12
|
defaultExpanded?: string[];
|
|
@@ -4,6 +4,8 @@ import { getFileIcon } from "../../utils/ElementIcon.js";
|
|
|
4
4
|
import { ElementType } from "../../utils/ElementType.js";
|
|
5
5
|
import TreeViewFinder from "../TreeViewFinder/TreeViewFinder.js";
|
|
6
6
|
import { useSnackMessage } from "../../hooks/useSnackMessage.js";
|
|
7
|
+
import { fetchElementsInfos } from "../../services/explore.js";
|
|
8
|
+
import { fetchRootFolders, fetchDirectoryContent } from "../../services/directory.js";
|
|
7
9
|
const styles = {
|
|
8
10
|
icon: (theme) => ({
|
|
9
11
|
marginRight: theme.spacing(1),
|
|
@@ -16,9 +18,6 @@ const DirectoryItemSelector = ({
|
|
|
16
18
|
types,
|
|
17
19
|
equipmentTypes,
|
|
18
20
|
itemFilter,
|
|
19
|
-
fetchDirectoryContent,
|
|
20
|
-
fetchRootFolders,
|
|
21
|
-
fetchElementsInfos,
|
|
22
21
|
expanded,
|
|
23
22
|
...otherTreeViewFinderProps
|
|
24
23
|
}) => {
|
|
@@ -77,7 +76,7 @@ const DirectoryItemSelector = ({
|
|
|
77
76
|
[convertRoots]
|
|
78
77
|
);
|
|
79
78
|
const updateRootDirectories = useCallback(() => {
|
|
80
|
-
fetchRootFolders
|
|
79
|
+
fetchRootFolders(types).then((data2) => {
|
|
81
80
|
let [nrs, mdr] = updatedTree(
|
|
82
81
|
rootsRef.current,
|
|
83
82
|
nodeMap.current,
|
|
@@ -93,30 +92,26 @@ const DirectoryItemSelector = ({
|
|
|
93
92
|
headerId: "DirectoryItemSelector"
|
|
94
93
|
});
|
|
95
94
|
});
|
|
96
|
-
}, [convertRoots, types, snackError
|
|
95
|
+
}, [convertRoots, types, snackError]);
|
|
97
96
|
const fetchDirectory = useCallback(
|
|
98
97
|
(nodeId) => {
|
|
99
98
|
const typeList = types.includes(ElementType.DIRECTORY) ? [] : types;
|
|
100
|
-
fetchDirectoryContent
|
|
99
|
+
fetchDirectoryContent(nodeId, typeList).then((children) => {
|
|
101
100
|
const childrenMatchedTypes = children.filter(
|
|
102
101
|
(item) => contentFilter().has(item.type)
|
|
103
102
|
);
|
|
104
103
|
if (childrenMatchedTypes.length > 0 && equipmentTypes && equipmentTypes.length > 0) {
|
|
105
|
-
fetchElementsInfos
|
|
106
|
-
childrenMatchedTypes.map(
|
|
107
|
-
(e) => e.elementUuid
|
|
108
|
-
),
|
|
104
|
+
fetchElementsInfos(
|
|
105
|
+
childrenMatchedTypes.map((e) => e.elementUuid),
|
|
109
106
|
types,
|
|
110
107
|
equipmentTypes
|
|
111
108
|
).then((childrenWithMetadata) => {
|
|
112
|
-
const children2 = itemFilter ? childrenWithMetadata.filter(
|
|
113
|
-
(val)
|
|
114
|
-
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
return itemFilter(val);
|
|
109
|
+
const children2 = itemFilter ? childrenWithMetadata.filter((val) => {
|
|
110
|
+
if (val.type === ElementType.DIRECTORY) {
|
|
111
|
+
return true;
|
|
118
112
|
}
|
|
119
|
-
|
|
113
|
+
return itemFilter(val);
|
|
114
|
+
}) : childrenWithMetadata;
|
|
120
115
|
addToDirectory(nodeId, children2);
|
|
121
116
|
});
|
|
122
117
|
} else {
|
|
@@ -128,15 +123,7 @@ const DirectoryItemSelector = ({
|
|
|
128
123
|
);
|
|
129
124
|
});
|
|
130
125
|
},
|
|
131
|
-
[
|
|
132
|
-
types,
|
|
133
|
-
equipmentTypes,
|
|
134
|
-
itemFilter,
|
|
135
|
-
contentFilter,
|
|
136
|
-
addToDirectory,
|
|
137
|
-
fetchDirectoryContent,
|
|
138
|
-
fetchElementsInfos
|
|
139
|
-
]
|
|
126
|
+
[types, equipmentTypes, itemFilter, contentFilter, addToDirectory]
|
|
140
127
|
);
|
|
141
128
|
useEffect(() => {
|
|
142
129
|
if (open) {
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
import { EquipmentInfos } from '../../utils/EquipmentType';
|
|
3
|
+
import { TagRenderer } from './index';
|
|
4
|
+
|
|
5
|
+
export interface EquipmentItemProps {
|
|
6
|
+
inputValue: string;
|
|
7
|
+
suffixRenderer: typeof TagRenderer;
|
|
8
|
+
element: EquipmentInfos;
|
|
9
|
+
showsJustText: boolean;
|
|
10
|
+
classes?: {
|
|
11
|
+
result?: string;
|
|
12
|
+
equipmentOption?: string;
|
|
13
|
+
equipmentTag?: string;
|
|
14
|
+
equipmentTypeTag?: string;
|
|
15
|
+
equipmentVlTag?: string;
|
|
16
|
+
};
|
|
17
|
+
styles?: {
|
|
18
|
+
result?: SxProps;
|
|
19
|
+
equipmentOption?: SxProps;
|
|
20
|
+
equipmentTag?: SxProps;
|
|
21
|
+
equipmentTypeTag?: SxProps;
|
|
22
|
+
equipmentVlTag?: SxProps;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare const EquipmentItem: ({ inputValue, suffixRenderer, element, showsJustText, ...props }: EquipmentItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,8 +7,8 @@ import { TagRenderer } from "./tag-renderer.js";
|
|
|
7
7
|
import match from "autosuggest-highlight/match";
|
|
8
8
|
import parse from "autosuggest-highlight/parse";
|
|
9
9
|
import clsx from "clsx";
|
|
10
|
-
import { OverflowableText } from "../OverflowableText/overflowable-text.js";
|
|
11
10
|
import { EQUIPMENT_TYPE } from "../../utils/EquipmentType.js";
|
|
11
|
+
import { OverflowableText } from "../OverflowableText/overflowable-text.js";
|
|
12
12
|
import { mergeSx } from "../../utils/styles.js";
|
|
13
13
|
const EquipmentItem = ({
|
|
14
14
|
inputValue,
|
|
@@ -17,7 +17,7 @@ const EquipmentItem = ({
|
|
|
17
17
|
showsJustText = false,
|
|
18
18
|
...props
|
|
19
19
|
}) => {
|
|
20
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
21
21
|
let matches = match(element.label, inputValue, {
|
|
22
22
|
insideWords: true,
|
|
23
23
|
findAllOccurrences: true
|
|
@@ -44,7 +44,7 @@ const EquipmentItem = ({
|
|
|
44
44
|
children: /* @__PURE__ */ jsx(
|
|
45
45
|
FormattedMessage,
|
|
46
46
|
{
|
|
47
|
-
id: EQUIPMENT_TYPE[element.type].tagLabel
|
|
47
|
+
id: (_g = EQUIPMENT_TYPE[element.type]) == null ? void 0 : _g.tagLabel
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
}
|
|
@@ -53,8 +53,8 @@ const EquipmentItem = ({
|
|
|
53
53
|
OverflowableText,
|
|
54
54
|
{
|
|
55
55
|
text: parts.map((e) => e.text).join(),
|
|
56
|
-
className: (
|
|
57
|
-
sx: (
|
|
56
|
+
className: (_h = props.classes) == null ? void 0 : _h.result,
|
|
57
|
+
sx: (_i = props.styles) == null ? void 0 : _i.result,
|
|
58
58
|
children: parts.map((part, index) => /* @__PURE__ */ jsx(
|
|
59
59
|
"span",
|
|
60
60
|
{
|