@bit.rhplus/ag-grid 0.0.34 → 0.0.36
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/AggregationNotification.js +113 -105
- package/Aggregations.js +320 -184
- package/Functions/index.js +11 -3
- package/NotificationOptions.jsx +355 -53
- package/dist/AggregationNotification.js +119 -105
- 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/index.js +41 -21
- package/dist/index.js.map +1 -1
- package/dist/util.js +16 -5
- package/dist/util.js.map +1 -1
- package/index.jsx +50 -22
- package/package.json +4 -2
- package/util.js +16 -6
- /package/dist/{preview-1758725544565.js → preview-1759925900657.js} +0 -0
package/NotificationOptions.jsx
CHANGED
|
@@ -1,53 +1,355 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Row, Col, Divider, Typography, Space, Progress, Collapse } from 'antd';
|
|
4
|
+
import {
|
|
5
|
+
CalculatorOutlined,
|
|
6
|
+
RiseOutlined,
|
|
7
|
+
FallOutlined,
|
|
8
|
+
LineChartOutlined,
|
|
9
|
+
TableOutlined,
|
|
10
|
+
CalendarOutlined,
|
|
11
|
+
SwapOutlined,
|
|
12
|
+
CheckCircleOutlined,
|
|
13
|
+
FileTextOutlined,
|
|
14
|
+
BarChartOutlined
|
|
15
|
+
} from '@ant-design/icons';
|
|
16
|
+
|
|
17
|
+
const { Panel } = Collapse;
|
|
18
|
+
|
|
19
|
+
const { Text } = Typography;
|
|
20
|
+
|
|
21
|
+
const formatNumber = (value, decimals = 2) => {
|
|
22
|
+
if (value === null || value === undefined || Number.isNaN(value)) return '-';
|
|
23
|
+
return parseFloat(value).toLocaleString('cs-CZ', {
|
|
24
|
+
minimumFractionDigits: decimals,
|
|
25
|
+
maximumFractionDigits: decimals
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const formatCurrency = (value, decimals, currencySymbol, hasMixed) => {
|
|
30
|
+
if (value === null || value === undefined || Number.isNaN(value)) return '-';
|
|
31
|
+
const formatted = formatNumber(value, decimals);
|
|
32
|
+
|
|
33
|
+
if (!currencySymbol) return formatted;
|
|
34
|
+
|
|
35
|
+
if (hasMixed) {
|
|
36
|
+
return `${formatted} ${currencySymbol}*`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return `${formatted} ${currencySymbol}`;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const StatItem = ({ icon, label, value, color, decimals = 2, currencySymbol = null, hasMixed = false }) => (
|
|
43
|
+
<Space size="small" style={{ display: 'flex', alignItems: 'center' }}>
|
|
44
|
+
{icon && React.cloneElement(icon, {
|
|
45
|
+
style: { color, fontSize: '16px', marginRight: '4px' }
|
|
46
|
+
})}
|
|
47
|
+
<Text strong style={{ fontSize: '12px' }}>{label}:</Text>
|
|
48
|
+
<Text style={{ fontSize: '13px', fontWeight: 500 }}>
|
|
49
|
+
{currencySymbol ? formatCurrency(value, decimals, currencySymbol, hasMixed) : formatNumber(value, decimals)}
|
|
50
|
+
</Text>
|
|
51
|
+
</Space>
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const NotificationOptions = {
|
|
55
|
+
head: messageInfo => {
|
|
56
|
+
const { rows, cols, count, numberCount } = messageInfo;
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div>
|
|
60
|
+
<Space size="middle" wrap>
|
|
61
|
+
<StatItem
|
|
62
|
+
icon={<TableOutlined />}
|
|
63
|
+
label="Řádky"
|
|
64
|
+
value={rows}
|
|
65
|
+
decimals={0}
|
|
66
|
+
color="#1890ff"
|
|
67
|
+
/>
|
|
68
|
+
<StatItem
|
|
69
|
+
icon={<TableOutlined />}
|
|
70
|
+
label="Sloupce"
|
|
71
|
+
value={cols}
|
|
72
|
+
decimals={0}
|
|
73
|
+
color="#1890ff"
|
|
74
|
+
/>
|
|
75
|
+
<StatItem
|
|
76
|
+
icon={<CalculatorOutlined />}
|
|
77
|
+
label="Označeno buněk"
|
|
78
|
+
value={count}
|
|
79
|
+
decimals={0}
|
|
80
|
+
color="#722ed1"
|
|
81
|
+
/>
|
|
82
|
+
{numberCount > 0 && (
|
|
83
|
+
<StatItem
|
|
84
|
+
icon={<CalculatorOutlined />}
|
|
85
|
+
label="Číselné hodnoty"
|
|
86
|
+
value={numberCount}
|
|
87
|
+
decimals={0}
|
|
88
|
+
color="#13c2c2"
|
|
89
|
+
/>
|
|
90
|
+
)}
|
|
91
|
+
</Space>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
body: messageInfo => {
|
|
97
|
+
const {
|
|
98
|
+
sum,
|
|
99
|
+
min,
|
|
100
|
+
max,
|
|
101
|
+
avg,
|
|
102
|
+
median,
|
|
103
|
+
range,
|
|
104
|
+
square,
|
|
105
|
+
cubic,
|
|
106
|
+
earliest,
|
|
107
|
+
latest,
|
|
108
|
+
dateRange,
|
|
109
|
+
numberCount,
|
|
110
|
+
textCount,
|
|
111
|
+
uniqueTextCount,
|
|
112
|
+
hasDuplicates,
|
|
113
|
+
valueFrequencies,
|
|
114
|
+
cols,
|
|
115
|
+
currencySymbol,
|
|
116
|
+
hasMixedCurrencies
|
|
117
|
+
} = messageInfo;
|
|
118
|
+
|
|
119
|
+
const hasNumbers = numberCount > 0;
|
|
120
|
+
const hasDateValues = earliest && latest;
|
|
121
|
+
const hasGeometry = cols === 2 || cols === 3;
|
|
122
|
+
const hasFrequencies = valueFrequencies && valueFrequencies.length > 0;
|
|
123
|
+
|
|
124
|
+
const squareMeters = square ? (square / 10000) : null;
|
|
125
|
+
const cubicMeters = cubic ? (cubic / 1000000) : null;
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<div style={{ paddingTop: '8px' }}>
|
|
129
|
+
{/* Číselné statistiky */}
|
|
130
|
+
{hasNumbers && (
|
|
131
|
+
<>
|
|
132
|
+
<Row gutter={[16, 8]}>
|
|
133
|
+
<Col span={12}>
|
|
134
|
+
<StatItem
|
|
135
|
+
icon={<CalculatorOutlined />}
|
|
136
|
+
label="Součet"
|
|
137
|
+
value={sum}
|
|
138
|
+
color="#52c41a"
|
|
139
|
+
currencySymbol={currencySymbol}
|
|
140
|
+
hasMixed={hasMixedCurrencies}
|
|
141
|
+
/>
|
|
142
|
+
</Col>
|
|
143
|
+
<Col span={12}>
|
|
144
|
+
<StatItem
|
|
145
|
+
icon={<LineChartOutlined />}
|
|
146
|
+
label="Průměr"
|
|
147
|
+
value={avg}
|
|
148
|
+
color="#fa8c16"
|
|
149
|
+
currencySymbol={currencySymbol}
|
|
150
|
+
hasMixed={hasMixedCurrencies}
|
|
151
|
+
/>
|
|
152
|
+
</Col>
|
|
153
|
+
</Row>
|
|
154
|
+
|
|
155
|
+
<Row gutter={[16, 8]} style={{ marginTop: '8px' }}>
|
|
156
|
+
<Col span={12}>
|
|
157
|
+
<StatItem
|
|
158
|
+
icon={<FallOutlined />}
|
|
159
|
+
label="Minimum"
|
|
160
|
+
value={min}
|
|
161
|
+
color="#ff4d4f"
|
|
162
|
+
currencySymbol={currencySymbol}
|
|
163
|
+
hasMixed={hasMixedCurrencies}
|
|
164
|
+
/>
|
|
165
|
+
</Col>
|
|
166
|
+
<Col span={12}>
|
|
167
|
+
<StatItem
|
|
168
|
+
icon={<RiseOutlined />}
|
|
169
|
+
label="Maximum"
|
|
170
|
+
value={max}
|
|
171
|
+
color="#52c41a"
|
|
172
|
+
currencySymbol={currencySymbol}
|
|
173
|
+
hasMixed={hasMixedCurrencies}
|
|
174
|
+
/>
|
|
175
|
+
</Col>
|
|
176
|
+
</Row>
|
|
177
|
+
|
|
178
|
+
<Row gutter={[16, 8]} style={{ marginTop: '8px' }}>
|
|
179
|
+
<Col span={12}>
|
|
180
|
+
<StatItem
|
|
181
|
+
icon={<LineChartOutlined />}
|
|
182
|
+
label="Medián"
|
|
183
|
+
value={median}
|
|
184
|
+
color="#722ed1"
|
|
185
|
+
currencySymbol={currencySymbol}
|
|
186
|
+
hasMixed={hasMixedCurrencies}
|
|
187
|
+
/>
|
|
188
|
+
</Col>
|
|
189
|
+
<Col span={12}>
|
|
190
|
+
<StatItem
|
|
191
|
+
icon={<SwapOutlined />}
|
|
192
|
+
label="Rozpětí"
|
|
193
|
+
value={range}
|
|
194
|
+
color="#13c2c2"
|
|
195
|
+
currencySymbol={currencySymbol}
|
|
196
|
+
hasMixed={hasMixedCurrencies}
|
|
197
|
+
/>
|
|
198
|
+
</Col>
|
|
199
|
+
</Row>
|
|
200
|
+
|
|
201
|
+
{hasMixedCurrencies && (
|
|
202
|
+
<Row gutter={[16, 8]} style={{ marginTop: '8px' }}>
|
|
203
|
+
<Col span={24}>
|
|
204
|
+
<Text style={{ fontSize: '11px', color: '#fa8c16', fontStyle: 'italic' }}>
|
|
205
|
+
* Pozor: Výběr obsahuje více měn. Zobrazena primární měna.
|
|
206
|
+
</Text>
|
|
207
|
+
</Col>
|
|
208
|
+
</Row>
|
|
209
|
+
)}
|
|
210
|
+
</>
|
|
211
|
+
)}
|
|
212
|
+
|
|
213
|
+
{/* Geometrické výpočty */}
|
|
214
|
+
{hasGeometry && hasNumbers && (
|
|
215
|
+
<>
|
|
216
|
+
<Divider style={{ margin: '12px 0' }} />
|
|
217
|
+
<Row gutter={[16, 8]}>
|
|
218
|
+
{cols === 2 && squareMeters !== null && (
|
|
219
|
+
<Col span={12}>
|
|
220
|
+
<Space size="small">
|
|
221
|
+
<Text strong style={{ fontSize: '12px' }}>Plocha (m²):</Text>
|
|
222
|
+
<Text style={{ fontSize: '13px', fontWeight: 500 }}>
|
|
223
|
+
{formatNumber(squareMeters)}
|
|
224
|
+
</Text>
|
|
225
|
+
</Space>
|
|
226
|
+
</Col>
|
|
227
|
+
)}
|
|
228
|
+
{cols === 3 && cubicMeters !== null && (
|
|
229
|
+
<Col span={12}>
|
|
230
|
+
<Space size="small">
|
|
231
|
+
<Text strong style={{ fontSize: '12px' }}>Objem (m³):</Text>
|
|
232
|
+
<Text style={{ fontSize: '13px', fontWeight: 500 }}>
|
|
233
|
+
{formatNumber(cubicMeters)}
|
|
234
|
+
</Text>
|
|
235
|
+
</Space>
|
|
236
|
+
</Col>
|
|
237
|
+
)}
|
|
238
|
+
</Row>
|
|
239
|
+
</>
|
|
240
|
+
)}
|
|
241
|
+
|
|
242
|
+
{/* Datové informace */}
|
|
243
|
+
{hasDateValues && (
|
|
244
|
+
<>
|
|
245
|
+
<Divider style={{ margin: '12px 0' }} />
|
|
246
|
+
<Row gutter={[16, 8]}>
|
|
247
|
+
<Col span={24}>
|
|
248
|
+
<Space size="small">
|
|
249
|
+
<CalendarOutlined style={{ color: '#1890ff', fontSize: '16px' }} />
|
|
250
|
+
<Text strong style={{ fontSize: '12px' }}>Nejdříve:</Text>
|
|
251
|
+
<Text style={{ fontSize: '13px' }}>
|
|
252
|
+
{new Date(earliest).toLocaleString('cs-CZ')}
|
|
253
|
+
</Text>
|
|
254
|
+
</Space>
|
|
255
|
+
</Col>
|
|
256
|
+
<Col span={24} style={{ marginTop: '4px' }}>
|
|
257
|
+
<Space size="small">
|
|
258
|
+
<CalendarOutlined style={{ color: '#1890ff', fontSize: '16px' }} />
|
|
259
|
+
<Text strong style={{ fontSize: '12px' }}>Nejpozději:</Text>
|
|
260
|
+
<Text style={{ fontSize: '13px' }}>
|
|
261
|
+
{new Date(latest).toLocaleString('cs-CZ')}
|
|
262
|
+
</Text>
|
|
263
|
+
</Space>
|
|
264
|
+
</Col>
|
|
265
|
+
{dateRange !== null && dateRange > 0 && (
|
|
266
|
+
<Col span={24} style={{ marginTop: '4px' }}>
|
|
267
|
+
<Space size="small">
|
|
268
|
+
<SwapOutlined style={{ color: '#722ed1', fontSize: '16px' }} />
|
|
269
|
+
<Text strong style={{ fontSize: '12px' }}>Rozpětí:</Text>
|
|
270
|
+
<Text style={{ fontSize: '13px' }}>
|
|
271
|
+
{dateRange} {dateRange === 1 ? 'den' : dateRange < 5 ? 'dny' : 'dní'}
|
|
272
|
+
</Text>
|
|
273
|
+
</Space>
|
|
274
|
+
</Col>
|
|
275
|
+
)}
|
|
276
|
+
</Row>
|
|
277
|
+
</>
|
|
278
|
+
)}
|
|
279
|
+
|
|
280
|
+
{/* Frekvenční analýza textových hodnot */}
|
|
281
|
+
{hasFrequencies && (
|
|
282
|
+
<>
|
|
283
|
+
<Divider style={{ margin: '12px 0' }} />
|
|
284
|
+
<div>
|
|
285
|
+
<Space size="small" style={{ marginBottom: '8px' }}>
|
|
286
|
+
<BarChartOutlined style={{ color: '#1890ff', fontSize: '16px' }} />
|
|
287
|
+
<Text strong style={{ fontSize: '12px' }}>
|
|
288
|
+
Nejčastější hodnoty ({textCount} hodnot, {uniqueTextCount} unikátních)
|
|
289
|
+
</Text>
|
|
290
|
+
</Space>
|
|
291
|
+
|
|
292
|
+
<div style={{ marginTop: '8px', maxHeight: '200px', overflowY: 'auto', overflowX: 'hidden' }}>
|
|
293
|
+
{valueFrequencies.slice(0, 10).map((item, index) => {
|
|
294
|
+
const isTop = index < 3;
|
|
295
|
+
const color = isTop
|
|
296
|
+
? (index === 0 ? '#52c41a' : index === 1 ? '#1890ff' : '#fa8c16')
|
|
297
|
+
: '#8c8c8c';
|
|
298
|
+
|
|
299
|
+
return (
|
|
300
|
+
<div key={index} style={{ marginBottom: '6px' }}>
|
|
301
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
302
|
+
<div style={{ flex: '0 0 auto' }}>
|
|
303
|
+
<CheckCircleOutlined style={{ color, fontSize: '14px' }} />
|
|
304
|
+
</div>
|
|
305
|
+
<div style={{ flex: '1 1 auto', minWidth: 0 }}>
|
|
306
|
+
<Text
|
|
307
|
+
ellipsis={{ tooltip: item.value }}
|
|
308
|
+
style={{
|
|
309
|
+
fontSize: '12px',
|
|
310
|
+
fontWeight: isTop ? 500 : 400,
|
|
311
|
+
display: 'block'
|
|
312
|
+
}}
|
|
313
|
+
>
|
|
314
|
+
"{item.value}"
|
|
315
|
+
</Text>
|
|
316
|
+
</div>
|
|
317
|
+
<div style={{ flex: '0 0 auto', whiteSpace: 'nowrap' }}>
|
|
318
|
+
<Text style={{ fontSize: '12px', color: '#595959' }}>
|
|
319
|
+
{item.count}× ({item.percentage.toFixed(1)}%)
|
|
320
|
+
</Text>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
<div style={{ marginLeft: '22px', marginTop: '2px' }}>
|
|
324
|
+
<Progress
|
|
325
|
+
percent={item.percentage}
|
|
326
|
+
size="small"
|
|
327
|
+
showInfo={false}
|
|
328
|
+
strokeColor={color}
|
|
329
|
+
/>
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
);
|
|
333
|
+
})}
|
|
334
|
+
|
|
335
|
+
{valueFrequencies.length > 10 && (
|
|
336
|
+
<Text style={{ fontSize: '11px', color: '#8c8c8c', fontStyle: 'italic' }}>
|
|
337
|
+
... a dalších {valueFrequencies.length - 10} hodnot
|
|
338
|
+
</Text>
|
|
339
|
+
)}
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</>
|
|
343
|
+
)}
|
|
344
|
+
</div>
|
|
345
|
+
);
|
|
346
|
+
},
|
|
347
|
+
|
|
348
|
+
style: {
|
|
349
|
+
width: 600,
|
|
350
|
+
maxWidth: '90vw'
|
|
351
|
+
},
|
|
352
|
+
placement: 'bottomRight'
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
export default NotificationOptions;
|
|
@@ -1,107 +1,121 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// DEPRECATED: This component is not used anywhere in the codebase
|
|
4
|
+
// Kept for reference only - uses @material-ui which is being phased out
|
|
5
|
+
/*
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import classnames from 'classnames';
|
|
9
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
10
|
+
import { useSnackbar } from 'notistack';
|
|
11
|
+
import Collapse from '@material-ui/core/Collapse';
|
|
12
|
+
import Paper from '@material-ui/core/Paper';
|
|
13
|
+
import Typography from '@material-ui/core/Typography';
|
|
14
|
+
import Card from '@material-ui/core/Card';
|
|
15
|
+
import CardActions from '@material-ui/core/CardActions';
|
|
16
|
+
import Button from '@material-ui/core/Button';
|
|
17
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
18
|
+
import CloseIcon from '@material-ui/icons/Close';
|
|
19
|
+
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
|
20
|
+
import CheckCircleIcon from '@material-ui/icons/CheckCircle';
|
|
21
|
+
import moment from 'moment';
|
|
22
|
+
|
|
23
|
+
const useStyles = makeStyles(theme => ({
|
|
24
|
+
card: {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
flexWrap: 'wrap',
|
|
28
|
+
flexGrow: 1,
|
|
29
|
+
backgroundColor: '#fddc6c',
|
|
30
|
+
[theme.breakpoints.up('sm')]: {
|
|
31
|
+
flexGrow: 'initial',
|
|
32
|
+
minWidth: 344,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
// typography: {
|
|
36
|
+
// fontWeight: 'bold',
|
|
37
|
+
// },
|
|
38
|
+
actionRoot: {
|
|
39
|
+
padding: '8px 8px 8px 16px',
|
|
40
|
+
},
|
|
41
|
+
icons: {
|
|
42
|
+
marginLeft: 'auto',
|
|
43
|
+
},
|
|
44
|
+
expand: {
|
|
45
|
+
padding: '8px 8px',
|
|
46
|
+
transform: 'rotate(0deg)',
|
|
47
|
+
transition: theme.transitions.create('transform', {
|
|
48
|
+
duration: theme.transitions.duration.shortest,
|
|
49
|
+
}),
|
|
50
|
+
},
|
|
51
|
+
expandOpen: {
|
|
52
|
+
transform: 'rotate(180deg)',
|
|
53
|
+
},
|
|
54
|
+
collapse: {
|
|
55
|
+
padding: 16,
|
|
56
|
+
},
|
|
57
|
+
checkIcon: {
|
|
58
|
+
fontSize: 20,
|
|
59
|
+
color: '#b3b3b3',
|
|
60
|
+
paddingRight: 4,
|
|
61
|
+
},
|
|
62
|
+
button: {
|
|
63
|
+
padding: 0,
|
|
64
|
+
textTransform: 'none',
|
|
65
|
+
},
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
const AggregationNotification = React.forwardRef((props, ref) => {
|
|
69
|
+
const classes = useStyles();
|
|
70
|
+
const { closeSnackbar } = useSnackbar();
|
|
71
|
+
const expanded = true;
|
|
72
|
+
// Aktualizované props pro novou verzi AG Grid aggregací
|
|
73
|
+
const {count, sum, max, min, avg, square, cubic, earliest, latest, rows, cols} = props.messageInfo;
|
|
74
|
+
const length = count || 0;
|
|
75
|
+
const isDate = earliest && latest;
|
|
76
|
+
|
|
77
|
+
const handleDismiss = () => {
|
|
78
|
+
closeSnackbar(props.id);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<Card className={classes.card} ref={ref}>
|
|
83
|
+
<CardActions classes={{ root: classes.actionRoot }}>
|
|
84
|
+
<Typography variant="subtitle2">Označeno {rows} řádků, {cols} sloupců ({length} buněk)</Typography>
|
|
85
|
+
<div className={classes.icons}>
|
|
86
|
+
<IconButton className={classes.expand} onClick={handleDismiss}>
|
|
87
|
+
<CloseIcon />
|
|
88
|
+
</IconButton>
|
|
89
|
+
</div>
|
|
90
|
+
</CardActions>
|
|
91
|
+
<Collapse in={expanded} timeout="auto" unmountOnExit>
|
|
92
|
+
{props.showNumber && count > 0 ? (
|
|
93
|
+
<Paper className={classes.collapse}>
|
|
94
|
+
{ !isNaN(parseFloat(count)) ? (<span><b>Počet:</b> {parseFloat(count)}</span>) : (<span />) }
|
|
95
|
+
{ !isNaN(parseFloat(sum)) ? (<span className="ml-2"><b>Součet:</b> {parseFloat(sum).toFixed(2)}</span>) : (<span />) }
|
|
96
|
+
{ !isNaN(parseFloat(min)) ? (<span className="ml-2"><b>Min:</b> {parseFloat(min).toFixed(2)}</span>) : (<span />) }
|
|
97
|
+
{ !isNaN(parseFloat(max)) ? (<span className="ml-2"><b>Max:</b> {parseFloat(max).toFixed(2)}</span>) : (<span />) }
|
|
98
|
+
{ !isNaN(parseFloat(avg)) ? (<span className="ml-2"><b>Průměr:</b> {parseFloat(avg).toFixed(2)}</span>) : (<span />) }
|
|
99
|
+
{ !isNaN(parseFloat(square)) ? (<span className="ml-2"><b>2D:</b> {parseFloat(square).toFixed(2)}</span>) : (<span />) }
|
|
100
|
+
{ !isNaN(parseFloat(cubic)) ? (<span className="ml-2"><b>3D:</b> {parseFloat(cubic).toFixed(2)}</span>) : (<span />) }
|
|
101
|
+
</Paper>
|
|
102
|
+
) : (<div />)}
|
|
103
|
+
|
|
104
|
+
{props.showDate && isDate ? (
|
|
105
|
+
<Paper className={classes.collapse}>
|
|
106
|
+
<span><b>Nejdříve:</b> {moment(earliest).format("DD.MM.YY HH:mm:ss")}</span>
|
|
107
|
+
<span className="ml-2"><b>Nejpozději:</b> {moment(latest).format("DD.MM.YY HH:mm:ss")}</span>
|
|
108
|
+
</Paper>
|
|
109
|
+
) : (<div />)}
|
|
110
|
+
</Collapse>
|
|
111
|
+
</Card>
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
AggregationNotification.propTypes = {
|
|
116
|
+
id: PropTypes.number.isRequired,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export default AggregationNotification;
|
|
120
|
+
*/
|
|
107
121
|
//# sourceMappingURL=AggregationNotification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationNotification.js","sourceRoot":"","sources":["../AggregationNotification.js"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"AggregationNotification.js","sourceRoot":"","sources":["../AggregationNotification.js"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,kEAAkE;AAClE,wEAAwE;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmHE"}
|