sag_components 1.0.705 → 1.0.706
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.
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.BarChartsByWeeks = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _recharts = require("recharts");
|
|
11
|
+
var _FormattedValue = require("./FormattedValue");
|
|
11
12
|
var _CommonFunctions = require("./CommonFunctions");
|
|
12
13
|
var _BarChartsByWeeks = require("./BarChartsByWeeks.style");
|
|
13
14
|
var _PerformanceAnalyticsLegend = _interopRequireDefault(require("./PerformanceAnalyticsLegend"));
|
|
@@ -20,6 +21,11 @@ const ICON_TYPE_LEGEND_LINE_ICON = 'LegendLineIcon';
|
|
|
20
21
|
const BarChartsByWeeks = props => {
|
|
21
22
|
const {
|
|
22
23
|
title,
|
|
24
|
+
headerValueTopTitle,
|
|
25
|
+
headerValueBottomTitle,
|
|
26
|
+
headerValue,
|
|
27
|
+
HeaderValueCurrencyType,
|
|
28
|
+
HeaderValueIsPercent,
|
|
23
29
|
barChartData,
|
|
24
30
|
isTitleOriganal,
|
|
25
31
|
width,
|
|
@@ -88,11 +94,11 @@ const BarChartsByWeeks = props => {
|
|
|
88
94
|
var _getWeek;
|
|
89
95
|
if (!barChartData || barChartData.length === 0) return '';
|
|
90
96
|
return /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.EventWeeksLegendDataElementsContainer, {
|
|
91
|
-
|
|
97
|
+
className: "EventWeeksLegendDataElementsContainer"
|
|
92
98
|
}, (_getWeek = getWeek()) === null || _getWeek === void 0 ? void 0 : _getWeek.map(item => {
|
|
93
99
|
var _item$title2, _item$title3;
|
|
94
100
|
return /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.EventWeeksLegendDataElement, {
|
|
95
|
-
|
|
101
|
+
className: "EventWeeksLegendDataElement",
|
|
96
102
|
color: item.title >= startWeekRange && item.title <= endWeekRange ? xselectedColor : '',
|
|
97
103
|
textColor: item.title >= startWeekRange && item.title <= endWeekRange ? '#212121' : '#B1B1B1',
|
|
98
104
|
fontWeight: item.title >= startWeekRange && item.title <= endWeekRange ? 600 : 400,
|
|
@@ -102,21 +108,28 @@ const BarChartsByWeeks = props => {
|
|
|
102
108
|
}));
|
|
103
109
|
};
|
|
104
110
|
const displayEventWeeksLegendData = () => /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.EventWeeksLegendMainContainer, {
|
|
105
|
-
|
|
111
|
+
className: "EventWeeksLegendMainContainer"
|
|
106
112
|
}, displayEventWeeksElements());
|
|
107
113
|
return /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.ControlsContainer, {
|
|
108
|
-
|
|
114
|
+
className: "ControlsContainer",
|
|
109
115
|
height: height,
|
|
110
116
|
width: width,
|
|
111
117
|
ref: controlsContainerRef
|
|
112
118
|
}, /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.Controls, {
|
|
113
|
-
|
|
119
|
+
className: "Controls"
|
|
114
120
|
}, /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.TitleAndValueContainer, {
|
|
115
|
-
|
|
121
|
+
className: "TitleAndValueContainer"
|
|
116
122
|
}, /*#__PURE__*/_react.default.createElement(_BarChartsByWeeks.Title, {
|
|
117
|
-
|
|
118
|
-
}, title)
|
|
119
|
-
|
|
123
|
+
className: "Title"
|
|
124
|
+
}, title), /*#__PURE__*/_react.default.createElement(_FormattedValue.FormattedValue, {
|
|
125
|
+
title: headerValueTopTitle,
|
|
126
|
+
subtitle: headerValueBottomTitle,
|
|
127
|
+
value: headerValue,
|
|
128
|
+
currencyType: HeaderValueCurrencyType,
|
|
129
|
+
isPercent: HeaderValueIsPercent,
|
|
130
|
+
dotCut: true
|
|
131
|
+
})), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
132
|
+
className: "ResponsiveContainer",
|
|
120
133
|
width: "100%",
|
|
121
134
|
height: showLegend ? '80%' : '86%'
|
|
122
135
|
}, /*#__PURE__*/_react.default.createElement(_recharts.BarChart, {
|
|
@@ -178,7 +191,12 @@ const BarChartsByWeeks = props => {
|
|
|
178
191
|
exports.BarChartsByWeeks = BarChartsByWeeks;
|
|
179
192
|
var _default = exports.default = BarChartsByWeeks;
|
|
180
193
|
BarChartsByWeeks.defaultProps = {
|
|
181
|
-
title: '
|
|
194
|
+
title: '',
|
|
195
|
+
headerValueTopTitle: '',
|
|
196
|
+
headerValueBottomTitle: '',
|
|
197
|
+
headerValue: '',
|
|
198
|
+
HeaderValueCurrencyType: '',
|
|
199
|
+
HeaderValueIsPercent: '',
|
|
182
200
|
barChartData: [{
|
|
183
201
|
title: '202320',
|
|
184
202
|
value: 542366
|
|
@@ -15,7 +15,7 @@ const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div(_templateO
|
|
|
15
15
|
const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n width: fit-content;\n"])));
|
|
16
16
|
const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 600;\n line-height: normal;\n"])));
|
|
17
17
|
const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 1rem;\n"])));
|
|
18
|
-
const Title = exports.Title = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-weight: 500;\n font-size:
|
|
18
|
+
const Title = exports.Title = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-weight: 500;\n font-size: 20px;\n line-height: 20px;\n @media (max-width: 1536px) {\n font-size: 16px;\n }\n @media (max-width: 1366px) {\n font-size: 14px;\n }\n\n"])));
|
|
19
19
|
const EventWeeksLegendMainContainer = exports.EventWeeksLegendMainContainer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n flex-direction: column;\n margin: 2px 0 0 0;\n padding-left: 55px;\n align-items: center;\n\n"])));
|
|
20
20
|
const EventWeeksLegendDataElementsContainer = exports.EventWeeksLegendDataElementsContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin: 0px;\n align-items: center;\n justify-content: space-around;\n width: 100%;\n"])));
|
|
21
21
|
const EventWeeksLegendDataElement = exports.EventWeeksLegendDataElement = _styledComponents.default.h4(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n font-weight: ", ";\n font-size: 12px;\n line-height: 15px;\n margin: 0px;\n width: 100%;\n justify-content: center;\n align-content: center;\n color: ", ";\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n background: ", ";\n @media (max-width: 1536px) {\n font-size: 11px;\n }\n @media (max-width: 1366px) {\n font-size: 10px;\n }\n"])), props => props.fontWeight, props => props.textColor, props => props.borderLeftRadius, props => props.borderLeftRadius, props => props.borderRightRadius, props => props.borderRightRadius, props => props.color);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.FormattedValue = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _CommonFunctions = require("./CommonFunctions");
|
|
10
|
+
var _FormattedValue = require("./FormattedValue.style");
|
|
11
|
+
/* FormattedValue */
|
|
12
|
+
const FormattedValue = props => {
|
|
13
|
+
const {
|
|
14
|
+
className,
|
|
15
|
+
title,
|
|
16
|
+
subtitle,
|
|
17
|
+
value,
|
|
18
|
+
dotCut,
|
|
19
|
+
currencySign,
|
|
20
|
+
currencyType,
|
|
21
|
+
width,
|
|
22
|
+
height,
|
|
23
|
+
textcolor,
|
|
24
|
+
isPercent
|
|
25
|
+
} = props;
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_FormattedValue.ControlsContainer, {
|
|
27
|
+
className: className || 'FormattedValue_ControlsContainer',
|
|
28
|
+
height: height,
|
|
29
|
+
width: width,
|
|
30
|
+
textcolor: textcolor
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(_FormattedValue.Controls, {
|
|
32
|
+
className: "Controls",
|
|
33
|
+
height: height,
|
|
34
|
+
width: width
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_FormattedValue.TitleAndValueContainer, {
|
|
36
|
+
className: "TitleAndValueContainer"
|
|
37
|
+
}, title ? /*#__PURE__*/_react.default.createElement(_FormattedValue.Title, {
|
|
38
|
+
className: "Title",
|
|
39
|
+
width: width
|
|
40
|
+
}, title) : '', /*#__PURE__*/_react.default.createElement(_FormattedValue.CurrencySignAndFormattedValueContainer, {
|
|
41
|
+
className: "CurrencySignAndFormattedValueContainer"
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_FormattedValue.FormattedValueText, {
|
|
43
|
+
className: "FormattedValueText",
|
|
44
|
+
width: width
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement(_FormattedValue.CurrencySignOrPercent, {
|
|
46
|
+
className: "CurrencySignOrPercent"
|
|
47
|
+
}, 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) : '', /*#__PURE__*/_react.default.createElement(_FormattedValue.CurrencySignOrPercent, {
|
|
48
|
+
className: "CurrencySignOrPercent"
|
|
49
|
+
}, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/_react.default.createElement(_FormattedValue.Title, {
|
|
50
|
+
className: "Title",
|
|
51
|
+
width: width
|
|
52
|
+
}, subtitle) : '')));
|
|
53
|
+
};
|
|
54
|
+
exports.FormattedValue = FormattedValue;
|
|
55
|
+
var _default = exports.default = FormattedValue;
|
|
56
|
+
FormattedValue.defaultProps = {
|
|
57
|
+
className: 'FormattedValue_ControlsContainer',
|
|
58
|
+
title: '',
|
|
59
|
+
subtitle: '',
|
|
60
|
+
value: 0,
|
|
61
|
+
dotCut: false,
|
|
62
|
+
currencySign: false,
|
|
63
|
+
currencyType: 'USD',
|
|
64
|
+
width: '100%',
|
|
65
|
+
height: '100%',
|
|
66
|
+
textcolor: '#212121',
|
|
67
|
+
isPercent: false
|
|
68
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TitleAndValueContainer = exports.Title = exports.FormattedValueText = exports.CurrencySignOrPercent = exports.CurrencySignAndFormattedValueContainer = exports.ControlsContainer = exports.Controls = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
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-weight: 500;\n font-size: 20px;\n color: ", ";\n width: ", ";\n height: ", ";\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.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 TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column; \n"])));
|
|
15
|
+
const Title = exports.Title = _styledComponents.default.h4(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 20px;\n margin: 0;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 10px;\n }\n"])));
|
|
16
|
+
const CurrencySignAndFormattedValueContainer = exports.CurrencySignAndFormattedValueContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n gap: 16px;\n"])));
|
|
17
|
+
const CurrencySignOrPercent = exports.CurrencySignOrPercent = _styledComponents.default.span(_templateObject6 || (_templateObject6 = (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"])));
|
|
18
|
+
const FormattedValueText = exports.FormattedValueText = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 40px;\n @media (max-width: 1536px) {\n font-size: 34px;\n }\n @media (max-width: 1366px) {\n font-size: 28px;\n }\n"])));
|