@ammarkhalidfarooq/dashboard-package 0.4.7 → 0.4.9
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 +50 -32
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +50 -32
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2891,7 +2891,7 @@ var PerformanceSection = function PerformanceSection(_ref) {
|
|
|
2891
2891
|
});
|
|
2892
2892
|
};
|
|
2893
2893
|
|
|
2894
|
-
var data$
|
|
2894
|
+
var data$1 = [{
|
|
2895
2895
|
range: "$0 – $12",
|
|
2896
2896
|
plans: 21,
|
|
2897
2897
|
share: 24
|
|
@@ -2951,7 +2951,7 @@ var RecurringDonationAmounts = function RecurringDonationAmounts() {
|
|
|
2951
2951
|
flexDirection: "column",
|
|
2952
2952
|
gap: 2
|
|
2953
2953
|
},
|
|
2954
|
-
children: data$
|
|
2954
|
+
children: data$1.map(function (item, index) {
|
|
2955
2955
|
return /*#__PURE__*/jsxs(Box, {
|
|
2956
2956
|
sx: {
|
|
2957
2957
|
display: "flex",
|
|
@@ -3484,7 +3484,7 @@ var UTMPerformance = function UTMPerformance() {
|
|
|
3484
3484
|
});
|
|
3485
3485
|
};
|
|
3486
3486
|
|
|
3487
|
-
var data
|
|
3487
|
+
var data = [{
|
|
3488
3488
|
step: "Step 1: Amount Selection",
|
|
3489
3489
|
share: 22
|
|
3490
3490
|
}, {
|
|
@@ -3536,7 +3536,7 @@ var DropOffPoints = function DropOffPoints() {
|
|
|
3536
3536
|
flexDirection: "column",
|
|
3537
3537
|
gap: 2
|
|
3538
3538
|
},
|
|
3539
|
-
children: data
|
|
3539
|
+
children: data.map(function (item, index) {
|
|
3540
3540
|
return /*#__PURE__*/jsxs(Box, {
|
|
3541
3541
|
sx: {
|
|
3542
3542
|
display: "flex",
|
|
@@ -4525,6 +4525,19 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
|
|
|
4525
4525
|
});
|
|
4526
4526
|
};
|
|
4527
4527
|
|
|
4528
|
+
function formatNumber(num) {
|
|
4529
|
+
if (num >= 1000000000) {
|
|
4530
|
+
return (num / 1000000000).toFixed(1).replace(/\.0$/, "") + "B";
|
|
4531
|
+
}
|
|
4532
|
+
if (num >= 1000000) {
|
|
4533
|
+
return (num / 1000000).toFixed(1).replace(/\.0$/, "") + "M";
|
|
4534
|
+
}
|
|
4535
|
+
if (num >= 1000) {
|
|
4536
|
+
return (num / 1000).toFixed(1).replace(/\.0$/, "") + "K";
|
|
4537
|
+
}
|
|
4538
|
+
return (num !== null && num !== void 0 ? num : 0).toString();
|
|
4539
|
+
}
|
|
4540
|
+
|
|
4528
4541
|
var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
4529
4542
|
var _ref$title = _ref.title,
|
|
4530
4543
|
title = _ref$title === void 0 ? "Traffic source" : _ref$title,
|
|
@@ -4535,6 +4548,24 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
4535
4548
|
_ref$total = _ref.total,
|
|
4536
4549
|
total = _ref$total === void 0 ? "$240.9K" : _ref$total,
|
|
4537
4550
|
sx = _ref.sx;
|
|
4551
|
+
var paidAdsColor = "rgb(99, 99, 230)";
|
|
4552
|
+
var organicColor = "#10B981";
|
|
4553
|
+
var emailColor = "#0EA5E9";
|
|
4554
|
+
var directColor = "#94A3B8";
|
|
4555
|
+
var getSourceColor = function getSourceColor(label) {
|
|
4556
|
+
switch (label) {
|
|
4557
|
+
case "Paid Ads":
|
|
4558
|
+
return paidAdsColor;
|
|
4559
|
+
case "Organic":
|
|
4560
|
+
return organicColor;
|
|
4561
|
+
case "Email":
|
|
4562
|
+
return emailColor;
|
|
4563
|
+
case "Direct":
|
|
4564
|
+
return directColor;
|
|
4565
|
+
default:
|
|
4566
|
+
return "#CBD5E1";
|
|
4567
|
+
}
|
|
4568
|
+
};
|
|
4538
4569
|
return /*#__PURE__*/jsxs(Card, {
|
|
4539
4570
|
sx: _objectSpread2({
|
|
4540
4571
|
p: 3,
|
|
@@ -4614,7 +4645,7 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
4614
4645
|
gap: 2,
|
|
4615
4646
|
py: 1.5,
|
|
4616
4647
|
alignItems: "center",
|
|
4617
|
-
borderBottom: index ===
|
|
4648
|
+
borderBottom: index === trafficSourceData.length - 1 ? "none" : "1px solid #f5f5f5"
|
|
4618
4649
|
},
|
|
4619
4650
|
children: [/*#__PURE__*/jsxs(Box, {
|
|
4620
4651
|
sx: {
|
|
@@ -4626,7 +4657,7 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
4626
4657
|
sx: {
|
|
4627
4658
|
width: 10,
|
|
4628
4659
|
height: 10,
|
|
4629
|
-
bgcolor: item.
|
|
4660
|
+
bgcolor: getSourceColor(item.label),
|
|
4630
4661
|
borderRadius: "2px"
|
|
4631
4662
|
}
|
|
4632
4663
|
}), /*#__PURE__*/jsx(Typography, {
|
|
@@ -4665,7 +4696,7 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
4665
4696
|
bgcolor: "#F3F4F6",
|
|
4666
4697
|
"& .MuiLinearProgress-bar": {
|
|
4667
4698
|
borderRadius: 3,
|
|
4668
|
-
bgcolor: item.
|
|
4699
|
+
bgcolor: getSourceColor(item.label)
|
|
4669
4700
|
}
|
|
4670
4701
|
}
|
|
4671
4702
|
})
|
|
@@ -5123,19 +5154,6 @@ var MetricDonutCard = function MetricDonutCard(_ref) {
|
|
|
5123
5154
|
});
|
|
5124
5155
|
};
|
|
5125
5156
|
|
|
5126
|
-
function formatNumber$1(num) {
|
|
5127
|
-
if (num >= 1000000000) {
|
|
5128
|
-
return (num / 1000000000).toFixed(1).replace(/\.0$/, "") + "B";
|
|
5129
|
-
}
|
|
5130
|
-
if (num >= 1000000) {
|
|
5131
|
-
return (num / 1000000).toFixed(1).replace(/\.0$/, "") + "M";
|
|
5132
|
-
}
|
|
5133
|
-
if (num >= 1000) {
|
|
5134
|
-
return (num / 1000).toFixed(1).replace(/\.0$/, "") + "K";
|
|
5135
|
-
}
|
|
5136
|
-
return (num !== null && num !== void 0 ? num : 0).toString();
|
|
5137
|
-
}
|
|
5138
|
-
|
|
5139
5157
|
var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
5140
5158
|
var _donationTypeData$sum, _donationTypeData$sum2, _donationTypeData$sum3, _donationTypeData$sum4, _donationTypeData$sum5, _donationTypeData$sum6;
|
|
5141
5159
|
var sx = _ref.sx,
|
|
@@ -5168,7 +5186,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5168
5186
|
dataLabels: {
|
|
5169
5187
|
enabled: true,
|
|
5170
5188
|
formatter: function formatter(val) {
|
|
5171
|
-
return "$".concat(formatNumber
|
|
5189
|
+
return "$".concat(formatNumber(val));
|
|
5172
5190
|
},
|
|
5173
5191
|
offsetY: -22,
|
|
5174
5192
|
style: {
|
|
@@ -5202,7 +5220,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5202
5220
|
tickAmount: 4,
|
|
5203
5221
|
labels: {
|
|
5204
5222
|
formatter: function formatter(val) {
|
|
5205
|
-
return "$".concat(formatNumber
|
|
5223
|
+
return "$".concat(formatNumber(val));
|
|
5206
5224
|
},
|
|
5207
5225
|
style: {
|
|
5208
5226
|
colors: "rgba(0, 0, 0, 0.4)",
|
|
@@ -5233,7 +5251,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5233
5251
|
tooltip: {
|
|
5234
5252
|
y: {
|
|
5235
5253
|
formatter: function formatter(val) {
|
|
5236
|
-
return "$".concat(formatNumber
|
|
5254
|
+
return "$".concat(formatNumber(val));
|
|
5237
5255
|
}
|
|
5238
5256
|
}
|
|
5239
5257
|
}
|
|
@@ -5305,7 +5323,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5305
5323
|
fontWeight: 600,
|
|
5306
5324
|
color: "#000"
|
|
5307
5325
|
},
|
|
5308
|
-
children: ["$", formatNumber
|
|
5326
|
+
children: ["$", formatNumber((donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum4 = donationTypeData.summary) === null || _donationTypeData$sum4 === void 0 || (_donationTypeData$sum4 = _donationTypeData$sum4.recurring) === null || _donationTypeData$sum4 === void 0 ? void 0 : _donationTypeData$sum4.total) || 0)]
|
|
5309
5327
|
})]
|
|
5310
5328
|
}), /*#__PURE__*/jsxs(Box, {
|
|
5311
5329
|
sx: {
|
|
@@ -5333,7 +5351,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5333
5351
|
fontWeight: 600,
|
|
5334
5352
|
color: "#000"
|
|
5335
5353
|
},
|
|
5336
|
-
children: ["$", formatNumber
|
|
5354
|
+
children: ["$", formatNumber((donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum6 = donationTypeData.summary) === null || _donationTypeData$sum6 === void 0 || (_donationTypeData$sum6 = _donationTypeData$sum6.oneTime) === null || _donationTypeData$sum6 === void 0 ? void 0 : _donationTypeData$sum6.total) || 0)]
|
|
5337
5355
|
})]
|
|
5338
5356
|
})]
|
|
5339
5357
|
})]
|
|
@@ -5695,13 +5713,13 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5695
5713
|
};
|
|
5696
5714
|
var metricInfo = {
|
|
5697
5715
|
"Total Raised": {
|
|
5698
|
-
value: "$".concat(formatNumber
|
|
5716
|
+
value: "$".concat(formatNumber(apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedCard)) || "$240.9K",
|
|
5699
5717
|
subValue: "".concat(Number((_apiData$totalRaisedP = apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedPrev) !== null && _apiData$totalRaisedP !== void 0 ? _apiData$totalRaisedP : 0).toFixed(2), "% vs ").concat(dateName || "last month"),
|
|
5700
5718
|
label: "Total Raised",
|
|
5701
5719
|
icon: PaidOutlined
|
|
5702
5720
|
},
|
|
5703
5721
|
"Net Raised": {
|
|
5704
|
-
value: "$".concat(formatNumber
|
|
5722
|
+
value: "$".concat(formatNumber((_apiData$netRaisedCar = apiData === null || apiData === void 0 ? void 0 : apiData.netRaisedCard) !== null && _apiData$netRaisedCar !== void 0 ? _apiData$netRaisedCar : 0)),
|
|
5705
5723
|
subValue: "".concat(Number((_apiData$netRaisedPre = apiData === null || apiData === void 0 ? void 0 : apiData.netRaisedPrev) !== null && _apiData$netRaisedPre !== void 0 ? _apiData$netRaisedPre : 0).toFixed(2), "% vs ").concat(dateName !== null && dateName !== void 0 ? dateName : "previous period"),
|
|
5706
5724
|
label: "Net Raised",
|
|
5707
5725
|
icon: FavoriteOutlined
|
|
@@ -5713,13 +5731,13 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5713
5731
|
icon: PeopleAltOutlined
|
|
5714
5732
|
},
|
|
5715
5733
|
"Avg donation": {
|
|
5716
|
-
value: "$".concat(formatNumber
|
|
5734
|
+
value: "$".concat(formatNumber((_apiData$averageDonat = apiData === null || apiData === void 0 ? void 0 : apiData.averageDonationsCard) !== null && _apiData$averageDonat !== void 0 ? _apiData$averageDonat : 0)),
|
|
5717
5735
|
subValue: "".concat(Number((_apiData$averageDonat2 = apiData === null || apiData === void 0 ? void 0 : apiData.averageDonationsCardPrev) !== null && _apiData$averageDonat2 !== void 0 ? _apiData$averageDonat2 : 0).toFixed(2), "% vs ").concat(dateName !== null && dateName !== void 0 ? dateName : "last month"),
|
|
5718
5736
|
label: "Average Donation Amount",
|
|
5719
5737
|
icon: PaidOutlined
|
|
5720
5738
|
},
|
|
5721
5739
|
"ROAS": {
|
|
5722
|
-
value: "".concat(formatNumber
|
|
5740
|
+
value: "".concat(formatNumber((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 0), "x"),
|
|
5723
5741
|
subValue: "".concat(Number((_apiData$roasCardPrev = apiData === null || apiData === void 0 ? void 0 : apiData.roasCardPrev) !== null && _apiData$roasCardPrev !== void 0 ? _apiData$roasCardPrev : 0).toFixed(2), "x vs ").concat(dateName !== null && dateName !== void 0 ? dateName : "last month"),
|
|
5724
5742
|
label: "ROAS",
|
|
5725
5743
|
icon: TrendingUp
|
|
@@ -6082,11 +6100,11 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
6082
6100
|
return word[0];
|
|
6083
6101
|
}).join("").toUpperCase().slice(0, 2) : "??",
|
|
6084
6102
|
name: campaign.campaignName || "Untitled Campaign",
|
|
6085
|
-
val1: "$".concat(formatNumber
|
|
6103
|
+
val1: "$".concat(formatNumber(campaign.raisedAmount || 0)),
|
|
6086
6104
|
type: "progress",
|
|
6087
6105
|
progress: Math.round((campaign.raisedAmount || 0) / (campaign.totalAmount || 1) * 100),
|
|
6088
|
-
val3: formatNumber
|
|
6089
|
-
val4: "$".concat(formatNumber
|
|
6106
|
+
val3: formatNumber(campaign.donors || 0),
|
|
6107
|
+
val4: "$".concat(formatNumber(campaign.avgGift || 0))
|
|
6090
6108
|
};
|
|
6091
6109
|
})
|
|
6092
6110
|
})
|