@desynova-digital/components 9.0.26 → 9.1.0
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/_helpers/globals.js +9 -10
- package/_helpers/pagination.js +10 -15
- package/_helpers/story-example.js +16 -39
- package/_helpers/story-helpers.js +15 -14
- package/_helpers/story-stack.js +22 -43
- package/_helpers/uniqueId.js +2 -5
- package/_helpers/utils.js +28 -4
- package/atoms/avatar/avatar.js +19 -42
- package/atoms/avatar/avatar.story.js +25 -58
- package/atoms/avatar/index.js +13 -11
- package/atoms/badge/badge.js +14 -37
- package/atoms/badge/badge.story.js +45 -103
- package/atoms/badge/index.js +12 -10
- package/atoms/button/button.js +85 -161
- package/atoms/button/button.story.js +354 -508
- package/atoms/button/index.js +5 -9
- package/atoms/card/card.js +26 -55
- package/atoms/card/card.story.js +39 -88
- package/atoms/card/index.js +12 -10
- package/atoms/cardStack/cardStack.js +88 -147
- package/atoms/cardStack/cardStack.story.js +106 -210
- package/atoms/cardStack/index.js +12 -10
- package/atoms/cardV2/cardV2.js +57 -106
- package/atoms/cardV2/cardV2.story.js +184 -232
- package/atoms/cardV2/content.js +154 -256
- package/atoms/cardV2/index.js +4 -8
- package/atoms/cardV2/thumbnail.js +138 -208
- package/atoms/cardV2/timeline.js +167 -123
- package/atoms/checkbox/checkbox.js +85 -157
- package/atoms/checkbox/checkbox.story.js +237 -365
- package/atoms/checkbox/index.js +4 -9
- package/atoms/customSelect/customSelect.js +136 -215
- package/atoms/customSelect/customSelect.story.js +745 -851
- package/atoms/customSelect/index.js +4 -8
- package/atoms/datePicker/datePicker.js +299 -431
- package/atoms/datePicker/datePicker.story.js +453 -501
- package/atoms/datePicker/index.js +4 -8
- package/atoms/dateTime/dateTime.js +3 -6
- package/atoms/dateTime/dateTime.story.js +17 -63
- package/atoms/dateTime/index.js +5 -9
- package/atoms/draftInputText/draftInputText.js +121 -189
- package/atoms/draftInputText/draftInputText.story.js +200 -249
- package/atoms/draftInputText/index.js +5 -9
- package/atoms/dropdown/dropdown.js +38 -66
- package/atoms/dropdown/dropdown.story.js +102 -262
- package/atoms/dropdown/index.js +4 -8
- package/atoms/dropdownList/dropdownList.js +78 -108
- package/atoms/dropdownList/dropdownList.story.js +1546 -1621
- package/atoms/dropdownList/index.js +4 -8
- package/atoms/graphs/barGraph/barGraph.js +95 -146
- package/atoms/graphs/barGraph/barGraph.story.js +65 -87
- package/atoms/graphs/barGraph/index.js +4 -8
- package/atoms/graphs/circleDonut/circleDonut.js +177 -229
- package/atoms/graphs/circleDonut/circleDonut.story.js +328 -394
- package/atoms/graphs/circleDonut/index.js +5 -9
- package/atoms/graphs/circleGraph/circleGraph.js +60 -90
- package/atoms/graphs/circleGraph/circleGraph.story.js +36 -54
- package/atoms/graphs/circleGraph/index.js +4 -8
- package/atoms/graphs/circleNested/circleNested.js +216 -262
- package/atoms/graphs/circleNested/circleNested.story.js +91 -116
- package/atoms/graphs/circleNested/index.js +5 -9
- package/atoms/graphs/pieChart/index.js +4 -8
- package/atoms/graphs/pieChart/pieChart.js +162 -191
- package/atoms/graphs/pieChart/pieChart.story.js +147 -176
- package/atoms/graphs/verticalBarGraph/index.js +5 -9
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.js +75 -98
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.story.js +26 -45
- package/atoms/icon/icon.js +41 -72
- package/atoms/icon/icon.story.js +831 -260
- package/atoms/icon/index.js +19 -12
- package/atoms/image/image.js +18 -32
- package/atoms/image/image.story.js +10 -19
- package/atoms/image/index.js +4 -8
- package/atoms/inputText/index.js +4 -8
- package/atoms/inputText/inputText.js +86 -131
- package/atoms/inputText/inputText.story.js +191 -255
- package/atoms/label/index.js +4 -8
- package/atoms/label/label.js +25 -50
- package/atoms/label/label.story.js +42 -83
- package/atoms/loader/CircleLoader.js +29 -63
- package/atoms/loader/ShimmerComponent/CollabShimmerCard.js +39 -50
- package/atoms/loader/ShimmerComponent/CollabShimmerCardTray.js +41 -42
- package/atoms/loader/ShimmerComponent/FiltersShimmer.js +30 -30
- package/atoms/loader/ShimmerComponent/GraphDetailShimmer.js +21 -34
- package/atoms/loader/ShimmerComponent/GraphTitleShimmer.js +30 -34
- package/atoms/loader/ShimmerComponent/GraphsComponentShimmer.js +23 -32
- package/atoms/loader/ShimmerComponent/Shimmer.js +24 -32
- package/atoms/loader/ThreeDotLoader.js +14 -29
- package/atoms/loader/index.js +13 -11
- package/atoms/loader/loader.js +34 -58
- package/atoms/loader/loader.story.js +48 -52
- package/atoms/loader/spinningLoader.js +23 -34
- package/atoms/popup/index.js +5 -9
- package/atoms/popup/popup.js +123 -208
- package/atoms/popup/popup.story.js +97 -131
- package/atoms/radio/index.js +18 -11
- package/atoms/radio/radio.js +58 -112
- package/atoms/radio/radio.story.js +197 -420
- package/atoms/select/index.js +4 -8
- package/atoms/select/select.js +48 -86
- package/atoms/sideBar/index.js +5 -9
- package/atoms/sideBar/sidebar.js +89 -140
- package/atoms/switch/index.js +4 -8
- package/atoms/switch/switch.js +56 -86
- package/atoms/switch/switch.story.js +268 -415
- package/atoms/tag/index.js +12 -10
- package/atoms/tag/tag.js +29 -63
- package/atoms/tag/tag.story.js +135 -209
- package/atoms/textarea/index.js +5 -9
- package/atoms/textarea/textarea.js +55 -99
- package/atoms/textarea/textarea.story.js +48 -41
- package/atoms/thematicBreak/index.js +12 -10
- package/atoms/thematicBreak/thematicBreak.js +20 -38
- package/atoms/thematicBreak/thematicBreak.story.js +25 -37
- package/atoms/timeCodeInput/index.js +4 -8
- package/atoms/timeCodeInput/timCodeInput.story.js +21 -35
- package/atoms/timeCodeInput/timeCodeInput.js +33 -51
- package/atoms/timer/index.js +5 -9
- package/atoms/timer/timer.js +57 -108
- package/atoms/timer/timer.story.js +13 -26
- package/atoms/toast/index.js +5 -9
- package/atoms/toast/toast.js +81 -116
- package/atoms/toast/toast.story.js +50 -76
- package/atoms/videoCard/index.js +12 -10
- package/atoms/videoCard/videoCard.js +265 -447
- package/atoms/videoCard/videoCard.story.js +495 -710
- package/components.js +411 -294
- package/index.js +350 -61
- package/molecules/carousel/carousel.js +121 -207
- package/molecules/carousel/carousel.story.js +240 -223
- package/molecules/carousel/index.js +5 -9
- package/molecules/errorScreen/CollabErrorScreen.js +35 -66
- package/molecules/errorScreen/TableErrorScreen.js +109 -102
- package/molecules/errorScreen/TableErrorScreen.jsx +7 -6
- package/molecules/errorScreen/errorScreen.js +41 -94
- package/molecules/filter/constants.js +1 -0
- package/molecules/filter/filter.js +378 -562
- package/molecules/filter/filter.story.js +79 -104
- package/molecules/filter/index.js +5 -9
- package/molecules/graphCard/graphCard.js +97 -193
- package/molecules/graphCard/graphCard.story.js +159 -191
- package/molecules/graphCard/index.js +4 -8
- package/molecules/graphCard/loader.js +28 -68
- package/molecules/graphDetailCard/graphDetailCard.js +115 -183
- package/molecules/graphDetailCard/graphDetailCard.story.js +218 -254
- package/molecules/graphDetailCard/index.js +5 -9
- package/molecules/pageHeader/index.js +12 -10
- package/molecules/pageHeader/pageHeader.js +38 -79
- package/molecules/pageHeader/pageHeader.story.js +34 -55
- package/molecules/pagination/index.js +4 -8
- package/molecules/pagination/pagination.js +126 -202
- package/molecules/pagination/pagination.story.js +40 -52
- package/molecules/richTextInput/RichTextInput.js +354 -0
- package/molecules/richTextInput/RichTextInput.story.js +50 -0
- package/molecules/richTextInput/index.js +9 -0
- package/molecules/table/index.js +4 -8
- package/molecules/table/table-column.js +10 -16
- package/molecules/table/table-header.js +31 -72
- package/molecules/table/table.js +743 -1075
- package/molecules/table/table.story.js +274 -304
- package/molecules/tabs/index.js +4 -8
- package/molecules/tabs/tabs.js +112 -184
- package/molecules/tabs/tabs.story.js +66 -133
- package/molecules/videoCardList/index.js +4 -8
- package/molecules/videoCardList/videoCardList.js +24 -41
- package/molecules/videoCardList/videoCardList.story.js +449 -664
- package/molecules/videoPlayer/index.js +4 -8
- package/molecules/videoPlayer/videoPlayer.js +1019 -1097
- package/molecules/videoPlayer/videoPlayer.story.js +10 -21
- package/package.json +2 -2
|
@@ -1,91 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var _verticalBarGraph = require('../../atoms/graphs/verticalBarGraph');
|
|
29
|
-
|
|
30
|
-
var _verticalBarGraph2 = _interopRequireDefault(_verticalBarGraph);
|
|
31
|
-
|
|
32
|
-
var _circleDonut = require('../../atoms/graphs/circleDonut');
|
|
33
|
-
|
|
34
|
-
var _circleDonut2 = _interopRequireDefault(_circleDonut);
|
|
35
|
-
|
|
36
|
-
var _circleNested = require('../../atoms/graphs/circleNested');
|
|
37
|
-
|
|
38
|
-
var _circleNested2 = _interopRequireDefault(_circleNested);
|
|
39
|
-
|
|
40
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
-
|
|
42
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
43
|
-
|
|
44
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
45
|
-
|
|
46
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
47
|
-
|
|
48
|
-
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
49
|
-
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
20
|
+
var _tokens = require("@desynova-digital/tokens");
|
|
21
|
+
var _verticalBarGraph = _interopRequireDefault(require("../../atoms/graphs/verticalBarGraph"));
|
|
22
|
+
var _circleDonut = _interopRequireDefault(require("../../atoms/graphs/circleDonut"));
|
|
23
|
+
var _circleNested = _interopRequireDefault(require("../../atoms/graphs/circleNested"));
|
|
24
|
+
var _templateObject, _templateObject2;
|
|
25
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
26
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
27
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
28
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
50
29
|
var propTypes = {};
|
|
51
|
-
|
|
52
|
-
var StyledGraphDisplayComponent = _styledComponents2.default.div(_templateObject, function (props) {
|
|
30
|
+
var StyledGraphDisplayComponent = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\nheight: 350px;\nmin-width: 295px;\nborder-radius: 4px;\nbackground: #15212F;\nbox-shadow: 0px 12px 24px rgba(0, 0, 0, 0.1);\ntransition: all 0.4s ease;\nposition: relative;\noverflow: hidden;\nborder-bottom: 0px solid ", "\nmax-width: 25%;\nwidth: 100%;\nmargin: 0px 10px;\n\n&.active{\n height: 400px;\n border-bottom: 2px solid ", "\n .legend-value-box {\n right: 10px;\n }\n}\n \n.legend-value {\n font-size: 10px;\n line-height: 10px;\n text-transform: uppercase;\n color: #FFFFFF;\n font-family: 'SFUIText-Regular';\n margin-top: 10px;\n}\n\n.legend-value-box {\n position: absolute;\n right: -40px;\n transition: all 0.4s ease;\n top: 288px;\n}\n .graph-title{\n font-family: 'SFUIText-Regular';\n font-size: 16px;\n line-height: 16px;\n color: #AFB2BA;\n padding:30px;\n text-align:center;\n }\n\n .indicator {\n display: inline-block;\n width: 10px;\n height: 10px;\n \n border-radius: 50%;\n margin-right: 5px;\n margin-bottom: -2px;\n }\n\n .legend-name {\n font-family: SFProText;\n font-size: 10px;\n line-height: 10px;\n text-transform: uppercase;\n color: #FFFFFF;\n font-family: 'SFUIText-Regular';\n display: inline-block;\n }\n\n .legends-box {\n padding: 20px 10px;\n transition: all 0.4s ease;\n display: flex;\n justify-content: space-evenly;\n flex-wrap: wrap;\n position: relative;\n\n .legend-item{\n transition: all 0.4s ease;\n position: relative;\n top: 0px;\n left: 0px;\n }\n }\n \n"])), function (props) {
|
|
53
31
|
return _tokens.colors[props.theme].graph.borderColor;
|
|
54
32
|
}, function (props) {
|
|
55
33
|
return _tokens.colors[props.theme].graph.borderColor;
|
|
56
34
|
});
|
|
57
|
-
|
|
58
|
-
var StyledVerticalBarGroup = _styledComponents2.default.div(_templateObject2);
|
|
59
|
-
|
|
35
|
+
var StyledVerticalBarGroup = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: center;\n"])));
|
|
60
36
|
var graphColorsConst = [['#00C8E7', '#00E6B9'], ['#FFE259', '#FFA751'], ['#FF8D29', '#F6462C'], ['#AFB2BA', '#303F51']];
|
|
61
|
-
|
|
62
|
-
var GraphDetailCard = function (_Component) {
|
|
63
|
-
_inherits(GraphDetailCard, _Component);
|
|
64
|
-
|
|
37
|
+
var GraphDetailCard = /*#__PURE__*/function (_Component) {
|
|
65
38
|
function GraphDetailCard(props) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
_this.componentDidMount = function () {
|
|
39
|
+
var _this;
|
|
40
|
+
(0, _classCallCheck2["default"])(this, GraphDetailCard);
|
|
41
|
+
_this = _callSuper(this, GraphDetailCard, [props]);
|
|
42
|
+
(0, _defineProperty2["default"])(_this, "componentDidMount", function () {
|
|
71
43
|
setTimeout(function () {
|
|
72
44
|
_this.animateActive = true;
|
|
73
45
|
if (_this.props.showLegends) {
|
|
74
46
|
_this.showLegendsFunc();
|
|
75
47
|
}
|
|
76
48
|
}, 2000);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
_this.cardClick = function (e) {
|
|
49
|
+
});
|
|
50
|
+
(0, _defineProperty2["default"])(_this, "cardClick", function (e) {
|
|
80
51
|
_this.props.onClickHandler(e);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
_this.showLegendsFunc = function () {
|
|
52
|
+
});
|
|
53
|
+
(0, _defineProperty2["default"])(_this, "showLegendsFunc", function () {
|
|
84
54
|
if (!_this.myRef || !_this.myRef.current) {
|
|
85
55
|
return;
|
|
86
56
|
}
|
|
87
57
|
var elements = _this.myRef.current.querySelectorAll('.legend-item');
|
|
88
|
-
|
|
89
58
|
var arrLegend = [];
|
|
90
59
|
if (elements && elements.length > 0) {
|
|
91
60
|
elements.forEach(function (ele, idx) {
|
|
@@ -103,9 +72,8 @@ var GraphDetailCard = function (_Component) {
|
|
|
103
72
|
_this.showLegendsFunc();
|
|
104
73
|
}, 1000);
|
|
105
74
|
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
_this.getPosition = function (cardViewExpand, idx) {
|
|
75
|
+
});
|
|
76
|
+
(0, _defineProperty2["default"])(_this, "getPosition", function (cardViewExpand, idx) {
|
|
109
77
|
if (cardViewExpand && _this.state.arrLegend && _this.state.arrLegend[idx]) {
|
|
110
78
|
return {
|
|
111
79
|
top: 20 * idx + 'px',
|
|
@@ -114,12 +82,10 @@ var GraphDetailCard = function (_Component) {
|
|
|
114
82
|
} else {
|
|
115
83
|
return {};
|
|
116
84
|
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
_this.render = function () {
|
|
85
|
+
});
|
|
86
|
+
(0, _defineProperty2["default"])(_this, "render", function () {
|
|
120
87
|
var theme = _this.props.theme;
|
|
121
88
|
var cardViewExpand = _this.state.cardViewExpand;
|
|
122
|
-
|
|
123
89
|
var highestValue = 0;
|
|
124
90
|
if (!_this.props.data.loading && _this.props.data.data) {
|
|
125
91
|
var totalMatched = false;
|
|
@@ -133,144 +99,110 @@ var GraphDetailCard = function (_Component) {
|
|
|
133
99
|
totalMatched = true;
|
|
134
100
|
}
|
|
135
101
|
});
|
|
136
|
-
|
|
137
102
|
highestValue = totalMatched ? _this.props.data.data.data.total : highestValue * 110 / 100;
|
|
138
103
|
}
|
|
139
|
-
|
|
140
104
|
var graphDataMain = _this.props.data.data;
|
|
141
|
-
|
|
142
105
|
var graphLoading = _this.props.data.loading;
|
|
143
|
-
|
|
144
106
|
var graphColors = _this.props.graphColors ? _this.props.graphColors : graphColorsConst;
|
|
145
|
-
|
|
146
107
|
var graphTitleName = _this.props.uniqueKey ? _this.props.uniqueKey : _this.props.data && _this.props.data.data && _this.props.data.data.data && _this.props.data.data.data.name ? _this.props.data.data.data.name : null;
|
|
147
108
|
|
|
148
109
|
// console.log(colors.nexc.status.primary.background);
|
|
149
|
-
return
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
'span',
|
|
207
|
-
{ className: 'legend-name' },
|
|
208
|
-
dataItem.name
|
|
209
|
-
)
|
|
210
|
-
);
|
|
211
|
-
})
|
|
212
|
-
),
|
|
213
|
-
_react2.default.createElement(
|
|
214
|
-
'div',
|
|
215
|
-
{ className: 'legend-value-box' },
|
|
216
|
-
!graphLoading && _this.props.data.data.data.values.map(function (dataItem, idx) {
|
|
217
|
-
return _react2.default.createElement(
|
|
218
|
-
'div',
|
|
219
|
-
{
|
|
220
|
-
className: 'legend-value',
|
|
221
|
-
key: graphTitleName + 'legend-value' + idx,
|
|
222
|
-
style: {}
|
|
223
|
-
},
|
|
224
|
-
dataItem.data
|
|
225
|
-
);
|
|
226
|
-
})
|
|
227
|
-
)
|
|
228
|
-
);
|
|
229
|
-
};
|
|
230
|
-
|
|
110
|
+
return /*#__PURE__*/_react["default"].createElement(StyledGraphDisplayComponent, (0, _extends2["default"])({
|
|
111
|
+
ref: _this.myRef,
|
|
112
|
+
key: graphTitleName + 'GraphDisplayComponent',
|
|
113
|
+
className: cardViewExpand ? 'graph-display-box active' : 'graph-display-box'
|
|
114
|
+
}, _this.props, {
|
|
115
|
+
onClick: function onClick(e) {
|
|
116
|
+
_this.cardClick(e);
|
|
117
|
+
},
|
|
118
|
+
theme: _this.props.theme
|
|
119
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
120
|
+
className: "graph-title"
|
|
121
|
+
}, graphDataMain && graphDataMain.data ? graphDataMain.data.name : null), graphDataMain && graphDataMain.data ? graphDataMain.graph_name === 'vertical-bar' ? /*#__PURE__*/_react["default"].createElement(StyledVerticalBarGroup, {
|
|
122
|
+
className: "vertical-bar-group-box"
|
|
123
|
+
}, graphDataMain.data.values.map(function (dataItem, idx) {
|
|
124
|
+
return /*#__PURE__*/_react["default"].createElement(_verticalBarGraph["default"], (0, _extends2["default"])({}, graphTitleName ? {
|
|
125
|
+
key: graphTitleName + idx
|
|
126
|
+
} : null, {
|
|
127
|
+
value: (!highestValue > 0 ? 0 : dataItem.data / highestValue) * 100,
|
|
128
|
+
graphColors: graphColors[idx],
|
|
129
|
+
valueMain: dataItem.data,
|
|
130
|
+
valueSub: dataItem.name
|
|
131
|
+
}));
|
|
132
|
+
})) : graphDataMain.graph_name === 'circle-donut' && graphDataMain.graph_type === 'nested' ? /*#__PURE__*/_react["default"].createElement(_circleNested["default"], {
|
|
133
|
+
data: graphDataMain,
|
|
134
|
+
graphColors: graphColors,
|
|
135
|
+
valueSub: _this.props.valueSub,
|
|
136
|
+
graphPlaceholder: graphLoading
|
|
137
|
+
}) : graphDataMain.graph_name === 'circle-donut' ? /*#__PURE__*/_react["default"].createElement(_circleDonut["default"], {
|
|
138
|
+
data: graphDataMain,
|
|
139
|
+
graphColors: graphColors,
|
|
140
|
+
valueSub: _this.props.valueSub,
|
|
141
|
+
graphPlaceholder: graphLoading
|
|
142
|
+
}) : null : null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
143
|
+
className: "legends-box"
|
|
144
|
+
}, !graphLoading && _this.props.data.data.data.values.map(function (dataItem, idx) {
|
|
145
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
146
|
+
className: "legend-item",
|
|
147
|
+
key: graphTitleName + 'legend-item' + idx,
|
|
148
|
+
style: _this.getPosition(cardViewExpand, idx)
|
|
149
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
150
|
+
className: "indicator",
|
|
151
|
+
style: {
|
|
152
|
+
background: 'linear-gradient(0deg,' + graphColors[idx][1] + ' 0%,' + graphColors[idx][0] + ' 100%)'
|
|
153
|
+
}
|
|
154
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
155
|
+
className: "legend-name"
|
|
156
|
+
}, dataItem.name));
|
|
157
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
158
|
+
className: "legend-value-box"
|
|
159
|
+
}, !graphLoading && _this.props.data.data.data.values.map(function (dataItem, idx) {
|
|
160
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
161
|
+
className: "legend-value",
|
|
162
|
+
key: graphTitleName + 'legend-value' + idx,
|
|
163
|
+
style: {}
|
|
164
|
+
}, dataItem.data);
|
|
165
|
+
})));
|
|
166
|
+
});
|
|
231
167
|
_this.state = {
|
|
232
168
|
cardViewExpand: false
|
|
233
169
|
};
|
|
234
|
-
_this.myRef =
|
|
170
|
+
_this.myRef = /*#__PURE__*/_react["default"].createRef();
|
|
235
171
|
_this.animateActive = false;
|
|
236
172
|
return _this;
|
|
237
173
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
key:
|
|
174
|
+
(0, _inherits2["default"])(GraphDetailCard, _Component);
|
|
175
|
+
return (0, _createClass2["default"])(GraphDetailCard, [{
|
|
176
|
+
key: "componentDidUpdate",
|
|
241
177
|
value: function componentDidUpdate(prevProps) {
|
|
242
178
|
if (prevProps.data && prevProps.data.data === null && this.props.data.data && this.props.data.data.data !== (prevProps.data.data ? prevProps.data.data.data : null) || this.props.showLegends !== prevProps.showLegends && this.animateActive) {
|
|
243
179
|
this.showLegendsFunc();
|
|
244
180
|
}
|
|
245
181
|
}
|
|
246
182
|
}]);
|
|
247
|
-
|
|
248
|
-
return GraphDetailCard;
|
|
249
183
|
}(_react.Component);
|
|
250
|
-
|
|
251
184
|
GraphDetailCard.propTypes = {
|
|
252
|
-
data:
|
|
253
|
-
loading:
|
|
254
|
-
data:
|
|
255
|
-
graph_name:
|
|
256
|
-
graph_type:
|
|
257
|
-
data:
|
|
258
|
-
total:
|
|
259
|
-
name:
|
|
260
|
-
values:
|
|
261
|
-
data:
|
|
185
|
+
data: _propTypes["default"].shape({
|
|
186
|
+
loading: _propTypes["default"].bool,
|
|
187
|
+
data: _propTypes["default"].shape({
|
|
188
|
+
graph_name: _propTypes["default"].string,
|
|
189
|
+
graph_type: _propTypes["default"].string,
|
|
190
|
+
data: _propTypes["default"].shape({
|
|
191
|
+
total: _propTypes["default"].number.isRequired,
|
|
192
|
+
name: _propTypes["default"].string,
|
|
193
|
+
values: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
194
|
+
data: _propTypes["default"].number.isRequired
|
|
262
195
|
}).isRequired)
|
|
263
196
|
})
|
|
264
197
|
}).isRequired
|
|
265
198
|
}),
|
|
266
|
-
theme:
|
|
267
|
-
graphColors:
|
|
268
|
-
valueSub:
|
|
269
|
-
uniqueKey:
|
|
199
|
+
theme: _propTypes["default"].oneOf(['light', 'dark', 'nexc']),
|
|
200
|
+
graphColors: _propTypes["default"].array,
|
|
201
|
+
valueSub: _propTypes["default"].string,
|
|
202
|
+
uniqueKey: _propTypes["default"].string
|
|
270
203
|
};
|
|
271
|
-
|
|
272
204
|
GraphDetailCard.defaultProps = {
|
|
273
205
|
theme: 'light',
|
|
274
206
|
graphColors: [['#00C8E7', '#00E6B9'], ['#FFE259', '#FFA751'], ['#FF8D29', '#F6462C'], ['#AFB2BA', '#303F51']]
|
|
275
207
|
};
|
|
276
|
-
exports
|
|
208
|
+
var _default = exports["default"] = GraphDetailCard;
|