victory-pie 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-pie.js +150 -44
- package/dist/victory-pie.min.js +1 -1
- package/es/victory-pie.js +3 -2
- package/lib/victory-pie.js +4 -1
- package/package.json +4 -3
- package/src/victory-pie.js +7 -2
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-pie.js
CHANGED
|
@@ -495,14 +495,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
495
495
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
|
|
496
496
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
|
|
497
497
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
498
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/
|
|
499
|
-
/* harmony import */ var
|
|
500
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
501
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
502
|
-
/* harmony import */ var
|
|
503
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/
|
|
504
|
-
/* harmony import */ var
|
|
505
|
-
/* harmony import */ var
|
|
498
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/user-props.js");
|
|
499
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/prop-types.js");
|
|
500
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-label/victory-label.js");
|
|
501
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
502
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
|
|
503
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/data.js");
|
|
504
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/add-events.js");
|
|
505
|
+
/* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./slice */ "./slice.js");
|
|
506
|
+
/* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.js");
|
|
506
507
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
507
508
|
|
|
508
509
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -563,7 +564,8 @@ function (_React$Component) {
|
|
|
563
564
|
}
|
|
564
565
|
|
|
565
566
|
var children = this.renderData(props);
|
|
566
|
-
|
|
567
|
+
var container = react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.containerComponent, victory_core__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props));
|
|
568
|
+
return props.standalone ? this.renderContainer(container, children) : children;
|
|
567
569
|
}
|
|
568
570
|
}]);
|
|
569
571
|
|
|
@@ -627,50 +629,50 @@ Object.defineProperty(VictoryPie, "propTypes", {
|
|
|
627
629
|
animate: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)]),
|
|
628
630
|
colorScale: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)), prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(["grayscale", "qualitative", "heatmap", "warm", "cool", "red", "green", "blue"])]),
|
|
629
631
|
containerComponent: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
|
|
630
|
-
cornerRadius: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([
|
|
632
|
+
cornerRadius: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
|
631
633
|
data: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array),
|
|
632
634
|
dataComponent: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
|
|
633
635
|
disableInlineStyes: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
|
634
636
|
endAngle: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
|
635
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
|
637
|
+
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
|
|
636
638
|
events: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
|
|
637
639
|
target: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(["data", "labels", "parent"]),
|
|
638
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
|
640
|
+
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
|
|
639
641
|
eventHandlers: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)
|
|
640
642
|
})),
|
|
641
643
|
externalEventMutations: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
|
|
642
644
|
callback: (prop_types__WEBPACK_IMPORTED_MODULE_1___default()["function"]),
|
|
643
645
|
childName: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array)]),
|
|
644
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().array),
|
|
646
|
+
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().array), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
|
|
645
647
|
mutation: (prop_types__WEBPACK_IMPORTED_MODULE_1___default()["function"]),
|
|
646
648
|
target: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array)])
|
|
647
649
|
})),
|
|
648
650
|
groupComponent: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
|
|
649
|
-
height:
|
|
650
|
-
innerRadius: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([
|
|
651
|
+
height: victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative,
|
|
652
|
+
innerRadius: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
|
651
653
|
labelComponent: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
|
|
652
654
|
labelPlacement: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func), prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(["parallel", "perpendicular", "vertical"])]),
|
|
653
655
|
labelPosition: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func), prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(["startAngle", "centroid", "endAngle"])]),
|
|
654
|
-
labelRadius: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([
|
|
656
|
+
labelRadius: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
|
655
657
|
labels: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array)]),
|
|
656
658
|
name: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
|
|
657
659
|
origin: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
|
|
658
|
-
x:
|
|
659
|
-
y:
|
|
660
|
+
x: victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative,
|
|
661
|
+
y: victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative
|
|
660
662
|
}),
|
|
661
|
-
padAngle: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([
|
|
663
|
+
padAngle: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
|
662
664
|
padding: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
|
|
663
665
|
top: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
|
664
666
|
bottom: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
|
665
667
|
left: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
|
666
668
|
right: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)
|
|
667
669
|
})]),
|
|
668
|
-
radius: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([
|
|
670
|
+
radius: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
|
669
671
|
sharedEvents: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
|
|
670
672
|
events: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array),
|
|
671
673
|
getEventState: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
|
|
672
674
|
}),
|
|
673
|
-
sortKey: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
|
675
|
+
sortKey: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().string))]),
|
|
674
676
|
sortOrder: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(["ascending", "descending"]),
|
|
675
677
|
standalone: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
|
676
678
|
startAngle: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
|
@@ -680,9 +682,9 @@ Object.defineProperty(VictoryPie, "propTypes", {
|
|
|
680
682
|
labels: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)
|
|
681
683
|
}),
|
|
682
684
|
theme: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
|
|
683
|
-
width:
|
|
684
|
-
x: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
|
685
|
-
y: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
|
685
|
+
width: victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative,
|
|
686
|
+
x: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().string))]),
|
|
687
|
+
y: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().string))])
|
|
686
688
|
}
|
|
687
689
|
});
|
|
688
690
|
Object.defineProperty(VictoryPie, "defaultProps", {
|
|
@@ -707,12 +709,12 @@ Object.defineProperty(VictoryPie, "defaultProps", {
|
|
|
707
709
|
y: 2
|
|
708
710
|
}],
|
|
709
711
|
standalone: true,
|
|
710
|
-
dataComponent: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
711
|
-
labelComponent: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
712
|
-
containerComponent: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
712
|
+
dataComponent: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_slice__WEBPACK_IMPORTED_MODULE_5__["default"], null),
|
|
713
|
+
labelComponent: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_6__["default"], null),
|
|
714
|
+
containerComponent: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_7__["default"], null),
|
|
713
715
|
groupComponent: react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
|
|
714
716
|
sortOrder: "ascending",
|
|
715
|
-
theme:
|
|
717
|
+
theme: victory_core__WEBPACK_IMPORTED_MODULE_8__["default"].grayscale
|
|
716
718
|
}
|
|
717
719
|
});
|
|
718
720
|
Object.defineProperty(VictoryPie, "getBaseProps", {
|
|
@@ -720,14 +722,14 @@ Object.defineProperty(VictoryPie, "getBaseProps", {
|
|
|
720
722
|
enumerable: true,
|
|
721
723
|
writable: true,
|
|
722
724
|
value: function (props) {
|
|
723
|
-
return (0,
|
|
725
|
+
return (0,_helper_methods__WEBPACK_IMPORTED_MODULE_9__.getBaseProps)(props, fallbackProps);
|
|
724
726
|
}
|
|
725
727
|
});
|
|
726
728
|
Object.defineProperty(VictoryPie, "getData", {
|
|
727
729
|
configurable: true,
|
|
728
730
|
enumerable: true,
|
|
729
731
|
writable: true,
|
|
730
|
-
value:
|
|
732
|
+
value: victory_core__WEBPACK_IMPORTED_MODULE_10__.getData
|
|
731
733
|
});
|
|
732
734
|
Object.defineProperty(VictoryPie, "expectedComponents", {
|
|
733
735
|
configurable: true,
|
|
@@ -735,7 +737,7 @@ Object.defineProperty(VictoryPie, "expectedComponents", {
|
|
|
735
737
|
writable: true,
|
|
736
738
|
value: ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]
|
|
737
739
|
});
|
|
738
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,
|
|
740
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,victory_core__WEBPACK_IMPORTED_MODULE_11__["default"])(VictoryPie));
|
|
739
741
|
|
|
740
742
|
/***/ }),
|
|
741
743
|
|
|
@@ -14849,11 +14851,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14849
14851
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
|
|
14850
14852
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
|
|
14851
14853
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
|
|
14852
|
-
/* harmony import */ var
|
|
14853
|
-
/* harmony import */ var
|
|
14854
|
+
/* 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");
|
|
14855
|
+
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
14854
14856
|
/* 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");
|
|
14855
|
-
/* harmony import */ var
|
|
14857
|
+
/* 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");
|
|
14856
14858
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
14859
|
+
/* 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");
|
|
14857
14860
|
|
|
14858
14861
|
|
|
14859
14862
|
|
|
@@ -14886,6 +14889,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
14886
14889
|
|
|
14887
14890
|
|
|
14888
14891
|
|
|
14892
|
+
|
|
14889
14893
|
var VictoryContainer =
|
|
14890
14894
|
/*#__PURE__*/
|
|
14891
14895
|
function (_React$Component) {
|
|
@@ -15056,8 +15060,9 @@ function (_React$Component) {
|
|
|
15056
15060
|
preserveAspectRatio = _props.preserveAspectRatio,
|
|
15057
15061
|
role = _props.role;
|
|
15058
15062
|
var style = responsive ? this.props.style : _victory_util_helpers__WEBPACK_IMPORTED_MODULE_8__.omit(this.props.style, ["height", "width"]);
|
|
15063
|
+
var userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_9__.getSafeUserProps(this.props);
|
|
15059
15064
|
|
|
15060
|
-
var svgProps = lodash_assign__WEBPACK_IMPORTED_MODULE_4___default()({
|
|
15065
|
+
var svgProps = lodash_assign__WEBPACK_IMPORTED_MODULE_4___default()(_objectSpread({
|
|
15061
15066
|
width: width,
|
|
15062
15067
|
height: height,
|
|
15063
15068
|
tabIndex: tabIndex,
|
|
@@ -15066,7 +15071,7 @@ function (_React$Component) {
|
|
|
15066
15071
|
"aria-describedby": [desc && this.getIdForElement("desc"), this.props["aria-describedby"]].filter(Boolean).join(" ") || undefined,
|
|
15067
15072
|
viewBox: responsive ? "0 0 ".concat(width, " ").concat(height) : undefined,
|
|
15068
15073
|
preserveAspectRatio: responsive ? preserveAspectRatio : undefined
|
|
15069
|
-
}, events);
|
|
15074
|
+
}, userProps), events);
|
|
15070
15075
|
|
|
15071
15076
|
return this.renderContainer(this.props, svgProps, style);
|
|
15072
15077
|
}
|
|
@@ -15100,18 +15105,18 @@ Object.defineProperty(VictoryContainer, "propTypes", {
|
|
|
15100
15105
|
containerRef: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func),
|
|
15101
15106
|
desc: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15102
15107
|
events: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object),
|
|
15103
|
-
height:
|
|
15108
|
+
height: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.nonNegative,
|
|
15104
15109
|
name: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15105
15110
|
origin: prop_types__WEBPACK_IMPORTED_MODULE_6___default().shape({
|
|
15106
|
-
x:
|
|
15107
|
-
y:
|
|
15111
|
+
x: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.nonNegative,
|
|
15112
|
+
y: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.nonNegative
|
|
15108
15113
|
}),
|
|
15109
15114
|
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)]),
|
|
15110
15115
|
ouiaSafe: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool),
|
|
15111
15116
|
ouiaType: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15112
15117
|
polar: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool),
|
|
15113
15118
|
portalComponent: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().element),
|
|
15114
|
-
portalZIndex:
|
|
15119
|
+
portalZIndex: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.integer,
|
|
15115
15120
|
preserveAspectRatio: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15116
15121
|
responsive: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool),
|
|
15117
15122
|
role: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
@@ -15119,7 +15124,7 @@ Object.defineProperty(VictoryContainer, "propTypes", {
|
|
|
15119
15124
|
tabIndex: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().number),
|
|
15120
15125
|
theme: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object),
|
|
15121
15126
|
title: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
|
|
15122
|
-
width:
|
|
15127
|
+
width: _victory_util_prop_types__WEBPACK_IMPORTED_MODULE_10__.nonNegative
|
|
15123
15128
|
}
|
|
15124
15129
|
});
|
|
15125
15130
|
Object.defineProperty(VictoryContainer, "defaultProps", {
|
|
@@ -15128,7 +15133,7 @@ Object.defineProperty(VictoryContainer, "defaultProps", {
|
|
|
15128
15133
|
writable: true,
|
|
15129
15134
|
value: {
|
|
15130
15135
|
className: "VictoryContainer",
|
|
15131
|
-
portalComponent: react__WEBPACK_IMPORTED_MODULE_5___default().createElement(
|
|
15136
|
+
portalComponent: react__WEBPACK_IMPORTED_MODULE_5___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_11__["default"], null),
|
|
15132
15137
|
portalZIndex: 99,
|
|
15133
15138
|
responsive: true,
|
|
15134
15139
|
role: "img"
|
|
@@ -15138,7 +15143,7 @@ Object.defineProperty(VictoryContainer, "contextType", {
|
|
|
15138
15143
|
configurable: true,
|
|
15139
15144
|
enumerable: true,
|
|
15140
15145
|
writable: true,
|
|
15141
|
-
value:
|
|
15146
|
+
value: _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_12__["default"]
|
|
15142
15147
|
});
|
|
15143
15148
|
|
|
15144
15149
|
|
|
@@ -17102,6 +17107,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17102
17107
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/react-fast-compare/index.js");
|
|
17103
17108
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_10__);
|
|
17104
17109
|
/* 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");
|
|
17110
|
+
/* 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");
|
|
17105
17111
|
|
|
17106
17112
|
|
|
17107
17113
|
|
|
@@ -17138,6 +17144,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
17138
17144
|
|
|
17139
17145
|
|
|
17140
17146
|
|
|
17147
|
+
|
|
17141
17148
|
var datumHasXandY = function (datum) {
|
|
17142
17149
|
return !lodash_isNil__WEBPACK_IMPORTED_MODULE_1___default()(datum._x) && !lodash_isNil__WEBPACK_IMPORTED_MODULE_1___default()(datum._y);
|
|
17143
17150
|
}; // used for checking state changes. Expected components can be passed in via options
|
|
@@ -17483,6 +17490,7 @@ var defaultComponents = [{
|
|
|
17483
17490
|
var dataComponent = props.dataComponent,
|
|
17484
17491
|
labelComponent = props.labelComponent,
|
|
17485
17492
|
groupComponent = props.groupComponent;
|
|
17493
|
+
var userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_13__.getSafeUserProps(props);
|
|
17486
17494
|
var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
|
|
17487
17495
|
var dataProps = _this9.getComponentProps(dataComponent, "data", index);
|
|
17488
17496
|
|
|
@@ -17504,7 +17512,8 @@ var defaultComponents = [{
|
|
|
17504
17512
|
|
|
17505
17513
|
var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
|
|
17506
17514
|
|
|
17507
|
-
|
|
17515
|
+
var group = react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(groupComponent, userProps, children);
|
|
17516
|
+
return this.renderContainer(group, children);
|
|
17508
17517
|
}
|
|
17509
17518
|
}]);
|
|
17510
17519
|
|
|
@@ -20854,6 +20863,103 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
20854
20863
|
|
|
20855
20864
|
/***/ }),
|
|
20856
20865
|
|
|
20866
|
+
/***/ "../../victory-core/es/victory-util/user-props.js":
|
|
20867
|
+
/*!********************************************************!*\
|
|
20868
|
+
!*** ../../victory-core/es/victory-util/user-props.js ***!
|
|
20869
|
+
\********************************************************/
|
|
20870
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
20871
|
+
|
|
20872
|
+
"use strict";
|
|
20873
|
+
__webpack_require__.r(__webpack_exports__);
|
|
20874
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20875
|
+
/* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps)
|
|
20876
|
+
/* harmony export */ });
|
|
20877
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
20878
|
+
|
|
20879
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
20880
|
+
|
|
20881
|
+
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; }
|
|
20882
|
+
|
|
20883
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20884
|
+
|
|
20885
|
+
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; }
|
|
20886
|
+
|
|
20887
|
+
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; }
|
|
20888
|
+
|
|
20889
|
+
/*
|
|
20890
|
+
USER_PROPS_SAFELIST is to contain any string deemed safe for user props.
|
|
20891
|
+
The startsWidth array will contain the start of any accepted user-prop that
|
|
20892
|
+
starts with these characters.
|
|
20893
|
+
The exactMatch will contain a list of exact prop names that are accepted.
|
|
20894
|
+
*/
|
|
20895
|
+
var USER_PROPS_SAFELIST = {
|
|
20896
|
+
startsWith: ["data-", "aria-"],
|
|
20897
|
+
exactMatch: []
|
|
20898
|
+
};
|
|
20899
|
+
/**
|
|
20900
|
+
* doesPropStartWith: Function that takes a prop's key and runs it against all
|
|
20901
|
+
* options in the USER_PROPS_SAFELIST and checks to see if it starts with any
|
|
20902
|
+
* of those options.
|
|
20903
|
+
* @param {string} key: prop key to be tested against whitelist
|
|
20904
|
+
* @returns {Boolean}: returns true if the key starts with an option or false if
|
|
20905
|
+
* otherwise
|
|
20906
|
+
*/
|
|
20907
|
+
|
|
20908
|
+
var doesPropStartWith = function (key) {
|
|
20909
|
+
var startsWith = false;
|
|
20910
|
+
USER_PROPS_SAFELIST.startsWith.forEach(function (starterString) {
|
|
20911
|
+
var regex = new RegExp("\\b(".concat(starterString, ")(\\w|-)+"), "g");
|
|
20912
|
+
if (regex.test(key)) startsWith = true;
|
|
20913
|
+
});
|
|
20914
|
+
return startsWith;
|
|
20915
|
+
};
|
|
20916
|
+
/**
|
|
20917
|
+
* isExactMatch: checks to see if the given key matches any of the 'exactMatch'
|
|
20918
|
+
* items in the whitelist
|
|
20919
|
+
* @param {String} key: prop key to be tested against the whitelist-exact match
|
|
20920
|
+
* array.
|
|
20921
|
+
* @returns {Boolean}: return true if whitelist contains that key, otherwise
|
|
20922
|
+
* returns false.
|
|
20923
|
+
*/
|
|
20924
|
+
|
|
20925
|
+
|
|
20926
|
+
var isExactMatch = function (key) {
|
|
20927
|
+
return USER_PROPS_SAFELIST.exactMatch.includes(key);
|
|
20928
|
+
};
|
|
20929
|
+
/**
|
|
20930
|
+
* testIfSafeProp: tests prop's key against both startsWith and exactMatch values
|
|
20931
|
+
* @param {String} key: prop key to be tested against the whitelist
|
|
20932
|
+
* @returns {Boolean}: returns true if found in whitelist, otherwise returns false
|
|
20933
|
+
*/
|
|
20934
|
+
|
|
20935
|
+
|
|
20936
|
+
var testIfSafeProp = function (key) {
|
|
20937
|
+
if (doesPropStartWith(key) || isExactMatch(key)) return true;
|
|
20938
|
+
return false;
|
|
20939
|
+
};
|
|
20940
|
+
/**
|
|
20941
|
+
* getSafeUserProps - function that takes in a props object and removes any
|
|
20942
|
+
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
20943
|
+
* object.
|
|
20944
|
+
*
|
|
20945
|
+
* @param {Object} props: props to be filtered against USER_PROPS_SAFELIST
|
|
20946
|
+
* @returns {Object}: object containing remaining acceptable props
|
|
20947
|
+
*/
|
|
20948
|
+
|
|
20949
|
+
|
|
20950
|
+
var getSafeUserProps = function (props) {
|
|
20951
|
+
var propsToFilter = _objectSpread({}, props);
|
|
20952
|
+
|
|
20953
|
+
return Object.fromEntries(Object.entries(propsToFilter).filter(function (_ref) {
|
|
20954
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
20955
|
+
key = _ref2[0];
|
|
20956
|
+
|
|
20957
|
+
return testIfSafeProp(key);
|
|
20958
|
+
}));
|
|
20959
|
+
};
|
|
20960
|
+
|
|
20961
|
+
/***/ }),
|
|
20962
|
+
|
|
20857
20963
|
/***/ "react":
|
|
20858
20964
|
/*!**************************************************************************************!*\
|
|
20859
20965
|
!*** external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} ***!
|