@quillsql/react 1.7.4 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AddToDashboardModal.js +2 -2
- package/lib/AddToDashboardModal.js.map +1 -1
- package/lib/Chart.js +2 -2
- package/lib/Chart.js.map +1 -1
- package/lib/Context.d.ts +2 -1
- package/lib/Context.js +3 -1
- package/lib/Context.js.map +1 -1
- package/lib/Dashboard.js +2 -2
- package/lib/Dashboard.js.map +1 -1
- package/lib/QuillProvider.d.ts +2 -1
- package/lib/QuillProvider.js +2 -2
- package/lib/QuillProvider.js.map +1 -1
- package/lib/ReportBuilder.d.ts +1 -1
- package/lib/ReportBuilder.js +3 -2
- package/lib/ReportBuilder.js.map +1 -1
- package/lib/SQLEditor.js +5 -5
- package/lib/SQLEditor.js.map +1 -1
- package/lib/Table.js +1 -1
- package/lib/Table.js.map +1 -1
- package/lib/components/BigModal/BigModal.js +1 -0
- package/lib/components/BigModal/BigModal.js.map +1 -1
- package/lib/components/Modal/Modal.js +1 -0
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/hooks/useQuill.js +3 -2
- package/lib/hooks/useQuill.js.map +1 -1
- package/package.json +11 -4
- package/.eslintrc.json +0 -19
- package/.prettierrc +0 -11
- package/.vscode/settings.json +0 -10
- package/src/AddToDashboardModal.tsx +0 -1213
- package/src/BarList.tsx +0 -580
- package/src/Chart.tsx +0 -1336
- package/src/Context.tsx +0 -249
- package/src/Dashboard.tsx +0 -819
- package/src/DateRangePicker/Calendar.tsx +0 -442
- package/src/DateRangePicker/DateRangePicker.tsx +0 -261
- package/src/DateRangePicker/DateRangePickerButton.tsx +0 -250
- package/src/DateRangePicker/dateRangePickerUtils.tsx +0 -480
- package/src/DateRangePicker/index.ts +0 -4
- package/src/PieChart.tsx +0 -845
- package/src/QuillProvider.tsx +0 -78
- package/src/ReportBuilder.tsx +0 -2202
- package/src/SQLEditor.tsx +0 -1087
- package/src/Table.tsx +0 -1074
- package/src/TableChart.tsx +0 -428
- package/src/assets/ArrowDownHeadIcon.tsx +0 -11
- package/src/assets/ArrowDownIcon.tsx +0 -14
- package/src/assets/ArrowDownRightIcon.tsx +0 -14
- package/src/assets/ArrowLeftHeadIcon.tsx +0 -11
- package/src/assets/ArrowRightHeadIcon.tsx +0 -11
- package/src/assets/ArrowRightIcon.tsx +0 -14
- package/src/assets/ArrowUpHeadIcon.tsx +0 -11
- package/src/assets/ArrowUpIcon.tsx +0 -14
- package/src/assets/ArrowUpRightIcon.tsx +0 -14
- package/src/assets/CalendarIcon.tsx +0 -14
- package/src/assets/DoubleArrowLeftHeadIcon.tsx +0 -18
- package/src/assets/DoubleArrowRightHeadIcon.tsx +0 -20
- package/src/assets/ExclamationFilledIcon.tsx +0 -14
- package/src/assets/LoadingSpinner.tsx +0 -11
- package/src/assets/SearchIcon.tsx +0 -14
- package/src/assets/XCircleIcon.tsx +0 -14
- package/src/assets/index.ts +0 -16
- package/src/components/BigModal/BigModal.tsx +0 -108
- package/src/components/Dropdown/Dropdown.tsx +0 -169
- package/src/components/Dropdown/DropdownItem.tsx +0 -68
- package/src/components/Dropdown/index.ts +0 -2
- package/src/components/Modal/Modal.tsx +0 -132
- package/src/components/Modal/index.ts +0 -1
- package/src/components/selectUtils.ts +0 -60
- package/src/contexts/BaseColorContext.tsx +0 -5
- package/src/contexts/HoveredValueContext.tsx +0 -12
- package/src/contexts/RootStylesContext.tsx +0 -5
- package/src/contexts/SelectedValueContext.tsx +0 -13
- package/src/contexts/index.ts +0 -4
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useInternalState.tsx +0 -18
- package/src/hooks/useOnClickOutside.tsx +0 -23
- package/src/hooks/useOnWindowResize.tsx +0 -17
- package/src/hooks/useQuill.ts +0 -137
- package/src/hooks/useSelectOnKeyDown.tsx +0 -80
- package/src/index.ts +0 -9
- package/src/lib/font.ts +0 -14
- package/src/lib/index.ts +0 -3
- package/src/lib/inputTypes.ts +0 -81
- package/src/lib/utils.tsx +0 -46
- package/tsconfig.json +0 -22
package/src/Context.tsx
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import React, { useState, createContext, useEffect, useReducer } from 'react';
|
|
4
|
-
import { QuillTheme } from './QuillProvider';
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7
|
-
const dummySetter = () => {};
|
|
8
|
-
|
|
9
|
-
export const SchemaContext = createContext([[], dummySetter]);
|
|
10
|
-
export const ColumnsContext = createContext([null, dummySetter]);
|
|
11
|
-
export const RowsContext = createContext([null, dummySetter]);
|
|
12
|
-
export const SelectedSidebarIndexContext = createContext([0, dummySetter]);
|
|
13
|
-
export const HistoryContext = createContext([[], dummySetter]);
|
|
14
|
-
export const SavedQueriesContext = createContext([[], dummySetter]);
|
|
15
|
-
export const SaveQueryModalStatusContext = createContext([
|
|
16
|
-
'HIDDEN',
|
|
17
|
-
dummySetter,
|
|
18
|
-
]);
|
|
19
|
-
export const EditorQueryContext = createContext(['', dummySetter]);
|
|
20
|
-
export const ThemeContext = createContext<
|
|
21
|
-
[QuillTheme, (theme: QuillTheme) => void]
|
|
22
|
-
>([null, dummySetter]);
|
|
23
|
-
export const ClientContext = createContext([null, dummySetter]);
|
|
24
|
-
export const CreateVisualizationModalVisibleContext = createContext([
|
|
25
|
-
false,
|
|
26
|
-
dummySetter,
|
|
27
|
-
]);
|
|
28
|
-
export const ActiveVisualizationContext = createContext([null, dummySetter]);
|
|
29
|
-
export const QueryResultsLoadingContext = createContext([false, dummySetter]);
|
|
30
|
-
export const EditVisualizationModalVisibleContext = createContext([
|
|
31
|
-
false,
|
|
32
|
-
dummySetter,
|
|
33
|
-
]);
|
|
34
|
-
export const ReportBuilderQueryContext = createContext(['', dummySetter]);
|
|
35
|
-
export const SavedReportsQueryContext = createContext(['', dummySetter]);
|
|
36
|
-
export const DashboardContext = createContext([{}, dummySetter]);
|
|
37
|
-
export const DashboardFiltersContext = createContext([{}, dummySetter]);
|
|
38
|
-
|
|
39
|
-
const dashboardReducer = (state, action) => {
|
|
40
|
-
switch (action.type) {
|
|
41
|
-
case 'UPDATE_DASHBOARD_ITEM':
|
|
42
|
-
return {
|
|
43
|
-
...state,
|
|
44
|
-
[action.id]: {
|
|
45
|
-
...state[action.id],
|
|
46
|
-
...action.data,
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
case 'ADD_DASHBOARD_ITEM':
|
|
50
|
-
return {
|
|
51
|
-
...state,
|
|
52
|
-
[action.id]: action.data,
|
|
53
|
-
};
|
|
54
|
-
case 'CLEAR_DASHBOARD':
|
|
55
|
-
return {};
|
|
56
|
-
default:
|
|
57
|
-
return state;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const dashboardFiltersReducer = (state, action) => {
|
|
62
|
-
switch (action.type) {
|
|
63
|
-
case 'UPDATE_DASHBOARD_FILTER':
|
|
64
|
-
return {
|
|
65
|
-
...state,
|
|
66
|
-
[action.id]: {
|
|
67
|
-
...state[action.id],
|
|
68
|
-
...action.data,
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
case 'ADD_DASHBOARD_FILTER':
|
|
72
|
-
return {
|
|
73
|
-
...state,
|
|
74
|
-
[action.id]: action.data,
|
|
75
|
-
};
|
|
76
|
-
case 'CLEAR_DASHBOARD_FILTERS':
|
|
77
|
-
return {};
|
|
78
|
-
default:
|
|
79
|
-
return state;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const ContextProvider = ({
|
|
84
|
-
children,
|
|
85
|
-
initialTheme,
|
|
86
|
-
publicKey,
|
|
87
|
-
environment,
|
|
88
|
-
authToken,
|
|
89
|
-
customerId,
|
|
90
|
-
userId,
|
|
91
|
-
queryEndpoint,
|
|
92
|
-
queryHeaders,
|
|
93
|
-
}) => {
|
|
94
|
-
const [client, setClient] = useState(null);
|
|
95
|
-
const [theme, setTheme] =
|
|
96
|
-
useState<[QuillTheme, (theme: QuillTheme) => void]>(null);
|
|
97
|
-
const [columns, setColumns] = useState(null);
|
|
98
|
-
const [rows, setRows] = useState(null);
|
|
99
|
-
const [schema, setSchema] = useState([]);
|
|
100
|
-
const [selectedSidebarIndex, setSelectedSidebarIndex] = useState(0);
|
|
101
|
-
const [history, setHistory] = useState([]);
|
|
102
|
-
const [savedQueries, setSavedQueries] = useState([]);
|
|
103
|
-
// REPORT_BUILDER, SQL_EDITOR, HIDDEN
|
|
104
|
-
const [saveQueryModalStatus, setSaveQueryModalStatus] = useState('HIDDEN');
|
|
105
|
-
const [editorQuery, setEditorQuery] = useState('');
|
|
106
|
-
const [savedReportsQuery, setSavedReportsQuery] = useState('');
|
|
107
|
-
const [reportBuilderQuery, setReportBuilderQuery] = useState('');
|
|
108
|
-
const [createVisualizationModalVisible, setCreateVisualizationModalVisible] =
|
|
109
|
-
useState(false);
|
|
110
|
-
const [activeVisualization, setActiveVisualization] = useState(null);
|
|
111
|
-
const [queryResultsLoading, setQueryResultsLoading] = useState(false);
|
|
112
|
-
const [editVisualizationModalVisible, setEditVisualizationModalVisible] =
|
|
113
|
-
useState(false);
|
|
114
|
-
const [dashboard, dispatch] = useReducer(dashboardReducer, {});
|
|
115
|
-
const [dashboardFilters, dashboardFiltersDispatch] = useReducer(
|
|
116
|
-
dashboardFiltersReducer,
|
|
117
|
-
{}
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
// SETS INITIAL THEME
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
if (!theme) {
|
|
123
|
-
setTheme({ ...initialTheme });
|
|
124
|
-
}
|
|
125
|
-
}, [initialTheme]);
|
|
126
|
-
|
|
127
|
-
// SETS INITIAL CLIENT
|
|
128
|
-
useEffect(() => {
|
|
129
|
-
if (!client) {
|
|
130
|
-
setClient({
|
|
131
|
-
customerId,
|
|
132
|
-
userId,
|
|
133
|
-
authToken,
|
|
134
|
-
publicKey,
|
|
135
|
-
environment,
|
|
136
|
-
queryEndpoint,
|
|
137
|
-
queryHeaders,
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}, [
|
|
141
|
-
customerId,
|
|
142
|
-
userId,
|
|
143
|
-
authToken,
|
|
144
|
-
publicKey,
|
|
145
|
-
client,
|
|
146
|
-
environment,
|
|
147
|
-
queryEndpoint,
|
|
148
|
-
queryHeaders,
|
|
149
|
-
]);
|
|
150
|
-
|
|
151
|
-
// DYNAMICALLY CHANGE ORG
|
|
152
|
-
useEffect(() => {
|
|
153
|
-
setClient(client => {
|
|
154
|
-
return { ...client, customerId, environment };
|
|
155
|
-
});
|
|
156
|
-
if (Object.keys(dashboard).length > 0) {
|
|
157
|
-
dispatch({ type: 'CLEAR_DASHBOARD' });
|
|
158
|
-
}
|
|
159
|
-
}, [customerId, environment]);
|
|
160
|
-
|
|
161
|
-
if (!theme || !client) {
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return (
|
|
166
|
-
<ClientContext.Provider value={[client, setClient]}>
|
|
167
|
-
<ThemeContext.Provider value={[theme, setTheme]}>
|
|
168
|
-
<SchemaContext.Provider value={[schema, setSchema]}>
|
|
169
|
-
<ColumnsContext.Provider value={[columns, setColumns]}>
|
|
170
|
-
<RowsContext.Provider value={[rows, setRows]}>
|
|
171
|
-
<SelectedSidebarIndexContext.Provider
|
|
172
|
-
value={[selectedSidebarIndex, setSelectedSidebarIndex]}
|
|
173
|
-
>
|
|
174
|
-
<HistoryContext.Provider value={[history, setHistory]}>
|
|
175
|
-
<SavedQueriesContext.Provider
|
|
176
|
-
value={[savedQueries, setSavedQueries]}
|
|
177
|
-
>
|
|
178
|
-
<SaveQueryModalStatusContext.Provider
|
|
179
|
-
value={[saveQueryModalStatus, setSaveQueryModalStatus]}
|
|
180
|
-
>
|
|
181
|
-
<CreateVisualizationModalVisibleContext.Provider
|
|
182
|
-
value={[
|
|
183
|
-
createVisualizationModalVisible,
|
|
184
|
-
setCreateVisualizationModalVisible,
|
|
185
|
-
]}
|
|
186
|
-
>
|
|
187
|
-
<EditorQueryContext.Provider
|
|
188
|
-
value={[editorQuery, setEditorQuery]}
|
|
189
|
-
>
|
|
190
|
-
<ActiveVisualizationContext.Provider
|
|
191
|
-
value={[
|
|
192
|
-
activeVisualization,
|
|
193
|
-
setActiveVisualization,
|
|
194
|
-
]}
|
|
195
|
-
>
|
|
196
|
-
<QueryResultsLoadingContext.Provider
|
|
197
|
-
value={[
|
|
198
|
-
queryResultsLoading,
|
|
199
|
-
setQueryResultsLoading,
|
|
200
|
-
]}
|
|
201
|
-
>
|
|
202
|
-
<EditVisualizationModalVisibleContext.Provider
|
|
203
|
-
value={[
|
|
204
|
-
editVisualizationModalVisible,
|
|
205
|
-
setEditVisualizationModalVisible,
|
|
206
|
-
]}
|
|
207
|
-
>
|
|
208
|
-
<ReportBuilderQueryContext.Provider
|
|
209
|
-
value={[
|
|
210
|
-
reportBuilderQuery,
|
|
211
|
-
setReportBuilderQuery,
|
|
212
|
-
]}
|
|
213
|
-
>
|
|
214
|
-
<SavedReportsQueryContext.Provider
|
|
215
|
-
value={[
|
|
216
|
-
savedReportsQuery,
|
|
217
|
-
setSavedReportsQuery,
|
|
218
|
-
]}
|
|
219
|
-
>
|
|
220
|
-
<DashboardContext.Provider
|
|
221
|
-
value={{ dashboard, dispatch }}
|
|
222
|
-
>
|
|
223
|
-
<DashboardFiltersContext.Provider
|
|
224
|
-
value={{
|
|
225
|
-
dashboardFilters,
|
|
226
|
-
dashboardFiltersDispatch,
|
|
227
|
-
}}
|
|
228
|
-
>
|
|
229
|
-
{children}
|
|
230
|
-
</DashboardFiltersContext.Provider>
|
|
231
|
-
</DashboardContext.Provider>
|
|
232
|
-
</SavedReportsQueryContext.Provider>
|
|
233
|
-
</ReportBuilderQueryContext.Provider>
|
|
234
|
-
</EditVisualizationModalVisibleContext.Provider>
|
|
235
|
-
</QueryResultsLoadingContext.Provider>
|
|
236
|
-
</ActiveVisualizationContext.Provider>
|
|
237
|
-
</EditorQueryContext.Provider>
|
|
238
|
-
</CreateVisualizationModalVisibleContext.Provider>
|
|
239
|
-
</SaveQueryModalStatusContext.Provider>
|
|
240
|
-
</SavedQueriesContext.Provider>
|
|
241
|
-
</HistoryContext.Provider>
|
|
242
|
-
</SelectedSidebarIndexContext.Provider>
|
|
243
|
-
</RowsContext.Provider>
|
|
244
|
-
</ColumnsContext.Provider>
|
|
245
|
-
</SchemaContext.Provider>
|
|
246
|
-
</ThemeContext.Provider>
|
|
247
|
-
</ClientContext.Provider>
|
|
248
|
-
);
|
|
249
|
-
};
|