sag_components 1.0.586 → 1.0.588
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.
|
@@ -49,41 +49,41 @@ const OneColumnContainer = props => {
|
|
|
49
49
|
width: width,
|
|
50
50
|
height: height,
|
|
51
51
|
overflow: overflow
|
|
52
|
-
}, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.
|
|
53
|
-
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.OneColumnContainerMainDiv, {
|
|
53
|
+
className: "OneColumnContainerMainDiv",
|
|
54
54
|
width: width,
|
|
55
55
|
height: height,
|
|
56
56
|
display: display,
|
|
57
57
|
gridTemplateColumns: gridTemplateColumns,
|
|
58
58
|
ref: nodeRef
|
|
59
59
|
}, !isLoading && showViewByBannerButton && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.BannerContainer, {
|
|
60
|
-
|
|
60
|
+
className: "BannerContainer",
|
|
61
61
|
right: disableInfo ? '15px' : '50px'
|
|
62
62
|
}, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.OutBanner, {
|
|
63
|
-
|
|
63
|
+
className: "OutBanner",
|
|
64
64
|
onClick: () => onBannerClick({
|
|
65
65
|
eventName: 'onBannerClick'
|
|
66
66
|
})
|
|
67
67
|
}, /*#__PURE__*/_react.default.createElement(_ExportIcon.ExportIcon, null), "View By Banner")), !isLoading && !hover && children, !disableInfo && !isLoading && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.IconContainer, {
|
|
68
|
-
|
|
68
|
+
className: "IconContainer",
|
|
69
69
|
onMouseEnter: () => setHover(true),
|
|
70
70
|
onMouseLeave: () => setHover(false)
|
|
71
71
|
}, /*#__PURE__*/_react.default.createElement(_InfoIcon.InfoIcon, null)), hover && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.InfoTextContainer, {
|
|
72
|
-
|
|
72
|
+
className: "InfoTextContainer",
|
|
73
73
|
width: width,
|
|
74
74
|
height: height
|
|
75
75
|
}, infoTitle && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.InfoTitleLabel, {
|
|
76
|
-
|
|
76
|
+
className: "InfoTitleLabel",
|
|
77
77
|
dangerouslySetInnerHTML: {
|
|
78
78
|
__html: infoTitle
|
|
79
79
|
}
|
|
80
80
|
}), /*#__PURE__*/_react.default.createElement(_OneColumnContainer.InfoTextLabel, {
|
|
81
|
-
|
|
81
|
+
className: "InfoTextLabel",
|
|
82
82
|
dangerouslySetInnerHTML: {
|
|
83
83
|
__html: infoText
|
|
84
84
|
}
|
|
85
85
|
}))), isLoading && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.LoadingDiv, {
|
|
86
|
-
|
|
86
|
+
className: "loadingDiv"
|
|
87
87
|
}, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.SkeletonTheme, {
|
|
88
88
|
baseColor: "#EAEAEA"
|
|
89
89
|
}, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.StyledContainer = exports.OutBanner = exports.
|
|
7
|
+
exports.StyledContainer = exports.OutBanner = exports.OneColumnContainerMainDiv = exports.LoadingDiv = exports.InfoTitleLabel = exports.InfoTextLabel = exports.InfoTextContainer = exports.IconContainer = exports.BannerContainer = void 0;
|
|
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;
|
|
@@ -14,6 +14,6 @@ const InfoTitleLabel = exports.InfoTitleLabel = _styledComponents.default.div(_t
|
|
|
14
14
|
const InfoTextLabel = exports.InfoTextLabel = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: black;\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n overflow: hidden;\n"])));
|
|
15
15
|
const IconContainer = exports.IconContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n width: 20px;\n height: 20px;\n top: 10px;\n right: 10px;\n position: absolute;\n"])));
|
|
16
16
|
const LoadingDiv = exports.LoadingDiv = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n margin-top: 20px;\n display: flex;\n flex-direction: column;\n justify-content: space-evenly;\n align-items: center;\n width: 76%;\n height: 65%;\n"])));
|
|
17
|
-
const
|
|
17
|
+
const OneColumnContainerMainDiv = exports.OneColumnContainerMainDiv = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: flex-start;\n justify-content: center; \n background-color: white;\n width: ", ";\n height: ", ";\n display: ", ";\n grid-template-columns: ", ";\n"])), props => props.width, props => props.height, props => props.display, props => props.gridTemplateColumns);
|
|
18
18
|
const BannerContainer = exports.BannerContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 140px;\n height: 20px;\n top: 10px;\n right: ", "; \n font-family: \"Poppins\", sans-serif;\n user-select: none;\n"])), props => props.right);
|
|
19
19
|
const OutBanner = exports.OutBanner = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)([" \n display: flex;\n justify-content: flex-end;\n align-items: center; \n gap: 8px; \n font-size: 14px;\n font-weight: 400;\n color: ", ";\n cursor: pointer;\n @media (max-width: 1536px) {\n font-size: 13px;\n }\n @media (max-width: 1366px) {\n font-size: 12px;\n }\n > svg {\n width: 14px;\n height: 14px;\n @media (max-width: 1536px) {\n width: 13px;\n height: 13px;\n }\n @media (max-width: 1366px) {\n width: 12px;\n height: 12px;\n }\n }\n"])), props => props.textColor);
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.TotalDoughnutChart = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _recharts = require("recharts");
|
|
10
|
-
var _NoDataFoundMessage = require("./NoDataFoundMessage");
|
|
11
10
|
var _CommonFunctions = require("./CommonFunctions");
|
|
12
11
|
var _TotalDoughnutChart = require("./TotalDoughnutChart.style");
|
|
13
12
|
var _Benchmark = require("./Benchmark");
|
|
@@ -28,22 +27,22 @@ const TotalDoughnutChart = props => {
|
|
|
28
27
|
width,
|
|
29
28
|
height,
|
|
30
29
|
textcolor,
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
isPercent,
|
|
31
|
+
hideTitleAndValue
|
|
33
32
|
} = props;
|
|
34
33
|
const [DoughnutChartRadius, setDoughnutChartRadius] = (0, _react.useState)(0);
|
|
35
34
|
const [zoomResolution, setZoomResolution] = (0, _react.useState)(1);
|
|
36
35
|
const DoughnutChartContainerRef = (0, _react.useRef)();
|
|
37
36
|
const dotCutTrenty = row => {
|
|
38
37
|
if (!row || !row.value) return 0;
|
|
39
|
-
let
|
|
40
|
-
if (row !== null && row !== void 0 && row.value && Math.abs(row.value) > 0 && row.value % 1
|
|
38
|
+
let valueNew = 0;
|
|
39
|
+
if (row !== null && row !== void 0 && row.value && Math.abs(row.value) > 0 && row.value % 1 !== 0) {
|
|
41
40
|
var _row$value;
|
|
42
|
-
|
|
41
|
+
valueNew = row === null || row === void 0 ? void 0 : (_row$value = row.value) === null || _row$value === void 0 ? void 0 : _row$value.toFixed(2);
|
|
43
42
|
} else {
|
|
44
|
-
|
|
43
|
+
valueNew = row === null || row === void 0 ? void 0 : row.value;
|
|
45
44
|
}
|
|
46
|
-
return dotCut ? (0, _CommonFunctions.getFormattedValue)(
|
|
45
|
+
return dotCut ? (0, _CommonFunctions.getFormattedValue)(valueNew) : (0, _CommonFunctions.getNumberWithCommas)(valueNew);
|
|
47
46
|
};
|
|
48
47
|
(0, _react.useEffect)(() => {
|
|
49
48
|
const handleResize = () => {
|
|
@@ -97,7 +96,7 @@ const TotalDoughnutChart = props => {
|
|
|
97
96
|
id: "Controls",
|
|
98
97
|
height: height,
|
|
99
98
|
width: width
|
|
100
|
-
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.TitleAndValueContainer, {
|
|
99
|
+
}, !hideTitleAndValue && /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.TitleAndValueContainer, {
|
|
101
100
|
id: "TitleAndValueContainer"
|
|
102
101
|
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.Title, {
|
|
103
102
|
id: "Title",
|
|
@@ -109,7 +108,7 @@ const TotalDoughnutChart = props => {
|
|
|
109
108
|
width: width
|
|
110
109
|
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.CurrencySign, {
|
|
111
110
|
id: "CurrencySign"
|
|
112
|
-
}, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, value) : ''), dotCut ? (0, _CommonFunctions.getFormattedValue)(value && Math.abs(value) > 0 && value % 1
|
|
111
|
+
}, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, value) : ''), dotCut ? (0, _CommonFunctions.getFormattedValue)(value && Math.abs(value) > 0 && value % 1 !== 0 ? value === null || value === void 0 ? void 0 : value.toFixed(2) : value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ''), addingBenchmark && /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, null))), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartAndLegendContainer, {
|
|
113
112
|
id: "DoughnutChartAndLegendContainer"
|
|
114
113
|
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartContainer, {
|
|
115
114
|
id: "DoughnutChartContainer",
|
|
@@ -166,8 +165,8 @@ TotalDoughnutChart.defaultProps = {
|
|
|
166
165
|
width: '100%',
|
|
167
166
|
height: '100%',
|
|
168
167
|
textcolor: '#212121',
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
isPercent: false,
|
|
169
|
+
hideTitleAndValue: false
|
|
171
170
|
};
|
|
172
171
|
function CustomTooltip(_ref) {
|
|
173
172
|
let {
|