@quillsql/react 1.6.9 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AddToDashboardModal.js +249 -369
- package/lib/AddToDashboardModal.js.map +1 -1
- package/lib/BarList.js +92 -109
- package/lib/BarList.js.map +1 -1
- package/lib/Chart.js +378 -491
- package/lib/Chart.js.map +1 -1
- package/lib/Context.d.ts +3 -3
- package/lib/Context.js +94 -96
- package/lib/Context.js.map +1 -1
- package/lib/Dashboard.js +200 -217
- package/lib/Dashboard.js.map +1 -1
- package/lib/DateRangePicker/Calendar.js +87 -91
- package/lib/DateRangePicker/Calendar.js.map +1 -1
- package/lib/DateRangePicker/DateRangePicker.js +70 -68
- package/lib/DateRangePicker/DateRangePicker.js.map +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.js +46 -57
- package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -1
- package/lib/DateRangePicker/dateRangePickerUtils.js +105 -99
- package/lib/DateRangePicker/dateRangePickerUtils.js.map +1 -1
- package/lib/DateRangePicker/index.js +8 -1
- package/lib/DateRangePicker/index.js.map +1 -1
- package/lib/PieChart.js +221 -225
- package/lib/PieChart.js.map +1 -1
- package/lib/QuillProvider.d.ts +2 -1
- package/lib/QuillProvider.js +8 -18
- package/lib/QuillProvider.js.map +1 -1
- package/lib/ReportBuilder.d.ts +1 -1
- package/lib/ReportBuilder.js +430 -526
- package/lib/ReportBuilder.js.map +1 -1
- package/lib/SQLEditor.js +183 -268
- package/lib/SQLEditor.js.map +1 -1
- package/lib/Table.js +213 -256
- package/lib/Table.js.map +1 -1
- package/lib/TableChart.js +76 -75
- package/lib/TableChart.js.map +1 -1
- package/lib/assets/ArrowDownHeadIcon.js +5 -28
- package/lib/assets/ArrowDownHeadIcon.js.map +1 -1
- package/lib/assets/ArrowDownIcon.js +5 -28
- package/lib/assets/ArrowDownIcon.js.map +1 -1
- package/lib/assets/ArrowDownRightIcon.js +5 -28
- package/lib/assets/ArrowDownRightIcon.js.map +1 -1
- package/lib/assets/ArrowLeftHeadIcon.js +5 -28
- package/lib/assets/ArrowLeftHeadIcon.js.map +1 -1
- package/lib/assets/ArrowRightHeadIcon.js +5 -28
- package/lib/assets/ArrowRightHeadIcon.js.map +1 -1
- package/lib/assets/ArrowRightIcon.js +5 -28
- package/lib/assets/ArrowRightIcon.js.map +1 -1
- package/lib/assets/ArrowUpHeadIcon.js +5 -28
- package/lib/assets/ArrowUpHeadIcon.js.map +1 -1
- package/lib/assets/ArrowUpIcon.js +5 -28
- package/lib/assets/ArrowUpIcon.js.map +1 -1
- package/lib/assets/ArrowUpRightIcon.js +5 -28
- package/lib/assets/ArrowUpRightIcon.js.map +1 -1
- package/lib/assets/CalendarIcon.js +5 -28
- package/lib/assets/CalendarIcon.js.map +1 -1
- package/lib/assets/DoubleArrowLeftHeadIcon.js +5 -28
- package/lib/assets/DoubleArrowLeftHeadIcon.js.map +1 -1
- package/lib/assets/DoubleArrowRightHeadIcon.js +5 -28
- package/lib/assets/DoubleArrowRightHeadIcon.js.map +1 -1
- package/lib/assets/ExclamationFilledIcon.js +5 -28
- package/lib/assets/ExclamationFilledIcon.js.map +1 -1
- package/lib/assets/LoadingSpinner.js +5 -28
- package/lib/assets/LoadingSpinner.js.map +1 -1
- package/lib/assets/SearchIcon.js +5 -28
- package/lib/assets/SearchIcon.js.map +1 -1
- package/lib/assets/XCircleIcon.js +5 -28
- package/lib/assets/XCircleIcon.js.map +1 -1
- package/lib/assets/index.js +38 -16
- package/lib/assets/index.js.map +1 -1
- package/lib/components/BigModal/BigModal.js +45 -43
- package/lib/components/BigModal/BigModal.js.map +1 -1
- package/lib/components/Dropdown/Dropdown.js +57 -53
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/DropdownItem.js +43 -40
- package/lib/components/Dropdown/DropdownItem.js.map +1 -1
- package/lib/components/Dropdown/index.js +10 -2
- package/lib/components/Dropdown/index.js.map +1 -1
- package/lib/components/Modal/Modal.js +45 -43
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/index.js +8 -1
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/selectUtils.js +20 -15
- package/lib/components/selectUtils.js.map +1 -1
- package/lib/contexts/BaseColorContext.js +5 -3
- package/lib/contexts/BaseColorContext.js.map +1 -1
- package/lib/contexts/HoveredValueContext.js +5 -3
- package/lib/contexts/HoveredValueContext.js.map +1 -1
- package/lib/contexts/RootStylesContext.js +5 -3
- package/lib/contexts/RootStylesContext.js.map +1 -1
- package/lib/contexts/SelectedValueContext.js +5 -3
- package/lib/contexts/SelectedValueContext.js.map +1 -1
- package/lib/contexts/index.js +14 -4
- package/lib/contexts/index.js.map +1 -1
- package/lib/hooks/index.js +14 -4
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useInternalState.js +9 -7
- package/lib/hooks/useInternalState.js.map +1 -1
- package/lib/hooks/useOnClickOutside.js +8 -6
- package/lib/hooks/useOnClickOutside.js.map +1 -1
- package/lib/hooks/useOnWindowResize.js +9 -7
- package/lib/hooks/useOnWindowResize.js.map +1 -1
- package/lib/hooks/useQuill.js +60 -111
- package/lib/hooks/useQuill.js.map +1 -1
- package/lib/hooks/useSelectOnKeyDown.js +17 -15
- package/lib/hooks/useSelectOnKeyDown.js.map +1 -1
- package/lib/index.js +22 -8
- package/lib/index.js.map +1 -1
- package/package.json +9 -2
- package/rollup.config.ts +21 -0
- package/src/AddToDashboardModal.tsx +10 -3
- package/src/Chart.tsx +66 -195
- package/src/Context.tsx +10 -27
- package/src/Dashboard.tsx +40 -23
- package/src/QuillProvider.tsx +3 -0
- package/src/ReportBuilder.tsx +10 -5
- package/src/SQLEditor.tsx +9 -4
- package/src/Table.tsx +0 -1
- package/src/hooks/useQuill.ts +2 -1
- package/lib/AddToDashboardButton.d.ts +0 -1
- package/lib/AddToDashboardButton.js +0 -2
- package/lib/AddToDashboardButton.js.map +0 -1
- package/lib/AppContext.d.ts +0 -29
- package/lib/AppContext.js +0 -94
- package/lib/AppContext.js.map +0 -1
- package/lib/Button.d.ts +0 -26
- package/lib/Button.js +0 -151
- package/lib/Button.js.map +0 -1
- package/lib/ContextProvider.d.ts +0 -28
- package/lib/ContextProvider.js +0 -93
- package/lib/ContextProvider.js.map +0 -1
- package/lib/DateRangePicker.d.ts +0 -32
- package/lib/DateRangePicker.js +0 -105
- package/lib/DateRangePicker.js.map +0 -1
- package/lib/Dialog.d.ts +0 -68
- package/lib/Dialog.js +0 -407
- package/lib/Dialog.js.map +0 -1
- package/lib/Portal.d.ts +0 -32
- package/lib/Portal.js +0 -171
- package/lib/Portal.js.map +0 -1
- package/lib/Props.d.ts +0 -0
- package/lib/Props.js +0 -2
- package/lib/Props.js.map +0 -1
- package/lib/components/BigModal/Modal.d.ts +0 -14
- package/lib/components/BigModal/Modal.js +0 -109
- package/lib/components/BigModal/Modal.js.map +0 -1
- package/lib/components/Modal/Dropdown/Dropdown.d.ts +0 -12
- package/lib/components/Modal/Dropdown/Dropdown.js +0 -52
- package/lib/components/Modal/Dropdown/Dropdown.js.map +0 -1
- package/lib/components/Modal/Dropdown/DropdownItem.d.ts +0 -8
- package/lib/components/Modal/Dropdown/DropdownItem.js +0 -51
- package/lib/components/Modal/Dropdown/DropdownItem.js.map +0 -1
- package/lib/components/Modal/Dropdown/index.d.ts +0 -2
- package/lib/components/Modal/Dropdown/index.js +0 -3
- package/lib/components/Modal/Dropdown/index.js.map +0 -1
- package/lib/hooks/useSyncRefs.d.ts +0 -5
- package/lib/hooks/useSyncRefs.js +0 -38
- package/lib/hooks/useSyncRefs.js.map +0 -1
- package/lib/lib/colorClassNames.d.ts +0 -19
- package/lib/lib/colorClassNames.js +0 -3175
- package/lib/lib/colorClassNames.js.map +0 -1
- package/lib/lib/constants.d.ts +0 -16
- package/lib/lib/constants.js +0 -47
- package/lib/lib/constants.js.map +0 -1
- package/lib/lib/font.d.ts +0 -13
- package/lib/lib/font.js +0 -14
- package/lib/lib/font.js.map +0 -1
- package/lib/lib/hexColors.d.ts +0 -3
- package/lib/lib/hexColors.js +0 -29
- package/lib/lib/hexColors.js.map +0 -1
- package/lib/lib/index.d.ts +0 -3
- package/lib/lib/index.js +0 -4
- package/lib/lib/index.js.map +0 -1
- package/lib/lib/inputTypes.d.ts +0 -20
- package/lib/lib/inputTypes.js +0 -56
- package/lib/lib/inputTypes.js.map +0 -1
- package/lib/lib/shape.d.ts +0 -73
- package/lib/lib/shape.js +0 -74
- package/lib/lib/shape.js.map +0 -1
- package/lib/lib/sizing.d.ts +0 -46
- package/lib/lib/sizing.js +0 -43
- package/lib/lib/sizing.js.map +0 -1
- package/lib/lib/spacing.d.ts +0 -264
- package/lib/lib/spacing.js +0 -265
- package/lib/lib/spacing.js.map +0 -1
- package/lib/lib/theme.d.ts +0 -22
- package/lib/lib/theme.js +0 -46
- package/lib/lib/theme.js.map +0 -1
- package/lib/lib/utils.d.ts +0 -9
- package/lib/lib/utils.js +0 -40
- package/lib/lib/utils.js.map +0 -1
- package/lib/styles.css +0 -15795
- package/lib/types/Props.d.ts +0 -0
- package/lib/types/Props.js +0 -2
- package/lib/types/Props.js.map +0 -1
- package/lib/types.d.ts +0 -27
- package/lib/types.js +0 -6
- package/lib/types.js.map +0 -1
- package/src/lib/font.ts +0 -14
- package/src/lib/index.ts +0 -3
- package/src/lib/inputTypes.ts +0 -81
- package/src/lib/utils.tsx +0 -46
package/lib/Dashboard.js
CHANGED
|
@@ -1,63 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 };
|
|
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]; } };
|
|
46
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 };
|
|
47
27
|
};
|
|
48
|
-
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
49
31
|
// @ts-nocheck
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
32
|
+
const react_1 = __importStar(require("react"));
|
|
33
|
+
const Chart_1 = __importDefault(require("./Chart"));
|
|
34
|
+
const Context_1 = require("./Context");
|
|
35
|
+
const date_fns_1 = require("date-fns");
|
|
36
|
+
const index_1 = require("./DateRangePicker/index");
|
|
37
|
+
const axios_1 = __importDefault(require("axios"));
|
|
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");
|
|
61
43
|
// const theme = {
|
|
62
44
|
// fontFamily: 'Inter; Helvetica',
|
|
63
45
|
// primaryTextColor: '#212121',
|
|
@@ -66,133 +48,137 @@ import { useInternalState, useSelectOnKeyDown } from './hooks';
|
|
|
66
48
|
// chartTickColor: '#CCCCCC',
|
|
67
49
|
// chartColors: ['#6269E9', '#E14F62'],
|
|
68
50
|
// };
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
case 1:
|
|
94
|
-
_a.trys.push([1, 5, , 6]);
|
|
95
|
-
if (!(queryEndpoint && queryHeaders)) return [3 /*break*/, 3];
|
|
96
|
-
return [4 /*yield*/, axios.post(queryEndpoint, {
|
|
97
|
-
metadata: { name: name, task: 'config' },
|
|
98
|
-
}, {
|
|
99
|
-
headers: queryHeaders,
|
|
100
|
-
})];
|
|
101
|
-
case 2:
|
|
102
|
-
response_1 = _a.sent();
|
|
103
|
-
if (response_1.status !== 200) {
|
|
104
|
-
throw new Error("HTTP error! Status: ".concat(response_1.status));
|
|
105
|
-
}
|
|
106
|
-
setDashboardSections(response_1.data.sections);
|
|
107
|
-
setConfigFilters(response_1.data.filters || []);
|
|
108
|
-
return [2 /*return*/];
|
|
109
|
-
case 3: return [4 /*yield*/, axios.get('https://quill-344421.uc.r.appspot.com/dashconfig', {
|
|
110
|
-
params: {
|
|
111
|
-
publicKey: publicKey,
|
|
112
|
-
orgId: customerId,
|
|
113
|
-
name: name,
|
|
114
|
-
task: 'dashconfig',
|
|
115
|
-
},
|
|
116
|
-
headers: {
|
|
117
|
-
environment: environment || undefined,
|
|
118
|
-
},
|
|
119
|
-
})];
|
|
120
|
-
case 4:
|
|
121
|
-
response = _a.sent();
|
|
122
|
-
if (response.status !== 200) {
|
|
123
|
-
throw new Error("HTTP error! Status: ".concat(response.status));
|
|
124
|
-
}
|
|
125
|
-
setDashboardSections(response.data.sections);
|
|
126
|
-
setConfigFilters(response.data.filters || []);
|
|
127
|
-
return [3 /*break*/, 6];
|
|
128
|
-
case 5:
|
|
129
|
-
error_1 = _a.sent();
|
|
130
|
-
console.error('Error fetching data:', error_1);
|
|
131
|
-
return [3 /*break*/, 6];
|
|
132
|
-
case 6: return [2 /*return*/];
|
|
51
|
+
function Dashboard({ name, containerStyle, maxColumnWidth, rowHeight, onClickDashboardItem, hideDateFilter, }) {
|
|
52
|
+
const [dashboardSections, setDashboardSections] = (0, react_1.useState)(null);
|
|
53
|
+
const { dashboard } = (0, react_1.useContext)(Context_1.DashboardContext);
|
|
54
|
+
const [client] = (0, react_1.useContext)(Context_1.ClientContext);
|
|
55
|
+
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
56
|
+
const { dashboardFiltersDispatch } = (0, react_1.useContext)(Context_1.DashboardFiltersContext);
|
|
57
|
+
const [configFilters, setConfigFilters] = (0, react_1.useState)([]);
|
|
58
|
+
react_1.default.useEffect(() => {
|
|
59
|
+
async function getDashboards() {
|
|
60
|
+
const { publicKey, customerId, environment, queryEndpoint, queryHeaders, withCredentials, } = client;
|
|
61
|
+
try {
|
|
62
|
+
// const response = await fetch(
|
|
63
|
+
// `https://quill-344421.uc.r.appspot.com/dashsections/${publicKey}/${customerId}/${name}`
|
|
64
|
+
// );
|
|
65
|
+
if (queryEndpoint) {
|
|
66
|
+
//&& queryHeaders
|
|
67
|
+
const response = await axios_1.default.post(queryEndpoint, {
|
|
68
|
+
metadata: { name, task: 'config' },
|
|
69
|
+
}, {
|
|
70
|
+
headers: queryHeaders,
|
|
71
|
+
withCredentials,
|
|
72
|
+
});
|
|
73
|
+
if (response.status !== 200) {
|
|
74
|
+
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
133
75
|
}
|
|
76
|
+
setDashboardSections(response.data.sections);
|
|
77
|
+
setConfigFilters(response.data.filters || []);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const response = await axios_1.default.get('https://quill-344421.uc.r.appspot.com/dashconfig', {
|
|
81
|
+
params: {
|
|
82
|
+
publicKey: publicKey,
|
|
83
|
+
orgId: customerId,
|
|
84
|
+
name: name,
|
|
85
|
+
task: 'dashconfig',
|
|
86
|
+
},
|
|
87
|
+
headers: {
|
|
88
|
+
environment: environment || undefined,
|
|
89
|
+
},
|
|
134
90
|
});
|
|
135
|
-
|
|
91
|
+
if (response.status !== 200) {
|
|
92
|
+
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
93
|
+
}
|
|
94
|
+
setDashboardSections(response.data.sections);
|
|
95
|
+
setConfigFilters(response.data.filters || []);
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
console.error('Error fetching data:', error);
|
|
99
|
+
}
|
|
136
100
|
}
|
|
137
101
|
getDashboards();
|
|
138
102
|
}, [name]);
|
|
139
|
-
|
|
140
|
-
setGlobalDateFilter(dateFilter[0], dateFilter[1]);
|
|
141
|
-
};
|
|
142
|
-
useEffect(function () {
|
|
103
|
+
(0, react_1.useEffect)(() => {
|
|
143
104
|
// change to be set on the dashboard / section as default date range
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
105
|
+
const filter = {
|
|
106
|
+
startDate: (0, date_fns_1.sub)((0, date_fns_1.startOfToday)(), { days: 90 }),
|
|
107
|
+
endDate: new Date(),
|
|
108
|
+
filterType: 'DATE_RANGE',
|
|
109
|
+
};
|
|
110
|
+
dashboardFiltersDispatch({
|
|
111
|
+
type: 'ADD_DASHBOARD_FILTER',
|
|
112
|
+
id: 'date_range',
|
|
113
|
+
data: {
|
|
114
|
+
...filter,
|
|
149
115
|
},
|
|
150
116
|
});
|
|
151
117
|
}, []);
|
|
152
|
-
|
|
118
|
+
const handleOnClickDashboardItem = id => {
|
|
153
119
|
if (dashboard[id]) {
|
|
154
120
|
onClickDashboardItem(dashboard[id]);
|
|
155
121
|
}
|
|
156
122
|
};
|
|
157
|
-
|
|
123
|
+
const onChangeDateFilter = dateFilter => {
|
|
124
|
+
setGlobalDateFilter(dateFilter[0], dateFilter[1]);
|
|
125
|
+
};
|
|
126
|
+
const setGlobalDateFilter = (startDate, endDate) => {
|
|
127
|
+
const filter = {
|
|
128
|
+
startDate: startDate,
|
|
129
|
+
endDate: endDate,
|
|
130
|
+
filterType: 'DATE_RANGE',
|
|
131
|
+
};
|
|
158
132
|
dashboardFiltersDispatch({
|
|
159
133
|
type: 'ADD_DASHBOARD_FILTER',
|
|
160
|
-
id:
|
|
161
|
-
data:
|
|
134
|
+
id: 'date_range',
|
|
135
|
+
data: {
|
|
136
|
+
...filter,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
const onChangeFilter = (value, filter) => {
|
|
141
|
+
dashboardFiltersDispatch({
|
|
142
|
+
type: 'ADD_DASHBOARD_FILTER',
|
|
143
|
+
id: 'date_range',
|
|
144
|
+
data: {
|
|
145
|
+
...filter,
|
|
146
|
+
selectedValue: filter.options.find(elem => elem[removeQuotes(filter.field)] === value[2])[removeQuotes(filter.field)],
|
|
147
|
+
},
|
|
162
148
|
});
|
|
163
149
|
};
|
|
164
150
|
if (!dashboardSections) {
|
|
165
151
|
return null;
|
|
166
152
|
}
|
|
167
|
-
return (
|
|
153
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: containerStyle, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
168
154
|
display: 'flex',
|
|
169
155
|
boxSizing: 'content-box',
|
|
170
156
|
flexDirection: 'row',
|
|
171
157
|
alignItems: 'center',
|
|
172
|
-
}
|
|
158
|
+
}, children: [!hideDateFilter ? ((0, jsx_runtime_1.jsxs)("div", { style: { width: 420, marginBottom: 25, marginLeft: 25 }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
173
159
|
marginBottom: 6,
|
|
174
160
|
fontWeight: '600',
|
|
175
161
|
color: theme.secondaryTextColor,
|
|
176
162
|
fontFamily: theme.fontFamily,
|
|
177
163
|
fontSize: 14,
|
|
178
|
-
}
|
|
164
|
+
}, children: "Date" }), (0, jsx_runtime_1.jsx)(index_1.DateRangePicker
|
|
179
165
|
// change to be set on the dashboard / section as default date range
|
|
180
166
|
, {
|
|
181
167
|
// change to be set on the dashboard / section as default date range
|
|
182
|
-
defaultValue: [undefined, undefined, '90d'], onValueChange: onChangeDateFilter, theme: theme })] }))
|
|
168
|
+
defaultValue: [undefined, undefined, '90d'], onValueChange: onChangeDateFilter, theme: theme })] })) : null, (0, jsx_runtime_1.jsx)("div", { style: { width: 280, marginBottom: 25, marginLeft: 25 }, children: configFilters.map((elem, index) => ((0, jsx_runtime_1.jsx)(Filter, { onValueChange: value => onChangeFilter(value, elem), defaultValue: [
|
|
183
169
|
undefined,
|
|
184
170
|
undefined,
|
|
185
171
|
elem.options[removeQuotes(elem.field)],
|
|
186
|
-
], theme: theme, filter: elem }, 'filter' + configFilters.field + index))
|
|
172
|
+
], theme: theme, filter: elem }, 'filter' + configFilters.field + index))) })] }), Object.keys(dashboardSections)
|
|
187
173
|
.sort(function (a, b) {
|
|
188
174
|
return a.length - b.length;
|
|
189
175
|
})
|
|
190
|
-
.map(
|
|
191
|
-
return (
|
|
176
|
+
.map((section, sectionIndex) => {
|
|
177
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
192
178
|
width: '100%',
|
|
193
179
|
display: 'flex',
|
|
194
180
|
flexDirection: 'column',
|
|
195
|
-
}
|
|
181
|
+
}, 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: {
|
|
196
182
|
fontSize: 22,
|
|
197
183
|
color: theme.primaryTextColor,
|
|
198
184
|
fontFamily: theme.fontFamily,
|
|
@@ -202,20 +188,20 @@ export default function Dashboard(_a) {
|
|
|
202
188
|
marginLeft: 25,
|
|
203
189
|
textAlign: 'left',
|
|
204
190
|
marginTop: 12,
|
|
205
|
-
}
|
|
191
|
+
}, children: section }))] }), dashboardSections[section].filter(elem => elem.chartType === 'metric').length ? ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
206
192
|
boxSizing: 'content-box',
|
|
207
|
-
width:
|
|
193
|
+
width: `100%`,
|
|
208
194
|
listStyleType: 'none',
|
|
209
195
|
marginBottom: 50,
|
|
210
196
|
display: 'grid',
|
|
211
197
|
gridGap: 25,
|
|
212
|
-
gridTemplateColumns:
|
|
213
|
-
gridTemplateRows:
|
|
214
|
-
}
|
|
215
|
-
.filter(
|
|
216
|
-
.map(
|
|
217
|
-
return (
|
|
218
|
-
?
|
|
198
|
+
gridTemplateColumns: `repeat(auto-fill,minmax(${maxColumnWidth || 400}px, 1fr))`,
|
|
199
|
+
gridTemplateRows: `repeat(${170}px)`,
|
|
200
|
+
}, children: dashboardSections[section]
|
|
201
|
+
.filter(elem => elem.chartType === 'metric')
|
|
202
|
+
.map((elem, index) => {
|
|
203
|
+
return ((0, jsx_runtime_1.jsx)("div", { onClick: onClickDashboardItem
|
|
204
|
+
? () => handleOnClickDashboardItem(elem._id)
|
|
219
205
|
: undefined, style: {
|
|
220
206
|
// background: theme.elevatedCardColor,
|
|
221
207
|
// borderRadius: theme.borderRadius,
|
|
@@ -226,22 +212,22 @@ export default function Dashboard(_a) {
|
|
|
226
212
|
height: '100%',
|
|
227
213
|
cursor: 'pointer',
|
|
228
214
|
width: '100%',
|
|
229
|
-
}
|
|
215
|
+
}, children: (0, jsx_runtime_1.jsx)("div", {
|
|
230
216
|
// className="group-hover:bg-black"
|
|
231
217
|
style: {
|
|
232
218
|
width: '100%',
|
|
233
219
|
boxSizing: 'content-box',
|
|
234
220
|
height: '100%',
|
|
235
|
-
}
|
|
221
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
236
222
|
width: '100%',
|
|
237
223
|
boxSizing: 'content-box',
|
|
238
224
|
height: '100%',
|
|
239
|
-
}
|
|
225
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
240
226
|
display: 'flex',
|
|
241
227
|
flexDirection: 'column',
|
|
242
228
|
justifyContent: 'space-between',
|
|
243
229
|
boxSizing: 'content-box',
|
|
244
|
-
}
|
|
230
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
245
231
|
// className="group-hover:bg-black"
|
|
246
232
|
style: {
|
|
247
233
|
display: 'flex',
|
|
@@ -252,7 +238,7 @@ export default function Dashboard(_a) {
|
|
|
252
238
|
// paddingLeft: theme.padding,
|
|
253
239
|
paddingRight: 25,
|
|
254
240
|
// paddingTop: theme.padding,
|
|
255
|
-
}
|
|
241
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { title: elem.name, style: {
|
|
256
242
|
fontFamily: theme.fontFamily,
|
|
257
243
|
color: theme.primaryTextColor,
|
|
258
244
|
boxSizing: 'content-box',
|
|
@@ -271,7 +257,7 @@ export default function Dashboard(_a) {
|
|
|
271
257
|
display: 'block',
|
|
272
258
|
maxWidth: '100%',
|
|
273
259
|
overflow: 'hidden',
|
|
274
|
-
}
|
|
260
|
+
}, children: elem.name }), onClickDashboardItem ? ((0, jsx_runtime_1.jsx)("div", {
|
|
275
261
|
// className="hover:bg-black"
|
|
276
262
|
style: {
|
|
277
263
|
fontFamily: theme.fontFamily,
|
|
@@ -284,27 +270,26 @@ export default function Dashboard(_a) {
|
|
|
284
270
|
display: 'flex',
|
|
285
271
|
alignItems: 'center',
|
|
286
272
|
justifyContent: 'flex-end',
|
|
287
|
-
}
|
|
273
|
+
}, children: 'view report →' })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: { padding: 0 }, children: (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: {
|
|
288
274
|
display: 'flex',
|
|
289
275
|
// width: '100%',
|
|
290
276
|
height: 30,
|
|
291
277
|
// marginBottom: 50,
|
|
292
278
|
marginTop: 20,
|
|
293
|
-
},
|
|
294
|
-
}) }))
|
|
279
|
+
}, dateFilter: true, chartId: elem._id, query: elem.queryString }) })] }) }) }) }, elem.name + '' + index));
|
|
280
|
+
}) })) : null, (0, jsx_runtime_1.jsx)("div", { style: {
|
|
295
281
|
// width: `100%`,
|
|
296
282
|
listStyleType: 'none',
|
|
297
283
|
display: 'grid',
|
|
298
284
|
gridGap: 25,
|
|
299
285
|
boxSizing: 'content-box',
|
|
300
|
-
gridTemplateColumns:
|
|
301
|
-
gridTemplateRows:
|
|
302
|
-
}
|
|
303
|
-
.filter(
|
|
304
|
-
.map(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
? function () { return handleOnClickDashboardItem(elem._id); }
|
|
286
|
+
gridTemplateColumns: `repeat(auto-fill,minmax(${maxColumnWidth || 400}px, 1fr))`,
|
|
287
|
+
gridTemplateRows: `repeat(auto-fill, ${rowHeight || 400}px)`,
|
|
288
|
+
}, children: dashboardSections[section]
|
|
289
|
+
.filter(elem => elem.chartType !== 'metric')
|
|
290
|
+
.map((elem, index) => {
|
|
291
|
+
return ((0, jsx_runtime_1.jsx)("div", { onClick: onClickDashboardItem
|
|
292
|
+
? () => handleOnClickDashboardItem(elem._id)
|
|
308
293
|
: undefined,
|
|
309
294
|
// onClick={() => handleEditDashboardItem(elem)}
|
|
310
295
|
// className="qq-shadow"
|
|
@@ -320,21 +305,21 @@ export default function Dashboard(_a) {
|
|
|
320
305
|
minHeight: rowHeight || 400,
|
|
321
306
|
borderRadius: 8,
|
|
322
307
|
paddingTop: 20,
|
|
323
|
-
}
|
|
308
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
324
309
|
width: '100%',
|
|
325
310
|
height: '100%',
|
|
326
311
|
boxSizing: 'content-box',
|
|
327
|
-
}
|
|
312
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
328
313
|
width: '100%',
|
|
329
314
|
height: '100%',
|
|
330
315
|
boxSizing: 'content-box',
|
|
331
|
-
}
|
|
316
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
332
317
|
display: 'flex',
|
|
333
318
|
flexDirection: 'column',
|
|
334
319
|
justifyContent: 'space-between',
|
|
335
320
|
height: '100%',
|
|
336
321
|
boxSizing: 'content-box',
|
|
337
|
-
}
|
|
322
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
338
323
|
display: 'flex',
|
|
339
324
|
flexDirection: 'row',
|
|
340
325
|
justifyContent: 'space-between',
|
|
@@ -343,7 +328,7 @@ export default function Dashboard(_a) {
|
|
|
343
328
|
// paddingLeft: theme.padding,
|
|
344
329
|
// paddingRight: theme.padding,
|
|
345
330
|
// paddingTop: theme.padding,
|
|
346
|
-
}
|
|
331
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
347
332
|
fontFamily: theme.fontFamily,
|
|
348
333
|
color: theme.primaryTextColor,
|
|
349
334
|
boxSizing: 'content-box',
|
|
@@ -360,7 +345,7 @@ export default function Dashboard(_a) {
|
|
|
360
345
|
display: 'block',
|
|
361
346
|
maxWidth: '100%',
|
|
362
347
|
overflow: 'hidden',
|
|
363
|
-
}
|
|
348
|
+
}, children: elem.name }), onClickDashboardItem ? ((0, jsx_runtime_1.jsx)("div", {
|
|
364
349
|
// className="hover:bg-black"
|
|
365
350
|
style: {
|
|
366
351
|
fontFamily: theme.fontFamily,
|
|
@@ -373,27 +358,27 @@ export default function Dashboard(_a) {
|
|
|
373
358
|
display: 'flex',
|
|
374
359
|
alignItems: 'center',
|
|
375
360
|
justifyContent: 'flex-end',
|
|
376
|
-
}
|
|
361
|
+
}, children: 'view report →' })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
377
362
|
padding: 0,
|
|
378
363
|
height: '100%',
|
|
379
364
|
boxSizing: 'content-box',
|
|
380
|
-
}
|
|
365
|
+
}, children: (0, jsx_runtime_1.jsx)(Chart_1.default, { containerStyle: {
|
|
381
366
|
display: 'flex',
|
|
382
367
|
width: '100%',
|
|
383
368
|
// TODO: fix fixed height
|
|
384
369
|
height: 300,
|
|
385
370
|
marginBottom: 50,
|
|
386
371
|
marginTop: 30,
|
|
387
|
-
}, isDateFilter: true, chartId: elem._id, colors:
|
|
372
|
+
}, isDateFilter: true, chartId: elem._id, colors: theme.chartColors?.length
|
|
388
373
|
? theme.chartColors
|
|
389
|
-
: undefined }) })
|
|
390
|
-
}) })
|
|
391
|
-
})] }))
|
|
374
|
+
: undefined }) })] }) }) }) }, elem.name + '' + index));
|
|
375
|
+
}) })] }, section + '' + sectionIndex));
|
|
376
|
+
})] }));
|
|
392
377
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
378
|
+
exports.default = Dashboard;
|
|
379
|
+
function Filter({ defaultValue, theme, onValueChange, filter }) {
|
|
380
|
+
//should be date as well as strings
|
|
381
|
+
const dropdownOptions = [
|
|
397
382
|
{ value: 'popupbagelsmardens', text: 'popupbagelsmardens' },
|
|
398
383
|
{ value: 'popupbagelswestport', text: 'popupbagelswestport' },
|
|
399
384
|
{ value: 'popupbagelseasthampton', text: 'popupbagelseasthampton' },
|
|
@@ -401,23 +386,23 @@ function Filter(_a) {
|
|
|
401
386
|
{ value: 'popupbagelsredding', text: 'popupbagelsredding' },
|
|
402
387
|
{ value: 'popupbagelsthompson', text: 'popupbagelsthompson' },
|
|
403
388
|
];
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
389
|
+
const dropdownRef = (0, react_1.useRef)(null);
|
|
390
|
+
const [showDropdown, setShowDropdown] = (0, react_1.useState)(false);
|
|
391
|
+
const [selectedValue, setSelectedValue] = (0, hooks_1.useInternalState)(defaultValue, undefined);
|
|
392
|
+
const selectedDropdownValue = selectedValue ? selectedValue[2] ?? null : null;
|
|
393
|
+
const handleDropdownOptionClick = (dropdownValue) => {
|
|
409
394
|
setSelectedValue([undefined, undefined, dropdownValue]);
|
|
410
|
-
onValueChange
|
|
395
|
+
onValueChange?.([undefined, undefined, dropdownValue]);
|
|
411
396
|
setShowDropdown(false);
|
|
412
397
|
};
|
|
413
|
-
|
|
414
|
-
return (
|
|
398
|
+
const [hoveredDropdownValue, handleDropdownKeyDown] = (0, hooks_1.useSelectOnKeyDown)(handleDropdownOptionClick, dropdownOptions.map((option) => option.value), showDropdown, setShowDropdown, selectedDropdownValue);
|
|
399
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%' }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
415
400
|
marginBottom: 6,
|
|
416
401
|
fontWeight: '600',
|
|
417
402
|
color: theme.secondaryTextColor,
|
|
418
403
|
fontSize: 14,
|
|
419
404
|
fontFamily: theme.fontFamily,
|
|
420
|
-
}
|
|
405
|
+
}, 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 })] }));
|
|
421
406
|
}
|
|
422
407
|
function removeQuotes(str) {
|
|
423
408
|
if (str.startsWith('"') && str.endsWith('"')) {
|
|
@@ -427,22 +412,21 @@ function removeQuotes(str) {
|
|
|
427
412
|
return str;
|
|
428
413
|
}
|
|
429
414
|
}
|
|
430
|
-
function FilterDropdown(
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
? String(dropdownOptions.find(function (option) { return option[removeQuotes(field)] === selectedDropdownValue; })[removeQuotes(label)])
|
|
415
|
+
function FilterDropdown({ setShowDropdown, dropdownRef, showDropdown, handleDropdownKeyDown, theme, dropdownPlaceholder = 'Select', selectedDropdownValue, dropdownOptions, field, label, }) {
|
|
416
|
+
const dropdownText = selectedDropdownValue
|
|
417
|
+
? String(dropdownOptions.find(option => option[removeQuotes(field)] === selectedDropdownValue)[removeQuotes(label)])
|
|
434
418
|
: dropdownPlaceholder;
|
|
435
|
-
return (
|
|
419
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
436
420
|
display: 'flex',
|
|
437
421
|
alignItems: 'center',
|
|
438
422
|
justifyContent: 'space-between',
|
|
439
423
|
borderRadius: '0.375rem',
|
|
440
|
-
background: theme
|
|
441
|
-
fontFamily: theme
|
|
424
|
+
background: theme?.backgroundColor,
|
|
425
|
+
fontFamily: theme?.fontFamily,
|
|
442
426
|
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
443
|
-
}
|
|
427
|
+
}, children: (0, jsx_runtime_1.jsxs)("button", { type: "button", style: {
|
|
444
428
|
// fontFamily: theme?.fontFamily,
|
|
445
|
-
borderColor:
|
|
429
|
+
borderColor: theme?.borderColor || '#E5E7EB',
|
|
446
430
|
borderStyle: 'solid',
|
|
447
431
|
borderWidth: 1,
|
|
448
432
|
cursor: 'pointer',
|
|
@@ -459,31 +443,30 @@ function FilterDropdown(_a) {
|
|
|
459
443
|
minHeight: 38,
|
|
460
444
|
justifyContent: 'space-between',
|
|
461
445
|
alignItems: 'center',
|
|
462
|
-
background: theme
|
|
463
|
-
fontSize:
|
|
446
|
+
background: theme?.backgroundColor,
|
|
447
|
+
fontSize: theme?.fontSizeSmall || '0.875rem',
|
|
464
448
|
// fontWeight: theme?.fontWeightMedium || '800',
|
|
465
|
-
}, ref: dropdownRef, onClick:
|
|
449
|
+
}, ref: dropdownRef, onClick: () => setShowDropdown(!showDropdown), onKeyDown: handleDropdownKeyDown, children: [(0, jsx_runtime_1.jsx)("p", { style: {
|
|
466
450
|
margin: 0,
|
|
467
|
-
fontFamily: theme
|
|
468
|
-
color:
|
|
451
|
+
fontFamily: theme?.fontFamily,
|
|
452
|
+
color: theme?.primaryTextColor || '#364153',
|
|
469
453
|
overflow: 'hidden',
|
|
470
454
|
textOverflow: 'ellipsis',
|
|
471
455
|
whiteSpace: 'nowrap',
|
|
472
|
-
fontWeight:
|
|
473
|
-
fontSize:
|
|
474
|
-
}
|
|
456
|
+
fontWeight: theme?.fontWeightMedium || '500',
|
|
457
|
+
fontSize: theme?.fontSizeSmall || '0.875rem',
|
|
458
|
+
}, children: dropdownText }), (0, jsx_runtime_1.jsx)(assets_1.ArrowDownHeadIcon, { style: {
|
|
475
459
|
height: '1.25rem',
|
|
476
460
|
width: '1.25rem',
|
|
477
461
|
flex: 'none',
|
|
478
|
-
color: theme
|
|
462
|
+
color: theme?.secondaryTextColor,
|
|
479
463
|
marginRight: '-0.25rem',
|
|
480
|
-
}, "aria-hidden": "true" })] })
|
|
464
|
+
}, "aria-hidden": "true" })] }) }));
|
|
481
465
|
}
|
|
482
|
-
function FilterModal(
|
|
483
|
-
|
|
484
|
-
return (_jsx(Modal, __assign({ showModal: showDropdown, setShowModal: setShowDropdown, parentRef: dropdownRef, theme: theme }, { children: _jsx(SelectedValueContext.Provider, __assign({ value: {
|
|
466
|
+
function FilterModal({ setShowDropdown, dropdownRef, showDropdown, theme, selectedDropdownValue, hoveredDropdownValue, dropdownOptions, handleDropdownOptionClick, field, label, }) {
|
|
467
|
+
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: {
|
|
485
468
|
selectedValue: selectedDropdownValue,
|
|
486
469
|
handleValueChange: handleDropdownOptionClick,
|
|
487
|
-
}
|
|
470
|
+
}, 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)]))) }) }) }));
|
|
488
471
|
}
|
|
489
472
|
//# sourceMappingURL=Dashboard.js.map
|