diff --git a/src/src/components/Object/ObjectChart.jsx b/src/src/components/Object/ObjectChart.jsx index 2433e9c63..f8c003a7f 100644 --- a/src/src/components/Object/ObjectChart.jsx +++ b/src/src/components/Object/ObjectChart.jsx @@ -250,12 +250,12 @@ class ObjectChart extends Component { state && this.rangeValues && (!this.rangeValues.length || this.rangeValues[this.rangeValues.length - 1].ts < state.ts)) { - if (!this.state.max || state.ts - this.state.max < 120000) { + if (!this.state.max || state.ts - this.state.max < 120_000) { this.chartValues && this.chartValues.push({ val: state.val, ts: state.ts }); this.rangeValues.push({ val: state.val, ts: state.ts }); // update only if end is near to now - if (state.ts >= this.chart.min && state.ts <= this.chart.max + 300000) { + if (state.ts >= this.chart.min && state.ts <= this.chart.max + 300_000) { this.updateChart(); } } @@ -472,6 +472,7 @@ class ObjectChart extends Component { } else { this.maxY = Math.ceil(this.maxY); } + return chart; }); } diff --git a/src/src/components/ObjectBrowser.jsx b/src/src/components/ObjectBrowser.jsx index 31c9eba67..e6a490d1b 100644 --- a/src/src/components/ObjectBrowser.jsx +++ b/src/src/components/ObjectBrowser.jsx @@ -6693,11 +6693,14 @@ class ObjectBrowser extends Component { const classes = this.props.classes; const items = this.renderItem(this.root, undefined, classes); - return this.navigateKeyPress(event)} tabIndex={0}> - {this.getToolbar()} - + return + + {this.getToolbar()} + + {this.renderHeader()} -
+ {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */} +
this.navigateKeyPress(event)} tabIndex={0}> {items}
@@ -6728,8 +6731,8 @@ ObjectBrowser.defaultProps = { objectStatesView: false, objectImportExport: false, objectEditOfAccessControl: false, - modalNewObject: () => {}, - modalEditOfAccessControl: () => {}, + modalNewObject: () => undefined, + modalEditOfAccessControl: () => undefined, }; ObjectBrowser.propTypes = { diff --git a/src/src/components/TabContainer.jsx b/src/src/components/TabContainer.tsx similarity index 56% rename from src/src/components/TabContainer.jsx rename to src/src/components/TabContainer.tsx index 311ef4d15..5bde906a0 100644 --- a/src/src/components/TabContainer.jsx +++ b/src/src/components/TabContainer.tsx @@ -1,11 +1,9 @@ // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined import React from 'react'; import { withStyles } from '@mui/styles'; -import PropTypes from 'prop-types'; - import { Grid, Paper } from '@mui/material'; - import { Utils } from '@iobroker/adapter-react-v5'; +import type { ReactNodeLike } from 'prop-types'; const styles = { root: { @@ -18,25 +16,27 @@ const styles = { container: { height: '100%', }, -}; +} as const; -/** - * @typedef {object} TabContainerProps - * @property {number} [elevation] The elevation of the tab container. - * @property {string} [overflow] Set to 'visible' show the overflow. - * @property {{ [key in keyof styles]: string}} classes The styling class names. - * - * @extends {React.Component} - */ -class TabContainer extends React.Component { +interface TabContainerProps { + /** The content of the component. */ + children: ReactNodeLike; + /** The elevation of the tab container. */ + elevation?:number; + /** Set to 'visible' show the overflow. */ + overflow?: string; + className?: string; + /** Additional css classes */ + classes: { [key in keyof typeof styles]: string}; +} + +class TabContainer extends React.Component { render() { const { classes } = this.props; return { - const { classes } = props; - - return - {props.children} - ; -}; - -TabContent.propTypes = { - /** - * The content of the component. - */ - children: PropTypes.node, - /** - * Overflow behavior - */ - overflow: PropTypes.string, -}; - -export default withStyles(styles)(TabContent); diff --git a/src/src/components/TabContent.tsx b/src/src/components/TabContent.tsx new file mode 100644 index 000000000..483788a3e --- /dev/null +++ b/src/src/components/TabContent.tsx @@ -0,0 +1,39 @@ +import type { ReactNodeLike } from 'prop-types'; +import { withStyles } from '@mui/styles'; +import { Grid } from '@mui/material'; +import { Utils } from '@iobroker/adapter-react-v5'; +import React from 'react'; + +const styles = { + root: { + height: '100%', + overflow: 'hidden', + }, + overflowAuto: { + overflow: 'auto', + }, +} as const; + +interface TabContentProps { + /** The content of the component. */ + children: ReactNodeLike; + /** Overflow behavior */ + overflow: string; + /** Additional css classes */ + classes: { [key in keyof typeof styles]: string}; +} + +class TabContent extends React.Component { + render(): React.JSX.Element { + const { classes } = this.props; + + return + {this.props.children} + ; + } +} + +export default withStyles(styles)(TabContent);