victory-core 36.2.2 → 36.4.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 (102) hide show
  1. package/dist/victory-core.js +14294 -14202
  2. package/dist/victory-core.min.js +1 -1
  3. package/es/index.d.ts +1 -0
  4. package/es/index.js +2 -0
  5. package/es/victory-accessible-group/victory-accessible-group.js +38 -40
  6. package/es/victory-animation/util.js +1 -1
  7. package/es/victory-animation/victory-animation.js +46 -48
  8. package/es/victory-clip-container/victory-clip-container.js +71 -73
  9. package/es/victory-container/victory-container.js +86 -94
  10. package/es/victory-label/victory-label.js +29 -24
  11. package/es/victory-portal/portal-context.js +1 -1
  12. package/es/victory-portal/portal.js +28 -26
  13. package/es/victory-portal/victory-portal.js +31 -41
  14. package/es/victory-primitives/arc.js +6 -4
  15. package/es/victory-primitives/background.js +8 -6
  16. package/es/victory-primitives/border.js +6 -4
  17. package/es/victory-primitives/circle.js +8 -4
  18. package/es/victory-primitives/clip-path.js +1 -1
  19. package/es/victory-primitives/line-segment.js +6 -4
  20. package/es/victory-primitives/line.js +8 -4
  21. package/es/victory-primitives/path.js +7 -3
  22. package/es/victory-primitives/point.js +6 -4
  23. package/es/victory-primitives/rect.js +8 -4
  24. package/es/victory-primitives/text.js +7 -3
  25. package/es/victory-primitives/tspan.js +1 -1
  26. package/es/victory-primitives/whisker.js +9 -7
  27. package/es/victory-transition/victory-transition.js +30 -32
  28. package/es/victory-util/add-events.js +327 -315
  29. package/es/victory-util/axis.js +12 -5
  30. package/es/victory-util/collection.js +8 -4
  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 +110 -0
  42. package/es/victory-util/wrapper.js +18 -12
  43. package/lib/index.d.ts +1 -0
  44. package/lib/index.js +72 -58
  45. package/lib/victory-accessible-group/victory-accessible-group.js +38 -40
  46. package/lib/victory-animation/util.js +2 -2
  47. package/lib/victory-animation/victory-animation.js +49 -49
  48. package/lib/victory-clip-container/victory-clip-container.js +74 -74
  49. package/lib/victory-container/victory-container.js +90 -95
  50. package/lib/victory-label/victory-label.js +35 -27
  51. package/lib/victory-portal/portal-context.js +1 -1
  52. package/lib/victory-portal/portal.js +31 -27
  53. package/lib/victory-portal/victory-portal.js +34 -42
  54. package/lib/victory-primitives/arc.js +9 -5
  55. package/lib/victory-primitives/background.js +11 -7
  56. package/lib/victory-primitives/border.js +9 -5
  57. package/lib/victory-primitives/circle.js +8 -4
  58. package/lib/victory-primitives/clip-path.js +1 -1
  59. package/lib/victory-primitives/line-segment.js +9 -5
  60. package/lib/victory-primitives/line.js +8 -4
  61. package/lib/victory-primitives/path.js +7 -3
  62. package/lib/victory-primitives/point.js +9 -5
  63. package/lib/victory-primitives/rect.js +8 -4
  64. package/lib/victory-primitives/text.js +7 -3
  65. package/lib/victory-primitives/tspan.js +1 -1
  66. package/lib/victory-primitives/whisker.js +12 -8
  67. package/lib/victory-transition/victory-transition.js +33 -33
  68. package/lib/victory-util/add-events.js +328 -311
  69. package/lib/victory-util/axis.js +20 -11
  70. package/lib/victory-util/collection.js +11 -7
  71. package/lib/victory-util/common-props.js +4 -2
  72. package/lib/victory-util/data.js +13 -7
  73. package/lib/victory-util/default-transitions.js +1 -1
  74. package/lib/victory-util/domain.js +11 -5
  75. package/lib/victory-util/events.js +17 -11
  76. package/lib/victory-util/helpers.js +14 -14
  77. package/lib/victory-util/hooks/index.js +4 -4
  78. package/lib/victory-util/hooks/use-animation-state.js +14 -6
  79. package/lib/victory-util/immutable.js +3 -3
  80. package/lib/victory-util/label-helpers.js +6 -4
  81. package/lib/victory-util/line-helpers.js +4 -2
  82. package/lib/victory-util/prop-types.js +5 -3
  83. package/lib/victory-util/scale.js +24 -21
  84. package/lib/victory-util/selection.js +6 -4
  85. package/lib/victory-util/textsize.js +12 -8
  86. package/lib/victory-util/timer-context.js +1 -1
  87. package/lib/victory-util/timer.js +3 -5
  88. package/lib/victory-util/user-props.js +119 -0
  89. package/lib/victory-util/wrapper.js +31 -23
  90. package/package.json +4 -11
  91. package/src/index.d.ts +1 -0
  92. package/src/index.js +1 -0
  93. package/src/victory-animation/util.js +1 -1
  94. package/src/victory-animation/victory-animation.js +1 -1
  95. package/src/victory-container/victory-container.js +7 -1
  96. package/src/victory-label/victory-label.js +6 -6
  97. package/src/victory-util/add-events.js +6 -2
  98. package/src/victory-util/axis.js +3 -0
  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 +81 -0
package/es/index.d.ts CHANGED
@@ -248,6 +248,7 @@ export interface VictoryLabelProps {
248
248
  style?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
249
249
  tabIndex?: NumberOrCallback;
250
250
  text?: string[] | StringOrNumberOrCallback;
251
+ textComponent?: React.ReactElement;
251
252
  textAnchor?: TextAnchorType | { (): TextAnchorType };
252
253
  title?: string;
253
254
  transform?: string | {} | { (): string | {} };
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,29 +3,43 @@ 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); }
23
29
 
24
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
30
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
+
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";
@@ -35,17 +49,17 @@ import ClipPath from "../victory-primitives/clip-path";
35
49
  import Circle from "../victory-primitives/circle";
36
50
  import Rect from "../victory-primitives/rect";
37
51
 
38
- var VictoryClipContainer =
39
- /*#__PURE__*/
40
- function (_React$Component) {
52
+ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
41
53
  _inherits(VictoryClipContainer, _React$Component);
42
54
 
55
+ var _super = _createSuper(VictoryClipContainer);
56
+
43
57
  function VictoryClipContainer(props) {
44
58
  var _this;
45
59
 
46
60
  _classCallCheck(this, VictoryClipContainer);
47
61
 
48
- _this = _possibleConstructorReturn(this, (VictoryClipContainer.__proto__ || Object.getPrototypeOf(VictoryClipContainer)).call(this, props));
62
+ _this = _super.call(this, props);
49
63
  _this.clipId = !_isObject(props) || props.clipId === undefined ? _uniqueId("victory-clip-") : props.clipId;
50
64
  return _this;
51
65
  }
@@ -94,7 +108,7 @@ function (_React$Component) {
94
108
  clipPath: "url(#".concat(clipId, ")")
95
109
  }, events);
96
110
 
97
- return React.cloneElement(groupComponent, _objectSpread({}, groupProps, {
111
+ return /*#__PURE__*/React.cloneElement(groupComponent, _objectSpread(_objectSpread({}, groupProps), {}, {
98
112
  "aria-label": props["aria-label"],
99
113
  tabIndex: tabIndex
100
114
  }), [clipComponent].concat(_toConsumableArray(React.Children.toArray(children))));
@@ -109,7 +123,7 @@ function (_React$Component) {
109
123
  className = props.className,
110
124
  groupComponent = props.groupComponent,
111
125
  tabIndex = props.tabIndex;
112
- return React.cloneElement(groupComponent, _assign({
126
+ return /*#__PURE__*/React.cloneElement(groupComponent, _assign({
113
127
  className: className,
114
128
  style: style,
115
129
  transform: transform,
@@ -151,7 +165,7 @@ function (_React$Component) {
151
165
  cx: origin.x - left,
152
166
  cy: origin.y - top
153
167
  };
154
- child = React.cloneElement(circleComponent, circleProps);
168
+ child = /*#__PURE__*/React.cloneElement(circleComponent, circleProps);
155
169
  } else {
156
170
  var rectProps = {
157
171
  x: translateX - left,
@@ -159,10 +173,10 @@ function (_React$Component) {
159
173
  width: Math.max(clipWidth + left + right, 0),
160
174
  height: Math.max(clipHeight + top + bottom, 0)
161
175
  };
162
- child = React.cloneElement(rectComponent, rectProps);
176
+ child = /*#__PURE__*/React.cloneElement(rectComponent, rectProps);
163
177
  }
164
178
 
165
- return React.cloneElement(clipPathComponent, _assign({
179
+ return /*#__PURE__*/React.cloneElement(clipPathComponent, _assign({
166
180
  key: "clip-path-".concat(clipId)
167
181
  }, props, {
168
182
  clipId: clipId
@@ -225,61 +239,45 @@ function (_React$Component) {
225
239
  return VictoryClipContainer;
226
240
  }(React.Component);
227
241
 
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
- }
242
+ _defineProperty(VictoryClipContainer, "displayName", "VictoryClipContainer");
243
+
244
+ _defineProperty(VictoryClipContainer, "role", "container");
245
+
246
+ _defineProperty(VictoryClipContainer, "propTypes", {
247
+ "aria-label": PropTypes.string,
248
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
249
+ circleComponent: PropTypes.element,
250
+ className: PropTypes.string,
251
+ clipHeight: CustomPropTypes.nonNegative,
252
+ clipId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
253
+ clipPadding: PropTypes.shape({
254
+ top: PropTypes.number,
255
+ bottom: PropTypes.number,
256
+ left: PropTypes.number,
257
+ right: PropTypes.number
258
+ }),
259
+ clipPathComponent: PropTypes.element,
260
+ clipWidth: CustomPropTypes.nonNegative,
261
+ events: PropTypes.object,
262
+ groupComponent: PropTypes.element,
263
+ origin: PropTypes.shape({
264
+ x: CustomPropTypes.nonNegative,
265
+ y: CustomPropTypes.nonNegative
266
+ }),
267
+ polar: PropTypes.bool,
268
+ radius: CustomPropTypes.nonNegative,
269
+ style: PropTypes.object,
270
+ tabIndex: PropTypes.number,
271
+ transform: PropTypes.string,
272
+ translateX: PropTypes.number,
273
+ translateY: PropTypes.number
273
274
  });
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
- }
275
+
276
+ _defineProperty(VictoryClipContainer, "defaultProps", {
277
+ circleComponent: /*#__PURE__*/React.createElement(Circle, null),
278
+ rectComponent: /*#__PURE__*/React.createElement(Rect, null),
279
+ clipPathComponent: /*#__PURE__*/React.createElement(ClipPath, null),
280
+ groupComponent: /*#__PURE__*/React.createElement("g", null)
284
281
  });
282
+
285
283
  export { VictoryClipContainer as default };