@quillsql/react 2.8.6 → 2.8.8
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/AddToDashboardModal.js +181 -146
- package/dist/BarList.js +44 -36
- package/dist/Chart.js +132 -99
- package/dist/ChartBuilder.js +89 -80
- package/dist/ChartEditor.js +21 -14
- package/dist/Context.js +57 -52
- package/dist/Dashboard.js +213 -180
- package/dist/Dashboard.js.map +1 -1
- package/dist/DateRangePicker/Calendar.js +46 -41
- package/dist/DateRangePicker/DateRangePicker.js +61 -32
- package/dist/DateRangePicker/DateRangePickerButton.js +17 -14
- package/dist/DateRangePicker/dateRangePickerUtils.js +90 -76
- package/dist/DateRangePicker/dateRangePickerUtils.js.map +1 -1
- package/dist/DateRangePicker/index.js +9 -1
- package/dist/PieChart.js +70 -35
- package/dist/QuillProvider.js +7 -4
- package/dist/ReportBuilder.js +129 -120
- package/dist/SQLEditor.js +65 -56
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +71 -60
- package/dist/Table.js.map +1 -1
- package/dist/TableChart.js +45 -17
- package/dist/assets/ArrowDownHeadIcon.js +6 -3
- package/dist/assets/ArrowDownIcon.js +6 -3
- package/dist/assets/ArrowDownRightIcon.js +6 -3
- package/dist/assets/ArrowLeftHeadIcon.js +6 -3
- package/dist/assets/ArrowRightHeadIcon.js +6 -3
- package/dist/assets/ArrowRightIcon.js +6 -3
- package/dist/assets/ArrowUpHeadIcon.js +6 -3
- package/dist/assets/ArrowUpIcon.js +6 -3
- package/dist/assets/ArrowUpRightIcon.js +6 -3
- package/dist/assets/CalendarIcon.js +6 -3
- package/dist/assets/CalendarNormalIcon.js +6 -3
- package/dist/assets/DoubleArrowLeftHeadIcon.js +6 -3
- package/dist/assets/DoubleArrowRightHeadIcon.js +6 -3
- package/dist/assets/ExclamationFilledIcon.js +6 -3
- package/dist/assets/FilterIcon.js +6 -3
- package/dist/assets/LoadingSpinner.js +6 -3
- package/dist/assets/RefreshIcon.js +6 -3
- package/dist/assets/SearchIcon.js +6 -3
- package/dist/assets/UpLeftArrowsIcon.js +6 -3
- package/dist/assets/XCircleIcon.js +6 -3
- package/dist/assets/XIcon.js +6 -3
- package/dist/assets/index.js +49 -21
- package/dist/components/BigModal/BigModal.js +39 -13
- package/dist/components/Dropdown/Dropdown.js +53 -24
- package/dist/components/Dropdown/DropdownItem.js +35 -9
- package/dist/components/Dropdown/index.js +11 -2
- package/dist/components/Modal/Modal.js +39 -13
- package/dist/components/Modal/index.js +9 -1
- package/dist/components/QuillCard.js +13 -8
- package/dist/components/SqlTextEditor.js +11 -4
- package/dist/components/SqlTextEditor.js.map +1 -0
- package/dist/components/UiComponents.js +51 -37
- package/dist/components/selectUtils.js +17 -6
- package/dist/contexts/BaseColorContext.js +6 -3
- package/dist/contexts/HoveredValueContext.js +6 -3
- package/dist/contexts/RootStylesContext.js +6 -3
- package/dist/contexts/SelectedValueContext.js +6 -3
- package/dist/contexts/index.js +15 -4
- package/dist/hooks/index.js +15 -4
- package/dist/hooks/useDashboard.js +17 -11
- package/dist/hooks/useDashboard.js.map +1 -0
- package/dist/hooks/useInternalState.js +6 -3
- package/dist/hooks/useOnClickOutside.js +6 -3
- package/dist/hooks/useOnWindowResize.js +7 -4
- package/dist/hooks/useQuill.js +16 -11
- package/dist/hooks/useSelectOnKeyDown.js +7 -4
- package/dist/index.js +33 -13
- package/dist/index.js.map +1 -1
- package/dist/internals/ReportBuilder/PivotList.js +20 -14
- package/dist/internals/ReportBuilder/PivotModal.js +92 -84
- package/dist/internals/ReportBuilder/PivotModal.spec.js +73 -70
- package/dist/lib/font.js +6 -2
- package/dist/lib/index.js +20 -3
- package/dist/lib/inputTypes.js +3 -1
- package/dist/lib/utils.js +19 -8
- package/dist/utils/aggregate.js +35 -28
- package/dist/utils/colorToHex.js +5 -1
- package/dist/utils/dataFetcher.js +8 -2
- package/dist/utils/downloadCSV.js +6 -1
- package/package.json +2 -1
package/dist/Context.js
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContextProvider = exports.DashboardFiltersContext = exports.DashboardContext = exports.SavedReportsQueryContext = exports.ReportBuilderQueryContext = exports.EditVisualizationModalVisibleContext = exports.QueryResultsLoadingContext = exports.ActiveVisualizationContext = exports.CreateVisualizationModalVisibleContext = exports.ClientContext = exports.ThemeContext = exports.EditorQueryContext = exports.SaveQueryModalStatusContext = exports.SavedQueriesContext = exports.HistoryContext = exports.SelectedSidebarIndexContext = exports.RowsContext = exports.ColumnsContext = exports.SchemaContext = exports.DateFilterContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
2
5
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
6
|
// @ts-nocheck
|
|
4
|
-
|
|
7
|
+
const react_1 = require("react");
|
|
5
8
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
6
9
|
const dummySetter = () => { };
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
exports.DateFilterContext = (0, react_1.createContext)([], dummySetter);
|
|
11
|
+
exports.SchemaContext = (0, react_1.createContext)([[], dummySetter]);
|
|
12
|
+
exports.ColumnsContext = (0, react_1.createContext)([null, dummySetter]);
|
|
13
|
+
exports.RowsContext = (0, react_1.createContext)([null, dummySetter]);
|
|
14
|
+
exports.SelectedSidebarIndexContext = (0, react_1.createContext)([0, dummySetter]);
|
|
15
|
+
exports.HistoryContext = (0, react_1.createContext)([[], dummySetter]);
|
|
16
|
+
exports.SavedQueriesContext = (0, react_1.createContext)([[], dummySetter]);
|
|
17
|
+
exports.SaveQueryModalStatusContext = (0, react_1.createContext)([
|
|
15
18
|
'HIDDEN',
|
|
16
19
|
dummySetter,
|
|
17
20
|
]);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
exports.EditorQueryContext = (0, react_1.createContext)(['', dummySetter]);
|
|
22
|
+
exports.ThemeContext = (0, react_1.createContext)([null, dummySetter]);
|
|
23
|
+
exports.ClientContext = (0, react_1.createContext)([null, dummySetter]);
|
|
24
|
+
exports.CreateVisualizationModalVisibleContext = (0, react_1.createContext)([
|
|
22
25
|
false,
|
|
23
26
|
dummySetter,
|
|
24
27
|
]);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
exports.ActiveVisualizationContext = (0, react_1.createContext)([null, dummySetter]);
|
|
29
|
+
exports.QueryResultsLoadingContext = (0, react_1.createContext)([false, dummySetter]);
|
|
30
|
+
exports.EditVisualizationModalVisibleContext = (0, react_1.createContext)([
|
|
28
31
|
false,
|
|
29
32
|
dummySetter,
|
|
30
33
|
]);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
exports.ReportBuilderQueryContext = (0, react_1.createContext)(['', dummySetter]);
|
|
35
|
+
exports.SavedReportsQueryContext = (0, react_1.createContext)(['', dummySetter]);
|
|
36
|
+
exports.DashboardContext = (0, react_1.createContext)([{}, dummySetter]);
|
|
37
|
+
exports.DashboardFiltersContext = (0, react_1.createContext)([{}, dummySetter]);
|
|
35
38
|
const dashboardReducer = (state, action) => {
|
|
36
39
|
switch (action.type) {
|
|
37
40
|
case 'UPDATE_DASHBOARD_ITEM':
|
|
@@ -83,29 +86,29 @@ const dashboardFiltersReducer = (state, action) => {
|
|
|
83
86
|
return state;
|
|
84
87
|
}
|
|
85
88
|
};
|
|
86
|
-
|
|
87
|
-
const [client, setClient] = useState(null);
|
|
88
|
-
const [theme, setTheme] = useState(null);
|
|
89
|
-
const [columns, setColumns] = useState(null);
|
|
90
|
-
const [rows, setRows] = useState(null);
|
|
91
|
-
const [schema, setSchema] = useState([]);
|
|
92
|
-
const [selectedSidebarIndex, setSelectedSidebarIndex] = useState(0);
|
|
93
|
-
const [history, setHistory] = useState([]);
|
|
94
|
-
const [savedQueries, setSavedQueries] = useState([]);
|
|
89
|
+
const ContextProvider = ({ children, initialTheme, publicKey, environment, authToken, customerId, userId, queryEndpoint, queryHeaders, withCredentials, }) => {
|
|
90
|
+
const [client, setClient] = (0, react_1.useState)(null);
|
|
91
|
+
const [theme, setTheme] = (0, react_1.useState)(null);
|
|
92
|
+
const [columns, setColumns] = (0, react_1.useState)(null);
|
|
93
|
+
const [rows, setRows] = (0, react_1.useState)(null);
|
|
94
|
+
const [schema, setSchema] = (0, react_1.useState)([]);
|
|
95
|
+
const [selectedSidebarIndex, setSelectedSidebarIndex] = (0, react_1.useState)(0);
|
|
96
|
+
const [history, setHistory] = (0, react_1.useState)([]);
|
|
97
|
+
const [savedQueries, setSavedQueries] = (0, react_1.useState)([]);
|
|
95
98
|
// REPORT_BUILDER, SQL_EDITOR, HIDDEN
|
|
96
|
-
const [saveQueryModalStatus, setSaveQueryModalStatus] = useState('HIDDEN');
|
|
97
|
-
const [editorQuery, setEditorQuery] = useState('');
|
|
98
|
-
const [savedReportsQuery, setSavedReportsQuery] = useState('');
|
|
99
|
-
const [reportBuilderQuery, setReportBuilderQuery] = useState('');
|
|
100
|
-
const [createVisualizationModalVisible, setCreateVisualizationModalVisible] = useState(false);
|
|
101
|
-
const [activeVisualization, setActiveVisualization] = useState(null);
|
|
102
|
-
const [queryResultsLoading, setQueryResultsLoading] = useState(false);
|
|
103
|
-
const [editVisualizationModalVisible, setEditVisualizationModalVisible] = useState(false);
|
|
104
|
-
const [dashboard, dispatch] = useReducer(dashboardReducer, {});
|
|
105
|
-
const [dashboardFilters, dashboardFiltersDispatch] = useReducer(dashboardFiltersReducer, {});
|
|
106
|
-
const [dateFilter, setDateFilter] = useState(null);
|
|
99
|
+
const [saveQueryModalStatus, setSaveQueryModalStatus] = (0, react_1.useState)('HIDDEN');
|
|
100
|
+
const [editorQuery, setEditorQuery] = (0, react_1.useState)('');
|
|
101
|
+
const [savedReportsQuery, setSavedReportsQuery] = (0, react_1.useState)('');
|
|
102
|
+
const [reportBuilderQuery, setReportBuilderQuery] = (0, react_1.useState)('');
|
|
103
|
+
const [createVisualizationModalVisible, setCreateVisualizationModalVisible] = (0, react_1.useState)(false);
|
|
104
|
+
const [activeVisualization, setActiveVisualization] = (0, react_1.useState)(null);
|
|
105
|
+
const [queryResultsLoading, setQueryResultsLoading] = (0, react_1.useState)(false);
|
|
106
|
+
const [editVisualizationModalVisible, setEditVisualizationModalVisible] = (0, react_1.useState)(false);
|
|
107
|
+
const [dashboard, dispatch] = (0, react_1.useReducer)(dashboardReducer, {});
|
|
108
|
+
const [dashboardFilters, dashboardFiltersDispatch] = (0, react_1.useReducer)(dashboardFiltersReducer, {});
|
|
109
|
+
const [dateFilter, setDateFilter] = (0, react_1.useState)(null);
|
|
107
110
|
// SETS INITIAL THEME
|
|
108
|
-
useEffect(() => {
|
|
111
|
+
(0, react_1.useEffect)(() => {
|
|
109
112
|
if (!theme) {
|
|
110
113
|
// Create a copy of initialTheme
|
|
111
114
|
const newTheme = { ...initialTheme };
|
|
@@ -125,7 +128,7 @@ export const ContextProvider = ({ children, initialTheme, publicKey, environment
|
|
|
125
128
|
}
|
|
126
129
|
}, [initialTheme]);
|
|
127
130
|
// SETS INITIAL CLIENT
|
|
128
|
-
useEffect(() => {
|
|
131
|
+
(0, react_1.useEffect)(() => {
|
|
129
132
|
if (!client) {
|
|
130
133
|
setClient({
|
|
131
134
|
customerId,
|
|
@@ -156,7 +159,7 @@ export const ContextProvider = ({ children, initialTheme, publicKey, environment
|
|
|
156
159
|
withCredentials,
|
|
157
160
|
]);
|
|
158
161
|
// DYNAMICALLY CHANGE ORG
|
|
159
|
-
useEffect(() => {
|
|
162
|
+
(0, react_1.useEffect)(() => {
|
|
160
163
|
setClient(client => {
|
|
161
164
|
return { ...client, customerId, environment };
|
|
162
165
|
});
|
|
@@ -167,29 +170,31 @@ export const ContextProvider = ({ children, initialTheme, publicKey, environment
|
|
|
167
170
|
if (!theme || !client) {
|
|
168
171
|
return null;
|
|
169
172
|
}
|
|
170
|
-
return (
|
|
173
|
+
return ((0, jsx_runtime_1.jsx)(exports.ClientContext.Provider, { value: [client, setClient], children: (0, jsx_runtime_1.jsx)(exports.ThemeContext.Provider, { value: [theme, setTheme], children: (0, jsx_runtime_1.jsx)(exports.SchemaContext.Provider, { value: [schema, setSchema], children: (0, jsx_runtime_1.jsx)(exports.ColumnsContext.Provider, { value: [columns, setColumns], children: (0, jsx_runtime_1.jsx)(exports.RowsContext.Provider, { value: [rows, setRows], children: (0, jsx_runtime_1.jsx)(exports.SelectedSidebarIndexContext.Provider, { value: [selectedSidebarIndex, setSelectedSidebarIndex], children: (0, jsx_runtime_1.jsx)(exports.HistoryContext.Provider, { value: [history, setHistory], children: (0, jsx_runtime_1.jsx)(exports.SavedQueriesContext.Provider, { value: [savedQueries, setSavedQueries], children: (0, jsx_runtime_1.jsx)(exports.SaveQueryModalStatusContext.Provider, { value: [saveQueryModalStatus, setSaveQueryModalStatus], children: (0, jsx_runtime_1.jsx)(exports.CreateVisualizationModalVisibleContext.Provider, { value: [
|
|
171
174
|
createVisualizationModalVisible,
|
|
172
175
|
setCreateVisualizationModalVisible,
|
|
173
|
-
], children:
|
|
176
|
+
], children: (0, jsx_runtime_1.jsx)(exports.EditorQueryContext.Provider, { value: [editorQuery, setEditorQuery], children: (0, jsx_runtime_1.jsx)(exports.ActiveVisualizationContext.Provider, { value: [
|
|
174
177
|
activeVisualization,
|
|
175
178
|
setActiveVisualization,
|
|
176
|
-
], children:
|
|
179
|
+
], children: (0, jsx_runtime_1.jsx)(exports.QueryResultsLoadingContext.Provider, { value: [
|
|
177
180
|
queryResultsLoading,
|
|
178
181
|
setQueryResultsLoading,
|
|
179
|
-
], children:
|
|
182
|
+
], children: (0, jsx_runtime_1.jsx)(exports.EditVisualizationModalVisibleContext.Provider, { value: [
|
|
180
183
|
editVisualizationModalVisible,
|
|
181
184
|
setEditVisualizationModalVisible,
|
|
182
|
-
], children:
|
|
185
|
+
], children: (0, jsx_runtime_1.jsx)(exports.ReportBuilderQueryContext.Provider, { value: [
|
|
183
186
|
reportBuilderQuery,
|
|
184
187
|
setReportBuilderQuery,
|
|
185
|
-
], children:
|
|
188
|
+
], children: (0, jsx_runtime_1.jsx)(exports.SavedReportsQueryContext.Provider, { value: [
|
|
186
189
|
savedReportsQuery,
|
|
187
190
|
setSavedReportsQuery,
|
|
188
|
-
], children:
|
|
191
|
+
], children: (0, jsx_runtime_1.jsx)(exports.DashboardContext.Provider, { value: { dashboard, dispatch }, children: (0, jsx_runtime_1.jsx)(exports.DashboardFiltersContext.Provider, { value: {
|
|
189
192
|
dashboardFilters,
|
|
190
193
|
dashboardFiltersDispatch,
|
|
191
|
-
}, children:
|
|
194
|
+
}, children: (0, jsx_runtime_1.jsx)(exports.DateFilterContext.Provider, { value: {
|
|
192
195
|
dateFilter,
|
|
193
196
|
setDateFilter,
|
|
194
197
|
}, children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
195
198
|
};
|
|
199
|
+
exports.ContextProvider = ContextProvider;
|
|
200
|
+
//# sourceMappingURL=Context.js.map
|