@ammarkhalidfarooq/dashboard-package 0.6.45 → 0.6.46
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 +24 -21
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +24 -21
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1578,11 +1578,14 @@ var THEME = {
|
|
|
1578
1578
|
var d$ = function d$(v) {
|
|
1579
1579
|
return "$".concat(formatNumber(Number(v !== null && v !== void 0 ? v : 0)));
|
|
1580
1580
|
};
|
|
1581
|
-
var
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
return
|
|
1581
|
+
var kpi$ = function kpi$(v) {
|
|
1582
|
+
return "$".concat(formatNumber(Number(v !== null && v !== void 0 ? v : 0).toFixed(2)));
|
|
1583
|
+
};
|
|
1584
|
+
var kpiPct = function kpiPct(v) {
|
|
1585
|
+
return "".concat(formatNumber(Number(v !== null && v !== void 0 ? v : 0).toFixed(2)), "%");
|
|
1586
|
+
};
|
|
1587
|
+
var kpiRoas = function kpiRoas(v) {
|
|
1588
|
+
return "".concat(formatNumber(Number(v !== null && v !== void 0 ? v : 0).toFixed(2)), "\xD7");
|
|
1586
1589
|
};
|
|
1587
1590
|
var pct = function pct(v) {
|
|
1588
1591
|
var dp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
@@ -2179,7 +2182,7 @@ var PageFooter = function PageFooter(_ref0) {
|
|
|
2179
2182
|
|
|
2180
2183
|
// ─── Main component ───────────────────────────────────────────────────────────
|
|
2181
2184
|
var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
2182
|
-
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,
|
|
2185
|
+
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, _ob$peakDay;
|
|
2183
2186
|
var _ref1$apiData = _ref1.apiData,
|
|
2184
2187
|
apiData = _ref1$apiData === void 0 ? {} : _ref1$apiData,
|
|
2185
2188
|
_ref1$dateName = _ref1.dateName,
|
|
@@ -2420,7 +2423,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2420
2423
|
},
|
|
2421
2424
|
children: [/*#__PURE__*/jsxRuntime.jsx(KpiCard, {
|
|
2422
2425
|
title: "Total Raised",
|
|
2423
|
-
value:
|
|
2426
|
+
value: kpi$(totalRaised),
|
|
2424
2427
|
trend: hero.trend,
|
|
2425
2428
|
detail: hero.detail,
|
|
2426
2429
|
variant: "primary"
|
|
@@ -2432,7 +2435,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2432
2435
|
},
|
|
2433
2436
|
children: [/*#__PURE__*/jsxRuntime.jsx(KpiCard, {
|
|
2434
2437
|
title: "Net Raised",
|
|
2435
|
-
value:
|
|
2438
|
+
value: kpi$(netRaised),
|
|
2436
2439
|
trend: ((_metricByTitle$NetRa = metricByTitle["Net Raised"]) === null || _metricByTitle$NetRa === void 0 ? void 0 : _metricByTitle$NetRa.trend) || signed((growth === null || growth === void 0 ? void 0 : growth.netRevenue) || 17.4),
|
|
2437
2440
|
detail: passThrough
|
|
2438
2441
|
}), /*#__PURE__*/jsxRuntime.jsx(KpiCard, {
|
|
@@ -2442,9 +2445,9 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2442
2445
|
detail: ((_metricByTitle$Total3 = metricByTitle["Total Donors"]) === null || _metricByTitle$Total3 === void 0 ? void 0 : _metricByTitle$Total3.detail) || "".concat(formatNumber(newDonors), " new \xB7 ").concat(formatNumber(returningDonors), " returning")
|
|
2443
2446
|
}), /*#__PURE__*/jsxRuntime.jsx(KpiCard, {
|
|
2444
2447
|
title: "Avg Donation",
|
|
2445
|
-
value:
|
|
2446
|
-
trend: ((_metricByTitle$
|
|
2447
|
-
detail: ((_metricByTitle$
|
|
2448
|
+
value: kpi$(avgDonation),
|
|
2449
|
+
trend: ((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.trend) || signed((growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) || 8.4),
|
|
2450
|
+
detail: ((_metricByTitle$AvgDo2 = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo2 === void 0 ? void 0 : _metricByTitle$AvgDo2.detail) || "Median ".concat(d$((_apiData$medianGift = apiData === null || apiData === void 0 ? void 0 : apiData.medianGift) !== null && _apiData$medianGift !== void 0 ? _apiData$medianGift : 75), " \xB7 top decile ").concat(d$((_apiData$topDecileGif = apiData === null || apiData === void 0 ? void 0 : apiData.topDecileGift) !== null && _apiData$topDecileGif !== void 0 ? _apiData$topDecileGif : 850))
|
|
2448
2451
|
})]
|
|
2449
2452
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2450
2453
|
style: {
|
|
@@ -2454,19 +2457,19 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2454
2457
|
},
|
|
2455
2458
|
children: [/*#__PURE__*/jsxRuntime.jsx(KpiCard, {
|
|
2456
2459
|
title: "ROAS",
|
|
2457
|
-
value: ((
|
|
2458
|
-
trend: ((_metricByTitle$
|
|
2459
|
-
detail: ((_metricByTitle$
|
|
2460
|
+
value: kpiRoas((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 3.0),
|
|
2461
|
+
trend: ((_metricByTitle$ROAS = metricByTitle.ROAS) === null || _metricByTitle$ROAS === void 0 ? void 0 : _metricByTitle$ROAS.trend) || signed((_apiData$roasCardPrev = apiData === null || apiData === void 0 ? void 0 : apiData.roasCardPrev) !== null && _apiData$roasCardPrev !== void 0 ? _apiData$roasCardPrev : 0.4, "×"),
|
|
2462
|
+
detail: ((_metricByTitle$ROAS2 = metricByTitle.ROAS) === null || _metricByTitle$ROAS2 === void 0 ? void 0 : _metricByTitle$ROAS2.detail) || "".concat(d$((_apiData$adSpend = apiData === null || apiData === void 0 ? void 0 : apiData.adSpend) !== null && _apiData$adSpend !== void 0 ? _apiData$adSpend : 72000), " spend \xB7 ").concat(d$((_apiData$attributedRe = apiData === null || apiData === void 0 ? void 0 : apiData.attributedRevenue) !== null && _apiData$attributedRe !== void 0 ? _apiData$attributedRe : 215000), " attrib.")
|
|
2460
2463
|
}), /*#__PURE__*/jsxRuntime.jsx(KpiCard, {
|
|
2461
2464
|
title: "Conversion",
|
|
2462
|
-
value: (
|
|
2463
|
-
trend: ((_metricByTitle$
|
|
2464
|
-
detail: ((_metricByTitle$
|
|
2465
|
+
value: kpiPct(convRate),
|
|
2466
|
+
trend: ((_metricByTitle$Conver = metricByTitle.Conversion) === null || _metricByTitle$Conver === void 0 ? void 0 : _metricByTitle$Conver.trend) || signed((growth === null || growth === void 0 ? void 0 : growth.conversionRate) || 0.21, "pp"),
|
|
2467
|
+
detail: ((_metricByTitle$Conver2 = metricByTitle.Conversion) === null || _metricByTitle$Conver2 === void 0 ? void 0 : _metricByTitle$Conver2.detail) || "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits")
|
|
2465
2468
|
}), /*#__PURE__*/jsxRuntime.jsx(KpiCard, {
|
|
2466
2469
|
title: "Refund Rate",
|
|
2467
|
-
value:
|
|
2468
|
-
trend: ((_metricByTitle$
|
|
2469
|
-
detail: ((_metricByTitle$
|
|
2470
|
+
value: pct(refundRate, 2),
|
|
2471
|
+
trend: ((_metricByTitle$Refund = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund === void 0 ? void 0 : _metricByTitle$Refund.trend) || signed((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundRateChange) || -0.3, "pp"),
|
|
2472
|
+
detail: ((_metricByTitle$Refund2 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund2 === void 0 ? void 0 : _metricByTitle$Refund2.detail) || "".concat(formatNumber((_refundsRaw$refundCou = refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundCount) !== null && _refundsRaw$refundCou !== void 0 ? _refundsRaw$refundCou : 2), " refunds this period")
|
|
2470
2473
|
})]
|
|
2471
2474
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2472
2475
|
style: {
|
|
@@ -2509,7 +2512,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2509
2512
|
fontWeight: 800,
|
|
2510
2513
|
color: "#111827"
|
|
2511
2514
|
},
|
|
2512
|
-
children:
|
|
2515
|
+
children: kpi$(totalRaised)
|
|
2513
2516
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2514
2517
|
style: {
|
|
2515
2518
|
marginLeft: 8,
|