@ammarkhalidfarooq/dashboard-package 0.3.19 → 0.3.21

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 CHANGED
@@ -2300,7 +2300,7 @@ var NewOverview = function NewOverview(_ref) {
2300
2300
  return item.date;
2301
2301
  }) : categories;
2302
2302
  var primaryCharts = [{
2303
- label: "Total Revenue",
2303
+ label: "Total Raised",
2304
2304
  value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === "string" ? apiData.totalRevenue : "$9,200.00",
2305
2305
  subValue: "Total Donations: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalDonations) || 215),
2306
2306
  data: totalRevValues,
@@ -4798,7 +4798,7 @@ var OverallSection = function OverallSection(_ref) {
4798
4798
  "Total Raised": {
4799
4799
  value: "$".concat(formatNumber(apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedCard)) || "$240.9K",
4800
4800
  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"),
4801
- label: "Total Revenue",
4801
+ label: "Total Raised",
4802
4802
  icon: iconsMaterial.PaidOutlined
4803
4803
  },
4804
4804
  "Net Raised": {
@@ -4856,33 +4856,38 @@ var OverallSection = function OverallSection(_ref) {
4856
4856
  var mainChart = extendedCharts.find(function (c) {
4857
4857
  return c.label === selectedInfo.label;
4858
4858
  }) || primaryCharts[0];
4859
- if (activeMetric === "Total Raised" && (apiData !== null && apiData !== void 0 && apiData.paidAds || apiData !== null && apiData !== void 0 && apiData.email || apiData !== null && apiData !== void 0 && apiData.organic)) {
4860
- var categories = ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || (apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || (apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
4861
- return item.date;
4862
- });
4863
- var series = [{
4864
- name: "Paid Ads",
4865
- data: ((apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || []).map(function (item) {
4866
- return item.value;
4867
- })
4868
- }, {
4869
- name: "Organic",
4870
- data: ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || []).map(function (item) {
4871
- return item.value;
4872
- })
4873
- }, {
4874
- name: "Email",
4875
- data: ((apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
4876
- return item.value;
4877
- })
4878
- }];
4879
- mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4880
- label: "Total revenue trend",
4881
- series: series,
4882
- categories: categories,
4883
- stacked: true,
4884
- colors: ["#6366F1", "#10B981", "#06B6D4"]
4885
- });
4859
+ if (activeMetric === "Total Raised") {
4860
+ var hasStackedData = (apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || (apiData === null || apiData === void 0 ? void 0 : apiData.email) || (apiData === null || apiData === void 0 ? void 0 : apiData.organic);
4861
+ if (hasStackedData) {
4862
+ var categories = ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || (apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || (apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
4863
+ return item.date;
4864
+ });
4865
+ var series = [{
4866
+ name: "Paid Ads",
4867
+ data: ((apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || []).map(function (item) {
4868
+ return item.value;
4869
+ })
4870
+ }, {
4871
+ name: "Organic",
4872
+ data: ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || []).map(function (item) {
4873
+ return item.value;
4874
+ })
4875
+ }, {
4876
+ name: "Email",
4877
+ data: ((apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
4878
+ return item.value;
4879
+ })
4880
+ }];
4881
+ mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4882
+ label: "Total revenue trend",
4883
+ data: undefined,
4884
+ // Clear single data property to force series usage
4885
+ series: series,
4886
+ categories: categories,
4887
+ stacked: true,
4888
+ colors: ["#6366F1", "#10B981", "#06B6D4"]
4889
+ });
4890
+ }
4886
4891
  }
4887
4892
  mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4888
4893
  label: mainChart.label || activeMetric,
@@ -4909,7 +4914,8 @@ var OverallSection = function OverallSection(_ref) {
4909
4914
  index: 0,
4910
4915
  md: 12,
4911
4916
  isPremium: true,
4912
- isPrimary: true
4917
+ isPrimary: true,
4918
+ metric: activeMetric.includes("Raised") || activeMetric.includes("donation") ? "Revenue" : "Donors"
4913
4919
  })
4914
4920
  }), /*#__PURE__*/jsxRuntime.jsxs(material.Grid, {
4915
4921
  container: true,