@widergy/energy-ui 2.12.1 → 2.12.2
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 +36 -13
- package/dist/components/Loading/constants.js +2 -1
- package/dist/components/Loading/index.js +12 -13
- package/dist/components/Loading/theme.js +2 -4
- package/dist/components/UTAlert/AlertHandler.js +101 -75
- package/dist/components/UTAlert/index.js +87 -65
- package/dist/components/UTAlert/theme.js +32 -32
- package/dist/components/UTAttachment/components/Preview/index.js +9 -8
- package/dist/components/UTAttachment/constants.js +13 -7
- package/dist/components/UTAttachment/index.js +250 -159
- package/dist/components/UTAttachment/layout.js +27 -26
- package/dist/components/UTAttachment/theme.js +2 -4
- package/dist/components/UTAttachment/utils.js +117 -34
- package/dist/components/UTAutocomplete/components/ListBox/index.js +21 -13
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -9
- package/dist/components/UTAutocomplete/constants.js +23 -12
- package/dist/components/UTAutocomplete/index.js +94 -54
- package/dist/components/UTAutocomplete/theme.js +4 -6
- package/dist/components/UTAvatar/constants.js +3 -2
- package/dist/components/UTAvatar/index.js +17 -18
- 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 +22 -21
- package/dist/components/UTBarChart/components/Bars/constants.js +6 -3
- package/dist/components/UTBarChart/components/Bars/index.js +80 -70
- package/dist/components/UTBarChart/components/Legend/constants.js +18 -12
- package/dist/components/UTBarChart/components/Legend/index.js +93 -75
- package/dist/components/UTBarChart/components/Legend/utils.js +5 -1
- package/dist/components/UTBarChart/components/Levels/index.js +14 -16
- package/dist/components/UTBarChart/components/Levels/utils.js +27 -25
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +5 -3
- package/dist/components/UTBarChart/components/LinearPlot/index.js +20 -25
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -37
- package/dist/components/UTBarChart/components/Pagination/constants.js +2 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +24 -20
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +32 -21
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +4 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -20
- package/dist/components/UTBarChart/components/XAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +65 -54
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -12
- package/dist/components/UTBarChart/components/YAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +37 -30
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -4
- package/dist/components/UTBarChart/constants.js +8 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +40 -23
- package/dist/components/UTBarChart/index.js +166 -152
- package/dist/components/UTBarChart/theme.js +2 -4
- package/dist/components/UTBarChart/types.js +19 -10
- package/dist/components/UTBarChart/utils.js +111 -107
- package/dist/components/UTBreadcrumbs/constants.js +31 -23
- package/dist/components/UTBreadcrumbs/index.js +101 -76
- package/dist/components/UTBreadcrumbs/theme.js +2 -4
- package/dist/components/UTButton/constants.js +17 -11
- package/dist/components/UTButton/index.js +31 -28
- package/dist/components/UTButton/theme.js +23 -23
- package/dist/components/UTCBUInput/index.js +40 -36
- package/dist/components/UTCBUInput/theme.js +2 -4
- package/dist/components/UTCaptcha/index.js +45 -19
- package/dist/components/UTCard/components/UTCardFooter/index.js +16 -15
- package/dist/components/UTCard/index.js +120 -85
- package/dist/components/UTCard/theme.js +12 -11
- package/dist/components/UTCard/types.js +3 -2
- package/dist/components/UTCarousel/components/Button/index.js +13 -13
- package/dist/components/UTCarousel/components/Legend/index.js +15 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +16 -16
- package/dist/components/UTCarousel/components/Slider/constants.js +10 -5
- package/dist/components/UTCarousel/components/Slider/index.js +273 -204
- package/dist/components/UTCarousel/components/Slider/layout.js +94 -67
- package/dist/components/UTCarousel/index.js +15 -14
- package/dist/components/UTCarousel/theme.js +2 -4
- package/dist/components/UTCheckList/constants.js +2 -1
- package/dist/components/UTCheckList/index.js +93 -72
- package/dist/components/UTCheckList/theme.js +31 -31
- package/dist/components/UTCheckbox/constants.js +6 -3
- package/dist/components/UTCheckbox/index.js +44 -32
- package/dist/components/UTCheckbox/theme.js +35 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +9 -9
- package/dist/components/UTConsumptionBar/constants.js +6 -3
- package/dist/components/UTConsumptionBar/index.js +80 -53
- package/dist/components/UTCuit/index.js +133 -109
- package/dist/components/UTCuit/theme.js +53 -51
- package/dist/components/UTDatePicker/components/Day/constants.js +2 -1
- package/dist/components/UTDatePicker/components/Day/index.js +12 -12
- package/dist/components/UTDatePicker/constants.js +31 -20
- package/dist/components/UTDatePicker/index.js +102 -60
- package/dist/components/UTDatePicker/theme.js +3 -5
- package/dist/components/UTDatePicker/types.js +3 -2
- package/dist/components/UTDatePicker/utils.js +6 -2
- package/dist/components/UTDialog/constants.js +4 -2
- package/dist/components/UTDialog/index.js +37 -38
- package/dist/components/UTDialog/theme.js +2 -4
- package/dist/components/UTDialog/types.js +3 -2
- package/dist/components/UTDotMenu/index.js +61 -39
- package/dist/components/UTEmojiPicker/constants.js +11 -6
- package/dist/components/UTEmojiPicker/index.js +65 -45
- package/dist/components/UTEmojiPicker/theme.js +2 -4
- package/dist/components/UTEmojiPicker/utils.js +51 -21
- package/dist/components/UTExternalLink/constants.js +5 -3
- package/dist/components/UTExternalLink/index.js +15 -18
- package/dist/components/UTExternalLink/theme.js +6 -8
- package/dist/components/UTFileInput/constants.js +4 -2
- package/dist/components/UTFileInput/index.js +31 -7
- package/dist/components/UTFileInput/layout.js +97 -68
- package/dist/components/UTIconButton/index.js +72 -49
- package/dist/components/UTIconButton/theme.js +2 -4
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +58 -53
- package/dist/components/UTImageRadio/constants.js +6 -3
- package/dist/components/UTImageRadio/index.js +47 -39
- package/dist/components/UTImageRadio/theme.js +12 -11
- package/dist/components/UTImageRadio/types.js +3 -2
- package/dist/components/UTImageRadio/utils.js +6 -2
- package/dist/components/UTLabel/constants.js +20 -14
- package/dist/components/UTLabel/index.js +20 -18
- package/dist/components/UTLabel/theme.js +15 -15
- package/dist/components/UTList/index.js +18 -15
- package/dist/components/UTLoading/index.js +15 -15
- package/dist/components/UTMap/components/GoogleMaps/constants.js +11 -8
- package/dist/components/UTMap/components/GoogleMaps/index.js +91 -63
- package/dist/components/UTMap/components/GoogleMaps/styles.js +3 -2
- package/dist/components/UTMap/constants.js +12 -6
- package/dist/components/UTMap/index.js +198 -163
- package/dist/components/UTMap/types.js +6 -4
- package/dist/components/UTMap/utils.js +46 -29
- package/dist/components/UTMap/withGoogleMapScript.js +22 -18
- package/dist/components/UTMenu/index.js +69 -52
- package/dist/components/UTMenu/theme.js +3 -5
- package/dist/components/UTMenu/utils.js +11 -5
- package/dist/components/UTModal/constants.js +13 -9
- package/dist/components/UTModal/index.js +30 -26
- package/dist/components/UTModal/theme.js +2 -4
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -11
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTPagination/components/Pagination/index.js +39 -28
- package/dist/components/UTPagination/components/Pagination/utils.js +14 -8
- package/dist/components/UTPagination/constants.js +6 -3
- package/dist/components/UTPagination/index.js +17 -16
- package/dist/components/UTPagination/theme.js +2 -4
- package/dist/components/UTPanel/index.js +44 -38
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +10 -13
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +19 -22
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +50 -63
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +26 -25
- package/dist/components/UTPasswordField/index.js +23 -26
- package/dist/components/UTPasswordField/theme.js +2 -4
- package/dist/components/UTPhoneInput/constants.js +6 -3
- package/dist/components/UTPhoneInput/index.js +205 -180
- package/dist/components/UTPhoneInput/theme.js +77 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +8 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -24
- package/dist/components/UTPieChart/components/Legend/contants.js +6 -3
- package/dist/components/UTPieChart/components/Legend/index.js +24 -27
- package/dist/components/UTPieChart/constants.js +26 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +33 -15
- package/dist/components/UTPieChart/index.js +76 -73
- package/dist/components/UTPieChart/theme.js +2 -4
- package/dist/components/UTPieChart/utils.js +2 -4
- package/dist/components/UTProgressBar/constants.js +4 -2
- package/dist/components/UTProgressBar/index.js +17 -15
- package/dist/components/UTProgressBar/theme.js +2 -4
- package/dist/components/UTProgressBar/types.js +3 -2
- package/dist/components/UTRadioGroup/index.js +83 -56
- package/dist/components/UTRadioGroup/theme.js +52 -52
- package/dist/components/UTRating/components/Circle/index.js +56 -41
- package/dist/components/UTRating/components/Faces/constants.js +4 -2
- package/dist/components/UTRating/components/Faces/index.js +36 -34
- package/dist/components/UTRating/components/Star/index.js +40 -36
- package/dist/components/UTRating/constants.js +8 -4
- package/dist/components/UTRating/index.js +46 -31
- package/dist/components/UTRating/theme.js +2 -4
- package/dist/components/UTRipple/Ripple.js +39 -22
- package/dist/components/UTRipple/index.js +37 -18
- package/dist/components/UTSelect/components/Option/index.js +13 -13
- package/dist/components/UTSelect/constants.js +8 -4
- package/dist/components/UTSelect/index.js +85 -63
- package/dist/components/UTSelect/stylesJS.js +3 -2
- package/dist/components/UTSelect/theme.js +4 -6
- package/dist/components/UTSelect/utils.js +13 -3
- package/dist/components/UTSidebar/components/ListOption/index.js +49 -34
- 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 +3 -2
- package/dist/components/UTSidebar/components/Option/index.js +32 -28
- package/dist/components/UTSidebar/components/Toggler/index.js +11 -11
- package/dist/components/UTSidebar/index.js +53 -42
- package/dist/components/UTSidebar/theme.js +2 -4
- package/dist/components/UTSidebar/types.js +10 -5
- package/dist/components/UTSkeleton/index.js +36 -10
- package/dist/components/UTStatus/constants.js +9 -5
- package/dist/components/UTStatus/index.js +15 -16
- package/dist/components/UTStatus/theme.js +49 -66
- package/dist/components/UTSwitch/constants.js +6 -3
- package/dist/components/UTSwitch/index.js +57 -42
- package/dist/components/UTSwitch/theme.js +2 -4
- package/dist/components/UTTable/components/ActionIcons/constants.js +2 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +85 -47
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +12 -10
- package/dist/components/UTTable/components/Cell/index.js +23 -18
- package/dist/components/UTTable/components/HeaderCell/constants.js +3 -2
- package/dist/components/UTTable/components/HeaderCell/index.js +30 -23
- package/dist/components/UTTable/components/HeaderCell/utils.js +3 -3
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -12
- package/dist/components/UTTable/components/ResponsiveCell/index.js +20 -19
- package/dist/components/UTTable/components/Status/index.js +19 -18
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -10
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +32 -21
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +14 -8
- package/dist/components/UTTable/components/TableFooter/constants.js +2 -1
- 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 +6 -3
- package/dist/components/UTTable/components/TableRow/index.js +94 -79
- package/dist/components/UTTable/constants.js +43 -26
- package/dist/components/UTTable/hook.js +26 -11
- package/dist/components/UTTable/index.js +223 -132
- package/dist/components/UTTable/theme.js +17 -17
- package/dist/components/UTTable/types.js +8 -4
- package/dist/components/UTTable/utils.js +74 -70
- package/dist/components/UTTabs/components/TooltipTab/index.js +30 -20
- package/dist/components/UTTabs/constants.js +8 -4
- package/dist/components/UTTabs/index.js +86 -57
- package/dist/components/UTTabs/theme.js +2 -4
- package/dist/components/UTTabs/utils.js +1 -1
- package/dist/components/UTTextArea/constants.js +6 -3
- package/dist/components/UTTextArea/index.js +23 -23
- package/dist/components/UTTextArea/theme.js +2 -4
- package/dist/components/UTTextInput/constants.js +3 -2
- package/dist/components/UTTextInput/index.js +165 -137
- package/dist/components/UTTextInput/theme.js +4 -6
- package/dist/components/UTThirdPartyCookieChecker/index.js +21 -17
- package/dist/components/UTToggle/components/ToggleOption/index.js +17 -16
- package/dist/components/UTToggle/index.js +26 -25
- package/dist/components/UTToggle/theme.js +2 -4
- package/dist/components/UTTooltip/index.js +30 -23
- package/dist/components/UTTooltip/theme.js +2 -4
- package/dist/components/UTTopbar/components/Notifications/index.js +14 -11
- package/dist/components/UTTopbar/components/UserMenu/index.js +15 -15
- package/dist/components/UTTopbar/index.js +31 -28
- package/dist/components/UTTopbar/theme.js +2 -4
- package/dist/components/UTTopbar/types.js +9 -5
- package/dist/components/UTTouchableWithoutFeedback/index.js +27 -14
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +4 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +31 -34
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +4 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +12 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +18 -8
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +47 -23
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +34 -31
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +93 -81
- package/dist/components/UTVirtualizedList/constants.js +8 -4
- package/dist/components/UTVirtualizedList/index.js +38 -26
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +21 -17
- package/dist/components/UTWorkflowContainer/constants.js +6 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +3 -3
- package/dist/components/UTWorkflowContainer/index.js +51 -32
- package/dist/components/UTWorkflowContainer/theme.js +53 -60
- package/dist/components/UTWorkflowContainer/types.js +3 -2
- package/dist/components/WithLoading/index.js +15 -10
- package/dist/components/WithTheme/index.js +17 -10
- package/dist/components/WithTheme/layout.js +28 -22
- package/dist/components/WithTouch/index.js +19 -12
- package/dist/constants/UTTable.js +3 -2
- package/dist/index.js +58 -58
- package/dist/theme.js +5 -6
- package/dist/types/commonTypes.js +5 -3
- package/dist/types/consumptionTypes.js +5 -3
- package/dist/types/formTypes.js +7 -4
- package/dist/types/tableTypes.js +3 -2
- package/dist/utils/classesUtils.js +13 -5
- package/dist/utils/componentUtils.js +13 -10
- package/dist/utils/helperFunctions.js +4 -4
- package/dist/utils/shadowUtils.js +11 -13
- package/dist/utils/useScreenSize.js +3 -2
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -15,7 +16,7 @@ var _commonTypes = require("../../types/commonTypes");
|
|
|
15
16
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
16
17
|
var _theme = require("./theme");
|
|
17
18
|
var _utils = require("./utils");
|
|
18
|
-
var
|
|
19
|
+
var _useDynamicMargins2 = _interopRequireDefault(require("./hooks/use-dynamic-margins"));
|
|
19
20
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
20
21
|
var _YAxis = _interopRequireDefault(require("./components/YAxis"));
|
|
21
22
|
var _XAxis = _interopRequireDefault(require("./components/XAxis"));
|
|
@@ -25,130 +26,142 @@ var _Levels = _interopRequireDefault(require("./components/Levels"));
|
|
|
25
26
|
var _Pagination = _interopRequireDefault(require("./components/Pagination"));
|
|
26
27
|
var _Legend = _interopRequireDefault(require("./components/Legend"));
|
|
27
28
|
var _types = require("./types");
|
|
29
|
+
var _excluded = ["data"];
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
function _getRequireWildcardCache(
|
|
30
|
-
function _interopRequireWildcard(
|
|
31
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
33
|
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); }
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
34
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
38
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
39
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
40
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
41
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
42
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
43
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
44
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
45
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
46
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
+
var UTBarChart = function UTBarChart(_ref) {
|
|
48
|
+
var barBorderRadius = _ref.barBorderRadius,
|
|
49
|
+
barData = _ref.barData,
|
|
50
|
+
barPadding = _ref.barPadding,
|
|
51
|
+
buttonProps = _ref.buttonProps,
|
|
52
|
+
center = _ref.center,
|
|
53
|
+
theme = _ref.classes,
|
|
54
|
+
className = _ref.className,
|
|
55
|
+
classNames = _ref.classNames,
|
|
56
|
+
decoratorRenderer = _ref.decoratorRenderer,
|
|
57
|
+
displayLegendAs = _ref.displayLegendAs,
|
|
58
|
+
fitLegend = _ref.fitLegend,
|
|
59
|
+
gradientGenerator = _ref.gradientGenerator,
|
|
60
|
+
hideYAxis = _ref.hideYAxis,
|
|
61
|
+
highlightWidth = _ref.highlightWidth,
|
|
62
|
+
labelFormatters = _ref.labelFormatters,
|
|
63
|
+
labels = _ref.labels,
|
|
64
|
+
levels = _ref.levels,
|
|
65
|
+
linearData = _ref.linearData,
|
|
66
|
+
minBarWidth = _ref.minBarWidth,
|
|
67
|
+
NoDataComponent = _ref.NoDataComponent,
|
|
68
|
+
onBarClick = _ref.onBarClick,
|
|
69
|
+
pagination = _ref.pagination,
|
|
70
|
+
references = _ref.references,
|
|
71
|
+
selectable = _ref.selectable,
|
|
72
|
+
showGrid = _ref.showGrid,
|
|
73
|
+
singleYAxis = _ref.singleYAxis,
|
|
74
|
+
spacingOptions = _ref.spacingOptions,
|
|
75
|
+
title = _ref.title,
|
|
76
|
+
transitionDuration = _ref.transitionDuration,
|
|
77
|
+
units = _ref.units,
|
|
78
|
+
valuesOnTop = _ref.valuesOnTop,
|
|
79
|
+
xAxisDefinition = _ref.xAxisDefinition,
|
|
80
|
+
yAxisTicks = _ref.yAxisTicks;
|
|
81
|
+
var classes = (0, _classesUtils.mergeClasses)(theme, classNames);
|
|
82
|
+
var _useState = (0, _react.useState)(0),
|
|
83
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
84
|
+
currentPage = _useState2[0],
|
|
85
|
+
setCurrentPage = _useState2[1];
|
|
86
|
+
var _useState3 = (0, _react.useState)(),
|
|
87
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
88
|
+
currentLabel = _useState4[0],
|
|
89
|
+
setCurrentLabel = _useState4[1];
|
|
90
|
+
var _useDynamicMargins = (0, _useDynamicMargins2.default)(center, spacingOptions),
|
|
91
|
+
marginLeftRef = _useDynamicMargins.marginLeftRef,
|
|
92
|
+
marginRightRef = _useDynamicMargins.marginRightRef,
|
|
93
|
+
marginBottomRef = _useDynamicMargins.marginBottomRef,
|
|
94
|
+
marginBottom = _useDynamicMargins.marginBottom,
|
|
95
|
+
marginRight = _useDynamicMargins.marginRight,
|
|
96
|
+
marginLeft = _useDynamicMargins.marginLeft;
|
|
97
|
+
var _useComponentDimensio = (0, _energyHooks.useComponentDimensions)(),
|
|
98
|
+
containerRef = _useComponentDimensio.ref,
|
|
99
|
+
containerWidth = _useComponentDimensio.width,
|
|
100
|
+
containerHeight = _useComponentDimensio.height;
|
|
101
|
+
var _useComponentPosition = (0, _energyHooks.useComponentPosition)({
|
|
102
|
+
externalRef: containerRef
|
|
103
|
+
}),
|
|
104
|
+
parentYPosition = _useComponentPosition.y;
|
|
105
|
+
var paginationRef = (0, _react.useRef)();
|
|
106
|
+
var groups = barData.length;
|
|
107
|
+
var totalPages = (0, _react.useMemo)(function () {
|
|
108
|
+
return (0, _utils.getPages)(barData[0], pagination);
|
|
109
|
+
}, [barData, pagination]);
|
|
110
|
+
var formattedData = (0, _react.useMemo)(function () {
|
|
111
|
+
return pagination ? barData === null || barData === void 0 ? void 0 : barData.map(function (data) {
|
|
112
|
+
return (0, _utils.getFormattedData)(data, pagination, currentPage);
|
|
113
|
+
}) : barData;
|
|
114
|
+
}, [pagination, barData, currentPage]);
|
|
115
|
+
var formattedLinearData = (0, _react.useMemo)(function () {
|
|
116
|
+
return linearData === null || linearData === void 0 ? void 0 : linearData.map(function (_ref2) {
|
|
117
|
+
var data = _ref2.data,
|
|
118
|
+
config = _objectWithoutProperties(_ref2, _excluded);
|
|
119
|
+
return _objectSpread({
|
|
120
|
+
data: pagination ? (0, _utils.getFormattedLinearData)(data, currentPage, pagination) : data
|
|
121
|
+
}, config);
|
|
122
|
+
});
|
|
123
|
+
}, [pagination, linearData, currentPage]);
|
|
124
|
+
var flattenedAndReducedBarData = (0, _utils.flattenAndReduceBarData)(barData);
|
|
125
|
+
var _flattenData = (0, _utils.flattenData)(formattedData, linearData),
|
|
126
|
+
flatBarData = _flattenData.flatBarData,
|
|
127
|
+
flatLinearData = _flattenData.flatLinearData;
|
|
128
|
+
var _flattenData2 = (0, _utils.flattenData)(barData, linearData),
|
|
129
|
+
fullFlatBarData = _flattenData2.flatBarData;
|
|
130
|
+
var _getMaxValues = (0, _utils.getMaxValues)(flattenedAndReducedBarData, flatLinearData, levels),
|
|
131
|
+
maxBarValue = _getMaxValues.maxBarValue,
|
|
132
|
+
maxLinearValue = _getMaxValues.maxLinearValue;
|
|
133
|
+
var withLinearData = !(0, _array.isEmpty)(flatLinearData);
|
|
134
|
+
var withBarData = !(0, _array.isEmpty)(fullFlatBarData);
|
|
135
|
+
var _getGraphAttributes = (0, _utils.getGraphAttributes)(containerWidth, containerHeight, marginLeft, marginRight, marginBottom, pagination ? 0 : minBarWidth, formattedData[0].length, barPadding, groups, spacingOptions),
|
|
136
|
+
TOTAL_HEIGHT = _getGraphAttributes.TOTAL_HEIGHT,
|
|
137
|
+
TOTAL_WIDTH = _getGraphAttributes.TOTAL_WIDTH,
|
|
138
|
+
GRAPH_X_END = _getGraphAttributes.GRAPH_X_END,
|
|
139
|
+
GRAPH_X_START = _getGraphAttributes.GRAPH_X_START,
|
|
140
|
+
GRAPH_Y_END = _getGraphAttributes.GRAPH_Y_END,
|
|
141
|
+
GRAPH_Y_START = _getGraphAttributes.GRAPH_Y_START;
|
|
142
|
+
var roundedMaxBarValue = Math.round(maxBarValue);
|
|
143
|
+
var roundedMaxLinearValue = Math.round(maxLinearValue);
|
|
144
|
+
var maxAbsoluteValue = Math.max(roundedMaxBarValue, roundedMaxLinearValue);
|
|
145
|
+
var yAxis = d3.scaleLinear().domain([0, singleYAxis ? maxAbsoluteValue : roundedMaxBarValue]).range([GRAPH_Y_START, GRAPH_Y_END]);
|
|
146
|
+
var xAxis = d3.scaleBand().domain(d3.range(formattedData[0].length)).range([GRAPH_X_START, GRAPH_X_END]).padding(barPadding);
|
|
147
|
+
var groupWidth = xAxis.bandwidth();
|
|
148
|
+
var xSubAxis = d3.scaleBand().domain(d3.range(groups)).range([0, groupWidth]).padding(barPadding);
|
|
149
|
+
var barWidth = xSubAxis.bandwidth();
|
|
150
|
+
var linearYAxis = singleYAxis ? yAxis : d3.scaleLinear().domain([0, roundedMaxLinearValue]).range([GRAPH_Y_START, GRAPH_Y_END]);
|
|
151
|
+
(0, _react.useEffect)(function () {
|
|
135
152
|
setCurrentPage(0);
|
|
136
153
|
}, [barData]);
|
|
137
|
-
(0, _react.useEffect)(()
|
|
154
|
+
(0, _react.useEffect)(function () {
|
|
138
155
|
setCurrentLabel(null);
|
|
139
156
|
}, [currentPage]);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
linearSubtitle: linearUnitSubtitle
|
|
149
|
-
} = units;
|
|
150
|
-
const Wrapper = pagination ? 'div' : _reactPerfectScrollbar.default;
|
|
151
|
-
const wrapperProps = pagination ? {} : {
|
|
157
|
+
var barAxisLabelFormatter = labelFormatters.bar,
|
|
158
|
+
linearAxisLabelFormatter = labelFormatters.linear;
|
|
159
|
+
var barUnit = units.bar,
|
|
160
|
+
barUnitSubtitle = units.barSubtitle,
|
|
161
|
+
linearUnit = units.linear,
|
|
162
|
+
linearUnitSubtitle = units.linearSubtitle;
|
|
163
|
+
var Wrapper = pagination ? 'div' : _reactPerfectScrollbar.default;
|
|
164
|
+
var wrapperProps = pagination ? {} : {
|
|
152
165
|
suppressScrollX: !!pagination,
|
|
153
166
|
suppressScrollY: true
|
|
154
167
|
};
|
|
@@ -169,37 +182,37 @@ const UTBarChart = _ref => {
|
|
|
169
182
|
graphYStart: GRAPH_Y_START,
|
|
170
183
|
levels: (0, _utils.getGrid)(yAxisTicks, singleYAxis ? maxAbsoluteValue : roundedMaxBarValue),
|
|
171
184
|
yAxis: yAxis
|
|
172
|
-
}), formattedData.map((data, group)
|
|
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
|
-
|
|
185
|
+
}), formattedData.map(function (data, group) {
|
|
186
|
+
return /*#__PURE__*/_react.default.createElement(_Bars.default, {
|
|
187
|
+
barBorderRadius: barBorderRadius,
|
|
188
|
+
barData: data,
|
|
189
|
+
barWidth: barWidth,
|
|
190
|
+
classes: classes,
|
|
191
|
+
currentPage: currentPage,
|
|
192
|
+
graphYStart: GRAPH_Y_START,
|
|
193
|
+
group: group,
|
|
194
|
+
groups: groups,
|
|
195
|
+
groupWidth: groupWidth,
|
|
196
|
+
highlightWidth: highlightWidth,
|
|
197
|
+
maxBarValue: roundedMaxBarValue,
|
|
198
|
+
onBarClick: onBarClick,
|
|
199
|
+
padding: barPadding,
|
|
200
|
+
selectable: selectable,
|
|
201
|
+
setCurrentLabel: setCurrentLabel,
|
|
202
|
+
spacingOptions: spacingOptions,
|
|
203
|
+
totalData: barData,
|
|
204
|
+
transitionDuration: transitionDuration,
|
|
205
|
+
valuesOnTop: valuesOnTop,
|
|
206
|
+
xAxis: xAxis,
|
|
207
|
+
xSubAxis: xSubAxis,
|
|
208
|
+
yAxis: yAxis
|
|
209
|
+
});
|
|
210
|
+
}), formattedLinearData.map(function (_ref3) {
|
|
211
|
+
var data = _ref3.data,
|
|
212
|
+
type = _ref3.type,
|
|
213
|
+
color = _ref3.color,
|
|
214
|
+
customLineProps = _ref3.customLineProps,
|
|
215
|
+
markers = _ref3.markers;
|
|
203
216
|
return /*#__PURE__*/_react.default.createElement(_LinearPlot.default, {
|
|
204
217
|
barWidth: groupWidth,
|
|
205
218
|
color: color,
|
|
@@ -282,7 +295,7 @@ const UTBarChart = _ref => {
|
|
|
282
295
|
flatData: {
|
|
283
296
|
bar: flatBarData,
|
|
284
297
|
linear: flatLinearData,
|
|
285
|
-
levels
|
|
298
|
+
levels: levels
|
|
286
299
|
},
|
|
287
300
|
references: references,
|
|
288
301
|
title: title,
|
|
@@ -345,4 +358,5 @@ UTBarChart.defaultProps = {
|
|
|
345
358
|
linearData: [],
|
|
346
359
|
transitionDuration: 0
|
|
347
360
|
};
|
|
348
|
-
var _default =
|
|
361
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTBarChart);
|
|
362
|
+
exports.default = _default;
|
|
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _classesUtils = require("../../utils/classesUtils");
|
|
9
|
-
|
|
9
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
10
10
|
var _theme$UTBarChart, _theme$UTBarChart2, _theme$UTBarChart3, _theme$UTBarChart4, _theme$UTBarChart5, _theme$UTBarChart6;
|
|
11
|
-
|
|
12
|
-
theme
|
|
13
|
-
} = _ref;
|
|
11
|
+
var theme = _ref.theme;
|
|
14
12
|
return {
|
|
15
13
|
solidLevel: {
|
|
16
14
|
strokeWidth: (0, _seamlessImmutable.getIn)(theme, ['UTBarChart', 'solidLevel', 'strokeWidth'], 1)
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.xAxisDefinitionType = exports.referencesType = exports.linearType = exports.linearMarkersType = exports.linearDataType = exports.levelsType = exports.buttonPropsTypes = exports.barType = exports.barDataType = void 0;
|
|
7
7
|
var _propTypes = require("prop-types");
|
|
8
|
-
|
|
8
|
+
var barType = (0, _propTypes.shape)({
|
|
9
9
|
clickable: _propTypes.bool,
|
|
10
10
|
color: _propTypes.string,
|
|
11
11
|
highlightColor: _propTypes.string,
|
|
@@ -21,11 +21,14 @@ const barType = exports.barType = (0, _propTypes.shape)({
|
|
|
21
21
|
value: _propTypes.number
|
|
22
22
|
}))
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
exports.barType = barType;
|
|
25
|
+
var barDataType = (0, _propTypes.arrayOf)((0, _propTypes.oneOfType)([(0, _propTypes.arrayOf)(barType), barType]));
|
|
26
|
+
exports.barDataType = barDataType;
|
|
27
|
+
var linearMarkersType = (0, _propTypes.shape)({
|
|
26
28
|
type: _propTypes.string
|
|
27
29
|
});
|
|
28
|
-
|
|
30
|
+
exports.linearMarkersType = linearMarkersType;
|
|
31
|
+
var linearType = (0, _propTypes.shape)({
|
|
29
32
|
color: _propTypes.string,
|
|
30
33
|
data: (0, _propTypes.arrayOf)({
|
|
31
34
|
xCoodrinate: _propTypes.number,
|
|
@@ -34,13 +37,16 @@ const linearType = exports.linearType = (0, _propTypes.shape)({
|
|
|
34
37
|
marker: linearMarkersType,
|
|
35
38
|
type: _propTypes.string
|
|
36
39
|
});
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
exports.linearType = linearType;
|
|
41
|
+
var linearDataType = (0, _propTypes.arrayOf)(linearType);
|
|
42
|
+
exports.linearDataType = linearDataType;
|
|
43
|
+
var levelsType = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
39
44
|
value: _propTypes.number,
|
|
40
45
|
color: _propTypes.string,
|
|
41
46
|
id: _propTypes.string
|
|
42
47
|
}));
|
|
43
|
-
|
|
48
|
+
exports.levelsType = levelsType;
|
|
49
|
+
var referencesType = (0, _propTypes.shape)({
|
|
44
50
|
check: _propTypes.func,
|
|
45
51
|
className: _propTypes.string,
|
|
46
52
|
CustomIcon: _propTypes.elementType,
|
|
@@ -48,15 +54,18 @@ const referencesType = exports.referencesType = (0, _propTypes.shape)({
|
|
|
48
54
|
label: _propTypes.string,
|
|
49
55
|
orderFunction: _propTypes.func
|
|
50
56
|
});
|
|
51
|
-
|
|
57
|
+
exports.referencesType = referencesType;
|
|
58
|
+
var xAxisDefinitionType = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
52
59
|
labelBackgroundPadding: _propTypes.number,
|
|
53
60
|
mainLabel: _propTypes.string,
|
|
54
61
|
secondaryLabel: _propTypes.string,
|
|
55
62
|
selectedLabelBackground: _propTypes.string
|
|
56
63
|
}));
|
|
57
|
-
|
|
64
|
+
exports.xAxisDefinitionType = xAxisDefinitionType;
|
|
65
|
+
var buttonPropsTypes = (0, _propTypes.shape)({
|
|
58
66
|
colorTheme: _propTypes.string,
|
|
59
67
|
iconPlacement: _propTypes.string,
|
|
60
68
|
size: _propTypes.string,
|
|
61
69
|
variant: _propTypes.string
|
|
62
|
-
});
|
|
70
|
+
});
|
|
71
|
+
exports.buttonPropsTypes = buttonPropsTypes;
|