@quillsql/react 1.7.5 → 1.7.7

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