victory-chart 37.0.3-next.0 → 37.1.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/CHANGELOG.md CHANGED
@@ -1,14 +1,10 @@
1
1
  # victory-chart
2
2
 
3
- ## 37.0.3-next.0
3
+ ## 37.1.0
4
4
 
5
- ### Patch Changes
5
+ ### Minor Changes
6
6
 
7
- - Updated dependencies [65d02419f]
8
- - victory-core@37.0.3-next.0
9
- - victory-axis@37.0.3-next.0
10
- - victory-polar-axis@37.0.3-next.0
11
- - victory-shared-events@37.0.3-next.0
7
+ - Pin all internal victory package versions ([#2876](https://github.com/FormidableLabs/victory/pull/2876))
12
8
 
13
9
  ## 37.0.2
14
10
 
@@ -6341,9 +6341,9 @@ __webpack_require__.r(__webpack_exports__);
6341
6341
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6342
6342
  /* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
6343
6343
  /* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
6344
- /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
6344
+ /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
6345
6345
  /* harmony import */ var _victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-portal/portal-outlet */ "../../victory-core/es/victory-portal/portal-outlet.js");
6346
- /* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-portal/portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6346
+ /* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-portal/portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6347
6347
 
6348
6348
  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); }
6349
6349
 
@@ -6443,7 +6443,7 @@ const VictoryContainer = initialProps => {
6443
6443
  };
6444
6444
  // eslint-disable-next-line react-hooks/exhaustive-deps
6445
6445
  }, []);
6446
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_4__.PortalProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
6446
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
6447
6447
  className: className,
6448
6448
  style: {
6449
6449
  ...style,
@@ -6456,8 +6456,8 @@ const VictoryContainer = initialProps => {
6456
6456
  "data-ouia-component-id": ouiaId,
6457
6457
  "data-ouia-component-type": ouiaType,
6458
6458
  "data-ouia-safe": ouiaSafe,
6459
- ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_5__.mergeRefs)([localContainerRef, containerRef])
6460
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
6459
+ ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
6460
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__.PortalProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
6461
6461
  width: width,
6462
6462
  height: height,
6463
6463
  tabIndex: tabIndex,
@@ -7018,9 +7018,6 @@ const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().
7018
7018
  PortalContext.displayName = "PortalContext";
7019
7019
  const usePortalContext = () => {
7020
7020
  const context = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(PortalContext);
7021
- if (!context) {
7022
- throw new Error("`usePortalContext` must be used within a `<PortalProvider />`");
7023
- }
7024
7021
  return context;
7025
7022
  };
7026
7023
  const PortalProvider = _ref => {
@@ -7076,12 +7073,10 @@ const PortalOutlet = _ref => {
7076
7073
  ...props
7077
7074
  } = _ref;
7078
7075
  const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_1__.usePortalContext)();
7079
- const children = Array.from(portalContext.children.entries()).map(_ref2 => {
7080
- let [key, node] = _ref2;
7081
- return !node.key ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(node, {
7082
- key
7083
- }) : node;
7084
- });
7076
+ if (!portalContext) {
7077
+ return null;
7078
+ }
7079
+ const children = Array.from(portalContext.children.values());
7085
7080
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
7086
7081
  };
7087
7082
 
@@ -7147,26 +7142,28 @@ const VictoryPortal = initialProps => {
7147
7142
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
7148
7143
  _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
7149
7144
  }
7145
+ const children = Array.isArray(props.children) ? props.children[0] : props.children;
7146
+ const {
7147
+ groupComponent
7148
+ } = props;
7149
+ const childProps = children && children.props || {};
7150
+ const standardProps = childProps.groupComponent ? {
7151
+ groupComponent,
7152
+ standalone: false
7153
+ } : {};
7154
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
7155
+ key: childProps.key ?? id
7156
+ });
7157
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
7150
7158
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7151
- const children = Array.isArray(props.children) ? props.children[0] : props.children;
7152
- const {
7153
- groupComponent
7154
- } = props;
7155
- const childProps = children && children.props || {};
7156
- const standardProps = childProps.groupComponent ? {
7157
- groupComponent,
7158
- standalone: false
7159
- } : {};
7160
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]));
7161
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
7162
- portalContext.addChild(id, child);
7159
+ portalContext?.addChild(id, child);
7163
7160
  // eslint-disable-next-line react-hooks/exhaustive-deps
7164
7161
  }, [props.children]);
7165
7162
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7166
- return () => portalContext.removeChild(id);
7163
+ return () => portalContext?.removeChild(id);
7167
7164
  // eslint-disable-next-line react-hooks/exhaustive-deps
7168
7165
  }, []);
7169
- return null;
7166
+ return portalContext ? null : child;
7170
7167
  };
7171
7168
  VictoryPortal.role = "portal";
7172
7169