sag_components 1.0.343 → 1.0.345
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.
|
@@ -21,19 +21,19 @@ var _excluded = ["totalsData", "data", "legendData", "colorBarchart1", "colorBar
|
|
|
21
21
|
var PerformanceAnalyticsOneColumn = exports.PerformanceAnalyticsOneColumn = function PerformanceAnalyticsOneColumn(_ref) {
|
|
22
22
|
var _ref$totalsData = _ref.totalsData,
|
|
23
23
|
totalsData = _ref$totalsData === void 0 ? [{
|
|
24
|
-
title:
|
|
24
|
+
title: "title",
|
|
25
25
|
value: 13,
|
|
26
26
|
dotCut: true,
|
|
27
27
|
currency: true,
|
|
28
|
-
currencyType:
|
|
28
|
+
currencyType: "USD",
|
|
29
29
|
growthPercent: 14,
|
|
30
30
|
showGrowthPercentSign: true
|
|
31
31
|
}] : _ref$totalsData,
|
|
32
32
|
_ref$data = _ref.data,
|
|
33
33
|
data = _ref$data === void 0 ? [{
|
|
34
|
-
retailer:
|
|
35
|
-
offerType:
|
|
36
|
-
period:
|
|
34
|
+
retailer: "",
|
|
35
|
+
offerType: "",
|
|
36
|
+
period: "",
|
|
37
37
|
// New / existing Shoppers
|
|
38
38
|
newShoppersValue: 44,
|
|
39
39
|
newShoppersPercentValue: 55,
|
|
@@ -47,9 +47,9 @@ var PerformanceAnalyticsOneColumn = exports.PerformanceAnalyticsOneColumn = func
|
|
|
47
47
|
title: string | null
|
|
48
48
|
}] : _ref$legendData,
|
|
49
49
|
_ref$colorBarchart = _ref.colorBarchart1,
|
|
50
|
-
colorBarchart1 = _ref$colorBarchart === void 0 ?
|
|
50
|
+
colorBarchart1 = _ref$colorBarchart === void 0 ? "#1F7677" : _ref$colorBarchart,
|
|
51
51
|
_ref$colorBarchart2 = _ref.colorBarchart2,
|
|
52
|
-
colorBarchart2 = _ref$colorBarchart2 === void 0 ?
|
|
52
|
+
colorBarchart2 = _ref$colorBarchart2 === void 0 ? "#90CE9C" : _ref$colorBarchart2,
|
|
53
53
|
width = _ref.width,
|
|
54
54
|
height = _ref.height,
|
|
55
55
|
lineChartHeight = _ref.lineChartHeight,
|
|
@@ -64,7 +64,7 @@ var PerformanceAnalyticsOneColumn = exports.PerformanceAnalyticsOneColumn = func
|
|
|
64
64
|
showLegendTooltip = _useState2[0],
|
|
65
65
|
setShowLegendTooltip = _useState2[1];
|
|
66
66
|
var _useState3 = (0, _react.useState)({
|
|
67
|
-
content:
|
|
67
|
+
content: "",
|
|
68
68
|
clientX: 0,
|
|
69
69
|
clientY: 0
|
|
70
70
|
}),
|
|
@@ -86,13 +86,13 @@ var PerformanceAnalyticsOneColumn = exports.PerformanceAnalyticsOneColumn = func
|
|
|
86
86
|
return null;
|
|
87
87
|
};
|
|
88
88
|
var getTopBarSigning = function getTopBarSigning(signing) {
|
|
89
|
-
if (signing ===
|
|
90
|
-
return
|
|
89
|
+
if (signing === "Dollar sign ($)") {
|
|
90
|
+
return "$";
|
|
91
91
|
}
|
|
92
|
-
if (signing ===
|
|
93
|
-
return
|
|
92
|
+
if (signing === "Euro sign (€)") {
|
|
93
|
+
return "€";
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return "";
|
|
96
96
|
};
|
|
97
97
|
var CustomizedLabelBarchart = function CustomizedLabelBarchart(props) {
|
|
98
98
|
var x = props.x,
|
|
@@ -110,7 +110,7 @@ var PerformanceAnalyticsOneColumn = exports.PerformanceAnalyticsOneColumn = func
|
|
|
110
110
|
fontSize: "16px",
|
|
111
111
|
textAnchor: "middle",
|
|
112
112
|
dominantBaseline: "middle"
|
|
113
|
-
}, "".concat(getTopBarSigning(topBarSigning), "\n ").concat((0, _CommonFunctions.getFormattedValue)(totalValue), "\n ").concat((0, _CommonFunctions.getFormattedUnits)(totalValue), "\n ").concat(topBarPercentSigning ?
|
|
113
|
+
}, "".concat(getTopBarSigning(topBarSigning), "\n ").concat((0, _CommonFunctions.getFormattedValue)(totalValue), "\n ").concat((0, _CommonFunctions.getFormattedUnits)(totalValue), "\n ").concat(topBarPercentSigning ? "%" : "")));
|
|
114
114
|
};
|
|
115
115
|
var CustomizedTickBarChart = function CustomizedTickBarChart(props) {
|
|
116
116
|
var x = props.x,
|
|
@@ -192,7 +192,7 @@ var PerformanceAnalyticsOneColumn = exports.PerformanceAnalyticsOneColumn = func
|
|
|
192
192
|
direction: "top"
|
|
193
193
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
194
194
|
cursor: {
|
|
195
|
-
fill:
|
|
195
|
+
fill: "transparent"
|
|
196
196
|
},
|
|
197
197
|
content: CustomTooltipBarChart
|
|
198
198
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
@@ -235,7 +235,7 @@ var PerformanceAnalyticsOneColumn = exports.PerformanceAnalyticsOneColumn = func
|
|
|
235
235
|
fontWeight: lineChartValueBold ? 600 : 400,
|
|
236
236
|
fontSize: 14,
|
|
237
237
|
textAnchor: "middle"
|
|
238
|
-
}, "".concat(value).concat(lineChartValueType ?
|
|
238
|
+
}, "".concat(value).concat(lineChartValueType ? "%" : ""));
|
|
239
239
|
};
|
|
240
240
|
var CustomTooltipROI = function CustomTooltipROI(_ref3) {
|
|
241
241
|
var active = _ref3.active,
|
|
@@ -288,7 +288,8 @@ var PerformanceAnalyticsOneColumn = exports.PerformanceAnalyticsOneColumn = func
|
|
|
288
288
|
})))));
|
|
289
289
|
};
|
|
290
290
|
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsOneColumn.ControlsContainer, {
|
|
291
|
-
id: "
|
|
291
|
+
id: "PerformanceAnalyticsControlsContainer",
|
|
292
|
+
className: (totalsData === null || totalsData === void 0 ? void 0 : totalsData.length) > 0 && (data === null || data === void 0 ? void 0 : data.length) > 0 ? "" : "NoData",
|
|
292
293
|
width: width,
|
|
293
294
|
height: height
|
|
294
295
|
}, (totalsData === null || totalsData === void 0 ? void 0 : totalsData.length) > 0 && (data === null || data === void 0 ? void 0 : data.length) > 0 ? /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsOneColumn.Controls, {
|
|
@@ -299,9 +300,9 @@ var PerformanceAnalyticsOneColumn = exports.PerformanceAnalyticsOneColumn = func
|
|
|
299
300
|
};
|
|
300
301
|
var _default = exports.default = PerformanceAnalyticsOneColumn;
|
|
301
302
|
PerformanceAnalyticsOneColumn.defaultProps = {
|
|
302
|
-
lineChartHeight:
|
|
303
|
-
width:
|
|
304
|
-
height:
|
|
303
|
+
lineChartHeight: "50",
|
|
304
|
+
width: "100%",
|
|
305
|
+
height: "100%",
|
|
305
306
|
totalsData: [],
|
|
306
|
-
noDataText:
|
|
307
|
+
noDataText: "No data"
|
|
307
308
|
};
|
|
@@ -8,7 +8,7 @@ exports.TotalsDataContainer = exports.TooltipValue = exports.TooltipTitle = expo
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
11
|
-
var ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: ", ";\n color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 12px;\n align-self: center;\n\n > * {\n box-sizing: border-box;\n }\n"])), function (props) {
|
|
11
|
+
var ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: ", ";\n color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 12px;\n align-self: center;\n &.NoData {\n align-self: center;\n display: flex;\n align-items: center;\n width: 50%;\n margin: auto;\n }\n > * {\n box-sizing: border-box;\n }\n"])), function (props) {
|
|
12
12
|
return props.rootFont;
|
|
13
13
|
}, function (props) {
|
|
14
14
|
return props.textColor;
|