sag_components 1.0.46 → 1.0.48
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/ArrowDownIcon.js +24 -0
- package/dist/stories/components/ArrowUpIcon.js +24 -0
- package/dist/stories/components/Benchmark.js +30 -4
- package/dist/stories/components/FilterContainer.js +2 -1
- package/dist/stories/components/SegmentedButton.js +10 -6
- package/dist/stories/components/TotalBenchmark.js +1 -0
- package/dist/stories/components/TotalBenchmarkArrows.js +91 -0
- package/dist/stories/components/TotalBenchmarkArrows.style.js +62 -0
- package/dist/stories/components/TotalBenchmarkBarchart.js +128 -0
- package/dist/stories/components/TotalBenchmarkBarchart.style.js +54 -0
- package/package.json +1 -1
- package/dist/stories/Button.style.js +0 -14
- package/dist/stories/Dropdown.style.js +0 -14
- package/dist/stories/OneColumnContainer.style.js +0 -28
- package/dist/stories/SegmentedButton.style.js +0 -39
- package/dist/stories/TotalDoughnutChart.style.js +0 -44
|
@@ -0,0 +1,24 @@
|
|
|
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.ArrowDownIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var ArrowDownIcon = function ArrowDownIcon(_ref) {
|
|
10
|
+
var clicked = _ref.clicked;
|
|
11
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
12
|
+
width: "8",
|
|
13
|
+
height: "9",
|
|
14
|
+
viewBox: "0 0 8 9",
|
|
15
|
+
fill: "none",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
17
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
18
|
+
d: "M3.52935 8.81165C3.78967 9.06278 4.21242 9.06278 4.47273 8.81165L7.80476 5.59719C8.06508 5.34606 8.06508 4.93822 7.80476 4.68709C7.54445 4.43596 7.1217 4.43596 6.86138 4.68709L4.66641 6.80663L4.66641 0.642893C4.66641 0.287292 4.36861 -4.08657e-07 4 -4.40881e-07C3.63139 -4.73106e-07 3.33359 0.287292 3.33359 0.642893L3.33359 6.80663L1.13862 4.6891C0.878303 4.43797 0.455551 4.43797 0.195236 4.6891C-0.0650787 4.94023 -0.0650787 5.34807 0.195236 5.5992L3.52727 8.81366L3.52935 8.81165Z",
|
|
19
|
+
fill: "#F00021"
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
exports.ArrowDownIcon = ArrowDownIcon;
|
|
23
|
+
var _default = ArrowDownIcon;
|
|
24
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
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.ArrowUpIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var ArrowUpIcon = function ArrowUpIcon(_ref) {
|
|
10
|
+
var clicked = _ref.clicked;
|
|
11
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
12
|
+
width: "8",
|
|
13
|
+
height: "9",
|
|
14
|
+
viewBox: "0 0 8 9",
|
|
15
|
+
fill: "none",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
17
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
18
|
+
d: "M4.47065 0.188348C4.21033 -0.0627825 3.78758 -0.0627825 3.52727 0.188348L0.195236 3.40281C-0.0650787 3.65394 -0.0650787 4.06178 0.195236 4.31291C0.455551 4.56404 0.878303 4.56404 1.13862 4.31291L3.33359 2.19337V8.35711C3.33359 8.71271 3.63139 9 4 9C4.36861 9 4.66641 8.71271 4.66641 8.35711V2.19337L6.86138 4.3109C7.1217 4.56203 7.54445 4.56203 7.80476 4.3109C8.06508 4.05977 8.06508 3.65193 7.80476 3.4008L4.47273 0.186338L4.47065 0.188348Z",
|
|
19
|
+
fill: "#5FCC70"
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
exports.ArrowUpIcon = ArrowUpIcon;
|
|
23
|
+
var _default = ArrowUpIcon;
|
|
24
|
+
exports.default = _default;
|
|
@@ -8,13 +8,14 @@ exports.default = exports.Benchmark = void 0;
|
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _BenchmarkStyle = require("./Benchmark.style.js");
|
|
11
|
-
var _excluded = ["totalValue", "currentValue", "width", "height", "color", "linearGradientColor", "underAvarageColor", "linearGradientUnderAvarageColor", "backgroundColor"];
|
|
11
|
+
var _excluded = ["totalValue", "currentValue", "benchmarkValue", "width", "height", "color", "linearGradientColor", "underAvarageColor", "linearGradientUnderAvarageColor", "backgroundColor"];
|
|
12
12
|
/*Benchmark*/
|
|
13
13
|
var Benchmark = function Benchmark(_ref) {
|
|
14
14
|
var _ref$totalValue = _ref.totalValue,
|
|
15
15
|
totalValue = _ref$totalValue === void 0 ? 100 : _ref$totalValue,
|
|
16
16
|
_ref$currentValue = _ref.currentValue,
|
|
17
17
|
currentValue = _ref$currentValue === void 0 ? 60 : _ref$currentValue,
|
|
18
|
+
benchmarkValue = _ref.benchmarkValue,
|
|
18
19
|
_ref$width = _ref.width,
|
|
19
20
|
width = _ref$width === void 0 ? 100 : _ref$width,
|
|
20
21
|
_ref$height = _ref.height,
|
|
@@ -38,7 +39,15 @@ var Benchmark = function Benchmark(_ref) {
|
|
|
38
39
|
var getUnderAvarageColor = function getUnderAvarageColor() {
|
|
39
40
|
if (!totalValue) return backgroundColor;
|
|
40
41
|
if (currentValue > totalValue) return color;
|
|
41
|
-
|
|
42
|
+
var benchmarkCurrentValue;
|
|
43
|
+
if (!benchmarkValue) {
|
|
44
|
+
benchmarkCurrentValue = 0.5;
|
|
45
|
+
} else if (benchmarkValue > totalValue) {
|
|
46
|
+
benchmarkCurrentValue = 1;
|
|
47
|
+
} else {
|
|
48
|
+
benchmarkCurrentValue = benchmarkValue / totalValue;
|
|
49
|
+
}
|
|
50
|
+
if (currentValue / totalValue <= benchmarkCurrentValue) {
|
|
42
51
|
return underAvarageColor;
|
|
43
52
|
} else {
|
|
44
53
|
return color;
|
|
@@ -47,12 +56,29 @@ var Benchmark = function Benchmark(_ref) {
|
|
|
47
56
|
var getUnderAvaragelinearGradientColor = function getUnderAvaragelinearGradientColor() {
|
|
48
57
|
if (!totalValue) return backgroundColor;
|
|
49
58
|
if (currentValue > totalValue) return linearGradientColor;
|
|
50
|
-
|
|
59
|
+
var benchmarkCurrentValue;
|
|
60
|
+
if (!benchmarkValue) {
|
|
61
|
+
benchmarkCurrentValue = 0.5;
|
|
62
|
+
} else if (benchmarkValue > totalValue) {
|
|
63
|
+
benchmarkCurrentValue = 1;
|
|
64
|
+
} else {
|
|
65
|
+
benchmarkCurrentValue = benchmarkValue / totalValue;
|
|
66
|
+
}
|
|
67
|
+
if (currentValue / totalValue <= benchmarkCurrentValue) {
|
|
51
68
|
return linearGradientUnderAvarageColor;
|
|
52
69
|
} else {
|
|
53
70
|
return linearGradientColor;
|
|
54
71
|
}
|
|
55
72
|
};
|
|
73
|
+
var getBenchmarkLeft = function getBenchmarkLeft() {
|
|
74
|
+
if (!benchmarkValue) {
|
|
75
|
+
return width / 2;
|
|
76
|
+
}
|
|
77
|
+
if (benchmarkValue > totalValue) {
|
|
78
|
+
return width;
|
|
79
|
+
}
|
|
80
|
+
return width * (benchmarkValue / totalValue);
|
|
81
|
+
};
|
|
56
82
|
return /*#__PURE__*/_react.default.createElement(_BenchmarkStyle.ControlsContainer, {
|
|
57
83
|
height: height,
|
|
58
84
|
width: width
|
|
@@ -72,7 +98,7 @@ var Benchmark = function Benchmark(_ref) {
|
|
|
72
98
|
height: height + 4,
|
|
73
99
|
width: 0,
|
|
74
100
|
top: -2,
|
|
75
|
-
left:
|
|
101
|
+
left: getBenchmarkLeft()
|
|
76
102
|
})));
|
|
77
103
|
};
|
|
78
104
|
exports.Benchmark = Benchmark;
|
|
@@ -10,6 +10,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
10
10
|
var _FilterContainer = require("./FilterContainer.style");
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
require("./Filter.css");
|
|
13
14
|
var _excluded = ["width", "nodeRef", "height"];
|
|
14
15
|
var _templateObject;
|
|
15
16
|
var Card = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)([""])));
|
|
@@ -24,7 +25,7 @@ var FilterContainer = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
|
24
25
|
width: width,
|
|
25
26
|
height: height
|
|
26
27
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
27
|
-
className:
|
|
28
|
+
className: 'filter',
|
|
28
29
|
ref: nodeRef
|
|
29
30
|
}, props.children), /*#__PURE__*/_react.default.createElement(_FilterContainer.FilterFooterContent, null));
|
|
30
31
|
});
|
|
@@ -11,15 +11,15 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm
|
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _SegmentedButtonStyle = require("./SegmentedButton.style.js");
|
|
14
|
-
var _excluded = ["name", "options", "
|
|
14
|
+
var _excluded = ["name", "options", "width", "heigth", "controlRadius", "segmentRadius", "fontSize", "backgroundColor", "selectedSegmentColor", "selectedTextColor", "unselectedTextColor", "defaultIndex", "onClick"];
|
|
15
15
|
/*SegmentedButton*/
|
|
16
16
|
var SegmentedButton = function SegmentedButton(_ref) {
|
|
17
17
|
var name = _ref.name,
|
|
18
18
|
options = _ref.options,
|
|
19
|
-
_ref$
|
|
20
|
-
|
|
21
|
-
_ref$
|
|
22
|
-
|
|
19
|
+
_ref$width = _ref.width,
|
|
20
|
+
width = _ref$width === void 0 ? 120 : _ref$width,
|
|
21
|
+
_ref$heigth = _ref.heigth,
|
|
22
|
+
heigth = _ref$heigth === void 0 ? 40 : _ref$heigth,
|
|
23
23
|
_ref$controlRadius = _ref.controlRadius,
|
|
24
24
|
controlRadius = _ref$controlRadius === void 0 ? 8 : _ref$controlRadius,
|
|
25
25
|
_ref$segmentRadius = _ref.segmentRadius,
|
|
@@ -76,6 +76,10 @@ var SegmentedButton = function SegmentedButton(_ref) {
|
|
|
76
76
|
value: value
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
+
var segmentWidth = 120;
|
|
80
|
+
if (options && options.length > 0 && width && width > 0) {
|
|
81
|
+
segmentWidth = width / options.length;
|
|
82
|
+
}
|
|
79
83
|
return /*#__PURE__*/_react.default.createElement(_SegmentedButtonStyle.ControlsContainer, {
|
|
80
84
|
fontSize: fontSize,
|
|
81
85
|
ref: controlRef
|
|
@@ -108,7 +112,7 @@ var SegmentedButton = function SegmentedButton(_ref) {
|
|
|
108
112
|
}), /*#__PURE__*/_react.default.createElement(_SegmentedButtonStyle.SegmentLabel, {
|
|
109
113
|
selectedTextColor: selectedTextColor,
|
|
110
114
|
unselectedTextColor: unselectedTextColor,
|
|
111
|
-
segmentHeigth:
|
|
115
|
+
segmentHeigth: heigth / 5,
|
|
112
116
|
className: "".concat(activeIndex === i ? "active" : "inactive", " "),
|
|
113
117
|
htmlFor: item.value
|
|
114
118
|
}, item.value));
|
|
@@ -40,6 +40,7 @@ var TotalBenchmark = function TotalBenchmark(_ref) {
|
|
|
40
40
|
}, /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, {
|
|
41
41
|
totalValue: item.totalValue,
|
|
42
42
|
currentValue: item.value,
|
|
43
|
+
benchmarkValue: item.benchmarkValue,
|
|
43
44
|
height: 12,
|
|
44
45
|
width: 100,
|
|
45
46
|
color: "#79DB95",
|
|
@@ -0,0 +1,91 @@
|
|
|
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.TotalBenchmarkArrows = void 0;
|
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _ArrowUpIcon = require("./ArrowUpIcon");
|
|
11
|
+
var _ArrowDownIcon = require("./ArrowDownIcon");
|
|
12
|
+
var _CommonFunctions = require("./CommonFunctions");
|
|
13
|
+
var _Benchmark = require("./Benchmark");
|
|
14
|
+
var _TotalBenchmarkArrowsStyle = require("./TotalBenchmarkArrows.style.js");
|
|
15
|
+
var _excluded = ["title", "value", "benchmarkTotalValue", "benchmarkValue", "detailsTitle", "detailsData", "dotCut", "width", "height", "textColor"];
|
|
16
|
+
/*TotalBenchmarkArrows*/
|
|
17
|
+
var TotalBenchmarkArrows = function TotalBenchmarkArrows(_ref) {
|
|
18
|
+
var title = _ref.title,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
benchmarkTotalValue = _ref.benchmarkTotalValue,
|
|
21
|
+
benchmarkValue = _ref.benchmarkValue,
|
|
22
|
+
_ref$detailsTitle = _ref.detailsTitle,
|
|
23
|
+
detailsTitle = _ref$detailsTitle === void 0 ? "" : _ref$detailsTitle,
|
|
24
|
+
detailsData = _ref.detailsData,
|
|
25
|
+
_ref$dotCut = _ref.dotCut,
|
|
26
|
+
dotCut = _ref$dotCut === void 0 ? true : _ref$dotCut,
|
|
27
|
+
_ref$width = _ref.width,
|
|
28
|
+
width = _ref$width === void 0 ? 260 : _ref$width,
|
|
29
|
+
_ref$height = _ref.height,
|
|
30
|
+
height = _ref$height === void 0 ? 350 : _ref$height,
|
|
31
|
+
_ref$textColor = _ref.textColor,
|
|
32
|
+
textColor = _ref$textColor === void 0 ? "black" : _ref$textColor,
|
|
33
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
34
|
+
var getArrowSign = function getArrowSign(value) {
|
|
35
|
+
if (!value) {
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
38
|
+
if (value >= 0) {
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.DetailsRowArrow, {
|
|
40
|
+
value: value
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_ArrowUpIcon.ArrowUpIcon, null));
|
|
42
|
+
} else {
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.DetailsRowArrow, {
|
|
44
|
+
value: value
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement(_ArrowDownIcon.ArrowDownIcon, null));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.ControlsContainer, {
|
|
49
|
+
height: height,
|
|
50
|
+
width: width,
|
|
51
|
+
textColor: textColor
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.Controls, {
|
|
53
|
+
height: height,
|
|
54
|
+
width: width
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.Title, {
|
|
56
|
+
width: width
|
|
57
|
+
}, title), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.FormattedValue, {
|
|
58
|
+
width: width
|
|
59
|
+
}, dotCut ? (0, _CommonFunctions.getFormattedValue)(value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ""), benchmarkTotalValue ? /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.BenchmarkContainer, {
|
|
60
|
+
width: width
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, {
|
|
62
|
+
totalValue: benchmarkTotalValue,
|
|
63
|
+
currentValue: value,
|
|
64
|
+
benchmarkValue: benchmarkValue,
|
|
65
|
+
height: 12,
|
|
66
|
+
width: 100,
|
|
67
|
+
color: "#79DB95",
|
|
68
|
+
linearGradientColor: "#C3EFD0",
|
|
69
|
+
linearGradientUnderAvarageColor: "#FDB1B1",
|
|
70
|
+
underAvarageColor: "#FD5959",
|
|
71
|
+
backgroundColor: "#F2F2F2"
|
|
72
|
+
})) : "", /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.DetailsContainer, {
|
|
73
|
+
height: height,
|
|
74
|
+
width: width
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.DetailsTitle, {
|
|
76
|
+
height: height,
|
|
77
|
+
width: width
|
|
78
|
+
}, detailsTitle), detailsData.map(function (item, index) {
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.DetailsRowContainer, {
|
|
80
|
+
height: height,
|
|
81
|
+
width: width,
|
|
82
|
+
index: index
|
|
83
|
+
}, getArrowSign(item.value), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.DetailsRowFormattedValue, null, item.value ? Math.abs(item.value) : ""), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.DetailsRowPercentSign, null, " % "), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkArrowsStyle.DetailsRowTitle, {
|
|
84
|
+
height: height,
|
|
85
|
+
width: width
|
|
86
|
+
}, item.title));
|
|
87
|
+
})), ";"));
|
|
88
|
+
};
|
|
89
|
+
exports.TotalBenchmarkArrows = TotalBenchmarkArrows;
|
|
90
|
+
var _default = TotalBenchmarkArrows;
|
|
91
|
+
exports.default = _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Title = exports.FormattedValue = exports.DetailsTitle = exports.DetailsRowTitle = exports.DetailsRowPercentSign = exports.DetailsRowFormattedValue = exports.DetailsRowContainer = exports.DetailsRowArrow = exports.DetailsContainer = exports.ControlsContainer = exports.Controls = exports.BenchmarkContainer = 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, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
11
|
+
var MIN_HEIGHT = 300;
|
|
12
|
+
var MIN_WIDTH = 260;
|
|
13
|
+
var ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n position: relative;\n margin: 0px 0 0px;\n font-family: \"Lato\", sans-serif;\n font-style: normal;\n color: ", ";\n width: ", ";\n height: ", ";\n //box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);\n border-radius: 12px;\n //border: 1px solid red;\n"])), function (props) {
|
|
14
|
+
return props.textColor;
|
|
15
|
+
}, function (props) {
|
|
16
|
+
return (props.width - MIN_WIDTH <= 0 ? MIN_WIDTH : props.width).toString().concat("", "px");
|
|
17
|
+
}, function (props) {
|
|
18
|
+
return (props.height - MIN_HEIGHT <= 0 ? MIN_HEIGHT : props.height).toString().concat("", "px");
|
|
19
|
+
});
|
|
20
|
+
exports.ControlsContainer = ControlsContainer;
|
|
21
|
+
var Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n border-radius: 12px;\n width: ", ";\n height: ", ";\n top: 68px;\n left: 40px;\n background: #ffffff;\n //border: 1px solid yellow;\n"])), function (props) {
|
|
22
|
+
return (props.width - MIN_WIDTH <= 0 ? 217 : 217 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
23
|
+
}, function (props) {
|
|
24
|
+
return (props.height - MIN_HEIGHT <= 0 ? 230 : 230 + (props.height - MIN_HEIGHT)).toString().concat("", "px");
|
|
25
|
+
});
|
|
26
|
+
exports.Controls = Controls;
|
|
27
|
+
var Title = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: ", ";\n height: 22px;\n left: 0px;\n top: 0px;\n font-weight: 600;\n font-size: 18px;\n line-height: 22px;\n //border: 1px solid red;\n"])), function (props) {
|
|
28
|
+
return (props.width - MIN_WIDTH <= 0 ? 250 : 250 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
29
|
+
});
|
|
30
|
+
exports.Title = Title;
|
|
31
|
+
var FormattedValue = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: ", ";\n height: 48px;\n left: 0px;\n top: 40px;\n font-weight: 500;\n font-size: 40px;\n line-height: 48px;\n //border: 1px solid red;\n"])), function (props) {
|
|
32
|
+
return (props.width - MIN_WIDTH <= 0 ? 217 : 217 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
33
|
+
});
|
|
34
|
+
exports.FormattedValue = FormattedValue;
|
|
35
|
+
var BenchmarkContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 100px;\n height: 12px;\n left: ", ";\n top: 66px;\n //border: 1px solid red;\n"])), function (props) {
|
|
36
|
+
return (props.width - MIN_WIDTH <= 0 ? 115 : 115 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
37
|
+
});
|
|
38
|
+
exports.BenchmarkContainer = BenchmarkContainer;
|
|
39
|
+
var DetailsContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: ", "; \n height: ", "; \n left: 0px;\n top: 150px;\n //border: 1px solid green;\n"])), function (props) {
|
|
40
|
+
return (props.width - MIN_WIDTH <= 0 ? 217 : 217 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
41
|
+
}, function (props) {
|
|
42
|
+
return (props.height - MIN_HEIGHT <= 0 ? 80 : 80 + (props.height - MIN_HEIGHT)).toString().concat("", "px");
|
|
43
|
+
});
|
|
44
|
+
exports.DetailsContainer = DetailsContainer;
|
|
45
|
+
var DetailsTitle = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: ", ";\n height: 22px;\n left: 0px;\n top: 0px;\n font-weight: 600;\n font-size: 16px;\n line-height: 19px;\n //border: 1px solid red;\n"])), function (props) {
|
|
46
|
+
return (props.width - MIN_WIDTH <= 0 ? 240 : 240 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
47
|
+
});
|
|
48
|
+
exports.DetailsTitle = DetailsTitle;
|
|
49
|
+
var DetailsRowContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n display: inline-flex;\n width: ", ";\n height: 35px;\n left: 0px;\n top: ", ";\n //border: 1px solid brown;\n"])), function (props) {
|
|
50
|
+
return (props.width - MIN_WIDTH <= 0 ? 220 : 220 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
51
|
+
}, function (props) {
|
|
52
|
+
return (35 + 35 * props.index).toString().concat("", "px");
|
|
53
|
+
});
|
|
54
|
+
exports.DetailsRowContainer = DetailsRowContainer;
|
|
55
|
+
var DetailsRowArrow = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)([" \n margin-left: 0px;\n margin-top: 4px; \n height: 12px; \n font-size: 12px;\n line-height: 14px; \n //border: 1px solid red;\n"])));
|
|
56
|
+
exports.DetailsRowArrow = DetailsRowArrow;
|
|
57
|
+
var DetailsRowFormattedValue = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 5px;\n height: 19px;\n left: 0px;\n top: 0px;\n font-weight: 600;\n font-size: 16px;\n line-height: 19px;\n //border: 1px solid red;\n"])));
|
|
58
|
+
exports.DetailsRowFormattedValue = DetailsRowFormattedValue;
|
|
59
|
+
var DetailsRowPercentSign = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)([" \n margin-left: 5px;\n margin-top: 3px;\n margin-right: 10px;\n text-align: bottom;\n height: 16px;\n left: 32px;\n top: 5px;\n font-weight: 600;\n font-size: 12px;\n line-height: 14px;\n //border: 1px solid red;\n"])));
|
|
60
|
+
exports.DetailsRowPercentSign = DetailsRowPercentSign;
|
|
61
|
+
var DetailsRowTitle = _styledComponents.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)([" \n height: 19px;\n left: 50px;\n top: 0px;\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n //border: 1px solid red;\n"])));
|
|
62
|
+
exports.DetailsRowTitle = DetailsRowTitle;
|
|
@@ -0,0 +1,128 @@
|
|
|
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.TotalBenchmarkBarchart = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _recharts = require("recharts");
|
|
12
|
+
var _CommonFunctions = require("./CommonFunctions");
|
|
13
|
+
var _Benchmark = require("./Benchmark");
|
|
14
|
+
var _TotalBenchmarkBarchartStyle = require("./TotalBenchmarkBarchart.style.js");
|
|
15
|
+
var _excluded = ["title", "value", "benchmarkTotalValue", "benchmarkValue", "currency", "currencyType", "barChartData", "dotCut", "width", "height", "textColor"];
|
|
16
|
+
/*TotalBenchmarkBarchart*/
|
|
17
|
+
var TotalBenchmarkBarchart = function TotalBenchmarkBarchart(_ref) {
|
|
18
|
+
var title = _ref.title,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
benchmarkTotalValue = _ref.benchmarkTotalValue,
|
|
21
|
+
benchmarkValue = _ref.benchmarkValue,
|
|
22
|
+
_ref$currency = _ref.currency,
|
|
23
|
+
currency = _ref$currency === void 0 ? true : _ref$currency,
|
|
24
|
+
_ref$currencyType = _ref.currencyType,
|
|
25
|
+
currencyType = _ref$currencyType === void 0 ? "USD" : _ref$currencyType,
|
|
26
|
+
barChartData = _ref.barChartData,
|
|
27
|
+
_ref$dotCut = _ref.dotCut,
|
|
28
|
+
dotCut = _ref$dotCut === void 0 ? true : _ref$dotCut,
|
|
29
|
+
_ref$width = _ref.width,
|
|
30
|
+
width = _ref$width === void 0 ? 260 : _ref$width,
|
|
31
|
+
_ref$height = _ref.height,
|
|
32
|
+
height = _ref$height === void 0 ? 350 : _ref$height,
|
|
33
|
+
_ref$textColor = _ref.textColor,
|
|
34
|
+
textColor = _ref$textColor === void 0 ? "black" : _ref$textColor,
|
|
35
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
36
|
+
var formattedBarChartData = [];
|
|
37
|
+
if (barChartData && barChartData.length === 2) {
|
|
38
|
+
formattedBarChartData.push({
|
|
39
|
+
title1: barChartData[0].title,
|
|
40
|
+
value1: barChartData[0].value,
|
|
41
|
+
formattedValue1: currency ? (0, _CommonFunctions.getCurrencySign)(currencyType).toString().concat("", (0, _CommonFunctions.getFormattedValue)(barChartData[0].value), "", (0, _CommonFunctions.getFormattedUnits)(barChartData[0].value)) : "",
|
|
42
|
+
color1: barChartData[0].color ? barChartData[0].color : "#79DB95",
|
|
43
|
+
title2: barChartData[1].title,
|
|
44
|
+
value2: barChartData[1].value,
|
|
45
|
+
formattedValue2: currency ? (0, _CommonFunctions.getCurrencySign)(currencyType).toString().concat("", (0, _CommonFunctions.getFormattedValue)(barChartData[1].value), "", (0, _CommonFunctions.getFormattedUnits)(barChartData[1].value)) : "",
|
|
46
|
+
color2: barChartData[1].color ? barChartData[1].color : "#D4C0FF"
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.ControlsContainer, {
|
|
50
|
+
height: height,
|
|
51
|
+
width: width,
|
|
52
|
+
textColor: textColor
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.Controls, {
|
|
54
|
+
height: height,
|
|
55
|
+
width: width
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.Title, {
|
|
57
|
+
width: width
|
|
58
|
+
}, title), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.ValueAndBenchmarkContainer, {
|
|
59
|
+
height: height,
|
|
60
|
+
width: width
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.CurrencySign, null, currency ? (0, _CommonFunctions.getCurrencySign)(currencyType, value) : ""), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.FormattedValue, {
|
|
62
|
+
width: width
|
|
63
|
+
}, dotCut ? (0, _CommonFunctions.getFormattedValue)(value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ""), benchmarkTotalValue ? /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.BenchmarkContainer, {
|
|
64
|
+
width: width
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, {
|
|
66
|
+
totalValue: benchmarkTotalValue,
|
|
67
|
+
currentValue: value,
|
|
68
|
+
benchmarkValue: benchmarkValue,
|
|
69
|
+
height: 12,
|
|
70
|
+
width: 100,
|
|
71
|
+
color: "#79DB95",
|
|
72
|
+
linearGradientColor: "#C3EFD0",
|
|
73
|
+
linearGradientUnderAvarageColor: "#FDB1B1",
|
|
74
|
+
underAvarageColor: "#FD5959",
|
|
75
|
+
backgroundColor: "#F2F2F2"
|
|
76
|
+
})) : ""), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.BarchartContainer, {
|
|
77
|
+
height: height,
|
|
78
|
+
width: width
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.BarChart, {
|
|
80
|
+
width: 240,
|
|
81
|
+
height: 120,
|
|
82
|
+
data: formattedBarChartData,
|
|
83
|
+
margin: {
|
|
84
|
+
top: 20,
|
|
85
|
+
right: -20,
|
|
86
|
+
bottom: 0,
|
|
87
|
+
left: -20
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.CartesianGrid, {
|
|
90
|
+
strokeDasharray: "3 3",
|
|
91
|
+
vertical: false
|
|
92
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
93
|
+
dataKey: "value1",
|
|
94
|
+
fill: formattedBarChartData[0].color1,
|
|
95
|
+
name: "Actual",
|
|
96
|
+
maxBarSize: 60,
|
|
97
|
+
radius: [5, 5, 0, 0]
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
99
|
+
dataKey: "formattedValue1",
|
|
100
|
+
position: "top",
|
|
101
|
+
fill: textColor,
|
|
102
|
+
style: (0, _defineProperty2.default)({}, "font-size", "16px")
|
|
103
|
+
})), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
104
|
+
dataKey: "value2",
|
|
105
|
+
fill: formattedBarChartData[0].color2,
|
|
106
|
+
name: "Base Line",
|
|
107
|
+
maxBarSize: 60,
|
|
108
|
+
radius: [5, 5, 0, 0],
|
|
109
|
+
label: "aaa"
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
111
|
+
dataKey: "formattedValue2",
|
|
112
|
+
position: "top",
|
|
113
|
+
fill: textColor,
|
|
114
|
+
style: (0, _defineProperty2.default)({}, "font-size", "16px")
|
|
115
|
+
}))), formattedBarChartData && formattedBarChartData.length > 0 ? /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.BottomDetailsRowContainer, {
|
|
116
|
+
height: height,
|
|
117
|
+
width: width
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.BottomDetailsRowTitle, {
|
|
119
|
+
height: height,
|
|
120
|
+
width: width
|
|
121
|
+
}, formattedBarChartData[0].title1), /*#__PURE__*/_react.default.createElement(_TotalBenchmarkBarchartStyle.BottomDetailsRowTitle, {
|
|
122
|
+
height: height,
|
|
123
|
+
width: width
|
|
124
|
+
}, formattedBarChartData[0].title2)) : ""), ";"));
|
|
125
|
+
};
|
|
126
|
+
exports.TotalBenchmarkBarchart = TotalBenchmarkBarchart;
|
|
127
|
+
var _default = TotalBenchmarkBarchart;
|
|
128
|
+
exports.default = _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ValueAndBenchmarkContainer = exports.Title = exports.FormattedValue = exports.CurrencySign = exports.ControlsContainer = exports.Controls = exports.BottomDetailsRowTitle = exports.BottomDetailsRowContainer = exports.BenchmarkContainer = exports.BarchartContainer = 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, _templateObject8, _templateObject9, _templateObject10;
|
|
11
|
+
var MIN_HEIGHT = 300;
|
|
12
|
+
var MIN_WIDTH = 260;
|
|
13
|
+
var ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n position: relative;\n margin: 0px 0 0px;\n font-family: \"Lato\", sans-serif;\n font-style: normal;\n color: ", ";\n width: ", ";\n height: ", ";\n //box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);\n border-radius: 12px;\n //border: 1px solid red;\n"])), function (props) {
|
|
14
|
+
return props.textColor;
|
|
15
|
+
}, function (props) {
|
|
16
|
+
return (props.width - MIN_WIDTH <= 0 ? MIN_WIDTH : props.width).toString().concat("", "px");
|
|
17
|
+
}, function (props) {
|
|
18
|
+
return (props.height - MIN_HEIGHT <= 0 ? MIN_HEIGHT : props.height).toString().concat("", "px");
|
|
19
|
+
});
|
|
20
|
+
exports.ControlsContainer = ControlsContainer;
|
|
21
|
+
var Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n border-radius: 12px;\n width: ", ";\n height: ", ";\n top: 68px;\n left: 40px;\n background: #ffffff;\n //border: 1px solid yellow;\n"])), function (props) {
|
|
22
|
+
return (props.width - MIN_WIDTH <= 0 ? 217 : 217 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
23
|
+
}, function (props) {
|
|
24
|
+
return (props.height - MIN_HEIGHT <= 0 ? 230 : 230 + (props.height - MIN_HEIGHT)).toString().concat("", "px");
|
|
25
|
+
});
|
|
26
|
+
exports.Controls = Controls;
|
|
27
|
+
var Title = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: ", ";\n height: 22px;\n left: 0px;\n top: 0px;\n font-weight: 600;\n font-size: 18px;\n line-height: 22px;\n //border: 1px solid red;\n"])), function (props) {
|
|
28
|
+
return (props.width - MIN_WIDTH <= 0 ? 250 : 250 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
29
|
+
});
|
|
30
|
+
exports.Title = Title;
|
|
31
|
+
var ValueAndBenchmarkContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n display: inline-flex;\n width: ", ";\n height: ", ";\n left: 0px;\n top: 30px;\n //border: 1px solid green;\n"])), function (props) {
|
|
32
|
+
return (props.width - MIN_WIDTH <= 0 ? 217 : 217 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return (props.height - MIN_HEIGHT <= 0 ? 0 : 0 + (props.height - MIN_HEIGHT)).toString().concat("", "px");
|
|
35
|
+
});
|
|
36
|
+
exports.ValueAndBenchmarkContainer = ValueAndBenchmarkContainer;
|
|
37
|
+
var CurrencySign = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n //position: absolute;\n margin-left: 0px;\n margin-top: 19px;\n width: 11px;\n height: 22px;\n left: 40px;\n top: 10px;\n font-weight: 500;\n font-size: 18px;\n line-height: 22px;\n //border: 1px solid red;\n"])));
|
|
38
|
+
exports.CurrencySign = CurrencySign;
|
|
39
|
+
var FormattedValue = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n //position: absolute;\n margin-left: 2px;\n width: ", ";\n height: 48px;\n left: 0px;\n top: 40px;\n font-weight: 500;\n font-size: 40px;\n line-height: 48px;\n //border: 1px solid red;\n"])), function (props) {
|
|
40
|
+
return (props.width - MIN_WIDTH <= 0 ? 217 : 217 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
41
|
+
});
|
|
42
|
+
exports.FormattedValue = FormattedValue;
|
|
43
|
+
var BenchmarkContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n //position: absolute;\n margin-left: 4px;\n margin-top: 26px;\n width: 100px;\n height: 12px;\n left: ", ";\n //top: 24px;\n //border: 1px solid red;\n"])), function (props) {
|
|
44
|
+
return (props.width - MIN_WIDTH <= 0 ? 115 : 115 + (props.width - MIN_WIDTH)).toString().concat("", "px");
|
|
45
|
+
});
|
|
46
|
+
exports.BenchmarkContainer = BenchmarkContainer;
|
|
47
|
+
var BarchartContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n // display: inline-flex;\n width: 240 px;\n height: ", ";\n left: 0px;\n top: 120px;\n //border: 1px solid green;\n"])), function (props) {
|
|
48
|
+
return (props.height - MIN_HEIGHT <= 0 ? 100 : 100 + (props.height - MIN_HEIGHT)).toString().concat("", "px");
|
|
49
|
+
});
|
|
50
|
+
exports.BarchartContainer = BarchartContainer;
|
|
51
|
+
var BottomDetailsRowContainer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n //width: 245px;\n height: 20px;\n left: 0px;\n top: 3px;\n \n //border: 1px solid brown;\n"])));
|
|
52
|
+
exports.BottomDetailsRowContainer = BottomDetailsRowContainer;
|
|
53
|
+
var BottomDetailsRowTitle = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin-top: 1px;\n margin-left: 1px; \n margin-right: 1px;\n height: 19px;\n width: 115px;\n left: 0px;\n top: 0px;\n font-weight: 400;\n font-size: 14px;\n line-height: 17px;\n //border: 1px solid red;\n"])));
|
|
54
|
+
exports.BottomDetailsRowTitle = BottomDetailsRowTitle;
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DropdownContainer = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var DropdownContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "; \n text-align: left; \n position: relative; \n align-items: center;\n justify-content: center;\n"])), function (props) {
|
|
12
|
-
return props.width;
|
|
13
|
-
});
|
|
14
|
-
exports.DropdownContainer = DropdownContainer;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DropdownContainer = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var DropdownContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "; \n text-align: left; \n position: relative; \n align-items: center;\n justify-content: center;\n"])), function (props) {
|
|
12
|
-
return props.width;
|
|
13
|
-
});
|
|
14
|
-
exports.DropdownContainer = DropdownContainer;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.StyledContainer = exports.InfoTextLabel = exports.InfoTextContainer = exports.IconContainer = 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;
|
|
11
|
-
var StyledContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px; \n display: flex;\n position: relative;\n border-radius: 10px;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n"])), function (props) {
|
|
12
|
-
return props.width;
|
|
13
|
-
}, function (props) {
|
|
14
|
-
return props.height;
|
|
15
|
-
});
|
|
16
|
-
exports.StyledContainer = StyledContainer;
|
|
17
|
-
var InfoTextContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n align-items: center;\n display: flex;\n visibility: ", ";\n text-align: center;\n justify-content: center;\n background: rgba(16, 16, 16, .6);\n"])), function (props) {
|
|
18
|
-
return props.width;
|
|
19
|
-
}, function (props) {
|
|
20
|
-
return props.height;
|
|
21
|
-
}, function (props) {
|
|
22
|
-
return props.clicked ? 'visible' : 'hidden';
|
|
23
|
-
});
|
|
24
|
-
exports.InfoTextContainer = InfoTextContainer;
|
|
25
|
-
var InfoTextLabel = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n text-align: center;\n color: white;\n margin: 10px;\n justify-content: center;\n"])));
|
|
26
|
-
exports.InfoTextLabel = InfoTextLabel;
|
|
27
|
-
var IconContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n width: 15px;\n height: 15px;\n position: absolute;\n margin-top:10px;\n margin-right:10px;\n top: 0;\n right: 0;\n"])));
|
|
28
|
-
exports.IconContainer = IconContainer;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.SegmentLabel = exports.Segment = exports.ControlsInput = 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;
|
|
11
|
-
var ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex; \n font: ", "; \n margin: 100px 0 25px;\n --highlight-width: auto;\n --highlight-x-pos: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n"])), function (props) {
|
|
12
|
-
var _props$fontSize;
|
|
13
|
-
return (_props$fontSize = props.fontSize) === null || _props$fontSize === void 0 ? void 0 : _props$fontSize.toString().concat("", "px Lato, sans-serif");
|
|
14
|
-
});
|
|
15
|
-
exports.ControlsContainer = ControlsContainer;
|
|
16
|
-
var Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n justify-content: space-between; \n background: ", ";\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n border-radius: ", "; //12px\n // max-width: 500px; //use this to limit max lenght of the control \n padding: 6px; \n margin: auto;\n overflow: hidden;\n position: relative;\n &.controls::before {\n content: \"\";\n background: ", "; /* #3a9df9; #5465ff;*/\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n border-radius: ", "; //12px\n width: var(--highlight-width);\n transform: translateX(var(--highlight-x-pos));\n position: absolute;\n top: 6px;\n bottom: 6px;\n left: 0;\n z-index: 0;\n }\n &.controls.ready::before {\n transition: transform 0.3s ease, width 0.3s ease;\n }\n"])), function (props) {
|
|
17
|
-
return props.backgroundColor;
|
|
18
|
-
}, function (props) {
|
|
19
|
-
return props.controlRadius.toString().concat("", "px");
|
|
20
|
-
}, function (props) {
|
|
21
|
-
return props.selectedSegmentColor;
|
|
22
|
-
}, function (props) {
|
|
23
|
-
return props.segmentRadius.toString().concat("", "px");
|
|
24
|
-
});
|
|
25
|
-
exports.Controls = Controls;
|
|
26
|
-
var ControlsInput = _styledComponents.default.input(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n opacity: 0;\n margin: 0;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n position: absolute;\n width: 100%;\n cursor: pointer;\n height: 100%;\n"])));
|
|
27
|
-
exports.ControlsInput = ControlsInput;
|
|
28
|
-
var Segment = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n /* width: 100%; uncomment for each segment to have matching width */ \n min-width: ", "; //120px;\n position: relative;\n text-align: center;\n z-index: 1; \n"])), function (props) {
|
|
29
|
-
return props.segmentWidth.toString().concat("", "px");
|
|
30
|
-
});
|
|
31
|
-
exports.Segment = Segment;
|
|
32
|
-
var SegmentLabel = _styledComponents.default.label(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: block;\n //font-weight: 550;\n padding: ", "; //10px;\n transition: color 0.5s ease;\n &.active {\n color: ", ";\n }\n &.inactive {\n color: ", ";\n }\n"])), function (props) {
|
|
33
|
-
return props.segmentHeigth.toString().concat("", "px");
|
|
34
|
-
}, function (props) {
|
|
35
|
-
return props.selectedTextColor;
|
|
36
|
-
}, function (props) {
|
|
37
|
-
return props.unselectedTextColor;
|
|
38
|
-
});
|
|
39
|
-
exports.SegmentLabel = SegmentLabel;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Title = exports.LegendTitle = exports.LegendFormattedValue = exports.LegendCurrencySign = exports.LegendControls = exports.LegendColorRectangle = exports.FormattedValue = exports.DoughnutChart = exports.CurrencySign = 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, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
11
|
-
var ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n position: relative;\n margin: 0px 0 0px;\n font-family: \"Lato\", sans-serif;\n font-style: normal;\n color: ", ";\n width: ", ";\n height: ", ";\n //box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);\n border-radius: 12px;\n //border: 1px solid red;\n"])), function (props) {
|
|
12
|
-
return props.textColor;
|
|
13
|
-
}, function (props) {
|
|
14
|
-
return props.width.toString().concat("", "px");
|
|
15
|
-
}, function (props) {
|
|
16
|
-
return props.height.toString().concat("", "px");
|
|
17
|
-
});
|
|
18
|
-
exports.ControlsContainer = ControlsContainer;
|
|
19
|
-
var Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n border-radius: 12px;\n width: ", ";\n height: ", ";\n background: #ffffff;\n //border: 1px solid blue;\n"])), function (props) {
|
|
20
|
-
return props.width.toString().concat("", "px");
|
|
21
|
-
}, function (props) {
|
|
22
|
-
return props.height.toString().concat("", "px");
|
|
23
|
-
});
|
|
24
|
-
exports.Controls = Controls;
|
|
25
|
-
var Title = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 150px;\n height: 22px;\n left: 40px;\n top: 81px;\n font-weight: 600;\n font-size: 18px;\n line-height: 22px;\n //border: 1px solid red;\n"])));
|
|
26
|
-
exports.Title = Title;
|
|
27
|
-
var CurrencySign = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 11px;\n height: 22px;\n left: 42px;\n top: 135px;\n font-weight: 500;\n font-size: 18px;\n line-height: 22px;\n //border: 1px solid red;\n"])));
|
|
28
|
-
exports.CurrencySign = CurrencySign;
|
|
29
|
-
var FormattedValue = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 200px;\n height: 48px;\n left: 57px;\n top: 115px;\n font-weight: 500;\n font-size: 40px;\n line-height: 48px;\n //border: 1px solid red;\n"])));
|
|
30
|
-
exports.FormattedValue = FormattedValue;
|
|
31
|
-
var DoughnutChart = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 95px;\n height: 95px;\n left: 40px;\n top: 221px;\n //border: 1px solid red;\n"])));
|
|
32
|
-
exports.DoughnutChart = DoughnutChart;
|
|
33
|
-
var LegendControls = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n border-radius: 12px;\n width: 180px;\n height: 47px;\n left: 150px;\n top: 221px; \n background: #ffffff;\n //border: 1px solid blue;\n"])));
|
|
34
|
-
exports.LegendControls = LegendControls;
|
|
35
|
-
var LegendColorRectangle = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 16px;\n height: 16px;\n left: 14px;\n top: 14px;\n background: ", ";\n"])), function (props) {
|
|
36
|
-
return props.color;
|
|
37
|
-
});
|
|
38
|
-
exports.LegendColorRectangle = LegendColorRectangle;
|
|
39
|
-
var LegendTitle = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 120px;\n height: 18px;\n left: 40px;\n top: 1px;\n font-weight: 400;\n font-size: 14px;\n line-height: 17px;\n //border: 1px solid red;\n"])));
|
|
40
|
-
exports.LegendTitle = LegendTitle;
|
|
41
|
-
var LegendCurrencySign = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 11px;\n height: 19px;\n left: 42px;\n top: 21px;\n font-weight: 600;\n font-size: 16px;\n line-height: 19px;\n //border: 1px solid red;\n"])));
|
|
42
|
-
exports.LegendCurrencySign = LegendCurrencySign;
|
|
43
|
-
var LegendFormattedValue = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 100px;\n height: 19px;\n left: 52px;\n top: 21px;\n font-weight: 600;\n font-size: 16px;\n line-height: 19px;\n //border: 1px solid red;\n"])));
|
|
44
|
-
exports.LegendFormattedValue = LegendFormattedValue;
|