Skip to content

Commit

Permalink
Optimize imports
Browse files Browse the repository at this point in the history
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
  • Loading branch information
flomillot committed Feb 6, 2024
1 parent 7fb34a3 commit 63261ad
Show file tree
Hide file tree
Showing 23 changed files with 125 additions and 97 deletions.
3 changes: 1 addition & 2 deletions demo/src/InputsTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import React from 'react';
import * as yup from 'yup';
import { yupResolver } from '@hookform/resolvers/yup';
import { FormProvider, useForm } from 'react-hook-form';
import { Grid } from '@mui/material';
import { Box } from '@mui/material';
import { Box, Grid } from '@mui/material';
import AutocompleteInput from '../../src/components/react-hook-form/autocomplete-input';
import TextInput from '../../src/components/react-hook-form/text-input';
import RadioInput from '../../src/components/react-hook-form/radio-input';
Expand Down
10 changes: 8 additions & 2 deletions demo/src/TableTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ import { DEFAULT_CELL_PADDING, KeyedColumnsRowIndexer } from '../../src';
import { styled } from '@mui/system';
import withStyles from '@mui/styles/withStyles/withStyles.js';

import { Box, FormControlLabel, Stack, Switch, TextField } from '@mui/material';
import {
Box,
Button,
FormControlLabel,
Stack,
Switch,
TextField,
} from '@mui/material';
import MuiVirtualizedTable, {
generateMuiVirtualizedTableClass,
} from '../../src/components/MuiVirtualizedTable';
import { Button } from '@mui/material';
import { CHANGE_WAYS } from '../../src/components/MuiVirtualizedTable/KeyedColumnsRowIndexer';

import { toNestedGlobalSelectors } from '../../src/utils/styles';
Expand Down
16 changes: 9 additions & 7 deletions demo/src/TreeViewFinderConfig.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
*/
import React from 'react';

import { Radio } from '@mui/material';
import { RadioGroup } from '@mui/material';
import { FormControlLabel } from '@mui/material';
import { FormControl } from '@mui/material';
import { FormLabel } from '@mui/material';
import { FormGroup } from '@mui/material';
import { Checkbox } from '@mui/material';
import {
Checkbox,
FormControl,
FormControlLabel,
FormGroup,
FormLabel,
Radio,
RadioGroup,
} from '@mui/material';

/**
* TreeViewFinderConfig documentation :
Expand Down
10 changes: 5 additions & 5 deletions demo/src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@ import {
} from '../../src';
import { useSnackMessage } from '../../src/hooks/useSnackMessage';

import { ThemeProvider } from '@mui/material';
import { createTheme } from '@mui/material';
import StyledEngineProvider from '@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js';
import { makeStyles, withStyles } from '@mui/styles';
import { styled } from '@mui/system';
import {
Box,
Button,
Checkbox,
createTheme,
CssBaseline,
FormControl,
FormControlLabel,
Expand All @@ -45,8 +41,12 @@ import {
Tab,
Tabs,
TextField,
ThemeProvider,
Typography,
} from '@mui/material';
import StyledEngineProvider from '@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js';
import { makeStyles, withStyles } from '@mui/styles';
import { styled } from '@mui/system';

import { useMatch } from 'react-router';
import { IntlProvider, useIntl } from 'react-intl';
Expand Down
4 changes: 1 addition & 3 deletions src/components/AuthenticationRouter/AuthenticationRouter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import SilentRenewCallbackHandler from '../SilentRenewCallbackHandler';
import Login from '../Login';
import Logout from '../Login/Logout';

import { Grid } from '@mui/material';
import { Alert } from '@mui/material';
import { AlertTitle } from '@mui/material';
import { Alert, AlertTitle, Grid } from '@mui/material';
import { FormattedMessage } from 'react-intl';

const AuthenticationRouter = ({
Expand Down
26 changes: 15 additions & 11 deletions src/components/CardErrorBoundary/card-error-boundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@
// https://mui.com/material-ui/react-card/#complex-interaction

import React from 'react';
import { Box } from '@mui/material';
import { Card } from '@mui/material';
import { CardHeader } from '@mui/material';
import { CardContent } from '@mui/material';
import { CardActions } from '@mui/material';
import { Collapse } from '@mui/material';
import { IconButton } from '@mui/material';
import { ExpandMore as ExpandMoreIcon } from '@mui/icons-material';
import { Replay as ReplayIcon } from '@mui/icons-material';
import { Typography } from '@mui/material';
import { styled } from '@mui/material';
import {
Box,
Card,
CardActions,
CardContent,
CardHeader,
Collapse,
IconButton,
styled,
Typography,
} from '@mui/material';
import {
ExpandMore as ExpandMoreIcon,
Replay as ReplayIcon,
} from '@mui/icons-material';
import { FormattedMessage } from 'react-intl';

const ExpandMore = styled((props) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/FlatParameters/FlatParameters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import React, { useCallback, useState } from 'react';
import {
Autocomplete,
Chip,
Divider,
IconButton,
List,
ListItem,
MenuItem,
Expand All @@ -17,8 +19,6 @@ import {
TextField,
Tooltip,
Typography,
Divider,
IconButton,
} from '@mui/material';
import { Tune as TuneIcon } from '@mui/icons-material';
import { FormattedMessage, useIntl } from 'react-intl';
Expand Down
14 changes: 8 additions & 6 deletions src/components/Login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
*/

import React from 'react';
import { Avatar } from '@mui/material';
import { Button } from '@mui/material';
import { Link } from '@mui/material';
import { Box } from '@mui/material';
import {
Avatar,
Box,
Button,
Container,
Link,
Typography,
} from '@mui/material';
import { LockOutlined as LockOutlinedIcon } from '@mui/icons-material';
import { Typography } from '@mui/material';
import { Container } from '@mui/material';
import { FormattedMessage } from 'react-intl';

const styles = {
Expand Down
14 changes: 8 additions & 6 deletions src/components/Login/Logout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
*/

import React from 'react';
import { Avatar } from '@mui/material';
import { Button } from '@mui/material';
import { Link } from '@mui/material';
import { Box } from '@mui/material';
import {
Avatar,
Box,
Button,
Container,
Link,
Typography,
} from '@mui/material';
import { LogoutOutlined as LogoutOutlinedIcon } from '@mui/icons-material';
import { Typography } from '@mui/material';
import { Container } from '@mui/material';
import { FormattedMessage } from 'react-intl';

const styles = {
Expand Down
8 changes: 5 additions & 3 deletions src/components/MuiVirtualizedTable/ColumnHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

import React, { useRef } from 'react';

import { FilterAltOutlined as FilterAltOutlinedIcon } from '@mui/icons-material';
import {
ArrowDownward as ArrowDownwardIcon,
ArrowUpward as ArrowUpwardIcon,
FilterAltOutlined as FilterAltOutlinedIcon,
} from '@mui/icons-material';

import { styled } from '@mui/system';
import { Box } from '@mui/material';
import { ArrowUpward as ArrowUpwardIcon } from '@mui/icons-material';
import { ArrowDownward as ArrowDownwardIcon } from '@mui/icons-material';
import { mergeSx } from '../../utils/styles';

const styles = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/MuiVirtualizedTable/MuiVirtualizedTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import { AutoSizer, Column, Table } from 'react-virtualized';
import CsvDownloader from 'react-csv-downloader';
import OverflowableText from '../OverflowableText/overflowable-text';
import {
toNestedGlobalSelectors,
makeComposeClasses,
toNestedGlobalSelectors,
} from '../../utils/styles';
import {
CHANGE_WAYS,
Expand Down
18 changes: 11 additions & 7 deletions src/components/MultipleSelectionDialog/MultipleSelectionDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { Dialog, DialogContent, List } from '@mui/material';
import { DialogTitle } from '@mui/material';
import {
Button,
Checkbox,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
FormControlLabel,
Grid,
List,
} from '@mui/material';
import { FormattedMessage } from 'react-intl';
import { FormControlLabel } from '@mui/material';
import { Checkbox } from '@mui/material';
import React, { useState } from 'react';
import { DialogActions } from '@mui/material';
import { Button } from '@mui/material';
import { Grid } from '@mui/material';

const MultipleSelectionDialog = ({
options,
Expand Down
3 changes: 1 addition & 2 deletions src/components/ReportViewer/log-table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
*/
import React, { memo, useCallback, useEffect, useState } from 'react';
import { useIntl } from 'react-intl';
import { TableCell } from '@mui/material';
import { TableCell, useTheme } from '@mui/material';
import { styled } from '@mui/system';
import MuiVirtualizedTable from '../MuiVirtualizedTable';
import { useTheme } from '@mui/material';
import { FilterButton } from './filter-button';

const SEVERITY_COLUMN_FIXED_WIDTH = 115;
Expand Down
4 changes: 1 addition & 3 deletions src/components/ReportViewer/multi-select-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import React from 'react';
import { Menu } from '@mui/material';
import { MenuItem } from '@mui/material';
import { Checkbox, FormControlLabel } from '@mui/material';
import { Checkbox, FormControlLabel, Menu, MenuItem } from '@mui/material';

const styles = {
label: {
Expand Down
6 changes: 2 additions & 4 deletions src/components/ReportViewer/report-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
*/

import React, { useContext } from 'react';
import { Box } from '@mui/material';
import { styled } from '@mui/system';
import { Box, Typography } from '@mui/material';
import { alpha, styled } from '@mui/system';
import PropTypes from 'prop-types';
import TreeItem from '@mui/lab/TreeItem/TreeItem.js';
import { Typography } from '@mui/material';
import { Label } from '@mui/icons-material';
import ReportTreeViewContext from './report-tree-view-context';
import { alpha } from '@mui/system';

const styles = {
root: (theme) => ({
Expand Down
6 changes: 4 additions & 2 deletions src/components/ReportViewer/report-viewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import React, {
useState,
} from 'react';
import TreeView from '@mui/lab/TreeView/TreeView.js';
import { ArrowDropDown as ArrowDropDownIcon } from '@mui/icons-material';
import { ArrowRight as ArrowRightIcon } from '@mui/icons-material';
import {
ArrowDropDown as ArrowDropDownIcon,
ArrowRight as ArrowRightIcon,
} from '@mui/icons-material';
import ReportItem from './report-item';
import LogReport from './log-report';
import { Grid } from '@mui/material';
Expand Down
17 changes: 11 additions & 6 deletions src/components/ReportViewerDialog/report-viewer-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
*/

import React, { useState } from 'react';
import { DialogTitle } from '@mui/material';
import { DialogActions } from '@mui/material';
import { Button } from '@mui/material';
import { Fullscreen as FullscreenIcon } from '@mui/icons-material';
import { FullscreenExit as FullscreenExitIcon } from '@mui/icons-material';
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
} from '@mui/material';
import {
Fullscreen as FullscreenIcon,
FullscreenExit as FullscreenExitIcon,
} from '@mui/icons-material';
import { FormattedMessage } from 'react-intl';
import { Dialog, DialogContent } from '@mui/material';
import ReportViewer from '../ReportViewer';

const styles = {
Expand Down
3 changes: 1 addition & 2 deletions src/components/TopBar/TopBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ import {
Settings as SettingsIcon,
WbSunny as WbSunnyIcon,
} from '@mui/icons-material';
import { darken } from '@mui/system';
import { styled } from '@mui/system';
import { darken, styled } from '@mui/system';

import PropTypes from 'prop-types';
import FullScreen, { fullScreenSupported } from 'react-request-fullscreen';
Expand Down
3 changes: 1 addition & 2 deletions src/components/TopBar/TopBar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { top_bar_en } from '../../';
import PowsyblLogo from '../images/powsybl_logo.svg';

import { red } from '@mui/material/colors';
import { ThemeProvider } from '@mui/material';
import { createTheme } from '@mui/material';
import { createTheme, ThemeProvider } from '@mui/material';

let container = null;
beforeEach(() => {
Expand Down
28 changes: 16 additions & 12 deletions src/components/TreeViewFinder/TreeViewFinder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,33 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import React, { useState, useCallback, useEffect } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { useIntl } from 'react-intl';
import PropTypes from 'prop-types';
import {
toNestedGlobalSelectors,
makeComposeClasses,
toNestedGlobalSelectors,
} from '../../utils/styles';

import { styled } from '@mui/system';

import { Dialog } from '@mui/material';
import { DialogActions } from '@mui/material';
import { DialogContent } from '@mui/material';
import { DialogContentText } from '@mui/material';
import { DialogTitle } from '@mui/material';
import { Button } from '@mui/material';
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
Typography,
} from '@mui/material';

import TreeItem from '@mui/lab/TreeItem/TreeItem.js';
import TreeView from '@mui/lab/TreeView/TreeView.js';
import { Typography } from '@mui/material';
import { ExpandMore as ExpandMoreIcon } from '@mui/icons-material';
import { ChevronRight as ChevronRightIcon } from '@mui/icons-material';
import { Check as CheckIcon } from '@mui/icons-material';
import {
Check as CheckIcon,
ChevronRight as ChevronRightIcon,
ExpandMore as ExpandMoreIcon,
} from '@mui/icons-material';
import CancelButton from '../react-hook-form/utils/cancel-button';

// As a bunch of individual variables to try to make it easier
Expand Down
Loading

0 comments on commit 63261ad

Please sign in to comment.