victory-core 36.3.2 → 36.5.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 (253) hide show
  1. package/dist/victory-core.js +15084 -15018
  2. package/dist/victory-core.min.js +1 -1
  3. package/es/index.d.ts +38 -941
  4. package/es/index.js +19 -28
  5. package/es/types.d.ts +33 -0
  6. package/es/types.js +1 -0
  7. package/es/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  8. package/es/victory-accessible-group/victory-accessible-group.js +35 -45
  9. package/es/victory-animation/util.d.ts +66 -0
  10. package/es/victory-animation/util.js +3 -2
  11. package/es/victory-animation/victory-animation.d.ts +69 -0
  12. package/es/victory-animation/victory-animation.js +92 -102
  13. package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
  14. package/es/victory-clip-container/victory-clip-container.js +75 -82
  15. package/es/victory-container/victory-container.d.ts +99 -0
  16. package/es/victory-container/victory-container.js +97 -107
  17. package/es/victory-label/victory-label.d.ts +61 -0
  18. package/es/victory-label/victory-label.js +43 -31
  19. package/es/victory-portal/portal-context.d.ts +11 -0
  20. package/es/victory-portal/portal-context.js +3 -4
  21. package/es/victory-portal/portal.d.ts +28 -0
  22. package/es/victory-portal/portal.js +44 -50
  23. package/es/victory-portal/victory-portal.d.ts +31 -0
  24. package/es/victory-portal/victory-portal.js +38 -47
  25. package/es/victory-primitives/arc.d.ts +21 -0
  26. package/es/victory-primitives/arc.js +9 -9
  27. package/es/victory-primitives/background.d.ts +22 -0
  28. package/es/victory-primitives/background.js +12 -12
  29. package/es/victory-primitives/border.d.ts +18 -0
  30. package/es/victory-primitives/border.js +9 -9
  31. package/es/victory-primitives/circle.d.ts +2 -0
  32. package/es/victory-primitives/circle.js +17 -10
  33. package/es/victory-primitives/clip-path.d.ts +14 -0
  34. package/es/victory-primitives/clip-path.js +6 -6
  35. package/es/victory-primitives/index.d.ts +14 -0
  36. package/es/victory-primitives/index.js +14 -0
  37. package/es/victory-primitives/line-segment.d.ts +19 -0
  38. package/es/victory-primitives/line-segment.js +9 -9
  39. package/es/victory-primitives/line.d.ts +2 -0
  40. package/es/victory-primitives/line.js +17 -10
  41. package/es/victory-primitives/path.d.ts +2 -0
  42. package/es/victory-primitives/path.js +15 -8
  43. package/es/victory-primitives/point.d.ts +21 -0
  44. package/es/victory-primitives/point.js +15 -23
  45. package/es/victory-primitives/rect.d.ts +2 -0
  46. package/es/victory-primitives/rect.js +17 -10
  47. package/es/victory-primitives/text.d.ts +16 -0
  48. package/es/victory-primitives/text.js +13 -8
  49. package/es/victory-primitives/tspan.d.ts +2 -0
  50. package/es/victory-primitives/tspan.js +7 -6
  51. package/es/victory-primitives/types.d.ts +7 -0
  52. package/es/victory-primitives/types.js +1 -0
  53. package/es/victory-primitives/whisker.d.ts +24 -0
  54. package/es/victory-primitives/whisker.js +12 -12
  55. package/es/victory-theme/grayscale.d.ts +2 -0
  56. package/es/victory-theme/grayscale.js +1 -1
  57. package/es/victory-theme/material.d.ts +2 -0
  58. package/es/victory-theme/material.js +1 -1
  59. package/es/victory-theme/victory-theme-definition.d.ts +244 -0
  60. package/es/victory-theme/victory-theme-definition.js +1 -0
  61. package/es/victory-theme/victory-theme.d.ts +5 -0
  62. package/es/victory-theme/victory-theme.js +6 -5
  63. package/es/victory-transition/victory-transition.d.ts +59 -0
  64. package/es/victory-transition/victory-transition.js +38 -44
  65. package/es/victory-util/add-events.js +328 -319
  66. package/es/victory-util/axis.js +12 -6
  67. package/es/victory-util/collection.js +7 -5
  68. package/es/victory-util/common-props.js +2 -2
  69. package/es/victory-util/data.js +8 -6
  70. package/es/victory-util/default-transitions.js +0 -1
  71. package/es/victory-util/domain.js +7 -5
  72. package/es/victory-util/events.js +8 -4
  73. package/es/victory-util/helpers.js +1 -3
  74. package/es/victory-util/hooks/use-animation-state.js +11 -5
  75. package/es/victory-util/immutable.js +0 -1
  76. package/es/victory-util/label-helpers.js +0 -2
  77. package/es/victory-util/line-helpers.js +1 -1
  78. package/es/victory-util/log.js +0 -1
  79. package/es/victory-util/point-path-helpers.d.ts +9 -0
  80. package/es/victory-util/point-path-helpers.js +59 -61
  81. package/es/victory-util/scale.js +19 -19
  82. package/es/victory-util/selection.d.ts +23 -0
  83. package/es/victory-util/selection.js +0 -2
  84. package/es/victory-util/style.js +0 -2
  85. package/es/victory-util/textsize.d.ts +8 -0
  86. package/es/victory-util/textsize.js +11 -7
  87. package/es/victory-util/timer-context.d.ts +11 -0
  88. package/es/victory-util/timer-context.js +1 -1
  89. package/es/victory-util/timer.d.ts +16 -0
  90. package/es/victory-util/timer.js +16 -13
  91. package/es/victory-util/types.d.ts +188 -0
  92. package/es/victory-util/types.js +1 -0
  93. package/es/victory-util/user-props.js +44 -4
  94. package/es/victory-util/wrapper.js +18 -12
  95. package/lib/index.d.ts +38 -941
  96. package/lib/index.js +201 -189
  97. package/lib/types.d.ts +33 -0
  98. package/lib/types.js +1 -0
  99. package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  100. package/lib/victory-accessible-group/victory-accessible-group.js +37 -45
  101. package/lib/victory-animation/util.d.ts +66 -0
  102. package/lib/victory-animation/util.js +4 -3
  103. package/lib/victory-animation/victory-animation.d.ts +69 -0
  104. package/lib/victory-animation/victory-animation.js +97 -102
  105. package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
  106. package/lib/victory-clip-container/victory-clip-container.js +81 -82
  107. package/lib/victory-container/victory-container.d.ts +99 -0
  108. package/lib/victory-container/victory-container.js +102 -107
  109. package/lib/victory-label/victory-label.d.ts +61 -0
  110. package/lib/victory-label/victory-label.js +49 -32
  111. package/lib/victory-portal/portal-context.d.ts +11 -0
  112. package/lib/victory-portal/portal-context.js +4 -5
  113. package/lib/victory-portal/portal.d.ts +28 -0
  114. package/lib/victory-portal/portal.js +49 -50
  115. package/lib/victory-portal/victory-portal.d.ts +31 -0
  116. package/lib/victory-portal/victory-portal.js +43 -47
  117. package/lib/victory-primitives/arc.d.ts +21 -0
  118. package/lib/victory-primitives/arc.js +13 -10
  119. package/lib/victory-primitives/background.d.ts +22 -0
  120. package/lib/victory-primitives/background.js +16 -13
  121. package/lib/victory-primitives/border.d.ts +18 -0
  122. package/lib/victory-primitives/border.js +13 -10
  123. package/lib/victory-primitives/circle.d.ts +2 -0
  124. package/lib/victory-primitives/circle.js +17 -8
  125. package/lib/victory-primitives/clip-path.d.ts +14 -0
  126. package/lib/victory-primitives/clip-path.js +7 -5
  127. package/lib/victory-primitives/index.d.ts +14 -0
  128. package/lib/victory-primitives/index.js +187 -0
  129. package/lib/victory-primitives/line-segment.d.ts +19 -0
  130. package/lib/victory-primitives/line-segment.js +13 -10
  131. package/lib/victory-primitives/line.d.ts +2 -0
  132. package/lib/victory-primitives/line.js +17 -8
  133. package/lib/victory-primitives/path.d.ts +2 -0
  134. package/lib/victory-primitives/path.js +15 -6
  135. package/lib/victory-primitives/point.d.ts +21 -0
  136. package/lib/victory-primitives/point.js +21 -25
  137. package/lib/victory-primitives/rect.d.ts +2 -0
  138. package/lib/victory-primitives/rect.js +17 -8
  139. package/lib/victory-primitives/text.d.ts +16 -0
  140. package/lib/victory-primitives/text.js +14 -7
  141. package/lib/victory-primitives/tspan.d.ts +2 -0
  142. package/lib/victory-primitives/tspan.js +7 -4
  143. package/lib/victory-primitives/types.d.ts +7 -0
  144. package/lib/victory-primitives/types.js +1 -0
  145. package/lib/victory-primitives/whisker.d.ts +24 -0
  146. package/lib/victory-primitives/whisker.js +16 -13
  147. package/lib/victory-theme/grayscale.d.ts +2 -0
  148. package/lib/victory-theme/grayscale.js +3 -3
  149. package/lib/victory-theme/material.d.ts +2 -0
  150. package/lib/victory-theme/material.js +3 -3
  151. package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
  152. package/lib/victory-theme/victory-theme-definition.js +1 -0
  153. package/lib/victory-theme/victory-theme.d.ts +5 -0
  154. package/lib/victory-theme/victory-theme.js +22 -8
  155. package/lib/victory-transition/victory-transition.d.ts +59 -0
  156. package/lib/victory-transition/victory-transition.js +43 -45
  157. package/lib/victory-util/add-events.js +326 -316
  158. package/lib/victory-util/axis.js +20 -11
  159. package/lib/victory-util/collection.js +10 -8
  160. package/lib/victory-util/common-props.js +6 -4
  161. package/lib/victory-util/data.js +13 -7
  162. package/lib/victory-util/default-transitions.js +1 -2
  163. package/lib/victory-util/domain.js +11 -5
  164. package/lib/victory-util/events.js +17 -11
  165. package/lib/victory-util/helpers.js +14 -16
  166. package/lib/victory-util/hooks/index.js +4 -4
  167. package/lib/victory-util/hooks/use-animation-state.js +14 -6
  168. package/lib/victory-util/immutable.js +3 -5
  169. package/lib/victory-util/label-helpers.js +6 -6
  170. package/lib/victory-util/line-helpers.js +4 -2
  171. package/lib/victory-util/log.js +0 -1
  172. package/lib/victory-util/point-path-helpers.d.ts +9 -0
  173. package/lib/victory-util/point-path-helpers.js +86 -73
  174. package/lib/victory-util/prop-types.js +5 -3
  175. package/lib/victory-util/scale.js +24 -21
  176. package/lib/victory-util/selection.d.ts +23 -0
  177. package/lib/victory-util/selection.js +5 -5
  178. package/lib/victory-util/style.js +0 -2
  179. package/lib/victory-util/textsize.d.ts +8 -0
  180. package/lib/victory-util/textsize.js +12 -8
  181. package/lib/victory-util/timer-context.d.ts +11 -0
  182. package/lib/victory-util/timer-context.js +1 -1
  183. package/lib/victory-util/timer.d.ts +16 -0
  184. package/lib/victory-util/timer.js +16 -13
  185. package/lib/victory-util/types.d.ts +188 -0
  186. package/lib/victory-util/types.js +1 -0
  187. package/lib/victory-util/user-props.js +53 -6
  188. package/lib/victory-util/wrapper.js +31 -23
  189. package/package.json +6 -13
  190. package/src/index.ts +42 -0
  191. package/src/types.ts +45 -0
  192. package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
  193. package/src/victory-animation/{util.js → util.ts} +5 -4
  194. package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +90 -13
  195. package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +32 -6
  196. package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
  197. package/src/victory-label/{victory-label.js → victory-label.tsx} +80 -19
  198. package/src/victory-portal/portal-context.ts +14 -0
  199. package/src/victory-portal/{portal.js → portal.tsx} +23 -12
  200. package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
  201. package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
  202. package/src/victory-primitives/{background.js → background.tsx} +17 -7
  203. package/src/victory-primitives/{border.js → border.tsx} +12 -5
  204. package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
  205. package/src/victory-primitives/clip-path.tsx +25 -0
  206. package/src/victory-primitives/index.ts +14 -0
  207. package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
  208. package/src/victory-primitives/{line.js → line.tsx} +4 -3
  209. package/src/victory-primitives/{path.js → path.tsx} +4 -3
  210. package/src/victory-primitives/{point.js → point.tsx} +25 -20
  211. package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
  212. package/src/victory-primitives/{text.js → text.tsx} +9 -3
  213. package/src/victory-primitives/tspan.tsx +7 -0
  214. package/src/victory-primitives/types.ts +19 -0
  215. package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
  216. package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
  217. package/src/victory-theme/{material.js → material.tsx} +2 -1
  218. package/src/victory-theme/victory-theme-definition.ts +261 -0
  219. package/src/victory-theme/victory-theme.tsx +5 -0
  220. package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
  221. package/src/victory-util/add-events.js +7 -5
  222. package/src/victory-util/axis.js +3 -1
  223. package/src/victory-util/collection.js +0 -1
  224. package/src/victory-util/common-props.js +2 -2
  225. package/src/victory-util/data.js +0 -1
  226. package/src/victory-util/default-transitions.js +0 -1
  227. package/src/victory-util/domain.js +0 -1
  228. package/src/victory-util/events.js +1 -1
  229. package/src/victory-util/helpers.js +0 -1
  230. package/src/victory-util/immutable.js +0 -1
  231. package/src/victory-util/label-helpers.js +0 -1
  232. package/src/victory-util/line-helpers.js +1 -1
  233. package/src/victory-util/log.js +0 -1
  234. package/src/victory-util/point-path-helpers.ts +119 -0
  235. package/src/victory-util/prop-types.js +0 -1
  236. package/src/victory-util/scale.js +18 -10
  237. package/src/victory-util/selection.d.ts +23 -0
  238. package/src/victory-util/selection.js +0 -1
  239. package/src/victory-util/style.js +0 -1
  240. package/src/victory-util/textsize.d.ts +8 -0
  241. package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
  242. package/src/victory-util/{timer.js → timer.ts} +20 -5
  243. package/src/victory-util/transitions.js +0 -1
  244. package/src/victory-util/types.ts +247 -0
  245. package/src/victory-util/user-props.js +31 -1
  246. package/src/victory-util/wrapper.js +0 -1
  247. package/src/index.d.ts +0 -941
  248. package/src/index.js +0 -51
  249. package/src/victory-portal/portal-context.js +0 -10
  250. package/src/victory-primitives/clip-path.js +0 -18
  251. package/src/victory-primitives/tspan.js +0 -5
  252. package/src/victory-theme/victory-theme.js +0 -7
  253. package/src/victory-util/point-path-helpers.js +0 -121
@@ -8,32 +8,46 @@ import _keys from "lodash/keys";
8
8
  import _assign from "lodash/assign";
9
9
  import _defaults from "lodash/defaults";
10
10
 
11
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
11
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12
12
 
13
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
13
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
14
 
15
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
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
16
 
17
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
17
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
18
+
19
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
20
+
21
+ 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; }
18
22
 
19
23
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
24
 
21
25
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
22
26
 
23
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
27
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
28
+
29
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
30
 
25
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
31
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
26
32
 
27
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
33
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
34
+
35
+ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
28
36
 
29
37
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
30
38
 
39
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
40
+
41
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
42
+
31
43
  /*global window:false */
32
44
  import React from "react";
33
45
  import * as Events from "./events";
34
46
  import isEqual from "react-fast-compare";
35
- import VictoryTransition from "../victory-transition/victory-transition";
36
- import * as UserProps from "../victory-util/user-props";
47
+ import { VictoryTransition } from "../victory-transition/victory-transition"; // DISCLAIMER:
48
+ // This file is not currently tested, and it is first on the list of files
49
+ // to refactor in our current refactoring effort. Please do not make changes
50
+ // to this file without manual testing and/or refactoring and adding tests.
37
51
 
38
52
  var datumHasXandY = function (datum) {
39
53
  return !_isNil(datum._x) && !_isNil(datum._y);
@@ -49,365 +63,360 @@ var defaultComponents = [{
49
63
  name: "labels"
50
64
  }];
51
65
  export default (function (WrappedComponent, options) {
52
- return (
53
- /*#__PURE__*/
54
- function (_WrappedComponent) {
55
- _inherits(addEvents, _WrappedComponent);
66
+ return /*#__PURE__*/function (_WrappedComponent) {
67
+ _inherits(addEvents, _WrappedComponent);
56
68
 
57
- function addEvents(props) {
58
- var _this;
69
+ var _super = _createSuper(addEvents);
59
70
 
60
- _classCallCheck(this, addEvents);
71
+ function addEvents(props) {
72
+ var _this;
61
73
 
62
- _this = _possibleConstructorReturn(this, (addEvents.__proto__ || Object.getPrototypeOf(addEvents)).call(this, props));
63
- var getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
64
- var boundGetEvents = Events.getEvents.bind(_assertThisInitialized(_this));
65
- _this.state = {};
74
+ _classCallCheck(this, addEvents);
66
75
 
67
- _this.getEvents = function (p, target, eventKey) {
68
- return boundGetEvents(p, target, eventKey, getScopedEvents);
69
- };
76
+ _this = _super.call(this, props);
77
+ var getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
78
+ var boundGetEvents = Events.getEvents.bind(_assertThisInitialized(_this));
79
+ _this.state = {};
70
80
 
71
- _this.getEventState = Events.getEventState.bind(_assertThisInitialized(_this));
81
+ _this.getEvents = function (p, target, eventKey) {
82
+ return boundGetEvents(p, target, eventKey, getScopedEvents);
83
+ };
72
84
 
73
- var calculatedValues = _this.getCalculatedValues(props);
85
+ _this.getEventState = Events.getEventState.bind(_assertThisInitialized(_this));
74
86
 
75
- _this.cacheValues(calculatedValues);
87
+ var calculatedValues = _this.getCalculatedValues(props);
76
88
 
77
- _this.externalMutations = _this.getExternalMutations(props);
78
- _this.calculatedState = _this.getStateChanges(props);
79
- _this.globalEvents = {};
80
- _this.prevGlobalEventKeys = [];
81
- _this.boundGlobalEvents = {};
82
- return _this;
83
- }
89
+ _this.cacheValues(calculatedValues);
84
90
 
85
- _createClass(addEvents, [{
86
- key: "shouldComponentUpdate",
87
- value: function shouldComponentUpdate(nextProps) {
88
- var externalMutations = this.getExternalMutations(nextProps);
89
- var animating = this.props.animating || this.props.animate;
90
- var newMutation = !isEqual(externalMutations, this.externalMutations);
91
-
92
- if (animating || newMutation) {
93
- this.cacheValues(this.getCalculatedValues(nextProps));
94
- this.externalMutations = externalMutations;
95
- this.applyExternalMutations(nextProps, externalMutations);
96
- return true;
97
- }
91
+ _this.externalMutations = _this.getExternalMutations(props);
92
+ _this.calculatedState = _this.getStateChanges(props);
93
+ _this.globalEvents = {};
94
+ _this.prevGlobalEventKeys = [];
95
+ _this.boundGlobalEvents = {};
96
+ return _this;
97
+ }
98
98
 
99
- var calculatedState = this.getStateChanges(nextProps);
99
+ _createClass(addEvents, [{
100
+ key: "shouldComponentUpdate",
101
+ value: function shouldComponentUpdate(nextProps) {
102
+ var externalMutations = this.getExternalMutations(nextProps);
103
+ var animating = this.props.animating || this.props.animate;
104
+ var newMutation = !isEqual(externalMutations, this.externalMutations);
100
105
 
101
- if (!isEqual(this.calculatedState, calculatedState)) {
102
- this.cacheValues(this.getCalculatedValues(nextProps));
103
- return true;
104
- }
106
+ if (animating || newMutation) {
107
+ this.cacheValues(this.getCalculatedValues(nextProps));
108
+ this.externalMutations = externalMutations;
109
+ this.applyExternalMutations(nextProps, externalMutations);
110
+ return true;
111
+ }
105
112
 
106
- if (!isEqual(this.props, nextProps)) {
107
- this.cacheValues(this.getCalculatedValues(nextProps));
108
- return true;
109
- }
113
+ var calculatedState = this.getStateChanges(nextProps);
110
114
 
111
- return false;
115
+ if (!isEqual(this.calculatedState, calculatedState)) {
116
+ this.cacheValues(this.getCalculatedValues(nextProps));
117
+ return true;
112
118
  }
113
- }, {
114
- key: "componentDidMount",
115
- value: function componentDidMount() {
116
- var _this2 = this;
117
-
118
- var globalEventKeys = _keys(this.globalEvents);
119
119
 
120
- globalEventKeys.forEach(function (key) {
121
- return _this2.addGlobalListener(key);
122
- });
123
- this.prevGlobalEventKeys = globalEventKeys;
120
+ if (!isEqual(this.props, nextProps)) {
121
+ this.cacheValues(this.getCalculatedValues(nextProps));
122
+ return true;
124
123
  }
125
- }, {
126
- key: "componentDidUpdate",
127
- value: function componentDidUpdate(prevProps) {
128
- var _this3 = this;
129
124
 
130
- var calculatedState = this.getStateChanges(prevProps);
131
- this.calculatedState = calculatedState;
125
+ return false;
126
+ }
127
+ }, {
128
+ key: "componentDidMount",
129
+ value: function componentDidMount() {
130
+ var _this2 = this;
132
131
 
133
- var globalEventKeys = _keys(this.globalEvents);
132
+ var globalEventKeys = _keys(this.globalEvents);
134
133
 
135
- var removedGlobalEventKeys = _difference(this.prevGlobalEventKeys, globalEventKeys);
134
+ globalEventKeys.forEach(function (key) {
135
+ return _this2.addGlobalListener(key);
136
+ });
137
+ this.prevGlobalEventKeys = globalEventKeys;
138
+ }
139
+ }, {
140
+ key: "componentDidUpdate",
141
+ value: function componentDidUpdate(prevProps) {
142
+ var _this3 = this;
136
143
 
137
- removedGlobalEventKeys.forEach(function (key) {
138
- return _this3.removeGlobalListener(key);
139
- });
144
+ var calculatedState = this.getStateChanges(prevProps);
145
+ this.calculatedState = calculatedState;
140
146
 
141
- var addedGlobalEventKeys = _difference(globalEventKeys, this.prevGlobalEventKeys);
147
+ var globalEventKeys = _keys(this.globalEvents);
142
148
 
143
- addedGlobalEventKeys.forEach(function (key) {
144
- return _this3.addGlobalListener(key);
145
- });
146
- this.prevGlobalEventKeys = globalEventKeys;
147
- }
148
- }, {
149
- key: "componentWillUnmount",
150
- value: function componentWillUnmount() {
151
- var _this4 = this;
149
+ var removedGlobalEventKeys = _difference(this.prevGlobalEventKeys, globalEventKeys);
152
150
 
153
- this.prevGlobalEventKeys.forEach(function (key) {
154
- return _this4.removeGlobalListener(key);
155
- });
156
- }
157
- }, {
158
- key: "addGlobalListener",
159
- value: function addGlobalListener(key) {
160
- var _this5 = this;
161
-
162
- var boundListener = function (event) {
163
- var listener = _this5.globalEvents[key];
164
- return listener && listener(Events.emulateReactEvent(event));
165
- };
166
-
167
- this.boundGlobalEvents[key] = boundListener;
168
- window.addEventListener(Events.getGlobalEventNameFromKey(key), boundListener);
169
- }
170
- }, {
171
- key: "removeGlobalListener",
172
- value: function removeGlobalListener(key) {
173
- window.removeEventListener(Events.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
174
- } // compile all state changes from own and parent state. Order doesn't matter, as any state
175
- // state change should trigger a re-render
176
-
177
- }, {
178
- key: "getStateChanges",
179
- value: function getStateChanges(props) {
180
- var _this6 = this;
181
-
182
- if (!this.hasEvents) {
183
- return {};
184
- }
185
-
186
- var getState = function (key, type) {
187
- var result = _defaults({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
188
-
189
- return _isEmpty(result) ? undefined : result;
190
- };
191
-
192
- options = options || {};
193
- var components = options.components || defaultComponents;
194
- var stateChanges = components.map(function (component) {
195
- if (!props.standalone && component.name === "parent") {
196
- // don't check for changes on parent props for non-standalone components
197
- return undefined;
198
- } else {
199
- return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
200
- return getState(key, component.name);
201
- }).filter(Boolean);
202
- }
203
- }).filter(Boolean);
204
- return stateChanges;
205
- }
206
- }, {
207
- key: "applyExternalMutations",
208
- value: function applyExternalMutations(props, externalMutations) {
209
- if (!_isEmpty(externalMutations)) {
210
- var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
211
- memo = _isFunction(mutation.callback) ? memo.concat(mutation.callback) : memo;
212
- return memo;
213
- }, []);
214
- var compiledCallbacks = callbacks.length ? function () {
215
- callbacks.forEach(function (c) {
216
- return c();
217
- });
218
- } : undefined;
219
- this.setState(externalMutations, compiledCallbacks);
220
- }
221
- }
222
- }, {
223
- key: "getCalculatedValues",
224
- value: function getCalculatedValues(props) {
225
- var sharedEvents = props.sharedEvents;
226
- var components = WrappedComponent.expectedComponents;
227
- var componentEvents = Events.getComponentEvents(props, components);
228
- var getSharedEventState = sharedEvents && _isFunction(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
229
- return undefined;
230
- };
231
- var baseProps = this.getBaseProps(props, getSharedEventState);
151
+ removedGlobalEventKeys.forEach(function (key) {
152
+ return _this3.removeGlobalListener(key);
153
+ });
232
154
 
233
- var dataKeys = _keys(baseProps).filter(function (key) {
234
- return key !== "parent";
235
- });
155
+ var addedGlobalEventKeys = _difference(globalEventKeys, this.prevGlobalEventKeys);
236
156
 
237
- var hasEvents = props.events || props.sharedEvents || componentEvents;
238
- var events = this.getAllEvents(props);
239
- return {
240
- componentEvents: componentEvents,
241
- getSharedEventState: getSharedEventState,
242
- baseProps: baseProps,
243
- dataKeys: dataKeys,
244
- hasEvents: hasEvents,
245
- events: events
246
- };
247
- }
248
- }, {
249
- key: "getExternalMutations",
250
- value: function getExternalMutations(props) {
251
- var sharedEvents = props.sharedEvents,
252
- externalEventMutations = props.externalEventMutations;
253
- return _isEmpty(externalEventMutations) || sharedEvents ? undefined : Events.getExternalMutations(externalEventMutations, this.baseProps, this.state);
254
- }
255
- }, {
256
- key: "cacheValues",
257
- value: function cacheValues(obj) {
258
- var _this7 = this;
157
+ addedGlobalEventKeys.forEach(function (key) {
158
+ return _this3.addGlobalListener(key);
159
+ });
160
+ this.prevGlobalEventKeys = globalEventKeys;
161
+ }
162
+ }, {
163
+ key: "componentWillUnmount",
164
+ value: function componentWillUnmount() {
165
+ var _this4 = this;
166
+
167
+ this.prevGlobalEventKeys.forEach(function (key) {
168
+ return _this4.removeGlobalListener(key);
169
+ });
170
+ }
171
+ }, {
172
+ key: "addGlobalListener",
173
+ value: function addGlobalListener(key) {
174
+ var _this5 = this;
175
+
176
+ var boundListener = function (event) {
177
+ var listener = _this5.globalEvents[key];
178
+ return listener && listener(Events.emulateReactEvent(event));
179
+ };
259
180
 
260
- _keys(obj).forEach(function (key) {
261
- _this7[key] = obj[key];
262
- });
181
+ this.boundGlobalEvents[key] = boundListener;
182
+ window.addEventListener(Events.getGlobalEventNameFromKey(key), boundListener);
183
+ }
184
+ }, {
185
+ key: "removeGlobalListener",
186
+ value: function removeGlobalListener(key) {
187
+ window.removeEventListener(Events.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
188
+ } // compile all state changes from own and parent state. Order doesn't matter, as any state
189
+ // state change should trigger a re-render
190
+
191
+ }, {
192
+ key: "getStateChanges",
193
+ value: function getStateChanges(props) {
194
+ var _this6 = this;
195
+
196
+ if (!this.hasEvents) {
197
+ return {};
263
198
  }
264
- }, {
265
- key: "getBaseProps",
266
- value: function getBaseProps(props, getSharedEventState) {
267
- getSharedEventState = getSharedEventState || this.getSharedEventState;
268
- var sharedParentState = getSharedEventState("parent", "parent");
269
- var parentState = this.getEventState("parent", "parent");
270
-
271
- var baseParentProps = _defaults({}, parentState, sharedParentState);
272
199
 
273
- var parentPropsList = baseParentProps.parentControlledProps;
274
- var parentProps = parentPropsList ? _pick(baseParentProps, parentPropsList) : {};
200
+ var getState = function (key, type) {
201
+ var result = _defaults({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
275
202
 
276
- var modifiedProps = _defaults({}, parentProps, props);
203
+ return _isEmpty(result) ? undefined : result;
204
+ };
277
205
 
278
- return _isFunction(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
206
+ options = options || {};
207
+ var components = options.components || defaultComponents;
208
+ var stateChanges = components.map(function (component) {
209
+ if (!props.standalone && component.name === "parent") {
210
+ // don't check for changes on parent props for non-standalone components
211
+ return undefined;
212
+ } else {
213
+ return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
214
+ return getState(key, component.name);
215
+ }).filter(Boolean);
216
+ }
217
+ }).filter(Boolean);
218
+ return stateChanges;
219
+ }
220
+ }, {
221
+ key: "applyExternalMutations",
222
+ value: function applyExternalMutations(props, externalMutations) {
223
+ if (!_isEmpty(externalMutations)) {
224
+ var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
225
+ memo = _isFunction(mutation.callback) ? memo.concat(mutation.callback) : memo;
226
+ return memo;
227
+ }, []);
228
+ var compiledCallbacks = callbacks.length ? function () {
229
+ callbacks.forEach(function (c) {
230
+ return c();
231
+ });
232
+ } : undefined;
233
+ this.setState(externalMutations, compiledCallbacks);
279
234
  }
280
- }, {
281
- key: "getAllEvents",
282
- value: function getAllEvents(props) {
283
- if (Array.isArray(this.componentEvents)) {
284
- var _componentEvents;
235
+ }
236
+ }, {
237
+ key: "getCalculatedValues",
238
+ value: function getCalculatedValues(props) {
239
+ var sharedEvents = props.sharedEvents;
240
+ var components = WrappedComponent.expectedComponents;
241
+ var componentEvents = Events.getComponentEvents(props, components);
242
+ var getSharedEventState = sharedEvents && _isFunction(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
243
+ return undefined;
244
+ };
245
+ var baseProps = this.getBaseProps(props, getSharedEventState);
246
+
247
+ var dataKeys = _keys(baseProps).filter(function (key) {
248
+ return key !== "parent";
249
+ });
250
+
251
+ var hasEvents = props.events || props.sharedEvents || componentEvents;
252
+ var events = this.getAllEvents(props);
253
+ return {
254
+ componentEvents: componentEvents,
255
+ getSharedEventState: getSharedEventState,
256
+ baseProps: baseProps,
257
+ dataKeys: dataKeys,
258
+ hasEvents: hasEvents,
259
+ events: events
260
+ };
261
+ }
262
+ }, {
263
+ key: "getExternalMutations",
264
+ value: function getExternalMutations(props) {
265
+ var sharedEvents = props.sharedEvents,
266
+ externalEventMutations = props.externalEventMutations;
267
+ return _isEmpty(externalEventMutations) || sharedEvents ? undefined : Events.getExternalMutations(externalEventMutations, this.baseProps, this.state);
268
+ }
269
+ }, {
270
+ key: "cacheValues",
271
+ value: function cacheValues(obj) {
272
+ var _this7 = this;
273
+
274
+ _keys(obj).forEach(function (key) {
275
+ _this7[key] = obj[key];
276
+ });
277
+ }
278
+ }, {
279
+ key: "getBaseProps",
280
+ value: function getBaseProps(props, getSharedEventState) {
281
+ getSharedEventState = getSharedEventState || this.getSharedEventState;
282
+ var sharedParentState = getSharedEventState("parent", "parent");
283
+ var parentState = this.getEventState("parent", "parent");
285
284
 
286
- return Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
287
- }
285
+ var baseParentProps = _defaults({}, parentState, sharedParentState);
288
286
 
289
- return props.events;
290
- }
291
- }, {
292
- key: "getComponentProps",
293
- value: function getComponentProps(component, type, index) {
294
- var name = this.props.name || WrappedComponent.role;
295
- var key = this.dataKeys && this.dataKeys[index] || index;
296
- var id = "".concat(name, "-").concat(type, "-").concat(key);
297
- var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
298
-
299
- if (!baseProps && !this.hasEvents) {
300
- return undefined;
301
- }
287
+ var parentPropsList = baseParentProps.parentControlledProps;
288
+ var parentProps = parentPropsList ? _pick(baseParentProps, parentPropsList) : {};
302
289
 
303
- if (this.hasEvents) {
304
- var baseEvents = this.getEvents(this.props, type, key);
290
+ var modifiedProps = _defaults({}, parentProps, props);
305
291
 
306
- var componentProps = _defaults({
307
- index: index,
308
- key: id
309
- }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
310
- id: id
311
- });
292
+ return _isFunction(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
293
+ }
294
+ }, {
295
+ key: "getAllEvents",
296
+ value: function getAllEvents(props) {
297
+ if (Array.isArray(this.componentEvents)) {
298
+ var _this$componentEvents;
312
299
 
313
- var events = _defaults({}, Events.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
300
+ return Array.isArray(props.events) ? (_this$componentEvents = this.componentEvents).concat.apply(_this$componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
301
+ }
314
302
 
315
- return _assign({}, componentProps, {
316
- events: events
317
- });
318
- }
303
+ return props.events;
304
+ }
305
+ }, {
306
+ key: "getComponentProps",
307
+ value: function getComponentProps(component, type, index) {
308
+ var name = this.props.name || WrappedComponent.role;
309
+ var key = this.dataKeys && this.dataKeys[index] || index;
310
+ var id = "".concat(name, "-").concat(type, "-").concat(key);
311
+ var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
312
+
313
+ if (!baseProps && !this.hasEvents) {
314
+ return undefined;
315
+ }
316
+
317
+ if (this.hasEvents) {
318
+ var baseEvents = this.getEvents(this.props, type, key);
319
319
 
320
- return _defaults({
320
+ var componentProps = _defaults({
321
321
  index: index,
322
322
  key: id
323
- }, component.props, baseProps, {
323
+ }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
324
324
  id: id
325
325
  });
326
- }
327
- }, {
328
- key: "renderContainer",
329
- value: function renderContainer(component, children) {
330
- var isContainer = component.type && component.type.role === "container";
331
- var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
332
-
333
- if (parentProps.events) {
334
- this.globalEvents = Events.getGlobalEvents(parentProps.events);
335
- parentProps.events = Events.omitGlobalEvents(parentProps.events);
336
- }
337
326
 
338
- return React.cloneElement(component, parentProps, children);
327
+ var events = _defaults({}, Events.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
328
+
329
+ return _assign({}, componentProps, {
330
+ events: events
331
+ });
339
332
  }
340
- }, {
341
- key: "animateComponent",
342
- value: function animateComponent(props, defaultAnimationWhitelist) {
343
- var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
344
- return React.createElement(VictoryTransition, {
345
- animate: props.animate,
346
- animationWhitelist: animationWhitelist
347
- }, React.createElement(this.constructor, props));
348
- } // Used by `VictoryLine` and `VictoryArea`
349
-
350
- }, {
351
- key: "renderContinuousData",
352
- value: function renderContinuousData(props) {
353
- var _this8 = this;
354
-
355
- var dataComponent = props.dataComponent,
356
- labelComponent = props.labelComponent,
357
- groupComponent = props.groupComponent;
358
-
359
- var dataKeys = _without(this.dataKeys, "all");
360
-
361
- var labelComponents = dataKeys.reduce(function (memo, key) {
362
- var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
363
-
364
- if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
365
- memo = memo.concat(React.cloneElement(labelComponent, labelProps));
366
- }
367
333
 
368
- return memo;
369
- }, []);
370
- var dataProps = this.getComponentProps(dataComponent, "data", "all");
371
- var children = [React.cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
372
- return this.renderContainer(groupComponent, children);
334
+ return _defaults({
335
+ index: index,
336
+ key: id
337
+ }, component.props, baseProps, {
338
+ id: id
339
+ });
340
+ }
341
+ }, {
342
+ key: "renderContainer",
343
+ value: function renderContainer(component, children) {
344
+ var isContainer = component.type && component.type.role === "container";
345
+ var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
346
+
347
+ if (parentProps.events) {
348
+ this.globalEvents = Events.getGlobalEvents(parentProps.events);
349
+ parentProps.events = Events.omitGlobalEvents(parentProps.events);
373
350
  }
374
- }, {
375
- key: "renderData",
376
- value: function renderData(props) {
377
- var _this9 = this;
378
-
379
- var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
380
- var dataComponent = props.dataComponent,
381
- labelComponent = props.labelComponent,
382
- groupComponent = props.groupComponent;
383
- var userProps = UserProps.getSafeUserProps(props);
384
- var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
385
- var dataProps = _this9.getComponentProps(dataComponent, "data", index);
386
-
387
- if (shouldRenderDatum(dataProps.datum)) {
388
- validDataComponents.push(React.cloneElement(dataComponent, dataProps));
389
- }
390
-
391
- return validDataComponents;
392
- }, []);
393
- var labelComponents = this.dataKeys.map(function (_dataKey, index) {
394
- var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
395
351
 
396
- if (labelProps.text !== undefined && labelProps.text !== null) {
397
- return React.cloneElement(labelComponent, labelProps);
398
- }
352
+ return /*#__PURE__*/React.cloneElement(component, parentProps, children);
353
+ }
354
+ }, {
355
+ key: "animateComponent",
356
+ value: function animateComponent(props, defaultAnimationWhitelist) {
357
+ var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
358
+ return /*#__PURE__*/React.createElement(VictoryTransition, {
359
+ animate: props.animate,
360
+ animationWhitelist: animationWhitelist
361
+ }, /*#__PURE__*/React.createElement(this.constructor, props));
362
+ } // Used by `VictoryLine` and `VictoryArea`
363
+
364
+ }, {
365
+ key: "renderContinuousData",
366
+ value: function renderContinuousData(props) {
367
+ var _this8 = this;
368
+
369
+ var dataComponent = props.dataComponent,
370
+ labelComponent = props.labelComponent,
371
+ groupComponent = props.groupComponent;
372
+
373
+ var dataKeys = _without(this.dataKeys, "all");
374
+
375
+ var labelComponents = dataKeys.reduce(function (memo, key) {
376
+ var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
377
+
378
+ if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
379
+ memo = memo.concat( /*#__PURE__*/React.cloneElement(labelComponent, labelProps));
380
+ }
399
381
 
400
- return undefined;
401
- }).filter(Boolean);
382
+ return memo;
383
+ }, []);
384
+ var dataProps = this.getComponentProps(dataComponent, "data", "all");
385
+ var children = [/*#__PURE__*/React.cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
386
+ return this.renderContainer(groupComponent, children);
387
+ }
388
+ }, {
389
+ key: "renderData",
390
+ value: function renderData(props) {
391
+ var _this9 = this;
392
+
393
+ var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
394
+ var dataComponent = props.dataComponent,
395
+ labelComponent = props.labelComponent,
396
+ groupComponent = props.groupComponent;
397
+ var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
398
+ var dataProps = _this9.getComponentProps(dataComponent, "data", index);
399
+
400
+ if (shouldRenderDatum(dataProps.datum)) {
401
+ validDataComponents.push( /*#__PURE__*/React.cloneElement(dataComponent, dataProps));
402
+ }
402
403
 
403
- var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
404
+ return validDataComponents;
405
+ }, []);
406
+ var labelComponents = this.dataKeys.map(function (_dataKey, index) {
407
+ var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
404
408
 
405
- var group = React.cloneElement(groupComponent, userProps, children);
406
- return this.renderContainer(group, children);
407
- }
408
- }]);
409
+ if (labelProps.text !== undefined && labelProps.text !== null) {
410
+ return /*#__PURE__*/React.cloneElement(labelComponent, labelProps);
411
+ }
412
+
413
+ return undefined;
414
+ }).filter(Boolean);
415
+ var children = [].concat(_toConsumableArray(dataComponents), _toConsumableArray(labelComponents));
416
+ return this.renderContainer(groupComponent, children);
417
+ }
418
+ }]);
409
419
 
410
- return addEvents;
411
- }(WrappedComponent)
412
- );
420
+ return addEvents;
421
+ }(WrappedComponent);
413
422
  });