victory-group 36.8.2 → 36.8.4
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 +4 -0
- package/dist/victory-group.js +156 -156
- package/dist/victory-group.min.js +1 -1
- package/es/helper-methods.d.ts +2 -2
- package/es/helper-methods.js +18 -21
- package/lib/helper-methods.d.ts +2 -2
- package/lib/helper-methods.js +21 -21
- package/package.json +3 -3
- package/src/helper-methods.tsx +13 -13
package/dist/victory-group.js
CHANGED
|
@@ -72,16 +72,15 @@ var fallbackProps = {
|
|
|
72
72
|
offset: 0
|
|
73
73
|
}; // eslint-disable-next-line max-statements
|
|
74
74
|
|
|
75
|
-
function getCalculatedProps(
|
|
75
|
+
function getCalculatedProps(initialProps, childComponents) {
|
|
76
76
|
var role = "group";
|
|
77
|
-
props = victory_core__WEBPACK_IMPORTED_MODULE_3__.modifyProps(
|
|
77
|
+
var props = victory_core__WEBPACK_IMPORTED_MODULE_3__.modifyProps(initialProps, fallbackProps, role);
|
|
78
78
|
var style = victory_core__WEBPACK_IMPORTED_MODULE_4__.getStyle(props.theme, props.style, role);
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
horizontal = _props.horizontal;
|
|
79
|
+
var offset = props.offset,
|
|
80
|
+
colorScale = props.colorScale,
|
|
81
|
+
color = props.color,
|
|
82
|
+
polar = props.polar,
|
|
83
|
+
horizontal = props.horizontal;
|
|
85
84
|
var categories = props.categories || victory_core__WEBPACK_IMPORTED_MODULE_4__.getCategories(props, childComponents, null);
|
|
86
85
|
var datasets = props.datasets || victory_core__WEBPACK_IMPORTED_MODULE_4__.getDataFromChildren(props, null);
|
|
87
86
|
var domain = {
|
|
@@ -251,21 +250,19 @@ function getDataWithOffset(props) {
|
|
|
251
250
|
});
|
|
252
251
|
}
|
|
253
252
|
|
|
254
|
-
function getChildren(
|
|
255
|
-
props = victory_core__WEBPACK_IMPORTED_MODULE_3__.modifyProps(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
var
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
polar = _props2.polar;
|
|
263
|
-
var childProps = getChildProps(props, calculatedProps);
|
|
253
|
+
function getChildren(initialProps, childComponents, calculatedProps) {
|
|
254
|
+
var props = victory_core__WEBPACK_IMPORTED_MODULE_3__.modifyProps(initialProps, fallbackProps, "stack");
|
|
255
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_1___default().Children.toArray(props.children);
|
|
256
|
+
var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
|
|
257
|
+
var datasets = newCalculatedProps.datasets;
|
|
258
|
+
var labelComponent = props.labelComponent,
|
|
259
|
+
polar = props.polar;
|
|
260
|
+
var childProps = getChildProps(props, newCalculatedProps);
|
|
264
261
|
var parentName = props.name || "group";
|
|
265
|
-
return
|
|
262
|
+
return children.map(function (child, index) {
|
|
266
263
|
var role = child.type && child.type.role;
|
|
267
|
-
var xOffset = polar ? getPolarX0(props,
|
|
268
|
-
var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : victory_core__WEBPACK_IMPORTED_MODULE_4__.getChildStyle(child, index,
|
|
264
|
+
var xOffset = polar ? getPolarX0(props, newCalculatedProps, index, role) : getX0(props, newCalculatedProps, index, role);
|
|
265
|
+
var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : victory_core__WEBPACK_IMPORTED_MODULE_4__.getChildStyle(child, index, newCalculatedProps);
|
|
269
266
|
var labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
270
267
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
271
268
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(child, lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
@@ -432,7 +429,7 @@ var VictoryGroupBase = function (initialProps) {
|
|
|
432
429
|
}, [setAnimationState, previousProps, propsWithDefaults, props]);
|
|
433
430
|
|
|
434
431
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
435
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_13__
|
|
432
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_13__.VictorySharedEvents, {
|
|
436
433
|
container: container,
|
|
437
434
|
eventKey: eventKey,
|
|
438
435
|
events: events,
|
|
@@ -8679,11 +8676,11 @@ function getAxis(props) {
|
|
|
8679
8676
|
*/
|
|
8680
8677
|
|
|
8681
8678
|
function findAxisComponents(childComponents, predicate) {
|
|
8682
|
-
|
|
8679
|
+
var predicateFunction = predicate || (lodash_identity__WEBPACK_IMPORTED_MODULE_9___default());
|
|
8683
8680
|
|
|
8684
8681
|
var findAxes = function (children) {
|
|
8685
8682
|
return children.reduce(function (memo, child) {
|
|
8686
|
-
if (child.type && child.type.role === "axis" &&
|
|
8683
|
+
if (child.type && child.type.role === "axis" && predicateFunction(child)) {
|
|
8687
8684
|
return memo.concat(child);
|
|
8688
8685
|
} else if (child.props && child.props.children) {
|
|
8689
8686
|
return memo.concat(findAxes(react__WEBPACK_IMPORTED_MODULE_12___default().Children.toArray(child.props.children)));
|
|
@@ -9427,12 +9424,14 @@ function sortData(dataset, sortKey) {
|
|
|
9427
9424
|
} // Ensures previous VictoryLine api for sortKey prop stays consistent
|
|
9428
9425
|
|
|
9429
9426
|
|
|
9427
|
+
var formattedSortKey = sortKey;
|
|
9428
|
+
|
|
9430
9429
|
if (sortKey === "x" || sortKey === "y") {
|
|
9431
|
-
|
|
9430
|
+
formattedSortKey = "_".concat(sortKey);
|
|
9432
9431
|
}
|
|
9433
9432
|
|
|
9434
9433
|
var order = sortOrder === "ascending" ? "asc" : "desc";
|
|
9435
|
-
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset,
|
|
9434
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
|
|
9436
9435
|
} // This method will remove data points that break certain scales. (log scale only)
|
|
9437
9436
|
|
|
9438
9437
|
|
|
@@ -9623,7 +9622,10 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9623
9622
|
return [];
|
|
9624
9623
|
}
|
|
9625
9624
|
|
|
9626
|
-
var defaultKeys = ["x", "y", "y0"];
|
|
9625
|
+
var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
|
|
9626
|
+
// but we need to figure out why changing it causes regressions in tests.
|
|
9627
|
+
// eslint-disable-next-line no-param-reassign
|
|
9628
|
+
|
|
9627
9629
|
expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
|
|
9628
9630
|
|
|
9629
9631
|
var createAccessor = function (name) {
|
|
@@ -9648,13 +9650,13 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9648
9650
|
|
|
9649
9651
|
var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
|
|
9650
9652
|
// eslint-disable-line complexity
|
|
9651
|
-
|
|
9653
|
+
var parsedDatum = parseDatum(datum);
|
|
9652
9654
|
var fallbackValues = {
|
|
9653
9655
|
x: index,
|
|
9654
|
-
y:
|
|
9656
|
+
y: parsedDatum
|
|
9655
9657
|
};
|
|
9656
9658
|
var processedValues = expectedKeys.reduce(function (memo, type) {
|
|
9657
|
-
var processedValue = accessor[type](
|
|
9659
|
+
var processedValue = accessor[type](parsedDatum);
|
|
9658
9660
|
var value = processedValue !== undefined ? processedValue : fallbackValues[type];
|
|
9659
9661
|
|
|
9660
9662
|
if (value !== undefined) {
|
|
@@ -9669,7 +9671,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9669
9671
|
return memo;
|
|
9670
9672
|
}, {});
|
|
9671
9673
|
|
|
9672
|
-
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues,
|
|
9674
|
+
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
|
|
9673
9675
|
|
|
9674
9676
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
|
|
9675
9677
|
dataArr.push(formattedDatum);
|
|
@@ -9780,8 +9782,8 @@ function getStringsFromData(props, axis) {
|
|
|
9780
9782
|
}, []);
|
|
9781
9783
|
var sortedData = sortData(data, props.sortKey, props.sortOrder);
|
|
9782
9784
|
var dataStrings = sortedData.reduce(function (dataArr, datum) {
|
|
9783
|
-
|
|
9784
|
-
dataArr.push(accessor(
|
|
9785
|
+
var parsedDatum = parseDatum(datum);
|
|
9786
|
+
dataArr.push(accessor(parsedDatum));
|
|
9785
9787
|
return dataArr;
|
|
9786
9788
|
}, []).filter(function (datum) {
|
|
9787
9789
|
return typeof datum === "string";
|
|
@@ -10025,18 +10027,18 @@ function padDomain(domain, props, axis) {
|
|
|
10025
10027
|
|
|
10026
10028
|
|
|
10027
10029
|
function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
+
var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
|
|
10031
|
+
var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
|
|
10030
10032
|
return function (props, axis) {
|
|
10031
10033
|
var propsDomain = getDomainFromProps(props, axis);
|
|
10032
10034
|
|
|
10033
10035
|
if (propsDomain) {
|
|
10034
|
-
return
|
|
10036
|
+
return formatDomainFn(propsDomain, props, axis);
|
|
10035
10037
|
}
|
|
10036
10038
|
|
|
10037
10039
|
var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
10038
|
-
var domain = categories ? getDomainFromCategories(props, axis, categories) :
|
|
10039
|
-
return domain ?
|
|
10040
|
+
var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
|
|
10041
|
+
return domain ? formatDomainFn(domain, props, axis) : undefined;
|
|
10040
10042
|
};
|
|
10041
10043
|
}
|
|
10042
10044
|
/**
|
|
@@ -10069,27 +10071,27 @@ function getDomain(props, axis) {
|
|
|
10069
10071
|
*/
|
|
10070
10072
|
|
|
10071
10073
|
function getDomainFromCategories(props, axis, categories) {
|
|
10072
|
-
|
|
10074
|
+
var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
10073
10075
|
var polar = props.polar,
|
|
10074
10076
|
_props$startAngle = props.startAngle,
|
|
10075
10077
|
startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
|
|
10076
10078
|
_props$endAngle = props.endAngle,
|
|
10077
10079
|
endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
|
|
10078
10080
|
|
|
10079
|
-
if (!
|
|
10081
|
+
if (!categoriesArray) {
|
|
10080
10082
|
return undefined;
|
|
10081
10083
|
}
|
|
10082
10084
|
|
|
10083
10085
|
var minDomain = getMinFromProps(props, axis);
|
|
10084
10086
|
var maxDomain = getMaxFromProps(props, axis);
|
|
10085
|
-
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(
|
|
10087
|
+
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
|
|
10086
10088
|
var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
|
|
10087
10089
|
memo[string] = index + 1;
|
|
10088
10090
|
return memo;
|
|
10089
10091
|
}, {});
|
|
10090
|
-
var categoryValues = stringMap ?
|
|
10092
|
+
var categoryValues = stringMap ? categoriesArray.map(function (value) {
|
|
10091
10093
|
return stringMap[value];
|
|
10092
|
-
}) :
|
|
10094
|
+
}) : categoriesArray;
|
|
10093
10095
|
var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
|
|
10094
10096
|
var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
|
|
10095
10097
|
var categoryDomain = getDomainFromMinMax(min, max);
|
|
@@ -10104,7 +10106,7 @@ function getDomainFromCategories(props, axis, categories) {
|
|
|
10104
10106
|
*/
|
|
10105
10107
|
|
|
10106
10108
|
function getDomainFromData(props, axis, dataset) {
|
|
10107
|
-
|
|
10109
|
+
var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
|
|
10108
10110
|
var polar = props.polar,
|
|
10109
10111
|
_props$startAngle2 = props.startAngle,
|
|
10110
10112
|
startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
|
|
@@ -10113,14 +10115,14 @@ function getDomainFromData(props, axis, dataset) {
|
|
|
10113
10115
|
var minDomain = getMinFromProps(props, axis);
|
|
10114
10116
|
var maxDomain = getMaxFromProps(props, axis);
|
|
10115
10117
|
|
|
10116
|
-
if (
|
|
10118
|
+
if (datasetArray.length < 1) {
|
|
10117
10119
|
return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
|
|
10118
10120
|
}
|
|
10119
10121
|
|
|
10120
|
-
var min = minDomain !== undefined ? minDomain : getExtremeFromData(
|
|
10121
|
-
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(
|
|
10122
|
+
var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
|
|
10123
|
+
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
|
|
10122
10124
|
var domain = getDomainFromMinMax(min, max);
|
|
10123
|
-
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(
|
|
10125
|
+
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
|
|
10124
10126
|
}
|
|
10125
10127
|
/**
|
|
10126
10128
|
* Returns a domain in the form of a two element array given a min and max value.
|
|
@@ -10433,14 +10435,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10433
10435
|
// eslint-disable-next-line no-invalid-this
|
|
10434
10436
|
|
|
10435
10437
|
|
|
10436
|
-
|
|
10438
|
+
var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
|
|
10437
10439
|
|
|
10438
10440
|
var getTargetProps = function (identifier, type) {
|
|
10439
10441
|
var childName = identifier.childName,
|
|
10440
10442
|
target = identifier.target,
|
|
10441
10443
|
key = identifier.key; // eslint-disable-next-line no-invalid-this
|
|
10442
10444
|
|
|
10443
|
-
var baseType = type === "props" ?
|
|
10445
|
+
var baseType = type === "props" ? newBaseProps : _this2.state || {};
|
|
10444
10446
|
var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
10445
10447
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
10446
10448
|
}; // Returns the state object with the mutation caused by a given eventReturn
|
|
@@ -10457,9 +10459,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10457
10459
|
}
|
|
10458
10460
|
|
|
10459
10461
|
if (eventReturn.eventKey === "all") {
|
|
10460
|
-
return
|
|
10462
|
+
return newBaseProps[childName] ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]), "parent") : lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent");
|
|
10461
10463
|
} else if (eventReturn.eventKey === undefined && eventKey === "parent") {
|
|
10462
|
-
return
|
|
10464
|
+
return newBaseProps[childName] ? lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]) : lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps);
|
|
10463
10465
|
}
|
|
10464
10466
|
|
|
10465
10467
|
return eventReturn.eventKey !== undefined ? eventReturn.eventKey : eventKey;
|
|
@@ -10484,7 +10486,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10484
10486
|
key: key,
|
|
10485
10487
|
target: target
|
|
10486
10488
|
}, "state");
|
|
10487
|
-
var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState),
|
|
10489
|
+
var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState), newBaseProps);
|
|
10488
10490
|
var childState = baseState[childName] || {};
|
|
10489
10491
|
|
|
10490
10492
|
var filterState = function (state) {
|
|
@@ -10519,7 +10521,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10519
10521
|
}; // returns an entire mutated state for all children
|
|
10520
10522
|
|
|
10521
10523
|
|
|
10522
|
-
var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(
|
|
10524
|
+
var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent") : childNames;
|
|
10523
10525
|
return Array.isArray(allChildNames) ? allChildNames.reduce(function (memo, childName) {
|
|
10524
10526
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()(memo, getReturnByChild(childName));
|
|
10525
10527
|
}, {}) : getReturnByChild(allChildNames);
|
|
@@ -10528,8 +10530,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10528
10530
|
|
|
10529
10531
|
var parseEventReturn = function (eventReturn, eventKey) {
|
|
10530
10532
|
return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
|
|
10531
|
-
|
|
10532
|
-
return memo;
|
|
10533
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
|
|
10533
10534
|
}, {}) : parseEvent(eventReturn, eventKey);
|
|
10534
10535
|
};
|
|
10535
10536
|
|
|
@@ -10615,9 +10616,10 @@ function getEventState(eventKey, namespace, childType) {
|
|
|
10615
10616
|
*/
|
|
10616
10617
|
// eslint-disable-next-line max-params
|
|
10617
10618
|
|
|
10618
|
-
function getExternalMutationsWithChildren(mutations
|
|
10619
|
-
baseProps =
|
|
10620
|
-
baseState =
|
|
10619
|
+
function getExternalMutationsWithChildren(mutations) {
|
|
10620
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10621
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10622
|
+
var childNames = arguments.length > 3 ? arguments[3] : undefined;
|
|
10621
10623
|
return childNames.reduce(function (memo, childName) {
|
|
10622
10624
|
var childState = baseState[childName];
|
|
10623
10625
|
var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
@@ -10639,9 +10641,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
10639
10641
|
*/
|
|
10640
10642
|
// eslint-disable-next-line max-params
|
|
10641
10643
|
|
|
10642
|
-
function getExternalMutations(mutations
|
|
10643
|
-
baseProps =
|
|
10644
|
-
baseState =
|
|
10644
|
+
function getExternalMutations(mutations) {
|
|
10645
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10646
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10647
|
+
var childName = arguments.length > 3 ? arguments[3] : undefined;
|
|
10645
10648
|
|
|
10646
10649
|
var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
|
|
10647
10650
|
|
|
@@ -10707,8 +10710,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
10707
10710
|
return false;
|
|
10708
10711
|
};
|
|
10709
10712
|
|
|
10710
|
-
|
|
10711
|
-
var scopedMutations = mutations;
|
|
10713
|
+
var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
|
|
10712
10714
|
|
|
10713
10715
|
if (identifier.childName) {
|
|
10714
10716
|
scopedMutations = mutations.filter(function (m) {
|
|
@@ -10747,13 +10749,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
10747
10749
|
|
|
10748
10750
|
function getComponentEvents(props, components) {
|
|
10749
10751
|
var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
|
|
10750
|
-
var _memo;
|
|
10751
|
-
|
|
10752
10752
|
var component = props[componentName];
|
|
10753
10753
|
var defaultEvents = component && component.type && component.type.defaultEvents;
|
|
10754
10754
|
var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
|
|
10755
|
-
|
|
10756
|
-
return memo;
|
|
10755
|
+
return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
|
|
10757
10756
|
}, []);
|
|
10758
10757
|
return events && events.length ? events : undefined;
|
|
10759
10758
|
}
|
|
@@ -11111,6 +11110,7 @@ function reduceChildren(children, iteratee) {
|
|
|
11111
11110
|
|
|
11112
11111
|
var traverseChildren = function (childArray, names, parent) {
|
|
11113
11112
|
return childArray.reduce(function (memo, child, index) {
|
|
11113
|
+
var newMemo = memo;
|
|
11114
11114
|
var childRole = child.type && child.type.role;
|
|
11115
11115
|
var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
|
|
11116
11116
|
|
|
@@ -11128,16 +11128,16 @@ function reduceChildren(children, iteratee) {
|
|
|
11128
11128
|
});
|
|
11129
11129
|
|
|
11130
11130
|
var nestedResults = traverseChildren(nestedChildren, _childNames, child);
|
|
11131
|
-
|
|
11131
|
+
newMemo = combine(newMemo, nestedResults);
|
|
11132
11132
|
} else {
|
|
11133
11133
|
var result = iteratee(child, childName, parent);
|
|
11134
11134
|
|
|
11135
11135
|
if (result) {
|
|
11136
|
-
|
|
11136
|
+
newMemo = combine(newMemo, result);
|
|
11137
11137
|
}
|
|
11138
11138
|
}
|
|
11139
11139
|
|
|
11140
|
-
return
|
|
11140
|
+
return newMemo;
|
|
11141
11141
|
}, initialMemo);
|
|
11142
11142
|
};
|
|
11143
11143
|
|
|
@@ -11163,8 +11163,7 @@ function isHorizontal(props) {
|
|
|
11163
11163
|
var childProps = child.props || {};
|
|
11164
11164
|
|
|
11165
11165
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
11166
|
-
|
|
11167
|
-
return memo;
|
|
11166
|
+
return memo || childProps.horizontal;
|
|
11168
11167
|
}
|
|
11169
11168
|
|
|
11170
11169
|
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
|
|
@@ -11399,11 +11398,13 @@ function isMap(x) {
|
|
|
11399
11398
|
}
|
|
11400
11399
|
function shallowToJS(x, whitelist) {
|
|
11401
11400
|
return isIterable(x) ? x.reduce(function (result, curr, key) {
|
|
11401
|
+
var newCurr = curr;
|
|
11402
|
+
|
|
11402
11403
|
if (whitelist && whitelist[key]) {
|
|
11403
|
-
|
|
11404
|
+
newCurr = shallowToJS(curr);
|
|
11404
11405
|
}
|
|
11405
11406
|
|
|
11406
|
-
result[key] =
|
|
11407
|
+
result[key] = newCurr;
|
|
11407
11408
|
return result;
|
|
11408
11409
|
}, isList(x) ? [] : {}) : x;
|
|
11409
11410
|
}
|
|
@@ -12050,11 +12051,10 @@ var Timer = /*#__PURE__*/function () {
|
|
|
12050
12051
|
}, {
|
|
12051
12052
|
key: "subscribe",
|
|
12052
12053
|
value: function subscribe(callback, duration) {
|
|
12053
|
-
duration = this.shouldAnimate ? duration : 0;
|
|
12054
12054
|
var subscriptionID = this.subscribers.push({
|
|
12055
12055
|
startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
|
|
12056
12056
|
callback: callback,
|
|
12057
|
-
duration: duration
|
|
12057
|
+
duration: this.shouldAnimate ? duration : 0
|
|
12058
12058
|
});
|
|
12059
12059
|
this.activeSubscriptions++;
|
|
12060
12060
|
this.start();
|
|
@@ -12241,36 +12241,38 @@ function getInitialChildProps(animate, data) {
|
|
|
12241
12241
|
|
|
12242
12242
|
|
|
12243
12243
|
function getChildBeforeLoad(animate, child, data, cb) {
|
|
12244
|
-
|
|
12244
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
12245
12245
|
onEnd: cb
|
|
12246
12246
|
});
|
|
12247
12247
|
|
|
12248
|
-
if (
|
|
12248
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
12249
12249
|
return {
|
|
12250
|
-
animate:
|
|
12250
|
+
animate: newAnimate,
|
|
12251
12251
|
data: data
|
|
12252
12252
|
};
|
|
12253
12253
|
}
|
|
12254
12254
|
|
|
12255
|
-
var before =
|
|
12255
|
+
var before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onLoad.before function.
|
|
12256
12256
|
|
|
12257
|
-
|
|
12257
|
+
var newData = data.map(function (datum, idx) {
|
|
12258
12258
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
|
|
12259
12259
|
});
|
|
12260
12260
|
return {
|
|
12261
|
-
animate:
|
|
12262
|
-
data:
|
|
12261
|
+
animate: newAnimate,
|
|
12262
|
+
data: newData,
|
|
12263
12263
|
clipWidth: 0
|
|
12264
12264
|
};
|
|
12265
12265
|
} // eslint-disable-next-line max-params
|
|
12266
12266
|
|
|
12267
12267
|
|
|
12268
12268
|
function getChildOnLoad(animate, data, cb) {
|
|
12269
|
-
|
|
12269
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
12270
12270
|
onEnd: cb
|
|
12271
12271
|
});
|
|
12272
12272
|
|
|
12273
|
-
|
|
12273
|
+
var newData = data;
|
|
12274
|
+
|
|
12275
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
12274
12276
|
return {
|
|
12275
12277
|
animate: animate,
|
|
12276
12278
|
data: data
|
|
@@ -12279,12 +12281,12 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
12279
12281
|
|
|
12280
12282
|
var after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onLoad.after function.
|
|
12281
12283
|
|
|
12282
|
-
|
|
12284
|
+
newData = data.map(function (datum, idx) {
|
|
12283
12285
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
|
|
12284
12286
|
});
|
|
12285
12287
|
return {
|
|
12286
|
-
animate:
|
|
12287
|
-
data:
|
|
12288
|
+
animate: newAnimate,
|
|
12289
|
+
data: newData
|
|
12288
12290
|
};
|
|
12289
12291
|
} // eslint-disable-next-line max-params, max-len
|
|
12290
12292
|
|
|
@@ -12293,7 +12295,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
12293
12295
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
12294
12296
|
// transition for all children to have the same duration, delay, etc.
|
|
12295
12297
|
var onExit = animate && animate.onExit;
|
|
12296
|
-
|
|
12298
|
+
|
|
12299
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
|
|
12300
|
+
|
|
12301
|
+
var newData = data;
|
|
12297
12302
|
|
|
12298
12303
|
if (exitingNodes) {
|
|
12299
12304
|
// After the exit transition occurs, trigger the animations for
|
|
@@ -12301,39 +12306,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
12301
12306
|
animate.onEnd = cb;
|
|
12302
12307
|
var before = animate.onExit && animate.onExit.before ? animate.onExit.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onExit.before function.
|
|
12303
12308
|
|
|
12304
|
-
|
|
12309
|
+
newData = data.map(function (datum, idx) {
|
|
12305
12310
|
var key = (datum.key || idx).toString();
|
|
12306
12311
|
return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
12307
12312
|
});
|
|
12308
12313
|
}
|
|
12309
12314
|
|
|
12310
12315
|
return {
|
|
12311
|
-
animate:
|
|
12312
|
-
data:
|
|
12316
|
+
animate: newAnimate,
|
|
12317
|
+
data: newData
|
|
12313
12318
|
};
|
|
12314
12319
|
} // eslint-disable-next-line max-params,max-len
|
|
12315
12320
|
|
|
12316
12321
|
|
|
12317
12322
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
12323
|
+
var newAnimate = animate;
|
|
12324
|
+
var newData = data;
|
|
12325
|
+
|
|
12318
12326
|
if (enteringNodes) {
|
|
12319
12327
|
// Perform a normal animation here, except - when it finishes - trigger
|
|
12320
12328
|
// the transition for entering nodes.
|
|
12321
|
-
|
|
12329
|
+
newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
12322
12330
|
onEnd: cb
|
|
12323
12331
|
});
|
|
12324
12332
|
var before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // We want the entering nodes to be included in the transition target
|
|
12325
12333
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
12326
12334
|
// so perform the `onEnter.before` transformation on each node.
|
|
12327
12335
|
|
|
12328
|
-
|
|
12336
|
+
newData = data.map(function (datum, idx) {
|
|
12329
12337
|
var key = (datum.key || idx).toString();
|
|
12330
12338
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
12331
12339
|
});
|
|
12332
12340
|
}
|
|
12333
12341
|
|
|
12334
12342
|
return {
|
|
12335
|
-
animate:
|
|
12336
|
-
data:
|
|
12343
|
+
animate: newAnimate,
|
|
12344
|
+
data: newData
|
|
12337
12345
|
};
|
|
12338
12346
|
} // eslint-disable-next-line max-params, max-len
|
|
12339
12347
|
|
|
@@ -12342,23 +12350,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
12342
12350
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
12343
12351
|
// transition for all children to have the same duration, delay, etc.
|
|
12344
12352
|
var onEnter = animate && animate.onEnter;
|
|
12345
|
-
|
|
12353
|
+
|
|
12354
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
|
|
12355
|
+
|
|
12356
|
+
var newData = data;
|
|
12346
12357
|
|
|
12347
12358
|
if (enteringNodes) {
|
|
12348
12359
|
// Old nodes have been transitioned to their new values, and the
|
|
12349
12360
|
// domain should encompass the nodes that will now enter. So perform
|
|
12350
12361
|
// the `onEnter.after` transformation on each node.
|
|
12351
|
-
|
|
12352
|
-
var after =
|
|
12353
|
-
|
|
12362
|
+
newAnimate.onEnd = cb;
|
|
12363
|
+
var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
|
|
12364
|
+
newData = data.map(function (datum, idx) {
|
|
12354
12365
|
var key = getDatumKey(datum, idx);
|
|
12355
12366
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
|
|
12356
12367
|
});
|
|
12357
12368
|
}
|
|
12358
12369
|
|
|
12359
12370
|
return {
|
|
12360
|
-
animate:
|
|
12361
|
-
data:
|
|
12371
|
+
animate: newAnimate,
|
|
12372
|
+
data: newData
|
|
12362
12373
|
};
|
|
12363
12374
|
}
|
|
12364
12375
|
/**
|
|
@@ -12524,6 +12535,7 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
12524
12535
|
"use strict";
|
|
12525
12536
|
__webpack_require__.r(__webpack_exports__);
|
|
12526
12537
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12538
|
+
/* harmony export */ "assert": () => (/* binding */ assert),
|
|
12527
12539
|
/* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
|
|
12528
12540
|
/* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
|
|
12529
12541
|
/* harmony export */ });
|
|
@@ -12604,6 +12616,18 @@ var testIfSafeProp = function (key) {
|
|
|
12604
12616
|
if (doesPropStartWith(key) || isExactMatch(key)) return true;
|
|
12605
12617
|
return false;
|
|
12606
12618
|
};
|
|
12619
|
+
/**
|
|
12620
|
+
* Asserts that value is not null or undefined, throwing an error if it is.
|
|
12621
|
+
* @param value The value to assert
|
|
12622
|
+
* @param message The error message to throw
|
|
12623
|
+
*/
|
|
12624
|
+
|
|
12625
|
+
|
|
12626
|
+
function assert(value, message) {
|
|
12627
|
+
if (value === undefined || value === null) {
|
|
12628
|
+
throw new Error(message);
|
|
12629
|
+
}
|
|
12630
|
+
}
|
|
12607
12631
|
/**
|
|
12608
12632
|
* getSafeUserProps - function that takes in a props object and removes any
|
|
12609
12633
|
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
@@ -12613,7 +12637,6 @@ var testIfSafeProp = function (key) {
|
|
|
12613
12637
|
* @returns {Object}: object containing remaining acceptable props
|
|
12614
12638
|
*/
|
|
12615
12639
|
|
|
12616
|
-
|
|
12617
12640
|
var getSafeUserProps = function (props) {
|
|
12618
12641
|
var propsToFilter = _objectSpread({}, props);
|
|
12619
12642
|
|
|
@@ -12816,12 +12839,13 @@ function getDataFromChildren(props, childComponents) {
|
|
|
12816
12839
|
var childProps = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props, parentProps);
|
|
12817
12840
|
|
|
12818
12841
|
var childData;
|
|
12842
|
+
var childElement = child;
|
|
12819
12843
|
|
|
12820
12844
|
if (!_data__WEBPACK_IMPORTED_MODULE_12__.isDataComponent(child)) {
|
|
12821
12845
|
return null;
|
|
12822
12846
|
} else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(child.type.getData)) {
|
|
12823
|
-
|
|
12824
|
-
childData =
|
|
12847
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(child, parent.props) : child;
|
|
12848
|
+
childData = childElement.type.getData(childProps);
|
|
12825
12849
|
} else {
|
|
12826
12850
|
childData = _data__WEBPACK_IMPORTED_MODULE_12__.getData(childProps);
|
|
12827
12851
|
}
|
|
@@ -12852,17 +12876,16 @@ function getData(props, childComponents) {
|
|
|
12852
12876
|
return _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
|
|
12853
12877
|
}
|
|
12854
12878
|
|
|
12855
|
-
|
|
12856
|
-
return getDataFromChildren(props, childComponents);
|
|
12879
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children));
|
|
12857
12880
|
}
|
|
12858
12881
|
function getWidth(props, groupLength, seriesLength) {
|
|
12859
12882
|
var datasets = props.datasets,
|
|
12860
12883
|
horizontal = props.horizontal;
|
|
12861
12884
|
var range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "x");
|
|
12862
12885
|
var extent = Math.abs(range[1] - range[0]);
|
|
12863
|
-
|
|
12864
|
-
|
|
12865
|
-
var bars =
|
|
12886
|
+
var seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
|
|
12887
|
+
var groupLengthValue = groupLength || datasets.length;
|
|
12888
|
+
var bars = groupLengthValue * seriesLengthValue;
|
|
12866
12889
|
var barRatio = 0.5;
|
|
12867
12890
|
return Math.round(barRatio * extent / bars);
|
|
12868
12891
|
}
|
|
@@ -12954,9 +12977,9 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
12954
12977
|
return [min, max];
|
|
12955
12978
|
}
|
|
12956
12979
|
function getDomain(props, axis, childComponents) {
|
|
12957
|
-
|
|
12980
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
|
|
12958
12981
|
var propsDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromProps(props, axis);
|
|
12959
|
-
var domainPadding = getDefaultDomainPadding(props, axis,
|
|
12982
|
+
var domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
12960
12983
|
var domain;
|
|
12961
12984
|
|
|
12962
12985
|
if (propsDomain) {
|
|
@@ -12966,7 +12989,7 @@ function getDomain(props, axis, childComponents) {
|
|
|
12966
12989
|
var maxDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getMaxFromProps(props, axis);
|
|
12967
12990
|
var dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
|
|
12968
12991
|
var dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromData(props, axis, dataset) : [];
|
|
12969
|
-
var childDomain = getDomainFromChildren(props, axis,
|
|
12992
|
+
var childDomain = getDomainFromChildren(props, axis, children);
|
|
12970
12993
|
var min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMinValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
|
|
12971
12994
|
var max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMaxValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
|
|
12972
12995
|
domain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromMinMax(min, max);
|
|
@@ -13128,10 +13151,10 @@ function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
|
13128
13151
|
return lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(categoryStrings), _toConsumableArray(axisStrings))));
|
|
13129
13152
|
}
|
|
13130
13153
|
function getStringsFromChildren(props, childComponents) {
|
|
13131
|
-
|
|
13132
|
-
var xStrings = getCategoryAndAxisStringsFromChildren(props, "x",
|
|
13133
|
-
var yStrings = getCategoryAndAxisStringsFromChildren(props, "y",
|
|
13134
|
-
var dataStrings = getStringsFromData(
|
|
13154
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
|
|
13155
|
+
var xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
13156
|
+
var yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
13157
|
+
var dataStrings = getStringsFromData(children);
|
|
13135
13158
|
return {
|
|
13136
13159
|
x: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(xStrings), _toConsumableArray(dataStrings.x)))),
|
|
13137
13160
|
y: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(yStrings), _toConsumableArray(dataStrings.y))))
|
|
@@ -13161,7 +13184,7 @@ function getCategories(props, childComponents, allStrings) {
|
|
|
13161
13184
|
"use strict";
|
|
13162
13185
|
__webpack_require__.r(__webpack_exports__);
|
|
13163
13186
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13164
|
-
/* harmony export */ "
|
|
13187
|
+
/* harmony export */ "VictorySharedEvents": () => (/* binding */ VictorySharedEvents)
|
|
13165
13188
|
/* harmony export */ });
|
|
13166
13189
|
/* harmony import */ var lodash_difference__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/difference */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/difference.js");
|
|
13167
13190
|
/* harmony import */ var lodash_difference__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_difference__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -13179,12 +13202,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13179
13202
|
/* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_6__);
|
|
13180
13203
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "react");
|
|
13181
13204
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);
|
|
13182
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! prop-types */ "../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js");
|
|
13183
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_12__);
|
|
13184
13205
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/events.js");
|
|
13185
13206
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
13186
|
-
/* harmony import */ var
|
|
13187
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
13207
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
13188
13208
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/.pnpm/react-fast-compare@3.2.0/node_modules/react-fast-compare/index.js");
|
|
13189
13209
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_8__);
|
|
13190
13210
|
/* harmony import */ var json_stringify_safe__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! json-stringify-safe */ "../../../node_modules/.pnpm/json-stringify-safe@5.0.1/node_modules/json-stringify-safe/stringify.js");
|
|
@@ -13241,11 +13261,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
13241
13261
|
|
|
13242
13262
|
|
|
13243
13263
|
|
|
13244
|
-
// DISCLAIMER:
|
|
13245
|
-
// This file is not currently tested, and it is first on the list of files
|
|
13246
|
-
// to refactor in our current refactoring effort. Please do not make changes
|
|
13247
|
-
// to this file without manual testing and/or refactoring and adding tests.
|
|
13248
|
-
|
|
13249
13264
|
var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
13250
13265
|
_inherits(VictorySharedEvents, _React$Component);
|
|
13251
13266
|
|
|
@@ -13257,14 +13272,21 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13257
13272
|
_classCallCheck(this, VictorySharedEvents);
|
|
13258
13273
|
|
|
13259
13274
|
_this = _super.call(this, props);
|
|
13260
|
-
_this.
|
|
13275
|
+
_this.getScopedEvents = void 0;
|
|
13276
|
+
_this.getEventState = void 0;
|
|
13277
|
+
_this.baseProps = void 0;
|
|
13278
|
+
_this.sharedEventsCache = void 0;
|
|
13279
|
+
_this.globalEvents = void 0;
|
|
13280
|
+
_this.prevGlobalEventKeys = void 0;
|
|
13281
|
+
_this.boundGlobalEvents = void 0;
|
|
13261
13282
|
_this.getScopedEvents = victory_core__WEBPACK_IMPORTED_MODULE_10__.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
13262
13283
|
_this.getEventState = victory_core__WEBPACK_IMPORTED_MODULE_10__.getEventState.bind(_assertThisInitialized(_this));
|
|
13263
|
-
_this.
|
|
13284
|
+
_this.state = _this.state || {};
|
|
13264
13285
|
_this.sharedEventsCache = {};
|
|
13265
13286
|
_this.globalEvents = {};
|
|
13266
13287
|
_this.prevGlobalEventKeys = [];
|
|
13267
13288
|
_this.boundGlobalEvents = {};
|
|
13289
|
+
_this.baseProps = _this.getBaseProps(props);
|
|
13268
13290
|
return _this;
|
|
13269
13291
|
}
|
|
13270
13292
|
|
|
@@ -13355,8 +13377,7 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13355
13377
|
value: function applyExternalMutations(props, externalMutations) {
|
|
13356
13378
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_3___default()(externalMutations)) {
|
|
13357
13379
|
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
13358
|
-
|
|
13359
|
-
return memo;
|
|
13380
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
13360
13381
|
}, []);
|
|
13361
13382
|
var compiledCallbacks = callbacks.length ? function () {
|
|
13362
13383
|
callbacks.forEach(function (c) {
|
|
@@ -13479,9 +13500,9 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13479
13500
|
var _this7 = this;
|
|
13480
13501
|
|
|
13481
13502
|
var children = this.getNewChildren(props, baseProps);
|
|
13482
|
-
var parents = Array.isArray(events)
|
|
13503
|
+
var parents = Array.isArray(events) ? events.filter(function (event) {
|
|
13483
13504
|
return event.target === "parent";
|
|
13484
|
-
});
|
|
13505
|
+
}) : [];
|
|
13485
13506
|
var sharedEvents = parents.length > 0 ? {
|
|
13486
13507
|
events: parents,
|
|
13487
13508
|
// partially apply childName (null) and baseProps,
|
|
@@ -13527,33 +13548,12 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13527
13548
|
|
|
13528
13549
|
return VictorySharedEvents;
|
|
13529
13550
|
}((react__WEBPACK_IMPORTED_MODULE_7___default().Component));
|
|
13530
|
-
|
|
13531
13551
|
VictorySharedEvents.displayName = "VictorySharedEvents";
|
|
13532
13552
|
VictorySharedEvents.role = "shared-event-wrapper";
|
|
13533
|
-
VictorySharedEvents.
|
|
13534
|
-
children: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_12___default().node)), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node)]),
|
|
13535
|
-
container: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node),
|
|
13536
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func), victory_core__WEBPACK_IMPORTED_MODULE_13__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_13__.integer, victory_core__WEBPACK_IMPORTED_MODULE_13__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)]),
|
|
13537
|
-
events: prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape({
|
|
13538
|
-
childName: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().array)]),
|
|
13539
|
-
eventHandlers: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().object),
|
|
13540
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func), victory_core__WEBPACK_IMPORTED_MODULE_13__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_13__.integer, victory_core__WEBPACK_IMPORTED_MODULE_13__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)]),
|
|
13541
|
-
target: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)
|
|
13542
|
-
})),
|
|
13543
|
-
externalEventMutations: prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape({
|
|
13544
|
-
callback: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func),
|
|
13545
|
-
childName: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().array)]),
|
|
13546
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().array), victory_core__WEBPACK_IMPORTED_MODULE_13__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_13__.integer, victory_core__WEBPACK_IMPORTED_MODULE_13__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)]),
|
|
13547
|
-
mutation: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func),
|
|
13548
|
-
target: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().array)])
|
|
13549
|
-
})),
|
|
13550
|
-
groupComponent: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node)
|
|
13551
|
-
};
|
|
13553
|
+
VictorySharedEvents.contextType = victory_core__WEBPACK_IMPORTED_MODULE_12__["default"];
|
|
13552
13554
|
VictorySharedEvents.defaultProps = {
|
|
13553
13555
|
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7___default().createElement("g", null)
|
|
13554
13556
|
};
|
|
13555
|
-
VictorySharedEvents.contextType = victory_core__WEBPACK_IMPORTED_MODULE_14__["default"];
|
|
13556
|
-
|
|
13557
13557
|
|
|
13558
13558
|
/***/ }),
|
|
13559
13559
|
|