victory-core 36.4.1 → 36.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/victory-core.js +874 -879
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +38 -941
- package/es/index.js +19 -28
- package/es/types.d.ts +33 -0
- package/es/types.js +1 -0
- package/es/victory-accessible-group/victory-accessible-group.d.ts +25 -0
- package/es/victory-accessible-group/victory-accessible-group.js +8 -16
- package/es/victory-animation/util.d.ts +66 -0
- package/es/victory-animation/util.js +2 -1
- package/es/victory-animation/victory-animation.d.ts +69 -0
- package/es/victory-animation/victory-animation.js +59 -67
- package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/es/victory-clip-container/victory-clip-container.js +15 -21
- package/es/victory-container/victory-container.d.ts +99 -0
- package/es/victory-container/victory-container.js +31 -31
- package/es/victory-label/victory-label.d.ts +61 -0
- package/es/victory-label/victory-label.js +13 -8
- package/es/victory-portal/portal-context.d.ts +11 -0
- package/es/victory-portal/portal-context.js +3 -4
- package/es/victory-portal/portal.d.ts +28 -0
- package/es/victory-portal/portal.js +25 -33
- package/es/victory-portal/victory-portal.d.ts +31 -0
- package/es/victory-portal/victory-portal.js +23 -22
- package/es/victory-primitives/arc.d.ts +21 -0
- package/es/victory-primitives/arc.js +3 -5
- package/es/victory-primitives/background.d.ts +22 -0
- package/es/victory-primitives/background.js +4 -6
- package/es/victory-primitives/border.d.ts +18 -0
- package/es/victory-primitives/border.js +3 -5
- package/es/victory-primitives/circle.d.ts +2 -0
- package/es/victory-primitives/circle.js +11 -8
- package/es/victory-primitives/clip-path.d.ts +14 -0
- package/es/victory-primitives/clip-path.js +6 -6
- package/es/victory-primitives/index.d.ts +14 -0
- package/es/victory-primitives/index.js +14 -0
- package/es/victory-primitives/line-segment.d.ts +19 -0
- package/es/victory-primitives/line-segment.js +3 -5
- package/es/victory-primitives/line.d.ts +2 -0
- package/es/victory-primitives/line.js +11 -8
- package/es/victory-primitives/path.d.ts +2 -0
- package/es/victory-primitives/path.js +9 -6
- package/es/victory-primitives/point.d.ts +21 -0
- package/es/victory-primitives/point.js +9 -19
- package/es/victory-primitives/rect.d.ts +2 -0
- package/es/victory-primitives/rect.js +11 -8
- package/es/victory-primitives/text.d.ts +16 -0
- package/es/victory-primitives/text.js +7 -6
- package/es/victory-primitives/tspan.d.ts +2 -0
- package/es/victory-primitives/tspan.js +7 -6
- package/es/victory-primitives/types.d.ts +7 -0
- package/es/victory-primitives/types.js +1 -0
- package/es/victory-primitives/whisker.d.ts +24 -0
- package/es/victory-primitives/whisker.js +3 -5
- package/es/victory-theme/grayscale.d.ts +2 -0
- package/es/victory-theme/grayscale.js +1 -1
- package/es/victory-theme/material.d.ts +2 -0
- package/es/victory-theme/material.js +1 -1
- package/es/victory-theme/victory-theme-definition.d.ts +244 -0
- package/es/victory-theme/victory-theme-definition.js +1 -0
- package/es/victory-theme/victory-theme.d.ts +5 -0
- package/es/victory-theme/victory-theme.js +6 -5
- package/es/victory-transition/victory-transition.d.ts +59 -0
- package/es/victory-transition/victory-transition.js +19 -23
- package/es/victory-util/add-events.js +6 -3
- package/es/victory-util/axis.js +0 -1
- package/es/victory-util/collection.js +0 -2
- package/es/victory-util/data.js +0 -2
- package/es/victory-util/default-transitions.js +0 -1
- package/es/victory-util/domain.js +0 -2
- package/es/victory-util/helpers.js +0 -2
- package/es/victory-util/immutable.js +0 -1
- package/es/victory-util/label-helpers.js +0 -2
- package/es/victory-util/log.js +0 -1
- package/es/victory-util/point-path-helpers.d.ts +9 -0
- package/es/victory-util/point-path-helpers.js +59 -61
- package/es/victory-util/selection.d.ts +23 -0
- package/es/victory-util/selection.js +0 -2
- package/es/victory-util/style.js +0 -2
- package/es/victory-util/textsize.d.ts +8 -0
- package/es/victory-util/timer-context.d.ts +11 -0
- package/es/victory-util/timer.d.ts +16 -0
- package/es/victory-util/timer.js +13 -8
- package/es/victory-util/types.d.ts +188 -0
- package/es/victory-util/types.js +1 -0
- package/lib/index.d.ts +38 -941
- package/lib/index.js +195 -193
- package/lib/types.d.ts +33 -0
- package/lib/types.js +1 -0
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +9 -15
- package/lib/victory-animation/util.d.ts +66 -0
- package/lib/victory-animation/util.js +2 -1
- package/lib/victory-animation/victory-animation.d.ts +69 -0
- package/lib/victory-animation/victory-animation.js +60 -65
- package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/lib/victory-clip-container/victory-clip-container.js +19 -22
- package/lib/victory-container/victory-container.d.ts +99 -0
- package/lib/victory-container/victory-container.js +34 -31
- package/lib/victory-label/victory-label.d.ts +61 -0
- package/lib/victory-label/victory-label.js +19 -13
- package/lib/victory-portal/portal-context.d.ts +11 -0
- package/lib/victory-portal/portal-context.js +3 -4
- package/lib/victory-portal/portal.d.ts +28 -0
- package/lib/victory-portal/portal.js +26 -31
- package/lib/victory-portal/victory-portal.d.ts +31 -0
- package/lib/victory-portal/victory-portal.js +24 -20
- package/lib/victory-primitives/arc.d.ts +21 -0
- package/lib/victory-primitives/arc.js +5 -6
- package/lib/victory-primitives/background.d.ts +22 -0
- package/lib/victory-primitives/background.js +7 -8
- package/lib/victory-primitives/border.d.ts +18 -0
- package/lib/victory-primitives/border.js +5 -6
- package/lib/victory-primitives/circle.d.ts +2 -0
- package/lib/victory-primitives/circle.js +11 -6
- package/lib/victory-primitives/clip-path.d.ts +14 -0
- package/lib/victory-primitives/clip-path.js +7 -5
- package/lib/victory-primitives/index.d.ts +14 -0
- package/lib/victory-primitives/index.js +187 -0
- package/lib/victory-primitives/line-segment.d.ts +19 -0
- package/lib/victory-primitives/line-segment.js +5 -6
- package/lib/victory-primitives/line.d.ts +2 -0
- package/lib/victory-primitives/line.js +11 -6
- package/lib/victory-primitives/path.d.ts +2 -0
- package/lib/victory-primitives/path.js +9 -4
- package/lib/victory-primitives/point.d.ts +21 -0
- package/lib/victory-primitives/point.js +13 -21
- package/lib/victory-primitives/rect.d.ts +2 -0
- package/lib/victory-primitives/rect.js +11 -6
- package/lib/victory-primitives/text.d.ts +16 -0
- package/lib/victory-primitives/text.js +8 -5
- package/lib/victory-primitives/tspan.d.ts +2 -0
- package/lib/victory-primitives/tspan.js +7 -4
- package/lib/victory-primitives/types.d.ts +7 -0
- package/lib/victory-primitives/types.js +1 -0
- package/lib/victory-primitives/whisker.d.ts +24 -0
- package/lib/victory-primitives/whisker.js +5 -6
- package/lib/victory-theme/grayscale.d.ts +2 -0
- package/lib/victory-theme/grayscale.js +3 -3
- package/lib/victory-theme/material.d.ts +2 -0
- package/lib/victory-theme/material.js +3 -3
- package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
- package/lib/victory-theme/victory-theme-definition.js +1 -0
- package/lib/victory-theme/victory-theme.d.ts +5 -0
- package/lib/victory-theme/victory-theme.js +22 -8
- package/lib/victory-transition/victory-transition.d.ts +59 -0
- package/lib/victory-transition/victory-transition.js +21 -23
- package/lib/victory-util/add-events.js +8 -4
- package/lib/victory-util/collection.js +0 -2
- package/lib/victory-util/default-transitions.js +0 -1
- package/lib/victory-util/helpers.js +0 -2
- package/lib/victory-util/immutable.js +0 -2
- package/lib/victory-util/label-helpers.js +0 -2
- package/lib/victory-util/log.js +0 -1
- package/lib/victory-util/point-path-helpers.d.ts +9 -0
- package/lib/victory-util/point-path-helpers.js +86 -73
- package/lib/victory-util/selection.d.ts +23 -0
- package/lib/victory-util/selection.js +0 -2
- package/lib/victory-util/style.js +0 -2
- package/lib/victory-util/textsize.d.ts +8 -0
- package/lib/victory-util/timer-context.d.ts +11 -0
- package/lib/victory-util/timer.d.ts +16 -0
- package/lib/victory-util/timer.js +13 -8
- package/lib/victory-util/types.d.ts +188 -0
- package/lib/victory-util/types.js +1 -0
- package/package.json +4 -4
- package/src/index.ts +42 -0
- package/src/types.ts +45 -0
- package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
- package/src/victory-animation/{util.js → util.ts} +4 -3
- package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +89 -12
- package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +29 -5
- package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
- package/src/victory-label/{victory-label.js → victory-label.tsx} +71 -14
- package/src/victory-portal/portal-context.ts +14 -0
- package/src/victory-portal/{portal.js → portal.tsx} +23 -12
- package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
- package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
- package/src/victory-primitives/{background.js → background.tsx} +17 -7
- package/src/victory-primitives/{border.js → border.tsx} +12 -5
- package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
- package/src/victory-primitives/clip-path.tsx +25 -0
- package/src/victory-primitives/index.ts +14 -0
- package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
- package/src/victory-primitives/{line.js → line.tsx} +4 -3
- package/src/victory-primitives/{path.js → path.tsx} +4 -3
- package/src/victory-primitives/{point.js → point.tsx} +25 -20
- package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
- package/src/victory-primitives/{text.js → text.tsx} +9 -3
- package/src/victory-primitives/tspan.tsx +7 -0
- package/src/victory-primitives/types.ts +19 -0
- package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
- package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
- package/src/victory-theme/{material.js → material.tsx} +2 -1
- package/src/victory-theme/victory-theme-definition.ts +261 -0
- package/src/victory-theme/victory-theme.tsx +5 -0
- package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
- package/src/victory-util/add-events.js +6 -1
- package/src/victory-util/axis.js +0 -1
- package/src/victory-util/collection.js +0 -1
- package/src/victory-util/data.js +0 -1
- package/src/victory-util/default-transitions.js +0 -1
- package/src/victory-util/domain.js +0 -1
- package/src/victory-util/events.js +1 -1
- package/src/victory-util/helpers.js +0 -1
- package/src/victory-util/immutable.js +0 -1
- package/src/victory-util/label-helpers.js +0 -1
- package/src/victory-util/log.js +0 -1
- package/src/victory-util/point-path-helpers.ts +119 -0
- package/src/victory-util/prop-types.js +0 -1
- package/src/victory-util/scale.js +0 -1
- package/src/victory-util/selection.d.ts +23 -0
- package/src/victory-util/selection.js +0 -1
- package/src/victory-util/style.js +0 -1
- package/src/victory-util/textsize.d.ts +8 -0
- package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
- package/src/victory-util/{timer.js → timer.ts} +19 -4
- package/src/victory-util/transitions.js +0 -1
- package/src/victory-util/types.ts +247 -0
- package/src/victory-util/wrapper.js +0 -1
- package/src/index.d.ts +0 -941
- package/src/index.js +0 -51
- package/src/victory-portal/portal-context.js +0 -10
- package/src/victory-primitives/clip-path.js +0 -18
- package/src/victory-primitives/tspan.js +0 -5
- package/src/victory-theme/victory-theme.js +0 -7
- package/src/victory-util/point-path-helpers.js +0 -121
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VictoryContainer = void 0;
|
|
7
7
|
|
|
8
8
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
9
9
|
|
|
@@ -21,9 +21,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
21
21
|
|
|
22
22
|
var CustomPropTypes = _interopRequireWildcard(require("../victory-util/prop-types"));
|
|
23
23
|
|
|
24
|
-
var _portal =
|
|
24
|
+
var _portal = require("../victory-portal/portal");
|
|
25
25
|
|
|
26
|
-
var _portalContext =
|
|
26
|
+
var _portalContext = require("../victory-portal/portal-context");
|
|
27
27
|
|
|
28
28
|
var _timerContext = _interopRequireDefault(require("../victory-util/timer-context"));
|
|
29
29
|
|
|
@@ -37,12 +37,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
37
37
|
|
|
38
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
39
|
|
|
40
|
-
function _extends() { _extends = Object.assign
|
|
40
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
41
41
|
|
|
42
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; }
|
|
43
43
|
|
|
44
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; }
|
|
45
45
|
|
|
46
|
+
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; }
|
|
47
|
+
|
|
46
48
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
47
49
|
|
|
48
50
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -51,7 +53,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
51
53
|
|
|
52
54
|
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
55
|
|
|
54
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
56
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
55
57
|
|
|
56
58
|
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
59
|
|
|
@@ -61,22 +63,25 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
61
63
|
|
|
62
64
|
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
65
|
|
|
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; }
|
|
66
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
67
67
|
|
|
68
68
|
var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
69
69
|
_inherits(VictoryContainer, _React$Component);
|
|
70
70
|
|
|
71
71
|
var _super = _createSuper(VictoryContainer);
|
|
72
72
|
|
|
73
|
+
// @ts-expect-error Ref will be initialized on mount
|
|
74
|
+
// @ts-expect-error Ref will be initialized on mount
|
|
73
75
|
function VictoryContainer(props) {
|
|
74
76
|
var _this;
|
|
75
77
|
|
|
76
78
|
_classCallCheck(this, VictoryContainer);
|
|
77
79
|
|
|
78
80
|
_this = _super.call(this, props);
|
|
79
|
-
_this.containerId =
|
|
81
|
+
_this.containerId = void 0;
|
|
82
|
+
_this.portalRef = void 0;
|
|
83
|
+
_this.containerRef = void 0;
|
|
84
|
+
_this.shouldHandleWheel = void 0;
|
|
80
85
|
|
|
81
86
|
_this.savePortalRef = function (portal) {
|
|
82
87
|
_this.portalRef = portal;
|
|
@@ -95,18 +100,21 @@ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
95
100
|
return _this.portalRef.portalDeregister(key);
|
|
96
101
|
};
|
|
97
102
|
|
|
98
|
-
_this.saveContainerRef =
|
|
103
|
+
_this.saveContainerRef = function (container) {
|
|
104
|
+
if ((0, _isFunction2.default)(_this.props.containerRef)) {
|
|
105
|
+
_this.props.containerRef(container);
|
|
106
|
+
}
|
|
107
|
+
|
|
99
108
|
_this.containerRef = container;
|
|
100
109
|
return container;
|
|
101
110
|
};
|
|
102
|
-
_this.shouldHandleWheel = props && props.events && props.events.onWheel;
|
|
103
111
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
};
|
|
108
|
-
}
|
|
112
|
+
_this.handleWheel = function (e) {
|
|
113
|
+
return e.preventDefault();
|
|
114
|
+
};
|
|
109
115
|
|
|
116
|
+
_this.containerId = !(0, _isObject2.default)(props) || props.containerId === undefined ? (0, _uniqueId2.default)("victory-container-") : props.containerId;
|
|
117
|
+
_this.shouldHandleWheel = !!(props && props.events && props.events.onWheel);
|
|
110
118
|
return _this;
|
|
111
119
|
}
|
|
112
120
|
|
|
@@ -194,7 +202,7 @@ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
194
202
|
preserveAspectRatio: svgProps.preserveAspectRatio,
|
|
195
203
|
style: portalSvgStyle
|
|
196
204
|
};
|
|
197
|
-
return /*#__PURE__*/_react.default.createElement(_portalContext.
|
|
205
|
+
return /*#__PURE__*/_react.default.createElement(_portalContext.PortalContext.Provider, {
|
|
198
206
|
value: {
|
|
199
207
|
portalUpdate: this.portalUpdate,
|
|
200
208
|
portalRegister: this.portalRegister,
|
|
@@ -248,13 +256,10 @@ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
248
256
|
return VictoryContainer;
|
|
249
257
|
}(_react.default.Component);
|
|
250
258
|
|
|
251
|
-
exports.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
_defineProperty(VictoryContainer, "role", "container");
|
|
256
|
-
|
|
257
|
-
_defineProperty(VictoryContainer, "propTypes", {
|
|
259
|
+
exports.VictoryContainer = VictoryContainer;
|
|
260
|
+
VictoryContainer.displayName = "VictoryContainer";
|
|
261
|
+
VictoryContainer.role = "container";
|
|
262
|
+
VictoryContainer.propTypes = {
|
|
258
263
|
"aria-describedby": _propTypes.default.string,
|
|
259
264
|
"aria-labelledby": _propTypes.default.string,
|
|
260
265
|
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
|
|
@@ -283,14 +288,12 @@ _defineProperty(VictoryContainer, "propTypes", {
|
|
|
283
288
|
theme: _propTypes.default.object,
|
|
284
289
|
title: _propTypes.default.string,
|
|
285
290
|
width: CustomPropTypes.nonNegative
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
_defineProperty(VictoryContainer, "defaultProps", {
|
|
291
|
+
};
|
|
292
|
+
VictoryContainer.defaultProps = {
|
|
289
293
|
className: "VictoryContainer",
|
|
290
|
-
portalComponent: /*#__PURE__*/_react.default.createElement(_portal.
|
|
294
|
+
portalComponent: /*#__PURE__*/_react.default.createElement(_portal.Portal, null),
|
|
291
295
|
portalZIndex: 99,
|
|
292
296
|
responsive: true,
|
|
293
297
|
role: "img"
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
_defineProperty(VictoryContainer, "contextType", _timerContext.default);
|
|
298
|
+
};
|
|
299
|
+
VictoryContainer.contextType = _timerContext.default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StringOrCallback, StringOrNumberOrCallback } from "../types";
|
|
3
|
+
import { NumberOrCallback, PaddingProps, VerticalAnchorType, VictoryLabelStyleObject } from "../victory-theme/victory-theme";
|
|
4
|
+
export declare type TextAnchorType = "start" | "middle" | "end" | "inherit";
|
|
5
|
+
export declare type OriginType = {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
export declare type LabelOrientationType = "parallel" | "perpendicular" | "vertical";
|
|
10
|
+
export interface VictoryLabelProps {
|
|
11
|
+
angle?: StringOrNumberOrCallback;
|
|
12
|
+
ariaLabel?: StringOrCallback;
|
|
13
|
+
backgroundComponent?: React.ReactElement;
|
|
14
|
+
backgroundStyle?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
15
|
+
backgroundPadding?: PaddingProps | PaddingProps[];
|
|
16
|
+
capHeight?: StringOrNumberOrCallback;
|
|
17
|
+
children?: StringOrNumberOrCallback;
|
|
18
|
+
className?: string;
|
|
19
|
+
datum?: object;
|
|
20
|
+
data?: any[];
|
|
21
|
+
desc?: string;
|
|
22
|
+
direction?: string;
|
|
23
|
+
disableInlineStyles?: boolean;
|
|
24
|
+
events?: React.DOMAttributes<any>;
|
|
25
|
+
groupComponent?: React.ReactElement;
|
|
26
|
+
id?: StringOrNumberOrCallback;
|
|
27
|
+
inline?: boolean;
|
|
28
|
+
labelPlacement?: LabelOrientationType;
|
|
29
|
+
lineHeight?: StringOrNumberOrCallback | (string | number)[];
|
|
30
|
+
origin?: OriginType;
|
|
31
|
+
polar?: boolean;
|
|
32
|
+
renderInPortal?: boolean;
|
|
33
|
+
style?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
34
|
+
tabIndex?: NumberOrCallback;
|
|
35
|
+
text?: string[] | StringOrNumberOrCallback;
|
|
36
|
+
textComponent?: React.ReactElement;
|
|
37
|
+
textAnchor?: TextAnchorType | {
|
|
38
|
+
(): TextAnchorType;
|
|
39
|
+
};
|
|
40
|
+
title?: string;
|
|
41
|
+
transform?: string | object | (() => string | object);
|
|
42
|
+
tspanComponent?: React.ReactElement;
|
|
43
|
+
verticalAnchor?: VerticalAnchorType | {
|
|
44
|
+
(): VerticalAnchorType;
|
|
45
|
+
};
|
|
46
|
+
x?: number;
|
|
47
|
+
y?: number;
|
|
48
|
+
dx?: StringOrNumberOrCallback;
|
|
49
|
+
dy?: StringOrNumberOrCallback;
|
|
50
|
+
}
|
|
51
|
+
declare const defaultStyles: {
|
|
52
|
+
fill: string;
|
|
53
|
+
fontSize: number;
|
|
54
|
+
fontFamily: string;
|
|
55
|
+
stroke: string;
|
|
56
|
+
};
|
|
57
|
+
export declare const VictoryLabel: {
|
|
58
|
+
role: string;
|
|
59
|
+
defaultStyles: typeof defaultStyles;
|
|
60
|
+
} & React.FC<VictoryLabelProps>;
|
|
61
|
+
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VictoryLabel = void 0;
|
|
7
7
|
|
|
8
8
|
var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
|
|
9
9
|
|
|
@@ -15,13 +15,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
|
|
18
|
-
var _victoryPortal =
|
|
18
|
+
var _victoryPortal = require("../victory-portal/victory-portal");
|
|
19
19
|
|
|
20
|
-
var _rect =
|
|
20
|
+
var _rect = require("../victory-primitives/rect");
|
|
21
21
|
|
|
22
|
-
var _text =
|
|
22
|
+
var _text = require("../victory-primitives/text");
|
|
23
23
|
|
|
24
|
-
var _tspan =
|
|
24
|
+
var _tspan = require("../victory-primitives/tspan");
|
|
25
25
|
|
|
26
26
|
var Helpers = _interopRequireWildcard(require("../victory-util/helpers"));
|
|
27
27
|
|
|
@@ -553,6 +553,7 @@ var VictoryLabel = function (props) {
|
|
|
553
553
|
fontSize: currentStyle.fontSize || defaultStyles.fontSize,
|
|
554
554
|
capHeight: capHeightPx,
|
|
555
555
|
text: line,
|
|
556
|
+
// @ts-expect-error TODO: This looks like a bug:
|
|
556
557
|
textSize: TextSize.approximateTextSize(line, currentStyle),
|
|
557
558
|
lineHeight: currentLineHeight,
|
|
558
559
|
backgroundPadding: getSingleValue(backgroundPadding, i)
|
|
@@ -566,12 +567,13 @@ var VictoryLabel = function (props) {
|
|
|
566
567
|
|
|
567
568
|
var backgroundWithLabel = /*#__PURE__*/_react.default.cloneElement(props.groupComponent, {}, children);
|
|
568
569
|
|
|
569
|
-
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.
|
|
570
|
+
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
|
|
570
571
|
}
|
|
571
572
|
|
|
572
|
-
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.
|
|
573
|
+
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.VictoryPortal, null, label) : label;
|
|
573
574
|
};
|
|
574
575
|
|
|
576
|
+
exports.VictoryLabel = VictoryLabel;
|
|
575
577
|
VictoryLabel.displayName = "VictoryLabel";
|
|
576
578
|
VictoryLabel.role = "label";
|
|
577
579
|
VictoryLabel.defaultStyles = defaultStyles;
|
|
@@ -586,6 +588,7 @@ VictoryLabel.propTypes = {
|
|
|
586
588
|
className: _propTypes.default.string,
|
|
587
589
|
data: _propTypes.default.array,
|
|
588
590
|
datum: _propTypes.default.any,
|
|
591
|
+
// @ts-expect-error "Function is not assignable to string"
|
|
589
592
|
desc: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]),
|
|
590
593
|
direction: _propTypes.default.oneOf(["rtl", "ltr", "inherit"]),
|
|
591
594
|
dx: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.func]),
|
|
@@ -597,6 +600,7 @@ VictoryLabel.propTypes = {
|
|
|
597
600
|
inline: _propTypes.default.bool,
|
|
598
601
|
labelPlacement: _propTypes.default.oneOf(["parallel", "perpendicular", "vertical"]),
|
|
599
602
|
lineHeight: _propTypes.default.oneOfType([_propTypes.default.string, CustomPropTypes.nonNegative, _propTypes.default.func, _propTypes.default.array]),
|
|
603
|
+
// @ts-expect-error "x is required in origin"
|
|
600
604
|
origin: _propTypes.default.shape({
|
|
601
605
|
x: CustomPropTypes.nonNegative,
|
|
602
606
|
y: CustomPropTypes.nonNegative
|
|
@@ -610,24 +614,26 @@ VictoryLabel.propTypes = {
|
|
|
610
614
|
style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]),
|
|
611
615
|
tabIndex: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
612
616
|
text: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.func, _propTypes.default.array]),
|
|
617
|
+
// @ts-expect-error Function is not assignable to string"
|
|
613
618
|
textAnchor: _propTypes.default.oneOfType([_propTypes.default.oneOf(["start", "middle", "end", "inherit"]), _propTypes.default.func]),
|
|
614
619
|
textComponent: _propTypes.default.element,
|
|
615
620
|
title: _propTypes.default.string,
|
|
616
621
|
transform: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.func]),
|
|
617
622
|
tspanComponent: _propTypes.default.element,
|
|
623
|
+
// @ts-expect-error Function is not assignable to string"
|
|
618
624
|
verticalAnchor: _propTypes.default.oneOfType([_propTypes.default.oneOf(["start", "middle", "end"]), _propTypes.default.func]),
|
|
625
|
+
// @ts-expect-error Number is not assignable to string
|
|
619
626
|
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
627
|
+
// @ts-expect-error Number is not assignable to string
|
|
620
628
|
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
621
629
|
};
|
|
622
630
|
VictoryLabel.defaultProps = {
|
|
623
|
-
backgroundComponent: /*#__PURE__*/_react.default.createElement(_rect.
|
|
631
|
+
backgroundComponent: /*#__PURE__*/_react.default.createElement(_rect.Rect, null),
|
|
624
632
|
groupComponent: /*#__PURE__*/_react.default.createElement("g", null),
|
|
625
633
|
direction: "inherit",
|
|
626
|
-
textComponent: /*#__PURE__*/_react.default.createElement(_text.
|
|
627
|
-
tspanComponent: /*#__PURE__*/_react.default.createElement(_tspan.
|
|
634
|
+
textComponent: /*#__PURE__*/_react.default.createElement(_text.Text, null),
|
|
635
|
+
tspanComponent: /*#__PURE__*/_react.default.createElement(_tspan.TSpan, null),
|
|
628
636
|
capHeight: 0.71,
|
|
629
637
|
// Magic number from d3.
|
|
630
638
|
lineHeight: 1
|
|
631
|
-
};
|
|
632
|
-
var _default = VictoryLabel;
|
|
633
|
-
exports.default = _default;
|
|
639
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PortalContextValue {
|
|
3
|
+
portalRegister(): number;
|
|
4
|
+
portalUpdate(key: number, element: React.ReactElement): void;
|
|
5
|
+
portalDeregister(key: number): void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The React context object consumers may use to access the context of the
|
|
9
|
+
* portal.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PortalContext: React.Context<PortalContextValue>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PortalContext = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -15,6 +15,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
15
|
*/
|
|
16
16
|
var PortalContext = /*#__PURE__*/_react.default.createContext({});
|
|
17
17
|
|
|
18
|
-
PortalContext
|
|
19
|
-
|
|
20
|
-
exports.default = _default;
|
|
18
|
+
exports.PortalContext = PortalContext;
|
|
19
|
+
PortalContext.displayName = "PortalContext";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { PortalContextValue } from "./portal-context";
|
|
4
|
+
export interface PortalProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
height?: number;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
viewBox?: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class Portal extends React.Component<PortalProps> implements PortalContextValue {
|
|
12
|
+
static displayName: string;
|
|
13
|
+
static propTypes: {
|
|
14
|
+
className: PropTypes.Requireable<string>;
|
|
15
|
+
height: any;
|
|
16
|
+
style: PropTypes.Requireable<object>;
|
|
17
|
+
viewBox: PropTypes.Requireable<string>;
|
|
18
|
+
width: any;
|
|
19
|
+
};
|
|
20
|
+
private readonly map;
|
|
21
|
+
private index;
|
|
22
|
+
constructor(props: PortalProps);
|
|
23
|
+
portalRegister: () => number;
|
|
24
|
+
portalUpdate: (key: number, element: React.ReactElement) => void;
|
|
25
|
+
portalDeregister: (key: number) => void;
|
|
26
|
+
private getChildren;
|
|
27
|
+
render(): JSX.Element;
|
|
28
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Portal = void 0;
|
|
7
7
|
|
|
8
8
|
var _keys2 = _interopRequireDefault(require("lodash/keys"));
|
|
9
9
|
|
|
@@ -27,7 +27,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
27
27
|
|
|
28
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
29
|
|
|
30
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
30
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
31
31
|
|
|
32
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
33
|
|
|
@@ -37,9 +37,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
37
37
|
|
|
38
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
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; }
|
|
40
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
41
|
|
|
44
42
|
var Portal = /*#__PURE__*/function (_React$Component) {
|
|
45
43
|
_inherits(Portal, _React$Component);
|
|
@@ -52,32 +50,31 @@ var Portal = /*#__PURE__*/function (_React$Component) {
|
|
|
52
50
|
_classCallCheck(this, Portal);
|
|
53
51
|
|
|
54
52
|
_this = _super.call(this, props);
|
|
53
|
+
_this.map = void 0;
|
|
54
|
+
_this.index = void 0;
|
|
55
|
+
|
|
56
|
+
_this.portalRegister = function () {
|
|
57
|
+
return ++_this.index;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
_this.portalUpdate = function (key, element) {
|
|
61
|
+
_this.map[key] = element;
|
|
62
|
+
|
|
63
|
+
_this.forceUpdate();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
_this.portalDeregister = function (key) {
|
|
67
|
+
delete _this.map[key];
|
|
68
|
+
|
|
69
|
+
_this.forceUpdate();
|
|
70
|
+
};
|
|
71
|
+
|
|
55
72
|
_this.map = {};
|
|
56
73
|
_this.index = 1;
|
|
57
|
-
_this.portalUpdate = _this.portalUpdate.bind(_assertThisInitialized(_this));
|
|
58
|
-
_this.portalRegister = _this.portalRegister.bind(_assertThisInitialized(_this));
|
|
59
|
-
_this.portalDeregister = _this.portalDeregister.bind(_assertThisInitialized(_this));
|
|
60
74
|
return _this;
|
|
61
75
|
}
|
|
62
76
|
|
|
63
77
|
_createClass(Portal, [{
|
|
64
|
-
key: "portalRegister",
|
|
65
|
-
value: function portalRegister() {
|
|
66
|
-
return ++this.index;
|
|
67
|
-
}
|
|
68
|
-
}, {
|
|
69
|
-
key: "portalUpdate",
|
|
70
|
-
value: function portalUpdate(key, element) {
|
|
71
|
-
this.map[key] = element;
|
|
72
|
-
this.forceUpdate();
|
|
73
|
-
}
|
|
74
|
-
}, {
|
|
75
|
-
key: "portalDeregister",
|
|
76
|
-
value: function portalDeregister(key) {
|
|
77
|
-
delete this.map[key];
|
|
78
|
-
this.forceUpdate();
|
|
79
|
-
}
|
|
80
|
-
}, {
|
|
81
78
|
key: "getChildren",
|
|
82
79
|
value: function getChildren() {
|
|
83
80
|
var _this2 = this;
|
|
@@ -100,14 +97,12 @@ var Portal = /*#__PURE__*/function (_React$Component) {
|
|
|
100
97
|
return Portal;
|
|
101
98
|
}(_react.default.Component);
|
|
102
99
|
|
|
103
|
-
exports.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
_defineProperty(Portal, "propTypes", {
|
|
100
|
+
exports.Portal = Portal;
|
|
101
|
+
Portal.displayName = "Portal";
|
|
102
|
+
Portal.propTypes = {
|
|
108
103
|
className: _propTypes.default.string,
|
|
109
104
|
height: CustomPropTypes.nonNegative,
|
|
110
105
|
style: _propTypes.default.object,
|
|
111
106
|
viewBox: _propTypes.default.string,
|
|
112
107
|
width: CustomPropTypes.nonNegative
|
|
113
|
-
}
|
|
108
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { PortalContext } from "./portal-context";
|
|
4
|
+
export interface VictoryPortalProps {
|
|
5
|
+
children?: React.ReactElement;
|
|
6
|
+
groupComponent?: React.ReactElement;
|
|
7
|
+
}
|
|
8
|
+
export interface VictoryPortal {
|
|
9
|
+
context: React.ContextType<typeof PortalContext>;
|
|
10
|
+
}
|
|
11
|
+
export declare class VictoryPortal extends React.Component<VictoryPortalProps> {
|
|
12
|
+
static displayName: string;
|
|
13
|
+
static role: string;
|
|
14
|
+
static propTypes: {
|
|
15
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
16
|
+
groupComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
17
|
+
};
|
|
18
|
+
static defaultProps: {
|
|
19
|
+
groupComponent: JSX.Element;
|
|
20
|
+
};
|
|
21
|
+
static contextType: React.Context<import("./portal-context").PortalContextValue>;
|
|
22
|
+
private checkedContext;
|
|
23
|
+
private renderInPlace;
|
|
24
|
+
private element;
|
|
25
|
+
private portalKey;
|
|
26
|
+
componentDidMount(): void;
|
|
27
|
+
componentDidUpdate(): void;
|
|
28
|
+
componentWillUnmount(): void;
|
|
29
|
+
renderPortal(child: React.ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
30
|
+
render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
31
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VictoryPortal = void 0;
|
|
7
7
|
|
|
8
8
|
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ var Log = _interopRequireWildcard(require("../victory-util/log"));
|
|
|
15
15
|
|
|
16
16
|
var Helpers = _interopRequireWildcard(require("../victory-util/helpers"));
|
|
17
17
|
|
|
18
|
-
var _portalContext =
|
|
18
|
+
var _portalContext = require("./portal-context");
|
|
19
19
|
|
|
20
20
|
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); }
|
|
21
21
|
|
|
@@ -31,7 +31,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
31
31
|
|
|
32
32
|
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); }
|
|
33
33
|
|
|
34
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
34
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
35
|
|
|
36
36
|
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); }; }
|
|
37
37
|
|
|
@@ -41,9 +41,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
41
41
|
|
|
42
42
|
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; } }
|
|
43
43
|
|
|
44
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
|
-
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; }
|
|
44
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
45
|
|
|
48
46
|
var VictoryPortal = /*#__PURE__*/function (_React$Component) {
|
|
49
47
|
_inherits(VictoryPortal, _React$Component);
|
|
@@ -51,9 +49,20 @@ var VictoryPortal = /*#__PURE__*/function (_React$Component) {
|
|
|
51
49
|
var _super = _createSuper(VictoryPortal);
|
|
52
50
|
|
|
53
51
|
function VictoryPortal() {
|
|
52
|
+
var _this;
|
|
53
|
+
|
|
54
54
|
_classCallCheck(this, VictoryPortal);
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
57
|
+
args[_key] = arguments[_key];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
61
|
+
_this.checkedContext = void 0;
|
|
62
|
+
_this.renderInPlace = void 0;
|
|
63
|
+
_this.element = void 0;
|
|
64
|
+
_this.portalKey = void 0;
|
|
65
|
+
return _this;
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
_createClass(VictoryPortal, [{
|
|
@@ -118,19 +127,14 @@ var VictoryPortal = /*#__PURE__*/function (_React$Component) {
|
|
|
118
127
|
return VictoryPortal;
|
|
119
128
|
}(_react.default.Component);
|
|
120
129
|
|
|
121
|
-
exports.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
_defineProperty(VictoryPortal, "role", "portal");
|
|
126
|
-
|
|
127
|
-
_defineProperty(VictoryPortal, "propTypes", {
|
|
130
|
+
exports.VictoryPortal = VictoryPortal;
|
|
131
|
+
VictoryPortal.displayName = "VictoryPortal";
|
|
132
|
+
VictoryPortal.role = "portal";
|
|
133
|
+
VictoryPortal.propTypes = {
|
|
128
134
|
children: _propTypes.default.node,
|
|
129
135
|
groupComponent: _propTypes.default.element
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
_defineProperty(VictoryPortal, "defaultProps", {
|
|
136
|
+
};
|
|
137
|
+
VictoryPortal.defaultProps = {
|
|
133
138
|
groupComponent: /*#__PURE__*/_react.default.createElement("g", null)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
_defineProperty(VictoryPortal, "contextType", _portalContext.default);
|
|
139
|
+
};
|
|
140
|
+
VictoryPortal.contextType = _portalContext.PortalContext;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryCommonPrimitiveProps } from "../victory-util/types";
|
|
3
|
+
export interface ArcProps extends VictoryCommonPrimitiveProps {
|
|
4
|
+
closedPath?: boolean;
|
|
5
|
+
cx?: number;
|
|
6
|
+
cy?: number;
|
|
7
|
+
datum?: any;
|
|
8
|
+
endAngle?: number;
|
|
9
|
+
pathComponent?: React.ReactElement;
|
|
10
|
+
r?: number;
|
|
11
|
+
startAngle?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const Arc: {
|
|
14
|
+
(props: ArcProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
15
|
+
propTypes: any;
|
|
16
|
+
defaultProps: {
|
|
17
|
+
pathComponent: JSX.Element;
|
|
18
|
+
role: string;
|
|
19
|
+
shapeRendering: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Arc = void 0;
|
|
7
7
|
|
|
8
8
|
var _assign2 = _interopRequireDefault(require("lodash/assign"));
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ var Helpers = _interopRequireWildcard(require("../victory-util/helpers"));
|
|
|
15
15
|
|
|
16
16
|
var CommonProps = _interopRequireWildcard(require("../victory-util/common-props"));
|
|
17
17
|
|
|
18
|
-
var _path =
|
|
18
|
+
var _path = require("./path");
|
|
19
19
|
|
|
20
20
|
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); }
|
|
21
21
|
|
|
@@ -95,6 +95,7 @@ var Arc = function (props) {
|
|
|
95
95
|
}));
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
+
exports.Arc = Arc;
|
|
98
99
|
Arc.propTypes = _objectSpread(_objectSpread({}, CommonProps.primitiveProps), {}, {
|
|
99
100
|
closedPath: _propTypes.default.bool,
|
|
100
101
|
cx: _propTypes.default.number,
|
|
@@ -106,9 +107,7 @@ Arc.propTypes = _objectSpread(_objectSpread({}, CommonProps.primitiveProps), {},
|
|
|
106
107
|
startAngle: _propTypes.default.number
|
|
107
108
|
});
|
|
108
109
|
Arc.defaultProps = {
|
|
109
|
-
pathComponent: /*#__PURE__*/_react.default.createElement(_path.
|
|
110
|
+
pathComponent: /*#__PURE__*/_react.default.createElement(_path.Path, null),
|
|
110
111
|
role: "presentation",
|
|
111
112
|
shapeRendering: "auto"
|
|
112
|
-
};
|
|
113
|
-
var _default = Arc;
|
|
114
|
-
exports.default = _default;
|
|
113
|
+
};
|