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
@@ -29,34 +29,50 @@ var Events = _interopRequireWildcard(require("./events"));
29
29
 
30
30
  var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
31
31
 
32
- var _victoryTransition = _interopRequireDefault(require("../victory-transition/victory-transition"));
32
+ var _victoryTransition = require("../victory-transition/victory-transition");
33
33
 
34
- var UserProps = _interopRequireWildcard(require("../victory-util/user-props"));
34
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
35
 
36
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
36
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
37
 
38
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
39
 
40
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
40
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
41
41
 
42
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
42
+ 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."); }
43
43
 
44
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
44
+ 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); }
45
45
 
46
- 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; } }
46
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
47
+
48
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
49
+
50
+ 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; }
47
51
 
48
52
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
49
53
 
50
54
  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); } }
51
55
 
52
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
56
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
57
+
58
+ 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); }
53
59
 
54
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
60
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
55
61
 
56
- 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; }
62
+ 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); }; }
63
+
64
+ 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); }
57
65
 
58
66
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
59
67
 
68
+ 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; } }
69
+
70
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
71
+
72
+ // DISCLAIMER:
73
+ // This file is not currently tested, and it is first on the list of files
74
+ // to refactor in our current refactoring effort. Please do not make changes
75
+ // to this file without manual testing and/or refactoring and adding tests.
60
76
  var datumHasXandY = function (datum) {
61
77
  return !(0, _isNil2.default)(datum._x) && !(0, _isNil2.default)(datum._y);
62
78
  }; // used for checking state changes. Expected components can be passed in via options
@@ -72,350 +88,344 @@ var defaultComponents = [{
72
88
  }];
73
89
 
74
90
  var _default = function _default(WrappedComponent, options) {
75
- return (
76
- /*#__PURE__*/
77
- function (_WrappedComponent) {
78
- _inherits(addEvents, _WrappedComponent);
91
+ return /*#__PURE__*/function (_WrappedComponent) {
92
+ _inherits(addEvents, _WrappedComponent);
79
93
 
80
- function addEvents(props) {
81
- var _this;
94
+ var _super = _createSuper(addEvents);
82
95
 
83
- _classCallCheck(this, addEvents);
96
+ function addEvents(props) {
97
+ var _this;
84
98
 
85
- _this = _possibleConstructorReturn(this, (addEvents.__proto__ || Object.getPrototypeOf(addEvents)).call(this, props));
86
- var getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
87
- var boundGetEvents = Events.getEvents.bind(_assertThisInitialized(_this));
88
- _this.state = {};
99
+ _classCallCheck(this, addEvents);
89
100
 
90
- _this.getEvents = function (p, target, eventKey) {
91
- return boundGetEvents(p, target, eventKey, getScopedEvents);
92
- };
101
+ _this = _super.call(this, props);
102
+ var getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
103
+ var boundGetEvents = Events.getEvents.bind(_assertThisInitialized(_this));
104
+ _this.state = {};
93
105
 
94
- _this.getEventState = Events.getEventState.bind(_assertThisInitialized(_this));
106
+ _this.getEvents = function (p, target, eventKey) {
107
+ return boundGetEvents(p, target, eventKey, getScopedEvents);
108
+ };
95
109
 
96
- var calculatedValues = _this.getCalculatedValues(props);
110
+ _this.getEventState = Events.getEventState.bind(_assertThisInitialized(_this));
97
111
 
98
- _this.cacheValues(calculatedValues);
112
+ var calculatedValues = _this.getCalculatedValues(props);
99
113
 
100
- _this.externalMutations = _this.getExternalMutations(props);
101
- _this.calculatedState = _this.getStateChanges(props);
102
- _this.globalEvents = {};
103
- _this.prevGlobalEventKeys = [];
104
- _this.boundGlobalEvents = {};
105
- return _this;
106
- }
114
+ _this.cacheValues(calculatedValues);
107
115
 
108
- _createClass(addEvents, [{
109
- key: "shouldComponentUpdate",
110
- value: function shouldComponentUpdate(nextProps) {
111
- var externalMutations = this.getExternalMutations(nextProps);
112
- var animating = this.props.animating || this.props.animate;
113
- var newMutation = !(0, _reactFastCompare.default)(externalMutations, this.externalMutations);
114
-
115
- if (animating || newMutation) {
116
- this.cacheValues(this.getCalculatedValues(nextProps));
117
- this.externalMutations = externalMutations;
118
- this.applyExternalMutations(nextProps, externalMutations);
119
- return true;
120
- }
116
+ _this.externalMutations = _this.getExternalMutations(props);
117
+ _this.calculatedState = _this.getStateChanges(props);
118
+ _this.globalEvents = {};
119
+ _this.prevGlobalEventKeys = [];
120
+ _this.boundGlobalEvents = {};
121
+ return _this;
122
+ }
121
123
 
122
- var calculatedState = this.getStateChanges(nextProps);
124
+ _createClass(addEvents, [{
125
+ key: "shouldComponentUpdate",
126
+ value: function shouldComponentUpdate(nextProps) {
127
+ var externalMutations = this.getExternalMutations(nextProps);
128
+ var animating = this.props.animating || this.props.animate;
129
+ var newMutation = !(0, _reactFastCompare.default)(externalMutations, this.externalMutations);
123
130
 
124
- if (!(0, _reactFastCompare.default)(this.calculatedState, calculatedState)) {
125
- this.cacheValues(this.getCalculatedValues(nextProps));
126
- return true;
127
- }
131
+ if (animating || newMutation) {
132
+ this.cacheValues(this.getCalculatedValues(nextProps));
133
+ this.externalMutations = externalMutations;
134
+ this.applyExternalMutations(nextProps, externalMutations);
135
+ return true;
136
+ }
128
137
 
129
- if (!(0, _reactFastCompare.default)(this.props, nextProps)) {
130
- this.cacheValues(this.getCalculatedValues(nextProps));
131
- return true;
132
- }
138
+ var calculatedState = this.getStateChanges(nextProps);
133
139
 
134
- return false;
140
+ if (!(0, _reactFastCompare.default)(this.calculatedState, calculatedState)) {
141
+ this.cacheValues(this.getCalculatedValues(nextProps));
142
+ return true;
135
143
  }
136
- }, {
137
- key: "componentDidMount",
138
- value: function componentDidMount() {
139
- var _this2 = this;
140
-
141
- var globalEventKeys = (0, _keys2.default)(this.globalEvents);
142
- globalEventKeys.forEach(function (key) {
143
- return _this2.addGlobalListener(key);
144
- });
145
- this.prevGlobalEventKeys = globalEventKeys;
146
- }
147
- }, {
148
- key: "componentDidUpdate",
149
- value: function componentDidUpdate(prevProps) {
150
- var _this3 = this;
151
-
152
- var calculatedState = this.getStateChanges(prevProps);
153
- this.calculatedState = calculatedState;
154
- var globalEventKeys = (0, _keys2.default)(this.globalEvents);
155
- var removedGlobalEventKeys = (0, _difference2.default)(this.prevGlobalEventKeys, globalEventKeys);
156
- removedGlobalEventKeys.forEach(function (key) {
157
- return _this3.removeGlobalListener(key);
158
- });
159
- var addedGlobalEventKeys = (0, _difference2.default)(globalEventKeys, this.prevGlobalEventKeys);
160
- addedGlobalEventKeys.forEach(function (key) {
161
- return _this3.addGlobalListener(key);
162
- });
163
- this.prevGlobalEventKeys = globalEventKeys;
164
- }
165
- }, {
166
- key: "componentWillUnmount",
167
- value: function componentWillUnmount() {
168
- var _this4 = this;
169
144
 
170
- this.prevGlobalEventKeys.forEach(function (key) {
171
- return _this4.removeGlobalListener(key);
172
- });
173
- }
174
- }, {
175
- key: "addGlobalListener",
176
- value: function addGlobalListener(key) {
177
- var _this5 = this;
178
-
179
- var boundListener = function (event) {
180
- var listener = _this5.globalEvents[key];
181
- return listener && listener(Events.emulateReactEvent(event));
182
- };
183
-
184
- this.boundGlobalEvents[key] = boundListener;
185
- window.addEventListener(Events.getGlobalEventNameFromKey(key), boundListener);
145
+ if (!(0, _reactFastCompare.default)(this.props, nextProps)) {
146
+ this.cacheValues(this.getCalculatedValues(nextProps));
147
+ return true;
186
148
  }
187
- }, {
188
- key: "removeGlobalListener",
189
- value: function removeGlobalListener(key) {
190
- window.removeEventListener(Events.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
191
- } // compile all state changes from own and parent state. Order doesn't matter, as any state
192
- // state change should trigger a re-render
193
-
194
- }, {
195
- key: "getStateChanges",
196
- value: function getStateChanges(props) {
197
- var _this6 = this;
198
-
199
- if (!this.hasEvents) {
200
- return {};
201
- }
202
149
 
203
- var getState = function (key, type) {
204
- var result = (0, _defaults2.default)({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
205
- return (0, _isEmpty2.default)(result) ? undefined : result;
206
- };
207
-
208
- options = options || {};
209
- var components = options.components || defaultComponents;
210
- var stateChanges = components.map(function (component) {
211
- if (!props.standalone && component.name === "parent") {
212
- // don't check for changes on parent props for non-standalone components
213
- return undefined;
214
- } else {
215
- return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
216
- return getState(key, component.name);
217
- }).filter(Boolean);
218
- }
219
- }).filter(Boolean);
220
- return stateChanges;
221
- }
222
- }, {
223
- key: "applyExternalMutations",
224
- value: function applyExternalMutations(props, externalMutations) {
225
- if (!(0, _isEmpty2.default)(externalMutations)) {
226
- var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
227
- memo = (0, _isFunction2.default)(mutation.callback) ? memo.concat(mutation.callback) : memo;
228
- return memo;
229
- }, []);
230
- var compiledCallbacks = callbacks.length ? function () {
231
- callbacks.forEach(function (c) {
232
- return c();
233
- });
234
- } : undefined;
235
- this.setState(externalMutations, compiledCallbacks);
236
- }
237
- }
238
- }, {
239
- key: "getCalculatedValues",
240
- value: function getCalculatedValues(props) {
241
- var sharedEvents = props.sharedEvents;
242
- var components = WrappedComponent.expectedComponents;
243
- var componentEvents = Events.getComponentEvents(props, components);
244
- var getSharedEventState = sharedEvents && (0, _isFunction2.default)(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
245
- return undefined;
246
- };
247
- var baseProps = this.getBaseProps(props, getSharedEventState);
248
- var dataKeys = (0, _keys2.default)(baseProps).filter(function (key) {
249
- return key !== "parent";
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 (0, _isEmpty2.default)(externalEventMutations) || sharedEvents ? undefined : Events.getExternalMutations(externalEventMutations, this.baseProps, this.state);
268
- }
269
- }, {
270
- key: "cacheValues",
271
- value: function cacheValues(obj) {
272
- var _this7 = this;
150
+ return false;
151
+ }
152
+ }, {
153
+ key: "componentDidMount",
154
+ value: function componentDidMount() {
155
+ var _this2 = this;
156
+
157
+ var globalEventKeys = (0, _keys2.default)(this.globalEvents);
158
+ globalEventKeys.forEach(function (key) {
159
+ return _this2.addGlobalListener(key);
160
+ });
161
+ this.prevGlobalEventKeys = globalEventKeys;
162
+ }
163
+ }, {
164
+ key: "componentDidUpdate",
165
+ value: function componentDidUpdate(prevProps) {
166
+ var _this3 = this;
167
+
168
+ var calculatedState = this.getStateChanges(prevProps);
169
+ this.calculatedState = calculatedState;
170
+ var globalEventKeys = (0, _keys2.default)(this.globalEvents);
171
+ var removedGlobalEventKeys = (0, _difference2.default)(this.prevGlobalEventKeys, globalEventKeys);
172
+ removedGlobalEventKeys.forEach(function (key) {
173
+ return _this3.removeGlobalListener(key);
174
+ });
175
+ var addedGlobalEventKeys = (0, _difference2.default)(globalEventKeys, this.prevGlobalEventKeys);
176
+ addedGlobalEventKeys.forEach(function (key) {
177
+ return _this3.addGlobalListener(key);
178
+ });
179
+ this.prevGlobalEventKeys = globalEventKeys;
180
+ }
181
+ }, {
182
+ key: "componentWillUnmount",
183
+ value: function componentWillUnmount() {
184
+ var _this4 = this;
185
+
186
+ this.prevGlobalEventKeys.forEach(function (key) {
187
+ return _this4.removeGlobalListener(key);
188
+ });
189
+ }
190
+ }, {
191
+ key: "addGlobalListener",
192
+ value: function addGlobalListener(key) {
193
+ var _this5 = this;
194
+
195
+ var boundListener = function (event) {
196
+ var listener = _this5.globalEvents[key];
197
+ return listener && listener(Events.emulateReactEvent(event));
198
+ };
273
199
 
274
- (0, _keys2.default)(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");
284
- var baseParentProps = (0, _defaults2.default)({}, parentState, sharedParentState);
285
- var parentPropsList = baseParentProps.parentControlledProps;
286
- var parentProps = parentPropsList ? (0, _pick2.default)(baseParentProps, parentPropsList) : {};
287
- var modifiedProps = (0, _defaults2.default)({}, parentProps, props);
288
- return (0, _isFunction2.default)(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
200
+ this.boundGlobalEvents[key] = boundListener;
201
+ window.addEventListener(Events.getGlobalEventNameFromKey(key), boundListener);
202
+ }
203
+ }, {
204
+ key: "removeGlobalListener",
205
+ value: function removeGlobalListener(key) {
206
+ window.removeEventListener(Events.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
207
+ } // compile all state changes from own and parent state. Order doesn't matter, as any state
208
+ // state change should trigger a re-render
209
+
210
+ }, {
211
+ key: "getStateChanges",
212
+ value: function getStateChanges(props) {
213
+ var _this6 = this;
214
+
215
+ if (!this.hasEvents) {
216
+ return {};
289
217
  }
290
- }, {
291
- key: "getAllEvents",
292
- value: function getAllEvents(props) {
293
- if (Array.isArray(this.componentEvents)) {
294
- var _componentEvents;
295
218
 
296
- return Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
297
- }
219
+ var getState = function (key, type) {
220
+ var result = (0, _defaults2.default)({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
221
+ return (0, _isEmpty2.default)(result) ? undefined : result;
222
+ };
298
223
 
299
- return props.events;
300
- }
301
- }, {
302
- key: "getComponentProps",
303
- value: function getComponentProps(component, type, index) {
304
- var name = this.props.name || WrappedComponent.role;
305
- var key = this.dataKeys && this.dataKeys[index] || index;
306
- var id = "".concat(name, "-").concat(type, "-").concat(key);
307
- var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
308
-
309
- if (!baseProps && !this.hasEvents) {
224
+ options = options || {};
225
+ var components = options.components || defaultComponents;
226
+ var stateChanges = components.map(function (component) {
227
+ if (!props.standalone && component.name === "parent") {
228
+ // don't check for changes on parent props for non-standalone components
310
229
  return undefined;
230
+ } else {
231
+ return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
232
+ return getState(key, component.name);
233
+ }).filter(Boolean);
311
234
  }
312
-
313
- if (this.hasEvents) {
314
- var baseEvents = this.getEvents(this.props, type, key);
315
- var componentProps = (0, _defaults2.default)({
316
- index: index,
317
- key: id
318
- }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
319
- id: id
320
- });
321
- var events = (0, _defaults2.default)({}, Events.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
322
- return (0, _assign2.default)({}, componentProps, {
323
- events: events
235
+ }).filter(Boolean);
236
+ return stateChanges;
237
+ }
238
+ }, {
239
+ key: "applyExternalMutations",
240
+ value: function applyExternalMutations(props, externalMutations) {
241
+ if (!(0, _isEmpty2.default)(externalMutations)) {
242
+ var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
243
+ memo = (0, _isFunction2.default)(mutation.callback) ? memo.concat(mutation.callback) : memo;
244
+ return memo;
245
+ }, []);
246
+ var compiledCallbacks = callbacks.length ? function () {
247
+ callbacks.forEach(function (c) {
248
+ return c();
324
249
  });
325
- }
250
+ } : undefined;
251
+ this.setState(externalMutations, compiledCallbacks);
252
+ }
253
+ }
254
+ }, {
255
+ key: "getCalculatedValues",
256
+ value: function getCalculatedValues(props) {
257
+ var sharedEvents = props.sharedEvents;
258
+ var components = WrappedComponent.expectedComponents;
259
+ var componentEvents = Events.getComponentEvents(props, components);
260
+ var getSharedEventState = sharedEvents && (0, _isFunction2.default)(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
261
+ return undefined;
262
+ };
263
+ var baseProps = this.getBaseProps(props, getSharedEventState);
264
+ var dataKeys = (0, _keys2.default)(baseProps).filter(function (key) {
265
+ return key !== "parent";
266
+ });
267
+ var hasEvents = props.events || props.sharedEvents || componentEvents;
268
+ var events = this.getAllEvents(props);
269
+ return {
270
+ componentEvents: componentEvents,
271
+ getSharedEventState: getSharedEventState,
272
+ baseProps: baseProps,
273
+ dataKeys: dataKeys,
274
+ hasEvents: hasEvents,
275
+ events: events
276
+ };
277
+ }
278
+ }, {
279
+ key: "getExternalMutations",
280
+ value: function getExternalMutations(props) {
281
+ var sharedEvents = props.sharedEvents,
282
+ externalEventMutations = props.externalEventMutations;
283
+ return (0, _isEmpty2.default)(externalEventMutations) || sharedEvents ? undefined : Events.getExternalMutations(externalEventMutations, this.baseProps, this.state);
284
+ }
285
+ }, {
286
+ key: "cacheValues",
287
+ value: function cacheValues(obj) {
288
+ var _this7 = this;
289
+
290
+ (0, _keys2.default)(obj).forEach(function (key) {
291
+ _this7[key] = obj[key];
292
+ });
293
+ }
294
+ }, {
295
+ key: "getBaseProps",
296
+ value: function getBaseProps(props, getSharedEventState) {
297
+ getSharedEventState = getSharedEventState || this.getSharedEventState;
298
+ var sharedParentState = getSharedEventState("parent", "parent");
299
+ var parentState = this.getEventState("parent", "parent");
300
+ var baseParentProps = (0, _defaults2.default)({}, parentState, sharedParentState);
301
+ var parentPropsList = baseParentProps.parentControlledProps;
302
+ var parentProps = parentPropsList ? (0, _pick2.default)(baseParentProps, parentPropsList) : {};
303
+ var modifiedProps = (0, _defaults2.default)({}, parentProps, props);
304
+ return (0, _isFunction2.default)(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
305
+ }
306
+ }, {
307
+ key: "getAllEvents",
308
+ value: function getAllEvents(props) {
309
+ if (Array.isArray(this.componentEvents)) {
310
+ var _this$componentEvents;
326
311
 
327
- return (0, _defaults2.default)({
312
+ return Array.isArray(props.events) ? (_this$componentEvents = this.componentEvents).concat.apply(_this$componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
313
+ }
314
+
315
+ return props.events;
316
+ }
317
+ }, {
318
+ key: "getComponentProps",
319
+ value: function getComponentProps(component, type, index) {
320
+ var name = this.props.name || WrappedComponent.role;
321
+ var key = this.dataKeys && this.dataKeys[index] || index;
322
+ var id = "".concat(name, "-").concat(type, "-").concat(key);
323
+ var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
324
+
325
+ if (!baseProps && !this.hasEvents) {
326
+ return undefined;
327
+ }
328
+
329
+ if (this.hasEvents) {
330
+ var baseEvents = this.getEvents(this.props, type, key);
331
+ var componentProps = (0, _defaults2.default)({
328
332
  index: index,
329
333
  key: id
330
- }, component.props, baseProps, {
334
+ }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
331
335
  id: id
332
336
  });
337
+ var events = (0, _defaults2.default)({}, Events.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
338
+ return (0, _assign2.default)({}, componentProps, {
339
+ events: events
340
+ });
333
341
  }
334
- }, {
335
- key: "renderContainer",
336
- value: function renderContainer(component, children) {
337
- var isContainer = component.type && component.type.role === "container";
338
- var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
339
-
340
- if (parentProps.events) {
341
- this.globalEvents = Events.getGlobalEvents(parentProps.events);
342
- parentProps.events = Events.omitGlobalEvents(parentProps.events);
343
- }
344
-
345
- return _react.default.cloneElement(component, parentProps, children);
346
- }
347
- }, {
348
- key: "animateComponent",
349
- value: function animateComponent(props, defaultAnimationWhitelist) {
350
- var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
351
- return _react.default.createElement(_victoryTransition.default, {
352
- animate: props.animate,
353
- animationWhitelist: animationWhitelist
354
- }, _react.default.createElement(this.constructor, props));
355
- } // Used by `VictoryLine` and `VictoryArea`
356
-
357
- }, {
358
- key: "renderContinuousData",
359
- value: function renderContinuousData(props) {
360
- var _this8 = this;
361
-
362
- var dataComponent = props.dataComponent,
363
- labelComponent = props.labelComponent,
364
- groupComponent = props.groupComponent;
365
- var dataKeys = (0, _without2.default)(this.dataKeys, "all");
366
- var labelComponents = dataKeys.reduce(function (memo, key) {
367
- var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
368
-
369
- if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
370
- memo = memo.concat(_react.default.cloneElement(labelComponent, labelProps));
371
- }
372
342
 
373
- return memo;
374
- }, []);
375
- var dataProps = this.getComponentProps(dataComponent, "data", "all");
376
- var children = [_react.default.cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
377
- return this.renderContainer(groupComponent, children);
343
+ return (0, _defaults2.default)({
344
+ index: index,
345
+ key: id
346
+ }, component.props, baseProps, {
347
+ id: id
348
+ });
349
+ }
350
+ }, {
351
+ key: "renderContainer",
352
+ value: function renderContainer(component, children) {
353
+ var isContainer = component.type && component.type.role === "container";
354
+ var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
355
+
356
+ if (parentProps.events) {
357
+ this.globalEvents = Events.getGlobalEvents(parentProps.events);
358
+ parentProps.events = Events.omitGlobalEvents(parentProps.events);
378
359
  }
379
- }, {
380
- key: "renderData",
381
- value: function renderData(props) {
382
- var _this9 = this;
383
-
384
- var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
385
- var dataComponent = props.dataComponent,
386
- labelComponent = props.labelComponent,
387
- groupComponent = props.groupComponent;
388
- var userProps = UserProps.getSafeUserProps(props);
389
- var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
390
- var dataProps = _this9.getComponentProps(dataComponent, "data", index);
391
-
392
- if (shouldRenderDatum(dataProps.datum)) {
393
- validDataComponents.push(_react.default.cloneElement(dataComponent, dataProps));
394
- }
395
-
396
- return validDataComponents;
397
- }, []);
398
- var labelComponents = this.dataKeys.map(function (_dataKey, index) {
399
- var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
400
360
 
401
- if (labelProps.text !== undefined && labelProps.text !== null) {
402
- return _react.default.cloneElement(labelComponent, labelProps);
403
- }
361
+ return /*#__PURE__*/_react.default.cloneElement(component, parentProps, children);
362
+ }
363
+ }, {
364
+ key: "animateComponent",
365
+ value: function animateComponent(props, defaultAnimationWhitelist) {
366
+ var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
367
+ return /*#__PURE__*/_react.default.createElement(_victoryTransition.VictoryTransition, {
368
+ animate: props.animate,
369
+ animationWhitelist: animationWhitelist
370
+ }, /*#__PURE__*/_react.default.createElement(this.constructor, props));
371
+ } // Used by `VictoryLine` and `VictoryArea`
372
+
373
+ }, {
374
+ key: "renderContinuousData",
375
+ value: function renderContinuousData(props) {
376
+ var _this8 = this;
377
+
378
+ var dataComponent = props.dataComponent,
379
+ labelComponent = props.labelComponent,
380
+ groupComponent = props.groupComponent;
381
+ var dataKeys = (0, _without2.default)(this.dataKeys, "all");
382
+ var labelComponents = dataKeys.reduce(function (memo, key) {
383
+ var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
384
+
385
+ if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
386
+ memo = memo.concat( /*#__PURE__*/_react.default.cloneElement(labelComponent, labelProps));
387
+ }
404
388
 
405
- return undefined;
406
- }).filter(Boolean);
389
+ return memo;
390
+ }, []);
391
+ var dataProps = this.getComponentProps(dataComponent, "data", "all");
392
+ var children = [/*#__PURE__*/_react.default.cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
393
+ return this.renderContainer(groupComponent, children);
394
+ }
395
+ }, {
396
+ key: "renderData",
397
+ value: function renderData(props) {
398
+ var _this9 = this;
399
+
400
+ var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
401
+ var dataComponent = props.dataComponent,
402
+ labelComponent = props.labelComponent,
403
+ groupComponent = props.groupComponent;
404
+ var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
405
+ var dataProps = _this9.getComponentProps(dataComponent, "data", index);
406
+
407
+ if (shouldRenderDatum(dataProps.datum)) {
408
+ validDataComponents.push( /*#__PURE__*/_react.default.cloneElement(dataComponent, dataProps));
409
+ }
407
410
 
408
- var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
411
+ return validDataComponents;
412
+ }, []);
413
+ var labelComponents = this.dataKeys.map(function (_dataKey, index) {
414
+ var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
409
415
 
410
- var group = _react.default.cloneElement(groupComponent, userProps, children);
416
+ if (labelProps.text !== undefined && labelProps.text !== null) {
417
+ return /*#__PURE__*/_react.default.cloneElement(labelComponent, labelProps);
418
+ }
411
419
 
412
- return this.renderContainer(group, children);
413
- }
414
- }]);
420
+ return undefined;
421
+ }).filter(Boolean);
422
+ var children = [].concat(_toConsumableArray(dataComponents), _toConsumableArray(labelComponents));
423
+ return this.renderContainer(groupComponent, children);
424
+ }
425
+ }]);
415
426
 
416
- return addEvents;
417
- }(WrappedComponent)
418
- );
427
+ return addEvents;
428
+ }(WrappedComponent);
419
429
  };
420
430
 
421
431
  exports.default = _default;