sag_components 1.0.975 → 1.0.976
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/Button.test.js +10 -10
- package/dist/LinkButton.test.js +10 -10
- package/dist/SingleBar.test.js +2 -2
- package/dist/index.js +1 -1
- package/dist/stories/components/AttachedFile/AttachedFile.js +1 -1
- package/dist/stories/components/AttachedFile/AttachedFile.style.js +40 -6
- package/dist/stories/components/BannerEventBox/BannerEventBox.js +33 -23
- package/dist/stories/components/BannerEventBox/BannerEventBox.style.js +71 -15
- package/dist/stories/components/BannerEventBoxList/BannerEventBoxList.js +10 -5
- package/dist/stories/components/BannerEventBoxList/BannerEventBoxList.style.js +182 -16
- package/dist/stories/components/BannersDropdown/BannersDropdown.style.js +91 -10
- package/dist/stories/components/BarChart/BarChart.js +5 -3
- package/dist/stories/components/BarChart/BarChart.stories.js +29 -20
- package/dist/stories/components/BarChart/BarChart.style.js +52 -10
- package/dist/stories/components/BarChartTwoRows/BarChartTwoRows.js +53 -44
- package/dist/stories/components/BarChartTwoRows/BarChartTwoRows.stories.js +166 -40
- package/dist/stories/components/BarChartTwoRows/BarChartTwoRows.style.js +72 -11
- package/dist/stories/components/BarChartsByWeeks/BarChartsByWeeks.js +7 -3
- package/dist/stories/components/BarChartsByWeeks/BarChartsByWeeks.style.js +88 -13
- package/dist/stories/components/Benchmark/Benchmark.style.js +53 -7
- package/dist/stories/components/Button/Button.js +1 -1
- package/dist/stories/components/Button/Button.style.js +82 -7
- package/dist/stories/components/CampaignDemoReport/CampaignDemoReport.style.js +40 -7
- package/dist/stories/components/Card/Card.style.js +57 -10
- package/dist/stories/components/CheckBox/CheckBox.style.js +28 -6
- package/dist/stories/components/CheckBoxButton/CheckBoxButton.style.js +31 -6
- package/dist/stories/components/CodeEditor/CodeEditor.style.js +4 -3
- package/dist/stories/components/CollapseData/CollapseData.js +5 -5
- package/dist/stories/components/CollapseData/CollapseData.style.js +119 -13
- package/dist/stories/components/CollapseHeader/CollapseHeader.js +2 -1
- package/dist/stories/components/CollapseHeader/CollapseHeader.style.js +192 -27
- package/dist/stories/components/CollapseMenuItem/CollapseMenuItem.style.js +53 -9
- package/dist/stories/components/Datepicker/Datepicker.style.js +9 -3
- package/dist/stories/components/DownloadProgress/DownloadProgress.style.js +43 -6
- package/dist/stories/components/Dropdown/Dropdown.style.js +9 -3
- package/dist/stories/components/DropdownMulti/DropdownMulti.js +290 -0
- package/dist/stories/components/DropdownMulti/DropdownMulti.stories.js +220 -0
- package/dist/stories/components/DropdownMulti/DropdownMulti.style.js +11 -0
- package/dist/stories/components/DropdownMultiNew/DropdownMultiNew.js +49 -36
- package/dist/stories/components/DropdownMultiNew/DropdownMultiNew.style.js +204 -16
- package/dist/stories/components/DropdownNew/DropdownNew.js +21 -11
- package/dist/stories/components/DropdownNew/DropdownNew.stories.js +18 -9
- package/dist/stories/components/DropdownNew/DropdownNew.style.js +13 -3
- package/dist/stories/components/DropdownSingleNew/DropdownSingleNew.js +30 -10
- package/dist/stories/components/DropdownSingleNew/DropdownSingleNew.style.js +175 -14
- package/dist/stories/components/EventDetailsCard/EventDetailsCard.style.js +86 -10
- package/dist/stories/components/EventList/EventList.style.js +30 -6
- package/dist/stories/components/EventListItem/EventListItem.style.js +39 -6
- package/dist/stories/components/FilterContainer/FilterContainer.style.js +22 -5
- package/dist/stories/components/FilterPanel/FilterPanel.js +22 -17
- package/dist/stories/components/FilterPanel/FilterPanel.style.js +81 -13
- package/dist/stories/components/FilterPanel.js +4 -0
- package/dist/stories/components/FormattedValue/FormattedValue.style.js +83 -10
- package/dist/stories/components/IconButton/IconButton.style.js +56 -7
- package/dist/stories/components/Input/Input.style.js +122 -9
- package/dist/stories/components/InputOld/InputOld.style.js +61 -8
- package/dist/stories/components/KpiFilter/KpiFilter.js +18 -1
- package/dist/stories/components/KpiFilter/KpiFilter.style.js +124 -18
- package/dist/stories/components/LinkButton/LinkButton.style.js +45 -6
- package/dist/stories/components/LinnerDataBox/LinnerDataBox.js +4 -2
- package/dist/stories/components/LinnerDataBox/LinnerDataBox.stories.js +32 -10
- package/dist/stories/components/LinnerDataBox/LinnerDataBox.style.js +60 -14
- package/dist/stories/components/ListBox/ListBox.style.js +40 -6
- package/dist/stories/components/MarketShareDescription/MarketShareDescription.stories.js +17 -3
- package/dist/stories/components/MarketShareDescription/MarketShareDescription.style.js +207 -19
- package/dist/stories/components/Modal/Modal.style.js +56 -8
- package/dist/stories/components/Modal/ModalTotalBenchmark.js +6 -6
- package/dist/stories/components/MonthPicker/MonthPicker.js +2 -2
- package/dist/stories/components/MonthPicker/MonthPicker.style.js +95 -10
- package/dist/stories/components/MonthPicker/MonthPopupPicker.js +91 -13
- package/dist/stories/components/MultipleCard/MultipleCard.style.js +5 -3
- package/dist/stories/components/NoDataFoundMessage/NoDataFoundMessage.style.js +31 -5
- package/dist/stories/components/OneColumnContainer/OneColumnContainer.style.js +99 -12
- package/dist/stories/components/PageFilterBar/PageFilterBar.style.js +14 -4
- package/dist/stories/components/PerformanceAnalytics/PerformanceAnalytics.js +16 -9
- package/dist/stories/components/PerformanceAnalytics/PerformanceAnalytics.style.js +136 -17
- package/dist/stories/components/PerformanceAnalyticsLegend/PerformanceAnalyticsLegend.js +14 -13
- package/dist/stories/components/PerformanceAnalyticsLegend/PerformanceAnalyticsLegend.style.js +55 -8
- package/dist/stories/components/PerformanceAnalyticsOneColumn/PerformanceAnalyticsOneColumn.js +12 -5
- package/dist/stories/components/PerformanceAnalyticsOneColumn/PerformanceAnalyticsOneColumn.style.js +108 -15
- package/dist/stories/components/PerformanceAnalyticsTotals/PerformanceAnalyticsTotals.js +1 -1
- package/dist/stories/components/PerformanceAnalyticsTotals/PerformanceAnalyticsTotals.style.js +81 -12
- package/dist/stories/components/Popup/Popup.style.js +114 -16
- package/dist/stories/components/PopupCharts/PopupCharts.style.js +100 -15
- package/dist/stories/components/PopupContent/PopupContent.style.js +64 -11
- package/dist/stories/components/ProductsVariety/ProductsVariety.style.js +78 -12
- package/dist/stories/components/ProgressBar/ProgressBar.style.js +15 -4
- package/dist/stories/components/QuarterPicker/QuarterPicker.js +2 -2
- package/dist/stories/components/QuarterPicker/QuarterPicker.style.js +94 -10
- package/dist/stories/components/QuarterPicker/QuarterPopupPicker.js +85 -12
- package/dist/stories/components/QuickFilter/QuickFilter.style.js +13 -3
- package/dist/stories/components/QuickFilter/QuickFilterDropdownMultiSelection.js +2 -2
- package/dist/stories/components/QuickFilter/QuickFilterDropdownMultiSelection.style.js +182 -16
- package/dist/stories/components/QuickFilter/QuickFilterDropdownSingle.js +1 -1
- package/dist/stories/components/QuickFilter/QuickFilterDropdownSingle.style.js +127 -15
- package/dist/stories/components/QuickFilterDropdownMultiSelection.js +1 -1
- package/dist/stories/components/QuickFilterDropdownSingle.js +1 -1
- package/dist/stories/components/RangePicker/RangeDatePicker.js +95 -12
- package/dist/stories/components/RangePicker/RangePicker.js +2 -2
- package/dist/stories/components/RangePicker/RangePicker.style.js +99 -10
- package/dist/stories/components/ReportTable/ReportTable.style.js +123 -14
- package/dist/stories/components/SagButton/SagButton.style.js +39 -5
- package/dist/stories/components/SagIconButton/SagIconButton.style.js +22 -4
- package/dist/stories/components/SagInput/SagInput.style.js +33 -5
- package/dist/stories/components/SalesAndROI/SalesAndROI.style.js +103 -11
- package/dist/stories/components/SearchInput/SearchInput.style.js +29 -4
- package/dist/stories/components/SegmentedButton/SegmentedButton.js +5 -5
- package/dist/stories/components/SegmentedButton/SegmentedButton.style.js +90 -9
- package/dist/stories/components/Select/Select.style.js +92 -9
- package/dist/stories/components/TabMenu/TabMenu.js +19 -7
- package/dist/stories/components/TabMenu/TabMenu.style.js +105 -14
- package/dist/stories/components/Table/Table.js +2 -2
- package/dist/stories/components/Table/Table.style.js +78 -9
- package/dist/stories/components/TextField/TextField.style.js +10 -3
- package/dist/stories/components/TitleDescription/TitleDescription.style.js +214 -28
- package/dist/stories/components/Tooltip/Tooltip.js +1 -1
- package/dist/stories/components/Tooltip/Tooltip.style.js +90 -5
- package/dist/stories/components/TopToggleList/TopToggleList.style.js +43 -8
- package/dist/stories/components/TotalBenchmark/TotalBenchmark.style.js +71 -11
- package/dist/stories/components/TotalBenchmarkAreachart/TotalBenchmarkAreachart.js +3 -3
- package/dist/stories/components/TotalBenchmarkAreachart/TotalBenchmarkAreachart.style.js +163 -22
- package/dist/stories/components/TotalBenchmarkArrows/TotalBenchmarkArrows.style.js +100 -16
- package/dist/stories/components/TotalBenchmarkBarchart/TotalBenchmarkBarchart.style.js +69 -12
- package/dist/stories/components/TotalDoughnutChart/TotalDoughnutChart.js +3 -3
- package/dist/stories/components/TotalDoughnutChart/TotalDoughnutChart.style.js +170 -22
- package/dist/stories/components/TotalHorizontalCharts/TotalHorizontalCharts.js +47 -32
- package/dist/stories/components/TotalHorizontalCharts/TotalHorizontalCharts.stories.js +52 -14
- package/dist/stories/components/TotalHorizontalCharts/TotalHorizontalCharts.style.js +51 -13
- package/dist/stories/components/TspanTooltip/TspanTooltip.js +3 -3
- package/dist/stories/components/TspanTooltip/TspanTooltip.style.js +97 -5
- package/dist/stories/components/TwoBarCharts/TwoBarCharts.js +6 -4
- package/dist/stories/components/TwoBarCharts/TwoBarCharts.stories.js +88 -23
- package/dist/stories/components/TwoBarCharts/TwoBarCharts.style.js +52 -10
- package/dist/stories/utils/CommonFunctions.js +13 -8
- package/package.json +1 -1
- package/dist/stories/components/HaiTooltip.js +0 -71
- package/dist/stories/components/HaiTooltip.style.js +0 -12
- package/dist/stories/components/Rbackup.js +0 -453
- package/dist/stories/components/TableTooltip.js +0 -71
- package/dist/stories/components/TableTooltip.style.js +0 -12
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
@@ -10,33 +9,34 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
9
|
var _recharts = require("recharts");
|
|
11
10
|
var _CommonFunctions = require("../../utils/CommonFunctions");
|
|
12
11
|
var _BarChartTwoRows = require("./BarChartTwoRows.style");
|
|
13
|
-
var _PerformanceAnalyticsLegend = _interopRequireDefault(require("../PerformanceAnalyticsLegend/PerformanceAnalyticsLegend"));
|
|
14
12
|
const ICON_TYPE_SQUARE = 'Square';
|
|
15
13
|
/* BarChartsByWeeks */
|
|
16
14
|
const BarChartTwoRows = props => {
|
|
17
15
|
const {
|
|
18
16
|
className,
|
|
19
17
|
title,
|
|
20
|
-
barChartData,
|
|
21
|
-
barSize,
|
|
22
|
-
isDollar,
|
|
23
18
|
width,
|
|
24
19
|
height,
|
|
20
|
+
barChartHeight,
|
|
21
|
+
barSize,
|
|
22
|
+
barFontSizeValue,
|
|
23
|
+
barChartData,
|
|
25
24
|
barChartColorFirst,
|
|
26
25
|
barChartColorSecond,
|
|
27
|
-
showLegend,
|
|
28
|
-
legendData,
|
|
29
26
|
showDollarSign,
|
|
27
|
+
isDollar,
|
|
30
28
|
showReferenceLine,
|
|
31
29
|
referenceLinePoint,
|
|
32
30
|
referenceLineColor,
|
|
33
31
|
referenceLineDashed,
|
|
34
32
|
lowerValueLabel,
|
|
35
|
-
highValueLabel
|
|
33
|
+
highValueLabel,
|
|
34
|
+
showLegend,
|
|
35
|
+
legendData
|
|
36
36
|
} = props;
|
|
37
37
|
const controlsContainerRef = (0, _react.useRef)();
|
|
38
38
|
const displayFormattedValue = value => {
|
|
39
|
-
if (!value) return '';
|
|
39
|
+
if (!value) return 'N/A';
|
|
40
40
|
let formattedValue = '';
|
|
41
41
|
formattedValue = !isDollar ? ''.concat('', value.toFixed(1)) : ''.concat(showDollarSign ? '$' : '', (0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
|
|
42
42
|
return formattedValue;
|
|
@@ -53,7 +53,7 @@ const BarChartTwoRows = props => {
|
|
|
53
53
|
let currentTooltipHighValue = 0;
|
|
54
54
|
if ((_payload$0$payload = payload[0].payload) !== null && _payload$0$payload !== void 0 && _payload$0$payload.lowerValue) currentTooltipLowerValue = (_payload$0$payload2 = payload[0].payload) === null || _payload$0$payload2 === void 0 ? void 0 : _payload$0$payload2.lowerValue;
|
|
55
55
|
if ((_payload$0$payload3 = payload[0].payload) !== null && _payload$0$payload3 !== void 0 && _payload$0$payload3.highValue) currentTooltipHighValue = (_payload$0$payload4 = payload[0].payload) === null || _payload$0$payload4 === void 0 ? void 0 : _payload$0$payload4.highValue;
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipTitle, null,
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipTitle, null, `${label}`), /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipLabel, null, `${lowerValueLabel} ${displayFormattedValue(currentTooltipLowerValue)}`), /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipLabel, null, `${highValueLabel} ${displayFormattedValue(currentTooltipHighValue)}`));
|
|
57
57
|
};
|
|
58
58
|
const CustomizedTickBarChart = props => {
|
|
59
59
|
const {
|
|
@@ -65,7 +65,7 @@ const BarChartTwoRows = props => {
|
|
|
65
65
|
const retailerData = barChartData.filter(item => item.title === payload.value);
|
|
66
66
|
if (retailerData && retailerData.length > 0) {
|
|
67
67
|
return /*#__PURE__*/_react.default.createElement("g", {
|
|
68
|
-
transform:
|
|
68
|
+
transform: `translate(${x},${y})`
|
|
69
69
|
// onMouseEnter={() => handleMouseEnter(offerType)}
|
|
70
70
|
// onMouseLeave={handleMouseLeave}
|
|
71
71
|
}, /*#__PURE__*/_react.default.createElement("text", {
|
|
@@ -76,13 +76,18 @@ const BarChartTwoRows = props => {
|
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.LabelBoldText, {
|
|
77
77
|
textAnchor: "middle",
|
|
78
78
|
x: "0",
|
|
79
|
-
dy: "
|
|
79
|
+
dy: "30",
|
|
80
80
|
fontSize: 16,
|
|
81
81
|
fontWeight: 600
|
|
82
|
-
}, payload.value), /*#__PURE__*/_react.default.createElement(
|
|
82
|
+
}, payload.value)), /*#__PURE__*/_react.default.createElement("text", {
|
|
83
|
+
x: 0,
|
|
84
|
+
y: 0,
|
|
85
|
+
dy: 16,
|
|
86
|
+
fill: "#212121"
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.LabelText, {
|
|
83
88
|
textAnchor: "middle",
|
|
84
89
|
x: "0",
|
|
85
|
-
dy: "
|
|
90
|
+
dy: "50",
|
|
86
91
|
fontSize: 14,
|
|
87
92
|
fontWeight: 400
|
|
88
93
|
}, retailerData[0].date)));
|
|
@@ -103,7 +108,7 @@ const BarChartTwoRows = props => {
|
|
|
103
108
|
y: y,
|
|
104
109
|
dy: -8,
|
|
105
110
|
fill: stroke,
|
|
106
|
-
fontSize:
|
|
111
|
+
fontSize: barFontSizeValue,
|
|
107
112
|
textAnchor: "middle"
|
|
108
113
|
}, displayFormattedValue(value));
|
|
109
114
|
};
|
|
@@ -112,18 +117,20 @@ const BarChartTwoRows = props => {
|
|
|
112
117
|
height: height,
|
|
113
118
|
width: width,
|
|
114
119
|
ref: controlsContainerRef
|
|
115
|
-
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.Controls,
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.Controls, {
|
|
121
|
+
className: "Controls"
|
|
122
|
+
}, title !== '' && /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.Title, null, title), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
123
|
+
height: barChartHeight
|
|
118
124
|
}, /*#__PURE__*/_react.default.createElement(_recharts.BarChart, {
|
|
119
125
|
width: width,
|
|
120
126
|
height: height,
|
|
121
127
|
data: barChartData,
|
|
128
|
+
maxBarSize: 60,
|
|
122
129
|
margin: {
|
|
123
130
|
top: 20,
|
|
124
131
|
right: 0,
|
|
125
|
-
|
|
126
|
-
|
|
132
|
+
left: 0,
|
|
133
|
+
bottom: 20
|
|
127
134
|
}
|
|
128
135
|
}, showReferenceLine && /*#__PURE__*/_react.default.createElement(_recharts.ReferenceLine, {
|
|
129
136
|
y: referenceLinePoint,
|
|
@@ -133,9 +140,9 @@ const BarChartTwoRows = props => {
|
|
|
133
140
|
dataKey: "title",
|
|
134
141
|
tick: CustomizedTickBarChart,
|
|
135
142
|
tickLine: false,
|
|
136
|
-
height:
|
|
137
|
-
|
|
138
|
-
|
|
143
|
+
height: 80,
|
|
144
|
+
interval: 0,
|
|
145
|
+
stroke: "#D0D0D0"
|
|
139
146
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
140
147
|
content: /*#__PURE__*/_react.default.createElement(CustomTooltip, null)
|
|
141
148
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
@@ -153,7 +160,7 @@ const BarChartTwoRows = props => {
|
|
|
153
160
|
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
154
161
|
dataKey: "value",
|
|
155
162
|
content: CustomizedLabel
|
|
156
|
-
})))), showLegend && /*#__PURE__*/_react.default.createElement(
|
|
163
|
+
})))), showLegend && /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.LegendContainer, {
|
|
157
164
|
legendData: legendData
|
|
158
165
|
})));
|
|
159
166
|
};
|
|
@@ -161,6 +168,27 @@ exports.BarChartTwoRows = BarChartTwoRows;
|
|
|
161
168
|
var _default = exports.default = BarChartTwoRows;
|
|
162
169
|
BarChartTwoRows.defaultProps = {
|
|
163
170
|
title: 'String',
|
|
171
|
+
width: '100%',
|
|
172
|
+
height: '100%',
|
|
173
|
+
barChartHeight: 250,
|
|
174
|
+
barSize: 60,
|
|
175
|
+
barFontSizeValue: '0.6em',
|
|
176
|
+
barChartColorFirst: '#BD9EFF',
|
|
177
|
+
barChartColorSecond: '#0b00aaF',
|
|
178
|
+
showDollarSign: true,
|
|
179
|
+
isDollar: true,
|
|
180
|
+
showReferenceLine: false,
|
|
181
|
+
referenceLinePoint: 0,
|
|
182
|
+
referenceLineColor: '#212121',
|
|
183
|
+
referenceLineDashed: '5',
|
|
184
|
+
lowerValueLabel: 'Lower Value:',
|
|
185
|
+
highValueLabel: 'High Value:',
|
|
186
|
+
showLegend: true,
|
|
187
|
+
legendData: [{
|
|
188
|
+
title: 'Incremental Sales',
|
|
189
|
+
iconType: ICON_TYPE_SQUARE,
|
|
190
|
+
iconColor: '#BD9EFF'
|
|
191
|
+
}],
|
|
164
192
|
barChartData: [{
|
|
165
193
|
title: 'Food Lion',
|
|
166
194
|
date: '15.01.24-31.01.24',
|
|
@@ -181,24 +209,5 @@ BarChartTwoRows.defaultProps = {
|
|
|
181
209
|
title: 'Stop&Shop',
|
|
182
210
|
date: '15.01.24-31.01.24',
|
|
183
211
|
value: 415317
|
|
184
|
-
}]
|
|
185
|
-
width: '100%',
|
|
186
|
-
height: '100%',
|
|
187
|
-
barSize: 60,
|
|
188
|
-
barChartColorFirst: '#BD9EFF',
|
|
189
|
-
barChartColorSecond: '#0b00aaF',
|
|
190
|
-
showDollarSign: true,
|
|
191
|
-
isDollar: true,
|
|
192
|
-
showLegend: true,
|
|
193
|
-
legendData: [{
|
|
194
|
-
title: 'Incremental Sales',
|
|
195
|
-
iconType: ICON_TYPE_SQUARE,
|
|
196
|
-
iconColor: '#BD9EFF'
|
|
197
|
-
}],
|
|
198
|
-
showReferenceLine: false,
|
|
199
|
-
referenceLinePoint: 0,
|
|
200
|
-
referenceLineColor: '#212121',
|
|
201
|
-
referenceLineDashed: '5',
|
|
202
|
-
lowerValueLabel: 'Lower Value:',
|
|
203
|
-
highValueLabel: 'High Value:'
|
|
212
|
+
}]
|
|
204
213
|
};
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = exports.SalesDollars = void 0;
|
|
7
|
+
exports.default = exports.SalesDollars = exports.OneColumnOnly = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _BarChartTwoRows = require("./BarChartTwoRows");
|
|
10
10
|
const arrData = [{
|
|
@@ -38,96 +38,222 @@ const arrData = [{
|
|
|
38
38
|
lowerValue: 415317,
|
|
39
39
|
highValue: 415317
|
|
40
40
|
}];
|
|
41
|
+
const arrDataOneColumnOnly = [{
|
|
42
|
+
title: 'Food Lion',
|
|
43
|
+
date: '15.01.24-31.01.24',
|
|
44
|
+
value: 542366,
|
|
45
|
+
lowerValue: null,
|
|
46
|
+
highValue: 542366
|
|
47
|
+
}, {
|
|
48
|
+
title: 'Hannaford',
|
|
49
|
+
date: '15.01.24-31.01.24',
|
|
50
|
+
value: 699511,
|
|
51
|
+
lowerValue: null,
|
|
52
|
+
highValue: 699511
|
|
53
|
+
}, {
|
|
54
|
+
title: 'The Giant Company',
|
|
55
|
+
date: '15.01.24-31.01.24',
|
|
56
|
+
value: 403092,
|
|
57
|
+
lowerValue: null,
|
|
58
|
+
highValue: 403092
|
|
59
|
+
}, {
|
|
60
|
+
title: 'Giant Food',
|
|
61
|
+
date: '15.01.24-31.01.24',
|
|
62
|
+
value: 396184,
|
|
63
|
+
lowerValue: null,
|
|
64
|
+
highValue: 396184
|
|
65
|
+
}, {
|
|
66
|
+
title: 'Stop&Shop',
|
|
67
|
+
date: '15.01.24-31.01.24',
|
|
68
|
+
value: 415317,
|
|
69
|
+
lowerValue: null,
|
|
70
|
+
highValue: 415317
|
|
71
|
+
}];
|
|
41
72
|
var _default = exports.default = {
|
|
42
73
|
title: 'SAG BI/Bar Chart Two Rows',
|
|
43
74
|
component: _BarChartTwoRows.BarChartTwoRows,
|
|
44
75
|
tags: ['autodocs'],
|
|
45
76
|
argTypes: {
|
|
46
77
|
title: {
|
|
47
|
-
name: '
|
|
78
|
+
name: 'Title',
|
|
48
79
|
control: {
|
|
49
80
|
type: 'text'
|
|
50
81
|
},
|
|
51
|
-
description: '
|
|
82
|
+
description: 'Title displayed on top of the component'
|
|
52
83
|
},
|
|
53
84
|
width: {
|
|
54
|
-
name: '
|
|
85
|
+
name: 'Width',
|
|
55
86
|
control: {
|
|
56
87
|
type: 'text'
|
|
57
88
|
},
|
|
58
|
-
description: '
|
|
89
|
+
description: 'Width of the control (in px)'
|
|
59
90
|
},
|
|
60
91
|
height: {
|
|
61
|
-
name: '
|
|
92
|
+
name: 'Height',
|
|
62
93
|
control: {
|
|
63
94
|
type: 'text'
|
|
64
95
|
},
|
|
65
|
-
description: '
|
|
96
|
+
description: 'Height of the control (in px)'
|
|
97
|
+
},
|
|
98
|
+
barChartHeight: {
|
|
99
|
+
name: 'Bar Chart Height',
|
|
100
|
+
control: {
|
|
101
|
+
type: 'number'
|
|
102
|
+
},
|
|
103
|
+
description: 'Height of the bar chart (in px)'
|
|
66
104
|
},
|
|
67
105
|
barSize: {
|
|
68
|
-
name: '
|
|
106
|
+
name: 'Bar Size',
|
|
69
107
|
control: {
|
|
70
|
-
type: '
|
|
108
|
+
type: 'number'
|
|
71
109
|
},
|
|
72
|
-
description: '
|
|
110
|
+
description: 'Size of the bars (in number, e.g., 60)'
|
|
111
|
+
},
|
|
112
|
+
barChartData: {
|
|
113
|
+
name: 'Bar Chart Data',
|
|
114
|
+
description: 'Array of objects: {title: string, value: number} to fill the bar chart data.'
|
|
73
115
|
},
|
|
74
116
|
barChartColorFirst: {
|
|
75
|
-
name: '
|
|
76
|
-
description: 'Sets the
|
|
117
|
+
name: 'First Bar Color',
|
|
118
|
+
description: 'Sets the color for the first bar chart',
|
|
77
119
|
control: {
|
|
78
120
|
type: 'color',
|
|
79
121
|
presetColors: ['#ffffff', '#ff0000', '#00ff00', '#0000ff']
|
|
80
122
|
}
|
|
81
123
|
},
|
|
82
124
|
barChartColorSecond: {
|
|
83
|
-
name: '
|
|
84
|
-
description: 'Sets the
|
|
125
|
+
name: 'Second Bar Color',
|
|
126
|
+
description: 'Sets the color for the second bar chart',
|
|
85
127
|
control: {
|
|
86
128
|
type: 'color',
|
|
87
129
|
presetColors: ['#ffffff', '#ff0000', '#00ff00', '#0000ff']
|
|
88
130
|
}
|
|
89
131
|
},
|
|
90
|
-
barChartData: {
|
|
91
|
-
description: 'array [] of objects: {title: string, value:number } to fill the area data. '
|
|
92
|
-
},
|
|
93
132
|
showDollarSign: {
|
|
94
|
-
name: '
|
|
133
|
+
name: 'Show Dollar Sign',
|
|
95
134
|
control: {
|
|
96
135
|
type: 'boolean'
|
|
97
136
|
},
|
|
98
|
-
description: '
|
|
137
|
+
description: 'Display a dollar sign on top of the bar'
|
|
99
138
|
},
|
|
100
139
|
isDollar: {
|
|
101
|
-
name: '
|
|
140
|
+
name: 'Display as Dollar',
|
|
141
|
+
control: {
|
|
142
|
+
type: 'boolean'
|
|
143
|
+
},
|
|
144
|
+
description: 'Show values as dollar amounts'
|
|
145
|
+
},
|
|
146
|
+
showReferenceLine: {
|
|
147
|
+
name: 'Show Reference Line',
|
|
102
148
|
control: {
|
|
103
149
|
type: 'boolean'
|
|
104
150
|
},
|
|
105
|
-
description: '
|
|
151
|
+
description: 'Display a reference line on the chart'
|
|
152
|
+
},
|
|
153
|
+
referenceLinePoint: {
|
|
154
|
+
name: 'Reference Line Point',
|
|
155
|
+
control: {
|
|
156
|
+
type: 'number'
|
|
157
|
+
},
|
|
158
|
+
description: 'Value at which the reference line is drawn'
|
|
159
|
+
},
|
|
160
|
+
referenceLineColor: {
|
|
161
|
+
name: 'Reference Line Color',
|
|
162
|
+
control: {
|
|
163
|
+
type: 'color'
|
|
164
|
+
},
|
|
165
|
+
description: 'Color of the reference line'
|
|
166
|
+
},
|
|
167
|
+
referenceLineDashed: {
|
|
168
|
+
name: 'Reference Line Dashed',
|
|
169
|
+
control: {
|
|
170
|
+
type: 'number'
|
|
171
|
+
},
|
|
172
|
+
description: 'Dashed Gapes of the reference line'
|
|
173
|
+
},
|
|
174
|
+
lowerValueLabel: {
|
|
175
|
+
name: 'Lower Value Label',
|
|
176
|
+
control: {
|
|
177
|
+
type: 'text'
|
|
178
|
+
},
|
|
179
|
+
description: 'Label for the lower value'
|
|
180
|
+
},
|
|
181
|
+
highValueLabel: {
|
|
182
|
+
name: 'High Value Label',
|
|
183
|
+
control: {
|
|
184
|
+
type: 'text'
|
|
185
|
+
},
|
|
186
|
+
description: 'Label for the high value'
|
|
106
187
|
},
|
|
107
188
|
showLegend: {
|
|
108
|
-
name: '
|
|
189
|
+
name: 'Show Legend',
|
|
109
190
|
control: {
|
|
110
191
|
type: 'boolean'
|
|
111
192
|
},
|
|
112
|
-
description: '
|
|
193
|
+
description: 'Display the legend at the bottom'
|
|
194
|
+
},
|
|
195
|
+
legendData: {
|
|
196
|
+
name: 'Legend Data',
|
|
197
|
+
description: 'Array of objects: {title: string, iconType: string, iconColor: string} to fill the legend data.'
|
|
113
198
|
}
|
|
114
199
|
}
|
|
115
200
|
};
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
201
|
+
const Template = args => /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.BarChartTwoRows, args);
|
|
202
|
+
const SalesDollars = exports.SalesDollars = Template.bind({});
|
|
203
|
+
SalesDollars.args = {
|
|
204
|
+
title: 'Cost',
|
|
205
|
+
width: '800px',
|
|
206
|
+
height: '500px',
|
|
207
|
+
barChartHeight: 250,
|
|
208
|
+
barSize: 60,
|
|
209
|
+
barChartData: arrData,
|
|
210
|
+
barChartColorFirst: '#90CE9C',
|
|
211
|
+
barChartColorSecond: '#1F7677',
|
|
212
|
+
showDollarSign: true,
|
|
213
|
+
isDollar: true,
|
|
214
|
+
showReferenceLine: true,
|
|
215
|
+
referenceLinePoint: 0,
|
|
216
|
+
referenceLineColor: '#212121',
|
|
217
|
+
referenceLineDashed: '5',
|
|
218
|
+
lowerValueLabel: 'Redemption Cost: ',
|
|
219
|
+
highValueLabel: 'Package Cost: ',
|
|
220
|
+
showLegend: true,
|
|
221
|
+
legendData: [{
|
|
222
|
+
title: 'Package Cost',
|
|
223
|
+
iconType: 'Square',
|
|
224
|
+
iconColor: '#1F7677'
|
|
225
|
+
}, {
|
|
226
|
+
title: 'Redemption Cost',
|
|
227
|
+
iconType: 'Square',
|
|
228
|
+
iconColor: '#90CE9C'
|
|
229
|
+
}]
|
|
230
|
+
};
|
|
231
|
+
const OneColumnOnly = exports.OneColumnOnly = Template.bind({});
|
|
232
|
+
OneColumnOnly.args = {
|
|
233
|
+
title: 'Cost',
|
|
234
|
+
width: '800px',
|
|
235
|
+
height: '500px',
|
|
236
|
+
barChartHeight: 250,
|
|
237
|
+
barSize: 60,
|
|
238
|
+
barChartData: arrDataOneColumnOnly,
|
|
239
|
+
barChartColorFirst: '#90CE9C',
|
|
240
|
+
barChartColorSecond: '#1F7677',
|
|
241
|
+
showDollarSign: true,
|
|
242
|
+
isDollar: true,
|
|
243
|
+
showReferenceLine: true,
|
|
244
|
+
referenceLinePoint: 0,
|
|
245
|
+
referenceLineColor: '#212121',
|
|
246
|
+
referenceLineDashed: '5',
|
|
247
|
+
lowerValueLabel: 'Redemption Cost: ',
|
|
248
|
+
highValueLabel: 'Package Cost: ',
|
|
249
|
+
showLegend: true,
|
|
250
|
+
legendData: [{
|
|
251
|
+
title: 'Package Cost',
|
|
252
|
+
iconType: 'Square',
|
|
253
|
+
iconColor: '#1F7677'
|
|
254
|
+
}, {
|
|
255
|
+
title: 'Redemption Cost',
|
|
256
|
+
iconType: 'Square',
|
|
257
|
+
iconColor: '#90CE9C'
|
|
258
|
+
}]
|
|
133
259
|
};
|
|
@@ -4,15 +4,76 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.Title = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
7
|
+
exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.Title = exports.LegendContainer = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = void 0;
|
|
9
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var
|
|
11
|
-
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
var _PerformanceAnalyticsLegend = require("../PerformanceAnalyticsLegend/PerformanceAnalyticsLegend");
|
|
10
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div`
|
|
11
|
+
font-family: "Poppins", sans-serif;
|
|
12
|
+
width: ${props => props.width};
|
|
13
|
+
height: ${props => props.height};
|
|
14
|
+
border-radius: 12px;
|
|
15
|
+
align-self: center;
|
|
16
|
+
&.NoData {
|
|
17
|
+
align-self: center;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
width: 50%;
|
|
21
|
+
margin: 10% auto 0;
|
|
22
|
+
}
|
|
23
|
+
> * {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
const Controls = exports.Controls = _styledComponents.default.div`
|
|
28
|
+
height: 100%;
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding: 24px 40px;
|
|
31
|
+
background: white;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
@media (max-width: 1536px) {
|
|
35
|
+
padding: 12px 32px;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const Title = exports.Title = _styledComponents.default.span`
|
|
39
|
+
color: #212121;
|
|
40
|
+
display: inline-block;
|
|
41
|
+
font-size: 18px;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
margin-bottom: 14px;
|
|
44
|
+
@media (max-width: 1536px) {
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
}
|
|
47
|
+
@media (max-width: 1366px) {
|
|
48
|
+
font-size: 14px;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
const LegendContainer = exports.LegendContainer = (0, _styledComponents.default)(_PerformanceAnalyticsLegend.PerformanceAnalyticsLegend)`
|
|
52
|
+
margin-top: auto;
|
|
53
|
+
padding-bottom: 16px;
|
|
54
|
+
`;
|
|
55
|
+
const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div`
|
|
56
|
+
border-radius: 5px;
|
|
57
|
+
padding: 8px 12px;
|
|
58
|
+
background: white;
|
|
59
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
|
|
60
|
+
margin: 0;
|
|
61
|
+
`;
|
|
62
|
+
const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div`
|
|
63
|
+
color: #212121;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
line-height: normal;
|
|
67
|
+
width: fit-content;
|
|
68
|
+
`;
|
|
69
|
+
const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div`
|
|
70
|
+
color: #212121;
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
`;
|
|
74
|
+
const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan`
|
|
75
|
+
font-size: 0.7em;
|
|
76
|
+
`;
|
|
77
|
+
const LabelText = exports.LabelText = _styledComponents.default.tspan`
|
|
78
|
+
font-size: 0.6em;
|
|
79
|
+
`;
|
|
@@ -100,7 +100,11 @@ const BarChartsByWeeks = props => {
|
|
|
100
100
|
let currentTooltipSecondValue = 0;
|
|
101
101
|
if ((_payload$0$payload = payload[0].payload) !== null && _payload$0$payload !== void 0 && _payload$0$payload.value) currentTooltipValue = (_payload$0$payload2 = payload[0].payload) === null || _payload$0$payload2 === void 0 ? void 0 : _payload$0$payload2.value;
|
|
102
102
|
if ((_payload$0$payload3 = payload[0].payload) !== null && _payload$0$payload3 !== void 0 && _payload$0$payload3.secondValue) currentTooltipSecondValue = (_payload$0$payload4 = payload[0].payload) === null || _payload$0$payload4 === void 0 ? void 0 : _payload$0$payload4.secondValue;
|
|
103
|
-
return /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.TooltipTitle, null,
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.TooltipTitle, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.TooltipLabel, null, `${tooltipTitle}
|
|
104
|
+
${displayFormattedValue(currentTooltipValue)}
|
|
105
|
+
`), currentTooltipSecondValue ? /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.TooltipLabel, null, `${tooltipSecondTitle}
|
|
106
|
+
${displayFormattedValue(currentTooltipSecondValue)}
|
|
107
|
+
`) : '');
|
|
104
108
|
};
|
|
105
109
|
const getWeek = () => {
|
|
106
110
|
if (!barChartData || (barChartData === null || barChartData === void 0 ? void 0 : barChartData.length) === 0) return null;
|
|
@@ -151,7 +155,7 @@ const BarChartsByWeeks = props => {
|
|
|
151
155
|
if (showLegend) {
|
|
152
156
|
newHeight -= 34;
|
|
153
157
|
}
|
|
154
|
-
return
|
|
158
|
+
return `${newHeight}px`;
|
|
155
159
|
};
|
|
156
160
|
return /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.ControlsContainer, {
|
|
157
161
|
className: className,
|
|
@@ -198,7 +202,7 @@ const BarChartsByWeeks = props => {
|
|
|
198
202
|
fontWeight: 400,
|
|
199
203
|
fontSize: "12px",
|
|
200
204
|
tickLine: false,
|
|
201
|
-
tickFormatter: value =>
|
|
205
|
+
tickFormatter: value => `${displayFormattedValue(value)}`
|
|
202
206
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
203
207
|
content: /*#__PURE__*/_react.default.createElement(CustomTooltip, null)
|
|
204
208
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null), !showTwoBars ? /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|