@ammarkhalidfarooq/dashboard-package 0.4.9 → 0.4.11
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 +52 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +52 -17
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4708,7 +4708,7 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
4708
4708
|
minWidth: "30px",
|
|
4709
4709
|
textAlign: "right"
|
|
4710
4710
|
},
|
|
4711
|
-
children: [(_item$share = item.share) === null || _item$share === void 0 ? void 0 : _item$share.toFixed(
|
|
4711
|
+
children: [(_item$share = item.share) === null || _item$share === void 0 ? void 0 : _item$share.toFixed(0), "%"]
|
|
4712
4712
|
})]
|
|
4713
4713
|
})]
|
|
4714
4714
|
}, index);
|
|
@@ -4754,6 +4754,18 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
|
|
|
4754
4754
|
chartColor = _ref$chartColor === void 0 ? "rgb(99, 99, 230)" : _ref$chartColor,
|
|
4755
4755
|
_ref$footerMetrics = _ref.footerMetrics,
|
|
4756
4756
|
footerMetrics = _ref$footerMetrics === void 0 ? [] : _ref$footerMetrics;
|
|
4757
|
+
// Extract values for chart series
|
|
4758
|
+
var series = [{
|
|
4759
|
+
name: title,
|
|
4760
|
+
data: chartData.map(function (item) {
|
|
4761
|
+
return item.value;
|
|
4762
|
+
})
|
|
4763
|
+
}];
|
|
4764
|
+
|
|
4765
|
+
// Extract labels for x-axis
|
|
4766
|
+
var categories = chartData.map(function (item) {
|
|
4767
|
+
return item.label;
|
|
4768
|
+
});
|
|
4757
4769
|
var chartOptions = {
|
|
4758
4770
|
chart: {
|
|
4759
4771
|
type: "area",
|
|
@@ -4762,6 +4774,15 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
|
|
|
4762
4774
|
},
|
|
4763
4775
|
animations: {
|
|
4764
4776
|
enabled: true
|
|
4777
|
+
},
|
|
4778
|
+
toolbar: {
|
|
4779
|
+
show: false
|
|
4780
|
+
}
|
|
4781
|
+
},
|
|
4782
|
+
xaxis: {
|
|
4783
|
+
categories: categories,
|
|
4784
|
+
labels: {
|
|
4785
|
+
show: false
|
|
4765
4786
|
}
|
|
4766
4787
|
},
|
|
4767
4788
|
stroke: {
|
|
@@ -4782,17 +4803,21 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
|
|
|
4782
4803
|
enabled: true,
|
|
4783
4804
|
theme: "light",
|
|
4784
4805
|
x: {
|
|
4785
|
-
show:
|
|
4806
|
+
show: true,
|
|
4807
|
+
formatter: function formatter(_, _ref2) {
|
|
4808
|
+
var dataPointIndex = _ref2.dataPointIndex;
|
|
4809
|
+
return categories[dataPointIndex];
|
|
4810
|
+
}
|
|
4786
4811
|
},
|
|
4787
4812
|
y: {
|
|
4788
4813
|
formatter: function formatter(val) {
|
|
4789
4814
|
if (title !== null && title !== void 0 && title.toLowerCase().includes("revenue")) {
|
|
4790
|
-
return "$".concat(val.toLocaleString());
|
|
4815
|
+
return "$".concat(Number(val).toLocaleString());
|
|
4791
4816
|
}
|
|
4792
4817
|
if (title !== null && title !== void 0 && title.toLowerCase().includes("rate") || title !== null && title !== void 0 && title.toLowerCase().includes("bounce")) {
|
|
4793
4818
|
return "".concat(val, "%");
|
|
4794
4819
|
}
|
|
4795
|
-
return val.toLocaleString();
|
|
4820
|
+
return Number(val).toLocaleString();
|
|
4796
4821
|
}
|
|
4797
4822
|
},
|
|
4798
4823
|
marker: {
|
|
@@ -4800,10 +4825,6 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
|
|
|
4800
4825
|
}
|
|
4801
4826
|
}
|
|
4802
4827
|
};
|
|
4803
|
-
var series = [{
|
|
4804
|
-
name: title,
|
|
4805
|
-
data: chartData
|
|
4806
|
-
}];
|
|
4807
4828
|
return /*#__PURE__*/jsxs(Card, {
|
|
4808
4829
|
sx: {
|
|
4809
4830
|
p: 3,
|
|
@@ -4811,7 +4832,6 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
|
|
|
4811
4832
|
border: "1px solid #f0f0f0",
|
|
4812
4833
|
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
4813
4834
|
bgcolor: "#fff",
|
|
4814
|
-
// height: "100%",
|
|
4815
4835
|
display: "flex",
|
|
4816
4836
|
flexDirection: "column"
|
|
4817
4837
|
},
|
|
@@ -4880,26 +4900,25 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
|
|
|
4880
4900
|
fontSize: "10px",
|
|
4881
4901
|
color: "rgba(0, 0, 0, 0.3)"
|
|
4882
4902
|
},
|
|
4883
|
-
children:
|
|
4903
|
+
children: categories[0]
|
|
4884
4904
|
}), /*#__PURE__*/jsx(Typography, {
|
|
4885
4905
|
sx: {
|
|
4886
4906
|
fontSize: "10px",
|
|
4887
4907
|
color: "rgba(0, 0, 0, 0.3)"
|
|
4888
4908
|
},
|
|
4889
|
-
children:
|
|
4909
|
+
children: categories[Math.floor(categories.length / 2)]
|
|
4890
4910
|
}), /*#__PURE__*/jsx(Typography, {
|
|
4891
4911
|
sx: {
|
|
4892
4912
|
fontSize: "10px",
|
|
4893
4913
|
color: "rgba(0, 0, 0, 0.3)"
|
|
4894
4914
|
},
|
|
4895
|
-
children:
|
|
4915
|
+
children: categories[categories.length - 1]
|
|
4896
4916
|
})]
|
|
4897
4917
|
})]
|
|
4898
4918
|
}), /*#__PURE__*/jsx(Box, {
|
|
4899
4919
|
sx: {
|
|
4900
4920
|
mt: "auto",
|
|
4901
4921
|
pt: 3,
|
|
4902
|
-
// borderTop: "1px solid #f0f0f0",
|
|
4903
4922
|
display: "flex",
|
|
4904
4923
|
justifyContent: "space-between"
|
|
4905
4924
|
},
|
|
@@ -5658,7 +5677,7 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
|
5658
5677
|
};
|
|
5659
5678
|
|
|
5660
5679
|
var OverallSection = function OverallSection(_ref) {
|
|
5661
|
-
var _apiData$totalRaisedP, _apiData$netRaisedCar, _apiData$netRaisedPre, _apiData$averageDonat, _apiData$averageDonat2, _apiData$roasCard, _apiData$roasCardPrev;
|
|
5680
|
+
var _apiData$totalRaisedP, _apiData$netRaisedCar, _apiData$netRaisedPre, _apiData$averageDonat, _apiData$averageDonat2, _apiData$roasCard, _apiData$roasCardPrev, _orderBumpData$prevTr;
|
|
5662
5681
|
var _ref$apiData = _ref.apiData,
|
|
5663
5682
|
apiData = _ref$apiData === void 0 ? {} : _ref$apiData,
|
|
5664
5683
|
primaryCharts = _ref.primaryCharts,
|
|
@@ -5673,6 +5692,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5673
5692
|
var donationTypeData = (apiData === null || apiData === void 0 ? void 0 : apiData.donationTypeData) || [];
|
|
5674
5693
|
var donorGeographyData = (apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography) || [];
|
|
5675
5694
|
var trafficSourceData = (apiData === null || apiData === void 0 ? void 0 : apiData.trafficSource) || [];
|
|
5695
|
+
var orderBumpData = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpData) || [];
|
|
5676
5696
|
var allCharts = [].concat(_toConsumableArray(primaryCharts), _toConsumableArray(secondaryCharts), _toConsumableArray(tertiaryCharts), _toConsumableArray(quaternaryCharts));
|
|
5677
5697
|
var getExtendedCharts = function getExtendedCharts() {
|
|
5678
5698
|
var charts = _toConsumableArray(allCharts);
|
|
@@ -6199,9 +6219,24 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
6199
6219
|
children: /*#__PURE__*/jsx(MetricSparklineCard, {
|
|
6200
6220
|
title: "Order Bump",
|
|
6201
6221
|
subtitle: "Revenue trend \xB7 last 30 days",
|
|
6202
|
-
value: "$
|
|
6203
|
-
trend: "\u25B2
|
|
6204
|
-
chartData: [
|
|
6222
|
+
value: "$".concat(formatNumber((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.totalValue) || "$0")),
|
|
6223
|
+
trend: "\u25B2 ".concat(orderBumpData === null || orderBumpData === void 0 || (_orderBumpData$prevTr = orderBumpData.prevTrend) === null || _orderBumpData$prevTr === void 0 ? void 0 : _orderBumpData$prevTr.toFixed(1), "% vs last month"),
|
|
6224
|
+
chartData: [{
|
|
6225
|
+
"label": "Apr 5",
|
|
6226
|
+
"value": 1200
|
|
6227
|
+
}, {
|
|
6228
|
+
"label": "Apr 10",
|
|
6229
|
+
"value": 1800
|
|
6230
|
+
}, {
|
|
6231
|
+
"label": "Apr 17",
|
|
6232
|
+
"value": 1400
|
|
6233
|
+
}, {
|
|
6234
|
+
"label": "Apr 24",
|
|
6235
|
+
"value": 2200
|
|
6236
|
+
}, {
|
|
6237
|
+
"label": "May 6",
|
|
6238
|
+
"value": 2600
|
|
6239
|
+
}],
|
|
6205
6240
|
footerMetrics: [{
|
|
6206
6241
|
label: "Avg/day",
|
|
6207
6242
|
value: "$640"
|