@quillsql/react 2.11.9 → 2.11.13
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/BarList.d.ts +2 -1
- package/dist/cjs/BarList.d.ts.map +1 -1
- package/dist/cjs/BarList.js +9 -3
- package/dist/cjs/Chart.d.ts +11 -5
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +57 -20
- package/dist/cjs/ChartBuilder.d.ts +16 -1
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +423 -281
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +1 -0
- package/dist/cjs/Dashboard.d.ts +2 -1
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +6 -20
- package/dist/cjs/PieChart.d.ts.map +1 -1
- package/dist/cjs/PieChart.js +2 -1
- package/dist/cjs/QuillProvider.d.ts.map +1 -1
- package/dist/cjs/QuillProvider.js +15 -1
- package/dist/cjs/ReportBuilder.d.ts +4 -3
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +238 -108
- package/dist/cjs/SQLEditor.d.ts +2 -1
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +61 -90
- package/dist/cjs/components/Chart/BarChart.d.ts +2 -1
- package/dist/cjs/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.js +10 -3
- package/dist/cjs/components/Chart/ChartTooltipFrame.d.ts.map +1 -1
- package/dist/cjs/components/Chart/ChartTooltipFrame.js +1 -0
- package/dist/cjs/components/Chart/LineChart.d.ts +3 -4
- package/dist/cjs/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/LineChart.js +35 -15
- package/dist/cjs/components/Dashboard/ChartComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/ChartComponent.js +0 -3
- package/dist/cjs/components/Dashboard/DashboardSection.js +4 -4
- package/dist/cjs/components/Dashboard/DashboardSectionContainer.js +1 -1
- package/dist/cjs/components/Dashboard/DataLoader.d.ts +8 -1
- package/dist/cjs/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DataLoader.js +12 -3
- package/dist/cjs/components/Dashboard/MetricComponent.d.ts +12 -1
- package/dist/cjs/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/MetricComponent.js +105 -9
- package/dist/cjs/components/Dashboard/TableComponent.d.ts +1 -1
- package/dist/cjs/components/Dashboard/TableComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/TableComponent.js +78 -3
- package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelect.js +7 -1
- package/dist/cjs/components/QuillTable.d.ts.map +1 -1
- package/dist/cjs/components/QuillTable.js +3 -1
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.js +3 -3
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts +3 -0
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -0
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.js +43 -0
- package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddSortPopover.js +14 -7
- package/dist/cjs/components/ReportBuilder/ast.d.ts +4 -0
- package/dist/cjs/components/ReportBuilder/ast.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ast.js +10 -1
- package/dist/cjs/components/ReportBuilder/bigDateMap.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/bigDateMap.js +2 -1
- package/dist/cjs/components/ReportBuilder/convert.d.ts +4 -1
- package/dist/cjs/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/convert.js +45 -13
- package/dist/cjs/components/ReportBuilder/pivot.d.ts +3 -0
- package/dist/cjs/components/ReportBuilder/pivot.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +7 -5
- package/dist/cjs/components/ReportBuilder/util.d.ts +1 -0
- package/dist/cjs/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/util.js +55 -6
- package/dist/cjs/components/UiComponents.d.ts +3 -1
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +4 -4
- package/dist/cjs/hooks/useQuill.js +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +2 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +91 -91
- package/dist/cjs/utils/axisFormatter.js +74 -30
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +10 -0
- package/dist/cjs/utils/getDomain.js +25 -4
- package/dist/cjs/utils/valueFormatter.d.ts +2 -1
- package/dist/cjs/utils/valueFormatter.d.ts.map +1 -1
- package/dist/esm/BarList.d.ts +2 -1
- package/dist/esm/BarList.d.ts.map +1 -1
- package/dist/esm/BarList.js +9 -3
- package/dist/esm/Chart.d.ts +11 -5
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +57 -20
- package/dist/esm/ChartBuilder.d.ts +16 -1
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +421 -280
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +1 -0
- package/dist/esm/Dashboard.d.ts +2 -1
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +6 -20
- package/dist/esm/PieChart.d.ts.map +1 -1
- package/dist/esm/PieChart.js +2 -1
- package/dist/esm/QuillProvider.d.ts.map +1 -1
- package/dist/esm/QuillProvider.js +16 -2
- package/dist/esm/ReportBuilder.d.ts +4 -3
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +242 -112
- package/dist/esm/SQLEditor.d.ts +2 -1
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +62 -91
- package/dist/esm/components/Chart/BarChart.d.ts +2 -1
- package/dist/esm/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.js +10 -3
- package/dist/esm/components/Chart/ChartTooltipFrame.d.ts.map +1 -1
- package/dist/esm/components/Chart/ChartTooltipFrame.js +1 -0
- package/dist/esm/components/Chart/LineChart.d.ts +3 -4
- package/dist/esm/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/LineChart.js +35 -15
- package/dist/esm/components/Dashboard/ChartComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/ChartComponent.js +0 -3
- package/dist/esm/components/Dashboard/DashboardSection.js +4 -4
- package/dist/esm/components/Dashboard/DashboardSectionContainer.js +1 -1
- package/dist/esm/components/Dashboard/DataLoader.d.ts +8 -1
- package/dist/esm/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DataLoader.js +13 -4
- package/dist/esm/components/Dashboard/MetricComponent.d.ts +12 -1
- package/dist/esm/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/MetricComponent.js +101 -8
- package/dist/esm/components/Dashboard/TableComponent.d.ts +1 -1
- package/dist/esm/components/Dashboard/TableComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/TableComponent.js +74 -2
- package/dist/esm/components/QuillSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillSelect.js +7 -1
- package/dist/esm/components/QuillTable.d.ts.map +1 -1
- package/dist/esm/components/QuillTable.js +3 -1
- package/dist/esm/components/ReportBuilder/AddColumnPopover.js +3 -3
- package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts +3 -0
- package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -0
- package/dist/esm/components/ReportBuilder/AddLimitPopover.js +38 -0
- package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddSortPopover.js +15 -8
- package/dist/esm/components/ReportBuilder/ast.d.ts +4 -0
- package/dist/esm/components/ReportBuilder/ast.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ast.js +8 -0
- package/dist/esm/components/ReportBuilder/bigDateMap.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/bigDateMap.js +2 -1
- package/dist/esm/components/ReportBuilder/convert.d.ts +4 -1
- package/dist/esm/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/convert.js +45 -13
- package/dist/esm/components/ReportBuilder/pivot.d.ts +3 -0
- package/dist/esm/components/ReportBuilder/pivot.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +7 -5
- package/dist/esm/components/ReportBuilder/util.d.ts +1 -0
- package/dist/esm/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/util.js +53 -5
- package/dist/esm/components/UiComponents.d.ts +3 -1
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +4 -4
- package/dist/esm/hooks/useQuill.js +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +2 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +91 -91
- package/dist/esm/utils/axisFormatter.js +74 -30
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +10 -0
- package/dist/esm/utils/getDomain.js +25 -4
- package/dist/esm/utils/valueFormatter.d.ts +2 -1
- package/dist/esm/utils/valueFormatter.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -173,9 +173,10 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
173
173
|
else if (column.expr?.args?.expr) {
|
|
174
174
|
columnName = column.expr?.args?.expr?.value;
|
|
175
175
|
}
|
|
176
|
-
if (column.expr.type === 'aggr_func') {
|
|
176
|
+
if (column.expr.type === 'aggr_func' && !isIdColumn(columnName)) {
|
|
177
177
|
pivot.aggregationType = column.expr.name.toLowerCase();
|
|
178
|
-
pivot.valueField =
|
|
178
|
+
pivot.valueField =
|
|
179
|
+
column.expr.args?.expr?.value || column.expr.args?.expr?.column;
|
|
179
180
|
if (column.expr.args.expr.type === 'column_ref') {
|
|
180
181
|
columnTable = column.expr.args.expr.table;
|
|
181
182
|
columnName = column.expr.args.expr.column;
|
|
@@ -200,7 +201,7 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
200
201
|
table: columnTable,
|
|
201
202
|
column: columnName,
|
|
202
203
|
},
|
|
203
|
-
as:
|
|
204
|
+
as: columnName,
|
|
204
205
|
});
|
|
205
206
|
}
|
|
206
207
|
newAst = { ...ast };
|
|
@@ -220,8 +221,10 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
220
221
|
// The result of the CASE is the column to use
|
|
221
222
|
const columnNode = column.expr?.args?.expr?.args[0]?.result;
|
|
222
223
|
const columnName = columnNode?.value ?? columnNode?.column;
|
|
223
|
-
|
|
224
|
-
|
|
224
|
+
if (!isIdColumn(columnName)) {
|
|
225
|
+
pivot.valueField = columnName;
|
|
226
|
+
pivot.aggregationType = column?.expr?.name?.toLowerCase();
|
|
227
|
+
}
|
|
225
228
|
const findByName = (x) => [x.expr?.value, x.expr?.column].includes(columnName);
|
|
226
229
|
if (!newColumns.find(findByName)) {
|
|
227
230
|
newColumns.push({
|
|
@@ -238,7 +241,9 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
238
241
|
// the CASE and we'll use that as the columnField in our pivot.
|
|
239
242
|
const condNode = column.expr?.args?.expr?.args[0]?.cond;
|
|
240
243
|
const condColumnName = condNode.left?.column ?? condNode.left?.value;
|
|
241
|
-
|
|
244
|
+
if (!isIdColumn(condColumnName)) {
|
|
245
|
+
pivot.columnField = condColumnName;
|
|
246
|
+
}
|
|
242
247
|
const findByColName = (x) => [x.expr?.value, x.expr?.column].includes(condColumnName);
|
|
243
248
|
if (!newColumns.find(findByColName)) {
|
|
244
249
|
// Make sure the column we extracted is in our column list.
|
|
@@ -261,7 +266,6 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
261
266
|
column.expr?.args?.expr?.type === 'column_ref' ||
|
|
262
267
|
// count(*)
|
|
263
268
|
column.expr?.args?.expr?.type === 'star') {
|
|
264
|
-
console.log(column);
|
|
265
269
|
const columnNode = column.expr?.args?.expr;
|
|
266
270
|
const columnName = columnNode?.value || columnNode?.column;
|
|
267
271
|
// if count(*), make the value field an actual column
|
|
@@ -284,7 +288,8 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
284
288
|
}
|
|
285
289
|
else {
|
|
286
290
|
// ONLY SET VALUE FIELD IF THE FIELD TYPE IS A NUMBER
|
|
287
|
-
if (isNumericColumnType(field?.fieldType)
|
|
291
|
+
if (isNumericColumnType(field?.fieldType) &&
|
|
292
|
+
!isIdColumn(columnName)) {
|
|
288
293
|
pivot.valueField = columnName;
|
|
289
294
|
pivot.aggregationType = column?.expr?.name.toLowerCase();
|
|
290
295
|
}
|
|
@@ -415,11 +420,15 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
415
420
|
const extractGroup = ast.groupby.find(isExtract);
|
|
416
421
|
if (dateTruncGroup) {
|
|
417
422
|
const column = dateTruncGroup.args?.value.find(isCol);
|
|
418
|
-
|
|
423
|
+
const columnName = extractColumnish(column);
|
|
424
|
+
pivot.rowField = columnName;
|
|
425
|
+
pivot.rowFieldType = columns.find((c) => c.field === columnName)?.fieldType;
|
|
419
426
|
}
|
|
420
427
|
else if (extractGroup) {
|
|
421
428
|
const column = extractGroup.args?.source;
|
|
422
|
-
|
|
429
|
+
const columnName = extractColumnish(column);
|
|
430
|
+
pivot.rowField = columnName;
|
|
431
|
+
pivot.rowFieldType = columns.find((c) => c.field === columnName)?.fieldType;
|
|
423
432
|
}
|
|
424
433
|
else if (aliasMap) {
|
|
425
434
|
const match = ast.groupby.find(isAlias);
|
|
@@ -427,6 +436,7 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
427
436
|
if (matchColumnish) {
|
|
428
437
|
const actualColumnName = aliasMap[matchColumnish];
|
|
429
438
|
pivot.rowField = actualColumnName;
|
|
439
|
+
pivot.rowFieldType = columns.find((c) => c.field === actualColumnName)?.fieldType;
|
|
430
440
|
}
|
|
431
441
|
}
|
|
432
442
|
// Otherwise, set the first groupby to rowField then set
|
|
@@ -434,6 +444,9 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
434
444
|
for (let j = 0; j < ast.groupby.length; j++) {
|
|
435
445
|
const group = ast.groupby[j];
|
|
436
446
|
let groupValue = extractColumnish(group);
|
|
447
|
+
if (!groupValue || isIdColumn(groupValue)) {
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
437
450
|
// check if this value is an alias, if so use concrete value
|
|
438
451
|
if (groupValue && aliasMap[groupValue]) {
|
|
439
452
|
groupValue = aliasMap[groupValue];
|
|
@@ -441,6 +454,7 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
441
454
|
// Try to set the rowField and columnField.
|
|
442
455
|
if (!pivot.rowField) {
|
|
443
456
|
pivot.rowField = groupValue;
|
|
457
|
+
pivot.rowFieldType = columns.find((c) => c.field === groupValue)?.fieldType;
|
|
444
458
|
}
|
|
445
459
|
else if (!pivot.columnField && groupValue !== pivot.rowField) {
|
|
446
460
|
pivot.columnField = groupValue;
|
|
@@ -465,10 +479,23 @@ export function convertGroupBy(ast, prevPivot = null, schemaTables) {
|
|
|
465
479
|
},
|
|
466
480
|
]
|
|
467
481
|
: null;
|
|
468
|
-
// If the AI didn't generate an aggregate, add one.
|
|
482
|
+
// If the AI didn't generate an aggregate, add one. DO NOT ADD ID FOR VALUE FIELD
|
|
469
483
|
if (!pivot.valueField) {
|
|
470
|
-
|
|
471
|
-
|
|
484
|
+
for (let i = 0; i < newAst.columns.length; i++) {
|
|
485
|
+
const columnName = newAst.columns[i].expr?.column ||
|
|
486
|
+
newAst.columns[i].expr?.value ||
|
|
487
|
+
undefined;
|
|
488
|
+
if (columnName &&
|
|
489
|
+
!isIdColumn(columnName) &&
|
|
490
|
+
isNumericColumnType(columns.find((c) => c.field === columnName)?.fieldType)) {
|
|
491
|
+
pivot.valueField = columnName;
|
|
492
|
+
pivot.aggregationType = 'sum';
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
if (pivot.rowFieldType === 'date') {
|
|
497
|
+
pivot.sort = true;
|
|
498
|
+
pivot.sortDirection = 'ASC';
|
|
472
499
|
}
|
|
473
500
|
return { pivot, ast: newAst };
|
|
474
501
|
}
|
|
@@ -718,3 +745,8 @@ export function convertRemoveSimpleParentheses(ast) {
|
|
|
718
745
|
}
|
|
719
746
|
return { ...ast, where: node };
|
|
720
747
|
}
|
|
748
|
+
function isIdColumn(columnName) {
|
|
749
|
+
return (columnName &&
|
|
750
|
+
(columnName.toLowerCase() === 'id' ||
|
|
751
|
+
columnName.toLowerCase().endsWith('_id')));
|
|
752
|
+
}
|
|
@@ -5,6 +5,9 @@ export type Pivot = {
|
|
|
5
5
|
aggregationType: 'sum' | 'average' | 'min' | 'max' | 'count';
|
|
6
6
|
valueField: string;
|
|
7
7
|
rowField?: string;
|
|
8
|
+
rowFieldType?: string;
|
|
8
9
|
columnField?: string;
|
|
10
|
+
sort: boolean;
|
|
11
|
+
sortDirection: 'ASC' | 'DESC';
|
|
9
12
|
} | null;
|
|
10
13
|
//# sourceMappingURL=pivot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pivot.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/pivot.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,eAAe,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"pivot.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/pivot.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,eAAe,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,KAAK,GAAG,MAAM,CAAC;CAC/B,GAAG,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/ui.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/ui.tsx"],"names":[],"mappings":";AAiBA;;;;;GAKG;AAEH,eAAO,MAAM,WAAW,2BAA4B,GAAG,4CA2BtD,CAAC;AAEF,eAAO,MAAM,oBAAoB,2BAA4B,GAAG,4CA2B/D,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,GAAG,4CAuBxC,CAAC;AAEF,eAAO,MAAM,uBAAuB,uCAKjC,GAAG,4CAiBL,CAAC;AAEF,eAAO,MAAM,QAAQ,sGAoEpB,CAAC;AAGF,eAAO,MAAM,mBAAmB,cAAe,GAAG,4CAEjD,CAAC;AAGF,eAAO,MAAM,sBAAsB,cAAe,GAAG,4CAEpD,CAAC;AAGF,eAAO,MAAM,YAAY,sGAiBxB,CAAC;AAGF,eAAO,MAAM,eAAe,sGAuB3B,CAAC;AAEF,eAAO,MAAM,WAAW,2BAA4B,GAAG,4CAUtD,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,QAAQ,EACR,KAAU,EACV,OAAO,EACP,MAAM,GACP,EAAE,GAAG,2CAgDL;AAED,eAAO,MAAM,YAAY,sGAkCxB,CAAC;AAGF,eAAO,MAAM,iBAAiB,+CAwE7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,gDAK3B,GAAG,4CA6CL,CAAC;AAGF,eAAO,MAAM,oBAAoB,kCAAmC,GAAG,4CAiDtE,CAAC;AAGF,eAAO,MAAM,uBAAuB,+CAMnC,CAAC;AAGF,eAAO,MAAM,sBAAsB,+CAMlC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;GAG/B,CAAC;AAEF,eAAO,MAAM,SAAS,sGAIrB,CAAC;AAEF,eAAO,MAAM,WAAW,8DAMrB,GAAG,4CAwBL,CAAC;AAEF,eAAO,MAAM,kBAAkB,4FAO5B,GAAG,4CAqBL,CAAC;AAEF,eAAO,MAAM,gBAAgB,sFAO1B,GAAG,4CAqBL,CAAC;AAEF,eAAO,MAAM,UAAU,sTAuBpB,GAAG,4CAqFL,CAAC;AAEF,eAAO,MAAM,gBAAgB,oDAK1B,GAAG,4CAeL,CAAC"}
|
|
@@ -5,6 +5,7 @@ import MemoizedQuillTable from '../QuillTable';
|
|
|
5
5
|
import { ThemeContext } from '../../Context';
|
|
6
6
|
import { isNodeEmptyCollection } from './util';
|
|
7
7
|
import { downloadCSV } from '../../utils/csv';
|
|
8
|
+
import { snakeCaseToTitleCase } from '../../utils/textProcessing';
|
|
8
9
|
/**
|
|
9
10
|
* This file is a collection of basic UI components that conform to the shape
|
|
10
11
|
* expected by the Report Builder. Where possible, we use our existing
|
|
@@ -106,11 +107,12 @@ export const QuillSidebarHeading = ({ label }) => (_jsx(MemoizedHeader, { childr
|
|
|
106
107
|
export const QuillSidebarSubHeading = ({ label }) => (_jsx(MemoizedLabel, { children: label }));
|
|
107
108
|
// The gray thing on the left.
|
|
108
109
|
export const QuillSidebar = forwardRef(({ children, ...props }, forwardedRef) => (_jsx("div", { style: {
|
|
109
|
-
|
|
110
|
+
overflowX: 'visible',
|
|
110
111
|
padding: '12px',
|
|
111
112
|
width: '25%',
|
|
112
113
|
height: '100%',
|
|
113
114
|
maxWidth: '300px',
|
|
115
|
+
boxSizing: 'border-box',
|
|
114
116
|
}, ref: forwardedRef, ...props, children: children })));
|
|
115
117
|
// A big wrapper around the main content (ie. Input, Button, and Table)
|
|
116
118
|
export const CustomContainer = forwardRef(({ children, ...props }, forwardedRef) => (_jsx("div", { style: {
|
|
@@ -125,6 +127,7 @@ export const CustomContainer = forwardRef(({ children, ...props }, forwardedRef)
|
|
|
125
127
|
flexGrow: 1,
|
|
126
128
|
width: '75%',
|
|
127
129
|
height: '100%',
|
|
130
|
+
boxSizing: 'border-box',
|
|
128
131
|
}, ref: forwardedRef, ...props, children: children })));
|
|
129
132
|
export const QuillSelect = ({ onChange, ...props }) => {
|
|
130
133
|
const handleOnChange = (value) => {
|
|
@@ -163,7 +166,6 @@ export function MemoizedPopover({ onClose, children, style = {}, trigger, isOpen
|
|
|
163
166
|
top: 12,
|
|
164
167
|
borderRadius: 6,
|
|
165
168
|
padding: 20,
|
|
166
|
-
overflow: 'auto',
|
|
167
169
|
...style,
|
|
168
170
|
}, children: children }) }))] }));
|
|
169
171
|
}
|
|
@@ -174,7 +176,7 @@ export const QuillPopover = forwardRef(({ children, trigger, isOpen, onClose = (
|
|
|
174
176
|
fontSize: 18,
|
|
175
177
|
margin: 0,
|
|
176
178
|
textAlign: 'left',
|
|
177
|
-
|
|
179
|
+
marginBottom: 5,
|
|
178
180
|
color: theme?.primaryTextColor,
|
|
179
181
|
fontFamily: theme?.fontFamily,
|
|
180
182
|
}, children: title })), children] }));
|
|
@@ -249,7 +251,7 @@ export const QuillSelectColumn = ({ label, selected, setSelected, children, }) =
|
|
|
249
251
|
overflow: 'hidden',
|
|
250
252
|
fontFamily: theme?.fontFamily,
|
|
251
253
|
color: theme?.primaryTextColor,
|
|
252
|
-
}, children: label })] })] }));
|
|
254
|
+
}, children: snakeCaseToTitleCase(label) })] })] }));
|
|
253
255
|
};
|
|
254
256
|
// A draggable card with a grab-handle and a column name
|
|
255
257
|
export const QuillDraggableColumn = ({ label, children, onDelete }) => {
|
|
@@ -279,7 +281,7 @@ export const QuillDraggableColumn = ({ label, children, onDelete }) => {
|
|
|
279
281
|
};
|
|
280
282
|
// Three dots animated bouncing
|
|
281
283
|
export const QuillButtonLoadingState = () => {
|
|
282
|
-
return _jsx(QuillButton, { children:
|
|
284
|
+
return (_jsx(QuillButton, { children: _jsx(LoadingSpinner, {}) }));
|
|
283
285
|
};
|
|
284
286
|
// Loading state for the table
|
|
285
287
|
export const QuillTableLoadingState = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/util.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,qBAAqB,SAAU,GAAG,YAW9C,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,WAa1C;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,WAK5C;AAGD,eAAO,MAAM,WAAW,SAAU,GAAG,YAuBpC,CAAC;AAKF,eAAO,MAAM,oBAAoB,SAAU,GAAG,QAE7C,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG;;;;;;;;EAU3C;AAKD,eAAO,MA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;GAEG;AACH,eAAO,MAAM,eAAe,SAAU,GAAG,YAOxC,CAAC;AAEF,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,WAehD;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,GAAG,GACV,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAyB1C;AAED,eAAO,MAAM,QAAQ,QAAS,GAAG,QAAoC,CAAC;AAEtE,eAAO,MAAM,QAAQ,MAAO,MAAM,WAA2C,CAAC;AA4L9E,eAAO,MAAM,iBAAiB,SAAU,GAAG;;;;;;;CAc1C,CAAC;AAqCF,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,OAQvE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// A collection of reusable, pure, utility functions for the Report Builder.
|
|
2
2
|
import { getQuarter } from 'date-fns';
|
|
3
3
|
import { DATE_DESCRIPTION_MAP } from './bigDateMap';
|
|
4
|
+
import { snakeCaseToTitleCase } from '../../utils/textProcessing';
|
|
4
5
|
/**
|
|
5
6
|
* A node that is "in" or "not in" where none of the variants are selected.
|
|
6
7
|
*/
|
|
@@ -120,7 +121,7 @@ export function formatDateComparisonNode(node) {
|
|
|
120
121
|
}
|
|
121
122
|
export function getInTheCurrentIntervalSentence(node, databaseType) {
|
|
122
123
|
if (databaseType === 'BigQuery') {
|
|
123
|
-
const dateColumn = node.left.args.value[0].column;
|
|
124
|
+
const dateColumn = snakeCaseToTitleCase(node.left.args.value[0].column);
|
|
124
125
|
const periodValue = node.left.args.value[1].column.toLowerCase();
|
|
125
126
|
return `${dateColumn} in the current ${periodValue}`;
|
|
126
127
|
}
|
|
@@ -133,7 +134,7 @@ const BIG_QUERY_DAY_TO_INTERVAL_MAP = {
|
|
|
133
134
|
};
|
|
134
135
|
export function getInTheLastIntervalSentence(node, databaseType) {
|
|
135
136
|
if (databaseType === 'BigQuery') {
|
|
136
|
-
const dateColumn = node.left.column;
|
|
137
|
+
const dateColumn = snakeCaseToTitleCase(node.left.column);
|
|
137
138
|
const amount = node.right.args.value[1].expr.value;
|
|
138
139
|
let unit = node.right.args.value[1].unit.toLowerCase();
|
|
139
140
|
if (unit.includes('*')) {
|
|
@@ -145,7 +146,7 @@ export function getInTheLastIntervalSentence(node, databaseType) {
|
|
|
145
146
|
}
|
|
146
147
|
export function getInThePreviousIntervalSentence(node, databaseType) {
|
|
147
148
|
if (databaseType === 'BigQuery') {
|
|
148
|
-
const dateColumn = node.left.args.value[0].column;
|
|
149
|
+
const dateColumn = snakeCaseToTitleCase(node.left.args.value[0].column);
|
|
149
150
|
const periodValue = node.left.args.value[1].column.toLowerCase();
|
|
150
151
|
return `${dateColumn} in the previous ${periodValue}`;
|
|
151
152
|
}
|
|
@@ -201,6 +202,7 @@ export const isTheCurrentInterval = (node, databaseType) => {
|
|
|
201
202
|
const isInsideOfDateTrunc = ['AND'].includes(node.operator) &&
|
|
202
203
|
(node.left.operator === '=' || node.left.type === 'double_quote_string') &&
|
|
203
204
|
node.right.operator === '=' &&
|
|
205
|
+
node.right.name &&
|
|
204
206
|
node.right.name.toLowerCase() === 'date_trunc' &&
|
|
205
207
|
node.args.value[0].type === 'single_quote_string' &&
|
|
206
208
|
node.args.value[1].type === 'binary_expr' &&
|
|
@@ -356,14 +358,14 @@ export function tryConvertDateEquality(node, databaseType) {
|
|
|
356
358
|
if (isDateTruncEquals(node)) {
|
|
357
359
|
const columnNode = node.left.args.value[1];
|
|
358
360
|
const columnName = columnNode.column ?? columnNode.value;
|
|
359
|
-
const cleanColumnName = columnName.replaceAll('_at', '');
|
|
361
|
+
const cleanColumnName = snakeCaseToTitleCase(columnName.replaceAll('_at', ''));
|
|
360
362
|
const prettyDateSuffix = dateTruncSuffixToString(node, databaseType);
|
|
361
363
|
return `${cleanColumnName} ${prettyDateSuffix}`;
|
|
362
364
|
}
|
|
363
365
|
else if (isExtractEquals(node)) {
|
|
364
366
|
const columnNode = node.left.args.source;
|
|
365
367
|
const columnName = columnNode.column ?? columnNode.value;
|
|
366
|
-
const cleanColumnName = columnName.replaceAll('_at', '');
|
|
368
|
+
const cleanColumnName = snakeCaseToTitleCase(columnName.replaceAll('_at', ''));
|
|
367
369
|
const prettyDateSuffix = extractSuffixToString(node);
|
|
368
370
|
return `${cleanColumnName} ${prettyDateSuffix}`;
|
|
369
371
|
}
|
|
@@ -614,3 +616,49 @@ export const getDateFilterInfo = (node) => {
|
|
|
614
616
|
intervalPaths,
|
|
615
617
|
};
|
|
616
618
|
};
|
|
619
|
+
// NEED TO UPDATE FOR MORE POTENTIAL CASES
|
|
620
|
+
function getNodeTable(node) {
|
|
621
|
+
if (node.table) {
|
|
622
|
+
return node.table;
|
|
623
|
+
}
|
|
624
|
+
if (node.args && node.args.value[0].table) {
|
|
625
|
+
return node.args.value[0].table;
|
|
626
|
+
}
|
|
627
|
+
return null;
|
|
628
|
+
}
|
|
629
|
+
// Recursively remove filters that don't apply to the given table
|
|
630
|
+
function removeNonSelectedTableFilters(node, table) {
|
|
631
|
+
if (node.left.type !== 'binary_expr') {
|
|
632
|
+
const referencedTable = getNodeTable(node.left);
|
|
633
|
+
if (referencedTable && referencedTable !== table) {
|
|
634
|
+
return null;
|
|
635
|
+
}
|
|
636
|
+
else {
|
|
637
|
+
return node;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
node.left = removeNonSelectedTableFilters(node.left, table);
|
|
641
|
+
node.right = removeNonSelectedTableFilters(node.right, table);
|
|
642
|
+
if (node.left && node.right) {
|
|
643
|
+
return node;
|
|
644
|
+
}
|
|
645
|
+
else if (node.left) {
|
|
646
|
+
return node.left;
|
|
647
|
+
}
|
|
648
|
+
else if (node.right) {
|
|
649
|
+
return node.right;
|
|
650
|
+
}
|
|
651
|
+
else {
|
|
652
|
+
return null;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
export function removeNonSelectedTableReferences(ast, table) {
|
|
656
|
+
ast.columns = ast.columns.filter((col) => {
|
|
657
|
+
return col.table === table || col.expr.table === table || !col.expr.table;
|
|
658
|
+
});
|
|
659
|
+
if (!ast.where)
|
|
660
|
+
return ast;
|
|
661
|
+
ast.where = removeNonSelectedTableFilters(ast.where, table);
|
|
662
|
+
console.log(ast);
|
|
663
|
+
return ast;
|
|
664
|
+
}
|
|
@@ -14,6 +14,7 @@ export interface SelectComponentProps {
|
|
|
14
14
|
export interface ButtonComponentProps {
|
|
15
15
|
onClick: () => void;
|
|
16
16
|
label: string;
|
|
17
|
+
isLoading?: boolean | undefined;
|
|
17
18
|
primary?: boolean;
|
|
18
19
|
width?: string;
|
|
19
20
|
}
|
|
@@ -67,10 +68,11 @@ export declare const MemoizedTextInput: ({ value, onChange, placeholder, id }: {
|
|
|
67
68
|
placeholder: any;
|
|
68
69
|
id: any;
|
|
69
70
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
70
|
-
export declare const MemoizedButton: ({ label, onClick, primary }: {
|
|
71
|
+
export declare const MemoizedButton: ({ label, onClick, primary, isLoading, }: {
|
|
71
72
|
label: any;
|
|
72
73
|
onClick: any;
|
|
73
74
|
primary?: boolean | undefined;
|
|
75
|
+
isLoading?: boolean | undefined;
|
|
74
76
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
75
77
|
export declare const MemoizedSecondaryButton: ({ label, onClick }: {
|
|
76
78
|
label: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiComponents.d.ts","sourceRoot":"","sources":["../../../src/components/UiComponents.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAA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,WAAkB,EAClB,MAAM,EACN,KAAK,EACL,SAAS,GACV,EAAE,oBAAoB,2CA2DtB;AAED,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAU,GACX;;;;;;;;CAAA,kDA4FA;AAED,eAAO,MAAM,oBAAoB;;;6CA0BhC,CAAC;AAEF,eAAO,MAAM,cAAc,+CAwD1B,CAAC"}
|
|
@@ -27,7 +27,7 @@ export const MemoizedTextInput = ({ value, onChange, placeholder, id }) => {
|
|
|
27
27
|
.quill-text-input {
|
|
28
28
|
background-color: white;
|
|
29
29
|
height: 40px;
|
|
30
|
-
width:
|
|
30
|
+
width: 100%;
|
|
31
31
|
color: #384151;
|
|
32
32
|
border: 1px solid #e7e7e7;
|
|
33
33
|
border-radius: 6px;
|
|
@@ -37,10 +37,10 @@ export const MemoizedTextInput = ({ value, onChange, placeholder, id }) => {
|
|
|
37
37
|
padding-right: 12px;
|
|
38
38
|
padding-top: 0px;
|
|
39
39
|
padding-bottom: 0px;
|
|
40
|
-
box-sizing:
|
|
40
|
+
box-sizing: border-box;
|
|
41
41
|
}` }), _jsx("input", { id: id, className: "quill-text-input", type: "text", value: value, onChange: (event) => onChange(event.target.value), placeholder: placeholder, style: { fontFamily: theme?.fontFamily } })] }));
|
|
42
42
|
};
|
|
43
|
-
export const MemoizedButton = ({ label, onClick, primary = true }) => {
|
|
43
|
+
export const MemoizedButton = ({ label, onClick, primary = true, isLoading = false, }) => {
|
|
44
44
|
const [theme] = useContext(ThemeContext);
|
|
45
45
|
return (_jsxs("button", { className: "quill-button", onClick: onClick, style: { fontFamily: theme?.fontFamily }, children: [_jsx("style", { children: `
|
|
46
46
|
.quill-button {
|
|
@@ -60,7 +60,7 @@ export const MemoizedButton = ({ label, onClick, primary = true }) => {
|
|
|
60
60
|
.quill-button:hover {
|
|
61
61
|
background-color: rgba(56, 65, 81, 0.9);
|
|
62
62
|
border-radius: 6px;
|
|
63
|
-
}` }), label] }));
|
|
63
|
+
}` }), isLoading ? (_jsx("div", { style: { padding: '0px 16px' }, children: _jsx(LoadingSpinner, {}) })) : (label)] }));
|
|
64
64
|
};
|
|
65
65
|
export const MemoizedSecondaryButton = ({ label, onClick }) => {
|
|
66
66
|
const [theme] = useContext(ThemeContext);
|
|
@@ -40,7 +40,7 @@ export const useQuill = (chartId) => {
|
|
|
40
40
|
};
|
|
41
41
|
const resp = await getData(client, 'itempost', 'same-origin', hostedBody, cloudBody);
|
|
42
42
|
if (resp) {
|
|
43
|
-
if (resp.name === 'error') {
|
|
43
|
+
if (resp.name === 'error' || resp.errorMessage) {
|
|
44
44
|
setError(JSON.stringify(resp));
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
@@ -8,7 +8,7 @@ export interface Pivot {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
triggerButtonText?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const PivotModal: ({ pivotRowField, setPivotRowField, pivotColumnField, setPivotColumnField, pivotValueField, setPivotValueField, pivotAggregation, setPivotAggregation, popUpTitle, setPopUpTitle, selectedTable, SelectComponent, ButtonComponent, PopoverComponent, HeaderComponent, LabelComponent, TextComponent, selectedPivotIndex, setSelectedPivotIndex, removePivot, selectPivot, showUpdatePivot, setShowUpdatePivot, data, columns, theme, isOpen, setIsOpen, dateRange, createdPivots, setCreatedPivots, recommendedPivots, setRecommendedPivots, triggerButtonText, showPivotEditButton, showEditOnPivotClick, selectPivotOnEdit, showTrigger, rightAlign, parentRef, recommendPivotCount, }: {
|
|
11
|
+
export declare const PivotModal: ({ pivotRowField, setPivotRowField, pivotColumnField, setPivotColumnField, pivotValueField, setPivotValueField, pivotAggregation, setPivotAggregation, popUpTitle, setPopUpTitle, selectedTable, SelectComponent, ButtonComponent, SecondaryButtonComponent, PopoverComponent, HeaderComponent, LabelComponent, TextComponent, selectedPivotIndex, setSelectedPivotIndex, removePivot, selectPivot, showUpdatePivot, setShowUpdatePivot, data, columns, theme, isOpen, setIsOpen, dateRange, createdPivots, setCreatedPivots, recommendedPivots, setRecommendedPivots, triggerButtonText, showPivotEditButton, showEditOnPivotClick, selectPivotOnEdit, showTrigger, rightAlign, parentRef, recommendPivotCount, }: {
|
|
12
12
|
pivotRowField: any;
|
|
13
13
|
setPivotRowField: any;
|
|
14
14
|
pivotColumnField: any;
|
|
@@ -22,6 +22,7 @@ export declare const PivotModal: ({ pivotRowField, setPivotRowField, pivotColumn
|
|
|
22
22
|
selectedTable: any;
|
|
23
23
|
SelectComponent: any;
|
|
24
24
|
ButtonComponent: any;
|
|
25
|
+
SecondaryButtonComponent: any;
|
|
25
26
|
PopoverComponent: any;
|
|
26
27
|
HeaderComponent: any;
|
|
27
28
|
LabelComponent: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PivotModal.d.ts","sourceRoot":"","sources":["../../../../src/internals/ReportBuilder/PivotModal.tsx"],"names":[],"mappings":"AA+BA,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAkBD,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"PivotModal.d.ts","sourceRoot":"","sources":["../../../../src/internals/ReportBuilder/PivotModal.tsx"],"names":[],"mappings":"AA+BA,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAkBD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAqtBtB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA,EAAE,MAAM,KAAA,OAyB1D;AAkHD,wBAAgB,WAAW,CAAC,SAAS,KAAA,WAYpC;AAgCD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,GAAG,EACT,SAAS,EAAE,GAAG,EACd,YAAY,EAAE,OAAO,EACrB,QAAQ,SAAK,EACb,SAAS,GAAE,GAAU;;;;;;EA6atB"}
|