@widergy/energy-ui 2.12.2 → 2.12.3
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/components/EnergyThemeProvider/index.js +13 -36
- package/dist/components/Loading/constants.js +1 -2
- package/dist/components/Loading/index.js +13 -12
- package/dist/components/Loading/theme.js +4 -2
- package/dist/components/UTAlert/AlertHandler.js +75 -101
- package/dist/components/UTAlert/index.js +65 -87
- package/dist/components/UTAlert/theme.js +32 -32
- package/dist/components/UTAttachment/components/Preview/index.js +8 -9
- package/dist/components/UTAttachment/constants.js +7 -13
- package/dist/components/UTAttachment/index.js +159 -250
- package/dist/components/UTAttachment/layout.js +26 -27
- package/dist/components/UTAttachment/theme.js +4 -2
- package/dist/components/UTAttachment/utils.js +34 -117
- package/dist/components/UTAutocomplete/components/ListBox/index.js +13 -21
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +9 -11
- package/dist/components/UTAutocomplete/constants.js +12 -23
- package/dist/components/UTAutocomplete/index.js +54 -94
- package/dist/components/UTAutocomplete/theme.js +6 -4
- package/dist/components/UTAvatar/constants.js +2 -3
- package/dist/components/UTAvatar/index.js +18 -17
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +22 -22
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +1 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +21 -22
- package/dist/components/UTBarChart/components/Bars/constants.js +3 -6
- package/dist/components/UTBarChart/components/Bars/index.js +70 -80
- package/dist/components/UTBarChart/components/Legend/constants.js +12 -18
- package/dist/components/UTBarChart/components/Legend/index.js +75 -93
- package/dist/components/UTBarChart/components/Legend/utils.js +1 -5
- package/dist/components/UTBarChart/components/Levels/index.js +16 -14
- package/dist/components/UTBarChart/components/Levels/utils.js +25 -27
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +3 -5
- package/dist/components/UTBarChart/components/LinearPlot/index.js +25 -20
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +37 -39
- package/dist/components/UTBarChart/components/Pagination/constants.js +1 -2
- package/dist/components/UTBarChart/components/Pagination/index.js +20 -24
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +21 -32
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -4
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +20 -19
- package/dist/components/UTBarChart/components/XAxis/constants.js +1 -2
- package/dist/components/UTBarChart/components/XAxis/index.js +54 -65
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +12 -11
- package/dist/components/UTBarChart/components/YAxis/constants.js +1 -2
- package/dist/components/UTBarChart/components/YAxis/index.js +30 -37
- package/dist/components/UTBarChart/components/YAxis/utils.js +4 -6
- package/dist/components/UTBarChart/constants.js +4 -8
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +23 -40
- package/dist/components/UTBarChart/index.js +152 -166
- package/dist/components/UTBarChart/theme.js +4 -2
- package/dist/components/UTBarChart/types.js +10 -19
- package/dist/components/UTBarChart/utils.js +107 -111
- package/dist/components/UTBreadcrumbs/constants.js +23 -31
- package/dist/components/UTBreadcrumbs/index.js +76 -101
- package/dist/components/UTBreadcrumbs/theme.js +4 -2
- package/dist/components/UTButton/constants.js +11 -17
- package/dist/components/UTButton/index.js +28 -31
- package/dist/components/UTButton/theme.js +23 -23
- package/dist/components/UTCBUInput/index.js +36 -40
- package/dist/components/UTCBUInput/theme.js +4 -2
- package/dist/components/UTCaptcha/index.js +19 -45
- package/dist/components/UTCard/components/UTCardFooter/index.js +15 -16
- package/dist/components/UTCard/index.js +85 -120
- package/dist/components/UTCard/theme.js +11 -12
- package/dist/components/UTCard/types.js +2 -3
- package/dist/components/UTCarousel/components/Button/index.js +13 -13
- package/dist/components/UTCarousel/components/Legend/index.js +13 -15
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +16 -16
- package/dist/components/UTCarousel/components/Slider/constants.js +5 -10
- package/dist/components/UTCarousel/components/Slider/index.js +204 -273
- package/dist/components/UTCarousel/components/Slider/layout.js +67 -94
- package/dist/components/UTCarousel/index.js +14 -15
- package/dist/components/UTCarousel/theme.js +4 -2
- package/dist/components/UTCheckList/constants.js +1 -2
- package/dist/components/UTCheckList/index.js +72 -93
- package/dist/components/UTCheckList/theme.js +31 -31
- package/dist/components/UTCheckbox/constants.js +3 -6
- package/dist/components/UTCheckbox/index.js +32 -44
- package/dist/components/UTCheckbox/theme.js +35 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +9 -9
- package/dist/components/UTConsumptionBar/constants.js +3 -6
- package/dist/components/UTConsumptionBar/index.js +53 -80
- package/dist/components/UTCuit/index.js +109 -133
- package/dist/components/UTCuit/theme.js +51 -53
- package/dist/components/UTDatePicker/components/Day/constants.js +1 -2
- package/dist/components/UTDatePicker/components/Day/index.js +12 -12
- package/dist/components/UTDatePicker/constants.js +20 -31
- package/dist/components/UTDatePicker/index.js +60 -102
- package/dist/components/UTDatePicker/theme.js +5 -3
- package/dist/components/UTDatePicker/types.js +2 -3
- package/dist/components/UTDatePicker/utils.js +2 -6
- package/dist/components/UTDialog/constants.js +2 -4
- package/dist/components/UTDialog/index.js +38 -37
- package/dist/components/UTDialog/theme.js +4 -2
- package/dist/components/UTDialog/types.js +2 -3
- package/dist/components/UTDotMenu/index.js +39 -61
- package/dist/components/UTEmojiPicker/constants.js +6 -11
- package/dist/components/UTEmojiPicker/index.js +45 -65
- package/dist/components/UTEmojiPicker/theme.js +4 -2
- package/dist/components/UTEmojiPicker/utils.js +21 -51
- package/dist/components/UTExternalLink/constants.js +3 -5
- package/dist/components/UTExternalLink/index.js +18 -15
- package/dist/components/UTExternalLink/theme.js +8 -6
- package/dist/components/UTFileInput/constants.js +2 -4
- package/dist/components/UTFileInput/index.js +7 -31
- package/dist/components/UTFileInput/layout.js +68 -97
- package/dist/components/UTIconButton/index.js +49 -72
- package/dist/components/UTIconButton/theme.js +4 -2
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +53 -58
- package/dist/components/UTImageRadio/constants.js +3 -6
- package/dist/components/UTImageRadio/index.js +39 -47
- package/dist/components/UTImageRadio/theme.js +11 -12
- package/dist/components/UTImageRadio/types.js +2 -3
- package/dist/components/UTImageRadio/utils.js +2 -6
- package/dist/components/UTLabel/constants.js +14 -20
- package/dist/components/UTLabel/index.js +18 -20
- package/dist/components/UTLabel/theme.js +15 -15
- package/dist/components/UTList/index.js +15 -18
- package/dist/components/UTLoading/index.js +15 -15
- package/dist/components/UTMap/components/GoogleMaps/constants.js +8 -11
- package/dist/components/UTMap/components/GoogleMaps/index.js +63 -91
- package/dist/components/UTMap/components/GoogleMaps/styles.js +2 -3
- package/dist/components/UTMap/constants.js +6 -12
- package/dist/components/UTMap/index.js +163 -198
- package/dist/components/UTMap/types.js +4 -6
- package/dist/components/UTMap/utils.js +29 -46
- package/dist/components/UTMap/withGoogleMapScript.js +18 -22
- package/dist/components/UTMenu/index.js +52 -69
- package/dist/components/UTMenu/theme.js +5 -3
- package/dist/components/UTMenu/utils.js +5 -11
- package/dist/components/UTModal/constants.js +9 -13
- package/dist/components/UTModal/index.js +26 -30
- package/dist/components/UTModal/theme.js +4 -2
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +11 -10
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +7 -13
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTPagination/components/Pagination/index.js +28 -39
- package/dist/components/UTPagination/components/Pagination/utils.js +8 -14
- package/dist/components/UTPagination/constants.js +3 -6
- package/dist/components/UTPagination/index.js +16 -17
- package/dist/components/UTPagination/theme.js +4 -2
- package/dist/components/UTPanel/index.js +38 -44
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +13 -10
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +22 -19
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +63 -50
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +25 -26
- package/dist/components/UTPasswordField/index.js +26 -23
- package/dist/components/UTPasswordField/theme.js +4 -2
- package/dist/components/UTPhoneInput/constants.js +3 -6
- package/dist/components/UTPhoneInput/index.js +180 -205
- package/dist/components/UTPhoneInput/theme.js +77 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -8
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +24 -23
- package/dist/components/UTPieChart/components/Legend/contants.js +3 -6
- package/dist/components/UTPieChart/components/Legend/index.js +27 -24
- package/dist/components/UTPieChart/constants.js +13 -26
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +15 -33
- package/dist/components/UTPieChart/index.js +73 -76
- package/dist/components/UTPieChart/theme.js +4 -2
- package/dist/components/UTPieChart/utils.js +4 -2
- package/dist/components/UTProgressBar/constants.js +2 -4
- package/dist/components/UTProgressBar/index.js +15 -17
- package/dist/components/UTProgressBar/theme.js +4 -2
- package/dist/components/UTProgressBar/types.js +2 -3
- package/dist/components/UTRadioGroup/index.js +56 -83
- package/dist/components/UTRadioGroup/theme.js +52 -52
- package/dist/components/UTRating/components/Circle/index.js +41 -56
- package/dist/components/UTRating/components/Faces/constants.js +2 -4
- package/dist/components/UTRating/components/Faces/index.js +34 -36
- package/dist/components/UTRating/components/Star/index.js +36 -40
- package/dist/components/UTRating/constants.js +4 -8
- package/dist/components/UTRating/index.js +31 -46
- package/dist/components/UTRating/theme.js +4 -2
- package/dist/components/UTRipple/Ripple.js +22 -39
- package/dist/components/UTRipple/index.js +18 -37
- package/dist/components/UTSelect/components/Option/index.js +13 -13
- package/dist/components/UTSelect/constants.js +4 -8
- package/dist/components/UTSelect/index.js +63 -85
- package/dist/components/UTSelect/stylesJS.js +2 -3
- package/dist/components/UTSelect/theme.js +6 -4
- package/dist/components/UTSelect/utils.js +3 -13
- package/dist/components/UTSidebar/components/ListOption/index.js +34 -49
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +8 -8
- package/dist/components/UTSidebar/components/LogosContainer/index.js +14 -14
- package/dist/components/UTSidebar/components/Option/constants.js +2 -3
- package/dist/components/UTSidebar/components/Option/index.js +28 -32
- package/dist/components/UTSidebar/components/Toggler/index.js +11 -11
- package/dist/components/UTSidebar/index.js +42 -53
- package/dist/components/UTSidebar/theme.js +4 -2
- package/dist/components/UTSidebar/types.js +5 -10
- package/dist/components/UTSkeleton/index.js +10 -36
- package/dist/components/UTStatus/constants.js +5 -9
- package/dist/components/UTStatus/index.js +16 -15
- package/dist/components/UTStatus/theme.js +66 -49
- package/dist/components/UTSwitch/constants.js +3 -6
- package/dist/components/UTSwitch/index.js +42 -57
- package/dist/components/UTSwitch/theme.js +4 -2
- package/dist/components/UTTable/components/ActionIcons/constants.js +1 -2
- package/dist/components/UTTable/components/ActionIcons/index.js +47 -85
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +10 -12
- package/dist/components/UTTable/components/Cell/index.js +18 -23
- package/dist/components/UTTable/components/HeaderCell/constants.js +2 -3
- package/dist/components/UTTable/components/HeaderCell/index.js +23 -30
- package/dist/components/UTTable/components/HeaderCell/utils.js +3 -3
- package/dist/components/UTTable/components/PrimaryAction/index.js +12 -11
- package/dist/components/UTTable/components/ResponsiveCell/index.js +19 -20
- package/dist/components/UTTable/components/Status/index.js +18 -19
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +10 -9
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +7 -13
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +21 -32
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +8 -14
- package/dist/components/UTTable/components/TableFooter/constants.js +1 -2
- package/dist/components/UTTable/components/TableFooter/index.js +15 -15
- package/dist/components/UTTable/components/TableHeader/index.js +11 -11
- package/dist/components/UTTable/components/TableRow/constants.js +3 -6
- package/dist/components/UTTable/components/TableRow/index.js +82 -95
- package/dist/components/UTTable/components/TableRow/styles.module.scss +8 -1
- package/dist/components/UTTable/components/TableRow/utils.js +15 -0
- package/dist/components/UTTable/constants.js +26 -43
- package/dist/components/UTTable/hook.js +11 -26
- package/dist/components/UTTable/index.js +129 -220
- package/dist/components/UTTable/theme.js +17 -17
- package/dist/components/UTTable/types.js +4 -8
- package/dist/components/UTTable/utils.js +70 -74
- package/dist/components/UTTabs/components/TooltipTab/index.js +20 -30
- package/dist/components/UTTabs/constants.js +4 -8
- package/dist/components/UTTabs/index.js +57 -86
- package/dist/components/UTTabs/theme.js +4 -2
- package/dist/components/UTTabs/utils.js +1 -1
- package/dist/components/UTTextArea/constants.js +3 -6
- package/dist/components/UTTextArea/index.js +23 -23
- package/dist/components/UTTextArea/theme.js +4 -2
- package/dist/components/UTTextInput/constants.js +2 -3
- package/dist/components/UTTextInput/index.js +137 -165
- package/dist/components/UTTextInput/theme.js +6 -4
- package/dist/components/UTThirdPartyCookieChecker/index.js +17 -21
- package/dist/components/UTToggle/components/ToggleOption/index.js +16 -17
- package/dist/components/UTToggle/index.js +25 -26
- package/dist/components/UTToggle/theme.js +4 -2
- package/dist/components/UTTooltip/index.js +23 -30
- package/dist/components/UTTooltip/theme.js +4 -2
- package/dist/components/UTTopbar/components/Notifications/index.js +11 -14
- package/dist/components/UTTopbar/components/UserMenu/index.js +15 -15
- package/dist/components/UTTopbar/index.js +28 -31
- package/dist/components/UTTopbar/theme.js +4 -2
- package/dist/components/UTTopbar/types.js +5 -9
- package/dist/components/UTTouchableWithoutFeedback/index.js +14 -27
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +34 -31
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +4 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -12
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +8 -18
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +23 -47
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +31 -34
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +81 -93
- package/dist/components/UTVirtualizedList/constants.js +4 -8
- package/dist/components/UTVirtualizedList/index.js +26 -38
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +17 -21
- package/dist/components/UTWorkflowContainer/constants.js +3 -6
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +3 -3
- package/dist/components/UTWorkflowContainer/index.js +32 -51
- package/dist/components/UTWorkflowContainer/theme.js +60 -53
- package/dist/components/UTWorkflowContainer/types.js +2 -3
- package/dist/components/WithLoading/index.js +10 -15
- package/dist/components/WithTheme/index.js +10 -17
- package/dist/components/WithTheme/layout.js +22 -28
- package/dist/components/WithTouch/index.js +12 -19
- package/dist/constants/UTTable.js +2 -3
- package/dist/index.js +58 -58
- package/dist/theme.js +6 -5
- package/dist/types/commonTypes.js +3 -5
- package/dist/types/consumptionTypes.js +3 -5
- package/dist/types/formTypes.js +4 -7
- package/dist/types/tableTypes.js +2 -3
- package/dist/utils/classesUtils.js +5 -13
- package/dist/utils/componentUtils.js +10 -13
- package/dist/utils/helperFunctions.js +4 -4
- package/dist/utils/shadowUtils.js +13 -11
- package/dist/utils/useScreenSize.js +2 -3
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -16,84 +15,78 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
|
16
15
|
var _constants = require("./constants");
|
|
17
16
|
var _utils = require("./utils");
|
|
18
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
function _interopRequireWildcard(
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
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 && Object.prototype.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; }
|
|
21
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
flatBarData
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return linearReferences.forEach(function (_ref6) {
|
|
74
|
-
var check = _ref6.check,
|
|
75
|
-
id = _ref6.id;
|
|
76
|
-
return check(item) && referencesToShow.add(id);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
levels.forEach(function (_ref7) {
|
|
80
|
-
var id = _ref7.id;
|
|
21
|
+
const Legend = _ref => {
|
|
22
|
+
let {
|
|
23
|
+
title,
|
|
24
|
+
references,
|
|
25
|
+
flatData,
|
|
26
|
+
displayAs = 'block',
|
|
27
|
+
style,
|
|
28
|
+
labels,
|
|
29
|
+
classes,
|
|
30
|
+
buttonProps
|
|
31
|
+
} = _ref;
|
|
32
|
+
const [showLegend, setShowLegend] = (0, _react.useState)(false);
|
|
33
|
+
const {
|
|
34
|
+
referencesModalTitle,
|
|
35
|
+
referencesModalButton,
|
|
36
|
+
showReferencesLabel
|
|
37
|
+
} = labels || {};
|
|
38
|
+
const {
|
|
39
|
+
bar: barReferences = [],
|
|
40
|
+
linear: linearReferences = [],
|
|
41
|
+
levels: levelsReferences = []
|
|
42
|
+
} = references || {};
|
|
43
|
+
const {
|
|
44
|
+
bar: flatBarData = [],
|
|
45
|
+
linear: flatLinearData = [],
|
|
46
|
+
levels = []
|
|
47
|
+
} = flatData || {};
|
|
48
|
+
const {
|
|
49
|
+
Component: Wrapper,
|
|
50
|
+
withButton
|
|
51
|
+
} = (0, _constants.displayOptions)(displayAs);
|
|
52
|
+
const getReferencesToShow = () => {
|
|
53
|
+
let referencesToShow = new Set();
|
|
54
|
+
flatBarData.forEach(item => barReferences.forEach(_ref2 => {
|
|
55
|
+
let {
|
|
56
|
+
check,
|
|
57
|
+
id
|
|
58
|
+
} = _ref2;
|
|
59
|
+
return check(item) && referencesToShow.add(id);
|
|
60
|
+
}));
|
|
61
|
+
flatLinearData.forEach(item => linearReferences.forEach(_ref3 => {
|
|
62
|
+
let {
|
|
63
|
+
check,
|
|
64
|
+
id
|
|
65
|
+
} = _ref3;
|
|
66
|
+
return check(item) && referencesToShow.add(id);
|
|
67
|
+
}));
|
|
68
|
+
levels.forEach(_ref4 => {
|
|
69
|
+
let {
|
|
70
|
+
id
|
|
71
|
+
} = _ref4;
|
|
81
72
|
return referencesToShow.add(id);
|
|
82
73
|
});
|
|
83
74
|
referencesToShow = Array.from(referencesToShow);
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
const filterFunction = _ref5 => {
|
|
76
|
+
let {
|
|
77
|
+
id
|
|
78
|
+
} = _ref5;
|
|
86
79
|
return referencesToShow.includes(id);
|
|
87
80
|
};
|
|
88
|
-
|
|
89
|
-
return getOrderedLegend(levelsReferences.filter(filterFunction), linearReferences.filter(filterFunction), barReferences.filter(filterFunction)).filter(
|
|
90
|
-
return !(0, _array.isEmpty)(row);
|
|
91
|
-
});
|
|
81
|
+
const getOrderedLegend = (0, _utils.orderLegend)(references === null || references === void 0 ? void 0 : references.orderFunction);
|
|
82
|
+
return getOrderedLegend(levelsReferences.filter(filterFunction), linearReferences.filter(filterFunction), barReferences.filter(filterFunction)).filter(row => !(0, _array.isEmpty)(row));
|
|
92
83
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
const referenceRenderer = reference => {
|
|
85
|
+
const {
|
|
86
|
+
label,
|
|
87
|
+
className,
|
|
88
|
+
CustomIcon
|
|
89
|
+
} = reference;
|
|
97
90
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
98
91
|
className: _stylesModule.default["item".concat(displayAs)],
|
|
99
92
|
key: label
|
|
@@ -103,19 +96,15 @@ var Legend = function Legend(_ref) {
|
|
|
103
96
|
className: "".concat(_stylesModule.default.itemLabel, " ").concat(classes.legendItemLabel)
|
|
104
97
|
}, label));
|
|
105
98
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
const referencesToShow = getReferencesToShow(flatData);
|
|
100
|
+
const hasReferences = !(0, _array.isEmpty)(referencesToShow);
|
|
101
|
+
const wrapperProps = displayAs === _constants.MODAL_KEY ? {
|
|
109
102
|
acceptButton: {
|
|
110
|
-
onClick:
|
|
111
|
-
return setShowLegend(false);
|
|
112
|
-
},
|
|
103
|
+
onClick: () => setShowLegend(false),
|
|
113
104
|
text: referencesModalButton || ''
|
|
114
105
|
},
|
|
115
106
|
isOpen: showLegend,
|
|
116
|
-
onRequestClose:
|
|
117
|
-
return setShowLegend(false);
|
|
118
|
-
},
|
|
107
|
+
onRequestClose: () => setShowLegend(false),
|
|
119
108
|
title: referencesModalTitle,
|
|
120
109
|
withCloseButton: true
|
|
121
110
|
} : {};
|
|
@@ -131,16 +120,10 @@ var Legend = function Legend(_ref) {
|
|
|
131
120
|
},
|
|
132
121
|
disabled: !hasReferences,
|
|
133
122
|
Icon: _InfoOutlined.default,
|
|
134
|
-
onClick:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
139
|
-
className: _stylesModule.default["row".concat(displayAs)]
|
|
140
|
-
}, row.map(function (item) {
|
|
141
|
-
return referenceRenderer(item);
|
|
142
|
-
}));
|
|
143
|
-
})));
|
|
123
|
+
onClick: () => setShowLegend(true)
|
|
124
|
+
}, buttonProps), showReferencesLabel), /*#__PURE__*/_react.default.createElement(Wrapper, wrapperProps, referencesToShow.map(row => /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
className: _stylesModule.default["row".concat(displayAs)]
|
|
126
|
+
}, row.map(item => referenceRenderer(item))))));
|
|
144
127
|
};
|
|
145
128
|
Legend.propTypes = {
|
|
146
129
|
buttonProps: _types.buttonPropsTypes,
|
|
@@ -156,5 +139,4 @@ Legend.propTypes = {
|
|
|
156
139
|
style: _propTypes.object,
|
|
157
140
|
title: _propTypes.string
|
|
158
141
|
};
|
|
159
|
-
var _default = Legend;
|
|
160
|
-
exports.default = _default;
|
|
142
|
+
var _default = exports.default = Legend;
|
|
@@ -4,9 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.orderLegend = void 0;
|
|
7
|
-
|
|
8
|
-
return function (levels, linear, bar) {
|
|
9
|
-
return legendOrderFunction ? legendOrderFunction(levels, linear, bar) : [levels, linear, bar];
|
|
10
|
-
};
|
|
11
|
-
};
|
|
7
|
+
const orderLegend = legendOrderFunction => (levels, linear, bar) => legendOrderFunction ? legendOrderFunction(levels, linear, bar) : [levels, linear, bar];
|
|
12
8
|
exports.orderLegend = orderLegend;
|
|
@@ -11,18 +11,21 @@ var _commonTypes = require("../../../../types/commonTypes");
|
|
|
11
11
|
var _utils = require("./utils");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
classes =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
const Levels = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
levels,
|
|
17
|
+
yAxis,
|
|
18
|
+
graphXStart,
|
|
19
|
+
graphXEnd,
|
|
20
|
+
classes = {}
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement("g", null, levels.map(_ref2 => {
|
|
23
|
+
let {
|
|
24
|
+
color,
|
|
25
|
+
value,
|
|
26
|
+
type
|
|
27
|
+
} = _ref2;
|
|
28
|
+
const yValue = yAxis(value);
|
|
26
29
|
return /*#__PURE__*/_react.default.createElement("line", _extends({
|
|
27
30
|
x1: graphXStart,
|
|
28
31
|
x2: graphXEnd,
|
|
@@ -39,5 +42,4 @@ Levels.propTypes = {
|
|
|
39
42
|
graphXStart: _propTypes.number,
|
|
40
43
|
classes: _commonTypes.classesType
|
|
41
44
|
};
|
|
42
|
-
var _default = Levels;
|
|
43
|
-
exports.default = _default;
|
|
45
|
+
var _default = exports.default = Levels;
|
|
@@ -4,31 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getLineConfiguration = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}[type];
|
|
33
|
-
};
|
|
7
|
+
const getLineConfiguration = (type, classes) => ({
|
|
8
|
+
solid: {
|
|
9
|
+
fill: 'none',
|
|
10
|
+
strokeWidth: '1',
|
|
11
|
+
className: classes.solidLevel
|
|
12
|
+
},
|
|
13
|
+
dashed: {
|
|
14
|
+
fill: 'none',
|
|
15
|
+
strokeWidth: '1',
|
|
16
|
+
strokeDasharray: '2,2',
|
|
17
|
+
className: classes.dashedLevel
|
|
18
|
+
},
|
|
19
|
+
dotted: {
|
|
20
|
+
fill: 'none',
|
|
21
|
+
strokeWidth: '2',
|
|
22
|
+
strokeDasharray: '4',
|
|
23
|
+
className: classes.dottedLevel
|
|
24
|
+
},
|
|
25
|
+
grid: {
|
|
26
|
+
fill: 'none',
|
|
27
|
+
strokeWidth: '1',
|
|
28
|
+
strokeDasharray: '5',
|
|
29
|
+
className: classes.gridLine
|
|
30
|
+
}
|
|
31
|
+
})[type];
|
|
34
32
|
exports.getLineConfiguration = getLineConfiguration;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MARKER_TYPES = exports.DEFAULT_MARKER_SIZE = void 0;
|
|
7
|
-
|
|
8
|
-
exports.
|
|
9
|
-
var MARKER_TYPES = {
|
|
7
|
+
const DEFAULT_MARKER_SIZE = exports.DEFAULT_MARKER_SIZE = 4;
|
|
8
|
+
const MARKER_TYPES = exports.MARKER_TYPES = {
|
|
10
9
|
DOT: 'dot'
|
|
11
|
-
};
|
|
12
|
-
exports.MARKER_TYPES = MARKER_TYPES;
|
|
10
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -10,28 +9,35 @@ var d3 = _interopRequireWildcard(require("d3"));
|
|
|
10
9
|
var _propTypes = require("prop-types");
|
|
11
10
|
var _types = require("../../types");
|
|
12
11
|
var _utils = require("./utils");
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
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 && Object.prototype.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; }
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const LinearPlot = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
data,
|
|
19
|
+
barWidth,
|
|
20
|
+
yAxis,
|
|
21
|
+
xAxis,
|
|
22
|
+
type,
|
|
23
|
+
color,
|
|
24
|
+
customLineProps,
|
|
25
|
+
markers
|
|
26
|
+
} = _ref;
|
|
27
|
+
const lineGenerator = d3.line().x(_ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
xCoordinate
|
|
30
|
+
} = _ref2;
|
|
28
31
|
return xAxis(xCoordinate) + barWidth / 2;
|
|
29
|
-
}).y(
|
|
30
|
-
|
|
32
|
+
}).y(_ref3 => {
|
|
33
|
+
let {
|
|
34
|
+
value
|
|
35
|
+
} = _ref3;
|
|
31
36
|
return yAxis(value);
|
|
32
37
|
});
|
|
33
|
-
|
|
34
|
-
props
|
|
38
|
+
const {
|
|
39
|
+
props
|
|
40
|
+
} = (0, _utils.getLineConfiguration)(type, lineGenerator);
|
|
35
41
|
return /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("path", _extends({
|
|
36
42
|
d: lineGenerator(data),
|
|
37
43
|
stroke: color
|
|
@@ -51,5 +57,4 @@ LinearPlot.propTypes = {
|
|
|
51
57
|
strokeDasharray: _propTypes.string
|
|
52
58
|
})
|
|
53
59
|
};
|
|
54
|
-
var _default = LinearPlot;
|
|
55
|
-
exports.default = _default;
|
|
60
|
+
var _default = exports.default = LinearPlot;
|
|
@@ -7,44 +7,42 @@ exports.getMarkers = exports.getLineConfiguration = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _constants = require("./constants");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}[type || DEFAULT_LINE_TYPE];
|
|
28
|
-
};
|
|
10
|
+
const DEFAULT_LINE_TYPE = 'solid';
|
|
11
|
+
const getLineConfiguration = type => ({
|
|
12
|
+
solid: {
|
|
13
|
+
props: {
|
|
14
|
+
fill: 'none',
|
|
15
|
+
strokeWidth: '1'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
dashed: {
|
|
19
|
+
props: {
|
|
20
|
+
fill: 'none',
|
|
21
|
+
strokeWidth: '1',
|
|
22
|
+
strokeDasharray: '2,2'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
custom: {}
|
|
26
|
+
})[type || DEFAULT_LINE_TYPE];
|
|
29
27
|
exports.getLineConfiguration = getLineConfiguration;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
});
|
|
49
|
-
};
|
|
28
|
+
const getMarkers = (data, xAxis, yAxis, barWidth, color, markersConfig) => data.map(_ref => {
|
|
29
|
+
let {
|
|
30
|
+
xCoordinate,
|
|
31
|
+
value
|
|
32
|
+
} = _ref;
|
|
33
|
+
const x = xAxis(xCoordinate) + barWidth / 2;
|
|
34
|
+
const y = yAxis(value);
|
|
35
|
+
const size = (markersConfig.size || _constants.DEFAULT_MARKER_SIZE) / 2;
|
|
36
|
+
return markersConfig.type === _constants.MARKER_TYPES.DOT && /*#__PURE__*/_react.default.createElement("svg", {
|
|
37
|
+
x: x - size,
|
|
38
|
+
y: y - size,
|
|
39
|
+
height: 2 * size,
|
|
40
|
+
width: 2 * size
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement("circle", {
|
|
42
|
+
cx: size,
|
|
43
|
+
cy: size,
|
|
44
|
+
r: size,
|
|
45
|
+
fill: color
|
|
46
|
+
}));
|
|
47
|
+
});
|
|
50
48
|
exports.getMarkers = getMarkers;
|
|
@@ -13,25 +13,26 @@ var _UTButton = _interopRequireDefault(require("../../../UTButton"));
|
|
|
13
13
|
var _constants = require("./constants");
|
|
14
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
16
|
+
const Pagination = _ref => {
|
|
17
17
|
var _anchor$current, _anchor$current$getBo;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
height =
|
|
31
|
-
|
|
18
|
+
let {
|
|
19
|
+
anchor,
|
|
20
|
+
classes,
|
|
21
|
+
currentPage,
|
|
22
|
+
graphXEnd,
|
|
23
|
+
graphXStart,
|
|
24
|
+
parentYPosition,
|
|
25
|
+
setCurrentPage,
|
|
26
|
+
totalPages
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
y = 0,
|
|
30
|
+
height = 0
|
|
31
|
+
} = ((_anchor$current = anchor.current) === null || _anchor$current === void 0 || (_anchor$current$getBo = _anchor$current.getBoundingClientRect) === null || _anchor$current$getBo === void 0 ? void 0 : _anchor$current$getBo.call(_anchor$current)) || {};
|
|
32
|
+
const top = y - parentYPosition + height / 2 - _constants.BUTTONS_SIZE / 2 || 0;
|
|
32
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
34
|
style: {
|
|
34
|
-
top
|
|
35
|
+
top,
|
|
35
36
|
left: graphXStart - 30,
|
|
36
37
|
width: graphXEnd - graphXStart + 60,
|
|
37
38
|
height: _constants.BUTTONS_SIZE
|
|
@@ -44,9 +45,7 @@ var Pagination = function Pagination(_ref) {
|
|
|
44
45
|
},
|
|
45
46
|
disabled: !currentPage,
|
|
46
47
|
Icon: _ChevronLeft.default,
|
|
47
|
-
onClick:
|
|
48
|
-
return setCurrentPage(currentPage - 1);
|
|
49
|
-
},
|
|
48
|
+
onClick: () => setCurrentPage(currentPage - 1),
|
|
50
49
|
variant: "text"
|
|
51
50
|
}), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
52
51
|
classNames: {
|
|
@@ -55,9 +54,7 @@ var Pagination = function Pagination(_ref) {
|
|
|
55
54
|
},
|
|
56
55
|
disabled: currentPage + 1 === totalPages,
|
|
57
56
|
Icon: _ChevronRight.default,
|
|
58
|
-
onClick:
|
|
59
|
-
return setCurrentPage(currentPage + 1);
|
|
60
|
-
},
|
|
57
|
+
onClick: () => setCurrentPage(currentPage + 1),
|
|
61
58
|
variant: "text"
|
|
62
59
|
}));
|
|
63
60
|
};
|
|
@@ -75,5 +72,4 @@ Pagination.propTypes = {
|
|
|
75
72
|
setCurrentPage: _propTypes.func,
|
|
76
73
|
totalPages: _propTypes.number
|
|
77
74
|
};
|
|
78
|
-
var _default = Pagination;
|
|
79
|
-
exports.default = _default;
|
|
75
|
+
var _default = exports.default = Pagination;
|