@ammarkhalidfarooq/dashboard-package 0.3.23 → 0.3.24
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 +72 -26
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +72 -26
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -256,7 +256,9 @@ var RevenueChart = function RevenueChart(_ref) {
|
|
|
256
256
|
type = _ref$type === void 0 ? "area" : _ref$type,
|
|
257
257
|
_ref$id = _ref.id,
|
|
258
258
|
id = _ref$id === void 0 ? "revenue-chart" : _ref$id,
|
|
259
|
-
colors = _ref.colors
|
|
259
|
+
colors = _ref.colors,
|
|
260
|
+
_ref$showLegend = _ref.showLegend,
|
|
261
|
+
showLegend = _ref$showLegend === void 0 ? true : _ref$showLegend;
|
|
260
262
|
var theme = styles.useTheme();
|
|
261
263
|
var isRadial = type === 'donut' || type === 'pie';
|
|
262
264
|
|
|
@@ -294,7 +296,7 @@ var RevenueChart = function RevenueChart(_ref) {
|
|
|
294
296
|
enabled: true
|
|
295
297
|
},
|
|
296
298
|
legend: {
|
|
297
|
-
show:
|
|
299
|
+
show: showLegend,
|
|
298
300
|
position: 'bottom',
|
|
299
301
|
horizontalAlign: 'center'
|
|
300
302
|
},
|
|
@@ -373,7 +375,7 @@ var RevenueChart = function RevenueChart(_ref) {
|
|
|
373
375
|
enabled: false
|
|
374
376
|
},
|
|
375
377
|
legend: {
|
|
376
|
-
show: stacked || series && series.length > 1,
|
|
378
|
+
show: showLegend && (stacked || series && series.length > 1),
|
|
377
379
|
position: 'top',
|
|
378
380
|
horizontalAlign: 'left'
|
|
379
381
|
},
|
|
@@ -539,33 +541,75 @@ var RenderChartCard = function RenderChartCard(_ref) {
|
|
|
539
541
|
},
|
|
540
542
|
children: _typeof(item.subValue) === 'object' && item.subValue !== null ? JSON.stringify(item.subValue) : item.subValue
|
|
541
543
|
})]
|
|
542
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
544
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
543
545
|
sx: {
|
|
544
546
|
display: "flex",
|
|
545
|
-
gap: 1
|
|
547
|
+
gap: 1,
|
|
548
|
+
alignItems: "center"
|
|
546
549
|
},
|
|
547
|
-
children:
|
|
548
|
-
metric: metric,
|
|
549
|
-
onMetricChange: setMetric,
|
|
550
|
-
options: ["Revenue", "Donations"]
|
|
551
|
-
}), /*#__PURE__*/jsxRuntime.jsx(material.IconButton, {
|
|
550
|
+
children: item.hideControls ? /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
552
551
|
sx: {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
height: "40px",
|
|
557
|
-
width: "40px",
|
|
558
|
-
"&:hover": {
|
|
559
|
-
borderColor: "primary.main",
|
|
560
|
-
bgcolor: "rgba(99, 99, 230, 0.04)"
|
|
561
|
-
}
|
|
552
|
+
display: "flex",
|
|
553
|
+
gap: 2,
|
|
554
|
+
alignItems: "center"
|
|
562
555
|
},
|
|
563
|
-
children:
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
556
|
+
children: [{
|
|
557
|
+
label: "Paid Ads",
|
|
558
|
+
color: "#6366F1"
|
|
559
|
+
}, {
|
|
560
|
+
label: "Organic",
|
|
561
|
+
color: "#10B981"
|
|
562
|
+
}, {
|
|
563
|
+
label: "Email",
|
|
564
|
+
color: "#06B6D4"
|
|
565
|
+
}].map(function (leg) {
|
|
566
|
+
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
567
|
+
sx: {
|
|
568
|
+
display: "flex",
|
|
569
|
+
alignItems: "center",
|
|
570
|
+
gap: 0.5
|
|
571
|
+
},
|
|
572
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
573
|
+
sx: {
|
|
574
|
+
width: 8,
|
|
575
|
+
height: 8,
|
|
576
|
+
borderRadius: "50%",
|
|
577
|
+
bgcolor: leg.color
|
|
578
|
+
}
|
|
579
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
580
|
+
sx: {
|
|
581
|
+
fontSize: "12px",
|
|
582
|
+
color: "rgba(0,0,0,0.6)",
|
|
583
|
+
fontWeight: 500
|
|
584
|
+
},
|
|
585
|
+
children: leg.label
|
|
586
|
+
})]
|
|
587
|
+
}, leg.label);
|
|
567
588
|
})
|
|
568
|
-
})
|
|
589
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
590
|
+
children: [item.showSelector && /*#__PURE__*/jsxRuntime.jsx(MetricSelector, {
|
|
591
|
+
metric: metric,
|
|
592
|
+
onMetricChange: setMetric,
|
|
593
|
+
options: ["Revenue", "Donations"]
|
|
594
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.IconButton, {
|
|
595
|
+
sx: {
|
|
596
|
+
border: "1px solid #E9E9EB",
|
|
597
|
+
borderRadius: "8px",
|
|
598
|
+
color: "#000",
|
|
599
|
+
height: "40px",
|
|
600
|
+
width: "40px",
|
|
601
|
+
"&:hover": {
|
|
602
|
+
borderColor: "primary.main",
|
|
603
|
+
bgcolor: "rgba(99, 99, 230, 0.04)"
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
children: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.MoreHoriz, {
|
|
607
|
+
sx: {
|
|
608
|
+
fontSize: "1.2rem"
|
|
609
|
+
}
|
|
610
|
+
})
|
|
611
|
+
})]
|
|
612
|
+
})
|
|
569
613
|
})]
|
|
570
614
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
571
615
|
sx: {
|
|
@@ -581,7 +625,8 @@ var RenderChartCard = function RenderChartCard(_ref) {
|
|
|
581
625
|
height: isPrimary ? 250 : 200,
|
|
582
626
|
stacked: item.stacked,
|
|
583
627
|
type: type || item.type || "area",
|
|
584
|
-
colors: item.colors
|
|
628
|
+
colors: item.colors,
|
|
629
|
+
showLegend: !item.hideControls
|
|
585
630
|
})
|
|
586
631
|
}), item.footer && /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
587
632
|
sx: {
|
|
@@ -4886,7 +4931,8 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
4886
4931
|
series: series,
|
|
4887
4932
|
categories: categories,
|
|
4888
4933
|
stacked: true,
|
|
4889
|
-
colors: ["#6366F1", "#10B981", "#06B6D4"]
|
|
4934
|
+
colors: ["#6366F1", "#10B981", "#06B6D4"],
|
|
4935
|
+
hideControls: true
|
|
4890
4936
|
});
|
|
4891
4937
|
}
|
|
4892
4938
|
}
|