@gridsuite/commons-ui 0.46.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -17
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +147 -0
- package/dist/components/CardErrorBoundary/card-error-boundary.js +110 -0
- package/dist/components/ElementSearchDialog/element-search-dialog.js +139 -0
- package/dist/components/ElementSearchDialog/equipment-item.js +77 -0
- package/dist/components/ElementSearchDialog/tag-renderer.js +34 -0
- package/dist/components/FlatParameters/FlatParameters.js +411 -0
- package/dist/components/Login/Login.js +78 -0
- package/dist/components/Login/Logout.js +69 -0
- package/dist/components/MuiVirtualizedTable/ColumnHeader.js +127 -0
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +548 -0
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +790 -0
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +87 -0
- package/dist/components/OverflowableText/overflowable-text.js +87 -0
- package/dist/components/ReportViewer/filter-button.js +64 -0
- package/dist/components/ReportViewer/log-report-item.js +95 -0
- package/dist/components/ReportViewer/log-report.js +49 -0
- package/dist/components/ReportViewer/log-table.js +131 -0
- package/dist/components/ReportViewer/multi-select-list.js +40 -0
- package/dist/components/ReportViewer/report-item.js +112 -0
- package/dist/components/ReportViewer/report-tree-view-context.js +8 -0
- package/dist/components/ReportViewer/report-viewer.js +158 -0
- package/dist/components/ReportViewerDialog/report-viewer-dialog.js +61 -0
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +13 -0
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +16 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.js +28 -0
- package/dist/components/TopBar/AboutDialog.js +467 -0
- package/dist/components/TopBar/GridLogo.js +71 -0
- package/dist/components/TopBar/TopBar.js +679 -0
- package/dist/components/TreeViewFinder/TreeViewFinder.js +288 -0
- package/dist/components/react-hook-form/autocomplete-input.js +96 -0
- package/dist/components/react-hook-form/booleans/boolean-input.js +49 -0
- package/dist/components/react-hook-form/booleans/checkbox-input.js +24 -0
- package/dist/components/react-hook-form/booleans/switch-input.js +24 -0
- package/dist/components/react-hook-form/error-management/error-input.js +42 -0
- package/dist/components/react-hook-form/error-management/field-error-alert.js +9 -0
- package/dist/components/react-hook-form/error-management/mid-form-error.js +20 -0
- package/dist/components/react-hook-form/numbers/float-input.js +51 -0
- package/dist/components/react-hook-form/numbers/integer-input.js +36 -0
- package/dist/components/react-hook-form/numbers/utils.js +10 -0
- package/dist/components/react-hook-form/radio-input.js +44 -0
- package/dist/components/react-hook-form/select-input.js +31 -0
- package/dist/components/react-hook-form/slider-input.js +43 -0
- package/dist/components/react-hook-form/text-input.js +94 -0
- package/dist/components/react-hook-form/utils/cancel-button.js +16 -0
- package/dist/components/react-hook-form/utils/field-label.js +12 -0
- package/dist/components/react-hook-form/utils/functions.js +36 -0
- package/dist/components/react-hook-form/utils/submit-button.js +23 -0
- package/dist/components/react-hook-form/utils/text-field-with-adornment.js +96 -0
- package/dist/components/translations/card-error-boundary-en.js +8 -0
- package/dist/components/translations/card-error-boundary-fr.js +8 -0
- package/dist/components/translations/common-button-en.js +7 -0
- package/dist/components/translations/common-button-fr.js +7 -0
- package/dist/components/translations/element-search-en.js +7 -0
- package/dist/components/translations/element-search-fr.js +7 -0
- package/dist/components/translations/equipment-search-en.js +21 -0
- package/dist/components/translations/equipment-search-fr.js +21 -0
- package/dist/components/translations/flat-parameters-en.js +8 -0
- package/dist/components/translations/flat-parameters-fr.js +8 -0
- package/dist/components/translations/login-en.js +14 -0
- package/dist/components/translations/login-fr.js +14 -0
- package/dist/components/translations/multiple-selection-dialog-en.js +8 -0
- package/dist/components/translations/multiple-selection-dialog-fr.js +8 -0
- package/dist/components/translations/report-viewer-en.js +8 -0
- package/dist/components/translations/report-viewer-fr.js +8 -0
- package/dist/components/translations/table-en.js +6 -0
- package/dist/components/translations/table-fr.js +6 -0
- package/dist/components/translations/top-bar-en.js +27 -0
- package/dist/components/translations/top-bar-fr.js +27 -0
- package/dist/components/translations/treeview-finder-en.js +12 -0
- package/dist/components/translations/treeview-finder-fr.js +12 -0
- package/dist/hooks/useDebounce.js +17 -0
- package/{es/components/ElementSearchDialog/index.js → dist/hooks/useIntlRef.d.ts} +2 -2
- package/dist/hooks/useIntlRef.js +13 -0
- package/dist/hooks/useSnackMessage.js +81 -0
- package/dist/index.d.ts +225 -0
- package/dist/index.js +154 -0
- package/dist/utils/AuthService.js +336 -0
- package/dist/utils/ElementType.js +38 -0
- package/dist/utils/EquipmentType.js +132 -0
- package/dist/utils/UserManagerMock.js +85 -0
- package/dist/utils/actions.js +71 -0
- package/dist/utils/algos.js +24 -0
- package/dist/utils/styles.js +13 -0
- package/package.json +36 -21
- package/es/components/AuthenticationRouter/AuthenticationRouter.js +0 -102
- package/es/components/AuthenticationRouter/index.js +0 -7
- package/es/components/CardErrorBoundary/card-error-boundary.js +0 -138
- package/es/components/CardErrorBoundary/index.js +0 -7
- package/es/components/ElementSearchDialog/element-search-dialog.js +0 -153
- package/es/components/ElementSearchDialog/equipment-item.js +0 -63
- package/es/components/ElementSearchDialog/tag-renderer.js +0 -29
- package/es/components/FlatParameters/FlatParameters.js +0 -448
- package/es/components/FlatParameters/index.js +0 -8
- package/es/components/Login/Login.js +0 -79
- package/es/components/Login/Logout.js +0 -78
- package/es/components/Login/index.js +0 -7
- package/es/components/MuiVirtualizedTable/ColumnHeader.js +0 -125
- package/es/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +0 -619
- package/es/components/MuiVirtualizedTable/MuiVirtualizedTable.js +0 -780
- package/es/components/MuiVirtualizedTable/index.js +0 -9
- package/es/components/MultipleSelectionDialog/MultipleSelectionDialog.js +0 -95
- package/es/components/MultipleSelectionDialog/index.js +0 -8
- package/es/components/OverflowableText/index.js +0 -7
- package/es/components/OverflowableText/overflowable-text.js +0 -81
- package/es/components/ReportViewer/filter-button.js +0 -77
- package/es/components/ReportViewer/index.js +0 -7
- package/es/components/ReportViewer/log-report-item.js +0 -97
- package/es/components/ReportViewer/log-report.js +0 -63
- package/es/components/ReportViewer/log-table.js +0 -130
- package/es/components/ReportViewer/multi-select-list.js +0 -56
- package/es/components/ReportViewer/report-item.js +0 -131
- package/es/components/ReportViewer/report-tree-view-context.js +0 -13
- package/es/components/ReportViewer/report-viewer.js +0 -167
- package/es/components/ReportViewerDialog/index.js +0 -7
- package/es/components/ReportViewerDialog/report-viewer-dialog.js +0 -67
- package/es/components/SignInCallbackHandler/SignInCallbackHandler.js +0 -19
- package/es/components/SignInCallbackHandler/index.js +0 -7
- package/es/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +0 -19
- package/es/components/SilentRenewCallbackHandler/index.js +0 -7
- package/es/components/SnackbarProvider/SnackbarProvider.js +0 -39
- package/es/components/SnackbarProvider/index.js +0 -7
- package/es/components/TopBar/AboutDialog.js +0 -456
- package/es/components/TopBar/GridLogo.js +0 -73
- package/es/components/TopBar/TopBar.js +0 -487
- package/es/components/TopBar/index.js +0 -9
- package/es/components/TreeViewFinder/TreeViewFinder.js +0 -341
- package/es/components/TreeViewFinder/index.js +0 -7
- package/es/components/images/powsybl_logo.svg +0 -35
- package/es/components/react-hook-form/autocomplete-input.js +0 -110
- package/es/components/react-hook-form/booleans/boolean-input.js +0 -56
- package/es/components/react-hook-form/booleans/checkbox-input.js +0 -28
- package/es/components/react-hook-form/booleans/switch-input.js +0 -28
- package/es/components/react-hook-form/error-management/error-input.js +0 -50
- package/es/components/react-hook-form/error-management/field-error-alert.js +0 -22
- package/es/components/react-hook-form/error-management/mid-form-error.js +0 -25
- package/es/components/react-hook-form/numbers/float-input.js +0 -105
- package/es/components/react-hook-form/numbers/integer-input.js +0 -35
- package/es/components/react-hook-form/numbers/utils.js +0 -6
- package/es/components/react-hook-form/radio-input.js +0 -55
- package/es/components/react-hook-form/select-input.js +0 -40
- package/es/components/react-hook-form/slider-input.js +0 -48
- package/es/components/react-hook-form/text-input.js +0 -100
- package/es/components/react-hook-form/utils/cancel-button.js +0 -28
- package/es/components/react-hook-form/utils/field-label.js +0 -15
- package/es/components/react-hook-form/utils/functions.js +0 -42
- package/es/components/react-hook-form/utils/submit-button.js +0 -29
- package/es/components/react-hook-form/utils/text-field-with-adornment.js +0 -92
- package/es/components/translations/card-error-boundary-en.js +0 -13
- package/es/components/translations/card-error-boundary-fr.js +0 -13
- package/es/components/translations/common-button-en.js +0 -12
- package/es/components/translations/common-button-fr.js +0 -12
- package/es/components/translations/element-search-en.js +0 -12
- package/es/components/translations/element-search-fr.js +0 -12
- package/es/components/translations/equipment-search-en.js +0 -26
- package/es/components/translations/equipment-search-fr.js +0 -26
- package/es/components/translations/flat-parameters-en.js +0 -13
- package/es/components/translations/flat-parameters-fr.js +0 -13
- package/es/components/translations/inputs-en.js +0 -25
- package/es/components/translations/inputs-fr.js +0 -25
- package/es/components/translations/login-en.js +0 -19
- package/es/components/translations/login-fr.js +0 -19
- package/es/components/translations/multiple-selection-dialog-en.js +0 -13
- package/es/components/translations/multiple-selection-dialog-fr.js +0 -13
- package/es/components/translations/report-viewer-en.js +0 -13
- package/es/components/translations/report-viewer-fr.js +0 -13
- package/es/components/translations/table-en.js +0 -11
- package/es/components/translations/table-fr.js +0 -11
- package/es/components/translations/top-bar-en.js +0 -32
- package/es/components/translations/top-bar-fr.js +0 -32
- package/es/components/translations/treeview-finder-en.js +0 -17
- package/es/components/translations/treeview-finder-fr.js +0 -17
- package/es/hooks/useDebounce.js +0 -26
- package/es/hooks/useIntlRef.js +0 -22
- package/es/hooks/useSnackMessage.js +0 -81
- package/es/index.js +0 -71
- package/es/utils/AuthService.js +0 -312
- package/es/utils/ElementType.js +0 -53
- package/es/utils/EquipmentType.js +0 -133
- package/es/utils/UserManagerMock.js +0 -81
- package/es/utils/actions.js +0 -65
- package/es/utils/algos.js +0 -29
- package/es/utils/styles.js +0 -35
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021, 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
|
-
|
|
8
|
-
export { default, generateMuiVirtualizedTableClass } from './MuiVirtualizedTable';
|
|
9
|
-
export { KeyedColumnsRowIndexer, CHANGE_WAYS } from './KeyedColumnsRowIndexer';
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023, 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
|
-
|
|
8
|
-
import { Dialog, DialogContent, List } from '@mui/material';
|
|
9
|
-
import DialogTitle from '@mui/material/DialogTitle';
|
|
10
|
-
import { FormattedMessage } from 'react-intl';
|
|
11
|
-
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
12
|
-
import Checkbox from '@mui/material/Checkbox';
|
|
13
|
-
import React, { useState } from 'react';
|
|
14
|
-
import DialogActions from '@mui/material/DialogActions';
|
|
15
|
-
import Button from '@mui/material/Button';
|
|
16
|
-
import Grid from '@mui/material/Grid';
|
|
17
|
-
var MultipleSelectionDialog = function MultipleSelectionDialog(_ref) {
|
|
18
|
-
var options = _ref.options,
|
|
19
|
-
selectedOptions = _ref.selectedOptions,
|
|
20
|
-
open = _ref.open,
|
|
21
|
-
getOptionLabel = _ref.getOptionLabel,
|
|
22
|
-
handleClose = _ref.handleClose,
|
|
23
|
-
handleValidate = _ref.handleValidate,
|
|
24
|
-
titleId = _ref.titleId;
|
|
25
|
-
var _useState = useState(selectedOptions !== null && selectedOptions !== void 0 ? selectedOptions : []),
|
|
26
|
-
selectedIds = _useState[0],
|
|
27
|
-
setSelectedIds = _useState[1];
|
|
28
|
-
var handleSelectAll = function handleSelectAll() {
|
|
29
|
-
if (selectedIds.length !== options.length) {
|
|
30
|
-
setSelectedIds(options);
|
|
31
|
-
} else {
|
|
32
|
-
setSelectedIds([]);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var handleOptionSelection = function handleOptionSelection(option) {
|
|
36
|
-
setSelectedIds(function (oldValues) {
|
|
37
|
-
if (oldValues.includes(option)) {
|
|
38
|
-
return oldValues.filter(function (o) {
|
|
39
|
-
return o !== option;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
return [].concat(oldValues, [option]);
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
return /*#__PURE__*/React.createElement(Dialog, {
|
|
46
|
-
open: open
|
|
47
|
-
}, /*#__PURE__*/React.createElement(DialogTitle, null, titleId), /*#__PURE__*/React.createElement(DialogContent, null, /*#__PURE__*/React.createElement(Grid, {
|
|
48
|
-
container: true,
|
|
49
|
-
spacing: 2,
|
|
50
|
-
flexDirection: "column"
|
|
51
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
52
|
-
item: true
|
|
53
|
-
}, /*#__PURE__*/React.createElement(FormControlLabel, {
|
|
54
|
-
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
55
|
-
id: 'multiple_selection_dialog/selectAll'
|
|
56
|
-
}),
|
|
57
|
-
control: /*#__PURE__*/React.createElement(Checkbox, {
|
|
58
|
-
checked: selectedIds.length === options.length,
|
|
59
|
-
indeterminate: !!selectedIds.length && selectedIds.length !== options.length,
|
|
60
|
-
onChange: handleSelectAll
|
|
61
|
-
})
|
|
62
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
63
|
-
item: true
|
|
64
|
-
}, /*#__PURE__*/React.createElement(List, null, options.map(function (option) {
|
|
65
|
-
var _option$id;
|
|
66
|
-
var optionId = (_option$id = option === null || option === void 0 ? void 0 : option.id) !== null && _option$id !== void 0 ? _option$id : option;
|
|
67
|
-
var label = getOptionLabel(option);
|
|
68
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
69
|
-
key: optionId
|
|
70
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
71
|
-
item: true
|
|
72
|
-
}, /*#__PURE__*/React.createElement(FormControlLabel, {
|
|
73
|
-
label: label,
|
|
74
|
-
control: /*#__PURE__*/React.createElement(Checkbox, {
|
|
75
|
-
checked: selectedIds.includes(optionId),
|
|
76
|
-
onChange: function onChange() {
|
|
77
|
-
return handleOptionSelection(optionId);
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
})));
|
|
81
|
-
}))))), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(Button, {
|
|
82
|
-
onClick: function onClick() {
|
|
83
|
-
return handleClose();
|
|
84
|
-
}
|
|
85
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
86
|
-
id: 'multiple_selection_dialog/cancel'
|
|
87
|
-
})), /*#__PURE__*/React.createElement(Button, {
|
|
88
|
-
onClick: function onClick() {
|
|
89
|
-
return handleValidate(selectedIds);
|
|
90
|
-
}
|
|
91
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
92
|
-
id: 'multiple_selection_dialog/validate'
|
|
93
|
-
}))));
|
|
94
|
-
};
|
|
95
|
-
export default MultipleSelectionDialog;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023, 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
|
-
|
|
8
|
-
export { default } from './MultipleSelectionDialog';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021, 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 { default } from './overflowable-text';
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
var _excluded = ["text", "tooltipStyle", "tooltipSx", "className", "children"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
6
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
-
*/
|
|
10
|
-
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
11
|
-
import { Box, Tooltip } from '@mui/material';
|
|
12
|
-
import PropTypes from 'prop-types';
|
|
13
|
-
import { styled } from '@mui/system';
|
|
14
|
-
var overflowStyle = {
|
|
15
|
-
overflow: {
|
|
16
|
-
display: 'inline-block',
|
|
17
|
-
whiteSpace: 'pre',
|
|
18
|
-
textOverflow: 'ellipsis',
|
|
19
|
-
overflow: 'hidden'
|
|
20
|
-
},
|
|
21
|
-
tooltip: {
|
|
22
|
-
whiteSpace: 'pre',
|
|
23
|
-
width: 'fit-content',
|
|
24
|
-
maxWidth: 'fit-content'
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
export var OverflowableText = styled(function (_ref) {
|
|
28
|
-
var _element$current, _element$current2;
|
|
29
|
-
var text = _ref.text,
|
|
30
|
-
tooltipStyle = _ref.tooltipStyle,
|
|
31
|
-
tooltipSx = _ref.tooltipSx,
|
|
32
|
-
className = _ref.className,
|
|
33
|
-
children = _ref.children,
|
|
34
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
35
|
-
var element = useRef();
|
|
36
|
-
var _useState = useState(false),
|
|
37
|
-
overflowed = _useState[0],
|
|
38
|
-
setOverflowed = _useState[1];
|
|
39
|
-
var checkOverflow = useCallback(function () {
|
|
40
|
-
if (!element.current) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
setOverflowed(element.current.scrollWidth > element.current.clientWidth);
|
|
44
|
-
}, [setOverflowed, element]);
|
|
45
|
-
useLayoutEffect(function () {
|
|
46
|
-
checkOverflow();
|
|
47
|
-
}, [checkOverflow, text, (_element$current = element.current) === null || _element$current === void 0 ? void 0 : _element$current.scrollWidth, (_element$current2 = element.current) === null || _element$current2 === void 0 ? void 0 : _element$current2.clientWidth]);
|
|
48
|
-
var defaultTooltipSx = !tooltipStyle ? overflowStyle.tooltip : false;
|
|
49
|
-
// the previous tooltipStyle classname API was replacing default, not
|
|
50
|
-
// merging with the defaults, so keep the same behavior with the new tooltipSx API
|
|
51
|
-
var finalTooltipSx = tooltipSx || defaultTooltipSx;
|
|
52
|
-
var tooltipStyleProps = _extends({}, tooltipStyle && {
|
|
53
|
-
classes: {
|
|
54
|
-
tooltip: tooltipStyle
|
|
55
|
-
}
|
|
56
|
-
}, finalTooltipSx && {
|
|
57
|
-
slotProps: {
|
|
58
|
-
tooltip: {
|
|
59
|
-
sx: finalTooltipSx
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
return /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
64
|
-
title: text || '',
|
|
65
|
-
disableHoverListener: !overflowed
|
|
66
|
-
}, tooltipStyleProps /* legacy classes or newer slotProps API */), /*#__PURE__*/React.createElement(Box, _extends({}, props, {
|
|
67
|
-
ref: element,
|
|
68
|
-
children: children || text,
|
|
69
|
-
className: className,
|
|
70
|
-
sx: overflowStyle.overflow
|
|
71
|
-
})));
|
|
72
|
-
})({});
|
|
73
|
-
OverflowableText.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
74
|
-
children: PropTypes.array,
|
|
75
|
-
text: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node]),
|
|
76
|
-
tooltipStyle: PropTypes.string,
|
|
77
|
-
tooltipSx: PropTypes.object,
|
|
78
|
-
sx: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.func]),
|
|
79
|
-
className: PropTypes.string
|
|
80
|
-
} : {};
|
|
81
|
-
export default OverflowableText;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2023, RTE (http://www.rte-france.com)
|
|
4
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
7
|
-
*/
|
|
8
|
-
import React, { useMemo, useState } from 'react';
|
|
9
|
-
import { Box, IconButton } from '@mui/material';
|
|
10
|
-
import MenuIcon from '@mui/icons-material/Menu';
|
|
11
|
-
import { MultiSelectList } from './multi-select-list';
|
|
12
|
-
var styles = {
|
|
13
|
-
notificationDot: {
|
|
14
|
-
height: '6px',
|
|
15
|
-
width: '6px',
|
|
16
|
-
backgroundColor: '#cc70a0',
|
|
17
|
-
borderRadius: '50%',
|
|
18
|
-
position: 'absolute',
|
|
19
|
-
top: '5px',
|
|
20
|
-
left: '23px'
|
|
21
|
-
},
|
|
22
|
-
container: {
|
|
23
|
-
position: 'relative'
|
|
24
|
-
},
|
|
25
|
-
icon: {
|
|
26
|
-
width: '0.7em',
|
|
27
|
-
height: '0.7em'
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* FilterButton wraps a MultiSelectList with a button which has a visual indication to indicate when the user alters the default state of the list
|
|
33
|
-
*
|
|
34
|
-
* @param {Object} selectedItems - It serves as the model and data of the Component each entry must be formatted as a pair of string and boolean. Each key will be displayed and the corresponding boolean is updated in function of its checkbox status
|
|
35
|
-
* @param {Function} setSelectedItems - Setter needed to update the list underlying data
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
export var FilterButton = function FilterButton(_ref) {
|
|
39
|
-
var selectedItems = _ref.selectedItems,
|
|
40
|
-
setSelectedItems = _ref.setSelectedItems;
|
|
41
|
-
var _useState = useState(selectedItems),
|
|
42
|
-
initialState = _useState[0];
|
|
43
|
-
var _useState2 = useState(),
|
|
44
|
-
anchorEl = _useState2[0],
|
|
45
|
-
setAnchorEl = _useState2[1];
|
|
46
|
-
var handleClick = function handleClick(event) {
|
|
47
|
-
setAnchorEl(event.currentTarget);
|
|
48
|
-
};
|
|
49
|
-
var handleClose = function handleClose() {
|
|
50
|
-
setAnchorEl(null);
|
|
51
|
-
};
|
|
52
|
-
var handleChange = function handleChange(event) {
|
|
53
|
-
setSelectedItems(function (previousSelection) {
|
|
54
|
-
var _extends2;
|
|
55
|
-
return _extends({}, previousSelection, (_extends2 = {}, _extends2[event.target.name] = !selectedItems[event.target.name], _extends2));
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
var isInitialStateModified = useMemo(function () {
|
|
59
|
-
return Object.keys(selectedItems).some(function (key) {
|
|
60
|
-
return initialState[key] !== selectedItems[key];
|
|
61
|
-
});
|
|
62
|
-
}, [initialState, selectedItems]);
|
|
63
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
64
|
-
sx: styles.container
|
|
65
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
66
|
-
onClick: handleClick
|
|
67
|
-
}, /*#__PURE__*/React.createElement(MenuIcon, {
|
|
68
|
-
sx: styles.icon
|
|
69
|
-
}), isInitialStateModified && /*#__PURE__*/React.createElement(Box, {
|
|
70
|
-
sx: styles.notificationDot
|
|
71
|
-
})), /*#__PURE__*/React.createElement(MultiSelectList, {
|
|
72
|
-
selectedItems: selectedItems,
|
|
73
|
-
handleChange: handleChange,
|
|
74
|
-
handleClose: handleClose,
|
|
75
|
-
anchor: anchorEl
|
|
76
|
-
}));
|
|
77
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021, 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 { default } from './report-viewer';
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (c) 2021, RTE (http://www.rte-france.com)
|
|
6
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
-
*/
|
|
10
|
-
var LogReportItem = /*#__PURE__*/function () {
|
|
11
|
-
LogReportItem.resolveTemplateMessage = function resolveTemplateMessage(templateMessage, templateValues) {
|
|
12
|
-
var templateVars = {};
|
|
13
|
-
for (var _i = 0, _Object$entries = Object.entries(templateValues); _i < _Object$entries.length; _i++) {
|
|
14
|
-
var _Object$entries$_i = _Object$entries[_i],
|
|
15
|
-
key = _Object$entries$_i[0],
|
|
16
|
-
value = _Object$entries$_i[1];
|
|
17
|
-
templateVars[key] = value.value;
|
|
18
|
-
}
|
|
19
|
-
return templateMessage.replace(/\${([^{}]*)}/g, function (a, b) {
|
|
20
|
-
var r = templateVars[b];
|
|
21
|
-
return typeof r === 'string' || typeof r === 'number' ? r : a;
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
function LogReportItem(jsonReport, reportId) {
|
|
25
|
-
this.key = jsonReport.reportKey;
|
|
26
|
-
this.log = LogReportItem.resolveTemplateMessage(jsonReport.defaultMessage, jsonReport.values);
|
|
27
|
-
this.reportId = reportId;
|
|
28
|
-
this.severity = this.initSeverity(jsonReport.values.reportSeverity);
|
|
29
|
-
}
|
|
30
|
-
var _proto = LogReportItem.prototype;
|
|
31
|
-
_proto.getLog = function getLog() {
|
|
32
|
-
return this.log;
|
|
33
|
-
};
|
|
34
|
-
_proto.getReportId = function getReportId() {
|
|
35
|
-
return this.reportId;
|
|
36
|
-
};
|
|
37
|
-
_proto.getSeverity = function getSeverity() {
|
|
38
|
-
return this.severity;
|
|
39
|
-
};
|
|
40
|
-
_proto.getSeverityName = function getSeverityName() {
|
|
41
|
-
return this.severity.name;
|
|
42
|
-
};
|
|
43
|
-
_proto.getColorName = function getColorName() {
|
|
44
|
-
return this.severity.colorName;
|
|
45
|
-
};
|
|
46
|
-
_proto.getColorHexCode = function getColorHexCode() {
|
|
47
|
-
return this.severity.colorHexCode;
|
|
48
|
-
};
|
|
49
|
-
_proto.initSeverity = function initSeverity(jsonSeverity) {
|
|
50
|
-
var severity = LogReportItem.SEVERITY.UNKNOWN;
|
|
51
|
-
if (!jsonSeverity) {
|
|
52
|
-
return severity;
|
|
53
|
-
}
|
|
54
|
-
Object.values(LogReportItem.SEVERITY).some(function (value) {
|
|
55
|
-
var severityFound = jsonSeverity.value.includes(value.name);
|
|
56
|
-
if (severityFound) {
|
|
57
|
-
severity = value;
|
|
58
|
-
}
|
|
59
|
-
return severityFound;
|
|
60
|
-
});
|
|
61
|
-
return severity;
|
|
62
|
-
};
|
|
63
|
-
return LogReportItem;
|
|
64
|
-
}();
|
|
65
|
-
_defineProperty(LogReportItem, "SEVERITY", {
|
|
66
|
-
UNKNOWN: {
|
|
67
|
-
name: 'UNKNOWN',
|
|
68
|
-
level: 0,
|
|
69
|
-
colorName: 'cornflowerblue',
|
|
70
|
-
colorHexCode: '#6495ED'
|
|
71
|
-
},
|
|
72
|
-
INFO: {
|
|
73
|
-
name: 'INFO',
|
|
74
|
-
level: 1,
|
|
75
|
-
colorName: 'mediumseagreen',
|
|
76
|
-
colorHexCode: '#3CB371'
|
|
77
|
-
},
|
|
78
|
-
WARN: {
|
|
79
|
-
name: 'WARN',
|
|
80
|
-
level: 2,
|
|
81
|
-
colorName: 'orange',
|
|
82
|
-
colorHexCode: '#FFA500'
|
|
83
|
-
},
|
|
84
|
-
ERROR: {
|
|
85
|
-
name: 'ERROR',
|
|
86
|
-
level: 3,
|
|
87
|
-
colorName: 'crimson',
|
|
88
|
-
colorHexCode: '#DC143C'
|
|
89
|
-
},
|
|
90
|
-
FATAL: {
|
|
91
|
-
name: 'FATAL',
|
|
92
|
-
level: 4,
|
|
93
|
-
colorName: 'mediumorchid',
|
|
94
|
-
colorHexCode: '#BA55D3'
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
export { LogReportItem as default };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021, 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
|
-
|
|
8
|
-
import LogReportItem from './log-report-item';
|
|
9
|
-
import { v4 as uuid4 } from 'uuid';
|
|
10
|
-
var LogReport = /*#__PURE__*/function () {
|
|
11
|
-
function LogReport(jsonReporter, parentReportId) {
|
|
12
|
-
this.id = uuid4();
|
|
13
|
-
this.key = jsonReporter.taskKey;
|
|
14
|
-
this.title = LogReportItem.resolveTemplateMessage(jsonReporter.defaultName, jsonReporter.taskValues);
|
|
15
|
-
this.subReports = [];
|
|
16
|
-
this.logs = [];
|
|
17
|
-
this.parentReportId = parentReportId;
|
|
18
|
-
this.init(jsonReporter);
|
|
19
|
-
}
|
|
20
|
-
var _proto = LogReport.prototype;
|
|
21
|
-
_proto.getId = function getId() {
|
|
22
|
-
return this.id;
|
|
23
|
-
};
|
|
24
|
-
_proto.getTitle = function getTitle() {
|
|
25
|
-
return this.title;
|
|
26
|
-
};
|
|
27
|
-
_proto.getSubReports = function getSubReports() {
|
|
28
|
-
return this.subReports;
|
|
29
|
-
};
|
|
30
|
-
_proto.getLogs = function getLogs() {
|
|
31
|
-
return this.logs;
|
|
32
|
-
};
|
|
33
|
-
_proto.getAllLogs = function getAllLogs() {
|
|
34
|
-
return this.getLogs().concat(this.getSubReports().flatMap(function (r) {
|
|
35
|
-
return r.getAllLogs();
|
|
36
|
-
}));
|
|
37
|
-
};
|
|
38
|
-
_proto.init = function init(jsonReporter) {
|
|
39
|
-
var _this = this;
|
|
40
|
-
jsonReporter.subReporters.map(function (value) {
|
|
41
|
-
return _this.subReports.push(new LogReport(value, _this.id));
|
|
42
|
-
});
|
|
43
|
-
jsonReporter.reports.map(function (value) {
|
|
44
|
-
return _this.logs.push(new LogReportItem(value, _this.id));
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
_proto.getHighestSeverity = function getHighestSeverity(currentSeverity) {
|
|
48
|
-
if (currentSeverity === void 0) {
|
|
49
|
-
currentSeverity = LogReportItem.SEVERITY.UNKNOWN;
|
|
50
|
-
}
|
|
51
|
-
var reduceFct = function reduceFct(p, c) {
|
|
52
|
-
return p.level < c.level ? c : p;
|
|
53
|
-
};
|
|
54
|
-
var highestSeverity = this.getLogs().map(function (r) {
|
|
55
|
-
return r.getSeverity();
|
|
56
|
-
}).reduce(reduceFct, currentSeverity);
|
|
57
|
-
return this.getSubReports().map(function (r) {
|
|
58
|
-
return r.getHighestSeverity(highestSeverity);
|
|
59
|
-
}).reduce(reduceFct, highestSeverity);
|
|
60
|
-
};
|
|
61
|
-
return LogReport;
|
|
62
|
-
}();
|
|
63
|
-
export { LogReport as default };
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021, 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
|
-
import React, { memo, useCallback, useEffect, useState } from 'react';
|
|
8
|
-
import { useIntl } from 'react-intl';
|
|
9
|
-
import TableCell from '@mui/material/TableCell';
|
|
10
|
-
import { styled } from '@mui/system';
|
|
11
|
-
import MuiVirtualizedTable from '../MuiVirtualizedTable';
|
|
12
|
-
import { useTheme } from '@mui/material/styles';
|
|
13
|
-
import { FilterButton } from './filter-button';
|
|
14
|
-
var SEVERITY_COLUMN_FIXED_WIDTH = 115;
|
|
15
|
-
var styles = {
|
|
16
|
-
flexContainer: {
|
|
17
|
-
display: 'flex',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
boxSizing: 'border-box'
|
|
20
|
-
},
|
|
21
|
-
table: function table(theme) {
|
|
22
|
-
return {
|
|
23
|
-
// temporary right-to-left patch, waiting for
|
|
24
|
-
// https://github.com/bvaughn/react-virtualized/issues/454
|
|
25
|
-
'& .ReactVirtualized__Table__headerRow': {
|
|
26
|
-
flip: false,
|
|
27
|
-
paddingRight: theme.direction === 'rtl' ? '0 !important' : undefined
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
header: {
|
|
32
|
-
variant: 'header'
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var VirtualizedTable = styled(MuiVirtualizedTable)(styles);
|
|
36
|
-
var LogTable = function LogTable(_ref) {
|
|
37
|
-
var logs = _ref.logs,
|
|
38
|
-
onRowClick = _ref.onRowClick,
|
|
39
|
-
selectedSeverity = _ref.selectedSeverity,
|
|
40
|
-
setSelectedSeverity = _ref.setSelectedSeverity;
|
|
41
|
-
var intl = useIntl();
|
|
42
|
-
var theme = useTheme();
|
|
43
|
-
var _useState = useState(-1),
|
|
44
|
-
selectedRowIndex = _useState[0],
|
|
45
|
-
setSelectedRowIndex = _useState[1];
|
|
46
|
-
var severityCellRender = function severityCellRender(cellData) {
|
|
47
|
-
return /*#__PURE__*/React.createElement(TableCell, {
|
|
48
|
-
component: "div",
|
|
49
|
-
variant: "body",
|
|
50
|
-
style: {
|
|
51
|
-
display: 'flex',
|
|
52
|
-
flex: '1',
|
|
53
|
-
backgroundColor: cellData.rowData.backgroundColor
|
|
54
|
-
},
|
|
55
|
-
align: "center"
|
|
56
|
-
}, cellData.rowData.severity);
|
|
57
|
-
};
|
|
58
|
-
var COLUMNS_DEFINITIONS = [{
|
|
59
|
-
label: intl.formatMessage({
|
|
60
|
-
id: 'report_viewer/severity'
|
|
61
|
-
}).toUpperCase(),
|
|
62
|
-
id: 'severity',
|
|
63
|
-
dataKey: 'severity',
|
|
64
|
-
maxWidth: SEVERITY_COLUMN_FIXED_WIDTH,
|
|
65
|
-
minWidth: SEVERITY_COLUMN_FIXED_WIDTH,
|
|
66
|
-
cellRenderer: severityCellRender,
|
|
67
|
-
extra: /*#__PURE__*/React.createElement(FilterButton, {
|
|
68
|
-
selectedItems: selectedSeverity,
|
|
69
|
-
setSelectedItems: setSelectedSeverity
|
|
70
|
-
})
|
|
71
|
-
}, {
|
|
72
|
-
label: intl.formatMessage({
|
|
73
|
-
id: 'report_viewer/message'
|
|
74
|
-
}).toUpperCase(),
|
|
75
|
-
id: 'message',
|
|
76
|
-
dataKey: 'message'
|
|
77
|
-
}];
|
|
78
|
-
var generateTableColumns = function generateTableColumns() {
|
|
79
|
-
return Object.values(COLUMNS_DEFINITIONS).map(function (c) {
|
|
80
|
-
return c;
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
var generateTableRows = function generateTableRows() {
|
|
84
|
-
return logs.map(function (log) {
|
|
85
|
-
return {
|
|
86
|
-
severity: log.getSeverityName(),
|
|
87
|
-
message: log.getLog(),
|
|
88
|
-
backgroundColor: log.getColorName(),
|
|
89
|
-
reportId: log.getReportId()
|
|
90
|
-
};
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
var handleRowClick = function handleRowClick(event) {
|
|
94
|
-
setSelectedRowIndex(event.index);
|
|
95
|
-
onRowClick(event.rowData);
|
|
96
|
-
};
|
|
97
|
-
var rowStyleFormat = function rowStyleFormat(row) {
|
|
98
|
-
if (row.index < 0) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (selectedRowIndex === row.index) {
|
|
102
|
-
return {
|
|
103
|
-
backgroundColor: theme.palette.action.selected
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
useEffect(function () {
|
|
108
|
-
setSelectedRowIndex(-1);
|
|
109
|
-
}, [logs]);
|
|
110
|
-
var filter = useCallback(function (row) {
|
|
111
|
-
return row.severity && Object.entries(selectedSeverity).some(function (_ref2) {
|
|
112
|
-
var key = _ref2[0],
|
|
113
|
-
value = _ref2[1];
|
|
114
|
-
return key === row.severity && value;
|
|
115
|
-
});
|
|
116
|
-
}, [selectedSeverity]);
|
|
117
|
-
return (
|
|
118
|
-
/*#__PURE__*/
|
|
119
|
-
//TODO do we need to useMemo/useCallback these props to avoid rerenders ?
|
|
120
|
-
React.createElement(VirtualizedTable, {
|
|
121
|
-
columns: generateTableColumns(),
|
|
122
|
-
rows: generateTableRows(),
|
|
123
|
-
sortable: false,
|
|
124
|
-
onRowClick: handleRowClick,
|
|
125
|
-
rowStyle: rowStyleFormat,
|
|
126
|
-
filter: filter
|
|
127
|
-
})
|
|
128
|
-
);
|
|
129
|
-
};
|
|
130
|
-
export default memo(LogTable);
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023, 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
|
-
import React from 'react';
|
|
8
|
-
import Menu from '@mui/material/Menu';
|
|
9
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
10
|
-
import { Checkbox, FormControlLabel } from '@mui/material';
|
|
11
|
-
var styles = {
|
|
12
|
-
label: {
|
|
13
|
-
width: '100%',
|
|
14
|
-
margin: 0
|
|
15
|
-
},
|
|
16
|
-
menuItem: {
|
|
17
|
-
padding: '0 10px 0 0'
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* MultiSelectList allows to manipulate an object where each keys are associated to a boolean in order to determine which are the ones the user wants to select
|
|
23
|
-
*
|
|
24
|
-
* @param {Object} selectedItems - It serves as the model and data of the Component each entry must be formatted as a pair of string and boolean. Each key will be displayed and the corresponding boolean is updated in function of its checkbox status
|
|
25
|
-
* @param {Function} handleChange - Allows to customise the behaviour on selection change
|
|
26
|
-
* @param {Function} handleClose - Allows to customise the behaviour when the menu is closing
|
|
27
|
-
* @param {Object} anchor - Determines where the menu will appear on screen
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
export var MultiSelectList = function MultiSelectList(_ref) {
|
|
31
|
-
var selectedItems = _ref.selectedItems,
|
|
32
|
-
handleChange = _ref.handleChange,
|
|
33
|
-
handleClose = _ref.handleClose,
|
|
34
|
-
anchor = _ref.anchor;
|
|
35
|
-
var open = Boolean(anchor);
|
|
36
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
37
|
-
open: open,
|
|
38
|
-
onClose: handleClose,
|
|
39
|
-
anchorEl: anchor
|
|
40
|
-
}, Object.entries(selectedItems).map(function (_ref2) {
|
|
41
|
-
var key = _ref2[0],
|
|
42
|
-
value = _ref2[1];
|
|
43
|
-
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
44
|
-
sx: styles.menuItem,
|
|
45
|
-
key: key
|
|
46
|
-
}, /*#__PURE__*/React.createElement(FormControlLabel, {
|
|
47
|
-
control: /*#__PURE__*/React.createElement(Checkbox, {
|
|
48
|
-
checked: value,
|
|
49
|
-
onChange: handleChange,
|
|
50
|
-
name: key
|
|
51
|
-
}),
|
|
52
|
-
label: key,
|
|
53
|
-
sx: styles.label
|
|
54
|
-
}));
|
|
55
|
-
}));
|
|
56
|
-
};
|