@quillsql/react 2.13.37 → 2.13.39

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 (101) hide show
  1. package/dist/cjs/Chart.d.ts +2 -1
  2. package/dist/cjs/Chart.d.ts.map +1 -1
  3. package/dist/cjs/Chart.js +1 -2
  4. package/dist/cjs/ChartBuilder.d.ts.map +1 -1
  5. package/dist/cjs/ChartBuilder.js +68 -57
  6. package/dist/cjs/ReportBuilder.d.ts.map +1 -1
  7. package/dist/cjs/ReportBuilder.js +69 -51
  8. package/dist/cjs/components/Chart/ChartTooltip.d.ts +1 -1
  9. package/dist/cjs/components/Chart/ChartTooltip.d.ts.map +1 -1
  10. package/dist/cjs/components/Chart/ChartTooltip.js +3 -3
  11. package/dist/cjs/components/Chart/InternalChart.d.ts.map +1 -1
  12. package/dist/cjs/components/Chart/InternalChart.js +7 -1
  13. package/dist/cjs/components/Chart/LineChart.d.ts.map +1 -1
  14. package/dist/cjs/components/Chart/LineChart.js +4 -4
  15. package/dist/cjs/components/Dashboard/MetricComponent.d.ts.map +1 -1
  16. package/dist/cjs/components/Dashboard/MetricComponent.js +3 -3
  17. package/dist/cjs/components/ReportBuilder/convert.d.ts +1 -1
  18. package/dist/cjs/components/ReportBuilder/convert.d.ts.map +1 -1
  19. package/dist/cjs/components/ReportBuilder/convert.js +73 -21
  20. package/dist/cjs/components/UiComponents.d.ts +2 -1
  21. package/dist/cjs/components/UiComponents.d.ts.map +1 -1
  22. package/dist/cjs/components/UiComponents.js +11 -4
  23. package/dist/cjs/hooks/useExport.d.ts.map +1 -1
  24. package/dist/cjs/hooks/useExport.js +4 -5
  25. package/dist/cjs/internals/ReportBuilder/PivotForm.d.ts +19 -11
  26. package/dist/cjs/internals/ReportBuilder/PivotForm.d.ts.map +1 -1
  27. package/dist/cjs/internals/ReportBuilder/PivotForm.js +62 -48
  28. package/dist/cjs/internals/ReportBuilder/PivotList.js +5 -4
  29. package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +28 -31
  30. package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
  31. package/dist/cjs/internals/ReportBuilder/PivotModal.js +315 -633
  32. package/dist/cjs/models/Pivot.d.ts +27 -7
  33. package/dist/cjs/models/Pivot.d.ts.map +1 -1
  34. package/dist/cjs/utils/astProcessing.js +2 -2
  35. package/dist/cjs/utils/dashboard.d.ts.map +1 -1
  36. package/dist/cjs/utils/dashboard.js +36 -11
  37. package/dist/cjs/utils/merge.d.ts.map +1 -1
  38. package/dist/cjs/utils/merge.js +2 -1
  39. package/dist/cjs/utils/pivotConstructor.d.ts +1 -0
  40. package/dist/cjs/utils/pivotConstructor.d.ts.map +1 -1
  41. package/dist/cjs/utils/pivotConstructor.js +37 -7
  42. package/dist/cjs/utils/pivotProcessing.d.ts.map +1 -1
  43. package/dist/cjs/utils/pivotProcessing.js +10 -14
  44. package/dist/cjs/utils/queryConstructor.d.ts.map +1 -1
  45. package/dist/cjs/utils/queryConstructor.js +421 -134
  46. package/dist/cjs/utils/report.d.ts.map +1 -1
  47. package/dist/cjs/utils/report.js +2 -2
  48. package/dist/cjs/utils/textProcessing.d.ts +1 -1
  49. package/dist/cjs/utils/textProcessing.d.ts.map +1 -1
  50. package/dist/cjs/utils/textProcessing.js +3 -0
  51. package/dist/esm/Chart.d.ts +2 -1
  52. package/dist/esm/Chart.d.ts.map +1 -1
  53. package/dist/esm/Chart.js +1 -2
  54. package/dist/esm/ChartBuilder.d.ts.map +1 -1
  55. package/dist/esm/ChartBuilder.js +68 -57
  56. package/dist/esm/ReportBuilder.d.ts.map +1 -1
  57. package/dist/esm/ReportBuilder.js +69 -51
  58. package/dist/esm/components/Chart/ChartTooltip.d.ts +1 -1
  59. package/dist/esm/components/Chart/ChartTooltip.d.ts.map +1 -1
  60. package/dist/esm/components/Chart/ChartTooltip.js +3 -3
  61. package/dist/esm/components/Chart/InternalChart.d.ts.map +1 -1
  62. package/dist/esm/components/Chart/InternalChart.js +7 -1
  63. package/dist/esm/components/Chart/LineChart.d.ts.map +1 -1
  64. package/dist/esm/components/Chart/LineChart.js +4 -4
  65. package/dist/esm/components/Dashboard/MetricComponent.d.ts.map +1 -1
  66. package/dist/esm/components/Dashboard/MetricComponent.js +3 -3
  67. package/dist/esm/components/ReportBuilder/convert.d.ts +1 -1
  68. package/dist/esm/components/ReportBuilder/convert.d.ts.map +1 -1
  69. package/dist/esm/components/ReportBuilder/convert.js +74 -22
  70. package/dist/esm/components/UiComponents.d.ts +2 -1
  71. package/dist/esm/components/UiComponents.d.ts.map +1 -1
  72. package/dist/esm/components/UiComponents.js +11 -4
  73. package/dist/esm/hooks/useExport.d.ts.map +1 -1
  74. package/dist/esm/hooks/useExport.js +4 -5
  75. package/dist/esm/internals/ReportBuilder/PivotForm.d.ts +19 -11
  76. package/dist/esm/internals/ReportBuilder/PivotForm.d.ts.map +1 -1
  77. package/dist/esm/internals/ReportBuilder/PivotForm.js +63 -49
  78. package/dist/esm/internals/ReportBuilder/PivotList.js +5 -4
  79. package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +28 -31
  80. package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
  81. package/dist/esm/internals/ReportBuilder/PivotModal.js +327 -635
  82. package/dist/esm/models/Pivot.d.ts +27 -7
  83. package/dist/esm/models/Pivot.d.ts.map +1 -1
  84. package/dist/esm/utils/astProcessing.js +2 -2
  85. package/dist/esm/utils/dashboard.d.ts.map +1 -1
  86. package/dist/esm/utils/dashboard.js +36 -11
  87. package/dist/esm/utils/merge.d.ts.map +1 -1
  88. package/dist/esm/utils/merge.js +2 -1
  89. package/dist/esm/utils/pivotConstructor.d.ts +1 -0
  90. package/dist/esm/utils/pivotConstructor.d.ts.map +1 -1
  91. package/dist/esm/utils/pivotConstructor.js +37 -8
  92. package/dist/esm/utils/pivotProcessing.d.ts.map +1 -1
  93. package/dist/esm/utils/pivotProcessing.js +10 -14
  94. package/dist/esm/utils/queryConstructor.d.ts.map +1 -1
  95. package/dist/esm/utils/queryConstructor.js +421 -134
  96. package/dist/esm/utils/report.d.ts.map +1 -1
  97. package/dist/esm/utils/report.js +2 -2
  98. package/dist/esm/utils/textProcessing.d.ts +1 -1
  99. package/dist/esm/utils/textProcessing.d.ts.map +1 -1
  100. package/dist/esm/utils/textProcessing.js +3 -0
  101. package/package.json +1 -1
@@ -133,9 +133,11 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
133
133
  const [theme] = useContext(ThemeContext);
134
134
  const [pivotRowField, setPivotRowField] = useState(undefined);
135
135
  const [pivotColumnField, setPivotColumnField] = useState(undefined);
136
- const [pivotValueField, setPivotValueField] = useState(undefined);
137
- const [pivotValueField2, setPivotValueField2] = useState(undefined);
138
- const [pivotAggregation, setPivotAggregation] = useState(undefined);
136
+ const [pivotAggregations, setPivotAggregations] = useState(reportInfo?.pivot?.aggregations ?? [{
137
+ valueField: reportInfo?.pivot?.valueField,
138
+ valueField2: reportInfo?.pivot?.valueField2,
139
+ aggregationType: reportInfo?.pivot?.aggregationType,
140
+ }]);
139
141
  const [pivotHint, setPivotHint] = useState('');
140
142
  /* eslint-disable-next-line */
141
143
  const [pivotError, setPivotError] = useState(undefined);
@@ -211,20 +213,35 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
211
213
  window.removeEventListener('resize', handleResize);
212
214
  };
213
215
  }, []);
216
+ const setTypesOnPivot = (newPivot, searchColumns) => ({
217
+ ...newPivot,
218
+ aggregations: newPivot.aggregations?.map((agg) => ({
219
+ ...agg,
220
+ valueFieldType: searchColumns.find((c) => c.field === agg.valueField)?.jsType,
221
+ valueField2Type: searchColumns.find((c) => c.field === agg.valueField2)?.jsType,
222
+ })),
223
+ valueField: newPivot.aggregations?.[0]?.valueField,
224
+ valueField2: newPivot.aggregations?.[0]?.valueField2,
225
+ aggregationType: newPivot.aggregations?.[0]?.aggregationType,
226
+ valueFieldType: searchColumns.find((c) => c.field === newPivot.aggregations?.[0]?.valueField)?.jsType,
227
+ valueField2Type: searchColumns.find((c) => c.field === newPivot.aggregations?.[0]?.valueField2)?.jsType,
228
+ });
214
229
  const updatePivot = async (changeField, fieldKey, prevValue) => {
215
- const newPivot = deepCopy(pivot);
230
+ let newPivot = deepCopy(pivot);
216
231
  setPivotError(undefined);
217
232
  // @ts-ignore
218
233
  newPivot[fieldKey] = changeField;
219
- if (fieldKey === 'columnField' &&
220
- !changeField &&
221
- pivotValueField === pivotValueField2) {
222
- setPivotValueField2(undefined);
223
- newPivot.valueField2 = undefined;
224
- }
225
234
  newPivot.rowLimit = undefined;
226
235
  newPivot.sort = undefined;
227
236
  if (fieldKey === 'rowField') {
237
+ if (changeField === '' || changeField === undefined) {
238
+ setPivotColumnField(undefined);
239
+ // set all percentage aggregations to undefined
240
+ setPivotAggregations(pivotAggregations.map((agg) => ({
241
+ ...agg,
242
+ aggregationType: agg.aggregationType === 'percentage' ? undefined : agg.aggregationType,
243
+ })));
244
+ }
228
245
  // check to see if the new rowField value is a date field
229
246
  const column = columns.find((c) => c.field === changeField);
230
247
  if (column?.jsType === 'date') {
@@ -239,7 +256,11 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
239
256
  newPivot.sort = undefined;
240
257
  }
241
258
  }
242
- setPivot(newPivot);
259
+ newPivot = setTypesOnPivot(newPivot, columns);
260
+ setPivot(setTypesOnPivot(newPivot, columns));
261
+ if (newPivot.aggregations?.length === 0 || newPivot.aggregations?.some((agg) => !agg.aggregationType) || newPivot.aggregations?.some((agg) => !agg.valueField && agg.aggregationType !== 'count')) {
262
+ return;
263
+ }
243
264
  const { valid, reason } = isValidPivot(newPivot);
244
265
  if (!valid) {
245
266
  setPivotError(reason);
@@ -296,14 +317,8 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
296
317
  case 'columnField':
297
318
  setPivotColumnField(prevValue);
298
319
  break;
299
- case 'valueField':
300
- setPivotValueField(prevValue);
301
- break;
302
- case 'valueField2':
303
- setPivotValueField2(prevValue);
304
- break;
305
- case 'aggregationType':
306
- setPivotAggregation(prevValue);
320
+ case 'aggregations':
321
+ setPivotAggregations(prevValue);
307
322
  break;
308
323
  }
309
324
  setPivot(prevPivot);
@@ -720,20 +735,24 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
720
735
  return column?.fieldType;
721
736
  };
722
737
  const emptyPivotColumns = () => {
723
- if (pivot && pivot.rowField && pivot.columnField && pivot.valueField) {
738
+ if (pivot && pivot.rowField && pivot.columnField) {
724
739
  return [
725
740
  { label: snakeAndCamelCaseToTitleCase(pivot.rowField) },
726
741
  { label: snakeAndCamelCaseToTitleCase(pivot.columnField) },
727
742
  ];
728
743
  }
729
- else if (pivot && pivot.rowField && pivot.valueField) {
744
+ else if (pivot && pivot.rowField) {
730
745
  return [
731
746
  { label: snakeAndCamelCaseToTitleCase(pivot.rowField) },
732
- { label: snakeAndCamelCaseToTitleCase(pivot.valueField) },
747
+ ...(pivot.aggregations ?? []).filter((a) => !!a.valueField).map((agg) => ({
748
+ label: snakeAndCamelCaseToTitleCase(agg.valueField),
749
+ })),
733
750
  ];
734
751
  }
735
752
  else {
736
- return [{ label: snakeAndCamelCaseToTitleCase(pivot?.valueField || '') }];
753
+ return (pivot?.aggregations ?? []).filter((a) => !!a.valueField).map((agg) => ({
754
+ label: snakeAndCamelCaseToTitleCase(agg.valueField),
755
+ }));
737
756
  }
738
757
  };
739
758
  const [previousPage, setPreviousPage] = useState(0);
@@ -1071,7 +1090,7 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1071
1090
  if (prevTable !== reportBuilderInfo.table) {
1072
1091
  setSelectedOrderedColumns([]); // reset selected ordered columns
1073
1092
  }
1074
- setPivot(reportBuilderInfo.pivot);
1093
+ setPivot(reportBuilderInfo.pivot ? setTypesOnPivot(reportBuilderInfo.pivot, reportBuilderInfo.columns) : null);
1075
1094
  if (!keepPivotHint) {
1076
1095
  setPivotHint('');
1077
1096
  }
@@ -1083,10 +1102,12 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1083
1102
  setFormData(curFormData);
1084
1103
  if (reportBuilderInfo.pivot) {
1085
1104
  setPivotRowField(reportBuilderInfo.pivot.rowField);
1086
- setPivotAggregation(reportBuilderInfo.pivot.aggregationType);
1087
1105
  setPivotColumnField(reportBuilderInfo.pivot.columnField);
1088
- setPivotValueField(reportBuilderInfo.pivot.valueField);
1089
- setPivotValueField2(reportBuilderInfo.pivot.valueField2);
1106
+ setPivotAggregations(reportBuilderInfo.pivot.aggregations ?? [{
1107
+ valueField: reportBuilderInfo.pivot.valueField,
1108
+ valueField2: reportBuilderInfo.pivot.valueField2,
1109
+ aggregationType: reportBuilderInfo.pivot.aggregationType,
1110
+ }]);
1090
1111
  }
1091
1112
  else {
1092
1113
  setLoading(false);
@@ -1132,7 +1153,7 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1132
1153
  !isValidPivotForReport(reportBuilderInfo.pivot, newUnique, reportBuilderInfo.table, reportBuilderInfo.columns)) {
1133
1154
  const { pivot, hint } = makePivotValid(reportBuilderInfo.pivot, newUnique, reportBuilderInfo.table, reportBuilderInfo.columns);
1134
1155
  if (pivot) {
1135
- setPivot(pivot);
1156
+ setPivot(setTypesOnPivot(pivot, reportBuilderInfo.columns));
1136
1157
  newPivot = pivot;
1137
1158
  pivotChanged = true;
1138
1159
  setPivotHint(hint);
@@ -1277,8 +1298,13 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1277
1298
  !possibleOptions.columnFields.includes(pivot.columnField)) {
1278
1299
  return false;
1279
1300
  }
1280
- if (pivot.valueField &&
1281
- !possibleOptions.valueFields.includes(pivot.valueField)) {
1301
+ for (const agg of pivot.aggregations ?? []) {
1302
+ if (agg.valueField &&
1303
+ !possibleOptions.valueFields.includes(agg.valueField)) {
1304
+ return false;
1305
+ }
1306
+ }
1307
+ if (!pivot.aggregations || pivot.aggregations.length === 0) {
1282
1308
  return false;
1283
1309
  }
1284
1310
  return true;
@@ -1483,7 +1509,7 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1483
1509
  s.displayName === currentTable) ?? schemaData.schema[0], fieldValuesMap: fieldValuesMap, fieldValuesMapIsLoading: uniqueValuesIsLoading, onSubmitFilter: (filter) => {
1484
1510
  setOpenPopover(null);
1485
1511
  handleInsertion(filter);
1486
- }, onDeleteFilter: () => { }, ButtonComponent: ButtonComponent, SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, MultiSelectComponent: MultiSelectComponent }) }) })] })] }), _jsxs("div", { style: { width: '100%' }, children: [_jsx(SidebarHeadingComponent, { label: "Pivot" }), _jsx(PivotModal, { pivotRowField: pivotRowField, setPivotRowField: setPivotRowField, pivotColumnField: pivotColumnField, setPivotColumnField: setPivotColumnField, pivotValueField: pivotValueField, pivotValueField2: pivotValueField2, setPivotValueField: setPivotValueField, setPivotValueField2: setPivotValueField2, pivotAggregation: pivotAggregation, setPivotAggregation: setPivotAggregation, createdPivots: createdPivots, setCreatedPivots: setCreatedPivots, recommendedPivots: recommendedPivots, setRecommendedPivots: setRecommendedPivots, popUpTitle: pivotPopUpTitle, setPopUpTitle: setPivotPopUpTitle, selectedTable: initialTableName, SelectComponent: SelectComponent, ButtonComponent: ButtonComponent, CardComponent: CardComponent, SecondaryButtonComponent: SecondaryButtonComponent, PopoverComponent: PopoverComponent, TextComponent: TextComponent, ErrorMessageComponent: ErrorMessageComponent, PivotRowContainer: PivotRowContainer, PivotColumnContainer: PivotColumnContainer, LoadingComponent: LoadingComponent, isOpen: showPivotPopover, setIsOpen: setShowPivotPopover, showUpdatePivot: isEditingPivot, setShowUpdatePivot: setIsEditingPivot, parentRef: parentRef, data: rows, columns: columns, triggerButtonText: 'Add pivot', selectedPivotIndex: selectedPivotIndex, setSelectedPivotIndex: setSelectedPivotIndex, removePivot: () => {
1512
+ }, onDeleteFilter: () => { }, ButtonComponent: ButtonComponent, SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, MultiSelectComponent: MultiSelectComponent }) }) })] })] }), _jsxs("div", { style: { width: '100%' }, children: [_jsx(SidebarHeadingComponent, { label: "Pivot" }), _jsx(PivotModal, { pivotRowField: pivotRowField, setPivotRowField: setPivotRowField, pivotColumnField: pivotColumnField, setPivotColumnField: setPivotColumnField, pivotAggregations: pivotAggregations, setPivotAggregations: setPivotAggregations, createdPivots: createdPivots, setCreatedPivots: setCreatedPivots, recommendedPivots: recommendedPivots, setRecommendedPivots: setRecommendedPivots, popUpTitle: pivotPopUpTitle, setPopUpTitle: setPivotPopUpTitle, selectedTable: initialTableName, SubheaderComponent: SubHeaderComponent, DeleteButtonComponent: DeleteButtonComponent, SelectComponent: SelectComponent, ButtonComponent: ButtonComponent, CardComponent: CardComponent, SecondaryButtonComponent: SecondaryButtonComponent, PopoverComponent: PopoverComponent, TextComponent: TextComponent, ErrorMessageComponent: ErrorMessageComponent, PivotRowContainer: PivotRowContainer, PivotColumnContainer: PivotColumnContainer, LoadingComponent: LoadingComponent, isOpen: showPivotPopover, setIsOpen: setShowPivotPopover, showUpdatePivot: isEditingPivot, setShowUpdatePivot: setIsEditingPivot, parentRef: parentRef, data: rows, columns: columns, triggerButtonText: 'Add pivot', selectedPivotIndex: selectedPivotIndex, setSelectedPivotIndex: setSelectedPivotIndex, removePivot: () => {
1487
1513
  setPivot(null);
1488
1514
  setPivotHint('');
1489
1515
  setPivotData(null);
@@ -1506,7 +1532,8 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1506
1532
  if (dateRange) {
1507
1533
  dateBucket = getDateBucketFromRange(dateRange);
1508
1534
  }
1509
- setPivot(selectedPivot);
1535
+ const processedPivot = setTypesOnPivot(selectedPivot, columns);
1536
+ setPivot(processedPivot);
1510
1537
  resetLimit();
1511
1538
  resetSort();
1512
1539
  setPreviousPage(0);
@@ -1515,7 +1542,7 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1515
1542
  if (!pivotTable) {
1516
1543
  setTableLoading(true);
1517
1544
  pivotTable = await generatePivotTable({
1518
- pivot: selectedPivot,
1545
+ pivot: processedPivot,
1519
1546
  dateBucket,
1520
1547
  report: tempReport,
1521
1548
  client,
@@ -1549,18 +1576,10 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1549
1576
  const prev = pivotColumnField;
1550
1577
  setPivotColumnField(value);
1551
1578
  updatePivot(value, 'columnField', prev);
1552
- }, setPivotValueField: (value) => {
1553
- const prev = pivotValueField;
1554
- setPivotValueField(value);
1555
- updatePivot(value, 'valueField', prev);
1556
- }, setPivotValueField2: (value) => {
1557
- const prev = pivotValueField2;
1558
- setPivotValueField2(value);
1559
- updatePivot(value, 'valueField2', prev);
1560
- }, setPivotAggregation: (value) => {
1561
- const prev = pivotAggregation;
1562
- setPivotAggregation(value);
1563
- updatePivot(value, 'aggregationType', prev);
1579
+ }, setPivotAggregations: (value) => {
1580
+ const prev = pivotAggregations;
1581
+ setPivotAggregations(value);
1582
+ updatePivot(value, 'aggregations', prev);
1564
1583
  }, onDelete: () => {
1565
1584
  setPivot(null);
1566
1585
  setPivotError(undefined);
@@ -1571,7 +1590,7 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1571
1590
  setPreviousPage(0);
1572
1591
  const formattedRows = formatRows(rows, columns, false);
1573
1592
  setFormattedRows(formattedRows);
1574
- }, isLoading: tableLoading || loading, pivotRowField: pivotRowField, pivotColumnField: pivotColumnField, pivotValueField: pivotValueField, pivotValueField2: pivotValueField2, pivotAggregation: pivotAggregation, SecondaryButtonComponent: SecondaryButtonComponent, SelectComponent: SelectComponent, PivotColumnContainer: PivotColumnContainer, pivotHint: pivotHint }))] }), _jsxs("div", { style: { width: '100%' }, children: [_jsx(SidebarHeadingComponent, { label: "Sort" }), pivot && pivot.sort && pivot.sortField && (_jsx("div", { style: {
1593
+ }, isLoading: tableLoading || loading, pivotRowField: pivotRowField, pivotColumnField: pivotColumnField, pivotAggregations: pivotAggregations, SecondaryButtonComponent: SecondaryButtonComponent, SelectComponent: SelectComponent, PivotColumnContainer: PivotColumnContainer, DeleteButtonComponent: DeleteButtonComponent, pivotHint: pivotHint }))] }), _jsxs("div", { style: { width: '100%' }, children: [_jsx(SidebarHeadingComponent, { label: "Sort" }), pivot && pivot.sort && pivot.sortField && (_jsx("div", { style: {
1575
1594
  display: 'flex',
1576
1595
  flexDirection: 'column',
1577
1596
  gap: 8,
@@ -1618,16 +1637,15 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1618
1637
  if (column === '')
1619
1638
  return;
1620
1639
  if (pivot) {
1621
- const sortFieldType = column === (pivot.valueField || 'count')
1622
- ? 'number'
1640
+ const sortFieldType = pivot.aggregations?.some((agg) => column === agg.valueField || column === 'count') ? 'number'
1623
1641
  : pivot.rowFieldType;
1624
- const tempPivot = {
1642
+ const tempPivot = setTypesOnPivot({
1625
1643
  ...pivot,
1626
1644
  sort: true,
1627
1645
  sortDirection: direction,
1628
1646
  sortField: column,
1629
1647
  sortFieldType: sortFieldType,
1630
- };
1648
+ }, columns);
1631
1649
  setPivot(tempPivot);
1632
1650
  setPivotHint('');
1633
1651
  let dateBucket = undefined;
@@ -1721,7 +1739,7 @@ SidebarComponent = QuillSidebar, ContainerComponent = CustomContainer, SelectCol
1721
1739
  }
1722
1740
  }, popoverTitle: "Add limit", popoverChildren: _jsx(AddLimitPopover, { TextInputComponent: TextInputComponent, Button: ButtonComponent, SecondaryButton: SecondaryButtonComponent, onSave: (limit) => {
1723
1741
  onLimitChange(limit);
1724
- } }) }) })] }))] })] }), _jsxs(ContainerComponent, { children: [isAIEnabled && (_jsx("form", { ref: askAIContainerRef, onSubmit: (event) => {
1742
+ } }) }) })] }))] }), _jsx("div", { style: { width: '100%', minHeight: '30vh' } })] }), _jsxs(ContainerComponent, { children: [isAIEnabled && (_jsx("form", { ref: askAIContainerRef, onSubmit: (event) => {
1725
1743
  event.preventDefault();
1726
1744
  }, style: {
1727
1745
  display: 'flex',
@@ -4,7 +4,7 @@ export interface ChartTooltipProps {
4
4
  payload: PayloadItem[];
5
5
  label: string;
6
6
  colors: string[];
7
- valueFormatter: any;
7
+ valueFormatter: (value: any, field: string) => string;
8
8
  dateFormatter: any;
9
9
  xAxisFormat: string;
10
10
  xAxisField: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ChartTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartTooltip.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,EAAE,GAAG,CAAC;IACpB,aAAa,EAAE,GAAG,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAsQF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,kDAI5D"}
1
+ {"version":3,"file":"ChartTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartTooltip.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACtD,aAAa,EAAE,GAAG,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAsQF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,kDAI5D"}
@@ -38,7 +38,7 @@ const ChartTooltipPrimary = (props) => (_jsxs(ChartTooltipFrame, { theme: props.
38
38
  paddingLeft: '16px',
39
39
  paddingTop: '8px',
40
40
  paddingBottom: '8px',
41
- }, children: props.payload.map(({ color, value, name }, idx) => (_jsx(ChartTooltipRow, { value: props.valueFormatter(value), name: name, color: color || 'black', theme: props.theme }, `id-${idx}`))) })] }));
41
+ }, children: props.payload.map(({ color, value, name }, idx) => (_jsx(ChartTooltipRow, { value: props.valueFormatter(value, name), name: name, color: color || 'black', theme: props.theme }, `id-${idx}`))) })] }));
42
42
  const LABEL_TO_DAYS = {
43
43
  'This week': 7,
44
44
  'This month': 30,
@@ -96,7 +96,7 @@ function reformatComparisonPayload(props, primaryLabel, comparisonLabel) {
96
96
  const date = item.payload[nameKey] ?? format(compDate, props.xAxisFormat);
97
97
  const name = props.dateFormatter(date);
98
98
  const color = item.color;
99
- const value = props.valueFormatter(item.value);
99
+ const value = props.valueFormatter(item.value, item.name);
100
100
  if (!columnsByKey['']) {
101
101
  columnsByKey[''] = [];
102
102
  }
@@ -120,7 +120,7 @@ function reformatComparisonPayload(props, primaryLabel, comparisonLabel) {
120
120
  const isComparison = item.name.includes('comparison ') || item.dataKey.includes('comparison_');
121
121
  const name = isComparison ? comparisonLabel : primaryLabel;
122
122
  const color = item.color;
123
- const value = props.valueFormatter(item.value);
123
+ const value = props.valueFormatter(item.value, item.name);
124
124
  if (!columnsByKey[key]) {
125
125
  columnsByKey[key] = [];
126
126
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InternalChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/InternalChart.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAgB,UAAU,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AAOlE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,WAiH5D;AAyFD,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,MAAM,EACN,MAAM,EACN,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,2BAAmC,EACnC,yBAAgC,EAChC,wBAAgC,EAChC,sBAAgC,EAChC,sBAAsB,EACtB,mBAAmB,EACnB,mBAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAuC,EACvC,eAAsC,EACtC,oBAAyD,EACzD,wBAA+C,EAC/C,eAAsC,EACtC,OAAO,EACP,uBAAuB,EACvB,mBAAmB,EACnB,OAAO,EACP,KAAK,EACL,OAAO,EACP,oBAAoB,EACpB,aAAa,GACd,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG;IAChC,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uBAAuB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7D,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,2CA0cA"}
1
+ {"version":3,"file":"InternalChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/InternalChart.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAgB,UAAU,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AAOlE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,G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A"}
@@ -453,7 +453,13 @@ export default function InternalChart({ report, colors, className, containerStyl
453
453
  .quill-secondary-button:hover {
454
454
  background-color: rgba(56, 65, 81, 0.09);
455
455
  }
456
- ` }), filtersExpanded ? 'Collapse' : 'See all'] }) }))] })] })), loading || !report ? (_jsx(LoadingComponent, {})) : (_jsxs(_Fragment, { children: ['metric' === report.chartType && (_jsx(MetricComponent, { error: error, isLoading: loading, report: report })), report.chartType !== 'table' && report.chartType !== 'metric' && (_jsx(ChartDisplay, { config: report, containerStyle: {
456
+ ` }), filtersExpanded ? 'Collapse' : 'See all'] }) }))] })] })), loading || !report ? (_jsx(LoadingComponent, {})) : (_jsxs(_Fragment, { children: ['metric' === report.chartType && (_jsx("div", { style: {
457
+ marginLeft: 'auto',
458
+ marginRight: 'auto',
459
+ marginTop: 'auto',
460
+ marginBottom: 'auto',
461
+ display: 'flex',
462
+ }, children: _jsx(MetricComponent, { error: error, isLoading: loading, report: report, children: report?.rows?.[0]?.[report.xAxisField] }) })), report.chartType !== 'table' && report.chartType !== 'metric' && (_jsx(ChartDisplay, { config: report, containerStyle: {
457
463
  width: '100%',
458
464
  height: '100%',
459
465
  minHeight: 300,
@@ -1 +1 @@
1
- {"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/LineChart.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA2B7C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,QAAa,EACb,WAAW,EACX,IAAI,EACJ,cAAc,EACd,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,EACzB,2BAAmC,EACnC,yBAAgC,EAChC,wBAAgC,EAChC,sBAAgC,EAChC,mBAA6B,EAC7B,sBAAsB,EACt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AU,EACV,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,EACzB,2BAAmC,EACnC,yBAAgC,EAChC,wBAAgC,EAChC,sBAAgC,EAChC,mBAA6B,EAC7B,sBAAsB,EACtB,mBAA8B,EAC9B,UAAU,GACX,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,GAAG,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2BAA2B,EAAE,OAAO,CAAC;IACrC,yBAAyB,EAAE,OAAO,CAAC;IACnC,wBAAwB,EAAE,OAAO,CAAC;IAClC,sBAAsB,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3C,mBAAmB,EAAE,OAAO,GAAG,QAAQ,CAAC;IACxC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,2CAqRA"}
@@ -137,13 +137,13 @@ export default function LineChart({ colors, colorMap = {}, yAxisFields, data, co
137
137
  value,
138
138
  field: xAxisField,
139
139
  fields: [{ field: xAxisField, format: xAxisFormat }],
140
- }), valueFormatter: (value) => {
141
- if (!payloadItems[0]?.dataKey) {
140
+ }), valueFormatter: (value, name) => {
141
+ const field = payloadItems.find((p) => p.dataKey === name)?.dataKey;
142
+ if (!field)
142
143
  return value;
143
- }
144
144
  return valueFormatter({
145
145
  value,
146
- field: payloadItems[0].dataKey,
146
+ field,
147
147
  fields: [
148
148
  ...yAxisFields,
149
149
  { field: xAxisField, format: xAxisFormat },
@@ -1 +1 @@
1
- {"version":3,"file":"MetricComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/MetricComponent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMnD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,MAAM,EACN,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,GACT,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CA8MhC"}
1
+ {"version":3,"file":"MetricComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/MetricComponent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMnD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,MAAM,EACN,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,GACT,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CA+MhC"}
@@ -26,13 +26,13 @@ export default function QuillMetricComponent({ report, onClick, error, isLoading
26
26
  justifyContent: 'space-between',
27
27
  height: '100%',
28
28
  boxSizing: 'content-box',
29
- }, children: [_jsx("div", { style: {
29
+ }, children: [onClick && (_jsx("div", { style: {
30
30
  display: 'flex',
31
31
  flexDirection: 'row',
32
32
  justifyContent: 'space-between',
33
33
  boxSizing: 'content-box',
34
34
  paddingBottom: 5,
35
- }, children: onClick && (_jsx("div", { style: {
35
+ }, children: _jsx("div", { style: {
36
36
  fontFamily: theme?.fontFamily,
37
37
  color: theme?.primaryTextColor,
38
38
  boxSizing: 'content-box',
@@ -44,7 +44,7 @@ export default function QuillMetricComponent({ report, onClick, error, isLoading
44
44
  display: 'block',
45
45
  maxWidth: '100%',
46
46
  overflow: 'hidden',
47
- }, children: report?.name })) }), isLoading ? (_jsx(ChartSkeleton, { containerStyle: {
47
+ }, children: report?.name }) })), isLoading ? (_jsx(ChartSkeleton, { containerStyle: {
48
48
  maxHeight: '78px',
49
49
  height: '100%',
50
50
  } })) : error ? (_jsx(ChartError, { errorMessage: error, containerStyle: {
@@ -23,7 +23,7 @@ export declare function convertASTToPivotData(ast: NSP.Select, columnInfo: Colum
23
23
  * and a list of tables in the schema.
24
24
  */
25
25
  export declare function convertGroupBy(ast: AST, schemaTables: Table[], prevPivot?: Pivot, prevTable?: string): {
26
- ast: NSP.Insert_Replace | NSP.Update | NSP.Delete | NSP.Alter | NSP.Use | NSP.Create | NSP.Drop | NSP.BigQuery;
26
+ ast: NSP.Use | NSP.Create | NSP.Update | NSP.Insert_Replace | NSP.Alter | NSP.Delete | NSP.Drop | NSP.BigQuery;
27
27
  pivot: Pivot | undefined;
28
28
  } | {
29
29
  pivot: Pivot | null;
@@ -1 +1 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/convert.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,IAAI,GAAG,EACpB,GAAG,EAQJ,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAU5C,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAuBlE;AAGD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,QAahB;AAGD,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,E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AE,KAAK,EAAE,OAkCvD"}
@@ -1,6 +1,6 @@
1
1
  import { isValid, parseISO } from 'date-fns';
2
2
  import { generatePivotTitle } from '../../internals/ReportBuilder/PivotModal';
3
- import { extractColumnish, isSelect, isLogicalBinaryExpr, isBigQuery, isNumericColumnType, getColumnName, getTableNames, } from './ast';
3
+ import { extractColumnish, isSelect, isLogicalBinaryExpr, isBigQuery, isNumericColumnType, getColumnName, getTableNames, isBoolColumnType, } from './ast';
4
4
  import { generateColumnExpr, isIdColumn } from './util';
5
5
  import { getFieldFromExpression } from '../../utils/astFilterProcessing';
6
6
  import { isStringType } from '../../utils/columnProcessing';
@@ -183,7 +183,10 @@ function addAllPivotColumnsToColumnAST(astColumns, pivot) {
183
183
  if (!pivot) {
184
184
  return;
185
185
  }
186
- [pivot.valueField, pivot.rowField, pivot.columnField].forEach((field) => {
186
+ [pivot.aggregations?.map((agg) => [agg.valueField, agg.valueField2])?.flat(), pivot.rowField, pivot.columnField]
187
+ .flat()
188
+ .filter((field) => typeof field === 'string' && field !== undefined)
189
+ .forEach((field) => {
187
190
  if (!field || columnExistsInNewColumns(astColumns, field)) {
188
191
  return;
189
192
  }
@@ -284,6 +287,12 @@ function convertCaseWhenToPivotData(column) {
284
287
  if (pivot.aggregationType === 'avg') {
285
288
  pivot.aggregationType = 'average';
286
289
  }
290
+ pivot.aggregations = [
291
+ {
292
+ valueField: pivot.valueField,
293
+ aggregationType: pivot.aggregationType,
294
+ },
295
+ ];
287
296
  }
288
297
  }
289
298
  // We need to extract a column name from the condition expression of
@@ -313,17 +322,36 @@ export function convertASTToPivotData(ast, columnInfo) {
313
322
  if (column.expr?.args?.expr?.type.toLowerCase() === 'case' &&
314
323
  ['double_quote_string', 'column_ref'].includes(column.expr?.args?.expr?.args[0]?.result?.type)) {
315
324
  const caseWhenPivot = convertCaseWhenToPivotData(column);
316
- newPivot.valueField = caseWhenPivot.valueField;
317
- newPivot.aggregationType = caseWhenPivot.aggregationType;
325
+ if (caseWhenPivot.aggregations) {
326
+ caseWhenPivot.aggregations.forEach((agg) => {
327
+ if (!newPivot.aggregations?.find((a) => a.valueField === agg.valueField)) {
328
+ newPivot.aggregations = newPivot.aggregations ?? [];
329
+ newPivot.aggregations.push(agg);
330
+ }
331
+ });
332
+ }
333
+ else {
334
+ if (!newPivot.aggregations?.find((a) => a.valueField === caseWhenPivot.valueField)) {
335
+ newPivot.aggregations = newPivot.aggregations ?? [];
336
+ newPivot.aggregations.push({
337
+ valueField: caseWhenPivot.valueField,
338
+ aggregationType: caseWhenPivot.aggregationType,
339
+ });
340
+ }
341
+ }
318
342
  newPivot.columnField = caseWhenPivot.columnField;
319
343
  }
320
344
  else if (column.expr.type === 'aggr_func' && !isIdColumn(columnName)) {
321
345
  const aggObj = column.expr;
322
- newPivot.aggregationType = aggObj.name.toLowerCase();
323
- if (newPivot.aggregationType === 'avg') {
324
- newPivot.aggregationType = 'average';
346
+ let aggregationType = aggObj.name.toLowerCase();
347
+ if (aggregationType === 'avg') {
348
+ aggregationType = 'average';
325
349
  }
326
- newPivot.valueField = columnName;
350
+ newPivot.aggregations = newPivot.aggregations ?? [];
351
+ newPivot.aggregations.push({
352
+ valueField: columnName,
353
+ aggregationType,
354
+ });
327
355
  }
328
356
  else if (column.expr.type === 'function') {
329
357
  const functionInfo = column.expr.name;
@@ -349,9 +377,16 @@ export function convertASTToPivotData(ast, columnInfo) {
349
377
  finalPivot.rowFieldType = 'date';
350
378
  }
351
379
  // Make sure pivot value field is of numeric type
352
- if (finalPivot.valueField) {
380
+ // MAke sure each value field is of numeric type
381
+ if (finalPivot.aggregations) {
382
+ finalPivot.aggregations = finalPivot.aggregations.filter((agg) => {
383
+ const column = columnInfo.find((c) => c.field === agg.valueField);
384
+ return column && (isNumericColumnType(column.fieldType) || isBoolColumnType(column.fieldType));
385
+ });
386
+ }
387
+ else if (finalPivot.valueField) {
353
388
  const column = columnInfo.find((c) => c.field === finalPivot.valueField);
354
- if (!column || !isNumericColumnType(column.fieldType)) {
389
+ if (!column || !(isNumericColumnType(column.fieldType) || isBoolColumnType(column.fieldType))) {
355
390
  finalPivot.valueField = '';
356
391
  finalPivot.aggregationType = 'count';
357
392
  }
@@ -373,10 +408,11 @@ export function convertASTToPivotData(ast, columnInfo) {
373
408
  }
374
409
  function addValueFieldToPivot(newAst, pivot, columns) {
375
410
  if (!pivot ||
376
- (pivot.aggregationType === 'count' && (pivot.rowField || pivot.valueField))) {
411
+ // (pivot.aggregationType === 'count' && (pivot.rowField || pivot.valueField))
412
+ pivot.aggregations?.some((agg) => agg.aggregationType === 'count' && (agg.valueField || pivot.rowField))) {
377
413
  return;
378
414
  }
379
- if (!pivot.valueField) {
415
+ if (!pivot.aggregations?.length) {
380
416
  let firstNumericNonIdColumn = undefined;
381
417
  (newAst.groupby?.columns ?? newAst.columns).forEach((col) => {
382
418
  const field = getFieldFromExpression(col.expr) || col.as;
@@ -386,22 +422,32 @@ function addValueFieldToPivot(newAst, pivot, columns) {
386
422
  }
387
423
  });
388
424
  if (firstNumericNonIdColumn) {
389
- pivot.valueField =
390
- getFieldFromExpression(firstNumericNonIdColumn.expr) ||
391
- firstNumericNonIdColumn.as;
392
- pivot.aggregationType = 'sum';
425
+ pivot.aggregations = [
426
+ {
427
+ valueField: getFieldFromExpression(firstNumericNonIdColumn.expr) ||
428
+ firstNumericNonIdColumn.as,
429
+ aggregationType: 'sum',
430
+ },
431
+ ];
393
432
  }
394
433
  else {
395
434
  const numericColumn = columns.find((c) => isNumericColumnType(c.fieldType) && !isIdColumn(c.field));
396
435
  if (numericColumn) {
397
436
  newAst.columns.push(generateColumnExpr(numericColumn.field));
398
- pivot.valueField = numericColumn.field;
399
- pivot.aggregationType = 'sum';
437
+ pivot.aggregations = [
438
+ {
439
+ valueField: numericColumn.field,
440
+ aggregationType: 'sum',
441
+ },
442
+ ];
400
443
  }
401
444
  else {
402
445
  pivot.columnField = undefined;
403
446
  pivot.columnFieldType = undefined;
404
- pivot.aggregationType = 'count';
447
+ pivot.aggregations = [{
448
+ valueField: undefined,
449
+ aggregationType: 'count',
450
+ }];
405
451
  }
406
452
  }
407
453
  }
@@ -437,9 +483,15 @@ export function convertGroupBy(ast, schemaTables, prevPivot, prevTable) {
437
483
  c.expr?.column?.expr?.value,
438
484
  c.as,
439
485
  ].includes(col));
440
- if (prevPivot.valueField) {
441
- const existingCol = columnAlreadyExists(prevPivot.valueField);
442
- newColumns.push(existingCol ?? generateColumnExpr(prevPivot.valueField));
486
+ if (prevPivot.aggregations?.length) {
487
+ for (const agg of prevPivot.aggregations) {
488
+ if (agg.valueField) {
489
+ newColumns.push(columnAlreadyExists(agg.valueField) ?? generateColumnExpr(agg.valueField));
490
+ }
491
+ if (agg.valueField2) {
492
+ newColumns.push(columnAlreadyExists(agg.valueField) ?? generateColumnExpr(agg.valueField));
493
+ }
494
+ }
443
495
  }
444
496
  if (prevPivot.rowField) {
445
497
  const existingCol = columnAlreadyExists(prevPivot.rowField);
@@ -75,12 +75,13 @@ export declare const MemoizedButton: ({ label, onClick, disabled, icon, tooltipT
75
75
  tooltipText?: string;
76
76
  isLoading?: boolean;
77
77
  }) => import("react/jsx-runtime").JSX.Element;
78
- export declare const MemoizedSecondaryButton: ({ label, onClick, icon, disabled, tooltipText, }: {
78
+ export declare const MemoizedSecondaryButton: ({ label, onClick, icon, disabled, tooltipText, width, }: {
79
79
  label: string;
80
80
  onClick: () => void;
81
81
  icon?: ReactNode;
82
82
  disabled?: boolean;
83
83
  tooltipText?: string;
84
+ width?: string;
84
85
  }) => import("react/jsx-runtime").JSX.Element;
85
86
  export interface SelectComponentProps {
86
87
  value: string | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"UiComponents.d.ts","sourceRoot":"","sources":["../../../src/components/UiComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,aAAa,EAEb,SAAS,EAKV,MAAM,OAAO,CAAC;AAOf,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd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