@quillsql/react 1.1.8 → 1.1.9
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/example/package-lock.json +754 -1643
- package/example/src/App.tsx +2 -1
- package/lib/BarList.d.ts +1 -0
- package/lib/BarList.js +129 -37
- package/lib/BarList.js.map +1 -1
- package/lib/Chart.d.ts +3 -3
- package/lib/Chart.js +66 -30
- package/lib/Chart.js.map +1 -1
- package/lib/Context.d.ts +1 -1
- package/lib/Dashboard.d.ts +1 -1
- package/lib/Dashboard.js +0 -4
- package/lib/Dashboard.js.map +1 -1
- package/lib/DateRangePicker/Calendar.d.ts +1 -1
- package/lib/DateRangePicker/Calendar.js +122 -23
- package/lib/DateRangePicker/Calendar.js.map +1 -1
- package/lib/DateRangePicker/DateRangePicker.js +5 -6
- package/lib/DateRangePicker/DateRangePicker.js.map +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.d.ts +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.js +101 -17
- package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -1
- package/lib/DateRangePicker/dateRangePickerUtils.d.ts +1 -2
- package/lib/DateRangePicker/dateRangePickerUtils.js +113 -79
- package/lib/DateRangePicker/dateRangePickerUtils.js.map +1 -1
- package/lib/PieChart.d.ts +3 -3
- package/lib/PieChart.js +51 -28
- package/lib/PieChart.js.map +1 -1
- package/lib/QuillProvider.d.ts +1 -2
- package/lib/assets/ArrowDownHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowDownIcon.d.ts +1 -2
- package/lib/assets/ArrowDownRightIcon.d.ts +1 -2
- package/lib/assets/ArrowLeftHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowRightHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowRightIcon.d.ts +1 -2
- package/lib/assets/ArrowUpHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowUpIcon.d.ts +1 -2
- package/lib/assets/ArrowUpRightIcon.d.ts +1 -2
- package/lib/assets/CalendarIcon.d.ts +1 -2
- package/lib/assets/DoubleArrowLeftHeadIcon.d.ts +1 -2
- package/lib/assets/DoubleArrowRightHeadIcon.d.ts +1 -2
- package/lib/assets/ExclamationFilledIcon.d.ts +1 -2
- package/lib/assets/LoadingSpinner.d.ts +1 -2
- package/lib/assets/SearchIcon.d.ts +1 -2
- package/lib/assets/XCircleIcon.d.ts +1 -2
- package/lib/components/Dropdown/Dropdown.js +45 -14
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/DropdownItem.d.ts +1 -0
- package/lib/components/Dropdown/DropdownItem.js +21 -29
- package/lib/components/Dropdown/DropdownItem.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts +1 -0
- package/lib/components/Modal/Modal.js +47 -9
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/selectUtils.d.ts +1 -1
- package/lib/components/selectUtils.js +18 -12
- package/lib/components/selectUtils.js.map +1 -1
- package/package.json +1 -8
- package/src/BarList.tsx +193 -96
- package/src/Chart.tsx +108 -48
- package/src/Dashboard.tsx +10 -10
- package/src/DateRangePicker/Calendar.tsx +149 -163
- package/src/DateRangePicker/DateRangePicker.tsx +11 -11
- package/src/DateRangePicker/DateRangePickerButton.tsx +129 -84
- package/src/DateRangePicker/dateRangePickerUtils.tsx +137 -111
- package/src/PieChart.tsx +87 -34
- package/src/components/Dropdown/Dropdown.tsx +50 -69
- package/src/components/Dropdown/DropdownItem.tsx +15 -50
- package/src/components/Modal/Modal.tsx +50 -31
- package/src/components/selectUtils.ts +19 -18
- package/src/styles.css +0 -5
- package/postcss.config.js +0 -6
- package/tailwind.config.js +0 -23
package/src/Chart.tsx
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
import React, { useState, useEffect, useContext } from 'react';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import {
|
|
6
|
-
Card,
|
|
7
|
-
Text,
|
|
8
|
-
Metric,
|
|
9
|
-
Flex,
|
|
10
|
-
ProgressBar,
|
|
11
|
-
AreaChart,
|
|
12
|
-
} from '@tremor/react';
|
|
13
4
|
import {
|
|
14
5
|
Area,
|
|
15
6
|
CartesianGrid,
|
|
@@ -207,9 +198,14 @@ export const ChartTooltipFrame = ({
|
|
|
207
198
|
style={{
|
|
208
199
|
borderStyle: 'solid',
|
|
209
200
|
borderColor: theme.borderColor || '#E5E7EB',
|
|
201
|
+
overflow: 'hidden',
|
|
210
202
|
borderWidth: 1,
|
|
203
|
+
background: theme?.backgroundColor || '#ffffff',
|
|
204
|
+
borderRadius: '0.375rem',
|
|
205
|
+
boxShadow:
|
|
206
|
+
'0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
211
207
|
}}
|
|
212
|
-
className="qq-bg-white qq-text-sm qq-rounded-md qq-shadow-lg"
|
|
208
|
+
// className="qq-bg-white qq-text-sm qq-rounded-md qq-shadow-lg"
|
|
213
209
|
// className={twMerge(
|
|
214
210
|
// 'bg-white',
|
|
215
211
|
// 'font-normal',
|
|
@@ -236,29 +232,53 @@ export const ChartTooltipRow = ({
|
|
|
236
232
|
color,
|
|
237
233
|
theme,
|
|
238
234
|
}: ChartTooltipRowProps) => (
|
|
239
|
-
<div
|
|
240
|
-
|
|
235
|
+
<div
|
|
236
|
+
style={{
|
|
237
|
+
marginRight: '1.5rem',
|
|
238
|
+
display: 'flex',
|
|
239
|
+
alignItems: 'center',
|
|
240
|
+
justifyContent: 'space-between',
|
|
241
|
+
width: '100%',
|
|
242
|
+
paddingTop: 2,
|
|
243
|
+
paddingBottom: 2,
|
|
244
|
+
}}
|
|
245
|
+
// className="qq-flex qq-items-center qq-justify-between qq-space-x-8"
|
|
246
|
+
>
|
|
247
|
+
<div
|
|
248
|
+
// className="qq-flex qq-items-center qq-space-x-2"
|
|
249
|
+
style={{
|
|
250
|
+
// marginLeft: '0.5rem',
|
|
251
|
+
display: 'flex',
|
|
252
|
+
alignItems: 'center',
|
|
253
|
+
}}
|
|
254
|
+
>
|
|
241
255
|
<span
|
|
242
256
|
style={{
|
|
243
257
|
background: color,
|
|
244
258
|
borderWidth: 2,
|
|
259
|
+
borderColor: 'white',
|
|
245
260
|
borderStyle: 'solid',
|
|
246
261
|
borderColor: 'white',
|
|
262
|
+
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
263
|
+
height: '0.5rem',
|
|
264
|
+
width: '0.5rem',
|
|
265
|
+
borderRadius: 100,
|
|
266
|
+
marginRight: 4,
|
|
247
267
|
}}
|
|
248
|
-
className={twMerge(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
)}
|
|
268
|
+
// className={twMerge(
|
|
269
|
+
// 'shrink-0',
|
|
270
|
+
// 'bg-black',
|
|
271
|
+
// 'bg-white',
|
|
272
|
+
// 'border-black',
|
|
273
|
+
// sizing.sm.height,
|
|
274
|
+
// sizing.sm.width,
|
|
275
|
+
// 'qq-h-3',
|
|
276
|
+
// 'qq-w-3',
|
|
277
|
+
// 'qq-shadow',
|
|
278
|
+
// 'qq-rounded-full'
|
|
279
|
+
// border.md.all,
|
|
280
|
+
// boxShadow.md
|
|
281
|
+
// )}
|
|
262
282
|
/>
|
|
263
283
|
<p
|
|
264
284
|
// className={twMerge(
|
|
@@ -270,8 +290,10 @@ export const ChartTooltipRow = ({
|
|
|
270
290
|
marginBottom: 0,
|
|
271
291
|
fontFamily: theme.fontFamily,
|
|
272
292
|
color: theme.primaryTextColor,
|
|
293
|
+
fontSize: theme?.fontSizeSmall || '0.875rem',
|
|
294
|
+
fontWeight: theme?.fontWeightMedium || '500',
|
|
273
295
|
}}
|
|
274
|
-
className="qq-font-medium qq-tabular-nums qq-text-right qq-whitespace-nowrap qq-text-black"
|
|
296
|
+
// className="qq-font-medium qq-tabular-nums qq-text-right qq-whitespace-nowrap qq-text-black"
|
|
275
297
|
>
|
|
276
298
|
{value}
|
|
277
299
|
</p>
|
|
@@ -282,13 +304,19 @@ export const ChartTooltipRow = ({
|
|
|
282
304
|
marginBottom: 0,
|
|
283
305
|
fontFamily: theme.fontFamily,
|
|
284
306
|
color: theme.secondaryTextColor,
|
|
307
|
+
textAlign: 'right',
|
|
308
|
+
whiteSpace: 'nowrap',
|
|
309
|
+
overflow: 'hidden',
|
|
310
|
+
textOverflow: 'ellipsis',
|
|
311
|
+
fontSize: theme?.fontSizeSmall || '0.875rem',
|
|
312
|
+
fontWeight: theme?.fontWeightNormal || '400',
|
|
285
313
|
}}
|
|
286
|
-
className={twMerge(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
)}
|
|
314
|
+
// className={twMerge(
|
|
315
|
+
// 'qq-text-right qq-whitespace-nowrap',
|
|
316
|
+
// getColorClassNames(DEFAULT_COLOR, colorPalette.text).textColor,
|
|
317
|
+
// 'qq-text-gray-500'
|
|
318
|
+
// fontWeight.sm
|
|
319
|
+
// )}
|
|
292
320
|
>
|
|
293
321
|
{name}
|
|
294
322
|
</p>
|
|
@@ -319,12 +347,19 @@ const ChartTooltip = ({
|
|
|
319
347
|
style={{
|
|
320
348
|
borderStyle: 'solid',
|
|
321
349
|
borderBottomColor: theme.borderColor || '#E5E7EB',
|
|
350
|
+
background: theme?.backgroundColor || 'white',
|
|
322
351
|
borderTop: 'none',
|
|
323
352
|
borderLeft: 'none',
|
|
324
353
|
borderRight: 'none',
|
|
325
354
|
borderBottomWidth: 1,
|
|
355
|
+
display: 'flex',
|
|
356
|
+
flexDirection: 'column',
|
|
357
|
+
paddingLeft: '1rem',
|
|
358
|
+
paddingRight: '1rem',
|
|
359
|
+
paddingTop: '0.5rem',
|
|
360
|
+
paddingBottom: '0.5rem',
|
|
326
361
|
}}
|
|
327
|
-
className="qq-flex qq-flex-col qq-py-2 qq-px-4 qq-gray-200"
|
|
362
|
+
// className="qq-flex qq-flex-col qq-py-2 qq-px-4 qq-gray-200"
|
|
328
363
|
// className={
|
|
329
364
|
// twMerge()
|
|
330
365
|
// getColorClassNames(DEFAULT_COLOR, colorPalette.lightBorder)
|
|
@@ -341,16 +376,20 @@ const ChartTooltip = ({
|
|
|
341
376
|
marginBottom: 0,
|
|
342
377
|
fontFamily: theme.fontFamily,
|
|
343
378
|
color: theme.primaryTextColor,
|
|
379
|
+
fontSize: theme?.fontSizeSmall || '0.875rem',
|
|
380
|
+
fontWeight: theme?.boldFontWeight || '500',
|
|
381
|
+
paddingTop: 2,
|
|
382
|
+
paddingBottom: 2,
|
|
344
383
|
}}
|
|
345
|
-
className={twMerge(
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
)}
|
|
384
|
+
// className={twMerge(
|
|
385
|
+
// 'qq-text-elem',
|
|
386
|
+
// 'qq-text-black',
|
|
387
|
+
// 'qq-font-medium',
|
|
388
|
+
// 'qq-gray-700'
|
|
389
|
+
// getColorClassNames(DEFAULT_COLOR, colorPalette.darkText)
|
|
390
|
+
// .textColor,
|
|
391
|
+
// fontWeight.md
|
|
392
|
+
// )}
|
|
354
393
|
>
|
|
355
394
|
{!isNaN(new Date(label))
|
|
356
395
|
? format(new Date(label), 'MMM yyyy')
|
|
@@ -360,7 +399,14 @@ const ChartTooltip = ({
|
|
|
360
399
|
</div>
|
|
361
400
|
|
|
362
401
|
<div
|
|
363
|
-
className="qq-px-4 qq-space-y-1 qq-py-2 qq-px-4"
|
|
402
|
+
// className="qq-px-4 qq-space-y-1 qq-py-2 qq-px-4"
|
|
403
|
+
style={{
|
|
404
|
+
paddingRight: '1rem',
|
|
405
|
+
paddingLeft: '1rem',
|
|
406
|
+
paddingTop: '0.5rem',
|
|
407
|
+
paddingBottom: '0.5rem',
|
|
408
|
+
// marginTop: '0.25rem',
|
|
409
|
+
}}
|
|
364
410
|
// className={
|
|
365
411
|
// twMerge()
|
|
366
412
|
// spacing.twoXl.paddingX,
|
|
@@ -552,12 +598,16 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
552
598
|
if (!chartConfig || loading) {
|
|
553
599
|
return (
|
|
554
600
|
<div
|
|
555
|
-
className="flex flex-col flex-1 h-[100%]"
|
|
601
|
+
// className="flex flex-col flex-1 h-[100%]"
|
|
556
602
|
style={{
|
|
557
603
|
...containerStyle,
|
|
558
604
|
marginLeft: 25,
|
|
559
605
|
marginRight: 25,
|
|
560
606
|
boxSizing: 'content-box',
|
|
607
|
+
height: '100%',
|
|
608
|
+
display: 'flex',
|
|
609
|
+
flexDirection: 'column',
|
|
610
|
+
flex: 1,
|
|
561
611
|
}}
|
|
562
612
|
>
|
|
563
613
|
<div
|
|
@@ -671,9 +721,11 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
671
721
|
textAlign: 'left',
|
|
672
722
|
overflow: 'hidden',
|
|
673
723
|
height: containerStyle?.height || '100%',
|
|
724
|
+
display: 'flex',
|
|
725
|
+
flexDirection: 'column',
|
|
674
726
|
// background: 'red',
|
|
675
727
|
}}
|
|
676
|
-
className="qq-flex qq-flex-col qq-text-xl"
|
|
728
|
+
// className="qq-flex qq-flex-col qq-text-xl"
|
|
677
729
|
>
|
|
678
730
|
{formatNumber(
|
|
679
731
|
chartConfig.rows[0][chartConfig.xAxisField],
|
|
@@ -782,8 +834,16 @@ function BarChart({
|
|
|
782
834
|
const newColors = findComplementaryAndAnalogousColors(colors[0], colors[1]);
|
|
783
835
|
return (
|
|
784
836
|
<div
|
|
785
|
-
style={{
|
|
786
|
-
|
|
837
|
+
style={{
|
|
838
|
+
...containerStyle,
|
|
839
|
+
boxSizing: 'content-box',
|
|
840
|
+
display: 'flex',
|
|
841
|
+
flexDirection: 'column',
|
|
842
|
+
flex: 1,
|
|
843
|
+
height: '100%',
|
|
844
|
+
width: '100%',
|
|
845
|
+
}}
|
|
846
|
+
// className="qq-flex qq-flex-col qq-flex-1 qq-h-full qq-w-full"
|
|
787
847
|
>
|
|
788
848
|
<ResponsiveContainer width="100%" height={'100%'}>
|
|
789
849
|
<ReChartsBarChart
|
package/src/Dashboard.tsx
CHANGED
|
@@ -191,11 +191,11 @@ export default function Dashboard({
|
|
|
191
191
|
? () => handleOnClickDashboardItem(elem._id)
|
|
192
192
|
: undefined
|
|
193
193
|
}
|
|
194
|
-
className={
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
194
|
+
// className={
|
|
195
|
+
// onClickDashboardItem
|
|
196
|
+
// ? 'hover:qq-bg-zinc-50'
|
|
197
|
+
// : undefined
|
|
198
|
+
// }
|
|
199
199
|
key={elem.name + '' + index}
|
|
200
200
|
style={{
|
|
201
201
|
// background: theme.elevatedCardColor,
|
|
@@ -355,11 +355,11 @@ export default function Dashboard({
|
|
|
355
355
|
? () => handleOnClickDashboardItem(elem._id)
|
|
356
356
|
: undefined
|
|
357
357
|
}
|
|
358
|
-
className={
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
358
|
+
// className={
|
|
359
|
+
// onClickDashboardItem
|
|
360
|
+
// ? 'hover:qq-bg-zinc-50'
|
|
361
|
+
// : undefined
|
|
362
|
+
// }
|
|
363
363
|
// className="qq-shadow-md"
|
|
364
364
|
key={elem.name + '' + index}
|
|
365
365
|
// onClick={() => handleEditDashboardItem(elem)}
|