@gridsuite/commons-ui 0.34.1 → 0.35.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/lib/components/ElementSearchDialog/equipment-item.js +12 -5
- package/lib/components/ElementSearchDialog/tag-renderer.js +4 -1
- package/lib/components/FlatParameters/FlatParameters.js +18 -21
- package/lib/components/Login/Login.js +22 -20
- package/lib/components/Login/Logout.js +18 -20
- package/lib/components/MuiVirtualizedTable/ColumnHeader.js +53 -54
- package/lib/components/MuiVirtualizedTable/MuiVirtualizedTable.js +80 -55
- package/lib/components/MuiVirtualizedTable/index.js +5 -3
- package/lib/components/OverflowableText/overflowable-text.js +38 -27
- package/lib/components/ReportViewer/log-table.js +15 -15
- package/lib/components/ReportViewer/report-item.js +61 -49
- package/lib/components/ReportViewer/report-viewer.js +5 -7
- package/lib/components/ReportViewerDialog/report-viewer-dialog.js +6 -8
- package/lib/components/TopBar/TopBar.js +157 -160
- package/lib/components/TreeViewFinder/TreeViewFinder.js +51 -39
- package/lib/components/TreeViewFinder/index.js +5 -4
- package/lib/components/translations/top-bar-en.js +2 -1
- package/lib/components/translations/top-bar-fr.js +2 -1
- package/lib/utils/EquipmentType.js +30 -30
- package/lib/utils/styles.js +42 -0
- package/package.json +1 -2
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports["default"] = exports.DEFAULT_ROW_HEIGHT = exports.DEFAULT_HEADER_HEIGHT = exports.DEFAULT_CELL_PADDING = void 0;
|
|
4
|
+
exports.generateMuiVirtualizedTableClass = exports["default"] = exports.DEFAULT_ROW_HEIGHT = exports.DEFAULT_HEADER_HEIGHT = exports.DEFAULT_CELL_PADDING = void 0;
|
|
5
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
6
6
|
var _reactIntl = require("react-intl");
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
8
|
var _clsx3 = _interopRequireDefault(require("clsx"));
|
|
9
9
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
10
10
|
var _material = require("@mui/material");
|
|
11
|
-
var
|
|
11
|
+
var _system = require("@mui/system");
|
|
12
12
|
var _GetApp = _interopRequireDefault(require("@mui/icons-material/GetApp"));
|
|
13
13
|
var _reactVirtualized = require("react-virtualized");
|
|
14
14
|
var _reactCsvDownloader = _interopRequireDefault(require("react-csv-downloader"));
|
|
15
15
|
var _overflowableText = _interopRequireDefault(require("../OverflowableText/overflowable-text"));
|
|
16
|
+
var _styles = require("../../utils/styles");
|
|
16
17
|
var _KeyedColumnsRowIndexer = require("./KeyedColumnsRowIndexer");
|
|
17
18
|
var _ColumnHeader = _interopRequireDefault(require("./ColumnHeader"));
|
|
18
19
|
var _excluded = ["sort"],
|
|
19
20
|
_excluded2 = ["dataKey"];
|
|
21
|
+
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
|
+
*/
|
|
20
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
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); }
|
|
22
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; }
|
|
@@ -30,14 +41,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Objec
|
|
|
30
41
|
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; }
|
|
31
42
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
32
43
|
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); }
|
|
33
|
-
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); }
|
|
34
|
-
* Copyright (c) 2022, RTE (http://www.rte-france.com)
|
|
35
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
36
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
37
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
38
|
-
*/ /**
|
|
39
|
-
* This class has been taken from 'Virtualized Table' example at https://material-ui.com/components/tables/
|
|
40
|
-
*/
|
|
44
|
+
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); }
|
|
41
45
|
function getTextWidth(text) {
|
|
42
46
|
// re-use canvas object for better performance
|
|
43
47
|
var canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement('canvas'));
|
|
@@ -52,42 +56,57 @@ exports.DEFAULT_CELL_PADDING = DEFAULT_CELL_PADDING;
|
|
|
52
56
|
var DEFAULT_HEADER_HEIGHT = 48;
|
|
53
57
|
exports.DEFAULT_HEADER_HEIGHT = DEFAULT_HEADER_HEIGHT;
|
|
54
58
|
var DEFAULT_ROW_HEIGHT = 48;
|
|
59
|
+
|
|
60
|
+
// As a bunch of individual variables to try to make it easier
|
|
61
|
+
// to track that they are all used. Not sure, maybe group them in an object ?
|
|
55
62
|
exports.DEFAULT_ROW_HEIGHT = DEFAULT_ROW_HEIGHT;
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
tableCellColor: {},
|
|
78
|
-
noClick: {
|
|
79
|
-
cursor: 'initial'
|
|
80
|
-
},
|
|
81
|
-
header: {
|
|
82
|
-
fontWeight: 'bold'
|
|
83
|
-
},
|
|
84
|
-
rowBackgroundDark: {},
|
|
85
|
-
rowBackgroundLight: {},
|
|
86
|
-
cellTooltip: {
|
|
87
|
-
maxWidth: '1260px',
|
|
88
|
-
fontSize: '0.9rem'
|
|
63
|
+
var cssFlexContainer = 'flexContainer';
|
|
64
|
+
var cssTable = 'table';
|
|
65
|
+
var cssTableRow = 'tableRow';
|
|
66
|
+
var cssTableRowHover = 'tableRowHover';
|
|
67
|
+
var cssTableCell = 'tableCell';
|
|
68
|
+
var cssTableCellColor = 'tableCellColor';
|
|
69
|
+
var cssNoClick = 'noClick';
|
|
70
|
+
var cssHeader = 'header';
|
|
71
|
+
var cssRowBackgroundDark = 'rowBackgroundDark';
|
|
72
|
+
var cssRowBackgroundLight = 'rowBackgroundLight';
|
|
73
|
+
|
|
74
|
+
// converted to nested rules
|
|
75
|
+
var defaultStyles = (_defaultStyles = {}, _defaultStyles[cssFlexContainer] = {
|
|
76
|
+
display: 'flex',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
boxSizing: 'border-box'
|
|
79
|
+
}, _defaultStyles[cssTable] = {
|
|
80
|
+
// temporary right-to-left patch, waiting for
|
|
81
|
+
// https://github.com/bvaughn/react-virtualized/issues/454
|
|
82
|
+
'& .ReactVirtualized__Table__headerRow': {
|
|
83
|
+
flip: false
|
|
89
84
|
}
|
|
85
|
+
}, _defaultStyles[cssTableRow] = {
|
|
86
|
+
cursor: 'pointer'
|
|
87
|
+
}, _defaultStyles[cssTableRowHover] = {}, _defaultStyles[cssTableCell] = {
|
|
88
|
+
flex: 1,
|
|
89
|
+
padding: DEFAULT_CELL_PADDING + 'px'
|
|
90
|
+
}, _defaultStyles[cssTableCellColor] = {}, _defaultStyles[cssNoClick] = {
|
|
91
|
+
cursor: 'initial'
|
|
92
|
+
}, _defaultStyles[cssHeader] = {
|
|
93
|
+
fontWeight: 'bold'
|
|
94
|
+
}, _defaultStyles[cssRowBackgroundDark] = {}, _defaultStyles[cssRowBackgroundLight] = {}, _defaultStyles);
|
|
95
|
+
|
|
96
|
+
// TODO find a better system, maybe MUI will fix/improve this ?
|
|
97
|
+
// Different from all others because of the poor nested sx support for portals
|
|
98
|
+
// requiring classname sharing/forwarding between the content and the tooltip
|
|
99
|
+
var defaultTooltipSx = {
|
|
100
|
+
maxWidth: '1260px',
|
|
101
|
+
fontSize: '0.9rem'
|
|
90
102
|
};
|
|
103
|
+
|
|
104
|
+
//TODO do we need to export this to clients (index.js) ?
|
|
105
|
+
var generateMuiVirtualizedTableClass = function generateMuiVirtualizedTableClass(className) {
|
|
106
|
+
return "MuiVirtualizedTable-" + className;
|
|
107
|
+
};
|
|
108
|
+
exports.generateMuiVirtualizedTableClass = generateMuiVirtualizedTableClass;
|
|
109
|
+
var composeClasses = (0, _styles.makeComposeClasses)(generateMuiVirtualizedTableClass);
|
|
91
110
|
var AmongChooser = function AmongChooser(props) {
|
|
92
111
|
var options = props.options,
|
|
93
112
|
value = props.value,
|
|
@@ -411,7 +430,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
411
430
|
var _this$props = _this.props,
|
|
412
431
|
classes = _this$props.classes,
|
|
413
432
|
onRowClick = _this$props.onRowClick;
|
|
414
|
-
return (0, _clsx3["default"])(classes
|
|
433
|
+
return (0, _clsx3["default"])(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));
|
|
415
434
|
});
|
|
416
435
|
_defineProperty(_assertThisInitialized(_this), "onClickableRowClick", function (event) {
|
|
417
436
|
var _event$rowData;
|
|
@@ -429,11 +448,12 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
429
448
|
classes = _this$props2.classes,
|
|
430
449
|
rowHeight = _this$props2.rowHeight,
|
|
431
450
|
onCellClick = _this$props2.onCellClick,
|
|
432
|
-
rows = _this$props2.rows
|
|
451
|
+
rows = _this$props2.rows,
|
|
452
|
+
tooltipSx = _this$props2.tooltipSx;
|
|
433
453
|
var displayedValue = _this.getDisplayValue(columns[columnIndex], cellData);
|
|
434
454
|
return /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
435
455
|
component: "div",
|
|
436
|
-
className: (0, _clsx3["default"])(classes
|
|
456
|
+
className: (0, _clsx3["default"])(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)),
|
|
437
457
|
variant: "body",
|
|
438
458
|
style: {
|
|
439
459
|
height: rowHeight,
|
|
@@ -448,7 +468,8 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
448
468
|
}
|
|
449
469
|
}, /*#__PURE__*/_react["default"].createElement(_overflowableText["default"], {
|
|
450
470
|
text: displayedValue,
|
|
451
|
-
tooltipStyle: classes.cellTooltip
|
|
471
|
+
tooltipStyle: classes.cellTooltip,
|
|
472
|
+
tooltipSx: _extends({}, defaultTooltipSx, tooltipSx)
|
|
452
473
|
}));
|
|
453
474
|
});
|
|
454
475
|
_defineProperty(_assertThisInitialized(_this), "makeSizedTable", function (height, width, sizes, reorderedIndex, _rowGetter2) {
|
|
@@ -464,7 +485,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
464
485
|
direction: 'inherit'
|
|
465
486
|
},
|
|
466
487
|
headerHeight: _this.state.headerHeight,
|
|
467
|
-
className: otherProps.classes
|
|
488
|
+
className: composeClasses(otherProps.classes, cssTable),
|
|
468
489
|
onRowClick: _this.props.onRowClick && /* The {...otherProps} just above would hold the slot onRowClick */
|
|
469
490
|
_this.onClickableRowClick,
|
|
470
491
|
rowCount: (_reorderedIndex$lengt = reorderedIndex === null || reorderedIndex === void 0 ? void 0 : reorderedIndex.length) !== null && _reorderedIndex$lengt !== void 0 ? _reorderedIndex$lengt : otherProps.rows.length,
|
|
@@ -485,7 +506,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
485
506
|
return /*#__PURE__*/_react["default"].createElement(_reactVirtualized.Column, _extends({
|
|
486
507
|
key: dataKey,
|
|
487
508
|
headerRenderer: _this.makeHeaderRenderer(dataKey, index),
|
|
488
|
-
className: otherProps.classes
|
|
509
|
+
className: composeClasses(otherProps.classes, cssFlexContainer),
|
|
489
510
|
cellRenderer: _this.cellRenderer,
|
|
490
511
|
dataKey: dataKey,
|
|
491
512
|
flexGrow: 1,
|
|
@@ -656,7 +677,7 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
656
677
|
return function (headerProps) {
|
|
657
678
|
return /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
658
679
|
component: "div",
|
|
659
|
-
className: (0, _clsx3["default"])(classes
|
|
680
|
+
className: (0, _clsx3["default"])(composeClasses(classes, cssTableCell), composeClasses(classes, cssFlexContainer), composeClasses(classes, cssNoClick), composeClasses(classes, cssHeader)),
|
|
660
681
|
variant: "head",
|
|
661
682
|
style: {
|
|
662
683
|
height: _this3.state.headerHeight
|
|
@@ -685,7 +706,8 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
685
706
|
display: 'flex',
|
|
686
707
|
flexDirection: 'column',
|
|
687
708
|
height: '100%'
|
|
688
|
-
}
|
|
709
|
+
},
|
|
710
|
+
className: this.props.className
|
|
689
711
|
}, this.props.enableExportCSV && /*#__PURE__*/_react["default"].createElement("div", {
|
|
690
712
|
style: {
|
|
691
713
|
display: 'flex',
|
|
@@ -734,11 +756,12 @@ var MuiVirtualizedTable = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
734
756
|
_defineProperty(MuiVirtualizedTable, "defaultProps", {
|
|
735
757
|
headerHeight: DEFAULT_HEADER_HEIGHT,
|
|
736
758
|
rowHeight: DEFAULT_ROW_HEIGHT,
|
|
737
|
-
enableExportCSV: false
|
|
759
|
+
enableExportCSV: false,
|
|
760
|
+
classes: {}
|
|
738
761
|
});
|
|
739
762
|
MuiVirtualizedTable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
740
763
|
name: _propTypes["default"].string,
|
|
741
|
-
classes: _propTypes["default"].object
|
|
764
|
+
classes: _propTypes["default"].object,
|
|
742
765
|
rows: _propTypes["default"].array,
|
|
743
766
|
columns: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
744
767
|
dataKey: _propTypes["default"].string.isRequired,
|
|
@@ -759,7 +782,9 @@ MuiVirtualizedTable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
759
782
|
onRowClick: _propTypes["default"].func,
|
|
760
783
|
onCellClick: _propTypes["default"].func,
|
|
761
784
|
rowHeight: _propTypes["default"].number,
|
|
762
|
-
filter: _propTypes["default"].func
|
|
785
|
+
filter: _propTypes["default"].func,
|
|
786
|
+
tooltipSx: _propTypes["default"].object
|
|
763
787
|
} : {};
|
|
764
|
-
var
|
|
788
|
+
var nestedGlobalSelectorsStyles = (0, _styles.toNestedGlobalSelectors)(defaultStyles, generateMuiVirtualizedTableClass);
|
|
789
|
+
var _default = (0, _system.styled)(MuiVirtualizedTable)(nestedGlobalSelectorsStyles);
|
|
765
790
|
exports["default"] = _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports["default"] = exports.KeyedColumnsRowIndexer = exports.CHANGE_WAYS = void 0;
|
|
5
|
-
var _MuiVirtualizedTable =
|
|
4
|
+
exports.generateMuiVirtualizedTableClass = exports["default"] = exports.KeyedColumnsRowIndexer = exports.CHANGE_WAYS = void 0;
|
|
5
|
+
var _MuiVirtualizedTable = _interopRequireWildcard(require("./MuiVirtualizedTable"));
|
|
6
6
|
exports["default"] = _MuiVirtualizedTable["default"];
|
|
7
|
+
exports.generateMuiVirtualizedTableClass = _MuiVirtualizedTable.generateMuiVirtualizedTableClass;
|
|
7
8
|
var _KeyedColumnsRowIndexer = require("./KeyedColumnsRowIndexer");
|
|
8
9
|
exports.KeyedColumnsRowIndexer = _KeyedColumnsRowIndexer.KeyedColumnsRowIndexer;
|
|
9
10
|
exports.CHANGE_WAYS = _KeyedColumnsRowIndexer.CHANGE_WAYS;
|
|
10
|
-
function
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
@@ -5,9 +5,8 @@ exports["default"] = exports.OverflowableText = void 0;
|
|
|
5
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
6
6
|
var _material = require("@mui/material");
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var _excluded = ["text", "tooltipStyle", "className", "children"];
|
|
8
|
+
var _system = require("@mui/system");
|
|
9
|
+
var _excluded = ["text", "tooltipStyle", "tooltipSx", "className", "children"];
|
|
11
10
|
/**
|
|
12
11
|
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
13
12
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -19,30 +18,27 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
18
|
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; }
|
|
20
19
|
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); }
|
|
21
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; }
|
|
22
|
-
var overflowStyle =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
};
|
|
21
|
+
var overflowStyle = {
|
|
22
|
+
overflow: {
|
|
23
|
+
display: 'inline-block',
|
|
24
|
+
whiteSpace: 'pre',
|
|
25
|
+
textOverflow: 'ellipsis',
|
|
26
|
+
overflow: 'hidden'
|
|
27
|
+
},
|
|
28
|
+
tooltip: {
|
|
29
|
+
whiteSpace: 'pre',
|
|
30
|
+
width: 'fit-content',
|
|
31
|
+
maxWidth: 'fit-content'
|
|
32
|
+
}
|
|
36
33
|
};
|
|
37
|
-
var
|
|
38
|
-
var OverflowableText = function OverflowableText(_ref) {
|
|
34
|
+
var OverflowableText = (0, _system.styled)(function (_ref) {
|
|
39
35
|
var text = _ref.text,
|
|
40
36
|
tooltipStyle = _ref.tooltipStyle,
|
|
37
|
+
tooltipSx = _ref.tooltipSx,
|
|
41
38
|
className = _ref.className,
|
|
42
39
|
children = _ref.children,
|
|
43
40
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
44
41
|
var element = (0, _react.useRef)();
|
|
45
|
-
var classes = useStyles();
|
|
46
42
|
var _useState = (0, _react.useState)(false),
|
|
47
43
|
overflowed = _useState[0],
|
|
48
44
|
setOverflowed = _useState[1];
|
|
@@ -55,23 +51,38 @@ var OverflowableText = function OverflowableText(_ref) {
|
|
|
55
51
|
(0, _react.useEffect)(function () {
|
|
56
52
|
checkOverflow();
|
|
57
53
|
}, [checkOverflow, text]);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
var defaultTooltipSx = !tooltipStyle ? overflowStyle.tooltip : false;
|
|
55
|
+
// the previous tooltipStyle classname API was replacing default, not
|
|
56
|
+
// merging with the defaults, so keep the same behavior with the new tooltipSx API
|
|
57
|
+
var finalTooltipSx = tooltipSx || defaultTooltipSx;
|
|
58
|
+
var tooltipStyleProps = _extends({}, tooltipStyle && {
|
|
61
59
|
classes: {
|
|
62
|
-
tooltip: tooltipStyle
|
|
60
|
+
tooltip: tooltipStyle
|
|
61
|
+
}
|
|
62
|
+
}, finalTooltipSx && {
|
|
63
|
+
slotProps: {
|
|
64
|
+
tooltip: {
|
|
65
|
+
sx: finalTooltipSx
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
|
-
}
|
|
68
|
+
});
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement(_material.Tooltip, _extends({
|
|
70
|
+
title: text || '',
|
|
71
|
+
disableHoverListener: !overflowed
|
|
72
|
+
}, tooltipStyleProps /* legacy classes or newer slotProps API */), /*#__PURE__*/_react["default"].createElement(_material.Box, _extends({}, props, {
|
|
65
73
|
ref: element,
|
|
66
74
|
children: children || text,
|
|
67
|
-
className:
|
|
75
|
+
className: className,
|
|
76
|
+
sx: overflowStyle.overflow
|
|
68
77
|
})));
|
|
69
|
-
};
|
|
78
|
+
})({});
|
|
70
79
|
exports.OverflowableText = OverflowableText;
|
|
71
80
|
OverflowableText.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
72
81
|
children: _propTypes["default"].array,
|
|
73
82
|
text: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].node]),
|
|
74
83
|
tooltipStyle: _propTypes["default"].string,
|
|
84
|
+
tooltipSx: _propTypes["default"].object,
|
|
85
|
+
sx: _propTypes["default"].object,
|
|
75
86
|
className: _propTypes["default"].string
|
|
76
87
|
} : {};
|
|
77
88
|
var _default = OverflowableText;
|
|
@@ -4,8 +4,8 @@ exports.__esModule = true;
|
|
|
4
4
|
exports["default"] = void 0;
|
|
5
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
6
6
|
var _reactIntl = require("react-intl");
|
|
7
|
-
var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
|
|
8
7
|
var _TableCell = _interopRequireDefault(require("@mui/material/TableCell"));
|
|
8
|
+
var _system = require("@mui/system");
|
|
9
9
|
var _MuiVirtualizedTable = _interopRequireDefault(require("../MuiVirtualizedTable"));
|
|
10
10
|
var _styles = require("@mui/material/styles");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -19,27 +19,27 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
var SEVERITY_COLUMN_FIXED_WIDTH = 100;
|
|
22
|
-
var styles =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
var styles = {
|
|
23
|
+
flexContainer: {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
boxSizing: 'border-box'
|
|
27
|
+
},
|
|
28
|
+
table: function table(theme) {
|
|
29
|
+
return {
|
|
30
30
|
// temporary right-to-left patch, waiting for
|
|
31
31
|
// https://github.com/bvaughn/react-virtualized/issues/454
|
|
32
32
|
'& .ReactVirtualized__Table__headerRow': {
|
|
33
33
|
flip: false,
|
|
34
34
|
paddingRight: theme.direction === 'rtl' ? '0 !important' : undefined
|
|
35
35
|
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
header: {
|
|
39
|
+
variant: 'header'
|
|
40
|
+
}
|
|
41
41
|
};
|
|
42
|
-
var VirtualizedTable = (0,
|
|
42
|
+
var VirtualizedTable = (0, _system.styled)(_MuiVirtualizedTable["default"])(styles);
|
|
43
43
|
var LogTable = function LogTable(_ref) {
|
|
44
44
|
var logs = _ref.logs,
|
|
45
45
|
onRowClick = _ref.onRowClick;
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
7
|
+
var _system = require("@mui/system");
|
|
6
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
-
var _makeStyles = _interopRequireDefault(require("@mui/styles/makeStyles"));
|
|
8
9
|
var _TreeItem = _interopRequireDefault(require("@mui/lab/TreeItem"));
|
|
9
10
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
10
11
|
var _Label = _interopRequireDefault(require("@mui/icons-material/Label"));
|
|
11
12
|
var _reportTreeViewContext = _interopRequireDefault(require("./report-tree-view-context"));
|
|
12
|
-
var
|
|
13
|
-
var _excluded = ["labelText", "labelIconColor"];
|
|
13
|
+
var _excluded = ["labelText", "labelIconColor", "className"];
|
|
14
14
|
/**
|
|
15
15
|
* Copyright (c) 2021, RTE (http://www.rte-france.com)
|
|
16
16
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -22,96 +22,108 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
22
22
|
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; }
|
|
23
23
|
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); }
|
|
24
24
|
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; }
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
var styles = {
|
|
26
|
+
root: function root(theme) {
|
|
27
|
+
return {
|
|
28
28
|
color: theme.palette.text.secondary,
|
|
29
|
-
'&:hover >
|
|
29
|
+
'&:hover > .MuiTreeItem-content': {
|
|
30
30
|
backgroundColor: theme.palette.action.hover
|
|
31
31
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
content: function content(theme) {
|
|
35
|
+
return {
|
|
34
36
|
color: theme.palette.text.secondary,
|
|
35
37
|
borderRadius: theme.spacing(2),
|
|
36
38
|
width: 'fit-content',
|
|
37
39
|
paddingRight: theme.spacing(1),
|
|
38
40
|
fontWeight: theme.typography.fontWeightMedium,
|
|
39
|
-
'
|
|
41
|
+
'&.Mui-expanded': {
|
|
40
42
|
fontWeight: theme.typography.fontWeightRegular
|
|
41
43
|
},
|
|
42
|
-
/*
|
|
43
|
-
|
|
44
|
-
'&&.Mui-focused, &&$selected': {
|
|
44
|
+
/* &.MuiTreeItem-content.Mui-focused to increase specifity because mui5 has a rule for &.Mui-selected.Mui-focused */
|
|
45
|
+
'&.MuiTreeItem-content.Mui-focused, &.Mui-selected': {
|
|
45
46
|
backgroundColor: "var(--tree-view-bg-color, " + theme.palette.action.selected + ")",
|
|
46
47
|
color: 'var(--tree-view-color)'
|
|
47
48
|
},
|
|
48
49
|
// same as mui v4 behavior on label text only right after clicking in contrast to after moving away with arrow keys.
|
|
49
|
-
'
|
|
50
|
+
'&.Mui-selected .MuiTreeItem-label:hover, &.Mui-selected.Mui-focused .MuiTreeItem-label': {
|
|
50
51
|
borderRadius: theme.spacing(2),
|
|
51
52
|
backgroundColor: (0, _system.alpha)(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity)
|
|
52
53
|
},
|
|
53
|
-
'&.Mui-focused
|
|
54
|
+
'&.Mui-focused .MuiTreeItem-label, &:hover .MuiTreeItem-label, &Mui-selected .MuiTreeItem-label': {
|
|
54
55
|
backgroundColor: 'transparent'
|
|
55
56
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
group: function group(theme) {
|
|
60
|
+
return {
|
|
61
|
+
marginLeft: '10px',
|
|
62
|
+
'& .MuiTreeItem-content': {
|
|
60
63
|
paddingLeft: theme.spacing(2)
|
|
61
64
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
expanded: {},
|
|
68
|
+
selected: {},
|
|
69
|
+
label: {
|
|
70
|
+
fontWeight: 'inherit',
|
|
71
|
+
color: 'inherit'
|
|
72
|
+
},
|
|
73
|
+
labelRoot: function labelRoot(theme) {
|
|
74
|
+
return {
|
|
70
75
|
display: 'flex',
|
|
71
76
|
alignItems: 'center',
|
|
72
77
|
padding: theme.spacing(0.5, 0)
|
|
73
|
-
}
|
|
74
|
-
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
labelRootHighlighted: function labelRootHighlighted(theme) {
|
|
81
|
+
return {
|
|
75
82
|
display: 'flex',
|
|
76
83
|
alignItems: 'center',
|
|
77
84
|
padding: theme.spacing(0.5, 0),
|
|
78
85
|
backgroundColor: theme.palette.action.selected
|
|
79
|
-
}
|
|
80
|
-
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
labelIcon: function labelIcon(theme) {
|
|
89
|
+
return {
|
|
81
90
|
marginRight: theme.spacing(1)
|
|
82
|
-
}
|
|
83
|
-
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
labelText: function labelText(theme) {
|
|
94
|
+
return {
|
|
84
95
|
fontWeight: 'inherit',
|
|
85
96
|
marginRight: theme.spacing(2)
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
};
|
|
89
100
|
var ReportItem = function ReportItem(props) {
|
|
90
101
|
// using a context because TreeItem uses useMemo on this. See report-viewer.js for the provider
|
|
91
102
|
var _useContext = (0, _react.useContext)(_reportTreeViewContext["default"]),
|
|
92
103
|
isHighlighted = _useContext.isHighlighted;
|
|
93
104
|
var highlighted = isHighlighted ? isHighlighted(props.nodeId) : false;
|
|
94
|
-
var classes = useReportItemStyles();
|
|
95
105
|
var labelText = props.labelText,
|
|
96
106
|
labelIconColor = props.labelIconColor,
|
|
107
|
+
className = props.className,
|
|
97
108
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
98
109
|
return /*#__PURE__*/_react["default"].createElement(_TreeItem["default"], _extends({
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
className: className,
|
|
111
|
+
sx: {
|
|
112
|
+
'&': styles.root,
|
|
113
|
+
'& .MuiTreeItem-content': styles.content,
|
|
114
|
+
'& .Mui-expanded': styles.expanded,
|
|
115
|
+
'& .Mui-selected': styles.selected,
|
|
116
|
+
'& .MuiTreeItem-group': styles.group,
|
|
117
|
+
'& .MuiTreeItem-label': styles.label
|
|
106
118
|
},
|
|
107
|
-
label: /*#__PURE__*/_react["default"].createElement("
|
|
108
|
-
|
|
119
|
+
label: /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
120
|
+
sx: highlighted ? styles.labelRootHighlighted : styles.labelRoot
|
|
109
121
|
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
|
110
122
|
htmlColor: labelIconColor,
|
|
111
|
-
|
|
123
|
+
sx: styles.labelIcon
|
|
112
124
|
}), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
113
125
|
variant: "body2",
|
|
114
|
-
|
|
126
|
+
sx: styles.labelText
|
|
115
127
|
}, labelText))
|
|
116
128
|
}, other));
|
|
117
129
|
};
|
|
@@ -121,6 +133,6 @@ ReportItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
121
133
|
labelInfo: _propTypes["default"].string,
|
|
122
134
|
labelText: _propTypes["default"].string.isRequired
|
|
123
135
|
} : {};
|
|
124
|
-
var _default = ReportItem;
|
|
136
|
+
var _default = (0, _system.styled)(ReportItem)({});
|
|
125
137
|
exports["default"] = _default;
|
|
126
138
|
module.exports = exports.default;
|