@bit.rhplus/ag-grid 0.0.33 → 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.
- package/AgGridColumn.js +3 -0
- package/AggregationNotification.js +109 -105
- package/Aggregations.js +320 -184
- package/Functions/index.js +11 -3
- package/NotificationOptions.jsx +355 -53
- package/Renderers/IconRenderer.jsx +64 -16
- package/Renderers/StateRenderer.jsx +111 -0
- package/dist/AgGridColumn.js +2 -0
- package/dist/AgGridColumn.js.map +1 -1
- package/dist/AggregationNotification.d.ts +3 -0
- package/dist/AggregationNotification.js +79 -106
- package/dist/AggregationNotification.js.map +1 -1
- package/dist/Aggregations.d.ts +1 -25
- package/dist/Aggregations.js +142 -20
- package/dist/Aggregations.js.map +1 -1
- package/dist/Functions/index.js +11 -3
- package/dist/Functions/index.js.map +1 -1
- package/dist/NotificationOptions.d.ts +1 -0
- package/dist/NotificationOptions.js +50 -9
- package/dist/NotificationOptions.js.map +1 -1
- package/dist/Renderers/IconRenderer.js +51 -13
- package/dist/Renderers/IconRenderer.js.map +1 -1
- package/dist/Renderers/StateRenderer.d.ts +1 -0
- package/dist/Renderers/StateRenderer.js +86 -0
- package/dist/Renderers/StateRenderer.js.map +1 -0
- package/dist/index.js +43 -21
- package/dist/index.js.map +1 -1
- package/dist/util.js +16 -5
- package/dist/util.js.map +1 -1
- package/index.jsx +52 -22
- package/package.json +9 -3
- package/util.js +16 -6
- /package/dist/{preview-1756735815679.js → preview-1759320571652.js} +0 -0
package/AgGridColumn.js
CHANGED
|
@@ -27,6 +27,9 @@ export const AgGridColumn = (column, options) => {
|
|
|
27
27
|
if (column.iconRenderer)
|
|
28
28
|
column.cellRenderer = "iconRenderer";
|
|
29
29
|
|
|
30
|
+
if (column.stateRenderer)
|
|
31
|
+
column.cellRenderer = "stateRenderer";
|
|
32
|
+
|
|
30
33
|
if (column.buttonRenderer)
|
|
31
34
|
column.cellRenderer = "buttonRenderer";
|
|
32
35
|
|
|
@@ -1,111 +1,115 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
//
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
AggregationNotification.propTypes = {
|
|
112
|
+
id: PropTypes.number.isRequired,
|
|
113
|
+
};
|
|
110
114
|
|
|
111
|
-
|
|
115
|
+
export default AggregationNotification;
|