Socket
Socket
Sign inDemoInstall

victory-core

Package Overview
Dependencies
Maintainers
21
Versions
300
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

victory-core - npm Package Compare versions

Comparing version 36.9.2-next.1 to 36.9.2-next.3

LICENSE.txt

5

CHANGELOG.md
# victory-core
## 36.9.2-next.1
## 36.9.2-next.3

@@ -10,2 +10,3 @@ ### Patch Changes

- c13308624: Convert victory-animation to function component
- 65d02419f: Refactor containers and portal to function components
- 7efd582cc: Replace lodash array utils with native code

@@ -15,3 +16,3 @@ - 9cdaf2c08: Replace lodash values and mapValues with native code

- 6e34169a5: Replace lodash isFunction with native code
- victory-vendor@36.9.2-next.1
- victory-vendor@36.9.2-next.3

@@ -18,0 +19,0 @@ ## 36.9.1

1

es/types/prop-types.d.ts

@@ -129,4 +129,3 @@ import * as React from "react";

};
export declare type VictoryEventHandler = (event?: any, targetProps?: any, eventKey?: any, context?: any) => void;
export {};
//# sourceMappingURL=prop-types.d.ts.map

@@ -17,2 +17,5 @@ import React from "react";

origin?: OriginType;
ouiaId?: number | string;
ouiaSafe?: boolean;
ouiaType?: string;
polar?: boolean;

@@ -33,35 +36,36 @@ portalComponent?: React.ReactElement;

width?: number;
ouiaId?: number | string;
ouiaSafe?: boolean;
ouiaType?: string;
}
export declare function useVictoryContainer<TProps extends VictoryContainerProps>(initialProps: TProps): {
className: string;
portalComponent: JSX.Element;
portalZIndex: number;
responsive: boolean;
role: string;
} & TProps & {
titleId: string;
descId: string;
dimensions: {
width: string;
height: string;
} | {
width: number | undefined;
height: number | undefined;
export declare class VictoryContainer<TProps extends VictoryContainerProps> extends React.Component<TProps> {
static displayName: string;
static role: string;
static defaultProps: {
className: string;
portalComponent: JSX.Element;
portalZIndex: number;
responsive: boolean;
role: string;
};
viewBox: string | undefined;
preserveAspectRatio: string | undefined;
ariaLabelledBy: string | undefined;
ariaDescribedBy: string | undefined;
userProps: Record<string, string>;
portalRef: (element: SVGSVGElement) => void;
portalElement: SVGSVGElement | undefined;
localContainerRef: React.RefObject<HTMLDivElement>;
};
export declare const VictoryContainer: {
(initialProps: VictoryContainerProps): JSX.Element;
role: string;
};
static contextType: React.Context<{
transitionTimer: import("..").Timer;
animationTimer: import("..").Timer;
}>;
private containerId;
private portalRef;
private containerRef;
private shouldHandleWheel;
constructor(props: TProps);
savePortalRef: (portal: any) => any;
portalUpdate: (key: any, el: any) => void;
portalRegister: () => number;
portalDeregister: (key: any) => void;
saveContainerRef: (container: HTMLElement) => HTMLElement;
handleWheel: (e: any) => any;
componentDidMount(): void;
componentWillUnmount(): void;
getIdForElement(elementName: any): string;
getChildren(props: any): any;
getOUIAProps(props: any): any;
renderContainer(props: any, svgProps: any, style: any): JSX.Element;
render(): JSX.Element;
}
//# sourceMappingURL=victory-container.d.ts.map

@@ -0,186 +1,238 @@

import _isObject from "lodash/isObject";
import _uniqueId from "lodash/uniqueId";
import _defaults from "lodash/defaults";
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); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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; }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
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; }
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); }
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; }
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
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); } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
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; }
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); }
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; }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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; }
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); }; }
import React, { useRef } from "react";
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); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
import React from "react";
import { Portal } from "../victory-portal/portal";
import { PortalContext } from "../victory-portal/portal-context";
import TimerContext from "../victory-util/timer-context";
import * as Helpers from "../victory-util/helpers";
import * as UserProps from "../victory-util/user-props";
import { mergeRefs } from "../victory-util";
var defaultProps = {
className: "VictoryContainer",
portalComponent: /*#__PURE__*/React.createElement(Portal, null),
portalZIndex: 99,
responsive: true,
role: "img"
};
export function useVictoryContainer(initialProps) {
var props = _objectSpread(_objectSpread({}, defaultProps), initialProps);
export var VictoryContainer = /*#__PURE__*/function (_React$Component) {
_inherits(VictoryContainer, _React$Component);
var title = props.title,
desc = props.desc,
width = props.width,
height = props.height,
responsive = props.responsive;
var localContainerRef = useRef(null);
var _super = _createSuper(VictoryContainer);
var _React$useState = React.useState(),
_React$useState2 = _slicedToArray(_React$useState, 2),
portalElement = _React$useState2[0],
setPortalElement = _React$useState2[1];
// @ts-expect-error Ref will be initialized on mount
// @ts-expect-error Ref will be initialized on mount
function VictoryContainer(props) {
var _this;
var portalRef = function (element) {
return setPortalElement(element);
}; // Generated ID stored in ref because it needs to persist across renders
_classCallCheck(this, VictoryContainer);
_this = _super.call(this, props);
_this.containerId = void 0;
_this.portalRef = void 0;
_this.containerRef = void 0;
_this.shouldHandleWheel = void 0;
var generatedId = useRef(_uniqueId("victory-container-"));
var containerId = props.containerId ?? generatedId.current;
_this.savePortalRef = function (portal) {
_this.portalRef = portal;
return portal;
};
var getIdForElement = function (elName) {
return "".concat(containerId, "-").concat(elName);
};
_this.portalUpdate = function (key, el) {
return _this.portalRef.portalUpdate(key, el);
};
var userProps = UserProps.getSafeUserProps(props);
var dimensions = responsive ? {
width: "100%",
height: "100%"
} : {
width: width,
height: height
};
var viewBox = responsive ? "0 0 ".concat(width, " ").concat(height) : undefined;
var preserveAspectRatio = responsive ? props.preserveAspectRatio : undefined;
var ariaLabelledBy = [title && getIdForElement("title"), props["aria-labelledby"]].filter(Boolean).join(" ") || undefined;
var ariaDescribedBy = [desc && getIdForElement("desc"), props["aria-describedby"]].filter(Boolean).join(" ") || undefined;
var titleId = getIdForElement("title");
var descId = getIdForElement("desc");
return _objectSpread(_objectSpread({}, props), {}, {
titleId: titleId,
descId: descId,
dimensions: dimensions,
viewBox: viewBox,
preserveAspectRatio: preserveAspectRatio,
ariaLabelledBy: ariaLabelledBy,
ariaDescribedBy: ariaDescribedBy,
userProps: userProps,
portalRef: portalRef,
portalElement: portalElement,
localContainerRef: localContainerRef
});
}
export var VictoryContainer = function (initialProps) {
var _useVictoryContainer = useVictoryContainer(initialProps),
role = _useVictoryContainer.role,
title = _useVictoryContainer.title,
desc = _useVictoryContainer.desc,
children = _useVictoryContainer.children,
className = _useVictoryContainer.className,
portalZIndex = _useVictoryContainer.portalZIndex,
portalComponent = _useVictoryContainer.portalComponent,
width = _useVictoryContainer.width,
height = _useVictoryContainer.height,
style = _useVictoryContainer.style,
tabIndex = _useVictoryContainer.tabIndex,
responsive = _useVictoryContainer.responsive,
events = _useVictoryContainer.events,
ouiaId = _useVictoryContainer.ouiaId,
ouiaSafe = _useVictoryContainer.ouiaSafe,
ouiaType = _useVictoryContainer.ouiaType,
dimensions = _useVictoryContainer.dimensions,
ariaDescribedBy = _useVictoryContainer.ariaDescribedBy,
ariaLabelledBy = _useVictoryContainer.ariaLabelledBy,
viewBox = _useVictoryContainer.viewBox,
preserveAspectRatio = _useVictoryContainer.preserveAspectRatio,
userProps = _useVictoryContainer.userProps,
titleId = _useVictoryContainer.titleId,
descId = _useVictoryContainer.descId,
portalElement = _useVictoryContainer.portalElement,
portalRef = _useVictoryContainer.portalRef,
containerRef = _useVictoryContainer.containerRef,
localContainerRef = _useVictoryContainer.localContainerRef;
_this.portalRegister = function () {
return _this.portalRef.portalRegister();
};
React.useEffect(function () {
// TODO check that this works
if (!(events !== null && events !== void 0 && events.onWheel)) return;
_this.portalDeregister = function (key) {
return _this.portalRef.portalDeregister(key);
};
var handleWheel = function (e) {
_this.saveContainerRef = function (container) {
if (Helpers.isFunction(_this.props.containerRef)) {
_this.props.containerRef(container);
}
_this.containerRef = container;
return container;
};
_this.handleWheel = function (e) {
return e.preventDefault();
};
var container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
container === null || container === void 0 ? void 0 : container.addEventListener("wheel", handleWheel);
return function () {
container === null || container === void 0 ? void 0 : container.removeEventListener("wheel", handleWheel);
}; // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return /*#__PURE__*/React.createElement(PortalContext.Provider, {
value: {
portalElement: portalElement
_this.containerId = !_isObject(props) || props.containerId === undefined ? _uniqueId("victory-container-") : props.containerId;
_this.shouldHandleWheel = !!(props && props.events && props.events.onWheel);
return _this;
}
_createClass(VictoryContainer, [{
key: "componentDidMount",
value: function componentDidMount() {
if (this.shouldHandleWheel && this.containerRef) {
this.containerRef.addEventListener("wheel", this.handleWheel);
}
}
}, /*#__PURE__*/React.createElement("div", {
className: className,
style: _objectSpread(_objectSpread({}, style), {}, {
width: responsive ? style === null || style === void 0 ? void 0 : style.width : dimensions.width,
height: responsive ? style === null || style === void 0 ? void 0 : style.height : dimensions.height,
pointerEvents: "none",
touchAction: "none",
position: "relative"
}),
"data-ouia-component-id": ouiaId,
"data-ouia-component-type": ouiaType,
"data-ouia-safe": ouiaSafe,
ref: mergeRefs([localContainerRef, containerRef])
}, /*#__PURE__*/React.createElement("svg", _extends({
width: width,
height: height,
tabIndex: tabIndex,
role: role,
"aria-labelledby": ariaLabelledBy,
"aria-describedby": ariaDescribedBy,
viewBox: viewBox,
preserveAspectRatio: preserveAspectRatio,
style: _objectSpread(_objectSpread({}, dimensions), {}, {
pointerEvents: "all"
})
}, userProps, events), title ? /*#__PURE__*/React.createElement("title", {
id: titleId
}, title) : null, desc ? /*#__PURE__*/React.createElement("desc", {
id: descId
}, desc) : null, children), /*#__PURE__*/React.createElement("div", {
style: _objectSpread(_objectSpread({}, dimensions), {}, {
zIndex: portalZIndex,
position: "absolute",
top: 0,
left: 0
})
}, /*#__PURE__*/React.cloneElement(portalComponent, {
width: width,
height: height,
viewBox: viewBox,
preserveAspectRatio: preserveAspectRatio,
style: _objectSpread(_objectSpread({}, dimensions), {}, {
overflow: "visible"
}),
ref: portalRef
}))));
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.shouldHandleWheel && this.containerRef) {
this.containerRef.removeEventListener("wheel", this.handleWheel);
}
}
}, {
key: "getIdForElement",
value: function getIdForElement(elementName) {
return "".concat(this.containerId, "-").concat(elementName);
} // overridden in custom containers
}, {
key: "getChildren",
value: function getChildren(props) {
return props.children;
} // Get props defined by the Open UI Automation (OUIA) 1.0-RC spec
// See https://ouia.readthedocs.io/en/latest/README.html#ouia-component
}, {
key: "getOUIAProps",
value: function getOUIAProps(props) {
var ouiaId = props.ouiaId,
ouiaSafe = props.ouiaSafe,
ouiaType = props.ouiaType;
return _objectSpread(_objectSpread(_objectSpread({}, ouiaId && {
"data-ouia-component-id": ouiaId
}), ouiaType && {
"data-ouia-component-type": ouiaType
}), ouiaSafe !== undefined && {
"data-ouia-safe": ouiaSafe
});
}
}, {
key: "renderContainer",
value: function renderContainer(props, svgProps, style) {
var title = props.title,
desc = props.desc,
portalComponent = props.portalComponent,
className = props.className,
width = props.width,
height = props.height,
portalZIndex = props.portalZIndex,
responsive = props.responsive;
var children = this.getChildren(props);
var dimensions = responsive ? {
width: "100%",
height: "100%"
} : {
width: width,
height: height
};
var divStyle = Object.assign({
pointerEvents: "none",
touchAction: "none",
position: "relative"
}, dimensions);
var portalDivStyle = Object.assign({
zIndex: portalZIndex,
position: "absolute",
top: 0,
left: 0
}, dimensions);
var svgStyle = Object.assign({
pointerEvents: "all"
}, dimensions);
var portalSvgStyle = Object.assign({
overflow: "visible"
}, dimensions);
var portalProps = {
width: width,
height: height,
viewBox: svgProps.viewBox,
preserveAspectRatio: svgProps.preserveAspectRatio,
style: portalSvgStyle
};
return /*#__PURE__*/React.createElement(PortalContext.Provider, {
value: {
portalUpdate: this.portalUpdate,
portalRegister: this.portalRegister,
portalDeregister: this.portalDeregister
}
}, /*#__PURE__*/React.createElement("div", _extends({
style: _defaults({}, style, divStyle),
className: className,
ref: this.saveContainerRef
}, this.getOUIAProps(props)), /*#__PURE__*/React.createElement("svg", _extends({}, svgProps, {
style: svgStyle
}), title ? /*#__PURE__*/React.createElement("title", {
id: this.getIdForElement("title")
}, title) : null, desc ? /*#__PURE__*/React.createElement("desc", {
id: this.getIdForElement("desc")
}, desc) : null, children), /*#__PURE__*/React.createElement("div", {
style: portalDivStyle
}, /*#__PURE__*/React.cloneElement(portalComponent, _objectSpread(_objectSpread({}, portalProps), {}, {
ref: this.savePortalRef
})))));
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
width = _this$props.width,
height = _this$props.height,
responsive = _this$props.responsive,
events = _this$props.events,
title = _this$props.title,
desc = _this$props.desc,
tabIndex = _this$props.tabIndex,
preserveAspectRatio = _this$props.preserveAspectRatio,
role = _this$props.role;
var style = responsive ? this.props.style : Helpers.omit(this.props.style, ["height", "width"]);
var userProps = UserProps.getSafeUserProps(this.props);
var svgProps = Object.assign(_objectSpread({
width: width,
height: height,
tabIndex: tabIndex,
role: role,
"aria-labelledby": [title && this.getIdForElement("title"), this.props["aria-labelledby"]].filter(Boolean).join(" ") || undefined,
"aria-describedby": [desc && this.getIdForElement("desc"), this.props["aria-describedby"]].filter(Boolean).join(" ") || undefined,
viewBox: responsive ? "0 0 ".concat(width, " ").concat(height) : undefined,
preserveAspectRatio: responsive ? preserveAspectRatio : undefined
}, userProps), events);
return this.renderContainer(this.props, svgProps, style);
}
}]);
return VictoryContainer;
}(React.Component);
VictoryContainer.displayName = "VictoryContainer";
VictoryContainer.role = "container";
VictoryContainer.defaultProps = {
className: "VictoryContainer",
portalComponent: /*#__PURE__*/React.createElement(Portal, null),
portalZIndex: 99,
responsive: true,
role: "img"
};
VictoryContainer.role = "container";
VictoryContainer.contextType = TimerContext;
import React from "react";
export interface PortalContextValue {
portalElement: SVGSVGElement | undefined;
portalRegister(): number;
portalUpdate(key: number, element: React.ReactElement): void;
portalDeregister(key: number): void;
}

@@ -9,3 +11,3 @@ /**

*/
export declare const PortalContext: React.Context<PortalContextValue | undefined>;
export declare const PortalContext: React.Context<PortalContextValue>;
//# sourceMappingURL=portal-context.d.ts.map

@@ -7,3 +7,3 @@ import React from "react";

*/
export var PortalContext = /*#__PURE__*/React.createContext(undefined);
export var PortalContext = /*#__PURE__*/React.createContext({});
PortalContext.displayName = "PortalContext";
import React from "react";
import { PortalContextValue } from "./portal-context";
export interface PortalProps {

@@ -9,3 +10,13 @@ className?: string;

}
export declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<SVGSVGElement>>;
export declare class Portal extends React.Component<PortalProps> implements PortalContextValue {
static displayName: string;
private readonly map;
private index;
constructor(props: PortalProps);
portalRegister: () => number;
portalUpdate: (key: number, element: React.ReactElement) => void;
portalDeregister: (key: number) => void;
getChildren(): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
render(): JSX.Element;
}
//# sourceMappingURL=portal.d.ts.map

@@ -1,8 +0,79 @@

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); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
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); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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); }; }
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); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
import React from "react";
export var Portal = /*#__PURE__*/React.forwardRef(function (props, ref) {
return /*#__PURE__*/React.createElement("svg", _extends({
ref: ref
}, props));
});
export var Portal = /*#__PURE__*/function (_ref) {
_inherits(Portal, _ref);
var _super = _createSuper(Portal);
function Portal(props) {
var _this;
_classCallCheck(this, Portal);
_this = _super.call(this, props);
_this.map = void 0;
_this.index = void 0;
_this.portalRegister = function () {
return ++_this.index;
};
_this.portalUpdate = function (key, element) {
_this.map[key] = element;
_this.forceUpdate();
};
_this.portalDeregister = function (key) {
delete _this.map[key];
_this.forceUpdate();
};
_this.map = {};
_this.index = 1;
return _this;
}
_createClass(Portal, [{
key: "getChildren",
value: function getChildren() {
var _this2 = this;
return Object.keys(this.map).map(function (key) {
var el = _this2.map[key];
return el ? /*#__PURE__*/React.cloneElement(el, {
key: key
}) : el;
});
} // Overridden in victory-core-native
}, {
key: "render",
value: function render() {
return /*#__PURE__*/React.createElement("svg", this.props, this.getChildren());
}
}]);
return Portal;
}(React.Component);
Portal.displayName = "Portal";
import React from "react";
import { PortalContext } from "./portal-context";
export interface VictoryPortalProps {

@@ -6,6 +7,22 @@ children?: React.ReactElement;

}
export declare const VictoryPortal: {
(initialProps: VictoryPortalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
role: string;
};
export interface VictoryPortal {
context: React.ContextType<typeof PortalContext>;
}
export declare class VictoryPortal extends React.Component<VictoryPortalProps> {
static displayName: string;
static role: string;
static defaultProps: {
groupComponent: JSX.Element;
};
static contextType: React.Context<import("./portal-context").PortalContextValue>;
private checkedContext;
private portalKey;
renderInPlace: boolean;
element: React.ReactElement;
componentDidMount(): void;
componentDidUpdate(): void;
componentWillUnmount(): void;
renderPortal(child: React.ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
}
//# sourceMappingURL=victory-portal.d.ts.map
import _defaults from "lodash/defaults";
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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); } }
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; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
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); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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); }; }
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); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
import React from "react";

@@ -13,30 +27,90 @@ import * as Log from "../victory-util/log";

import { PortalContext } from "./portal-context";
import { createPortal } from "react-dom";
var defaultProps = {
groupComponent: /*#__PURE__*/React.createElement("g", null)
};
export var VictoryPortal = function (initialProps) {
var props = _objectSpread(_objectSpread({}, defaultProps), initialProps);
export var VictoryPortal = /*#__PURE__*/function (_React$Component) {
_inherits(VictoryPortal, _React$Component);
var portalContext = React.useContext(PortalContext);
var _super = _createSuper(VictoryPortal);
if (!portalContext) {
var msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
Log.warn(msg);
function VictoryPortal() {
var _this;
_classCallCheck(this, VictoryPortal);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_this.checkedContext = void 0;
_this.portalKey = void 0;
_this.renderInPlace = void 0;
_this.element = void 0;
return _this;
}
var children = Array.isArray(props.children) ? props.children[0] : props.children;
var groupComponent = props.groupComponent;
var childProps = children && children.props || {};
var standardProps = childProps.groupComponent ? {
groupComponent: groupComponent,
standalone: false
} : {};
_createClass(VictoryPortal, [{
key: "componentDidMount",
value: function componentDidMount() {
if (!this.checkedContext) {
if (typeof this.context.portalUpdate !== "function") {
var msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
Log.warn(msg);
this.renderInPlace = true;
}
var newProps = _defaults(standardProps, childProps, Helpers.omit(props, ["children", "groupComponent"]));
this.checkedContext = true;
}
var child = children && /*#__PURE__*/React.cloneElement(children, newProps); // If there is no portal context, render the child in place
this.forceUpdate();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
if (!this.renderInPlace) {
this.portalKey = this.portalKey || this.context.portalRegister();
this.context.portalUpdate(this.portalKey, this.element);
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.context && this.context.portalDeregister) {
this.context.portalDeregister(this.portalKey);
}
} // Overridden in victory-core-native
return portalContext !== null && portalContext !== void 0 && portalContext.portalElement ? /*#__PURE__*/createPortal(child, portalContext.portalElement) : child;
}, {
key: "renderPortal",
value: function renderPortal(child) {
if (this.renderInPlace) {
return child;
}
this.element = child;
return null;
}
}, {
key: "render",
value: function render() {
var children = Array.isArray(this.props.children) ? this.props.children[0] : this.props.children;
var groupComponent = this.props.groupComponent;
var childProps = children && children.props || {};
var standardProps = childProps.groupComponent ? {
groupComponent: groupComponent,
standalone: false
} : {};
var newProps = _defaults(standardProps, childProps, Helpers.omit(this.props, ["children", "groupComponent"]));
var child = children && /*#__PURE__*/React.cloneElement(children, newProps);
return this.renderPortal(child);
}
}]);
return VictoryPortal;
}(React.Component);
VictoryPortal.displayName = "VictoryPortal";
VictoryPortal.role = "portal";
VictoryPortal.defaultProps = {
groupComponent: /*#__PURE__*/React.createElement("g", null)
};
VictoryPortal.role = "portal";
VictoryPortal.contextType = PortalContext;
export * from "./add-events";
export * from "./merge-refs";
export * as Axis from "./axis";

@@ -4,0 +3,0 @@ export * as Collection from "./collection";

export * from "./add-events";
export * from "./merge-refs";
import * as _Axis from "./axis";

@@ -4,0 +3,0 @@ export { _Axis as Axis };

@@ -129,4 +129,3 @@ import * as React from "react";

};
export declare type VictoryEventHandler = (event?: any, targetProps?: any, eventKey?: any, context?: any) => void;
export {};
//# sourceMappingURL=prop-types.d.ts.map

@@ -17,2 +17,5 @@ import React from "react";

origin?: OriginType;
ouiaId?: number | string;
ouiaSafe?: boolean;
ouiaType?: string;
polar?: boolean;

@@ -33,35 +36,36 @@ portalComponent?: React.ReactElement;

width?: number;
ouiaId?: number | string;
ouiaSafe?: boolean;
ouiaType?: string;
}
export declare function useVictoryContainer<TProps extends VictoryContainerProps>(initialProps: TProps): {
className: string;
portalComponent: JSX.Element;
portalZIndex: number;
responsive: boolean;
role: string;
} & TProps & {
titleId: string;
descId: string;
dimensions: {
width: string;
height: string;
} | {
width: number | undefined;
height: number | undefined;
export declare class VictoryContainer<TProps extends VictoryContainerProps> extends React.Component<TProps> {
static displayName: string;
static role: string;
static defaultProps: {
className: string;
portalComponent: JSX.Element;
portalZIndex: number;
responsive: boolean;
role: string;
};
viewBox: string | undefined;
preserveAspectRatio: string | undefined;
ariaLabelledBy: string | undefined;
ariaDescribedBy: string | undefined;
userProps: Record<string, string>;
portalRef: (element: SVGSVGElement) => void;
portalElement: SVGSVGElement | undefined;
localContainerRef: React.RefObject<HTMLDivElement>;
};
export declare const VictoryContainer: {
(initialProps: VictoryContainerProps): JSX.Element;
role: string;
};
static contextType: React.Context<{
transitionTimer: import("..").Timer;
animationTimer: import("..").Timer;
}>;
private containerId;
private portalRef;
private containerRef;
private shouldHandleWheel;
constructor(props: TProps);
savePortalRef: (portal: any) => any;
portalUpdate: (key: any, el: any) => void;
portalRegister: () => number;
portalDeregister: (key: any) => void;
saveContainerRef: (container: HTMLElement) => HTMLElement;
handleWheel: (e: any) => any;
componentDidMount(): void;
componentWillUnmount(): void;
getIdForElement(elementName: any): string;
getChildren(props: any): any;
getOUIAProps(props: any): any;
renderContainer(props: any, svgProps: any, style: any): JSX.Element;
render(): JSX.Element;
}
//# sourceMappingURL=victory-container.d.ts.map

@@ -7,8 +7,11 @@ "use strict";

exports.VictoryContainer = void 0;
exports.useVictoryContainer = useVictoryContainer;
var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId"));
var _react = _interopRequireWildcard(require("react"));
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
var _react = _interopRequireDefault(require("react"));
var _portal = require("../victory-portal/portal");

@@ -18,6 +21,8 @@

var _timerContext = _interopRequireDefault(require("../victory-util/timer-context"));
var Helpers = _interopRequireWildcard(require("../victory-util/helpers"));
var UserProps = _interopRequireWildcard(require("../victory-util/user-props"));
var _victoryUtil = require("../victory-util");
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,183 +36,229 @@

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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; }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
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; }
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); }
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; }
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
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); } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
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; }
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); }
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; }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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; }
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); }; }
var defaultProps = {
className: "VictoryContainer",
portalComponent: /*#__PURE__*/_react.default.createElement(_portal.Portal, null),
portalZIndex: 99,
responsive: true,
role: "img"
};
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); }
function useVictoryContainer(initialProps) {
var props = _objectSpread(_objectSpread({}, defaultProps), initialProps);
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
var title = props.title,
desc = props.desc,
width = props.width,
height = props.height,
responsive = props.responsive;
var localContainerRef = (0, _react.useRef)(null);
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; } }
var _React$useState = _react.default.useState(),
_React$useState2 = _slicedToArray(_React$useState, 2),
portalElement = _React$useState2[0],
setPortalElement = _React$useState2[1];
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var portalRef = function (element) {
return setPortalElement(element);
}; // Generated ID stored in ref because it needs to persist across renders
var VictoryContainer = /*#__PURE__*/function (_React$Component) {
_inherits(VictoryContainer, _React$Component);
var _super = _createSuper(VictoryContainer);
var generatedId = (0, _react.useRef)((0, _uniqueId2.default)("victory-container-"));
var containerId = props.containerId ?? generatedId.current;
// @ts-expect-error Ref will be initialized on mount
// @ts-expect-error Ref will be initialized on mount
function VictoryContainer(props) {
var _this;
var getIdForElement = function (elName) {
return "".concat(containerId, "-").concat(elName);
};
_classCallCheck(this, VictoryContainer);
var userProps = UserProps.getSafeUserProps(props);
var dimensions = responsive ? {
width: "100%",
height: "100%"
} : {
width: width,
height: height
};
var viewBox = responsive ? "0 0 ".concat(width, " ").concat(height) : undefined;
var preserveAspectRatio = responsive ? props.preserveAspectRatio : undefined;
var ariaLabelledBy = [title && getIdForElement("title"), props["aria-labelledby"]].filter(Boolean).join(" ") || undefined;
var ariaDescribedBy = [desc && getIdForElement("desc"), props["aria-describedby"]].filter(Boolean).join(" ") || undefined;
var titleId = getIdForElement("title");
var descId = getIdForElement("desc");
return _objectSpread(_objectSpread({}, props), {}, {
titleId: titleId,
descId: descId,
dimensions: dimensions,
viewBox: viewBox,
preserveAspectRatio: preserveAspectRatio,
ariaLabelledBy: ariaLabelledBy,
ariaDescribedBy: ariaDescribedBy,
userProps: userProps,
portalRef: portalRef,
portalElement: portalElement,
localContainerRef: localContainerRef
});
}
_this = _super.call(this, props);
_this.containerId = void 0;
_this.portalRef = void 0;
_this.containerRef = void 0;
_this.shouldHandleWheel = void 0;
var VictoryContainer = function (initialProps) {
var _useVictoryContainer = useVictoryContainer(initialProps),
role = _useVictoryContainer.role,
title = _useVictoryContainer.title,
desc = _useVictoryContainer.desc,
children = _useVictoryContainer.children,
className = _useVictoryContainer.className,
portalZIndex = _useVictoryContainer.portalZIndex,
portalComponent = _useVictoryContainer.portalComponent,
width = _useVictoryContainer.width,
height = _useVictoryContainer.height,
style = _useVictoryContainer.style,
tabIndex = _useVictoryContainer.tabIndex,
responsive = _useVictoryContainer.responsive,
events = _useVictoryContainer.events,
ouiaId = _useVictoryContainer.ouiaId,
ouiaSafe = _useVictoryContainer.ouiaSafe,
ouiaType = _useVictoryContainer.ouiaType,
dimensions = _useVictoryContainer.dimensions,
ariaDescribedBy = _useVictoryContainer.ariaDescribedBy,
ariaLabelledBy = _useVictoryContainer.ariaLabelledBy,
viewBox = _useVictoryContainer.viewBox,
preserveAspectRatio = _useVictoryContainer.preserveAspectRatio,
userProps = _useVictoryContainer.userProps,
titleId = _useVictoryContainer.titleId,
descId = _useVictoryContainer.descId,
portalElement = _useVictoryContainer.portalElement,
portalRef = _useVictoryContainer.portalRef,
containerRef = _useVictoryContainer.containerRef,
localContainerRef = _useVictoryContainer.localContainerRef;
_this.savePortalRef = function (portal) {
_this.portalRef = portal;
return portal;
};
_react.default.useEffect(function () {
// TODO check that this works
if (!(events !== null && events !== void 0 && events.onWheel)) return;
_this.portalUpdate = function (key, el) {
return _this.portalRef.portalUpdate(key, el);
};
var handleWheel = function (e) {
_this.portalRegister = function () {
return _this.portalRef.portalRegister();
};
_this.portalDeregister = function (key) {
return _this.portalRef.portalDeregister(key);
};
_this.saveContainerRef = function (container) {
if (Helpers.isFunction(_this.props.containerRef)) {
_this.props.containerRef(container);
}
_this.containerRef = container;
return container;
};
_this.handleWheel = function (e) {
return e.preventDefault();
};
var container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
container === null || container === void 0 ? void 0 : container.addEventListener("wheel", handleWheel);
return function () {
container === null || container === void 0 ? void 0 : container.removeEventListener("wheel", handleWheel);
}; // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
_this.containerId = !(0, _isObject2.default)(props) || props.containerId === undefined ? (0, _uniqueId2.default)("victory-container-") : props.containerId;
_this.shouldHandleWheel = !!(props && props.events && props.events.onWheel);
return _this;
}
return /*#__PURE__*/_react.default.createElement(_portalContext.PortalContext.Provider, {
value: {
portalElement: portalElement
_createClass(VictoryContainer, [{
key: "componentDidMount",
value: function componentDidMount() {
if (this.shouldHandleWheel && this.containerRef) {
this.containerRef.addEventListener("wheel", this.handleWheel);
}
}
}, /*#__PURE__*/_react.default.createElement("div", {
className: className,
style: _objectSpread(_objectSpread({}, style), {}, {
width: responsive ? style === null || style === void 0 ? void 0 : style.width : dimensions.width,
height: responsive ? style === null || style === void 0 ? void 0 : style.height : dimensions.height,
pointerEvents: "none",
touchAction: "none",
position: "relative"
}),
"data-ouia-component-id": ouiaId,
"data-ouia-component-type": ouiaType,
"data-ouia-safe": ouiaSafe,
ref: (0, _victoryUtil.mergeRefs)([localContainerRef, containerRef])
}, /*#__PURE__*/_react.default.createElement("svg", _extends({
width: width,
height: height,
tabIndex: tabIndex,
role: role,
"aria-labelledby": ariaLabelledBy,
"aria-describedby": ariaDescribedBy,
viewBox: viewBox,
preserveAspectRatio: preserveAspectRatio,
style: _objectSpread(_objectSpread({}, dimensions), {}, {
pointerEvents: "all"
})
}, userProps, events), title ? /*#__PURE__*/_react.default.createElement("title", {
id: titleId
}, title) : null, desc ? /*#__PURE__*/_react.default.createElement("desc", {
id: descId
}, desc) : null, children), /*#__PURE__*/_react.default.createElement("div", {
style: _objectSpread(_objectSpread({}, dimensions), {}, {
zIndex: portalZIndex,
position: "absolute",
top: 0,
left: 0
})
}, /*#__PURE__*/_react.default.cloneElement(portalComponent, {
width: width,
height: height,
viewBox: viewBox,
preserveAspectRatio: preserveAspectRatio,
style: _objectSpread(_objectSpread({}, dimensions), {}, {
overflow: "visible"
}),
ref: portalRef
}))));
};
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.shouldHandleWheel && this.containerRef) {
this.containerRef.removeEventListener("wheel", this.handleWheel);
}
}
}, {
key: "getIdForElement",
value: function getIdForElement(elementName) {
return "".concat(this.containerId, "-").concat(elementName);
} // overridden in custom containers
}, {
key: "getChildren",
value: function getChildren(props) {
return props.children;
} // Get props defined by the Open UI Automation (OUIA) 1.0-RC spec
// See https://ouia.readthedocs.io/en/latest/README.html#ouia-component
}, {
key: "getOUIAProps",
value: function getOUIAProps(props) {
var ouiaId = props.ouiaId,
ouiaSafe = props.ouiaSafe,
ouiaType = props.ouiaType;
return _objectSpread(_objectSpread(_objectSpread({}, ouiaId && {
"data-ouia-component-id": ouiaId
}), ouiaType && {
"data-ouia-component-type": ouiaType
}), ouiaSafe !== undefined && {
"data-ouia-safe": ouiaSafe
});
}
}, {
key: "renderContainer",
value: function renderContainer(props, svgProps, style) {
var title = props.title,
desc = props.desc,
portalComponent = props.portalComponent,
className = props.className,
width = props.width,
height = props.height,
portalZIndex = props.portalZIndex,
responsive = props.responsive;
var children = this.getChildren(props);
var dimensions = responsive ? {
width: "100%",
height: "100%"
} : {
width: width,
height: height
};
var divStyle = Object.assign({
pointerEvents: "none",
touchAction: "none",
position: "relative"
}, dimensions);
var portalDivStyle = Object.assign({
zIndex: portalZIndex,
position: "absolute",
top: 0,
left: 0
}, dimensions);
var svgStyle = Object.assign({
pointerEvents: "all"
}, dimensions);
var portalSvgStyle = Object.assign({
overflow: "visible"
}, dimensions);
var portalProps = {
width: width,
height: height,
viewBox: svgProps.viewBox,
preserveAspectRatio: svgProps.preserveAspectRatio,
style: portalSvgStyle
};
return /*#__PURE__*/_react.default.createElement(_portalContext.PortalContext.Provider, {
value: {
portalUpdate: this.portalUpdate,
portalRegister: this.portalRegister,
portalDeregister: this.portalDeregister
}
}, /*#__PURE__*/_react.default.createElement("div", _extends({
style: (0, _defaults2.default)({}, style, divStyle),
className: className,
ref: this.saveContainerRef
}, this.getOUIAProps(props)), /*#__PURE__*/_react.default.createElement("svg", _extends({}, svgProps, {
style: svgStyle
}), title ? /*#__PURE__*/_react.default.createElement("title", {
id: this.getIdForElement("title")
}, title) : null, desc ? /*#__PURE__*/_react.default.createElement("desc", {
id: this.getIdForElement("desc")
}, desc) : null, children), /*#__PURE__*/_react.default.createElement("div", {
style: portalDivStyle
}, /*#__PURE__*/_react.default.cloneElement(portalComponent, _objectSpread(_objectSpread({}, portalProps), {}, {
ref: this.savePortalRef
})))));
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
width = _this$props.width,
height = _this$props.height,
responsive = _this$props.responsive,
events = _this$props.events,
title = _this$props.title,
desc = _this$props.desc,
tabIndex = _this$props.tabIndex,
preserveAspectRatio = _this$props.preserveAspectRatio,
role = _this$props.role;
var style = responsive ? this.props.style : Helpers.omit(this.props.style, ["height", "width"]);
var userProps = UserProps.getSafeUserProps(this.props);
var svgProps = Object.assign(_objectSpread({
width: width,
height: height,
tabIndex: tabIndex,
role: role,
"aria-labelledby": [title && this.getIdForElement("title"), this.props["aria-labelledby"]].filter(Boolean).join(" ") || undefined,
"aria-describedby": [desc && this.getIdForElement("desc"), this.props["aria-describedby"]].filter(Boolean).join(" ") || undefined,
viewBox: responsive ? "0 0 ".concat(width, " ").concat(height) : undefined,
preserveAspectRatio: responsive ? preserveAspectRatio : undefined
}, userProps), events);
return this.renderContainer(this.props, svgProps, style);
}
}]);
return VictoryContainer;
}(_react.default.Component);
exports.VictoryContainer = VictoryContainer;
VictoryContainer.role = "container";
VictoryContainer.displayName = "VictoryContainer";
VictoryContainer.role = "container";
VictoryContainer.defaultProps = {
className: "VictoryContainer",
portalComponent: /*#__PURE__*/_react.default.createElement(_portal.Portal, null),
portalZIndex: 99,
responsive: true,
role: "img"
};
VictoryContainer.contextType = _timerContext.default;
import React from "react";
export interface PortalContextValue {
portalElement: SVGSVGElement | undefined;
portalRegister(): number;
portalUpdate(key: number, element: React.ReactElement): void;
portalDeregister(key: number): void;
}

@@ -9,3 +11,3 @@ /**

*/
export declare const PortalContext: React.Context<PortalContextValue | undefined>;
export declare const PortalContext: React.Context<PortalContextValue>;
//# sourceMappingURL=portal-context.d.ts.map

@@ -16,5 +16,5 @@ "use strict";

*/
var PortalContext = /*#__PURE__*/_react.default.createContext(undefined);
var PortalContext = /*#__PURE__*/_react.default.createContext({});
exports.PortalContext = PortalContext;
PortalContext.displayName = "PortalContext";
import React from "react";
import { PortalContextValue } from "./portal-context";
export interface PortalProps {

@@ -9,3 +10,13 @@ className?: string;

}
export declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<SVGSVGElement>>;
export declare class Portal extends React.Component<PortalProps> implements PortalContextValue {
static displayName: string;
private readonly map;
private index;
constructor(props: PortalProps);
portalRegister: () => number;
portalUpdate: (key: number, element: React.ReactElement) => void;
portalDeregister: (key: number) => void;
getChildren(): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
render(): JSX.Element;
}
//# sourceMappingURL=portal.d.ts.map

@@ -12,10 +12,81 @@ "use strict";

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); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Portal = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
return /*#__PURE__*/_react.default.createElement("svg", _extends({
ref: ref
}, props));
});
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); } }
exports.Portal = Portal;
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
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); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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); }; }
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); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var Portal = /*#__PURE__*/function (_ref) {
_inherits(Portal, _ref);
var _super = _createSuper(Portal);
function Portal(props) {
var _this;
_classCallCheck(this, Portal);
_this = _super.call(this, props);
_this.map = void 0;
_this.index = void 0;
_this.portalRegister = function () {
return ++_this.index;
};
_this.portalUpdate = function (key, element) {
_this.map[key] = element;
_this.forceUpdate();
};
_this.portalDeregister = function (key) {
delete _this.map[key];
_this.forceUpdate();
};
_this.map = {};
_this.index = 1;
return _this;
}
_createClass(Portal, [{
key: "getChildren",
value: function getChildren() {
var _this2 = this;
return Object.keys(this.map).map(function (key) {
var el = _this2.map[key];
return el ? /*#__PURE__*/_react.default.cloneElement(el, {
key: key
}) : el;
});
} // Overridden in victory-core-native
}, {
key: "render",
value: function render() {
return /*#__PURE__*/_react.default.createElement("svg", this.props, this.getChildren());
}
}]);
return Portal;
}(_react.default.Component);
exports.Portal = Portal;
Portal.displayName = "Portal";
import React from "react";
import { PortalContext } from "./portal-context";
export interface VictoryPortalProps {

@@ -6,6 +7,22 @@ children?: React.ReactElement;

}
export declare const VictoryPortal: {
(initialProps: VictoryPortalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
role: string;
};
export interface VictoryPortal {
context: React.ContextType<typeof PortalContext>;
}
export declare class VictoryPortal extends React.Component<VictoryPortalProps> {
static displayName: string;
static role: string;
static defaultProps: {
groupComponent: JSX.Element;
};
static contextType: React.Context<import("./portal-context").PortalContextValue>;
private checkedContext;
private portalKey;
renderInPlace: boolean;
element: React.ReactElement;
componentDidMount(): void;
componentDidUpdate(): void;
componentWillUnmount(): void;
renderPortal(child: React.ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
}
//# sourceMappingURL=victory-portal.d.ts.map

@@ -18,4 +18,2 @@ "use strict";

var _reactDom = require("react-dom");
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); }

@@ -27,38 +25,112 @@

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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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); } }
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; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
var defaultProps = {
groupComponent: /*#__PURE__*/_react.default.createElement("g", null)
};
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); }
var VictoryPortal = function (initialProps) {
var props = _objectSpread(_objectSpread({}, defaultProps), initialProps);
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
var portalContext = _react.default.useContext(_portalContext.PortalContext);
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); }; }
if (!portalContext) {
var msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
Log.warn(msg);
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); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var VictoryPortal = /*#__PURE__*/function (_React$Component) {
_inherits(VictoryPortal, _React$Component);
var _super = _createSuper(VictoryPortal);
function VictoryPortal() {
var _this;
_classCallCheck(this, VictoryPortal);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_this.checkedContext = void 0;
_this.portalKey = void 0;
_this.renderInPlace = void 0;
_this.element = void 0;
return _this;
}
var children = Array.isArray(props.children) ? props.children[0] : props.children;
var groupComponent = props.groupComponent;
var childProps = children && children.props || {};
var standardProps = childProps.groupComponent ? {
groupComponent: groupComponent,
standalone: false
} : {};
var newProps = (0, _defaults2.default)(standardProps, childProps, Helpers.omit(props, ["children", "groupComponent"]));
_createClass(VictoryPortal, [{
key: "componentDidMount",
value: function componentDidMount() {
if (!this.checkedContext) {
if (typeof this.context.portalUpdate !== "function") {
var msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
Log.warn(msg);
this.renderInPlace = true;
}
var child = children && /*#__PURE__*/_react.default.cloneElement(children, newProps); // If there is no portal context, render the child in place
this.checkedContext = true;
}
this.forceUpdate();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
if (!this.renderInPlace) {
this.portalKey = this.portalKey || this.context.portalRegister();
this.context.portalUpdate(this.portalKey, this.element);
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.context && this.context.portalDeregister) {
this.context.portalDeregister(this.portalKey);
}
} // Overridden in victory-core-native
return portalContext !== null && portalContext !== void 0 && portalContext.portalElement ? /*#__PURE__*/(0, _reactDom.createPortal)(child, portalContext.portalElement) : child;
};
}, {
key: "renderPortal",
value: function renderPortal(child) {
if (this.renderInPlace) {
return child;
}
this.element = child;
return null;
}
}, {
key: "render",
value: function render() {
var children = Array.isArray(this.props.children) ? this.props.children[0] : this.props.children;
var groupComponent = this.props.groupComponent;
var childProps = children && children.props || {};
var standardProps = childProps.groupComponent ? {
groupComponent: groupComponent,
standalone: false
} : {};
var newProps = (0, _defaults2.default)(standardProps, childProps, Helpers.omit(this.props, ["children", "groupComponent"]));
var child = children && /*#__PURE__*/_react.default.cloneElement(children, newProps);
return this.renderPortal(child);
}
}]);
return VictoryPortal;
}(_react.default.Component);
exports.VictoryPortal = VictoryPortal;
VictoryPortal.role = "portal";
VictoryPortal.displayName = "VictoryPortal";
VictoryPortal.role = "portal";
VictoryPortal.defaultProps = {
groupComponent: /*#__PURE__*/_react.default.createElement("g", null)
};
VictoryPortal.contextType = _portalContext.PortalContext;
export * from "./add-events";
export * from "./merge-refs";
export * as Axis from "./axis";

@@ -4,0 +3,0 @@ export * as Collection from "./collection";

@@ -59,16 +59,2 @@ "use strict";

var _mergeRefs = require("./merge-refs");
Object.keys(_mergeRefs).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _mergeRefs[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _mergeRefs[key];
}
});
});
var _Axis = _interopRequireWildcard(require("./axis"));

@@ -75,0 +61,0 @@

{
"name": "victory-core",
"version": "36.9.2-next.1",
"version": "36.9.2-next.3",
"description": "Victory Core",

@@ -25,3 +25,3 @@ "keywords": [

"react-fast-compare": "^3.2.0",
"victory-vendor": "^36.9.2-next.1"
"victory-vendor": "^36.9.2-next.3"
},

@@ -28,0 +28,0 @@ "peerDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc