@quillsql/react 2.11.16 → 2.11.18
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 +109 -42
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +44 -18
- package/dist/cjs/ChartBuilder.d.ts +204 -30
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +124 -63
- package/dist/cjs/ChartEditor.d.ts +123 -19
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +47 -15
- package/dist/cjs/Dashboard.d.ts +148 -91
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +51 -159
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.d.ts +21 -1
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.js +5 -2
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.js +1 -1
- package/dist/cjs/QuillProvider.d.ts +105 -2
- package/dist/cjs/QuillProvider.d.ts.map +1 -1
- package/dist/cjs/QuillProvider.js +59 -0
- package/dist/cjs/ReportBuilder.d.ts +194 -42
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +563 -416
- package/dist/cjs/SQLEditor.d.ts +160 -23
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +36 -30
- package/dist/cjs/Table.d.ts +119 -15
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/Table.js +37 -6
- package/dist/cjs/TableChart.d.ts.map +1 -1
- package/dist/cjs/TableChart.js +0 -194
- package/dist/cjs/{BarList.d.ts → components/Chart/BarList.d.ts} +1 -1
- package/dist/cjs/components/Chart/BarList.d.ts.map +1 -0
- package/dist/cjs/{BarList.js → components/Chart/BarList.js} +1 -1
- package/dist/cjs/components/Chart/LineChart.d.ts +2 -3
- 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.map +1 -0
- package/dist/cjs/{PieChart.js → components/Chart/PieChart.js} +1 -1
- package/dist/cjs/components/Dashboard/ChartComponent.d.ts +2 -1
- package/dist/cjs/components/Dashboard/ChartComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/ChartComponent.js +6 -7
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts +22 -0
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts.map +1 -0
- package/dist/cjs/components/Dashboard/DashboardFilter.js +75 -0
- package/dist/cjs/components/Dashboard/DataLoader.d.ts +1 -1
- package/dist/cjs/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DataLoader.js +1 -1
- package/dist/cjs/components/Dashboard/MetricComponent.d.ts +2 -12
- package/dist/cjs/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/MetricComponent.js +39 -17
- package/dist/cjs/components/Dashboard/TableComponent.d.ts +2 -1
- package/dist/cjs/components/Dashboard/TableComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/TableComponent.js +6 -9
- package/dist/cjs/components/QuillCard.d.ts +2 -7
- package/dist/cjs/components/QuillCard.d.ts.map +1 -1
- package/dist/cjs/components/QuillCard.js +15 -9
- package/dist/cjs/components/QuillSelect.d.ts +4 -1
- package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelect.js +13 -8
- package/dist/cjs/components/QuillTable.d.ts +16 -2
- package/dist/cjs/components/QuillTable.d.ts.map +1 -1
- package/dist/cjs/components/QuillTable.js +4 -4
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.d.ts +9 -3
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.js +10 -6
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts +13 -1
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.js +5 -15
- package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts +21 -1
- package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddSortPopover.js +15 -17
- package/dist/cjs/components/ReportBuilder/bigDateMap.js +1 -1
- package/dist/cjs/components/ReportBuilder/convert.d.ts +3 -1
- package/dist/cjs/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/convert.js +60 -21
- package/dist/cjs/components/ReportBuilder/operators.d.ts +15 -10
- package/dist/cjs/components/ReportBuilder/operators.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/operators.js +23 -10
- package/dist/cjs/components/ReportBuilder/pivot.d.ts +2 -1
- package/dist/cjs/components/ReportBuilder/pivot.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.d.ts +82 -18
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +55 -103
- package/dist/cjs/components/ReportBuilder/util.d.ts +10 -4
- package/dist/cjs/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/util.js +124 -71
- package/dist/cjs/components/UiComponents.d.ts +81 -87
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +76 -103
- package/dist/cjs/hooks/index.d.ts +1 -0
- package/dist/cjs/hooks/index.d.ts.map +1 -1
- package/dist/cjs/hooks/index.js +3 -1
- package/dist/cjs/hooks/useTheme.d.ts +7 -0
- package/dist/cjs/hooks/useTheme.d.ts.map +1 -0
- package/dist/cjs/hooks/useTheme.js +12 -0
- package/dist/cjs/index.d.ts +10 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotList.d.ts +5 -2
- package/dist/cjs/internals/ReportBuilder/PivotList.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotList.js +21 -21
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +30 -14
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +77 -52
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +2 -0
- package/dist/cjs/utils/parserBigQuery.d.ts +6 -0
- package/dist/cjs/utils/parserBigQuery.d.ts.map +1 -0
- package/dist/cjs/utils/parserBigQuery.js +60 -0
- package/dist/cjs/utils/parserPostgres.d.ts +3 -0
- package/dist/cjs/utils/parserPostgres.d.ts.map +1 -0
- package/dist/cjs/utils/parserPostgres.js +42 -0
- package/dist/esm/Chart.d.ts +109 -42
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +45 -19
- package/dist/esm/ChartBuilder.d.ts +204 -30
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +124 -63
- package/dist/esm/ChartEditor.d.ts +123 -19
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +51 -19
- package/dist/esm/Dashboard.d.ts +148 -91
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +54 -160
- package/dist/esm/DateRangePicker/QuillDateRangePicker.d.ts +21 -1
- package/dist/esm/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/QuillDateRangePicker.js +6 -3
- package/dist/esm/DateRangePicker/dateRangePickerUtils.js +1 -1
- package/dist/esm/QuillProvider.d.ts +105 -2
- package/dist/esm/QuillProvider.d.ts.map +1 -1
- package/dist/esm/QuillProvider.js +59 -0
- package/dist/esm/ReportBuilder.d.ts +194 -42
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +566 -419
- package/dist/esm/SQLEditor.d.ts +160 -23
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +36 -30
- package/dist/esm/Table.d.ts +119 -15
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/Table.js +38 -7
- package/dist/esm/TableChart.d.ts.map +1 -1
- package/dist/esm/TableChart.js +0 -194
- package/dist/esm/{BarList.d.ts → components/Chart/BarList.d.ts} +1 -1
- package/dist/esm/components/Chart/BarList.d.ts.map +1 -0
- package/dist/esm/{BarList.js → components/Chart/BarList.js} +1 -1
- package/dist/esm/components/Chart/LineChart.d.ts +2 -3
- 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.map +1 -0
- package/dist/esm/{PieChart.js → components/Chart/PieChart.js} +1 -1
- package/dist/esm/components/Dashboard/ChartComponent.d.ts +2 -1
- package/dist/esm/components/Dashboard/ChartComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/ChartComponent.js +5 -6
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts +22 -0
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts.map +1 -0
- package/dist/esm/components/Dashboard/DashboardFilter.js +71 -0
- package/dist/esm/components/Dashboard/DataLoader.d.ts +1 -1
- package/dist/esm/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DataLoader.js +1 -1
- package/dist/esm/components/Dashboard/MetricComponent.d.ts +2 -12
- package/dist/esm/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/MetricComponent.js +39 -17
- package/dist/esm/components/Dashboard/TableComponent.d.ts +2 -1
- package/dist/esm/components/Dashboard/TableComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/TableComponent.js +6 -9
- package/dist/esm/components/QuillCard.d.ts +2 -7
- package/dist/esm/components/QuillCard.d.ts.map +1 -1
- package/dist/esm/components/QuillCard.js +15 -9
- package/dist/esm/components/QuillSelect.d.ts +4 -1
- package/dist/esm/components/QuillSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillSelect.js +14 -9
- package/dist/esm/components/QuillTable.d.ts +16 -2
- package/dist/esm/components/QuillTable.d.ts.map +1 -1
- package/dist/esm/components/QuillTable.js +4 -4
- package/dist/esm/components/ReportBuilder/AddColumnPopover.d.ts +9 -3
- package/dist/esm/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddColumnPopover.js +10 -6
- package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts +13 -1
- package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddLimitPopover.js +5 -15
- package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts +21 -1
- package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddSortPopover.js +17 -19
- package/dist/esm/components/ReportBuilder/bigDateMap.js +1 -1
- package/dist/esm/components/ReportBuilder/convert.d.ts +3 -1
- package/dist/esm/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/convert.js +51 -13
- package/dist/esm/components/ReportBuilder/operators.d.ts +15 -10
- package/dist/esm/components/ReportBuilder/operators.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/operators.js +23 -10
- package/dist/esm/components/ReportBuilder/pivot.d.ts +2 -1
- package/dist/esm/components/ReportBuilder/pivot.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.d.ts +82 -18
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +53 -101
- package/dist/esm/components/ReportBuilder/util.d.ts +10 -4
- package/dist/esm/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/util.js +114 -67
- package/dist/esm/components/UiComponents.d.ts +81 -87
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +71 -102
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/index.d.ts.map +1 -1
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/useTheme.d.ts +7 -0
- package/dist/esm/hooks/useTheme.d.ts.map +1 -0
- package/dist/esm/hooks/useTheme.js +10 -0
- package/dist/esm/index.d.ts +10 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotList.d.ts +5 -2
- package/dist/esm/internals/ReportBuilder/PivotList.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotList.js +21 -21
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +30 -14
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +77 -52
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +2 -0
- package/dist/esm/utils/parserBigQuery.d.ts +6 -0
- package/dist/esm/utils/parserBigQuery.d.ts.map +1 -0
- package/dist/esm/utils/parserBigQuery.js +52 -0
- package/dist/esm/utils/parserPostgres.d.ts +3 -0
- package/dist/esm/utils/parserPostgres.d.ts.map +1 -0
- package/dist/esm/utils/parserPostgres.js +37 -0
- package/package.json +1 -1
- package/dist/cjs/BarList.d.ts.map +0 -1
- package/dist/cjs/PieChart.d.ts.map +0 -1
- package/dist/esm/BarList.d.ts.map +0 -1
- package/dist/esm/PieChart.d.ts.map +0 -1
- /package/dist/cjs/{PieChart.d.ts → components/Chart/PieChart.d.ts} +0 -0
- /package/dist/esm/{PieChart.d.ts → components/Chart/PieChart.d.ts} +0 -0
package/dist/cjs/Dashboard.js
CHANGED
|
@@ -3,13 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DashboardFilter = void 0;
|
|
7
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
/* eslint-disable no-unused-vars */
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const Chart_1 = __importDefault(require("./Chart"));
|
|
10
10
|
const dateRangePickerUtils_1 = require("./DateRangePicker/dateRangePickerUtils");
|
|
11
11
|
const Context_1 = require("./Context");
|
|
12
|
-
const assets_1 = require("./assets");
|
|
13
12
|
const useDashboard_1 = require("./hooks/useDashboard");
|
|
14
13
|
const crypto_1 = require("./utils/crypto");
|
|
15
14
|
const DashboardSectionContainer_1 = __importDefault(require("./components/Dashboard/DashboardSectionContainer"));
|
|
@@ -21,138 +20,9 @@ const styles_1 = require("./utils/styles");
|
|
|
21
20
|
const dashboard_1 = require("./utils/dashboard");
|
|
22
21
|
const QuillDateRangePicker_1 = require("./DateRangePicker/QuillDateRangePicker");
|
|
23
22
|
const DataLoader_1 = __importDefault(require("./components/Dashboard/DataLoader"));
|
|
23
|
+
const UiComponents_1 = require("./components/UiComponents");
|
|
24
|
+
const DashboardFilter_1 = require("./components/Dashboard/DashboardFilter");
|
|
24
25
|
const QuillSelect_1 = require("./components/QuillSelect");
|
|
25
|
-
const ChartSkeleton_1 = __importDefault(require("./components/Chart/ChartSkeleton"));
|
|
26
|
-
function DashboardFilter({ filter, onChangeFilter, SelectComponent = QuillSelect_1.QuillSelectComponent, DateRangePickerComponent, theme, }) {
|
|
27
|
-
const { comparisonRange, setComparisonRange } = (0, Context_1.useComparisonRange)();
|
|
28
|
-
const { setDateFilter } = (0, Context_1.useDateFilter)();
|
|
29
|
-
const [filterValue, setFilterValue] = (0, react_1.useState)(null);
|
|
30
|
-
(0, react_1.useEffect)(() => {
|
|
31
|
-
if (filter.filterType === 'string') {
|
|
32
|
-
setFilterValue(filter.selectedValue);
|
|
33
|
-
}
|
|
34
|
-
if (filter.filterType == 'date_range') {
|
|
35
|
-
setDateFilter(filter.preset.label);
|
|
36
|
-
if (filter?.comparisonRange?.value) {
|
|
37
|
-
const newComparisonRange = dateRangePickerUtils_1.COMPARISON_OPTIONS.find((option) => {
|
|
38
|
-
return option.value === filter.comparisonRange.value;
|
|
39
|
-
});
|
|
40
|
-
setComparisonRange(newComparisonRange);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
setComparisonRange(null);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, [filter]);
|
|
47
|
-
if (filter.filterType === 'string') {
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(SelectComponent, { theme: theme, label: filter.label, value: filterValue, onChange: (e) => {
|
|
49
|
-
onChangeFilter(filter, e);
|
|
50
|
-
}, options: [
|
|
51
|
-
...filter.options.map((elem) => {
|
|
52
|
-
return {
|
|
53
|
-
label: elem[filter.labelField],
|
|
54
|
-
value: elem[filter.field],
|
|
55
|
-
};
|
|
56
|
-
}),
|
|
57
|
-
] }));
|
|
58
|
-
}
|
|
59
|
-
if (filter.filterType == 'date_range') {
|
|
60
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
61
|
-
display: 'flex',
|
|
62
|
-
flexDirection: 'row',
|
|
63
|
-
alignItems: 'flex-end',
|
|
64
|
-
}, children: [(0, jsx_runtime_1.jsx)(DateRangePickerComponent, { label: filter.label, dateRange: { startDate: filter.startDate, endDate: filter.endDate }, preset: filter.preset.label, onChangeDateRange: (value) => {
|
|
65
|
-
onChangeFilter(filter, {
|
|
66
|
-
startDate: value.startDate,
|
|
67
|
-
endDate: value.endDate,
|
|
68
|
-
});
|
|
69
|
-
}, onChangePreset: (value) => {
|
|
70
|
-
onChangeFilter(filter, { preset: value });
|
|
71
|
-
}, presetOptions: filter.options.map((option) => {
|
|
72
|
-
return { label: option.label, value: option.label };
|
|
73
|
-
}) }), comparisonRange && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
74
|
-
display: 'flex',
|
|
75
|
-
flexDirection: 'row',
|
|
76
|
-
alignItems: 'center',
|
|
77
|
-
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
78
|
-
paddingLeft: 16,
|
|
79
|
-
paddingRight: 12,
|
|
80
|
-
color: theme?.secondaryTextColor,
|
|
81
|
-
fontFamily: theme?.fontFamily,
|
|
82
|
-
fontSize: 14,
|
|
83
|
-
display: 'flex',
|
|
84
|
-
alignItems: 'center',
|
|
85
|
-
flex: 1,
|
|
86
|
-
minWidth: 80,
|
|
87
|
-
justifyContent: 'center',
|
|
88
|
-
}, children: "compared to" }), (0, jsx_runtime_1.jsx)(SelectComponent, { theme: theme, value: comparisonRange.value, onChange: (e) => {
|
|
89
|
-
onChangeFilter(filter, null, dateRangePickerUtils_1.COMPARISON_OPTIONS.find((option) => {
|
|
90
|
-
return option.value === e;
|
|
91
|
-
}));
|
|
92
|
-
}, options: dateRangePickerUtils_1.COMPARISON_OPTIONS.map((compareOption) => {
|
|
93
|
-
return {
|
|
94
|
-
value: compareOption.value,
|
|
95
|
-
label: compareOption.text,
|
|
96
|
-
};
|
|
97
|
-
}) })] }) }))] }));
|
|
98
|
-
}
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
exports.DashboardFilter = DashboardFilter;
|
|
102
|
-
const QuillDropdownComponent = ({ onChange, value, label, options, }) => {
|
|
103
|
-
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
104
|
-
const handleOnChange = (0, react_1.useCallback)((event) => {
|
|
105
|
-
onChange(event.target.value);
|
|
106
|
-
}, [onChange]);
|
|
107
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [label && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
108
|
-
marginBottom: 6,
|
|
109
|
-
fontWeight: theme.labelFontWeight || '600',
|
|
110
|
-
color: theme.secondaryTextColor,
|
|
111
|
-
fontFamily: theme.fontFamily,
|
|
112
|
-
fontSize: 14,
|
|
113
|
-
}, children: label })), (0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', height: 38 }, children: [(0, jsx_runtime_1.jsxs)("select", { onChange: handleOnChange, value: value ?? '', id: 'reportbuilderdropdown',
|
|
114
|
-
// defaultValue="Select"
|
|
115
|
-
style: {
|
|
116
|
-
width: '100%',
|
|
117
|
-
WebkitAppearance: 'none',
|
|
118
|
-
minWidth: 230,
|
|
119
|
-
outline: 'none',
|
|
120
|
-
textAlign: 'left',
|
|
121
|
-
whiteSpace: 'nowrap',
|
|
122
|
-
overflow: 'hidden',
|
|
123
|
-
textOverflow: 'ellipsis',
|
|
124
|
-
borderRadius: 6,
|
|
125
|
-
paddingLeft: 12,
|
|
126
|
-
paddingRight: 12,
|
|
127
|
-
height: 38,
|
|
128
|
-
borderWidth: theme.borderWidth,
|
|
129
|
-
borderColor: theme.borderColor,
|
|
130
|
-
background: theme.backgroundColor,
|
|
131
|
-
color: theme.primaryTextColor,
|
|
132
|
-
boxShadow: '0 1px 2px 0 rgba(0,0,0,.05)',
|
|
133
|
-
fontFamily: theme.fontFamily,
|
|
134
|
-
fontSize: 14,
|
|
135
|
-
fontWeight: 500,
|
|
136
|
-
boxSizing: 'border-box',
|
|
137
|
-
}, children: [(0, jsx_runtime_1.jsx)("option", { value: "", children: "Select" }), options.map((option, index) => ((0, jsx_runtime_1.jsx)("option", { value: option.value, children: option.label }, option.label + index)))] }), (0, jsx_runtime_1.jsx)(assets_1.ArrowDownHeadIcon, { style: {
|
|
138
|
-
height: '20px',
|
|
139
|
-
width: '20px',
|
|
140
|
-
flex: 'none',
|
|
141
|
-
position: 'absolute',
|
|
142
|
-
right: 8,
|
|
143
|
-
top: 9,
|
|
144
|
-
color: theme?.secondaryTextColor,
|
|
145
|
-
}, "aria-hidden": "true" })] })] }));
|
|
146
|
-
};
|
|
147
|
-
const MemoizedDropdown = (0, react_1.memo)(QuillDropdownComponent);
|
|
148
|
-
const areEqual = (prevProps, nextProps) => {
|
|
149
|
-
// This function returns true if passing nextProps to render would return
|
|
150
|
-
// the same result as passing prevProps to render, otherwise it returns false
|
|
151
|
-
return (prevProps.dateRange.startDate === nextProps.dateRange.startDate &&
|
|
152
|
-
prevProps.dateRange.endDate === nextProps.dateRange.endDate);
|
|
153
|
-
};
|
|
154
|
-
const MemoizedDateRangePicker = (0, react_1.memo)(QuillDateRangePicker_1.QuillDateRangePicker, areEqual);
|
|
155
|
-
const QuillEmptyDashboardComponent = () => (0, jsx_runtime_1.jsx)("div", {});
|
|
156
26
|
const defaultChartContainerStyles = {
|
|
157
27
|
display: 'flex',
|
|
158
28
|
width: '100%',
|
|
@@ -160,10 +30,37 @@ const defaultChartContainerStyles = {
|
|
|
160
30
|
height: 300,
|
|
161
31
|
};
|
|
162
32
|
/**
|
|
163
|
-
* Quill Dashboard
|
|
33
|
+
* ### Quill Dashboard
|
|
34
|
+
*
|
|
35
|
+
* Dynamically displays a filterable grid of charts, metrics, and tables with
|
|
36
|
+
* live data from your database. Once implemented, Quill lets you perform
|
|
37
|
+
* zero-downtime, zero-code updates to your dashboard views on an org-level as
|
|
38
|
+
* well as company-wide.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```js
|
|
42
|
+
* // Usage without custom components
|
|
43
|
+
* <Dashboard />
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```js
|
|
48
|
+
* // You can also pass your own components
|
|
49
|
+
* <Dashboard
|
|
50
|
+
* name="saved_reports"
|
|
51
|
+
* SelectComponent={MySelect}
|
|
52
|
+
* onClickDashboardItem={(item) => navigate(`/detail/${item.id}`)}
|
|
53
|
+
* MetricComponent={MyMetric}
|
|
54
|
+
* ChartComponent={MyChart}
|
|
55
|
+
* TableComponent={MyTable}
|
|
56
|
+
* containerStyle={{ backgroundColor: 'white', padding: '10px' }}
|
|
57
|
+
* />
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* ### API Reference
|
|
61
|
+
* @see https://docs.quillsql.com/components/dashboard
|
|
164
62
|
*/
|
|
165
|
-
function Dashboard({ name,
|
|
166
|
-
const { dateFilter } = (0, Context_1.useDateFilter)();
|
|
63
|
+
function Dashboard({ name, SelectComponent = QuillSelect_1.QuillSelectComponent, EmptyDashboardComponent = UiComponents_1.QuillEmptyDashboardComponent, DateRangePickerComponent = QuillDateRangePicker_1.QuillDateRangePicker, MetricComponent = MetricComponent_1.default, ChartComponent = ChartComponent_1.default, TableComponent = TableComponent_1.default, DashboardSectionComponent = DashboardSection_1.default, DashboardSectionContainerComponent = DashboardSectionContainer_1.default, onClickDashboardItem, onChangeLoading, hideFilters, hideDateRangeFilter = false, hideXAxis = false, hideYAxis = false, hideCartesianGrid = false, comparisonLineStyle = 'solid', containerStyle, className, chartContainerStyle = defaultChartContainerStyles, }) {
|
|
167
64
|
const { dispatch } = (0, react_1.useContext)(Context_1.DashboardContext);
|
|
168
65
|
const { isLoading: isDataLoading, data, reload, } = (0, useDashboard_1.useDashboard)(name);
|
|
169
66
|
const [dashboardSections, setDashboardSections] = (0, react_1.useState)(null);
|
|
@@ -272,8 +169,11 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
272
169
|
}
|
|
273
170
|
};
|
|
274
171
|
const handleOnClickDashboardItem = (elem) => {
|
|
172
|
+
const cleanedItem = (0, dashboard_1.cleanDashboardItem)(dashboard[elem._id] ?? elem, dashboardFilters);
|
|
275
173
|
if (dashboard[elem._id]?._id && onClickDashboardItem) {
|
|
276
|
-
|
|
174
|
+
// The _id add-on is a patch for backwards compatability
|
|
175
|
+
// TODO: remove all _id references from the codebase (admin and react)
|
|
176
|
+
onClickDashboardItem({ ...cleanedItem, _id: elem._id });
|
|
277
177
|
}
|
|
278
178
|
else if (onClickDashboardItem) {
|
|
279
179
|
dispatch({
|
|
@@ -281,13 +181,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
281
181
|
id: elem._id,
|
|
282
182
|
data: { ...elem, filtersApplied: dashboardFilters },
|
|
283
183
|
});
|
|
284
|
-
onClickDashboardItem({
|
|
285
|
-
...dashboard[elem._id],
|
|
286
|
-
_id: elem._id,
|
|
287
|
-
error_id: elem._id,
|
|
288
|
-
name: elem.name,
|
|
289
|
-
query: elem.queryString,
|
|
290
|
-
});
|
|
184
|
+
onClickDashboardItem({ ...cleanedItem, _id: elem._id });
|
|
291
185
|
}
|
|
292
186
|
};
|
|
293
187
|
function removeQuotes(str) {
|
|
@@ -424,16 +318,16 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
424
318
|
return (0, jsx_runtime_1.jsx)(EmptyDashboardComponent, {});
|
|
425
319
|
const sortByOrdering = (a, b) => {
|
|
426
320
|
if (a.order === undefined && b.order === undefined)
|
|
427
|
-
return 0;
|
|
321
|
+
return 0;
|
|
428
322
|
if (a.order === undefined)
|
|
429
|
-
return 1;
|
|
323
|
+
return 1;
|
|
430
324
|
if (b.order === undefined)
|
|
431
|
-
return -1;
|
|
432
|
-
return a.order - b.order;
|
|
325
|
+
return -1;
|
|
326
|
+
return a.order - b.order;
|
|
433
327
|
};
|
|
434
328
|
const sortedFilters = Object.values(dashboardFilters)
|
|
435
329
|
.sort((filter) => (filter.filterType === 'date_range' ? -1 : 1))
|
|
436
|
-
.filter((f) => !
|
|
330
|
+
.filter((f) => !hideDateRangeFilter || f.filterType !== 'date_range');
|
|
437
331
|
const metrics = (section) => dashboardSections[section]
|
|
438
332
|
.filter(({ chartType }) => chartType === 'metric')
|
|
439
333
|
.sort(sortByOrdering);
|
|
@@ -443,7 +337,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
443
337
|
const tables = (section) => dashboardSections[section]
|
|
444
338
|
.filter(({ chartType }) => chartType === 'table')
|
|
445
339
|
.sort(sortByOrdering);
|
|
446
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ...(0, styles_1.styleToProps)(containerStyle), children: [!hideFilters && sortedFilters.length > 0 && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
340
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: className, ...(0, styles_1.styleToProps)(containerStyle), children: [!hideFilters && sortedFilters.length > 0 && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
447
341
|
display: 'flex',
|
|
448
342
|
boxSizing: 'content-box',
|
|
449
343
|
flexDirection: 'row',
|
|
@@ -455,9 +349,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
455
349
|
flexDirection: 'row',
|
|
456
350
|
alignItems: 'center',
|
|
457
351
|
gap: 12,
|
|
458
|
-
}, children: sortedFilters.map((filter, index) => ((0, jsx_runtime_1.jsx)(DashboardFilter, { filter: filter, onChangeFilter: updateFilter, theme: theme, SelectComponent: SelectComponent
|
|
459
|
-
? DateRangePickerComponent
|
|
460
|
-
: MemoizedDateRangePicker }, index))) }) })), Object.keys(dashboardSections)
|
|
352
|
+
}, children: sortedFilters.map((filter, index) => ((0, jsx_runtime_1.jsx)(DashboardFilter_1.DashboardFilter, { filter: filter, onChangeFilter: updateFilter, theme: theme, SelectComponent: SelectComponent, DateRangePickerComponent: DateRangePickerComponent }, index))) }) })), Object.keys(dashboardSections)
|
|
461
353
|
.sort(function (a, b) {
|
|
462
354
|
return a.length - b.length;
|
|
463
355
|
})
|
|
@@ -471,16 +363,16 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
471
363
|
textAlign: 'left',
|
|
472
364
|
marginTop: 12,
|
|
473
365
|
}, children: section })] })), metrics(section).length > 0 && ((0, jsx_runtime_1.jsx)(DashboardSectionComponent, { section: "metrics", children: metrics(section).map((item, index) => {
|
|
474
|
-
return ((0, jsx_runtime_1.jsx)(DataLoader_1.default, { id: item._id, children: ({ isLoading, error }) => ((0, jsx_runtime_1.jsx)(MetricComponent, {
|
|
366
|
+
return ((0, jsx_runtime_1.jsx)(DataLoader_1.default, { id: item._id, children: ({ isLoading, error }) => ((0, jsx_runtime_1.jsx)(MetricComponent, { error: error, isLoading: isLoading, dashboardItem: (0, dashboard_1.cleanDashboardItem)(dashboard[item._id] ?? item, dashboardFilters), onClick: onClickDashboardItem
|
|
475
367
|
? () => handleOnClickDashboardItem(item)
|
|
476
|
-
:
|
|
477
|
-
}) })), charts(section).length > 0 && ((0, jsx_runtime_1.jsx)(DashboardSectionComponent, { section: "charts", children: charts(section).map((item, index) => ((0, jsx_runtime_1.jsx)(ChartComponent, {
|
|
368
|
+
: undefined }, item.name + '' + index)) }, `${item.name}${index}`));
|
|
369
|
+
}) })), charts(section).length > 0 && ((0, jsx_runtime_1.jsx)(DashboardSectionComponent, { section: "charts", children: charts(section).map((item, index) => ((0, jsx_runtime_1.jsx)(ChartComponent, { dashboardItem: (0, dashboard_1.cleanDashboardItem)(dashboard[item._id] ?? item, dashboardFilters), onClick: onClickDashboardItem
|
|
478
370
|
? () => handleOnClickDashboardItem(item)
|
|
479
|
-
:
|
|
371
|
+
: undefined, children: (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: chartContainerStyle, chartId: item._id, colors: theme.chartColors?.length
|
|
480
372
|
? theme.chartColors
|
|
481
|
-
: undefined, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid,
|
|
373
|
+
: undefined, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid, comparisonLineStyle: comparisonLineStyle }) }, item.name + '' + index))) })), tables(section).length > 0 && ((0, jsx_runtime_1.jsx)(DashboardSectionComponent, { section: "tables", children: tables(section).map((item, index) => ((0, jsx_runtime_1.jsx)(DataLoader_1.default, { id: item._id, children: ({ isLoading, error }) => ((0, jsx_runtime_1.jsx)(TableComponent, { dashboardItem: (0, dashboard_1.cleanDashboardItem)(dashboard[item._id] ?? item, dashboardFilters), isLoading: isLoading, error: error, onClick: onClickDashboardItem
|
|
482
374
|
? () => handleOnClickDashboardItem(item)
|
|
483
|
-
:
|
|
375
|
+
: undefined })) }, `${item.name}${index}`))) }))] }, section + '' + sectionIndex));
|
|
484
376
|
})] }));
|
|
485
377
|
}
|
|
486
378
|
exports.default = Dashboard;
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
export interface DateRangePickerComponentProps {
|
|
3
|
+
preset: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
dateRange: {
|
|
6
|
+
startDate: Date;
|
|
7
|
+
endDate: Date;
|
|
8
|
+
};
|
|
9
|
+
presetOptions: {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}[];
|
|
13
|
+
onChangeDateRange: ({ startDate, endDate, }: {
|
|
14
|
+
startDate: Date;
|
|
15
|
+
endDate: Date;
|
|
16
|
+
}) => void;
|
|
17
|
+
onChangePreset: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The fallback date range picked used in <Dashboard/>.
|
|
21
|
+
*/
|
|
2
22
|
export declare function QuillDateRangePicker({ dateRange, onChangeDateRange, presetOptions, onChangePreset, preset, label, }: DateRangePickerComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
3
23
|
//# sourceMappingURL=QuillDateRangePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillDateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/DateRangePicker/QuillDateRangePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuillDateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/DateRangePicker/QuillDateRangePicker.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,WAAW,EAKZ,MAAM,OAAO,CAAC;AAqBf,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE;QAAE,SAAS,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC;IAC9C,aAAa,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClD,iBAAiB,EAAE,CAAC,EAClB,SAAS,EACT,OAAO,GACR,EAAE;QACD,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,EAAE,IAAI,CAAC;KACf,KAAK,IAAI,CAAC;IACX,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CACjE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,MAAM,EACN,KAAK,GACN,EAAE,6BAA6B,2CA8H/B"}
|
|
@@ -7,6 +7,9 @@ const date_fns_1 = require("date-fns");
|
|
|
7
7
|
const Context_1 = require("../Context");
|
|
8
8
|
const hooks_1 = require("../hooks");
|
|
9
9
|
const QuillSelect_1 = require("../components/QuillSelect");
|
|
10
|
+
/**
|
|
11
|
+
* The fallback date range picked used in <Dashboard/>.
|
|
12
|
+
*/
|
|
10
13
|
function QuillDateRangePicker({ dateRange, onChangeDateRange, presetOptions, onChangePreset, preset, label, }) {
|
|
11
14
|
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
12
15
|
const [anchorStartDate, setAnchorStartDate] = (0, react_1.useState)(getAnchorStartDate(dateRange.startDate, dateRange.endDate));
|
|
@@ -57,8 +60,8 @@ function QuillDateRangePicker({ dateRange, onChangeDateRange, presetOptions, onC
|
|
|
57
60
|
value: option.label,
|
|
58
61
|
})), value: localPreset.label || '', onChange: (e) => {
|
|
59
62
|
onChangePreset(e);
|
|
60
|
-
setLocalPreset({ label: e });
|
|
61
|
-
}
|
|
63
|
+
setLocalPreset({ label: e.target.value });
|
|
64
|
+
} })] }));
|
|
62
65
|
}
|
|
63
66
|
exports.QuillDateRangePicker = QuillDateRangePicker;
|
|
64
67
|
function CalendarRow({ theme, anchorStartDate, anchorEndDate, setAnchorStartDate, setAnchorEndDate, localStartDate, localEndDate, setLocalStartDate, setLocalEndDate, updateDateFilter, setLocalPreset, setShowModal, }) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatSelectedDates = exports.displaySelected = exports.getDateStyles = exports.getRangeFromPresetOptions = exports.getRangeFromPreset = exports.reportBuilderOptions = exports.defaultOptions = exports.defaultOptionsV2 = exports.COMPARISON_RANGE = exports.COMPARISON_OPTIONS = exports.PRIMARY_CODES = exports.PRIMARY_RANGE = exports.parseEndDate = exports.parseStartDate = exports.getEndDateByDropdownValue = exports.getStartDateByDropdownValue = exports.capitalize = exports.getWeekdays = void 0;
|
|
4
4
|
const date_fns_1 = require("date-fns");
|
|
5
|
-
const BarList_1 = require("../BarList");
|
|
5
|
+
const BarList_1 = require("../components/Chart/BarList");
|
|
6
6
|
const getWeekdays = (locale) => {
|
|
7
7
|
const firstDayOfWeek = (0, date_fns_1.startOfWeek)(new Date());
|
|
8
8
|
return Array.from(Array(7)).map((e, i) => (0, date_fns_1.format)((0, date_fns_1.addDays)(firstDayOfWeek, i), 'EEEEEE', { locale }));
|
|
@@ -17,7 +17,51 @@ interface WithQueryEndpoint extends BaseQuillProviderProps {
|
|
|
17
17
|
queryHeaders: object;
|
|
18
18
|
withCredentials?: boolean;
|
|
19
19
|
}
|
|
20
|
-
type
|
|
20
|
+
export type IQuillProviderProps = WithOrganizationId | WithQueryEndpoint;
|
|
21
|
+
/**
|
|
22
|
+
* Props for the QuillProvider component.
|
|
23
|
+
*/
|
|
24
|
+
export type QuillProviderProps = {
|
|
25
|
+
/**
|
|
26
|
+
* Your Quill public key.
|
|
27
|
+
*/
|
|
28
|
+
publicKey: string;
|
|
29
|
+
/**
|
|
30
|
+
* The url of the query endpoint if using self-hosted.
|
|
31
|
+
*/
|
|
32
|
+
queryEndpoint: string | never;
|
|
33
|
+
/**
|
|
34
|
+
* Request headers passed to queryEndpoint, if self-hosted.
|
|
35
|
+
*/
|
|
36
|
+
queryHeaders: object | never;
|
|
37
|
+
/**
|
|
38
|
+
* The organization id of this request, if any.
|
|
39
|
+
*/
|
|
40
|
+
organizationId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The environment where this request is executed (eg. 'production')
|
|
43
|
+
*/
|
|
44
|
+
environment?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The theme object used to customize all quill components.
|
|
47
|
+
*/
|
|
48
|
+
theme?: QuillTheme;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to pass credentials to the custom query endpoint, if any.
|
|
51
|
+
*/
|
|
52
|
+
withCredentials?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The children of this provider (typically, this is the rest of your app).
|
|
55
|
+
*/
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* ## Quill Theme
|
|
60
|
+
* Customizable styles used throughout Quill.
|
|
61
|
+
*
|
|
62
|
+
* ### QuillTheme API
|
|
63
|
+
* @see https://docs.quillsql.com/components/quill-provider#quilltheme
|
|
64
|
+
*/
|
|
21
65
|
export interface QuillTheme {
|
|
22
66
|
fontFamily: string;
|
|
23
67
|
backgroundColor: string;
|
|
@@ -29,9 +73,9 @@ export interface QuillTheme {
|
|
|
29
73
|
chartTickColor: string;
|
|
30
74
|
chartColors: string[];
|
|
31
75
|
borderColor: string;
|
|
76
|
+
borderWidth: number;
|
|
32
77
|
primaryButtonColor?: string;
|
|
33
78
|
secondaryButtonColor?: string;
|
|
34
|
-
borderWidth: number;
|
|
35
79
|
buttonFontWeight?: number;
|
|
36
80
|
labelFontWeight?: number;
|
|
37
81
|
fontSize?: number;
|
|
@@ -55,6 +99,65 @@ export declare const defaultQuillTheme: {
|
|
|
55
99
|
loadingStateBackgroundColor: string;
|
|
56
100
|
hoverBackgroundColor: string;
|
|
57
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* ### Quill Provider
|
|
104
|
+
*
|
|
105
|
+
* The quill provider allows all the quill components in your app to share
|
|
106
|
+
* information which lets your dashboards render fast and update dynamically.
|
|
107
|
+
*
|
|
108
|
+
* Similar to React’s `Context.Provider`, `QuillProvider` wraps your React app
|
|
109
|
+
* and places Quill Client on the context, enabling you to access it from
|
|
110
|
+
* anywhere in your component tree. We suggest putting the QuillProvider
|
|
111
|
+
* somewhere high in your app, above any component that might need to access
|
|
112
|
+
* your quill data.
|
|
113
|
+
*
|
|
114
|
+
* ### Quickstart
|
|
115
|
+
* There are two ways to set up the QuillProvider; with an organization id using
|
|
116
|
+
* our fully-managed cloud platform, or with a query endpoint pointing to your
|
|
117
|
+
* own server running our self-hosted server SDK.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```js
|
|
121
|
+
* // Usage with organization id
|
|
122
|
+
* <QuillProvider
|
|
123
|
+
* organizationId={'acme_org'}
|
|
124
|
+
* publicKey={QUILL_API_KEY}
|
|
125
|
+
* >
|
|
126
|
+
* // rest of your app here
|
|
127
|
+
* </QuillProvider>
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```js
|
|
132
|
+
* // Usage with query endpoint
|
|
133
|
+
* <QuillProvider
|
|
134
|
+
* queryEndpoint="https://example.com/quill"
|
|
135
|
+
* queryHeaders={AUTH_HEADERS}
|
|
136
|
+
* publicKey={QUILL_API_KEY}
|
|
137
|
+
* >
|
|
138
|
+
* // rest of your app here
|
|
139
|
+
* </QuillProvider>
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* ### Custom Themes
|
|
143
|
+
* You can also pass in a custom theme into the QuillProvider to automatically
|
|
144
|
+
* style all default quill components at the same time. The combination of
|
|
145
|
+
* passing custom themes as well as passing your existing components gets you
|
|
146
|
+
* pixel-perfect dashboards in a fraction of the time.
|
|
147
|
+
*
|
|
148
|
+
* Our guide on custom themes is coming soon.
|
|
149
|
+
*
|
|
150
|
+
* ### Endpoint Authorization
|
|
151
|
+
* When self-hosting the server SDK, you might need extra authentication measures
|
|
152
|
+
* to ensure a secure system. In addition to passing a `queryHeaders` object along
|
|
153
|
+
* with any requests to your custom endpoint, you also can pass a `withCredentials`
|
|
154
|
+
* boolean.
|
|
155
|
+
*
|
|
156
|
+
* Our guide on endpoint authorization is coming soon.
|
|
157
|
+
*
|
|
158
|
+
* ### Dashboard API
|
|
159
|
+
* @see https://docs.quillsql.com/components/quill-provider
|
|
160
|
+
*/
|
|
58
161
|
declare const QuillProvider: ({ organizationId, publicKey, queryEndpoint, queryHeaders, environment, children, theme, withCredentials, }: QuillProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
162
|
export default QuillProvider;
|
|
60
163
|
//# sourceMappingURL=QuillProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillProvider.d.ts","sourceRoot":"","sources":["../../src/QuillProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"QuillProvider.d.ts","sourceRoot":"","sources":["../../src/QuillProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,sBAAsB;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,UAAU,kBAAmB,SAAQ,sBAAsB;IACzD,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,UAAU,iBAAkB,SAAQ,sBAAsB;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAGD,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,KAAK,CAAC;IAE9B;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,KAAK,CAAC;IAE7B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;CAwB7B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,QAAA,MAAM,aAAa,+GAShB,kBAAkB,4CA+BpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -28,6 +28,65 @@ exports.defaultQuillTheme = {
|
|
|
28
28
|
loadingStateBackgroundColor: '#F9F9FA',
|
|
29
29
|
hoverBackgroundColor: '#F4F4F5',
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* ### Quill Provider
|
|
33
|
+
*
|
|
34
|
+
* The quill provider allows all the quill components in your app to share
|
|
35
|
+
* information which lets your dashboards render fast and update dynamically.
|
|
36
|
+
*
|
|
37
|
+
* Similar to React’s `Context.Provider`, `QuillProvider` wraps your React app
|
|
38
|
+
* and places Quill Client on the context, enabling you to access it from
|
|
39
|
+
* anywhere in your component tree. We suggest putting the QuillProvider
|
|
40
|
+
* somewhere high in your app, above any component that might need to access
|
|
41
|
+
* your quill data.
|
|
42
|
+
*
|
|
43
|
+
* ### Quickstart
|
|
44
|
+
* There are two ways to set up the QuillProvider; with an organization id using
|
|
45
|
+
* our fully-managed cloud platform, or with a query endpoint pointing to your
|
|
46
|
+
* own server running our self-hosted server SDK.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```js
|
|
50
|
+
* // Usage with organization id
|
|
51
|
+
* <QuillProvider
|
|
52
|
+
* organizationId={'acme_org'}
|
|
53
|
+
* publicKey={QUILL_API_KEY}
|
|
54
|
+
* >
|
|
55
|
+
* // rest of your app here
|
|
56
|
+
* </QuillProvider>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```js
|
|
61
|
+
* // Usage with query endpoint
|
|
62
|
+
* <QuillProvider
|
|
63
|
+
* queryEndpoint="https://example.com/quill"
|
|
64
|
+
* queryHeaders={AUTH_HEADERS}
|
|
65
|
+
* publicKey={QUILL_API_KEY}
|
|
66
|
+
* >
|
|
67
|
+
* // rest of your app here
|
|
68
|
+
* </QuillProvider>
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* ### Custom Themes
|
|
72
|
+
* You can also pass in a custom theme into the QuillProvider to automatically
|
|
73
|
+
* style all default quill components at the same time. The combination of
|
|
74
|
+
* passing custom themes as well as passing your existing components gets you
|
|
75
|
+
* pixel-perfect dashboards in a fraction of the time.
|
|
76
|
+
*
|
|
77
|
+
* Our guide on custom themes is coming soon.
|
|
78
|
+
*
|
|
79
|
+
* ### Endpoint Authorization
|
|
80
|
+
* When self-hosting the server SDK, you might need extra authentication measures
|
|
81
|
+
* to ensure a secure system. In addition to passing a `queryHeaders` object along
|
|
82
|
+
* with any requests to your custom endpoint, you also can pass a `withCredentials`
|
|
83
|
+
* boolean.
|
|
84
|
+
*
|
|
85
|
+
* Our guide on endpoint authorization is coming soon.
|
|
86
|
+
*
|
|
87
|
+
* ### Dashboard API
|
|
88
|
+
* @see https://docs.quillsql.com/components/quill-provider
|
|
89
|
+
*/
|
|
31
90
|
const QuillProvider = ({ organizationId, publicKey, queryEndpoint = 'https://quill-344421.uc.r.appspot.com/cloud', queryHeaders, environment, children, theme = exports.defaultQuillTheme, withCredentials = false, }) => {
|
|
32
91
|
return ((0, jsx_runtime_1.jsxs)(Context_1.ContextProvider, { initialTheme: theme, publicKey: publicKey, environment: environment, customerId: organizationId, queryEndpoint: queryEndpoint, queryHeaders: queryHeaders, withCredentials: withCredentials, children: [children, (0, jsx_runtime_1.jsx)("style", { children: `/* For WebKit-based browsers (Chrome, Safari, Opera) */
|
|
33
92
|
::-webkit-scrollbar {
|