@quillsql/react 2.11.19 → 2.11.21
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/dist/cjs/Chart.d.ts +6 -0
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +13 -13
- package/dist/cjs/ChartBuilder.d.ts +27 -6
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +86 -57
- package/dist/cjs/ChartEditor.d.ts +12 -1
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +3 -3
- package/dist/cjs/Dashboard.d.ts +3 -2
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.js +1 -1
- package/dist/cjs/ReportBuilder.d.ts +9 -1
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +56 -41
- package/dist/cjs/SQLEditor.d.ts +7 -1
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +3 -6
- package/dist/cjs/Table.d.ts +6 -0
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/Table.js +4 -4
- package/dist/cjs/components/Chart/BarChart.d.ts +2 -1
- package/dist/cjs/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.js +6 -4
- package/dist/cjs/components/Chart/BarList.d.ts +3 -2
- package/dist/cjs/components/Chart/BarList.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarList.js +3 -3
- package/dist/cjs/components/Chart/ChartError.d.ts +1 -1
- package/dist/cjs/components/Chart/ChartError.d.ts.map +1 -1
- package/dist/cjs/components/Chart/ChartError.js +2 -2
- package/dist/cjs/components/Chart/ChartSkeleton.d.ts +2 -1
- package/dist/cjs/components/Chart/ChartSkeleton.d.ts.map +1 -1
- package/dist/cjs/components/Chart/ChartSkeleton.js +2 -2
- package/dist/cjs/components/Chart/LineChart.d.ts +2 -1
- package/dist/cjs/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/LineChart.js +3 -3
- package/dist/cjs/components/Chart/PieChart.d.ts +1 -0
- package/dist/cjs/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/PieChart.js +4 -100
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts +2 -1
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardFilter.js +2 -2
- package/dist/cjs/components/QuillCard.d.ts +1 -1
- package/dist/cjs/components/QuillCard.d.ts.map +1 -1
- package/dist/cjs/components/QuillCard.js +1 -1
- package/dist/cjs/components/QuillSelect.d.ts +1 -1
- package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelect.js +5 -3
- package/dist/cjs/components/QuillTable.d.ts +2 -1
- package/dist/cjs/components/QuillTable.d.ts.map +1 -1
- package/dist/cjs/components/QuillTable.js +5 -5
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.js +2 -9
- package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddSortPopover.js +2 -2
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +4 -16
- package/dist/cjs/components/UiComponents.d.ts +9 -9
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +32 -17
- package/dist/cjs/internals/ReportBuilder/PivotList.d.ts +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotList.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotList.js +3 -3
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +25 -24
- package/dist/cjs/utils/color.d.ts +6 -0
- package/dist/cjs/utils/color.d.ts.map +1 -1
- package/dist/cjs/utils/color.js +98 -1
- package/dist/cjs/utils/valueFormatter.d.ts.map +1 -1
- package/dist/cjs/utils/valueFormatter.js +32 -2
- package/dist/esm/Chart.d.ts +6 -0
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +13 -13
- package/dist/esm/ChartBuilder.d.ts +27 -6
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +87 -58
- package/dist/esm/ChartEditor.d.ts +12 -1
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +4 -4
- package/dist/esm/Dashboard.d.ts +3 -2
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/QuillDateRangePicker.js +1 -1
- package/dist/esm/ReportBuilder.d.ts +9 -1
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +56 -41
- package/dist/esm/SQLEditor.d.ts +7 -1
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +3 -6
- package/dist/esm/Table.d.ts +6 -0
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/Table.js +4 -4
- package/dist/esm/components/Chart/BarChart.d.ts +2 -1
- package/dist/esm/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.js +7 -5
- package/dist/esm/components/Chart/BarList.d.ts +3 -2
- package/dist/esm/components/Chart/BarList.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarList.js +3 -3
- package/dist/esm/components/Chart/ChartError.d.ts +1 -1
- package/dist/esm/components/Chart/ChartError.d.ts.map +1 -1
- package/dist/esm/components/Chart/ChartError.js +2 -2
- package/dist/esm/components/Chart/ChartSkeleton.d.ts +2 -1
- package/dist/esm/components/Chart/ChartSkeleton.d.ts.map +1 -1
- package/dist/esm/components/Chart/ChartSkeleton.js +2 -2
- package/dist/esm/components/Chart/LineChart.d.ts +2 -1
- package/dist/esm/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/LineChart.js +3 -3
- package/dist/esm/components/Chart/PieChart.d.ts +1 -0
- package/dist/esm/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/PieChart.js +3 -99
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts +2 -1
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardFilter.js +2 -2
- package/dist/esm/components/QuillCard.d.ts +1 -1
- package/dist/esm/components/QuillCard.d.ts.map +1 -1
- package/dist/esm/components/QuillCard.js +1 -1
- package/dist/esm/components/QuillSelect.d.ts +1 -1
- package/dist/esm/components/QuillSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillSelect.js +5 -3
- package/dist/esm/components/QuillTable.d.ts +2 -1
- package/dist/esm/components/QuillTable.d.ts.map +1 -1
- package/dist/esm/components/QuillTable.js +5 -5
- package/dist/esm/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddColumnPopover.js +2 -9
- package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddSortPopover.js +2 -2
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +4 -16
- package/dist/esm/components/UiComponents.d.ts +9 -9
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +32 -17
- package/dist/esm/internals/ReportBuilder/PivotList.d.ts +1 -1
- package/dist/esm/internals/ReportBuilder/PivotList.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotList.js +3 -3
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +25 -24
- package/dist/esm/utils/color.d.ts +6 -0
- package/dist/esm/utils/color.d.ts.map +1 -1
- package/dist/esm/utils/color.js +96 -0
- package/dist/esm/utils/valueFormatter.d.ts.map +1 -1
- package/dist/esm/utils/valueFormatter.js +32 -2
- package/package.json +1 -1
package/dist/esm/SQLEditor.js
CHANGED
|
@@ -131,7 +131,7 @@ function setEditorTheme(editor, monaco) {
|
|
|
131
131
|
* ### SQLEditor API
|
|
132
132
|
* @see https://docs.quillsql.com/components/sql-editor
|
|
133
133
|
*/
|
|
134
|
-
export default function SQLEditor({ ButtonComponent = MemoizedButton, SecondaryButtonComponent = MemoizedSecondaryButton, TextInputComponent = QuillTextInput, TableComponent = QuillTableComponent, isNewQueryEnabled = false, LoadingComponent, ModalComponent = MemoizedModal, CardComponent = QuillCard, defaultQuery, onChangeQuery, onChangeData, onChangeColumns, onChangeFields, isChartBuilderEnabled = false, showTableFormatOptions = false, showDateFieldOptions = false, showAccessControlOptions = false, destinationDashboard, chartBuilderTitle, chartBuilderButtonLabel, onAddToDashboardComplete, addToDashboardButtonLabel = 'Add to dashboard', dashboardItem = undefined, organizationName = undefined, isChartBuilderHorizontalView = true, containerStyle = { height: '100vh' }, }) {
|
|
134
|
+
export default function SQLEditor({ ButtonComponent = MemoizedButton, SecondaryButtonComponent = MemoizedSecondaryButton, TextInputComponent = QuillTextInput, TableComponent = QuillTableComponent, isNewQueryEnabled = false, LoadingComponent, ModalComponent = MemoizedModal, CardComponent = QuillCard, defaultQuery, onChangeQuery, onChangeData, onChangeColumns, onChangeFields, isChartBuilderEnabled = false, showTableFormatOptions = false, showDateFieldOptions = false, showAccessControlOptions = false, destinationDashboard, chartBuilderTitle, chartBuilderButtonLabel, onAddToDashboardComplete, addToDashboardButtonLabel = 'Add to dashboard', dashboardItem = undefined, organizationName = undefined, isChartBuilderHorizontalView = true, containerStyle = { height: '100vh' }, className, }) {
|
|
135
135
|
const [sqlPrompt, setSqlPrompt] = useState('');
|
|
136
136
|
const [client] = useContext(ClientContext);
|
|
137
137
|
const [theme] = useContext(ThemeContext);
|
|
@@ -290,7 +290,7 @@ export default function SQLEditor({ ButtonComponent = MemoizedButton, SecondaryB
|
|
|
290
290
|
onChangeQuery(query);
|
|
291
291
|
}
|
|
292
292
|
}, [query]);
|
|
293
|
-
return (_jsxs("div", { style: containerStyle, children: [(!isChartBuilderHorizontalView ||
|
|
293
|
+
return (_jsxs("div", { style: { backgroundColor: theme.backgroundColor, ...containerStyle }, className: className, children: [(!isChartBuilderHorizontalView ||
|
|
294
294
|
(isChartBuilderHorizontalView && !isChartBuilderOpen)) && (_jsx("div", { style: {
|
|
295
295
|
height: '100%',
|
|
296
296
|
display: 'flex',
|
|
@@ -350,11 +350,10 @@ export default function SQLEditor({ ButtonComponent = MemoizedButton, SecondaryB
|
|
|
350
350
|
justifyContent: 'flex-end',
|
|
351
351
|
width: '100%',
|
|
352
352
|
height: '70px',
|
|
353
|
-
}, children: _jsx(ButtonComponent, { onClick: () => setIsChartBuilderOpen(true), label: addToDashboardButtonLabel }) }))] })] }) }) })), _jsx(ChartBuilderWithModal, { rows: rows, columns: columns, fields: fields, query: query,
|
|
353
|
+
}, children: _jsx(ButtonComponent, { onClick: () => setIsChartBuilderOpen(true), label: addToDashboardButtonLabel }) }))] })] }) }) })), _jsx(ChartBuilderWithModal, { rows: rows, columns: columns, fields: fields, query: query, isHorizontalView: isChartBuilderHorizontalView, isOpen: isChartBuilderOpen, setIsOpen: setIsChartBuilderOpen, onAddToDashboardComplete: onAddToDashboardComplete, showTableFormatOptions: showTableFormatOptions, showDateFieldOptions: showDateFieldOptions, showAccessControlOptions: showAccessControlOptions, destinationDashboard: destinationDashboard, title: chartBuilderTitle, button: chartBuilderButtonLabel, buttonLabel: addToDashboardButtonLabel, dashboardItem: dashboardItem, organizationName: organizationName, CardComponent: CardComponent, TableComponent: TableComponent, ModalComponent: ModalComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent })] }));
|
|
354
354
|
}
|
|
355
355
|
const SQLEditorComponent = ({ query, setQuery, handleRunQuery, handleFixWithAI, handleClearQuery, defineEditorTheme, setEditorTheme, ButtonComponent, SecondaryButtonComponent, isNewQueryEnabled, theme, loading, LoadingComponent, }) => {
|
|
356
356
|
return (_jsxs("div", { style: {
|
|
357
|
-
background: theme.backgroundColor,
|
|
358
357
|
// maxHeight: 700,
|
|
359
358
|
width: '100%',
|
|
360
359
|
height: '100%',
|
|
@@ -392,7 +391,6 @@ const SQLEditorComponent = ({ query, setQuery, handleRunQuery, handleFixWithAI,
|
|
|
392
391
|
export const SchemaListComponent = ({ schema, theme, loading, LoadingComponent, width, onClick = () => { }, }) => {
|
|
393
392
|
if (loading) {
|
|
394
393
|
return (_jsxs("div", { style: {
|
|
395
|
-
background: theme.backgroundColor,
|
|
396
394
|
// maxHeight: 700,
|
|
397
395
|
width: width || 250,
|
|
398
396
|
minWidth: 250,
|
|
@@ -408,7 +406,6 @@ export const SchemaListComponent = ({ schema, theme, loading, LoadingComponent,
|
|
|
408
406
|
}, children: [_jsx("div", { style: { height: 100 } }), LoadingComponent && _jsx(LoadingComponent, {}), !LoadingComponent && (_jsxs("svg", { width: "24", height: "24", children: [_jsx("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 6)", stroke: theme?.primaryTextColor || '#364153', fill: "none", transform: "rotate(-90 12 12)", children: _jsx("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "-180 12 12", to: "180 12 12", dur: "0.8s", repeatCount: "indefinite" }) }), _jsx("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 1 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", stroke: '#ADB1B9', fill: "none", transform: "rotate(90 12 12)", children: _jsx("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "0 12 12", to: "360 12 12", dur: "0.8s", repeatCount: "indefinite" }) })] }))] }));
|
|
409
407
|
}
|
|
410
408
|
return (_jsx("div", { style: {
|
|
411
|
-
background: theme.backgroundColor,
|
|
412
409
|
// maxHeight: 700,
|
|
413
410
|
width: width || 250,
|
|
414
411
|
minWidth: 250,
|
package/dist/esm/Table.d.ts
CHANGED
|
@@ -90,6 +90,12 @@ export interface TableProps {
|
|
|
90
90
|
* A loading component to show when the table is loading.
|
|
91
91
|
*/
|
|
92
92
|
LoadingComponent?: () => JSX.Element;
|
|
93
|
+
/**
|
|
94
|
+
* Styles the top-level container of the Table.
|
|
95
|
+
*
|
|
96
|
+
* This can be useful for TailwindCSS-style classname strings.
|
|
97
|
+
*/
|
|
98
|
+
className?: string;
|
|
93
99
|
/**
|
|
94
100
|
* Styles the top-level container of the Table.
|
|
95
101
|
*/
|
package/dist/esm/Table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAYrD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAYrD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAyBD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,CAAC;IAEhC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IAEJ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAEzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC;IAErC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,QAAA,MAAM,KAAK,UAAW,UAAU,4CAmC/B,CAAC;AAiGF,eAAe,KAAK,CAAC"}
|
package/dist/esm/Table.js
CHANGED
|
@@ -43,11 +43,11 @@ const Table = (props) => {
|
|
|
43
43
|
const { dashboardFilters } = useContext(DashboardFiltersContext);
|
|
44
44
|
const [client, _] = useContext(ClientContext);
|
|
45
45
|
if ('rows' in data && 'columns' in data) {
|
|
46
|
-
return (_jsx(QuillTable, { showDownloadCSVButton: data.showDownloadCSVButton, downloadFileName: data.csvFilename, columns: data.columns, rows: data.rows, containerStyle: data.containerStyle, LoadingComponent: data.LoadingComponent, isLoading: data.isLoading, downloadCSV: data.downloadCSV }));
|
|
46
|
+
return (_jsx(QuillTable, { showDownloadCSVButton: data.showDownloadCSVButton, downloadFileName: data.csvFilename, columns: data.columns, rows: data.rows, className: data.className, containerStyle: data.containerStyle, LoadingComponent: data.LoadingComponent, isLoading: data.isLoading, downloadCSV: data.downloadCSV }));
|
|
47
47
|
}
|
|
48
|
-
return (_jsx(ChartUpdater, { showDownloadCSVButton: data.showDownloadCSVButton, dispatch: dispatch, dashboard: dashboard, chartId: data.chartId, containerStyle: data.containerStyle, dashboardFilters: dashboardFilters, client: client, csvFilename: data.csvFilename, LoadingComponent: data.LoadingComponent }));
|
|
48
|
+
return (_jsx(ChartUpdater, { showDownloadCSVButton: data.showDownloadCSVButton, dispatch: dispatch, dashboard: dashboard, chartId: data.chartId, className: data.className, containerStyle: data.containerStyle, dashboardFilters: dashboardFilters, client: client, csvFilename: data.csvFilename, LoadingComponent: data.LoadingComponent }));
|
|
49
49
|
};
|
|
50
|
-
const ChartUpdater = ({ chartId, containerStyle, dashboard, dispatch, client, dashboardFilters, csvFilename, showDownloadCSVButton = true, LoadingComponent, }) => {
|
|
50
|
+
const ChartUpdater = ({ chartId, containerStyle, className, dashboard, dispatch, client, dashboardFilters, csvFilename, showDownloadCSVButton = true, LoadingComponent, }) => {
|
|
51
51
|
const { rows, loading } = useMemoizedRows(chartId);
|
|
52
52
|
const { downloadCSV } = useExport(chartId);
|
|
53
53
|
useEffect(() => {
|
|
@@ -100,6 +100,6 @@ const ChartUpdater = ({ chartId, containerStyle, dashboard, dispatch, client, da
|
|
|
100
100
|
// @ts-ignore
|
|
101
101
|
columns: dashboard[chartId]?.columns || [],
|
|
102
102
|
// @ts-ignore
|
|
103
|
-
rows: rows || dashboard[chartId]?.rows || [], containerStyle: containerStyle, LoadingComponent: LoadingComponent, isLoading: loading, downloadCSV: downloadCSV }));
|
|
103
|
+
rows: rows || dashboard[chartId]?.rows || [], containerStyle: containerStyle, className: className, LoadingComponent: LoadingComponent, isLoading: loading, downloadCSV: downloadCSV }));
|
|
104
104
|
};
|
|
105
105
|
export default Table;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type ColorMapType } from '../../Chart';
|
|
3
|
-
export default function BarChart({ colors, colorMap, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, }: {
|
|
3
|
+
export default function BarChart({ colors, colorMap, yAxisFields, data, containerStyle, className, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, }: {
|
|
4
4
|
colors?: string[];
|
|
5
5
|
colorMap?: ColorMapType;
|
|
6
6
|
yAxisFields: any[];
|
|
7
7
|
data: any[];
|
|
8
8
|
containerStyle?: React.CSSProperties;
|
|
9
|
+
className?: string;
|
|
9
10
|
xAxisField: string;
|
|
10
11
|
xAxisLabel: string;
|
|
11
12
|
xAxisFormat: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/BarChart.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,MAAM,EACN,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,cAAc,EACd,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,GAC1B,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/BarChart.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,MAAM,EACN,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,cAAc,EACd,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,GAC1B,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,2CAuLA"}
|
|
@@ -3,11 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis, Bar, BarChart as ReChartsBarChart, } from 'recharts';
|
|
4
4
|
import { valueFormatter } from '../../utils/valueFormatter';
|
|
5
5
|
import { axisFormatter } from '../../utils/axisFormatter';
|
|
6
|
-
import { selectColor } from '../../utils/color';
|
|
6
|
+
import { generateArrayFromColor, selectColor } from '../../utils/color';
|
|
7
7
|
import ChartTooltip from '../../components/Chart/ChartTooltip';
|
|
8
8
|
import getDomain from '../../utils/getDomain';
|
|
9
9
|
import { useEffect, useState } from 'react';
|
|
10
|
-
export default function BarChart({ colors, colorMap, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesianGrid = false, }) {
|
|
10
|
+
export default function BarChart({ colors, colorMap, yAxisFields, data, containerStyle, className, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesianGrid = false, }) {
|
|
11
11
|
const [formattedData, setFormattedData] = useState([]);
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
if (!data || data.length === 0) {
|
|
@@ -41,12 +41,12 @@ export default function BarChart({ colors, colorMap, yAxisFields, data, containe
|
|
|
41
41
|
fontSize: 13,
|
|
42
42
|
color: theme.secondaryTextColor,
|
|
43
43
|
...containerStyle,
|
|
44
|
-
}, children: "No results found for specified time period." }));
|
|
44
|
+
}, className: className, children: "No results found for specified time period." }));
|
|
45
45
|
}
|
|
46
46
|
return (_jsx("div", { style: {
|
|
47
47
|
boxSizing: 'content-box',
|
|
48
48
|
...containerStyle,
|
|
49
|
-
}, children: _jsx(ResponsiveContainer, { width: "100%", height: '100%', children: _jsxs(ReChartsBarChart, { data: formattedData, layout: 'horizontal', children: [!hideCartesianGrid && (_jsx(CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), _jsx(YAxis, { width: 44, hide: hideYAxis, axisLine: false, tickLine: false, type: "number", domain: getDomain(data, yAxisFields), tick: { transform: 'translate(-3, 0)' }, tickCount: 5, style: {
|
|
49
|
+
}, className: className, children: _jsx(ResponsiveContainer, { width: "100%", height: '100%', children: _jsxs(ReChartsBarChart, { data: formattedData, layout: 'horizontal', children: [!hideCartesianGrid && (_jsx(CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), _jsx(YAxis, { width: 44, hide: hideYAxis, axisLine: false, tickLine: false, type: "number", domain: getDomain(data, yAxisFields), tick: { transform: 'translate(-3, 0)' }, tickCount: 5, style: {
|
|
50
50
|
fontSize: '12px',
|
|
51
51
|
fontFamily: theme.chartLabelFontFamily,
|
|
52
52
|
}, tickFormatter: (tick) => axisFormatter({
|
|
@@ -81,6 +81,8 @@ export default function BarChart({ colors, colorMap, yAxisFields, data, containe
|
|
|
81
81
|
return (_jsx(Bar, { name: elem.label, dataKey: elem.field, stackId: isStacked &&
|
|
82
82
|
(elem.field?.replace('comparison_', '') ??
|
|
83
83
|
'unknown'), type: "linear", fill: getCustomColor(elem.field) ??
|
|
84
|
-
selectColor(elem, colors
|
|
84
|
+
selectColor(elem, colors.length >= yAxisFields.length / (comparison ? 2 : 1)
|
|
85
|
+
? colors
|
|
86
|
+
: generateArrayFromColor(colors.slice(0, 2), yAxisFields.length), yAxisFields.findIndex((field) => field.field === elem.field?.replace('comparison_', ''))), isAnimationActive: isAnimationActive }, elem.field));
|
|
85
87
|
})] }) }) }));
|
|
86
88
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { type ColorMapType } from '../../Chart';
|
|
3
3
|
interface YAxisField {
|
|
4
4
|
label: string;
|
|
@@ -12,7 +12,8 @@ export interface BarListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
showAnimation?: boolean;
|
|
13
13
|
xAxisField: string;
|
|
14
14
|
yAxisFields: YAxisField[];
|
|
15
|
-
containerStyle
|
|
15
|
+
containerStyle?: CSSProperties;
|
|
16
|
+
className?: string;
|
|
16
17
|
xAxisFormat: string;
|
|
17
18
|
colors?: string[];
|
|
18
19
|
colorMap?: ColorMapType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarList.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/BarList.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"BarList.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/BarList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAcvD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAuBhD,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACxE,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC;CACZ;AAYD,wBAAgB,2BAA2B,CAAC,GAAG,KAAA,UAW9C;AAED,QAAA,MAAM,OAAO,qFA2dX,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
|
@@ -50,11 +50,11 @@ const BarList = React.forwardRef((props, ref) => {
|
|
|
50
50
|
fontSize: 13,
|
|
51
51
|
color: theme.secondaryTextColor,
|
|
52
52
|
...containerStyle,
|
|
53
|
-
}, children: "No results found for specified time period." }));
|
|
53
|
+
}, className: className, children: "No results found for specified time period." }));
|
|
54
54
|
}
|
|
55
55
|
if (yAxisFields.length > 1) {
|
|
56
56
|
const widths2 = getWidthsFromValues(data.map((item) => item[yAxisFields[1].field]));
|
|
57
|
-
return (_jsxs("div", { ref: ref, style: {
|
|
57
|
+
return (_jsxs("div", { ref: ref, className: className, style: {
|
|
58
58
|
...containerStyle,
|
|
59
59
|
// width: '100%',
|
|
60
60
|
// height: '100%',
|
|
@@ -205,7 +205,7 @@ const BarList = React.forwardRef((props, ref) => {
|
|
|
205
205
|
}) }) }, item[xAxisField] + 'label' + idx));
|
|
206
206
|
}) })] }));
|
|
207
207
|
}
|
|
208
|
-
return (_jsx("div", { ref: ref, style: {
|
|
208
|
+
return (_jsx("div", { ref: ref, className: className, style: {
|
|
209
209
|
// width: '100%',
|
|
210
210
|
boxSizing: 'content-box',
|
|
211
211
|
height: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartError.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartError.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,cAAc,EAAE,EAAE,GAAG,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"ChartError.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartError.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,GAAG,GAAG,GAAG,CAAC,OAAO,CAqClF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { ThemeContext } from '../../Context';
|
|
4
|
-
export default function ChartError({ containerStyle }) {
|
|
4
|
+
export default function ChartError({ className, containerStyle }) {
|
|
5
5
|
const [theme] = useContext(ThemeContext);
|
|
6
6
|
return (_jsx("div", { style: {
|
|
7
7
|
boxSizing: 'content-box',
|
|
8
8
|
height: '100%',
|
|
9
9
|
...containerStyle,
|
|
10
|
-
}, children: _jsx("div", { style: {
|
|
10
|
+
}, className: className, children: _jsx("div", { style: {
|
|
11
11
|
height: containerStyle?.height,
|
|
12
12
|
width: '100%',
|
|
13
13
|
boxSizing: 'content-box',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
export interface SkeletonComponentProps {
|
|
3
3
|
conatinerStyle?: CSSProperties;
|
|
4
|
+
className?: string;
|
|
4
5
|
}
|
|
5
|
-
export default function ChartSkeleton({ containerStyle }: any): JSX.Element;
|
|
6
|
+
export default function ChartSkeleton({ className, containerStyle }: any): JSX.Element;
|
|
6
7
|
//# sourceMappingURL=ChartSkeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartSkeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartSkeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,WAAW,sBAAsB;IACrC,cAAc,CAAC,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartSkeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartSkeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,WAAW,sBAAsB;IACrC,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,GAAG,GAAG,GAAG,CAAC,OAAO,CA0ErF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { ThemeContext } from '../../Context';
|
|
4
|
-
export default function ChartSkeleton({ containerStyle }) {
|
|
4
|
+
export default function ChartSkeleton({ className, containerStyle }) {
|
|
5
5
|
const [theme] = useContext(ThemeContext);
|
|
6
6
|
return (_jsx("div", { style: {
|
|
7
7
|
boxSizing: 'content-box',
|
|
8
8
|
height: '100%',
|
|
9
9
|
...containerStyle,
|
|
10
|
-
}, children: _jsx("div", { style: {
|
|
10
|
+
}, className: className, children: _jsx("div", { style: {
|
|
11
11
|
height: '100%',
|
|
12
12
|
width: '100%',
|
|
13
13
|
boxSizing: 'content-box',
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type ColorMapType } from '../../Chart';
|
|
3
|
-
export default function LineChart({ colors, colorMap, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, comparisonLineStyle, }: {
|
|
3
|
+
export default function LineChart({ colors, colorMap, yAxisFields, data, containerStyle, className, xAxisField, xAxisFormat, theme, comparison, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, comparisonLineStyle, }: {
|
|
4
4
|
colors?: string[];
|
|
5
5
|
colorMap?: ColorMapType;
|
|
6
6
|
yAxisFields: any[];
|
|
7
7
|
data: any[];
|
|
8
8
|
containerStyle?: React.CSSProperties;
|
|
9
|
+
className?: string;
|
|
9
10
|
xAxisField: string;
|
|
10
11
|
xAxisLabel: string;
|
|
11
12
|
xAxisFormat: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/LineChart.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,QAAa,EACb,WAAW,EACX,IAAI,EACJ,cAAc,EACd,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,EACzB,mBAA6B,GAC9B,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,GAAG,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,GAAG,QAAQ,CAAC;CACzC,
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/LineChart.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,QAAa,EACb,WAAW,EACX,IAAI,EACJ,cAAc,EACd,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,EACzB,mBAA6B,GAC9B,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,GAAG,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,GAAG,QAAQ,CAAC;CACzC,kDAiPA"}
|
|
@@ -8,7 +8,7 @@ import ChartTooltip from '../../components/Chart/ChartTooltip';
|
|
|
8
8
|
import getDomain from '../../utils/getDomain';
|
|
9
9
|
import { useEffect, useState } from 'react';
|
|
10
10
|
import { hashCode } from '../../utils/crypto';
|
|
11
|
-
export default function LineChart({ colors, colorMap = {}, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesianGrid = false, comparisonLineStyle = 'solid', }) {
|
|
11
|
+
export default function LineChart({ colors, colorMap = {}, yAxisFields, data, containerStyle, className, xAxisField, xAxisFormat, theme, comparison, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesianGrid = false, comparisonLineStyle = 'solid', }) {
|
|
12
12
|
const [formattedData, setFormattedData] = useState([]);
|
|
13
13
|
if (!yAxisFields || !yAxisFields.length) {
|
|
14
14
|
return null;
|
|
@@ -45,7 +45,7 @@ export default function LineChart({ colors, colorMap = {}, yAxisFields, data, co
|
|
|
45
45
|
fontSize: 13,
|
|
46
46
|
color: theme.secondaryTextColor,
|
|
47
47
|
...containerStyle,
|
|
48
|
-
}, children: "No results" }));
|
|
48
|
+
}, className: className, children: "No results" }));
|
|
49
49
|
}
|
|
50
50
|
// Allows the users to override the color scheme on a per-chart basis.
|
|
51
51
|
const getCustomColor = (index, field, gradient) => {
|
|
@@ -64,7 +64,7 @@ export default function LineChart({ colors, colorMap = {}, yAxisFields, data, co
|
|
|
64
64
|
}
|
|
65
65
|
return undefined; // use the default colors from the theme
|
|
66
66
|
};
|
|
67
|
-
return (_jsx("div", { style: { ...containerStyle }, children: _jsx(ResponsiveContainer, { width: "100%", height: '100%', children: _jsxs(ReChartsAreaChart, { data: formattedData, children: [!hideCartesianGrid && (_jsx(CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), _jsx(XAxis, { dataKey: xAxisField, hide: hideXAxis, tick: { transform: 'translate(0, 6)' }, style: {
|
|
67
|
+
return (_jsx("div", { style: { ...containerStyle }, className: className, children: _jsx(ResponsiveContainer, { width: "100%", height: '100%', children: _jsxs(ReChartsAreaChart, { data: formattedData, children: [!hideCartesianGrid && (_jsx(CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), _jsx(XAxis, { dataKey: xAxisField, hide: hideXAxis, tick: { transform: 'translate(0, 6)' }, style: {
|
|
68
68
|
fontSize: '12px',
|
|
69
69
|
fontFamily: theme?.chartLabelFontFamily ||
|
|
70
70
|
theme?.fontFamily ||
|
|
@@ -53,6 +53,7 @@ export interface DonutChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
53
53
|
showAnimation?: boolean;
|
|
54
54
|
showTooltip?: boolean;
|
|
55
55
|
containerStyle?: CSSProperties;
|
|
56
|
+
className?: string;
|
|
56
57
|
theme?: any;
|
|
57
58
|
}
|
|
58
59
|
declare const PieChartWrapper: React.ForwardRefExoticComponent<DonutChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/PieChart.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"PieChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/PieChart.tsx"],"names":[],"mappings":"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ACnB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,eAAe,wFAwGpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Pie, PieChart, ResponsiveContainer, Tooltip } from 'recharts';
|
|
7
|
-
import {
|
|
7
|
+
import { generateArrayFromColor } from '../../utils/color';
|
|
8
8
|
const iconVariantValues = [
|
|
9
9
|
'simple',
|
|
10
10
|
'light',
|
|
@@ -160,102 +160,6 @@ export const DonutChartTooltip = ({ active, payload, valueFormatter, theme, }) =
|
|
|
160
160
|
}
|
|
161
161
|
return null;
|
|
162
162
|
};
|
|
163
|
-
function hexToRgb(hex) {
|
|
164
|
-
const r = parseInt(hex.substring(1, 3), 16);
|
|
165
|
-
const g = parseInt(hex.substring(3, 5), 16);
|
|
166
|
-
const b = parseInt(hex.substring(5, 7), 16);
|
|
167
|
-
return { r, g, b };
|
|
168
|
-
}
|
|
169
|
-
function rgbToHex(rgb) {
|
|
170
|
-
const rHex = rgb.r.toString(16).padStart(2, '0');
|
|
171
|
-
const gHex = rgb.g.toString(16).padStart(2, '0');
|
|
172
|
-
const bHex = rgb.b.toString(16).padStart(2, '0');
|
|
173
|
-
return `#${rHex}${gHex}${bHex}`;
|
|
174
|
-
}
|
|
175
|
-
function colorToHSL(color) {
|
|
176
|
-
const colorHex = namedColorToHex(color);
|
|
177
|
-
const { r, g, b } = hexToRgb(colorHex);
|
|
178
|
-
return RGBToHSL(r, g, b);
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Interpolates between two colors using HSL color space.
|
|
182
|
-
* @param leftColor - The left color in hexadecimal format.
|
|
183
|
-
* @param rightColor - The right color in hexadecimal format.
|
|
184
|
-
* @param length - The number of interpolated colors to generate between the
|
|
185
|
-
* left and right colors.
|
|
186
|
-
*/
|
|
187
|
-
function interpolateBetween(leftColor, rightColor, length = 3) {
|
|
188
|
-
const [h, s, _l] = colorToHSL(leftColor);
|
|
189
|
-
const [h2, s2, _l2] = colorToHSL(rightColor);
|
|
190
|
-
const hues = linspace(h, h2, length);
|
|
191
|
-
const saturations = linspace(s, s2, length);
|
|
192
|
-
const lightnesses = linspace(_l, _l2, length);
|
|
193
|
-
return Array.from({ length }).map((_, i) => {
|
|
194
|
-
const [r, g, b] = HSLtoRGB(hues[i], saturations[i], lightnesses[i]);
|
|
195
|
-
return rgbToHex({ r: Math.round(r), g: Math.round(g), b: Math.round(b) });
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Generates monochromatic interpolation of a given color.
|
|
200
|
-
* @param color - The base color in hexadecimal format.
|
|
201
|
-
* @param length - The number of interpolated colors to generate.
|
|
202
|
-
*/
|
|
203
|
-
function monochromaticInterpolation(color, length) {
|
|
204
|
-
const [h, s, _l] = colorToHSL(color);
|
|
205
|
-
const hues = linspace(h, h, length);
|
|
206
|
-
const saturations = linspace(s, s, length);
|
|
207
|
-
const lightnesses = linspace(0.6, 0.9, length);
|
|
208
|
-
return Array.from({ length }).map((_, i) => {
|
|
209
|
-
const [r, g, b] = HSLtoRGB(hues[i], saturations[i], lightnesses[i]);
|
|
210
|
-
return rgbToHex({ r: Math.round(r), g: Math.round(g), b: Math.round(b) });
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Generates an array of colors by interpolating between colors in the given array.
|
|
215
|
-
* @param colors - The array of colors to interpolate between.
|
|
216
|
-
* @param length - The desired length of the resulting array.
|
|
217
|
-
*/
|
|
218
|
-
function generateArrayFromColor(colors, length) {
|
|
219
|
-
if (typeof colors === 'string') {
|
|
220
|
-
return monochromaticInterpolation(colors, length);
|
|
221
|
-
}
|
|
222
|
-
if (colors.length === 1) {
|
|
223
|
-
return monochromaticInterpolation(colors[0], length);
|
|
224
|
-
}
|
|
225
|
-
const pairs = colors.length - 1;
|
|
226
|
-
const needed = length - colors.length;
|
|
227
|
-
const baseAmount = Math.floor(needed / pairs);
|
|
228
|
-
const extras = needed % pairs;
|
|
229
|
-
let result = [];
|
|
230
|
-
let i = 0;
|
|
231
|
-
let j = 1;
|
|
232
|
-
while (j < colors.length) {
|
|
233
|
-
const additional = i < extras ? 1 : 0;
|
|
234
|
-
const interpLength = 2 + baseAmount + additional;
|
|
235
|
-
const interp = interpolateBetween(colors[i], colors[j], interpLength);
|
|
236
|
-
const lastIndex = j === colors.length - 1 ? undefined : -1;
|
|
237
|
-
result = result.concat(interp.slice(0, lastIndex));
|
|
238
|
-
i++;
|
|
239
|
-
j++;
|
|
240
|
-
}
|
|
241
|
-
return result;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Generates an array of numbers linearly spaced between start and end.
|
|
245
|
-
* @param start - The starting number of the sequence.
|
|
246
|
-
* @param end - The end number of the sequence.
|
|
247
|
-
* @param num - The number of samples to generate.
|
|
248
|
-
*/
|
|
249
|
-
function linspace(start, end, num) {
|
|
250
|
-
if (num <= 1)
|
|
251
|
-
return [start];
|
|
252
|
-
const step = (end - start) / (num - 1);
|
|
253
|
-
const result = new Array(num);
|
|
254
|
-
for (let i = 0; i < num; i++) {
|
|
255
|
-
result[i] = start + step * i;
|
|
256
|
-
}
|
|
257
|
-
return result;
|
|
258
|
-
}
|
|
259
163
|
const PieChartWrapper = React.forwardRef((props, ref) => {
|
|
260
164
|
const { category = 'pct_of_the_total', index = 'status', data, colors = [], colorMap = {}, variant = 'donut', valueFormatter = defaultValueFormatter, label, showLabel = true, showAnimation = true, showTooltip = true, className, containerStyle, theme, ...other } = props;
|
|
261
165
|
const isDonut = variant == 'donut';
|
|
@@ -270,9 +174,9 @@ const PieChartWrapper = React.forwardRef((props, ref) => {
|
|
|
270
174
|
fontSize: 13,
|
|
271
175
|
color: theme.secondaryTextColor,
|
|
272
176
|
...containerStyle,
|
|
273
|
-
}, children: "No results found for specified time period." }));
|
|
177
|
+
}, className: className, children: "No results found for specified time period." }));
|
|
274
178
|
}
|
|
275
|
-
return (_jsx("div", { ref: ref, style: {
|
|
179
|
+
return (_jsx("div", { ref: ref, className: className, style: {
|
|
276
180
|
width: '100%',
|
|
277
181
|
display: 'flex',
|
|
278
182
|
flexDirection: 'row',
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type DateRangePickerComponentProps } from '../../DateRangePicker/QuillDateRangePicker';
|
|
3
|
-
type SelectComponentType = ({ label, value, options, onChange, }: {
|
|
3
|
+
type SelectComponentType = ({ label, value, options, onChange, width, }: {
|
|
4
4
|
value: string;
|
|
5
5
|
label?: string | undefined;
|
|
6
|
+
width: number;
|
|
6
7
|
options: {
|
|
7
8
|
value: string;
|
|
8
9
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardFilter.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/DashboardFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAEhG,KAAK,mBAAmB,GAAG,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,
|
|
1
|
+
{"version":3,"file":"DashboardFilter.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/DashboardFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAEhG,KAAK,mBAAmB,GAAG,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CACjE,KAAK,GAAG,CAAC,OAAO,CAAC;AAElB,KAAK,4BAA4B,GAAG,CAAC,EACnC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,MAAM,GACP,EAAE,6BAA6B,KAAK,GAAG,CAAC,OAAO,CAAC;AAEjD,UAAU,oBAAoB;IAC5B,MAAM,EAAE,GAAG,CAAC;IACZ,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACzC,eAAe,EACX,mBAAmB,GACnB,KAAK,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;IACnD,wBAAwB,EACpB,4BAA4B,GAC5B,KAAK,CAAC,mBAAmB,CAAC,4BAA4B,CAAC,CAAC;IAC5D,KAAK,EAAE,GAAG,CAAC;CACZ;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,cAAc,EACd,eAAe,EACf,wBAAwB,EACxB,KAAK,GACN,EAAE,oBAAoB,kDAiHtB"}
|
|
@@ -29,7 +29,7 @@ export function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateR
|
|
|
29
29
|
label: elem[filter.labelField],
|
|
30
30
|
value: elem[filter.field],
|
|
31
31
|
})),
|
|
32
|
-
] }));
|
|
32
|
+
], width: 200 }));
|
|
33
33
|
}
|
|
34
34
|
if (filter.filterType == 'date_range') {
|
|
35
35
|
return (_jsxs("div", { style: {
|
|
@@ -65,7 +65,7 @@ export function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateR
|
|
|
65
65
|
}, options: COMPARISON_OPTIONS.map((compareOption) => ({
|
|
66
66
|
value: compareOption.value,
|
|
67
67
|
label: compareOption.text,
|
|
68
|
-
})) })] }) }))] }));
|
|
68
|
+
})), width: 200 })] }) }))] }));
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
@@ -4,6 +4,6 @@ interface QuillCardProps {
|
|
|
4
4
|
onClick?: () => void;
|
|
5
5
|
onDelete?: () => void;
|
|
6
6
|
}
|
|
7
|
-
export declare function QuillCard({ children, onClick, onDelete
|
|
7
|
+
export declare function QuillCard({ children, onClick, onDelete }: QuillCardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=QuillCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillCard.d.ts","sourceRoot":"","sources":["../../../src/components/QuillCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,UAAU,cAAc;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"QuillCard.d.ts","sourceRoot":"","sources":["../../../src/components/QuillCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,UAAU,cAAc;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,cAAc,2CA4ExE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { XIcon } from '../assets';
|
|
3
3
|
import { useTheme } from '../hooks';
|
|
4
|
-
export function QuillCard({ children, onClick, onDelete
|
|
4
|
+
export function QuillCard({ children, onClick, onDelete }) {
|
|
5
5
|
const theme = useTheme();
|
|
6
6
|
return (_jsxs("div", { className: onClick ? 'quill-card-hover' : '', style: {
|
|
7
7
|
backgroundColor: theme.backgroundColor || 'white',
|
|
@@ -2,5 +2,5 @@ import { SelectComponentProps } from './UiComponents';
|
|
|
2
2
|
/**
|
|
3
3
|
* A robust select component that implements the new minimal Select interface.
|
|
4
4
|
*/
|
|
5
|
-
export declare function QuillSelectComponent({ options, value, onChange, label, }: SelectComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function QuillSelectComponent({ options, value, width, onChange, label, }: SelectComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=QuillSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillSelect.d.ts","sourceRoot":"","sources":["../../../src/components/QuillSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAKtD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,GACN,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"QuillSelect.d.ts","sourceRoot":"","sources":["../../../src/components/QuillSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAKtD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,GACN,EAAE,oBAAoB,2CA4MtB"}
|
|
@@ -5,16 +5,18 @@ import { ThemeContext } from '../Context';
|
|
|
5
5
|
/**
|
|
6
6
|
* A robust select component that implements the new minimal Select interface.
|
|
7
7
|
*/
|
|
8
|
-
export function QuillSelectComponent({ options, value, onChange, label, }) {
|
|
8
|
+
export function QuillSelectComponent({ options, value, width, onChange, label, }) {
|
|
9
9
|
const [theme] = useContext(ThemeContext);
|
|
10
10
|
const [showModal, setShowModal] = useState(false);
|
|
11
11
|
const modalRef = useRef(null);
|
|
12
12
|
useOnClickOutside(modalRef, (e) => setShowModal(false));
|
|
13
13
|
return (_jsxs("div", { style: {
|
|
14
14
|
position: 'relative',
|
|
15
|
-
width: 200,
|
|
16
|
-
minWidth: 200,
|
|
15
|
+
// width: 200,
|
|
16
|
+
// minWidth: 200,
|
|
17
17
|
borderRadius: '6px',
|
|
18
|
+
width: width,
|
|
19
|
+
minWidth: width,
|
|
18
20
|
}, children: [label && (_jsx("div", { style: {
|
|
19
21
|
fontSize: 14,
|
|
20
22
|
color: theme.primaryTextColor,
|
|
@@ -3,6 +3,7 @@ import { ButtonComponentProps } from './UiComponents';
|
|
|
3
3
|
export interface TableComponentProps {
|
|
4
4
|
rows: any[];
|
|
5
5
|
columns: any[];
|
|
6
|
+
className?: string;
|
|
6
7
|
containerStyle?: React.CSSProperties;
|
|
7
8
|
isLoading?: boolean;
|
|
8
9
|
showDownloadCSVButton?: boolean;
|
|
@@ -13,5 +14,5 @@ export interface TableComponentProps {
|
|
|
13
14
|
rowsPerPage?: number;
|
|
14
15
|
emptyStateLabel?: string;
|
|
15
16
|
}
|
|
16
|
-
export default function QuillTable({ rows, columns, isLoading, showDownloadCSVButton, downloadFileName, containerStyle, LoadingComponent, rowsPerPage, emptyStateLabel, downloadCSV, }: TableComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default function QuillTable({ rows, columns, isLoading, showDownloadCSVButton, downloadFileName, containerStyle, className, LoadingComponent, rowsPerPage, emptyStateLabel, downloadCSV, }: TableComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
//# sourceMappingURL=QuillTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillTable.d.ts","sourceRoot":"","sources":["../../../src/components/QuillTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAK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