sag_components 1.0.587 → 1.0.589

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.
@@ -34,7 +34,8 @@ const OneColumnContainer = props => {
34
34
  infoText,
35
35
  disableInfo,
36
36
  showViewByBannerButton,
37
- onBannerClick
37
+ onBannerClick,
38
+ columnTitle
38
39
  } = props;
39
40
  const [hover, setHover] = (0, _react.useState)(false);
40
41
  const [offsetWidth, setOffsetWidth] = (0, _react.useState)(200);
@@ -49,14 +50,16 @@ const OneColumnContainer = props => {
49
50
  width: width,
50
51
  height: height,
51
52
  overflow: overflow
52
- }, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.MainDiv, {
53
- className: "mainDiv",
53
+ }, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.OneColumnContainerMainDiv, {
54
+ className: "OneColumnContainerMainDiv",
54
55
  width: width,
55
56
  height: height,
56
57
  display: display,
57
58
  gridTemplateColumns: gridTemplateColumns,
58
59
  ref: nodeRef
59
- }, !isLoading && showViewByBannerButton && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.BannerContainer, {
60
+ }, !isLoading && columnTitle && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.ColumnTitle, {
61
+ className: "ColumnTitle"
62
+ }, columnTitle), !isLoading && showViewByBannerButton && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.BannerContainer, {
60
63
  className: "BannerContainer",
61
64
  right: disableInfo ? '15px' : '50px'
62
65
  }, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.OutBanner, {
@@ -64,7 +67,10 @@ const OneColumnContainer = props => {
64
67
  onClick: () => onBannerClick({
65
68
  eventName: 'onBannerClick'
66
69
  })
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, {
70
+ }, /*#__PURE__*/_react.default.createElement(_ExportIcon.ExportIcon, null), "View By Banner")), !isLoading && !hover && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.ChildrenContainer, {
71
+ className: "ChildrenContainer",
72
+ padding: columnTitle || showViewByBannerButton ? '30px 0 0 0' : '0'
73
+ }, children), !disableInfo && !isLoading && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.IconContainer, {
68
74
  className: "IconContainer",
69
75
  onMouseEnter: () => setHover(true),
70
76
  onMouseLeave: () => setHover(false)
@@ -117,6 +123,7 @@ OneColumnContainer.defaultProps = {
117
123
  infoText: '',
118
124
  disableInfo: false,
119
125
  showViewByBannerButton: false,
120
- onBannerClick: () => {}
126
+ onBannerClick: () => {},
127
+ columnTitle: ''
121
128
  };
122
129
  var _default = exports.default = OneColumnContainer;
@@ -4,16 +4,18 @@ 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.MainDiv = exports.LoadingDiv = exports.InfoTitleLabel = exports.InfoTextLabel = exports.InfoTextContainer = exports.IconContainer = exports.BannerContainer = void 0;
7
+ exports.StyledContainer = exports.OutBanner = exports.OneColumnContainerMainDiv = exports.LoadingDiv = exports.InfoTitleLabel = exports.InfoTextLabel = exports.InfoTextContainer = exports.IconContainer = exports.ColumnTitle = exports.ChildrenContainer = exports.BannerContainer = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
11
11
  const StyledContainer = exports.StyledContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);\n display: flex;\n position: relative;\n border-radius: 10px;\n align-items: center;\n justify-content: center;\n overflow: ", ";\n background-color: white;\n"])), props => props.width, props => props.height, props => props.overflow);
12
12
  const InfoTextContainer = exports.InfoTextContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n width: ", ";\n height: ", ";\n display: flex;\n flex-direction: column;\n justify-content: center;\n background: white;\n margin: 15px 20px 0px 20px;\n"])), props => props.width, props => props.height);
13
13
  const InfoTitleLabel = exports.InfoTitleLabel = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 600;\n color: black;\n margin: 0px 0px 10px 0px;\n font-size: 18px;\n line-height: 32px;\n overflow: hidden;\n"])));
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
- 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
- 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 MainDiv = exports.MainDiv = _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
- 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
- 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);
15
+ const ColumnTitle = exports.ColumnTitle = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 18px;\n left: 20px;\n width: 85%;\n height: 18px;\n color: black;\n font-family: \"Poppins\", sans-serif;\n font-size: 20px;\n font-weight: 400;\n overflow: hidden;\n display: flex;\n flex-wrap: nowrap; \n align-items: center; \n justify-content: flex-start;\n"])));
16
+ const IconContainer = exports.IconContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n width: 20px;\n height: 20px;\n top: 10px;\n right: 10px;\n position: absolute;\n"])));
17
+ const LoadingDiv = exports.LoadingDiv = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (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"])));
18
+ const OneColumnContainerMainDiv = exports.OneColumnContainerMainDiv = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (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 //padding: ", ";\n grid-template-columns: ", ";\n"])), props => props.width, props => props.height, props => props.display, props => props.padding || 0, props => props.gridTemplateColumns);
19
+ const BannerContainer = exports.BannerContainer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 140px;\n height: 20px;\n top: 20px;\n right: ", "; \n font-family: \"Poppins\", sans-serif;\n user-select: none;\n"])), props => props.right);
20
+ const OutBanner = exports.OutBanner = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (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);
21
+ const ChildrenContainer = exports.ChildrenContainer = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n margin: 0;\n padding: ", ";\n"])), props => props.padding || 0);
@@ -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
- noDataText,
32
- isPercent
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 value = 0;
40
- if (row !== null && row !== void 0 && row.value && Math.abs(row.value) > 0 && row.value % 1 != 0) {
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
- value = row === null || row === void 0 ? void 0 : (_row$value = row.value) === null || _row$value === void 0 ? void 0 : _row$value.toFixed(2);
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
- value = row === null || row === void 0 ? void 0 : row.value;
43
+ valueNew = row === null || row === void 0 ? void 0 : row.value;
45
44
  }
46
- return dotCut ? (0, _CommonFunctions.getFormattedValue)(value) : (0, _CommonFunctions.getNumberWithCommas)(value);
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 != 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, {
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
- noDataText: '',
170
- isPercent: false
168
+ isPercent: false,
169
+ hideTitleAndValue: false
171
170
  };
172
171
  function CustomTooltip(_ref) {
173
172
  let {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.587",
3
+ "version": "1.0.589",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {