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