@ammarkhalidfarooq/dashboard-package 0.6.59 → 0.6.61
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 +171 -92
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +171 -92
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1358,6 +1358,59 @@ var trendPillSx = function trendPillSx(value) {
|
|
|
1358
1358
|
whiteSpace: "nowrap"
|
|
1359
1359
|
};
|
|
1360
1360
|
};
|
|
1361
|
+
|
|
1362
|
+
/** Mirrors DonationTypeBarChart summary totals from recurringBarChartData. */
|
|
1363
|
+
var parseDonationTypeTotals = function parseDonationTypeTotals(donationTypeData) {
|
|
1364
|
+
var _dataObj$summary$recu, _dataObj$summary, _dataObj$summary$oneT, _dataObj$summary2;
|
|
1365
|
+
if (donationTypeData !== null && donationTypeData !== void 0 && donationTypeData.data && Array.isArray(donationTypeData.data)) {
|
|
1366
|
+
var _donationTypeData$tot, _donationTypeData$tot2;
|
|
1367
|
+
return {
|
|
1368
|
+
recurringTotal: Number((_donationTypeData$tot = donationTypeData.totalRecurringDonations) !== null && _donationTypeData$tot !== void 0 ? _donationTypeData$tot : 0),
|
|
1369
|
+
oneTimeTotal: Number((_donationTypeData$tot2 = donationTypeData.totalOneTimeDonations) !== null && _donationTypeData$tot2 !== void 0 ? _donationTypeData$tot2 : 0)
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
if (Array.isArray(donationTypeData) && donationTypeData.length > 0 && donationTypeData[0].totalAmount !== undefined) {
|
|
1373
|
+
var _recurring$totalAmoun, _oneTime$totalAmount;
|
|
1374
|
+
var recurring = donationTypeData.find(function (item) {
|
|
1375
|
+
return /recurring/i.test(item.type || "");
|
|
1376
|
+
}) || {};
|
|
1377
|
+
var oneTime = donationTypeData.find(function (item) {
|
|
1378
|
+
return /one.?time/i.test(item.type || "");
|
|
1379
|
+
}) || {};
|
|
1380
|
+
return {
|
|
1381
|
+
recurringTotal: Number((_recurring$totalAmoun = recurring.totalAmount) !== null && _recurring$totalAmoun !== void 0 ? _recurring$totalAmoun : 0),
|
|
1382
|
+
oneTimeTotal: Number((_oneTime$totalAmount = oneTime.totalAmount) !== null && _oneTime$totalAmount !== void 0 ? _oneTime$totalAmount : 0)
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
if (Array.isArray(donationTypeData) && donationTypeData.length > 0 && (donationTypeData[0].recurring !== undefined || donationTypeData[0].oneTime !== undefined || donationTypeData[0].recurringAmount !== undefined || donationTypeData[0].oneTimeAmount !== undefined)) {
|
|
1386
|
+
return {
|
|
1387
|
+
recurringTotal: donationTypeData.reduce(function (sum, item) {
|
|
1388
|
+
return sum + Number(item.recurring || item.recurringAmount || 0);
|
|
1389
|
+
}, 0),
|
|
1390
|
+
oneTimeTotal: donationTypeData.reduce(function (sum, item) {
|
|
1391
|
+
return sum + Number(item.oneTime || item.oneTimeAmount || 0);
|
|
1392
|
+
}, 0)
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
var dataObj = donationTypeData && _typeof(donationTypeData) === "object" ? donationTypeData : {};
|
|
1396
|
+
return {
|
|
1397
|
+
recurringTotal: Number((_dataObj$summary$recu = 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.total) !== null && _dataObj$summary$recu !== void 0 ? _dataObj$summary$recu : 0),
|
|
1398
|
+
oneTimeTotal: Number((_dataObj$summary$oneT = dataObj === null || dataObj === void 0 || (_dataObj$summary2 = dataObj.summary) === null || _dataObj$summary2 === void 0 || (_dataObj$summary2 = _dataObj$summary2.oneTime) === null || _dataObj$summary2 === void 0 ? void 0 : _dataObj$summary2.total) !== null && _dataObj$summary$oneT !== void 0 ? _dataObj$summary$oneT : 0)
|
|
1399
|
+
};
|
|
1400
|
+
};
|
|
1401
|
+
|
|
1402
|
+
/** Mirrors PaidDonorGeographyCard row mapping from donorGeography. */
|
|
1403
|
+
var parseDonorGeographyList = function parseDonorGeographyList(donorGeographyData) {
|
|
1404
|
+
var rawCountries = Array.isArray(donorGeographyData) ? donorGeographyData : (donorGeographyData === null || donorGeographyData === void 0 ? void 0 : donorGeographyData.countries) || (donorGeographyData === null || donorGeographyData === void 0 ? void 0 : donorGeographyData.data) || [];
|
|
1405
|
+
return rawCountries.map(function (item) {
|
|
1406
|
+
var _item$percentage, _ref, _ref2, _item$value;
|
|
1407
|
+
return {
|
|
1408
|
+
country: item.countryName || item.country || item.name || "Unknown",
|
|
1409
|
+
percentage: typeof item.percentage === "number" ? item.percentage : Number((_item$percentage = item.percentage) !== null && _item$percentage !== void 0 ? _item$percentage : 0),
|
|
1410
|
+
value: item.donations !== undefined ? item.donations : (_ref = (_ref2 = (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.totalDonors) !== null && _ref2 !== void 0 ? _ref2 : item.donors) !== null && _ref !== void 0 ? _ref : 0
|
|
1411
|
+
};
|
|
1412
|
+
});
|
|
1413
|
+
};
|
|
1361
1414
|
var getActiveFilterChips = function getActiveFilterChips(apiData) {
|
|
1362
1415
|
if (Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.activeFilterChips) && apiData.activeFilterChips.length) {
|
|
1363
1416
|
return apiData.activeFilterChips;
|
|
@@ -1569,7 +1622,9 @@ var buildReportData = function buildReportData() {
|
|
|
1569
1622
|
},
|
|
1570
1623
|
activeCampaigns: activeCampaigns,
|
|
1571
1624
|
donationTypeData: (apiData === null || apiData === void 0 ? void 0 : apiData.recurringBarChartData) || [],
|
|
1625
|
+
donationTypeTotals: parseDonationTypeTotals(apiData === null || apiData === void 0 ? void 0 : apiData.recurringBarChartData),
|
|
1572
1626
|
donorGeographyData: (apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography) || [],
|
|
1627
|
+
donorGeographyList: parseDonorGeographyList(apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography),
|
|
1573
1628
|
trafficSourceData: (apiData === null || apiData === void 0 ? void 0 : apiData.trafficSourceData) || [],
|
|
1574
1629
|
orderBumpData: (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpDetails) || [],
|
|
1575
1630
|
upsellData: (apiData === null || apiData === void 0 ? void 0 : apiData.upSellDetails) || {},
|
|
@@ -1973,7 +2028,9 @@ var MiniTable = function MiniTable(_ref8) {
|
|
|
1973
2028
|
var _ref8$head = _ref8.head,
|
|
1974
2029
|
head = _ref8$head === void 0 ? [] : _ref8$head,
|
|
1975
2030
|
_ref8$rows = _ref8.rows,
|
|
1976
|
-
rows = _ref8$rows === void 0 ? [] : _ref8$rows
|
|
2031
|
+
rows = _ref8$rows === void 0 ? [] : _ref8$rows,
|
|
2032
|
+
_ref8$colAlign = _ref8.colAlign,
|
|
2033
|
+
colAlign = _ref8$colAlign === void 0 ? [] : _ref8$colAlign;
|
|
1977
2034
|
return /*#__PURE__*/jsxRuntime.jsxs("table", {
|
|
1978
2035
|
style: {
|
|
1979
2036
|
width: "100%",
|
|
@@ -1991,7 +2048,7 @@ var MiniTable = function MiniTable(_ref8) {
|
|
|
1991
2048
|
return /*#__PURE__*/jsxRuntime.jsx("th", {
|
|
1992
2049
|
style: {
|
|
1993
2050
|
padding: "4px 6px",
|
|
1994
|
-
textAlign: i === 0 ? "left" : "right",
|
|
2051
|
+
textAlign: colAlign[i] || (i === 0 ? "left" : "right"),
|
|
1995
2052
|
fontWeight: 700,
|
|
1996
2053
|
fontSize: 8.5,
|
|
1997
2054
|
letterSpacing: "0.3px",
|
|
@@ -2012,9 +2069,10 @@ var MiniTable = function MiniTable(_ref8) {
|
|
|
2012
2069
|
return /*#__PURE__*/jsxRuntime.jsx("td", {
|
|
2013
2070
|
style: {
|
|
2014
2071
|
padding: "4px 6px",
|
|
2015
|
-
textAlign: ci === 0 ? "left" : "right",
|
|
2072
|
+
textAlign: colAlign[ci] || (ci === 0 ? "left" : "right"),
|
|
2016
2073
|
color: "#334155",
|
|
2017
|
-
borderBottom: ri < rows.length - 1 ? "1px solid #EEF2F7" : "none"
|
|
2074
|
+
borderBottom: ri < rows.length - 1 ? "1px solid #EEF2F7" : "none",
|
|
2075
|
+
verticalAlign: "middle"
|
|
2018
2076
|
},
|
|
2019
2077
|
children: cell
|
|
2020
2078
|
}, ci);
|
|
@@ -2024,15 +2082,63 @@ var MiniTable = function MiniTable(_ref8) {
|
|
|
2024
2082
|
})]
|
|
2025
2083
|
});
|
|
2026
2084
|
};
|
|
2027
|
-
var
|
|
2028
|
-
var
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
_ref9$
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2085
|
+
var ProgressBar = function ProgressBar(_ref9) {
|
|
2086
|
+
var value = _ref9.value,
|
|
2087
|
+
_ref9$color = _ref9.color,
|
|
2088
|
+
color = _ref9$color === void 0 ? "rgb(99, 99, 230)" : _ref9$color,
|
|
2089
|
+
_ref9$height = _ref9.height,
|
|
2090
|
+
height = _ref9$height === void 0 ? 6 : _ref9$height;
|
|
2091
|
+
var pct = Math.max(0, Number(value !== null && value !== void 0 ? value : 0));
|
|
2092
|
+
var barWidth = Math.min(100, pct);
|
|
2093
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2094
|
+
style: {
|
|
2095
|
+
display: "flex",
|
|
2096
|
+
alignItems: "center",
|
|
2097
|
+
gap: 6,
|
|
2098
|
+
width: "100%"
|
|
2099
|
+
},
|
|
2100
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2101
|
+
style: {
|
|
2102
|
+
flex: 1,
|
|
2103
|
+
minWidth: 0
|
|
2104
|
+
},
|
|
2105
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2106
|
+
style: {
|
|
2107
|
+
height: height,
|
|
2108
|
+
background: "#F3F4F6",
|
|
2109
|
+
borderRadius: 4,
|
|
2110
|
+
overflow: "hidden"
|
|
2111
|
+
},
|
|
2112
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2113
|
+
style: {
|
|
2114
|
+
width: "".concat(barWidth, "%"),
|
|
2115
|
+
height: "100%",
|
|
2116
|
+
background: color,
|
|
2117
|
+
borderRadius: 4
|
|
2118
|
+
}
|
|
2119
|
+
})
|
|
2120
|
+
})
|
|
2121
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2122
|
+
style: {
|
|
2123
|
+
fontSize: 9,
|
|
2124
|
+
color: "rgba(0, 0, 0, 0.4)",
|
|
2125
|
+
minWidth: 26,
|
|
2126
|
+
flexShrink: 0,
|
|
2127
|
+
textAlign: "right"
|
|
2128
|
+
},
|
|
2129
|
+
children: [pct, "%"]
|
|
2130
|
+
})]
|
|
2131
|
+
});
|
|
2132
|
+
};
|
|
2133
|
+
var KpiCard = function KpiCard(_ref0) {
|
|
2134
|
+
var title = _ref0.title,
|
|
2135
|
+
value = _ref0.value,
|
|
2136
|
+
trend = _ref0.trend,
|
|
2137
|
+
detail = _ref0.detail,
|
|
2138
|
+
_ref0$variant = _ref0.variant,
|
|
2139
|
+
variant = _ref0$variant === void 0 ? "secondary" : _ref0$variant,
|
|
2140
|
+
_ref0$trendPositiveWh = _ref0.trendPositiveWhenNegative,
|
|
2141
|
+
trendPositiveWhenNegative = _ref0$trendPositiveWh === void 0 ? false : _ref0$trendPositiveWh;
|
|
2036
2142
|
var displayTrend = withTrendArrow(trend);
|
|
2037
2143
|
var isPrimary = variant === "primary";
|
|
2038
2144
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -2083,10 +2189,10 @@ var KpiCard = function KpiCard(_ref9) {
|
|
|
2083
2189
|
})]
|
|
2084
2190
|
});
|
|
2085
2191
|
};
|
|
2086
|
-
var StatPair = function StatPair(
|
|
2087
|
-
var label =
|
|
2088
|
-
val =
|
|
2089
|
-
trend =
|
|
2192
|
+
var StatPair = function StatPair(_ref1) {
|
|
2193
|
+
var label = _ref1.label,
|
|
2194
|
+
val = _ref1.val,
|
|
2195
|
+
trend = _ref1.trend;
|
|
2090
2196
|
var displayTrend = withTrendArrow(trend);
|
|
2091
2197
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2092
2198
|
style: {
|
|
@@ -2123,12 +2229,12 @@ var StatPair = function StatPair(_ref0) {
|
|
|
2123
2229
|
})]
|
|
2124
2230
|
});
|
|
2125
2231
|
};
|
|
2126
|
-
var PageHeader = function PageHeader(
|
|
2127
|
-
var dateLabel =
|
|
2128
|
-
generatedLabel =
|
|
2129
|
-
activeFilters =
|
|
2130
|
-
page =
|
|
2131
|
-
windowLabel =
|
|
2232
|
+
var PageHeader = function PageHeader(_ref10) {
|
|
2233
|
+
var dateLabel = _ref10.dateLabel,
|
|
2234
|
+
generatedLabel = _ref10.generatedLabel,
|
|
2235
|
+
activeFilters = _ref10.activeFilters,
|
|
2236
|
+
page = _ref10.page,
|
|
2237
|
+
windowLabel = _ref10.windowLabel;
|
|
2132
2238
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2133
2239
|
style: {
|
|
2134
2240
|
padding: "22px ".concat(MX, "px 12px"),
|
|
@@ -2234,9 +2340,9 @@ var PageHeader = function PageHeader(_ref1) {
|
|
|
2234
2340
|
})]
|
|
2235
2341
|
});
|
|
2236
2342
|
};
|
|
2237
|
-
var PageFooter = function PageFooter(
|
|
2238
|
-
var generatedLabel =
|
|
2239
|
-
page =
|
|
2343
|
+
var PageFooter = function PageFooter(_ref11) {
|
|
2344
|
+
var generatedLabel = _ref11.generatedLabel,
|
|
2345
|
+
page = _ref11.page;
|
|
2240
2346
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2241
2347
|
style: {
|
|
2242
2348
|
padding: "7px ".concat(MX, "px"),
|
|
@@ -2256,16 +2362,16 @@ var PageFooter = function PageFooter(_ref10) {
|
|
|
2256
2362
|
};
|
|
2257
2363
|
|
|
2258
2364
|
// ─── Main component ───────────────────────────────────────────────────────────
|
|
2259
|
-
var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (
|
|
2260
|
-
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,
|
|
2261
|
-
var
|
|
2262
|
-
apiData =
|
|
2263
|
-
|
|
2264
|
-
dateName =
|
|
2265
|
-
|
|
2266
|
-
numberOfDays =
|
|
2267
|
-
|
|
2268
|
-
activeFilters =
|
|
2365
|
+
var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref12, ref) {
|
|
2366
|
+
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, _ref15, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _refCard$growthPercen;
|
|
2367
|
+
var _ref12$apiData = _ref12.apiData,
|
|
2368
|
+
apiData = _ref12$apiData === void 0 ? {} : _ref12$apiData,
|
|
2369
|
+
_ref12$dateName = _ref12.dateName,
|
|
2370
|
+
dateName = _ref12$dateName === void 0 ? "Last Period" : _ref12$dateName,
|
|
2371
|
+
_ref12$numberOfDays = _ref12.numberOfDays,
|
|
2372
|
+
numberOfDays = _ref12$numberOfDays === void 0 ? 30 : _ref12$numberOfDays,
|
|
2373
|
+
_ref12$activeFilters = _ref12.activeFilters,
|
|
2374
|
+
activeFilters = _ref12$activeFilters === void 0 ? [] : _ref12$activeFilters;
|
|
2269
2375
|
var now = new Date();
|
|
2270
2376
|
var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
|
|
2271
2377
|
var windowLabel = "".concat(numberOfDays, "-day window");
|
|
@@ -2320,7 +2426,8 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
2320
2426
|
mainChart = report.mainChart,
|
|
2321
2427
|
growth = report.growth,
|
|
2322
2428
|
totalDonors = report.totalDonors,
|
|
2323
|
-
donorMix = report.donorMix
|
|
2429
|
+
donorMix = report.donorMix,
|
|
2430
|
+
activeCampaigns = report.activeCampaigns;
|
|
2324
2431
|
var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
|
|
2325
2432
|
var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 240938);
|
|
2326
2433
|
var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 222300);
|
|
@@ -2338,43 +2445,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
2338
2445
|
retPct = donorMix.retPct,
|
|
2339
2446
|
mixAvgGift = donorMix.avgGift,
|
|
2340
2447
|
donorMixPrev = donorMix.donorMixPrev;
|
|
2341
|
-
var
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
var oneTimeTotal = recData.length ? recData.reduce(function (s, i) {
|
|
2346
|
-
return s + Number(i.oneTime || i.oneTimeAmount || 0);
|
|
2347
|
-
}, 0) : 188001;
|
|
2348
|
-
var geoRaw = apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography;
|
|
2349
|
-
var geoList = function () {
|
|
2350
|
-
var raw = Array.isArray(geoRaw) ? geoRaw : Array.isArray(geoRaw === null || geoRaw === void 0 ? void 0 : geoRaw.data) ? geoRaw.data : [];
|
|
2351
|
-
if (raw.length) return raw;
|
|
2352
|
-
return [{
|
|
2353
|
-
country: "United States",
|
|
2354
|
-
totalDonors: 78,
|
|
2355
|
-
percentage: 36
|
|
2356
|
-
}, {
|
|
2357
|
-
country: "United Kingdom",
|
|
2358
|
-
totalDonors: 42,
|
|
2359
|
-
percentage: 20
|
|
2360
|
-
}, {
|
|
2361
|
-
country: "Canada",
|
|
2362
|
-
totalDonors: 28,
|
|
2363
|
-
percentage: 13
|
|
2364
|
-
}, {
|
|
2365
|
-
country: "UAE",
|
|
2366
|
-
totalDonors: 24,
|
|
2367
|
-
percentage: 11
|
|
2368
|
-
}, {
|
|
2369
|
-
country: "Saudi Arabia",
|
|
2370
|
-
totalDonors: 19,
|
|
2371
|
-
percentage: 9
|
|
2372
|
-
}, {
|
|
2373
|
-
country: "Other",
|
|
2374
|
-
totalDonors: 24,
|
|
2375
|
-
percentage: 11
|
|
2376
|
-
}];
|
|
2377
|
-
}();
|
|
2448
|
+
var _report$donationTypeT = report.donationTypeTotals,
|
|
2449
|
+
recurringTotal = _report$donationTypeT.recurringTotal,
|
|
2450
|
+
oneTimeTotal = _report$donationTypeT.oneTimeTotal;
|
|
2451
|
+
var geoList = report.donorGeographyList;
|
|
2378
2452
|
var trafficItems = function (_apiData$trafficSourc) {
|
|
2379
2453
|
var items = Array.isArray(apiData === null || apiData === void 0 || (_apiData$trafficSourc = apiData.trafficSourceData) === null || _apiData$trafficSourc === void 0 ? void 0 : _apiData$trafficSourc.data) ? apiData.trafficSourceData.data : [];
|
|
2380
2454
|
if (items.length) return items;
|
|
@@ -2444,6 +2518,9 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
2444
2518
|
averageDonation: 1940,
|
|
2445
2519
|
status: "Active"
|
|
2446
2520
|
}];
|
|
2521
|
+
var campaignStatusByIndex = campaigns.map(function (c) {
|
|
2522
|
+
return c.status || "Active";
|
|
2523
|
+
});
|
|
2447
2524
|
var ob = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpDetails) || {};
|
|
2448
2525
|
var obData = ((ob === null || ob === void 0 ? void 0 : ob.chart) || []).map(function (i) {
|
|
2449
2526
|
return Number(i.revenue || 0);
|
|
@@ -2606,10 +2683,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
2606
2683
|
gap: 14,
|
|
2607
2684
|
marginBottom: 6
|
|
2608
2685
|
},
|
|
2609
|
-
children: [["Email", C.cyan], ["Organic", C.emerald], ["Paid Ads", C.indigo]].map(function (
|
|
2610
|
-
var
|
|
2611
|
-
name =
|
|
2612
|
-
color =
|
|
2686
|
+
children: [["Email", C.cyan], ["Organic", C.emerald], ["Paid Ads", C.indigo]].map(function (_ref13) {
|
|
2687
|
+
var _ref14 = _slicedToArray(_ref13, 2),
|
|
2688
|
+
name = _ref14[0],
|
|
2689
|
+
color = _ref14[1];
|
|
2613
2690
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2614
2691
|
style: {
|
|
2615
2692
|
display: "flex",
|
|
@@ -2673,11 +2750,13 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
2673
2750
|
children: [/*#__PURE__*/jsxRuntime.jsx(Panel, {
|
|
2674
2751
|
title: "Active campaigns",
|
|
2675
2752
|
subtitle: "Live fundraisers ranked by velocity",
|
|
2676
|
-
action: "View all \u2192",
|
|
2677
2753
|
children: /*#__PURE__*/jsxRuntime.jsx(MiniTable, {
|
|
2678
2754
|
head: ["CAMPAIGN", "RAISED", "PROGRESS", "DONORS", "AVG GIFT", "STATUS"],
|
|
2679
|
-
|
|
2680
|
-
|
|
2755
|
+
colAlign: ["left", "right", "left", "right", "right", "right"],
|
|
2756
|
+
rows: activeCampaigns.map(function (c, i) {
|
|
2757
|
+
return [c.name, c.val1, /*#__PURE__*/jsxRuntime.jsx(ProgressBar, {
|
|
2758
|
+
value: c.progress
|
|
2759
|
+
}, "campaign-progress-".concat(i)), c.val3, c.val4, campaignStatusByIndex[i] || "Active"];
|
|
2681
2760
|
})
|
|
2682
2761
|
})
|
|
2683
2762
|
}), /*#__PURE__*/jsxRuntime.jsx(Panel, {
|
|
@@ -2772,7 +2851,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
2772
2851
|
style: {
|
|
2773
2852
|
fontSize: 9
|
|
2774
2853
|
},
|
|
2775
|
-
children: "".concat(Number((
|
|
2854
|
+
children: "".concat(Number((_ref15 = donorMixPrev !== null && donorMixPrev !== void 0 ? donorMixPrev : growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _ref15 !== void 0 ? _ref15 : 0).toFixed(2), "% vs pp")
|
|
2776
2855
|
})
|
|
2777
2856
|
})]
|
|
2778
2857
|
})]
|
|
@@ -2889,13 +2968,13 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
2889
2968
|
fontSize: 9,
|
|
2890
2969
|
color: "#374151"
|
|
2891
2970
|
},
|
|
2892
|
-
children: g.country
|
|
2971
|
+
children: g.country
|
|
2893
2972
|
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2894
2973
|
style: {
|
|
2895
2974
|
fontSize: 9,
|
|
2896
2975
|
color: "#6B7280"
|
|
2897
2976
|
},
|
|
2898
|
-
children: [formatNumber(g.
|
|
2977
|
+
children: [formatNumber(g.value), " \xB7 ", formatNumber(g.percentage), "%"]
|
|
2899
2978
|
})]
|
|
2900
2979
|
}, i);
|
|
2901
2980
|
})
|
|
@@ -3028,10 +3107,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
3028
3107
|
display: "flex",
|
|
3029
3108
|
gap: 12
|
|
3030
3109
|
},
|
|
3031
|
-
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 (
|
|
3032
|
-
var
|
|
3033
|
-
l =
|
|
3034
|
-
v =
|
|
3110
|
+
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 (_ref16) {
|
|
3111
|
+
var _ref17 = _slicedToArray(_ref16, 2),
|
|
3112
|
+
l = _ref17[0],
|
|
3113
|
+
v = _ref17[1];
|
|
3035
3114
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3036
3115
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3037
3116
|
style: {
|
|
@@ -3158,10 +3237,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
|
|
|
3158
3237
|
display: "flex",
|
|
3159
3238
|
gap: 12
|
|
3160
3239
|
},
|
|
3161
|
-
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 (
|
|
3162
|
-
var
|
|
3163
|
-
l =
|
|
3164
|
-
v =
|
|
3240
|
+
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 (_ref18) {
|
|
3241
|
+
var _ref19 = _slicedToArray(_ref18, 2),
|
|
3242
|
+
l = _ref19[0],
|
|
3243
|
+
v = _ref19[1];
|
|
3165
3244
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3166
3245
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3167
3246
|
style: {
|