@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
|
@@ -10,23 +10,25 @@ var _propTypes = require("prop-types");
|
|
|
10
10
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
11
11
|
var _componentUtils = _interopRequireDefault(require("../../utils/componentUtils"));
|
|
12
12
|
var _constants = require("./constants");
|
|
13
|
-
var _excluded = ["colorTheme"];
|
|
14
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
14
|
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); }
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
const UTAvatar = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
manualColors,
|
|
19
|
+
labelProps,
|
|
20
|
+
palette,
|
|
21
|
+
userName
|
|
22
|
+
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
getFirstLetter,
|
|
25
|
+
getAvatarColors
|
|
26
|
+
} = _componentUtils.default;
|
|
27
|
+
const firstNameLetter = getFirstLetter(userName);
|
|
28
|
+
const {
|
|
29
|
+
colorTheme,
|
|
30
|
+
...styles
|
|
31
|
+
} = getAvatarColors(userName, palette || _constants.defaultPalette);
|
|
30
32
|
return /*#__PURE__*/_react.default.createElement(_Avatar.default, {
|
|
31
33
|
className: className,
|
|
32
34
|
style: manualColors ? {} : styles
|
|
@@ -50,5 +52,4 @@ UTAvatar.propTypes = {
|
|
|
50
52
|
})),
|
|
51
53
|
userName: _propTypes.string
|
|
52
54
|
};
|
|
53
|
-
var _default = UTAvatar;
|
|
54
|
-
exports.default = _default;
|
|
55
|
+
var _default = exports.default = UTAvatar;
|
|
@@ -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
|
});
|
|
@@ -8,25 +7,27 @@ exports.default = void 0;
|
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _propTypes = require("prop-types");
|
|
10
9
|
var d3 = _interopRequireWildcard(require("d3"));
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
const Rect = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
width,
|
|
15
|
+
height,
|
|
16
|
+
color,
|
|
17
|
+
x,
|
|
18
|
+
y,
|
|
19
|
+
borderRadius,
|
|
20
|
+
id,
|
|
21
|
+
stroke,
|
|
22
|
+
strokeWidth,
|
|
23
|
+
className,
|
|
24
|
+
transitionDuration
|
|
25
|
+
} = _ref;
|
|
26
|
+
const verticalStroke = -height + borderRadius || 0;
|
|
27
|
+
const horizontalStroke = width - 2 * borderRadius || 0;
|
|
28
|
+
const positiveHeight = height >= 0 ? height : 0;
|
|
29
|
+
const positiveY = y >= 0 ? y : 0;
|
|
30
|
+
(0, _react.useEffect)(() => {
|
|
30
31
|
d3.select("#bar-".concat(id)).attr('height', 0).attr('y', positiveY).transition().duration(transitionDuration).attr('height', positiveHeight).attr('y', positiveY - positiveHeight);
|
|
31
32
|
}, [positiveHeight, positiveY]);
|
|
32
33
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("clipPath", {
|
|
@@ -57,5 +58,4 @@ Rect.propTypes = {
|
|
|
57
58
|
className: _propTypes.string,
|
|
58
59
|
transitionDuration: _propTypes.number
|
|
59
60
|
};
|
|
60
|
-
var _default = Rect;
|
|
61
|
-
exports.default = _default;
|
|
61
|
+
var _default = exports.default = Rect;
|
|
@@ -12,23 +12,25 @@ var _Rect = _interopRequireDefault(require("./components/Rect"));
|
|
|
12
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
13
|
var _constants = require("./constants");
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
const Bar = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
19
|
+
color,
|
|
20
|
+
x,
|
|
21
|
+
y,
|
|
22
|
+
borderRadius,
|
|
23
|
+
tooltipContent,
|
|
24
|
+
onClick,
|
|
25
|
+
clickable,
|
|
26
|
+
data,
|
|
27
|
+
id,
|
|
28
|
+
index,
|
|
29
|
+
stroke,
|
|
30
|
+
strokeWidth,
|
|
31
|
+
tooltipClassName,
|
|
32
|
+
transitionDuration
|
|
33
|
+
} = _ref;
|
|
32
34
|
return /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
33
35
|
content: tooltipContent,
|
|
34
36
|
interactive: false,
|
|
@@ -36,9 +38,7 @@ var Bar = function Bar(_ref) {
|
|
|
36
38
|
className: tooltipClassName
|
|
37
39
|
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
38
40
|
className: "".concat(clickable && _stylesModule.default.clickable, " ").concat(_stylesModule.default.rect),
|
|
39
|
-
onClick: clickable ?
|
|
40
|
-
return onClick(index, data);
|
|
41
|
-
} : _constants.NO_OP
|
|
41
|
+
onClick: clickable ? () => onClick(index, data) : _constants.NO_OP
|
|
42
42
|
}, /*#__PURE__*/_react.default.createElement(_Rect.default, {
|
|
43
43
|
className: "".concat(clickable && _stylesModule.default.clickable, " ").concat(_stylesModule.default.rect),
|
|
44
44
|
width: width,
|
|
@@ -71,5 +71,4 @@ Bar.propTypes = {
|
|
|
71
71
|
tooltipClassName: _propTypes.string,
|
|
72
72
|
transitionDuration: _propTypes.number
|
|
73
73
|
};
|
|
74
|
-
var _default = Bar;
|
|
75
|
-
exports.default = _default;
|
|
74
|
+
var _default = exports.default = Bar;
|
|
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.HIGHLIGHT_KEY = exports.DEFAULT_TOP_LABEL_PADDING = exports.BAR_KEY = void 0;
|
|
7
|
-
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
exports.BAR_KEY = BAR_KEY;
|
|
11
|
-
var DEFAULT_TOP_LABEL_PADDING = '8';
|
|
12
|
-
exports.DEFAULT_TOP_LABEL_PADDING = DEFAULT_TOP_LABEL_PADDING;
|
|
7
|
+
const HIGHLIGHT_KEY = exports.HIGHLIGHT_KEY = 'HIGHLIGHT';
|
|
8
|
+
const BAR_KEY = exports.BAR_KEY = 'BAR';
|
|
9
|
+
const DEFAULT_TOP_LABEL_PADDING = exports.DEFAULT_TOP_LABEL_PADDING = '8';
|
|
@@ -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
|
});
|
|
@@ -12,60 +11,45 @@ var _commonTypes = require("../../../../types/commonTypes");
|
|
|
12
11
|
var _Bar = _interopRequireDefault(require("./components/Bar"));
|
|
13
12
|
var _constants = require("./constants");
|
|
14
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
highlightWidth = _ref.highlightWidth,
|
|
46
|
-
currentPage = _ref.currentPage,
|
|
47
|
-
valuesOnTop = _ref.valuesOnTop,
|
|
48
|
-
transitionDuration = _ref.transitionDuration,
|
|
49
|
-
classes = _ref.classes,
|
|
50
|
-
setCurrentLabel = _ref.setCurrentLabel;
|
|
51
|
-
var _useState = (0, _react.useState)(-1),
|
|
52
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
-
selectedIndex = _useState2[0],
|
|
54
|
-
setSelectedIndex = _useState2[1];
|
|
55
|
-
var _useState3 = (0, _react.useState)(-1),
|
|
56
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
|
-
selectedPage = _useState4[0],
|
|
58
|
-
setSelectedPage = _useState4[1];
|
|
59
|
-
var resetSelection = function resetSelection() {
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
const Bars = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
totalData,
|
|
19
|
+
barData,
|
|
20
|
+
xAxis,
|
|
21
|
+
xSubAxis,
|
|
22
|
+
yAxis,
|
|
23
|
+
barBorderRadius,
|
|
24
|
+
onBarClick,
|
|
25
|
+
barWidth,
|
|
26
|
+
graphYStart,
|
|
27
|
+
maxBarValue,
|
|
28
|
+
spacingOptions,
|
|
29
|
+
padding,
|
|
30
|
+
group,
|
|
31
|
+
groupWidth,
|
|
32
|
+
groups,
|
|
33
|
+
selectable,
|
|
34
|
+
highlightWidth,
|
|
35
|
+
currentPage,
|
|
36
|
+
valuesOnTop,
|
|
37
|
+
transitionDuration,
|
|
38
|
+
classes,
|
|
39
|
+
setCurrentLabel
|
|
40
|
+
} = _ref;
|
|
41
|
+
const [selectedIndex, setSelectedIndex] = (0, _react.useState)(-1);
|
|
42
|
+
const [selectedPage, setSelectedPage] = (0, _react.useState)(-1);
|
|
43
|
+
const resetSelection = () => {
|
|
60
44
|
setSelectedIndex(-1);
|
|
61
45
|
setSelectedPage(-1);
|
|
62
46
|
setCurrentLabel();
|
|
63
47
|
};
|
|
64
|
-
(0, _react.useEffect)(
|
|
48
|
+
(0, _react.useEffect)(() => {
|
|
65
49
|
resetSelection();
|
|
66
50
|
}, [totalData]);
|
|
67
|
-
|
|
68
|
-
|
|
51
|
+
const highlightSpacing = highlightWidth * (groups === 1 ? groupWidth * padding + barWidth * padding : barWidth * padding);
|
|
52
|
+
const onClick = (index, data) => {
|
|
69
53
|
if (selectable) {
|
|
70
54
|
setSelectedIndex(index);
|
|
71
55
|
setSelectedPage(currentPage);
|
|
@@ -76,20 +60,22 @@ var Bars = function Bars(_ref) {
|
|
|
76
60
|
setCurrentLabel(index);
|
|
77
61
|
}
|
|
78
62
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
63
|
+
const barRenderer = function (bar, index, data, stackIndex) {
|
|
64
|
+
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
65
|
+
let removeBorderRadius = arguments.length > 5 ? arguments[5] : undefined;
|
|
66
|
+
const {
|
|
67
|
+
value,
|
|
68
|
+
tooltipContent,
|
|
69
|
+
color,
|
|
70
|
+
clickable,
|
|
71
|
+
highlighted,
|
|
72
|
+
highlightColor,
|
|
73
|
+
stroke,
|
|
74
|
+
strokeWidth
|
|
75
|
+
} = bar;
|
|
76
|
+
const selected = selectable && selectedIndex === index && selectedPage === currentPage;
|
|
77
|
+
const xInitialPosition = xAxis(index) + xSubAxis(group);
|
|
78
|
+
const yInitialPosition = yAxis(value);
|
|
93
79
|
return /*#__PURE__*/_react.default.createElement("g", null, (highlighted || selected) && /*#__PURE__*/_react.default.createElement(_Bar.default, {
|
|
94
80
|
bar: bar,
|
|
95
81
|
width: barWidth + 2 * highlightSpacing,
|
|
@@ -126,25 +112,30 @@ var Bars = function Bars(_ref) {
|
|
|
126
112
|
y: yInitialPosition - (spacingOptions.onTopLabelPadding || _constants.DEFAULT_TOP_LABEL_PADDING)
|
|
127
113
|
}, data.onTopLabel || value));
|
|
128
114
|
};
|
|
129
|
-
return /*#__PURE__*/_react.default.createElement("g", null, barData.map(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement("g", null, barData.map((bar, index) => {
|
|
116
|
+
const {
|
|
117
|
+
value,
|
|
118
|
+
values,
|
|
119
|
+
clickable,
|
|
120
|
+
highlighted,
|
|
121
|
+
disableAutoOrder
|
|
122
|
+
} = bar;
|
|
123
|
+
let offset = 0;
|
|
136
124
|
if (value || value === 0 && highlighted) return barRenderer(bar, index, bar);
|
|
137
125
|
if (values && Array.isArray(values)) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
126
|
+
const valuesToRender = disableAutoOrder ? values : values.sort((_ref2, _ref3) => {
|
|
127
|
+
let {
|
|
128
|
+
value: a
|
|
129
|
+
} = _ref2;
|
|
130
|
+
let {
|
|
131
|
+
value: b
|
|
132
|
+
} = _ref3;
|
|
141
133
|
return a - b;
|
|
142
134
|
});
|
|
143
|
-
return valuesToRender.map(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
});
|
|
135
|
+
return valuesToRender.map((stackedBar, stackIndex, stack) => barRenderer({
|
|
136
|
+
...stackedBar,
|
|
137
|
+
clickable
|
|
138
|
+
}, index, bar, stackIndex, stackIndex ? offset += graphYStart - yAxis(stack[stackIndex - 1].value) : 0, stackIndex !== stack.length - 1));
|
|
148
139
|
}
|
|
149
140
|
return [];
|
|
150
141
|
}));
|
|
@@ -173,5 +164,4 @@ Bars.propTypes = {
|
|
|
173
164
|
classes: _commonTypes.classesType,
|
|
174
165
|
setCurrentLabel: _propTypes.func
|
|
175
166
|
};
|
|
176
|
-
var _default = Bars;
|
|
177
|
-
exports.default = _default;
|
|
167
|
+
var _default = exports.default = Bars;
|
|
@@ -6,24 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.displayOptions = exports.MODAL_KEY = exports.BLOCK_KEY = void 0;
|
|
7
7
|
var _reactPerfectScrollbar = _interopRequireDefault(require("react-perfect-scrollbar"));
|
|
8
8
|
var _UTDialog = _interopRequireDefault(require("../../../UTDialog"));
|
|
9
|
-
var _options;
|
|
10
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}), _defineProperty(_options, MODAL_KEY, {
|
|
23
|
-
Component: _UTDialog.default,
|
|
24
|
-
withButton: true
|
|
25
|
-
}), _options);
|
|
26
|
-
var displayOptions = function displayOptions(displayAs) {
|
|
27
|
-
return options[displayAs] || options[BLOCK_KEY];
|
|
10
|
+
const BLOCK_KEY = exports.BLOCK_KEY = 'block';
|
|
11
|
+
const MODAL_KEY = exports.MODAL_KEY = 'modal';
|
|
12
|
+
const options = {
|
|
13
|
+
[BLOCK_KEY]: {
|
|
14
|
+
Component: _reactPerfectScrollbar.default,
|
|
15
|
+
withButton: false
|
|
16
|
+
},
|
|
17
|
+
[MODAL_KEY]: {
|
|
18
|
+
Component: _UTDialog.default,
|
|
19
|
+
withButton: true
|
|
20
|
+
}
|
|
28
21
|
};
|
|
22
|
+
const displayOptions = displayAs => options[displayAs] || options[BLOCK_KEY];
|
|
29
23
|
exports.displayOptions = displayOptions;
|