@quillsql/react 2.10.5 → 2.10.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/dist/cjs/Chart.d.ts +2 -2
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +11 -16
- package/dist/cjs/Context.d.ts +22 -39
- package/dist/cjs/Context.d.ts.map +1 -1
- package/dist/cjs/Context.js +11 -9
- package/dist/cjs/Dashboard.d.ts +116 -27
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +85 -412
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts +18 -1
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.js +8 -8
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/Table.js +11 -1
- package/dist/cjs/components/Chart/BarChart.d.ts +2 -2
- package/dist/cjs/components/Chart/BarChart.js +2 -2
- package/dist/cjs/components/Chart/ChartTooltipFrame.d.ts.map +1 -1
- package/dist/cjs/components/Chart/ChartTooltipFrame.js +1 -0
- package/dist/cjs/components/Chart/LineChart.d.ts +2 -2
- package/dist/cjs/components/Chart/LineChart.js +2 -2
- package/dist/cjs/components/Dashboard/DashboardGroup.d.ts +3 -0
- package/dist/cjs/components/Dashboard/DashboardGroup.d.ts.map +1 -0
- package/dist/cjs/components/Dashboard/DashboardGroup.js +16 -0
- package/dist/cjs/components/Dashboard/DashboardItem.d.ts +3 -0
- package/dist/cjs/components/Dashboard/DashboardItem.d.ts.map +1 -0
- package/dist/cjs/components/Dashboard/DashboardItem.js +64 -0
- package/dist/cjs/components/Dashboard/DashboardSection.d.ts +3 -0
- package/dist/cjs/components/Dashboard/DashboardSection.d.ts.map +1 -0
- package/dist/cjs/components/Dashboard/DashboardSection.js +7 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +1 -1
- package/dist/cjs/utils/dashboard.d.ts +12 -0
- package/dist/cjs/utils/dashboard.d.ts.map +1 -0
- package/dist/cjs/utils/dashboard.js +150 -0
- package/dist/cjs/utils/styles.d.ts +17 -0
- package/dist/cjs/utils/styles.d.ts.map +1 -0
- package/dist/cjs/utils/styles.js +20 -0
- package/dist/cjs/utils/valueFormatter.d.ts +1 -1
- package/dist/cjs/utils/valueFormatter.d.ts.map +1 -1
- package/dist/esm/Chart.d.ts +2 -2
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +11 -16
- package/dist/esm/Context.d.ts +22 -39
- package/dist/esm/Context.d.ts.map +1 -1
- package/dist/esm/Context.js +11 -9
- package/dist/esm/Dashboard.d.ts +116 -27
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +81 -385
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts +18 -1
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/dateRangePickerUtils.js +8 -8
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/Table.js +11 -1
- package/dist/esm/components/Chart/BarChart.d.ts +2 -2
- package/dist/esm/components/Chart/BarChart.js +2 -2
- package/dist/esm/components/Chart/ChartTooltipFrame.d.ts.map +1 -1
- package/dist/esm/components/Chart/ChartTooltipFrame.js +1 -0
- package/dist/esm/components/Chart/LineChart.d.ts +2 -2
- package/dist/esm/components/Chart/LineChart.js +2 -2
- package/dist/esm/components/Dashboard/DashboardGroup.d.ts +3 -0
- package/dist/esm/components/Dashboard/DashboardGroup.d.ts.map +1 -0
- package/dist/esm/components/Dashboard/DashboardGroup.js +13 -0
- package/dist/esm/components/Dashboard/DashboardItem.d.ts +3 -0
- package/dist/esm/components/Dashboard/DashboardItem.d.ts.map +1 -0
- package/dist/esm/components/Dashboard/DashboardItem.js +61 -0
- package/dist/esm/components/Dashboard/DashboardSection.d.ts +3 -0
- package/dist/esm/components/Dashboard/DashboardSection.d.ts.map +1 -0
- package/dist/esm/components/Dashboard/DashboardSection.js +4 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +1 -1
- package/dist/esm/utils/dashboard.d.ts +12 -0
- package/dist/esm/utils/dashboard.d.ts.map +1 -0
- package/dist/esm/utils/dashboard.js +146 -0
- package/dist/esm/utils/styles.d.ts +17 -0
- package/dist/esm/utils/styles.d.ts.map +1 -0
- package/dist/esm/utils/styles.js +16 -0
- package/dist/esm/utils/valueFormatter.d.ts +1 -1
- package/dist/esm/utils/valueFormatter.d.ts.map +1 -1
- package/package.json +2 -5
package/dist/esm/Chart.js
CHANGED
|
@@ -69,13 +69,7 @@ function didFiltersChange(dashboardItem, filters) {
|
|
|
69
69
|
}
|
|
70
70
|
return !isEquivalent(dashboardItem.filtersApplied, filters);
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
return s.split('').reduce(function (a, b) {
|
|
74
|
-
a = (a << 5) - a + b.charCodeAt(0);
|
|
75
|
-
return a & a;
|
|
76
|
-
}, 0);
|
|
77
|
-
}
|
|
78
|
-
const Chart = ({ chartId, config, colors, containerStyle, query, SelectComponent, dateRangeFilterDisabled = false, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesionGrid = false, }) => {
|
|
72
|
+
const Chart = ({ chartId, config, colors, containerStyle, query, SelectComponent, dateRangeFilterDisabled = false, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesianGrid = false, }) => {
|
|
79
73
|
const { dispatch, dashboard } = useContext(DashboardContext);
|
|
80
74
|
const { dashboardFilters } = useContext(DashboardFiltersContext);
|
|
81
75
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -88,9 +82,9 @@ const Chart = ({ chartId, config, colors, containerStyle, query, SelectComponent
|
|
|
88
82
|
? theme.chartColors
|
|
89
83
|
: ['#4E80EE', '#E14F62', '#55B5A6', '#E9A23B', '#6466E9', '#55B685'];
|
|
90
84
|
}, [colors]);
|
|
91
|
-
return (_jsx(ChartUpdater, { config: config, dispatch: dispatch, dashboard: dashboard, chartId: chartId, containerStyle: containerStyle, colors: chartColors, client: client, theme: theme, dashboardFilters: dashboardFilters, query: query, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis,
|
|
85
|
+
return (_jsx(ChartUpdater, { config: config, dispatch: dispatch, dashboard: dashboard, chartId: chartId, containerStyle: containerStyle, colors: chartColors, client: client, theme: theme, dashboardFilters: dashboardFilters, query: query, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid, dateRangeFilterDisabled: dateRangeFilterDisabled }));
|
|
92
86
|
};
|
|
93
|
-
const ChartUpdater = ({ colors, chartId, config, containerStyle, dashboard, dispatch, client, theme, dashboardFilters, isAnimationActive, hideXAxis, hideYAxis,
|
|
87
|
+
const ChartUpdater = ({ colors, chartId, config, containerStyle, dashboard, dispatch, client, theme, dashboardFilters, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, dateRangeFilterDisabled, }) => {
|
|
94
88
|
const [loading, setLoading] = useState(false);
|
|
95
89
|
const [isComparison, setIsComparison] = useState(false);
|
|
96
90
|
const [bucketData, setBucketData] = useState(null);
|
|
@@ -102,13 +96,14 @@ const ChartUpdater = ({ colors, chartId, config, containerStyle, dashboard, disp
|
|
|
102
96
|
}
|
|
103
97
|
try {
|
|
104
98
|
setLoading(true);
|
|
105
|
-
|
|
99
|
+
// Remove extra fields on each filter so we don't confuse the backend.
|
|
100
|
+
const allowDateRange = !dateRangeFilterDisabled;
|
|
101
|
+
const minimalFilters = Object.values(dashboardFilters).length
|
|
106
102
|
? Object.values(dashboardFilters)
|
|
107
|
-
.filter((f) =>
|
|
103
|
+
.filter((f) => allowDateRange || f.filterType !== 'date_range')
|
|
108
104
|
.map((filter) => {
|
|
109
105
|
const newFilter = { ...filter };
|
|
110
106
|
if (newFilter.filterType === 'date_range') {
|
|
111
|
-
// filter.field = chartDateFilter?.field;
|
|
112
107
|
delete newFilter['field'];
|
|
113
108
|
delete newFilter['options'];
|
|
114
109
|
delete newFilter['selectedValue'];
|
|
@@ -122,12 +117,12 @@ const ChartUpdater = ({ colors, chartId, config, containerStyle, dashboard, disp
|
|
|
122
117
|
...(client.customerId && { orgId: client.customerId }),
|
|
123
118
|
clientId: client.publicKey,
|
|
124
119
|
task: 'item',
|
|
125
|
-
filters:
|
|
120
|
+
filters: minimalFilters,
|
|
126
121
|
},
|
|
127
122
|
};
|
|
128
123
|
const cloudBody = {
|
|
129
124
|
id: chartId,
|
|
130
|
-
filters:
|
|
125
|
+
filters: minimalFilters,
|
|
131
126
|
};
|
|
132
127
|
const resp = await getData(client, 'itempost', 'omit', hostedBody, cloudBody);
|
|
133
128
|
if (resp && resp.name !== 'error') {
|
|
@@ -327,7 +322,7 @@ const ChartUpdater = ({ colors, chartId, config, containerStyle, dashboard, disp
|
|
|
327
322
|
? config.xAxisFormat
|
|
328
323
|
: bucketData
|
|
329
324
|
? bucketData.xAxisFormat
|
|
330
|
-
: dashboard[chartId].xAxisFormat, containerStyle: containerStyle, comparison: dateFilter?.comparison, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis,
|
|
325
|
+
: dashboard[chartId].xAxisFormat, containerStyle: containerStyle, comparison: dateFilter?.comparison, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid }));
|
|
331
326
|
}
|
|
332
327
|
if (chartTypes.includes('metric')) {
|
|
333
328
|
const data = dashboard[chartId] ? dashboard[chartId] : config;
|
|
@@ -370,6 +365,6 @@ const ChartUpdater = ({ colors, chartId, config, containerStyle, dashboard, disp
|
|
|
370
365
|
? config.xAxisFormat
|
|
371
366
|
: bucketData
|
|
372
367
|
? bucketData.xAxisFormat
|
|
373
|
-
: dashboard[chartId].xAxisFormat, containerStyle: containerStyle, theme: theme, comparison: dateFilter?.comparison, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis,
|
|
368
|
+
: dashboard[chartId].xAxisFormat, containerStyle: containerStyle, theme: theme, comparison: dateFilter?.comparison, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid }));
|
|
374
369
|
};
|
|
375
370
|
export default Chart;
|
package/dist/esm/Context.d.ts
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const ChartDateFiltersContext: React.Context<{}[]>;
|
|
2
|
+
export declare const DateFilterContext: React.Context<any>;
|
|
3
|
+
export declare const SchemaContext: React.Context<any>;
|
|
4
|
+
export declare const ColumnsContext: React.Context<any>;
|
|
5
|
+
export declare const RowsContext: React.Context<any>;
|
|
6
|
+
export declare const SelectedSidebarIndexContext: React.Context<any>;
|
|
7
|
+
export declare const HistoryContext: React.Context<any>;
|
|
8
|
+
export declare const SavedQueriesContext: React.Context<any>;
|
|
9
|
+
export declare const SaveQueryModalStatusContext: React.Context<any>;
|
|
10
|
+
export declare const EditorQueryContext: React.Context<any>;
|
|
11
|
+
export declare const ThemeContext: React.Context<any>;
|
|
12
|
+
export declare const ClientContext: React.Context<any>;
|
|
13
|
+
export declare const CreateVisualizationModalVisibleContext: React.Context<any>;
|
|
14
|
+
export declare const ActiveVisualizationContext: React.Context<any>;
|
|
15
|
+
export declare const QueryResultsLoadingContext: React.Context<any>;
|
|
16
|
+
export declare const EditVisualizationModalVisibleContext: React.Context<any>;
|
|
17
|
+
export declare const ReportBuilderQueryContext: React.Context<any>;
|
|
18
|
+
export declare const SavedReportsQueryContext: React.Context<any>;
|
|
19
|
+
export declare const DashboardContext: React.Context<any>;
|
|
20
|
+
export declare const DashboardFiltersContext: React.Context<any>;
|
|
21
|
+
export declare const ChartDateFiltersContext: React.Context<any>;
|
|
23
22
|
export declare const useChartDateFilters: () => {
|
|
24
23
|
getChartDateFilterById: (id: string) => any;
|
|
25
24
|
setChartDateFilter: (id: string, dateFilter: any) => void;
|
|
26
25
|
};
|
|
27
|
-
|
|
28
|
-
value: string;
|
|
29
|
-
text: string;
|
|
30
|
-
} | null;
|
|
31
|
-
export declare const ComparisonRangeContext: React.Context<ComparisonRangeContextType>;
|
|
26
|
+
export declare const ComparisonRangeContext: React.Context<any>;
|
|
32
27
|
export declare const useDateFilter: () => {
|
|
33
28
|
dateFilter: any;
|
|
34
29
|
setDateFilter: any;
|
|
@@ -37,17 +32,5 @@ export declare const useComparisonRange: () => {
|
|
|
37
32
|
comparisonRange: any;
|
|
38
33
|
setComparisonRange: any;
|
|
39
34
|
};
|
|
40
|
-
export declare const ContextProvider: ({ children, initialTheme, publicKey, environment, authToken, customerId, userId, queryEndpoint, queryHeaders, withCredentials, }:
|
|
41
|
-
children: any;
|
|
42
|
-
initialTheme: any;
|
|
43
|
-
publicKey: any;
|
|
44
|
-
environment: any;
|
|
45
|
-
authToken: any;
|
|
46
|
-
customerId: any;
|
|
47
|
-
userId: any;
|
|
48
|
-
queryEndpoint: any;
|
|
49
|
-
queryHeaders: any;
|
|
50
|
-
withCredentials: any;
|
|
51
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
52
|
-
export {};
|
|
35
|
+
export declare const ContextProvider: ({ children, initialTheme, publicKey, environment, authToken, customerId, userId, queryEndpoint, queryHeaders, withCredentials, }: any) => import("react/jsx-runtime").JSX.Element | null;
|
|
53
36
|
//# sourceMappingURL=Context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/Context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/Context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAKf,eAAO,MAAM,iBAAiB,oBAAwC,CAAC;AACvE,eAAO,MAAM,aAAa,oBAAwC,CAAC;AACnE,eAAO,MAAM,cAAc,oBAA0C,CAAC;AACtE,eAAO,MAAM,WAAW,oBAA0C,CAAC;AACnE,eAAO,MAAM,2BAA2B,oBAAuC,CAAC;AAChF,eAAO,MAAM,cAAc,oBAAwC,CAAC;AACpE,eAAO,MAAM,mBAAmB,oBAAwC,CAAC;AACzE,eAAO,MAAM,2BAA2B,oBAGtC,CAAC;AACH,eAAO,MAAM,kBAAkB,oBAAwC,CAAC;AACxE,eAAO,MAAM,YAAY,oBAA0C,CAAC;AACpE,eAAO,MAAM,aAAa,oBAA0C,CAAC;AACrE,eAAO,MAAM,sCAAsC,oBAGjD,CAAC;AACH,eAAO,MAAM,0BAA0B,oBAGrC,CAAC;AACH,eAAO,MAAM,0BAA0B,oBAGrC,CAAC;AACH,eAAO,MAAM,oCAAoC,oBAG/C,CAAC;AACH,eAAO,MAAM,yBAAyB,oBAAwC,CAAC;AAC/E,eAAO,MAAM,wBAAwB,oBAAwC,CAAC;AAC9E,eAAO,MAAM,gBAAgB,oBAAwC,CAAC;AACtE,eAAO,MAAM,uBAAuB,oBAAwC,CAAC;AAC7E,eAAO,MAAM,uBAAuB,oBAAwC,CAAC;AAE7E,eAAO,MAAM,mBAAmB;iCAKM,MAAM;6BACV,MAAM,cAAc,GAAG;CAQxD,CAAC;AAEF,eAAO,MAAM,sBAAsB,oBAA2B,CAAC;AAE/D,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;CAK9B,CAAC;AAuDF,eAAO,MAAM,eAAe,qIAWzB,GAAG,mDAqML,CAAC"}
|
package/dist/esm/Context.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
4
2
|
import { useState, createContext, useEffect, useReducer, useContext, } from 'react';
|
|
5
|
-
import { defaultQuillTheme } from './QuillProvider';
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7
3
|
const dummySetter = () => { };
|
|
8
|
-
export const DateFilterContext = createContext([
|
|
4
|
+
export const DateFilterContext = createContext([[], dummySetter]);
|
|
9
5
|
export const SchemaContext = createContext([[], dummySetter]);
|
|
10
6
|
export const ColumnsContext = createContext([null, dummySetter]);
|
|
11
7
|
export const RowsContext = createContext([null, dummySetter]);
|
|
@@ -17,14 +13,20 @@ export const SaveQueryModalStatusContext = createContext([
|
|
|
17
13
|
dummySetter,
|
|
18
14
|
]);
|
|
19
15
|
export const EditorQueryContext = createContext(['', dummySetter]);
|
|
20
|
-
export const ThemeContext = createContext([
|
|
16
|
+
export const ThemeContext = createContext([null, dummySetter]);
|
|
21
17
|
export const ClientContext = createContext([null, dummySetter]);
|
|
22
18
|
export const CreateVisualizationModalVisibleContext = createContext([
|
|
23
19
|
false,
|
|
24
20
|
dummySetter,
|
|
25
21
|
]);
|
|
26
|
-
export const ActiveVisualizationContext = createContext([
|
|
27
|
-
|
|
22
|
+
export const ActiveVisualizationContext = createContext([
|
|
23
|
+
null,
|
|
24
|
+
dummySetter,
|
|
25
|
+
]);
|
|
26
|
+
export const QueryResultsLoadingContext = createContext([
|
|
27
|
+
false,
|
|
28
|
+
dummySetter,
|
|
29
|
+
]);
|
|
28
30
|
export const EditVisualizationModalVisibleContext = createContext([
|
|
29
31
|
false,
|
|
30
32
|
dummySetter,
|
|
@@ -45,7 +47,7 @@ export const useChartDateFilters = () => {
|
|
|
45
47
|
setChartDateFilter,
|
|
46
48
|
};
|
|
47
49
|
};
|
|
48
|
-
export const ComparisonRangeContext = createContext(
|
|
50
|
+
export const ComparisonRangeContext = createContext(null);
|
|
49
51
|
export const useDateFilter = () => {
|
|
50
52
|
const { dateFilter, setDateFilter } = useContext(DateFilterContext);
|
|
51
53
|
return { dateFilter, setDateFilter };
|
package/dist/esm/Dashboard.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DateRangePickerOption } from './DateRangePicker/DateRangePicker';
|
|
3
|
-
interface
|
|
3
|
+
interface QuillOption {
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|
|
6
6
|
}
|
|
7
7
|
interface SelectComponentProps {
|
|
8
8
|
label: string;
|
|
9
|
-
onChange: (
|
|
9
|
+
onChange: (_: string) => void;
|
|
10
10
|
value: string;
|
|
11
|
-
options:
|
|
11
|
+
options: QuillOption[];
|
|
12
12
|
}
|
|
13
|
-
type DateRange = [];
|
|
13
|
+
type DateRange = Date[];
|
|
14
14
|
interface DateRangePickerComponentProps {
|
|
15
15
|
dateRange: DateRange;
|
|
16
16
|
label: string;
|
|
17
|
-
onChangeDateRange: (
|
|
17
|
+
onChangeDateRange: (_: any) => void;
|
|
18
18
|
selectedPreset: string;
|
|
19
19
|
presetOptions: DateRangePickerOption[];
|
|
20
|
-
onChangePreset: (
|
|
20
|
+
onChangePreset: (_: any) => void;
|
|
21
21
|
preset: string;
|
|
22
22
|
}
|
|
23
23
|
interface FilterButtonComponentProps {
|
|
@@ -30,30 +30,123 @@ interface ModalComponentProps {
|
|
|
30
30
|
onClose: () => void;
|
|
31
31
|
title: string;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
export type AxisFormat = 'percent' | 'dollar_amount' | 'dollar_cents' | 'whole_number' | 'one_decimal_place' | 'two_decimal_places' | 'string' | 'yyyy' | 'MMM_yyyy' | 'MMM_dd_yyyy' | 'hh_ap_pm' | 'MMM_dd-MMM_dd' | 'MMM_dd_hh:mm_ap_pm' | 'wo, yyyy';
|
|
34
|
+
/**
|
|
35
|
+
* A dashboard item represents an individual item on a dashboard.
|
|
36
|
+
*
|
|
37
|
+
* Dashboard items can be charts, metric tiles, tables, etc. and can be styled
|
|
38
|
+
* however you'd like.
|
|
39
|
+
*/
|
|
40
|
+
export interface DashboardItemData {
|
|
41
|
+
/** The dashboard item's unique id. */
|
|
42
|
+
id: string;
|
|
43
|
+
/** The name of the dashboard item. */
|
|
34
44
|
name: string;
|
|
45
|
+
/** The name of the dashboard this item belongs to. */
|
|
46
|
+
dashboardName: string;
|
|
47
|
+
/** The rows of data returned from this item's query. */
|
|
48
|
+
rows: {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
}[];
|
|
51
|
+
/** The columns data returned from this item's query. */
|
|
52
|
+
columns: any[];
|
|
53
|
+
/** The type of this chart. */
|
|
54
|
+
chartType: string;
|
|
55
|
+
/** The table and field this chart uses for date filtering */
|
|
56
|
+
dateField: {
|
|
57
|
+
table: string;
|
|
58
|
+
field: string;
|
|
59
|
+
} | null;
|
|
60
|
+
/** The pivot used in this query */
|
|
61
|
+
pivot: {
|
|
62
|
+
title: string;
|
|
63
|
+
aggregationType: 'sum' | 'average' | 'count';
|
|
64
|
+
rowField: string;
|
|
65
|
+
rowFieldType: string;
|
|
66
|
+
columnField: string | undefined;
|
|
67
|
+
columnFieldType: string | undefined;
|
|
68
|
+
valueField: string;
|
|
69
|
+
} | null;
|
|
70
|
+
/** The formatted primary range aggregation value, if any. */
|
|
71
|
+
primaryAggregation?: string;
|
|
72
|
+
/** The formatted comparison range aggregation value, if any. */
|
|
73
|
+
comparisonAggregation?: string;
|
|
74
|
+
/** The percent change in the aggragations, if any. */
|
|
75
|
+
aggregationPercentChange?: string;
|
|
76
|
+
/** The label of the xAxis. */
|
|
77
|
+
xAxisLabel: string;
|
|
78
|
+
/** The field to use for this item's xAxis. */
|
|
79
|
+
xAxisField: string;
|
|
80
|
+
/** The format for this item's xAxis. */
|
|
81
|
+
xAxisFormat: AxisFormat;
|
|
82
|
+
/**
|
|
83
|
+
* A list of metadata about the yAxes of this item.
|
|
84
|
+
*/
|
|
85
|
+
yAxisFields: {
|
|
86
|
+
/** The field for this yAxis. */
|
|
87
|
+
field: string;
|
|
88
|
+
/** The label to use for this yAxis. */
|
|
89
|
+
label: string;
|
|
90
|
+
/** The format of the data in this yAxis. */
|
|
91
|
+
format: AxisFormat;
|
|
92
|
+
}[];
|
|
93
|
+
/**
|
|
94
|
+
* The relative ordering of this dashboard item in relation to its sibling
|
|
95
|
+
* dashboard items. Ordering starts at 1 and counts up.
|
|
96
|
+
*
|
|
97
|
+
* Also note that dashboard items in the same section are first grouped by
|
|
98
|
+
* `chartType` and then each group is sorted by `order`. Currently, the first
|
|
99
|
+
* group is the `metric` items and the last group is the `table` items with
|
|
100
|
+
* the rest of the items in between.
|
|
101
|
+
*/
|
|
102
|
+
order: number;
|
|
103
|
+
/**
|
|
104
|
+
* The rows of data returned from this item's query over the comparison date
|
|
105
|
+
* range as opposed to the primary date range.
|
|
106
|
+
*/
|
|
107
|
+
compareRows: {
|
|
108
|
+
[key: string]: string;
|
|
109
|
+
}[];
|
|
110
|
+
/** A map of filters that have been applied to this query. */
|
|
111
|
+
filtersApplied: {
|
|
112
|
+
[key: string]: any;
|
|
113
|
+
};
|
|
35
114
|
}
|
|
36
|
-
interface DashboardItemProps {
|
|
115
|
+
export interface DashboardItemProps {
|
|
116
|
+
dashboardItem: DashboardItemData | undefined;
|
|
117
|
+
onClickDashboardItem?: any;
|
|
37
118
|
children: any;
|
|
38
|
-
dashboardItem: DashboardItemData;
|
|
39
119
|
}
|
|
40
|
-
interface DashboardProps {
|
|
120
|
+
export interface DashboardProps {
|
|
121
|
+
/** The name of the dashboard. Must be unique. */
|
|
41
122
|
name?: string;
|
|
42
|
-
|
|
123
|
+
/**
|
|
124
|
+
* The styles for the dashboard container.
|
|
125
|
+
*
|
|
126
|
+
* This container is the parent of all the filtering buttons as well as any
|
|
127
|
+
* dashboard sections. The passed style can either be an object of React-style
|
|
128
|
+
* CSSProperties or a TailwindCSS-style classname string.
|
|
129
|
+
*/
|
|
130
|
+
containerStyle?: React.CSSProperties | string;
|
|
43
131
|
metricContainerStyle?: React.CSSProperties;
|
|
44
132
|
chartContainerStyle?: React.CSSProperties;
|
|
45
133
|
maxColumnWidth?: number;
|
|
46
134
|
rowHeight?: number;
|
|
47
|
-
onClickDashboardItem?: (
|
|
135
|
+
onClickDashboardItem?: (_: any) => void;
|
|
48
136
|
hideFilters?: boolean;
|
|
49
137
|
dateRangeFilterDisabled?: boolean;
|
|
50
138
|
EmptyDashboardComponent?: () => JSX.Element;
|
|
51
|
-
|
|
52
|
-
DashboardItemComponent?: (
|
|
53
|
-
DateRangePickerComponent?: (
|
|
54
|
-
FilterButtonComponent?: (
|
|
55
|
-
FilterModalComponent?: (
|
|
56
|
-
|
|
139
|
+
SelectComponent?: (_: SelectComponentProps) => JSX.Element;
|
|
140
|
+
DashboardItemComponent?: (_: DashboardItemProps) => JSX.Element;
|
|
141
|
+
DateRangePickerComponent?: (_: DateRangePickerComponentProps) => JSX.Element;
|
|
142
|
+
FilterButtonComponent?: (_: FilterButtonComponentProps) => JSX.Element;
|
|
143
|
+
FilterModalComponent?: (_: ModalComponentProps) => JSX.Element;
|
|
144
|
+
DashboardSectionComponent?: (_: any) => JSX.Element;
|
|
145
|
+
DashboardGroupComponent?: (_: any) => JSX.Element;
|
|
146
|
+
onChangeLoading?: (_: boolean) => void;
|
|
147
|
+
hideXAxis?: boolean;
|
|
148
|
+
hideYAxis?: boolean;
|
|
149
|
+
hideCartesianGrid?: boolean;
|
|
57
150
|
}
|
|
58
151
|
interface comparisonOption {
|
|
59
152
|
value: string;
|
|
@@ -61,15 +154,11 @@ interface comparisonOption {
|
|
|
61
154
|
}
|
|
62
155
|
export declare const COMPARISON_OPTIONS: comparisonOption[];
|
|
63
156
|
export declare const PRIMARY_OPTIONS: any[];
|
|
64
|
-
export declare
|
|
65
|
-
export declare function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateRangePickerComponent, theme, }: {
|
|
66
|
-
filter: any;
|
|
67
|
-
onChangeFilter: any;
|
|
68
|
-
SelectComponent: any;
|
|
69
|
-
DateRangePickerComponent: any;
|
|
70
|
-
theme: any;
|
|
71
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
157
|
+
export declare function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateRangePickerComponent, theme, }: any): import("react/jsx-runtime").JSX.Element | null;
|
|
72
158
|
export declare const QuillDateRangePicker: ({ label, dateRange, onChangeDateRange, presetOptions, preset, onChangePreset, }: DateRangePickerComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
73
|
-
|
|
159
|
+
/**
|
|
160
|
+
* Quill Dashboard.
|
|
161
|
+
*/
|
|
162
|
+
export default function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerStyle, maxColumnWidth, rowHeight, onClickDashboardItem, hideFilters, dateRangeFilterDisabled, SelectComponent, EmptyDashboardComponent, DateRangePickerComponent, FilterButtonComponent, FilterModalComponent, onChangeLoading, DashboardItemComponent, DashboardSectionComponent, DashboardGroupComponent, hideXAxis, hideYAxis, hideCartesianGrid, }: DashboardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
74
163
|
export {};
|
|
75
164
|
//# sourceMappingURL=Dashboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.d.ts","sourceRoot":"","sources":["../../src/Dashboard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dashboard.d.ts","sourceRoot":"","sources":["../../src/Dashboard.tsx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