@bit.rhplus/ag-grid 0.0.34 → 0.0.35

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.
@@ -1,111 +1,115 @@
1
- // import React, { useState } from 'react';
2
- // import PropTypes from 'prop-types';
3
- // import classnames from 'classnames';
4
- // import { makeStyles } from '@material-ui/core/styles';
5
- // import { useSnackbar } from 'notistack';
6
- // import Collapse from '@material-ui/core/Collapse';
7
- // import Paper from '@material-ui/core/Paper';
8
- // import Typography from '@material-ui/core/Typography';
9
- // import Card from '@material-ui/core/Card';
10
- // import CardActions from '@material-ui/core/CardActions';
11
- // import Button from '@material-ui/core/Button';
12
- // import IconButton from '@material-ui/core/IconButton';
13
- // import CloseIcon from '@material-ui/icons/Close';
14
- // import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
15
- // import CheckCircleIcon from '@material-ui/icons/CheckCircle';
16
- // import moment from 'moment';
1
+ /* eslint-disable */
2
+ import React, { useState } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import classnames from 'classnames';
5
+ import { makeStyles } from '@material-ui/core/styles';
6
+ import { useSnackbar } from 'notistack';
7
+ import Collapse from '@material-ui/core/Collapse';
8
+ import Paper from '@material-ui/core/Paper';
9
+ import Typography from '@material-ui/core/Typography';
10
+ import Card from '@material-ui/core/Card';
11
+ import CardActions from '@material-ui/core/CardActions';
12
+ import Button from '@material-ui/core/Button';
13
+ import IconButton from '@material-ui/core/IconButton';
14
+ import CloseIcon from '@material-ui/icons/Close';
15
+ import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
16
+ import CheckCircleIcon from '@material-ui/icons/CheckCircle';
17
+ import moment from 'moment';
17
18
 
18
- // const useStyles = makeStyles(theme => ({
19
- // card: {
20
- // display: 'flex',
21
- // flexDirection: 'column',
22
- // flexWrap: 'wrap',
23
- // flexGrow: 1,
24
- // backgroundColor: '#fddc6c',
25
- // [theme.breakpoints.up('sm')]: {
26
- // flexGrow: 'initial',
27
- // minWidth: 344,
28
- // },
29
- // },
30
- // // typography: {
31
- // // fontWeight: 'bold',
32
- // // },
33
- // actionRoot: {
34
- // padding: '8px 8px 8px 16px',
35
- // },
36
- // icons: {
37
- // marginLeft: 'auto',
38
- // },
39
- // expand: {
40
- // padding: '8px 8px',
41
- // transform: 'rotate(0deg)',
42
- // transition: theme.transitions.create('transform', {
43
- // duration: theme.transitions.duration.shortest,
44
- // }),
45
- // },
46
- // expandOpen: {
47
- // transform: 'rotate(180deg)',
48
- // },
49
- // collapse: {
50
- // padding: 16,
51
- // },
52
- // checkIcon: {
53
- // fontSize: 20,
54
- // color: '#b3b3b3',
55
- // paddingRight: 4,
56
- // },
57
- // button: {
58
- // padding: 0,
59
- // textTransform: 'none',
60
- // },
61
- // }));
19
+ const useStyles = makeStyles(theme => ({
20
+ card: {
21
+ display: 'flex',
22
+ flexDirection: 'column',
23
+ flexWrap: 'wrap',
24
+ flexGrow: 1,
25
+ backgroundColor: '#fddc6c',
26
+ [theme.breakpoints.up('sm')]: {
27
+ flexGrow: 'initial',
28
+ minWidth: 344,
29
+ },
30
+ },
31
+ // typography: {
32
+ // fontWeight: 'bold',
33
+ // },
34
+ actionRoot: {
35
+ padding: '8px 8px 8px 16px',
36
+ },
37
+ icons: {
38
+ marginLeft: 'auto',
39
+ },
40
+ expand: {
41
+ padding: '8px 8px',
42
+ transform: 'rotate(0deg)',
43
+ transition: theme.transitions.create('transform', {
44
+ duration: theme.transitions.duration.shortest,
45
+ }),
46
+ },
47
+ expandOpen: {
48
+ transform: 'rotate(180deg)',
49
+ },
50
+ collapse: {
51
+ padding: 16,
52
+ },
53
+ checkIcon: {
54
+ fontSize: 20,
55
+ color: '#b3b3b3',
56
+ paddingRight: 4,
57
+ },
58
+ button: {
59
+ padding: 0,
60
+ textTransform: 'none',
61
+ },
62
+ }));
62
63
 
63
- // const AggregationNotification = React.forwardRef((props, ref) => {
64
- // const classes = useStyles();
65
- // const { closeSnackbar } = useSnackbar();
66
- // const expanded = true;
67
- // const {length, count, sum, max, min, avg, volume2d, volume3d, earliest, latest, isDate, dateCount} = props.messageInfo;
64
+ const AggregationNotification = React.forwardRef((props, ref) => {
65
+ const classes = useStyles();
66
+ const { closeSnackbar } = useSnackbar();
67
+ const expanded = true;
68
+ // Aktualizované props pro novou verzi AG Grid aggregací
69
+ const {count, sum, max, min, avg, square, cubic, earliest, latest, rows, cols} = props.messageInfo;
70
+ const length = count || 0;
71
+ const isDate = earliest && latest;
68
72
 
69
- // const handleDismiss = () => {
70
- // closeSnackbar(props.id);
71
- // };
72
- // return (
73
- // <Card className={classes.card} ref={ref}>
74
- // <CardActions classes={{ root: classes.actionRoot }}>
75
- // <Typography variant="subtitle2">Selected {length} items</Typography>
76
- // <div className={classes.icons}>
77
- // <IconButton className={classes.expand} onClick={handleDismiss}>
78
- // <CloseIcon />
79
- // </IconButton>
80
- // </div>
81
- // </CardActions>
82
- // <Collapse in={expanded} timeout="auto" unmountOnExit>
83
- // {props.showNumber && count > 0 ? (
84
- // <Paper className={classes.collapse}>
85
- // { !isNaN(parseFloat(count)) ? (<span><b>Count:</b> {parseFloat(count)}</span>) : (<span />) }
86
- // { !isNaN(parseFloat(sum)) ? (<span className="ml-2"><b>Sum:</b> {parseFloat(sum).toFixed(2)}</span>) : (<span />) }
87
- // { !isNaN(parseFloat(min)) ? (<span className="ml-2"><b> Min:</b> {parseFloat(min).toFixed(2)}</span>) : (<span />) }
88
- // { !isNaN(parseFloat(max)) ? (<span className="ml-2"><b> Max:</b> {parseFloat(max).toFixed(2)}</span>) : (<span />) }
89
- // { !isNaN(parseFloat(avg)) ? (<span className="ml-2"><b> Avg:</b> {parseFloat(avg).toFixed(2)}</span>) : (<span />) }
90
- // { !isNaN(parseFloat(volume2d)) ? (<span className="ml-2"><b> 2d:</b> {parseFloat(volume2d).toFixed(2)}</span>) : (<span />) }
91
- // { !isNaN(parseFloat(volume3d)) ? (<span className="ml-2"><b> 3d:</b> {parseFloat(volume3d).toFixed(2)}</span>) : (<span />) }
92
- // </Paper>
93
- // ) : (<div />)}
73
+ const handleDismiss = () => {
74
+ closeSnackbar(props.id);
75
+ };
76
+
77
+ return (
78
+ <Card className={classes.card} ref={ref}>
79
+ <CardActions classes={{ root: classes.actionRoot }}>
80
+ <Typography variant="subtitle2">Označeno {rows} řádků, {cols} sloupců ({length} buněk)</Typography>
81
+ <div className={classes.icons}>
82
+ <IconButton className={classes.expand} onClick={handleDismiss}>
83
+ <CloseIcon />
84
+ </IconButton>
85
+ </div>
86
+ </CardActions>
87
+ <Collapse in={expanded} timeout="auto" unmountOnExit>
88
+ {props.showNumber && count > 0 ? (
89
+ <Paper className={classes.collapse}>
90
+ { !isNaN(parseFloat(count)) ? (<span><b>Počet:</b> {parseFloat(count)}</span>) : (<span />) }
91
+ { !isNaN(parseFloat(sum)) ? (<span className="ml-2"><b>Součet:</b> {parseFloat(sum).toFixed(2)}</span>) : (<span />) }
92
+ { !isNaN(parseFloat(min)) ? (<span className="ml-2"><b>Min:</b> {parseFloat(min).toFixed(2)}</span>) : (<span />) }
93
+ { !isNaN(parseFloat(max)) ? (<span className="ml-2"><b>Max:</b> {parseFloat(max).toFixed(2)}</span>) : (<span />) }
94
+ { !isNaN(parseFloat(avg)) ? (<span className="ml-2"><b>Průměr:</b> {parseFloat(avg).toFixed(2)}</span>) : (<span />) }
95
+ { !isNaN(parseFloat(square)) ? (<span className="ml-2"><b>2D:</b> {parseFloat(square).toFixed(2)}</span>) : (<span />) }
96
+ { !isNaN(parseFloat(cubic)) ? (<span className="ml-2"><b>3D:</b> {parseFloat(cubic).toFixed(2)}</span>) : (<span />) }
97
+ </Paper>
98
+ ) : (<div />)}
94
99
 
95
- // {props.showDate && isDate ? (
96
- // <Paper className={classes.collapse}>
97
- // <span><b>Count:</b> {parseFloat(dateCount)}</span>
98
- // <span className="ml-2"><b>Earliest:</b> {moment(Date.parse(earliest)).format("DD.MM.YY HH:mm:SS")}</span>
99
- // <span className="ml-2"><b>Latest:</b> {moment(Date.parse(latest)).format("DD.MM.YY HH:mm:SS")}</span>
100
- // </Paper>
101
- // ) : (<div />)}
102
- // </Collapse>
103
- // </Card>
104
- // );
105
- // });
100
+ {props.showDate && isDate ? (
101
+ <Paper className={classes.collapse}>
102
+ <span><b>Nejdříve:</b> {moment(earliest).format("DD.MM.YY HH:mm:ss")}</span>
103
+ <span className="ml-2"><b>Nejpozději:</b> {moment(latest).format("DD.MM.YY HH:mm:ss")}</span>
104
+ </Paper>
105
+ ) : (<div />)}
106
+ </Collapse>
107
+ </Card>
108
+ );
109
+ });
106
110
 
107
- // AggregationNotification.propTypes = {
108
- // id: PropTypes.number.isRequired,
109
- // };
111
+ AggregationNotification.propTypes = {
112
+ id: PropTypes.number.isRequired,
113
+ };
110
114
 
111
- // export default AggregationNotification;
115
+ export default AggregationNotification;