@quillsql/react 2.8.8 → 2.8.9

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 (114) hide show
  1. package/dist/AddToDashboardModal.js +146 -181
  2. package/dist/BarList.js +36 -44
  3. package/dist/Chart.d.ts +0 -5
  4. package/dist/Chart.d.ts.map +1 -1
  5. package/dist/Chart.js +94 -276
  6. package/dist/ChartBuilder.d.ts +1 -0
  7. package/dist/ChartBuilder.d.ts.map +1 -1
  8. package/dist/ChartBuilder.js +96 -93
  9. package/dist/ChartEditor.d.ts +2 -1
  10. package/dist/ChartEditor.d.ts.map +1 -1
  11. package/dist/ChartEditor.js +14 -21
  12. package/dist/Context.js +52 -57
  13. package/dist/Dashboard.d.ts.map +1 -1
  14. package/dist/Dashboard.js +181 -213
  15. package/dist/DateRangePicker/Calendar.js +41 -46
  16. package/dist/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  17. package/dist/DateRangePicker/DateRangePicker.js +33 -62
  18. package/dist/DateRangePicker/DateRangePickerButton.js +14 -17
  19. package/dist/DateRangePicker/dateRangePickerUtils.js +76 -90
  20. package/dist/DateRangePicker/index.js +1 -9
  21. package/dist/PieChart.js +35 -70
  22. package/dist/QuillProvider.js +4 -7
  23. package/dist/ReportBuilder.js +120 -129
  24. package/dist/SQLEditor.d.ts +5 -1
  25. package/dist/SQLEditor.d.ts.map +1 -1
  26. package/dist/SQLEditor.js +82 -89
  27. package/dist/Table.d.ts.map +1 -1
  28. package/dist/Table.js +64 -66
  29. package/dist/TableChart.js +17 -45
  30. package/dist/assets/ArrowDownHeadIcon.js +3 -6
  31. package/dist/assets/ArrowDownIcon.js +3 -6
  32. package/dist/assets/ArrowDownRightIcon.js +3 -6
  33. package/dist/assets/ArrowLeftHeadIcon.js +3 -6
  34. package/dist/assets/ArrowRightHeadIcon.js +3 -6
  35. package/dist/assets/ArrowRightIcon.js +3 -6
  36. package/dist/assets/ArrowUpHeadIcon.js +3 -6
  37. package/dist/assets/ArrowUpIcon.js +3 -6
  38. package/dist/assets/ArrowUpRightIcon.js +3 -6
  39. package/dist/assets/CalendarIcon.js +3 -6
  40. package/dist/assets/CalendarNormalIcon.js +3 -6
  41. package/dist/assets/DoubleArrowLeftHeadIcon.js +3 -6
  42. package/dist/assets/DoubleArrowRightHeadIcon.js +3 -6
  43. package/dist/assets/ExclamationFilledIcon.js +3 -6
  44. package/dist/assets/FilterIcon.js +3 -6
  45. package/dist/assets/LoadingSpinner.js +3 -6
  46. package/dist/assets/RefreshIcon.js +3 -6
  47. package/dist/assets/SearchIcon.js +3 -6
  48. package/dist/assets/UpLeftArrowsIcon.js +3 -6
  49. package/dist/assets/XCircleIcon.js +3 -6
  50. package/dist/assets/XIcon.js +3 -6
  51. package/dist/assets/index.js +21 -49
  52. package/dist/components/Banner/index.d.ts +3 -0
  53. package/dist/components/Banner/index.d.ts.map +1 -0
  54. package/dist/components/Banner/index.js +24 -0
  55. package/dist/components/BigModal/BigModal.js +13 -39
  56. package/dist/components/Dropdown/Dropdown.js +24 -53
  57. package/dist/components/Dropdown/DropdownItem.js +9 -35
  58. package/dist/components/Dropdown/index.js +2 -11
  59. package/dist/components/Modal/Modal.js +13 -39
  60. package/dist/components/Modal/index.js +1 -9
  61. package/dist/components/QuillCard.js +8 -13
  62. package/dist/components/ReportBuilder/ColumnSelector.d.ts +19 -0
  63. package/dist/components/ReportBuilder/ColumnSelector.d.ts.map +1 -0
  64. package/dist/components/ReportBuilder/ColumnSelector.js +87 -0
  65. package/dist/components/SqlTextEditor.d.ts.map +1 -1
  66. package/dist/components/SqlTextEditor.js +30 -13
  67. package/dist/components/UiComponents.d.ts.map +1 -1
  68. package/dist/components/UiComponents.js +40 -53
  69. package/dist/components/selectUtils.js +6 -17
  70. package/dist/contexts/BaseColorContext.js +3 -6
  71. package/dist/contexts/HoveredValueContext.js +3 -6
  72. package/dist/contexts/RootStylesContext.js +3 -6
  73. package/dist/contexts/SelectedValueContext.js +3 -6
  74. package/dist/contexts/index.js +4 -15
  75. package/dist/hooks/index.js +4 -15
  76. package/dist/hooks/useDashboard.js +10 -15
  77. package/dist/hooks/useInternalState.js +3 -6
  78. package/dist/hooks/useOnClickOutside.js +3 -6
  79. package/dist/hooks/useOnWindowResize.js +4 -7
  80. package/dist/hooks/useQuill.js +11 -16
  81. package/dist/hooks/useSelectOnKeyDown.js +4 -7
  82. package/dist/index.js +13 -33
  83. package/dist/internals/ReportBuilder/PivotList.js +14 -20
  84. package/dist/internals/ReportBuilder/PivotModal.d.ts +2 -2
  85. package/dist/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
  86. package/dist/internals/ReportBuilder/PivotModal.js +116 -119
  87. package/dist/internals/ReportBuilder/PivotModal.spec.js +70 -73
  88. package/dist/lib/font.js +2 -6
  89. package/dist/lib/index.js +3 -20
  90. package/dist/lib/inputTypes.js +1 -3
  91. package/dist/lib/utils.js +8 -19
  92. package/dist/test-data/tables.d.ts +2 -0
  93. package/dist/test-data/tables.d.ts.map +1 -0
  94. package/dist/test-data/tables.js +621 -0
  95. package/dist/utils/aggregate.js +28 -35
  96. package/dist/utils/axisFormatter.d.ts +20 -0
  97. package/dist/utils/axisFormatter.d.ts.map +1 -0
  98. package/dist/utils/axisFormatter.js +185 -0
  99. package/dist/utils/colorToHex.js +1 -5
  100. package/dist/utils/dataFetcher.js +2 -8
  101. package/dist/utils/downloadCSV.js +1 -6
  102. package/dist/utils/schema.d.ts +22 -0
  103. package/dist/utils/schema.d.ts.map +1 -0
  104. package/dist/utils/schema.js +134 -0
  105. package/dist/utils/textFormatting.d.ts +4 -0
  106. package/dist/utils/textFormatting.d.ts.map +1 -0
  107. package/dist/utils/textFormatting.js +38 -0
  108. package/dist/utils/valueFormatter.d.ts +17 -0
  109. package/dist/utils/valueFormatter.d.ts.map +1 -0
  110. package/dist/utils/valueFormatter.js +166 -0
  111. package/dist/utils/valueFormatterCSV.d.ts +17 -0
  112. package/dist/utils/valueFormatterCSV.d.ts.map +1 -0
  113. package/dist/utils/valueFormatterCSV.js +90 -0
  114. package/package.json +1 -2
@@ -1,19 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generatePivotTable = exports.isDateField = exports.generatePivotTableYAxis = exports.PivotModal = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
2
  // @ts-nocheck
6
- const react_1 = require("react");
7
- const Context_1 = require("../../Context");
8
- const dataFetcher_1 = require("../../utils/dataFetcher");
9
- const assets_1 = require("../../assets");
10
- const PivotList_1 = require("./PivotList");
11
- const date_fns_1 = require("date-fns");
12
- const Chart_1 = require("../../Chart");
13
- const ChartBuilder_1 = require("../../ChartBuilder");
14
- const QuillCard_1 = require("../../components/QuillCard");
3
+ import { useCallback, useContext, useMemo, useState, useEffect, useRef, } from 'react';
4
+ import { ClientContext } from '../../Context';
5
+ import { getDataFromCloud } from '../../utils/dataFetcher';
6
+ import { RefreshIcon } from '../../assets';
7
+ import { PivotList, PivotCard } from './PivotList';
8
+ import { differenceInDays, eachDayOfInterval, eachMonthOfInterval, eachWeekOfInterval, eachYearOfInterval, endOfDay, isWithinInterval, subMilliseconds, min, max, } from 'date-fns';
9
+ import { valueFormatter } from '../../utils/valueFormatter';
10
+ import { numberFormatOptions, snakeCaseToTitleCase } from '../../ChartBuilder';
11
+ import { QuillCard } from '../../components/QuillCard';
15
12
  const QuillHover = () => {
16
- return ((0, jsx_runtime_1.jsx)("style", { children: `
13
+ return (_jsx("style", { children: `
17
14
  .quill-hover {
18
15
  background-color: white;
19
16
  }
@@ -25,8 +22,8 @@ const QuillHover = () => {
25
22
  }
26
23
  ` }));
27
24
  };
28
- 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 = 'Pivot', showPivotEditButton = false, showEditOnPivotClick = true, selectPivotOnEdit = false, showTrigger = true, rightAlign = false, parentRef, }) => {
29
- const [isLoading, setIsLoading] = (0, react_1.useState)(false);
25
+ export 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 = 'Pivot', showPivotEditButton = false, showEditOnPivotClick = true, selectPivotOnEdit = false, showTrigger = true, rightAlign = false, parentRef, }) => {
26
+ const [isLoading, setIsLoading] = useState(false);
30
27
  // for testing
31
28
  // const [createdPivots, setCreatedPivots] = useState<Pivot[]>([
32
29
  // {
@@ -57,16 +54,16 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
57
54
  // title: 'sum of amount by created_at and merchant',
58
55
  // },
59
56
  // ]);
60
- const [pivotUpdateIndex, setPivotUpdateIndex] = (0, react_1.useState)(null);
61
- const [selectedPivotType, setSelectedPivotType] = (0, react_1.useState)('recommended');
62
- const [errors, setErrors] = (0, react_1.useState)([]);
63
- const [client] = (0, react_1.useContext)(Context_1.ClientContext);
64
- const [divWidth, setDivWidth] = (0, react_1.useState)(0);
65
- const editModalRef = (0, react_1.useRef)();
57
+ const [pivotUpdateIndex, setPivotUpdateIndex] = useState(null);
58
+ const [selectedPivotType, setSelectedPivotType] = useState('recommended');
59
+ const [errors, setErrors] = useState([]);
60
+ const [client] = useContext(ClientContext);
61
+ const [divWidth, setDivWidth] = useState(0);
62
+ const editModalRef = useRef();
66
63
  const calculateWidth = () => {
67
64
  return editModalRef.current.offsetWidth;
68
65
  };
69
- (0, react_1.useEffect)(() => {
66
+ useEffect(() => {
70
67
  // Measure the width of the div and update state
71
68
  if (editModalRef.current) {
72
69
  setDivWidth(calculateWidth());
@@ -83,13 +80,13 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
83
80
  window.removeEventListener('resize', handleResize);
84
81
  };
85
82
  }, []);
86
- (0, react_1.useEffect)(() => {
83
+ useEffect(() => {
87
84
  // Measure the width of the div and update state
88
85
  if (editModalRef.current) {
89
86
  setDivWidth(calculateWidth());
90
87
  }
91
88
  }, [editModalRef.current, showUpdatePivot]);
92
- (0, react_1.useEffect)(() => {
89
+ useEffect(() => {
93
90
  setSelectedPivotIndex(-1);
94
91
  setPivotUpdateIndex(null);
95
92
  setSelectedPivotType(undefined);
@@ -100,7 +97,7 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
100
97
  setIsOpen(false);
101
98
  setErrors([]);
102
99
  }, [selectedTable]);
103
- const columnsToShow = (0, react_1.useMemo)(() => {
100
+ const columnsToShow = useMemo(() => {
104
101
  return (columns || []).reduce((map, col) => {
105
102
  // only use columns shown in the report builder's table
106
103
  // also filter out id
@@ -110,7 +107,7 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
110
107
  return map;
111
108
  }, {});
112
109
  }, [columns]);
113
- const selectedPivotTable = (0, react_1.useMemo)(() => {
110
+ const selectedPivotTable = useMemo(() => {
114
111
  if (selectedPivotIndex === -1) {
115
112
  return null;
116
113
  }
@@ -122,10 +119,10 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
122
119
  columns: columns,
123
120
  };
124
121
  }, [selectedPivotIndex, data, dateRange, createdPivots]);
125
- const columnSelectOptions = (0, react_1.useMemo)(() => {
122
+ const columnSelectOptions = useMemo(() => {
126
123
  return [
127
124
  { label: 'Select', value: '' },
128
- ...Object.keys(columnsToShow).map(key => {
125
+ ...Object.keys(columnsToShow).map((key) => {
129
126
  return { label: key, value: key };
130
127
  }),
131
128
  ];
@@ -161,7 +158,7 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
161
158
  const onEditRecommendedPivot = (pivot, index) => {
162
159
  onEditPivot(pivot, null);
163
160
  };
164
- const refreshPivots = (0, react_1.useCallback)(async () => {
161
+ const refreshPivots = useCallback(async () => {
165
162
  if (isLoading || Object.keys(columnsToShow).length === 0) {
166
163
  return;
167
164
  }
@@ -178,7 +175,7 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
178
175
  }, {}),
179
176
  };
180
177
  try {
181
- const resp = await (0, dataFetcher_1.getDataFromCloud)(client, 'pivotai', cloudBody);
178
+ const resp = await getDataFromCloud(client, 'pivotai', cloudBody);
182
179
  const recommendedPivots = resp?.data?.pivotTables || [];
183
180
  // for testing if needed
184
181
  // const recommendedPivots = [
@@ -225,8 +222,8 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
225
222
  // },
226
223
  // ];
227
224
  setRecommendedPivots(recommendedPivots
228
- .filter(pivot => pivot.rowField != '')
229
- .map(pivot => {
225
+ .filter((pivot) => pivot.rowField != '')
226
+ .map((pivot) => {
230
227
  return {
231
228
  ...pivot,
232
229
  rowFieldType: columnsToShow[pivot.rowField],
@@ -241,26 +238,26 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
241
238
  }
242
239
  setIsLoading(false);
243
240
  }, [selectedTable, data, columnsToShow, isLoading]);
244
- (0, react_1.useEffect)(() => {
241
+ useEffect(() => {
245
242
  if (recommendedPivots.length === 0) {
246
243
  refreshPivots();
247
244
  }
248
245
  }, [refreshPivots]);
249
- const recommendedPivotTables = (0, react_1.useMemo)(() => {
250
- const pts = recommendedPivots.map(p => {
246
+ const recommendedPivotTables = useMemo(() => {
247
+ const pts = recommendedPivots.map((p) => {
251
248
  const { rows, columns } = generatePivotTable(p, data, dateRange, 6);
252
249
  return { pivot: p, rows, columns };
253
250
  });
254
251
  return pts;
255
252
  }, [recommendedPivots, data]);
256
- const createdPivotTables = (0, react_1.useMemo)(() => {
257
- const pts = createdPivots.map(p => {
253
+ const createdPivotTables = useMemo(() => {
254
+ const pts = createdPivots.map((p) => {
258
255
  const { rows, columns } = generatePivotTable(p, data, dateRange, 6);
259
256
  return { pivot: p, rows, columns };
260
257
  });
261
258
  return pts;
262
259
  }, [createdPivots, data]);
263
- const samplePivotTable = (0, react_1.useMemo)(() => {
260
+ const samplePivotTable = useMemo(() => {
264
261
  if (!pivotAggregation || !pivotRowField) {
265
262
  return null;
266
263
  }
@@ -281,15 +278,15 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
281
278
  pivotColumnField,
282
279
  columnsToShow,
283
280
  ]);
284
- return ((0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'column' }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
281
+ return (_jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: _jsxs("div", { style: {
285
282
  position: 'relative',
286
283
  display: 'inline-block',
287
284
  textAlign: 'left',
288
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
285
+ }, children: [_jsx("div", { style: {
289
286
  display: 'flex',
290
287
  flexDirection: 'row',
291
288
  alignItems: 'center',
292
- }, children: selectedPivotIndex !== -1 && ((0, jsx_runtime_1.jsx)("span", { style: {
289
+ }, children: selectedPivotIndex !== -1 && (_jsx("span", { style: {
293
290
  height: 10,
294
291
  width: 10,
295
292
  backgroundColor: theme.primaryButtonColor,
@@ -297,7 +294,7 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
297
294
  position: 'absolute',
298
295
  top: -2,
299
296
  right: -2,
300
- } })) }), (0, jsx_runtime_1.jsx)(PopoverComponent, { onClose: () => {
297
+ } })) }), _jsx(PopoverComponent, { onClose: () => {
301
298
  setShowUpdatePivot(false);
302
299
  setPopUpTitle('Add Pivot');
303
300
  }, style: rightAlign ? { right: 0 } : {}, parentRef: parentRef, showTrigger: showTrigger, label: triggerButtonText, isOpen: isOpen, setIsOpen: setIsOpen, onClick: () => {
@@ -309,53 +306,52 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
309
306
  refreshPivots();
310
307
  }
311
308
  setShowUpdatePivot(false);
312
- }, children: (0, jsx_runtime_1.jsx)("div", { children: showUpdatePivot ? ((0, jsx_runtime_1.jsxs)("div", { className: "ref-in-use", ref: editModalRef, style: {
309
+ }, children: _jsx("div", { children: showUpdatePivot ? (_jsxs("div", { className: "ref-in-use", ref: editModalRef, style: {
313
310
  backgroundColor: 'rgb(255, 255, 255)',
314
311
  display: 'flex',
315
312
  flexDirection: 'column',
316
- }, children: [(0, jsx_runtime_1.jsx)(HeaderComponent, { children: popUpTitle }), (0, jsx_runtime_1.jsx)("div", { style: { height: 12 } }), (0, jsx_runtime_1.jsx)("div", { style: { width: divWidth }, children: samplePivotTable ? ((0, jsx_runtime_1.jsx)("div", { style: {
313
+ }, children: [_jsx(HeaderComponent, { children: popUpTitle }), _jsx("div", { style: { height: 12 } }), _jsx("div", { style: { width: divWidth }, children: samplePivotTable ? (_jsx("div", { style: {
317
314
  marginBottom: 20,
318
315
  minHeight: 160,
319
- }, children: (0, jsx_runtime_1.jsx)(PivotList_1.PivotCard, { pivotTable: samplePivotTable, theme: theme, index: 0, onSelectPivot: () => { }, selectedPivotIndex: -1, onEditPivot: () => { }, ButtonComponent: ButtonComponent, showEdit: false, clickable: false, minHeight: 140, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }) })) : ((0, jsx_runtime_1.jsx)("div", { style: { marginBottom: 20, maxWidth: 470 }, children: (0, jsx_runtime_1.jsx)(QuillCard_1.QuillCard, { theme: theme, clickable: false, children: (0, jsx_runtime_1.jsx)("div", { style: {
316
+ }, children: _jsx(PivotCard, { pivotTable: samplePivotTable, theme: theme, index: 0, onSelectPivot: () => { }, selectedPivotIndex: -1, onEditPivot: () => { }, ButtonComponent: ButtonComponent, showEdit: false, clickable: false, minHeight: 140, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }) })) : (_jsx("div", { style: { marginBottom: 20, maxWidth: 470 }, children: _jsx(QuillCard, { theme: theme, clickable: false, children: _jsx("div", { style: {
320
317
  color: theme.secondaryTextColor,
321
- }, children: "Select a row field and aggregation type to see a preview" }) }) })) }), (0, jsx_runtime_1.jsxs)("div", { style: {
318
+ }, children: "Select a row field and aggregation type to see a preview" }) }) })) }), _jsxs("div", { style: {
322
319
  display: 'flex',
323
320
  flexDirection: 'column',
324
321
  gap: 10,
325
322
  alignItems: 'center',
326
323
  justifyContent: 'space-between',
327
- }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
324
+ }, children: [_jsxs("div", { style: {
328
325
  display: 'flex',
329
326
  flexDirection: 'row',
330
327
  gap: 20,
331
328
  marginBottom: 5,
332
- }, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(LabelComponent, { children: "Row Field" }), (0, jsx_runtime_1.jsx)(SelectComponent, { label: 'Row Field', id: "pivot-row-field", value: pivotRowField, onChange: e => {
329
+ }, children: [_jsxs("div", { children: [_jsx(LabelComponent, { children: "Row Field" }), _jsx(SelectComponent, { label: 'Row Field', id: "pivot-row-field", value: pivotRowField, onChange: (e) => {
333
330
  setPivotRowField(e === '' ? undefined : e);
334
- }, options: columnSelectOptions, theme: theme })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(LabelComponent, { children: "Column Field" }), (0, jsx_runtime_1.jsx)(SelectComponent, { label: 'Column Field', id: "pivot-row-field", value: pivotColumnField, onChange: e => {
331
+ }, options: columnSelectOptions, theme: theme })] }), _jsxs("div", { children: [_jsx(LabelComponent, { children: "Column Field" }), _jsx(SelectComponent, { label: 'Column Field', id: "pivot-row-field", value: pivotColumnField, onChange: (e) => {
335
332
  setPivotColumnField(e === '' ? undefined : e);
336
- }, options: columnSelectOptions, theme: theme })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: {
333
+ }, options: columnSelectOptions, theme: theme })] })] }), _jsxs("div", { style: {
337
334
  display: 'flex',
338
335
  flexDirection: 'row',
339
336
  gap: 20,
340
337
  marginBottom: 20,
341
- }, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(LabelComponent, { children: "Value Field" }), (0, jsx_runtime_1.jsx)(SelectComponent, { label: 'Value Field', id: "pivot-row-field", value: pivotValueField, onChange: e => {
338
+ }, children: [_jsxs("div", { children: [_jsx(LabelComponent, { children: "Value Field" }), _jsx(SelectComponent, { label: 'Value Field', id: "pivot-row-field", value: pivotValueField, onChange: (e) => {
342
339
  setPivotValueField(e === '' ? undefined : e);
343
340
  }, options: pivotAggregation === 'count'
344
341
  ? columnSelectOptions
345
- : columnSelectOptions.filter(option => {
342
+ : columnSelectOptions.filter((option) => {
346
343
  return (option.value === '' ||
347
- ChartBuilder_1.numberFormatOptions.includes(columns.find(col => col.field === option.value)?.format));
348
- }), theme: theme })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(LabelComponent, { children: "Aggregation Type" }), (0, jsx_runtime_1.jsx)(SelectComponent, { label: 'Aggregation Type', id: "pivot-row-field", value: pivotAggregation, theme: theme, onChange: e => {
344
+ numberFormatOptions.includes(columns.find((col) => col.field === option.value)?.format));
345
+ }), theme: theme })] }), _jsxs("div", { children: [_jsx(LabelComponent, { children: "Aggregation Type" }), _jsx(SelectComponent, { label: 'Aggregation Type', id: "pivot-row-field", value: pivotAggregation, theme: theme, onChange: (e) => {
349
346
  if (e !== 'count' &&
350
347
  pivotValueField &&
351
- !ChartBuilder_1.numberFormatOptions.includes(columns.find(col => col.field === pivotValueField)
352
- ?.format)) {
348
+ !numberFormatOptions.includes(columns.find((col) => col.field === pivotValueField)?.format)) {
353
349
  setPivotValueField(null);
354
350
  }
355
351
  setPivotAggregation(e === '' ? undefined : e);
356
- }, options: ['', 'sum', 'average', 'count'].map(option => {
352
+ }, options: ['', 'sum', 'average', 'count'].map((option) => {
357
353
  return { label: option || 'Select', value: option };
358
- }) })] })] })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ButtonComponent, { id: "custom-button", onClick: () => {
354
+ }) })] })] })] }), _jsx("div", { children: _jsx(ButtonComponent, { id: "custom-button", onClick: () => {
359
355
  const errors = [];
360
356
  if (!pivotRowField) {
361
357
  errors.push('Row field cannot be empty');
@@ -382,13 +378,13 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
382
378
  setPopUpTitle('Add Pivot');
383
379
  }
384
380
  setErrors(errors);
385
- }, label: popUpTitle }) }), (0, jsx_runtime_1.jsx)("div", { children: errors.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { style: {
381
+ }, label: popUpTitle }) }), _jsx("div", { children: errors.length > 0 && (_jsxs("div", { children: [_jsx("div", { style: {
386
382
  fontSize: 14,
387
383
  marginBottom: '6px',
388
384
  marginTop: '12px',
389
385
  fontWeight: '600',
390
386
  color: theme.secondaryTextColor,
391
- }, children: "Pivot Errors" }), errors.map((error, index) => ((0, jsx_runtime_1.jsx)("div", { style: {
387
+ }, children: "Pivot Errors" }), errors.map((error, index) => (_jsx("div", { style: {
392
388
  borderRadius: 8,
393
389
  backgroundColor: '#FF9494',
394
390
  paddingLeft: '12px',
@@ -401,7 +397,7 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
401
397
  fontFamily: theme?.fontFamily,
402
398
  color: 'white',
403
399
  marginBottom: 5,
404
- }, children: error }, index)))] })) })] })) : ((0, jsx_runtime_1.jsx)("div", { style: {
400
+ }, children: error }, index)))] })) })] })) : (_jsx("div", { style: {
405
401
  display: 'flex',
406
402
  flexDirection: 'column',
407
403
  fontFamily: theme?.fontFamily,
@@ -409,20 +405,20 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
409
405
  width: selectedPivotTable ? 500 : 600,
410
406
  maxHeight: 600,
411
407
  overflowY: 'scroll',
412
- }, children: selectedPivotIndex >= 0 ? ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", { onClick: () => {
408
+ }, children: selectedPivotIndex >= 0 ? (_jsx("div", { children: _jsx("div", { onClick: () => {
413
409
  setPopUpTitle('Edit Pivot');
414
410
  onEditPivot(createdPivots[0], 0);
415
- }, children: (0, jsx_runtime_1.jsx)(PivotList_1.PivotCard, { pivotTable: {
411
+ }, children: _jsx(PivotCard, { pivotTable: {
416
412
  pivot: selectedPivotTable?.pivot,
417
413
  rows: selectedPivotTable?.rows,
418
414
  columns: selectedPivotTable?.columns,
419
415
  }, theme: theme, index: 0, onSelectPivot: () => { }, selectedPivotIndex: -1, onEditPivot: () => { }, ButtonComponent: ButtonComponent, showEdit: false, onClose: () => {
420
416
  removePivot();
421
- }, clickable: true, minHeight: 180, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }) }) })) : ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
417
+ }, clickable: true, minHeight: 180, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }) }) })) : (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: {
422
418
  fontWeight: '600',
423
419
  marginBottom: 5,
424
420
  fontSize: 18,
425
- }, children: "Recommended Pivots" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { onClick: refreshPivots, style: {
421
+ }, children: "Recommended Pivots" }), _jsx("div", { children: _jsxs("div", { onClick: refreshPivots, style: {
426
422
  color: theme?.secondaryTextColor,
427
423
  cursor: 'pointer',
428
424
  marginTop: 0,
@@ -437,7 +433,7 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
437
433
  paddingTop: 6,
438
434
  paddingBottom: 6,
439
435
  borderRadius: 5,
440
- }, className: "quill-hover", children: [(0, jsx_runtime_1.jsx)(QuillHover, {}), (0, jsx_runtime_1.jsx)(assets_1.RefreshIcon, { style: { marginRight: 5 } }), "Refresh"] }) }), isLoading ? ((0, jsx_runtime_1.jsxs)("div", { style: {
436
+ }, className: "quill-hover", children: [_jsx(QuillHover, {}), _jsx(RefreshIcon, { style: { marginRight: 5 } }), "Refresh"] }) }), isLoading ? (_jsxs("div", { style: {
441
437
  background: theme.backgroundColor,
442
438
  width: 250,
443
439
  minWidth: 250,
@@ -448,29 +444,33 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
448
444
  display: 'flex',
449
445
  margin: '0px auto',
450
446
  justifyContent: 'center',
451
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: { height: 100 } }), (0, jsx_runtime_1.jsxs)("svg", { width: "24", height: "24", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 6)", stroke: theme?.primaryTextColor || '#364153', fill: "none", transform: "rotate(-90 12 12)", children: (0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "-180 12 12", to: "180 12 12", dur: "0.8s", repeatCount: "indefinite" }) }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 1 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", stroke: '#ADB1B9', fill: "none", transform: "rotate(90 12 12)", children: (0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "0 12 12", to: "360 12 12", dur: "0.8s", repeatCount: "indefinite" }) })] })] })) : ((0, jsx_runtime_1.jsxs)("div", { children: [recommendedPivotTables.length == 0 && ((0, jsx_runtime_1.jsx)("div", { style: { marginBottom: 20 }, children: "There are currently no recommended pivots available." })), (0, jsx_runtime_1.jsx)(PivotList_1.PivotList, { recommendedPivotTables: recommendedPivotTables, createdPivotTables: createdPivotTables, theme: theme, onSelectRecommendedPivot: onSelectRecommendedPivot, onSelectCreatedPivot: onSelectCreatedPivot, selectedPivotIndex: selectedPivotIndex, selectedPivotType: selectedPivotType, ButtonComponent: ButtonComponent, HeaderComponent: HeaderComponent, onEditRecommendedPivot: onEditRecommendedPivot, onEditCreatedPivot: onEditPivot, showCreatePivot: true, showPivotEditButton: showPivotEditButton, LabelComponent: LabelComponent, TextComponent: TextComponent })] }))] })) })) }) })] }) }));
447
+ }, children: [_jsx("div", { style: { height: 100 } }), _jsxs("svg", { width: "24", height: "24", children: [_jsx("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 6)", stroke: theme?.primaryTextColor || '#364153', fill: "none", transform: "rotate(-90 12 12)", children: _jsx("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "-180 12 12", to: "180 12 12", dur: "0.8s", repeatCount: "indefinite" }) }), _jsx("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 1 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", stroke: '#ADB1B9', fill: "none", transform: "rotate(90 12 12)", children: _jsx("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "0 12 12", to: "360 12 12", dur: "0.8s", repeatCount: "indefinite" }) })] })] })) : (_jsxs("div", { children: [recommendedPivotTables.length == 0 && (_jsx("div", { style: { marginBottom: 20 }, children: "There are currently no recommended pivots available." })), _jsx(PivotList, { recommendedPivotTables: recommendedPivotTables, createdPivotTables: createdPivotTables, theme: theme, onSelectRecommendedPivot: onSelectRecommendedPivot, onSelectCreatedPivot: onSelectCreatedPivot, selectedPivotIndex: selectedPivotIndex, selectedPivotType: selectedPivotType, ButtonComponent: ButtonComponent, HeaderComponent: HeaderComponent, onEditRecommendedPivot: onEditRecommendedPivot, onEditCreatedPivot: onEditPivot, showCreatePivot: true, showPivotEditButton: showPivotEditButton, LabelComponent: LabelComponent, TextComponent: TextComponent })] }))] })) })) }) })] }) }));
452
448
  };
453
- exports.PivotModal = PivotModal;
454
- function generatePivotTableYAxis(pivot, pivotColumns, format) {
455
- return pivot.columnField
456
- ? pivotColumns.slice(1).map(col => {
457
- return {
458
- field: col.field,
459
- label: col.label,
460
- format: format,
461
- };
462
- })
463
- : [
464
- {
465
- field: pivot.valueField,
466
- label: '',
467
- format: format,
468
- },
469
- ];
449
+ export function generatePivotTableYAxis(pivot, cols, format) {
450
+ // Use the column field for the field and label if there is one
451
+ if (pivot.columnField) {
452
+ return cols.slice(1).map(({ field, label }) => ({ field, label, format }));
453
+ }
454
+ // For count aggregations, use 'count' for the label
455
+ if (pivot?.aggregationType === "count") {
456
+ return [{ field: pivot.valueField, label: "count", format: format }];
457
+ }
458
+ // For average aggregations, use 'average <label>' for the label
459
+ if (pivot?.aggregationType === "average") {
460
+ const label = `average ${pivot.valueField}`;
461
+ return [{ field: pivot.valueField, label, format: format }];
462
+ }
463
+ // otherwise use the default (ie. the field label)
464
+ return [
465
+ {
466
+ field: pivot.valueField,
467
+ label: '',
468
+ format: format,
469
+ },
470
+ ];
470
471
  }
471
- exports.generatePivotTableYAxis = generatePivotTableYAxis;
472
472
  function generatePivotTitle(pivot) {
473
- return (0, ChartBuilder_1.snakeCaseToTitleCase)(`${pivot.aggregationType} of ${pivot.valueField} by ${pivot.rowField}${pivot.columnField ? ` and ${pivot.columnField}` : ''}`);
473
+ return snakeCaseToTitleCase(`${pivot.aggregationType} of ${pivot.valueField} by ${pivot.rowField}${pivot.columnField ? ` and ${pivot.columnField}` : ''}`);
474
474
  }
475
475
  function getDateRange(dateRange, column, data) {
476
476
  if (!dateRange || !dateRange[0]) {
@@ -489,9 +489,9 @@ function getDateRange(dateRange, column, data) {
489
489
  for (let i = 0; i < data.length; i++) {
490
490
  if (data[i][column]) {
491
491
  const value = new Date(data[i][column]);
492
- lastestDate = lastestDate === null ? value : (0, date_fns_1.max)([lastestDate, value]);
492
+ lastestDate = lastestDate === null ? value : max([lastestDate, value]);
493
493
  earliestDate =
494
- earliestDate === null ? value : (0, date_fns_1.min)([earliestDate, value]);
494
+ earliestDate === null ? value : min([earliestDate, value]);
495
495
  }
496
496
  }
497
497
  return { start: earliestDate, end: lastestDate };
@@ -502,20 +502,20 @@ function getDateRange(dateRange, column, data) {
502
502
  }
503
503
  function getDateBuckets(dateRange, column, data) {
504
504
  if (!dateRange || !dateRange[0]) {
505
- return (0, date_fns_1.eachMonthOfInterval)(getDateRange(dateRange, column, data));
505
+ return eachMonthOfInterval(getDateRange(dateRange, column, data));
506
506
  }
507
- const dayDifference = (0, date_fns_1.differenceInDays)(new Date(dateRange[1]), new Date(dateRange[0]));
507
+ const dayDifference = differenceInDays(new Date(dateRange[1]), new Date(dateRange[0]));
508
508
  if (dayDifference < 14) {
509
- return (0, date_fns_1.eachDayOfInterval)({ start: dateRange[0], end: dateRange[1] });
509
+ return eachDayOfInterval({ start: dateRange[0], end: dateRange[1] });
510
510
  }
511
511
  else if (dayDifference < 60) {
512
- return (0, date_fns_1.eachWeekOfInterval)({ start: dateRange[0], end: dateRange[1] }, { weekStartsOn: 1 });
512
+ return eachWeekOfInterval({ start: dateRange[0], end: dateRange[1] }, { weekStartsOn: 1 });
513
513
  }
514
514
  else if (dayDifference < 365 * 3) {
515
- return (0, date_fns_1.eachMonthOfInterval)({ start: dateRange[0], end: dateRange[1] });
515
+ return eachMonthOfInterval({ start: dateRange[0], end: dateRange[1] });
516
516
  }
517
517
  else {
518
- return (0, date_fns_1.eachYearOfInterval)({ start: dateRange[0], end: dateRange[1] });
518
+ return eachYearOfInterval({ start: dateRange[0], end: dateRange[1] });
519
519
  }
520
520
  }
521
521
  function getDateString(value, dateRange) {
@@ -524,7 +524,7 @@ function getDateString(value, dateRange) {
524
524
  format = 'MMM_yyyy';
525
525
  }
526
526
  else {
527
- const dayDifference = (0, date_fns_1.differenceInDays)(new Date(dateRange[1]), new Date(dateRange[0]));
527
+ const dayDifference = differenceInDays(new Date(dateRange[1]), new Date(dateRange[0]));
528
528
  if (dayDifference < 14) {
529
529
  format = 'MMM_dd_yyyy';
530
530
  }
@@ -538,24 +538,23 @@ function getDateString(value, dateRange) {
538
538
  format = 'yyyy';
539
539
  }
540
540
  }
541
- return (0, Chart_1.valueFormatter)({
541
+ return valueFormatter({
542
542
  value,
543
543
  field: 'date',
544
544
  fields: [{ field: 'date', format }],
545
545
  });
546
546
  }
547
- function isDateField(fieldType) {
547
+ export function isDateField(fieldType) {
548
548
  return (fieldType === 'date' ||
549
549
  fieldType === 'datetime' ||
550
550
  fieldType === 'timestamp' ||
551
551
  fieldType === 'timestamptz');
552
552
  }
553
- exports.isDateField = isDateField;
554
- function generatePivotTable(pivot, data, dateRange, rowLimit = -1) {
553
+ export function generatePivotTable(pivot, data, dateRange, rowLimit = -1) {
555
554
  const pivotRows = [];
556
555
  const uniqueRows = isDateField(pivot.rowFieldType)
557
556
  ? getDateBuckets(dateRange, pivot.rowField, data)
558
- : [...new Set(data.map(item => item[pivot.rowField]))];
557
+ : [...new Set(data.map((item) => item[pivot.rowField]))];
559
558
  const rowDateRange = pivot.rowField
560
559
  ? getDateRange(dateRange, pivot.rowField, data)
561
560
  : null;
@@ -566,7 +565,7 @@ function generatePivotTable(pivot, data, dateRange, rowLimit = -1) {
566
565
  const uniqueColumns = pivot.columnField && pivot.columnField.trim()
567
566
  ? isDateField(pivot.columnFieldType)
568
567
  ? getDateBuckets(dateRange, pivot.columnField, data)
569
- : [...new Set(data.map(item => item[pivot.columnField || '']))]
568
+ : [...new Set(data.map((item) => item[pivot.columnField || '']))]
570
569
  : [pivot.valueField];
571
570
  const rowsToGenerate = rowLimit !== -1 && rowLimit <= uniqueRows.length
572
571
  ? uniqueRows.slice(0, rowLimit + 1)
@@ -587,23 +586,23 @@ function generatePivotTable(pivot, data, dateRange, rowLimit = -1) {
587
586
  let filteredData;
588
587
  let value;
589
588
  const nextRowValue = isDateField(pivot.rowFieldType)
590
- ? uniqueRows[rowIndex + 1] || (0, date_fns_1.endOfDay)(rowDateRange.end)
589
+ ? uniqueRows[rowIndex + 1] || endOfDay(rowDateRange.end)
591
590
  : null;
592
591
  if (pivot.columnField) {
593
592
  const nextColumnValue = isDateField(pivot.columnFieldType)
594
- ? uniqueColumns[colIndex + 1] || (0, date_fns_1.endOfDay)(columnDateRange.end)
593
+ ? uniqueColumns[colIndex + 1] || endOfDay(columnDateRange.end)
595
594
  : null;
596
595
  // If columnField is provided, filter by both rowField and columnField
597
596
  if (isDateField(pivot.columnFieldType) &&
598
597
  isDateField(pivot.rowFieldType)) {
599
598
  filteredData = data.filter((item) => {
600
- return ((0, date_fns_1.isWithinInterval)(new Date(item[pivot.rowField]), {
599
+ return (isWithinInterval(new Date(item[pivot.rowField]), {
601
600
  start: rowValue,
602
- end: (0, date_fns_1.subMilliseconds)(nextRowValue, 1),
601
+ end: subMilliseconds(nextRowValue, 1),
603
602
  }) &&
604
- (0, date_fns_1.isWithinInterval)(new Date(item[pivot.columnField]), {
603
+ isWithinInterval(new Date(item[pivot.columnField]), {
605
604
  start: colValue,
606
- end: (0, date_fns_1.subMilliseconds)(nextColumnValue, 1),
605
+ end: subMilliseconds(nextColumnValue, 1),
607
606
  }));
608
607
  });
609
608
  }
@@ -611,18 +610,18 @@ function generatePivotTable(pivot, data, dateRange, rowLimit = -1) {
611
610
  !isDateField(pivot.rowFieldType)) {
612
611
  filteredData = data.filter((item) => {
613
612
  return (item[pivot.rowField] === rowValue &&
614
- (0, date_fns_1.isWithinInterval)(new Date(item[pivot.columnField]), {
613
+ isWithinInterval(new Date(item[pivot.columnField]), {
615
614
  start: colValue,
616
- end: (0, date_fns_1.subMilliseconds)(nextColumnValue, 1),
615
+ end: subMilliseconds(nextColumnValue, 1),
617
616
  }));
618
617
  });
619
618
  }
620
619
  else if (!isDateField(pivot.columnFieldType) &&
621
620
  isDateField(pivot.rowFieldType)) {
622
621
  filteredData = data.filter((item) => {
623
- return ((0, date_fns_1.isWithinInterval)(new Date(item[pivot.rowField]), {
622
+ return (isWithinInterval(new Date(item[pivot.rowField]), {
624
623
  start: rowValue,
625
- end: (0, date_fns_1.subMilliseconds)(nextRowValue, 1),
624
+ end: subMilliseconds(nextRowValue, 1),
626
625
  }) && item[pivot.columnField || ''] === colValue);
627
626
  });
628
627
  }
@@ -636,13 +635,13 @@ function generatePivotTable(pivot, data, dateRange, rowLimit = -1) {
636
635
  else {
637
636
  // If columnField is not provided, filter by rowField only
638
637
  filteredData = isDateField(pivot.rowFieldType)
639
- ? data.filter(item => {
640
- return (0, date_fns_1.isWithinInterval)(new Date(item[pivot.rowField]), {
638
+ ? data.filter((item) => {
639
+ return isWithinInterval(new Date(item[pivot.rowField]), {
641
640
  start: rowValue,
642
- end: (0, date_fns_1.subMilliseconds)(nextRowValue, 1),
641
+ end: subMilliseconds(nextRowValue, 1),
643
642
  });
644
643
  })
645
- : data.filter(item => item[pivot.rowField] === rowValue);
644
+ : data.filter((item) => item[pivot.rowField] === rowValue);
646
645
  }
647
646
  // Aggregation logic remains the same
648
647
  switch (pivot.aggregationType) {
@@ -686,11 +685,9 @@ function generatePivotTable(pivot, data, dateRange, rowLimit = -1) {
686
685
  !pivot.columnField &&
687
686
  index === 1
688
687
  ? 'Count'
689
- : (0, ChartBuilder_1.snakeCaseToTitleCase)(columnName),
688
+ : snakeCaseToTitleCase(columnName),
690
689
  field: columnName,
691
690
  };
692
691
  }),
693
692
  };
694
693
  }
695
- exports.generatePivotTable = generatePivotTable;
696
- //# sourceMappingURL=PivotModal.js.map