victory-chart 36.2.1 → 36.3.2
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/LICENSE.txt +30 -0
- package/dist/victory-chart.js +142 -37
- package/dist/victory-chart.min.js +1 -1
- package/es/index.d.ts +2 -0
- package/es/victory-chart.js +3 -3
- package/lib/index.d.ts +2 -0
- package/lib/victory-chart.js +2 -2
- package/package.json +7 -6
- package/src/index.d.ts +2 -0
- package/src/victory-chart.js +14 -6
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-2020 Formidable Labs.
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2016-2020 Alexey Svetliakov <https://github.com/asvetliakov>,
|
|
6
|
+
snerks <https://github.com/snerks>, Krzysztof Cebula <https://github.com
|
|
7
|
+
Havret>, Vitaliy Polyanskiy <https://github.com/alreadyExisted>, James Lismore
|
|
8
|
+
<https://github.com/jlismore>, Stack Builders <https://github.com
|
|
9
|
+
stackbuilders>, Esteban Ibarra <https://github.com/ibarrae>, Dominic Lee
|
|
10
|
+
<https://github.com/dominictwlee>, Dave Vedder <https://github.com
|
|
11
|
+
veddermatic>, Alec Flett <https://github.com/alecf> and potentially other
|
|
12
|
+
DefinitelyTyped contributors.
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
The above copyright notice and this permission notice shall be included in all
|
|
30
|
+
copies or substantial portions of the Software.
|
package/dist/victory-chart.js
CHANGED
|
@@ -280,16 +280,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
280
280
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
|
|
281
281
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/hooks/use-animation-state.js");
|
|
282
282
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
283
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/
|
|
284
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/
|
|
285
|
-
/* harmony import */ var
|
|
286
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/
|
|
287
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
288
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
289
|
-
/* harmony import */ var
|
|
290
|
-
/* harmony import */ var
|
|
291
|
-
/* harmony import */ var
|
|
292
|
-
/* harmony import */ var
|
|
283
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/user-props.js");
|
|
284
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/wrapper.js");
|
|
285
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/hooks/use-previous-props.js");
|
|
286
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/common-props.js");
|
|
287
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/prop-types.js");
|
|
288
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/background.js");
|
|
289
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
290
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
|
|
291
|
+
/* harmony import */ var victory_shared_events__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! victory-shared-events */ "../../victory-shared-events/es/victory-shared-events.js");
|
|
292
|
+
/* harmony import */ var victory_axis__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! victory-axis */ "../../victory-axis/es/victory-axis.js");
|
|
293
|
+
/* harmony import */ var victory_polar_axis__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! victory-polar-axis */ "../../victory-polar-axis/es/victory-polar-axis.js");
|
|
293
294
|
/* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.js");
|
|
294
295
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/react-fast-compare/index.js");
|
|
295
296
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_5__);
|
|
@@ -387,17 +388,17 @@ var VictoryChart = function (initialProps) {
|
|
|
387
388
|
}, [domain, scale, width, height, standalone, theme, style, horizontal, name, polar, radius, origin]);
|
|
388
389
|
var container = react__WEBPACK_IMPORTED_MODULE_4___default().useMemo(function () {
|
|
389
390
|
if (standalone) {
|
|
390
|
-
var defaultContainerProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_2___default()({}, containerComponent.props, containerProps);
|
|
391
|
+
var defaultContainerProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_2___default()({}, containerComponent.props, containerProps, victory_core__WEBPACK_IMPORTED_MODULE_9__.getSafeUserProps(initialProps));
|
|
391
392
|
|
|
392
393
|
return react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(containerComponent, defaultContainerProps);
|
|
393
394
|
}
|
|
394
395
|
|
|
395
396
|
return groupComponent;
|
|
396
|
-
}, [groupComponent, standalone, containerComponent, containerProps]);
|
|
397
|
+
}, [groupComponent, standalone, containerComponent, containerProps, initialProps]);
|
|
397
398
|
var events = react__WEBPACK_IMPORTED_MODULE_4___default().useMemo(function () {
|
|
398
|
-
return
|
|
399
|
+
return victory_core__WEBPACK_IMPORTED_MODULE_10__.getAllEvents(props);
|
|
399
400
|
}, [props]);
|
|
400
|
-
var previousProps =
|
|
401
|
+
var previousProps = victory_core__WEBPACK_IMPORTED_MODULE_11__.usePreviousProps(initialProps);
|
|
401
402
|
react__WEBPACK_IMPORTED_MODULE_4___default().useEffect(function () {
|
|
402
403
|
// This is called before dismount to keep state in sync
|
|
403
404
|
return function () {
|
|
@@ -408,7 +409,7 @@ var VictoryChart = function (initialProps) {
|
|
|
408
409
|
}, [setAnimationState, previousProps, initialProps]);
|
|
409
410
|
|
|
410
411
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
411
|
-
return react__WEBPACK_IMPORTED_MODULE_4___default().createElement(
|
|
412
|
+
return react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_12__["default"], {
|
|
412
413
|
container: container,
|
|
413
414
|
eventKey: eventKey,
|
|
414
415
|
events: events,
|
|
@@ -419,7 +420,7 @@ var VictoryChart = function (initialProps) {
|
|
|
419
420
|
return react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(container, container.props, newChildren);
|
|
420
421
|
};
|
|
421
422
|
|
|
422
|
-
VictoryChart.propTypes = _objectSpread({},
|
|
423
|
+
VictoryChart.propTypes = _objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE_13__.baseProps, {
|
|
423
424
|
backgroundComponent: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().element),
|
|
424
425
|
children: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)]),
|
|
425
426
|
defaultAxes: prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
|
|
@@ -431,28 +432,28 @@ VictoryChart.propTypes = _objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE
|
|
|
431
432
|
dependent: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().element)
|
|
432
433
|
}),
|
|
433
434
|
endAngle: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
|
|
434
|
-
innerRadius:
|
|
435
|
+
innerRadius: victory_core__WEBPACK_IMPORTED_MODULE_14__.nonNegative,
|
|
435
436
|
prependDefaultAxes: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
|
|
436
437
|
startAngle: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number)
|
|
437
438
|
});
|
|
438
439
|
VictoryChart.defaultProps = {
|
|
439
|
-
backgroundComponent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(
|
|
440
|
-
containerComponent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(
|
|
440
|
+
backgroundComponent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_15__["default"], null),
|
|
441
|
+
containerComponent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_16__["default"], null),
|
|
441
442
|
defaultAxes: {
|
|
442
|
-
independent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(
|
|
443
|
-
dependent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(
|
|
443
|
+
independent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_axis__WEBPACK_IMPORTED_MODULE_17__["default"], null),
|
|
444
|
+
dependent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_axis__WEBPACK_IMPORTED_MODULE_17__["default"], {
|
|
444
445
|
dependentAxis: true
|
|
445
446
|
})
|
|
446
447
|
},
|
|
447
448
|
defaultPolarAxes: {
|
|
448
|
-
independent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(
|
|
449
|
-
dependent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(
|
|
449
|
+
independent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_polar_axis__WEBPACK_IMPORTED_MODULE_18__["default"], null),
|
|
450
|
+
dependent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_polar_axis__WEBPACK_IMPORTED_MODULE_18__["default"], {
|
|
450
451
|
dependentAxis: true
|
|
451
452
|
})
|
|
452
453
|
},
|
|
453
454
|
groupComponent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement("g", null),
|
|
454
455
|
standalone: true,
|
|
455
|
-
theme:
|
|
456
|
+
theme: victory_core__WEBPACK_IMPORTED_MODULE_19__["default"].grayscale
|
|
456
457
|
};
|
|
457
458
|
var VictoryChartMemo = react__WEBPACK_IMPORTED_MODULE_4___default().memo(VictoryChart, (react_fast_compare__WEBPACK_IMPORTED_MODULE_5___default()));
|
|
458
459
|
VictoryChartMemo.displayName = "VictoryChart";
|
|
@@ -15696,11 +15697,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15696
15697
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
|
|
15697
15698
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
|
|
15698
15699
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
|
|
15699
|
-
/* harmony import */ var
|
|
15700
|
-
/* harmony import */ var
|
|
15700
|
+
/* harmony import */ var _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../victory-util/prop-types */ "../../victory-core/es/victory-util/prop-types.js");
|
|
15701
|
+
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
15701
15702
|
/* 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");
|
|
15702
|
-
/* harmony import */ var
|
|
15703
|
+
/* harmony import */ var _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../victory-util/timer-context */ "../../victory-core/es/victory-util/timer-context.js");
|
|
15703
15704
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
15705
|
+
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
15704
15706
|
|
|
15705
15707
|
|
|
15706
15708
|
|
|
@@ -15733,6 +15735,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
15733
15735
|
|
|
15734
15736
|
|
|
15735
15737
|
|
|
15738
|
+
|
|
15736
15739
|
var VictoryContainer =
|
|
15737
15740
|
/*#__PURE__*/
|
|
15738
15741
|
function (_React$Component) {
|
|
@@ -15903,8 +15906,9 @@ function (_React$Component) {
|
|
|
15903
15906
|
preserveAspectRatio = _props.preserveAspectRatio,
|
|
15904
15907
|
role = _props.role;
|
|
15905
15908
|
var style = responsive ? this.props.style : _victory_util_helpers__WEBPACK_IMPORTED_MODULE_8__.omit(this.props.style, ["height", "width"]);
|
|
15909
|
+
var userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_9__.getSafeUserProps(this.props);
|
|
15906
15910
|
|
|
15907
|
-
var svgProps = lodash_assign__WEBPACK_IMPORTED_MODULE_4___default()({
|
|
15911
|
+
var svgProps = lodash_assign__WEBPACK_IMPORTED_MODULE_4___default()(_objectSpread({
|
|
15908
15912
|
width: width,
|
|
15909
15913
|
height: height,
|
|
15910
15914
|
tabIndex: tabIndex,
|
|
@@ -15913,7 +15917,7 @@ function (_React$Component) {
|
|
|
15913
15917
|
"aria-describedby": [desc && this.getIdForElement("desc"), this.props["aria-describedby"]].filter(Boolean).join(" ") || undefined,
|
|
15914
15918
|
viewBox: responsive ? "0 0 ".concat(width, " ").concat(height) : undefined,
|
|
15915
15919
|
preserveAspectRatio: responsive ? preserveAspectRatio : undefined
|
|
15916
|
-
}, events);
|
|
15920
|
+
}, userProps), events);
|
|
15917
15921
|
|
|
15918
15922
|
return this.renderContainer(this.props, svgProps, style);
|
|
15919
15923
|
}
|
|
@@ -15947,18 +15951,18 @@ Object.defineProperty(VictoryContainer, "propTypes", {
|
|
|
15947
15951
|
containerRef: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func),
|
|
15948
15952
|
desc: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15949
15953
|
events: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object),
|
|
15950
|
-
height:
|
|
15954
|
+
height: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.nonNegative,
|
|
15951
15955
|
name: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15952
15956
|
origin: prop_types__WEBPACK_IMPORTED_MODULE_6___default().shape({
|
|
15953
|
-
x:
|
|
15954
|
-
y:
|
|
15957
|
+
x: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.nonNegative,
|
|
15958
|
+
y: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.nonNegative
|
|
15955
15959
|
}),
|
|
15956
15960
|
ouiaId: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string)]),
|
|
15957
15961
|
ouiaSafe: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool),
|
|
15958
15962
|
ouiaType: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15959
15963
|
polar: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool),
|
|
15960
15964
|
portalComponent: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().element),
|
|
15961
|
-
portalZIndex:
|
|
15965
|
+
portalZIndex: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.integer,
|
|
15962
15966
|
preserveAspectRatio: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15963
15967
|
responsive: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool),
|
|
15964
15968
|
role: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
@@ -15966,7 +15970,7 @@ Object.defineProperty(VictoryContainer, "propTypes", {
|
|
|
15966
15970
|
tabIndex: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().number),
|
|
15967
15971
|
theme: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object),
|
|
15968
15972
|
title: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15969
|
-
width:
|
|
15973
|
+
width: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.nonNegative
|
|
15970
15974
|
}
|
|
15971
15975
|
});
|
|
15972
15976
|
Object.defineProperty(VictoryContainer, "defaultProps", {
|
|
@@ -15975,7 +15979,7 @@ Object.defineProperty(VictoryContainer, "defaultProps", {
|
|
|
15975
15979
|
writable: true,
|
|
15976
15980
|
value: {
|
|
15977
15981
|
className: "VictoryContainer",
|
|
15978
|
-
portalComponent: react__WEBPACK_IMPORTED_MODULE_5___default().createElement(
|
|
15982
|
+
portalComponent: react__WEBPACK_IMPORTED_MODULE_5___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_11__["default"], null),
|
|
15979
15983
|
portalZIndex: 99,
|
|
15980
15984
|
responsive: true,
|
|
15981
15985
|
role: "img"
|
|
@@ -15985,7 +15989,7 @@ Object.defineProperty(VictoryContainer, "contextType", {
|
|
|
15985
15989
|
configurable: true,
|
|
15986
15990
|
enumerable: true,
|
|
15987
15991
|
writable: true,
|
|
15988
|
-
value:
|
|
15992
|
+
value: _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_12__["default"]
|
|
15989
15993
|
});
|
|
15990
15994
|
|
|
15991
15995
|
|
|
@@ -18319,6 +18323,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18319
18323
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/react-fast-compare/index.js");
|
|
18320
18324
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_10__);
|
|
18321
18325
|
/* harmony import */ var _victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../victory-transition/victory-transition */ "../../victory-core/es/victory-transition/victory-transition.js");
|
|
18326
|
+
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
18322
18327
|
|
|
18323
18328
|
|
|
18324
18329
|
|
|
@@ -18355,6 +18360,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
18355
18360
|
|
|
18356
18361
|
|
|
18357
18362
|
|
|
18363
|
+
|
|
18358
18364
|
var datumHasXandY = function (datum) {
|
|
18359
18365
|
return !lodash_isNil__WEBPACK_IMPORTED_MODULE_1___default()(datum._x) && !lodash_isNil__WEBPACK_IMPORTED_MODULE_1___default()(datum._y);
|
|
18360
18366
|
}; // used for checking state changes. Expected components can be passed in via options
|
|
@@ -18700,6 +18706,7 @@ var defaultComponents = [{
|
|
|
18700
18706
|
var dataComponent = props.dataComponent,
|
|
18701
18707
|
labelComponent = props.labelComponent,
|
|
18702
18708
|
groupComponent = props.groupComponent;
|
|
18709
|
+
var userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_13__.getSafeUserProps(props);
|
|
18703
18710
|
var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
|
|
18704
18711
|
var dataProps = _this9.getComponentProps(dataComponent, "data", index);
|
|
18705
18712
|
|
|
@@ -18721,7 +18728,8 @@ var defaultComponents = [{
|
|
|
18721
18728
|
|
|
18722
18729
|
var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
|
|
18723
18730
|
|
|
18724
|
-
|
|
18731
|
+
var group = react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(groupComponent, userProps, children);
|
|
18732
|
+
return this.renderContainer(group, children);
|
|
18725
18733
|
}
|
|
18726
18734
|
}]);
|
|
18727
18735
|
|
|
@@ -23173,6 +23181,103 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
23173
23181
|
|
|
23174
23182
|
/***/ }),
|
|
23175
23183
|
|
|
23184
|
+
/***/ "../../victory-core/es/victory-util/user-props.js":
|
|
23185
|
+
/*!********************************************************!*\
|
|
23186
|
+
!*** ../../victory-core/es/victory-util/user-props.js ***!
|
|
23187
|
+
\********************************************************/
|
|
23188
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
23189
|
+
|
|
23190
|
+
"use strict";
|
|
23191
|
+
__webpack_require__.r(__webpack_exports__);
|
|
23192
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23193
|
+
/* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps)
|
|
23194
|
+
/* harmony export */ });
|
|
23195
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
23196
|
+
|
|
23197
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
23198
|
+
|
|
23199
|
+
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; }
|
|
23200
|
+
|
|
23201
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23202
|
+
|
|
23203
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
|
23204
|
+
|
|
23205
|
+
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; }
|
|
23206
|
+
|
|
23207
|
+
/*
|
|
23208
|
+
USER_PROPS_SAFELIST is to contain any string deemed safe for user props.
|
|
23209
|
+
The startsWidth array will contain the start of any accepted user-prop that
|
|
23210
|
+
starts with these characters.
|
|
23211
|
+
The exactMatch will contain a list of exact prop names that are accepted.
|
|
23212
|
+
*/
|
|
23213
|
+
var USER_PROPS_SAFELIST = {
|
|
23214
|
+
startsWith: ["data-", "aria-"],
|
|
23215
|
+
exactMatch: []
|
|
23216
|
+
};
|
|
23217
|
+
/**
|
|
23218
|
+
* doesPropStartWith: Function that takes a prop's key and runs it against all
|
|
23219
|
+
* options in the USER_PROPS_SAFELIST and checks to see if it starts with any
|
|
23220
|
+
* of those options.
|
|
23221
|
+
* @param {string} key: prop key to be tested against whitelist
|
|
23222
|
+
* @returns {Boolean}: returns true if the key starts with an option or false if
|
|
23223
|
+
* otherwise
|
|
23224
|
+
*/
|
|
23225
|
+
|
|
23226
|
+
var doesPropStartWith = function (key) {
|
|
23227
|
+
var startsWith = false;
|
|
23228
|
+
USER_PROPS_SAFELIST.startsWith.forEach(function (starterString) {
|
|
23229
|
+
var regex = new RegExp("\\b(".concat(starterString, ")(\\w|-)+"), "g");
|
|
23230
|
+
if (regex.test(key)) startsWith = true;
|
|
23231
|
+
});
|
|
23232
|
+
return startsWith;
|
|
23233
|
+
};
|
|
23234
|
+
/**
|
|
23235
|
+
* isExactMatch: checks to see if the given key matches any of the 'exactMatch'
|
|
23236
|
+
* items in the whitelist
|
|
23237
|
+
* @param {String} key: prop key to be tested against the whitelist-exact match
|
|
23238
|
+
* array.
|
|
23239
|
+
* @returns {Boolean}: return true if whitelist contains that key, otherwise
|
|
23240
|
+
* returns false.
|
|
23241
|
+
*/
|
|
23242
|
+
|
|
23243
|
+
|
|
23244
|
+
var isExactMatch = function (key) {
|
|
23245
|
+
return USER_PROPS_SAFELIST.exactMatch.includes(key);
|
|
23246
|
+
};
|
|
23247
|
+
/**
|
|
23248
|
+
* testIfSafeProp: tests prop's key against both startsWith and exactMatch values
|
|
23249
|
+
* @param {String} key: prop key to be tested against the whitelist
|
|
23250
|
+
* @returns {Boolean}: returns true if found in whitelist, otherwise returns false
|
|
23251
|
+
*/
|
|
23252
|
+
|
|
23253
|
+
|
|
23254
|
+
var testIfSafeProp = function (key) {
|
|
23255
|
+
if (doesPropStartWith(key) || isExactMatch(key)) return true;
|
|
23256
|
+
return false;
|
|
23257
|
+
};
|
|
23258
|
+
/**
|
|
23259
|
+
* getSafeUserProps - function that takes in a props object and removes any
|
|
23260
|
+
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
23261
|
+
* object.
|
|
23262
|
+
*
|
|
23263
|
+
* @param {Object} props: props to be filtered against USER_PROPS_SAFELIST
|
|
23264
|
+
* @returns {Object}: object containing remaining acceptable props
|
|
23265
|
+
*/
|
|
23266
|
+
|
|
23267
|
+
|
|
23268
|
+
var getSafeUserProps = function (props) {
|
|
23269
|
+
var propsToFilter = _objectSpread({}, props);
|
|
23270
|
+
|
|
23271
|
+
return Object.fromEntries(Object.entries(propsToFilter).filter(function (_ref) {
|
|
23272
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
23273
|
+
key = _ref2[0];
|
|
23274
|
+
|
|
23275
|
+
return testIfSafeProp(key);
|
|
23276
|
+
}));
|
|
23277
|
+
};
|
|
23278
|
+
|
|
23279
|
+
/***/ }),
|
|
23280
|
+
|
|
23176
23281
|
/***/ "../../victory-core/es/victory-util/wrapper.js":
|
|
23177
23282
|
/*!*****************************************************!*\
|
|
23178
23283
|
!*** ../../victory-core/es/victory-util/wrapper.js ***!
|