sag_components 1.0.416 → 1.0.418

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.
Files changed (97) hide show
  1. package/dist/stories/components/CommonFunctions.js +28 -18
  2. package/dist/stories/components/IconButton.js +35 -16
  3. package/dist/stories/components/IconButton.style.js +2 -2
  4. package/dist/stories/components/TotalBenchmarkAreachart.js +82 -55
  5. package/dist/stories/components/TotalBenchmarkAreachart.style.js +1 -1
  6. package/package.json +1 -1
  7. package/.history/.env_20231001120549 +0 -0
  8. package/.history/.env_20231001120613 +0 -1
  9. package/.history/.env_20231003143620 +0 -1
  10. package/.history/.eslintrc_20230928112617.js +0 -26
  11. package/.history/.eslintrc_20230928130534.js +0 -27
  12. package/.history/.eslintrc_20230928133400.js +0 -28
  13. package/.history/.eslintrc_20230928133404.js +0 -28
  14. package/.history/.eslintrc_20230928133416.js +0 -28
  15. package/.history/.eslintrc_20230928133419.js +0 -28
  16. package/.history/.eslintrc_20230928133432.js +0 -28
  17. package/.history/.eslintrc_20230928133439.js +0 -28
  18. package/.history/.eslintrc_20230928133458.js +0 -29
  19. package/.history/.eslintrc_20230928133500.js +0 -28
  20. package/.history/.eslintrc_20230928134009.js +0 -28
  21. package/.history/.eslintrc_20230928135318.js +0 -34
  22. package/.history/.eslintrc_20230928135321.js +0 -34
  23. package/.history/.eslintrc_20230928135323.js +0 -34
  24. package/.history/.eslintrc_20230928135332.js +0 -34
  25. package/.history/.eslintrc_20230928135333.js +0 -34
  26. package/.history/.eslintrc_20230928135352.js +0 -29
  27. package/.history/.eslintrc_20230928135353.js +0 -29
  28. package/.history/.eslintrc_20230928135355.js +0 -29
  29. package/.history/.eslintrc_20230928135408.js +0 -29
  30. package/.history/.eslintrc_20230928135538.js +0 -30
  31. package/.history/.eslintrc_20230928135539.js +0 -30
  32. package/.history/.eslintrc_20230928135543.js +0 -30
  33. package/.history/.gitignore_20230921093332 +0 -119
  34. package/.history/.gitignore_20230921111638 +0 -120
  35. package/.history/.gitignore_20230921111650 +0 -120
  36. package/.history/.gitignore_20230921111810 +0 -121
  37. package/.history/package-lock_20231114111138.json +0 -47810
  38. package/.history/package-lock_20231114111158.json +0 -47802
  39. package/.history/package_20231029152422.json +0 -82
  40. package/.history/package_20231029153420.json +0 -82
  41. package/.history/package_20231029154416.json +0 -82
  42. package/.history/package_20231030094127.json +0 -82
  43. package/.history/package_20231030114707.json +0 -82
  44. package/.history/package_20231030130704.json +0 -82
  45. package/.history/package_20231030132422.json +0 -82
  46. package/.history/package_20231030134051.json +0 -82
  47. package/.history/package_20231030142913.json +0 -82
  48. package/.history/package_20231030143556.json +0 -82
  49. package/.history/package_20231030144210.json +0 -82
  50. package/.history/package_20231101113942.json +0 -82
  51. package/.history/package_20231101114544.json +0 -82
  52. package/.history/package_20231101151518.json +0 -82
  53. package/.history/package_20231101154501.json +0 -82
  54. package/.history/package_20231101155811.json +0 -82
  55. package/.history/package_20231101160235.json +0 -82
  56. package/.history/package_20231101160406.json +0 -82
  57. package/.history/package_20231101161325.json +0 -82
  58. package/.history/package_20231101161333.json +0 -82
  59. package/.history/package_20231102123623.json +0 -82
  60. package/.history/package_20231102125741.json +0 -82
  61. package/.history/package_20231102130857.json +0 -82
  62. package/.history/package_20231102132227.json +0 -82
  63. package/.history/package_20231102142340.json +0 -82
  64. package/.history/package_20231102143256.json +0 -82
  65. package/.history/package_20231105153539.json +0 -82
  66. package/.history/package_20231105154332.json +0 -82
  67. package/.history/package_20231105171201.json +0 -82
  68. package/.history/package_20231106123849.json +0 -82
  69. package/.history/package_20231107170638.json +0 -82
  70. package/.history/package_20231109103647.json +0 -82
  71. package/.history/package_20231109103911.json +0 -82
  72. package/.history/package_20231109105426.json +0 -82
  73. package/.history/package_20231109132014.json +0 -82
  74. package/.history/package_20231109132115.json +0 -82
  75. package/.history/package_20231114100517.json +0 -82
  76. package/.history/package_20231114100859.json +0 -82
  77. package/.history/package_20231114101553.json +0 -82
  78. package/.history/package_20231114102545.json +0 -82
  79. package/.history/package_20231114111208.json +0 -83
  80. package/.history/package_20231114111515.json +0 -83
  81. package/.history/package_20231114112931.json +0 -83
  82. package/.history/package_20231114113014.json +0 -83
  83. package/.history/package_20231114113155.json +0 -83
  84. package/.history/package_20231114124318.json +0 -83
  85. package/.history/package_20231114125107.json +0 -83
  86. package/.history/package_20231114125510.json +0 -83
  87. package/.history/package_20231114132634.json +0 -83
  88. package/.history/package_20231116165815.json +0 -83
  89. package/.history/package_20231116165916.json +0 -83
  90. package/.history/package_20231119113637.json +0 -83
  91. package/.history/package_20231120100907.json +0 -83
  92. package/.history/package_20231121151523.json +0 -77
  93. package/.history/package_20231121155513.json +0 -77
  94. package/.history/package_20231121162434.json +0 -77
  95. package/.history/package_20231122100718.json +0 -77
  96. package/.history/package_20231128125149.json +0 -82
  97. package/.history/package_20231128125208.json +0 -82
@@ -3,18 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getNumberWithCommas = exports.getFormattedValue = exports.getFormattedUnits = exports.getCurrencySign = void 0;
6
+ exports.isNumericValue = exports.getNumberWithCommas = exports.getFormattedValue = exports.getFormattedUnits = exports.getCurrencySign = void 0;
7
7
  const getCurrencySign = (currencyTypeToConvert, value) => {
8
8
  if (value === undefined || value === null) {
9
- return '';
9
+ return "";
10
10
  }
11
11
  if (isNaN(parseFloat(value))) {
12
- return '';
12
+ return "";
13
13
  }
14
- if (!currencyTypeToConvert) return '';
15
- let currencySign = '';
16
- const currencyFormatter = new Intl.NumberFormat('en-US', {
17
- style: 'currency',
14
+ if (!currencyTypeToConvert) return "";
15
+ let currencySign = "";
16
+ const currencyFormatter = new Intl.NumberFormat("en-US", {
17
+ style: "currency",
18
18
  currency: currencyTypeToConvert
19
19
  });
20
20
  currencySign = currencyFormatter.format(Math.abs(value)).substring(0, 1);
@@ -23,21 +23,21 @@ const getCurrencySign = (currencyTypeToConvert, value) => {
23
23
  exports.getCurrencySign = getCurrencySign;
24
24
  const getFormattedUnits = num => {
25
25
  if (num === undefined || num === null) {
26
- return '';
26
+ return "";
27
27
  }
28
28
  if (isNaN(parseFloat(num))) {
29
- return '';
29
+ return "";
30
30
  }
31
31
  if (Math.abs(num) >= 1000000000) {
32
- return 'B';
32
+ return "B";
33
33
  }
34
34
  if (Math.abs(num) >= 1000000) {
35
- return 'M';
35
+ return "M";
36
36
  }
37
37
  if (Math.abs(num) >= 1000) {
38
- return 'K';
38
+ return "K";
39
39
  }
40
- return '';
40
+ return "";
41
41
  };
42
42
  exports.getFormattedUnits = getFormattedUnits;
43
43
  const getFormattedValue = num => {
@@ -50,13 +50,13 @@ const getFormattedValue = num => {
50
50
 
51
51
  // if (typeof num === 'number') {
52
52
  if (Math.abs(num) >= 1000000000) {
53
- return (num / 1000000000).toFixed(1).replace(/\.0$/, '');
53
+ return (num / 1000000000).toFixed(1).replace(/\.0$/, "");
54
54
  }
55
55
  if (Math.abs(num) >= 1000000) {
56
- return (num / 1000000).toFixed(1).replace(/\.0$/, '');
56
+ return (num / 1000000).toFixed(1).replace(/\.0$/, "");
57
57
  }
58
58
  if (Math.abs(num) >= 1000) {
59
- return (num / 1000).toFixed(1).replace(/\.0$/, '');
59
+ return (num / 1000).toFixed(1).replace(/\.0$/, "");
60
60
  }
61
61
  return num;
62
62
  // }
@@ -65,7 +65,17 @@ exports.getFormattedValue = getFormattedValue;
65
65
  const getNumberWithCommas = x => {
66
66
  let param = x.toString();
67
67
  const pattern = /(-?\d+)(\d{3})/;
68
- while (pattern.test(param)) param = param.replace(pattern, '$1,$2');
68
+ while (pattern.test(param)) param = param.replace(pattern, "$1,$2");
69
69
  return param;
70
70
  };
71
- exports.getNumberWithCommas = getNumberWithCommas;
71
+ exports.getNumberWithCommas = getNumberWithCommas;
72
+ const isNumericValue = num => {
73
+ if (num === undefined || num === null) {
74
+ return false;
75
+ }
76
+ if (isNaN(parseFloat(num))) {
77
+ return false;
78
+ }
79
+ return true;
80
+ };
81
+ exports.isNumericValue = isNumericValue;
@@ -17,10 +17,7 @@ var _IconButton = require("./IconButton.style");
17
17
  /* IconButton */
18
18
  const IconButton = props => {
19
19
  const {
20
- // downloadStatus,
21
- fileName,
22
- fileLink,
23
- showProcess,
20
+ downloadStatus,
24
21
  contentColor,
25
22
  buttonText,
26
23
  backgroundColor,
@@ -30,28 +27,30 @@ const IconButton = props => {
30
27
  iconWidth,
31
28
  iconHeight,
32
29
  disabled,
30
+ inProgress,
33
31
  onClick,
34
32
  onCancelClick
35
33
  } = props;
34
+ const [mouseDownPressed, setMouseDownPressed] = (0, _react.useState)(false);
36
35
  const [progress, setProgress] = (0, _react.useState)(0);
37
36
  const incrementProgress = () => {
38
- if (showProcess && progress <= 90) {
37
+ if (downloadStatus === 'in progress' && progress <= 90) {
39
38
  const interval = setInterval(() => {
40
39
  setProgress(prevProgress => {
41
- const newProgress = prevProgress + 3;
40
+ const newProgress = prevProgress + 1;
42
41
  if (newProgress >= 90) {
43
42
  clearInterval(interval);
44
43
  }
45
44
  return newProgress;
46
45
  });
47
46
  }, 500);
48
- } else {
47
+ } else if (downloadStatus === 'success') {
49
48
  setProgress(0);
50
49
  }
51
50
  };
52
51
  (0, _react.useEffect)(() => {
53
52
  incrementProgress();
54
- }, [showProcess]);
53
+ }, [downloadStatus]);
55
54
  const getIcon = icon => {
56
55
  switch (icon) {
57
56
  case 'download':
@@ -100,35 +99,54 @@ const IconButton = props => {
100
99
  return '';
101
100
  }
102
101
  };
102
+ const onMouseDownHandler = () => {
103
+ if (disabled) return;
104
+ setMouseDownPressed(true);
105
+ };
106
+ const onMouseUpHandler = () => {
107
+ if (disabled) return;
108
+ setMouseDownPressed(false);
109
+ };
110
+ const onPointerOutHandler = () => {
111
+ if (disabled) return;
112
+ if (!mouseDownPressed) return;
113
+ setMouseDownPressed(false);
114
+ };
115
+ const getClassNameExtention = () => {
116
+ if (disabled) return 'disabled';
117
+ if (mouseDownPressed) return 'mouseDownPressed';
118
+ return '';
119
+ };
103
120
  const onClickHandler = event => {
121
+ if (disabled) return;
104
122
  onClick(event);
105
123
  };
106
124
  const onCancelClickHandler = event => {
107
125
  onCancelClick(event);
108
126
  };
109
127
  return /*#__PURE__*/_react.default.createElement(_IconButton.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_IconButton.IconButtonContainer, {
110
- download: fileName,
111
- href: fileLink,
128
+ className: getClassNameExtention(),
112
129
  backgroundColor: backgroundColor,
113
130
  borderColor: borderColor,
114
131
  borderRadius: borderRadius,
115
132
  color: contentColor,
116
- inProgress: showProcess,
133
+ onMouseDown: onMouseDownHandler,
134
+ onMouseUp: onMouseUpHandler,
135
+ onPointerOut: onPointerOutHandler,
136
+ inProgress: inProgress,
117
137
  progress: progress,
118
138
  onClick: event => {
119
139
  onClickHandler(event);
120
140
  }
121
- }, getIcon(iconName), buttonText !== '' && buttonText !== undefined && /*#__PURE__*/_react.default.createElement(_IconButton.SpanText, null, buttonText)), showProcess && /*#__PURE__*/_react.default.createElement(_IconButton.CancelClick, {
141
+ }, getIcon(iconName), buttonText !== '' && buttonText !== undefined && /*#__PURE__*/_react.default.createElement(_IconButton.SpanText, null, buttonText)), inProgress && /*#__PURE__*/_react.default.createElement(_IconButton.CancelClick, {
122
142
  onClick: event => onCancelClickHandler(event)
123
143
  }, "Click here to cancel"));
124
144
  };
125
145
  exports.IconButton = IconButton;
126
146
  var _default = exports.default = IconButton;
127
147
  IconButton.defaultProps = {
128
- // downloadStatus: '',
129
- fileName: '',
130
- fileLink: '',
131
- showProcess: false,
148
+ // downloadStatus: 'fail',
149
+ downloadStatus: 'in progress',
132
150
  buttonText: '',
133
151
  iconName: 'eye',
134
152
  contentColor: '#212121',
@@ -138,6 +156,7 @@ IconButton.defaultProps = {
138
156
  iconHeight: 18,
139
157
  iconWidth: 18,
140
158
  disabled: false,
159
+ inProgress: false,
141
160
  onClick: () => {},
142
161
  onCancelClick: () => {}
143
162
  };
@@ -10,6 +10,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
10
10
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
11
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
12
12
  const ButtonWrapper = exports.ButtonWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: fit-content;\n text-align: center;\n"])));
13
- const IconButtonContainer = exports.IconButtonContainer = _styledComponents.default.a(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 14px;\n font-weight: 400;\n display: flex;\n gap: 10px;\n align-items: center;\n justify-content: center;\n padding: 12px 20px;\n margin-bottom: 5px;\n text-decoration: none;\n color: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n background: ", ";\n position: relative;\n transition: all .3s;\n ", "\n &:hover, &:focus {\n cursor: pointer;\n box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);\n }\n"])), props => props.color, props => props.borderRadius, props => props.borderColor.toString(), props => props.backgroundColor.toString(), props => props.inProgress && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n pointer-events: none;\n &:after {\n content: 'In Progress';\n display: flex;\n align-items: center;\n justify-content: center;\n text-wrap: nowrap;\n position: absolute;\n background: linear-gradient(\n to right,\n #5FCC70 ", "%,\n #B1B1B1 ", "%,\n #B1B1B1 100%\n );\n width: 100%;\n height: 100%;\n border-radius: ", ";\n border-width: 0;\n z-index: 9;\n }\n "])), props.progress, props.progress + 1, props => props.borderRadius));
13
+ const IconButtonContainer = exports.IconButtonContainer = _styledComponents.default.button(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 14px;\n font-weight: 400;\n display: flex;\n gap: 10px;\n align-items: center;\n justify-content: center;\n padding: 12px 20px;\n margin-bottom: 5px;\n color: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n background: ", ";\n position: relative;\n transition: all .3s;\n ", "\n &:hover, &:focus {\n cursor: pointer;\n box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);\n }\n"])), props => props.color, props => props.borderRadius, props => props.borderColor.toString(), props => props.backgroundColor.toString(), props => props.inProgress && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n pointer-events: none;\n &:after {\n content: 'In Progress';\n display: flex;\n align-items: center;\n justify-content: center;\n text-wrap: nowrap;\n position: absolute;\n background: linear-gradient(\n to right,\n #5FCC70 ", "%,\n #B1B1B1 ", "%,\n #B1B1B1 100%\n );\n width: 100%;\n height: 100%;\n border-radius: ", ";\n border-width: 0;\n z-index: 9;\n }\n "])), props.progress, props.progress + 1, props => props.borderRadius));
14
14
  const SpanText = exports.SpanText = _styledComponents.default.span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n"])));
15
- const CancelClick = exports.CancelClick = _styledComponents.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: inherit;\n font-family: \"Lato\", sans-serif;;\n font-size: 14px;\n color: #568202;\n cursor: pointer;\n"])));
15
+ const CancelClick = exports.CancelClick = _styledComponents.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: inherit;\n font-family: \"Lato\", sans-serif;;\n font-size: 14px;\n color: #568202;\n"])));
@@ -10,9 +10,9 @@ var _recharts = require("recharts");
10
10
  var _ArrowUpIcon = require("./icons/ArrowUpIcon");
11
11
  var _ArrowDownIcon = require("./icons/ArrowDownIcon");
12
12
  var _NoDataFoundMessage = require("./NoDataFoundMessage");
13
+ var _CommonFunctions = require("./CommonFunctions");
13
14
  var _Benchmark = require("./Benchmark");
14
15
  var _TotalBenchmarkAreachart = require("./TotalBenchmarkAreachart.style");
15
- var _CommonFunctions = require("./CommonFunctions");
16
16
  /* TotalBenchmarkAreachart */
17
17
  const TotalBenchmarkAreachart = props => {
18
18
  const {
@@ -36,14 +36,16 @@ const TotalBenchmarkAreachart = props => {
36
36
  opacity,
37
37
  value1Title,
38
38
  value2Title,
39
- noDataText
39
+ noDataText,
40
+ startWeekRange = 0,
41
+ endWeekRange = 0
40
42
  } = props;
41
43
  const DEFAULT_ROOT_FONT = 16;
42
44
  const DEFAULT_COMPONENT_WIDTH = 250;
43
45
  const DEFAULT_COMPONENT_HEIGHT = 280;
44
- const [rootFont, setRootFont] = (0, _react.useState)(DEFAULT_ROOT_FONT.toString().concat('', 'px'));
46
+ const [rootFont, setRootFont] = (0, _react.useState)(DEFAULT_ROOT_FONT.toString().concat("", "px"));
45
47
  const anotherRef = (0, _react.useRef)(null);
46
- const [activeLabel, setActiveLabel] = (0, _react.useState)('');
48
+ const [activeLabel, setActiveLabel] = (0, _react.useState)("");
47
49
  const controlsContainerRef = (0, _react.useRef)();
48
50
  (0, _react.useEffect)(() => {
49
51
  const {
@@ -52,16 +54,16 @@ const TotalBenchmarkAreachart = props => {
52
54
  setRootFont(getRootFont(offsetWidth));
53
55
  }, [width]);
54
56
  const getRootFont = width => {
55
- const relation = width.toString().replace('px', '').replace('%', '') / DEFAULT_COMPONENT_WIDTH;
56
- const fontRoot = (DEFAULT_ROOT_FONT * relation).toString().concat('', 'px');
57
+ const relation = width.toString().replace("px", "").replace("%", "") / DEFAULT_COMPONENT_WIDTH;
58
+ const fontRoot = (DEFAULT_ROOT_FONT * relation).toString().concat("", "px");
57
59
  return fontRoot;
58
60
  };
59
- const getSizeFactor = () => rootFont.toString().replace('px', '') / DEFAULT_ROOT_FONT;
61
+ const getSizeFactor = () => rootFont.toString().replace("px", "") / DEFAULT_ROOT_FONT;
60
62
  const getArrowSign = arrowSign => {
61
63
  if (!arrowSign) {
62
- return '';
64
+ return "";
63
65
  }
64
- if (arrowSign === 'up') {
66
+ if (arrowSign === "up") {
65
67
  return /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.DetailsRowArrowContainer, {
66
68
  id: "DetailsRowArrowContainer",
67
69
  value: value
@@ -78,24 +80,49 @@ const TotalBenchmarkAreachart = props => {
78
80
  height: 25 * getSizeFactor()
79
81
  }));
80
82
  };
81
- const CustomTick = _ref => {
82
- let {
83
+ const CustomTick = item => {
84
+ var _payload$value, _payload$value2, _payload$value3;
85
+ const {
83
86
  x,
84
87
  y,
85
88
  stroke,
86
89
  payload
87
- } = _ref;
90
+ } = item;
91
+ const currentWeek = (payload === null || payload === void 0 ? void 0 : (_payload$value = payload.value) === null || _payload$value === void 0 ? void 0 : _payload$value.length) > 1 ? payload === null || payload === void 0 ? void 0 : (_payload$value2 = payload.value) === null || _payload$value2 === void 0 ? void 0 : _payload$value2.substring(1, payload === null || payload === void 0 ? void 0 : (_payload$value3 = payload.value) === null || _payload$value3 === void 0 ? void 0 : _payload$value3.length) : 0;
92
+ console.log("payload?.value", currentWeek);
93
+ if (!(0, _CommonFunctions.isNumericValue)(currentWeek) || !(0, _CommonFunctions.isNumericValue)(startWeekRange) || !(0, _CommonFunctions.isNumericValue)(endWeekRange)) {
94
+ return;
95
+ }
96
+ const currentWeekNumeric = Number(currentWeek);
97
+ const startWeekRangeNumeric = Number(startWeekRange);
98
+ const endWeekRangeNumeric = Number(endWeekRange);
88
99
  return /*#__PURE__*/_react.default.createElement("g", {
89
100
  transform: "translate(".concat(x, ",").concat(y, ")")
90
- }, activeLabel === payload.value && /*#__PURE__*/_react.default.createElement("rect", {
101
+ }, currentWeekNumeric === startWeekRangeNumeric || currentWeekNumeric === startWeekRangeNumeric - 1 ? /*#__PURE__*/_react.default.createElement("rect", {
91
102
  x: -15,
92
103
  y: 0,
93
- width: "40",
104
+ width: "70",
94
105
  height: "18",
95
106
  rx: 9,
96
- fill: xselectedColor,
97
- fillOpacity: "0.30"
98
- }), /*#__PURE__*/_react.default.createElement("text", {
107
+ fill: xselectedColor
108
+ //fillOpacity="0.30"
109
+ }) : currentWeekNumeric > startWeekRangeNumeric && currentWeekNumeric < endWeekRangeNumeric ? /*#__PURE__*/_react.default.createElement("rect", {
110
+ x: -30,
111
+ y: 0,
112
+ width: "80",
113
+ height: "18",
114
+ rx: 9,
115
+ fill: xselectedColor
116
+ //fillOpacity="0.30"
117
+ }) : currentWeekNumeric === endWeekRangeNumeric || currentWeekNumeric === endWeekRangeNumeric + 1 ? /*#__PURE__*/_react.default.createElement("rect", {
118
+ x: -30,
119
+ y: 0,
120
+ width: "55",
121
+ height: "18",
122
+ rx: 9,
123
+ fill: xselectedColor
124
+ //fillOpacity="0.30"
125
+ }) : "", /*#__PURE__*/_react.default.createElement("text", {
99
126
  x: 0,
100
127
  y: 14,
101
128
  dx: -10,
@@ -103,12 +130,12 @@ const TotalBenchmarkAreachart = props => {
103
130
  fontSize: "14px"
104
131
  }, payload.value));
105
132
  };
106
- const CustomTooltip = _ref2 => {
133
+ const CustomTooltip = _ref => {
107
134
  let {
108
135
  active,
109
136
  payload,
110
137
  label
111
- } = _ref2;
138
+ } = _ref;
112
139
  if (active && payload && payload.length) {
113
140
  setActiveLabel(label);
114
141
  return /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.TooltipTitle, null, "".concat(label)), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.TooltipLabel, null, "".concat(value1Title, " ").concat((0, _CommonFunctions.getFormattedValue)(payload[0].value)).concat((0, _CommonFunctions.getFormattedUnits)(payload[0].value))), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.TooltipLabel, null, "".concat(value2Title, " ").concat((0, _CommonFunctions.getFormattedValue)(payload[1].value)).concat((0, _CommonFunctions.getFormattedUnits)(payload[1].value))));
@@ -129,9 +156,9 @@ const TotalBenchmarkAreachart = props => {
129
156
  id: "Title"
130
157
  }, title), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.ValueAndBenchmarkContainer, {
131
158
  id: "ValueAndBenchmarkContainer"
132
- }, value !== undefined && value != null ? getArrowSign(arrowSign) : '', /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.FormattedValue, {
159
+ }, value !== undefined && value != null ? getArrowSign(arrowSign) : "", /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.FormattedValue, {
133
160
  id: "FormattedValue"
134
- }, value !== undefined && value != null ? /*#__PURE__*/_react.default.createElement("span", null, "".concat(value, " "), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.CurrencySign, null, "%")) : ''), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.FormattedValueNoDataMessage, null, value === undefined || value === null ? 'No Data' : ''), addingBenchmark && benchmarkTotalValue ? /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.BenchmarkContainer, {
161
+ }, value !== undefined && value != null ? /*#__PURE__*/_react.default.createElement("span", null, "".concat(value, " "), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.CurrencySign, null, "%")) : ""), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.FormattedValueNoDataMessage, null, value === undefined || value === null ? "No Data" : ""), addingBenchmark && benchmarkTotalValue ? /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.BenchmarkContainer, {
135
162
  id: "BenchmarkContainer"
136
163
  }, /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, {
137
164
  id: "Benchmark",
@@ -145,7 +172,7 @@ const TotalBenchmarkAreachart = props => {
145
172
  linearGradientUnderAvarageColor: "#FDB1B1",
146
173
  underAvarageColor: "#FD5959",
147
174
  backgroundColor: "#F2F2F2"
148
- })) : '')), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.AreaChartContainer, {
175
+ })) : "")), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.AreaChartContainer, {
149
176
  ref: anotherRef,
150
177
  id: "AreaChartContainer"
151
178
  }, /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
@@ -197,9 +224,9 @@ const TotalBenchmarkAreachart = props => {
197
224
  tick: item => /*#__PURE__*/_react.default.createElement(CustomTick, item),
198
225
  tickLine: false,
199
226
  style: {
200
- fontWeight: '700',
201
- stroke: '#D0D0D0',
202
- strokeWidth: '1px'
227
+ fontWeight: "700",
228
+ stroke: "#D0D0D0",
229
+ strokeWidth: "1px"
203
230
  }
204
231
  }), /*#__PURE__*/_react.default.createElement(_recharts.CartesianGrid, {
205
232
  strokeDasharray: "3 3"
@@ -224,77 +251,77 @@ const TotalBenchmarkAreachart = props => {
224
251
  exports.TotalBenchmarkAreachart = TotalBenchmarkAreachart;
225
252
  var _default = exports.default = TotalBenchmarkAreachart;
226
253
  TotalBenchmarkAreachart.defaultProps = {
227
- title: 'String',
254
+ title: "String",
228
255
  value: 300,
229
- arrowSign: '$',
256
+ arrowSign: "$",
230
257
  addingBenchmark: true,
231
- benchmarkTotalValue: '',
258
+ benchmarkTotalValue: "",
232
259
  benchmarkValue: null,
233
260
  areaChartData: [{
234
- title: 'W20',
261
+ title: "W20",
235
262
  value1: 542366,
236
263
  value2: 247715
237
264
  }, {
238
- title: 'W21',
265
+ title: "W21",
239
266
  value1: 699511,
240
267
  value2: 252313
241
268
  }, {
242
- title: 'W22',
269
+ title: "W22",
243
270
  value1: 403092,
244
271
  value2: 260822
245
272
  }, {
246
- title: 'W23',
273
+ title: "W23",
247
274
  value1: 396184,
248
275
  value2: 264325
249
276
  }, {
250
- title: 'W24',
277
+ title: "W24",
251
278
  value1: 415317,
252
279
  value2: 269243
253
280
  }, {
254
- title: 'W25',
281
+ title: "W25",
255
282
  value1: 568376,
256
283
  value2: 269592
257
284
  }, {
258
- title: 'W26',
285
+ title: "W26",
259
286
  value1: 1078121,
260
287
  value2: 269949
261
288
  }, {
262
- title: 'W27',
289
+ title: "W27",
263
290
  value1: 347930,
264
291
  value2: 270735
265
292
  }, {
266
- title: 'W28',
293
+ title: "W28",
267
294
  value1: 346258,
268
295
  value2: 271200
269
296
  }, {
270
- title: 'W29',
297
+ title: "W29",
271
298
  value1: 350184,
272
299
  value2: 270324
273
300
  }, {
274
- title: 'W30',
301
+ title: "W30",
275
302
  value1: 312790,
276
303
  value2: 266821
277
304
  }, {
278
- title: 'W31',
305
+ title: "W31",
279
306
  value1: 335076,
280
307
  value2: 267064
281
308
  }, {
282
- title: 'W32',
309
+ title: "W32",
283
310
  value1: 311037,
284
311
  value2: 266821
285
312
  }],
286
- width: '100%',
287
- height: '100%',
288
- textcolor: '#212121',
289
- areaChart1Color: '#BD9EFF',
290
- areaChart2Color: '#96B4FF',
291
- xselectedColor: '#42977A',
292
- fillChart1Color: 'rgba(34, 158, 56, 0.20)',
293
- fillChart2Color: 'rgba(255, 84, 84, 0.2)',
294
- startOffset: '17.04%',
295
- endOffset: '17.04%',
296
- opacity: '191',
297
- value1Title: 'Actual Sales',
298
- value2Title: 'Baseline Sales',
299
- noDataText: ''
313
+ width: "100%",
314
+ height: "100%",
315
+ textcolor: "#212121",
316
+ areaChart1Color: "#BD9EFF",
317
+ areaChart2Color: "#96B4FF",
318
+ xselectedColor: "#42977A",
319
+ fillChart1Color: "rgba(34, 158, 56, 0.20)",
320
+ fillChart2Color: "rgba(255, 84, 84, 0.2)",
321
+ startOffset: "17.04%",
322
+ endOffset: "17.04%",
323
+ opacity: "191",
324
+ value1Title: "Actual Sales",
325
+ value2Title: "Baseline Sales",
326
+ noDataText: ""
300
327
  };
@@ -20,5 +20,5 @@ const ValueAndBenchmarkContainer = exports.ValueAndBenchmarkContainer = _styledC
20
20
  const DetailsRowArrowContainer = exports.DetailsRowArrowContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: flex-end;\n width: 22px;\n @media (max-width: 1366px) {\n width: 12px;\n }\n @media (max-width: 1536px) {\n width: 14px;\n }\n"])));
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
- 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"])));
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
24
  const BenchmarkContainer = exports.BenchmarkContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 1.5rem;\n"])));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.416",
3
+ "version": "1.0.418",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
File without changes
@@ -1 +0,0 @@
1
- STORYBOOK_FIGMA_ACCESS_TOKEN=figd_YdAmQQKQ2B6ZngEijA0JiqNNUdJvP23G46NK7-fc
@@ -1 +0,0 @@
1
- STORYBOOK_FIGMA_ACCESS_TOKEN=figd_MOcc8-aS91XJ3mFdtNlH4oPVY73ChHlmw6-hKhsb
@@ -1,26 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true,
5
- },
6
- extends: 'airbnb',
7
- overrides: [
8
- {
9
- env: {
10
- node: true,
11
- },
12
- files: [
13
- '.eslintrc.{js,cjs}',
14
- ],
15
- parserOptions: {
16
- sourceType: 'script',
17
- },
18
- },
19
- ],
20
- parserOptions: {
21
- ecmaVersion: 'latest',
22
- sourceType: 'module',
23
- },
24
- rules: {
25
- },
26
- };
@@ -1,27 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true,
5
- },
6
- extends: 'airbnb',
7
- overrides: [
8
- {
9
- env: {
10
- node: true,
11
- },
12
- files: [
13
- '.eslintrc.{js,cjs}',
14
- ],
15
- parserOptions: {
16
- sourceType: 'script',
17
- },
18
- },
19
- ],
20
- parserOptions: {
21
- ecmaVersion: 'latest',
22
- sourceType: 'module',
23
- },
24
- rules: {
25
- 'max-len': 'off',
26
- },
27
- };
@@ -1,28 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true,
5
- },
6
- extends: 'airbnb',
7
- overrides: [
8
- {
9
- env: {
10
- node: true,
11
- },
12
- files: [
13
- '.eslintrc.{js,cjs}',
14
- ],
15
- parserOptions: {
16
- sourceType: 'script',
17
- },
18
- },
19
- ],
20
- parserOptions: {
21
- ecmaVersion: 'latest',
22
- sourceType: 'module',
23
- },
24
- rules: {
25
- 'max-len': 'off',
26
- /*eslint linebreak-style: ["error", "windows"]*/
27
- },
28
- };
@@ -1,28 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true,
5
- },
6
- extends: 'airbnb',
7
- overrides: [
8
- {
9
- env: {
10
- node: true,
11
- },
12
- files: [
13
- '.eslintrc.{js,cjs}',
14
- ],
15
- parserOptions: {
16
- sourceType: 'script',
17
- },
18
- },
19
- ],
20
- parserOptions: {
21
- ecmaVersion: 'latest',
22
- sourceType: 'module',
23
- },
24
- rules: {
25
- 'max-len': 'off',
26
- eslint linebreak-style: ["error", "windows"]
27
- },
28
- };
@@ -1,28 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true,
5
- },
6
- extends: 'airbnb',
7
- overrides: [
8
- {
9
- env: {
10
- node: true,
11
- },
12
- files: [
13
- '.eslintrc.{js,cjs}',
14
- ],
15
- parserOptions: {
16
- sourceType: 'script',
17
- },
18
- },
19
- ],
20
- parserOptions: {
21
- ecmaVersion: 'latest',
22
- sourceType: 'module',
23
- },
24
- rules: {
25
- 'max-len': 'off',
26
- linebreak-style: ["error", "windows"]
27
- },
28
- };