@quillsql/react 1.7.2 → 1.7.4
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 +249 -369
- package/lib/AddToDashboardModal.js.map +1 -1
- package/lib/BarList.js +92 -109
- package/lib/BarList.js.map +1 -1
- package/lib/Chart.d.ts +0 -1
- package/lib/Chart.js +359 -419
- package/lib/Chart.js.map +1 -1
- package/lib/Context.d.ts +1 -2
- package/lib/Context.js +91 -85
- package/lib/Context.js.map +1 -1
- package/lib/Dashboard.js +181 -209
- package/lib/Dashboard.js.map +1 -1
- package/lib/DateRangePicker/Calendar.js +87 -91
- package/lib/DateRangePicker/Calendar.js.map +1 -1
- package/lib/DateRangePicker/DateRangePicker.js +70 -68
- package/lib/DateRangePicker/DateRangePicker.js.map +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.js +46 -57
- package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -1
- package/lib/DateRangePicker/dateRangePickerUtils.js +105 -99
- package/lib/DateRangePicker/dateRangePickerUtils.js.map +1 -1
- package/lib/DateRangePicker/index.js +8 -1
- package/lib/DateRangePicker/index.js.map +1 -1
- package/lib/PieChart.js +221 -225
- package/lib/PieChart.js.map +1 -1
- package/lib/QuillProvider.d.ts +1 -2
- package/lib/QuillProvider.js +8 -18
- package/lib/QuillProvider.js.map +1 -1
- package/lib/ReportBuilder.js +430 -526
- package/lib/ReportBuilder.js.map +1 -1
- package/lib/SQLEditor.js +182 -268
- package/lib/SQLEditor.js.map +1 -1
- package/lib/Table.js +207 -261
- package/lib/Table.js.map +1 -1
- package/lib/TableChart.js +76 -75
- package/lib/TableChart.js.map +1 -1
- package/lib/assets/ArrowDownHeadIcon.js +5 -28
- package/lib/assets/ArrowDownHeadIcon.js.map +1 -1
- package/lib/assets/ArrowDownIcon.js +5 -28
- package/lib/assets/ArrowDownIcon.js.map +1 -1
- package/lib/assets/ArrowDownRightIcon.js +5 -28
- package/lib/assets/ArrowDownRightIcon.js.map +1 -1
- package/lib/assets/ArrowLeftHeadIcon.js +5 -28
- package/lib/assets/ArrowLeftHeadIcon.js.map +1 -1
- package/lib/assets/ArrowRightHeadIcon.js +5 -28
- package/lib/assets/ArrowRightHeadIcon.js.map +1 -1
- package/lib/assets/ArrowRightIcon.js +5 -28
- package/lib/assets/ArrowRightIcon.js.map +1 -1
- package/lib/assets/ArrowUpHeadIcon.js +5 -28
- package/lib/assets/ArrowUpHeadIcon.js.map +1 -1
- package/lib/assets/ArrowUpIcon.js +5 -28
- package/lib/assets/ArrowUpIcon.js.map +1 -1
- package/lib/assets/ArrowUpRightIcon.js +5 -28
- package/lib/assets/ArrowUpRightIcon.js.map +1 -1
- package/lib/assets/CalendarIcon.js +5 -28
- package/lib/assets/CalendarIcon.js.map +1 -1
- package/lib/assets/DoubleArrowLeftHeadIcon.js +5 -28
- package/lib/assets/DoubleArrowLeftHeadIcon.js.map +1 -1
- package/lib/assets/DoubleArrowRightHeadIcon.js +5 -28
- package/lib/assets/DoubleArrowRightHeadIcon.js.map +1 -1
- package/lib/assets/ExclamationFilledIcon.js +5 -28
- package/lib/assets/ExclamationFilledIcon.js.map +1 -1
- package/lib/assets/LoadingSpinner.js +5 -28
- package/lib/assets/LoadingSpinner.js.map +1 -1
- package/lib/assets/SearchIcon.js +5 -28
- package/lib/assets/SearchIcon.js.map +1 -1
- package/lib/assets/XCircleIcon.js +5 -28
- package/lib/assets/XCircleIcon.js.map +1 -1
- package/lib/assets/index.js +38 -16
- package/lib/assets/index.js.map +1 -1
- package/lib/components/BigModal/BigModal.js +45 -43
- package/lib/components/BigModal/BigModal.js.map +1 -1
- package/lib/components/Dropdown/Dropdown.js +57 -53
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/DropdownItem.js +43 -40
- package/lib/components/Dropdown/DropdownItem.js.map +1 -1
- package/lib/components/Dropdown/index.js +10 -2
- package/lib/components/Dropdown/index.js.map +1 -1
- package/lib/components/Modal/Modal.js +45 -43
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/index.js +8 -1
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/selectUtils.js +20 -15
- package/lib/components/selectUtils.js.map +1 -1
- package/lib/contexts/BaseColorContext.js +5 -3
- package/lib/contexts/BaseColorContext.js.map +1 -1
- package/lib/contexts/HoveredValueContext.js +5 -3
- package/lib/contexts/HoveredValueContext.js.map +1 -1
- package/lib/contexts/RootStylesContext.js +5 -3
- package/lib/contexts/RootStylesContext.js.map +1 -1
- package/lib/contexts/SelectedValueContext.js +5 -3
- package/lib/contexts/SelectedValueContext.js.map +1 -1
- package/lib/contexts/index.js +14 -4
- package/lib/contexts/index.js.map +1 -1
- package/lib/hooks/index.js +14 -4
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useInternalState.js +9 -7
- package/lib/hooks/useInternalState.js.map +1 -1
- package/lib/hooks/useOnClickOutside.js +8 -6
- package/lib/hooks/useOnClickOutside.js.map +1 -1
- package/lib/hooks/useOnWindowResize.js +9 -7
- package/lib/hooks/useOnWindowResize.js.map +1 -1
- package/lib/hooks/useQuill.js +60 -111
- package/lib/hooks/useQuill.js.map +1 -1
- package/lib/hooks/useSelectOnKeyDown.js +17 -15
- package/lib/hooks/useSelectOnKeyDown.js.map +1 -1
- package/lib/index.js +22 -8
- package/lib/index.js.map +1 -1
- package/lib/lib/font.d.ts +13 -0
- package/lib/lib/font.js +17 -0
- package/lib/lib/font.js.map +1 -0
- package/lib/lib/index.d.ts +3 -0
- package/lib/lib/index.js +20 -0
- package/lib/lib/index.js.map +1 -0
- package/lib/lib/inputTypes.d.ts +20 -0
- package/lib/lib/inputTypes.js +57 -0
- package/lib/lib/inputTypes.js.map +1 -0
- package/lib/lib/utils.d.ts +9 -0
- package/lib/lib/utils.js +46 -0
- package/lib/lib/utils.js.map +1 -0
- package/package.json +6 -13
- package/src/AddToDashboardModal.tsx +2 -9
- package/src/Chart.tsx +49 -20
- package/src/Context.tsx +0 -3
- package/src/Dashboard.tsx +2 -3
- package/src/PieChart.tsx +2 -2
- package/src/QuillProvider.tsx +0 -3
- package/src/ReportBuilder.tsx +3 -9
- package/src/SQLEditor.tsx +99 -12
- package/src/Table.tsx +99 -10
- package/src/hooks/useQuill.ts +1 -2
- package/src/lib/font.ts +14 -0
- package/src/lib/index.ts +3 -0
- package/src/lib/inputTypes.ts +81 -0
- package/src/lib/utils.tsx +46 -0
- package/tsconfig.json +3 -3
- package/rollup.config.ts +0 -21
package/lib/SQLEditor.js
CHANGED
|
@@ -1,63 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
4
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.convertPostgresColumn = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
49
8
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
50
9
|
// @ts-ignore
|
|
51
|
-
|
|
52
|
-
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const react_2 = __importDefault(require("@monaco-editor/react"));
|
|
53
12
|
// import './nightOwlLight.css';
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var format;
|
|
13
|
+
const axios_1 = __importDefault(require("axios"));
|
|
14
|
+
const Context_1 = require("./Context");
|
|
15
|
+
const solid_1 = require("@heroicons/react/20/solid");
|
|
16
|
+
const Table_1 = require("./Table");
|
|
17
|
+
function convertPostgresColumn(column) {
|
|
18
|
+
let format;
|
|
61
19
|
switch (column.dataTypeID) {
|
|
62
20
|
case 20: // int8
|
|
63
21
|
case 21: // int2
|
|
@@ -85,6 +43,7 @@ export function convertPostgresColumn(column) {
|
|
|
85
43
|
format: format,
|
|
86
44
|
};
|
|
87
45
|
}
|
|
46
|
+
exports.convertPostgresColumn = convertPostgresColumn;
|
|
88
47
|
function defineEditorTheme(monaco, theme) {
|
|
89
48
|
monaco.editor.defineTheme('onedark', {
|
|
90
49
|
base: theme.darkMode ? 'vs-dark' : 'vs',
|
|
@@ -110,30 +69,26 @@ function setEditorTheme(editor, monaco) {
|
|
|
110
69
|
console.log('ERROR: ', e);
|
|
111
70
|
}
|
|
112
71
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
};
|
|
134
|
-
var QuillTextInput = function (_a) {
|
|
135
|
-
var onChange = _a.onChange, value = _a.value, id = _a.id, placeholder = _a.placeholder, theme = _a.theme;
|
|
136
|
-
return (_jsx("input", { style: {
|
|
72
|
+
const QuillButton = ({ onClick, label, theme, secondary, }) => ((0, jsx_runtime_1.jsx)("button", { style: {
|
|
73
|
+
borderRadius: '6px',
|
|
74
|
+
backgroundColor: secondary
|
|
75
|
+
? theme?.secondaryButtonColor || '#FFFFFF'
|
|
76
|
+
: theme?.primaryButtonColor,
|
|
77
|
+
opacity: 1,
|
|
78
|
+
paddingLeft: '16px',
|
|
79
|
+
paddingRight: '16px',
|
|
80
|
+
paddingTop: '10px',
|
|
81
|
+
paddingBottom: '10px',
|
|
82
|
+
fontSize: '14px',
|
|
83
|
+
fontWeight: 600,
|
|
84
|
+
color: secondary ? theme?.primaryTextColor : '#FFFFFF',
|
|
85
|
+
cursor: 'pointer',
|
|
86
|
+
outline: 'none',
|
|
87
|
+
border: 'none',
|
|
88
|
+
fontFamily: theme?.fontFamily,
|
|
89
|
+
}, onClick: onClick, children: label }));
|
|
90
|
+
const QuillTextInput = ({ onChange, value, id, placeholder, theme, }) => {
|
|
91
|
+
return ((0, jsx_runtime_1.jsx)("input", { style: {
|
|
137
92
|
display: 'flex',
|
|
138
93
|
flexDirection: 'row',
|
|
139
94
|
alignItems: 'center',
|
|
@@ -143,173 +98,134 @@ var QuillTextInput = function (_a) {
|
|
|
143
98
|
height: 36,
|
|
144
99
|
boxShadow: 'rgba(0, 0, 0, 0.1) 0px 1px 5px 0px',
|
|
145
100
|
width: '445px',
|
|
146
|
-
backgroundColor:
|
|
147
|
-
color: theme
|
|
101
|
+
backgroundColor: theme?.backgroundColor || 'white',
|
|
102
|
+
color: theme?.primaryTextColor,
|
|
148
103
|
borderWidth: '1px',
|
|
149
|
-
borderColor:
|
|
104
|
+
borderColor: theme?.borderColor || '#E7E7E7',
|
|
150
105
|
borderStyle: 'solid',
|
|
151
106
|
borderRadius: '6px',
|
|
152
107
|
}, id: id, onChange: onChange, value: value, placeholder: placeholder }));
|
|
153
108
|
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
publicKey = client.publicKey, environment = client.environment;
|
|
179
|
-
setSchemaLoading(true);
|
|
180
|
-
return [4 /*yield*/, axios.get("https://quill-344421.uc.r.appspot.com/schema2/".concat(publicKey, "/"), {
|
|
181
|
-
headers: {
|
|
182
|
-
Authorization: "Bearer ",
|
|
183
|
-
environment: environment || undefined,
|
|
184
|
-
},
|
|
185
|
-
})];
|
|
186
|
-
case 1:
|
|
187
|
-
response3 = _a.sent();
|
|
188
|
-
if (isSubscribed) {
|
|
189
|
-
setSchema(response3.data.tables);
|
|
190
|
-
setSchemaLoading(false);
|
|
191
|
-
}
|
|
192
|
-
return [2 /*return*/];
|
|
193
|
-
}
|
|
194
|
-
});
|
|
109
|
+
function QueryEditor({ containerStyle = { height: '100vh' }, ButtonComponent, SecondaryButtonComponent, TextInputComponent, TableComponent, AddToDashboardButton, LoadingComponent, }) {
|
|
110
|
+
const [sqlPrompt, setSqlPrompt] = (0, react_1.useState)('');
|
|
111
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
112
|
+
const [client] = (0, react_1.useContext)(Context_1.ClientContext);
|
|
113
|
+
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
114
|
+
const [query, setQuery] = (0, react_1.useState)('');
|
|
115
|
+
const [rows, setRows] = (0, react_1.useState)([]);
|
|
116
|
+
const [columns, setColumns] = (0, react_1.useState)([]);
|
|
117
|
+
const [fields, setFields] = (0, react_1.useState)([]);
|
|
118
|
+
const [schema, setSchema] = (0, react_1.useContext)(Context_1.SchemaContext);
|
|
119
|
+
const [errorMessage, setErrorMessage] = (0, react_1.useState)('');
|
|
120
|
+
const [sqlResponseLoading, setSqlResponseLoading] = (0, react_1.useState)(false);
|
|
121
|
+
const [sqlQueryLoading, setSqlQueryLoading] = (0, react_1.useState)(false);
|
|
122
|
+
const [schemaLoading, setSchemaLoading] = (0, react_1.useState)(false);
|
|
123
|
+
(0, react_1.useEffect)(() => {
|
|
124
|
+
let isSubscribed = true;
|
|
125
|
+
async function getSchema() {
|
|
126
|
+
const { publicKey, environment } = client;
|
|
127
|
+
setSchemaLoading(true);
|
|
128
|
+
const response3 = await axios_1.default.get(`https://quill-344421.uc.r.appspot.com/schema2/${publicKey}/`, {
|
|
129
|
+
headers: {
|
|
130
|
+
Authorization: `Bearer `,
|
|
131
|
+
environment: environment || undefined,
|
|
132
|
+
},
|
|
195
133
|
});
|
|
134
|
+
if (isSubscribed) {
|
|
135
|
+
setSchema(response3.data.tables);
|
|
136
|
+
setSchemaLoading(false);
|
|
137
|
+
}
|
|
196
138
|
}
|
|
197
139
|
if (isSubscribed) {
|
|
198
140
|
getSchema();
|
|
199
141
|
}
|
|
200
|
-
return
|
|
142
|
+
return () => {
|
|
201
143
|
isSubscribed = false;
|
|
202
144
|
};
|
|
203
145
|
}, []);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
headers: {
|
|
216
|
-
Authorization: "Bearer ",
|
|
217
|
-
environment: environment || undefined,
|
|
218
|
-
},
|
|
219
|
-
})];
|
|
220
|
-
case 1:
|
|
221
|
-
response = _a.sent();
|
|
222
|
-
setQuery(response.data.message);
|
|
223
|
-
setSqlResponseLoading(false);
|
|
224
|
-
return [2 /*return*/];
|
|
225
|
-
}
|
|
146
|
+
const handleRunSqlPrompt = async () => {
|
|
147
|
+
const { publicKey, environment } = client;
|
|
148
|
+
setSqlResponseLoading(true);
|
|
149
|
+
const response = await axios_1.default.post(`https://quill-344421.uc.r.appspot.com/quillai`, {
|
|
150
|
+
initialQuestion: sqlPrompt,
|
|
151
|
+
publicKey: publicKey,
|
|
152
|
+
}, {
|
|
153
|
+
headers: {
|
|
154
|
+
Authorization: `Bearer `,
|
|
155
|
+
environment: environment || undefined,
|
|
156
|
+
},
|
|
226
157
|
});
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
response = void 0;
|
|
238
|
-
setSqlQueryLoading(true);
|
|
239
|
-
if (!queryEndpoint) return [3 /*break*/, 3];
|
|
240
|
-
return [4 /*yield*/, axios.post(queryEndpoint, { metadata: { query: query, task: 'query' } }, { headers: queryHeaders, withCredentials: withCredentials })];
|
|
241
|
-
case 2:
|
|
242
|
-
response = _a.sent();
|
|
243
|
-
return [3 /*break*/, 5];
|
|
244
|
-
case 3: return [4 /*yield*/, axios.post("https://quill-344421.uc.r.appspot.com/dashquery", {
|
|
245
|
-
query: query,
|
|
246
|
-
}, {
|
|
247
|
-
params: {
|
|
248
|
-
orgId: customerId,
|
|
249
|
-
publicKey: publicKey,
|
|
250
|
-
},
|
|
251
|
-
headers: {
|
|
252
|
-
Authorization: "Bearer ",
|
|
253
|
-
environment: environment || undefined,
|
|
254
|
-
},
|
|
255
|
-
})];
|
|
256
|
-
case 4:
|
|
257
|
-
response = _a.sent();
|
|
258
|
-
_a.label = 5;
|
|
259
|
-
case 5:
|
|
260
|
-
if (response && response.data && response.data.errorMessage) {
|
|
261
|
-
setSqlQueryLoading(false);
|
|
262
|
-
setErrorMessage('Failed to run SQL query: ' + response.data.errorMessage);
|
|
263
|
-
setRows([]);
|
|
264
|
-
setColumns([]);
|
|
265
|
-
setFields([]);
|
|
266
|
-
return [2 /*return*/];
|
|
267
|
-
}
|
|
268
|
-
setSqlQueryLoading(false);
|
|
269
|
-
setErrorMessage('');
|
|
270
|
-
setRows(response.data.rows && response.data.rows.length
|
|
271
|
-
? response.data.rows
|
|
272
|
-
: []);
|
|
273
|
-
setColumns(response.data.fields.map(function (elem) { return convertPostgresColumn(elem); }));
|
|
274
|
-
setFields(response.data.fields);
|
|
275
|
-
return [3 /*break*/, 7];
|
|
276
|
-
case 6:
|
|
277
|
-
e_1 = _a.sent();
|
|
278
|
-
console.log('ERROR: ', e_1);
|
|
279
|
-
return [2 /*return*/];
|
|
280
|
-
case 7: return [2 /*return*/];
|
|
158
|
+
setQuery(response.data.message);
|
|
159
|
+
setSqlResponseLoading(false);
|
|
160
|
+
};
|
|
161
|
+
const handleRunQuery = async () => {
|
|
162
|
+
const { publicKey, customerId, environment, queryEndpoint, queryHeaders } = client;
|
|
163
|
+
try {
|
|
164
|
+
let response;
|
|
165
|
+
setSqlQueryLoading(true);
|
|
166
|
+
if (queryEndpoint) {
|
|
167
|
+
response = await axios_1.default.post(queryEndpoint, { metadata: { query, task: 'query' } }, { headers: queryHeaders });
|
|
281
168
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
169
|
+
else {
|
|
170
|
+
response = await axios_1.default.post(`https://quill-344421.uc.r.appspot.com/dashquery`, {
|
|
171
|
+
query,
|
|
172
|
+
}, {
|
|
173
|
+
params: {
|
|
174
|
+
orgId: customerId,
|
|
175
|
+
publicKey: publicKey,
|
|
176
|
+
},
|
|
177
|
+
headers: {
|
|
178
|
+
Authorization: `Bearer `,
|
|
179
|
+
environment: environment || undefined,
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
if (response && response.data && response.data.errorMessage) {
|
|
184
|
+
setSqlQueryLoading(false);
|
|
185
|
+
setErrorMessage('Failed to run SQL query: ' + response.data.errorMessage);
|
|
186
|
+
setRows([]);
|
|
187
|
+
setColumns([]);
|
|
188
|
+
setFields([]);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
setSqlQueryLoading(false);
|
|
192
|
+
setErrorMessage('');
|
|
193
|
+
setRows(response.data.rows && response.data.rows.length
|
|
194
|
+
? response.data.rows
|
|
195
|
+
: []);
|
|
196
|
+
setColumns(response.data.fields.map(elem => convertPostgresColumn(elem)));
|
|
197
|
+
setFields(response.data.fields);
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
console.log('ERROR: ', e);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
const handleAddToDashboard = () => {
|
|
285
205
|
setIsOpen(true);
|
|
286
206
|
};
|
|
287
207
|
/* all your useState and useContext calls and your useEffect hooks */
|
|
288
|
-
|
|
208
|
+
const downloadCSV = () => {
|
|
289
209
|
// report.rows
|
|
290
210
|
if (!rows.length) {
|
|
291
211
|
return;
|
|
292
212
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
213
|
+
const json = rows; // JSON data passed as a prop
|
|
214
|
+
const fields = Object.keys(json[0]); // Assumes all objects have same keys
|
|
215
|
+
const csvRows = [];
|
|
296
216
|
// Header row
|
|
297
217
|
csvRows.push(fields.join(','));
|
|
298
|
-
var _loop_1 = function (row) {
|
|
299
|
-
var values = fields.map(function (field) { return JSON.stringify(row[field] || ''); });
|
|
300
|
-
csvRows.push(values.join(','));
|
|
301
|
-
};
|
|
302
218
|
// Data rows
|
|
303
|
-
for (
|
|
304
|
-
|
|
305
|
-
|
|
219
|
+
for (const row of json) {
|
|
220
|
+
const values = fields.map(field => JSON.stringify(row[field] || ''));
|
|
221
|
+
csvRows.push(values.join(','));
|
|
306
222
|
}
|
|
307
223
|
// Create CSV string and create a 'blob' with it
|
|
308
|
-
|
|
309
|
-
|
|
224
|
+
const csvString = csvRows.join('\r\n');
|
|
225
|
+
const csvBlob = new Blob([csvString], { type: 'text/csv' });
|
|
310
226
|
// Create a download link and click it
|
|
311
|
-
|
|
312
|
-
downloadLink.download =
|
|
227
|
+
const downloadLink = document.createElement('a');
|
|
228
|
+
downloadLink.download = `${query}.csv`;
|
|
313
229
|
downloadLink.href = URL.createObjectURL(csvBlob);
|
|
314
230
|
downloadLink.style.display = 'none';
|
|
315
231
|
document.body.appendChild(downloadLink);
|
|
@@ -317,28 +233,28 @@ export default function QueryEditor(_a) {
|
|
|
317
233
|
document.body.removeChild(downloadLink);
|
|
318
234
|
};
|
|
319
235
|
/* rest of your methods */
|
|
320
|
-
return (
|
|
236
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: containerStyle, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
321
237
|
height: 'calc(100%)',
|
|
322
238
|
display: 'flex',
|
|
323
239
|
flexDirection: 'column',
|
|
324
240
|
padding: 0,
|
|
325
|
-
}
|
|
241
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: { height: '100%', display: 'flex', flexDirection: 'column' }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
326
242
|
width: '100%',
|
|
327
243
|
display: 'flex',
|
|
328
244
|
height: '100%',
|
|
329
245
|
flexDirection: 'row',
|
|
330
|
-
}
|
|
246
|
+
}, children: [(0, jsx_runtime_1.jsx)(SchemaListComponent, { schema: schema, theme: theme, LoadingComponent: LoadingComponent, loading: schemaLoading }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
331
247
|
display: 'flex',
|
|
332
248
|
flexDirection: 'column',
|
|
333
249
|
width: 'calc(100% - 250px)',
|
|
334
|
-
}
|
|
250
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
335
251
|
// TODO: change color
|
|
336
252
|
height: 80,
|
|
337
253
|
background: 'white',
|
|
338
254
|
display: 'flex',
|
|
339
255
|
flexDirection: 'row',
|
|
340
256
|
alignItems: 'center',
|
|
341
|
-
}
|
|
257
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { minWidth: 440, marginRight: 10 }, children: (TextInputComponent && ((0, jsx_runtime_1.jsx)(TextInputComponent, { id: "ai-search", value: sqlPrompt, onChange: e => setSqlPrompt(e.target.value), placeholder: "Ask a question..." }))) || ((0, jsx_runtime_1.jsx)(QuillTextInput, { id: "ai-search", value: sqlPrompt, onChange: e => setSqlPrompt(e.target.value), placeholder: "Ask a question...", theme: theme })) }), (ButtonComponent && ((0, jsx_runtime_1.jsx)(ButtonComponent, { onClick: handleRunSqlPrompt, label: "Ask AI" }))) || ((0, jsx_runtime_1.jsx)(QuillButton, { theme: theme, onClick: handleRunSqlPrompt, label: "Ask AI" }))] }), (0, jsx_runtime_1.jsx)("div", { style: { height: 'calc(50% - 40px)' }, children: (0, jsx_runtime_1.jsx)(SQLEditorComponent, { query: query, setQuery: setQuery, handleRunQuery: handleRunQuery, theme: theme, defineEditorTheme: defineEditorTheme, setEditorTheme: setEditorTheme, ButtonComponent: ButtonComponent, loading: sqlResponseLoading, LoadingComponent: LoadingComponent }) }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
342
258
|
height: 'calc(50% - 40px)',
|
|
343
259
|
display: 'flex',
|
|
344
260
|
flexDirection: 'column',
|
|
@@ -346,52 +262,52 @@ export default function QueryEditor(_a) {
|
|
|
346
262
|
margin: 0,
|
|
347
263
|
border: 'none',
|
|
348
264
|
outline: 'none',
|
|
349
|
-
}
|
|
350
|
-
fontFamily: theme
|
|
351
|
-
color: theme
|
|
265
|
+
}, children: [errorMessage && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
266
|
+
fontFamily: theme?.fontFamily,
|
|
267
|
+
color: theme?.primaryTextColor,
|
|
352
268
|
fontSize: 15,
|
|
353
269
|
fontWeight: '400',
|
|
354
|
-
}
|
|
270
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
355
271
|
padding: 30,
|
|
356
272
|
// TODO: change color
|
|
357
273
|
background: 'rgba(0,0,0,0.02)',
|
|
358
274
|
display: 'inline-block',
|
|
359
275
|
flex: 0,
|
|
360
276
|
borderRadius: 6,
|
|
361
|
-
color: theme
|
|
362
|
-
fontFamily: theme
|
|
363
|
-
}
|
|
277
|
+
color: theme?.primaryTextColor,
|
|
278
|
+
fontFamily: theme?.fontFamily,
|
|
279
|
+
}, children: errorMessage }) })), errorMessage
|
|
364
280
|
? null
|
|
365
|
-
: (TableComponent && (
|
|
281
|
+
: (TableComponent && ((0, jsx_runtime_1.jsx)(TableComponent, { rows: rows, columns: columns, height: "calc(100% - 70px)" }))) || ((0, jsx_runtime_1.jsx)(Table_1.SpecialTable, { rows: rows, columns: columns, height: "calc(100% - 70px)", LoadingComponent: LoadingComponent, loading: sqlQueryLoading, theme: theme })), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
366
282
|
height: 70,
|
|
367
283
|
// TODO: change color
|
|
368
|
-
background: theme
|
|
369
|
-
}
|
|
284
|
+
background: theme?.backgroundColor,
|
|
285
|
+
}, children: rows.length ? ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
370
286
|
display: 'flex',
|
|
371
287
|
flexDirection: 'column',
|
|
372
288
|
height: 70,
|
|
373
289
|
border: 'none',
|
|
374
|
-
}
|
|
290
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
375
291
|
height: 1,
|
|
376
292
|
width: '100%',
|
|
377
293
|
// TODO: change color
|
|
378
294
|
// background: theme.borderColor,
|
|
379
|
-
} }),
|
|
295
|
+
} }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
380
296
|
marginLeft: 0,
|
|
381
297
|
height: 69,
|
|
382
298
|
display: 'flex',
|
|
383
299
|
alignItems: 'center',
|
|
384
300
|
justifyContent: 'flex-end',
|
|
385
301
|
paddingRight: 20,
|
|
386
|
-
}
|
|
302
|
+
}, children: [(SecondaryButtonComponent && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { onClick: downloadCSV, label: "Download CSV" }))) || ((0, jsx_runtime_1.jsx)(QuillButton, { theme: theme, onClick: downloadCSV, label: "Download CSV", secondary: true })), AddToDashboardButton && (0, jsx_runtime_1.jsx)("div", { style: { width: 10 } }), AddToDashboardButton && ((0, jsx_runtime_1.jsx)(AddToDashboardButton
|
|
387
303
|
// @ts-ignore
|
|
388
304
|
, {
|
|
389
305
|
// @ts-ignore
|
|
390
|
-
rows: rows, columns: columns, query: query })),
|
|
306
|
+
rows: rows, columns: columns, query: query })), (0, jsx_runtime_1.jsx)("div", {})] })] })) : null })] })] })] }) }) }) }));
|
|
391
307
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
return (
|
|
308
|
+
exports.default = QueryEditor;
|
|
309
|
+
const SQLEditorComponent = ({ query, setQuery, handleRunQuery, defineEditorTheme, setEditorTheme, ButtonComponent, theme, loading, LoadingComponent, }) => {
|
|
310
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
395
311
|
background: theme.backgroundColor,
|
|
396
312
|
// maxHeight: 700,
|
|
397
313
|
width: '100%',
|
|
@@ -405,27 +321,27 @@ var SQLEditorComponent = function (_a) {
|
|
|
405
321
|
borderTopRightRadius: 0,
|
|
406
322
|
borderBottomRightRadius: 0,
|
|
407
323
|
overflow: 'hidden',
|
|
408
|
-
}
|
|
324
|
+
}, children: [loading ? ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
409
325
|
height: 'calc(100% - 70px)',
|
|
410
326
|
width: '100%',
|
|
411
327
|
display: 'flex',
|
|
412
328
|
alignItems: 'center',
|
|
413
329
|
justifyContent: 'center',
|
|
414
330
|
background: '#F9F9F9',
|
|
415
|
-
}
|
|
331
|
+
}, children: [LoadingComponent && (0, jsx_runtime_1.jsx)(LoadingComponent, {}), !LoadingComponent && ((0, jsx_runtime_1.jsxs)("svg", { width: "24", height: "24", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsxs)("defs", { children: [(0, jsx_runtime_1.jsxs)("linearGradient", { id: "circleGradient", gradientUnits: "objectBoundingBox", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0%", "stop-color": "#F9F9FA" }), (0, jsx_runtime_1.jsx)("stop", { offset: "5%", "stop-color": "#F9F9FA" }), (0, jsx_runtime_1.jsx)("stop", { offset: "100%", "stop-color": "#D1D1D1" })] }), (0, jsx_runtime_1.jsxs)("mask", { id: "mask", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "12", fill: "white" }), (0, jsx_runtime_1.jsx)("path", { id: "sector", fill: "black", d: "M15,15 L15,1.8 A13.2,13.2 0 0,1 15,1.8 Z", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", from: "M15,15 L15,1.8 A13.2,13.2 0 0,0 15,1.8 Z", to: "M15,15 L15,1.8 A13.2,13.2 0 1,1 15,1.8 Z", dur: "2s", repeatCount: "indefinite" }) })] })] }), (0, jsx_runtime_1.jsxs)("g", { transform: "rotate(0 15 15)", children: [(0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "0 12 12", to: "360 12 12", dur: "2s", repeatCount: "indefinite" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "12", fill: "none", stroke: "url(#circleGradient)", "stroke-width": "8", mask: "url(#mask)" })] })] }))] })) : ((0, jsx_runtime_1.jsx)(react_2.default, { height: "calc(100% - 70px)", width: "100%", defaultLanguage: "pgsql", defaultValue: "", value: query, loading: (0, jsx_runtime_1.jsx)("div", {}), options: {
|
|
416
332
|
wordWrap: 'on',
|
|
417
333
|
minimap: {
|
|
418
334
|
enabled: false,
|
|
419
335
|
},
|
|
420
336
|
padding: { top: 16 },
|
|
421
|
-
}, onChange:
|
|
337
|
+
}, onChange: query => setQuery(query), beforeMount: monaco => defineEditorTheme(monaco, theme), onMount: setEditorTheme })), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
422
338
|
display: 'flex',
|
|
423
339
|
flexDirection: 'row',
|
|
424
340
|
alignItems: 'center',
|
|
425
341
|
height: 70,
|
|
426
|
-
}
|
|
342
|
+
}, children: (ButtonComponent && ((0, jsx_runtime_1.jsx)(ButtonComponent, { onClick: handleRunQuery, label: "Run query" }))) || ((0, jsx_runtime_1.jsx)(QuillButton, { onClick: handleRunQuery, label: "Run query", theme: theme })) })] }));
|
|
427
343
|
};
|
|
428
|
-
|
|
344
|
+
const styles = {
|
|
429
345
|
columnHeader: {
|
|
430
346
|
boxSizing: 'border-box',
|
|
431
347
|
flex: '150 0 auto',
|
|
@@ -457,10 +373,9 @@ var styles = {
|
|
|
457
373
|
overflow: 'hidden',
|
|
458
374
|
},
|
|
459
375
|
};
|
|
460
|
-
|
|
461
|
-
var schema = _a.schema, theme = _a.theme, loading = _a.loading, LoadingComponent = _a.LoadingComponent;
|
|
376
|
+
const SchemaListComponent = ({ schema, theme, loading, LoadingComponent }) => {
|
|
462
377
|
if (loading) {
|
|
463
|
-
return (
|
|
378
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
464
379
|
background: theme.backgroundColor,
|
|
465
380
|
// maxHeight: 700,
|
|
466
381
|
width: 250,
|
|
@@ -474,9 +389,9 @@ var SchemaListComponent = function (_a) {
|
|
|
474
389
|
display: 'flex',
|
|
475
390
|
// alignItems: 'center',
|
|
476
391
|
justifyContent: 'center',
|
|
477
|
-
}
|
|
392
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { height: 100 } }), LoadingComponent && (0, jsx_runtime_1.jsx)(LoadingComponent, {}), !LoadingComponent && ((0, jsx_runtime_1.jsxs)("svg", { width: "24", height: "24", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsxs)("defs", { children: [(0, jsx_runtime_1.jsxs)("linearGradient", { id: "circleGradient", gradientUnits: "objectBoundingBox", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0%", "stop-color": "#F9F9FA" }), (0, jsx_runtime_1.jsx)("stop", { offset: "5%", "stop-color": "#F9F9FA" }), (0, jsx_runtime_1.jsx)("stop", { offset: "100%", "stop-color": "#D1D1D1" })] }), (0, jsx_runtime_1.jsxs)("mask", { id: "mask", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "12", fill: "white" }), (0, jsx_runtime_1.jsx)("path", { id: "sector", fill: "black", d: "M15,15 L15,1.8 A13.2,13.2 0 0,1 15,1.8 Z", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", from: "M15,15 L15,1.8 A13.2,13.2 0 0,0 15,1.8 Z", to: "M15,15 L15,1.8 A13.2,13.2 0 1,1 15,1.8 Z", dur: "2s", repeatCount: "indefinite" }) })] })] }), (0, jsx_runtime_1.jsxs)("g", { transform: "rotate(0 15 15)", children: [(0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "0 12 12", to: "360 12 12", dur: "2s", repeatCount: "indefinite" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "12", fill: "none", stroke: "url(#circleGradient)", "stroke-width": "8", mask: "url(#mask)" })] })] }))] }));
|
|
478
393
|
}
|
|
479
|
-
return (
|
|
394
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
480
395
|
background: theme.backgroundColor,
|
|
481
396
|
// maxHeight: 700,
|
|
482
397
|
width: 250,
|
|
@@ -486,12 +401,11 @@ var SchemaListComponent = function (_a) {
|
|
|
486
401
|
// maxHeight: "100%",
|
|
487
402
|
paddingLeft: 20,
|
|
488
403
|
paddingRight: 30,
|
|
489
|
-
}
|
|
404
|
+
}, children: schema.map((elem, index) => ((0, jsx_runtime_1.jsx)(SchemaItem, { elem: elem, theme: theme, index: index }, elem.displayName + index))) }));
|
|
490
405
|
};
|
|
491
|
-
function SchemaItem(
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
var schemaContainerStyle = {
|
|
406
|
+
function SchemaItem({ elem, theme, index }) {
|
|
407
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)(index === 0);
|
|
408
|
+
const schemaContainerStyle = {
|
|
495
409
|
display: 'flex',
|
|
496
410
|
flexDirection: 'column',
|
|
497
411
|
// WebkitTouchCallout: "none",
|
|
@@ -501,7 +415,7 @@ function SchemaItem(_a) {
|
|
|
501
415
|
// msUserSelect: "none",
|
|
502
416
|
// userSelect: "none",
|
|
503
417
|
};
|
|
504
|
-
|
|
418
|
+
const schemaRowStyle = {
|
|
505
419
|
display: 'flex',
|
|
506
420
|
flexDirection: 'row',
|
|
507
421
|
alignItems: 'center',
|
|
@@ -509,10 +423,10 @@ function SchemaItem(_a) {
|
|
|
509
423
|
justifyContent: 'space-between',
|
|
510
424
|
cursor: 'pointer',
|
|
511
425
|
};
|
|
512
|
-
|
|
426
|
+
const schemaRowHoverStyle = {
|
|
513
427
|
background: theme.selectUnderlayColor,
|
|
514
428
|
};
|
|
515
|
-
return (
|
|
429
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: schemaContainerStyle, children: [(0, jsx_runtime_1.jsxs)("div", { style: { ...schemaRowStyle, ...(isOpen && schemaRowHoverStyle) }, onClick: () => setIsOpen(!isOpen), children: [(0, jsx_runtime_1.jsx)("p", { style: {
|
|
516
430
|
marginLeft: theme.padding,
|
|
517
431
|
fontSize: 13,
|
|
518
432
|
color: '#384151',
|
|
@@ -522,8 +436,8 @@ function SchemaItem(_a) {
|
|
|
522
436
|
margin: 0,
|
|
523
437
|
textOverflow: 'ellipsis',
|
|
524
438
|
overflow: 'hidden',
|
|
525
|
-
fontFamily: theme
|
|
526
|
-
}, title: elem.displayName
|
|
439
|
+
fontFamily: theme?.fontFamily,
|
|
440
|
+
}, title: elem.displayName, children: elem.displayName }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
527
441
|
display: 'flex',
|
|
528
442
|
alignItems: 'center',
|
|
529
443
|
justifyContent: 'center',
|
|
@@ -532,19 +446,19 @@ function SchemaItem(_a) {
|
|
|
532
446
|
paddingBottom: 12,
|
|
533
447
|
paddingLeft: 0,
|
|
534
448
|
cursor: 'pointer',
|
|
535
|
-
}
|
|
449
|
+
}, children: isOpen ? ((0, jsx_runtime_1.jsx)(solid_1.ChevronDownIcon, { style: { height: 13, width: 13, color: theme.secondaryTextColor }, "aria-hidden": "true" })) : ((0, jsx_runtime_1.jsx)(solid_1.ChevronRightIcon, { style: { height: 13, width: 13, color: theme.secondaryTextColor }, "aria-hidden": "true" })) })] }), isOpen ? ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
536
450
|
paddingBottom: theme.padding,
|
|
537
451
|
display: 'flex',
|
|
538
452
|
flexDirection: 'column',
|
|
539
453
|
paddingLeft: theme.padding,
|
|
540
454
|
paddingRight: theme.padding,
|
|
541
|
-
}
|
|
455
|
+
}, children: elem.columns.map((elem, index) => ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
542
456
|
paddingTop: theme.padding,
|
|
543
457
|
display: 'flex',
|
|
544
458
|
flexDirection: 'row',
|
|
545
459
|
alignItems: 'center',
|
|
546
460
|
justifyContent: 'space-between',
|
|
547
|
-
}
|
|
461
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { title: elem.displayName,
|
|
548
462
|
// className="text-gray-500"
|
|
549
463
|
style: {
|
|
550
464
|
fontSize: 12,
|
|
@@ -558,8 +472,8 @@ function SchemaItem(_a) {
|
|
|
558
472
|
overflow: 'hidden',
|
|
559
473
|
width: 200,
|
|
560
474
|
maxWidth: 200,
|
|
561
|
-
fontFamily: theme
|
|
562
|
-
}
|
|
475
|
+
fontFamily: theme?.fontFamily,
|
|
476
|
+
}, children: elem.displayName }), (0, jsx_runtime_1.jsx)("div", {
|
|
563
477
|
// className="text-gray-500"
|
|
564
478
|
title: elem.displayName, style: {
|
|
565
479
|
fontSize: 12,
|
|
@@ -567,7 +481,7 @@ function SchemaItem(_a) {
|
|
|
567
481
|
color: theme.secondaryTextColor,
|
|
568
482
|
padding: 0,
|
|
569
483
|
margin: 0,
|
|
570
|
-
fontFamily: theme
|
|
571
|
-
}
|
|
484
|
+
fontFamily: theme?.fontFamily,
|
|
485
|
+
}, children: elem.fieldType })] }, elem.displayName + elem.index))) })) : null] }));
|
|
572
486
|
}
|
|
573
487
|
//# sourceMappingURL=SQLEditor.js.map
|