@gridsuite/commons-ui 0.35.0 → 0.35.2
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 +2 -2
- package/es/components/AuthenticationRouter/AuthenticationRouter.js +102 -0
- package/es/components/AuthenticationRouter/index.js +7 -0
- package/{lib → es}/components/CardErrorBoundary/card-error-boundary.js +35 -42
- package/es/components/CardErrorBoundary/index.js +7 -0
- package/es/components/ElementSearchDialog/element-search-dialog.js +120 -0
- package/{lib → es}/components/ElementSearchDialog/equipment-item.js +26 -32
- package/es/components/ElementSearchDialog/index.js +8 -0
- package/es/components/ElementSearchDialog/tag-renderer.js +29 -0
- package/{lib → es}/components/FlatParameters/FlatParameters.js +42 -49
- package/es/components/FlatParameters/index.js +8 -0
- package/es/components/Login/Login.js +79 -0
- package/es/components/Login/Logout.js +78 -0
- package/es/components/Login/index.js +7 -0
- package/es/components/MuiVirtualizedTable/ColumnHeader.js +125 -0
- package/{lib → es}/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +18 -25
- package/{lib → es}/components/MuiVirtualizedTable/MuiVirtualizedTable.js +88 -99
- package/es/components/MuiVirtualizedTable/index.js +9 -0
- package/es/components/OverflowableText/index.js +7 -0
- package/{lib → es}/components/OverflowableText/overflowable-text.js +22 -30
- package/es/components/ReportViewer/index.js +7 -0
- package/{lib → es}/components/ReportViewer/log-report-item.js +1 -6
- package/{lib → es}/components/ReportViewer/log-report.js +8 -13
- package/{lib → es}/components/ReportViewer/log-table.js +14 -24
- package/{lib → es}/components/ReportViewer/report-item.js +23 -30
- package/{lib → es}/components/ReportViewer/report-tree-view-context.js +3 -9
- package/{lib → es}/components/ReportViewer/report-viewer.js +32 -40
- package/es/components/ReportViewerDialog/index.js +7 -0
- package/es/components/ReportViewerDialog/report-viewer-dialog.js +67 -0
- package/es/components/SignInCallbackHandler/SignInCallbackHandler.js +19 -0
- package/es/components/SignInCallbackHandler/index.js +7 -0
- package/es/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +19 -0
- package/es/components/SilentRenewCallbackHandler/index.js +7 -0
- package/es/components/SnackbarProvider/SnackbarProvider.js +39 -0
- package/es/components/SnackbarProvider/index.js +7 -0
- package/es/components/TopBar/TopBar.js +565 -0
- package/es/components/TopBar/index.js +7 -0
- package/{lib → es}/components/TreeViewFinder/TreeViewFinder.js +59 -66
- package/es/components/TreeViewFinder/index.js +7 -0
- package/es/components/react-hook-form/autocomplete-input.js +110 -0
- package/es/components/react-hook-form/booleans/boolean-input.js +56 -0
- package/es/components/react-hook-form/booleans/checkbox-input.js +28 -0
- package/es/components/react-hook-form/booleans/switch-input.js +28 -0
- package/es/components/react-hook-form/error-management/error-input.js +50 -0
- package/es/components/react-hook-form/error-management/field-error-alert.js +22 -0
- package/es/components/react-hook-form/error-management/mid-form-error.js +25 -0
- package/es/components/react-hook-form/numbers/float-input.js +40 -0
- package/es/components/react-hook-form/numbers/integer-input.js +35 -0
- package/es/components/react-hook-form/numbers/utils.js +6 -0
- package/es/components/react-hook-form/radio-input.js +55 -0
- package/es/components/react-hook-form/select-input.js +40 -0
- package/es/components/react-hook-form/slider-input.js +48 -0
- package/es/components/react-hook-form/text-input.js +100 -0
- package/es/components/react-hook-form/utils/field-label.js +15 -0
- package/es/components/react-hook-form/utils/functions.js +42 -0
- package/es/components/react-hook-form/utils/submit-button.js +25 -0
- package/es/components/react-hook-form/utils/text-field-with-adornment.js +92 -0
- package/{lib → es}/components/translations/card-error-boundary-en.js +1 -7
- package/{lib → es}/components/translations/card-error-boundary-fr.js +1 -7
- package/{lib → es}/components/translations/element-search-en.js +1 -7
- package/{lib → es}/components/translations/element-search-fr.js +1 -7
- package/{lib → es}/components/translations/equipment-search-en.js +1 -7
- package/{lib → es}/components/translations/equipment-search-fr.js +1 -7
- package/es/components/translations/inputs-en.js +25 -0
- package/es/components/translations/inputs-fr.js +25 -0
- package/{lib → es}/components/translations/login-en.js +1 -7
- package/{lib → es}/components/translations/login-fr.js +1 -7
- package/{lib → es}/components/translations/report-viewer-en.js +1 -7
- package/{lib → es}/components/translations/report-viewer-fr.js +1 -7
- package/{lib → es}/components/translations/table-en.js +1 -7
- package/{lib → es}/components/translations/table-fr.js +1 -7
- package/{lib → es}/components/translations/top-bar-en.js +1 -7
- package/{lib → es}/components/translations/top-bar-fr.js +1 -7
- package/{lib → es}/components/translations/treeview-finder-en.js +1 -7
- package/{lib → es}/components/translations/treeview-finder-fr.js +1 -7
- package/{lib → es}/hooks/useDebounce.js +7 -12
- package/{lib → es}/hooks/useIntlRef.js +7 -10
- package/{lib → es}/hooks/useSnackMessage.js +9 -13
- package/es/index.js +62 -0
- package/{lib → es}/utils/AuthService.js +23 -34
- package/es/utils/ElementType.js +37 -0
- package/{lib → es}/utils/EquipmentType.js +8 -18
- package/{lib → es}/utils/UserManagerMock.js +2 -7
- package/es/utils/actions.js +65 -0
- package/{lib → es}/utils/algos.js +1 -5
- package/{lib → es}/utils/styles.js +4 -11
- package/package.json +10 -4
- package/lib/components/AuthenticationRouter/AuthenticationRouter.js +0 -111
- package/lib/components/AuthenticationRouter/index.js +0 -8
- package/lib/components/CardErrorBoundary/index.js +0 -8
- package/lib/components/ElementSearchDialog/element-search-dialog.js +0 -127
- package/lib/components/ElementSearchDialog/index.js +0 -9
- package/lib/components/ElementSearchDialog/tag-renderer.js +0 -36
- package/lib/components/FlatParameters/index.js +0 -8
- package/lib/components/Login/Login.js +0 -86
- package/lib/components/Login/Logout.js +0 -85
- package/lib/components/Login/index.js +0 -8
- package/lib/components/MuiVirtualizedTable/ColumnHeader.js +0 -134
- package/lib/components/MuiVirtualizedTable/index.js +0 -12
- package/lib/components/OverflowableText/index.js +0 -8
- package/lib/components/ReportViewer/index.js +0 -8
- package/lib/components/ReportViewerDialog/index.js +0 -8
- package/lib/components/ReportViewerDialog/report-viewer-dialog.js +0 -75
- package/lib/components/SignInCallbackHandler/SignInCallbackHandler.js +0 -27
- package/lib/components/SignInCallbackHandler/index.js +0 -8
- package/lib/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +0 -27
- package/lib/components/SilentRenewCallbackHandler/index.js +0 -8
- package/lib/components/SnackbarProvider/SnackbarProvider.js +0 -45
- package/lib/components/SnackbarProvider/index.js +0 -8
- package/lib/components/TopBar/TopBar.js +0 -576
- package/lib/components/TopBar/index.js +0 -8
- package/lib/components/TreeViewFinder/index.js +0 -9
- package/lib/index.js +0 -105
- package/lib/utils/ElementType.js +0 -45
- package/lib/utils/actions.js +0 -83
- /package/{lib → es}/components/images/powsybl_logo.svg +0 -0
|
@@ -1,36 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.generateMuiVirtualizedTableClass = exports["default"] = exports.DEFAULT_ROW_HEIGHT = exports.DEFAULT_HEADER_HEIGHT = exports.DEFAULT_CELL_PADDING = void 0;
|
|
5
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
-
var _reactIntl = require("react-intl");
|
|
7
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
-
var _clsx3 = _interopRequireDefault(require("clsx"));
|
|
9
|
-
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
10
|
-
var _material = require("@mui/material");
|
|
11
|
-
var _system = require("@mui/system");
|
|
12
|
-
var _GetApp = _interopRequireDefault(require("@mui/icons-material/GetApp"));
|
|
13
|
-
var _reactVirtualized = require("react-virtualized");
|
|
14
|
-
var _reactCsvDownloader = _interopRequireDefault(require("react-csv-downloader"));
|
|
15
|
-
var _overflowableText = _interopRequireDefault(require("../OverflowableText/overflowable-text"));
|
|
16
|
-
var _styles = require("../../utils/styles");
|
|
17
|
-
var _KeyedColumnsRowIndexer = require("./KeyedColumnsRowIndexer");
|
|
18
|
-
var _ColumnHeader = _interopRequireDefault(require("./ColumnHeader"));
|
|
19
1
|
var _excluded = ["sort"],
|
|
20
2
|
_excluded2 = ["dataKey"];
|
|
21
3
|
var _defaultStyles;
|
|
22
|
-
/**
|
|
23
|
-
* Copyright (c) 2022, RTE (http://www.rte-france.com)
|
|
24
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
25
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
26
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
27
|
-
*/
|
|
28
|
-
/**
|
|
29
|
-
* This class has been taken from 'Virtualized Table' example at https://material-ui.com/components/tables/
|
|
30
|
-
*/
|
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
32
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
34
4
|
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; }
|
|
35
5
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
36
6
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -42,6 +12,30 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
42
12
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
43
13
|
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); }
|
|
44
14
|
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); }
|
|
15
|
+
/**
|
|
16
|
+
* Copyright (c) 2022, RTE (http://www.rte-france.com)
|
|
17
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
18
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
19
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This class has been taken from 'Virtualized Table' example at https://material-ui.com/components/tables/
|
|
24
|
+
*/
|
|
25
|
+
import React, { createRef } from 'react';
|
|
26
|
+
import { FormattedMessage } from 'react-intl';
|
|
27
|
+
import PropTypes from 'prop-types';
|
|
28
|
+
import clsx from 'clsx';
|
|
29
|
+
import memoize from 'memoize-one';
|
|
30
|
+
import { Autocomplete, Chip, IconButton, Popover, TableCell, TextField } from '@mui/material';
|
|
31
|
+
import { styled } from '@mui/system';
|
|
32
|
+
import GetAppIcon from '@mui/icons-material/GetApp';
|
|
33
|
+
import { AutoSizer, Column, Table } from 'react-virtualized';
|
|
34
|
+
import CsvDownloader from 'react-csv-downloader';
|
|
35
|
+
import OverflowableText from '../OverflowableText/overflowable-text';
|
|
36
|
+
import { toNestedGlobalSelectors, makeComposeClasses } from '../../utils/styles';
|
|
37
|
+
import { CHANGE_WAYS, collectibleHelper, getHelper, KeyedColumnsRowIndexer } from './KeyedColumnsRowIndexer';
|
|
38
|
+
import ColumnHeader from './ColumnHeader';
|
|
45
39
|
function getTextWidth(text) {
|
|
46
40
|
// re-use canvas object for better performance
|
|
47
41
|
var canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement('canvas'));
|
|
@@ -51,15 +45,12 @@ function getTextWidth(text) {
|
|
|
51
45
|
var metrics = context.measureText(text);
|
|
52
46
|
return metrics.width;
|
|
53
47
|
}
|
|
54
|
-
var DEFAULT_CELL_PADDING = 16;
|
|
55
|
-
|
|
56
|
-
var
|
|
57
|
-
exports.DEFAULT_HEADER_HEIGHT = DEFAULT_HEADER_HEIGHT;
|
|
58
|
-
var DEFAULT_ROW_HEIGHT = 48;
|
|
48
|
+
export var DEFAULT_CELL_PADDING = 16;
|
|
49
|
+
export var DEFAULT_HEADER_HEIGHT = 48;
|
|
50
|
+
export var DEFAULT_ROW_HEIGHT = 48;
|
|
59
51
|
|
|
60
52
|
// As a bunch of individual variables to try to make it easier
|
|
61
53
|
// to track that they are all used. Not sure, maybe group them in an object ?
|
|
62
|
-
exports.DEFAULT_ROW_HEIGHT = DEFAULT_ROW_HEIGHT;
|
|
63
54
|
var cssFlexContainer = 'flexContainer';
|
|
64
55
|
var cssTable = 'table';
|
|
65
56
|
var cssTableRow = 'tableRow';
|
|
@@ -102,18 +93,17 @@ var defaultTooltipSx = {
|
|
|
102
93
|
};
|
|
103
94
|
|
|
104
95
|
//TODO do we need to export this to clients (index.js) ?
|
|
105
|
-
var generateMuiVirtualizedTableClass = function generateMuiVirtualizedTableClass(className) {
|
|
96
|
+
export var generateMuiVirtualizedTableClass = function generateMuiVirtualizedTableClass(className) {
|
|
106
97
|
return "MuiVirtualizedTable-" + className;
|
|
107
98
|
};
|
|
108
|
-
|
|
109
|
-
var composeClasses = (0, _styles.makeComposeClasses)(generateMuiVirtualizedTableClass);
|
|
99
|
+
var composeClasses = makeComposeClasses(generateMuiVirtualizedTableClass);
|
|
110
100
|
var AmongChooser = function AmongChooser(props) {
|
|
111
101
|
var options = props.options,
|
|
112
102
|
value = props.value,
|
|
113
103
|
setValue = props.setValue,
|
|
114
104
|
id = props.id,
|
|
115
105
|
onDropDownVisibility = props.onDropDownVisibility;
|
|
116
|
-
return /*#__PURE__*/
|
|
106
|
+
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Autocomplete, {
|
|
117
107
|
id: id,
|
|
118
108
|
value: value !== null && value !== void 0 ? value : [],
|
|
119
109
|
multiple: true,
|
|
@@ -128,13 +118,13 @@ var AmongChooser = function AmongChooser(props) {
|
|
|
128
118
|
},
|
|
129
119
|
options: options,
|
|
130
120
|
renderInput: function renderInput(props) {
|
|
131
|
-
return /*#__PURE__*/
|
|
121
|
+
return /*#__PURE__*/React.createElement(TextField, _extends({
|
|
132
122
|
autoFocus: true
|
|
133
123
|
}, props));
|
|
134
124
|
},
|
|
135
125
|
renderTags: function renderTags(val, getTagsProps) {
|
|
136
126
|
return val.map(function (code, index) {
|
|
137
|
-
return /*#__PURE__*/
|
|
127
|
+
return /*#__PURE__*/React.createElement(Chip, _extends({
|
|
138
128
|
id: 'chip_' + code,
|
|
139
129
|
size: 'small',
|
|
140
130
|
label: code
|
|
@@ -166,13 +156,13 @@ var initIndexer = function initIndexer(props, oldProps, versionSetter) {
|
|
|
166
156
|
if (props.indexer) {
|
|
167
157
|
return props.indexer;
|
|
168
158
|
}
|
|
169
|
-
return new
|
|
159
|
+
return new KeyedColumnsRowIndexer(true, true, null, versionSetter);
|
|
170
160
|
};
|
|
171
|
-
var preFilterData = (
|
|
161
|
+
var preFilterData = memoize(function (columns, rows, filterFromProps, indexer, filterVersion // filterVersion is unused directly, used only as a workaround just to reset the memoization
|
|
172
162
|
) {
|
|
173
163
|
return indexer.preFilterRowMapping(columns, rows, filterFromProps);
|
|
174
164
|
});
|
|
175
|
-
var reorderIndex = (
|
|
165
|
+
var reorderIndex = memoize(function (indexer, indirectionVersion, rows, columns, filterFromProps, sortFromProps) {
|
|
176
166
|
if (!rows) {
|
|
177
167
|
return {
|
|
178
168
|
viewIndexToModel: [],
|
|
@@ -231,7 +221,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
231
221
|
_defineProperty(_assertThisInitialized(_this), "computeDataWidth", function (text) {
|
|
232
222
|
return getTextWidth(text || '') + 2 * DEFAULT_CELL_PADDING;
|
|
233
223
|
});
|
|
234
|
-
_defineProperty(_assertThisInitialized(_this), "sizes", (
|
|
224
|
+
_defineProperty(_assertThisInitialized(_this), "sizes", memoize(function (columns, rows, rowGetter) {
|
|
235
225
|
var sizes = {};
|
|
236
226
|
columns.forEach(function (col) {
|
|
237
227
|
if (col.width) {
|
|
@@ -259,7 +249,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
259
249
|
var col = _this.props.columns.find(function (c) {
|
|
260
250
|
return c.dataKey === colKey;
|
|
261
251
|
});
|
|
262
|
-
if (
|
|
252
|
+
if (getHelper(col) !== collectibleHelper) {
|
|
263
253
|
return;
|
|
264
254
|
}
|
|
265
255
|
_this.dropDownVisible = false;
|
|
@@ -315,7 +305,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
315
305
|
var col = _this.props.columns.find(function (c) {
|
|
316
306
|
return c.dataKey === colKey;
|
|
317
307
|
});
|
|
318
|
-
return /*#__PURE__*/
|
|
308
|
+
return /*#__PURE__*/React.createElement(AmongChooser, {
|
|
319
309
|
options: options,
|
|
320
310
|
value: userParams,
|
|
321
311
|
id: 'fielt' + colKey,
|
|
@@ -349,13 +339,13 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
349
339
|
_this.openPopover(evt.target, colKey);
|
|
350
340
|
return;
|
|
351
341
|
}
|
|
352
|
-
var way =
|
|
342
|
+
var way = CHANGE_WAYS.SIMPLE;
|
|
353
343
|
if (evt.ctrlKey && evt.shiftKey) {
|
|
354
|
-
way =
|
|
344
|
+
way = CHANGE_WAYS.AMEND;
|
|
355
345
|
} else if (evt.ctrlKey) {
|
|
356
|
-
way =
|
|
346
|
+
way = CHANGE_WAYS.REMOVE;
|
|
357
347
|
} else if (evt.shiftKey) {
|
|
358
|
-
way =
|
|
348
|
+
way = CHANGE_WAYS.TAIL;
|
|
359
349
|
}
|
|
360
350
|
if (_this.state.indexer.updateSortingFromUser(colKey, way)) {
|
|
361
351
|
_this.setState({
|
|
@@ -401,7 +391,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
401
391
|
var onFilterClick = numeric || _this.props.sort || columns[columnIndex].cellRenderer ? undefined : function (ev, retargeted) {
|
|
402
392
|
_this.filterClickHandler(ev, retargeted, columnIndex);
|
|
403
393
|
};
|
|
404
|
-
return /*#__PURE__*/
|
|
394
|
+
return /*#__PURE__*/React.createElement(ColumnHeader, {
|
|
405
395
|
label: label,
|
|
406
396
|
ref: function ref(e) {
|
|
407
397
|
return _this._registerHeader(label, e);
|
|
@@ -417,7 +407,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
417
407
|
});
|
|
418
408
|
_defineProperty(_assertThisInitialized(_this), "simpleHeaderRenderer", function (_ref4) {
|
|
419
409
|
var label = _ref4.label;
|
|
420
|
-
return /*#__PURE__*/
|
|
410
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
421
411
|
ref: function ref(element) {
|
|
422
412
|
_this._registerHeader(label, element);
|
|
423
413
|
}
|
|
@@ -430,7 +420,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
430
420
|
var _this$props = _this.props,
|
|
431
421
|
classes = _this$props.classes,
|
|
432
422
|
onRowClick = _this$props.onRowClick;
|
|
433
|
-
return (
|
|
423
|
+
return clsx(composeClasses(classes, cssTableRow), composeClasses(classes, cssFlexContainer), index % 2 === 0 && composeClasses(classes, cssRowBackgroundDark), index % 2 !== 0 && composeClasses(classes, cssRowBackgroundLight), ((_rowGetter = rowGetter(index)) === null || _rowGetter === void 0 ? void 0 : _rowGetter.notClickable) === true && composeClasses(classes, cssNoClick), (_clsx = {}, _clsx[composeClasses(classes, cssTableRowHover)] = index !== -1 && onRowClick != null, _clsx));
|
|
434
424
|
});
|
|
435
425
|
_defineProperty(_assertThisInitialized(_this), "onClickableRowClick", function (event) {
|
|
436
426
|
var _event$rowData;
|
|
@@ -451,9 +441,9 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
451
441
|
rows = _this$props2.rows,
|
|
452
442
|
tooltipSx = _this$props2.tooltipSx;
|
|
453
443
|
var displayedValue = _this.getDisplayValue(columns[columnIndex], cellData);
|
|
454
|
-
return /*#__PURE__*/
|
|
444
|
+
return /*#__PURE__*/React.createElement(TableCell, {
|
|
455
445
|
component: "div",
|
|
456
|
-
className: (
|
|
446
|
+
className: clsx(composeClasses(classes, cssTableCell), composeClasses(classes, cssFlexContainer), (_clsx2 = {}, _clsx2[composeClasses(classes, cssNoClick)] = displayedValue === undefined || ((_rows$rowIndex = rows[rowIndex]) === null || _rows$rowIndex === void 0 ? void 0 : _rows$rowIndex.notClickable) === true || onCellClick == null || columns[columnIndex].clickable === undefined || !columns[columnIndex].clickable, _clsx2[composeClasses(classes, cssTableCellColor)] = displayedValue === undefined || onCellClick !== null && !((_rows$rowIndex2 = rows[rowIndex]) === null || _rows$rowIndex2 === void 0 ? void 0 : _rows$rowIndex2.notClickable) === true && columns[columnIndex].clickable !== undefined && columns[columnIndex].clickable, _clsx2)),
|
|
457
447
|
variant: "body",
|
|
458
448
|
style: {
|
|
459
449
|
height: rowHeight,
|
|
@@ -466,7 +456,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
466
456
|
onCellClick(rows[rowIndex], columns[columnIndex]);
|
|
467
457
|
}
|
|
468
458
|
}
|
|
469
|
-
}, /*#__PURE__*/
|
|
459
|
+
}, /*#__PURE__*/React.createElement(OverflowableText, {
|
|
470
460
|
text: displayedValue,
|
|
471
461
|
tooltipStyle: classes.cellTooltip,
|
|
472
462
|
tooltipSx: _extends({}, defaultTooltipSx, tooltipSx)
|
|
@@ -477,7 +467,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
477
467
|
var _this$props3 = _this.props,
|
|
478
468
|
sort = _this$props3.sort,
|
|
479
469
|
otherProps = _objectWithoutPropertiesLoose(_this$props3, _excluded);
|
|
480
|
-
return /*#__PURE__*/
|
|
470
|
+
return /*#__PURE__*/React.createElement(Table, _extends({}, otherProps, {
|
|
481
471
|
height: height,
|
|
482
472
|
width: width,
|
|
483
473
|
rowHeight: otherProps.rowHeight,
|
|
@@ -503,7 +493,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
503
493
|
}), otherProps.columns.map(function (_ref9, index) {
|
|
504
494
|
var dataKey = _ref9.dataKey,
|
|
505
495
|
other = _objectWithoutPropertiesLoose(_ref9, _excluded2);
|
|
506
|
-
return /*#__PURE__*/
|
|
496
|
+
return /*#__PURE__*/React.createElement(Column, _extends({
|
|
507
497
|
key: dataKey,
|
|
508
498
|
headerRenderer: _this.makeHeaderRenderer(dataKey, index),
|
|
509
499
|
className: composeClasses(otherProps.classes, cssFlexContainer),
|
|
@@ -548,7 +538,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
548
538
|
}
|
|
549
539
|
return Promise.resolve(csvData);
|
|
550
540
|
});
|
|
551
|
-
_defineProperty(_assertThisInitialized(_this), "csvHeaders", (
|
|
541
|
+
_defineProperty(_assertThisInitialized(_this), "csvHeaders", memoize(function (columns, exportCSVDataKeys) {
|
|
552
542
|
var tempHeaders = [];
|
|
553
543
|
columns.forEach(function (col) {
|
|
554
544
|
if (exportCSVDataKeys !== undefined && exportCSVDataKeys.find(function (el) {
|
|
@@ -565,7 +555,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
565
555
|
_this._computeHeaderSize = _this._computeHeaderSize.bind(_assertThisInitialized(_this));
|
|
566
556
|
_this._registerHeader = _this._registerHeader.bind(_assertThisInitialized(_this));
|
|
567
557
|
_this._registerObserver = _this._registerObserver.bind(_assertThisInitialized(_this));
|
|
568
|
-
_this.headers =
|
|
558
|
+
_this.headers = createRef();
|
|
569
559
|
_this.headers.current = {};
|
|
570
560
|
var _options = {
|
|
571
561
|
root: null,
|
|
@@ -675,9 +665,9 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
675
665
|
columns = _this$props4.columns,
|
|
676
666
|
classes = _this$props4.classes;
|
|
677
667
|
return function (headerProps) {
|
|
678
|
-
return /*#__PURE__*/
|
|
668
|
+
return /*#__PURE__*/React.createElement(TableCell, {
|
|
679
669
|
component: "div",
|
|
680
|
-
className: (
|
|
670
|
+
className: clsx(composeClasses(classes, cssTableCell), composeClasses(classes, cssFlexContainer), composeClasses(classes, cssNoClick), composeClasses(classes, cssHeader)),
|
|
681
671
|
variant: "head",
|
|
682
672
|
style: {
|
|
683
673
|
height: _this3.state.headerHeight
|
|
@@ -701,37 +691,37 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
701
691
|
rowGetter = _reorderIndex.rowGetter;
|
|
702
692
|
var sizes = this.sizes(this.props.columns, this.props.rows, rowGetter);
|
|
703
693
|
var csvHeaders = this.csvHeaders(this.props.columns, this.props.exportCSVDataKeys);
|
|
704
|
-
return /*#__PURE__*/
|
|
694
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
705
695
|
style: {
|
|
706
696
|
display: 'flex',
|
|
707
697
|
flexDirection: 'column',
|
|
708
698
|
height: '100%'
|
|
709
699
|
},
|
|
710
700
|
className: this.props.className
|
|
711
|
-
}, this.props.enableExportCSV && /*#__PURE__*/
|
|
701
|
+
}, this.props.enableExportCSV && /*#__PURE__*/React.createElement("div", {
|
|
712
702
|
style: {
|
|
713
703
|
display: 'flex',
|
|
714
704
|
justifyContent: 'flex-end',
|
|
715
705
|
alignItems: 'center'
|
|
716
706
|
}
|
|
717
|
-
}, /*#__PURE__*/
|
|
707
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
718
708
|
id: "MuiVirtualizedTable/exportCSV"
|
|
719
|
-
}), /*#__PURE__*/
|
|
709
|
+
}), /*#__PURE__*/React.createElement(CsvDownloader, {
|
|
720
710
|
datas: this.getCSVData,
|
|
721
711
|
columns: csvHeaders,
|
|
722
712
|
filename: this.getCSVFilename()
|
|
723
|
-
}, /*#__PURE__*/
|
|
713
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
724
714
|
"aria-label": "exportCSVButton",
|
|
725
715
|
size: "large"
|
|
726
|
-
}, /*#__PURE__*/
|
|
716
|
+
}, /*#__PURE__*/React.createElement(GetAppIcon, null)))), /*#__PURE__*/React.createElement("div", {
|
|
727
717
|
style: {
|
|
728
718
|
flexGrow: 1
|
|
729
719
|
}
|
|
730
|
-
}, /*#__PURE__*/
|
|
720
|
+
}, /*#__PURE__*/React.createElement(AutoSizer, null, function (_ref10) {
|
|
731
721
|
var height = _ref10.height,
|
|
732
722
|
width = _ref10.width;
|
|
733
723
|
return _this4.makeSizedTable(height, width, sizes, viewIndexToModel, rowGetter);
|
|
734
|
-
})), this.state.popoverAnchorEl && /*#__PURE__*/
|
|
724
|
+
})), this.state.popoverAnchorEl && /*#__PURE__*/React.createElement(Popover, {
|
|
735
725
|
anchorEl: this.state.popoverAnchorEl,
|
|
736
726
|
anchorOrigin: {
|
|
737
727
|
vertical: 'bottom',
|
|
@@ -752,7 +742,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
752
742
|
}, this.makeColumnFilterEditor()));
|
|
753
743
|
};
|
|
754
744
|
return MuiVirtualizedTable;
|
|
755
|
-
}(
|
|
745
|
+
}(React.PureComponent);
|
|
756
746
|
_defineProperty(MuiVirtualizedTable, "defaultProps", {
|
|
757
747
|
headerHeight: DEFAULT_HEADER_HEIGHT,
|
|
758
748
|
rowHeight: DEFAULT_ROW_HEIGHT,
|
|
@@ -760,31 +750,30 @@ _defineProperty(MuiVirtualizedTable, "defaultProps", {
|
|
|
760
750
|
classes: {}
|
|
761
751
|
});
|
|
762
752
|
MuiVirtualizedTable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
763
|
-
name:
|
|
764
|
-
classes:
|
|
765
|
-
rows:
|
|
766
|
-
columns:
|
|
767
|
-
dataKey:
|
|
768
|
-
label:
|
|
769
|
-
numeric:
|
|
770
|
-
width:
|
|
771
|
-
minWidth:
|
|
772
|
-
maxWidth:
|
|
773
|
-
unit:
|
|
774
|
-
fractionDigits:
|
|
753
|
+
name: PropTypes.string,
|
|
754
|
+
classes: PropTypes.object,
|
|
755
|
+
rows: PropTypes.array,
|
|
756
|
+
columns: PropTypes.arrayOf(PropTypes.shape({
|
|
757
|
+
dataKey: PropTypes.string.isRequired,
|
|
758
|
+
label: PropTypes.string.isRequired,
|
|
759
|
+
numeric: PropTypes.bool,
|
|
760
|
+
width: PropTypes.number,
|
|
761
|
+
minWidth: PropTypes.number,
|
|
762
|
+
maxWidth: PropTypes.number,
|
|
763
|
+
unit: PropTypes.string,
|
|
764
|
+
fractionDigits: PropTypes.number
|
|
775
765
|
})).isRequired,
|
|
776
|
-
enableExportCSV:
|
|
777
|
-
exportCSVDataKeys:
|
|
778
|
-
sort:
|
|
779
|
-
sortable:
|
|
780
|
-
indexer:
|
|
781
|
-
headerHeight:
|
|
782
|
-
onRowClick:
|
|
783
|
-
onCellClick:
|
|
784
|
-
rowHeight:
|
|
785
|
-
filter:
|
|
786
|
-
tooltipSx:
|
|
766
|
+
enableExportCSV: PropTypes.bool,
|
|
767
|
+
exportCSVDataKeys: PropTypes.array,
|
|
768
|
+
sort: PropTypes.func,
|
|
769
|
+
sortable: PropTypes.bool,
|
|
770
|
+
indexer: PropTypes.object,
|
|
771
|
+
headerHeight: PropTypes.number,
|
|
772
|
+
onRowClick: PropTypes.func,
|
|
773
|
+
onCellClick: PropTypes.func,
|
|
774
|
+
rowHeight: PropTypes.number,
|
|
775
|
+
filter: PropTypes.func,
|
|
776
|
+
tooltipSx: PropTypes.object
|
|
787
777
|
} : {};
|
|
788
|
-
var nestedGlobalSelectorsStyles =
|
|
789
|
-
|
|
790
|
-
exports["default"] = _default;
|
|
778
|
+
var nestedGlobalSelectorsStyles = toNestedGlobalSelectors(defaultStyles, generateMuiVirtualizedTableClass);
|
|
779
|
+
export default styled(MuiVirtualizedTable)(nestedGlobalSelectorsStyles);
|
|
@@ -0,0 +1,9 @@
|
|
|
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';
|
|
@@ -0,0 +1,7 @@
|
|
|
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,23 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports["default"] = exports.OverflowableText = void 0;
|
|
5
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
-
var _material = require("@mui/material");
|
|
7
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
-
var _system = require("@mui/system");
|
|
9
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; }
|
|
10
4
|
/**
|
|
11
5
|
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
12
6
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
13
7
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
14
8
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
15
9
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
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; }
|
|
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';
|
|
21
14
|
var overflowStyle = {
|
|
22
15
|
overflow: {
|
|
23
16
|
display: 'inline-block',
|
|
@@ -31,26 +24,27 @@ var overflowStyle = {
|
|
|
31
24
|
maxWidth: 'fit-content'
|
|
32
25
|
}
|
|
33
26
|
};
|
|
34
|
-
var OverflowableText =
|
|
27
|
+
export var OverflowableText = styled(function (_ref) {
|
|
28
|
+
var _element$current, _element$current2;
|
|
35
29
|
var text = _ref.text,
|
|
36
30
|
tooltipStyle = _ref.tooltipStyle,
|
|
37
31
|
tooltipSx = _ref.tooltipSx,
|
|
38
32
|
className = _ref.className,
|
|
39
33
|
children = _ref.children,
|
|
40
34
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
41
|
-
var element =
|
|
42
|
-
var _useState =
|
|
35
|
+
var element = useRef();
|
|
36
|
+
var _useState = useState(false),
|
|
43
37
|
overflowed = _useState[0],
|
|
44
38
|
setOverflowed = _useState[1];
|
|
45
|
-
var checkOverflow =
|
|
39
|
+
var checkOverflow = useCallback(function () {
|
|
46
40
|
if (!element.current) {
|
|
47
41
|
return;
|
|
48
42
|
}
|
|
49
43
|
setOverflowed(element.current.scrollWidth > element.current.clientWidth);
|
|
50
44
|
}, [setOverflowed, element]);
|
|
51
|
-
(
|
|
45
|
+
useLayoutEffect(function () {
|
|
52
46
|
checkOverflow();
|
|
53
|
-
}, [checkOverflow, text]);
|
|
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]);
|
|
54
48
|
var defaultTooltipSx = !tooltipStyle ? overflowStyle.tooltip : false;
|
|
55
49
|
// the previous tooltipStyle classname API was replacing default, not
|
|
56
50
|
// merging with the defaults, so keep the same behavior with the new tooltipSx API
|
|
@@ -66,24 +60,22 @@ var OverflowableText = (0, _system.styled)(function (_ref) {
|
|
|
66
60
|
}
|
|
67
61
|
}
|
|
68
62
|
});
|
|
69
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
70
64
|
title: text || '',
|
|
71
65
|
disableHoverListener: !overflowed
|
|
72
|
-
}, tooltipStyleProps /* legacy classes or newer slotProps API */), /*#__PURE__*/
|
|
66
|
+
}, tooltipStyleProps /* legacy classes or newer slotProps API */), /*#__PURE__*/React.createElement(Box, _extends({}, props, {
|
|
73
67
|
ref: element,
|
|
74
68
|
children: children || text,
|
|
75
69
|
className: className,
|
|
76
70
|
sx: overflowStyle.overflow
|
|
77
71
|
})));
|
|
78
72
|
})({});
|
|
79
|
-
exports.OverflowableText = OverflowableText;
|
|
80
73
|
OverflowableText.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
81
|
-
children:
|
|
82
|
-
text:
|
|
83
|
-
tooltipStyle:
|
|
84
|
-
tooltipSx:
|
|
85
|
-
sx:
|
|
86
|
-
className:
|
|
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.object,
|
|
79
|
+
className: PropTypes.string
|
|
87
80
|
} : {};
|
|
88
|
-
|
|
89
|
-
exports["default"] = _default;
|
|
81
|
+
export default OverflowableText;
|
|
@@ -0,0 +1,7 @@
|
|
|
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,7 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports["default"] = void 0;
|
|
5
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; }
|
|
6
2
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
7
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); }
|
|
@@ -66,7 +62,6 @@ var LogReportItem = /*#__PURE__*/function () {
|
|
|
66
62
|
};
|
|
67
63
|
return LogReportItem;
|
|
68
64
|
}();
|
|
69
|
-
exports["default"] = LogReportItem;
|
|
70
65
|
_defineProperty(LogReportItem, "SEVERITY", {
|
|
71
66
|
UNKNOWN: {
|
|
72
67
|
name: 'UNKNOWN',
|
|
@@ -99,4 +94,4 @@ _defineProperty(LogReportItem, "SEVERITY", {
|
|
|
99
94
|
colorHexCode: '#BA55D3'
|
|
100
95
|
}
|
|
101
96
|
});
|
|
102
|
-
|
|
97
|
+
export { LogReportItem as default };
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports["default"] = void 0;
|
|
5
|
-
var _logReportItem = _interopRequireDefault(require("./log-report-item"));
|
|
6
|
-
var _uuid = require("uuid");
|
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
8
1
|
/**
|
|
9
2
|
* Copyright (c) 2021, RTE (http://www.rte-france.com)
|
|
10
3
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
11
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
12
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
13
6
|
*/
|
|
7
|
+
|
|
8
|
+
import LogReportItem from './log-report-item';
|
|
9
|
+
import { v4 as uuid4 } from 'uuid';
|
|
14
10
|
var LogReport = /*#__PURE__*/function () {
|
|
15
11
|
function LogReport(jsonReporter, parentReportId) {
|
|
16
|
-
this.id = (
|
|
12
|
+
this.id = uuid4();
|
|
17
13
|
this.key = jsonReporter.taskKey;
|
|
18
|
-
this.title =
|
|
14
|
+
this.title = LogReportItem.resolveTemplateMessage(jsonReporter.defaultName, jsonReporter.taskValues);
|
|
19
15
|
this.subReports = [];
|
|
20
16
|
this.logs = [];
|
|
21
17
|
this.parentReportId = parentReportId;
|
|
@@ -45,12 +41,12 @@ var LogReport = /*#__PURE__*/function () {
|
|
|
45
41
|
return _this.subReports.push(new LogReport(value, _this.id));
|
|
46
42
|
});
|
|
47
43
|
jsonReporter.reports.map(function (value) {
|
|
48
|
-
return _this.logs.push(new
|
|
44
|
+
return _this.logs.push(new LogReportItem(value, _this.id));
|
|
49
45
|
});
|
|
50
46
|
};
|
|
51
47
|
_proto.getHighestSeverity = function getHighestSeverity(currentSeverity) {
|
|
52
48
|
if (currentSeverity === void 0) {
|
|
53
|
-
currentSeverity =
|
|
49
|
+
currentSeverity = LogReportItem.SEVERITY.UNKNOWN;
|
|
54
50
|
}
|
|
55
51
|
var reduceFct = function reduceFct(p, c) {
|
|
56
52
|
return p.level < c.level ? c : p;
|
|
@@ -64,5 +60,4 @@ var LogReport = /*#__PURE__*/function () {
|
|
|
64
60
|
};
|
|
65
61
|
return LogReport;
|
|
66
62
|
}();
|
|
67
|
-
|
|
68
|
-
module.exports = exports.default;
|
|
63
|
+
export { LogReport as default };
|