@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
package/dist/Dashboard.js CHANGED
@@ -1,48 +1,19 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.QuillDateRangePicker = exports.DashboardFilter = exports.COMPARISON_OPTIONS = void 0;
30
- const jsx_runtime_1 = require("react/jsx-runtime");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
2
  // @ts-nocheck
32
3
  /* eslint-disable @typescript-eslint/ban-ts-comment */
33
- const react_1 = __importStar(require("react"));
34
- const Chart_1 = __importDefault(require("./Chart"));
35
- const dateRangePickerUtils_1 = require("./DateRangePicker/dateRangePickerUtils");
36
- const Context_1 = require("./Context");
37
- const date_fns_1 = require("date-fns");
38
- const Modal_1 = __importDefault(require("./components/Modal/Modal"));
39
- const contexts_1 = require("./contexts");
40
- const Dropdown_1 = require("./components/Dropdown");
41
- const assets_1 = require("./assets");
42
- const hooks_1 = require("./hooks");
43
- const locale_1 = require("date-fns/locale");
44
- const useDashboard_1 = require("./hooks/useDashboard");
45
- exports.COMPARISON_OPTIONS = [
4
+ import React, { useContext, useEffect, useState, useRef, useCallback, } from 'react';
5
+ import Chart from './Chart';
6
+ import { capitalize, defaultOptions, getWeekdays, getRangeFromPreset, PRIMARY_RANGE, COMPARISON_RANGE, } from './DateRangePicker/dateRangePickerUtils';
7
+ import { ClientContext, DashboardContext, ThemeContext, DashboardFiltersContext, DateFilterContext, } from './Context';
8
+ import { addDays, eachDayOfInterval, endOfMonth, format, isAfter, isBefore, isEqual, isSaturday, isSunday, nextSaturday, previousSunday, startOfMonth, startOfToday, startOfWeek, startOfYear, sub, subDays, } from 'date-fns';
9
+ import Modal from './components/Modal/Modal';
10
+ import { HoveredValueContext, SelectedValueContext } from './contexts';
11
+ import { DropdownItem } from './components/Dropdown';
12
+ import { ArrowDownHeadIcon, ArrowLeftHeadIcon, ArrowRightHeadIcon, CalendarNormalIcon, } from './assets';
13
+ import { useInternalState, useOnClickOutside, useSelectOnKeyDown, } from './hooks';
14
+ import { enUS } from 'date-fns/locale';
15
+ import { useDashboard } from './hooks/useDashboard';
16
+ export const COMPARISON_OPTIONS = [
46
17
  {
47
18
  value: 'PREV_PERIOD',
48
19
  text: 'Previous Period',
@@ -64,10 +35,10 @@ exports.COMPARISON_OPTIONS = [
64
35
  text: 'No comparison',
65
36
  },
66
37
  ];
67
- function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateRangePickerComponent, theme, }) {
68
- const [comparisonValue, setComparisonValue] = (0, react_1.useState)('');
69
- const [filterValue, setFilterValue] = (0, react_1.useState)(null);
70
- (0, react_1.useEffect)(() => {
38
+ export function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateRangePickerComponent, theme, }) {
39
+ const [comparisonValue, setComparisonValue] = useState('');
40
+ const [filterValue, setFilterValue] = useState(null);
41
+ useEffect(() => {
71
42
  if (filter.filterType === 'date_range' &&
72
43
  !filter.selectedValue &&
73
44
  !filterValue) {
@@ -80,13 +51,13 @@ function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateRangePic
80
51
  setFilterValue(filter.selectedValue);
81
52
  }
82
53
  if (filter.comparison) {
83
- setComparisonValue(exports.COMPARISON_OPTIONS.find((option) => {
54
+ setComparisonValue(COMPARISON_OPTIONS.find((option) => {
84
55
  return option.value === filter.comparisonRange.value;
85
56
  }).value);
86
57
  }
87
58
  }, [filter]);
88
59
  if (filter.filterType === 'string') {
89
- return ((0, jsx_runtime_1.jsx)(SelectComponent, { label: filter.label, value: filterValue, onChange: (e) => {
60
+ return (_jsx(SelectComponent, { label: filter.label, value: filterValue, onChange: (e) => {
90
61
  onChangeFilter(filter, e);
91
62
  }, options: [
92
63
  ...filter.options.map((elem) => {
@@ -98,11 +69,11 @@ function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateRangePic
98
69
  ] }));
99
70
  }
100
71
  if (filter.filterType == 'date_range') {
101
- return ((0, jsx_runtime_1.jsxs)("div", { style: {
72
+ return (_jsxs("div", { style: {
102
73
  display: 'flex',
103
74
  flexDirection: 'row',
104
75
  alignItems: 'flex-end',
105
- }, children: [(0, jsx_runtime_1.jsx)(DateRangePickerComponent, { dateRange: filterValue ? [filterValue[0], filterValue[1]] : [null, null], label: filter.label,
76
+ }, children: [_jsx(DateRangePickerComponent, { dateRange: filterValue ? [filterValue[0], filterValue[1]] : [null, null], label: filter.label,
106
77
  // value={filterValue}
107
78
  onChangeDateRange: (dateRange) => {
108
79
  onChangeFilter(filter, [dateRange[0], dateRange[1], null]);
@@ -111,7 +82,7 @@ function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateRangePic
111
82
  ? filterValue[2]
112
83
  : '', onChangePreset: (preset) => {
113
84
  if (typeof preset === 'string') {
114
- const fullPreset = (0, dateRangePickerUtils_1.getRangeFromPreset)(preset);
85
+ const fullPreset = getRangeFromPreset(preset);
115
86
  onChangeFilter(filter, fullPreset);
116
87
  setFilterValue(fullPreset);
117
88
  return;
@@ -126,19 +97,19 @@ function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateRangePic
126
97
  new Date(),
127
98
  preset?.value || '',
128
99
  ]);
129
- }, presetOptions: dateRangePickerUtils_1.defaultOptions }), filter.comparison && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
100
+ }, presetOptions: defaultOptions }), filter.comparison && (_jsx("div", { children: _jsxs("div", { style: {
130
101
  display: 'flex',
131
102
  flexDirection: 'row',
132
103
  alignItems: 'center',
133
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
104
+ }, children: [_jsx("div", { style: {
134
105
  paddingLeft: 16,
135
106
  paddingRight: 12,
136
107
  color: theme.secondaryTextColor,
137
- }, children: "compared to" }), (0, jsx_runtime_1.jsx)(SelectComponent, { value: comparisonValue, onChange: (e) => {
138
- onChangeFilter(filter, null, exports.COMPARISON_OPTIONS.find((option) => {
108
+ }, children: "compared to" }), _jsx(SelectComponent, { value: comparisonValue, onChange: (e) => {
109
+ onChangeFilter(filter, null, COMPARISON_OPTIONS.find((option) => {
139
110
  return option.value === e;
140
111
  }));
141
- }, options: exports.COMPARISON_OPTIONS.map((compareOption) => {
112
+ }, options: COMPARISON_OPTIONS.map((compareOption) => {
142
113
  return {
143
114
  value: compareOption.value,
144
115
  label: compareOption.text,
@@ -147,45 +118,44 @@ function DashboardFilter({ filter, onChangeFilter, SelectComponent, DateRangePic
147
118
  }
148
119
  return null;
149
120
  }
150
- exports.DashboardFilter = DashboardFilter;
151
121
  const options = [
152
122
  {
153
- date_range: [(0, date_fns_1.startOfWeek)((0, date_fns_1.startOfToday)()), (0, date_fns_1.startOfToday)(), 'wk'],
123
+ date_range: [startOfWeek(startOfToday()), startOfToday(), 'wk'],
154
124
  },
155
125
  {
156
- date_range: [(0, date_fns_1.sub)((0, date_fns_1.startOfToday)(), { days: 90 }), (0, date_fns_1.startOfToday)(), '90d'],
126
+ date_range: [sub(startOfToday(), { days: 90 }), startOfToday(), '90d'],
157
127
  },
158
128
  {
159
- date_range: [(0, date_fns_1.sub)((0, date_fns_1.startOfToday)(), { days: 30 }), (0, date_fns_1.startOfToday)(), 't'],
129
+ date_range: [sub(startOfToday(), { days: 30 }), startOfToday(), 't'],
160
130
  },
161
131
  {
162
- date_range: [(0, date_fns_1.sub)((0, date_fns_1.startOfToday)(), { years: 100 }), (0, date_fns_1.startOfToday)(), 'at'],
132
+ date_range: [sub(startOfToday(), { years: 100 }), startOfToday(), 'at'],
163
133
  },
164
134
  {
165
- date_range: [(0, date_fns_1.startOfYear)((0, date_fns_1.startOfToday)()), (0, date_fns_1.startOfToday)(), 'y'],
135
+ date_range: [startOfYear(startOfToday()), startOfToday(), 'y'],
166
136
  },
167
137
  {
168
- date_range: [(0, date_fns_1.startOfMonth)((0, date_fns_1.startOfToday)()), (0, date_fns_1.startOfToday)(), 'm'],
138
+ date_range: [startOfMonth(startOfToday()), startOfToday(), 'm'],
169
139
  },
170
140
  {
171
- date_range: [(0, date_fns_1.sub)((0, date_fns_1.startOfToday)(), { days: 7 }), (0, date_fns_1.startOfToday)(), 'w'],
141
+ date_range: [sub(startOfToday(), { days: 7 }), startOfToday(), 'w'],
172
142
  },
173
143
  {
174
- date_range: [(0, date_fns_1.sub)((0, date_fns_1.startOfToday)(), { months: 6 }), (0, date_fns_1.startOfToday)(), '6m'],
144
+ date_range: [sub(startOfToday(), { months: 6 }), startOfToday(), '6m'],
175
145
  },
176
146
  ];
177
147
  const QuillDropdownComponent = ({ onChange, value, label, options, }) => {
178
- const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
179
- const handleOnChange = (0, react_1.useCallback)((event) => {
148
+ const [theme] = useContext(ThemeContext);
149
+ const handleOnChange = useCallback((event) => {
180
150
  onChange(event.target.value);
181
151
  }, [onChange]);
182
- return ((0, jsx_runtime_1.jsxs)("div", { children: [label && ((0, jsx_runtime_1.jsx)("div", { style: {
152
+ return (_jsxs("div", { children: [label && (_jsx("div", { style: {
183
153
  marginBottom: 6,
184
154
  fontWeight: theme.labelFontWeight || '600',
185
155
  color: theme.secondaryTextColor,
186
156
  fontFamily: theme.fontFamily,
187
157
  fontSize: 14,
188
- }, children: label })), (0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', height: 38 }, children: [(0, jsx_runtime_1.jsxs)("select", { onChange: handleOnChange, value: value ?? '', id: 'reportbuilderdropdown',
158
+ }, children: label })), _jsxs("div", { style: { position: 'relative', height: 38 }, children: [_jsxs("select", { onChange: handleOnChange, value: value ?? '', id: 'reportbuilderdropdown',
189
159
  // defaultValue="Select"
190
160
  style: {
191
161
  width: '100%',
@@ -209,7 +179,7 @@ const QuillDropdownComponent = ({ onChange, value, label, options, }) => {
209
179
  fontSize: 14,
210
180
  fontWeight: 500,
211
181
  boxSizing: 'border-box',
212
- }, children: [(0, jsx_runtime_1.jsx)("option", { value: "", children: "Select" }), options.map((option, index) => ((0, jsx_runtime_1.jsx)("option", { value: option.value, children: option.label }, option.label + index)))] }), (0, jsx_runtime_1.jsx)(assets_1.ArrowDownHeadIcon, { style: {
182
+ }, children: [_jsx("option", { value: "", children: "Select" }), options.map((option, index) => (_jsx("option", { value: option.value, children: option.label }, option.label + index)))] }), _jsx(ArrowDownHeadIcon, { style: {
213
183
  height: '20px',
214
184
  width: '20px',
215
185
  flex: 'none',
@@ -220,27 +190,27 @@ const QuillDropdownComponent = ({ onChange, value, label, options, }) => {
220
190
  }, "aria-hidden": "true" })] })] }));
221
191
  };
222
192
  const isBetween = (date, startDate, endDate) => {
223
- return (0, date_fns_1.isAfter)(date, startDate) && (0, date_fns_1.isBefore)(date, endDate);
193
+ return isAfter(date, startDate) && isBefore(date, endDate);
224
194
  };
225
195
  function Calendar({ anchorDate, selectedDateRange, onClickDate, theme, localStartDate, localEndDate, }) {
226
- const firstDayOfDisplayedMonth = (0, date_fns_1.startOfMonth)(anchorDate);
227
- const lastDayOfDisplayedMonth = (0, date_fns_1.endOfMonth)(anchorDate);
228
- const weekdays = (0, dateRangePickerUtils_1.getWeekdays)(locale_1.enUS).map((dayName) => (0, dateRangePickerUtils_1.capitalize)(dayName, locale_1.enUS));
229
- const displayedDates = (0, date_fns_1.eachDayOfInterval)({
230
- start: (0, date_fns_1.isSunday)(firstDayOfDisplayedMonth)
196
+ const firstDayOfDisplayedMonth = startOfMonth(anchorDate);
197
+ const lastDayOfDisplayedMonth = endOfMonth(anchorDate);
198
+ const weekdays = getWeekdays(enUS).map((dayName) => capitalize(dayName, enUS));
199
+ const displayedDates = eachDayOfInterval({
200
+ start: isSunday(firstDayOfDisplayedMonth)
231
201
  ? firstDayOfDisplayedMonth
232
- : (0, date_fns_1.previousSunday)(firstDayOfDisplayedMonth),
233
- end: (0, date_fns_1.isSaturday)(lastDayOfDisplayedMonth)
202
+ : previousSunday(firstDayOfDisplayedMonth),
203
+ end: isSaturday(lastDayOfDisplayedMonth)
234
204
  ? lastDayOfDisplayedMonth
235
- : (0, date_fns_1.nextSaturday)(lastDayOfDisplayedMonth),
205
+ : nextSaturday(lastDayOfDisplayedMonth),
236
206
  });
237
- const displayedTitle = (0, dateRangePickerUtils_1.capitalize)((0, date_fns_1.format)(firstDayOfDisplayedMonth, 'MMMM yyyy', { locale: locale_1.enUS }), locale_1.enUS);
238
- return ((0, jsx_runtime_1.jsxs)("div", { style: {
207
+ const displayedTitle = capitalize(format(firstDayOfDisplayedMonth, 'MMMM yyyy', { locale: enUS }), enUS);
208
+ return (_jsxs("div", { style: {
239
209
  display: 'flex',
240
210
  flexDirection: 'column',
241
211
  flex: 1,
242
212
  // alignItems: 'center',
243
- }, children: [(0, jsx_runtime_1.jsx)("h2", { style: {
213
+ }, children: [_jsx("h2", { style: {
244
214
  color: theme?.textColor || '#364153',
245
215
  fontSize: '13px',
246
216
  fontFamily: theme?.fontFamily,
@@ -254,7 +224,7 @@ function Calendar({ anchorDate, selectedDateRange, onClickDate, theme, localStar
254
224
  justifyContent: 'center',
255
225
  marginBottom: 3,
256
226
  marginTop: 6,
257
- }, children: displayedTitle }), (0, jsx_runtime_1.jsx)("div", { style: {
227
+ }, children: displayedTitle }), _jsx("div", { style: {
258
228
  color: theme?.primaryTextColor || '#364153',
259
229
  textAlign: 'center',
260
230
  fontSize: 12,
@@ -262,7 +232,7 @@ function Calendar({ anchorDate, selectedDateRange, onClickDate, theme, localStar
262
232
  display: 'grid',
263
233
  gridTemplateColumns: 'repeat(7, minmax(0, 1fr))',
264
234
  paddingTop: 6,
265
- }, children: weekdays.map((dayName) => ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%', display: 'flex', justifyContent: 'center' }, children: (0, jsx_runtime_1.jsx)("div", { style: {
235
+ }, children: weekdays.map((dayName) => (_jsx("div", { style: { width: '100%', display: 'flex', justifyContent: 'center' }, children: _jsx("div", { style: {
266
236
  display: 'flex',
267
237
  alignItems: 'center',
268
238
  justifyContent: 'center',
@@ -271,7 +241,7 @@ function Calendar({ anchorDate, selectedDateRange, onClickDate, theme, localStar
271
241
  fontFamily: theme?.fontFamily,
272
242
  color: theme.secondaryTextColor,
273
243
  paddingBottom: 4,
274
- }, children: dayName }) }, dayName))) }), (0, jsx_runtime_1.jsx)("div", { style: {
244
+ }, children: dayName }) }, dayName))) }), _jsx("div", { style: {
275
245
  display: 'grid',
276
246
  gridTemplateColumns: 'repeat(7, minmax(0, 1fr))',
277
247
  borderRadius: 3,
@@ -286,7 +256,7 @@ function Calendar({ anchorDate, selectedDateRange, onClickDate, theme, localStar
286
256
  // lastDayOfDisplayedMonth
287
257
  // );
288
258
  // console.log(localStartDate === date, localStartDate, date);
289
- return ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)("button", { style: {
259
+ return (_jsx("div", { style: { width: '100%' }, children: _jsx("button", { style: {
290
260
  border: 'none',
291
261
  height: '34px',
292
262
  display: 'flex',
@@ -295,22 +265,22 @@ function Calendar({ anchorDate, selectedDateRange, onClickDate, theme, localStar
295
265
  justifyContent: 'center',
296
266
  fontFamily: theme?.fontFamily,
297
267
  fontSize: 13,
298
- background: (0, date_fns_1.isEqual)(localStartDate, date) || (0, date_fns_1.isEqual)(localEndDate, date)
268
+ background: isEqual(localStartDate, date) || isEqual(localEndDate, date)
299
269
  ? theme.primaryTextColor
300
270
  : isBetween(date, localStartDate, localEndDate)
301
271
  ? '#F4F4F5'
302
272
  : 'transparent',
303
- color: (0, date_fns_1.isEqual)(localStartDate, date) || (0, date_fns_1.isEqual)(localEndDate, date)
273
+ color: isEqual(localStartDate, date) || isEqual(localEndDate, date)
304
274
  ? theme.backgroundColor
305
275
  : theme.primaryTextColor,
306
- borderRadius: (0, date_fns_1.isEqual)(localStartDate, date) || (0, date_fns_1.isEqual)(localEndDate, date)
276
+ borderRadius: isEqual(localStartDate, date) || isEqual(localEndDate, date)
307
277
  ? 3
308
278
  : 0,
309
279
  ...isBeginningOrEndOfWeek(index),
310
280
  }, type: "button", onClick: () => {
311
281
  onClickDate(date);
312
- }, children: (0, jsx_runtime_1.jsx)("time", { dateTime: (0, date_fns_1.format)(date, 'yyyy-MM-dd', { locale: locale_1.enUS }), children: (0, date_fns_1.format)(date, 'd', { locale: locale_1.enUS }) }) }) }, date.toString()));
313
- }) }), (0, jsx_runtime_1.jsx)("div", { style: { height: 8 } })] }));
282
+ }, children: _jsx("time", { dateTime: format(date, 'yyyy-MM-dd', { locale: enUS }), children: format(date, 'd', { locale: enUS }) }) }) }, date.toString()));
283
+ }) }), _jsx("div", { style: { height: 8 } })] }));
314
284
  }
315
285
  function isBeginningOrEndOfWeek(num) {
316
286
  // Check if the number is 0
@@ -327,48 +297,48 @@ function isBeginningOrEndOfWeek(num) {
327
297
  }
328
298
  const formatDateText = (dateRange, localStartDate, localEndDate) => {
329
299
  if (dateRange.length && dateRange[0] && dateRange[1]) {
330
- return ((0, date_fns_1.format)(dateRange[0], 'MMM dd, yyyy') +
300
+ return (format(dateRange[0], 'MMM dd, yyyy') +
331
301
  ' - ' +
332
- (0, date_fns_1.format)(dateRange[1], 'MMM dd, yyyy'));
302
+ format(dateRange[1], 'MMM dd, yyyy'));
333
303
  }
334
304
  if (localStartDate && localEndDate) {
335
- return ((0, date_fns_1.format)(localStartDate, 'MMM dd, yyyy') +
305
+ return (format(localStartDate, 'MMM dd, yyyy') +
336
306
  ' - ' +
337
- (0, date_fns_1.format)(localEndDate, 'MMM dd, yyyy'));
307
+ format(localEndDate, 'MMM dd, yyyy'));
338
308
  }
339
309
  return '';
340
310
  };
341
311
  function CalendarDropdown({ onChangeDateRange, dateRange }) {
342
- const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
343
- const [showModal, setShowModal] = (0, react_1.useState)(false);
344
- const modalRef = (0, react_1.useRef)(null);
345
- const parentRef = (0, react_1.useRef)(null);
346
- const handleOnChange = (0, react_1.useCallback)((event) => {
312
+ const [theme] = useContext(ThemeContext);
313
+ const [showModal, setShowModal] = useState(false);
314
+ const modalRef = useRef(null);
315
+ const parentRef = useRef(null);
316
+ const handleOnChange = useCallback((event) => {
347
317
  onChangeDateRange(event.target.value);
348
318
  }, [onChangeDateRange]);
349
- const [anchorDate, setAnchorDate] = (0, react_1.useState)(null);
350
- const [localStartDate, setLocalStartDate] = (0, react_1.useState)(null);
351
- const [localEndDate, setLocalEndDate] = (0, react_1.useState)(null);
319
+ const [anchorDate, setAnchorDate] = useState(null);
320
+ const [localStartDate, setLocalStartDate] = useState(null);
321
+ const [localEndDate, setLocalEndDate] = useState(null);
352
322
  // const firstDayOfFirstMonth = startOfMonth(value[0]);
353
323
  // const lastDayOfLastMonth = endOfMonth(value[1]);
354
324
  // const weekdays = getWeekdays(enUS).map(dayName =>
355
325
  // capitalize(dayName, locale)
356
326
  // );
357
- const prevMonthAnchor = (0, date_fns_1.subDays)((0, date_fns_1.startOfMonth)(anchorDate), 1);
327
+ const prevMonthAnchor = subDays(startOfMonth(anchorDate), 1);
358
328
  const onClickDate = (date) => {
359
- if (localStartDate && (0, date_fns_1.isBefore)(date, localStartDate)) {
329
+ if (localStartDate && isBefore(date, localStartDate)) {
360
330
  setLocalStartDate(date);
361
331
  return;
362
332
  }
363
- if (localEndDate && (0, date_fns_1.isAfter)(date, localEndDate)) {
333
+ if (localEndDate && isAfter(date, localEndDate)) {
364
334
  setLocalEndDate(date);
365
335
  return;
366
336
  }
367
- if (localEndDate && (0, date_fns_1.isBefore)(date, localEndDate)) {
337
+ if (localEndDate && isBefore(date, localEndDate)) {
368
338
  setLocalEndDate(date);
369
339
  return;
370
340
  }
371
- if ((0, date_fns_1.isEqual)(localStartDate, date) || (0, date_fns_1.isEqual)(localEndDate, date)) {
341
+ if (isEqual(localStartDate, date) || isEqual(localEndDate, date)) {
372
342
  setLocalStartDate(null);
373
343
  setLocalEndDate(null);
374
344
  }
@@ -381,19 +351,19 @@ function CalendarDropdown({ onChangeDateRange, dateRange }) {
381
351
  return;
382
352
  }
383
353
  };
384
- (0, react_1.useEffect)(() => {
354
+ useEffect(() => {
385
355
  if (localEndDate &&
386
356
  localStartDate &&
387
- (0, date_fns_1.isBefore)(localStartDate, localEndDate)) {
357
+ isBefore(localStartDate, localEndDate)) {
388
358
  onChangeDateRange([localStartDate, localEndDate]);
389
359
  }
390
360
  }, [localEndDate, localStartDate]);
391
- (0, react_1.useEffect)(() => {
361
+ useEffect(() => {
392
362
  if (dateRange.length && !anchorDate) {
393
363
  setAnchorDate(dateRange[1]);
394
364
  }
395
365
  }, [dateRange, anchorDate]);
396
- (0, hooks_1.useOnClickOutside)(modalRef, (e) => {
366
+ useOnClickOutside(modalRef, (e) => {
397
367
  // Exclude click on trigger button (e.g. Dropdown Button) from outside click handler
398
368
  const isTriggerElem = parentRef
399
369
  ? parentRef.current?.contains(e.target)
@@ -402,7 +372,7 @@ function CalendarDropdown({ onChangeDateRange, dateRange }) {
402
372
  setShowModal(false);
403
373
  }
404
374
  });
405
- return ((0, jsx_runtime_1.jsxs)("div", { ref: parentRef, style: { position: 'relative', height: 38 }, children: [(0, jsx_runtime_1.jsx)("button", {
375
+ return (_jsxs("div", { ref: parentRef, style: { position: 'relative', height: 38 }, children: [_jsx("button", {
406
376
  // onChange={handleOnChange}
407
377
  // value={value}
408
378
  onClick: () => setShowModal((showModal) => !showModal), id: 'reportbuilderdropdown', defaultValue: "Select", style: {
@@ -431,7 +401,7 @@ function CalendarDropdown({ onChangeDateRange, dateRange }) {
431
401
  minHeight: 38,
432
402
  marginBottom: 0,
433
403
  paddingLeft: 14 + 15 + 3,
434
- }, children: formatDateText(dateRange, localStartDate, localEndDate) }), (0, jsx_runtime_1.jsx)(assets_1.CalendarNormalIcon, { style: {
404
+ }, children: formatDateText(dateRange, localStartDate, localEndDate) }), _jsx(CalendarNormalIcon, { style: {
435
405
  height: '15px',
436
406
  width: '15px',
437
407
  flex: 'none',
@@ -439,7 +409,7 @@ function CalendarDropdown({ onChangeDateRange, dateRange }) {
439
409
  left: 12,
440
410
  top: 11,
441
411
  color: theme?.primaryTextColor,
442
- } }), showModal && ((0, jsx_runtime_1.jsxs)("div", { ref: modalRef, style: {
412
+ } }), showModal && (_jsxs("div", { ref: modalRef, style: {
443
413
  position: 'absolute',
444
414
  zIndex: 1,
445
415
  overflowY: 'auto',
@@ -469,7 +439,7 @@ function CalendarDropdown({ onChangeDateRange, dateRange }) {
469
439
  paddingLeft: 8,
470
440
  paddingRight: 8,
471
441
  paddingBottom: 1,
472
- }, children: [(0, jsx_runtime_1.jsx)("button", { style: {
442
+ }, children: [_jsx("button", { style: {
473
443
  height: 32,
474
444
  width: 32,
475
445
  position: 'absolute',
@@ -489,11 +459,11 @@ function CalendarDropdown({ onChangeDateRange, dateRange }) {
489
459
  alignItems: 'center',
490
460
  justifyContent: 'center',
491
461
  background: 'transparent',
492
- }, onClick: () => setAnchorDate((date) => (0, date_fns_1.subDays)((0, date_fns_1.startOfMonth)(date), 1)), children: (0, jsx_runtime_1.jsx)(assets_1.ArrowLeftHeadIcon, { style: {
462
+ }, onClick: () => setAnchorDate((date) => subDays(startOfMonth(date), 1)), children: _jsx(ArrowLeftHeadIcon, { style: {
493
463
  height: '20px',
494
464
  width: '20px',
495
465
  color: theme?.secondaryTextColor,
496
- }, "aria-hidden": "true" }) }), (0, jsx_runtime_1.jsx)("button", { style: {
466
+ }, "aria-hidden": "true" }) }), _jsx("button", { style: {
497
467
  height: 32,
498
468
  width: 32,
499
469
  borderColor: theme?.borderColor || '#E5E7EB',
@@ -513,33 +483,32 @@ function CalendarDropdown({ onChangeDateRange, dateRange }) {
513
483
  alignItems: 'center',
514
484
  justifyContent: 'center',
515
485
  background: 'transparent',
516
- }, onClick: () => setAnchorDate((date) => (0, date_fns_1.addDays)((0, date_fns_1.endOfMonth)(date), 1)), children: (0, jsx_runtime_1.jsx)(assets_1.ArrowRightHeadIcon, { style: {
486
+ }, onClick: () => setAnchorDate((date) => addDays(endOfMonth(date), 1)), children: _jsx(ArrowRightHeadIcon, { style: {
517
487
  height: '20px',
518
488
  width: '20px',
519
489
  color: theme?.secondaryTextColor,
520
- }, "aria-hidden": "true" }) }), anchorDate && ((0, jsx_runtime_1.jsx)(Calendar, { anchorDate: prevMonthAnchor, dateRange: dateRange, theme: theme, onClickDate: onClickDate, localStartDate: localStartDate, localEndDate: localEndDate })), anchorDate && ((0, jsx_runtime_1.jsx)(Calendar, { anchorDate: anchorDate, dateRange: dateRange, theme: theme, onClickDate: onClickDate, localStartDate: localStartDate, localEndDate: localEndDate }))] }))] }));
490
+ }, "aria-hidden": "true" }) }), anchorDate && (_jsx(Calendar, { anchorDate: prevMonthAnchor, dateRange: dateRange, theme: theme, onClickDate: onClickDate, localStartDate: localStartDate, localEndDate: localEndDate })), anchorDate && (_jsx(Calendar, { anchorDate: anchorDate, dateRange: dateRange, theme: theme, onClickDate: onClickDate, localStartDate: localStartDate, localEndDate: localEndDate }))] }))] }));
521
491
  }
522
- const QuillDateRangePicker = ({ label, dateRange, onChangeDateRange, presetOptions, preset, onChangePreset, }) => {
523
- const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
524
- return ((0, jsx_runtime_1.jsxs)("div", { children: [label !== '' && ((0, jsx_runtime_1.jsx)("div", { style: {
492
+ export const QuillDateRangePicker = ({ label, dateRange, onChangeDateRange, presetOptions, preset, onChangePreset, }) => {
493
+ const [theme] = useContext(ThemeContext);
494
+ return (_jsxs("div", { children: [label !== '' && (_jsx("div", { style: {
525
495
  marginBottom: 6,
526
496
  fontWeight: theme.labelFontWeight || '600',
527
497
  color: theme.secondaryTextColor,
528
498
  fontFamily: theme.fontFamily,
529
499
  fontSize: 14,
530
- }, children: label })), (0, jsx_runtime_1.jsxs)("div", { style: {
500
+ }, children: label })), _jsxs("div", { style: {
531
501
  display: 'flex',
532
502
  flexDirection: 'row',
533
503
  alignItems: 'center',
534
504
  gap: 12,
535
- }, children: [(0, jsx_runtime_1.jsx)(MemoizedCalendarDropdown, { dateRange: dateRange, onChangeDateRange: onChangeDateRange, theme: theme }), (0, jsx_runtime_1.jsx)(MemoizedDropdown, { options: presetOptions.map((option) => ({
505
+ }, children: [_jsx(MemoizedCalendarDropdown, { dateRange: dateRange, onChangeDateRange: onChangeDateRange, theme: theme }), _jsx(MemoizedDropdown, { options: presetOptions.map((option) => ({
536
506
  label: option.text,
537
507
  value: option.value,
538
508
  })), onChange: onChangePreset, value: preset })] })] }));
539
509
  };
540
- exports.QuillDateRangePicker = QuillDateRangePicker;
541
- const MemoizedCalendarDropdown = react_1.default.memo(CalendarDropdown);
542
- const MemoizedDropdown = react_1.default.memo(QuillDropdownComponent);
510
+ const MemoizedCalendarDropdown = React.memo(CalendarDropdown);
511
+ const MemoizedDropdown = React.memo(QuillDropdownComponent);
543
512
  const areEqual = (prevProps, nextProps) => {
544
513
  // This function returns true if passing nextProps to render would return
545
514
  // the same result as passing prevProps to render, otherwise it returns false
@@ -548,25 +517,25 @@ const areEqual = (prevProps, nextProps) => {
548
517
  prevProps.dateRange[0] === nextProps.dateRange[0] &&
549
518
  prevProps.dateRange[1] === nextProps.dateRange[1]);
550
519
  };
551
- const MemoizedDateRangePicker = react_1.default.memo(exports.QuillDateRangePicker, areEqual);
552
- function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerStyle, maxColumnWidth, rowHeight, onClickDashboardItem, hideFilters, FilterDropdownComponent, DateRangePickerComponent, FilterButtonComponent, FilterModalComponent, onChangeLoading, DashboardItemComponent, }) {
553
- const { isLoading: isDataLoading, data, reload } = (0, useDashboard_1.useDashboard)(name);
554
- const [dashboardSections, setDashboardSections] = (0, react_1.useState)(null);
555
- const { dashboard } = (0, react_1.useContext)(Context_1.DashboardContext);
556
- const [client] = (0, react_1.useContext)(Context_1.ClientContext);
557
- const [isLoading, setIsLoading] = (0, react_1.useState)(isDataLoading);
558
- const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
559
- const { dashboardFilters, dashboardFiltersDispatch } = (0, react_1.useContext)(Context_1.DashboardFiltersContext);
560
- const { setDateFilter } = (0, react_1.useContext)(Context_1.DateFilterContext);
561
- (0, react_1.useEffect)(() => {
520
+ const MemoizedDateRangePicker = React.memo(QuillDateRangePicker, areEqual);
521
+ export default function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerStyle, maxColumnWidth, rowHeight, onClickDashboardItem, hideFilters, FilterDropdownComponent, DateRangePickerComponent, FilterButtonComponent, FilterModalComponent, onChangeLoading, DashboardItemComponent, }) {
522
+ const { isLoading: isDataLoading, data, reload } = useDashboard(name);
523
+ const [dashboardSections, setDashboardSections] = useState(null);
524
+ const { dashboard } = useContext(DashboardContext);
525
+ const [client] = useContext(ClientContext);
526
+ const [isLoading, setIsLoading] = useState(isDataLoading);
527
+ const [theme] = useContext(ThemeContext);
528
+ const { dashboardFilters, dashboardFiltersDispatch } = useContext(DashboardFiltersContext);
529
+ const { setDateFilter } = useContext(DateFilterContext);
530
+ useEffect(() => {
562
531
  setIsLoading(isDataLoading);
563
532
  }, [isDataLoading]);
564
- (0, react_1.useEffect)(() => {
533
+ useEffect(() => {
565
534
  if (!data)
566
535
  return;
567
536
  onDashboardDataChange(data);
568
537
  }, [data]);
569
- (0, react_1.useEffect)(() => {
538
+ useEffect(() => {
570
539
  reload();
571
540
  }, [name, client]);
572
541
  const onDashboardDataChange = (resp) => {
@@ -576,12 +545,12 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
576
545
  const key = 'LAST_6_MONTHS';
577
546
  const code = '6m';
578
547
  const filter = {
579
- startDate: dateRangePickerUtils_1.PRIMARY_RANGE[key]?.start,
580
- endDate: dateRangePickerUtils_1.PRIMARY_RANGE[key]?.end,
548
+ startDate: PRIMARY_RANGE[key]?.start,
549
+ endDate: PRIMARY_RANGE[key]?.end,
581
550
  filterType: 'date_range',
582
551
  selectedValue: [
583
- dateRangePickerUtils_1.PRIMARY_RANGE[key]?.start,
584
- dateRangePickerUtils_1.PRIMARY_RANGE[key]?.end,
552
+ PRIMARY_RANGE[key]?.start,
553
+ PRIMARY_RANGE[key]?.end,
585
554
  code,
586
555
  ],
587
556
  options: options,
@@ -592,8 +561,8 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
592
561
  filter.comparison = true;
593
562
  const range = { start: filter.startDate, end: filter.endDate };
594
563
  filter.comparisonRange = {
595
- startDate: dateRangePickerUtils_1.COMPARISON_RANGE['PREV_PERIOD'](range)?.start,
596
- endDate: dateRangePickerUtils_1.COMPARISON_RANGE['PREV_PERIOD'](range)?.end,
564
+ startDate: COMPARISON_RANGE['PREV_PERIOD'](range)?.start,
565
+ endDate: COMPARISON_RANGE['PREV_PERIOD'](range)?.end,
597
566
  value: 'PREV_PERIOD',
598
567
  };
599
568
  }
@@ -737,8 +706,8 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
737
706
  label: 'Date',
738
707
  comparison: true,
739
708
  comparisonRange: {
740
- startDate: dateRangePickerUtils_1.COMPARISON_RANGE[key](primaryRange)?.start,
741
- endDate: dateRangePickerUtils_1.COMPARISON_RANGE[key](primaryRange)?.end,
709
+ startDate: COMPARISON_RANGE[key](primaryRange)?.start,
710
+ endDate: COMPARISON_RANGE[key](primaryRange)?.end,
742
711
  value: key,
743
712
  },
744
713
  },
@@ -762,7 +731,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
762
731
  }
763
732
  }
764
733
  };
765
- (0, react_1.useEffect)(() => {
734
+ useEffect(() => {
766
735
  if (dashboardSections && dashboard) {
767
736
  const totalNumberOfItems = Object.values(dashboardSections).reduce((count, arr) => count + arr.length, 0);
768
737
  const itemsLoaded = Object.keys(dashboard).length;
@@ -771,20 +740,19 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
771
740
  }
772
741
  }
773
742
  }, [dashboard, dashboardSections, isLoading]);
774
- (0, react_1.useEffect)(() => {
743
+ useEffect(() => {
775
744
  if (onChangeLoading) {
776
745
  onChangeLoading(isLoading);
777
746
  }
778
747
  }, [isLoading, onChangeLoading]);
779
- if (!dashboardSections) {
748
+ if (!dashboardSections)
780
749
  return null;
781
- }
782
- return ((0, jsx_runtime_1.jsxs)("div", { style: containerStyle, children: [!hideFilters ? ((0, jsx_runtime_1.jsx)("div", { style: {
750
+ return (_jsxs("div", { style: containerStyle, children: [!hideFilters ? (_jsx("div", { style: {
783
751
  display: 'flex',
784
752
  boxSizing: 'content-box',
785
753
  flexDirection: 'row',
786
754
  alignItems: 'center',
787
- }, children: (0, jsx_runtime_1.jsx)("div", { style: {
755
+ }, children: _jsx("div", { style: {
788
756
  width: '100%',
789
757
  marginBottom: 25,
790
758
  display: 'flex',
@@ -793,7 +761,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
793
761
  gap: 12,
794
762
  }, children: Object.values(dashboardFilters)
795
763
  .sort((filter) => (filter.filterType === 'date_range' ? -1 : 1))
796
- .map((filter, index) => ((0, jsx_runtime_1.jsx)(DashboardFilter, { filter: filter, onChangeFilter: updateFilter, theme: theme, filterValue: dashboardFilters, SelectComponent: FilterDropdownComponent
764
+ .map((filter, index) => (_jsx(DashboardFilter, { filter: filter, onChangeFilter: updateFilter, theme: theme, filterValue: dashboardFilters, SelectComponent: FilterDropdownComponent
797
765
  ? FilterDropdownComponent
798
766
  : MemoizedDropdown, DateRangePickerComponent: DateRangePickerComponent
799
767
  ? DateRangePickerComponent
@@ -802,9 +770,9 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
802
770
  return a.length - b.length;
803
771
  })
804
772
  .map((section, sectionIndex) => {
805
- return ((0, jsx_runtime_1.jsxs)("div", { style: {
773
+ return (_jsxs("div", { style: {
806
774
  width: '100%',
807
- }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { height: sectionIndex > 0 ? 25 : 0 } }), section && ((0, jsx_runtime_1.jsx)("h1", { style: {
775
+ }, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: { height: sectionIndex > 0 ? 25 : 0 } }), section && (_jsx("h1", { style: {
808
776
  fontSize: 22,
809
777
  color: theme.primaryTextColor,
810
778
  fontFamily: theme.fontFamily,
@@ -814,7 +782,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
814
782
  // marginLeft: 25,
815
783
  textAlign: 'left',
816
784
  marginTop: 12,
817
- }, children: section }))] }), dashboardSections[section].filter((elem) => elem.chartType === 'metric').length ? ((0, jsx_runtime_1.jsx)("div", { style: {
785
+ }, children: section }))] }), dashboardSections[section].filter((elem) => elem.chartType === 'metric').length ? (_jsx("div", { style: {
818
786
  boxSizing: 'content-box',
819
787
  width: `100%`,
820
788
  listStyleType: 'none',
@@ -836,13 +804,13 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
836
804
  })
837
805
  .map((elem, index) => {
838
806
  if (DashboardItemComponent) {
839
- return ((0, jsx_runtime_1.jsx)("div", { onClick: onClickDashboardItem
807
+ return (_jsx("div", { onClick: onClickDashboardItem
840
808
  ? () => handleOnClickDashboardItem(elem)
841
- : undefined, children: (0, jsx_runtime_1.jsx)(DashboardItemComponent, { dashboardItem: elem, children: (0, jsx_runtime_1.jsx)("div", { style: {
809
+ : undefined, children: _jsx(DashboardItemComponent, { dashboardItem: elem, children: _jsx("div", { style: {
842
810
  padding: 0,
843
811
  // height: '100%',
844
812
  boxSizing: 'content-box',
845
- }, children: (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: {
813
+ }, children: _jsx(Chart, { containerStyle: {
846
814
  display: 'flex',
847
815
  width: '100%',
848
816
  // height: '100%',
@@ -850,7 +818,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
850
818
  ? theme.chartColors
851
819
  : undefined }) }) }) }, elem.name + '' + index));
852
820
  }
853
- return ((0, jsx_runtime_1.jsx)("div", { onClick: onClickDashboardItem
821
+ return (_jsx("div", { onClick: onClickDashboardItem
854
822
  ? () => handleOnClickDashboardItem(elem)
855
823
  : undefined, style: {
856
824
  // background: theme.elevatedCardColor,
@@ -863,22 +831,22 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
863
831
  cursor: 'pointer',
864
832
  width: '100%',
865
833
  ...metricContainerStyle,
866
- }, children: (0, jsx_runtime_1.jsx)("div", {
834
+ }, children: _jsx("div", {
867
835
  // className="group-hover:bg-black"
868
836
  style: {
869
837
  width: '100%',
870
838
  boxSizing: 'content-box',
871
839
  height: '100%',
872
- }, children: (0, jsx_runtime_1.jsx)("div", { style: {
840
+ }, children: _jsx("div", { style: {
873
841
  width: '100%',
874
842
  boxSizing: 'content-box',
875
843
  height: '100%',
876
- }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
844
+ }, children: _jsxs("div", { style: {
877
845
  display: 'flex',
878
846
  flexDirection: 'column',
879
847
  justifyContent: 'space-between',
880
848
  boxSizing: 'content-box',
881
- }, children: [(0, jsx_runtime_1.jsxs)("div", {
849
+ }, children: [_jsxs("div", {
882
850
  // className="group-hover:bg-black"
883
851
  style: {
884
852
  display: 'flex',
@@ -889,7 +857,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
889
857
  // paddingLeft: theme.padding,
890
858
  // paddingRight: 25,
891
859
  // paddingTop: theme.padding,
892
- }, children: [(0, jsx_runtime_1.jsx)("div", { title: elem.name, style: {
860
+ }, children: [_jsx("div", { title: elem.name, style: {
893
861
  fontFamily: theme.fontFamily,
894
862
  color: theme.primaryTextColor,
895
863
  boxSizing: 'content-box',
@@ -907,7 +875,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
907
875
  display: 'block',
908
876
  maxWidth: '100%',
909
877
  overflow: 'hidden',
910
- }, children: elem.name }), onClickDashboardItem ? ((0, jsx_runtime_1.jsx)("div", {
878
+ }, children: elem.name }), onClickDashboardItem ? (_jsx("div", {
911
879
  // className="hover:bg-black"
912
880
  style: {
913
881
  fontFamily: theme.fontFamily,
@@ -920,7 +888,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
920
888
  display: 'flex',
921
889
  alignItems: 'center',
922
890
  justifyContent: 'flex-end',
923
- }, children: 'view report →' })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: { padding: 0, paddingTop: 10 }, children: (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: {
891
+ }, children: 'view report →' })) : null] }), _jsx("div", { style: { padding: 0, paddingTop: 10 }, children: _jsx(Chart, { containerStyle: {
924
892
  // display: 'flex',
925
893
  // width: '100%',
926
894
  // height: 30,
@@ -929,7 +897,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
929
897
  }, isDateFilter: true,
930
898
  // chartFilters={elem.chartFilters}
931
899
  chartId: elem._id }) })] }) }) }) }, elem.name + '' + index));
932
- }) })) : null, dashboardSections[section].filter((elem) => elem.chartType !== 'table' && elem.chartType !== 'metric').length ? ((0, jsx_runtime_1.jsx)("div", { style: {
900
+ }) })) : null, dashboardSections[section].filter((elem) => elem.chartType !== 'table' && elem.chartType !== 'metric').length ? (_jsx("div", { style: {
933
901
  listStyleType: 'none',
934
902
  display: 'grid',
935
903
  gridGap: 25,
@@ -950,9 +918,9 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
950
918
  })
951
919
  .map((elem, index) => {
952
920
  if (DashboardItemComponent) {
953
- return ((0, jsx_runtime_1.jsx)("div", { onClick: onClickDashboardItem
921
+ return (_jsx("div", { onClick: onClickDashboardItem
954
922
  ? () => handleOnClickDashboardItem(elem)
955
- : undefined, style: { height: rowHeight || 400 }, children: (0, jsx_runtime_1.jsx)(DashboardItemComponent, { dashboardItem: elem, children: (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: {
923
+ : undefined, style: { height: rowHeight || 400 }, children: _jsx(DashboardItemComponent, { dashboardItem: elem, children: _jsx(Chart, { containerStyle: {
956
924
  display: 'flex',
957
925
  width: '100%',
958
926
  // height: '100%',
@@ -963,7 +931,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
963
931
  ? theme.chartColors
964
932
  : undefined }) }) }, elem.name + '' + index));
965
933
  }
966
- return ((0, jsx_runtime_1.jsx)("div", { onClick: onClickDashboardItem
934
+ return (_jsx("div", { onClick: onClickDashboardItem
967
935
  ? () => handleOnClickDashboardItem(elem)
968
936
  : undefined, style: {
969
937
  height: '100%',
@@ -974,26 +942,26 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
974
942
  borderRadius: 8,
975
943
  paddingTop: 20,
976
944
  ...chartContainerStyle,
977
- }, children: (0, jsx_runtime_1.jsx)("div", { style: {
945
+ }, children: _jsx("div", { style: {
978
946
  width: '100%',
979
947
  height: '100%',
980
948
  boxSizing: 'content-box',
981
- }, children: (0, jsx_runtime_1.jsx)("div", { style: {
949
+ }, children: _jsx("div", { style: {
982
950
  width: '100%',
983
951
  height: '100%',
984
952
  boxSizing: 'content-box',
985
- }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
953
+ }, children: _jsxs("div", { style: {
986
954
  display: 'flex',
987
955
  flexDirection: 'column',
988
956
  justifyContent: 'space-between',
989
957
  height: '100%',
990
958
  boxSizing: 'content-box',
991
- }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
959
+ }, children: [_jsxs("div", { style: {
992
960
  display: 'flex',
993
961
  flexDirection: 'row',
994
962
  justifyContent: 'space-between',
995
963
  boxSizing: 'content-box',
996
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
964
+ }, children: [_jsx("div", { style: {
997
965
  fontFamily: theme.fontFamily,
998
966
  color: theme.primaryTextColor,
999
967
  boxSizing: 'content-box',
@@ -1006,7 +974,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1006
974
  display: 'block',
1007
975
  maxWidth: '100%',
1008
976
  overflow: 'hidden',
1009
- }, children: elem.name }), onClickDashboardItem ? ((0, jsx_runtime_1.jsx)("div", { style: {
977
+ }, children: elem.name }), onClickDashboardItem ? (_jsx("div", { style: {
1010
978
  fontFamily: theme.fontFamily,
1011
979
  color: theme.primaryTextColor,
1012
980
  boxSizing: 'content-box',
@@ -1016,11 +984,11 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1016
984
  display: 'flex',
1017
985
  alignItems: 'center',
1018
986
  justifyContent: 'flex-end',
1019
- }, children: 'view report →' })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: {
987
+ }, children: 'view report →' })) : null] }), _jsx("div", { style: {
1020
988
  padding: 0,
1021
989
  height: '100%',
1022
990
  boxSizing: 'content-box',
1023
- }, children: (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: {
991
+ }, children: _jsx(Chart, { containerStyle: {
1024
992
  display: 'flex',
1025
993
  width: '100%',
1026
994
  // TODO: fix fixed height
@@ -1030,13 +998,13 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1030
998
  }, isDateFilter: true, chartId: elem._id, colors: theme.chartColors?.length
1031
999
  ? theme.chartColors
1032
1000
  : undefined }) })] }) }) }) }, elem.name + '' + index));
1033
- }) })) : null, dashboardSections[section].filter((elem) => elem.chartType === 'table').length ? ((0, jsx_runtime_1.jsxs)("div", { style: {
1001
+ }) })) : null, dashboardSections[section].filter((elem) => elem.chartType === 'table').length ? (_jsxs("div", { style: {
1034
1002
  boxSizing: 'content-box',
1035
1003
  width: `100%`,
1036
1004
  gap: 20,
1037
1005
  display: 'flex',
1038
1006
  flexDirection: 'column',
1039
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: { height: 0 } }), dashboardSections[section]
1007
+ }, children: [_jsx("div", { style: { height: 0 } }), dashboardSections[section]
1040
1008
  .filter((elem) => elem.chartType === 'table')
1041
1009
  .sort((a, b) => {
1042
1010
  if (a.order === undefined && b.order === undefined)
@@ -1049,13 +1017,13 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1049
1017
  })
1050
1018
  .map((elem, index) => {
1051
1019
  if (DashboardItemComponent) {
1052
- return ((0, jsx_runtime_1.jsx)("div", { onClick: onClickDashboardItem
1020
+ return (_jsx("div", { onClick: onClickDashboardItem
1053
1021
  ? () => handleOnClickDashboardItem(elem)
1054
- : undefined, children: (0, jsx_runtime_1.jsx)(DashboardItemComponent, { dashboardItem: elem, children: (0, jsx_runtime_1.jsx)("div", { style: {
1022
+ : undefined, children: _jsx(DashboardItemComponent, { dashboardItem: elem, children: _jsx("div", { style: {
1055
1023
  padding: 0,
1056
1024
  height: '100%',
1057
1025
  boxSizing: 'content-box',
1058
- }, children: (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: {
1026
+ }, children: _jsx(Chart, { containerStyle: {
1059
1027
  display: 'flex',
1060
1028
  width: '100%',
1061
1029
  height: '100%',
@@ -1063,7 +1031,9 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1063
1031
  ? theme.chartColors
1064
1032
  : undefined }) }) }) }, elem.name + '' + index));
1065
1033
  }
1066
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { onClick: onClickDashboardItem
1034
+ return (_jsxs("div", { onClick: onClickDashboardItem
1035
+ ? () => handleOnClickDashboardItem(elem)
1036
+ : undefined, children: [_jsx("div", { onClick: onClickDashboardItem
1067
1037
  ? () => handleOnClickDashboardItem(elem)
1068
1038
  : undefined, style: {
1069
1039
  // background: theme.elevatedCardColor,
@@ -1078,23 +1048,23 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1078
1048
  minHeight: 420,
1079
1049
  height: 420,
1080
1050
  // ...metricContainerStyle,
1081
- }, children: (0, jsx_runtime_1.jsx)("div", {
1051
+ }, children: _jsx("div", {
1082
1052
  // className="group-hover:bg-black"
1083
1053
  style: {
1084
1054
  width: '100%',
1085
1055
  boxSizing: 'content-box',
1086
1056
  height: '100%',
1087
- }, children: (0, jsx_runtime_1.jsx)("div", { style: {
1057
+ }, children: _jsx("div", { style: {
1088
1058
  width: '100%',
1089
1059
  boxSizing: 'content-box',
1090
1060
  height: '100%',
1091
- }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
1061
+ }, children: _jsxs("div", { style: {
1092
1062
  display: 'flex',
1093
1063
  flexDirection: 'column',
1094
1064
  justifyContent: 'space-between',
1095
1065
  boxSizing: 'content-box',
1096
1066
  height: '100%',
1097
- }, children: [(0, jsx_runtime_1.jsxs)("div", {
1067
+ }, children: [_jsxs("div", {
1098
1068
  // className="group-hover:bg-black"
1099
1069
  style: {
1100
1070
  display: 'flex',
@@ -1105,7 +1075,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1105
1075
  // paddingLeft: theme.padding,
1106
1076
  paddingRight: 25,
1107
1077
  // paddingTop: theme.padding,
1108
- }, children: [(0, jsx_runtime_1.jsx)("div", { title: elem.name, style: {
1078
+ }, children: [_jsx("div", { title: elem.name, style: {
1109
1079
  fontFamily: theme.fontFamily,
1110
1080
  color: theme.primaryTextColor,
1111
1081
  boxSizing: 'content-box',
@@ -1124,7 +1094,7 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1124
1094
  display: 'block',
1125
1095
  maxWidth: '100%',
1126
1096
  overflow: 'hidden',
1127
- }, children: elem.name }), onClickDashboardItem ? ((0, jsx_runtime_1.jsx)("div", {
1097
+ }, children: elem.name }), onClickDashboardItem ? (_jsx("div", {
1128
1098
  // className="hover:bg-black"
1129
1099
  style: {
1130
1100
  fontFamily: theme.fontFamily,
@@ -1137,10 +1107,10 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1137
1107
  display: 'flex',
1138
1108
  alignItems: 'center',
1139
1109
  justifyContent: 'flex-end',
1140
- }, children: 'view report →' })) : null] }), (0, jsx_runtime_1.jsxs)("div", { style: {
1110
+ }, children: 'view report →' })) : null] }), _jsxs("div", { style: {
1141
1111
  padding: 0,
1142
1112
  height: '400px',
1143
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: { height: 20 } }), (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: {
1113
+ }, children: [_jsx("div", { style: { height: 20 } }), _jsx(Chart, { containerStyle: {
1144
1114
  // display: 'flex',
1145
1115
  // width: '100%',
1146
1116
  // height: 30,
@@ -1149,11 +1119,10 @@ function Dashboard({ name, containerStyle, chartContainerStyle, metricContainerS
1149
1119
  // paddingLeft: 25,
1150
1120
  }, isDateFilter: true,
1151
1121
  // chartFilters={elem.chartFilters}
1152
- chartId: elem._id })] })] }) }) }) }, elem.name + '' + index), (0, jsx_runtime_1.jsx)("div", { style: { height: 40 } })] }));
1153
- })] })) : null, (0, jsx_runtime_1.jsx)("div", { style: { height: 40 } })] }, section + '' + sectionIndex));
1122
+ chartId: elem._id })] })] }) }) }) }, elem.name + '' + index), _jsx("div", { style: { height: 40 } })] }, elem.name + '' + index));
1123
+ })] })) : null, _jsx("div", { style: { height: 40 } })] }, section + '' + sectionIndex));
1154
1124
  })] }));
1155
1125
  }
1156
- exports.default = Dashboard;
1157
1126
  // ----------------------------------------------------------------
1158
1127
  // REST OF CODE NOT USED
1159
1128
  function Filter({ defaultValue, theme, onValueChange, filter }) {
@@ -1166,23 +1135,23 @@ function Filter({ defaultValue, theme, onValueChange, filter }) {
1166
1135
  { value: 'popupbagelsredding', text: 'popupbagelsredding' },
1167
1136
  { value: 'popupbagelsthompson', text: 'popupbagelsthompson' },
1168
1137
  ];
1169
- const dropdownRef = (0, react_1.useRef)(null);
1170
- const [showDropdown, setShowDropdown] = (0, react_1.useState)(false);
1171
- const [selectedValue, setSelectedValue] = (0, hooks_1.useInternalState)(defaultValue, undefined);
1138
+ const dropdownRef = useRef(null);
1139
+ const [showDropdown, setShowDropdown] = useState(false);
1140
+ const [selectedValue, setSelectedValue] = useInternalState(defaultValue, undefined);
1172
1141
  const selectedDropdownValue = selectedValue ? selectedValue[2] ?? null : null;
1173
1142
  const handleDropdownOptionClick = (dropdownValue) => {
1174
1143
  setSelectedValue([undefined, undefined, dropdownValue]);
1175
1144
  onValueChange?.([undefined, undefined, dropdownValue]);
1176
1145
  setShowDropdown(false);
1177
1146
  };
1178
- const [hoveredDropdownValue, handleDropdownKeyDown] = (0, hooks_1.useSelectOnKeyDown)(handleDropdownOptionClick, dropdownOptions.map((option) => option.value), showDropdown, setShowDropdown, selectedDropdownValue);
1179
- return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%' }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
1147
+ const [hoveredDropdownValue, handleDropdownKeyDown] = useSelectOnKeyDown(handleDropdownOptionClick, dropdownOptions.map((option) => option.value), showDropdown, setShowDropdown, selectedDropdownValue);
1148
+ return (_jsxs("div", { style: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
1180
1149
  marginBottom: 6,
1181
1150
  fontWeight: '600',
1182
1151
  color: theme.secondaryTextColor,
1183
1152
  fontSize: 14,
1184
1153
  fontFamily: theme.fontFamily,
1185
- }, children: filter.label }), (0, jsx_runtime_1.jsx)(FilterDropdown, { showDropdown: showDropdown, setShowDropdown: setShowDropdown, handleDropdownKeyDown: handleDropdownKeyDown, dropdownRef: dropdownRef, theme: theme, selectedDropdownValue: selectedDropdownValue, dropdownOptions: filter.options, field: filter.field, label: filter.labelField }), (0, jsx_runtime_1.jsx)(FilterModal, { showDropdown: showDropdown, setShowDropdown: setShowDropdown, dropdownRef: dropdownRef, theme: theme, hoveredDropdownValue: hoveredDropdownValue, selectedDropdownValue: selectedDropdownValue, dropdownOptions: filter.options, handleDropdownOptionClick: handleDropdownOptionClick, field: filter.field, label: filter.labelField })] }));
1154
+ }, children: filter.label }), _jsx(FilterDropdown, { showDropdown: showDropdown, setShowDropdown: setShowDropdown, handleDropdownKeyDown: handleDropdownKeyDown, dropdownRef: dropdownRef, theme: theme, selectedDropdownValue: selectedDropdownValue, dropdownOptions: filter.options, field: filter.field, label: filter.labelField }), _jsx(FilterModal, { showDropdown: showDropdown, setShowDropdown: setShowDropdown, dropdownRef: dropdownRef, theme: theme, hoveredDropdownValue: hoveredDropdownValue, selectedDropdownValue: selectedDropdownValue, dropdownOptions: filter.options, handleDropdownOptionClick: handleDropdownOptionClick, field: filter.field, label: filter.labelField })] }));
1186
1155
  }
1187
1156
  function removeQuotes(str) {
1188
1157
  if (str.startsWith('"') && str.endsWith('"')) {
@@ -1196,7 +1165,7 @@ function FilterDropdown({ setShowDropdown, dropdownRef, showDropdown, handleDrop
1196
1165
  const dropdownText = selectedDropdownValue
1197
1166
  ? String(dropdownOptions.find((option) => option[removeQuotes(field)] === selectedDropdownValue)[removeQuotes(label)])
1198
1167
  : dropdownPlaceholder;
1199
- return ((0, jsx_runtime_1.jsx)("div", { style: {
1168
+ return (_jsx("div", { style: {
1200
1169
  display: 'flex',
1201
1170
  alignItems: 'center',
1202
1171
  justifyContent: 'space-between',
@@ -1204,7 +1173,7 @@ function FilterDropdown({ setShowDropdown, dropdownRef, showDropdown, handleDrop
1204
1173
  background: theme?.backgroundColor,
1205
1174
  fontFamily: theme?.fontFamily,
1206
1175
  boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
1207
- }, children: (0, jsx_runtime_1.jsxs)("button", { type: "button", style: {
1176
+ }, children: _jsxs("button", { type: "button", style: {
1208
1177
  // fontFamily: theme?.fontFamily,
1209
1178
  borderColor: theme?.borderColor || '#E5E7EB',
1210
1179
  borderStyle: 'solid',
@@ -1226,7 +1195,7 @@ function FilterDropdown({ setShowDropdown, dropdownRef, showDropdown, handleDrop
1226
1195
  background: theme?.backgroundColor,
1227
1196
  fontSize: theme?.fontSizeSmall || '0.875rem',
1228
1197
  // fontWeight: theme?.fontWeightMedium || '800',
1229
- }, ref: dropdownRef, onClick: () => setShowDropdown(!showDropdown), onKeyDown: handleDropdownKeyDown, children: [(0, jsx_runtime_1.jsx)("p", { style: {
1198
+ }, ref: dropdownRef, onClick: () => setShowDropdown(!showDropdown), onKeyDown: handleDropdownKeyDown, children: [_jsx("p", { style: {
1230
1199
  margin: 0,
1231
1200
  fontFamily: theme?.fontFamily,
1232
1201
  color: theme?.primaryTextColor || '#364153',
@@ -1235,7 +1204,7 @@ function FilterDropdown({ setShowDropdown, dropdownRef, showDropdown, handleDrop
1235
1204
  whiteSpace: 'nowrap',
1236
1205
  fontWeight: theme?.fontWeightMedium || '500',
1237
1206
  fontSize: theme?.fontSizeSmall || '0.875rem',
1238
- }, children: dropdownText }), (0, jsx_runtime_1.jsx)(assets_1.ArrowDownHeadIcon, { style: {
1207
+ }, children: dropdownText }), _jsx(ArrowDownHeadIcon, { style: {
1239
1208
  height: '1.25rem',
1240
1209
  width: '1.25rem',
1241
1210
  flex: 'none',
@@ -1244,9 +1213,8 @@ function FilterDropdown({ setShowDropdown, dropdownRef, showDropdown, handleDrop
1244
1213
  }, "aria-hidden": "true" })] }) }));
1245
1214
  }
1246
1215
  function FilterModal({ setShowDropdown, dropdownRef, showDropdown, theme, selectedDropdownValue, hoveredDropdownValue, dropdownOptions, handleDropdownOptionClick, field, label, }) {
1247
- return ((0, jsx_runtime_1.jsx)(Modal_1.default, { showModal: showDropdown, setShowModal: setShowDropdown, parentRef: dropdownRef, theme: theme, children: (0, jsx_runtime_1.jsx)(contexts_1.SelectedValueContext.Provider, { value: {
1216
+ return (_jsx(Modal, { showModal: showDropdown, setShowModal: setShowDropdown, parentRef: dropdownRef, theme: theme, children: _jsx(SelectedValueContext.Provider, { value: {
1248
1217
  selectedValue: selectedDropdownValue,
1249
1218
  handleValueChange: handleDropdownOptionClick,
1250
- }, children: (0, jsx_runtime_1.jsx)(contexts_1.HoveredValueContext.Provider, { value: { hoveredValue: hoveredDropdownValue }, children: dropdownOptions.map((row, index) => ((0, jsx_runtime_1.jsx)(Dropdown_1.DropdownItem, { value: row[removeQuotes(field)], text: row[removeQuotes(label)], theme: theme, lastItem: dropdownOptions.length - 1 === index }, row[removeQuotes(field)]))) }) }) }));
1219
+ }, children: _jsx(HoveredValueContext.Provider, { value: { hoveredValue: hoveredDropdownValue }, children: dropdownOptions.map((row, index) => (_jsx(DropdownItem, { value: row[removeQuotes(field)], text: row[removeQuotes(label)], theme: theme, lastItem: dropdownOptions.length - 1 === index }, row[removeQuotes(field)]))) }) }) }));
1251
1220
  }
1252
- //# sourceMappingURL=Dashboard.js.map