@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.
Files changed (283) hide show
  1. package/dist/components/EnergyThemeProvider/index.js +12 -34
  2. package/dist/components/Loading/constants.js +1 -1
  3. package/dist/components/Loading/index.js +12 -10
  4. package/dist/components/Loading/theme.js +6 -3
  5. package/dist/components/UTAlert/AlertHandler.js +74 -99
  6. package/dist/components/UTAlert/index.js +64 -85
  7. package/dist/components/UTAlert/theme.js +34 -32
  8. package/dist/components/UTAttachment/components/Preview/index.js +7 -7
  9. package/dist/components/UTAttachment/constants.js +6 -6
  10. package/dist/components/UTAttachment/index.js +158 -248
  11. package/dist/components/UTAttachment/layout.js +25 -25
  12. package/dist/components/UTAttachment/theme.js +6 -3
  13. package/dist/components/UTAttachment/utils.js +44 -117
  14. package/dist/components/UTAutocomplete/components/ListBox/index.js +12 -19
  15. package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -12
  16. package/dist/components/UTAutocomplete/constants.js +11 -11
  17. package/dist/components/UTAutocomplete/index.js +53 -92
  18. package/dist/components/UTAutocomplete/theme.js +9 -5
  19. package/dist/components/UTAvatar/constants.js +1 -1
  20. package/dist/components/UTAvatar/index.js +17 -15
  21. package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +21 -20
  22. package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +2 -1
  23. package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +20 -20
  24. package/dist/components/UTBarChart/components/Bars/constants.js +3 -3
  25. package/dist/components/UTBarChart/components/Bars/index.js +69 -78
  26. package/dist/components/UTBarChart/components/Legend/constants.js +14 -17
  27. package/dist/components/UTBarChart/components/Legend/index.js +74 -91
  28. package/dist/components/UTBarChart/components/Legend/utils.js +2 -5
  29. package/dist/components/UTBarChart/components/Levels/index.js +15 -12
  30. package/dist/components/UTBarChart/components/Levels/utils.js +26 -27
  31. package/dist/components/UTBarChart/components/LinearPlot/constants.js +2 -2
  32. package/dist/components/UTBarChart/components/LinearPlot/index.js +24 -18
  33. package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -39
  34. package/dist/components/UTBarChart/components/Pagination/constants.js +1 -1
  35. package/dist/components/UTBarChart/components/Pagination/index.js +19 -22
  36. package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +20 -30
  37. package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -2
  38. package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -17
  39. package/dist/components/UTBarChart/components/XAxis/constants.js +1 -1
  40. package/dist/components/UTBarChart/components/XAxis/index.js +53 -63
  41. package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -9
  42. package/dist/components/UTBarChart/components/YAxis/constants.js +1 -1
  43. package/dist/components/UTBarChart/components/YAxis/index.js +29 -35
  44. package/dist/components/UTBarChart/components/YAxis/utils.js +6 -6
  45. package/dist/components/UTBarChart/constants.js +4 -4
  46. package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +22 -38
  47. package/dist/components/UTBarChart/index.js +151 -164
  48. package/dist/components/UTBarChart/theme.js +6 -3
  49. package/dist/components/UTBarChart/types.js +9 -9
  50. package/dist/components/UTBarChart/utils.js +118 -111
  51. package/dist/components/UTBreadcrumbs/constants.js +22 -24
  52. package/dist/components/UTBreadcrumbs/index.js +75 -99
  53. package/dist/components/UTBreadcrumbs/theme.js +6 -3
  54. package/dist/components/UTButton/constants.js +11 -11
  55. package/dist/components/UTButton/index.js +27 -29
  56. package/dist/components/UTButton/theme.js +26 -24
  57. package/dist/components/UTCBUInput/index.js +35 -38
  58. package/dist/components/UTCBUInput/theme.js +6 -3
  59. package/dist/components/UTCaptcha/index.js +18 -43
  60. package/dist/components/UTCard/components/UTCardFooter/index.js +14 -14
  61. package/dist/components/UTCard/index.js +84 -118
  62. package/dist/components/UTCard/theme.js +13 -13
  63. package/dist/components/UTCard/types.js +1 -1
  64. package/dist/components/UTCarousel/components/Button/index.js +12 -11
  65. package/dist/components/UTCarousel/components/Legend/index.js +12 -13
  66. package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +15 -14
  67. package/dist/components/UTCarousel/components/Slider/constants.js +5 -5
  68. package/dist/components/UTCarousel/components/Slider/index.js +203 -271
  69. package/dist/components/UTCarousel/components/Slider/layout.js +66 -92
  70. package/dist/components/UTCarousel/index.js +13 -13
  71. package/dist/components/UTCarousel/theme.js +6 -3
  72. package/dist/components/UTCheckList/constants.js +1 -1
  73. package/dist/components/UTCheckList/index.js +71 -91
  74. package/dist/components/UTCheckList/theme.js +34 -32
  75. package/dist/components/UTCheckbox/constants.js +2 -4
  76. package/dist/components/UTCheckbox/index.js +31 -42
  77. package/dist/components/UTCheckbox/theme.js +37 -35
  78. package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +8 -7
  79. package/dist/components/UTConsumptionBar/constants.js +3 -3
  80. package/dist/components/UTConsumptionBar/index.js +52 -78
  81. package/dist/components/UTCuit/index.js +108 -131
  82. package/dist/components/UTCuit/theme.js +52 -53
  83. package/dist/components/UTDatePicker/components/Day/constants.js +1 -1
  84. package/dist/components/UTDatePicker/components/Day/index.js +11 -10
  85. package/dist/components/UTDatePicker/constants.js +21 -22
  86. package/dist/components/UTDatePicker/index.js +59 -100
  87. package/dist/components/UTDatePicker/theme.js +8 -4
  88. package/dist/components/UTDatePicker/types.js +1 -1
  89. package/dist/components/UTDatePicker/utils.js +4 -6
  90. package/dist/components/UTDialog/constants.js +2 -2
  91. package/dist/components/UTDialog/index.js +37 -35
  92. package/dist/components/UTDialog/theme.js +6 -3
  93. package/dist/components/UTDialog/types.js +1 -1
  94. package/dist/components/UTDotMenu/index.js +38 -59
  95. package/dist/components/UTEmojiPicker/constants.js +5 -5
  96. package/dist/components/UTEmojiPicker/index.js +44 -63
  97. package/dist/components/UTEmojiPicker/theme.js +6 -3
  98. package/dist/components/UTEmojiPicker/utils.js +24 -52
  99. package/dist/components/UTExternalLink/constants.js +2 -2
  100. package/dist/components/UTExternalLink/index.js +17 -13
  101. package/dist/components/UTExternalLink/theme.js +11 -7
  102. package/dist/components/UTFileInput/constants.js +2 -2
  103. package/dist/components/UTFileInput/index.js +6 -29
  104. package/dist/components/UTFileInput/layout.js +67 -95
  105. package/dist/components/UTIconButton/index.js +48 -70
  106. package/dist/components/UTIconButton/theme.js +6 -3
  107. package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +52 -56
  108. package/dist/components/UTImageRadio/constants.js +3 -3
  109. package/dist/components/UTImageRadio/index.js +38 -45
  110. package/dist/components/UTImageRadio/theme.js +13 -13
  111. package/dist/components/UTImageRadio/types.js +1 -1
  112. package/dist/components/UTImageRadio/utils.js +4 -6
  113. package/dist/components/UTLabel/constants.js +13 -11
  114. package/dist/components/UTLabel/index.js +17 -18
  115. package/dist/components/UTLabel/theme.js +19 -16
  116. package/dist/components/UTList/index.js +14 -16
  117. package/dist/components/UTLoading/index.js +14 -13
  118. package/dist/components/UTMap/components/GoogleMaps/constants.js +9 -10
  119. package/dist/components/UTMap/components/GoogleMaps/index.js +62 -89
  120. package/dist/components/UTMap/constants.js +6 -6
  121. package/dist/components/UTMap/index.js +162 -196
  122. package/dist/components/UTMap/types.js +4 -3
  123. package/dist/components/UTMap/utils.js +35 -46
  124. package/dist/components/UTMap/withGoogleMapScript.js +18 -14
  125. package/dist/components/UTMenu/index.js +51 -67
  126. package/dist/components/UTMenu/theme.js +8 -4
  127. package/dist/components/UTMenu/utils.js +10 -12
  128. package/dist/components/UTModal/constants.js +9 -9
  129. package/dist/components/UTModal/index.js +25 -28
  130. package/dist/components/UTModal/theme.js +6 -3
  131. package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -8
  132. package/dist/components/UTPagination/components/PageSizeSelector/utils.js +9 -14
  133. package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +11 -10
  134. package/dist/components/UTPagination/components/Pagination/index.js +27 -37
  135. package/dist/components/UTPagination/components/Pagination/utils.js +10 -15
  136. package/dist/components/UTPagination/constants.js +3 -3
  137. package/dist/components/UTPagination/index.js +15 -15
  138. package/dist/components/UTPagination/theme.js +6 -3
  139. package/dist/components/UTPanel/index.js +37 -42
  140. package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +12 -8
  141. package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +21 -17
  142. package/dist/components/UTPasswordField/components/PasswordValidations/index.js +62 -48
  143. package/dist/components/UTPasswordField/components/PasswordWarning/index.js +24 -24
  144. package/dist/components/UTPasswordField/index.js +25 -21
  145. package/dist/components/UTPasswordField/theme.js +6 -3
  146. package/dist/components/UTPhoneInput/constants.js +3 -3
  147. package/dist/components/UTPhoneInput/index.js +179 -203
  148. package/dist/components/UTPhoneInput/theme.js +79 -77
  149. package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -4
  150. package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -21
  151. package/dist/components/UTPieChart/components/Legend/contants.js +3 -3
  152. package/dist/components/UTPieChart/components/Legend/index.js +26 -22
  153. package/dist/components/UTPieChart/constants.js +13 -13
  154. package/dist/components/UTPieChart/hooks/use-animated-value/index.js +14 -31
  155. package/dist/components/UTPieChart/index.js +72 -74
  156. package/dist/components/UTPieChart/theme.js +6 -3
  157. package/dist/components/UTPieChart/utils.js +6 -3
  158. package/dist/components/UTProgressBar/constants.js +2 -2
  159. package/dist/components/UTProgressBar/index.js +14 -15
  160. package/dist/components/UTProgressBar/theme.js +6 -3
  161. package/dist/components/UTProgressBar/types.js +1 -1
  162. package/dist/components/UTRadioGroup/index.js +55 -81
  163. package/dist/components/UTRadioGroup/theme.js +54 -52
  164. package/dist/components/UTRating/components/Circle/index.js +40 -54
  165. package/dist/components/UTRating/components/Faces/assets/mood-confuzed.svg +3 -0
  166. package/dist/components/UTRating/components/Faces/assets/mood-empty.svg +3 -0
  167. package/dist/components/UTRating/components/Faces/assets/mood-happy.svg +3 -0
  168. package/dist/components/UTRating/components/Faces/assets/mood-sad.svg +3 -0
  169. package/dist/components/UTRating/components/Faces/assets/mood-smile.svg +3 -0
  170. package/dist/components/UTRating/components/Faces/constants.js +85 -0
  171. package/dist/components/UTRating/components/Faces/index.js +76 -0
  172. package/dist/components/UTRating/components/Faces/styles.module.scss +78 -0
  173. package/dist/components/UTRating/components/Star/index.js +35 -38
  174. package/dist/components/UTRating/constants.js +5 -4
  175. package/dist/components/UTRating/index.js +35 -46
  176. package/dist/components/UTRating/styles.module.scss +1 -0
  177. package/dist/components/UTRating/theme.js +52 -3
  178. package/dist/components/UTRipple/Ripple.js +21 -37
  179. package/dist/components/UTRipple/index.js +17 -35
  180. package/dist/components/UTSelect/components/Option/index.js +12 -11
  181. package/dist/components/UTSelect/constants.js +4 -4
  182. package/dist/components/UTSelect/index.js +62 -83
  183. package/dist/components/UTSelect/theme.js +9 -5
  184. package/dist/components/UTSelect/utils.js +5 -14
  185. package/dist/components/UTSidebar/components/ListOption/index.js +33 -47
  186. package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +7 -6
  187. package/dist/components/UTSidebar/components/LogosContainer/index.js +13 -12
  188. package/dist/components/UTSidebar/components/Option/constants.js +1 -1
  189. package/dist/components/UTSidebar/components/Option/index.js +27 -30
  190. package/dist/components/UTSidebar/components/Toggler/index.js +10 -9
  191. package/dist/components/UTSidebar/index.js +41 -51
  192. package/dist/components/UTSidebar/theme.js +6 -3
  193. package/dist/components/UTSidebar/types.js +5 -5
  194. package/dist/components/UTSkeleton/index.js +9 -34
  195. package/dist/components/UTStatus/constants.js +4 -4
  196. package/dist/components/UTStatus/index.js +15 -13
  197. package/dist/components/UTStatus/theme.js +70 -49
  198. package/dist/components/UTSwitch/constants.js +3 -3
  199. package/dist/components/UTSwitch/index.js +41 -55
  200. package/dist/components/UTSwitch/theme.js +6 -3
  201. package/dist/components/UTTable/components/ActionIcons/constants.js +1 -1
  202. package/dist/components/UTTable/components/ActionIcons/index.js +46 -83
  203. package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +9 -10
  204. package/dist/components/UTTable/components/Cell/index.js +17 -21
  205. package/dist/components/UTTable/components/HeaderCell/constants.js +1 -1
  206. package/dist/components/UTTable/components/HeaderCell/index.js +22 -28
  207. package/dist/components/UTTable/components/HeaderCell/utils.js +5 -4
  208. package/dist/components/UTTable/components/PrimaryAction/index.js +11 -9
  209. package/dist/components/UTTable/components/ResponsiveCell/index.js +18 -18
  210. package/dist/components/UTTable/components/Status/index.js +17 -17
  211. package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -7
  212. package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +9 -14
  213. package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +11 -10
  214. package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +20 -30
  215. package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +10 -15
  216. package/dist/components/UTTable/components/TableFooter/constants.js +1 -1
  217. package/dist/components/UTTable/components/TableFooter/index.js +14 -13
  218. package/dist/components/UTTable/components/TableHeader/index.js +10 -9
  219. package/dist/components/UTTable/components/TableRow/constants.js +2 -4
  220. package/dist/components/UTTable/components/TableRow/index.js +78 -92
  221. package/dist/components/UTTable/constants.js +26 -24
  222. package/dist/components/UTTable/hook.js +13 -27
  223. package/dist/components/UTTable/index.js +125 -213
  224. package/dist/components/UTTable/theme.js +19 -18
  225. package/dist/components/UTTable/types.js +4 -4
  226. package/dist/components/UTTable/utils.js +80 -75
  227. package/dist/components/UTTabs/components/TooltipTab/index.js +19 -28
  228. package/dist/components/UTTabs/constants.js +4 -4
  229. package/dist/components/UTTabs/index.js +56 -84
  230. package/dist/components/UTTabs/theme.js +6 -3
  231. package/dist/components/UTTabs/utils.js +3 -2
  232. package/dist/components/UTTextArea/constants.js +2 -4
  233. package/dist/components/UTTextArea/index.js +22 -21
  234. package/dist/components/UTTextArea/theme.js +6 -3
  235. package/dist/components/UTTextInput/constants.js +1 -1
  236. package/dist/components/UTTextInput/index.js +136 -163
  237. package/dist/components/UTTextInput/theme.js +9 -5
  238. package/dist/components/UTThirdPartyCookieChecker/index.js +16 -19
  239. package/dist/components/UTToggle/components/ToggleOption/index.js +15 -15
  240. package/dist/components/UTToggle/index.js +24 -24
  241. package/dist/components/UTToggle/theme.js +6 -3
  242. package/dist/components/UTTooltip/index.js +22 -28
  243. package/dist/components/UTTooltip/theme.js +6 -3
  244. package/dist/components/UTTopbar/components/Notifications/index.js +10 -12
  245. package/dist/components/UTTopbar/components/UserMenu/index.js +14 -13
  246. package/dist/components/UTTopbar/index.js +27 -29
  247. package/dist/components/UTTopbar/theme.js +6 -3
  248. package/dist/components/UTTopbar/types.js +4 -4
  249. package/dist/components/UTTouchableWithoutFeedback/index.js +13 -25
  250. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -2
  251. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +33 -29
  252. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +6 -5
  253. package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -6
  254. package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +7 -16
  255. package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +22 -45
  256. package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +30 -32
  257. package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +89 -94
  258. package/dist/components/UTVirtualizedList/constants.js +4 -4
  259. package/dist/components/UTVirtualizedList/index.js +25 -36
  260. package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +14 -17
  261. package/dist/components/UTWorkflowContainer/constants.js +3 -3
  262. package/dist/components/UTWorkflowContainer/hooks/use-previous.js +5 -4
  263. package/dist/components/UTWorkflowContainer/index.js +31 -49
  264. package/dist/components/UTWorkflowContainer/theme.js +62 -54
  265. package/dist/components/UTWorkflowContainer/types.js +1 -1
  266. package/dist/components/WithLoading/index.js +9 -13
  267. package/dist/components/WithTheme/index.js +9 -15
  268. package/dist/components/WithTheme/layout.js +21 -26
  269. package/dist/components/WithTouch/index.js +11 -17
  270. package/dist/constants/UTTable.js +1 -1
  271. package/dist/index.js +58 -58
  272. package/dist/theme.js +8 -4
  273. package/dist/types/commonTypes.js +2 -2
  274. package/dist/types/consumptionTypes.js +2 -2
  275. package/dist/types/formTypes.js +3 -3
  276. package/dist/types/tableTypes.js +1 -1
  277. package/dist/utils/classesUtils.js +7 -13
  278. package/dist/utils/componentUtils.js +8 -10
  279. package/dist/utils/helperFunctions.js +6 -5
  280. package/dist/utils/shadowUtils.js +15 -12
  281. package/dist/utils/useScreenSize.js +1 -1
  282. package/package.json +2 -2
  283. package/CHANGELOG.md +0 -2234
@@ -4,30 +4,29 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getLineConfiguration = void 0;
7
- var getLineConfiguration = exports.getLineConfiguration = function getLineConfiguration(type, classes) {
8
- return {
9
- solid: {
10
- fill: 'none',
11
- strokeWidth: '1',
12
- className: classes.solidLevel
13
- },
14
- dashed: {
15
- fill: 'none',
16
- strokeWidth: '1',
17
- strokeDasharray: '2,2',
18
- className: classes.dashedLevel
19
- },
20
- dotted: {
21
- fill: 'none',
22
- strokeWidth: '2',
23
- strokeDasharray: '4',
24
- className: classes.dottedLevel
25
- },
26
- grid: {
27
- fill: 'none',
28
- strokeWidth: '1',
29
- strokeDasharray: '5',
30
- className: classes.gridLine
31
- }
32
- }[type];
33
- };
7
+ const getLineConfiguration = (type, classes) => ({
8
+ solid: {
9
+ fill: 'none',
10
+ strokeWidth: '1',
11
+ className: classes.solidLevel
12
+ },
13
+ dashed: {
14
+ fill: 'none',
15
+ strokeWidth: '1',
16
+ strokeDasharray: '2,2',
17
+ className: classes.dashedLevel
18
+ },
19
+ dotted: {
20
+ fill: 'none',
21
+ strokeWidth: '2',
22
+ strokeDasharray: '4',
23
+ className: classes.dottedLevel
24
+ },
25
+ grid: {
26
+ fill: 'none',
27
+ strokeWidth: '1',
28
+ strokeDasharray: '5',
29
+ className: classes.gridLine
30
+ }
31
+ })[type];
32
+ exports.getLineConfiguration = getLineConfiguration;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.MARKER_TYPES = exports.DEFAULT_MARKER_SIZE = void 0;
7
- var DEFAULT_MARKER_SIZE = exports.DEFAULT_MARKER_SIZE = 4;
8
- var MARKER_TYPES = exports.MARKER_TYPES = {
7
+ const DEFAULT_MARKER_SIZE = exports.DEFAULT_MARKER_SIZE = 4;
8
+ const MARKER_TYPES = exports.MARKER_TYPES = {
9
9
  DOT: 'dot'
10
10
  };
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -10,28 +9,35 @@ var d3 = _interopRequireWildcard(require("d3"));
10
9
  var _propTypes = require("prop-types");
11
10
  var _types = require("../../types");
12
11
  var _utils = require("./utils");
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
- 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
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
15
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
- var LinearPlot = function LinearPlot(_ref) {
18
- var data = _ref.data,
19
- barWidth = _ref.barWidth,
20
- yAxis = _ref.yAxis,
21
- xAxis = _ref.xAxis,
22
- type = _ref.type,
23
- color = _ref.color,
24
- customLineProps = _ref.customLineProps,
25
- markers = _ref.markers;
26
- var lineGenerator = d3.line().x(function (_ref2) {
27
- var xCoordinate = _ref2.xCoordinate;
16
+ const LinearPlot = _ref => {
17
+ let {
18
+ data,
19
+ barWidth,
20
+ yAxis,
21
+ xAxis,
22
+ type,
23
+ color,
24
+ customLineProps,
25
+ markers
26
+ } = _ref;
27
+ const lineGenerator = d3.line().x(_ref2 => {
28
+ let {
29
+ xCoordinate
30
+ } = _ref2;
28
31
  return xAxis(xCoordinate) + barWidth / 2;
29
- }).y(function (_ref3) {
30
- var value = _ref3.value;
32
+ }).y(_ref3 => {
33
+ let {
34
+ value
35
+ } = _ref3;
31
36
  return yAxis(value);
32
37
  });
33
- var _getLineConfiguration = (0, _utils.getLineConfiguration)(type, lineGenerator),
34
- props = _getLineConfiguration.props;
38
+ const {
39
+ props
40
+ } = (0, _utils.getLineConfiguration)(type, lineGenerator);
35
41
  return /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("path", _extends({
36
42
  d: lineGenerator(data),
37
43
  stroke: color
@@ -7,42 +7,42 @@ exports.getMarkers = exports.getLineConfiguration = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _constants = require("./constants");
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- var DEFAULT_LINE_TYPE = 'solid';
11
- var getLineConfiguration = exports.getLineConfiguration = function getLineConfiguration(type) {
12
- return {
13
- solid: {
14
- props: {
15
- fill: 'none',
16
- strokeWidth: '1'
17
- }
18
- },
19
- dashed: {
20
- props: {
21
- fill: 'none',
22
- strokeWidth: '1',
23
- strokeDasharray: '2,2'
24
- }
25
- },
26
- custom: {}
27
- }[type || DEFAULT_LINE_TYPE];
28
- };
29
- var getMarkers = exports.getMarkers = function getMarkers(data, xAxis, yAxis, barWidth, color, markersConfig) {
30
- return data.map(function (_ref) {
31
- var xCoordinate = _ref.xCoordinate,
32
- value = _ref.value;
33
- var x = xAxis(xCoordinate) + barWidth / 2;
34
- var y = yAxis(value);
35
- var size = (markersConfig.size || _constants.DEFAULT_MARKER_SIZE) / 2;
36
- return markersConfig.type === _constants.MARKER_TYPES.DOT && /*#__PURE__*/_react.default.createElement("svg", {
37
- x: x - size,
38
- y: y - size,
39
- height: 2 * size,
40
- width: 2 * size
41
- }, /*#__PURE__*/_react.default.createElement("circle", {
42
- cx: size,
43
- cy: size,
44
- r: size,
45
- fill: color
46
- }));
47
- });
48
- };
10
+ const DEFAULT_LINE_TYPE = 'solid';
11
+ const getLineConfiguration = type => ({
12
+ solid: {
13
+ props: {
14
+ fill: 'none',
15
+ strokeWidth: '1'
16
+ }
17
+ },
18
+ dashed: {
19
+ props: {
20
+ fill: 'none',
21
+ strokeWidth: '1',
22
+ strokeDasharray: '2,2'
23
+ }
24
+ },
25
+ custom: {}
26
+ })[type || DEFAULT_LINE_TYPE];
27
+ exports.getLineConfiguration = getLineConfiguration;
28
+ const getMarkers = (data, xAxis, yAxis, barWidth, color, markersConfig) => data.map(_ref => {
29
+ let {
30
+ xCoordinate,
31
+ value
32
+ } = _ref;
33
+ const x = xAxis(xCoordinate) + barWidth / 2;
34
+ const y = yAxis(value);
35
+ const size = (markersConfig.size || _constants.DEFAULT_MARKER_SIZE) / 2;
36
+ return markersConfig.type === _constants.MARKER_TYPES.DOT && /*#__PURE__*/_react.default.createElement("svg", {
37
+ x: x - size,
38
+ y: y - size,
39
+ height: 2 * size,
40
+ width: 2 * size
41
+ }, /*#__PURE__*/_react.default.createElement("circle", {
42
+ cx: size,
43
+ cy: size,
44
+ r: size,
45
+ fill: color
46
+ }));
47
+ });
48
+ exports.getMarkers = getMarkers;
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.BUTTONS_SIZE = void 0;
7
- var BUTTONS_SIZE = exports.BUTTONS_SIZE = 48;
7
+ const BUTTONS_SIZE = exports.BUTTONS_SIZE = 48;
@@ -13,25 +13,26 @@ var _UTButton = _interopRequireDefault(require("../../../UTButton"));
13
13
  var _constants = require("./constants");
14
14
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- var Pagination = function Pagination(_ref) {
16
+ const Pagination = _ref => {
17
17
  var _anchor$current, _anchor$current$getBo;
18
- var anchor = _ref.anchor,
19
- classes = _ref.classes,
20
- currentPage = _ref.currentPage,
21
- graphXEnd = _ref.graphXEnd,
22
- graphXStart = _ref.graphXStart,
23
- parentYPosition = _ref.parentYPosition,
24
- setCurrentPage = _ref.setCurrentPage,
25
- totalPages = _ref.totalPages;
26
- var _ref2 = ((_anchor$current = anchor.current) === null || _anchor$current === void 0 || (_anchor$current$getBo = _anchor$current.getBoundingClientRect) === null || _anchor$current$getBo === void 0 ? void 0 : _anchor$current$getBo.call(_anchor$current)) || {},
27
- _ref2$y = _ref2.y,
28
- y = _ref2$y === void 0 ? 0 : _ref2$y,
29
- _ref2$height = _ref2.height,
30
- height = _ref2$height === void 0 ? 0 : _ref2$height;
31
- var top = y - parentYPosition + height / 2 - _constants.BUTTONS_SIZE / 2 || 0;
18
+ let {
19
+ anchor,
20
+ classes,
21
+ currentPage,
22
+ graphXEnd,
23
+ graphXStart,
24
+ parentYPosition,
25
+ setCurrentPage,
26
+ totalPages
27
+ } = _ref;
28
+ const {
29
+ y = 0,
30
+ height = 0
31
+ } = ((_anchor$current = anchor.current) === null || _anchor$current === void 0 || (_anchor$current$getBo = _anchor$current.getBoundingClientRect) === null || _anchor$current$getBo === void 0 ? void 0 : _anchor$current$getBo.call(_anchor$current)) || {};
32
+ const top = y - parentYPosition + height / 2 - _constants.BUTTONS_SIZE / 2 || 0;
32
33
  return /*#__PURE__*/_react.default.createElement("div", {
33
34
  style: {
34
- top: top,
35
+ top,
35
36
  left: graphXStart - 30,
36
37
  width: graphXEnd - graphXStart + 60,
37
38
  height: _constants.BUTTONS_SIZE
@@ -44,9 +45,7 @@ var Pagination = function Pagination(_ref) {
44
45
  },
45
46
  disabled: !currentPage,
46
47
  Icon: _ChevronLeft.default,
47
- onClick: function onClick() {
48
- return setCurrentPage(currentPage - 1);
49
- },
48
+ onClick: () => setCurrentPage(currentPage - 1),
50
49
  variant: "text"
51
50
  }), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
52
51
  classNames: {
@@ -55,9 +54,7 @@ var Pagination = function Pagination(_ref) {
55
54
  },
56
55
  disabled: currentPage + 1 === totalPages,
57
56
  Icon: _ChevronRight.default,
58
- onClick: function onClick() {
59
- return setCurrentPage(currentPage + 1);
60
- },
57
+ onClick: () => setCurrentPage(currentPage + 1),
61
58
  variant: "text"
62
59
  }));
63
60
  };
@@ -1,40 +1,32 @@
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
  });
7
6
  exports.default = void 0;
8
7
  var _react = _interopRequireWildcard(require("react"));
9
8
  var _propTypes = require("prop-types");
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(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; }
9
+ 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); }
10
+ 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
11
  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); }
13
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
- 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."); }
15
- 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); }
16
- 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; }
17
- 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; } }
18
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
- var AxisElement = function AxisElement(_ref) {
12
+ const AxisElement = _ref => {
20
13
  var _textRef$getBoundingC, _textRef$getBoundingC2, _textRef$getBoundingC3;
21
- var x = _ref.x,
22
- graphYStart = _ref.graphYStart,
23
- className = _ref.className,
24
- mainLabel = _ref.mainLabel,
25
- mainLabelStyles = _ref.mainLabelStyles,
26
- secondaryLabel = _ref.secondaryLabel,
27
- color = _ref.color,
28
- yOffset = _ref.yOffset,
29
- circle = _ref.circle,
30
- selected = _ref.selected,
31
- selectedLabelBackground = _ref.selectedLabelBackground,
32
- labelBackgroundPadding = _ref.labelBackgroundPadding;
33
- var y = graphYStart + yOffset;
34
- var _useState = (0, _react.useState)(),
35
- _useState2 = _slicedToArray(_useState, 2),
36
- textRef = _useState2[0],
37
- setTextRef = _useState2[1];
14
+ let {
15
+ x,
16
+ graphYStart,
17
+ className,
18
+ mainLabel,
19
+ mainLabelStyles,
20
+ secondaryLabel,
21
+ color,
22
+ yOffset,
23
+ circle,
24
+ selected,
25
+ selectedLabelBackground,
26
+ labelBackgroundPadding
27
+ } = _ref;
28
+ const y = graphYStart + yOffset;
29
+ const [textRef, setTextRef] = (0, _react.useState)();
38
30
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, secondaryLabel && /*#__PURE__*/_react.default.createElement("text", {
39
31
  className: className,
40
32
  textAnchor: "middle",
@@ -52,9 +44,7 @@ var AxisElement = function AxisElement(_ref) {
52
44
  fill: selectedLabelBackground,
53
45
  rx: "14"
54
46
  }), /*#__PURE__*/_react.default.createElement("text", _extends({
55
- ref: function ref(el) {
56
- return setTextRef(el);
57
- },
47
+ ref: el => setTextRef(el),
58
48
  className: className,
59
49
  textAnchor: "middle",
60
50
  fill: color,
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.LINE_PADDING_Y = exports.LINE_PADDING_X = void 0;
7
- var LINE_PADDING_X = exports.LINE_PADDING_X = 5;
8
- var LINE_PADDING_Y = exports.LINE_PADDING_Y = 20;
7
+ const LINE_PADDING_X = exports.LINE_PADDING_X = 5;
8
+ const LINE_PADDING_Y = exports.LINE_PADDING_Y = 20;
@@ -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
  });
@@ -9,23 +8,26 @@ var _react = _interopRequireWildcard(require("react"));
9
8
  var _propTypes = require("prop-types");
10
9
  var _commonTypes = require("../../../../../../types/commonTypes");
11
10
  var _constants = require("./constants");
12
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
+ 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); }
12
+ 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; }
14
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); }
15
- var Decoration = function Decoration(_ref) {
16
- var decoration = _ref.decoration,
17
- barWidth = _ref.barWidth,
18
- graphYStart = _ref.graphYStart,
19
- offset = _ref.offset,
20
- classes = _ref.classes;
21
- var x = decoration.x,
22
- label = decoration.label,
23
- position = decoration.position,
24
- textAnchor = decoration.textAnchor,
25
- _decoration$textProps = decoration.textProps,
26
- textProps = _decoration$textProps === void 0 ? {} : _decoration$textProps,
27
- withLine = decoration.withLine;
28
- var xCoordinate = x + (position === 'center' ? barWidth / 2 : 0);
14
+ const Decoration = _ref => {
15
+ let {
16
+ decoration,
17
+ barWidth,
18
+ graphYStart,
19
+ offset,
20
+ classes
21
+ } = _ref;
22
+ const {
23
+ x,
24
+ label,
25
+ position,
26
+ textAnchor,
27
+ textProps = {},
28
+ withLine
29
+ } = decoration;
30
+ const xCoordinate = x + (position === 'center' ? barWidth / 2 : 0);
29
31
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("text", _extends({
30
32
  className: classes.decoration,
31
33
  textAnchor: textAnchor,
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Y_OFFSET = void 0;
7
- var Y_OFFSET = exports.Y_OFFSET = 20;
7
+ const Y_OFFSET = exports.Y_OFFSET = 20;
@@ -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
  });
@@ -14,46 +13,35 @@ var _AxisElement = _interopRequireDefault(require("./components/AxisElement"));
14
13
  var _Decoration = _interopRequireDefault(require("./components/Decoration"));
15
14
  var _constants = require("./constants");
16
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
- 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; }
19
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
20
- 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."); }
21
- 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); }
22
- 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; }
23
- 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; } }
24
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
25
- var XAxis = function XAxis(_ref) {
26
- var data = _ref.data,
27
- setRef = _ref.setRef,
28
- classes = _ref.classes,
29
- barWidth = _ref.barWidth,
30
- xAxisDefinition = _ref.xAxisDefinition,
31
- xAxis = _ref.xAxis,
32
- graphYStart = _ref.graphYStart,
33
- graphXStart = _ref.graphXStart,
34
- graphXEnd = _ref.graphXEnd,
35
- decoratorRenderer = _ref.decoratorRenderer,
36
- pagination = _ref.pagination,
37
- currentPage = _ref.currentPage,
38
- initialHeight = _ref.initialHeight,
39
- paginationRef = _ref.paginationRef,
40
- currentLabel = _ref.currentLabel;
41
- var xOffset = barWidth / 2;
42
- var decorations = (0, _react.useMemo)(function () {
43
- return decoratorRenderer === null || decoratorRenderer === void 0 ? void 0 : decoratorRenderer({
44
- data: data,
45
- currentPage: currentPage,
46
- pagination: pagination
47
- });
48
- }, [data, currentPage, pagination, decoratorRenderer]) || [];
49
- var _useState = (0, _react.useState)(0),
50
- _useState2 = _slicedToArray(_useState, 2),
51
- offset = _useState2[0],
52
- setOffset = _useState2[1];
53
- var formattedDecorators = (0, _react.useMemo)(function () {
54
- return (0, _utils.getFormattedDecorators)(xAxis, decorations, currentPage, pagination);
55
- }, [decorations]);
56
- (0, _react.useEffect)(function () {
16
+ 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); }
17
+ 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; }
18
+ const XAxis = _ref => {
19
+ let {
20
+ data,
21
+ setRef,
22
+ classes,
23
+ barWidth,
24
+ xAxisDefinition,
25
+ xAxis,
26
+ graphYStart,
27
+ graphXStart,
28
+ graphXEnd,
29
+ decoratorRenderer,
30
+ pagination,
31
+ currentPage,
32
+ initialHeight,
33
+ paginationRef,
34
+ currentLabel
35
+ } = _ref;
36
+ const xOffset = barWidth / 2;
37
+ const decorations = (0, _react.useMemo)(() => decoratorRenderer === null || decoratorRenderer === void 0 ? void 0 : decoratorRenderer({
38
+ data,
39
+ currentPage,
40
+ pagination
41
+ }), [data, currentPage, pagination, decoratorRenderer]) || [];
42
+ const [offset, setOffset] = (0, _react.useState)(0);
43
+ const formattedDecorators = (0, _react.useMemo)(() => (0, _utils.getFormattedDecorators)(xAxis, decorations, currentPage, pagination), [decorations]);
44
+ (0, _react.useEffect)(() => {
57
45
  if (!offset && initialHeight > 0) {
58
46
  setOffset(initialHeight);
59
47
  }
@@ -70,14 +58,16 @@ var XAxis = function XAxis(_ref) {
70
58
  className: classes.xAxis
71
59
  }), /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("g", {
72
60
  ref: paginationRef
73
- }, xAxisDefinition.map(function (_ref2, index) {
74
- var mainLabel = _ref2.mainLabel,
75
- color = _ref2.color,
76
- mainLabelStyles = _ref2.mainLabelStyles,
77
- circle = _ref2.circle,
78
- selectedLabelBackground = _ref2.selectedLabelBackground,
79
- labelBackgroundPadding = _ref2.labelBackgroundPadding;
80
- var selected = index === currentLabel;
61
+ }, xAxisDefinition.map((_ref2, index) => {
62
+ let {
63
+ mainLabel,
64
+ color,
65
+ mainLabelStyles,
66
+ circle,
67
+ selectedLabelBackground,
68
+ labelBackgroundPadding
69
+ } = _ref2;
70
+ const selected = index === currentLabel;
81
71
  return /*#__PURE__*/_react.default.createElement(_AxisElement.default, {
82
72
  className: "".concat(classes.xAxisMainLabel, " ").concat(selected && classes.xAxisSelectedLabel),
83
73
  barWidth: barWidth,
@@ -92,9 +82,11 @@ var XAxis = function XAxis(_ref) {
92
82
  selectedLabelBackground: selectedLabelBackground,
93
83
  labelBackgroundPadding: labelBackgroundPadding
94
84
  });
95
- })), /*#__PURE__*/_react.default.createElement("g", null, xAxisDefinition.map(function (_ref3, index) {
96
- var secondaryLabel = _ref3.secondaryLabel,
97
- color = _ref3.color;
85
+ })), /*#__PURE__*/_react.default.createElement("g", null, xAxisDefinition.map((_ref3, index) => {
86
+ let {
87
+ secondaryLabel,
88
+ color
89
+ } = _ref3;
98
90
  return /*#__PURE__*/_react.default.createElement(_AxisElement.default, {
99
91
  className: classes.xAxisSecondaryLabel,
100
92
  barWidth: barWidth,
@@ -104,17 +96,15 @@ var XAxis = function XAxis(_ref) {
104
96
  graphYStart: graphYStart,
105
97
  yOffset: _constants.Y_OFFSET
106
98
  });
107
- })))), /*#__PURE__*/_react.default.createElement("g", null, formattedDecorators.map(function (decoration) {
108
- return /*#__PURE__*/_react.default.createElement(_Decoration.default, {
109
- classes: classes,
110
- barWidth: barWidth,
111
- xAxis: xAxis,
112
- decoration: decoration,
113
- offset: offset + _constants.Y_OFFSET,
114
- graphYStart: graphYStart,
115
- yOffset: _constants.Y_OFFSET
116
- });
117
- })));
99
+ })))), /*#__PURE__*/_react.default.createElement("g", null, formattedDecorators.map(decoration => /*#__PURE__*/_react.default.createElement(_Decoration.default, {
100
+ classes: classes,
101
+ barWidth: barWidth,
102
+ xAxis: xAxis,
103
+ decoration: decoration,
104
+ offset: offset + _constants.Y_OFFSET,
105
+ graphYStart: graphYStart,
106
+ yOffset: _constants.Y_OFFSET
107
+ }))));
118
108
  };
119
109
  XAxis.propTypes = {
120
110
  classes: _commonTypes.classesType,
@@ -8,15 +8,17 @@ var _propTypes = require("prop-types");
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _commonTypes = require("../../../../../types/commonTypes");
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- var AxisElement = function AxisElement(_ref) {
12
- var x = _ref.x,
13
- value = _ref.value,
14
- label = _ref.label,
15
- textAnchor = _ref.textAnchor,
16
- yAxis = _ref.yAxis,
17
- height = _ref.height,
18
- setRef = _ref.setRef,
19
- className = _ref.className;
11
+ const AxisElement = _ref => {
12
+ let {
13
+ x,
14
+ value,
15
+ label,
16
+ textAnchor,
17
+ yAxis,
18
+ height,
19
+ setRef,
20
+ className
21
+ } = _ref;
20
22
  return /*#__PURE__*/_react.default.createElement("text", {
21
23
  className: className,
22
24
  ref: setRef,
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UNIT_PADDING = void 0;
7
- var UNIT_PADDING = exports.UNIT_PADDING = 40;
7
+ const UNIT_PADDING = exports.UNIT_PADDING = 40;