victory-core 36.3.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.
- package/dist/victory-core.js +14175 -14191
- package/dist/victory-core.min.js +1 -1
- package/es/victory-accessible-group/victory-accessible-group.js +38 -40
- package/es/victory-animation/util.js +1 -1
- package/es/victory-animation/victory-animation.js +46 -48
- package/es/victory-clip-container/victory-clip-container.js +71 -73
- package/es/victory-container/victory-container.js +82 -92
- package/es/victory-label/victory-label.js +29 -24
- package/es/victory-portal/portal-context.js +1 -1
- package/es/victory-portal/portal.js +28 -26
- package/es/victory-portal/victory-portal.js +31 -41
- package/es/victory-primitives/arc.js +6 -4
- package/es/victory-primitives/background.js +8 -6
- package/es/victory-primitives/border.js +6 -4
- package/es/victory-primitives/circle.js +8 -4
- package/es/victory-primitives/clip-path.js +1 -1
- package/es/victory-primitives/line-segment.js +6 -4
- package/es/victory-primitives/line.js +8 -4
- package/es/victory-primitives/path.js +7 -3
- package/es/victory-primitives/point.js +6 -4
- package/es/victory-primitives/rect.js +8 -4
- package/es/victory-primitives/text.js +7 -3
- package/es/victory-primitives/tspan.js +1 -1
- package/es/victory-primitives/whisker.js +9 -7
- package/es/victory-transition/victory-transition.js +30 -32
- package/es/victory-util/add-events.js +326 -317
- package/es/victory-util/axis.js +12 -5
- package/es/victory-util/collection.js +8 -4
- package/es/victory-util/data.js +9 -5
- package/es/victory-util/domain.js +8 -4
- package/es/victory-util/events.js +8 -4
- package/es/victory-util/helpers.js +1 -1
- package/es/victory-util/hooks/use-animation-state.js +11 -5
- package/es/victory-util/line-helpers.js +1 -1
- package/es/victory-util/scale.js +19 -19
- package/es/victory-util/textsize.js +11 -7
- package/es/victory-util/timer-context.js +1 -1
- package/es/victory-util/timer.js +3 -5
- package/es/victory-util/user-props.js +31 -4
- package/es/victory-util/wrapper.js +18 -12
- package/lib/index.js +68 -58
- package/lib/victory-accessible-group/victory-accessible-group.js +38 -40
- package/lib/victory-animation/util.js +2 -2
- package/lib/victory-animation/victory-animation.js +49 -49
- package/lib/victory-clip-container/victory-clip-container.js +74 -74
- package/lib/victory-container/victory-container.js +85 -93
- package/lib/victory-label/victory-label.js +35 -27
- package/lib/victory-portal/portal-context.js +1 -1
- package/lib/victory-portal/portal.js +31 -27
- package/lib/victory-portal/victory-portal.js +34 -42
- package/lib/victory-primitives/arc.js +9 -5
- package/lib/victory-primitives/background.js +11 -7
- package/lib/victory-primitives/border.js +9 -5
- package/lib/victory-primitives/circle.js +8 -4
- package/lib/victory-primitives/clip-path.js +1 -1
- package/lib/victory-primitives/line-segment.js +9 -5
- package/lib/victory-primitives/line.js +8 -4
- package/lib/victory-primitives/path.js +7 -3
- package/lib/victory-primitives/point.js +9 -5
- package/lib/victory-primitives/rect.js +8 -4
- package/lib/victory-primitives/text.js +7 -3
- package/lib/victory-primitives/tspan.js +1 -1
- package/lib/victory-primitives/whisker.js +12 -8
- package/lib/victory-transition/victory-transition.js +33 -33
- package/lib/victory-util/add-events.js +325 -313
- package/lib/victory-util/axis.js +20 -11
- package/lib/victory-util/collection.js +11 -7
- package/lib/victory-util/common-props.js +4 -2
- package/lib/victory-util/data.js +13 -7
- package/lib/victory-util/default-transitions.js +1 -1
- package/lib/victory-util/domain.js +11 -5
- package/lib/victory-util/events.js +17 -11
- package/lib/victory-util/helpers.js +14 -14
- package/lib/victory-util/hooks/index.js +4 -4
- package/lib/victory-util/hooks/use-animation-state.js +14 -6
- package/lib/victory-util/immutable.js +3 -3
- package/lib/victory-util/label-helpers.js +6 -4
- package/lib/victory-util/line-helpers.js +4 -2
- package/lib/victory-util/prop-types.js +5 -3
- package/lib/victory-util/scale.js +24 -21
- package/lib/victory-util/selection.js +6 -4
- package/lib/victory-util/textsize.js +12 -8
- package/lib/victory-util/timer-context.js +1 -1
- package/lib/victory-util/timer.js +3 -5
- package/lib/victory-util/user-props.js +31 -4
- package/lib/victory-util/wrapper.js +31 -23
- package/package.json +4 -11
- package/src/victory-animation/util.js +1 -1
- package/src/victory-animation/victory-animation.js +1 -1
- package/src/victory-label/victory-label.js +6 -6
- package/src/victory-util/axis.js +3 -0
- package/src/victory-util/line-helpers.js +1 -1
- package/src/victory-util/scale.js +18 -9
- package/src/victory-util/timer.js +1 -1
- package/src/victory-util/user-props.js +18 -1
|
@@ -27,45 +27,61 @@ var _circle = _interopRequireDefault(require("../victory-primitives/circle"));
|
|
|
27
27
|
|
|
28
28
|
var _rect = _interopRequireDefault(require("../victory-primitives/rect"));
|
|
29
29
|
|
|
30
|
-
function
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
31
33
|
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
36
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
35
37
|
|
|
36
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
38
|
+
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."); }
|
|
37
39
|
|
|
38
|
-
function
|
|
40
|
+
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); }
|
|
39
41
|
|
|
40
|
-
function
|
|
42
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
41
43
|
|
|
42
|
-
function
|
|
44
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
43
45
|
|
|
44
|
-
function
|
|
46
|
+
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
|
+
|
|
48
|
+
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; }
|
|
49
|
+
|
|
50
|
+
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; }
|
|
45
51
|
|
|
46
52
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
47
53
|
|
|
48
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); } }
|
|
49
55
|
|
|
50
|
-
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); }
|
|
51
59
|
|
|
52
|
-
function
|
|
60
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
61
|
+
|
|
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); }
|
|
53
65
|
|
|
54
66
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
55
67
|
|
|
56
|
-
function
|
|
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; } }
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
function (
|
|
70
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
71
|
+
|
|
72
|
+
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; }
|
|
73
|
+
|
|
74
|
+
var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
61
75
|
_inherits(VictoryClipContainer, _React$Component);
|
|
62
76
|
|
|
77
|
+
var _super = _createSuper(VictoryClipContainer);
|
|
78
|
+
|
|
63
79
|
function VictoryClipContainer(props) {
|
|
64
80
|
var _this;
|
|
65
81
|
|
|
66
82
|
_classCallCheck(this, VictoryClipContainer);
|
|
67
83
|
|
|
68
|
-
_this =
|
|
84
|
+
_this = _super.call(this, props);
|
|
69
85
|
_this.clipId = !(0, _isObject2.default)(props) || props.clipId === undefined ? (0, _uniqueId2.default)("victory-clip-") : props.clipId;
|
|
70
86
|
return _this;
|
|
71
87
|
}
|
|
@@ -112,7 +128,7 @@ function (_React$Component) {
|
|
|
112
128
|
key: "clipped-group-".concat(clipId),
|
|
113
129
|
clipPath: "url(#".concat(clipId, ")")
|
|
114
130
|
}, events);
|
|
115
|
-
return _react.default.cloneElement(groupComponent, _objectSpread({}, groupProps, {
|
|
131
|
+
return /*#__PURE__*/_react.default.cloneElement(groupComponent, _objectSpread(_objectSpread({}, groupProps), {}, {
|
|
116
132
|
"aria-label": props["aria-label"],
|
|
117
133
|
tabIndex: tabIndex
|
|
118
134
|
}), [clipComponent].concat(_toConsumableArray(_react.default.Children.toArray(children))));
|
|
@@ -127,7 +143,7 @@ function (_React$Component) {
|
|
|
127
143
|
className = props.className,
|
|
128
144
|
groupComponent = props.groupComponent,
|
|
129
145
|
tabIndex = props.tabIndex;
|
|
130
|
-
return _react.default.cloneElement(groupComponent, (0, _assign2.default)({
|
|
146
|
+
return /*#__PURE__*/_react.default.cloneElement(groupComponent, (0, _assign2.default)({
|
|
131
147
|
className: className,
|
|
132
148
|
style: style,
|
|
133
149
|
transform: transform,
|
|
@@ -169,7 +185,7 @@ function (_React$Component) {
|
|
|
169
185
|
cx: origin.x - left,
|
|
170
186
|
cy: origin.y - top
|
|
171
187
|
};
|
|
172
|
-
child = _react.default.cloneElement(circleComponent, circleProps);
|
|
188
|
+
child = /*#__PURE__*/_react.default.cloneElement(circleComponent, circleProps);
|
|
173
189
|
} else {
|
|
174
190
|
var rectProps = {
|
|
175
191
|
x: translateX - left,
|
|
@@ -177,10 +193,10 @@ function (_React$Component) {
|
|
|
177
193
|
width: Math.max(clipWidth + left + right, 0),
|
|
178
194
|
height: Math.max(clipHeight + top + bottom, 0)
|
|
179
195
|
};
|
|
180
|
-
child = _react.default.cloneElement(rectComponent, rectProps);
|
|
196
|
+
child = /*#__PURE__*/_react.default.cloneElement(rectComponent, rectProps);
|
|
181
197
|
}
|
|
182
198
|
|
|
183
|
-
return _react.default.cloneElement(clipPathComponent, (0, _assign2.default)({
|
|
199
|
+
return /*#__PURE__*/_react.default.cloneElement(clipPathComponent, (0, _assign2.default)({
|
|
184
200
|
key: "clip-path-".concat(clipId)
|
|
185
201
|
}, props, {
|
|
186
202
|
clipId: clipId
|
|
@@ -242,60 +258,44 @@ function (_React$Component) {
|
|
|
242
258
|
}(_react.default.Component);
|
|
243
259
|
|
|
244
260
|
exports.default = VictoryClipContainer;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
origin: _propTypes.default.shape({
|
|
279
|
-
x: CustomPropTypes.nonNegative,
|
|
280
|
-
y: CustomPropTypes.nonNegative
|
|
281
|
-
}),
|
|
282
|
-
polar: _propTypes.default.bool,
|
|
283
|
-
radius: CustomPropTypes.nonNegative,
|
|
284
|
-
style: _propTypes.default.object,
|
|
285
|
-
tabIndex: _propTypes.default.number,
|
|
286
|
-
transform: _propTypes.default.string,
|
|
287
|
-
translateX: _propTypes.default.number,
|
|
288
|
-
translateY: _propTypes.default.number
|
|
289
|
-
}
|
|
261
|
+
|
|
262
|
+
_defineProperty(VictoryClipContainer, "displayName", "VictoryClipContainer");
|
|
263
|
+
|
|
264
|
+
_defineProperty(VictoryClipContainer, "role", "container");
|
|
265
|
+
|
|
266
|
+
_defineProperty(VictoryClipContainer, "propTypes", {
|
|
267
|
+
"aria-label": _propTypes.default.string,
|
|
268
|
+
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
|
|
269
|
+
circleComponent: _propTypes.default.element,
|
|
270
|
+
className: _propTypes.default.string,
|
|
271
|
+
clipHeight: CustomPropTypes.nonNegative,
|
|
272
|
+
clipId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
273
|
+
clipPadding: _propTypes.default.shape({
|
|
274
|
+
top: _propTypes.default.number,
|
|
275
|
+
bottom: _propTypes.default.number,
|
|
276
|
+
left: _propTypes.default.number,
|
|
277
|
+
right: _propTypes.default.number
|
|
278
|
+
}),
|
|
279
|
+
clipPathComponent: _propTypes.default.element,
|
|
280
|
+
clipWidth: CustomPropTypes.nonNegative,
|
|
281
|
+
events: _propTypes.default.object,
|
|
282
|
+
groupComponent: _propTypes.default.element,
|
|
283
|
+
origin: _propTypes.default.shape({
|
|
284
|
+
x: CustomPropTypes.nonNegative,
|
|
285
|
+
y: CustomPropTypes.nonNegative
|
|
286
|
+
}),
|
|
287
|
+
polar: _propTypes.default.bool,
|
|
288
|
+
radius: CustomPropTypes.nonNegative,
|
|
289
|
+
style: _propTypes.default.object,
|
|
290
|
+
tabIndex: _propTypes.default.number,
|
|
291
|
+
transform: _propTypes.default.string,
|
|
292
|
+
translateX: _propTypes.default.number,
|
|
293
|
+
translateY: _propTypes.default.number
|
|
290
294
|
});
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
rectComponent: _react.default.createElement(_rect.default, null),
|
|
298
|
-
clipPathComponent: _react.default.createElement(_clipPath.default, null),
|
|
299
|
-
groupComponent: _react.default.createElement("g", null)
|
|
300
|
-
}
|
|
295
|
+
|
|
296
|
+
_defineProperty(VictoryClipContainer, "defaultProps", {
|
|
297
|
+
circleComponent: /*#__PURE__*/_react.default.createElement(_circle.default, null),
|
|
298
|
+
rectComponent: /*#__PURE__*/_react.default.createElement(_rect.default, null),
|
|
299
|
+
clipPathComponent: /*#__PURE__*/_react.default.createElement(_clipPath.default, null),
|
|
300
|
+
groupComponent: /*#__PURE__*/_react.default.createElement("g", null)
|
|
301
301
|
});
|
|
@@ -31,39 +31,51 @@ var Helpers = _interopRequireWildcard(require("../victory-util/helpers"));
|
|
|
31
31
|
|
|
32
32
|
var UserProps = _interopRequireWildcard(require("../victory-util/user-props"));
|
|
33
33
|
|
|
34
|
-
function
|
|
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
|
+
|
|
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; }
|
|
35
37
|
|
|
36
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
39
|
|
|
38
40
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
39
41
|
|
|
40
|
-
function
|
|
42
|
+
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; }
|
|
41
43
|
|
|
42
|
-
function
|
|
44
|
+
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; }
|
|
43
45
|
|
|
44
46
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
45
47
|
|
|
46
48
|
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); } }
|
|
47
49
|
|
|
48
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
50
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
51
|
+
|
|
52
|
+
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
|
+
|
|
54
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
55
|
|
|
50
|
-
function
|
|
56
|
+
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); }; }
|
|
57
|
+
|
|
58
|
+
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); }
|
|
51
59
|
|
|
52
60
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
53
61
|
|
|
54
|
-
function
|
|
62
|
+
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; } }
|
|
63
|
+
|
|
64
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
65
|
+
|
|
66
|
+
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; }
|
|
55
67
|
|
|
56
|
-
var VictoryContainer =
|
|
57
|
-
/*#__PURE__*/
|
|
58
|
-
function (_React$Component) {
|
|
68
|
+
var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
59
69
|
_inherits(VictoryContainer, _React$Component);
|
|
60
70
|
|
|
71
|
+
var _super = _createSuper(VictoryContainer);
|
|
72
|
+
|
|
61
73
|
function VictoryContainer(props) {
|
|
62
74
|
var _this;
|
|
63
75
|
|
|
64
76
|
_classCallCheck(this, VictoryContainer);
|
|
65
77
|
|
|
66
|
-
_this =
|
|
78
|
+
_this = _super.call(this, props);
|
|
67
79
|
_this.containerId = !(0, _isObject2.default)(props) || props.containerId === undefined ? (0, _uniqueId2.default)("victory-container-") : props.containerId;
|
|
68
80
|
|
|
69
81
|
_this.savePortalRef = function (portal) {
|
|
@@ -131,11 +143,11 @@ function (_React$Component) {
|
|
|
131
143
|
var ouiaId = props.ouiaId,
|
|
132
144
|
ouiaSafe = props.ouiaSafe,
|
|
133
145
|
ouiaType = props.ouiaType;
|
|
134
|
-
return _objectSpread({}, ouiaId && {
|
|
146
|
+
return _objectSpread(_objectSpread(_objectSpread({}, ouiaId && {
|
|
135
147
|
"data-ouia-component-id": ouiaId
|
|
136
|
-
}, ouiaType && {
|
|
148
|
+
}), ouiaType && {
|
|
137
149
|
"data-ouia-component-type": ouiaType
|
|
138
|
-
}, ouiaSafe !== undefined && {
|
|
150
|
+
}), ouiaSafe !== undefined && {
|
|
139
151
|
"data-ouia-safe": ouiaSafe
|
|
140
152
|
});
|
|
141
153
|
}
|
|
@@ -182,41 +194,41 @@ function (_React$Component) {
|
|
|
182
194
|
preserveAspectRatio: svgProps.preserveAspectRatio,
|
|
183
195
|
style: portalSvgStyle
|
|
184
196
|
};
|
|
185
|
-
return _react.default.createElement(_portalContext.default.Provider, {
|
|
197
|
+
return /*#__PURE__*/_react.default.createElement(_portalContext.default.Provider, {
|
|
186
198
|
value: {
|
|
187
199
|
portalUpdate: this.portalUpdate,
|
|
188
200
|
portalRegister: this.portalRegister,
|
|
189
201
|
portalDeregister: this.portalDeregister
|
|
190
202
|
}
|
|
191
|
-
}, _react.default.createElement("div", _extends({
|
|
203
|
+
}, /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
192
204
|
style: (0, _defaults2.default)({}, style, divStyle),
|
|
193
205
|
className: className,
|
|
194
206
|
ref: this.saveContainerRef
|
|
195
|
-
}, this.getOUIAProps(props)), _react.default.createElement("svg", _extends({}, svgProps, {
|
|
207
|
+
}, this.getOUIAProps(props)), /*#__PURE__*/_react.default.createElement("svg", _extends({}, svgProps, {
|
|
196
208
|
style: svgStyle
|
|
197
|
-
}), title ? _react.default.createElement("title", {
|
|
209
|
+
}), title ? /*#__PURE__*/_react.default.createElement("title", {
|
|
198
210
|
id: this.getIdForElement("title")
|
|
199
|
-
}, title) : null, desc ? _react.default.createElement("desc", {
|
|
211
|
+
}, title) : null, desc ? /*#__PURE__*/_react.default.createElement("desc", {
|
|
200
212
|
id: this.getIdForElement("desc")
|
|
201
|
-
}, desc) : null, children), _react.default.createElement("div", {
|
|
213
|
+
}, desc) : null, children), /*#__PURE__*/_react.default.createElement("div", {
|
|
202
214
|
style: portalDivStyle
|
|
203
|
-
}, _react.default.cloneElement(portalComponent, _objectSpread({}, portalProps, {
|
|
215
|
+
}, /*#__PURE__*/_react.default.cloneElement(portalComponent, _objectSpread(_objectSpread({}, portalProps), {}, {
|
|
204
216
|
ref: this.savePortalRef
|
|
205
217
|
})))));
|
|
206
218
|
}
|
|
207
219
|
}, {
|
|
208
220
|
key: "render",
|
|
209
221
|
value: function render() {
|
|
210
|
-
var
|
|
211
|
-
width =
|
|
212
|
-
height =
|
|
213
|
-
responsive =
|
|
214
|
-
events =
|
|
215
|
-
title =
|
|
216
|
-
desc =
|
|
217
|
-
tabIndex =
|
|
218
|
-
preserveAspectRatio =
|
|
219
|
-
role =
|
|
222
|
+
var _this$props = this.props,
|
|
223
|
+
width = _this$props.width,
|
|
224
|
+
height = _this$props.height,
|
|
225
|
+
responsive = _this$props.responsive,
|
|
226
|
+
events = _this$props.events,
|
|
227
|
+
title = _this$props.title,
|
|
228
|
+
desc = _this$props.desc,
|
|
229
|
+
tabIndex = _this$props.tabIndex,
|
|
230
|
+
preserveAspectRatio = _this$props.preserveAspectRatio,
|
|
231
|
+
role = _this$props.role;
|
|
220
232
|
var style = responsive ? this.props.style : Helpers.omit(this.props.style, ["height", "width"]);
|
|
221
233
|
var userProps = UserProps.getSafeUserProps(this.props);
|
|
222
234
|
var svgProps = (0, _assign2.default)(_objectSpread({
|
|
@@ -237,68 +249,48 @@ function (_React$Component) {
|
|
|
237
249
|
}(_react.default.Component);
|
|
238
250
|
|
|
239
251
|
exports.default = VictoryContainer;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
polar: _propTypes.default.bool,
|
|
275
|
-
portalComponent: _propTypes.default.element,
|
|
276
|
-
portalZIndex: CustomPropTypes.integer,
|
|
277
|
-
preserveAspectRatio: _propTypes.default.string,
|
|
278
|
-
responsive: _propTypes.default.bool,
|
|
279
|
-
role: _propTypes.default.string,
|
|
280
|
-
style: _propTypes.default.object,
|
|
281
|
-
tabIndex: _propTypes.default.number,
|
|
282
|
-
theme: _propTypes.default.object,
|
|
283
|
-
title: _propTypes.default.string,
|
|
284
|
-
width: CustomPropTypes.nonNegative
|
|
285
|
-
}
|
|
252
|
+
|
|
253
|
+
_defineProperty(VictoryContainer, "displayName", "VictoryContainer");
|
|
254
|
+
|
|
255
|
+
_defineProperty(VictoryContainer, "role", "container");
|
|
256
|
+
|
|
257
|
+
_defineProperty(VictoryContainer, "propTypes", {
|
|
258
|
+
"aria-describedby": _propTypes.default.string,
|
|
259
|
+
"aria-labelledby": _propTypes.default.string,
|
|
260
|
+
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
|
|
261
|
+
className: _propTypes.default.string,
|
|
262
|
+
containerId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
263
|
+
containerRef: _propTypes.default.func,
|
|
264
|
+
desc: _propTypes.default.string,
|
|
265
|
+
events: _propTypes.default.object,
|
|
266
|
+
height: CustomPropTypes.nonNegative,
|
|
267
|
+
name: _propTypes.default.string,
|
|
268
|
+
origin: _propTypes.default.shape({
|
|
269
|
+
x: CustomPropTypes.nonNegative,
|
|
270
|
+
y: CustomPropTypes.nonNegative
|
|
271
|
+
}),
|
|
272
|
+
ouiaId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
273
|
+
ouiaSafe: _propTypes.default.bool,
|
|
274
|
+
ouiaType: _propTypes.default.string,
|
|
275
|
+
polar: _propTypes.default.bool,
|
|
276
|
+
portalComponent: _propTypes.default.element,
|
|
277
|
+
portalZIndex: CustomPropTypes.integer,
|
|
278
|
+
preserveAspectRatio: _propTypes.default.string,
|
|
279
|
+
responsive: _propTypes.default.bool,
|
|
280
|
+
role: _propTypes.default.string,
|
|
281
|
+
style: _propTypes.default.object,
|
|
282
|
+
tabIndex: _propTypes.default.number,
|
|
283
|
+
theme: _propTypes.default.object,
|
|
284
|
+
title: _propTypes.default.string,
|
|
285
|
+
width: CustomPropTypes.nonNegative
|
|
286
286
|
});
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
portalZIndex: 99,
|
|
295
|
-
responsive: true,
|
|
296
|
-
role: "img"
|
|
297
|
-
}
|
|
287
|
+
|
|
288
|
+
_defineProperty(VictoryContainer, "defaultProps", {
|
|
289
|
+
className: "VictoryContainer",
|
|
290
|
+
portalComponent: /*#__PURE__*/_react.default.createElement(_portal.default, null),
|
|
291
|
+
portalZIndex: 99,
|
|
292
|
+
responsive: true,
|
|
293
|
+
role: "img"
|
|
298
294
|
});
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
enumerable: true,
|
|
302
|
-
writable: true,
|
|
303
|
-
value: _timerContext.default
|
|
304
|
-
});
|
|
295
|
+
|
|
296
|
+
_defineProperty(VictoryContainer, "contextType", _timerContext.default);
|