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