@quillsql/react 1.7.4 → 1.7.6
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/lib/AddToDashboardModal.js +2 -2
- package/lib/AddToDashboardModal.js.map +1 -1
- package/lib/Chart.js +2 -2
- package/lib/Chart.js.map +1 -1
- package/lib/Context.d.ts +2 -1
- package/lib/Context.js +3 -1
- package/lib/Context.js.map +1 -1
- package/lib/Dashboard.js +2 -2
- package/lib/Dashboard.js.map +1 -1
- package/lib/QuillProvider.d.ts +2 -1
- package/lib/QuillProvider.js +2 -2
- package/lib/QuillProvider.js.map +1 -1
- package/lib/ReportBuilder.d.ts +1 -1
- package/lib/ReportBuilder.js +3 -2
- package/lib/ReportBuilder.js.map +1 -1
- package/lib/SQLEditor.js +5 -5
- package/lib/SQLEditor.js.map +1 -1
- package/lib/Table.js +1 -1
- package/lib/Table.js.map +1 -1
- package/lib/components/BigModal/BigModal.js +1 -0
- package/lib/components/BigModal/BigModal.js.map +1 -1
- package/lib/components/Modal/Modal.js +1 -0
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/hooks/useQuill.js +3 -2
- package/lib/hooks/useQuill.js.map +1 -1
- package/package.json +11 -4
- package/.eslintrc.json +0 -19
- package/.prettierrc +0 -11
- package/.vscode/settings.json +0 -10
- package/src/AddToDashboardModal.tsx +0 -1213
- package/src/BarList.tsx +0 -580
- package/src/Chart.tsx +0 -1336
- package/src/Context.tsx +0 -249
- package/src/Dashboard.tsx +0 -819
- package/src/DateRangePicker/Calendar.tsx +0 -442
- package/src/DateRangePicker/DateRangePicker.tsx +0 -261
- package/src/DateRangePicker/DateRangePickerButton.tsx +0 -250
- package/src/DateRangePicker/dateRangePickerUtils.tsx +0 -480
- package/src/DateRangePicker/index.ts +0 -4
- package/src/PieChart.tsx +0 -845
- package/src/QuillProvider.tsx +0 -78
- package/src/ReportBuilder.tsx +0 -2202
- package/src/SQLEditor.tsx +0 -1087
- package/src/Table.tsx +0 -1074
- package/src/TableChart.tsx +0 -428
- package/src/assets/ArrowDownHeadIcon.tsx +0 -11
- package/src/assets/ArrowDownIcon.tsx +0 -14
- package/src/assets/ArrowDownRightIcon.tsx +0 -14
- package/src/assets/ArrowLeftHeadIcon.tsx +0 -11
- package/src/assets/ArrowRightHeadIcon.tsx +0 -11
- package/src/assets/ArrowRightIcon.tsx +0 -14
- package/src/assets/ArrowUpHeadIcon.tsx +0 -11
- package/src/assets/ArrowUpIcon.tsx +0 -14
- package/src/assets/ArrowUpRightIcon.tsx +0 -14
- package/src/assets/CalendarIcon.tsx +0 -14
- package/src/assets/DoubleArrowLeftHeadIcon.tsx +0 -18
- package/src/assets/DoubleArrowRightHeadIcon.tsx +0 -20
- package/src/assets/ExclamationFilledIcon.tsx +0 -14
- package/src/assets/LoadingSpinner.tsx +0 -11
- package/src/assets/SearchIcon.tsx +0 -14
- package/src/assets/XCircleIcon.tsx +0 -14
- package/src/assets/index.ts +0 -16
- package/src/components/BigModal/BigModal.tsx +0 -108
- package/src/components/Dropdown/Dropdown.tsx +0 -169
- package/src/components/Dropdown/DropdownItem.tsx +0 -68
- package/src/components/Dropdown/index.ts +0 -2
- package/src/components/Modal/Modal.tsx +0 -132
- package/src/components/Modal/index.ts +0 -1
- package/src/components/selectUtils.ts +0 -60
- package/src/contexts/BaseColorContext.tsx +0 -5
- package/src/contexts/HoveredValueContext.tsx +0 -12
- package/src/contexts/RootStylesContext.tsx +0 -5
- package/src/contexts/SelectedValueContext.tsx +0 -13
- package/src/contexts/index.ts +0 -4
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useInternalState.tsx +0 -18
- package/src/hooks/useOnClickOutside.tsx +0 -23
- package/src/hooks/useOnWindowResize.tsx +0 -17
- package/src/hooks/useQuill.ts +0 -137
- package/src/hooks/useSelectOnKeyDown.tsx +0 -80
- package/src/index.ts +0 -9
- package/src/lib/font.ts +0 -14
- package/src/lib/index.ts +0 -3
- package/src/lib/inputTypes.ts +0 -81
- package/src/lib/utils.tsx +0 -46
- package/tsconfig.json +0 -22
package/src/BarList.tsx
DELETED
|
@@ -1,580 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/display-name */
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
// import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import {
|
|
6
|
-
Area,
|
|
7
|
-
CartesianGrid,
|
|
8
|
-
Legend,
|
|
9
|
-
ComposedChart as ReChartsAreaChart,
|
|
10
|
-
ResponsiveContainer,
|
|
11
|
-
Tooltip,
|
|
12
|
-
XAxis,
|
|
13
|
-
YAxis,
|
|
14
|
-
} from 'recharts';
|
|
15
|
-
import { format } from 'date-fns';
|
|
16
|
-
import { valueFormatter } from './Chart';
|
|
17
|
-
|
|
18
|
-
// const data = [
|
|
19
|
-
// { name: 'Pool and Spa', median_days: 56.5104166666667 },
|
|
20
|
-
// { name: 'Fencing & Gates', median_days: 56.1202719907407 },
|
|
21
|
-
// { name: 'Fireplace & Chimney', median_days: 51.5482581018519 },
|
|
22
|
-
// { name: 'Concrete, Driveway & Masonry', median_days: 49.6866608796296 },
|
|
23
|
-
// { name: 'Painting', median_days: 37.3942939814815 },
|
|
24
|
-
// { name: 'Roofing', median_days: 35.6859027777778 },
|
|
25
|
-
// { name: 'Flooring', median_days: 34.6166956018519 },
|
|
26
|
-
// { name: 'Irrigation, Landscaping & Trees', median_days: 27.4079456018519 },
|
|
27
|
-
// { name: 'Glass & Windows', median_days: 27.1180613425926 },
|
|
28
|
-
// { name: 'Remodeling Interior/Exterior', median_days: 24.9670775462963 },
|
|
29
|
-
// { name: 'Pests, Extermination & Wildlife', median_days: 20.7024537037037 },
|
|
30
|
-
// { name: 'Appliance', median_days: 18.7326157407407 },
|
|
31
|
-
// { name: 'Garage Doors', median_days: 18.0982175925926 },
|
|
32
|
-
// { name: 'Electrical', median_days: 16.1240740740741 },
|
|
33
|
-
// {
|
|
34
|
-
// name: '(HVAC) Heating, Ventilation & Air Conditioning',
|
|
35
|
-
// median_days: 16.0118576388889,
|
|
36
|
-
// },
|
|
37
|
-
// { name: 'Simple Maintenance Skills', median_days: 15.153130787037 },
|
|
38
|
-
// { name: 'Utilities', median_days: 13.4653240740741 },
|
|
39
|
-
// { name: 'Carpentry, Framing, Doors', median_days: 12.3884664351852 },
|
|
40
|
-
// {
|
|
41
|
-
// name: 'Cleaning, Sanitation & Restoration Services',
|
|
42
|
-
// median_days: 11.6931886574074,
|
|
43
|
-
// },
|
|
44
|
-
// { name: 'Awning & Sunshades', median_days: 10.3050983796296 },
|
|
45
|
-
// { name: 'Plumbing', median_days: 10.2094328703704 },
|
|
46
|
-
// { name: 'Carpet & Floor Cleaning', median_days: 8.9691087962963 },
|
|
47
|
-
// { name: 'Junk Removal & Hauling', median_days: 8.57038194444444 },
|
|
48
|
-
// { name: 'Locksmith', median_days: 4.49019097222222 },
|
|
49
|
-
// ];
|
|
50
|
-
|
|
51
|
-
type Bar = {
|
|
52
|
-
key?: string;
|
|
53
|
-
value: number;
|
|
54
|
-
name: string;
|
|
55
|
-
icon?: React.JSXElementConstructor<any>;
|
|
56
|
-
href?: string;
|
|
57
|
-
target?: string;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const getWidthsFromValues = (dataValues: number[]) => {
|
|
61
|
-
let maxValue = -Infinity;
|
|
62
|
-
dataValues.forEach(value => {
|
|
63
|
-
maxValue = Math.max(maxValue, value);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
return dataValues.map(value => {
|
|
67
|
-
if (value === 0) return 0;
|
|
68
|
-
return Math.max((value / maxValue) * 100, 1);
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
interface YAxisField {
|
|
73
|
-
label: string;
|
|
74
|
-
field: string;
|
|
75
|
-
chartType?: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface BarListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
79
|
-
data: object[];
|
|
80
|
-
valueFormatter?: any;
|
|
81
|
-
color?: string;
|
|
82
|
-
showAnimation?: boolean;
|
|
83
|
-
xAxisField: string;
|
|
84
|
-
yAxisFields: YAxisField[];
|
|
85
|
-
containerStyle: any;
|
|
86
|
-
xAxisFormat: string;
|
|
87
|
-
colors: string[];
|
|
88
|
-
theme: any;
|
|
89
|
-
}
|
|
90
|
-
function makeBarListClassName(componentName: string) {
|
|
91
|
-
return (className: string) => {
|
|
92
|
-
return `BarList-${componentName}-${className};`;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// const valueFormatter = (number: number) => {
|
|
97
|
-
// return '$ ' + Intl.NumberFormat('us').format(number).toString();
|
|
98
|
-
// return number.toFixed(0);
|
|
99
|
-
// };
|
|
100
|
-
|
|
101
|
-
export function hexToRgbaWith10PercentAlpha(hex) {
|
|
102
|
-
// Convert the hex color to RGB
|
|
103
|
-
const r = parseInt(hex.slice(1, 3), 16);
|
|
104
|
-
const g = parseInt(hex.slice(3, 5), 16);
|
|
105
|
-
const b = parseInt(hex.slice(5, 7), 16);
|
|
106
|
-
|
|
107
|
-
// Set the alpha value to 10%
|
|
108
|
-
const alpha = 0.1;
|
|
109
|
-
|
|
110
|
-
// Return the color as an rgba string
|
|
111
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
115
|
-
const {
|
|
116
|
-
data = [],
|
|
117
|
-
yAxisFields,
|
|
118
|
-
xAxisField,
|
|
119
|
-
xAxisFormat,
|
|
120
|
-
colors,
|
|
121
|
-
// valueFormatter = (value: any) => value,valueFormatter
|
|
122
|
-
showAnimation = true,
|
|
123
|
-
className,
|
|
124
|
-
containerStyle,
|
|
125
|
-
theme,
|
|
126
|
-
...other
|
|
127
|
-
} = props;
|
|
128
|
-
|
|
129
|
-
const widths = getWidthsFromValues(
|
|
130
|
-
data.map(item => item[yAxisFields[0].field])
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
const NUM_TO_SHOW = Math.floor(containerStyle?.height / 40) - 1;
|
|
134
|
-
|
|
135
|
-
if (yAxisFields.length > 1) {
|
|
136
|
-
const widths2 = getWidthsFromValues(
|
|
137
|
-
data.map(item => item[yAxisFields[1].field])
|
|
138
|
-
);
|
|
139
|
-
return (
|
|
140
|
-
<div
|
|
141
|
-
ref={ref}
|
|
142
|
-
style={{
|
|
143
|
-
// width: '100%',
|
|
144
|
-
height: '100%',
|
|
145
|
-
// marginLeft: 25,
|
|
146
|
-
// background: 'red',
|
|
147
|
-
marginTop: 20,
|
|
148
|
-
// paddingRight: 25,
|
|
149
|
-
overflow: 'hidden',
|
|
150
|
-
boxSizing: 'content-box',
|
|
151
|
-
display: 'flex',
|
|
152
|
-
justifyContent: 'space-between',
|
|
153
|
-
// marginLeft: '24px',
|
|
154
|
-
width: 'calc(100% - 24px)',
|
|
155
|
-
}}
|
|
156
|
-
// className={twMerge(
|
|
157
|
-
// // makeBarListClassName('root'),
|
|
158
|
-
// 'qq-space-x-6',
|
|
159
|
-
// className
|
|
160
|
-
// )}
|
|
161
|
-
{...other}
|
|
162
|
-
>
|
|
163
|
-
<div
|
|
164
|
-
// className={twMerge(makeBarListClassName('bars'), 'relative w-full')}
|
|
165
|
-
// className="qq-relative-w-full"
|
|
166
|
-
style={{
|
|
167
|
-
// width: '100%',
|
|
168
|
-
height: '100%',
|
|
169
|
-
position: 'relative',
|
|
170
|
-
boxSizing: 'content-box',
|
|
171
|
-
width: '100%',
|
|
172
|
-
}}
|
|
173
|
-
>
|
|
174
|
-
{data.slice(0, Math.floor(NUM_TO_SHOW / 2)).map((item, idx) => {
|
|
175
|
-
// const Icon = item.icon;
|
|
176
|
-
const Icon = null;
|
|
177
|
-
|
|
178
|
-
return (
|
|
179
|
-
<div
|
|
180
|
-
// className="qq-flex qq-flex-row qq-items-center"
|
|
181
|
-
key={item[xAxisField] + idx}
|
|
182
|
-
style={{
|
|
183
|
-
boxSizing: 'content-box',
|
|
184
|
-
display: 'flex',
|
|
185
|
-
flexDirection: 'row',
|
|
186
|
-
alignItems: 'center',
|
|
187
|
-
width: '100%',
|
|
188
|
-
}}
|
|
189
|
-
>
|
|
190
|
-
<div
|
|
191
|
-
title={item[xAxisField]}
|
|
192
|
-
style={{
|
|
193
|
-
maxWidth: 130,
|
|
194
|
-
boxSizing: 'content-box',
|
|
195
|
-
minWidth: 130,
|
|
196
|
-
overflow: 'hidden',
|
|
197
|
-
width: '100%',
|
|
198
|
-
}}
|
|
199
|
-
>
|
|
200
|
-
<p
|
|
201
|
-
style={{
|
|
202
|
-
color: theme?.chartLabelColor,
|
|
203
|
-
boxSizing: 'content-box',
|
|
204
|
-
whiteSpace: 'nowrap',
|
|
205
|
-
overflow: 'hidden',
|
|
206
|
-
textOverflow: 'ellipsis',
|
|
207
|
-
fontFamily:
|
|
208
|
-
theme?.chartLabelFontFamily || theme?.fontFamily,
|
|
209
|
-
fontSize: theme?.fontSizeSmall || '14px',
|
|
210
|
-
}}
|
|
211
|
-
// className={twMerge(
|
|
212
|
-
// makeBarListClassName('barText'),
|
|
213
|
-
// 'qq-whitespace-nowrap truncate',
|
|
214
|
-
// 'qq-text-sm'
|
|
215
|
-
// )}
|
|
216
|
-
>
|
|
217
|
-
{/* {item[xAxisField]} */}
|
|
218
|
-
{valueFormatter({
|
|
219
|
-
value: item[xAxisField],
|
|
220
|
-
field: xAxisField,
|
|
221
|
-
fields: [{ field: xAxisField, format: xAxisFormat }],
|
|
222
|
-
})}
|
|
223
|
-
</p>
|
|
224
|
-
</div>
|
|
225
|
-
<div
|
|
226
|
-
style={{
|
|
227
|
-
width: '100%',
|
|
228
|
-
height: '100%',
|
|
229
|
-
boxSizing: 'content-box',
|
|
230
|
-
display: 'flex',
|
|
231
|
-
flexDirection: 'column',
|
|
232
|
-
}}
|
|
233
|
-
// className="qq-flex qq-flex-col"
|
|
234
|
-
>
|
|
235
|
-
<div
|
|
236
|
-
// className={`qq-flex qq-items-center qq-h-9 qq-rounded qq-mb-2`}
|
|
237
|
-
style={{
|
|
238
|
-
display: 'flex',
|
|
239
|
-
alignItems: 'center',
|
|
240
|
-
height: '36px',
|
|
241
|
-
borderRadius: '4px',
|
|
242
|
-
marginBottom: '8px',
|
|
243
|
-
width: `${widths[idx]}%`,
|
|
244
|
-
transition: showAnimation ? 'all 2s' : '',
|
|
245
|
-
backgroundColor: hexToRgbaWith10PercentAlpha(colors[0]),
|
|
246
|
-
boxSizing: 'content-box',
|
|
247
|
-
}}
|
|
248
|
-
>
|
|
249
|
-
<div
|
|
250
|
-
style={{
|
|
251
|
-
position: 'absolute',
|
|
252
|
-
display: 'flex',
|
|
253
|
-
maxWidth: '100%',
|
|
254
|
-
boxSizing: 'content-box',
|
|
255
|
-
marginLeft: '8px',
|
|
256
|
-
}}
|
|
257
|
-
// className={twMerge(
|
|
258
|
-
// 'qq-absolute qq-max-w-full qq-flex',
|
|
259
|
-
// 'qq-ml-2'
|
|
260
|
-
// )}
|
|
261
|
-
>
|
|
262
|
-
<p
|
|
263
|
-
style={{
|
|
264
|
-
color: theme?.chartLabelColor,
|
|
265
|
-
fontFamily:
|
|
266
|
-
theme?.chartLabelFontFamily || theme?.fontFamily,
|
|
267
|
-
boxSizing: 'content-box',
|
|
268
|
-
whiteSpace: 'nowrap',
|
|
269
|
-
overflow: 'hidden',
|
|
270
|
-
textOverflow: 'ellipsis',
|
|
271
|
-
fontSize: theme?.fontSizeSmall || '14px',
|
|
272
|
-
}}
|
|
273
|
-
// className={twMerge(
|
|
274
|
-
// makeBarListClassName('barText'),
|
|
275
|
-
// 'qq-whitespace-nowrap truncate',
|
|
276
|
-
// 'qq-text-sm'
|
|
277
|
-
// )}
|
|
278
|
-
>
|
|
279
|
-
{yAxisFields[0].label}
|
|
280
|
-
</p>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
<div
|
|
284
|
-
// className={`qq-flex qq-items-center qq-h-9 qq-rounded qq-mb-2`}
|
|
285
|
-
style={{
|
|
286
|
-
display: 'flex',
|
|
287
|
-
alignItems: 'center',
|
|
288
|
-
height: '36px',
|
|
289
|
-
borderRadius: '4px',
|
|
290
|
-
marginBottom: '8px',
|
|
291
|
-
width: `${widths2[idx]}%`,
|
|
292
|
-
transition: showAnimation ? 'all 2s' : '',
|
|
293
|
-
backgroundColor: hexToRgbaWith10PercentAlpha(colors[1]),
|
|
294
|
-
boxSizing: 'content-box',
|
|
295
|
-
}}
|
|
296
|
-
>
|
|
297
|
-
<div
|
|
298
|
-
style={{
|
|
299
|
-
boxSizing: 'content-box',
|
|
300
|
-
position: 'absolute',
|
|
301
|
-
maxWidth: '100%',
|
|
302
|
-
display: 'flex',
|
|
303
|
-
marginLeft: '8px',
|
|
304
|
-
}}
|
|
305
|
-
// className={twMerge(
|
|
306
|
-
// 'qq-absolute qq-max-w-full qq-flex',
|
|
307
|
-
// 'qq-ml-2'
|
|
308
|
-
// )}
|
|
309
|
-
>
|
|
310
|
-
<p
|
|
311
|
-
style={{
|
|
312
|
-
color: theme?.chartLabelColor,
|
|
313
|
-
boxSizing: 'content-box',
|
|
314
|
-
whiteSpace: 'nowrap',
|
|
315
|
-
overflow: 'hidden',
|
|
316
|
-
textOverflow: 'ellipsis',
|
|
317
|
-
fontFamily:
|
|
318
|
-
theme?.chartLabelFontFamily || theme?.fontFamily,
|
|
319
|
-
fontSize: theme?.fontSizeSmall || '14px',
|
|
320
|
-
}}
|
|
321
|
-
// className={twMerge(
|
|
322
|
-
// makeBarListClassName('barText'),
|
|
323
|
-
// 'qq-whitespace-nowrap truncate',
|
|
324
|
-
// 'qq-text-sm'
|
|
325
|
-
// )}
|
|
326
|
-
>
|
|
327
|
-
{yAxisFields[1].label}
|
|
328
|
-
{/* {item[xAxisField]} */}
|
|
329
|
-
</p>
|
|
330
|
-
</div>
|
|
331
|
-
</div>
|
|
332
|
-
</div>
|
|
333
|
-
</div>
|
|
334
|
-
);
|
|
335
|
-
})}
|
|
336
|
-
{data.length > NUM_TO_SHOW && (
|
|
337
|
-
<div
|
|
338
|
-
style={{
|
|
339
|
-
color: theme?.chartLabelColor,
|
|
340
|
-
boxSizing: 'content-box',
|
|
341
|
-
fontFamily: theme?.chartLabelFontFamily || theme?.fontFamily,
|
|
342
|
-
fontSize: theme?.fontSizeSmall || '14px',
|
|
343
|
-
}}
|
|
344
|
-
// className="qq-text-sm"
|
|
345
|
-
>
|
|
346
|
-
...{data.length - NUM_TO_SHOW} more
|
|
347
|
-
</div>
|
|
348
|
-
)}
|
|
349
|
-
</div>
|
|
350
|
-
{/* eslint-disable prettier/prettier */}
|
|
351
|
-
<div
|
|
352
|
-
style={{
|
|
353
|
-
boxSizing: 'content-box',
|
|
354
|
-
minWidth: 'min-content',
|
|
355
|
-
textAlign: 'right',
|
|
356
|
-
paddingLeft: 10,
|
|
357
|
-
}}
|
|
358
|
-
// className={
|
|
359
|
-
// (makeBarListClassName('labels'), 'qq-text-right qq-min-w-min')
|
|
360
|
-
// }
|
|
361
|
-
>
|
|
362
|
-
{data.slice(0, NUM_TO_SHOW).map((item, idx) => (
|
|
363
|
-
<div
|
|
364
|
-
key={item[xAxisField] + 'label' + idx}
|
|
365
|
-
style={{
|
|
366
|
-
boxSizing: 'content-box',
|
|
367
|
-
display: 'flex',
|
|
368
|
-
justifyContent: 'flex-end',
|
|
369
|
-
alignItems: 'center',
|
|
370
|
-
marginBottom: idx === data.length - 1 ? 0 : '8px',
|
|
371
|
-
height: '36px',
|
|
372
|
-
}}
|
|
373
|
-
// className={twMerge(
|
|
374
|
-
// makeBarListClassName('labelWrapper'),
|
|
375
|
-
// 'qq-flex qq-justify-end qq-items-center',
|
|
376
|
-
// 'qq-h-9',
|
|
377
|
-
// idx === data.length - 1 ? 'qq-mb-0' : 'qq-mb-2'
|
|
378
|
-
// )}
|
|
379
|
-
>
|
|
380
|
-
<p
|
|
381
|
-
style={{
|
|
382
|
-
color: theme?.chartLabelColor,
|
|
383
|
-
boxSizing: 'content-box',
|
|
384
|
-
fontFamily: theme?.chartLabelFontFamily || theme?.fontFamily,
|
|
385
|
-
whiteSpace: 'nowrap',
|
|
386
|
-
overflow: 'hidden',
|
|
387
|
-
textOverflow: 'ellipsis',
|
|
388
|
-
fontSize: theme?.fontSizeSmall || '14px',
|
|
389
|
-
}}
|
|
390
|
-
// className={twMerge(
|
|
391
|
-
// makeBarListClassName('labelText'),
|
|
392
|
-
// 'qq-whitespace-nowrap truncate',
|
|
393
|
-
// 'qq-text-sm'
|
|
394
|
-
// )}
|
|
395
|
-
>
|
|
396
|
-
{valueFormatter({
|
|
397
|
-
value: item[yAxisFields[0].field],
|
|
398
|
-
field: yAxisFields[0].field,
|
|
399
|
-
fields: yAxisFields,
|
|
400
|
-
})}
|
|
401
|
-
</p>
|
|
402
|
-
</div>
|
|
403
|
-
))}
|
|
404
|
-
</div>
|
|
405
|
-
</div>
|
|
406
|
-
);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
return (
|
|
410
|
-
<div
|
|
411
|
-
ref={ref}
|
|
412
|
-
style={{
|
|
413
|
-
// width: '100%',
|
|
414
|
-
boxSizing: 'content-box',
|
|
415
|
-
height: '100%',
|
|
416
|
-
// height: hei
|
|
417
|
-
// marginLeft: 25,
|
|
418
|
-
// background: 'red',
|
|
419
|
-
marginTop: 20,
|
|
420
|
-
// paddingRight: 25,
|
|
421
|
-
overflow: 'hidden',
|
|
422
|
-
display: 'flex',
|
|
423
|
-
marginLeft: 25,
|
|
424
|
-
justifyContent: 'space-between',
|
|
425
|
-
}}
|
|
426
|
-
// className={twMerge(
|
|
427
|
-
// makeBarListClassName('root'),
|
|
428
|
-
// 'qq-flex qq-justify-between qq-h-full qq-w-full',
|
|
429
|
-
// 'qq-space-x-6',
|
|
430
|
-
// className
|
|
431
|
-
// )}
|
|
432
|
-
{...other}
|
|
433
|
-
>
|
|
434
|
-
<div
|
|
435
|
-
// className={twMerge(makeBarListClassName('bars'), 'relative w-full')}
|
|
436
|
-
// className="qq-relative-w-full"
|
|
437
|
-
style={{
|
|
438
|
-
width: 'calc(100%)',
|
|
439
|
-
boxSizing: 'content-box',
|
|
440
|
-
height: '100%',
|
|
441
|
-
paddingRight: 25,
|
|
442
|
-
position: 'relative',
|
|
443
|
-
}}
|
|
444
|
-
>
|
|
445
|
-
{data.slice(0, NUM_TO_SHOW).map((item, idx) => {
|
|
446
|
-
// const Icon = item.icon;
|
|
447
|
-
const Icon = null;
|
|
448
|
-
|
|
449
|
-
return (
|
|
450
|
-
<div
|
|
451
|
-
key={item[xAxisField] + 'label' + idx}
|
|
452
|
-
// className={`qq-flex qq-items-center qq-h-9 qq-rounded qq-mb-2`}
|
|
453
|
-
style={{
|
|
454
|
-
width: `${widths[idx]}%`,
|
|
455
|
-
transition: showAnimation ? 'all 2s' : '',
|
|
456
|
-
boxSizing: 'content-box',
|
|
457
|
-
backgroundColor: hexToRgbaWith10PercentAlpha(colors[0]),
|
|
458
|
-
display: 'flex',
|
|
459
|
-
alignItems: 'center',
|
|
460
|
-
height: '36px',
|
|
461
|
-
marginBottom: '8px',
|
|
462
|
-
borderRadius: '4px',
|
|
463
|
-
}}
|
|
464
|
-
>
|
|
465
|
-
<div
|
|
466
|
-
style={{
|
|
467
|
-
boxSizing: 'content-box',
|
|
468
|
-
position: 'absolute',
|
|
469
|
-
maxWidth: '100%',
|
|
470
|
-
display: 'flex',
|
|
471
|
-
marginLeft: '8px',
|
|
472
|
-
}}
|
|
473
|
-
// className={twMerge(
|
|
474
|
-
// 'qq-absolute qq-max-w-full qq-flex',
|
|
475
|
-
// 'qq-ml-2'
|
|
476
|
-
// )}
|
|
477
|
-
>
|
|
478
|
-
<p
|
|
479
|
-
style={{
|
|
480
|
-
color: theme?.chartLabelColor,
|
|
481
|
-
boxSizing: 'content-box',
|
|
482
|
-
whiteSpace: 'nowrap',
|
|
483
|
-
overflow: 'hidden',
|
|
484
|
-
textOverflow: 'ellipsis',
|
|
485
|
-
fontFamily:
|
|
486
|
-
theme?.chartLabelFontFamily || theme?.fontFamily,
|
|
487
|
-
fontSize: theme?.fontSizeSmall || '14px',
|
|
488
|
-
}}
|
|
489
|
-
// className={twMerge(
|
|
490
|
-
// makeBarListClassName('barText'),
|
|
491
|
-
// 'qq-whitespace-nowrap truncate',
|
|
492
|
-
// 'qq-text-sm'
|
|
493
|
-
// )}
|
|
494
|
-
>
|
|
495
|
-
{/* {item[xAxisField]} */}
|
|
496
|
-
{valueFormatter({
|
|
497
|
-
value: item[xAxisField],
|
|
498
|
-
field: xAxisField,
|
|
499
|
-
fields: [{ field: xAxisField, format: xAxisFormat }],
|
|
500
|
-
})}
|
|
501
|
-
</p>
|
|
502
|
-
</div>
|
|
503
|
-
</div>
|
|
504
|
-
);
|
|
505
|
-
})}
|
|
506
|
-
{data.length > NUM_TO_SHOW && (
|
|
507
|
-
<div
|
|
508
|
-
style={{
|
|
509
|
-
color: theme?.chartLabelColor,
|
|
510
|
-
boxSizing: 'content-box',
|
|
511
|
-
fontFamily: theme?.chartLabelFontFamily || theme?.fontFamily,
|
|
512
|
-
fontSize: theme?.fontSizeSmall || '14px',
|
|
513
|
-
}}
|
|
514
|
-
// className="qq-text-sm"
|
|
515
|
-
>
|
|
516
|
-
...{data.length - NUM_TO_SHOW} more
|
|
517
|
-
</div>
|
|
518
|
-
)}
|
|
519
|
-
</div>
|
|
520
|
-
{/* eslint-disable prettier/prettier */}
|
|
521
|
-
<div
|
|
522
|
-
style={{
|
|
523
|
-
boxSizing: 'content-box',
|
|
524
|
-
textAlign: 'right',
|
|
525
|
-
minWidth: 'min-content',
|
|
526
|
-
paddingLeft: 10,
|
|
527
|
-
}}
|
|
528
|
-
// className={
|
|
529
|
-
// (makeBarListClassName('labels'), 'qq-text-right qq-min-w-min')
|
|
530
|
-
// }
|
|
531
|
-
>
|
|
532
|
-
{data.slice(0, NUM_TO_SHOW).map((item, idx) => (
|
|
533
|
-
<div
|
|
534
|
-
key={item[xAxisField] + 'value' + idx}
|
|
535
|
-
style={{
|
|
536
|
-
boxSizing: 'content-box',
|
|
537
|
-
display: 'flex',
|
|
538
|
-
alignItems: 'center',
|
|
539
|
-
justifyContent: 'flex-end',
|
|
540
|
-
marginBottom: idx === data.length - 1 ? 0 : '8px',
|
|
541
|
-
height: '36px',
|
|
542
|
-
}}
|
|
543
|
-
// className={twMerge(
|
|
544
|
-
// makeBarListClassName('labelWrapper'),
|
|
545
|
-
// 'qq-flex qq-justify-end qq-items-center',
|
|
546
|
-
// 'qq-h-9',
|
|
547
|
-
// idx === data.length - 1 ? 'qq-mb-0' : 'qq-mb-2'
|
|
548
|
-
// )}
|
|
549
|
-
>
|
|
550
|
-
<p
|
|
551
|
-
style={{
|
|
552
|
-
color: theme?.chartLabelColor,
|
|
553
|
-
boxSizing: 'content-box',
|
|
554
|
-
fontFamily: theme?.chartLabelFontFamily || theme?.fontFamily,
|
|
555
|
-
whiteSpace: 'nowrap',
|
|
556
|
-
overflow: 'hidden',
|
|
557
|
-
textOverflow: 'ellipsis',
|
|
558
|
-
fontSize: theme?.fontSizeSmall || '14px',
|
|
559
|
-
}}
|
|
560
|
-
// className={twMerge(
|
|
561
|
-
// makeBarListClassName('labelText'),
|
|
562
|
-
// 'qq-whitespace-nowrap qq-truncate',
|
|
563
|
-
// 'qq-text-sm'
|
|
564
|
-
// )}
|
|
565
|
-
>
|
|
566
|
-
{/* {valueFormatter(item[yAxisFields[0].field])} */}
|
|
567
|
-
{valueFormatter({
|
|
568
|
-
value: item[yAxisFields[0].field],
|
|
569
|
-
field: yAxisFields[0].field,
|
|
570
|
-
fields: yAxisFields,
|
|
571
|
-
})}
|
|
572
|
-
</p>
|
|
573
|
-
</div>
|
|
574
|
-
))}
|
|
575
|
-
</div>
|
|
576
|
-
</div>
|
|
577
|
-
);
|
|
578
|
-
});
|
|
579
|
-
|
|
580
|
-
export default BarList;
|