victory-core 36.3.0 → 36.4.1

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 (102) hide show
  1. package/dist/victory-core.js +14792 -14613
  2. package/dist/victory-core.min.js +1 -1
  3. package/es/index.js +2 -0
  4. package/es/victory-accessible-group/victory-accessible-group.js +38 -40
  5. package/es/victory-animation/util.js +1 -1
  6. package/es/victory-animation/victory-animation.js +46 -48
  7. package/es/victory-clip-container/victory-clip-container.js +74 -75
  8. package/es/victory-container/victory-container.js +86 -94
  9. package/es/victory-label/victory-label.js +32 -25
  10. package/es/victory-portal/portal-context.js +1 -1
  11. package/es/victory-portal/portal.js +28 -26
  12. package/es/victory-portal/victory-portal.js +31 -41
  13. package/es/victory-primitives/arc.js +6 -4
  14. package/es/victory-primitives/background.js +8 -6
  15. package/es/victory-primitives/border.js +6 -4
  16. package/es/victory-primitives/circle.js +8 -4
  17. package/es/victory-primitives/clip-path.js +1 -1
  18. package/es/victory-primitives/line-segment.js +6 -4
  19. package/es/victory-primitives/line.js +8 -4
  20. package/es/victory-primitives/path.js +7 -3
  21. package/es/victory-primitives/point.js +6 -4
  22. package/es/victory-primitives/rect.js +8 -4
  23. package/es/victory-primitives/text.js +7 -3
  24. package/es/victory-primitives/tspan.js +1 -1
  25. package/es/victory-primitives/whisker.js +9 -7
  26. package/es/victory-transition/victory-transition.js +30 -32
  27. package/es/victory-util/add-events.js +324 -315
  28. package/es/victory-util/axis.js +12 -5
  29. package/es/victory-util/collection.js +8 -4
  30. package/es/victory-util/common-props.js +2 -2
  31. package/es/victory-util/data.js +9 -5
  32. package/es/victory-util/domain.js +8 -4
  33. package/es/victory-util/events.js +8 -4
  34. package/es/victory-util/helpers.js +1 -1
  35. package/es/victory-util/hooks/use-animation-state.js +11 -5
  36. package/es/victory-util/line-helpers.js +1 -1
  37. package/es/victory-util/scale.js +19 -19
  38. package/es/victory-util/textsize.js +11 -7
  39. package/es/victory-util/timer-context.js +1 -1
  40. package/es/victory-util/timer.js +3 -5
  41. package/es/victory-util/user-props.js +123 -0
  42. package/es/victory-util/wrapper.js +18 -12
  43. package/lib/index.js +72 -58
  44. package/lib/victory-accessible-group/victory-accessible-group.js +38 -40
  45. package/lib/victory-animation/util.js +2 -2
  46. package/lib/victory-animation/victory-animation.js +49 -49
  47. package/lib/victory-clip-container/victory-clip-container.js +78 -76
  48. package/lib/victory-container/victory-container.js +90 -95
  49. package/lib/victory-label/victory-label.js +38 -27
  50. package/lib/victory-portal/portal-context.js +1 -1
  51. package/lib/victory-portal/portal.js +31 -27
  52. package/lib/victory-portal/victory-portal.js +34 -42
  53. package/lib/victory-primitives/arc.js +9 -5
  54. package/lib/victory-primitives/background.js +11 -7
  55. package/lib/victory-primitives/border.js +9 -5
  56. package/lib/victory-primitives/circle.js +8 -4
  57. package/lib/victory-primitives/clip-path.js +1 -1
  58. package/lib/victory-primitives/line-segment.js +9 -5
  59. package/lib/victory-primitives/line.js +8 -4
  60. package/lib/victory-primitives/path.js +7 -3
  61. package/lib/victory-primitives/point.js +9 -5
  62. package/lib/victory-primitives/rect.js +8 -4
  63. package/lib/victory-primitives/text.js +7 -3
  64. package/lib/victory-primitives/tspan.js +1 -1
  65. package/lib/victory-primitives/whisker.js +12 -8
  66. package/lib/victory-transition/victory-transition.js +33 -33
  67. package/lib/victory-util/add-events.js +322 -311
  68. package/lib/victory-util/axis.js +20 -11
  69. package/lib/victory-util/collection.js +11 -7
  70. package/lib/victory-util/common-props.js +6 -4
  71. package/lib/victory-util/data.js +13 -7
  72. package/lib/victory-util/default-transitions.js +1 -1
  73. package/lib/victory-util/domain.js +11 -5
  74. package/lib/victory-util/events.js +17 -11
  75. package/lib/victory-util/helpers.js +14 -14
  76. package/lib/victory-util/hooks/index.js +4 -4
  77. package/lib/victory-util/hooks/use-animation-state.js +14 -6
  78. package/lib/victory-util/immutable.js +3 -3
  79. package/lib/victory-util/label-helpers.js +6 -4
  80. package/lib/victory-util/line-helpers.js +4 -2
  81. package/lib/victory-util/prop-types.js +5 -3
  82. package/lib/victory-util/scale.js +24 -21
  83. package/lib/victory-util/selection.js +6 -4
  84. package/lib/victory-util/textsize.js +12 -8
  85. package/lib/victory-util/timer-context.js +1 -1
  86. package/lib/victory-util/timer.js +3 -5
  87. package/lib/victory-util/user-props.js +139 -0
  88. package/lib/victory-util/wrapper.js +31 -23
  89. package/package.json +5 -12
  90. package/src/index.js +1 -0
  91. package/src/victory-animation/util.js +1 -1
  92. package/src/victory-animation/victory-animation.js +1 -1
  93. package/src/victory-clip-container/victory-clip-container.js +3 -1
  94. package/src/victory-container/victory-container.js +7 -1
  95. package/src/victory-label/victory-label.js +11 -7
  96. package/src/victory-util/add-events.js +2 -1
  97. package/src/victory-util/axis.js +3 -0
  98. package/src/victory-util/common-props.js +2 -2
  99. package/src/victory-util/line-helpers.js +1 -1
  100. package/src/victory-util/scale.js +18 -9
  101. package/src/victory-util/timer.js +1 -1
  102. package/src/victory-util/user-props.js +94 -0
package/es/index.js CHANGED
@@ -55,6 +55,8 @@ export { _TextSize as TextSize };
55
55
  export { default as Timer } from "./victory-util/timer";
56
56
  import * as _Transitions from "./victory-util/transitions";
57
57
  export { _Transitions as Transitions };
58
+ import * as _UserProps from "./victory-util/user-props";
59
+ export { _UserProps as UserProps };
58
60
  import * as _CommonProps from "./victory-util/common-props";
59
61
  export { _CommonProps as CommonProps };
60
62
  import * as _Wrapper from "./victory-util/wrapper";
@@ -2,45 +2,55 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
2
2
 
3
3
  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); } }
4
4
 
5
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
6
 
7
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
7
+ 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); }
8
+
9
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
+
11
+ 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); }; }
12
+
13
+ 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); }
8
14
 
9
15
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
10
16
 
11
- 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; }
17
+ 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; } }
18
+
19
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
20
+
21
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
22
 
13
23
  import React from "react";
14
24
  import PropTypes from "prop-types";
15
25
 
16
- var VictoryAccessibleGroup =
17
- /*#__PURE__*/
18
- function (_React$Component) {
26
+ var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
19
27
  _inherits(VictoryAccessibleGroup, _React$Component);
20
28
 
29
+ var _super = _createSuper(VictoryAccessibleGroup);
30
+
21
31
  function VictoryAccessibleGroup() {
22
32
  _classCallCheck(this, VictoryAccessibleGroup);
23
33
 
24
- return _possibleConstructorReturn(this, (VictoryAccessibleGroup.__proto__ || Object.getPrototypeOf(VictoryAccessibleGroup)).apply(this, arguments));
34
+ return _super.apply(this, arguments);
25
35
  }
26
36
 
27
37
  _createClass(VictoryAccessibleGroup, [{
28
38
  key: "render",
29
39
  value: function render() {
30
- var _props = this.props,
31
- desc = _props.desc,
32
- children = _props.children,
33
- className = _props.className,
34
- tabIndex = _props.tabIndex;
40
+ var _this$props = this.props,
41
+ desc = _this$props.desc,
42
+ children = _this$props.children,
43
+ className = _this$props.className,
44
+ tabIndex = _this$props.tabIndex;
35
45
  var descId = desc && (this.props["aria-describedby"] || desc.split(" ").join("-"));
36
- return desc ? React.createElement("g", {
46
+ return desc ? /*#__PURE__*/React.createElement("g", {
37
47
  "aria-label": this.props["aria-label"],
38
48
  "aria-describedby": descId,
39
49
  className: className,
40
50
  tabIndex: tabIndex
41
- }, React.createElement("desc", {
51
+ }, /*#__PURE__*/React.createElement("desc", {
42
52
  id: descId
43
- }, desc), children) : React.createElement("g", {
53
+ }, desc), children) : /*#__PURE__*/React.createElement("g", {
44
54
  "aria-label": this.props["aria-label"],
45
55
  "aria-describedby": this.props["aria-describedby"],
46
56
  className: className,
@@ -52,31 +62,19 @@ function (_React$Component) {
52
62
  return VictoryAccessibleGroup;
53
63
  }(React.Component);
54
64
 
55
- Object.defineProperty(VictoryAccessibleGroup, "displayName", {
56
- configurable: true,
57
- enumerable: true,
58
- writable: true,
59
- value: "VictoryAccessibleGroup"
60
- });
61
- Object.defineProperty(VictoryAccessibleGroup, "propTypes", {
62
- configurable: true,
63
- enumerable: true,
64
- writable: true,
65
- value: {
66
- "aria-describedby": PropTypes.string,
67
- "aria-label": PropTypes.string,
68
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
69
- className: PropTypes.string,
70
- desc: PropTypes.string,
71
- tabIndex: PropTypes.number
72
- }
65
+ _defineProperty(VictoryAccessibleGroup, "displayName", "VictoryAccessibleGroup");
66
+
67
+ _defineProperty(VictoryAccessibleGroup, "propTypes", {
68
+ "aria-describedby": PropTypes.string,
69
+ "aria-label": PropTypes.string,
70
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
71
+ className: PropTypes.string,
72
+ desc: PropTypes.string,
73
+ tabIndex: PropTypes.number
73
74
  });
74
- Object.defineProperty(VictoryAccessibleGroup, "defaultProps", {
75
- configurable: true,
76
- enumerable: true,
77
- writable: true,
78
- value: {
79
- className: "VictoryAccessibleGroup"
80
- }
75
+
76
+ _defineProperty(VictoryAccessibleGroup, "defaultProps", {
77
+ className: "VictoryAccessibleGroup"
81
78
  });
79
+
82
80
  export default VictoryAccessibleGroup;
@@ -1,6 +1,6 @@
1
1
  import _orderBy from "lodash/orderBy";
2
2
  import _isPlainObject from "lodash/isPlainObject";
3
- import { interpolate } from "d3-interpolate";
3
+ import { interpolate } from "victory-vendor/d3-interpolate";
4
4
  export var isInterpolatable = function (obj) {
5
5
  // d3 turns null into 0 and undefined into NaN, which we don't want.
6
6
  if (obj !== null) {
@@ -1,42 +1,56 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
2
 
3
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
3
+ 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."); }
4
4
 
5
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
5
+ 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); }
6
6
 
7
- 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; } }
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+
11
+ 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; }
8
12
 
9
13
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
14
 
11
15
  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); } }
12
16
 
13
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
17
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
18
+
19
+ 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); }
20
+
21
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
22
 
15
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
23
+ 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); }; }
16
24
 
17
- 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; }
25
+ 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); }
18
26
 
19
27
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
20
28
 
29
+ 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; } }
30
+
31
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
+
33
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
34
+
21
35
  /*global setTimeout:false */
22
36
  import React from "react";
23
37
  import PropTypes from "prop-types";
24
- import * as d3Ease from "d3-ease";
38
+ import * as d3Ease from "victory-vendor/d3-ease";
25
39
  import { victoryInterpolator } from "./util";
26
40
  import TimerContext from "../victory-util/timer-context";
27
41
  import isEqual from "react-fast-compare";
28
42
 
29
- var VictoryAnimation =
30
- /*#__PURE__*/
31
- function (_React$Component) {
43
+ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
32
44
  _inherits(VictoryAnimation, _React$Component);
33
45
 
46
+ var _super = _createSuper(VictoryAnimation);
47
+
34
48
  function VictoryAnimation(props, context) {
35
49
  var _this;
36
50
 
37
51
  _classCallCheck(this, VictoryAnimation);
38
52
 
39
- _this = _possibleConstructorReturn(this, (VictoryAnimation.__proto__ || Object.getPrototypeOf(VictoryAnimation)).call(this, props, context));
53
+ _this = _super.call(this, props, context);
40
54
  /* defaults */
41
55
 
42
56
  _this.state = {
@@ -98,10 +112,10 @@ function (_React$Component) {
98
112
  this.queue.push(this.props.data);
99
113
  /* If an array was supplied */
100
114
  } else {
101
- var _queue;
115
+ var _this$queue;
102
116
 
103
117
  /* Extend the tween queue */
104
- (_queue = this.queue).push.apply(_queue, _toConsumableArray(this.props.data));
118
+ (_this$queue = this.queue).push.apply(_this$queue, _toConsumableArray(this.props.data));
105
119
  }
106
120
  /* Start traversing the tween queue */
107
121
 
@@ -210,40 +224,24 @@ function (_React$Component) {
210
224
  return VictoryAnimation;
211
225
  }(React.Component);
212
226
 
213
- Object.defineProperty(VictoryAnimation, "displayName", {
214
- configurable: true,
215
- enumerable: true,
216
- writable: true,
217
- value: "VictoryAnimation"
218
- });
219
- Object.defineProperty(VictoryAnimation, "propTypes", {
220
- configurable: true,
221
- enumerable: true,
222
- writable: true,
223
- value: {
224
- children: PropTypes.func,
225
- data: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
226
- delay: PropTypes.number,
227
- duration: PropTypes.number,
228
- easing: PropTypes.oneOf(["back", "backIn", "backOut", "backInOut", "bounce", "bounceIn", "bounceOut", "bounceInOut", "circle", "circleIn", "circleOut", "circleInOut", "linear", "linearIn", "linearOut", "linearInOut", "cubic", "cubicIn", "cubicOut", "cubicInOut", "elastic", "elasticIn", "elasticOut", "elasticInOut", "exp", "expIn", "expOut", "expInOut", "poly", "polyIn", "polyOut", "polyInOut", "quad", "quadIn", "quadOut", "quadInOut", "sin", "sinIn", "sinOut", "sinInOut"]),
229
- onEnd: PropTypes.func
230
- }
231
- });
232
- Object.defineProperty(VictoryAnimation, "defaultProps", {
233
- configurable: true,
234
- enumerable: true,
235
- writable: true,
236
- value: {
237
- data: {},
238
- delay: 0,
239
- duration: 1000,
240
- easing: "quadInOut"
241
- }
227
+ _defineProperty(VictoryAnimation, "displayName", "VictoryAnimation");
228
+
229
+ _defineProperty(VictoryAnimation, "propTypes", {
230
+ children: PropTypes.func,
231
+ data: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
232
+ delay: PropTypes.number,
233
+ duration: PropTypes.number,
234
+ easing: PropTypes.oneOf(["back", "backIn", "backOut", "backInOut", "bounce", "bounceIn", "bounceOut", "bounceInOut", "circle", "circleIn", "circleOut", "circleInOut", "linear", "linearIn", "linearOut", "linearInOut", "cubic", "cubicIn", "cubicOut", "cubicInOut", "elastic", "elasticIn", "elasticOut", "elasticInOut", "exp", "expIn", "expOut", "expInOut", "poly", "polyIn", "polyOut", "polyInOut", "quad", "quadIn", "quadOut", "quadInOut", "sin", "sinIn", "sinOut", "sinInOut"]),
235
+ onEnd: PropTypes.func
242
236
  });
243
- Object.defineProperty(VictoryAnimation, "contextType", {
244
- configurable: true,
245
- enumerable: true,
246
- writable: true,
247
- value: TimerContext
237
+
238
+ _defineProperty(VictoryAnimation, "defaultProps", {
239
+ data: {},
240
+ delay: 0,
241
+ duration: 1000,
242
+ easing: "quadInOut"
248
243
  });
244
+
245
+ _defineProperty(VictoryAnimation, "contextType", TimerContext);
246
+
249
247
  export { VictoryAnimation as default };
@@ -3,49 +3,64 @@ import _isObject from "lodash/isObject";
3
3
  import _defaults from "lodash/defaults";
4
4
  import _assign from "lodash/assign";
5
5
 
6
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
6
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
7
7
 
8
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
8
+ 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."); }
9
9
 
10
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
10
+ 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); }
11
11
 
12
- 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; } }
12
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
13
13
 
14
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
14
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
15
15
 
16
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
+
18
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
21
 
18
22
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
23
 
20
24
  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); } }
21
25
 
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
26
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
27
+
28
+ 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); }
29
+
30
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
31
 
24
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
32
+ 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); }; }
33
+
34
+ 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); }
25
35
 
26
36
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
27
37
 
28
- 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; }
38
+ 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; } }
39
+
40
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
+
42
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
43
 
30
44
  import React from "react";
31
45
  import PropTypes from "prop-types";
32
46
  import * as CustomPropTypes from "../victory-util/prop-types";
33
47
  import * as Helpers from "../victory-util/helpers";
48
+ import * as UserProps from "../victory-util/user-props";
34
49
  import ClipPath from "../victory-primitives/clip-path";
35
50
  import Circle from "../victory-primitives/circle";
36
51
  import Rect from "../victory-primitives/rect";
37
52
 
38
- var VictoryClipContainer =
39
- /*#__PURE__*/
40
- function (_React$Component) {
53
+ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
41
54
  _inherits(VictoryClipContainer, _React$Component);
42
55
 
56
+ var _super = _createSuper(VictoryClipContainer);
57
+
43
58
  function VictoryClipContainer(props) {
44
59
  var _this;
45
60
 
46
61
  _classCallCheck(this, VictoryClipContainer);
47
62
 
48
- _this = _possibleConstructorReturn(this, (VictoryClipContainer.__proto__ || Object.getPrototypeOf(VictoryClipContainer)).call(this, props));
63
+ _this = _super.call(this, props);
49
64
  _this.clipId = !_isObject(props) || props.clipId === undefined ? _uniqueId("victory-clip-") : props.clipId;
50
65
  return _this;
51
66
  }
@@ -77,6 +92,7 @@ function (_React$Component) {
77
92
  }, {
78
93
  key: "renderClippedGroup",
79
94
  value: function renderClippedGroup(props, clipId) {
95
+ var userProps = UserProps.getSafeUserProps(props);
80
96
  var style = props.style,
81
97
  events = props.events,
82
98
  transform = props.transform,
@@ -94,10 +110,9 @@ function (_React$Component) {
94
110
  clipPath: "url(#".concat(clipId, ")")
95
111
  }, events);
96
112
 
97
- return React.cloneElement(groupComponent, _objectSpread({}, groupProps, {
98
- "aria-label": props["aria-label"],
113
+ return /*#__PURE__*/React.cloneElement(groupComponent, _objectSpread(_objectSpread({}, groupProps), {}, {
99
114
  tabIndex: tabIndex
100
- }), [clipComponent].concat(_toConsumableArray(React.Children.toArray(children))));
115
+ }, userProps), [clipComponent].concat(_toConsumableArray(React.Children.toArray(children))));
101
116
  }
102
117
  }, {
103
118
  key: "renderGroup",
@@ -109,7 +124,7 @@ function (_React$Component) {
109
124
  className = props.className,
110
125
  groupComponent = props.groupComponent,
111
126
  tabIndex = props.tabIndex;
112
- return React.cloneElement(groupComponent, _assign({
127
+ return /*#__PURE__*/React.cloneElement(groupComponent, _assign({
113
128
  className: className,
114
129
  style: style,
115
130
  transform: transform,
@@ -151,7 +166,7 @@ function (_React$Component) {
151
166
  cx: origin.x - left,
152
167
  cy: origin.y - top
153
168
  };
154
- child = React.cloneElement(circleComponent, circleProps);
169
+ child = /*#__PURE__*/React.cloneElement(circleComponent, circleProps);
155
170
  } else {
156
171
  var rectProps = {
157
172
  x: translateX - left,
@@ -159,10 +174,10 @@ function (_React$Component) {
159
174
  width: Math.max(clipWidth + left + right, 0),
160
175
  height: Math.max(clipHeight + top + bottom, 0)
161
176
  };
162
- child = React.cloneElement(rectComponent, rectProps);
177
+ child = /*#__PURE__*/React.cloneElement(rectComponent, rectProps);
163
178
  }
164
179
 
165
- return React.cloneElement(clipPathComponent, _assign({
180
+ return /*#__PURE__*/React.cloneElement(clipPathComponent, _assign({
166
181
  key: "clip-path-".concat(clipId)
167
182
  }, props, {
168
183
  clipId: clipId
@@ -225,61 +240,45 @@ function (_React$Component) {
225
240
  return VictoryClipContainer;
226
241
  }(React.Component);
227
242
 
228
- Object.defineProperty(VictoryClipContainer, "displayName", {
229
- configurable: true,
230
- enumerable: true,
231
- writable: true,
232
- value: "VictoryClipContainer"
233
- });
234
- Object.defineProperty(VictoryClipContainer, "role", {
235
- configurable: true,
236
- enumerable: true,
237
- writable: true,
238
- value: "container"
239
- });
240
- Object.defineProperty(VictoryClipContainer, "propTypes", {
241
- configurable: true,
242
- enumerable: true,
243
- writable: true,
244
- value: {
245
- "aria-label": PropTypes.string,
246
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
247
- circleComponent: PropTypes.element,
248
- className: PropTypes.string,
249
- clipHeight: CustomPropTypes.nonNegative,
250
- clipId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
251
- clipPadding: PropTypes.shape({
252
- top: PropTypes.number,
253
- bottom: PropTypes.number,
254
- left: PropTypes.number,
255
- right: PropTypes.number
256
- }),
257
- clipPathComponent: PropTypes.element,
258
- clipWidth: CustomPropTypes.nonNegative,
259
- events: PropTypes.object,
260
- groupComponent: PropTypes.element,
261
- origin: PropTypes.shape({
262
- x: CustomPropTypes.nonNegative,
263
- y: CustomPropTypes.nonNegative
264
- }),
265
- polar: PropTypes.bool,
266
- radius: CustomPropTypes.nonNegative,
267
- style: PropTypes.object,
268
- tabIndex: PropTypes.number,
269
- transform: PropTypes.string,
270
- translateX: PropTypes.number,
271
- translateY: PropTypes.number
272
- }
243
+ _defineProperty(VictoryClipContainer, "displayName", "VictoryClipContainer");
244
+
245
+ _defineProperty(VictoryClipContainer, "role", "container");
246
+
247
+ _defineProperty(VictoryClipContainer, "propTypes", {
248
+ "aria-label": PropTypes.string,
249
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
250
+ circleComponent: PropTypes.element,
251
+ className: PropTypes.string,
252
+ clipHeight: CustomPropTypes.nonNegative,
253
+ clipId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
254
+ clipPadding: PropTypes.shape({
255
+ top: PropTypes.number,
256
+ bottom: PropTypes.number,
257
+ left: PropTypes.number,
258
+ right: PropTypes.number
259
+ }),
260
+ clipPathComponent: PropTypes.element,
261
+ clipWidth: CustomPropTypes.nonNegative,
262
+ events: PropTypes.object,
263
+ groupComponent: PropTypes.element,
264
+ origin: PropTypes.shape({
265
+ x: CustomPropTypes.nonNegative,
266
+ y: CustomPropTypes.nonNegative
267
+ }),
268
+ polar: PropTypes.bool,
269
+ radius: CustomPropTypes.nonNegative,
270
+ style: PropTypes.object,
271
+ tabIndex: PropTypes.number,
272
+ transform: PropTypes.string,
273
+ translateX: PropTypes.number,
274
+ translateY: PropTypes.number
273
275
  });
274
- Object.defineProperty(VictoryClipContainer, "defaultProps", {
275
- configurable: true,
276
- enumerable: true,
277
- writable: true,
278
- value: {
279
- circleComponent: React.createElement(Circle, null),
280
- rectComponent: React.createElement(Rect, null),
281
- clipPathComponent: React.createElement(ClipPath, null),
282
- groupComponent: React.createElement("g", null)
283
- }
276
+
277
+ _defineProperty(VictoryClipContainer, "defaultProps", {
278
+ circleComponent: /*#__PURE__*/React.createElement(Circle, null),
279
+ rectComponent: /*#__PURE__*/React.createElement(Rect, null),
280
+ clipPathComponent: /*#__PURE__*/React.createElement(ClipPath, null),
281
+ groupComponent: /*#__PURE__*/React.createElement("g", null)
284
282
  });
283
+
285
284
  export { VictoryClipContainer as default };