@quillsql/react 2.11.15 → 2.11.17
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 +117 -42
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +44 -18
- package/dist/cjs/ChartBuilder.d.ts +195 -28
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +124 -63
- package/dist/cjs/ChartEditor.d.ts +114 -18
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +47 -15
- package/dist/cjs/Dashboard.d.ts +148 -90
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +46 -152
- 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 +188 -34
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +551 -426
- package/dist/cjs/SQLEditor.d.ts +158 -29
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +52 -32
- 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/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 +30 -1
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.js +33 -14
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts +25 -2
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.js +19 -19
- package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts +22 -2
- package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddSortPopover.js +18 -20
- package/dist/cjs/components/ReportBuilder/bigDateMap.js +1 -1
- package/dist/cjs/components/ReportBuilder/convert.d.ts +2 -1
- package/dist/cjs/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/convert.js +40 -20
- 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 +83 -19
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +68 -121
- package/dist/cjs/components/ReportBuilder/util.d.ts +3 -1
- package/dist/cjs/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/util.js +34 -8
- package/dist/cjs/components/UiComponents.d.ts +98 -97
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +132 -112
- 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.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotList.js +10 -10
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +29 -14
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +73 -49
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +2 -0
- package/dist/cjs/utils/width.d.ts +12 -0
- package/dist/cjs/utils/width.d.ts.map +1 -0
- package/dist/cjs/utils/width.js +25 -0
- package/dist/esm/Chart.d.ts +117 -42
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +45 -19
- package/dist/esm/ChartBuilder.d.ts +195 -28
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +124 -63
- package/dist/esm/ChartEditor.d.ts +114 -18
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +51 -19
- package/dist/esm/Dashboard.d.ts +148 -90
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +49 -153
- 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 +188 -34
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +553 -428
- package/dist/esm/SQLEditor.d.ts +158 -29
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +53 -33
- 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/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 +30 -1
- package/dist/esm/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddColumnPopover.js +34 -15
- package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts +25 -2
- package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddLimitPopover.js +20 -20
- package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts +22 -2
- package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddSortPopover.js +20 -22
- package/dist/esm/components/ReportBuilder/bigDateMap.js +1 -1
- package/dist/esm/components/ReportBuilder/convert.d.ts +2 -1
- package/dist/esm/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/convert.js +33 -13
- 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 +83 -19
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +67 -119
- package/dist/esm/components/ReportBuilder/util.d.ts +3 -1
- package/dist/esm/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/util.js +31 -7
- package/dist/esm/components/UiComponents.d.ts +98 -97
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +125 -110
- 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.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotList.js +10 -10
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +29 -14
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +73 -49
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +2 -0
- package/dist/esm/utils/width.d.ts +12 -0
- package/dist/esm/utils/width.d.ts.map +1 -0
- package/dist/esm/utils/width.js +21 -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,8 @@ 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"));
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
function DashboardFilter({ filter, onChangeFilter, SelectComponent, 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)(QuillSelect_1.QuillSelectComponent, { 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)(QuillSelect_1.QuillSelectComponent, { 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", {});
|
|
23
|
+
const UiComponents_1 = require("./components/UiComponents");
|
|
24
|
+
const DashboardFilter_1 = require("./components/Dashboard/DashboardFilter");
|
|
156
25
|
const defaultChartContainerStyles = {
|
|
157
26
|
display: 'flex',
|
|
158
27
|
width: '100%',
|
|
@@ -160,10 +29,37 @@ const defaultChartContainerStyles = {
|
|
|
160
29
|
height: 300,
|
|
161
30
|
};
|
|
162
31
|
/**
|
|
163
|
-
* Quill Dashboard
|
|
32
|
+
* ### Quill Dashboard
|
|
33
|
+
*
|
|
34
|
+
* Dynamically displays a filterable grid of charts, metrics, and tables with
|
|
35
|
+
* live data from your database. Once implemented, Quill lets you perform
|
|
36
|
+
* zero-downtime, zero-code updates to your dashboard views on an org-level as
|
|
37
|
+
* well as company-wide.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```js
|
|
41
|
+
* // Usage without custom components
|
|
42
|
+
* <Dashboard />
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```js
|
|
47
|
+
* // You can also pass your own components
|
|
48
|
+
* <Dashboard
|
|
49
|
+
* name="saved_reports"
|
|
50
|
+
* SelectComponent={MySelect}
|
|
51
|
+
* onClickDashboardItem={(item) => navigate(`/detail/${item.id}`)}
|
|
52
|
+
* MetricComponent={MyMetric}
|
|
53
|
+
* ChartComponent={MyChart}
|
|
54
|
+
* TableComponent={MyTable}
|
|
55
|
+
* containerStyle={{ backgroundColor: 'white', padding: '10px' }}
|
|
56
|
+
* />
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* ### API Reference
|
|
60
|
+
* @see https://docs.quillsql.com/components/dashboard
|
|
164
61
|
*/
|
|
165
|
-
function Dashboard({ name,
|
|
166
|
-
const { dateFilter } = (0, Context_1.useDateFilter)();
|
|
62
|
+
function Dashboard({ name, SelectComponent = UiComponents_1.QuillDropdownComponent, 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
63
|
const { dispatch } = (0, react_1.useContext)(Context_1.DashboardContext);
|
|
168
64
|
const { isLoading: isDataLoading, data, reload, } = (0, useDashboard_1.useDashboard)(name);
|
|
169
65
|
const [dashboardSections, setDashboardSections] = (0, react_1.useState)(null);
|
|
@@ -424,16 +320,16 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
424
320
|
return (0, jsx_runtime_1.jsx)(EmptyDashboardComponent, {});
|
|
425
321
|
const sortByOrdering = (a, b) => {
|
|
426
322
|
if (a.order === undefined && b.order === undefined)
|
|
427
|
-
return 0;
|
|
323
|
+
return 0;
|
|
428
324
|
if (a.order === undefined)
|
|
429
|
-
return 1;
|
|
325
|
+
return 1;
|
|
430
326
|
if (b.order === undefined)
|
|
431
|
-
return -1;
|
|
432
|
-
return a.order - b.order;
|
|
327
|
+
return -1;
|
|
328
|
+
return a.order - b.order;
|
|
433
329
|
};
|
|
434
330
|
const sortedFilters = Object.values(dashboardFilters)
|
|
435
331
|
.sort((filter) => (filter.filterType === 'date_range' ? -1 : 1))
|
|
436
|
-
.filter((f) => !
|
|
332
|
+
.filter((f) => !hideDateRangeFilter || f.filterType !== 'date_range');
|
|
437
333
|
const metrics = (section) => dashboardSections[section]
|
|
438
334
|
.filter(({ chartType }) => chartType === 'metric')
|
|
439
335
|
.sort(sortByOrdering);
|
|
@@ -443,7 +339,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
443
339
|
const tables = (section) => dashboardSections[section]
|
|
444
340
|
.filter(({ chartType }) => chartType === 'table')
|
|
445
341
|
.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: {
|
|
342
|
+
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
343
|
display: 'flex',
|
|
448
344
|
boxSizing: 'content-box',
|
|
449
345
|
flexDirection: 'row',
|
|
@@ -455,9 +351,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
455
351
|
flexDirection: 'row',
|
|
456
352
|
alignItems: 'center',
|
|
457
353
|
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)
|
|
354
|
+
}, 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
355
|
.sort(function (a, b) {
|
|
462
356
|
return a.length - b.length;
|
|
463
357
|
})
|
|
@@ -471,16 +365,16 @@ function Dashboard({ name, containerStyle, chartContainerStyle = defaultChartCon
|
|
|
471
365
|
textAlign: 'left',
|
|
472
366
|
marginTop: 12,
|
|
473
367
|
}, 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, {
|
|
368
|
+
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
369
|
? () => 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, {
|
|
370
|
+
: undefined }, item.name + '' + index)) }, `${item.name}${index}`));
|
|
371
|
+
}) })), 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
372
|
? () => handleOnClickDashboardItem(item)
|
|
479
|
-
:
|
|
373
|
+
: undefined, children: (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: chartContainerStyle, chartId: item._id, colors: theme.chartColors?.length
|
|
480
374
|
? theme.chartColors
|
|
481
|
-
: undefined, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid,
|
|
375
|
+
: 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
376
|
? () => handleOnClickDashboardItem(item)
|
|
483
|
-
:
|
|
377
|
+
: undefined })) }, `${item.name}${index}`))) }))] }, section + '' + sectionIndex));
|
|
484
378
|
})] }));
|
|
485
379
|
}
|
|
486
380
|
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 {
|