victory-chart 37.0.1 → 37.0.3-next.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 +16 -0
- package/dist/victory-chart.js +337 -313
- package/dist/victory-chart.min.js +1 -1
- package/es/helper-methods.d.ts +40 -40
- package/es/index.d.ts +1 -1
- package/es/victory-chart.d.ts +26 -26
- package/es/victory-chart.js +1 -4
- package/lib/helper-methods.d.ts +40 -40
- package/lib/index.d.ts +1 -1
- package/lib/victory-chart.d.ts +26 -26
- package/lib/victory-chart.js +1 -4
- package/package.json +5 -8
- package/src/victory-chart.tsx +1 -1
package/dist/victory-chart.js
CHANGED
|
@@ -301,10 +301,7 @@ const defaultProps = {
|
|
|
301
301
|
theme: victory_core__WEBPACK_IMPORTED_MODULE_8__.VictoryTheme.grayscale
|
|
302
302
|
};
|
|
303
303
|
const VictoryChartImpl = initialProps => {
|
|
304
|
-
const propsWithDefaults = react__WEBPACK_IMPORTED_MODULE_2___default().useMemo(() => ({
|
|
305
|
-
...defaultProps,
|
|
306
|
-
...initialProps
|
|
307
|
-
}), [initialProps]);
|
|
304
|
+
const propsWithDefaults = react__WEBPACK_IMPORTED_MODULE_2___default().useMemo(() => lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps), [initialProps]);
|
|
308
305
|
const role = "chart";
|
|
309
306
|
const {
|
|
310
307
|
getAnimationProps,
|
|
@@ -6335,23 +6332,18 @@ const VictoryAnimation = _ref => {
|
|
|
6335
6332
|
"use strict";
|
|
6336
6333
|
__webpack_require__.r(__webpack_exports__);
|
|
6337
6334
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6338
|
-
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; }
|
|
6335
|
+
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
6336
|
+
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
6339
6337
|
/* harmony export */ });
|
|
6340
|
-
/* harmony import */ var
|
|
6341
|
-
/* harmony import */ var
|
|
6342
|
-
/* harmony import */ var
|
|
6343
|
-
/* harmony import */ var
|
|
6344
|
-
/* harmony import */ var
|
|
6345
|
-
/* harmony import */ var
|
|
6346
|
-
/* harmony import */ var
|
|
6347
|
-
/* harmony import */ var
|
|
6348
|
-
/* harmony import */ var
|
|
6349
|
-
/* 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");
|
|
6350
|
-
/* 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");
|
|
6351
|
-
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6352
|
-
/* 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");
|
|
6353
|
-
|
|
6354
|
-
|
|
6338
|
+
/* 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");
|
|
6339
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
6340
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
6341
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
6342
|
+
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
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");
|
|
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");
|
|
6355
6347
|
|
|
6356
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); }
|
|
6357
6349
|
|
|
@@ -6360,175 +6352,149 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
6360
6352
|
|
|
6361
6353
|
|
|
6362
6354
|
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6355
|
+
const defaultProps = {
|
|
6356
|
+
className: "VictoryContainer",
|
|
6357
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
6358
|
+
portalZIndex: 99,
|
|
6359
|
+
responsive: true,
|
|
6360
|
+
role: "img"
|
|
6361
|
+
};
|
|
6362
|
+
function useVictoryContainer(initialProps) {
|
|
6363
|
+
const props = {
|
|
6364
|
+
...defaultProps,
|
|
6365
|
+
...initialProps
|
|
6372
6366
|
};
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
this.props.containerRef(container);
|
|
6394
|
-
}
|
|
6395
|
-
this.containerRef = container;
|
|
6396
|
-
return container;
|
|
6367
|
+
const {
|
|
6368
|
+
title,
|
|
6369
|
+
desc,
|
|
6370
|
+
width,
|
|
6371
|
+
height,
|
|
6372
|
+
responsive
|
|
6373
|
+
} = props;
|
|
6374
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
6375
|
+
|
|
6376
|
+
// Generated ID stored in ref because it needs to persist across renders
|
|
6377
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()("victory-container-"));
|
|
6378
|
+
const containerId = props.containerId ?? generatedId.current;
|
|
6379
|
+
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
6380
|
+
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
6381
|
+
const dimensions = responsive ? {
|
|
6382
|
+
width: "100%",
|
|
6383
|
+
height: "100%"
|
|
6384
|
+
} : {
|
|
6385
|
+
width,
|
|
6386
|
+
height
|
|
6397
6387
|
};
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
const
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
} : {
|
|
6454
|
-
width,
|
|
6455
|
-
height
|
|
6388
|
+
const viewBox = responsive ? `0 0 ${width} ${height}` : undefined;
|
|
6389
|
+
const preserveAspectRatio = responsive ? props.preserveAspectRatio : undefined;
|
|
6390
|
+
const ariaLabelledBy = [title && getIdForElement("title"), props["aria-labelledby"]].filter(Boolean).join(" ") || undefined;
|
|
6391
|
+
const ariaDescribedBy = [desc && getIdForElement("desc"), props["aria-describedby"]].filter(Boolean).join(" ") || undefined;
|
|
6392
|
+
const titleId = getIdForElement("title");
|
|
6393
|
+
const descId = getIdForElement("desc");
|
|
6394
|
+
return {
|
|
6395
|
+
...props,
|
|
6396
|
+
titleId,
|
|
6397
|
+
descId,
|
|
6398
|
+
dimensions,
|
|
6399
|
+
viewBox,
|
|
6400
|
+
preserveAspectRatio,
|
|
6401
|
+
ariaLabelledBy,
|
|
6402
|
+
ariaDescribedBy,
|
|
6403
|
+
userProps,
|
|
6404
|
+
localContainerRef
|
|
6405
|
+
};
|
|
6406
|
+
}
|
|
6407
|
+
const VictoryContainer = initialProps => {
|
|
6408
|
+
const {
|
|
6409
|
+
role,
|
|
6410
|
+
title,
|
|
6411
|
+
desc,
|
|
6412
|
+
children,
|
|
6413
|
+
className,
|
|
6414
|
+
portalZIndex,
|
|
6415
|
+
portalComponent,
|
|
6416
|
+
width,
|
|
6417
|
+
height,
|
|
6418
|
+
style,
|
|
6419
|
+
tabIndex,
|
|
6420
|
+
responsive,
|
|
6421
|
+
events,
|
|
6422
|
+
ouiaId,
|
|
6423
|
+
ouiaSafe,
|
|
6424
|
+
ouiaType,
|
|
6425
|
+
dimensions,
|
|
6426
|
+
ariaDescribedBy,
|
|
6427
|
+
ariaLabelledBy,
|
|
6428
|
+
viewBox,
|
|
6429
|
+
preserveAspectRatio,
|
|
6430
|
+
userProps,
|
|
6431
|
+
titleId,
|
|
6432
|
+
descId,
|
|
6433
|
+
containerRef,
|
|
6434
|
+
localContainerRef
|
|
6435
|
+
} = useVictoryContainer(initialProps);
|
|
6436
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
6437
|
+
if (!events?.onWheel) return;
|
|
6438
|
+
const handleWheel = e => e.preventDefault();
|
|
6439
|
+
const container = localContainerRef?.current;
|
|
6440
|
+
container?.addEventListener("wheel", handleWheel);
|
|
6441
|
+
return () => {
|
|
6442
|
+
container?.removeEventListener("wheel", handleWheel);
|
|
6456
6443
|
};
|
|
6457
|
-
|
|
6444
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
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", {
|
|
6447
|
+
className: className,
|
|
6448
|
+
style: {
|
|
6449
|
+
...style,
|
|
6450
|
+
width: responsive ? style?.width : dimensions.width,
|
|
6451
|
+
height: responsive ? style?.height : dimensions.height,
|
|
6458
6452
|
pointerEvents: "none",
|
|
6459
6453
|
touchAction: "none",
|
|
6460
6454
|
position: "relative"
|
|
6461
|
-
},
|
|
6462
|
-
|
|
6455
|
+
},
|
|
6456
|
+
"data-ouia-component-id": ouiaId,
|
|
6457
|
+
"data-ouia-component-type": ouiaType,
|
|
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({
|
|
6461
|
+
width: width,
|
|
6462
|
+
height: height,
|
|
6463
|
+
tabIndex: tabIndex,
|
|
6464
|
+
role: role,
|
|
6465
|
+
"aria-labelledby": ariaLabelledBy,
|
|
6466
|
+
"aria-describedby": ariaDescribedBy,
|
|
6467
|
+
viewBox: viewBox,
|
|
6468
|
+
preserveAspectRatio: preserveAspectRatio,
|
|
6469
|
+
style: {
|
|
6470
|
+
...dimensions,
|
|
6471
|
+
pointerEvents: "all"
|
|
6472
|
+
}
|
|
6473
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("title", {
|
|
6474
|
+
id: titleId
|
|
6475
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("desc", {
|
|
6476
|
+
id: descId
|
|
6477
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
|
|
6478
|
+
style: {
|
|
6479
|
+
...dimensions,
|
|
6463
6480
|
zIndex: portalZIndex,
|
|
6464
6481
|
position: "absolute",
|
|
6465
6482
|
top: 0,
|
|
6466
6483
|
left: 0
|
|
6467
|
-
}
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6484
|
+
}
|
|
6485
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
6486
|
+
as: portalComponent,
|
|
6487
|
+
width: width,
|
|
6488
|
+
height: height,
|
|
6489
|
+
viewBox: viewBox,
|
|
6490
|
+
preserveAspectRatio: preserveAspectRatio,
|
|
6491
|
+
style: {
|
|
6492
|
+
...dimensions,
|
|
6472
6493
|
overflow: "visible"
|
|
6473
|
-
}
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
viewBox: svgProps.viewBox,
|
|
6478
|
-
preserveAspectRatio: svgProps.preserveAspectRatio,
|
|
6479
|
-
style: portalSvgStyle
|
|
6480
|
-
};
|
|
6481
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_7__.PortalContext.Provider, {
|
|
6482
|
-
value: {
|
|
6483
|
-
portalUpdate: this.portalUpdate,
|
|
6484
|
-
portalRegister: this.portalRegister,
|
|
6485
|
-
portalDeregister: this.portalDeregister
|
|
6486
|
-
}
|
|
6487
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("div", _extends({
|
|
6488
|
-
style: lodash_defaults__WEBPACK_IMPORTED_MODULE_2___default()({}, style, divStyle),
|
|
6489
|
-
className: className,
|
|
6490
|
-
ref: this.saveContainerRef
|
|
6491
|
-
}, this.getOUIAProps(props)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("svg", _extends({}, svgProps, {
|
|
6492
|
-
style: svgStyle
|
|
6493
|
-
}), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("title", {
|
|
6494
|
-
id: this.getIdForElement("title")
|
|
6495
|
-
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("desc", {
|
|
6496
|
-
id: this.getIdForElement("desc")
|
|
6497
|
-
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("div", {
|
|
6498
|
-
style: portalDivStyle
|
|
6499
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(portalComponent, {
|
|
6500
|
-
...portalProps,
|
|
6501
|
-
ref: this.savePortalRef
|
|
6502
|
-
}))));
|
|
6503
|
-
}
|
|
6504
|
-
render() {
|
|
6505
|
-
const {
|
|
6506
|
-
width,
|
|
6507
|
-
height,
|
|
6508
|
-
responsive,
|
|
6509
|
-
events,
|
|
6510
|
-
title,
|
|
6511
|
-
desc,
|
|
6512
|
-
tabIndex,
|
|
6513
|
-
preserveAspectRatio,
|
|
6514
|
-
role
|
|
6515
|
-
} = this.props;
|
|
6516
|
-
const style = responsive ? this.props.style : _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.omit(this.props.style, ["height", "width"]);
|
|
6517
|
-
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_8__.getSafeUserProps(this.props);
|
|
6518
|
-
const svgProps = Object.assign({
|
|
6519
|
-
width,
|
|
6520
|
-
height,
|
|
6521
|
-
tabIndex,
|
|
6522
|
-
role,
|
|
6523
|
-
"aria-labelledby": [title && this.getIdForElement("title"), this.props["aria-labelledby"]].filter(Boolean).join(" ") || undefined,
|
|
6524
|
-
"aria-describedby": [desc && this.getIdForElement("desc"), this.props["aria-describedby"]].filter(Boolean).join(" ") || undefined,
|
|
6525
|
-
viewBox: responsive ? `0 0 ${width} ${height}` : undefined,
|
|
6526
|
-
preserveAspectRatio: responsive ? preserveAspectRatio : undefined,
|
|
6527
|
-
...userProps
|
|
6528
|
-
}, events);
|
|
6529
|
-
return this.renderContainer(this.props, svgProps, style);
|
|
6530
|
-
}
|
|
6531
|
-
}
|
|
6494
|
+
}
|
|
6495
|
+
}))));
|
|
6496
|
+
};
|
|
6497
|
+
VictoryContainer.role = "container";
|
|
6532
6498
|
|
|
6533
6499
|
/***/ }),
|
|
6534
6500
|
|
|
@@ -6990,10 +6956,7 @@ const defaultProps = {
|
|
|
6990
6956
|
lineHeight: 1
|
|
6991
6957
|
};
|
|
6992
6958
|
const VictoryLabel = initialProps => {
|
|
6993
|
-
const props = evaluateProps({
|
|
6994
|
-
...defaultProps,
|
|
6995
|
-
...initialProps
|
|
6996
|
-
});
|
|
6959
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
6997
6960
|
if (props.text === null || props.text === undefined) {
|
|
6998
6961
|
return null;
|
|
6999
6962
|
}
|
|
@@ -7044,17 +7007,83 @@ VictoryLabel.defaultStyles = defaultStyles;
|
|
|
7044
7007
|
"use strict";
|
|
7045
7008
|
__webpack_require__.r(__webpack_exports__);
|
|
7046
7009
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7047
|
-
/* harmony export */ "PortalContext": function() { return /* binding */ PortalContext; }
|
|
7010
|
+
/* harmony export */ "PortalContext": function() { return /* binding */ PortalContext; },
|
|
7011
|
+
/* harmony export */ "PortalProvider": function() { return /* binding */ PortalProvider; },
|
|
7012
|
+
/* harmony export */ "usePortalContext": function() { return /* binding */ usePortalContext; }
|
|
7048
7013
|
/* harmony export */ });
|
|
7049
7014
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7050
7015
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7051
7016
|
|
|
7052
|
-
|
|
7053
|
-
* The React context object consumers may use to access the context of the
|
|
7054
|
-
* portal.
|
|
7055
|
-
*/
|
|
7056
|
-
const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext({});
|
|
7017
|
+
const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext(undefined);
|
|
7057
7018
|
PortalContext.displayName = "PortalContext";
|
|
7019
|
+
const usePortalContext = () => {
|
|
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
|
+
return context;
|
|
7025
|
+
};
|
|
7026
|
+
const PortalProvider = _ref => {
|
|
7027
|
+
let {
|
|
7028
|
+
children
|
|
7029
|
+
} = _ref;
|
|
7030
|
+
const [portalChildren, setPortalChildren] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(new Map());
|
|
7031
|
+
const addChild = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback((id, element) => {
|
|
7032
|
+
setPortalChildren(prevChildren => {
|
|
7033
|
+
const nextChildren = new Map(prevChildren);
|
|
7034
|
+
nextChildren.set(id, element);
|
|
7035
|
+
return nextChildren;
|
|
7036
|
+
});
|
|
7037
|
+
}, [setPortalChildren]);
|
|
7038
|
+
const removeChild = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback(id => {
|
|
7039
|
+
setPortalChildren(prevChildren => {
|
|
7040
|
+
const nextChildren = new Map(prevChildren);
|
|
7041
|
+
nextChildren.delete(id);
|
|
7042
|
+
return nextChildren;
|
|
7043
|
+
});
|
|
7044
|
+
}, [setPortalChildren]);
|
|
7045
|
+
const contextValue = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => ({
|
|
7046
|
+
addChild,
|
|
7047
|
+
removeChild,
|
|
7048
|
+
children: portalChildren
|
|
7049
|
+
}), [addChild, removeChild, portalChildren]);
|
|
7050
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PortalContext.Provider, {
|
|
7051
|
+
value: contextValue
|
|
7052
|
+
}, children);
|
|
7053
|
+
};
|
|
7054
|
+
|
|
7055
|
+
/***/ }),
|
|
7056
|
+
|
|
7057
|
+
/***/ "../../victory-core/es/victory-portal/portal-outlet.js":
|
|
7058
|
+
/*!*************************************************************!*\
|
|
7059
|
+
!*** ../../victory-core/es/victory-portal/portal-outlet.js ***!
|
|
7060
|
+
\*************************************************************/
|
|
7061
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7062
|
+
|
|
7063
|
+
"use strict";
|
|
7064
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7065
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7066
|
+
/* harmony export */ "PortalOutlet": function() { return /* binding */ PortalOutlet; }
|
|
7067
|
+
/* harmony export */ });
|
|
7068
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7069
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7070
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
7071
|
+
|
|
7072
|
+
|
|
7073
|
+
const PortalOutlet = _ref => {
|
|
7074
|
+
let {
|
|
7075
|
+
as: portalComponent,
|
|
7076
|
+
...props
|
|
7077
|
+
} = _ref;
|
|
7078
|
+
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
|
+
});
|
|
7085
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
|
|
7086
|
+
};
|
|
7058
7087
|
|
|
7059
7088
|
/***/ }),
|
|
7060
7089
|
|
|
@@ -7071,39 +7100,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7071
7100
|
/* harmony export */ });
|
|
7072
7101
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7073
7102
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7103
|
+
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); }
|
|
7074
7104
|
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
this.index = 1;
|
|
7081
|
-
}
|
|
7082
|
-
portalRegister = () => {
|
|
7083
|
-
return ++this.index;
|
|
7084
|
-
};
|
|
7085
|
-
portalUpdate = (key, element) => {
|
|
7086
|
-
this.map[key] = element;
|
|
7087
|
-
this.forceUpdate();
|
|
7088
|
-
};
|
|
7089
|
-
portalDeregister = key => {
|
|
7090
|
-
delete this.map[key];
|
|
7091
|
-
this.forceUpdate();
|
|
7092
|
-
};
|
|
7093
|
-
getChildren() {
|
|
7094
|
-
return Object.keys(this.map).map(key => {
|
|
7095
|
-
const el = this.map[key];
|
|
7096
|
-
return el ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(el, {
|
|
7097
|
-
key
|
|
7098
|
-
}) : el;
|
|
7099
|
-
});
|
|
7100
|
-
}
|
|
7101
|
-
|
|
7102
|
-
// Overridden in victory-core-native
|
|
7103
|
-
render() {
|
|
7104
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", this.props, this.getChildren());
|
|
7105
|
-
}
|
|
7106
|
-
}
|
|
7105
|
+
const Portal = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forwardRef((props, ref) => {
|
|
7106
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", _extends({
|
|
7107
|
+
ref: ref
|
|
7108
|
+
}, props));
|
|
7109
|
+
});
|
|
7107
7110
|
|
|
7108
7111
|
/***/ }),
|
|
7109
7112
|
|
|
@@ -7130,59 +7133,42 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7130
7133
|
|
|
7131
7134
|
|
|
7132
7135
|
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7136
|
+
const defaultProps = {
|
|
7137
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
|
|
7138
|
+
};
|
|
7139
|
+
const VictoryPortal = initialProps => {
|
|
7140
|
+
const props = {
|
|
7141
|
+
...defaultProps,
|
|
7142
|
+
...initialProps
|
|
7138
7143
|
};
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
_victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
|
|
7145
|
-
this.renderInPlace = true;
|
|
7146
|
-
}
|
|
7147
|
-
this.checkedContext = true;
|
|
7148
|
-
}
|
|
7149
|
-
this.forceUpdate();
|
|
7144
|
+
const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
|
|
7145
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
|
|
7146
|
+
if (!portalContext) {
|
|
7147
|
+
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
7148
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
|
|
7150
7149
|
}
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
this.portalKey = this.portalKey || this.context.portalRegister();
|
|
7154
|
-
this.context.portalUpdate(this.portalKey, this.element);
|
|
7155
|
-
}
|
|
7156
|
-
}
|
|
7157
|
-
componentWillUnmount() {
|
|
7158
|
-
if (this.context && this.context.portalDeregister) {
|
|
7159
|
-
this.context.portalDeregister(this.portalKey);
|
|
7160
|
-
}
|
|
7161
|
-
}
|
|
7162
|
-
|
|
7163
|
-
// Overridden in victory-core-native
|
|
7164
|
-
renderPortal(child) {
|
|
7165
|
-
if (this.renderInPlace) {
|
|
7166
|
-
return child;
|
|
7167
|
-
}
|
|
7168
|
-
this.element = child;
|
|
7169
|
-
return null;
|
|
7170
|
-
}
|
|
7171
|
-
render() {
|
|
7172
|
-
const children = Array.isArray(this.props.children) ? this.props.children[0] : this.props.children;
|
|
7150
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
7151
|
+
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
7173
7152
|
const {
|
|
7174
7153
|
groupComponent
|
|
7175
|
-
} =
|
|
7154
|
+
} = props;
|
|
7176
7155
|
const childProps = children && children.props || {};
|
|
7177
7156
|
const standardProps = childProps.groupComponent ? {
|
|
7178
7157
|
groupComponent,
|
|
7179
7158
|
standalone: false
|
|
7180
7159
|
} : {};
|
|
7181
|
-
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(
|
|
7160
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]));
|
|
7182
7161
|
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
}
|
|
7162
|
+
portalContext.addChild(id, child);
|
|
7163
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7164
|
+
}, [props.children]);
|
|
7165
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
7166
|
+
return () => portalContext.removeChild(id);
|
|
7167
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7168
|
+
}, []);
|
|
7169
|
+
return null;
|
|
7170
|
+
};
|
|
7171
|
+
VictoryPortal.role = "portal";
|
|
7186
7172
|
|
|
7187
7173
|
/***/ }),
|
|
7188
7174
|
|
|
@@ -7197,10 +7183,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7197
7183
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7198
7184
|
/* harmony export */ "Arc": function() { return /* binding */ Arc; }
|
|
7199
7185
|
/* harmony export */ });
|
|
7200
|
-
/* harmony import */ var
|
|
7201
|
-
/* harmony import */ var
|
|
7202
|
-
/* harmony import */ var
|
|
7203
|
-
/* harmony import */ var
|
|
7186
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
7187
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
7188
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
7189
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
7190
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7191
|
+
/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./path */ "../../victory-core/es/victory-primitives/path.js");
|
|
7192
|
+
|
|
7204
7193
|
/* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 2, 180] }]*/
|
|
7205
7194
|
|
|
7206
7195
|
|
|
@@ -7216,12 +7205,12 @@ const getArcPath = props => {
|
|
|
7216
7205
|
} = props;
|
|
7217
7206
|
// Always draw the path as two arcs so that complete circles may be rendered.
|
|
7218
7207
|
const halfAngle = Math.abs(endAngle - startAngle) / 2 + startAngle;
|
|
7219
|
-
const x1 = cx + r * Math.cos(
|
|
7220
|
-
const y1 = cy - r * Math.sin(
|
|
7221
|
-
const x2 = cx + r * Math.cos(
|
|
7222
|
-
const y2 = cy - r * Math.sin(
|
|
7223
|
-
const x3 = cx + r * Math.cos(
|
|
7224
|
-
const y3 = cy - r * Math.sin(
|
|
7208
|
+
const x1 = cx + r * Math.cos(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(startAngle));
|
|
7209
|
+
const y1 = cy - r * Math.sin(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(startAngle));
|
|
7210
|
+
const x2 = cx + r * Math.cos(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(halfAngle));
|
|
7211
|
+
const y2 = cy - r * Math.sin(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(halfAngle));
|
|
7212
|
+
const x3 = cx + r * Math.cos(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(endAngle));
|
|
7213
|
+
const y3 = cy - r * Math.sin(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(endAngle));
|
|
7225
7214
|
const largerArcFlag1 = halfAngle - startAngle <= 180 ? 0 : 1;
|
|
7226
7215
|
const largerArcFlag2 = endAngle - halfAngle <= 180 ? 0 : 1;
|
|
7227
7216
|
const arcStart = closedPath ? ` M ${cx}, ${cy} L ${x1}, ${y1}` : `M ${x1}, ${y1}`;
|
|
@@ -7239,14 +7228,14 @@ const evaluateProps = props => {
|
|
|
7239
7228
|
* `style`
|
|
7240
7229
|
* `tabIndex`
|
|
7241
7230
|
*/
|
|
7242
|
-
const ariaLabel =
|
|
7243
|
-
const desc =
|
|
7244
|
-
const id =
|
|
7245
|
-
const style =
|
|
7231
|
+
const ariaLabel = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.ariaLabel, props);
|
|
7232
|
+
const desc = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.desc, props);
|
|
7233
|
+
const id = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.id, props);
|
|
7234
|
+
const style = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateStyle(Object.assign({
|
|
7246
7235
|
stroke: "black",
|
|
7247
7236
|
fill: "none"
|
|
7248
7237
|
}, props.style), props);
|
|
7249
|
-
const tabIndex =
|
|
7238
|
+
const tabIndex = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.tabIndex, props);
|
|
7250
7239
|
return Object.assign({}, props, {
|
|
7251
7240
|
ariaLabel,
|
|
7252
7241
|
desc,
|
|
@@ -7256,16 +7245,13 @@ const evaluateProps = props => {
|
|
|
7256
7245
|
});
|
|
7257
7246
|
};
|
|
7258
7247
|
const defaultProps = {
|
|
7259
|
-
pathComponent: /*#__PURE__*/
|
|
7248
|
+
pathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_path__WEBPACK_IMPORTED_MODULE_3__.Path, null),
|
|
7260
7249
|
role: "presentation",
|
|
7261
7250
|
shapeRendering: "auto"
|
|
7262
7251
|
};
|
|
7263
7252
|
const Arc = initialProps => {
|
|
7264
|
-
const props = evaluateProps({
|
|
7265
|
-
|
|
7266
|
-
...initialProps
|
|
7267
|
-
});
|
|
7268
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.pathComponent, {
|
|
7253
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, initialProps, defaultProps));
|
|
7254
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.pathComponent, {
|
|
7269
7255
|
...props.events,
|
|
7270
7256
|
"aria-label": props.ariaLabel,
|
|
7271
7257
|
d: getArcPath(props),
|
|
@@ -7293,11 +7279,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7293
7279
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7294
7280
|
/* harmony export */ "Background": function() { return /* binding */ Background; }
|
|
7295
7281
|
/* harmony export */ });
|
|
7296
|
-
/* harmony import */ var
|
|
7297
|
-
/* harmony import */ var
|
|
7298
|
-
/* harmony import */ var
|
|
7299
|
-
/* harmony import */ var
|
|
7300
|
-
/* harmony import */ var
|
|
7282
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
7283
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
7284
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
7285
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
7286
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7287
|
+
/* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
7288
|
+
/* harmony import */ var _circle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./circle */ "../../victory-core/es/victory-primitives/circle.js");
|
|
7289
|
+
|
|
7301
7290
|
|
|
7302
7291
|
|
|
7303
7292
|
|
|
@@ -7307,23 +7296,20 @@ const evaluateProps = props => {
|
|
|
7307
7296
|
* Potential evaluated prop is:
|
|
7308
7297
|
* `id`
|
|
7309
7298
|
*/
|
|
7310
|
-
const id =
|
|
7299
|
+
const id = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.id, props);
|
|
7311
7300
|
return Object.assign({}, props, {
|
|
7312
7301
|
id
|
|
7313
7302
|
});
|
|
7314
7303
|
};
|
|
7315
7304
|
const defaultProps = {
|
|
7316
|
-
circleComponent: /*#__PURE__*/
|
|
7317
|
-
rectComponent: /*#__PURE__*/
|
|
7305
|
+
circleComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_circle__WEBPACK_IMPORTED_MODULE_3__.Circle, null),
|
|
7306
|
+
rectComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_rect__WEBPACK_IMPORTED_MODULE_4__.Rect, null),
|
|
7318
7307
|
role: "presentation",
|
|
7319
7308
|
shapeRendering: "auto"
|
|
7320
7309
|
};
|
|
7321
7310
|
const Background = initialProps => {
|
|
7322
|
-
const props = evaluateProps({
|
|
7323
|
-
|
|
7324
|
-
...initialProps
|
|
7325
|
-
});
|
|
7326
|
-
return props.polar ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.circleComponent, {
|
|
7311
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, initialProps, defaultProps));
|
|
7312
|
+
return props.polar ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.circleComponent, {
|
|
7327
7313
|
...props.events,
|
|
7328
7314
|
style: props.style,
|
|
7329
7315
|
role: props.role,
|
|
@@ -7332,7 +7318,7 @@ const Background = initialProps => {
|
|
|
7332
7318
|
cy: props.y,
|
|
7333
7319
|
r: props.height,
|
|
7334
7320
|
className: props.className
|
|
7335
|
-
}) : /*#__PURE__*/
|
|
7321
|
+
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.rectComponent, {
|
|
7336
7322
|
...props.events,
|
|
7337
7323
|
style: props.style,
|
|
7338
7324
|
role: props.role,
|
|
@@ -7403,10 +7389,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7403
7389
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7404
7390
|
/* harmony export */ "LineSegment": function() { return /* binding */ LineSegment; }
|
|
7405
7391
|
/* harmony export */ });
|
|
7406
|
-
/* harmony import */ var
|
|
7407
|
-
/* harmony import */ var
|
|
7408
|
-
/* harmony import */ var
|
|
7409
|
-
/* harmony import */ var
|
|
7392
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
7393
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
7394
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
7395
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
7396
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7397
|
+
/* harmony import */ var _line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./line */ "../../victory-core/es/victory-primitives/line.js");
|
|
7398
|
+
|
|
7410
7399
|
|
|
7411
7400
|
|
|
7412
7401
|
|
|
@@ -7419,13 +7408,13 @@ const evaluateProps = props => {
|
|
|
7419
7408
|
* `style`
|
|
7420
7409
|
* `tabIndex`
|
|
7421
7410
|
*/
|
|
7422
|
-
const ariaLabel =
|
|
7423
|
-
const desc =
|
|
7424
|
-
const id =
|
|
7425
|
-
const style =
|
|
7411
|
+
const ariaLabel = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.ariaLabel, props);
|
|
7412
|
+
const desc = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.desc, props);
|
|
7413
|
+
const id = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.id, props);
|
|
7414
|
+
const style = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateStyle(Object.assign({
|
|
7426
7415
|
stroke: "black"
|
|
7427
7416
|
}, props.style), props);
|
|
7428
|
-
const tabIndex =
|
|
7417
|
+
const tabIndex = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.tabIndex, props);
|
|
7429
7418
|
return Object.assign({}, props, {
|
|
7430
7419
|
ariaLabel,
|
|
7431
7420
|
desc,
|
|
@@ -7435,16 +7424,13 @@ const evaluateProps = props => {
|
|
|
7435
7424
|
});
|
|
7436
7425
|
};
|
|
7437
7426
|
const defaultProps = {
|
|
7438
|
-
lineComponent: /*#__PURE__*/
|
|
7427
|
+
lineComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_line__WEBPACK_IMPORTED_MODULE_3__.Line, null),
|
|
7439
7428
|
role: "presentation",
|
|
7440
7429
|
shapeRendering: "auto"
|
|
7441
7430
|
};
|
|
7442
7431
|
const LineSegment = initialProps => {
|
|
7443
|
-
const props = evaluateProps({
|
|
7444
|
-
|
|
7445
|
-
...initialProps
|
|
7446
|
-
});
|
|
7447
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.lineComponent, {
|
|
7432
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, initialProps, defaultProps));
|
|
7433
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.lineComponent, {
|
|
7448
7434
|
...props.events,
|
|
7449
7435
|
"aria-label": props.ariaLabel,
|
|
7450
7436
|
style: props.style,
|
|
@@ -11383,6 +11369,44 @@ function warn(message) {
|
|
|
11383
11369
|
|
|
11384
11370
|
/***/ }),
|
|
11385
11371
|
|
|
11372
|
+
/***/ "../../victory-core/es/victory-util/merge-refs.js":
|
|
11373
|
+
/*!********************************************************!*\
|
|
11374
|
+
!*** ../../victory-core/es/victory-util/merge-refs.js ***!
|
|
11375
|
+
\********************************************************/
|
|
11376
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
11377
|
+
|
|
11378
|
+
"use strict";
|
|
11379
|
+
__webpack_require__.r(__webpack_exports__);
|
|
11380
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11381
|
+
/* harmony export */ "mergeRefs": function() { return /* binding */ mergeRefs; }
|
|
11382
|
+
/* harmony export */ });
|
|
11383
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
11384
|
+
|
|
11385
|
+
/**
|
|
11386
|
+
* Used to merge multiple React refs into a single callback ref.
|
|
11387
|
+
*
|
|
11388
|
+
* @example
|
|
11389
|
+
* ```tsx
|
|
11390
|
+
* <div ref={mergeRefs([ref, forwardedRef])} />
|
|
11391
|
+
* ```
|
|
11392
|
+
*/
|
|
11393
|
+
function mergeRefs(refs) {
|
|
11394
|
+
return value => {
|
|
11395
|
+
refs.forEach(ref => {
|
|
11396
|
+
// If the ref is a function, it's a callback ref and we call it with the value.
|
|
11397
|
+
if (_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction(ref)) {
|
|
11398
|
+
ref(value);
|
|
11399
|
+
} else if (ref !== null && ref !== undefined) {
|
|
11400
|
+
// If the ref is an object (not null and not undefined), it's an object ref.
|
|
11401
|
+
// We assign the value to its 'current' property.
|
|
11402
|
+
ref.current = value;
|
|
11403
|
+
}
|
|
11404
|
+
});
|
|
11405
|
+
};
|
|
11406
|
+
}
|
|
11407
|
+
|
|
11408
|
+
/***/ }),
|
|
11409
|
+
|
|
11386
11410
|
/***/ "../../victory-core/es/victory-util/scale.js":
|
|
11387
11411
|
/*!***************************************************!*\
|
|
11388
11412
|
!*** ../../victory-core/es/victory-util/scale.js ***!
|