sag_components 1.0.397 → 1.0.398
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/.history/.env_20231001120549 +0 -0
- package/.history/.env_20231001120613 +1 -0
- package/.history/.env_20231003143620 +1 -0
- package/.history/.eslintrc_20230928112617.js +26 -0
- package/.history/.eslintrc_20230928130534.js +27 -0
- package/.history/.eslintrc_20230928133400.js +28 -0
- package/.history/.eslintrc_20230928133404.js +28 -0
- package/.history/.eslintrc_20230928133416.js +28 -0
- package/.history/.eslintrc_20230928133419.js +28 -0
- package/.history/.eslintrc_20230928133432.js +28 -0
- package/.history/.eslintrc_20230928133439.js +28 -0
- package/.history/.eslintrc_20230928133458.js +29 -0
- package/.history/.eslintrc_20230928133500.js +28 -0
- package/.history/.eslintrc_20230928134009.js +28 -0
- package/.history/.eslintrc_20230928135318.js +34 -0
- package/.history/.eslintrc_20230928135321.js +34 -0
- package/.history/.eslintrc_20230928135323.js +34 -0
- package/.history/.eslintrc_20230928135332.js +34 -0
- package/.history/.eslintrc_20230928135333.js +34 -0
- package/.history/.eslintrc_20230928135352.js +29 -0
- package/.history/.eslintrc_20230928135353.js +29 -0
- package/.history/.eslintrc_20230928135355.js +29 -0
- package/.history/.eslintrc_20230928135408.js +29 -0
- package/.history/.eslintrc_20230928135538.js +30 -0
- package/.history/.eslintrc_20230928135539.js +30 -0
- package/.history/.eslintrc_20230928135543.js +30 -0
- package/.history/.gitignore_20230921093332 +119 -0
- package/.history/.gitignore_20230921111638 +120 -0
- package/.history/.gitignore_20230921111650 +120 -0
- package/.history/.gitignore_20230921111810 +121 -0
- package/.history/package-lock_20231114111138.json +47810 -0
- package/.history/package-lock_20231114111158.json +47802 -0
- package/.history/package_20231029152422.json +82 -0
- package/.history/package_20231029153420.json +82 -0
- package/.history/package_20231029154416.json +82 -0
- package/.history/package_20231030094127.json +82 -0
- package/.history/package_20231030114707.json +82 -0
- package/.history/package_20231030130704.json +82 -0
- package/.history/package_20231030132422.json +82 -0
- package/.history/package_20231030134051.json +82 -0
- package/.history/package_20231030142913.json +82 -0
- package/.history/package_20231030143556.json +82 -0
- package/.history/package_20231030144210.json +82 -0
- package/.history/package_20231101113942.json +82 -0
- package/.history/package_20231101114544.json +82 -0
- package/.history/package_20231101151518.json +82 -0
- package/.history/package_20231101154501.json +82 -0
- package/.history/package_20231101155811.json +82 -0
- package/.history/package_20231101160235.json +82 -0
- package/.history/package_20231101160406.json +82 -0
- package/.history/package_20231101161325.json +82 -0
- package/.history/package_20231101161333.json +82 -0
- package/.history/package_20231102123623.json +82 -0
- package/.history/package_20231102125741.json +82 -0
- package/.history/package_20231102130857.json +82 -0
- package/.history/package_20231102132227.json +82 -0
- package/.history/package_20231102142340.json +82 -0
- package/.history/package_20231102143256.json +82 -0
- package/.history/package_20231105153539.json +82 -0
- package/.history/package_20231105154332.json +82 -0
- package/.history/package_20231105171201.json +82 -0
- package/.history/package_20231106123849.json +82 -0
- package/.history/package_20231107170638.json +82 -0
- package/.history/package_20231109103647.json +82 -0
- package/.history/package_20231109103911.json +82 -0
- package/.history/package_20231109105426.json +82 -0
- package/.history/package_20231109132014.json +82 -0
- package/.history/package_20231109132115.json +82 -0
- package/.history/package_20231114100517.json +82 -0
- package/.history/package_20231114100859.json +82 -0
- package/.history/package_20231114101553.json +82 -0
- package/.history/package_20231114102545.json +82 -0
- package/.history/package_20231114111208.json +83 -0
- package/.history/package_20231114111515.json +83 -0
- package/.history/package_20231114112931.json +83 -0
- package/.history/package_20231114113014.json +83 -0
- package/.history/package_20231114113155.json +83 -0
- package/.history/package_20231114124318.json +83 -0
- package/.history/package_20231114125107.json +83 -0
- package/.history/package_20231114125510.json +83 -0
- package/.history/package_20231114132634.json +83 -0
- package/.history/package_20231116165815.json +83 -0
- package/.history/package_20231116165916.json +83 -0
- package/.history/package_20231119113637.json +83 -0
- package/.history/package_20231120100907.json +83 -0
- package/.history/package_20231121151523.json +77 -0
- package/.history/package_20231121155513.json +77 -0
- package/.history/package_20231121162434.json +77 -0
- package/.history/package_20231122100718.json +77 -0
- package/.history/package_20231128125149.json +82 -0
- package/.history/package_20231128125208.json +82 -0
- package/dist/index.js +1 -1
- package/dist/stories/components/Benchmark.js +23 -20
- package/dist/stories/components/Benchmark.style.js +5 -35
- package/dist/stories/components/Button.js +35 -30
- package/dist/stories/components/Button.style.js +1 -3
- package/dist/stories/components/CheckBox.js +22 -35
- package/dist/stories/components/CheckBox.style.js +4 -12
- package/dist/stories/components/CheckBoxButton.js +27 -45
- package/dist/stories/components/CheckBoxButton.style.js +4 -20
- package/dist/stories/components/CodeEditor.js +5 -3
- package/dist/stories/components/CodeEditor.style.js +1 -1
- package/dist/stories/components/CollapseData.js +34 -42
- package/dist/stories/components/CollapseData.style.js +11 -17
- package/dist/stories/components/CommonFunctions.js +13 -10
- package/dist/stories/components/Datepicker.js +22 -27
- package/dist/stories/components/Datepicker.style.js +1 -3
- package/dist/stories/components/Dropdown.js +94 -112
- package/dist/stories/components/Dropdown.style.js +1 -3
- package/dist/stories/components/DropdownMulti.js +123 -145
- package/dist/stories/components/DropdownMulti.style.js +1 -3
- package/dist/stories/components/FilterContainer.js +7 -7
- package/dist/stories/components/FilterContainer.style.js +3 -3
- package/dist/stories/components/IconButton.js +58 -27
- package/dist/stories/components/IconButton.style.js +8 -13
- package/dist/stories/components/KpiFilter.js +185 -186
- package/dist/stories/components/KpiFilter.style.js +16 -16
- package/dist/stories/components/ListBox.js +50 -67
- package/dist/stories/components/ListBox.style.js +4 -12
- package/dist/stories/components/Modal.js +6 -4
- package/dist/stories/components/Modal.style.js +5 -5
- package/dist/stories/components/ModalTotalBenchmark.js +48 -46
- package/dist/stories/components/ModalTotalCost.js +66 -68
- package/dist/stories/components/NoDataFoundMessage.js +5 -2
- package/dist/stories/components/NoDataFoundMessage.style.js +3 -3
- package/dist/stories/components/OneColumnContainer.js +30 -38
- package/dist/stories/components/OneColumnContainer.style.js +7 -23
- package/dist/stories/components/PerformanceAnalytics.js +142 -156
- package/dist/stories/components/PerformanceAnalytics.style.js +15 -25
- package/dist/stories/components/PerformanceAnalyticsLegend.js +25 -26
- package/dist/stories/components/PerformanceAnalyticsLegend.style.js +6 -16
- package/dist/stories/components/PerformanceAnalyticsOneColumn.js +119 -123
- package/dist/stories/components/PerformanceAnalyticsOneColumn.style.js +13 -23
- package/dist/stories/components/PerformanceAnalyticsTotals.js +26 -27
- package/dist/stories/components/PerformanceAnalyticsTotals.style.js +10 -18
- package/dist/stories/components/ReportTable.js +15 -18
- package/dist/stories/components/ReportTable.style.js +8 -14
- package/dist/stories/components/SegmentedButton.js +63 -68
- package/dist/stories/components/SegmentedButton.style.js +6 -16
- package/dist/stories/components/TextField.js +37 -52
- package/dist/stories/components/TextField.style.js +1 -3
- package/dist/stories/components/TitleDescription.js +39 -42
- package/dist/stories/components/TitleDescription.style.js +26 -50
- package/dist/stories/components/Tooltip.js +6 -11
- package/dist/stories/components/Tooltip.style.js +3 -3
- package/dist/stories/components/TotalBenchmark.js +54 -58
- package/dist/stories/components/TotalBenchmark.style.js +11 -17
- package/dist/stories/components/TotalBenchmarkAreachart.js +55 -58
- package/dist/stories/components/TotalBenchmarkAreachart.style.js +14 -20
- package/dist/stories/components/TotalBenchmarkArrows.js +48 -53
- package/dist/stories/components/TotalBenchmarkArrows.style.js +14 -20
- package/dist/stories/components/TotalBenchmarkBarchart.js +45 -51
- package/dist/stories/components/TotalBenchmarkBarchart.style.js +10 -16
- package/dist/stories/components/TotalDoughnutChart.js +60 -64
- package/dist/stories/components/TotalDoughnutChart.style.js +19 -29
- package/dist/stories/components/TspanTooltip.js +6 -8
- package/dist/stories/components/TspanTooltip.style.js +3 -7
- package/dist/stories/components/icons/ArrowDownIcon.js +7 -6
- package/dist/stories/components/icons/ArrowDropDownIcon.js +7 -6
- package/dist/stories/components/icons/ArrowUpIcon.js +7 -6
- package/dist/stories/components/icons/BellIcon.js +6 -5
- package/dist/stories/components/icons/CalendarIcon.js +7 -6
- package/dist/stories/components/icons/CheckBoxButtonCheckedIcon.js +8 -8
- package/dist/stories/components/icons/CheckBoxCheckedIcon.js +8 -8
- package/dist/stories/components/icons/CheckBoxNotCheckedIcon.js +8 -8
- package/dist/stories/components/icons/ClockIcon.js +7 -6
- package/dist/stories/components/icons/ComboBoxArrowDownIcon.js +8 -8
- package/dist/stories/components/icons/ComboBoxArrowUpIcon.js +8 -8
- package/dist/stories/components/icons/DocumentIcon.js +7 -7
- package/dist/stories/components/icons/DownloadIcon.js +7 -7
- package/dist/stories/components/icons/ExitIcon.js +7 -6
- package/dist/stories/components/icons/EyeIcon.js +7 -6
- package/dist/stories/components/icons/FlyIcon.js +7 -6
- package/dist/stories/components/icons/FoodLionIcon.js +7 -6
- package/dist/stories/components/icons/GiantFoodIcon.js +7 -6
- package/dist/stories/components/icons/HannafordIcon.js +7 -6
- package/dist/stories/components/icons/InfoIcon.js +8 -8
- package/dist/stories/components/icons/LegendUnionIcon.js +7 -7
- package/dist/stories/components/icons/MaintenanceIcon.js +7 -6
- package/dist/stories/components/icons/NoDataFoundIcon.js +6 -5
- package/dist/stories/components/icons/ShoppingCartIcon.js +7 -6
- package/dist/stories/components/icons/StopAndShopIcon.js +7 -6
- package/dist/stories/components/icons/TheGiantCompanyIcon.js +7 -6
- package/dist/stories/utils/ComponentFactory.js +4 -2
- package/package.json +5 -5
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = exports.TotalBenchmarkArrows = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
9
|
var _ArrowUpIcon = require("./icons/ArrowUpIcon");
|
|
12
10
|
var _ArrowDownIcon = require("./icons/ArrowDownIcon");
|
|
@@ -15,49 +13,47 @@ var _CommonFunctions = require("./CommonFunctions");
|
|
|
15
13
|
var _Benchmark = require("./Benchmark");
|
|
16
14
|
var _TotalBenchmarkArrows = require("./TotalBenchmarkArrows.style");
|
|
17
15
|
/* TotalBenchmarkArrows */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(0, _react.useEffect)(function () {
|
|
44
|
-
var offsetWidth = controlsContainerRef.current.offsetWidth;
|
|
16
|
+
const TotalBenchmarkArrows = props => {
|
|
17
|
+
const {
|
|
18
|
+
title,
|
|
19
|
+
value,
|
|
20
|
+
addingBenchmark,
|
|
21
|
+
benchmarkTotalValue,
|
|
22
|
+
benchmarkValue,
|
|
23
|
+
detailsTitle,
|
|
24
|
+
detailsData,
|
|
25
|
+
dotCut,
|
|
26
|
+
width,
|
|
27
|
+
height,
|
|
28
|
+
textcolor,
|
|
29
|
+
noDataText
|
|
30
|
+
} = props;
|
|
31
|
+
const DEFAULT_ROOT_FONT = 16;
|
|
32
|
+
const DEFAULT_COMPONENT_WIDTH = 250;
|
|
33
|
+
const DEFAULT_COMPONENT_HEIGHT = 280;
|
|
34
|
+
const [rootFont, setRootFont] = (0, _react.useState)(DEFAULT_ROOT_FONT.toString().concat('', 'px'));
|
|
35
|
+
const [heightFactor, setHeightFactor] = (0, _react.useState)(1);
|
|
36
|
+
const controlsContainerRef = (0, _react.useRef)();
|
|
37
|
+
(0, _react.useEffect)(() => {
|
|
38
|
+
const {
|
|
39
|
+
offsetWidth
|
|
40
|
+
} = controlsContainerRef.current;
|
|
45
41
|
setRootFont(getRootFont(offsetWidth));
|
|
46
42
|
}, [width]);
|
|
47
|
-
(0, _react.useEffect)(
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
(0, _react.useEffect)(() => {
|
|
44
|
+
const {
|
|
45
|
+
offsetHeight
|
|
46
|
+
} = controlsContainerRef.current;
|
|
47
|
+
const factor = offsetHeight / DEFAULT_COMPONENT_HEIGHT;
|
|
50
48
|
setHeightFactor(factor);
|
|
51
49
|
}, [height]);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const getRootFont = width => {
|
|
51
|
+
const relation = width.toString().replace('px', '').replace('%', '') / DEFAULT_COMPONENT_WIDTH;
|
|
52
|
+
const fontRoot = (DEFAULT_ROOT_FONT * relation).toString().concat('', 'px');
|
|
55
53
|
return fontRoot;
|
|
56
54
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
var getArrowSign = function getArrowSign(arrowSign) {
|
|
55
|
+
const getSizeFactor = () => rootFont.toString().replace('px', '') / DEFAULT_ROOT_FONT;
|
|
56
|
+
const getArrowSign = arrowSign => {
|
|
61
57
|
if (!arrowSign) {
|
|
62
58
|
return '';
|
|
63
59
|
}
|
|
@@ -111,23 +107,22 @@ var TotalBenchmarkArrows = exports.TotalBenchmarkArrows = function TotalBenchmar
|
|
|
111
107
|
id: "DetailsContainer"
|
|
112
108
|
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrows.DetailsTitle, {
|
|
113
109
|
id: "DetailsTitle"
|
|
114
|
-
}, detailsTitle), detailsData.map(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, item.title));
|
|
127
|
-
}))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
110
|
+
}, detailsTitle), detailsData.map(item => /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrows.DetailsRowContainer, {
|
|
111
|
+
id: "DetailsRowContainer",
|
|
112
|
+
key: item.title
|
|
113
|
+
}, item.value !== undefined && item.value != null ? getArrowSign(item.value >= 0 ? 'up' : 'down') : '', /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrows.DetailsRowFormattedValue, {
|
|
114
|
+
id: "DetailsRowFormattedValue"
|
|
115
|
+
}, item.value !== undefined && item.value != null ? Math.abs(item.value) : ''), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrows.DetailsRowPercentSign, {
|
|
116
|
+
id: "DetailsRowPercentSign"
|
|
117
|
+
}, item.value !== undefined && item.value != null ? ' % ' : ''), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrows.DetailsRowFormattedValueNoDataMessage, {
|
|
118
|
+
id: "DetailsRowFormattedValueNoDataMessage"
|
|
119
|
+
}, item.value === undefined || item.value === null ? 'No Data' : ''), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrows.DetailsRowTitle, {
|
|
120
|
+
id: "DetailsRowTitle"
|
|
121
|
+
}, item.title))))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
128
122
|
noDataText: noDataText
|
|
129
123
|
}));
|
|
130
124
|
};
|
|
125
|
+
exports.TotalBenchmarkArrows = TotalBenchmarkArrows;
|
|
131
126
|
var _default = exports.default = TotalBenchmarkArrows;
|
|
132
127
|
TotalBenchmarkArrows.defaultProps = {
|
|
133
128
|
title: 'Title',
|
|
@@ -8,23 +8,17 @@ exports.ValueAndBenchmarkContainer = exports.Title = exports.FormattedValue = ex
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var DetailsRowContainer = exports.DetailsRowContainer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n text-align: center;\n align-items: baseline;\n height: 25%;\n"])));
|
|
26
|
-
var DetailsRowArrowContainer = exports.DetailsRowArrowContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 0.8rem;\n align-items: flex-end;\n height: 25%;\n"])));
|
|
27
|
-
var DetailsRowFormattedValue = exports.DetailsRowFormattedValue = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 0.3rem;\n font-weight: 700;\n font-size: 0.88889rem;\n"])));
|
|
28
|
-
var DetailsRowFormattedValueNoDataMessage = exports.DetailsRowFormattedValueNoDataMessage = _styledComponents.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.3rem;\n font-weight: 700;\n font-size: 0.88889rem;\n margin: 0; \n"])));
|
|
29
|
-
var DetailsRowPercentSign = exports.DetailsRowPercentSign = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 0.3rem;\n font-weight: 700;\n font-size: 12px;\n"])));
|
|
30
|
-
var DetailsRowTitle = exports.DetailsRowTitle = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 0.3rem;\n font-weight: 400;\n font-size: 0.88889rem;\n"])));
|
|
11
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n position: relative;\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 12px;\n align-content: center;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])), props => props.textColor, props => props.width, props => props.height);
|
|
12
|
+
const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n border-radius: 12px;\n width: 90%;\n height: 100%;\n background: #ffffff; \n flex-direction: column;\n flex-basis: 100%;\n //align-items: center;\n align-items: flex-start;\n justify-content: space-between;\n padding: 0px 0.8rem;\n \n"])));
|
|
13
|
+
const Title = exports.Title = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)([" \n font-weight: 500;\n font-size: 1rem;\n // margin-bottom: 1rem;\n"])));
|
|
14
|
+
const ValueAndBenchmarkContainer = exports.ValueAndBenchmarkContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: baseline;\n height: 45%;\n"])));
|
|
15
|
+
const FormattedValue = exports.FormattedValue = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.1rem;\n font-weight: 500;\n font-size: 2.22222rem;\n"])));
|
|
16
|
+
const BenchmarkContainer = exports.BenchmarkContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 0.77778rem;\n width: 5.35rem;\n"])));
|
|
17
|
+
const DetailsContainer = exports.DetailsContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n /* width: 14rem; */\n height: 50%;\n"])));
|
|
18
|
+
const DetailsTitle = exports.DetailsTitle = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n height: 25%;\n font-weight: 500;\n font-size: 1rem;\n"])));
|
|
19
|
+
const DetailsRowContainer = exports.DetailsRowContainer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n text-align: center;\n align-items: baseline;\n height: 25%;\n"])));
|
|
20
|
+
const DetailsRowArrowContainer = exports.DetailsRowArrowContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 0.8rem;\n align-items: flex-end;\n height: 25%;\n"])));
|
|
21
|
+
const DetailsRowFormattedValue = exports.DetailsRowFormattedValue = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 0.3rem;\n font-weight: 700;\n font-size: 0.88889rem;\n"])));
|
|
22
|
+
const DetailsRowFormattedValueNoDataMessage = exports.DetailsRowFormattedValueNoDataMessage = _styledComponents.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.3rem;\n font-weight: 700;\n font-size: 0.88889rem;\n margin: 0; \n"])));
|
|
23
|
+
const DetailsRowPercentSign = exports.DetailsRowPercentSign = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 0.3rem;\n font-weight: 700;\n font-size: 12px;\n"])));
|
|
24
|
+
const DetailsRowTitle = exports.DetailsRowTitle = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 0.3rem;\n font-weight: 400;\n font-size: 0.88889rem;\n"])));
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = exports.TotalBenchmarkBarchart = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
9
|
var _recharts = require("recharts");
|
|
12
10
|
var _NoDataFoundMessage = require("./NoDataFoundMessage");
|
|
@@ -14,56 +12,53 @@ var _CommonFunctions = require("./CommonFunctions");
|
|
|
14
12
|
var _Benchmark = require("./Benchmark");
|
|
15
13
|
var _TotalBenchmarkBarchart = require("./TotalBenchmarkBarchart.style");
|
|
16
14
|
/* TotalBenchmarkBarchart */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
dotCut =
|
|
28
|
-
width
|
|
29
|
-
height
|
|
30
|
-
textcolor
|
|
31
|
-
noDataText
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var controlsContainerRef = (0, _react.useRef)();
|
|
44
|
-
(0, _react.useEffect)(function () {
|
|
45
|
-
var offsetWidth = controlsContainerRef.current.offsetWidth;
|
|
15
|
+
const TotalBenchmarkBarchart = props => {
|
|
16
|
+
const {
|
|
17
|
+
title,
|
|
18
|
+
value,
|
|
19
|
+
addingBenchmark,
|
|
20
|
+
benchmarkTotalValue,
|
|
21
|
+
benchmarkValue,
|
|
22
|
+
currency,
|
|
23
|
+
currencyType,
|
|
24
|
+
barChartData,
|
|
25
|
+
dotCut = true,
|
|
26
|
+
width,
|
|
27
|
+
height,
|
|
28
|
+
textcolor,
|
|
29
|
+
noDataText
|
|
30
|
+
} = props;
|
|
31
|
+
const DEFAULT_ROOT_FONT = 16;
|
|
32
|
+
const DEFAULT_COMPONENT_WIDTH = 250;
|
|
33
|
+
const DEFAULT_COMPONENT_HEIGHT = 280;
|
|
34
|
+
const [rootFont, setRootFont] = (0, _react.useState)(DEFAULT_ROOT_FONT.toString().concat('', 'px'));
|
|
35
|
+
const [heightFactor, setHeightFactor] = (0, _react.useState)(1);
|
|
36
|
+
const controlsContainerRef = (0, _react.useRef)();
|
|
37
|
+
(0, _react.useEffect)(() => {
|
|
38
|
+
const {
|
|
39
|
+
offsetWidth
|
|
40
|
+
} = controlsContainerRef.current;
|
|
46
41
|
setRootFont(getRootFont(offsetWidth));
|
|
47
42
|
}, [width]);
|
|
48
|
-
(0, _react.useEffect)(
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
(0, _react.useEffect)(() => {
|
|
44
|
+
const {
|
|
45
|
+
offsetHeight
|
|
46
|
+
} = controlsContainerRef.current;
|
|
47
|
+
const factor = offsetHeight / DEFAULT_COMPONENT_HEIGHT;
|
|
51
48
|
setHeightFactor(factor);
|
|
52
49
|
}, [height]);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
const getRootFont = width => {
|
|
51
|
+
const relation = width.toString().replace('px', '').replace('%', '') / DEFAULT_COMPONENT_WIDTH;
|
|
52
|
+
const fontRoot = (DEFAULT_ROOT_FONT * relation).toString().concat('', 'px');
|
|
56
53
|
return fontRoot;
|
|
57
54
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var formattedBarChartData = [];
|
|
63
|
-
var currencySign = currency === true ? (0, _CommonFunctions.getCurrencySign)(currencyType).toString() : '';
|
|
55
|
+
const getSizeFactor = () => rootFont.toString().replace('px', '') / DEFAULT_ROOT_FONT;
|
|
56
|
+
const getFormattedBarChartData = () => {
|
|
57
|
+
const formattedBarChartData = [];
|
|
58
|
+
const currencySign = currency === true ? (0, _CommonFunctions.getCurrencySign)(currencyType).toString() : '';
|
|
64
59
|
if (barChartData && (barChartData === null || barChartData === void 0 ? void 0 : barChartData.length) === 2) {
|
|
65
|
-
barChartData.forEach(
|
|
66
|
-
|
|
60
|
+
barChartData.forEach((data, i) => {
|
|
61
|
+
const formattedData = {
|
|
67
62
|
id: i,
|
|
68
63
|
title: data.title,
|
|
69
64
|
value: data.value,
|
|
@@ -123,12 +118,10 @@ var TotalBenchmarkBarchart = exports.TotalBenchmarkBarchart = function TotalBenc
|
|
|
123
118
|
dataKey: "value",
|
|
124
119
|
name: "title",
|
|
125
120
|
radius: [5, 5, 0, 0]
|
|
126
|
-
}, getFormattedBarChartData().map(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
131
|
-
}), /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
121
|
+
}, getFormattedBarChartData().map(entry => /*#__PURE__*/_react.default.createElement(_recharts.Cell, {
|
|
122
|
+
key: entry.id,
|
|
123
|
+
fill: entry.color
|
|
124
|
+
})), /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
132
125
|
dataKey: "formattedValue",
|
|
133
126
|
position: "top",
|
|
134
127
|
fill: "#212121",
|
|
@@ -144,6 +137,7 @@ var TotalBenchmarkBarchart = exports.TotalBenchmarkBarchart = function TotalBenc
|
|
|
144
137
|
noDataText: noDataText
|
|
145
138
|
}));
|
|
146
139
|
};
|
|
140
|
+
exports.TotalBenchmarkBarchart = TotalBenchmarkBarchart;
|
|
147
141
|
var _default = exports.default = TotalBenchmarkBarchart;
|
|
148
142
|
TotalBenchmarkBarchart.defaultProps = {
|
|
149
143
|
title: 'Title',
|
|
@@ -8,19 +8,13 @@ exports.ValueAndBenchmarkContainer = exports.TitleAndValueContainer = exports.Ti
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var ValueAndBenchmarkContainer = exports.ValueAndBenchmarkContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-start;\n align-items: baseline; \n\n"])));
|
|
22
|
-
var CurrencySign = exports.CurrencySign = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)([" \n font-weight: 500;\n font-size: 1rem;\n"])));
|
|
23
|
-
var FormattedValue = exports.FormattedValue = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.1rem;\n font-weight: 500;\n font-size: 2.22222rem;\n"])));
|
|
24
|
-
var FormattedValueNoDataMessage = exports.FormattedValueNoDataMessage = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.3rem;\n font-weight: 700;\n font-size: 16px;\n margin: 0; \n"])));
|
|
25
|
-
var BenchmarkContainer = exports.BenchmarkContainer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.7em;\n width: 5.35em;\n"])));
|
|
26
|
-
var BarchartContainer = exports.BarchartContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
11
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n position: relative;\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 12px;\n align-content: center;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background: #ffffff;\n"])), props => props.textColor, props => props.width, props => props.height);
|
|
12
|
+
const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n border-radius: 12px;\n background: #ffffff; \n justify-content: space-between;\n flex-direction: column;\n flex-basis: 100%;\n"])));
|
|
13
|
+
const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0px;\n"])));
|
|
14
|
+
const Title = exports.Title = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 1rem; \n"])));
|
|
15
|
+
const ValueAndBenchmarkContainer = exports.ValueAndBenchmarkContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-start;\n align-items: baseline; \n\n"])));
|
|
16
|
+
const CurrencySign = exports.CurrencySign = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)([" \n font-weight: 500;\n font-size: 1rem;\n"])));
|
|
17
|
+
const FormattedValue = exports.FormattedValue = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.1rem;\n font-weight: 500;\n font-size: 2.22222rem;\n"])));
|
|
18
|
+
const FormattedValueNoDataMessage = exports.FormattedValueNoDataMessage = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.3rem;\n font-weight: 700;\n font-size: 16px;\n margin: 0; \n"])));
|
|
19
|
+
const BenchmarkContainer = exports.BenchmarkContainer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 0.7em;\n width: 5.35em;\n"])));
|
|
20
|
+
const BarchartContainer = exports.BarchartContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = exports.TotalDoughnutChart = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
9
|
var _recharts = require("recharts");
|
|
12
10
|
var _NoDataFoundMessage = require("./NoDataFoundMessage");
|
|
@@ -14,38 +12,37 @@ var _CommonFunctions = require("./CommonFunctions");
|
|
|
14
12
|
var _TotalDoughnutChart = require("./TotalDoughnutChart.style");
|
|
15
13
|
var _Benchmark = require("./Benchmark");
|
|
16
14
|
/* TotalDoughnutChart */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var fontRoot = (DEFAULT_ROOT_FONT * relation).toString().concat('', 'px');
|
|
15
|
+
const TotalDoughnutChart = props => {
|
|
16
|
+
const {
|
|
17
|
+
title,
|
|
18
|
+
value,
|
|
19
|
+
addingBenchmark,
|
|
20
|
+
dotCut,
|
|
21
|
+
currencySign,
|
|
22
|
+
currencyType,
|
|
23
|
+
legendData,
|
|
24
|
+
itemsPercentagesValueAside,
|
|
25
|
+
itemsBoldedValues,
|
|
26
|
+
itemsValuesSeparateLine,
|
|
27
|
+
width,
|
|
28
|
+
height,
|
|
29
|
+
textcolor,
|
|
30
|
+
noDataText
|
|
31
|
+
} = props;
|
|
32
|
+
const DEFAULT_ROOT_FONT = 18;
|
|
33
|
+
const DEFAULT_COMPONENT_WIDTH = 250;
|
|
34
|
+
const [rootFont, setRootFont] = (0, _react.useState)(DEFAULT_ROOT_FONT.toString().concat('', 'px'));
|
|
35
|
+
const controlsContainerRef = (0, _react.useRef)();
|
|
36
|
+
const getRootFont = scopeWidth => {
|
|
37
|
+
const relation = scopeWidth.toString().replace('px', '').replace('%', '') / DEFAULT_COMPONENT_WIDTH;
|
|
38
|
+
const fontRoot = (DEFAULT_ROOT_FONT * relation).toString().concat('', 'px');
|
|
42
39
|
return fontRoot;
|
|
43
40
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
const dotCutTrenty = row => dotCut ? (0, _CommonFunctions.getFormattedValue)(row.value) : (0, _CommonFunctions.getNumberWithCommas)(row.value);
|
|
42
|
+
(0, _react.useEffect)(() => {
|
|
43
|
+
const {
|
|
44
|
+
offsetWidth
|
|
45
|
+
} = controlsContainerRef.current;
|
|
49
46
|
setRootFont(getRootFont(offsetWidth));
|
|
50
47
|
}, [width]);
|
|
51
48
|
return /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.ControlsContainer, {
|
|
@@ -84,42 +81,39 @@ var TotalDoughnutChart = exports.TotalDoughnutChart = function TotalDoughnutChar
|
|
|
84
81
|
data: legendData,
|
|
85
82
|
outerRadius: rootFont.toString().replace('px', '') * 2,
|
|
86
83
|
innerRadius: rootFont.toString().replace('px', '') * 1.5
|
|
87
|
-
}, legendData.map(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
});
|
|
92
|
-
})), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
84
|
+
}, legendData.map(row => /*#__PURE__*/_react.default.createElement(_recharts.Cell, {
|
|
85
|
+
key: "cell-".concat(row.name),
|
|
86
|
+
fill: row.color
|
|
87
|
+
}))), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
93
88
|
content: /*#__PURE__*/_react.default.createElement(CustomTooltip, {
|
|
94
89
|
value: value
|
|
95
90
|
})
|
|
96
91
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null)))), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendContainer, {
|
|
97
92
|
id: "LegendContainer"
|
|
98
|
-
}, legendData.map(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, row.value) : '', row.value !== undefined && row.value !== null ? dotCutTrenty(row) : 'No Data', row.value !== undefined && row.value !== null && dotCut ? (0, _CommonFunctions.getFormattedUnits)(row.value) : '', itemsPercentagesValueAside && " (".concat(Math.round(row.value / value * 100), "%)")))));
|
|
119
|
-
})))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
93
|
+
}, legendData.map(row => /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendControlsContainer, {
|
|
94
|
+
id: "LegendControlsContainer",
|
|
95
|
+
key: row.name
|
|
96
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendColorRectangle, {
|
|
97
|
+
id: "LegendColorRectangle",
|
|
98
|
+
color: row.color
|
|
99
|
+
}), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendTitleAndFormatedValueContainer, {
|
|
100
|
+
id: "LegendTitleAndFormatedValueContainer"
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendTitle, {
|
|
102
|
+
id: "LegendTitle",
|
|
103
|
+
style: {
|
|
104
|
+
flexDirection: itemsValuesSeparateLine ? 'column' : 'row',
|
|
105
|
+
alignItems: itemsValuesSeparateLine ? 'baseline' : 'center'
|
|
106
|
+
}
|
|
107
|
+
}, row.name, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendFormattedValue, {
|
|
108
|
+
id: "LegendFormattedValue",
|
|
109
|
+
style: {
|
|
110
|
+
fontWeight: itemsBoldedValues ? '700' : '500'
|
|
111
|
+
}
|
|
112
|
+
}, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, row.value) : '', row.value !== undefined && row.value !== null ? dotCutTrenty(row) : 'No Data', row.value !== undefined && row.value !== null && dotCut ? (0, _CommonFunctions.getFormattedUnits)(row.value) : '', itemsPercentagesValueAside && " (".concat(Math.round(row.value / value * 100), "%)"))))))))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
120
113
|
noDataText: noDataText
|
|
121
114
|
}));
|
|
122
115
|
};
|
|
116
|
+
exports.TotalDoughnutChart = TotalDoughnutChart;
|
|
123
117
|
var _default = exports.default = TotalDoughnutChart;
|
|
124
118
|
TotalDoughnutChart.defaultProps = {
|
|
125
119
|
title: '',
|
|
@@ -138,11 +132,13 @@ TotalDoughnutChart.defaultProps = {
|
|
|
138
132
|
noDataText: ''
|
|
139
133
|
};
|
|
140
134
|
function CustomTooltip(_ref) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
let {
|
|
136
|
+
active,
|
|
137
|
+
payload,
|
|
138
|
+
value
|
|
139
|
+
} = _ref;
|
|
144
140
|
if (active && payload && payload.length) {
|
|
145
|
-
|
|
141
|
+
const percent = value && value !== 0 ? (payload[0].value / value * 100).toFixed(0) : 0;
|
|
146
142
|
return /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.TooltipLabel, null, "".concat(payload[0].name, " ").concat(percent, "%")));
|
|
147
143
|
}
|
|
148
144
|
}
|
|
@@ -8,32 +8,22 @@ exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exp
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var DoughnutChart = exports.DoughnutChart = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n min-width: 45%;\n flex-basis: 45%;\n min-height: 6rem;\n"])));
|
|
31
|
-
var LegendContainer = exports.LegendContainer = _styledComponents.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n padding-left: 10px;\n display: flex;\n flex-direction: column;\n justify-content: space-evenly;\n"])));
|
|
32
|
-
var LegendControlsContainer = exports.LegendControlsContainer = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: 0.5rem;\n align-items: center;\n margin-bottom: 0.375rem;\n"])));
|
|
33
|
-
var LegendTitleAndFormatedValueContainer = exports.LegendTitleAndFormatedValueContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n"])));
|
|
34
|
-
var LegendFormatedValueContainer = exports.LegendFormatedValueContainer = _styledComponents.default.div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n font-size: .875rem;\n"])));
|
|
35
|
-
var LegendColorRectangle = exports.LegendColorRectangle = _styledComponents.default.div(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n width: 0.875rem;\n min-width: 0.875rem;\n height: 0.875rem;\n border-radius: 2px;\n background: ", ";\n"])), function (props) {
|
|
36
|
-
return props.color;
|
|
37
|
-
});
|
|
38
|
-
var LegendTitle = exports.LegendTitle = _styledComponents.default.h5(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 16px;\n gap: 5px;\n margin: 0;\n display: flex;\n justify-content: space-between;\n @media (max-width: 1536px) {\n font-size: 11px;\n }\n @media (max-width: 1366px) {\n font-size: 10px;\n }\n"])));
|
|
39
|
-
var LegendFormattedValue = exports.LegendFormattedValue = _styledComponents.default.span(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n white-space: nowrap;\n"])));
|
|
11
|
+
const scrollableStyles = "\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-track {\n background: #E8E8E8;\n border-radius: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #D0D0D0;\n border-radius: 5px;\n }\n";
|
|
12
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: ", ";\n color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 12px;\n display: flex;\n align-items: center;\n @media (max-width: 1536px) {\n ", "\n }\n\n > * {\n box-sizing: border-box;\n }\n"])), props => props.rootFont, props => props.textColor, props => props.width, props => props.height, scrollableStyles);
|
|
13
|
+
const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: white;\n"])));
|
|
14
|
+
const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n background: white;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);\n border-radius: 5px;\n padding: 6px 10px;\n margin: 0;\n"])));
|
|
15
|
+
const TooltipLabel = exports.TooltipLabel = _styledComponents.default.p(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-family: \"Poppins\", sans-serif;\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n width: max-content; // fit-content; \n line-height: normal;\n margin: 0;\n"])));
|
|
16
|
+
const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n padding: 0 20px;\n"])));
|
|
17
|
+
const Title = exports.Title = _styledComponents.default.h4(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 1rem;\n margin: 0;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 12px;\n }\n"])));
|
|
18
|
+
const CurrencySignAndFormattedValueContainer = exports.CurrencySignAndFormattedValueContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n gap: 16px;\n"])));
|
|
19
|
+
const CurrencySign = exports.CurrencySign = _styledComponents.default.span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 11px;\n }\n"])));
|
|
20
|
+
const FormattedValue = exports.FormattedValue = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 40px;\n @media (max-width: 1536px) {\n font-size: 24px;\n } \n @media (max-width: 1366px) {\n font-size: 20px;\n }\n"])));
|
|
21
|
+
const DoughnutChartAndLegendContainer = exports.DoughnutChartAndLegendContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n margin-top: auto;\n padding: 0 20px;\n"])));
|
|
22
|
+
const DoughnutChart = exports.DoughnutChart = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n min-width: 45%;\n flex-basis: 45%;\n min-height: 6rem;\n"])));
|
|
23
|
+
const LegendContainer = exports.LegendContainer = _styledComponents.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n padding-left: 10px;\n display: flex;\n flex-direction: column;\n justify-content: space-evenly;\n"])));
|
|
24
|
+
const LegendControlsContainer = exports.LegendControlsContainer = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: 0.5rem;\n align-items: center;\n margin-bottom: 0.375rem;\n"])));
|
|
25
|
+
const LegendTitleAndFormatedValueContainer = exports.LegendTitleAndFormatedValueContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n"])));
|
|
26
|
+
const LegendFormatedValueContainer = exports.LegendFormatedValueContainer = _styledComponents.default.div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n font-size: .875rem;\n"])));
|
|
27
|
+
const LegendColorRectangle = exports.LegendColorRectangle = _styledComponents.default.div(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n width: 0.875rem;\n min-width: 0.875rem;\n height: 0.875rem;\n border-radius: 2px;\n background: ", ";\n"])), props => props.color);
|
|
28
|
+
const LegendTitle = exports.LegendTitle = _styledComponents.default.h5(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 16px;\n gap: 5px;\n margin: 0;\n display: flex;\n justify-content: space-between;\n @media (max-width: 1536px) {\n font-size: 11px;\n }\n @media (max-width: 1366px) {\n font-size: 10px;\n }\n"])));
|
|
29
|
+
const LegendFormattedValue = exports.LegendFormattedValue = _styledComponents.default.span(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n white-space: nowrap;\n"])));
|