intelicoreact 1.1.70 → 1.1.72
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.
|
@@ -31,22 +31,16 @@ var useClickOutside = function useClickOutside(hideComponent, additionalComponen
|
|
|
31
31
|
var ref = (0, _react.useRef)(null);
|
|
32
32
|
|
|
33
33
|
var checkCondition = function checkCondition(target) {
|
|
34
|
-
if (additionalComponent) {
|
|
35
|
-
|
|
36
|
-
var _ref$current, _Array$from;
|
|
34
|
+
if (additionalComponent && additionalComponent !== null && additionalComponent !== void 0 && additionalComponent.length) {
|
|
35
|
+
var _ref$current, _Array$from;
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} else {
|
|
42
|
-
var _ref$current2;
|
|
43
|
-
|
|
44
|
-
return !((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.contains(target)) && !(additionalComponent !== null && additionalComponent !== void 0 && additionalComponent.contains(target));
|
|
45
|
-
}
|
|
37
|
+
return !((_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains(target)) && !((_Array$from = Array.from(additionalComponent)) !== null && _Array$from !== void 0 && _Array$from.some(function (item) {
|
|
38
|
+
return item === null || item === void 0 ? void 0 : item.contains(target);
|
|
39
|
+
}));
|
|
46
40
|
} else {
|
|
47
|
-
var _ref$
|
|
41
|
+
var _ref$current2;
|
|
48
42
|
|
|
49
|
-
return !((_ref$
|
|
43
|
+
return !((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.contains(target));
|
|
50
44
|
}
|
|
51
45
|
};
|
|
52
46
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactChartjs = require("react-chartjs-2");
|
|
9
|
+
|
|
10
|
+
var _chart = require("chart.js");
|
|
11
|
+
|
|
12
|
+
require("./PieChart.scss");
|
|
13
|
+
|
|
14
|
+
_chart.Chart.register(_chart.ArcElement, _chart.Tooltip, _chart.Legend);
|
|
15
|
+
|
|
16
|
+
var PieChart = function PieChart(_ref) {
|
|
17
|
+
var data = _ref.data,
|
|
18
|
+
_ref$cutout = _ref.cutout,
|
|
19
|
+
cutout = _ref$cutout === void 0 ? '80%' : _ref$cutout,
|
|
20
|
+
resultLabel = _ref.resultLabel,
|
|
21
|
+
_ref$resultValue = _ref.resultValue,
|
|
22
|
+
resultValue = _ref$resultValue === void 0 ? 0 : _ref$resultValue,
|
|
23
|
+
_ref$withLegend = _ref.withLegend,
|
|
24
|
+
withLegend = _ref$withLegend === void 0 ? false : _ref$withLegend;
|
|
25
|
+
var options = {
|
|
26
|
+
cutout: cutout,
|
|
27
|
+
plugins: {
|
|
28
|
+
legend: {
|
|
29
|
+
display: withLegend
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: "pie-chart-box",
|
|
35
|
+
style: {
|
|
36
|
+
maxWidth: "320px"
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/React.createElement(_reactChartjs.Pie, {
|
|
39
|
+
data: data,
|
|
40
|
+
options: options
|
|
41
|
+
}), !!resultLabel && /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: "pie-chart__result"
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "pie-chart__result-value"
|
|
45
|
+
}, resultValue, /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
className: "pie-chart__result-percent"
|
|
47
|
+
}, "%"), ' '), /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: "pie-chart__result-label"
|
|
49
|
+
}, resultLabel)));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var _default = PieChart;
|
|
53
|
+
exports.default = _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.pie-chart-box {
|
|
2
|
+
max-width: 100%;
|
|
3
|
+
width: 180px;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
.pie-chart__result {
|
|
7
|
+
position: absolute;
|
|
8
|
+
left: 50%;
|
|
9
|
+
top: 50%;
|
|
10
|
+
transform: translateX(-50%) translateY(-50%);
|
|
11
|
+
text-align: center;
|
|
12
|
+
}
|
|
13
|
+
.pie-chart__result-value {
|
|
14
|
+
font-family: inherit;
|
|
15
|
+
font-size: 24px;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
line-height: 34px;
|
|
18
|
+
letter-spacing: 0;
|
|
19
|
+
}
|
|
20
|
+
.pie-chart__result-percent {
|
|
21
|
+
font-family: inherit;
|
|
22
|
+
font-size: 18px;
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
line-height: 25px;
|
|
25
|
+
letter-spacing: 0;
|
|
26
|
+
color: #7A8599;
|
|
27
|
+
margin-right: -14px;
|
|
28
|
+
display: inline-block;
|
|
29
|
+
transform: translateY(-5px) translateX(2px);
|
|
30
|
+
}
|
|
31
|
+
.pie-chart__result-label {
|
|
32
|
+
font-family: inherit;
|
|
33
|
+
font-size: 12px;
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
line-height: 24px;
|
|
36
|
+
letter-spacing: 0;
|
|
37
|
+
color: #9AA0B9;
|
|
38
|
+
text-transform: uppercase;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
|
|
41
|
+
}
|