@quillsql/react 1.7.2 → 1.7.3

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 (136) hide show
  1. package/lib/AddToDashboardModal.js +249 -369
  2. package/lib/AddToDashboardModal.js.map +1 -1
  3. package/lib/BarList.js +92 -109
  4. package/lib/BarList.js.map +1 -1
  5. package/lib/Chart.d.ts +0 -1
  6. package/lib/Chart.js +359 -419
  7. package/lib/Chart.js.map +1 -1
  8. package/lib/Context.d.ts +1 -2
  9. package/lib/Context.js +91 -85
  10. package/lib/Context.js.map +1 -1
  11. package/lib/Dashboard.js +181 -209
  12. package/lib/Dashboard.js.map +1 -1
  13. package/lib/DateRangePicker/Calendar.js +87 -91
  14. package/lib/DateRangePicker/Calendar.js.map +1 -1
  15. package/lib/DateRangePicker/DateRangePicker.js +70 -68
  16. package/lib/DateRangePicker/DateRangePicker.js.map +1 -1
  17. package/lib/DateRangePicker/DateRangePickerButton.js +46 -57
  18. package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -1
  19. package/lib/DateRangePicker/dateRangePickerUtils.js +105 -99
  20. package/lib/DateRangePicker/dateRangePickerUtils.js.map +1 -1
  21. package/lib/DateRangePicker/index.js +8 -1
  22. package/lib/DateRangePicker/index.js.map +1 -1
  23. package/lib/PieChart.js +221 -225
  24. package/lib/PieChart.js.map +1 -1
  25. package/lib/QuillProvider.d.ts +1 -2
  26. package/lib/QuillProvider.js +8 -18
  27. package/lib/QuillProvider.js.map +1 -1
  28. package/lib/ReportBuilder.js +430 -526
  29. package/lib/ReportBuilder.js.map +1 -1
  30. package/lib/SQLEditor.js +182 -268
  31. package/lib/SQLEditor.js.map +1 -1
  32. package/lib/Table.js +208 -261
  33. package/lib/Table.js.map +1 -1
  34. package/lib/TableChart.js +76 -75
  35. package/lib/TableChart.js.map +1 -1
  36. package/lib/assets/ArrowDownHeadIcon.js +5 -28
  37. package/lib/assets/ArrowDownHeadIcon.js.map +1 -1
  38. package/lib/assets/ArrowDownIcon.js +5 -28
  39. package/lib/assets/ArrowDownIcon.js.map +1 -1
  40. package/lib/assets/ArrowDownRightIcon.js +5 -28
  41. package/lib/assets/ArrowDownRightIcon.js.map +1 -1
  42. package/lib/assets/ArrowLeftHeadIcon.js +5 -28
  43. package/lib/assets/ArrowLeftHeadIcon.js.map +1 -1
  44. package/lib/assets/ArrowRightHeadIcon.js +5 -28
  45. package/lib/assets/ArrowRightHeadIcon.js.map +1 -1
  46. package/lib/assets/ArrowRightIcon.js +5 -28
  47. package/lib/assets/ArrowRightIcon.js.map +1 -1
  48. package/lib/assets/ArrowUpHeadIcon.js +5 -28
  49. package/lib/assets/ArrowUpHeadIcon.js.map +1 -1
  50. package/lib/assets/ArrowUpIcon.js +5 -28
  51. package/lib/assets/ArrowUpIcon.js.map +1 -1
  52. package/lib/assets/ArrowUpRightIcon.js +5 -28
  53. package/lib/assets/ArrowUpRightIcon.js.map +1 -1
  54. package/lib/assets/CalendarIcon.js +5 -28
  55. package/lib/assets/CalendarIcon.js.map +1 -1
  56. package/lib/assets/DoubleArrowLeftHeadIcon.js +5 -28
  57. package/lib/assets/DoubleArrowLeftHeadIcon.js.map +1 -1
  58. package/lib/assets/DoubleArrowRightHeadIcon.js +5 -28
  59. package/lib/assets/DoubleArrowRightHeadIcon.js.map +1 -1
  60. package/lib/assets/ExclamationFilledIcon.js +5 -28
  61. package/lib/assets/ExclamationFilledIcon.js.map +1 -1
  62. package/lib/assets/LoadingSpinner.js +5 -28
  63. package/lib/assets/LoadingSpinner.js.map +1 -1
  64. package/lib/assets/SearchIcon.js +5 -28
  65. package/lib/assets/SearchIcon.js.map +1 -1
  66. package/lib/assets/XCircleIcon.js +5 -28
  67. package/lib/assets/XCircleIcon.js.map +1 -1
  68. package/lib/assets/index.js +38 -16
  69. package/lib/assets/index.js.map +1 -1
  70. package/lib/components/BigModal/BigModal.js +45 -43
  71. package/lib/components/BigModal/BigModal.js.map +1 -1
  72. package/lib/components/Dropdown/Dropdown.js +57 -53
  73. package/lib/components/Dropdown/Dropdown.js.map +1 -1
  74. package/lib/components/Dropdown/DropdownItem.js +43 -40
  75. package/lib/components/Dropdown/DropdownItem.js.map +1 -1
  76. package/lib/components/Dropdown/index.js +10 -2
  77. package/lib/components/Dropdown/index.js.map +1 -1
  78. package/lib/components/Modal/Modal.js +45 -43
  79. package/lib/components/Modal/Modal.js.map +1 -1
  80. package/lib/components/Modal/index.js +8 -1
  81. package/lib/components/Modal/index.js.map +1 -1
  82. package/lib/components/selectUtils.js +20 -15
  83. package/lib/components/selectUtils.js.map +1 -1
  84. package/lib/contexts/BaseColorContext.js +5 -3
  85. package/lib/contexts/BaseColorContext.js.map +1 -1
  86. package/lib/contexts/HoveredValueContext.js +5 -3
  87. package/lib/contexts/HoveredValueContext.js.map +1 -1
  88. package/lib/contexts/RootStylesContext.js +5 -3
  89. package/lib/contexts/RootStylesContext.js.map +1 -1
  90. package/lib/contexts/SelectedValueContext.js +5 -3
  91. package/lib/contexts/SelectedValueContext.js.map +1 -1
  92. package/lib/contexts/index.js +14 -4
  93. package/lib/contexts/index.js.map +1 -1
  94. package/lib/hooks/index.js +14 -4
  95. package/lib/hooks/index.js.map +1 -1
  96. package/lib/hooks/useInternalState.js +9 -7
  97. package/lib/hooks/useInternalState.js.map +1 -1
  98. package/lib/hooks/useOnClickOutside.js +8 -6
  99. package/lib/hooks/useOnClickOutside.js.map +1 -1
  100. package/lib/hooks/useOnWindowResize.js +9 -7
  101. package/lib/hooks/useOnWindowResize.js.map +1 -1
  102. package/lib/hooks/useQuill.js +60 -111
  103. package/lib/hooks/useQuill.js.map +1 -1
  104. package/lib/hooks/useSelectOnKeyDown.js +17 -15
  105. package/lib/hooks/useSelectOnKeyDown.js.map +1 -1
  106. package/lib/index.js +22 -8
  107. package/lib/index.js.map +1 -1
  108. package/lib/lib/font.d.ts +13 -0
  109. package/lib/lib/font.js +17 -0
  110. package/lib/lib/font.js.map +1 -0
  111. package/lib/lib/index.d.ts +3 -0
  112. package/lib/lib/index.js +20 -0
  113. package/lib/lib/index.js.map +1 -0
  114. package/lib/lib/inputTypes.d.ts +20 -0
  115. package/lib/lib/inputTypes.js +57 -0
  116. package/lib/lib/inputTypes.js.map +1 -0
  117. package/lib/lib/utils.d.ts +9 -0
  118. package/lib/lib/utils.js +46 -0
  119. package/lib/lib/utils.js.map +1 -0
  120. package/package.json +6 -13
  121. package/src/AddToDashboardModal.tsx +2 -9
  122. package/src/Chart.tsx +49 -20
  123. package/src/Context.tsx +0 -3
  124. package/src/Dashboard.tsx +2 -3
  125. package/src/PieChart.tsx +2 -2
  126. package/src/QuillProvider.tsx +0 -3
  127. package/src/ReportBuilder.tsx +3 -9
  128. package/src/SQLEditor.tsx +99 -12
  129. package/src/Table.tsx +51 -8
  130. package/src/hooks/useQuill.ts +1 -2
  131. package/src/lib/font.ts +14 -0
  132. package/src/lib/index.ts +3 -0
  133. package/src/lib/inputTypes.ts +81 -0
  134. package/src/lib/utils.tsx +46 -0
  135. package/tsconfig.json +3 -3
  136. package/rollup.config.ts +0 -21
package/lib/Table.js CHANGED
@@ -1,89 +1,43 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
47
4
  };
48
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SpecialTable = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
49
8
  /* eslint-disable @typescript-eslint/ban-ts-comment */
50
9
  // @ts-nocheck
51
- import { useContext, useEffect, useMemo, useState } from 'react';
52
- import axios from 'axios';
53
- import { ClientContext, DashboardContext, ThemeContext, } from './Context';
54
- import Skeleton from 'react-loading-skeleton';
55
- import { valueFormatter } from './Chart';
56
- import { TailSpin } from 'react-loader-spinner';
57
- var Table = function (_a) {
58
- var chartId = _a.chartId, columns = _a.columns, rows = _a.rows, containerStyle = _a.containerStyle, csvFilename = _a.csvFilename;
59
- var _b = useContext(DashboardContext), dispatch = _b.dispatch, dashboard = _b.dashboard;
60
- var _c = useContext(ClientContext), client = _c[0], _ = _c[1];
61
- var theme = useContext(ThemeContext)[0];
62
- var downloadCSV = function (rows, name) {
10
+ const react_1 = require("react");
11
+ const axios_1 = __importDefault(require("axios"));
12
+ const Context_1 = require("./Context");
13
+ // import Skeleton from 'react-loading-skeleton';
14
+ const Chart_1 = require("./Chart");
15
+ const react_loader_spinner_1 = require("react-loader-spinner");
16
+ const Table = ({ chartId, columns, rows, containerStyle, csvFilename, }) => {
17
+ const { dispatch, dashboard } = (0, react_1.useContext)(Context_1.DashboardContext);
18
+ const [client, _] = (0, react_1.useContext)(Context_1.ClientContext);
19
+ const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
20
+ const downloadCSV = (rows, name) => {
63
21
  // report.rows
64
22
  if (!rows.length) {
65
23
  return;
66
24
  }
67
- var json = rows; // JSON data passed as a prop
68
- var fields = Object.keys(json[0]); // Assumes all objects have same keys
69
- var csvRows = [];
25
+ const json = rows; // JSON data passed as a prop
26
+ const fields = Object.keys(json[0]); // Assumes all objects have same keys
27
+ const csvRows = [];
70
28
  // Header row
71
29
  csvRows.push(fields.join(','));
72
- var _loop_1 = function (row) {
73
- var values = fields.map(function (field) { return JSON.stringify(row[field] || ''); });
74
- csvRows.push(values.join(','));
75
- };
76
30
  // Data rows
77
- for (var _i = 0, json_1 = json; _i < json_1.length; _i++) {
78
- var row = json_1[_i];
79
- _loop_1(row);
31
+ for (const row of json) {
32
+ const values = fields.map(field => JSON.stringify(row[field] || ''));
33
+ csvRows.push(values.join(','));
80
34
  }
81
35
  // Create CSV string and create a 'blob' with it
82
- var csvString = csvRows.join('\r\n');
83
- var csvBlob = new Blob([csvString], { type: 'text/csv' });
36
+ const csvString = csvRows.join('\r\n');
37
+ const csvBlob = new Blob([csvString], { type: 'text/csv' });
84
38
  // Create a download link and click it
85
- var downloadLink = document.createElement('a');
86
- downloadLink.download = "".concat(name, ".csv");
39
+ const downloadLink = document.createElement('a');
40
+ downloadLink.download = `${name}.csv`;
87
41
  downloadLink.href = URL.createObjectURL(csvBlob);
88
42
  downloadLink.style.display = 'none';
89
43
  document.body.appendChild(downloadLink);
@@ -91,37 +45,32 @@ var Table = function (_a) {
91
45
  document.body.removeChild(downloadLink);
92
46
  };
93
47
  if (!chartId && rows && columns) {
94
- return (_jsx(SpecialTable, { showDownloadCsvButton: true, csvFilename: csvFilename || 'table', columns: columns, rows: rows, height: (containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.height) || '100%', theme: theme }));
48
+ return ((0, jsx_runtime_1.jsx)(SpecialTable, { showDownloadCsvButton: true, csvFilename: csvFilename || 'table', columns: columns, rows: rows, height: containerStyle?.height || '100%', theme: theme }));
95
49
  }
96
- return (_jsx(ChartUpdater, { dispatch: dispatch, dashboard: dashboard, chartId: chartId, containerStyle: containerStyle, client: client, theme: theme, downloadCSV: downloadCSV, csvFilename: csvFilename }));
50
+ return ((0, jsx_runtime_1.jsx)(ChartUpdater, { dispatch: dispatch, dashboard: dashboard, chartId: chartId, containerStyle: containerStyle, client: client, theme: theme, downloadCSV: downloadCSV, csvFilename: csvFilename }));
97
51
  };
98
- export function SpecialTable(_a) {
99
- var columns = _a.columns, rows = _a.rows, height = _a.height, containerStyle = _a.containerStyle, loading = _a.loading, LoadingComponent = _a.LoadingComponent, theme = _a.theme, showDownloadCsvButton = _a.showDownloadCsvButton, csvFilename = _a.csvFilename, DownloadCSVButtonComponent = _a.DownloadCSVButtonComponent, AddToDashboardButtonComponent = _a.AddToDashboardButtonComponent;
100
- var downloadCSV = function () {
52
+ function SpecialTable({ columns, rows, height, containerStyle, loading, LoadingComponent, theme, showDownloadCsvButton, csvFilename, DownloadCSVButtonComponent, AddToDashboardButtonComponent, }) {
53
+ const downloadCSV = () => {
101
54
  // report.rows
102
55
  if (!rows.length) {
103
56
  return;
104
57
  }
105
- var json = rows; // JSON data passed as a prop
106
- var fields = Object.keys(json[0]); // Assumes all objects have same keys
107
- var csvRows = [];
58
+ const json = rows; // JSON data passed as a prop
59
+ const fields = Object.keys(json[0]); // Assumes all objects have same keys
60
+ const csvRows = [];
108
61
  // Header row
109
62
  csvRows.push(fields.join(','));
110
- var _loop_2 = function (row) {
111
- var values = fields.map(function (field) { return JSON.stringify(row[field] || ''); });
112
- csvRows.push(values.join(','));
113
- };
114
63
  // Data rows
115
- for (var _i = 0, json_2 = json; _i < json_2.length; _i++) {
116
- var row = json_2[_i];
117
- _loop_2(row);
64
+ for (const row of json) {
65
+ const values = fields.map(field => JSON.stringify(row[field] || ''));
66
+ csvRows.push(values.join(','));
118
67
  }
119
68
  // Create CSV string and create a 'blob' with it
120
- var csvString = csvRows.join('\r\n');
121
- var csvBlob = new Blob([csvString], { type: 'text/csv' });
69
+ const csvString = csvRows.join('\r\n');
70
+ const csvBlob = new Blob([csvString], { type: 'text/csv' });
122
71
  // Create a download link and click it
123
- var downloadLink = document.createElement('a');
124
- downloadLink.download = "".concat(csvFilename, ".csv");
72
+ const downloadLink = document.createElement('a');
73
+ downloadLink.download = `${csvFilename}.csv`;
125
74
  downloadLink.href = URL.createObjectURL(csvBlob);
126
75
  downloadLink.style.display = 'none';
127
76
  document.body.appendChild(downloadLink);
@@ -129,13 +78,19 @@ export function SpecialTable(_a) {
129
78
  document.body.removeChild(downloadLink);
130
79
  };
131
80
  if (loading) {
132
- return (_jsx("div", __assign({ style: __assign(__assign({}, containerStyle), {
81
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
82
+ ...containerStyle,
133
83
  // paddingLeft: 25,
134
84
  // paddingRight: 25,
135
85
  // borderRadius: 8,
136
86
  // marginTop: 25,
137
87
  // overflow: 'visible',
138
- width: '100%', height: height }) }, { children: _jsxs("div", __assign({ style: {
88
+ width: '100%',
89
+ height: height,
90
+ // overflow: 'hidden',
91
+ // @ts-ignore
92
+ // boxShadow: 'rgba(231, 231, 231, 0.5) 0px 1px 2px 0px',
93
+ }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
139
94
  height: '100%',
140
95
  overflow: 'scroll',
141
96
  borderRadius: 6,
@@ -150,18 +105,24 @@ export function SpecialTable(_a) {
150
105
  justifyContent: 'center',
151
106
  alignItems: 'center',
152
107
  // maxHeight: 600,
153
- } }, { children: [LoadingComponent && _jsx(LoadingComponent, {}), !LoadingComponent && (_jsx(TailSpin, { height: 36, width: 36, color: "#364153" }))] })) })));
108
+ }, children: [LoadingComponent && (0, jsx_runtime_1.jsx)(LoadingComponent, {}), !LoadingComponent && ((0, jsx_runtime_1.jsx)(react_loader_spinner_1.TailSpin, { height: 36, width: 36, color: "#364153" }))] }) }));
154
109
  }
155
110
  if (!columns || !columns.length || !rows) {
156
111
  return null;
157
112
  }
158
113
  if (showDownloadCsvButton) {
159
- return (_jsxs("div", __assign({ style: __assign(__assign({}, containerStyle), {
114
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
115
+ ...containerStyle,
160
116
  // paddingLeft: 25,
161
117
  // paddingRight: 25,
162
118
  // borderRadius: 8,
163
119
  // marginTop: 25,
164
- overflow: 'visible', height: height }) }, { children: [_jsx("div", __assign({ style: { height: 50, background: 'white' }, className: "thead" }, { children: _jsxs("div", __assign({ role: "row", className: "tr", style: {
120
+ overflow: 'visible',
121
+ height: height,
122
+ // overflow: 'hidden',
123
+ // @ts-ignore
124
+ // boxShadow: 'rgba(231, 231, 231, 0.5) 0px 1px 2px 0px',
125
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: { height: 50, background: 'white' }, className: "thead", children: (0, jsx_runtime_1.jsxs)("div", { role: "row", className: "tr", style: {
165
126
  display: 'flex',
166
127
  flex: '1 0 auto',
167
128
  minWidth: '100px',
@@ -170,20 +131,20 @@ export function SpecialTable(_a) {
170
131
  height: 50,
171
132
  // position: 'absolute',
172
133
  // bottom: 0,
173
- } }, { children: [DownloadCSVButtonComponent && (_jsx(DownloadCSVButtonComponent, { onClick: downloadCSV })), !DownloadCSVButtonComponent && (_jsx("div", __assign({ onClick: downloadCSV, style: {
134
+ }, children: [DownloadCSVButtonComponent && ((0, jsx_runtime_1.jsx)(DownloadCSVButtonComponent, { onClick: downloadCSV })), !DownloadCSVButtonComponent && ((0, jsx_runtime_1.jsx)("div", { onClick: downloadCSV, style: {
174
135
  height: 40,
175
136
  minHeight: 40,
176
- color: theme === null || theme === void 0 ? void 0 : theme.primaryTextColor,
137
+ color: theme?.primaryTextColor,
177
138
  boxSizing: 'content-box',
178
- fontFamily: (theme === null || theme === void 0 ? void 0 : theme.chartLabelFontFamily) || (theme === null || theme === void 0 ? void 0 : theme.fontFamily),
179
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '14px',
180
- fontWeight: (theme === null || theme === void 0 ? void 0 : theme.fontWeightMedium) || '500',
139
+ fontFamily: theme?.chartLabelFontFamily || theme?.fontFamily,
140
+ fontSize: theme?.fontSizeSmall || '14px',
141
+ fontWeight: theme?.fontWeightMedium || '500',
181
142
  // marginTop: 8,
182
143
  marginLeft: 20,
183
144
  alignItems: 'center',
184
145
  display: 'flex',
185
146
  cursor: 'pointer',
186
- } }, { children: "Download CSV" })))] })) })), _jsx("div", __assign({ style: {
147
+ }, children: "Download CSV" }))] }) }), (0, jsx_runtime_1.jsx)("div", { style: {
187
148
  height: 'calc(100% - 50px)',
188
149
  overflow: 'scroll',
189
150
  borderRadius: 6,
@@ -194,12 +155,12 @@ export function SpecialTable(_a) {
194
155
  boxSizing: 'border-box',
195
156
  outline: 'none',
196
157
  // maxHeight: 600,
197
- } }, { children: _jsxs("div", __assign({ role: "table", className: "table", style: { minWidth: '0px' } }, { children: [_jsx("div", __assign({ className: "thead" }, { children: _jsx("div", __assign({ role: "row", className: "tr", style: {
158
+ }, children: (0, jsx_runtime_1.jsxs)("div", { role: "table", className: "table", style: { minWidth: '0px' }, children: [(0, jsx_runtime_1.jsx)("div", { className: "thead", children: (0, jsx_runtime_1.jsx)("div", { role: "row", className: "tr", style: {
198
159
  display: 'flex',
199
160
  flex: '1 0 auto',
200
161
  minWidth: '100px',
201
162
  boxSizing: 'border-box',
202
- } }, { children: columns.map(function (column, index) { return (_jsxs("div", __assign({
163
+ }, children: columns.map((column, index) => ((0, jsx_runtime_1.jsxs)("div", {
203
164
  // @ts-ignore
204
165
  style: {
205
166
  boxSizing: 'border-box',
@@ -217,28 +178,28 @@ export function SpecialTable(_a) {
217
178
  margin: '0px',
218
179
  textOverflow: 'ellipsis',
219
180
  minHeight: '36px',
220
- } }, { children: [_jsx("div", { style: { width: 16 } }), _jsx("div", __assign({ "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r6-dropdown",
181
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: 16 } }), (0, jsx_runtime_1.jsx)("div", { "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r6-dropdown",
221
182
  // @ts-ignore
222
183
  style: {
223
184
  // fontFamily:
224
185
  // 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
225
186
  WebkitTapHighlightColor: 'transparent',
226
- fontFamily: theme === null || theme === void 0 ? void 0 : theme.fontFamily,
187
+ fontFamily: theme?.fontFamily,
227
188
  // color: 'rgb(55, 65, 81)',
228
- color: theme === null || theme === void 0 ? void 0 : theme.primaryTextColor,
189
+ color: theme?.primaryTextColor,
229
190
  textDecoration: 'none',
230
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '14px',
231
- fontWeight: (theme === null || theme === void 0 ? void 0 : theme.fontWeightMedium) || '500',
191
+ fontSize: theme?.fontSizeSmall || '14px',
192
+ fontWeight: theme?.fontWeightMedium || '500',
232
193
  lineHeight: '20px',
233
194
  textOverflow: 'ellipsis',
234
195
  whiteSpace: 'nowrap',
235
196
  overflow: 'hidden',
236
- } }, { children: column.label }))] }), 'sqlcol' + index)); }) })) })), _jsx("div", __assign({ role: "rowgroup", className: "tbody" }, { children: !rows.length ? (_jsx("div", __assign({ role: "row", className: "tr", style: {
197
+ }, children: column.label })] }, 'sqlcol' + index))) }) }), (0, jsx_runtime_1.jsx)("div", { role: "rowgroup", className: "tbody", children: !rows.length ? ((0, jsx_runtime_1.jsx)("div", { role: "row", className: "tr", style: {
237
198
  display: 'flex',
238
199
  flex: '1 0 auto',
239
200
  minWidth: '100px',
240
201
  boxSizing: 'border-box',
241
- } }, { children: _jsx("div", __assign({ role: "cell", className: "td airplane-1h7muk6", style: {
202
+ }, children: (0, jsx_runtime_1.jsx)("div", { role: "cell", className: "td airplane-1h7muk6", style: {
242
203
  boxSizing: 'border-box',
243
204
  flex: '150 0 auto',
244
205
  minWidth: '50px',
@@ -250,32 +211,32 @@ export function SpecialTable(_a) {
250
211
  borderRight: '1px solid rgb(229, 231, 235)',
251
212
  overflow: 'hidden',
252
213
  borderTop: '1px solid rgb(229, 231, 235)',
253
- } }, { children: _jsx("div", __assign({ style: {
214
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
254
215
  lineHeight: '24px',
255
216
  width: '100%',
256
217
  display: 'flex',
257
218
  cursor: 'default',
258
219
  position: 'relative',
259
- }, className: "airplane-gowkln", "data-testid": "static-cell" }, { children: _jsx("div", __assign({ className: "airplane-Text-root airplane-mzqt6k", "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r8-dropdown", id: "mantine-r8-target", style: {
260
- fontFamily: (theme === null || theme === void 0 ? void 0 : theme.fontFamily) ||
220
+ }, className: "airplane-gowkln", "data-testid": "static-cell", children: (0, jsx_runtime_1.jsx)("div", { className: "airplane-Text-root airplane-mzqt6k", "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r8-dropdown", id: "mantine-r8-target", style: {
221
+ fontFamily: theme?.fontFamily ||
261
222
  'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
262
223
  WebkitTapHighlightColor: 'transparent',
263
224
  // color: 'rgb(55, 65, 81)',
264
- color: (theme === null || theme === void 0 ? void 0 : theme.secondaryTextColor) || 'rgb(55, 65, 81)',
225
+ color: theme?.secondaryTextColor || 'rgb(55, 65, 81)',
265
226
  textDecoration: 'none',
266
227
  fontWeight: 400,
267
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '14px',
228
+ fontSize: theme?.fontSizeSmall || '14px',
268
229
  lineHeight: '20px',
269
230
  textOverflow: 'ellipsis',
270
231
  whiteSpace: 'nowrap',
271
232
  overflow: 'hidden',
272
233
  padding: '8px 16px',
273
- } }, { children: "No rows returned" })) })) }), 'sqlcell0') }), 'sqlrow0')) : (rows.map(function (row, rowIndex) { return (_jsx("div", __assign({ role: "row", className: "tr", style: {
234
+ }, children: "No rows returned" }) }) }, 'sqlcell0') }, 'sqlrow0')) : (rows.map((row, rowIndex) => ((0, jsx_runtime_1.jsx)("div", { role: "row", className: "tr", style: {
274
235
  display: 'flex',
275
236
  flex: '1 0 auto',
276
237
  minWidth: '100px',
277
238
  boxSizing: 'border-box',
278
- } }, { children: columns.map(function (column, columnIndex) { return (_jsx("div", __assign({ role: "cell", className: "td airplane-1h7muk6", style: {
239
+ }, children: columns.map((column, columnIndex) => ((0, jsx_runtime_1.jsx)("div", { role: "cell", className: "td airplane-1h7muk6", style: {
279
240
  boxSizing: 'border-box',
280
241
  flex: '150 0 auto',
281
242
  minWidth: '50px',
@@ -290,40 +251,46 @@ export function SpecialTable(_a) {
290
251
  borderBottom: rowIndex === rows.length - 1
291
252
  ? '1px solid rgb(229, 231, 235)'
292
253
  : undefined,
293
- } }, { children: _jsx("div", __assign({ style: {
254
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
294
255
  lineHeight: '24px',
295
256
  width: '100%',
296
257
  display: 'flex',
297
258
  cursor: 'default',
298
259
  position: 'relative',
299
- }, className: "airplane-gowkln", "data-testid": "static-cell" }, { children: _jsx("div", __assign({ className: "airplane-Text-root airplane-mzqt6k", "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r8-dropdown", id: "mantine-r8-target", style: {
300
- fontFamily: (theme === null || theme === void 0 ? void 0 : theme.fontFamily) ||
260
+ }, className: "airplane-gowkln", "data-testid": "static-cell", children: (0, jsx_runtime_1.jsx)("div", { className: "airplane-Text-root airplane-mzqt6k", "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r8-dropdown", id: "mantine-r8-target", style: {
261
+ fontFamily: theme?.fontFamily ||
301
262
  'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
302
263
  WebkitTapHighlightColor: 'transparent',
303
264
  // color: 'rgb(55, 65, 81)',
304
- color: (theme === null || theme === void 0 ? void 0 : theme.secondaryTextColor) || 'rgb(55, 65, 81)',
265
+ color: theme?.secondaryTextColor || 'rgb(55, 65, 81)',
305
266
  textDecoration: 'none',
306
267
  fontWeight: 400,
307
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '14px',
268
+ fontSize: theme?.fontSizeSmall || '14px',
308
269
  lineHeight: '20px',
309
270
  textOverflow: 'ellipsis',
310
271
  whiteSpace: 'nowrap',
311
272
  overflow: 'hidden',
312
273
  padding: '8px 16px',
313
- } }, { children: typeof row[column.field] === 'object'
274
+ }, children: typeof row[column.field] === 'object'
314
275
  ? JSON.stringify(row[column.field]).length > 55
315
276
  ? JSON.stringify(row[column.field]).substring(0, 52) + '...'
316
277
  : JSON.stringify(row[column.field])
317
278
  : row[column.field].length > 55
318
279
  ? row[column.field].substring(0, 52) + '...'
319
- : row[column.field] })) })) }), 'sqlcell' + columnIndex)); }) }), 'sqlrow' + rowIndex)); })) }))] })) }))] })));
280
+ : row[column.field] }) }) }, 'sqlcell' + columnIndex))) }, 'sqlrow' + rowIndex)))) })] }) })] }));
320
281
  }
321
- return (_jsx("div", __assign({ style: __assign(__assign({}, containerStyle), {
282
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
283
+ ...containerStyle,
322
284
  // paddingLeft: 25,
323
285
  // paddingRight: 25,
324
286
  // borderRadius: 8,
325
287
  // marginTop: 25,
326
- overflow: 'visible', height: height }) }, { children: _jsx("div", __assign({ style: {
288
+ overflow: 'visible',
289
+ height: height,
290
+ // overflow: 'hidden',
291
+ // @ts-ignore
292
+ // boxShadow: 'rgba(231, 231, 231, 0.5) 0px 1px 2px 0px',
293
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
327
294
  height: '100%',
328
295
  overflow: 'scroll',
329
296
  borderRadius: 6,
@@ -334,12 +301,12 @@ export function SpecialTable(_a) {
334
301
  boxSizing: 'border-box',
335
302
  outline: 'none',
336
303
  // maxHeight: 600,
337
- } }, { children: _jsxs("div", __assign({ role: "table", className: "table", style: { minWidth: '0px' } }, { children: [_jsx("div", __assign({ className: "thead" }, { children: _jsx("div", __assign({ role: "row", className: "tr", style: {
304
+ }, children: (0, jsx_runtime_1.jsxs)("div", { role: "table", className: "table", style: { minWidth: '0px' }, children: [(0, jsx_runtime_1.jsx)("div", { className: "thead", children: (0, jsx_runtime_1.jsx)("div", { role: "row", className: "tr", style: {
338
305
  display: 'flex',
339
306
  flex: '1 0 auto',
340
307
  minWidth: '100px',
341
308
  boxSizing: 'border-box',
342
- } }, { children: columns.map(function (column, index) { return (_jsxs("div", __assign({
309
+ }, children: columns.map((column, index) => ((0, jsx_runtime_1.jsxs)("div", {
343
310
  // @ts-ignore
344
311
  style: {
345
312
  boxSizing: 'border-box',
@@ -357,28 +324,28 @@ export function SpecialTable(_a) {
357
324
  margin: '0px',
358
325
  textOverflow: 'ellipsis',
359
326
  minHeight: '36px',
360
- } }, { children: [_jsx("div", { style: { width: 16 } }), _jsx("div", __assign({ "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r6-dropdown",
327
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: 16 } }), (0, jsx_runtime_1.jsx)("div", { "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r6-dropdown",
361
328
  // @ts-ignore
362
329
  style: {
363
330
  // fontFamily:
364
331
  // 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
365
332
  WebkitTapHighlightColor: 'transparent',
366
- fontFamily: theme === null || theme === void 0 ? void 0 : theme.fontFamily,
333
+ fontFamily: theme?.fontFamily,
367
334
  // color: 'rgb(55, 65, 81)',
368
- color: theme === null || theme === void 0 ? void 0 : theme.primaryTextColor,
335
+ color: theme?.primaryTextColor,
369
336
  textDecoration: 'none',
370
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '14px',
371
- fontWeight: (theme === null || theme === void 0 ? void 0 : theme.fontWeightMedium) || '500',
337
+ fontSize: theme?.fontSizeSmall || '14px',
338
+ fontWeight: theme?.fontWeightMedium || '500',
372
339
  lineHeight: '20px',
373
340
  textOverflow: 'ellipsis',
374
341
  whiteSpace: 'nowrap',
375
342
  overflow: 'hidden',
376
- } }, { children: column.label }))] }), 'sqlcol' + index)); }) })) })), _jsx("div", __assign({ role: "rowgroup", className: "tbody" }, { children: rows.map(function (row, rowIndex) { return (_jsx("div", __assign({ role: "row", className: "tr", style: {
343
+ }, children: column.label })] }, 'sqlcol' + index))) }) }), (0, jsx_runtime_1.jsx)("div", { role: "rowgroup", className: "tbody", children: rows.map((row, rowIndex) => ((0, jsx_runtime_1.jsx)("div", { role: "row", className: "tr", style: {
377
344
  display: 'flex',
378
345
  flex: '1 0 auto',
379
346
  minWidth: '100px',
380
347
  boxSizing: 'border-box',
381
- } }, { children: columns.map(function (column, columnIndex) { return (_jsx("div", __assign({ role: "cell", className: "td airplane-1h7muk6", style: {
348
+ }, children: columns.map((column, columnIndex) => ((0, jsx_runtime_1.jsx)("div", { role: "cell", className: "td airplane-1h7muk6", style: {
382
349
  boxSizing: 'border-box',
383
350
  flex: '150 0 auto',
384
351
  minWidth: '50px',
@@ -390,118 +357,105 @@ export function SpecialTable(_a) {
390
357
  borderRight: '1px solid rgb(229, 231, 235)',
391
358
  overflow: 'hidden',
392
359
  borderTop: '1px solid rgb(229, 231, 235)',
393
- } }, { children: _jsx("div", __assign({ style: {
360
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
394
361
  lineHeight: '24px',
395
362
  width: '100%',
396
363
  display: 'flex',
397
364
  cursor: 'default',
398
365
  position: 'relative',
399
- }, className: "airplane-gowkln", "data-testid": "static-cell" }, { children: _jsx("div", __assign({ className: "airplane-Text-root airplane-mzqt6k", "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r8-dropdown", id: "mantine-r8-target", style: {
400
- fontFamily: (theme === null || theme === void 0 ? void 0 : theme.fontFamily) ||
366
+ }, className: "airplane-gowkln", "data-testid": "static-cell", children: (0, jsx_runtime_1.jsx)("div", { className: "airplane-Text-root airplane-mzqt6k", "aria-haspopup": "dialog", "aria-expanded": "false", "aria-controls": "mantine-r8-dropdown", id: "mantine-r8-target", style: {
367
+ fontFamily: theme?.fontFamily ||
401
368
  'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
402
369
  WebkitTapHighlightColor: 'transparent',
403
370
  // color: 'rgb(55, 65, 81)',
404
- color: (theme === null || theme === void 0 ? void 0 : theme.secondaryTextColor) || 'rgb(55, 65, 81)',
371
+ color: theme?.secondaryTextColor || 'rgb(55, 65, 81)',
405
372
  textDecoration: 'none',
406
373
  fontWeight: 400,
407
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '14px',
374
+ fontSize: theme?.fontSizeSmall || '14px',
408
375
  lineHeight: '20px',
409
376
  textOverflow: 'ellipsis',
410
377
  whiteSpace: 'nowrap',
411
378
  overflow: 'hidden',
412
379
  padding: '8px 16px',
413
- } }, { children: typeof row[column.field] === 'object'
380
+ }, children: typeof row[column.field] === 'object'
414
381
  ? JSON.stringify(row[column.field]).length > 55
415
382
  ? JSON.stringify(row[column.field]).substring(0, 52) + '...'
416
383
  : JSON.stringify(row[column.field])
417
384
  : row[column.field].length > 55
418
385
  ? row[column.field].substring(0, 52) + '...'
419
- : row[column.field] })) })) }), 'sqlcell' + columnIndex)); }) }), 'sqlrow' + rowIndex)); }) }))] })) })) })));
386
+ : row[column.field] }) }) }, 'sqlcell' + columnIndex))) }, 'sqlrow' + rowIndex))) })] }) }) }));
420
387
  }
421
- var ChartUpdater = function (_a) {
422
- var chartId = _a.chartId, containerStyle = _a.containerStyle, dashboard = _a.dashboard, dispatch = _a.dispatch, client = _a.client, theme = _a.theme, downloadCSV = _a.downloadCSV, csvFilename = _a.csvFilename;
423
- var _b = useState(null), chartConfig = _b[0], setChartConfig = _b[1];
424
- var _c = useState(true), loading = _c[0], setLoading = _c[1];
425
- useEffect(function () {
426
- var isSubscribed = true;
427
- function getChartOptions(id) {
428
- return __awaiter(this, void 0, void 0, function () {
429
- var _a, columns, rows, name_1, publicKey, customerId, environment, resp, _b, columns, rows, name_2, e_1;
430
- return __generator(this, function (_c) {
431
- switch (_c.label) {
432
- case 0:
433
- if (!isSubscribed) return [3 /*break*/, 4];
434
- // @ts-ignore
435
- if (dashboard && dashboard[id]) {
436
- _a = dashboard[id], columns = _a.columns, rows = _a.rows, name_1 = _a.name;
437
- setChartConfig({
438
- columns: columns,
439
- rows: rows,
440
- name: name_1,
441
- });
442
- setLoading(false);
443
- return [2 /*return*/];
444
- }
445
- publicKey = client.publicKey, customerId = client.customerId, environment = client.environment;
446
- setLoading(true);
447
- _c.label = 1;
448
- case 1:
449
- _c.trys.push([1, 3, , 4]);
450
- return [4 /*yield*/, axios.get('https://quill-344421.uc.r.appspot.com/item', {
451
- params: {
452
- id: chartId,
453
- orgId: customerId,
454
- publicKey: publicKey,
455
- },
456
- headers: {
457
- environment: environment || undefined,
458
- },
459
- })];
460
- case 2:
461
- resp = _c.sent();
462
- _b = resp.data, columns = _b.columns, rows = _b.rows, name_2 = _b.name;
463
- setChartConfig({
464
- columns: columns,
465
- rows: rows,
466
- name: name_2,
467
- });
468
- setLoading(false);
469
- return [3 /*break*/, 4];
470
- case 3:
471
- e_1 = _c.sent();
472
- console.log('Error fetching chart: ', e_1);
473
- setLoading(false);
474
- return [3 /*break*/, 4];
475
- case 4: return [2 /*return*/];
476
- }
477
- });
478
- });
388
+ exports.SpecialTable = SpecialTable;
389
+ const ChartUpdater = ({ chartId, containerStyle, dashboard, dispatch, client, theme, downloadCSV, csvFilename, }) => {
390
+ const [chartConfig, setChartConfig] = (0, react_1.useState)(null);
391
+ const [loading, setLoading] = (0, react_1.useState)(true);
392
+ (0, react_1.useEffect)(() => {
393
+ let isSubscribed = true;
394
+ async function getChartOptions(id) {
395
+ if (isSubscribed) {
396
+ // @ts-ignore
397
+ if (dashboard && dashboard[id]) {
398
+ const { columns, rows, name } = dashboard[id];
399
+ setChartConfig({
400
+ columns,
401
+ rows,
402
+ name,
403
+ });
404
+ setLoading(false);
405
+ return;
406
+ }
407
+ const { publicKey, customerId, environment } = client;
408
+ setLoading(true);
409
+ try {
410
+ const resp = await axios_1.default.get('https://quill-344421.uc.r.appspot.com/item', {
411
+ params: {
412
+ id: chartId,
413
+ orgId: customerId,
414
+ publicKey: publicKey,
415
+ },
416
+ headers: {
417
+ environment: environment || undefined,
418
+ },
419
+ });
420
+ const { columns, rows, name } = resp.data;
421
+ setChartConfig({
422
+ columns,
423
+ rows,
424
+ name,
425
+ });
426
+ setLoading(false);
427
+ // dispatch({ type: 'UPDATE_DASHBOARD_ITEM', id, data: resp.data });
428
+ }
429
+ catch (e) {
430
+ console.log('Error fetching chart: ', e);
431
+ setLoading(false);
432
+ }
433
+ }
479
434
  }
480
435
  if (chartId && !chartConfig) {
481
436
  getChartOptions(chartId);
482
437
  }
483
- return function () {
438
+ return () => {
484
439
  isSubscribed = false;
485
440
  };
486
441
  }, [chartConfig]);
487
- var NUM_TO_SHOW = (containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.height)
442
+ const NUM_TO_SHOW = containerStyle?.height
488
443
  ? Math.floor(containerStyle.height / 40) - 1
489
444
  : 6;
490
- var memoizedData = useMemo(function () {
445
+ const memoizedData = (0, react_1.useMemo)(() => {
491
446
  if (!chartConfig || !chartConfig.rows || !chartConfig.rows.length) {
492
447
  return [];
493
448
  }
494
449
  // Deep copy of data
495
- var copiedData = JSON.parse(JSON.stringify(chartConfig && chartConfig.rows && chartConfig.rows.length
450
+ const copiedData = JSON.parse(JSON.stringify(chartConfig && chartConfig.rows && chartConfig.rows.length
496
451
  ? chartConfig.rows
497
452
  : []));
498
- return copiedData.map(function (item) {
499
- var fieldsWithFormattedValues = {};
500
- for (var _i = 0, _a = chartConfig.columns; _i < _a.length; _i++) {
501
- var field = _a[_i];
502
- var value = item[field.field];
503
- fieldsWithFormattedValues[field.field] = valueFormatter({
504
- value: value,
453
+ return copiedData.map(item => {
454
+ const fieldsWithFormattedValues = {};
455
+ for (const field of chartConfig.columns) {
456
+ const value = item[field.field];
457
+ fieldsWithFormattedValues[field.field] = (0, Chart_1.valueFormatter)({
458
+ value,
505
459
  field: field.field,
506
460
  fields: chartConfig.columns,
507
461
  });
@@ -509,98 +463,91 @@ var ChartUpdater = function (_a) {
509
463
  return fieldsWithFormattedValues;
510
464
  });
511
465
  }, [chartConfig]);
512
- var handleDownloadCSV = function () {
466
+ const handleDownloadCSV = () => {
513
467
  downloadCSV(memoizedData, chartConfig.name);
514
468
  };
515
469
  if (!chartConfig || loading) {
516
- return (_jsx("div", __assign({
470
+ return ((0, jsx_runtime_1.jsx)("div", {
517
471
  // className="flex flex-col flex-1 h-[100%]"
518
- style: __assign(__assign({}, containerStyle), {
472
+ style: {
473
+ ...containerStyle,
519
474
  // marginLeft: 25,
520
475
  // marginRight: 25,
521
- boxSizing: 'content-box', height: '100%', display: 'flex', flexDirection: 'column', flex: 1 }) }, { children: _jsx("div", __assign({ style: {
522
- height: (containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.height) || 300,
476
+ boxSizing: 'content-box',
477
+ height: '100%',
478
+ display: 'flex',
479
+ flexDirection: 'column',
480
+ flex: 1,
481
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
482
+ height: containerStyle?.height || 300,
523
483
  width: '100%',
524
484
  boxSizing: 'content-box',
525
- } }, { children: _jsx(Skeleton, { count: 1,
526
- // height={containerStyle?.height}
527
- height: (containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.height) && (containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.marginTop)
528
- ? (containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.height) + (containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.marginTop)
529
- : (containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.height)
530
- ? containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.height
531
- : 300, borderRadius: 8,
532
- // highlightColor="#F7F7F8"
533
- highlightColor: "#FDFDFD",
534
- // baseColor="#F3F4F6"
535
- baseColor: "#F9F9FA", width: "100%" }) })) })));
485
+ }, children: (0, jsx_runtime_1.jsxs)("svg", { width: "100%", height: "100%", xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", children: [(0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", fill: "#F9F9FA" }), (0, jsx_runtime_1.jsx)("defs", { fill: "#F9F9FA", children: (0, jsx_runtime_1.jsxs)("linearGradient", { id: "skeletonGradient", x1: "0%", y1: "0%", x2: "10%", y2: "0%", gradientUnits: "userSpaceOnUse", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0%", "stop-color": "rgba(255,255,255,0)" }), (0, jsx_runtime_1.jsx)("stop", { offset: "50%", "stop-color": "#FEFEFE" }), (0, jsx_runtime_1.jsx)("stop", { offset: "100%", "stop-color": "rgba(255,255,255,0)" }), (0, jsx_runtime_1.jsx)("animate", { attributeName: "x1", from: "-100%", to: "100%", dur: "2s", repeatCount: "indefinite" }), (0, jsx_runtime_1.jsx)("animate", { attributeName: "x2", from: "-50%", to: "150%", dur: "2s", repeatCount: "indefinite" })] }) }), (0, jsx_runtime_1.jsx)("rect", { width: "50%", height: "100%", fill: "url(#skeletonGradient)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "x", from: "-100%", to: "100%", dur: "2s", repeatCount: "indefinite" }) })] }) }) }));
536
486
  }
537
- return (_jsx(SpecialTable, { showDownloadCsvButton: true, csvFilename: csvFilename || chartConfig.name, columns: chartConfig.columns, rows: memoizedData, height: (containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.height) || '100%', theme: theme }));
487
+ return ((0, jsx_runtime_1.jsx)(SpecialTable, { showDownloadCsvButton: true, csvFilename: csvFilename || chartConfig.name, columns: chartConfig.columns, rows: memoizedData, height: containerStyle?.height || '100%', theme: theme }));
538
488
  };
539
- function Columns(_a) {
540
- var columns = _a.columns, data = _a.data, theme = _a.theme, handleDownloadCSV = _a.handleDownloadCSV, numToShow = _a.numToShow;
541
- return (_jsxs("div", __assign({ style: { display: 'flex', flexDirection: 'column', height: '100%' } }, { children: [_jsx("div", __assign({ style: {
489
+ function Columns({ columns, data, theme, handleDownloadCSV, numToShow }) {
490
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', height: '100%' }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
542
491
  display: 'flex',
543
492
  flexDirection: 'row',
544
493
  // overflowX: 'scroll',
545
494
  // overflowY: 'hidden',
546
495
  overflow: 'scroll',
547
496
  height: '100%',
548
- } }, { children: columns.map(function (elem) { return (_jsx(Column, { column: elem, data: data, theme: theme }, elem.field)); }) })), _jsxs("div", __assign({ style: {
497
+ }, children: columns.map(elem => ((0, jsx_runtime_1.jsx)(Column, { column: elem, data: data, theme: theme }, elem.field))) }), (0, jsx_runtime_1.jsxs)("div", { style: {
549
498
  display: 'flex',
550
499
  flexDirection: 'row',
551
500
  alignItems: 'center',
552
501
  justifyContent: 'space-between',
553
502
  // background: 'black',
554
- } }, { children: [data.length > numToShow && (_jsxs("div", __assign({ style: {
555
- color: theme === null || theme === void 0 ? void 0 : theme.chartLabelColor,
503
+ }, children: [data.length > numToShow && ((0, jsx_runtime_1.jsxs)("div", { style: {
504
+ color: theme?.chartLabelColor,
556
505
  boxSizing: 'content-box',
557
- fontFamily: (theme === null || theme === void 0 ? void 0 : theme.chartLabelFontFamily) || (theme === null || theme === void 0 ? void 0 : theme.fontFamily),
558
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '0.875rem',
506
+ fontFamily: theme?.chartLabelFontFamily || theme?.fontFamily,
507
+ fontSize: theme?.fontSizeSmall || '0.875rem',
559
508
  marginLeft: 12,
560
509
  marginTop: 8,
561
- } }, { children: ["...", data.length - numToShow, " more"] }))), _jsx("div", __assign({ onClick: handleDownloadCSV, style: {
510
+ }, children: ["...", data.length - numToShow, " more"] })), (0, jsx_runtime_1.jsx)("div", { onClick: handleDownloadCSV, style: {
562
511
  height: 40,
563
512
  minHeight: 40,
564
- color: theme === null || theme === void 0 ? void 0 : theme.primaryTextColor,
513
+ color: theme?.primaryTextColor,
565
514
  boxSizing: 'content-box',
566
- fontFamily: (theme === null || theme === void 0 ? void 0 : theme.chartLabelFontFamily) || (theme === null || theme === void 0 ? void 0 : theme.fontFamily),
567
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '0.875rem',
568
- fontWeight: (theme === null || theme === void 0 ? void 0 : theme.fontWeightMedium) || '500',
515
+ fontFamily: theme?.chartLabelFontFamily || theme?.fontFamily,
516
+ fontSize: theme?.fontSizeSmall || '0.875rem',
517
+ fontWeight: theme?.fontWeightMedium || '500',
569
518
  marginTop: 8,
570
519
  marginLeft: 20,
571
520
  cursor: 'pointer',
572
- } }, { children: "Download CSV" }))] }))] })));
521
+ }, children: "Download CSV" })] })] }));
573
522
  }
574
- function Column(_a) {
575
- var column = _a.column, data = _a.data, theme = _a.theme;
576
- return (_jsxs("div", __assign({ style: {
523
+ function Column({ column, data, theme }) {
524
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
577
525
  paddingLeft: 20,
578
526
  paddingRight: 20,
579
527
  // width: 'max-content',
580
528
  display: 'inline-flex',
581
529
  flexDirection: 'column',
582
530
  whiteSpace: 'nowrap',
583
- } }, { children: [_jsx("div", __assign({ style: {
531
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
584
532
  height: 40,
585
533
  minHeight: 40,
586
- color: theme === null || theme === void 0 ? void 0 : theme.primaryTextColor,
534
+ color: theme?.primaryTextColor,
587
535
  boxSizing: 'content-box',
588
- fontFamily: (theme === null || theme === void 0 ? void 0 : theme.chartLabelFontFamily) || (theme === null || theme === void 0 ? void 0 : theme.fontFamily),
589
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '0.875rem',
590
- fontWeight: (theme === null || theme === void 0 ? void 0 : theme.fontWeightMedium) || '500',
591
- } }, { children: column.label })), data.map(function (elem) { return (_jsx(Cell, { item: elem[column.field], theme: theme })); })] })));
536
+ fontFamily: theme?.chartLabelFontFamily || theme?.fontFamily,
537
+ fontSize: theme?.fontSizeSmall || '0.875rem',
538
+ fontWeight: theme?.fontWeightMedium || '500',
539
+ }, children: column.label }), data.map(elem => ((0, jsx_runtime_1.jsx)(Cell, { item: elem[column.field], theme: theme })))] }));
592
540
  }
593
- function Cell(_a) {
594
- var item = _a.item, theme = _a.theme;
595
- return (_jsx("div", __assign({ style: {
541
+ function Cell({ item, theme }) {
542
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
596
543
  height: 40,
597
544
  minHeight: 40,
598
545
  whiteSpace: 'nowrap',
599
546
  width: '100%',
600
- fontFamily: (theme === null || theme === void 0 ? void 0 : theme.chartLabelFontFamily) || (theme === null || theme === void 0 ? void 0 : theme.fontFamily),
601
- fontSize: (theme === null || theme === void 0 ? void 0 : theme.fontSizeSmall) || '0.875rem',
602
- color: theme === null || theme === void 0 ? void 0 : theme.chartLabelColor,
603
- } }, { children: item })));
547
+ fontFamily: theme?.chartLabelFontFamily || theme?.fontFamily,
548
+ fontSize: theme?.fontSizeSmall || '0.875rem',
549
+ color: theme?.chartLabelColor,
550
+ }, children: item }));
604
551
  }
605
- export default Table;
552
+ exports.default = Table;
606
553
  //# sourceMappingURL=Table.js.map