victory-box-plot 37.0.2 → 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 +6 -0
- package/dist/victory-box-plot.js +289 -262
- package/dist/victory-box-plot.min.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/victory-box-plot.js
CHANGED
|
@@ -5672,23 +5672,18 @@ const VictoryAnimation = _ref => {
|
|
|
5672
5672
|
"use strict";
|
|
5673
5673
|
__webpack_require__.r(__webpack_exports__);
|
|
5674
5674
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5675
|
-
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; }
|
|
5675
|
+
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
5676
|
+
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
5676
5677
|
/* harmony export */ });
|
|
5677
|
-
/* harmony import */ var
|
|
5678
|
-
/* harmony import */ var
|
|
5679
|
-
/* harmony import */ var
|
|
5680
|
-
/* harmony import */ var
|
|
5681
|
-
/* harmony import */ var
|
|
5682
|
-
/* harmony import */ var
|
|
5683
|
-
/* harmony import */ var
|
|
5684
|
-
/* harmony import */ var
|
|
5685
|
-
/* harmony import */ var
|
|
5686
|
-
/* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-portal/portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
5687
|
-
/* harmony import */ var _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/timer-context */ "../../victory-core/es/victory-util/timer-context.js");
|
|
5688
|
-
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
5689
|
-
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
5690
|
-
|
|
5691
|
-
|
|
5678
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
5679
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
5680
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
5681
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
5682
|
+
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
5683
|
+
/* 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");
|
|
5684
|
+
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
|
|
5685
|
+
/* 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");
|
|
5686
|
+
/* 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");
|
|
5692
5687
|
|
|
5693
5688
|
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); }
|
|
5694
5689
|
|
|
@@ -5697,175 +5692,149 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
5697
5692
|
|
|
5698
5693
|
|
|
5699
5694
|
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5695
|
+
const defaultProps = {
|
|
5696
|
+
className: "VictoryContainer",
|
|
5697
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
5698
|
+
portalZIndex: 99,
|
|
5699
|
+
responsive: true,
|
|
5700
|
+
role: "img"
|
|
5701
|
+
};
|
|
5702
|
+
function useVictoryContainer(initialProps) {
|
|
5703
|
+
const props = {
|
|
5704
|
+
...defaultProps,
|
|
5705
|
+
...initialProps
|
|
5709
5706
|
};
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5707
|
+
const {
|
|
5708
|
+
title,
|
|
5709
|
+
desc,
|
|
5710
|
+
width,
|
|
5711
|
+
height,
|
|
5712
|
+
responsive
|
|
5713
|
+
} = props;
|
|
5714
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
5715
|
+
|
|
5716
|
+
// Generated ID stored in ref because it needs to persist across renders
|
|
5717
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()("victory-container-"));
|
|
5718
|
+
const containerId = props.containerId ?? generatedId.current;
|
|
5719
|
+
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
5720
|
+
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
5721
|
+
const dimensions = responsive ? {
|
|
5722
|
+
width: "100%",
|
|
5723
|
+
height: "100%"
|
|
5724
|
+
} : {
|
|
5725
|
+
width,
|
|
5726
|
+
height
|
|
5724
5727
|
};
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5728
|
+
const viewBox = responsive ? `0 0 ${width} ${height}` : undefined;
|
|
5729
|
+
const preserveAspectRatio = responsive ? props.preserveAspectRatio : undefined;
|
|
5730
|
+
const ariaLabelledBy = [title && getIdForElement("title"), props["aria-labelledby"]].filter(Boolean).join(" ") || undefined;
|
|
5731
|
+
const ariaDescribedBy = [desc && getIdForElement("desc"), props["aria-describedby"]].filter(Boolean).join(" ") || undefined;
|
|
5732
|
+
const titleId = getIdForElement("title");
|
|
5733
|
+
const descId = getIdForElement("desc");
|
|
5734
|
+
return {
|
|
5735
|
+
...props,
|
|
5736
|
+
titleId,
|
|
5737
|
+
descId,
|
|
5738
|
+
dimensions,
|
|
5739
|
+
viewBox,
|
|
5740
|
+
preserveAspectRatio,
|
|
5741
|
+
ariaLabelledBy,
|
|
5742
|
+
ariaDescribedBy,
|
|
5743
|
+
userProps,
|
|
5744
|
+
localContainerRef
|
|
5734
5745
|
};
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
})
|
|
5773
|
-
};
|
|
5774
|
-
}
|
|
5775
|
-
renderContainer(props, svgProps, style) {
|
|
5776
|
-
const {
|
|
5777
|
-
title,
|
|
5778
|
-
desc,
|
|
5779
|
-
portalComponent,
|
|
5780
|
-
className,
|
|
5781
|
-
width,
|
|
5782
|
-
height,
|
|
5783
|
-
portalZIndex,
|
|
5784
|
-
responsive
|
|
5785
|
-
} = props;
|
|
5786
|
-
const children = this.getChildren(props);
|
|
5787
|
-
const dimensions = responsive ? {
|
|
5788
|
-
width: "100%",
|
|
5789
|
-
height: "100%"
|
|
5790
|
-
} : {
|
|
5791
|
-
width,
|
|
5792
|
-
height
|
|
5746
|
+
}
|
|
5747
|
+
const VictoryContainer = initialProps => {
|
|
5748
|
+
const {
|
|
5749
|
+
role,
|
|
5750
|
+
title,
|
|
5751
|
+
desc,
|
|
5752
|
+
children,
|
|
5753
|
+
className,
|
|
5754
|
+
portalZIndex,
|
|
5755
|
+
portalComponent,
|
|
5756
|
+
width,
|
|
5757
|
+
height,
|
|
5758
|
+
style,
|
|
5759
|
+
tabIndex,
|
|
5760
|
+
responsive,
|
|
5761
|
+
events,
|
|
5762
|
+
ouiaId,
|
|
5763
|
+
ouiaSafe,
|
|
5764
|
+
ouiaType,
|
|
5765
|
+
dimensions,
|
|
5766
|
+
ariaDescribedBy,
|
|
5767
|
+
ariaLabelledBy,
|
|
5768
|
+
viewBox,
|
|
5769
|
+
preserveAspectRatio,
|
|
5770
|
+
userProps,
|
|
5771
|
+
titleId,
|
|
5772
|
+
descId,
|
|
5773
|
+
containerRef,
|
|
5774
|
+
localContainerRef
|
|
5775
|
+
} = useVictoryContainer(initialProps);
|
|
5776
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
5777
|
+
if (!events?.onWheel) return;
|
|
5778
|
+
const handleWheel = e => e.preventDefault();
|
|
5779
|
+
const container = localContainerRef?.current;
|
|
5780
|
+
container?.addEventListener("wheel", handleWheel);
|
|
5781
|
+
return () => {
|
|
5782
|
+
container?.removeEventListener("wheel", handleWheel);
|
|
5793
5783
|
};
|
|
5794
|
-
|
|
5784
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5785
|
+
}, []);
|
|
5786
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
|
|
5787
|
+
className: className,
|
|
5788
|
+
style: {
|
|
5789
|
+
...style,
|
|
5790
|
+
width: responsive ? style?.width : dimensions.width,
|
|
5791
|
+
height: responsive ? style?.height : dimensions.height,
|
|
5795
5792
|
pointerEvents: "none",
|
|
5796
5793
|
touchAction: "none",
|
|
5797
5794
|
position: "relative"
|
|
5798
|
-
},
|
|
5799
|
-
|
|
5795
|
+
},
|
|
5796
|
+
"data-ouia-component-id": ouiaId,
|
|
5797
|
+
"data-ouia-component-type": ouiaType,
|
|
5798
|
+
"data-ouia-safe": ouiaSafe,
|
|
5799
|
+
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
5800
|
+
}, /*#__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({
|
|
5801
|
+
width: width,
|
|
5802
|
+
height: height,
|
|
5803
|
+
tabIndex: tabIndex,
|
|
5804
|
+
role: role,
|
|
5805
|
+
"aria-labelledby": ariaLabelledBy,
|
|
5806
|
+
"aria-describedby": ariaDescribedBy,
|
|
5807
|
+
viewBox: viewBox,
|
|
5808
|
+
preserveAspectRatio: preserveAspectRatio,
|
|
5809
|
+
style: {
|
|
5810
|
+
...dimensions,
|
|
5811
|
+
pointerEvents: "all"
|
|
5812
|
+
}
|
|
5813
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("title", {
|
|
5814
|
+
id: titleId
|
|
5815
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("desc", {
|
|
5816
|
+
id: descId
|
|
5817
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
|
|
5818
|
+
style: {
|
|
5819
|
+
...dimensions,
|
|
5800
5820
|
zIndex: portalZIndex,
|
|
5801
5821
|
position: "absolute",
|
|
5802
5822
|
top: 0,
|
|
5803
5823
|
left: 0
|
|
5804
|
-
}
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5824
|
+
}
|
|
5825
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
5826
|
+
as: portalComponent,
|
|
5827
|
+
width: width,
|
|
5828
|
+
height: height,
|
|
5829
|
+
viewBox: viewBox,
|
|
5830
|
+
preserveAspectRatio: preserveAspectRatio,
|
|
5831
|
+
style: {
|
|
5832
|
+
...dimensions,
|
|
5809
5833
|
overflow: "visible"
|
|
5810
|
-
}
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
viewBox: svgProps.viewBox,
|
|
5815
|
-
preserveAspectRatio: svgProps.preserveAspectRatio,
|
|
5816
|
-
style: portalSvgStyle
|
|
5817
|
-
};
|
|
5818
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_7__.PortalContext.Provider, {
|
|
5819
|
-
value: {
|
|
5820
|
-
portalUpdate: this.portalUpdate,
|
|
5821
|
-
portalRegister: this.portalRegister,
|
|
5822
|
-
portalDeregister: this.portalDeregister
|
|
5823
|
-
}
|
|
5824
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("div", _extends({
|
|
5825
|
-
style: lodash_defaults__WEBPACK_IMPORTED_MODULE_2___default()({}, style, divStyle),
|
|
5826
|
-
className: className,
|
|
5827
|
-
ref: this.saveContainerRef
|
|
5828
|
-
}, this.getOUIAProps(props)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("svg", _extends({}, svgProps, {
|
|
5829
|
-
style: svgStyle
|
|
5830
|
-
}), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("title", {
|
|
5831
|
-
id: this.getIdForElement("title")
|
|
5832
|
-
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("desc", {
|
|
5833
|
-
id: this.getIdForElement("desc")
|
|
5834
|
-
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("div", {
|
|
5835
|
-
style: portalDivStyle
|
|
5836
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(portalComponent, {
|
|
5837
|
-
...portalProps,
|
|
5838
|
-
ref: this.savePortalRef
|
|
5839
|
-
}))));
|
|
5840
|
-
}
|
|
5841
|
-
render() {
|
|
5842
|
-
const {
|
|
5843
|
-
width,
|
|
5844
|
-
height,
|
|
5845
|
-
responsive,
|
|
5846
|
-
events,
|
|
5847
|
-
title,
|
|
5848
|
-
desc,
|
|
5849
|
-
tabIndex,
|
|
5850
|
-
preserveAspectRatio,
|
|
5851
|
-
role
|
|
5852
|
-
} = this.props;
|
|
5853
|
-
const style = responsive ? this.props.style : _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.omit(this.props.style, ["height", "width"]);
|
|
5854
|
-
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_8__.getSafeUserProps(this.props);
|
|
5855
|
-
const svgProps = Object.assign({
|
|
5856
|
-
width,
|
|
5857
|
-
height,
|
|
5858
|
-
tabIndex,
|
|
5859
|
-
role,
|
|
5860
|
-
"aria-labelledby": [title && this.getIdForElement("title"), this.props["aria-labelledby"]].filter(Boolean).join(" ") || undefined,
|
|
5861
|
-
"aria-describedby": [desc && this.getIdForElement("desc"), this.props["aria-describedby"]].filter(Boolean).join(" ") || undefined,
|
|
5862
|
-
viewBox: responsive ? `0 0 ${width} ${height}` : undefined,
|
|
5863
|
-
preserveAspectRatio: responsive ? preserveAspectRatio : undefined,
|
|
5864
|
-
...userProps
|
|
5865
|
-
}, events);
|
|
5866
|
-
return this.renderContainer(this.props, svgProps, style);
|
|
5867
|
-
}
|
|
5868
|
-
}
|
|
5834
|
+
}
|
|
5835
|
+
}))));
|
|
5836
|
+
};
|
|
5837
|
+
VictoryContainer.role = "container";
|
|
5869
5838
|
|
|
5870
5839
|
/***/ }),
|
|
5871
5840
|
|
|
@@ -6378,17 +6347,78 @@ VictoryLabel.defaultStyles = defaultStyles;
|
|
|
6378
6347
|
"use strict";
|
|
6379
6348
|
__webpack_require__.r(__webpack_exports__);
|
|
6380
6349
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6381
|
-
/* harmony export */ "PortalContext": function() { return /* binding */ PortalContext; }
|
|
6350
|
+
/* harmony export */ "PortalContext": function() { return /* binding */ PortalContext; },
|
|
6351
|
+
/* harmony export */ "PortalProvider": function() { return /* binding */ PortalProvider; },
|
|
6352
|
+
/* harmony export */ "usePortalContext": function() { return /* binding */ usePortalContext; }
|
|
6382
6353
|
/* harmony export */ });
|
|
6383
6354
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6384
6355
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6385
6356
|
|
|
6386
|
-
|
|
6387
|
-
* The React context object consumers may use to access the context of the
|
|
6388
|
-
* portal.
|
|
6389
|
-
*/
|
|
6390
|
-
const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext({});
|
|
6357
|
+
const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext(undefined);
|
|
6391
6358
|
PortalContext.displayName = "PortalContext";
|
|
6359
|
+
const usePortalContext = () => {
|
|
6360
|
+
const context = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(PortalContext);
|
|
6361
|
+
return context;
|
|
6362
|
+
};
|
|
6363
|
+
const PortalProvider = _ref => {
|
|
6364
|
+
let {
|
|
6365
|
+
children
|
|
6366
|
+
} = _ref;
|
|
6367
|
+
const [portalChildren, setPortalChildren] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(new Map());
|
|
6368
|
+
const addChild = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback((id, element) => {
|
|
6369
|
+
setPortalChildren(prevChildren => {
|
|
6370
|
+
const nextChildren = new Map(prevChildren);
|
|
6371
|
+
nextChildren.set(id, element);
|
|
6372
|
+
return nextChildren;
|
|
6373
|
+
});
|
|
6374
|
+
}, [setPortalChildren]);
|
|
6375
|
+
const removeChild = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback(id => {
|
|
6376
|
+
setPortalChildren(prevChildren => {
|
|
6377
|
+
const nextChildren = new Map(prevChildren);
|
|
6378
|
+
nextChildren.delete(id);
|
|
6379
|
+
return nextChildren;
|
|
6380
|
+
});
|
|
6381
|
+
}, [setPortalChildren]);
|
|
6382
|
+
const contextValue = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => ({
|
|
6383
|
+
addChild,
|
|
6384
|
+
removeChild,
|
|
6385
|
+
children: portalChildren
|
|
6386
|
+
}), [addChild, removeChild, portalChildren]);
|
|
6387
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PortalContext.Provider, {
|
|
6388
|
+
value: contextValue
|
|
6389
|
+
}, children);
|
|
6390
|
+
};
|
|
6391
|
+
|
|
6392
|
+
/***/ }),
|
|
6393
|
+
|
|
6394
|
+
/***/ "../../victory-core/es/victory-portal/portal-outlet.js":
|
|
6395
|
+
/*!*************************************************************!*\
|
|
6396
|
+
!*** ../../victory-core/es/victory-portal/portal-outlet.js ***!
|
|
6397
|
+
\*************************************************************/
|
|
6398
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6399
|
+
|
|
6400
|
+
"use strict";
|
|
6401
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6402
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6403
|
+
/* harmony export */ "PortalOutlet": function() { return /* binding */ PortalOutlet; }
|
|
6404
|
+
/* harmony export */ });
|
|
6405
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6406
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6407
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
6408
|
+
|
|
6409
|
+
|
|
6410
|
+
const PortalOutlet = _ref => {
|
|
6411
|
+
let {
|
|
6412
|
+
as: portalComponent,
|
|
6413
|
+
...props
|
|
6414
|
+
} = _ref;
|
|
6415
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_1__.usePortalContext)();
|
|
6416
|
+
if (!portalContext) {
|
|
6417
|
+
return null;
|
|
6418
|
+
}
|
|
6419
|
+
const children = Array.from(portalContext.children.values());
|
|
6420
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
|
|
6421
|
+
};
|
|
6392
6422
|
|
|
6393
6423
|
/***/ }),
|
|
6394
6424
|
|
|
@@ -6405,39 +6435,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6405
6435
|
/* harmony export */ });
|
|
6406
6436
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6407
6437
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6438
|
+
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); }
|
|
6408
6439
|
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
this.index = 1;
|
|
6415
|
-
}
|
|
6416
|
-
portalRegister = () => {
|
|
6417
|
-
return ++this.index;
|
|
6418
|
-
};
|
|
6419
|
-
portalUpdate = (key, element) => {
|
|
6420
|
-
this.map[key] = element;
|
|
6421
|
-
this.forceUpdate();
|
|
6422
|
-
};
|
|
6423
|
-
portalDeregister = key => {
|
|
6424
|
-
delete this.map[key];
|
|
6425
|
-
this.forceUpdate();
|
|
6426
|
-
};
|
|
6427
|
-
getChildren() {
|
|
6428
|
-
return Object.keys(this.map).map(key => {
|
|
6429
|
-
const el = this.map[key];
|
|
6430
|
-
return el ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(el, {
|
|
6431
|
-
key
|
|
6432
|
-
}) : el;
|
|
6433
|
-
});
|
|
6434
|
-
}
|
|
6435
|
-
|
|
6436
|
-
// Overridden in victory-core-native
|
|
6437
|
-
render() {
|
|
6438
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", this.props, this.getChildren());
|
|
6439
|
-
}
|
|
6440
|
-
}
|
|
6440
|
+
const Portal = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forwardRef((props, ref) => {
|
|
6441
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", _extends({
|
|
6442
|
+
ref: ref
|
|
6443
|
+
}, props));
|
|
6444
|
+
});
|
|
6441
6445
|
|
|
6442
6446
|
/***/ }),
|
|
6443
6447
|
|
|
@@ -6464,59 +6468,44 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6464
6468
|
|
|
6465
6469
|
|
|
6466
6470
|
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6471
|
+
const defaultProps = {
|
|
6472
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
|
|
6473
|
+
};
|
|
6474
|
+
const VictoryPortal = initialProps => {
|
|
6475
|
+
const props = {
|
|
6476
|
+
...defaultProps,
|
|
6477
|
+
...initialProps
|
|
6472
6478
|
};
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
_victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
|
|
6479
|
-
this.renderInPlace = true;
|
|
6480
|
-
}
|
|
6481
|
-
this.checkedContext = true;
|
|
6482
|
-
}
|
|
6483
|
-
this.forceUpdate();
|
|
6484
|
-
}
|
|
6485
|
-
componentDidUpdate() {
|
|
6486
|
-
if (!this.renderInPlace) {
|
|
6487
|
-
this.portalKey = this.portalKey || this.context.portalRegister();
|
|
6488
|
-
this.context.portalUpdate(this.portalKey, this.element);
|
|
6489
|
-
}
|
|
6490
|
-
}
|
|
6491
|
-
componentWillUnmount() {
|
|
6492
|
-
if (this.context && this.context.portalDeregister) {
|
|
6493
|
-
this.context.portalDeregister(this.portalKey);
|
|
6494
|
-
}
|
|
6495
|
-
}
|
|
6496
|
-
|
|
6497
|
-
// Overridden in victory-core-native
|
|
6498
|
-
renderPortal(child) {
|
|
6499
|
-
if (this.renderInPlace) {
|
|
6500
|
-
return child;
|
|
6501
|
-
}
|
|
6502
|
-
this.element = child;
|
|
6503
|
-
return null;
|
|
6479
|
+
const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
|
|
6480
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
|
|
6481
|
+
if (!portalContext) {
|
|
6482
|
+
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
6483
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
|
|
6504
6484
|
}
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6485
|
+
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
6486
|
+
const {
|
|
6487
|
+
groupComponent
|
|
6488
|
+
} = props;
|
|
6489
|
+
const childProps = children && children.props || {};
|
|
6490
|
+
const standardProps = childProps.groupComponent ? {
|
|
6491
|
+
groupComponent,
|
|
6492
|
+
standalone: false
|
|
6493
|
+
} : {};
|
|
6494
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
|
|
6495
|
+
key: childProps.key ?? id
|
|
6496
|
+
});
|
|
6497
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
|
|
6498
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
6499
|
+
portalContext?.addChild(id, child);
|
|
6500
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6501
|
+
}, [props.children]);
|
|
6502
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
6503
|
+
return () => portalContext?.removeChild(id);
|
|
6504
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6505
|
+
}, []);
|
|
6506
|
+
return portalContext ? null : child;
|
|
6507
|
+
};
|
|
6508
|
+
VictoryPortal.role = "portal";
|
|
6520
6509
|
|
|
6521
6510
|
/***/ }),
|
|
6522
6511
|
|
|
@@ -10208,6 +10197,44 @@ function warn(message) {
|
|
|
10208
10197
|
|
|
10209
10198
|
/***/ }),
|
|
10210
10199
|
|
|
10200
|
+
/***/ "../../victory-core/es/victory-util/merge-refs.js":
|
|
10201
|
+
/*!********************************************************!*\
|
|
10202
|
+
!*** ../../victory-core/es/victory-util/merge-refs.js ***!
|
|
10203
|
+
\********************************************************/
|
|
10204
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
10205
|
+
|
|
10206
|
+
"use strict";
|
|
10207
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10208
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10209
|
+
/* harmony export */ "mergeRefs": function() { return /* binding */ mergeRefs; }
|
|
10210
|
+
/* harmony export */ });
|
|
10211
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
10212
|
+
|
|
10213
|
+
/**
|
|
10214
|
+
* Used to merge multiple React refs into a single callback ref.
|
|
10215
|
+
*
|
|
10216
|
+
* @example
|
|
10217
|
+
* ```tsx
|
|
10218
|
+
* <div ref={mergeRefs([ref, forwardedRef])} />
|
|
10219
|
+
* ```
|
|
10220
|
+
*/
|
|
10221
|
+
function mergeRefs(refs) {
|
|
10222
|
+
return value => {
|
|
10223
|
+
refs.forEach(ref => {
|
|
10224
|
+
// If the ref is a function, it's a callback ref and we call it with the value.
|
|
10225
|
+
if (_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction(ref)) {
|
|
10226
|
+
ref(value);
|
|
10227
|
+
} else if (ref !== null && ref !== undefined) {
|
|
10228
|
+
// If the ref is an object (not null and not undefined), it's an object ref.
|
|
10229
|
+
// We assign the value to its 'current' property.
|
|
10230
|
+
ref.current = value;
|
|
10231
|
+
}
|
|
10232
|
+
});
|
|
10233
|
+
};
|
|
10234
|
+
}
|
|
10235
|
+
|
|
10236
|
+
/***/ }),
|
|
10237
|
+
|
|
10211
10238
|
/***/ "../../victory-core/es/victory-util/scale.js":
|
|
10212
10239
|
/*!***************************************************!*\
|
|
10213
10240
|
!*** ../../victory-core/es/victory-util/scale.js ***!
|