sag_components 1.0.417 → 1.0.419
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.
|
@@ -93,32 +93,19 @@ const TotalBenchmarkAreachart = props => {
|
|
|
93
93
|
if (!(0, _CommonFunctions.isNumericValue)(currentWeek) || !(0, _CommonFunctions.isNumericValue)(startWeekRange) || !(0, _CommonFunctions.isNumericValue)(endWeekRange)) {
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
+
const currentWeekNumeric = Number(currentWeek);
|
|
97
|
+
const startWeekRangeNumeric = Number(startWeekRange);
|
|
98
|
+
const endWeekRangeNumeric = Number(endWeekRange);
|
|
96
99
|
return /*#__PURE__*/_react.default.createElement("g", {
|
|
97
100
|
transform: "translate(".concat(x, ",").concat(y, ")")
|
|
98
|
-
},
|
|
101
|
+
}, currentWeekNumeric >= startWeekRangeNumeric && currentWeekNumeric <= endWeekRangeNumeric ? /*#__PURE__*/_react.default.createElement("rect", {
|
|
99
102
|
x: -15,
|
|
100
103
|
y: 0,
|
|
101
|
-
width: "
|
|
104
|
+
width: "40",
|
|
102
105
|
height: "18",
|
|
103
106
|
rx: 9,
|
|
104
|
-
fill: xselectedColor
|
|
105
|
-
|
|
106
|
-
}) : currentWeek > startWeekRange && currentWeek < endWeekRange ? /*#__PURE__*/_react.default.createElement("rect", {
|
|
107
|
-
x: -30,
|
|
108
|
-
y: 0,
|
|
109
|
-
width: "80",
|
|
110
|
-
height: "18",
|
|
111
|
-
rx: 9,
|
|
112
|
-
fill: xselectedColor
|
|
113
|
-
//fillOpacity="0.30"
|
|
114
|
-
}) : currentWeek === endWeekRange ? /*#__PURE__*/_react.default.createElement("rect", {
|
|
115
|
-
x: -30,
|
|
116
|
-
y: 0,
|
|
117
|
-
width: "55",
|
|
118
|
-
height: "18",
|
|
119
|
-
rx: 9,
|
|
120
|
-
fill: xselectedColor
|
|
121
|
-
//fillOpacity="0.30"
|
|
107
|
+
fill: xselectedColor,
|
|
108
|
+
fillOpacity: "0.50"
|
|
122
109
|
}) : "", /*#__PURE__*/_react.default.createElement("text", {
|
|
123
110
|
x: 0,
|
|
124
111
|
y: 14,
|
|
@@ -139,6 +126,17 @@ const TotalBenchmarkAreachart = props => {
|
|
|
139
126
|
}
|
|
140
127
|
return null;
|
|
141
128
|
};
|
|
129
|
+
const getEventWeeksLegendData = () => /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.EventWeeksLegendDataContainer, {
|
|
130
|
+
id: "EventWeeksLegendDataContainer"
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.EventWeeksTitleAndIconContainer, {
|
|
132
|
+
id: "EventWeeksTitleAndIconContainer"
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.EventWeeksLegendColorRectangle, {
|
|
134
|
+
id: "EventWeeksLegendColorRectangle",
|
|
135
|
+
color: xselectedColor
|
|
136
|
+
}), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.EventWeeksLegendTitle, {
|
|
137
|
+
id: "EventWeeksLegendTitle",
|
|
138
|
+
width: width
|
|
139
|
+
}, "Event weeks")));
|
|
142
140
|
return /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.ControlsContainer, {
|
|
143
141
|
id: "ControlsContainer",
|
|
144
142
|
height: height,
|
|
@@ -241,7 +239,7 @@ const TotalBenchmarkAreachart = props => {
|
|
|
241
239
|
fill: "url(#colorValue2)"
|
|
242
240
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
243
241
|
content: /*#__PURE__*/_react.default.createElement(CustomTooltip, null)
|
|
244
|
-
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null))))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
242
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null)))), getEventWeeksLegendData()) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
245
243
|
noDataText: noDataText
|
|
246
244
|
}));
|
|
247
245
|
};
|
|
@@ -320,5 +318,7 @@ TotalBenchmarkAreachart.defaultProps = {
|
|
|
320
318
|
opacity: "191",
|
|
321
319
|
value1Title: "Actual Sales",
|
|
322
320
|
value2Title: "Baseline Sales",
|
|
323
|
-
noDataText: ""
|
|
321
|
+
noDataText: "",
|
|
322
|
+
startWeekRange: 0,
|
|
323
|
+
endWeekRange: 0
|
|
324
324
|
};
|
|
@@ -4,10 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.ValueAndBenchmarkContainer = exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.FormattedValueNoDataMessage = exports.FormattedValue = exports.DetailsRowArrowContainer = exports.CurrencySign = exports.ControlsContainer = exports.Controls = exports.BenchmarkContainer = exports.AreaChartContainer = void 0;
|
|
7
|
+
exports.ValueAndBenchmarkContainer = exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.FormattedValueNoDataMessage = exports.FormattedValue = exports.EventWeeksTitleAndIconContainer = exports.EventWeeksLegendTitle = exports.EventWeeksLegendDataContainer = exports.EventWeeksLegendColorRectangle = exports.DetailsRowArrowContainer = exports.CurrencySign = exports.ControlsContainer = exports.Controls = exports.BenchmarkContainer = exports.AreaChartContainer = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
|
|
11
11
|
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif;\n color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 12px;\n"])), props => props.textColor, props => props.width, props => props.height);
|
|
12
12
|
const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n background: #ffffff;\n border-radius: 12px;\n flex-basis: 100%;\n"])));
|
|
13
13
|
const AreaChartContainer = exports.AreaChartContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 50%;\n"])));
|
|
@@ -21,4 +21,8 @@ const DetailsRowArrowContainer = exports.DetailsRowArrowContainer = _styledCompo
|
|
|
21
21
|
const FormattedValue = exports.FormattedValue = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 40px;\n @media (max-width: 1366px) {\n font-size: 20px;\n }\n @media (max-width: 1536px) {\n font-size: 24px;\n }\n"])));
|
|
22
22
|
const CurrencySign = exports.CurrencySign = _styledComponents.default.span(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1366px) {\n font-size: 12px;\n }\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n"])));
|
|
23
23
|
const FormattedValueNoDataMessage = exports.FormattedValueNoDataMessage = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.3rem;\n font-weight: 700;\n font-size: 16px;\n margin: 0;\n"])));
|
|
24
|
-
const BenchmarkContainer = exports.BenchmarkContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 1.5rem;\n"])));
|
|
24
|
+
const BenchmarkContainer = exports.BenchmarkContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 1.5rem;\n"])));
|
|
25
|
+
const EventWeeksLegendDataContainer = exports.EventWeeksLegendDataContainer = _styledComponents.default.div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n gap: 40px;\n margin-top: 10px;\n @media (max-width: 1536px) {\n gap: 38px;\n }\n @media (max-width: 1366px) {\n gap: 30px;\n }\n"])));
|
|
26
|
+
const EventWeeksTitleAndIconContainer = exports.EventWeeksTitleAndIconContainer = _styledComponents.default.div(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n"])));
|
|
27
|
+
const EventWeeksLegendTitle = exports.EventWeeksLegendTitle = _styledComponents.default.h4(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n margin: 0 0 0 5px;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 12px;\n }\n"])));
|
|
28
|
+
const EventWeeksLegendColorRectangle = exports.EventWeeksLegendColorRectangle = _styledComponents.default.div(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n width: 0.5rem;\n min-width: 0.5rem;\n height: 0.5rem;\n border-radius: 2px;\n background: ", ";\n"])), props => props.color);
|