sag_components 1.0.416 → 1.0.417
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/stories/components/CommonFunctions.js +28 -18
- package/dist/stories/components/IconButton.js +35 -16
- package/dist/stories/components/IconButton.style.js +2 -2
- package/dist/stories/components/TotalBenchmarkAreachart.js +79 -55
- package/dist/stories/components/TotalBenchmarkAreachart.style.js +1 -1
- package/package.json +1 -1
- package/.history/.env_20231001120549 +0 -0
- package/.history/.env_20231001120613 +0 -1
- package/.history/.env_20231003143620 +0 -1
- package/.history/.eslintrc_20230928112617.js +0 -26
- package/.history/.eslintrc_20230928130534.js +0 -27
- package/.history/.eslintrc_20230928133400.js +0 -28
- package/.history/.eslintrc_20230928133404.js +0 -28
- package/.history/.eslintrc_20230928133416.js +0 -28
- package/.history/.eslintrc_20230928133419.js +0 -28
- package/.history/.eslintrc_20230928133432.js +0 -28
- package/.history/.eslintrc_20230928133439.js +0 -28
- package/.history/.eslintrc_20230928133458.js +0 -29
- package/.history/.eslintrc_20230928133500.js +0 -28
- package/.history/.eslintrc_20230928134009.js +0 -28
- package/.history/.eslintrc_20230928135318.js +0 -34
- package/.history/.eslintrc_20230928135321.js +0 -34
- package/.history/.eslintrc_20230928135323.js +0 -34
- package/.history/.eslintrc_20230928135332.js +0 -34
- package/.history/.eslintrc_20230928135333.js +0 -34
- package/.history/.eslintrc_20230928135352.js +0 -29
- package/.history/.eslintrc_20230928135353.js +0 -29
- package/.history/.eslintrc_20230928135355.js +0 -29
- package/.history/.eslintrc_20230928135408.js +0 -29
- package/.history/.eslintrc_20230928135538.js +0 -30
- package/.history/.eslintrc_20230928135539.js +0 -30
- package/.history/.eslintrc_20230928135543.js +0 -30
- package/.history/.gitignore_20230921093332 +0 -119
- package/.history/.gitignore_20230921111638 +0 -120
- package/.history/.gitignore_20230921111650 +0 -120
- package/.history/.gitignore_20230921111810 +0 -121
- package/.history/package-lock_20231114111138.json +0 -47810
- package/.history/package-lock_20231114111158.json +0 -47802
- package/.history/package_20231029152422.json +0 -82
- package/.history/package_20231029153420.json +0 -82
- package/.history/package_20231029154416.json +0 -82
- package/.history/package_20231030094127.json +0 -82
- package/.history/package_20231030114707.json +0 -82
- package/.history/package_20231030130704.json +0 -82
- package/.history/package_20231030132422.json +0 -82
- package/.history/package_20231030134051.json +0 -82
- package/.history/package_20231030142913.json +0 -82
- package/.history/package_20231030143556.json +0 -82
- package/.history/package_20231030144210.json +0 -82
- package/.history/package_20231101113942.json +0 -82
- package/.history/package_20231101114544.json +0 -82
- package/.history/package_20231101151518.json +0 -82
- package/.history/package_20231101154501.json +0 -82
- package/.history/package_20231101155811.json +0 -82
- package/.history/package_20231101160235.json +0 -82
- package/.history/package_20231101160406.json +0 -82
- package/.history/package_20231101161325.json +0 -82
- package/.history/package_20231101161333.json +0 -82
- package/.history/package_20231102123623.json +0 -82
- package/.history/package_20231102125741.json +0 -82
- package/.history/package_20231102130857.json +0 -82
- package/.history/package_20231102132227.json +0 -82
- package/.history/package_20231102142340.json +0 -82
- package/.history/package_20231102143256.json +0 -82
- package/.history/package_20231105153539.json +0 -82
- package/.history/package_20231105154332.json +0 -82
- package/.history/package_20231105171201.json +0 -82
- package/.history/package_20231106123849.json +0 -82
- package/.history/package_20231107170638.json +0 -82
- package/.history/package_20231109103647.json +0 -82
- package/.history/package_20231109103911.json +0 -82
- package/.history/package_20231109105426.json +0 -82
- package/.history/package_20231109132014.json +0 -82
- package/.history/package_20231109132115.json +0 -82
- package/.history/package_20231114100517.json +0 -82
- package/.history/package_20231114100859.json +0 -82
- package/.history/package_20231114101553.json +0 -82
- package/.history/package_20231114102545.json +0 -82
- package/.history/package_20231114111208.json +0 -83
- package/.history/package_20231114111515.json +0 -83
- package/.history/package_20231114112931.json +0 -83
- package/.history/package_20231114113014.json +0 -83
- package/.history/package_20231114113155.json +0 -83
- package/.history/package_20231114124318.json +0 -83
- package/.history/package_20231114125107.json +0 -83
- package/.history/package_20231114125510.json +0 -83
- package/.history/package_20231114132634.json +0 -83
- package/.history/package_20231116165815.json +0 -83
- package/.history/package_20231116165916.json +0 -83
- package/.history/package_20231119113637.json +0 -83
- package/.history/package_20231120100907.json +0 -83
- package/.history/package_20231121151523.json +0 -77
- package/.history/package_20231121155513.json +0 -77
- package/.history/package_20231121162434.json +0 -77
- package/.history/package_20231122100718.json +0 -77
- package/.history/package_20231128125149.json +0 -82
- 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(
|
|
17
|
-
style:
|
|
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
|
|
32
|
+
return "B";
|
|
33
33
|
}
|
|
34
34
|
if (Math.abs(num) >= 1000000) {
|
|
35
|
-
return
|
|
35
|
+
return "M";
|
|
36
36
|
}
|
|
37
37
|
if (Math.abs(num) >= 1000) {
|
|
38
|
-
return
|
|
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,
|
|
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
|
-
|
|
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 (
|
|
37
|
+
if (downloadStatus === 'in progress' && progress <= 90) {
|
|
39
38
|
const interval = setInterval(() => {
|
|
40
39
|
setProgress(prevProgress => {
|
|
41
|
-
const newProgress = prevProgress +
|
|
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
|
-
}, [
|
|
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
|
-
|
|
111
|
-
href: fileLink,
|
|
128
|
+
className: getClassNameExtention(),
|
|
112
129
|
backgroundColor: backgroundColor,
|
|
113
130
|
borderColor: borderColor,
|
|
114
131
|
borderRadius: borderRadius,
|
|
115
132
|
color: contentColor,
|
|
116
|
-
|
|
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)),
|
|
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
|
-
|
|
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.
|
|
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
|
|
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(
|
|
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(
|
|
56
|
-
const fontRoot = (DEFAULT_ROOT_FONT * relation).toString().concat(
|
|
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(
|
|
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 ===
|
|
66
|
+
if (arrowSign === "up") {
|
|
65
67
|
return /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.DetailsRowArrowContainer, {
|
|
66
68
|
id: "DetailsRowArrowContainer",
|
|
67
69
|
value: value
|
|
@@ -78,24 +80,46 @@ const TotalBenchmarkAreachart = props => {
|
|
|
78
80
|
height: 25 * getSizeFactor()
|
|
79
81
|
}));
|
|
80
82
|
};
|
|
81
|
-
const CustomTick =
|
|
82
|
-
|
|
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
|
-
} =
|
|
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
|
+
}
|
|
88
96
|
return /*#__PURE__*/_react.default.createElement("g", {
|
|
89
97
|
transform: "translate(".concat(x, ",").concat(y, ")")
|
|
90
|
-
},
|
|
98
|
+
}, currentWeek === startWeekRange ? /*#__PURE__*/_react.default.createElement("rect", {
|
|
91
99
|
x: -15,
|
|
92
100
|
y: 0,
|
|
93
|
-
width: "
|
|
101
|
+
width: "70",
|
|
94
102
|
height: "18",
|
|
95
103
|
rx: 9,
|
|
96
|
-
fill: xselectedColor
|
|
97
|
-
fillOpacity
|
|
98
|
-
})
|
|
104
|
+
fill: xselectedColor
|
|
105
|
+
//fillOpacity="0.30"
|
|
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"
|
|
122
|
+
}) : "", /*#__PURE__*/_react.default.createElement("text", {
|
|
99
123
|
x: 0,
|
|
100
124
|
y: 14,
|
|
101
125
|
dx: -10,
|
|
@@ -103,12 +127,12 @@ const TotalBenchmarkAreachart = props => {
|
|
|
103
127
|
fontSize: "14px"
|
|
104
128
|
}, payload.value));
|
|
105
129
|
};
|
|
106
|
-
const CustomTooltip =
|
|
130
|
+
const CustomTooltip = _ref => {
|
|
107
131
|
let {
|
|
108
132
|
active,
|
|
109
133
|
payload,
|
|
110
134
|
label
|
|
111
|
-
} =
|
|
135
|
+
} = _ref;
|
|
112
136
|
if (active && payload && payload.length) {
|
|
113
137
|
setActiveLabel(label);
|
|
114
138
|
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 +153,9 @@ const TotalBenchmarkAreachart = props => {
|
|
|
129
153
|
id: "Title"
|
|
130
154
|
}, title), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.ValueAndBenchmarkContainer, {
|
|
131
155
|
id: "ValueAndBenchmarkContainer"
|
|
132
|
-
}, value !== undefined && value != null ? getArrowSign(arrowSign) :
|
|
156
|
+
}, value !== undefined && value != null ? getArrowSign(arrowSign) : "", /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.FormattedValue, {
|
|
133
157
|
id: "FormattedValue"
|
|
134
|
-
}, value !== undefined && value != null ? /*#__PURE__*/_react.default.createElement("span", null, "".concat(value, " "), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.CurrencySign, null, "%")) :
|
|
158
|
+
}, 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
159
|
id: "BenchmarkContainer"
|
|
136
160
|
}, /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, {
|
|
137
161
|
id: "Benchmark",
|
|
@@ -145,7 +169,7 @@ const TotalBenchmarkAreachart = props => {
|
|
|
145
169
|
linearGradientUnderAvarageColor: "#FDB1B1",
|
|
146
170
|
underAvarageColor: "#FD5959",
|
|
147
171
|
backgroundColor: "#F2F2F2"
|
|
148
|
-
})) :
|
|
172
|
+
})) : "")), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkAreachart.AreaChartContainer, {
|
|
149
173
|
ref: anotherRef,
|
|
150
174
|
id: "AreaChartContainer"
|
|
151
175
|
}, /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
@@ -197,9 +221,9 @@ const TotalBenchmarkAreachart = props => {
|
|
|
197
221
|
tick: item => /*#__PURE__*/_react.default.createElement(CustomTick, item),
|
|
198
222
|
tickLine: false,
|
|
199
223
|
style: {
|
|
200
|
-
fontWeight:
|
|
201
|
-
stroke:
|
|
202
|
-
strokeWidth:
|
|
224
|
+
fontWeight: "700",
|
|
225
|
+
stroke: "#D0D0D0",
|
|
226
|
+
strokeWidth: "1px"
|
|
203
227
|
}
|
|
204
228
|
}), /*#__PURE__*/_react.default.createElement(_recharts.CartesianGrid, {
|
|
205
229
|
strokeDasharray: "3 3"
|
|
@@ -224,77 +248,77 @@ const TotalBenchmarkAreachart = props => {
|
|
|
224
248
|
exports.TotalBenchmarkAreachart = TotalBenchmarkAreachart;
|
|
225
249
|
var _default = exports.default = TotalBenchmarkAreachart;
|
|
226
250
|
TotalBenchmarkAreachart.defaultProps = {
|
|
227
|
-
title:
|
|
251
|
+
title: "String",
|
|
228
252
|
value: 300,
|
|
229
|
-
arrowSign:
|
|
253
|
+
arrowSign: "$",
|
|
230
254
|
addingBenchmark: true,
|
|
231
|
-
benchmarkTotalValue:
|
|
255
|
+
benchmarkTotalValue: "",
|
|
232
256
|
benchmarkValue: null,
|
|
233
257
|
areaChartData: [{
|
|
234
|
-
title:
|
|
258
|
+
title: "W20",
|
|
235
259
|
value1: 542366,
|
|
236
260
|
value2: 247715
|
|
237
261
|
}, {
|
|
238
|
-
title:
|
|
262
|
+
title: "W21",
|
|
239
263
|
value1: 699511,
|
|
240
264
|
value2: 252313
|
|
241
265
|
}, {
|
|
242
|
-
title:
|
|
266
|
+
title: "W22",
|
|
243
267
|
value1: 403092,
|
|
244
268
|
value2: 260822
|
|
245
269
|
}, {
|
|
246
|
-
title:
|
|
270
|
+
title: "W23",
|
|
247
271
|
value1: 396184,
|
|
248
272
|
value2: 264325
|
|
249
273
|
}, {
|
|
250
|
-
title:
|
|
274
|
+
title: "W24",
|
|
251
275
|
value1: 415317,
|
|
252
276
|
value2: 269243
|
|
253
277
|
}, {
|
|
254
|
-
title:
|
|
278
|
+
title: "W25",
|
|
255
279
|
value1: 568376,
|
|
256
280
|
value2: 269592
|
|
257
281
|
}, {
|
|
258
|
-
title:
|
|
282
|
+
title: "W26",
|
|
259
283
|
value1: 1078121,
|
|
260
284
|
value2: 269949
|
|
261
285
|
}, {
|
|
262
|
-
title:
|
|
286
|
+
title: "W27",
|
|
263
287
|
value1: 347930,
|
|
264
288
|
value2: 270735
|
|
265
289
|
}, {
|
|
266
|
-
title:
|
|
290
|
+
title: "W28",
|
|
267
291
|
value1: 346258,
|
|
268
292
|
value2: 271200
|
|
269
293
|
}, {
|
|
270
|
-
title:
|
|
294
|
+
title: "W29",
|
|
271
295
|
value1: 350184,
|
|
272
296
|
value2: 270324
|
|
273
297
|
}, {
|
|
274
|
-
title:
|
|
298
|
+
title: "W30",
|
|
275
299
|
value1: 312790,
|
|
276
300
|
value2: 266821
|
|
277
301
|
}, {
|
|
278
|
-
title:
|
|
302
|
+
title: "W31",
|
|
279
303
|
value1: 335076,
|
|
280
304
|
value2: 267064
|
|
281
305
|
}, {
|
|
282
|
-
title:
|
|
306
|
+
title: "W32",
|
|
283
307
|
value1: 311037,
|
|
284
308
|
value2: 266821
|
|
285
309
|
}],
|
|
286
|
-
width:
|
|
287
|
-
height:
|
|
288
|
-
textcolor:
|
|
289
|
-
areaChart1Color:
|
|
290
|
-
areaChart2Color:
|
|
291
|
-
xselectedColor:
|
|
292
|
-
fillChart1Color:
|
|
293
|
-
fillChart2Color:
|
|
294
|
-
startOffset:
|
|
295
|
-
endOffset:
|
|
296
|
-
opacity:
|
|
297
|
-
value1Title:
|
|
298
|
-
value2Title:
|
|
299
|
-
noDataText:
|
|
310
|
+
width: "100%",
|
|
311
|
+
height: "100%",
|
|
312
|
+
textcolor: "#212121",
|
|
313
|
+
areaChart1Color: "#BD9EFF",
|
|
314
|
+
areaChart2Color: "#96B4FF",
|
|
315
|
+
xselectedColor: "#42977A",
|
|
316
|
+
fillChart1Color: "rgba(34, 158, 56, 0.20)",
|
|
317
|
+
fillChart2Color: "rgba(255, 84, 84, 0.2)",
|
|
318
|
+
startOffset: "17.04%",
|
|
319
|
+
endOffset: "17.04%",
|
|
320
|
+
opacity: "191",
|
|
321
|
+
value1Title: "Actual Sales",
|
|
322
|
+
value2Title: "Baseline Sales",
|
|
323
|
+
noDataText: ""
|
|
300
324
|
};
|
|
@@ -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
|
|
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
|
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
|
-
};
|