@ammarkhalidfarooq/dashboard-package 0.6.64 → 0.6.65
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/dist/index.cjs.js +803 -545
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +803 -545
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1329,287 +1329,6 @@ var MetricCard$1 = function MetricCard(_ref) {
|
|
|
1329
1329
|
});
|
|
1330
1330
|
};
|
|
1331
1331
|
|
|
1332
|
-
var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
1333
|
-
var sx = _ref.sx,
|
|
1334
|
-
donationTypeData = _ref.donationTypeData,
|
|
1335
|
-
_ref$exportMode = _ref.exportMode,
|
|
1336
|
-
exportMode = _ref$exportMode === void 0 ? false : _ref$exportMode,
|
|
1337
|
-
_ref$subtitle = _ref.subtitle,
|
|
1338
|
-
subtitle = _ref$subtitle === void 0 ? "Donation type" : _ref$subtitle,
|
|
1339
|
-
chartHeight = _ref.chartHeight;
|
|
1340
|
-
var recurringColor = "rgb(99, 99, 230)";
|
|
1341
|
-
var oneTimeColor = "#10B981";
|
|
1342
|
-
var colors = [recurringColor, oneTimeColor, "#06B6D4", "#F59E0B", "#EF4444"];
|
|
1343
|
-
var categories = [];
|
|
1344
|
-
var series = [];
|
|
1345
|
-
var summaries = [];
|
|
1346
|
-
var title = "Donation Type";
|
|
1347
|
-
var isDistributed = false;
|
|
1348
|
-
if (donationTypeData && donationTypeData.data && Array.isArray(donationTypeData.data)) {
|
|
1349
|
-
// Time series recurring vs one-time format
|
|
1350
|
-
categories = donationTypeData.data.map(function (item) {
|
|
1351
|
-
return item.label || "";
|
|
1352
|
-
});
|
|
1353
|
-
series = [{
|
|
1354
|
-
name: "Recurring",
|
|
1355
|
-
data: donationTypeData.data.map(function (item) {
|
|
1356
|
-
return item.recurring || 0;
|
|
1357
|
-
})
|
|
1358
|
-
}, {
|
|
1359
|
-
name: "One-time",
|
|
1360
|
-
data: donationTypeData.data.map(function (item) {
|
|
1361
|
-
return item.oneTime || 0;
|
|
1362
|
-
})
|
|
1363
|
-
}];
|
|
1364
|
-
summaries = [{
|
|
1365
|
-
label: "Recurring",
|
|
1366
|
-
total: donationTypeData.totalRecurringDonations || 0,
|
|
1367
|
-
color: recurringColor
|
|
1368
|
-
}, {
|
|
1369
|
-
label: "One-time",
|
|
1370
|
-
total: donationTypeData.totalOneTimeDonations || 0,
|
|
1371
|
-
color: oneTimeColor
|
|
1372
|
-
}];
|
|
1373
|
-
title = "Recurring vs One-time";
|
|
1374
|
-
isDistributed = false;
|
|
1375
|
-
} else if (Array.isArray(donationTypeData) && donationTypeData.length > 0 && donationTypeData[0].totalAmount !== undefined) {
|
|
1376
|
-
// New array format
|
|
1377
|
-
categories = donationTypeData.map(function (item) {
|
|
1378
|
-
return item.type || "";
|
|
1379
|
-
});
|
|
1380
|
-
series = [{
|
|
1381
|
-
name: "Amount",
|
|
1382
|
-
data: donationTypeData.map(function (item) {
|
|
1383
|
-
return item.totalAmount || 0;
|
|
1384
|
-
})
|
|
1385
|
-
}];
|
|
1386
|
-
summaries = donationTypeData.map(function (item, index) {
|
|
1387
|
-
return {
|
|
1388
|
-
label: item.type || "",
|
|
1389
|
-
total: item.totalAmount || 0,
|
|
1390
|
-
color: colors[index % colors.length]
|
|
1391
|
-
};
|
|
1392
|
-
});
|
|
1393
|
-
isDistributed = true;
|
|
1394
|
-
if (donationTypeData.length === 2) {
|
|
1395
|
-
title = "".concat(donationTypeData[0].type, " vs ").concat(donationTypeData[1].type);
|
|
1396
|
-
}
|
|
1397
|
-
} else {
|
|
1398
|
-
var _dataObj$summary, _dataObj$summary2, _dataObj$summary3, _dataObj$summary4;
|
|
1399
|
-
// Object format, empty array, or missing data
|
|
1400
|
-
var dataObj = donationTypeData && _typeof(donationTypeData) === "object" && !Array.isArray(donationTypeData) ? donationTypeData : {};
|
|
1401
|
-
categories = dataObj.categories || [];
|
|
1402
|
-
var rawSeries = dataObj.series || [];
|
|
1403
|
-
if (rawSeries.length && categories.length) {
|
|
1404
|
-
series = rawSeries;
|
|
1405
|
-
} else {
|
|
1406
|
-
series = [{
|
|
1407
|
-
name: "Recurring",
|
|
1408
|
-
data: []
|
|
1409
|
-
}, {
|
|
1410
|
-
name: "One-time",
|
|
1411
|
-
data: []
|
|
1412
|
-
}];
|
|
1413
|
-
}
|
|
1414
|
-
summaries = [{
|
|
1415
|
-
label: (dataObj === null || dataObj === void 0 || (_dataObj$summary = dataObj.summary) === null || _dataObj$summary === void 0 || (_dataObj$summary = _dataObj$summary.recurring) === null || _dataObj$summary === void 0 ? void 0 : _dataObj$summary.label) || "Recurring",
|
|
1416
|
-
total: (dataObj === null || dataObj === void 0 || (_dataObj$summary2 = dataObj.summary) === null || _dataObj$summary2 === void 0 || (_dataObj$summary2 = _dataObj$summary2.recurring) === null || _dataObj$summary2 === void 0 ? void 0 : _dataObj$summary2.total) || 0,
|
|
1417
|
-
color: recurringColor
|
|
1418
|
-
}, {
|
|
1419
|
-
label: (dataObj === null || dataObj === void 0 || (_dataObj$summary3 = dataObj.summary) === null || _dataObj$summary3 === void 0 || (_dataObj$summary3 = _dataObj$summary3.oneTime) === null || _dataObj$summary3 === void 0 ? void 0 : _dataObj$summary3.label) || "One-time",
|
|
1420
|
-
total: (dataObj === null || dataObj === void 0 || (_dataObj$summary4 = dataObj.summary) === null || _dataObj$summary4 === void 0 || (_dataObj$summary4 = _dataObj$summary4.oneTime) === null || _dataObj$summary4 === void 0 ? void 0 : _dataObj$summary4.total) || 0,
|
|
1421
|
-
color: oneTimeColor
|
|
1422
|
-
}];
|
|
1423
|
-
title = "Recurring vs one-time";
|
|
1424
|
-
isDistributed = false;
|
|
1425
|
-
}
|
|
1426
|
-
var resolvedChartHeight = chartHeight !== null && chartHeight !== void 0 ? chartHeight : exportMode ? 110 : 170;
|
|
1427
|
-
var chartOptions = {
|
|
1428
|
-
chart: {
|
|
1429
|
-
type: "bar",
|
|
1430
|
-
toolbar: {
|
|
1431
|
-
show: false
|
|
1432
|
-
},
|
|
1433
|
-
zoom: {
|
|
1434
|
-
enabled: false
|
|
1435
|
-
},
|
|
1436
|
-
fontFamily: "Inter, sans-serif"
|
|
1437
|
-
},
|
|
1438
|
-
plotOptions: {
|
|
1439
|
-
bar: {
|
|
1440
|
-
horizontal: false,
|
|
1441
|
-
columnWidth: exportMode ? "68%" : "75%",
|
|
1442
|
-
borderRadius: exportMode ? 3 : 4,
|
|
1443
|
-
distributed: isDistributed,
|
|
1444
|
-
dataLabels: {
|
|
1445
|
-
position: "top"
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
},
|
|
1449
|
-
dataLabels: {
|
|
1450
|
-
enabled: true,
|
|
1451
|
-
formatter: function formatter(val) {
|
|
1452
|
-
return "$".concat(formatNumber(val));
|
|
1453
|
-
},
|
|
1454
|
-
offsetY: exportMode ? -16 : -20,
|
|
1455
|
-
style: {
|
|
1456
|
-
fontSize: exportMode ? "7px" : "9px",
|
|
1457
|
-
fontWeight: 600,
|
|
1458
|
-
colors: ["#000"]
|
|
1459
|
-
}
|
|
1460
|
-
},
|
|
1461
|
-
stroke: {
|
|
1462
|
-
show: true,
|
|
1463
|
-
width: 2,
|
|
1464
|
-
colors: ["transparent"]
|
|
1465
|
-
},
|
|
1466
|
-
xaxis: {
|
|
1467
|
-
categories: categories,
|
|
1468
|
-
axisBorder: {
|
|
1469
|
-
show: false
|
|
1470
|
-
},
|
|
1471
|
-
axisTicks: {
|
|
1472
|
-
show: false
|
|
1473
|
-
},
|
|
1474
|
-
labels: {
|
|
1475
|
-
style: {
|
|
1476
|
-
colors: "rgba(0, 0, 0, 0.4)",
|
|
1477
|
-
fontSize: exportMode ? "8px" : "11px"
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
},
|
|
1481
|
-
yaxis: {
|
|
1482
|
-
min: 0,
|
|
1483
|
-
tickAmount: exportMode ? 3 : 4,
|
|
1484
|
-
labels: {
|
|
1485
|
-
formatter: function formatter(val) {
|
|
1486
|
-
return "$".concat(formatNumber(val));
|
|
1487
|
-
},
|
|
1488
|
-
style: {
|
|
1489
|
-
colors: "rgba(0, 0, 0, 0.4)",
|
|
1490
|
-
fontSize: exportMode ? "8px" : "10px"
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
},
|
|
1494
|
-
fill: {
|
|
1495
|
-
opacity: 1
|
|
1496
|
-
},
|
|
1497
|
-
colors: colors,
|
|
1498
|
-
grid: {
|
|
1499
|
-
borderColor: "#f1f1f1",
|
|
1500
|
-
strokeDashArray: 4,
|
|
1501
|
-
padding: {
|
|
1502
|
-
left: 0,
|
|
1503
|
-
right: 0
|
|
1504
|
-
},
|
|
1505
|
-
yaxis: {
|
|
1506
|
-
lines: {
|
|
1507
|
-
show: true
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
},
|
|
1511
|
-
legend: {
|
|
1512
|
-
show: false
|
|
1513
|
-
},
|
|
1514
|
-
tooltip: {
|
|
1515
|
-
y: {
|
|
1516
|
-
formatter: function formatter(val) {
|
|
1517
|
-
return "$".concat(formatNumber(val));
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
};
|
|
1522
|
-
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
1523
|
-
sx: _objectSpread2({
|
|
1524
|
-
bgcolor: "#fff",
|
|
1525
|
-
borderRadius: exportMode ? 2 : 4,
|
|
1526
|
-
border: exportMode ? "1px solid #DDE3EA" : "1px solid #f0f0f0",
|
|
1527
|
-
boxShadow: exportMode ? "0 1px 0 rgba(15,23,42,0.03)" : "0 4px 24px rgba(0,0,0,0.06)",
|
|
1528
|
-
p: exportMode ? 1.5 : 3,
|
|
1529
|
-
height: exportMode ? "100%" : "auto",
|
|
1530
|
-
boxSizing: "border-box"
|
|
1531
|
-
}, sx),
|
|
1532
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
1533
|
-
sx: {
|
|
1534
|
-
display: "flex",
|
|
1535
|
-
flexDirection: "column"
|
|
1536
|
-
},
|
|
1537
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
1538
|
-
sx: {
|
|
1539
|
-
textAlign: "left"
|
|
1540
|
-
},
|
|
1541
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
1542
|
-
sx: {
|
|
1543
|
-
fontWeight: 700,
|
|
1544
|
-
fontSize: exportMode ? "12px" : "18px",
|
|
1545
|
-
color: "#000",
|
|
1546
|
-
lineHeight: 1.15
|
|
1547
|
-
},
|
|
1548
|
-
children: title
|
|
1549
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
1550
|
-
sx: {
|
|
1551
|
-
fontSize: exportMode ? "9.5px" : "13px",
|
|
1552
|
-
color: exportMode ? "#94A3B8" : "rgba(0, 0, 0, 0.4)",
|
|
1553
|
-
lineHeight: 1.15
|
|
1554
|
-
},
|
|
1555
|
-
children: subtitle
|
|
1556
|
-
})]
|
|
1557
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1558
|
-
sx: {
|
|
1559
|
-
display: "flex",
|
|
1560
|
-
gap: exportMode ? 1 : 1.5,
|
|
1561
|
-
mt: exportMode ? 0.75 : 0.5,
|
|
1562
|
-
flexWrap: "wrap"
|
|
1563
|
-
},
|
|
1564
|
-
children: summaries.map(function (item, index) {
|
|
1565
|
-
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
1566
|
-
sx: {
|
|
1567
|
-
display: "flex",
|
|
1568
|
-
alignItems: "center",
|
|
1569
|
-
gap: 0.5
|
|
1570
|
-
},
|
|
1571
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1572
|
-
sx: {
|
|
1573
|
-
width: exportMode ? 6 : 8,
|
|
1574
|
-
height: exportMode ? 6 : 8,
|
|
1575
|
-
bgcolor: item.color,
|
|
1576
|
-
borderRadius: "50%"
|
|
1577
|
-
}
|
|
1578
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
1579
|
-
sx: {
|
|
1580
|
-
fontSize: exportMode ? "9.5px" : "13px",
|
|
1581
|
-
color: exportMode ? "#374151" : "rgba(0, 0, 0, 0.5)",
|
|
1582
|
-
fontWeight: 500
|
|
1583
|
-
},
|
|
1584
|
-
children: item.label
|
|
1585
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
|
|
1586
|
-
sx: {
|
|
1587
|
-
fontSize: exportMode ? "9.5px" : "13px",
|
|
1588
|
-
fontWeight: exportMode ? 700 : 600,
|
|
1589
|
-
color: "#000"
|
|
1590
|
-
},
|
|
1591
|
-
children: ["$", formatNumber(item.total || 0)]
|
|
1592
|
-
})]
|
|
1593
|
-
}, item.label || index);
|
|
1594
|
-
})
|
|
1595
|
-
})]
|
|
1596
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1597
|
-
sx: {
|
|
1598
|
-
height: resolvedChartHeight,
|
|
1599
|
-
width: exportMode ? "calc(100% + 24px)" : "calc(100% + 48px)",
|
|
1600
|
-
ml: exportMode ? -1.5 : -3,
|
|
1601
|
-
mr: exportMode ? -1.5 : -3
|
|
1602
|
-
},
|
|
1603
|
-
children: /*#__PURE__*/jsxRuntime.jsx(ReactApexChart, {
|
|
1604
|
-
options: chartOptions,
|
|
1605
|
-
series: series,
|
|
1606
|
-
type: "bar",
|
|
1607
|
-
height: "100%"
|
|
1608
|
-
})
|
|
1609
|
-
})]
|
|
1610
|
-
});
|
|
1611
|
-
};
|
|
1612
|
-
|
|
1613
1332
|
var PURPLE = "#6363E6";
|
|
1614
1333
|
var REPORT_COLORS = {
|
|
1615
1334
|
purple: PURPLE};
|
|
@@ -1680,6 +1399,57 @@ var parseDonationTypeTotals = function parseDonationTypeTotals(donationTypeData)
|
|
|
1680
1399
|
};
|
|
1681
1400
|
};
|
|
1682
1401
|
|
|
1402
|
+
/** Weekly chart points + totals for recurring vs one-time (PDF + report). */
|
|
1403
|
+
var parseDonationTypeChartData = function parseDonationTypeChartData(donationTypeData) {
|
|
1404
|
+
var empty = {
|
|
1405
|
+
categories: [],
|
|
1406
|
+
recurring: [],
|
|
1407
|
+
oneTime: [],
|
|
1408
|
+
recurringTotal: 0,
|
|
1409
|
+
oneTimeTotal: 0
|
|
1410
|
+
};
|
|
1411
|
+
if (donationTypeData !== null && donationTypeData !== void 0 && donationTypeData.data && Array.isArray(donationTypeData.data)) {
|
|
1412
|
+
var _donationTypeData$tot3, _donationTypeData$tot4;
|
|
1413
|
+
return {
|
|
1414
|
+
categories: donationTypeData.data.map(function (item) {
|
|
1415
|
+
return item.label || "";
|
|
1416
|
+
}),
|
|
1417
|
+
recurring: donationTypeData.data.map(function (item) {
|
|
1418
|
+
return Number(item.recurring || 0);
|
|
1419
|
+
}),
|
|
1420
|
+
oneTime: donationTypeData.data.map(function (item) {
|
|
1421
|
+
return Number(item.oneTime || 0);
|
|
1422
|
+
}),
|
|
1423
|
+
recurringTotal: Number((_donationTypeData$tot3 = donationTypeData.totalRecurringDonations) !== null && _donationTypeData$tot3 !== void 0 ? _donationTypeData$tot3 : 0),
|
|
1424
|
+
oneTimeTotal: Number((_donationTypeData$tot4 = donationTypeData.totalOneTimeDonations) !== null && _donationTypeData$tot4 !== void 0 ? _donationTypeData$tot4 : 0)
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
if (Array.isArray(donationTypeData) && donationTypeData.length > 0 && donationTypeData[0].totalAmount !== undefined) {
|
|
1428
|
+
var totals = parseDonationTypeTotals(donationTypeData);
|
|
1429
|
+
return _objectSpread2(_objectSpread2({}, empty), totals);
|
|
1430
|
+
}
|
|
1431
|
+
if (Array.isArray(donationTypeData) && donationTypeData.length > 0 && (donationTypeData[0].recurring !== undefined || donationTypeData[0].oneTime !== undefined || donationTypeData[0].recurringAmount !== undefined || donationTypeData[0].oneTimeAmount !== undefined)) {
|
|
1432
|
+
return {
|
|
1433
|
+
categories: donationTypeData.map(function (item) {
|
|
1434
|
+
return item.label || item.date || "";
|
|
1435
|
+
}),
|
|
1436
|
+
recurring: donationTypeData.map(function (item) {
|
|
1437
|
+
return Number(item.recurring || item.recurringAmount || 0);
|
|
1438
|
+
}),
|
|
1439
|
+
oneTime: donationTypeData.map(function (item) {
|
|
1440
|
+
return Number(item.oneTime || item.oneTimeAmount || 0);
|
|
1441
|
+
}),
|
|
1442
|
+
recurringTotal: donationTypeData.reduce(function (sum, item) {
|
|
1443
|
+
return sum + Number(item.recurring || item.recurringAmount || 0);
|
|
1444
|
+
}, 0),
|
|
1445
|
+
oneTimeTotal: donationTypeData.reduce(function (sum, item) {
|
|
1446
|
+
return sum + Number(item.oneTime || item.oneTimeAmount || 0);
|
|
1447
|
+
}, 0)
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1450
|
+
return _objectSpread2(_objectSpread2({}, empty), parseDonationTypeTotals(donationTypeData));
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1683
1453
|
/** Mirrors PaidDonorGeographyCard row mapping from donorGeography. */
|
|
1684
1454
|
var parseDonorGeographyList = function parseDonorGeographyList(donorGeographyData) {
|
|
1685
1455
|
var rawCountries = Array.isArray(donorGeographyData) ? donorGeographyData : (donorGeographyData === null || donorGeographyData === void 0 ? void 0 : donorGeographyData.countries) || (donorGeographyData === null || donorGeographyData === void 0 ? void 0 : donorGeographyData.data) || [];
|
|
@@ -1945,6 +1715,12 @@ var kpiPct = function kpiPct(v) {
|
|
|
1945
1715
|
var kpiRoas = function kpiRoas(v) {
|
|
1946
1716
|
return "".concat(formatNumber(Number(v !== null && v !== void 0 ? v : 0).toFixed(2)), "\xD7");
|
|
1947
1717
|
};
|
|
1718
|
+
var d$Compact = function d$Compact(v) {
|
|
1719
|
+
var n = Number(v !== null && v !== void 0 ? v : 0);
|
|
1720
|
+
if (n >= 1000000) return "$".concat((n / 1000000).toFixed(1), "M");
|
|
1721
|
+
if (n >= 1000) return "$".concat((n / 1000).toFixed(1), "K");
|
|
1722
|
+
return d$(n);
|
|
1723
|
+
};
|
|
1948
1724
|
var pct = function pct(v) {
|
|
1949
1725
|
var dp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
1950
1726
|
return "".concat(Number(v !== null && v !== void 0 ? v : 0).toFixed(dp), "%");
|
|
@@ -2326,15 +2102,216 @@ var ProgressBar = function ProgressBar(_ref8) {
|
|
|
2326
2102
|
})]
|
|
2327
2103
|
});
|
|
2328
2104
|
};
|
|
2329
|
-
var
|
|
2330
|
-
var
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
_ref9$
|
|
2335
|
-
|
|
2336
|
-
_ref9$
|
|
2337
|
-
|
|
2105
|
+
var DonationTypeBarSvg = function DonationTypeBarSvg(_ref9) {
|
|
2106
|
+
var _ref9$categories = _ref9.categories,
|
|
2107
|
+
categories = _ref9$categories === void 0 ? [] : _ref9$categories,
|
|
2108
|
+
_ref9$recurring = _ref9.recurring,
|
|
2109
|
+
recurring = _ref9$recurring === void 0 ? [] : _ref9$recurring,
|
|
2110
|
+
_ref9$oneTime = _ref9.oneTime,
|
|
2111
|
+
oneTime = _ref9$oneTime === void 0 ? [] : _ref9$oneTime,
|
|
2112
|
+
_ref9$recurringColor = _ref9.recurringColor,
|
|
2113
|
+
recurringColor = _ref9$recurringColor === void 0 ? "#6366F1" : _ref9$recurringColor,
|
|
2114
|
+
_ref9$oneTimeColor = _ref9.oneTimeColor,
|
|
2115
|
+
oneTimeColor = _ref9$oneTimeColor === void 0 ? "#10B981" : _ref9$oneTimeColor;
|
|
2116
|
+
var width = 158;
|
|
2117
|
+
var height = 96;
|
|
2118
|
+
var padL = 30;
|
|
2119
|
+
var padR = 2;
|
|
2120
|
+
var padT = 14;
|
|
2121
|
+
var padB = 18;
|
|
2122
|
+
var chartW = width - padL - padR;
|
|
2123
|
+
var chartH = height - padT - padB;
|
|
2124
|
+
var allVals = [].concat(_toConsumableArray(recurring), _toConsumableArray(oneTime));
|
|
2125
|
+
var maxVal = Math.max.apply(Math, _toConsumableArray(allVals).concat([0])) || 1;
|
|
2126
|
+
var n = categories.length;
|
|
2127
|
+
var yTicks = [0, maxVal / 2, maxVal];
|
|
2128
|
+
if (!n) {
|
|
2129
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
2130
|
+
width: "100%",
|
|
2131
|
+
height: height,
|
|
2132
|
+
viewBox: "0 0 ".concat(width, " ").concat(height),
|
|
2133
|
+
style: {
|
|
2134
|
+
display: "block"
|
|
2135
|
+
},
|
|
2136
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("line", {
|
|
2137
|
+
x1: padL,
|
|
2138
|
+
y1: padT + chartH,
|
|
2139
|
+
x2: width - padR,
|
|
2140
|
+
y2: padT + chartH,
|
|
2141
|
+
stroke: "#f1f1f1"
|
|
2142
|
+
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2143
|
+
x: padL - 4,
|
|
2144
|
+
y: padT + chartH + 3,
|
|
2145
|
+
textAnchor: "end",
|
|
2146
|
+
fontSize: 7,
|
|
2147
|
+
fill: "rgba(0,0,0,0.4)",
|
|
2148
|
+
children: "$0"
|
|
2149
|
+
})]
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
var groupW = chartW / n;
|
|
2153
|
+
var barW = Math.min(groupW * 0.3, 12);
|
|
2154
|
+
var baseY = padT + chartH;
|
|
2155
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
2156
|
+
width: "100%",
|
|
2157
|
+
height: height,
|
|
2158
|
+
viewBox: "0 0 ".concat(width, " ").concat(height),
|
|
2159
|
+
style: {
|
|
2160
|
+
display: "block"
|
|
2161
|
+
},
|
|
2162
|
+
children: [yTicks.map(function (tick, i) {
|
|
2163
|
+
var y = padT + chartH - tick / maxVal * chartH;
|
|
2164
|
+
return /*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
2165
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("line", {
|
|
2166
|
+
x1: padL,
|
|
2167
|
+
y1: y,
|
|
2168
|
+
x2: width - padR,
|
|
2169
|
+
y2: y,
|
|
2170
|
+
stroke: "#f1f1f1",
|
|
2171
|
+
strokeDasharray: "4"
|
|
2172
|
+
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2173
|
+
x: padL - 4,
|
|
2174
|
+
y: y + 3,
|
|
2175
|
+
textAnchor: "end",
|
|
2176
|
+
fontSize: 7,
|
|
2177
|
+
fill: "rgba(0,0,0,0.4)",
|
|
2178
|
+
children: d$Compact(tick)
|
|
2179
|
+
})]
|
|
2180
|
+
}, "y-".concat(i));
|
|
2181
|
+
}), categories.map(function (cat, i) {
|
|
2182
|
+
var groupX = padL + i * groupW + groupW / 2;
|
|
2183
|
+
var rVal = recurring[i] || 0;
|
|
2184
|
+
var oVal = oneTime[i] || 0;
|
|
2185
|
+
var rH = rVal / maxVal * chartH;
|
|
2186
|
+
var oH = oVal / maxVal * chartH;
|
|
2187
|
+
var rX = groupX - barW - 1;
|
|
2188
|
+
var oX = groupX + 1;
|
|
2189
|
+
return /*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
2190
|
+
children: [rVal > 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2191
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
2192
|
+
x: rX,
|
|
2193
|
+
y: baseY - rH,
|
|
2194
|
+
width: barW,
|
|
2195
|
+
height: Math.max(rH, 1),
|
|
2196
|
+
fill: recurringColor,
|
|
2197
|
+
rx: 2
|
|
2198
|
+
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2199
|
+
x: rX + barW / 2,
|
|
2200
|
+
y: baseY - rH - 3,
|
|
2201
|
+
textAnchor: "middle",
|
|
2202
|
+
fontSize: 6.5,
|
|
2203
|
+
fontWeight: 600,
|
|
2204
|
+
fill: "#111827",
|
|
2205
|
+
children: d$Compact(rVal)
|
|
2206
|
+
})]
|
|
2207
|
+
}), oVal > 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2208
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
2209
|
+
x: oX,
|
|
2210
|
+
y: baseY - oH,
|
|
2211
|
+
width: barW,
|
|
2212
|
+
height: Math.max(oH, 1),
|
|
2213
|
+
fill: oneTimeColor,
|
|
2214
|
+
rx: 2
|
|
2215
|
+
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2216
|
+
x: oX + barW / 2,
|
|
2217
|
+
y: baseY - oH - 3,
|
|
2218
|
+
textAnchor: "middle",
|
|
2219
|
+
fontSize: 6.5,
|
|
2220
|
+
fontWeight: 600,
|
|
2221
|
+
fill: "#111827",
|
|
2222
|
+
children: d$Compact(oVal)
|
|
2223
|
+
})]
|
|
2224
|
+
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2225
|
+
x: groupX,
|
|
2226
|
+
y: height - 4,
|
|
2227
|
+
textAnchor: "middle",
|
|
2228
|
+
fontSize: 7.5,
|
|
2229
|
+
fill: "rgba(0,0,0,0.4)",
|
|
2230
|
+
children: cat
|
|
2231
|
+
})]
|
|
2232
|
+
}, "bar-".concat(i));
|
|
2233
|
+
})]
|
|
2234
|
+
});
|
|
2235
|
+
};
|
|
2236
|
+
var DonationTypePanel = function DonationTypePanel(_ref0) {
|
|
2237
|
+
var donationTypeData = _ref0.donationTypeData,
|
|
2238
|
+
_ref0$recurringColor = _ref0.recurringColor,
|
|
2239
|
+
recurringColor = _ref0$recurringColor === void 0 ? "#6366F1" : _ref0$recurringColor,
|
|
2240
|
+
_ref0$oneTimeColor = _ref0.oneTimeColor,
|
|
2241
|
+
oneTimeColor = _ref0$oneTimeColor === void 0 ? "#10B981" : _ref0$oneTimeColor;
|
|
2242
|
+
var _parseDonationTypeCha = parseDonationTypeChartData(donationTypeData),
|
|
2243
|
+
categories = _parseDonationTypeCha.categories,
|
|
2244
|
+
recurring = _parseDonationTypeCha.recurring,
|
|
2245
|
+
oneTime = _parseDonationTypeCha.oneTime,
|
|
2246
|
+
recurringTotal = _parseDonationTypeCha.recurringTotal,
|
|
2247
|
+
oneTimeTotal = _parseDonationTypeCha.oneTimeTotal;
|
|
2248
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Panel, {
|
|
2249
|
+
title: "Recurring vs one-time",
|
|
2250
|
+
subtitle: "Donation type \xB7 weekly",
|
|
2251
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2252
|
+
style: {
|
|
2253
|
+
display: "flex",
|
|
2254
|
+
flexWrap: "wrap",
|
|
2255
|
+
gap: "6px 10px",
|
|
2256
|
+
marginBottom: 4
|
|
2257
|
+
},
|
|
2258
|
+
children: [{
|
|
2259
|
+
label: "Recurring",
|
|
2260
|
+
total: recurringTotal,
|
|
2261
|
+
color: recurringColor
|
|
2262
|
+
}, {
|
|
2263
|
+
label: "One-time",
|
|
2264
|
+
total: oneTimeTotal,
|
|
2265
|
+
color: oneTimeColor
|
|
2266
|
+
}].map(function (item) {
|
|
2267
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2268
|
+
style: {
|
|
2269
|
+
display: "flex",
|
|
2270
|
+
alignItems: "center",
|
|
2271
|
+
gap: 4
|
|
2272
|
+
},
|
|
2273
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2274
|
+
style: {
|
|
2275
|
+
width: 6,
|
|
2276
|
+
height: 6,
|
|
2277
|
+
borderRadius: "50%",
|
|
2278
|
+
background: item.color,
|
|
2279
|
+
flexShrink: 0
|
|
2280
|
+
}
|
|
2281
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2282
|
+
style: {
|
|
2283
|
+
fontSize: 9.5,
|
|
2284
|
+
color: "#374151"
|
|
2285
|
+
},
|
|
2286
|
+
children: item.label
|
|
2287
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2288
|
+
style: {
|
|
2289
|
+
fontSize: 9.5,
|
|
2290
|
+
fontWeight: 700,
|
|
2291
|
+
color: "#111827"
|
|
2292
|
+
},
|
|
2293
|
+
children: d$(item.total)
|
|
2294
|
+
})]
|
|
2295
|
+
}, item.label);
|
|
2296
|
+
})
|
|
2297
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DonationTypeBarSvg, {
|
|
2298
|
+
categories: categories,
|
|
2299
|
+
recurring: recurring,
|
|
2300
|
+
oneTime: oneTime,
|
|
2301
|
+
recurringColor: recurringColor,
|
|
2302
|
+
oneTimeColor: oneTimeColor
|
|
2303
|
+
})]
|
|
2304
|
+
});
|
|
2305
|
+
};
|
|
2306
|
+
var KpiCard = function KpiCard(_ref1) {
|
|
2307
|
+
var title = _ref1.title,
|
|
2308
|
+
value = _ref1.value,
|
|
2309
|
+
trend = _ref1.trend,
|
|
2310
|
+
detail = _ref1.detail,
|
|
2311
|
+
_ref1$variant = _ref1.variant,
|
|
2312
|
+
variant = _ref1$variant === void 0 ? "secondary" : _ref1$variant,
|
|
2313
|
+
_ref1$trendPositiveWh = _ref1.trendPositiveWhenNegative,
|
|
2314
|
+
trendPositiveWhenNegative = _ref1$trendPositiveWh === void 0 ? false : _ref1$trendPositiveWh;
|
|
2338
2315
|
var displayTrend = withTrendArrow(trend);
|
|
2339
2316
|
var isPrimary = variant === "primary";
|
|
2340
2317
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -2385,10 +2362,10 @@ var KpiCard = function KpiCard(_ref9) {
|
|
|
2385
2362
|
})]
|
|
2386
2363
|
});
|
|
2387
2364
|
};
|
|
2388
|
-
var StatPair = function StatPair(
|
|
2389
|
-
var label =
|
|
2390
|
-
val =
|
|
2391
|
-
trend =
|
|
2365
|
+
var StatPair = function StatPair(_ref10) {
|
|
2366
|
+
var label = _ref10.label,
|
|
2367
|
+
val = _ref10.val,
|
|
2368
|
+
trend = _ref10.trend;
|
|
2392
2369
|
var displayTrend = withTrendArrow(trend);
|
|
2393
2370
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2394
2371
|
style: {
|
|
@@ -2425,12 +2402,12 @@ var StatPair = function StatPair(_ref0) {
|
|
|
2425
2402
|
})]
|
|
2426
2403
|
});
|
|
2427
2404
|
};
|
|
2428
|
-
var PageHeader = function PageHeader(
|
|
2429
|
-
var dateLabel =
|
|
2430
|
-
generatedLabel =
|
|
2431
|
-
activeFilters =
|
|
2432
|
-
page =
|
|
2433
|
-
windowLabel =
|
|
2405
|
+
var PageHeader = function PageHeader(_ref11) {
|
|
2406
|
+
var dateLabel = _ref11.dateLabel,
|
|
2407
|
+
generatedLabel = _ref11.generatedLabel,
|
|
2408
|
+
activeFilters = _ref11.activeFilters,
|
|
2409
|
+
page = _ref11.page,
|
|
2410
|
+
windowLabel = _ref11.windowLabel;
|
|
2434
2411
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2435
2412
|
style: {
|
|
2436
2413
|
padding: "22px ".concat(MX, "px 12px"),
|
|
@@ -2536,9 +2513,9 @@ var PageHeader = function PageHeader(_ref1) {
|
|
|
2536
2513
|
})]
|
|
2537
2514
|
});
|
|
2538
2515
|
};
|
|
2539
|
-
var PageFooter = function PageFooter(
|
|
2540
|
-
var generatedLabel =
|
|
2541
|
-
page =
|
|
2516
|
+
var PageFooter = function PageFooter(_ref12) {
|
|
2517
|
+
var generatedLabel = _ref12.generatedLabel,
|
|
2518
|
+
page = _ref12.page;
|
|
2542
2519
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2543
2520
|
style: {
|
|
2544
2521
|
padding: "7px ".concat(MX, "px"),
|
|
@@ -2558,16 +2535,16 @@ var PageFooter = function PageFooter(_ref10) {
|
|
|
2558
2535
|
};
|
|
2559
2536
|
|
|
2560
2537
|
// ─── Main component ───────────────────────────────────────────────────────────
|
|
2561
|
-
var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (
|
|
2562
|
-
var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc2, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _metricByTitle$AvgDo2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _refundsRaw$refundCou, _metricByTitle$Refund3, _mainChart$stacked,
|
|
2563
|
-
var
|
|
2564
|
-
apiData =
|
|
2565
|
-
|
|
2566
|
-
dateName =
|
|
2567
|
-
|
|
2568
|
-
numberOfDays =
|
|
2569
|
-
|
|
2570
|
-
activeFilters =
|
|
2538
|
+
var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
|
|
2539
|
+
var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc2, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _metricByTitle$AvgDo2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _refundsRaw$refundCou, _metricByTitle$Refund3, _mainChart$stacked, _ref16, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _refCard$growthPercen;
|
|
2540
|
+
var _ref13$apiData = _ref13.apiData,
|
|
2541
|
+
apiData = _ref13$apiData === void 0 ? {} : _ref13$apiData,
|
|
2542
|
+
_ref13$dateName = _ref13.dateName,
|
|
2543
|
+
dateName = _ref13$dateName === void 0 ? "Last Period" : _ref13$dateName,
|
|
2544
|
+
_ref13$numberOfDays = _ref13.numberOfDays,
|
|
2545
|
+
numberOfDays = _ref13$numberOfDays === void 0 ? 30 : _ref13$numberOfDays,
|
|
2546
|
+
_ref13$activeFilters = _ref13.activeFilters,
|
|
2547
|
+
activeFilters = _ref13$activeFilters === void 0 ? [] : _ref13$activeFilters;
|
|
2571
2548
|
var now = new Date();
|
|
2572
2549
|
var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
|
|
2573
2550
|
var windowLabel = "".concat(numberOfDays, "-day window");
|
|
@@ -2876,10 +2853,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
2876
2853
|
gap: 14,
|
|
2877
2854
|
marginBottom: 6
|
|
2878
2855
|
},
|
|
2879
|
-
children: [["Email", C.cyan], ["Organic", C.emerald], ["Paid Ads", C.indigo]].map(function (
|
|
2880
|
-
var
|
|
2881
|
-
name =
|
|
2882
|
-
color =
|
|
2856
|
+
children: [["Email", C.cyan], ["Organic", C.emerald], ["Paid Ads", C.indigo]].map(function (_ref14) {
|
|
2857
|
+
var _ref15 = _slicedToArray(_ref14, 2),
|
|
2858
|
+
name = _ref15[0],
|
|
2859
|
+
color = _ref15[1];
|
|
2883
2860
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2884
2861
|
style: {
|
|
2885
2862
|
display: "flex",
|
|
@@ -3055,7 +3032,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
3055
3032
|
style: {
|
|
3056
3033
|
fontSize: 9
|
|
3057
3034
|
},
|
|
3058
|
-
children: "".concat(Number((
|
|
3035
|
+
children: "".concat(Number((_ref16 = donorMixPrev !== null && donorMixPrev !== void 0 ? donorMixPrev : growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _ref16 !== void 0 ? _ref16 : 0).toFixed(2), "% vs pp")
|
|
3059
3036
|
})
|
|
3060
3037
|
})]
|
|
3061
3038
|
})]
|
|
@@ -3067,10 +3044,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
3067
3044
|
gridTemplateColumns: "repeat(4, 1fr)",
|
|
3068
3045
|
gap: 8
|
|
3069
3046
|
},
|
|
3070
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3047
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DonationTypePanel, {
|
|
3048
|
+
donationTypeData: report.donationTypeData,
|
|
3049
|
+
recurringColor: C.indigo,
|
|
3050
|
+
oneTimeColor: C.emerald
|
|
3074
3051
|
}), /*#__PURE__*/jsxRuntime.jsx(Panel, {
|
|
3075
3052
|
title: "Donor geography",
|
|
3076
3053
|
subtitle: "Top countries \xB7 ".concat(formatNumber(totalDonors), " total"),
|
|
@@ -3226,10 +3203,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
3226
3203
|
display: "flex",
|
|
3227
3204
|
gap: 12
|
|
3228
3205
|
},
|
|
3229
|
-
children: [["Avg/day", d$((ob === null || ob === void 0 ? void 0 : ob.averagePerDay) || 0)], ["Peak day", d$((ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) || 0)], ["Orders", formatNumber((ob === null || ob === void 0 ? void 0 : ob.totalOrders) || 0)]].map(function (
|
|
3230
|
-
var
|
|
3231
|
-
l =
|
|
3232
|
-
v =
|
|
3206
|
+
children: [["Avg/day", d$((ob === null || ob === void 0 ? void 0 : ob.averagePerDay) || 0)], ["Peak day", d$((ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) || 0)], ["Orders", formatNumber((ob === null || ob === void 0 ? void 0 : ob.totalOrders) || 0)]].map(function (_ref17) {
|
|
3207
|
+
var _ref18 = _slicedToArray(_ref17, 2),
|
|
3208
|
+
l = _ref18[0],
|
|
3209
|
+
v = _ref18[1];
|
|
3233
3210
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3234
3211
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3235
3212
|
style: {
|
|
@@ -3356,10 +3333,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
3356
3333
|
display: "flex",
|
|
3357
3334
|
gap: 12
|
|
3358
3335
|
},
|
|
3359
|
-
children: [["Referrers", formatNumber((refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) || 0)], ["Avg gift", d$((refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) || 0)], ["Conv. rate", pct((refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) || 0, 1)]].map(function (
|
|
3360
|
-
var
|
|
3361
|
-
l =
|
|
3362
|
-
v =
|
|
3336
|
+
children: [["Referrers", formatNumber((refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) || 0)], ["Avg gift", d$((refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) || 0)], ["Conv. rate", pct((refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) || 0, 1)]].map(function (_ref19) {
|
|
3337
|
+
var _ref20 = _slicedToArray(_ref19, 2),
|
|
3338
|
+
l = _ref20[0],
|
|
3339
|
+
v = _ref20[1];
|
|
3363
3340
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3364
3341
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3365
3342
|
style: {
|
|
@@ -4703,274 +4680,555 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
|
|
|
4703
4680
|
sx: {
|
|
4704
4681
|
display: "flex",
|
|
4705
4682
|
justifyContent: "space-between",
|
|
4706
|
-
mt: 0.5
|
|
4683
|
+
mt: 0.5
|
|
4684
|
+
},
|
|
4685
|
+
children: axisLabels.map(function (label, idx) {
|
|
4686
|
+
return /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4687
|
+
sx: {
|
|
4688
|
+
fontSize: "10px",
|
|
4689
|
+
color: "rgba(0, 0, 0, 0.3)"
|
|
4690
|
+
},
|
|
4691
|
+
children: label
|
|
4692
|
+
}, "".concat(label, "-").concat(idx));
|
|
4693
|
+
})
|
|
4694
|
+
})]
|
|
4695
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4696
|
+
sx: {
|
|
4697
|
+
mt: "auto",
|
|
4698
|
+
pt: bottomSection ? 1.5 : 3,
|
|
4699
|
+
display: "flex",
|
|
4700
|
+
justifyContent: "space-between"
|
|
4701
|
+
},
|
|
4702
|
+
children: footerMetrics.map(function (m, idx) {
|
|
4703
|
+
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4704
|
+
sx: {
|
|
4705
|
+
textAlign: "center"
|
|
4706
|
+
},
|
|
4707
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4708
|
+
sx: {
|
|
4709
|
+
fontSize: "10px",
|
|
4710
|
+
color: "rgba(0, 0, 0, 0.4)",
|
|
4711
|
+
fontWeight: 500
|
|
4712
|
+
},
|
|
4713
|
+
children: m.label
|
|
4714
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4715
|
+
sx: {
|
|
4716
|
+
fontSize: "14px",
|
|
4717
|
+
fontWeight: 700,
|
|
4718
|
+
color: "#000"
|
|
4719
|
+
},
|
|
4720
|
+
children: "".concat(formatNumber(m.value))
|
|
4721
|
+
})]
|
|
4722
|
+
}, idx);
|
|
4723
|
+
})
|
|
4724
|
+
})]
|
|
4725
|
+
});
|
|
4726
|
+
};
|
|
4727
|
+
|
|
4728
|
+
var TrendValue = function TrendValue(_ref) {
|
|
4729
|
+
var trend = _ref.trend;
|
|
4730
|
+
var direction = getTrendDirection(trend);
|
|
4731
|
+
var color = getTrendColor(trend);
|
|
4732
|
+
var Icon = direction === "down" ? iconsMaterial.TrendingDown : iconsMaterial.TrendingUp;
|
|
4733
|
+
return /*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
|
|
4734
|
+
sx: {
|
|
4735
|
+
fontSize: "10px",
|
|
4736
|
+
fontWeight: 700,
|
|
4737
|
+
color: color,
|
|
4738
|
+
display: "flex",
|
|
4739
|
+
alignItems: "center"
|
|
4740
|
+
},
|
|
4741
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
4742
|
+
sx: {
|
|
4743
|
+
fontSize: "12px"
|
|
4744
|
+
}
|
|
4745
|
+
}), " ", trend]
|
|
4746
|
+
});
|
|
4747
|
+
};
|
|
4748
|
+
var MetricDonutCard = function MetricDonutCard(_ref2) {
|
|
4749
|
+
var title = _ref2.title,
|
|
4750
|
+
subtitle = _ref2.subtitle,
|
|
4751
|
+
acceptanceRate = _ref2.acceptanceRate,
|
|
4752
|
+
acceptanceVal = _ref2.acceptanceVal,
|
|
4753
|
+
acceptanceTrend = _ref2.acceptanceTrend,
|
|
4754
|
+
raisedVal = _ref2.raisedVal,
|
|
4755
|
+
raisedTrend = _ref2.raisedTrend,
|
|
4756
|
+
_ref2$chartColors = _ref2.chartColors,
|
|
4757
|
+
chartColors = _ref2$chartColors === void 0 ? ["rgb(99, 99, 230)", "#88bfd290"] : _ref2$chartColors,
|
|
4758
|
+
sx = _ref2.sx,
|
|
4759
|
+
_ref2$compact = _ref2.compact,
|
|
4760
|
+
compact = _ref2$compact === void 0 ? false : _ref2$compact;
|
|
4761
|
+
var chartOptions = {
|
|
4762
|
+
chart: {
|
|
4763
|
+
type: "radialBar",
|
|
4764
|
+
sparkline: {
|
|
4765
|
+
enabled: true
|
|
4766
|
+
}
|
|
4767
|
+
},
|
|
4768
|
+
plotOptions: {
|
|
4769
|
+
radialBar: {
|
|
4770
|
+
hollow: {
|
|
4771
|
+
size: "45%"
|
|
4772
|
+
},
|
|
4773
|
+
track: {
|
|
4774
|
+
background: chartColors[1] || "#f0f0f0",
|
|
4775
|
+
strokeWidth: "100%"
|
|
4776
|
+
},
|
|
4777
|
+
dataLabels: {
|
|
4778
|
+
name: {
|
|
4779
|
+
show: true,
|
|
4780
|
+
fontSize: "11px",
|
|
4781
|
+
fontWeight: 500,
|
|
4782
|
+
color: "rgba(0, 0, 0, 0.4)",
|
|
4783
|
+
offsetY: 15
|
|
4784
|
+
},
|
|
4785
|
+
value: {
|
|
4786
|
+
show: true,
|
|
4787
|
+
fontSize: "18px",
|
|
4788
|
+
fontWeight: 700,
|
|
4789
|
+
color: "#000",
|
|
4790
|
+
offsetY: -15,
|
|
4791
|
+
formatter: function formatter() {
|
|
4792
|
+
return acceptanceRate + "%";
|
|
4793
|
+
}
|
|
4794
|
+
}
|
|
4795
|
+
}
|
|
4796
|
+
}
|
|
4797
|
+
},
|
|
4798
|
+
stroke: {
|
|
4799
|
+
lineCap: "butt"
|
|
4800
|
+
},
|
|
4801
|
+
colors: [chartColors[0]],
|
|
4802
|
+
labels: ["accepted"],
|
|
4803
|
+
tooltip: {
|
|
4804
|
+
enabled: true,
|
|
4805
|
+
theme: "dark",
|
|
4806
|
+
y: {
|
|
4807
|
+
formatter: function formatter(val) {
|
|
4808
|
+
return "".concat(val, "%");
|
|
4809
|
+
}
|
|
4810
|
+
}
|
|
4811
|
+
}
|
|
4812
|
+
};
|
|
4813
|
+
var series = [acceptanceRate];
|
|
4814
|
+
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
4815
|
+
sx: _objectSpread2({
|
|
4816
|
+
p: compact ? 1.25 : 3,
|
|
4817
|
+
borderRadius: compact ? 3 : 4,
|
|
4818
|
+
border: "1px solid #f0f0f0",
|
|
4819
|
+
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
4820
|
+
bgcolor: "#fff",
|
|
4821
|
+
// height: "100%",
|
|
4822
|
+
display: "flex",
|
|
4823
|
+
flexDirection: "column"
|
|
4824
|
+
}, sx),
|
|
4825
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4826
|
+
sx: {},
|
|
4827
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4828
|
+
sx: {
|
|
4829
|
+
fontWeight: 700,
|
|
4830
|
+
fontSize: compact ? "13px" : "16px",
|
|
4831
|
+
color: "#000",
|
|
4832
|
+
textAlign: "left",
|
|
4833
|
+
lineHeight: 1.15
|
|
4834
|
+
},
|
|
4835
|
+
children: title
|
|
4836
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4837
|
+
sx: {
|
|
4838
|
+
fontSize: "12px",
|
|
4839
|
+
color: "rgba(0, 0, 0, 0.4)",
|
|
4840
|
+
textAlign: "left",
|
|
4841
|
+
lineHeight: 1.15
|
|
4842
|
+
},
|
|
4843
|
+
children: subtitle
|
|
4844
|
+
})]
|
|
4845
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4846
|
+
sx: {
|
|
4847
|
+
height: compact ? 90 : 160,
|
|
4848
|
+
position: "relative",
|
|
4849
|
+
mt: compact ? 0.5 : 1,
|
|
4850
|
+
display: "flex",
|
|
4851
|
+
justifyContent: "center"
|
|
4852
|
+
},
|
|
4853
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ReactApexChart, {
|
|
4854
|
+
options: chartOptions,
|
|
4855
|
+
series: series,
|
|
4856
|
+
type: "radialBar",
|
|
4857
|
+
width: "100%",
|
|
4858
|
+
height: "100%"
|
|
4859
|
+
})
|
|
4860
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4861
|
+
sx: {},
|
|
4862
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4863
|
+
sx: {
|
|
4864
|
+
display: "flex",
|
|
4865
|
+
justifyContent: "space-between",
|
|
4866
|
+
alignItems: "center"
|
|
4867
|
+
},
|
|
4868
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4869
|
+
sx: {
|
|
4870
|
+
display: "flex",
|
|
4871
|
+
alignItems: "center",
|
|
4872
|
+
gap: 1
|
|
4873
|
+
},
|
|
4874
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4875
|
+
sx: {
|
|
4876
|
+
width: 10,
|
|
4877
|
+
height: 10,
|
|
4878
|
+
bgcolor: chartColors[0],
|
|
4879
|
+
borderRadius: "2px"
|
|
4880
|
+
}
|
|
4881
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4882
|
+
sx: {
|
|
4883
|
+
fontSize: "13px",
|
|
4884
|
+
color: "rgba(0, 0, 0, 0.5)",
|
|
4885
|
+
fontWeight: 500
|
|
4886
|
+
},
|
|
4887
|
+
children: "Acceptance"
|
|
4888
|
+
})]
|
|
4889
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4890
|
+
sx: {
|
|
4891
|
+
display: "flex",
|
|
4892
|
+
alignItems: "center",
|
|
4893
|
+
gap: 0.5
|
|
4894
|
+
},
|
|
4895
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4896
|
+
sx: {
|
|
4897
|
+
fontSize: "13px",
|
|
4898
|
+
fontWeight: 700,
|
|
4899
|
+
color: "#000"
|
|
4900
|
+
},
|
|
4901
|
+
children: acceptanceVal
|
|
4902
|
+
}), /*#__PURE__*/jsxRuntime.jsx(TrendValue, {
|
|
4903
|
+
trend: acceptanceTrend
|
|
4904
|
+
})]
|
|
4905
|
+
})]
|
|
4906
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4907
|
+
sx: {
|
|
4908
|
+
display: "flex",
|
|
4909
|
+
justifyContent: "space-between",
|
|
4910
|
+
alignItems: "center"
|
|
4707
4911
|
},
|
|
4708
|
-
children:
|
|
4709
|
-
return /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4710
|
-
sx: {
|
|
4711
|
-
fontSize: "10px",
|
|
4712
|
-
color: "rgba(0, 0, 0, 0.3)"
|
|
4713
|
-
},
|
|
4714
|
-
children: label
|
|
4715
|
-
}, "".concat(label, "-").concat(idx));
|
|
4716
|
-
})
|
|
4717
|
-
})]
|
|
4718
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4719
|
-
sx: {
|
|
4720
|
-
mt: "auto",
|
|
4721
|
-
pt: bottomSection ? 1.5 : 3,
|
|
4722
|
-
display: "flex",
|
|
4723
|
-
justifyContent: "space-between"
|
|
4724
|
-
},
|
|
4725
|
-
children: footerMetrics.map(function (m, idx) {
|
|
4726
|
-
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4912
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4727
4913
|
sx: {
|
|
4728
|
-
|
|
4914
|
+
display: "flex",
|
|
4915
|
+
alignItems: "center",
|
|
4916
|
+
gap: 1
|
|
4729
4917
|
},
|
|
4730
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(material.
|
|
4918
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4731
4919
|
sx: {
|
|
4732
|
-
|
|
4733
|
-
|
|
4920
|
+
width: 10,
|
|
4921
|
+
height: 10,
|
|
4922
|
+
bgcolor: chartColors[1],
|
|
4923
|
+
borderRadius: "2px"
|
|
4924
|
+
}
|
|
4925
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4926
|
+
sx: {
|
|
4927
|
+
fontSize: "13px",
|
|
4928
|
+
color: "rgba(0, 0, 0, 0.5)",
|
|
4734
4929
|
fontWeight: 500
|
|
4735
4930
|
},
|
|
4736
|
-
children:
|
|
4737
|
-
})
|
|
4931
|
+
children: "Raised"
|
|
4932
|
+
})]
|
|
4933
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4934
|
+
sx: {
|
|
4935
|
+
display: "flex",
|
|
4936
|
+
alignItems: "center",
|
|
4937
|
+
gap: 0.5
|
|
4938
|
+
},
|
|
4939
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4738
4940
|
sx: {
|
|
4739
|
-
fontSize: "
|
|
4941
|
+
fontSize: "13px",
|
|
4740
4942
|
fontWeight: 700,
|
|
4741
4943
|
color: "#000"
|
|
4742
4944
|
},
|
|
4743
|
-
children:
|
|
4945
|
+
children: raisedVal
|
|
4946
|
+
}), /*#__PURE__*/jsxRuntime.jsx(TrendValue, {
|
|
4947
|
+
trend: raisedTrend
|
|
4744
4948
|
})]
|
|
4745
|
-
}
|
|
4746
|
-
})
|
|
4949
|
+
})]
|
|
4950
|
+
})]
|
|
4747
4951
|
})]
|
|
4748
4952
|
});
|
|
4749
4953
|
};
|
|
4750
4954
|
|
|
4751
|
-
var
|
|
4752
|
-
var
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4955
|
+
var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
4956
|
+
var sx = _ref.sx,
|
|
4957
|
+
donationTypeData = _ref.donationTypeData,
|
|
4958
|
+
_ref$exportMode = _ref.exportMode,
|
|
4959
|
+
exportMode = _ref$exportMode === void 0 ? false : _ref$exportMode,
|
|
4960
|
+
_ref$subtitle = _ref.subtitle,
|
|
4961
|
+
subtitle = _ref$subtitle === void 0 ? "Donation type" : _ref$subtitle,
|
|
4962
|
+
chartHeight = _ref.chartHeight;
|
|
4963
|
+
var recurringColor = "rgb(99, 99, 230)";
|
|
4964
|
+
var oneTimeColor = "#10B981";
|
|
4965
|
+
var colors = [recurringColor, oneTimeColor, "#06B6D4", "#F59E0B", "#EF4444"];
|
|
4966
|
+
var categories = [];
|
|
4967
|
+
var series = [];
|
|
4968
|
+
var summaries = [];
|
|
4969
|
+
var title = "Donation Type";
|
|
4970
|
+
var isDistributed = false;
|
|
4971
|
+
if (donationTypeData && donationTypeData.data && Array.isArray(donationTypeData.data)) {
|
|
4972
|
+
// Time series recurring vs one-time format
|
|
4973
|
+
categories = donationTypeData.data.map(function (item) {
|
|
4974
|
+
return item.label || "";
|
|
4975
|
+
});
|
|
4976
|
+
series = [{
|
|
4977
|
+
name: "Recurring",
|
|
4978
|
+
data: donationTypeData.data.map(function (item) {
|
|
4979
|
+
return item.recurring || 0;
|
|
4980
|
+
})
|
|
4981
|
+
}, {
|
|
4982
|
+
name: "One-time",
|
|
4983
|
+
data: donationTypeData.data.map(function (item) {
|
|
4984
|
+
return item.oneTime || 0;
|
|
4985
|
+
})
|
|
4986
|
+
}];
|
|
4987
|
+
summaries = [{
|
|
4988
|
+
label: "Recurring",
|
|
4989
|
+
total: donationTypeData.totalRecurringDonations || 0,
|
|
4990
|
+
color: recurringColor
|
|
4991
|
+
}, {
|
|
4992
|
+
label: "One-time",
|
|
4993
|
+
total: donationTypeData.totalOneTimeDonations || 0,
|
|
4994
|
+
color: oneTimeColor
|
|
4995
|
+
}];
|
|
4996
|
+
title = "Recurring vs One-time";
|
|
4997
|
+
isDistributed = false;
|
|
4998
|
+
} else if (Array.isArray(donationTypeData) && donationTypeData.length > 0 && donationTypeData[0].totalAmount !== undefined) {
|
|
4999
|
+
// New array format
|
|
5000
|
+
categories = donationTypeData.map(function (item) {
|
|
5001
|
+
return item.type || "";
|
|
5002
|
+
});
|
|
5003
|
+
series = [{
|
|
5004
|
+
name: "Amount",
|
|
5005
|
+
data: donationTypeData.map(function (item) {
|
|
5006
|
+
return item.totalAmount || 0;
|
|
5007
|
+
})
|
|
5008
|
+
}];
|
|
5009
|
+
summaries = donationTypeData.map(function (item, index) {
|
|
5010
|
+
return {
|
|
5011
|
+
label: item.type || "",
|
|
5012
|
+
total: item.totalAmount || 0,
|
|
5013
|
+
color: colors[index % colors.length]
|
|
5014
|
+
};
|
|
5015
|
+
});
|
|
5016
|
+
isDistributed = true;
|
|
5017
|
+
if (donationTypeData.length === 2) {
|
|
5018
|
+
title = "".concat(donationTypeData[0].type, " vs ").concat(donationTypeData[1].type);
|
|
5019
|
+
}
|
|
5020
|
+
} else {
|
|
5021
|
+
var _dataObj$summary, _dataObj$summary2, _dataObj$summary3, _dataObj$summary4;
|
|
5022
|
+
// Object format, empty array, or missing data
|
|
5023
|
+
var dataObj = donationTypeData && _typeof(donationTypeData) === "object" && !Array.isArray(donationTypeData) ? donationTypeData : {};
|
|
5024
|
+
categories = dataObj.categories || [];
|
|
5025
|
+
var rawSeries = dataObj.series || [];
|
|
5026
|
+
if (rawSeries.length && categories.length) {
|
|
5027
|
+
series = rawSeries;
|
|
5028
|
+
} else {
|
|
5029
|
+
series = [{
|
|
5030
|
+
name: "Recurring",
|
|
5031
|
+
data: []
|
|
5032
|
+
}, {
|
|
5033
|
+
name: "One-time",
|
|
5034
|
+
data: []
|
|
5035
|
+
}];
|
|
5036
|
+
}
|
|
5037
|
+
summaries = [{
|
|
5038
|
+
label: (dataObj === null || dataObj === void 0 || (_dataObj$summary = dataObj.summary) === null || _dataObj$summary === void 0 || (_dataObj$summary = _dataObj$summary.recurring) === null || _dataObj$summary === void 0 ? void 0 : _dataObj$summary.label) || "Recurring",
|
|
5039
|
+
total: (dataObj === null || dataObj === void 0 || (_dataObj$summary2 = dataObj.summary) === null || _dataObj$summary2 === void 0 || (_dataObj$summary2 = _dataObj$summary2.recurring) === null || _dataObj$summary2 === void 0 ? void 0 : _dataObj$summary2.total) || 0,
|
|
5040
|
+
color: recurringColor
|
|
5041
|
+
}, {
|
|
5042
|
+
label: (dataObj === null || dataObj === void 0 || (_dataObj$summary3 = dataObj.summary) === null || _dataObj$summary3 === void 0 || (_dataObj$summary3 = _dataObj$summary3.oneTime) === null || _dataObj$summary3 === void 0 ? void 0 : _dataObj$summary3.label) || "One-time",
|
|
5043
|
+
total: (dataObj === null || dataObj === void 0 || (_dataObj$summary4 = dataObj.summary) === null || _dataObj$summary4 === void 0 || (_dataObj$summary4 = _dataObj$summary4.oneTime) === null || _dataObj$summary4 === void 0 ? void 0 : _dataObj$summary4.total) || 0,
|
|
5044
|
+
color: oneTimeColor
|
|
5045
|
+
}];
|
|
5046
|
+
title = "Recurring vs one-time";
|
|
5047
|
+
isDistributed = false;
|
|
5048
|
+
}
|
|
5049
|
+
var resolvedChartHeight = chartHeight !== null && chartHeight !== void 0 ? chartHeight : exportMode ? 110 : 170;
|
|
4784
5050
|
var chartOptions = {
|
|
4785
5051
|
chart: {
|
|
4786
|
-
type: "
|
|
4787
|
-
|
|
4788
|
-
|
|
5052
|
+
type: "bar",
|
|
5053
|
+
toolbar: {
|
|
5054
|
+
show: false
|
|
5055
|
+
},
|
|
5056
|
+
zoom: {
|
|
5057
|
+
enabled: false
|
|
5058
|
+
},
|
|
5059
|
+
fontFamily: "Inter, sans-serif"
|
|
5060
|
+
},
|
|
5061
|
+
plotOptions: {
|
|
5062
|
+
bar: {
|
|
5063
|
+
horizontal: false,
|
|
5064
|
+
columnWidth: exportMode ? "68%" : "75%",
|
|
5065
|
+
borderRadius: exportMode ? 3 : 4,
|
|
5066
|
+
distributed: isDistributed,
|
|
5067
|
+
dataLabels: {
|
|
5068
|
+
position: "top"
|
|
5069
|
+
}
|
|
5070
|
+
}
|
|
5071
|
+
},
|
|
5072
|
+
dataLabels: {
|
|
5073
|
+
enabled: true,
|
|
5074
|
+
formatter: function formatter(val) {
|
|
5075
|
+
return "$".concat(formatNumber(val));
|
|
5076
|
+
},
|
|
5077
|
+
offsetY: exportMode ? -16 : -20,
|
|
5078
|
+
style: {
|
|
5079
|
+
fontSize: exportMode ? "7px" : "9px",
|
|
5080
|
+
fontWeight: 600,
|
|
5081
|
+
colors: ["#000"]
|
|
5082
|
+
}
|
|
5083
|
+
},
|
|
5084
|
+
stroke: {
|
|
5085
|
+
show: true,
|
|
5086
|
+
width: 2,
|
|
5087
|
+
colors: ["transparent"]
|
|
5088
|
+
},
|
|
5089
|
+
xaxis: {
|
|
5090
|
+
categories: categories,
|
|
5091
|
+
axisBorder: {
|
|
5092
|
+
show: false
|
|
5093
|
+
},
|
|
5094
|
+
axisTicks: {
|
|
5095
|
+
show: false
|
|
5096
|
+
},
|
|
5097
|
+
labels: {
|
|
5098
|
+
style: {
|
|
5099
|
+
colors: "rgba(0, 0, 0, 0.4)",
|
|
5100
|
+
fontSize: exportMode ? "8px" : "11px"
|
|
5101
|
+
}
|
|
4789
5102
|
}
|
|
4790
5103
|
},
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
background: chartColors[1] || "#f0f0f0",
|
|
4798
|
-
strokeWidth: "100%"
|
|
5104
|
+
yaxis: {
|
|
5105
|
+
min: 0,
|
|
5106
|
+
tickAmount: exportMode ? 3 : 4,
|
|
5107
|
+
labels: {
|
|
5108
|
+
formatter: function formatter(val) {
|
|
5109
|
+
return "$".concat(formatNumber(val));
|
|
4799
5110
|
},
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
fontSize: "11px",
|
|
4804
|
-
fontWeight: 500,
|
|
4805
|
-
color: "rgba(0, 0, 0, 0.4)",
|
|
4806
|
-
offsetY: 15
|
|
4807
|
-
},
|
|
4808
|
-
value: {
|
|
4809
|
-
show: true,
|
|
4810
|
-
fontSize: "18px",
|
|
4811
|
-
fontWeight: 700,
|
|
4812
|
-
color: "#000",
|
|
4813
|
-
offsetY: -15,
|
|
4814
|
-
formatter: function formatter() {
|
|
4815
|
-
return acceptanceRate + "%";
|
|
4816
|
-
}
|
|
4817
|
-
}
|
|
5111
|
+
style: {
|
|
5112
|
+
colors: "rgba(0, 0, 0, 0.4)",
|
|
5113
|
+
fontSize: exportMode ? "8px" : "10px"
|
|
4818
5114
|
}
|
|
4819
5115
|
}
|
|
4820
5116
|
},
|
|
4821
|
-
|
|
4822
|
-
|
|
5117
|
+
fill: {
|
|
5118
|
+
opacity: 1
|
|
5119
|
+
},
|
|
5120
|
+
colors: colors,
|
|
5121
|
+
grid: {
|
|
5122
|
+
borderColor: "#f1f1f1",
|
|
5123
|
+
strokeDashArray: 4,
|
|
5124
|
+
padding: {
|
|
5125
|
+
left: 0,
|
|
5126
|
+
right: 0
|
|
5127
|
+
},
|
|
5128
|
+
yaxis: {
|
|
5129
|
+
lines: {
|
|
5130
|
+
show: true
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5133
|
+
},
|
|
5134
|
+
legend: {
|
|
5135
|
+
show: false
|
|
4823
5136
|
},
|
|
4824
|
-
colors: [chartColors[0]],
|
|
4825
|
-
labels: ["accepted"],
|
|
4826
5137
|
tooltip: {
|
|
4827
|
-
enabled: true,
|
|
4828
|
-
theme: "dark",
|
|
4829
5138
|
y: {
|
|
4830
5139
|
formatter: function formatter(val) {
|
|
4831
|
-
return "".concat(val
|
|
5140
|
+
return "$".concat(formatNumber(val));
|
|
4832
5141
|
}
|
|
4833
5142
|
}
|
|
4834
5143
|
}
|
|
4835
5144
|
};
|
|
4836
|
-
var series = [acceptanceRate];
|
|
4837
5145
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
4838
5146
|
sx: _objectSpread2({
|
|
4839
|
-
p: compact ? 1.25 : 3,
|
|
4840
|
-
borderRadius: compact ? 3 : 4,
|
|
4841
|
-
border: "1px solid #f0f0f0",
|
|
4842
|
-
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
4843
5147
|
bgcolor: "#fff",
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
5148
|
+
borderRadius: exportMode ? 2 : 4,
|
|
5149
|
+
border: exportMode ? "1px solid #DDE3EA" : "1px solid #f0f0f0",
|
|
5150
|
+
boxShadow: exportMode ? "0 1px 0 rgba(15,23,42,0.03)" : "0 4px 24px rgba(0,0,0,0.06)",
|
|
5151
|
+
p: exportMode ? 1.5 : 3,
|
|
5152
|
+
height: exportMode ? "100%" : "auto",
|
|
5153
|
+
boxSizing: "border-box"
|
|
4847
5154
|
}, sx),
|
|
4848
5155
|
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4849
|
-
sx: {},
|
|
4850
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4851
|
-
sx: {
|
|
4852
|
-
fontWeight: 700,
|
|
4853
|
-
fontSize: compact ? "13px" : "16px",
|
|
4854
|
-
color: "#000",
|
|
4855
|
-
textAlign: "left",
|
|
4856
|
-
lineHeight: 1.15
|
|
4857
|
-
},
|
|
4858
|
-
children: title
|
|
4859
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4860
|
-
sx: {
|
|
4861
|
-
fontSize: "12px",
|
|
4862
|
-
color: "rgba(0, 0, 0, 0.4)",
|
|
4863
|
-
textAlign: "left",
|
|
4864
|
-
lineHeight: 1.15
|
|
4865
|
-
},
|
|
4866
|
-
children: subtitle
|
|
4867
|
-
})]
|
|
4868
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4869
5156
|
sx: {
|
|
4870
|
-
height: compact ? 90 : 160,
|
|
4871
|
-
position: "relative",
|
|
4872
|
-
mt: compact ? 0.5 : 1,
|
|
4873
5157
|
display: "flex",
|
|
4874
|
-
|
|
5158
|
+
flexDirection: "column"
|
|
4875
5159
|
},
|
|
4876
|
-
children: /*#__PURE__*/jsxRuntime.jsx(ReactApexChart, {
|
|
4877
|
-
options: chartOptions,
|
|
4878
|
-
series: series,
|
|
4879
|
-
type: "radialBar",
|
|
4880
|
-
width: "100%",
|
|
4881
|
-
height: "100%"
|
|
4882
|
-
})
|
|
4883
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4884
|
-
sx: {},
|
|
4885
5160
|
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4886
5161
|
sx: {
|
|
4887
|
-
|
|
4888
|
-
justifyContent: "space-between",
|
|
4889
|
-
alignItems: "center"
|
|
5162
|
+
textAlign: "left"
|
|
4890
5163
|
},
|
|
4891
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
5164
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4892
5165
|
sx: {
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
5166
|
+
fontWeight: 700,
|
|
5167
|
+
fontSize: exportMode ? "12px" : "18px",
|
|
5168
|
+
color: "#000",
|
|
5169
|
+
lineHeight: 1.15
|
|
4896
5170
|
},
|
|
4897
|
-
children:
|
|
4898
|
-
|
|
4899
|
-
width: 10,
|
|
4900
|
-
height: 10,
|
|
4901
|
-
bgcolor: chartColors[0],
|
|
4902
|
-
borderRadius: "2px"
|
|
4903
|
-
}
|
|
4904
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4905
|
-
sx: {
|
|
4906
|
-
fontSize: "13px",
|
|
4907
|
-
color: "rgba(0, 0, 0, 0.5)",
|
|
4908
|
-
fontWeight: 500
|
|
4909
|
-
},
|
|
4910
|
-
children: "Acceptance"
|
|
4911
|
-
})]
|
|
4912
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
5171
|
+
children: title
|
|
5172
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4913
5173
|
sx: {
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
5174
|
+
fontSize: exportMode ? "9.5px" : "13px",
|
|
5175
|
+
color: exportMode ? "#94A3B8" : "rgba(0, 0, 0, 0.4)",
|
|
5176
|
+
lineHeight: 1.15
|
|
4917
5177
|
},
|
|
4918
|
-
children:
|
|
4919
|
-
sx: {
|
|
4920
|
-
fontSize: "13px",
|
|
4921
|
-
fontWeight: 700,
|
|
4922
|
-
color: "#000"
|
|
4923
|
-
},
|
|
4924
|
-
children: acceptanceVal
|
|
4925
|
-
}), /*#__PURE__*/jsxRuntime.jsx(TrendValue, {
|
|
4926
|
-
trend: acceptanceTrend
|
|
4927
|
-
})]
|
|
5178
|
+
children: subtitle
|
|
4928
5179
|
})]
|
|
4929
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
5180
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4930
5181
|
sx: {
|
|
4931
5182
|
display: "flex",
|
|
4932
|
-
|
|
4933
|
-
|
|
5183
|
+
gap: exportMode ? 1 : 1.5,
|
|
5184
|
+
mt: exportMode ? 0.75 : 0.5,
|
|
5185
|
+
flexWrap: "wrap"
|
|
4934
5186
|
},
|
|
4935
|
-
children:
|
|
4936
|
-
|
|
4937
|
-
display: "flex",
|
|
4938
|
-
alignItems: "center",
|
|
4939
|
-
gap: 1
|
|
4940
|
-
},
|
|
4941
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4942
|
-
sx: {
|
|
4943
|
-
width: 10,
|
|
4944
|
-
height: 10,
|
|
4945
|
-
bgcolor: chartColors[1],
|
|
4946
|
-
borderRadius: "2px"
|
|
4947
|
-
}
|
|
4948
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4949
|
-
sx: {
|
|
4950
|
-
fontSize: "13px",
|
|
4951
|
-
color: "rgba(0, 0, 0, 0.5)",
|
|
4952
|
-
fontWeight: 500
|
|
4953
|
-
},
|
|
4954
|
-
children: "Raised"
|
|
4955
|
-
})]
|
|
4956
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4957
|
-
sx: {
|
|
4958
|
-
display: "flex",
|
|
4959
|
-
alignItems: "center",
|
|
4960
|
-
gap: 0.5
|
|
4961
|
-
},
|
|
4962
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
5187
|
+
children: summaries.map(function (item, index) {
|
|
5188
|
+
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4963
5189
|
sx: {
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
5190
|
+
display: "flex",
|
|
5191
|
+
alignItems: "center",
|
|
5192
|
+
gap: 0.5
|
|
4967
5193
|
},
|
|
4968
|
-
children:
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
5194
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
5195
|
+
sx: {
|
|
5196
|
+
width: exportMode ? 6 : 8,
|
|
5197
|
+
height: exportMode ? 6 : 8,
|
|
5198
|
+
bgcolor: item.color,
|
|
5199
|
+
borderRadius: "50%"
|
|
5200
|
+
}
|
|
5201
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
5202
|
+
sx: {
|
|
5203
|
+
fontSize: exportMode ? "9.5px" : "13px",
|
|
5204
|
+
color: exportMode ? "#374151" : "rgba(0, 0, 0, 0.5)",
|
|
5205
|
+
fontWeight: 500
|
|
5206
|
+
},
|
|
5207
|
+
children: item.label
|
|
5208
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
|
|
5209
|
+
sx: {
|
|
5210
|
+
fontSize: exportMode ? "9.5px" : "13px",
|
|
5211
|
+
fontWeight: exportMode ? 700 : 600,
|
|
5212
|
+
color: "#000"
|
|
5213
|
+
},
|
|
5214
|
+
children: ["$", formatNumber(item.total || 0)]
|
|
5215
|
+
})]
|
|
5216
|
+
}, item.label || index);
|
|
5217
|
+
})
|
|
4973
5218
|
})]
|
|
5219
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
5220
|
+
sx: {
|
|
5221
|
+
height: resolvedChartHeight,
|
|
5222
|
+
width: exportMode ? "calc(100% + 24px)" : "calc(100% + 48px)",
|
|
5223
|
+
ml: exportMode ? -1.5 : -3,
|
|
5224
|
+
mr: exportMode ? -1.5 : -3
|
|
5225
|
+
},
|
|
5226
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ReactApexChart, {
|
|
5227
|
+
options: chartOptions,
|
|
5228
|
+
series: series,
|
|
5229
|
+
type: "bar",
|
|
5230
|
+
height: "100%"
|
|
5231
|
+
})
|
|
4974
5232
|
})]
|
|
4975
5233
|
});
|
|
4976
5234
|
};
|