sag_components 1.0.946 → 1.0.948

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.
@@ -16,6 +16,8 @@ var _HannafordChartIcon = _interopRequireDefault(require("./icons/HannafordChart
16
16
  var _CommonFunctions = require("./CommonFunctions");
17
17
  var _BarChartWithAreaChart = require("./BarChartWithAreaChart.style");
18
18
  var _PerformanceAnalyticsLegend = _interopRequireDefault(require("./PerformanceAnalyticsLegend"));
19
+ /* eslint-disable consistent-return */
20
+ /* eslint-disable default-case */
19
21
  /* eslint-disable react/prop-types */
20
22
  /* eslint-disable no-shadow */
21
23
  /* eslint-disable react/no-unstable-nested-components */
@@ -28,6 +30,7 @@ const BarChartWithAreaChart = props => {
28
30
  title,
29
31
  barChartData,
30
32
  barSize,
33
+ barFontSizeValue,
31
34
  signType,
32
35
  width,
33
36
  height,
@@ -142,7 +145,7 @@ const BarChartWithAreaChart = props => {
142
145
  y: y,
143
146
  dy: -8,
144
147
  fill: stroke,
145
- fontSize: "0.6em",
148
+ fontSize: barFontSizeValue,
146
149
  textAnchor: "middle"
147
150
  }, "0");
148
151
  }
@@ -152,7 +155,7 @@ const BarChartWithAreaChart = props => {
152
155
  y: y + viewBox.height,
153
156
  dy: -8,
154
157
  fill: stroke,
155
- fontSize: "0.6em",
158
+ fontSize: barFontSizeValue,
156
159
  textAnchor: "middle"
157
160
  }, displayFormattedValue(value, signType));
158
161
  }
@@ -161,7 +164,7 @@ const BarChartWithAreaChart = props => {
161
164
  y: y,
162
165
  dy: -8,
163
166
  fill: stroke,
164
- fontSize: "0.6em",
167
+ fontSize: barFontSizeValue,
165
168
  textAnchor: "middle"
166
169
  }, displayFormattedValue(value, signType));
167
170
  };
@@ -249,6 +252,7 @@ BarChartWithAreaChart.defaultProps = {
249
252
  width: '100%',
250
253
  height: '100%',
251
254
  barSize: 60,
255
+ barFontSizeValue: '14px',
252
256
  barChartColor: '#BD9EFF',
253
257
  showLegend: true,
254
258
  signType: 'dollar',
@@ -9,23 +9,30 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _LegendUnionIcon = require("./icons/LegendUnionIcon");
10
10
  var _LegendLineIcon = require("./icons/LegendLineIcon");
11
11
  var _PerformanceAnalyticsLegend = require("./PerformanceAnalyticsLegend.style");
12
+ /* eslint-disable no-nested-ternary */
13
+
12
14
  const ICON_TYPE_SQUARE = 'Square';
13
15
  const ICON_TYPE_LEGEND_UNION_ICON = 'LegendUnionIcon';
14
16
  const ICON_TYPE_LEGEND_LINE_ICON = 'LegendLineIcon';
15
-
16
- /* PerformanceAnalyticsLegend */
17
17
  const PerformanceAnalyticsLegend = props => {
18
18
  const {
19
+ className,
19
20
  legendData,
20
21
  width,
21
22
  height
22
23
  } = props;
23
- const getLegendData = () => /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.LegendDataContainer, {
24
+ return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.ControlsContainer, {
25
+ className: className,
26
+ height: height,
27
+ width: width
28
+ }, (legendData === null || legendData === void 0 ? void 0 : legendData.length) > 0 ? /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.Controls, {
29
+ height: height,
30
+ width: width
31
+ }, /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.LegendDataContainer, {
24
32
  id: "LegendDataContainer"
25
33
  }, legendData === null || legendData === void 0 ? void 0 : legendData.map((item, i) => /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.TitleAndIconContainer, {
26
34
  key: `${item.title + i}`
27
35
  }, item.iconType === ICON_TYPE_SQUARE ? /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.LegendColorRectangle, {
28
- id: "LegendColorRectangle",
29
36
  color: item.iconColor
30
37
  }) : item.iconType === ICON_TYPE_LEGEND_UNION_ICON ? /*#__PURE__*/_react.default.createElement(_LegendUnionIcon.LegendUnionIcon, {
31
38
  width: 30,
@@ -36,18 +43,12 @@ const PerformanceAnalyticsLegend = props => {
36
43
  }) : '', /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.Title, {
37
44
  id: "Title",
38
45
  width: width
39
- }, item.title))));
40
- return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.ControlsContainer, {
41
- height: height,
42
- width: width
43
- }, (legendData === null || legendData === void 0 ? void 0 : legendData.length) > 0 ? /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.Controls, {
44
- height: height,
45
- width: width
46
- }, getLegendData()) : '');
46
+ }, item.title))))) : '');
47
47
  };
48
48
  exports.PerformanceAnalyticsLegend = PerformanceAnalyticsLegend;
49
49
  var _default = exports.default = PerformanceAnalyticsLegend;
50
50
  PerformanceAnalyticsLegend.defaultProps = {
51
+ className: 'PerformanceAnalyticsLegend',
51
52
  width: '',
52
53
  height: '',
53
54
  legendData: [{
@@ -9,7 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _recharts = require("recharts");
10
10
  var _NoDataFoundMessage = require("./NoDataFoundMessage");
11
11
  var _SingleBarLineCharts = require("./SingleBarLineCharts.style");
12
- var _PerformanceAnalyticsLegend = require("./PerformanceAnalyticsLegend");
13
12
  var _CommonFunctions = require("./CommonFunctions");
14
13
  /* eslint-disable no-unused-vars */
15
14
  /* eslint-disable react/no-unstable-nested-components */
@@ -295,7 +294,7 @@ const SingleBarLineCharts = props => {
295
294
  fill: "#212121",
296
295
  dataKey: "secondBarValue",
297
296
  content: CustomizedLabelBarchart
298
- })))), showLegend && /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.PerformanceAnalyticsLegend, {
297
+ })))), showLegend && /*#__PURE__*/_react.default.createElement(_SingleBarLineCharts.LegendContainer, {
299
298
  legendData: legendData
300
299
  })) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
301
300
  noDataText: noDataText
@@ -4,9 +4,10 @@ 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.SegmentedButtonContainer = exports.LinnerDataBoxWrap = exports.LabelText = exports.LabelBoldText = exports.CustomTooltip = exports.ControlsContainer = exports.Controls = void 0;
7
+ exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.Title = exports.SegmentedButtonContainer = exports.LinnerDataBoxWrap = exports.LegendContainer = exports.LabelText = exports.LabelBoldText = exports.CustomTooltip = exports.ControlsContainer = exports.Controls = void 0;
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
  var _LinnerDataBox = require("./LinnerDataBox");
10
+ var _PerformanceAnalyticsLegend = require("./PerformanceAnalyticsLegend");
10
11
  const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div`
11
12
  font-family: "Poppins", sans-serif;
12
13
  font-size: ${props => props.rootFont};
@@ -90,4 +91,8 @@ const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div`
90
91
  color: #212121;
91
92
  font-size: 14px;
92
93
  font-weight: 600;
94
+ `;
95
+ const LegendContainer = exports.LegendContainer = (0, _styledComponents.default)(_PerformanceAnalyticsLegend.PerformanceAnalyticsLegend)`
96
+ margin-top: auto;
97
+ padding-bottom: 16px;
93
98
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.946",
3
+ "version": "1.0.948",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {