victory-bar 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,12 +1,10 @@
1
1
  # victory-bar
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-vendor@37.0.3-next.0
7
+ - Pin all internal victory package versions ([#2876](https://github.com/FormidableLabs/victory/pull/2876))
10
8
 
11
9
  ## 37.0.2
12
10
 
@@ -5910,9 +5910,9 @@ __webpack_require__.r(__webpack_exports__);
5910
5910
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
5911
5911
  /* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
5912
5912
  /* 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");
5913
- /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
5913
+ /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
5914
5914
  /* 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");
5915
- /* 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");
5915
+ /* 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");
5916
5916
 
5917
5917
  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); }
5918
5918
 
@@ -6012,7 +6012,7 @@ const VictoryContainer = initialProps => {
6012
6012
  };
6013
6013
  // eslint-disable-next-line react-hooks/exhaustive-deps
6014
6014
  }, []);
6015
- 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", {
6015
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
6016
6016
  className: className,
6017
6017
  style: {
6018
6018
  ...style,
@@ -6025,8 +6025,8 @@ const VictoryContainer = initialProps => {
6025
6025
  "data-ouia-component-id": ouiaId,
6026
6026
  "data-ouia-component-type": ouiaType,
6027
6027
  "data-ouia-safe": ouiaSafe,
6028
- ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_5__.mergeRefs)([localContainerRef, containerRef])
6029
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
6028
+ ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
6029
+ }, /*#__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({
6030
6030
  width: width,
6031
6031
  height: height,
6032
6032
  tabIndex: tabIndex,
@@ -6587,9 +6587,6 @@ const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().
6587
6587
  PortalContext.displayName = "PortalContext";
6588
6588
  const usePortalContext = () => {
6589
6589
  const context = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(PortalContext);
6590
- if (!context) {
6591
- throw new Error("`usePortalContext` must be used within a `<PortalProvider />`");
6592
- }
6593
6590
  return context;
6594
6591
  };
6595
6592
  const PortalProvider = _ref => {
@@ -6645,12 +6642,10 @@ const PortalOutlet = _ref => {
6645
6642
  ...props
6646
6643
  } = _ref;
6647
6644
  const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_1__.usePortalContext)();
6648
- const children = Array.from(portalContext.children.entries()).map(_ref2 => {
6649
- let [key, node] = _ref2;
6650
- return !node.key ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(node, {
6651
- key
6652
- }) : node;
6653
- });
6645
+ if (!portalContext) {
6646
+ return null;
6647
+ }
6648
+ const children = Array.from(portalContext.children.values());
6654
6649
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
6655
6650
  };
6656
6651
 
@@ -6716,26 +6711,28 @@ const VictoryPortal = initialProps => {
6716
6711
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6717
6712
  _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6718
6713
  }
6714
+ const children = Array.isArray(props.children) ? props.children[0] : props.children;
6715
+ const {
6716
+ groupComponent
6717
+ } = props;
6718
+ const childProps = children && children.props || {};
6719
+ const standardProps = childProps.groupComponent ? {
6720
+ groupComponent,
6721
+ standalone: false
6722
+ } : {};
6723
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6724
+ key: childProps.key ?? id
6725
+ });
6726
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6719
6727
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6720
- const children = Array.isArray(props.children) ? props.children[0] : props.children;
6721
- const {
6722
- groupComponent
6723
- } = props;
6724
- const childProps = children && children.props || {};
6725
- const standardProps = childProps.groupComponent ? {
6726
- groupComponent,
6727
- standalone: false
6728
- } : {};
6729
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]));
6730
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6731
- portalContext.addChild(id, child);
6728
+ portalContext?.addChild(id, child);
6732
6729
  // eslint-disable-next-line react-hooks/exhaustive-deps
6733
6730
  }, [props.children]);
6734
6731
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6735
- return () => portalContext.removeChild(id);
6732
+ return () => portalContext?.removeChild(id);
6736
6733
  // eslint-disable-next-line react-hooks/exhaustive-deps
6737
6734
  }, []);
6738
- return null;
6735
+ return portalContext ? null : child;
6739
6736
  };
6740
6737
  VictoryPortal.role = "portal";
6741
6738