@widergy/energy-ui 2.10.1 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/EnergyThemeProvider/index.js +12 -34
- package/dist/components/Loading/constants.js +1 -1
- package/dist/components/Loading/index.js +12 -10
- package/dist/components/Loading/theme.js +6 -3
- package/dist/components/UTAlert/AlertHandler.js +74 -99
- package/dist/components/UTAlert/index.js +64 -85
- package/dist/components/UTAlert/theme.js +34 -32
- package/dist/components/UTAttachment/components/Preview/index.js +7 -7
- package/dist/components/UTAttachment/constants.js +6 -6
- package/dist/components/UTAttachment/index.js +158 -248
- package/dist/components/UTAttachment/layout.js +25 -25
- package/dist/components/UTAttachment/theme.js +6 -3
- package/dist/components/UTAttachment/utils.js +44 -117
- package/dist/components/UTAutocomplete/components/ListBox/index.js +12 -19
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -12
- package/dist/components/UTAutocomplete/constants.js +11 -11
- package/dist/components/UTAutocomplete/index.js +53 -92
- package/dist/components/UTAutocomplete/theme.js +9 -5
- package/dist/components/UTAvatar/constants.js +1 -1
- package/dist/components/UTAvatar/index.js +17 -15
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +21 -20
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +2 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +20 -20
- package/dist/components/UTBarChart/components/Bars/constants.js +3 -3
- package/dist/components/UTBarChart/components/Bars/index.js +69 -78
- package/dist/components/UTBarChart/components/Legend/constants.js +14 -17
- package/dist/components/UTBarChart/components/Legend/index.js +74 -91
- package/dist/components/UTBarChart/components/Legend/utils.js +2 -5
- package/dist/components/UTBarChart/components/Levels/index.js +15 -12
- package/dist/components/UTBarChart/components/Levels/utils.js +26 -27
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +2 -2
- package/dist/components/UTBarChart/components/LinearPlot/index.js +24 -18
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -39
- package/dist/components/UTBarChart/components/Pagination/constants.js +1 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +19 -22
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +20 -30
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -17
- package/dist/components/UTBarChart/components/XAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +53 -63
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -9
- package/dist/components/UTBarChart/components/YAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +29 -35
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -6
- package/dist/components/UTBarChart/constants.js +4 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +22 -38
- package/dist/components/UTBarChart/index.js +151 -164
- package/dist/components/UTBarChart/theme.js +6 -3
- package/dist/components/UTBarChart/types.js +9 -9
- package/dist/components/UTBarChart/utils.js +118 -111
- package/dist/components/UTBreadcrumbs/constants.js +22 -24
- package/dist/components/UTBreadcrumbs/index.js +75 -99
- package/dist/components/UTBreadcrumbs/theme.js +6 -3
- package/dist/components/UTButton/constants.js +11 -11
- package/dist/components/UTButton/index.js +27 -29
- package/dist/components/UTButton/theme.js +26 -24
- package/dist/components/UTCBUInput/index.js +35 -38
- package/dist/components/UTCBUInput/theme.js +6 -3
- package/dist/components/UTCaptcha/index.js +18 -43
- package/dist/components/UTCard/components/UTCardFooter/index.js +14 -14
- package/dist/components/UTCard/index.js +84 -118
- package/dist/components/UTCard/theme.js +13 -13
- package/dist/components/UTCard/types.js +1 -1
- package/dist/components/UTCarousel/components/Button/index.js +12 -11
- package/dist/components/UTCarousel/components/Legend/index.js +12 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +15 -14
- package/dist/components/UTCarousel/components/Slider/constants.js +5 -5
- package/dist/components/UTCarousel/components/Slider/index.js +203 -271
- package/dist/components/UTCarousel/components/Slider/layout.js +66 -92
- package/dist/components/UTCarousel/index.js +13 -13
- package/dist/components/UTCarousel/theme.js +6 -3
- package/dist/components/UTCheckList/constants.js +1 -1
- package/dist/components/UTCheckList/index.js +71 -91
- package/dist/components/UTCheckList/theme.js +34 -32
- package/dist/components/UTCheckbox/constants.js +2 -4
- package/dist/components/UTCheckbox/index.js +31 -42
- package/dist/components/UTCheckbox/theme.js +37 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +8 -7
- package/dist/components/UTConsumptionBar/constants.js +3 -3
- package/dist/components/UTConsumptionBar/index.js +52 -78
- package/dist/components/UTCuit/index.js +108 -131
- package/dist/components/UTCuit/theme.js +52 -53
- package/dist/components/UTDatePicker/components/Day/constants.js +1 -1
- package/dist/components/UTDatePicker/components/Day/index.js +11 -10
- package/dist/components/UTDatePicker/constants.js +21 -22
- package/dist/components/UTDatePicker/index.js +59 -100
- package/dist/components/UTDatePicker/theme.js +8 -4
- package/dist/components/UTDatePicker/types.js +1 -1
- package/dist/components/UTDatePicker/utils.js +4 -6
- package/dist/components/UTDialog/constants.js +2 -2
- package/dist/components/UTDialog/index.js +37 -35
- package/dist/components/UTDialog/theme.js +6 -3
- package/dist/components/UTDialog/types.js +1 -1
- package/dist/components/UTDotMenu/index.js +38 -59
- package/dist/components/UTEmojiPicker/constants.js +5 -5
- package/dist/components/UTEmojiPicker/index.js +44 -63
- package/dist/components/UTEmojiPicker/theme.js +6 -3
- package/dist/components/UTEmojiPicker/utils.js +24 -52
- package/dist/components/UTExternalLink/constants.js +2 -2
- package/dist/components/UTExternalLink/index.js +17 -13
- package/dist/components/UTExternalLink/theme.js +11 -7
- package/dist/components/UTFileInput/constants.js +2 -2
- package/dist/components/UTFileInput/index.js +6 -29
- package/dist/components/UTFileInput/layout.js +67 -95
- package/dist/components/UTIconButton/index.js +48 -70
- package/dist/components/UTIconButton/theme.js +6 -3
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +52 -56
- package/dist/components/UTImageRadio/constants.js +3 -3
- package/dist/components/UTImageRadio/index.js +38 -45
- package/dist/components/UTImageRadio/theme.js +13 -13
- package/dist/components/UTImageRadio/types.js +1 -1
- package/dist/components/UTImageRadio/utils.js +4 -6
- package/dist/components/UTLabel/constants.js +13 -11
- package/dist/components/UTLabel/index.js +17 -18
- package/dist/components/UTLabel/theme.js +19 -16
- package/dist/components/UTList/index.js +14 -16
- package/dist/components/UTLoading/index.js +14 -13
- package/dist/components/UTMap/components/GoogleMaps/constants.js +9 -10
- package/dist/components/UTMap/components/GoogleMaps/index.js +62 -89
- package/dist/components/UTMap/constants.js +6 -6
- package/dist/components/UTMap/index.js +162 -196
- package/dist/components/UTMap/types.js +4 -3
- package/dist/components/UTMap/utils.js +35 -46
- package/dist/components/UTMap/withGoogleMapScript.js +18 -14
- package/dist/components/UTMenu/index.js +51 -67
- package/dist/components/UTMenu/theme.js +8 -4
- package/dist/components/UTMenu/utils.js +10 -12
- package/dist/components/UTModal/constants.js +9 -9
- package/dist/components/UTModal/index.js +25 -28
- package/dist/components/UTModal/theme.js +6 -3
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -8
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTPagination/components/Pagination/index.js +27 -37
- package/dist/components/UTPagination/components/Pagination/utils.js +10 -15
- package/dist/components/UTPagination/constants.js +3 -3
- package/dist/components/UTPagination/index.js +15 -15
- package/dist/components/UTPagination/theme.js +6 -3
- package/dist/components/UTPanel/index.js +37 -42
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +12 -8
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +21 -17
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +62 -48
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +24 -24
- package/dist/components/UTPasswordField/index.js +25 -21
- package/dist/components/UTPasswordField/theme.js +6 -3
- package/dist/components/UTPhoneInput/constants.js +3 -3
- package/dist/components/UTPhoneInput/index.js +179 -203
- package/dist/components/UTPhoneInput/theme.js +79 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -21
- package/dist/components/UTPieChart/components/Legend/contants.js +3 -3
- package/dist/components/UTPieChart/components/Legend/index.js +26 -22
- package/dist/components/UTPieChart/constants.js +13 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +14 -31
- package/dist/components/UTPieChart/index.js +72 -74
- package/dist/components/UTPieChart/theme.js +6 -3
- package/dist/components/UTPieChart/utils.js +6 -3
- package/dist/components/UTProgressBar/constants.js +2 -2
- package/dist/components/UTProgressBar/index.js +14 -15
- package/dist/components/UTProgressBar/theme.js +6 -3
- package/dist/components/UTProgressBar/types.js +1 -1
- package/dist/components/UTRadioGroup/index.js +55 -81
- package/dist/components/UTRadioGroup/theme.js +54 -52
- package/dist/components/UTRating/components/Circle/index.js +40 -54
- package/dist/components/UTRating/components/Faces/assets/mood-confuzed.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-empty.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-happy.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-sad.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-smile.svg +3 -0
- package/dist/components/UTRating/components/Faces/constants.js +85 -0
- package/dist/components/UTRating/components/Faces/index.js +76 -0
- package/dist/components/UTRating/components/Faces/styles.module.scss +78 -0
- package/dist/components/UTRating/components/Star/index.js +35 -38
- package/dist/components/UTRating/constants.js +5 -4
- package/dist/components/UTRating/index.js +35 -46
- package/dist/components/UTRating/styles.module.scss +1 -0
- package/dist/components/UTRating/theme.js +52 -3
- package/dist/components/UTRipple/Ripple.js +21 -37
- package/dist/components/UTRipple/index.js +17 -35
- package/dist/components/UTSelect/components/Option/index.js +12 -11
- package/dist/components/UTSelect/constants.js +4 -4
- package/dist/components/UTSelect/index.js +62 -83
- package/dist/components/UTSelect/theme.js +9 -5
- package/dist/components/UTSelect/utils.js +5 -14
- package/dist/components/UTSidebar/components/ListOption/index.js +33 -47
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +7 -6
- package/dist/components/UTSidebar/components/LogosContainer/index.js +13 -12
- package/dist/components/UTSidebar/components/Option/constants.js +1 -1
- package/dist/components/UTSidebar/components/Option/index.js +27 -30
- package/dist/components/UTSidebar/components/Toggler/index.js +10 -9
- package/dist/components/UTSidebar/index.js +41 -51
- package/dist/components/UTSidebar/theme.js +6 -3
- package/dist/components/UTSidebar/types.js +5 -5
- package/dist/components/UTSkeleton/index.js +9 -34
- package/dist/components/UTStatus/constants.js +4 -4
- package/dist/components/UTStatus/index.js +15 -13
- package/dist/components/UTStatus/theme.js +70 -49
- package/dist/components/UTSwitch/constants.js +3 -3
- package/dist/components/UTSwitch/index.js +41 -55
- package/dist/components/UTSwitch/theme.js +6 -3
- package/dist/components/UTTable/components/ActionIcons/constants.js +1 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +46 -83
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +9 -10
- package/dist/components/UTTable/components/Cell/index.js +17 -21
- package/dist/components/UTTable/components/HeaderCell/constants.js +1 -1
- package/dist/components/UTTable/components/HeaderCell/index.js +22 -28
- package/dist/components/UTTable/components/HeaderCell/utils.js +5 -4
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -9
- package/dist/components/UTTable/components/ResponsiveCell/index.js +18 -18
- package/dist/components/UTTable/components/Status/index.js +17 -17
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -7
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +20 -30
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +10 -15
- package/dist/components/UTTable/components/TableFooter/constants.js +1 -1
- package/dist/components/UTTable/components/TableFooter/index.js +14 -13
- package/dist/components/UTTable/components/TableHeader/index.js +10 -9
- package/dist/components/UTTable/components/TableRow/constants.js +2 -4
- package/dist/components/UTTable/components/TableRow/index.js +78 -92
- package/dist/components/UTTable/constants.js +26 -24
- package/dist/components/UTTable/hook.js +13 -27
- package/dist/components/UTTable/index.js +125 -213
- package/dist/components/UTTable/theme.js +19 -18
- package/dist/components/UTTable/types.js +4 -4
- package/dist/components/UTTable/utils.js +80 -75
- package/dist/components/UTTabs/components/TooltipTab/index.js +19 -28
- package/dist/components/UTTabs/constants.js +4 -4
- package/dist/components/UTTabs/index.js +56 -84
- package/dist/components/UTTabs/theme.js +6 -3
- package/dist/components/UTTabs/utils.js +3 -2
- package/dist/components/UTTextArea/constants.js +2 -4
- package/dist/components/UTTextArea/index.js +22 -21
- package/dist/components/UTTextArea/theme.js +6 -3
- package/dist/components/UTTextInput/constants.js +1 -1
- package/dist/components/UTTextInput/index.js +136 -163
- package/dist/components/UTTextInput/theme.js +9 -5
- package/dist/components/UTThirdPartyCookieChecker/index.js +16 -19
- package/dist/components/UTToggle/components/ToggleOption/index.js +15 -15
- package/dist/components/UTToggle/index.js +24 -24
- package/dist/components/UTToggle/theme.js +6 -3
- package/dist/components/UTTooltip/index.js +22 -28
- package/dist/components/UTTooltip/theme.js +6 -3
- package/dist/components/UTTopbar/components/Notifications/index.js +10 -12
- package/dist/components/UTTopbar/components/UserMenu/index.js +14 -13
- package/dist/components/UTTopbar/index.js +27 -29
- package/dist/components/UTTopbar/theme.js +6 -3
- package/dist/components/UTTopbar/types.js +4 -4
- package/dist/components/UTTouchableWithoutFeedback/index.js +13 -25
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +33 -29
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +6 -5
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +7 -16
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +22 -45
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +30 -32
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +89 -94
- package/dist/components/UTVirtualizedList/constants.js +4 -4
- package/dist/components/UTVirtualizedList/index.js +25 -36
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +14 -17
- package/dist/components/UTWorkflowContainer/constants.js +3 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +5 -4
- package/dist/components/UTWorkflowContainer/index.js +31 -49
- package/dist/components/UTWorkflowContainer/theme.js +62 -54
- package/dist/components/UTWorkflowContainer/types.js +1 -1
- package/dist/components/WithLoading/index.js +9 -13
- package/dist/components/WithTheme/index.js +9 -15
- package/dist/components/WithTheme/layout.js +21 -26
- package/dist/components/WithTouch/index.js +11 -17
- package/dist/constants/UTTable.js +1 -1
- package/dist/index.js +58 -58
- package/dist/theme.js +8 -4
- package/dist/types/commonTypes.js +2 -2
- package/dist/types/consumptionTypes.js +2 -2
- package/dist/types/formTypes.js +3 -3
- package/dist/types/tableTypes.js +1 -1
- package/dist/utils/classesUtils.js +7 -13
- package/dist/utils/componentUtils.js +8 -10
- package/dist/utils/helperFunctions.js +6 -5
- package/dist/utils/shadowUtils.js +15 -12
- package/dist/utils/useScreenSize.js +1 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -2234
|
@@ -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(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
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", {
|
|
@@ -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,
|
|
@@ -4,6 +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
|
-
|
|
9
|
-
|
|
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(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
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
|
}));
|
|
@@ -6,21 +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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return options[displayAs] || options[BLOCK_KEY];
|
|
26
|
-
};
|
|
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
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const displayOptions = displayAs => options[displayAs] || options[BLOCK_KEY];
|
|
23
|
+
exports.displayOptions = displayOptions;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -16,84 +15,78 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
|
16
15
|
var _constants = require("./constants");
|
|
17
16
|
var _utils = require("./utils");
|
|
18
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
flatBarData
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return linearReferences.forEach(function (_ref6) {
|
|
74
|
-
var check = _ref6.check,
|
|
75
|
-
id = _ref6.id;
|
|
76
|
-
return check(item) && referencesToShow.add(id);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
levels.forEach(function (_ref7) {
|
|
80
|
-
var id = _ref7.id;
|
|
21
|
+
const Legend = _ref => {
|
|
22
|
+
let {
|
|
23
|
+
title,
|
|
24
|
+
references,
|
|
25
|
+
flatData,
|
|
26
|
+
displayAs = 'block',
|
|
27
|
+
style,
|
|
28
|
+
labels,
|
|
29
|
+
classes,
|
|
30
|
+
buttonProps
|
|
31
|
+
} = _ref;
|
|
32
|
+
const [showLegend, setShowLegend] = (0, _react.useState)(false);
|
|
33
|
+
const {
|
|
34
|
+
referencesModalTitle,
|
|
35
|
+
referencesModalButton,
|
|
36
|
+
showReferencesLabel
|
|
37
|
+
} = labels || {};
|
|
38
|
+
const {
|
|
39
|
+
bar: barReferences = [],
|
|
40
|
+
linear: linearReferences = [],
|
|
41
|
+
levels: levelsReferences = []
|
|
42
|
+
} = references || {};
|
|
43
|
+
const {
|
|
44
|
+
bar: flatBarData = [],
|
|
45
|
+
linear: flatLinearData = [],
|
|
46
|
+
levels = []
|
|
47
|
+
} = flatData || {};
|
|
48
|
+
const {
|
|
49
|
+
Component: Wrapper,
|
|
50
|
+
withButton
|
|
51
|
+
} = (0, _constants.displayOptions)(displayAs);
|
|
52
|
+
const getReferencesToShow = () => {
|
|
53
|
+
let referencesToShow = new Set();
|
|
54
|
+
flatBarData.forEach(item => barReferences.forEach(_ref2 => {
|
|
55
|
+
let {
|
|
56
|
+
check,
|
|
57
|
+
id
|
|
58
|
+
} = _ref2;
|
|
59
|
+
return check(item) && referencesToShow.add(id);
|
|
60
|
+
}));
|
|
61
|
+
flatLinearData.forEach(item => linearReferences.forEach(_ref3 => {
|
|
62
|
+
let {
|
|
63
|
+
check,
|
|
64
|
+
id
|
|
65
|
+
} = _ref3;
|
|
66
|
+
return check(item) && referencesToShow.add(id);
|
|
67
|
+
}));
|
|
68
|
+
levels.forEach(_ref4 => {
|
|
69
|
+
let {
|
|
70
|
+
id
|
|
71
|
+
} = _ref4;
|
|
81
72
|
return referencesToShow.add(id);
|
|
82
73
|
});
|
|
83
74
|
referencesToShow = Array.from(referencesToShow);
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
const filterFunction = _ref5 => {
|
|
76
|
+
let {
|
|
77
|
+
id
|
|
78
|
+
} = _ref5;
|
|
86
79
|
return referencesToShow.includes(id);
|
|
87
80
|
};
|
|
88
|
-
|
|
89
|
-
return getOrderedLegend(levelsReferences.filter(filterFunction), linearReferences.filter(filterFunction), barReferences.filter(filterFunction)).filter(
|
|
90
|
-
return !(0, _array.isEmpty)(row);
|
|
91
|
-
});
|
|
81
|
+
const getOrderedLegend = (0, _utils.orderLegend)(references === null || references === void 0 ? void 0 : references.orderFunction);
|
|
82
|
+
return getOrderedLegend(levelsReferences.filter(filterFunction), linearReferences.filter(filterFunction), barReferences.filter(filterFunction)).filter(row => !(0, _array.isEmpty)(row));
|
|
92
83
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
const referenceRenderer = reference => {
|
|
85
|
+
const {
|
|
86
|
+
label,
|
|
87
|
+
className,
|
|
88
|
+
CustomIcon
|
|
89
|
+
} = reference;
|
|
97
90
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
98
91
|
className: _stylesModule.default["item".concat(displayAs)],
|
|
99
92
|
key: label
|
|
@@ -103,19 +96,15 @@ var Legend = function Legend(_ref) {
|
|
|
103
96
|
className: "".concat(_stylesModule.default.itemLabel, " ").concat(classes.legendItemLabel)
|
|
104
97
|
}, label));
|
|
105
98
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
const referencesToShow = getReferencesToShow(flatData);
|
|
100
|
+
const hasReferences = !(0, _array.isEmpty)(referencesToShow);
|
|
101
|
+
const wrapperProps = displayAs === _constants.MODAL_KEY ? {
|
|
109
102
|
acceptButton: {
|
|
110
|
-
onClick:
|
|
111
|
-
return setShowLegend(false);
|
|
112
|
-
},
|
|
103
|
+
onClick: () => setShowLegend(false),
|
|
113
104
|
text: referencesModalButton || ''
|
|
114
105
|
},
|
|
115
106
|
isOpen: showLegend,
|
|
116
|
-
onRequestClose:
|
|
117
|
-
return setShowLegend(false);
|
|
118
|
-
},
|
|
107
|
+
onRequestClose: () => setShowLegend(false),
|
|
119
108
|
title: referencesModalTitle,
|
|
120
109
|
withCloseButton: true
|
|
121
110
|
} : {};
|
|
@@ -131,16 +120,10 @@ var Legend = function Legend(_ref) {
|
|
|
131
120
|
},
|
|
132
121
|
disabled: !hasReferences,
|
|
133
122
|
Icon: _InfoOutlined.default,
|
|
134
|
-
onClick:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
139
|
-
className: _stylesModule.default["row".concat(displayAs)]
|
|
140
|
-
}, row.map(function (item) {
|
|
141
|
-
return referenceRenderer(item);
|
|
142
|
-
}));
|
|
143
|
-
})));
|
|
123
|
+
onClick: () => setShowLegend(true)
|
|
124
|
+
}, buttonProps), showReferencesLabel), /*#__PURE__*/_react.default.createElement(Wrapper, wrapperProps, referencesToShow.map(row => /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
className: _stylesModule.default["row".concat(displayAs)]
|
|
126
|
+
}, row.map(item => referenceRenderer(item))))));
|
|
144
127
|
};
|
|
145
128
|
Legend.propTypes = {
|
|
146
129
|
buttonProps: _types.buttonPropsTypes,
|
|
@@ -4,8 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.orderLegend = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return legendOrderFunction ? legendOrderFunction(levels, linear, bar) : [levels, linear, bar];
|
|
10
|
-
};
|
|
11
|
-
};
|
|
7
|
+
const orderLegend = legendOrderFunction => (levels, linear, bar) => legendOrderFunction ? legendOrderFunction(levels, linear, bar) : [levels, linear, bar];
|
|
8
|
+
exports.orderLegend = orderLegend;
|
|
@@ -11,18 +11,21 @@ var _commonTypes = require("../../../../types/commonTypes");
|
|
|
11
11
|
var _utils = require("./utils");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
classes =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
const Levels = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
levels,
|
|
17
|
+
yAxis,
|
|
18
|
+
graphXStart,
|
|
19
|
+
graphXEnd,
|
|
20
|
+
classes = {}
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement("g", null, levels.map(_ref2 => {
|
|
23
|
+
let {
|
|
24
|
+
color,
|
|
25
|
+
value,
|
|
26
|
+
type
|
|
27
|
+
} = _ref2;
|
|
28
|
+
const yValue = yAxis(value);
|
|
26
29
|
return /*#__PURE__*/_react.default.createElement("line", _extends({
|
|
27
30
|
x1: graphXStart,
|
|
28
31
|
x2: graphXEnd,
|