victory-stack 36.8.2 → 36.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/victory-stack.js +160 -162
- package/dist/victory-stack.min.js +1 -1
- package/es/helper-methods.d.ts +2 -2
- package/es/helper-methods.js +26 -28
- package/es/victory-stack.d.ts +1 -0
- package/lib/helper-methods.d.ts +2 -2
- package/lib/helper-methods.js +30 -28
- package/lib/victory-stack.d.ts +1 -0
- package/package.json +3 -3
- package/src/helper-methods.tsx +32 -24
package/dist/victory-stack.js
CHANGED
|
@@ -88,13 +88,13 @@ function fillData(props, datasets) {
|
|
|
88
88
|
var indexOffset = 0;
|
|
89
89
|
var isDate = dataset[0] && dataset[0]._x instanceof Date;
|
|
90
90
|
var filledInData = xArr.map(function (x, index) {
|
|
91
|
-
|
|
91
|
+
var parsedX = Number(x);
|
|
92
92
|
var datum = dataset[index - indexOffset];
|
|
93
93
|
|
|
94
94
|
if (datum) {
|
|
95
95
|
var x1 = isDate ? datum._x.getTime() : datum._x;
|
|
96
96
|
|
|
97
|
-
if (x1 ===
|
|
97
|
+
if (x1 === parsedX) {
|
|
98
98
|
return datum;
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -102,21 +102,21 @@ function fillData(props, datasets) {
|
|
|
102
102
|
|
|
103
103
|
var _y = fillInMissingData ? 0 : null;
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
parsedX = isDate ? new Date(parsedX) : parsedX;
|
|
106
106
|
return {
|
|
107
|
-
x:
|
|
107
|
+
x: parsedX,
|
|
108
108
|
y: _y,
|
|
109
|
-
_x:
|
|
109
|
+
_x: parsedX,
|
|
110
110
|
_y: _y
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
var y = fillInMissingData ? 0 : null;
|
|
115
|
-
|
|
115
|
+
parsedX = isDate ? new Date(parsedX) : parsedX;
|
|
116
116
|
return {
|
|
117
|
-
x:
|
|
117
|
+
x: parsedX,
|
|
118
118
|
y: y,
|
|
119
|
-
_x:
|
|
119
|
+
_x: parsedX,
|
|
120
120
|
_y: y
|
|
121
121
|
};
|
|
122
122
|
});
|
|
@@ -180,14 +180,14 @@ function stackData(props, childComponents) {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
function getCalculatedProps(
|
|
184
|
-
|
|
183
|
+
function getCalculatedProps(initialProps, childComponents) {
|
|
184
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_3___default().Children.toArray(initialProps.children);
|
|
185
185
|
var role = "stack";
|
|
186
|
-
props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(
|
|
186
|
+
var props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(initialProps, fallbackProps, role);
|
|
187
187
|
var style = victory_core__WEBPACK_IMPORTED_MODULE_5__.getStyle(props.theme, props.style, role);
|
|
188
|
-
var categories = props.categories || victory_core__WEBPACK_IMPORTED_MODULE_5__.getCategories(props,
|
|
189
|
-
var datasets = props.datasets || stackData(props,
|
|
190
|
-
var
|
|
188
|
+
var categories = props.categories || victory_core__WEBPACK_IMPORTED_MODULE_5__.getCategories(props, children);
|
|
189
|
+
var datasets = props.datasets || stackData(props, children);
|
|
190
|
+
var clonedChildren = children.map(function (c, i) {
|
|
191
191
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(c, {
|
|
192
192
|
data: datasets[i]
|
|
193
193
|
});
|
|
@@ -195,10 +195,10 @@ function getCalculatedProps(props, childComponents) {
|
|
|
195
195
|
var domain = {
|
|
196
196
|
x: victory_core__WEBPACK_IMPORTED_MODULE_5__.getDomain(lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, props, {
|
|
197
197
|
categories: categories
|
|
198
|
-
}), "x",
|
|
198
|
+
}), "x", clonedChildren),
|
|
199
199
|
y: victory_core__WEBPACK_IMPORTED_MODULE_5__.getDomain(lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, props, {
|
|
200
200
|
categories: categories
|
|
201
|
-
}), "y",
|
|
201
|
+
}), "y", clonedChildren)
|
|
202
202
|
};
|
|
203
203
|
var range = props.range || {
|
|
204
204
|
x: victory_core__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "x"),
|
|
@@ -212,9 +212,8 @@ function getCalculatedProps(props, childComponents) {
|
|
|
212
212
|
x: baseScale.x.domain(domain.x).range(props.horizontal ? range.y : range.x),
|
|
213
213
|
y: baseScale.y.domain(domain.y).range(props.horizontal ? range.x : range.y)
|
|
214
214
|
};
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
horizontal = _props.horizontal;
|
|
215
|
+
var colorScale = props.colorScale,
|
|
216
|
+
horizontal = props.horizontal;
|
|
218
217
|
return {
|
|
219
218
|
datasets: datasets,
|
|
220
219
|
categories: categories,
|
|
@@ -300,18 +299,17 @@ function getColorScale(props, child) {
|
|
|
300
299
|
return props.theme ? colorScaleOptions || props.theme.props.colorScale : colorScaleOptions;
|
|
301
300
|
}
|
|
302
301
|
|
|
303
|
-
function getChildren(
|
|
304
|
-
props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
var
|
|
308
|
-
|
|
309
|
-
var childProps = getChildProps(props, calculatedProps);
|
|
302
|
+
function getChildren(initialProps, childComponents, calculatedProps) {
|
|
303
|
+
var props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(initialProps, fallbackProps, "stack");
|
|
304
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_3___default().Children.toArray(props.children);
|
|
305
|
+
var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
|
|
306
|
+
var datasets = newCalculatedProps.datasets;
|
|
307
|
+
var childProps = getChildProps(props, newCalculatedProps);
|
|
310
308
|
var parentName = props.name || "stack";
|
|
311
|
-
return
|
|
309
|
+
return children.map(function (child, index) {
|
|
312
310
|
var role = child.type && child.type.role;
|
|
313
311
|
var data = datasets[index];
|
|
314
|
-
var style = victory_core__WEBPACK_IMPORTED_MODULE_5__.getChildStyle(child, index,
|
|
312
|
+
var style = victory_core__WEBPACK_IMPORTED_MODULE_5__.getChildStyle(child, index, newCalculatedProps);
|
|
315
313
|
var labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
316
314
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
317
315
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(child, lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({
|
|
@@ -484,7 +482,7 @@ var VictoryStackBase = function (initialProps) {
|
|
|
484
482
|
}, [setAnimationState, previousProps, propsWithDefaults]);
|
|
485
483
|
|
|
486
484
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
487
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_13__
|
|
485
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_13__.VictorySharedEvents, {
|
|
488
486
|
container: container,
|
|
489
487
|
eventKey: eventKey,
|
|
490
488
|
events: events,
|
|
@@ -8745,11 +8743,11 @@ function getAxis(props) {
|
|
|
8745
8743
|
*/
|
|
8746
8744
|
|
|
8747
8745
|
function findAxisComponents(childComponents, predicate) {
|
|
8748
|
-
|
|
8746
|
+
var predicateFunction = predicate || (lodash_identity__WEBPACK_IMPORTED_MODULE_9___default());
|
|
8749
8747
|
|
|
8750
8748
|
var findAxes = function (children) {
|
|
8751
8749
|
return children.reduce(function (memo, child) {
|
|
8752
|
-
if (child.type && child.type.role === "axis" &&
|
|
8750
|
+
if (child.type && child.type.role === "axis" && predicateFunction(child)) {
|
|
8753
8751
|
return memo.concat(child);
|
|
8754
8752
|
} else if (child.props && child.props.children) {
|
|
8755
8753
|
return memo.concat(findAxes(react__WEBPACK_IMPORTED_MODULE_12___default().Children.toArray(child.props.children)));
|
|
@@ -9493,12 +9491,14 @@ function sortData(dataset, sortKey) {
|
|
|
9493
9491
|
} // Ensures previous VictoryLine api for sortKey prop stays consistent
|
|
9494
9492
|
|
|
9495
9493
|
|
|
9494
|
+
var formattedSortKey = sortKey;
|
|
9495
|
+
|
|
9496
9496
|
if (sortKey === "x" || sortKey === "y") {
|
|
9497
|
-
|
|
9497
|
+
formattedSortKey = "_".concat(sortKey);
|
|
9498
9498
|
}
|
|
9499
9499
|
|
|
9500
9500
|
var order = sortOrder === "ascending" ? "asc" : "desc";
|
|
9501
|
-
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset,
|
|
9501
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
|
|
9502
9502
|
} // This method will remove data points that break certain scales. (log scale only)
|
|
9503
9503
|
|
|
9504
9504
|
|
|
@@ -9689,7 +9689,10 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9689
9689
|
return [];
|
|
9690
9690
|
}
|
|
9691
9691
|
|
|
9692
|
-
var defaultKeys = ["x", "y", "y0"];
|
|
9692
|
+
var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
|
|
9693
|
+
// but we need to figure out why changing it causes regressions in tests.
|
|
9694
|
+
// eslint-disable-next-line no-param-reassign
|
|
9695
|
+
|
|
9693
9696
|
expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
|
|
9694
9697
|
|
|
9695
9698
|
var createAccessor = function (name) {
|
|
@@ -9714,13 +9717,13 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9714
9717
|
|
|
9715
9718
|
var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
|
|
9716
9719
|
// eslint-disable-line complexity
|
|
9717
|
-
|
|
9720
|
+
var parsedDatum = parseDatum(datum);
|
|
9718
9721
|
var fallbackValues = {
|
|
9719
9722
|
x: index,
|
|
9720
|
-
y:
|
|
9723
|
+
y: parsedDatum
|
|
9721
9724
|
};
|
|
9722
9725
|
var processedValues = expectedKeys.reduce(function (memo, type) {
|
|
9723
|
-
var processedValue = accessor[type](
|
|
9726
|
+
var processedValue = accessor[type](parsedDatum);
|
|
9724
9727
|
var value = processedValue !== undefined ? processedValue : fallbackValues[type];
|
|
9725
9728
|
|
|
9726
9729
|
if (value !== undefined) {
|
|
@@ -9735,7 +9738,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9735
9738
|
return memo;
|
|
9736
9739
|
}, {});
|
|
9737
9740
|
|
|
9738
|
-
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues,
|
|
9741
|
+
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
|
|
9739
9742
|
|
|
9740
9743
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
|
|
9741
9744
|
dataArr.push(formattedDatum);
|
|
@@ -9846,8 +9849,8 @@ function getStringsFromData(props, axis) {
|
|
|
9846
9849
|
}, []);
|
|
9847
9850
|
var sortedData = sortData(data, props.sortKey, props.sortOrder);
|
|
9848
9851
|
var dataStrings = sortedData.reduce(function (dataArr, datum) {
|
|
9849
|
-
|
|
9850
|
-
dataArr.push(accessor(
|
|
9852
|
+
var parsedDatum = parseDatum(datum);
|
|
9853
|
+
dataArr.push(accessor(parsedDatum));
|
|
9851
9854
|
return dataArr;
|
|
9852
9855
|
}, []).filter(function (datum) {
|
|
9853
9856
|
return typeof datum === "string";
|
|
@@ -10091,18 +10094,18 @@ function padDomain(domain, props, axis) {
|
|
|
10091
10094
|
|
|
10092
10095
|
|
|
10093
10096
|
function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
|
|
10094
|
-
|
|
10095
|
-
|
|
10097
|
+
var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
|
|
10098
|
+
var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
|
|
10096
10099
|
return function (props, axis) {
|
|
10097
10100
|
var propsDomain = getDomainFromProps(props, axis);
|
|
10098
10101
|
|
|
10099
10102
|
if (propsDomain) {
|
|
10100
|
-
return
|
|
10103
|
+
return formatDomainFn(propsDomain, props, axis);
|
|
10101
10104
|
}
|
|
10102
10105
|
|
|
10103
10106
|
var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
10104
|
-
var domain = categories ? getDomainFromCategories(props, axis, categories) :
|
|
10105
|
-
return domain ?
|
|
10107
|
+
var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
|
|
10108
|
+
return domain ? formatDomainFn(domain, props, axis) : undefined;
|
|
10106
10109
|
};
|
|
10107
10110
|
}
|
|
10108
10111
|
/**
|
|
@@ -10135,27 +10138,27 @@ function getDomain(props, axis) {
|
|
|
10135
10138
|
*/
|
|
10136
10139
|
|
|
10137
10140
|
function getDomainFromCategories(props, axis, categories) {
|
|
10138
|
-
|
|
10141
|
+
var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
10139
10142
|
var polar = props.polar,
|
|
10140
10143
|
_props$startAngle = props.startAngle,
|
|
10141
10144
|
startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
|
|
10142
10145
|
_props$endAngle = props.endAngle,
|
|
10143
10146
|
endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
|
|
10144
10147
|
|
|
10145
|
-
if (!
|
|
10148
|
+
if (!categoriesArray) {
|
|
10146
10149
|
return undefined;
|
|
10147
10150
|
}
|
|
10148
10151
|
|
|
10149
10152
|
var minDomain = getMinFromProps(props, axis);
|
|
10150
10153
|
var maxDomain = getMaxFromProps(props, axis);
|
|
10151
|
-
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(
|
|
10154
|
+
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
|
|
10152
10155
|
var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
|
|
10153
10156
|
memo[string] = index + 1;
|
|
10154
10157
|
return memo;
|
|
10155
10158
|
}, {});
|
|
10156
|
-
var categoryValues = stringMap ?
|
|
10159
|
+
var categoryValues = stringMap ? categoriesArray.map(function (value) {
|
|
10157
10160
|
return stringMap[value];
|
|
10158
|
-
}) :
|
|
10161
|
+
}) : categoriesArray;
|
|
10159
10162
|
var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
|
|
10160
10163
|
var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
|
|
10161
10164
|
var categoryDomain = getDomainFromMinMax(min, max);
|
|
@@ -10170,7 +10173,7 @@ function getDomainFromCategories(props, axis, categories) {
|
|
|
10170
10173
|
*/
|
|
10171
10174
|
|
|
10172
10175
|
function getDomainFromData(props, axis, dataset) {
|
|
10173
|
-
|
|
10176
|
+
var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
|
|
10174
10177
|
var polar = props.polar,
|
|
10175
10178
|
_props$startAngle2 = props.startAngle,
|
|
10176
10179
|
startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
|
|
@@ -10179,14 +10182,14 @@ function getDomainFromData(props, axis, dataset) {
|
|
|
10179
10182
|
var minDomain = getMinFromProps(props, axis);
|
|
10180
10183
|
var maxDomain = getMaxFromProps(props, axis);
|
|
10181
10184
|
|
|
10182
|
-
if (
|
|
10185
|
+
if (datasetArray.length < 1) {
|
|
10183
10186
|
return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
|
|
10184
10187
|
}
|
|
10185
10188
|
|
|
10186
|
-
var min = minDomain !== undefined ? minDomain : getExtremeFromData(
|
|
10187
|
-
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(
|
|
10189
|
+
var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
|
|
10190
|
+
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
|
|
10188
10191
|
var domain = getDomainFromMinMax(min, max);
|
|
10189
|
-
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(
|
|
10192
|
+
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
|
|
10190
10193
|
}
|
|
10191
10194
|
/**
|
|
10192
10195
|
* Returns a domain in the form of a two element array given a min and max value.
|
|
@@ -10499,14 +10502,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10499
10502
|
// eslint-disable-next-line no-invalid-this
|
|
10500
10503
|
|
|
10501
10504
|
|
|
10502
|
-
|
|
10505
|
+
var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
|
|
10503
10506
|
|
|
10504
10507
|
var getTargetProps = function (identifier, type) {
|
|
10505
10508
|
var childName = identifier.childName,
|
|
10506
10509
|
target = identifier.target,
|
|
10507
10510
|
key = identifier.key; // eslint-disable-next-line no-invalid-this
|
|
10508
10511
|
|
|
10509
|
-
var baseType = type === "props" ?
|
|
10512
|
+
var baseType = type === "props" ? newBaseProps : _this2.state || {};
|
|
10510
10513
|
var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
10511
10514
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
10512
10515
|
}; // Returns the state object with the mutation caused by a given eventReturn
|
|
@@ -10594,8 +10597,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10594
10597
|
|
|
10595
10598
|
var parseEventReturn = function (eventReturn, eventKey) {
|
|
10596
10599
|
return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
|
|
10597
|
-
|
|
10598
|
-
return memo;
|
|
10600
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
|
|
10599
10601
|
}, {}) : parseEvent(eventReturn, eventKey);
|
|
10600
10602
|
};
|
|
10601
10603
|
|
|
@@ -10681,9 +10683,10 @@ function getEventState(eventKey, namespace, childType) {
|
|
|
10681
10683
|
*/
|
|
10682
10684
|
// eslint-disable-next-line max-params
|
|
10683
10685
|
|
|
10684
|
-
function getExternalMutationsWithChildren(mutations
|
|
10685
|
-
baseProps =
|
|
10686
|
-
baseState =
|
|
10686
|
+
function getExternalMutationsWithChildren(mutations) {
|
|
10687
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10688
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10689
|
+
var childNames = arguments.length > 3 ? arguments[3] : undefined;
|
|
10687
10690
|
return childNames.reduce(function (memo, childName) {
|
|
10688
10691
|
var childState = baseState[childName];
|
|
10689
10692
|
var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
@@ -10705,9 +10708,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
10705
10708
|
*/
|
|
10706
10709
|
// eslint-disable-next-line max-params
|
|
10707
10710
|
|
|
10708
|
-
function getExternalMutations(mutations
|
|
10709
|
-
baseProps =
|
|
10710
|
-
baseState =
|
|
10711
|
+
function getExternalMutations(mutations) {
|
|
10712
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10713
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10714
|
+
var childName = arguments.length > 3 ? arguments[3] : undefined;
|
|
10711
10715
|
|
|
10712
10716
|
var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
|
|
10713
10717
|
|
|
@@ -10773,8 +10777,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
10773
10777
|
return false;
|
|
10774
10778
|
};
|
|
10775
10779
|
|
|
10776
|
-
|
|
10777
|
-
var scopedMutations = mutations;
|
|
10780
|
+
var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
|
|
10778
10781
|
|
|
10779
10782
|
if (identifier.childName) {
|
|
10780
10783
|
scopedMutations = mutations.filter(function (m) {
|
|
@@ -10813,13 +10816,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
10813
10816
|
|
|
10814
10817
|
function getComponentEvents(props, components) {
|
|
10815
10818
|
var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
|
|
10816
|
-
var _memo;
|
|
10817
|
-
|
|
10818
10819
|
var component = props[componentName];
|
|
10819
10820
|
var defaultEvents = component && component.type && component.type.defaultEvents;
|
|
10820
10821
|
var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
|
|
10821
|
-
|
|
10822
|
-
return memo;
|
|
10822
|
+
return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
|
|
10823
10823
|
}, []);
|
|
10824
10824
|
return events && events.length ? events : undefined;
|
|
10825
10825
|
}
|
|
@@ -11177,6 +11177,7 @@ function reduceChildren(children, iteratee) {
|
|
|
11177
11177
|
|
|
11178
11178
|
var traverseChildren = function (childArray, names, parent) {
|
|
11179
11179
|
return childArray.reduce(function (memo, child, index) {
|
|
11180
|
+
var newMemo = memo;
|
|
11180
11181
|
var childRole = child.type && child.type.role;
|
|
11181
11182
|
var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
|
|
11182
11183
|
|
|
@@ -11194,16 +11195,16 @@ function reduceChildren(children, iteratee) {
|
|
|
11194
11195
|
});
|
|
11195
11196
|
|
|
11196
11197
|
var nestedResults = traverseChildren(nestedChildren, _childNames, child);
|
|
11197
|
-
|
|
11198
|
+
newMemo = combine(newMemo, nestedResults);
|
|
11198
11199
|
} else {
|
|
11199
11200
|
var result = iteratee(child, childName, parent);
|
|
11200
11201
|
|
|
11201
11202
|
if (result) {
|
|
11202
|
-
|
|
11203
|
+
newMemo = combine(newMemo, result);
|
|
11203
11204
|
}
|
|
11204
11205
|
}
|
|
11205
11206
|
|
|
11206
|
-
return
|
|
11207
|
+
return newMemo;
|
|
11207
11208
|
}, initialMemo);
|
|
11208
11209
|
};
|
|
11209
11210
|
|
|
@@ -11229,8 +11230,7 @@ function isHorizontal(props) {
|
|
|
11229
11230
|
var childProps = child.props || {};
|
|
11230
11231
|
|
|
11231
11232
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
11232
|
-
|
|
11233
|
-
return memo;
|
|
11233
|
+
return memo || childProps.horizontal;
|
|
11234
11234
|
}
|
|
11235
11235
|
|
|
11236
11236
|
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
|
|
@@ -11465,11 +11465,13 @@ function isMap(x) {
|
|
|
11465
11465
|
}
|
|
11466
11466
|
function shallowToJS(x, whitelist) {
|
|
11467
11467
|
return isIterable(x) ? x.reduce(function (result, curr, key) {
|
|
11468
|
+
var newCurr = curr;
|
|
11469
|
+
|
|
11468
11470
|
if (whitelist && whitelist[key]) {
|
|
11469
|
-
|
|
11471
|
+
newCurr = shallowToJS(curr);
|
|
11470
11472
|
}
|
|
11471
11473
|
|
|
11472
|
-
result[key] =
|
|
11474
|
+
result[key] = newCurr;
|
|
11473
11475
|
return result;
|
|
11474
11476
|
}, isList(x) ? [] : {}) : x;
|
|
11475
11477
|
}
|
|
@@ -12116,11 +12118,10 @@ var Timer = /*#__PURE__*/function () {
|
|
|
12116
12118
|
}, {
|
|
12117
12119
|
key: "subscribe",
|
|
12118
12120
|
value: function subscribe(callback, duration) {
|
|
12119
|
-
duration = this.shouldAnimate ? duration : 0;
|
|
12120
12121
|
var subscriptionID = this.subscribers.push({
|
|
12121
12122
|
startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
|
|
12122
12123
|
callback: callback,
|
|
12123
|
-
duration: duration
|
|
12124
|
+
duration: this.shouldAnimate ? duration : 0
|
|
12124
12125
|
});
|
|
12125
12126
|
this.activeSubscriptions++;
|
|
12126
12127
|
this.start();
|
|
@@ -12307,36 +12308,38 @@ function getInitialChildProps(animate, data) {
|
|
|
12307
12308
|
|
|
12308
12309
|
|
|
12309
12310
|
function getChildBeforeLoad(animate, child, data, cb) {
|
|
12310
|
-
|
|
12311
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
12311
12312
|
onEnd: cb
|
|
12312
12313
|
});
|
|
12313
12314
|
|
|
12314
|
-
if (
|
|
12315
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
12315
12316
|
return {
|
|
12316
|
-
animate:
|
|
12317
|
+
animate: newAnimate,
|
|
12317
12318
|
data: data
|
|
12318
12319
|
};
|
|
12319
12320
|
}
|
|
12320
12321
|
|
|
12321
|
-
var before =
|
|
12322
|
+
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.
|
|
12322
12323
|
|
|
12323
|
-
|
|
12324
|
+
var newData = data.map(function (datum, idx) {
|
|
12324
12325
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
|
|
12325
12326
|
});
|
|
12326
12327
|
return {
|
|
12327
|
-
animate:
|
|
12328
|
-
data:
|
|
12328
|
+
animate: newAnimate,
|
|
12329
|
+
data: newData,
|
|
12329
12330
|
clipWidth: 0
|
|
12330
12331
|
};
|
|
12331
12332
|
} // eslint-disable-next-line max-params
|
|
12332
12333
|
|
|
12333
12334
|
|
|
12334
12335
|
function getChildOnLoad(animate, data, cb) {
|
|
12335
|
-
|
|
12336
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
12336
12337
|
onEnd: cb
|
|
12337
12338
|
});
|
|
12338
12339
|
|
|
12339
|
-
|
|
12340
|
+
var newData = data;
|
|
12341
|
+
|
|
12342
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
12340
12343
|
return {
|
|
12341
12344
|
animate: animate,
|
|
12342
12345
|
data: data
|
|
@@ -12345,12 +12348,12 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
12345
12348
|
|
|
12346
12349
|
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.
|
|
12347
12350
|
|
|
12348
|
-
|
|
12351
|
+
newData = data.map(function (datum, idx) {
|
|
12349
12352
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
|
|
12350
12353
|
});
|
|
12351
12354
|
return {
|
|
12352
|
-
animate:
|
|
12353
|
-
data:
|
|
12355
|
+
animate: newAnimate,
|
|
12356
|
+
data: newData
|
|
12354
12357
|
};
|
|
12355
12358
|
} // eslint-disable-next-line max-params, max-len
|
|
12356
12359
|
|
|
@@ -12359,7 +12362,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
12359
12362
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
12360
12363
|
// transition for all children to have the same duration, delay, etc.
|
|
12361
12364
|
var onExit = animate && animate.onExit;
|
|
12362
|
-
|
|
12365
|
+
|
|
12366
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
|
|
12367
|
+
|
|
12368
|
+
var newData = data;
|
|
12363
12369
|
|
|
12364
12370
|
if (exitingNodes) {
|
|
12365
12371
|
// After the exit transition occurs, trigger the animations for
|
|
@@ -12367,39 +12373,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
12367
12373
|
animate.onEnd = cb;
|
|
12368
12374
|
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.
|
|
12369
12375
|
|
|
12370
|
-
|
|
12376
|
+
newData = data.map(function (datum, idx) {
|
|
12371
12377
|
var key = (datum.key || idx).toString();
|
|
12372
12378
|
return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
12373
12379
|
});
|
|
12374
12380
|
}
|
|
12375
12381
|
|
|
12376
12382
|
return {
|
|
12377
|
-
animate:
|
|
12378
|
-
data:
|
|
12383
|
+
animate: newAnimate,
|
|
12384
|
+
data: newData
|
|
12379
12385
|
};
|
|
12380
12386
|
} // eslint-disable-next-line max-params,max-len
|
|
12381
12387
|
|
|
12382
12388
|
|
|
12383
12389
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
12390
|
+
var newAnimate = animate;
|
|
12391
|
+
var newData = data;
|
|
12392
|
+
|
|
12384
12393
|
if (enteringNodes) {
|
|
12385
12394
|
// Perform a normal animation here, except - when it finishes - trigger
|
|
12386
12395
|
// the transition for entering nodes.
|
|
12387
|
-
|
|
12396
|
+
newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
12388
12397
|
onEnd: cb
|
|
12389
12398
|
});
|
|
12390
12399
|
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
|
|
12391
12400
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
12392
12401
|
// so perform the `onEnter.before` transformation on each node.
|
|
12393
12402
|
|
|
12394
|
-
|
|
12403
|
+
newData = data.map(function (datum, idx) {
|
|
12395
12404
|
var key = (datum.key || idx).toString();
|
|
12396
12405
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
12397
12406
|
});
|
|
12398
12407
|
}
|
|
12399
12408
|
|
|
12400
12409
|
return {
|
|
12401
|
-
animate:
|
|
12402
|
-
data:
|
|
12410
|
+
animate: newAnimate,
|
|
12411
|
+
data: newData
|
|
12403
12412
|
};
|
|
12404
12413
|
} // eslint-disable-next-line max-params, max-len
|
|
12405
12414
|
|
|
@@ -12408,23 +12417,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
12408
12417
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
12409
12418
|
// transition for all children to have the same duration, delay, etc.
|
|
12410
12419
|
var onEnter = animate && animate.onEnter;
|
|
12411
|
-
|
|
12420
|
+
|
|
12421
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
|
|
12422
|
+
|
|
12423
|
+
var newData = data;
|
|
12412
12424
|
|
|
12413
12425
|
if (enteringNodes) {
|
|
12414
12426
|
// Old nodes have been transitioned to their new values, and the
|
|
12415
12427
|
// domain should encompass the nodes that will now enter. So perform
|
|
12416
12428
|
// the `onEnter.after` transformation on each node.
|
|
12417
|
-
|
|
12418
|
-
var after =
|
|
12419
|
-
|
|
12429
|
+
newAnimate.onEnd = cb;
|
|
12430
|
+
var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
|
|
12431
|
+
newData = data.map(function (datum, idx) {
|
|
12420
12432
|
var key = getDatumKey(datum, idx);
|
|
12421
12433
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
|
|
12422
12434
|
});
|
|
12423
12435
|
}
|
|
12424
12436
|
|
|
12425
12437
|
return {
|
|
12426
|
-
animate:
|
|
12427
|
-
data:
|
|
12438
|
+
animate: newAnimate,
|
|
12439
|
+
data: newData
|
|
12428
12440
|
};
|
|
12429
12441
|
}
|
|
12430
12442
|
/**
|
|
@@ -12590,6 +12602,7 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
12590
12602
|
"use strict";
|
|
12591
12603
|
__webpack_require__.r(__webpack_exports__);
|
|
12592
12604
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12605
|
+
/* harmony export */ "assert": () => (/* binding */ assert),
|
|
12593
12606
|
/* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
|
|
12594
12607
|
/* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
|
|
12595
12608
|
/* harmony export */ });
|
|
@@ -12670,6 +12683,18 @@ var testIfSafeProp = function (key) {
|
|
|
12670
12683
|
if (doesPropStartWith(key) || isExactMatch(key)) return true;
|
|
12671
12684
|
return false;
|
|
12672
12685
|
};
|
|
12686
|
+
/**
|
|
12687
|
+
* Asserts that value is not null or undefined, throwing an error if it is.
|
|
12688
|
+
* @param value The value to assert
|
|
12689
|
+
* @param message The error message to throw
|
|
12690
|
+
*/
|
|
12691
|
+
|
|
12692
|
+
|
|
12693
|
+
function assert(value, message) {
|
|
12694
|
+
if (value === undefined || value === null) {
|
|
12695
|
+
throw new Error(message);
|
|
12696
|
+
}
|
|
12697
|
+
}
|
|
12673
12698
|
/**
|
|
12674
12699
|
* getSafeUserProps - function that takes in a props object and removes any
|
|
12675
12700
|
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
@@ -12679,7 +12704,6 @@ var testIfSafeProp = function (key) {
|
|
|
12679
12704
|
* @returns {Object}: object containing remaining acceptable props
|
|
12680
12705
|
*/
|
|
12681
12706
|
|
|
12682
|
-
|
|
12683
12707
|
var getSafeUserProps = function (props) {
|
|
12684
12708
|
var propsToFilter = _objectSpread({}, props);
|
|
12685
12709
|
|
|
@@ -12882,12 +12906,13 @@ function getDataFromChildren(props, childComponents) {
|
|
|
12882
12906
|
var childProps = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props, parentProps);
|
|
12883
12907
|
|
|
12884
12908
|
var childData;
|
|
12909
|
+
var childElement = child;
|
|
12885
12910
|
|
|
12886
12911
|
if (!_data__WEBPACK_IMPORTED_MODULE_12__.isDataComponent(child)) {
|
|
12887
12912
|
return null;
|
|
12888
12913
|
} else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(child.type.getData)) {
|
|
12889
|
-
|
|
12890
|
-
childData =
|
|
12914
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(child, parent.props) : child;
|
|
12915
|
+
childData = childElement.type.getData(childProps);
|
|
12891
12916
|
} else {
|
|
12892
12917
|
childData = _data__WEBPACK_IMPORTED_MODULE_12__.getData(childProps);
|
|
12893
12918
|
}
|
|
@@ -12918,17 +12943,16 @@ function getData(props, childComponents) {
|
|
|
12918
12943
|
return _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
|
|
12919
12944
|
}
|
|
12920
12945
|
|
|
12921
|
-
|
|
12922
|
-
return getDataFromChildren(props, childComponents);
|
|
12946
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children));
|
|
12923
12947
|
}
|
|
12924
12948
|
function getWidth(props, groupLength, seriesLength) {
|
|
12925
12949
|
var datasets = props.datasets,
|
|
12926
12950
|
horizontal = props.horizontal;
|
|
12927
12951
|
var range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "x");
|
|
12928
12952
|
var extent = Math.abs(range[1] - range[0]);
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
var bars =
|
|
12953
|
+
var seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
|
|
12954
|
+
var groupLengthValue = groupLength || datasets.length;
|
|
12955
|
+
var bars = groupLengthValue * seriesLengthValue;
|
|
12932
12956
|
var barRatio = 0.5;
|
|
12933
12957
|
return Math.round(barRatio * extent / bars);
|
|
12934
12958
|
}
|
|
@@ -13020,9 +13044,9 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
13020
13044
|
return [min, max];
|
|
13021
13045
|
}
|
|
13022
13046
|
function getDomain(props, axis, childComponents) {
|
|
13023
|
-
|
|
13047
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
|
|
13024
13048
|
var propsDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromProps(props, axis);
|
|
13025
|
-
var domainPadding = getDefaultDomainPadding(props, axis,
|
|
13049
|
+
var domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
13026
13050
|
var domain;
|
|
13027
13051
|
|
|
13028
13052
|
if (propsDomain) {
|
|
@@ -13032,7 +13056,7 @@ function getDomain(props, axis, childComponents) {
|
|
|
13032
13056
|
var maxDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getMaxFromProps(props, axis);
|
|
13033
13057
|
var dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
|
|
13034
13058
|
var dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromData(props, axis, dataset) : [];
|
|
13035
|
-
var childDomain = getDomainFromChildren(props, axis,
|
|
13059
|
+
var childDomain = getDomainFromChildren(props, axis, children);
|
|
13036
13060
|
var min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMinValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
|
|
13037
13061
|
var max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMaxValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
|
|
13038
13062
|
domain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromMinMax(min, max);
|
|
@@ -13194,10 +13218,10 @@ function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
|
13194
13218
|
return lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(categoryStrings), _toConsumableArray(axisStrings))));
|
|
13195
13219
|
}
|
|
13196
13220
|
function getStringsFromChildren(props, childComponents) {
|
|
13197
|
-
|
|
13198
|
-
var xStrings = getCategoryAndAxisStringsFromChildren(props, "x",
|
|
13199
|
-
var yStrings = getCategoryAndAxisStringsFromChildren(props, "y",
|
|
13200
|
-
var dataStrings = getStringsFromData(
|
|
13221
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
|
|
13222
|
+
var xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
13223
|
+
var yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
13224
|
+
var dataStrings = getStringsFromData(children);
|
|
13201
13225
|
return {
|
|
13202
13226
|
x: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(xStrings), _toConsumableArray(dataStrings.x)))),
|
|
13203
13227
|
y: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(yStrings), _toConsumableArray(dataStrings.y))))
|
|
@@ -13227,7 +13251,7 @@ function getCategories(props, childComponents, allStrings) {
|
|
|
13227
13251
|
"use strict";
|
|
13228
13252
|
__webpack_require__.r(__webpack_exports__);
|
|
13229
13253
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13230
|
-
/* harmony export */ "
|
|
13254
|
+
/* harmony export */ "VictorySharedEvents": () => (/* binding */ VictorySharedEvents)
|
|
13231
13255
|
/* harmony export */ });
|
|
13232
13256
|
/* 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");
|
|
13233
13257
|
/* harmony import */ var lodash_difference__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_difference__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -13245,12 +13269,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13245
13269
|
/* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_6__);
|
|
13246
13270
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "react");
|
|
13247
13271
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);
|
|
13248
|
-
/* 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");
|
|
13249
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_12__);
|
|
13250
13272
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/events.js");
|
|
13251
13273
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
13252
|
-
/* harmony import */ var
|
|
13253
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
13274
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
13254
13275
|
/* 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");
|
|
13255
13276
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_8__);
|
|
13256
13277
|
/* 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");
|
|
@@ -13307,11 +13328,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
13307
13328
|
|
|
13308
13329
|
|
|
13309
13330
|
|
|
13310
|
-
// DISCLAIMER:
|
|
13311
|
-
// This file is not currently tested, and it is first on the list of files
|
|
13312
|
-
// to refactor in our current refactoring effort. Please do not make changes
|
|
13313
|
-
// to this file without manual testing and/or refactoring and adding tests.
|
|
13314
|
-
|
|
13315
13331
|
var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
13316
13332
|
_inherits(VictorySharedEvents, _React$Component);
|
|
13317
13333
|
|
|
@@ -13323,14 +13339,21 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13323
13339
|
_classCallCheck(this, VictorySharedEvents);
|
|
13324
13340
|
|
|
13325
13341
|
_this = _super.call(this, props);
|
|
13326
|
-
_this.
|
|
13342
|
+
_this.getScopedEvents = void 0;
|
|
13343
|
+
_this.getEventState = void 0;
|
|
13344
|
+
_this.baseProps = void 0;
|
|
13345
|
+
_this.sharedEventsCache = void 0;
|
|
13346
|
+
_this.globalEvents = void 0;
|
|
13347
|
+
_this.prevGlobalEventKeys = void 0;
|
|
13348
|
+
_this.boundGlobalEvents = void 0;
|
|
13327
13349
|
_this.getScopedEvents = victory_core__WEBPACK_IMPORTED_MODULE_10__.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
13328
13350
|
_this.getEventState = victory_core__WEBPACK_IMPORTED_MODULE_10__.getEventState.bind(_assertThisInitialized(_this));
|
|
13329
|
-
_this.
|
|
13351
|
+
_this.state = _this.state || {};
|
|
13330
13352
|
_this.sharedEventsCache = {};
|
|
13331
13353
|
_this.globalEvents = {};
|
|
13332
13354
|
_this.prevGlobalEventKeys = [];
|
|
13333
13355
|
_this.boundGlobalEvents = {};
|
|
13356
|
+
_this.baseProps = _this.getBaseProps(props);
|
|
13334
13357
|
return _this;
|
|
13335
13358
|
}
|
|
13336
13359
|
|
|
@@ -13421,8 +13444,7 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13421
13444
|
value: function applyExternalMutations(props, externalMutations) {
|
|
13422
13445
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_3___default()(externalMutations)) {
|
|
13423
13446
|
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
13424
|
-
|
|
13425
|
-
return memo;
|
|
13447
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
13426
13448
|
}, []);
|
|
13427
13449
|
var compiledCallbacks = callbacks.length ? function () {
|
|
13428
13450
|
callbacks.forEach(function (c) {
|
|
@@ -13545,9 +13567,9 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13545
13567
|
var _this7 = this;
|
|
13546
13568
|
|
|
13547
13569
|
var children = this.getNewChildren(props, baseProps);
|
|
13548
|
-
var parents = Array.isArray(events)
|
|
13570
|
+
var parents = Array.isArray(events) ? events.filter(function (event) {
|
|
13549
13571
|
return event.target === "parent";
|
|
13550
|
-
});
|
|
13572
|
+
}) : [];
|
|
13551
13573
|
var sharedEvents = parents.length > 0 ? {
|
|
13552
13574
|
events: parents,
|
|
13553
13575
|
// partially apply childName (null) and baseProps,
|
|
@@ -13593,33 +13615,9 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13593
13615
|
|
|
13594
13616
|
return VictorySharedEvents;
|
|
13595
13617
|
}((react__WEBPACK_IMPORTED_MODULE_7___default().Component));
|
|
13596
|
-
|
|
13597
13618
|
VictorySharedEvents.displayName = "VictorySharedEvents";
|
|
13598
13619
|
VictorySharedEvents.role = "shared-event-wrapper";
|
|
13599
|
-
VictorySharedEvents.
|
|
13600
|
-
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)]),
|
|
13601
|
-
container: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node),
|
|
13602
|
-
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)]),
|
|
13603
|
-
events: prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape({
|
|
13604
|
-
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)]),
|
|
13605
|
-
eventHandlers: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().object),
|
|
13606
|
-
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)]),
|
|
13607
|
-
target: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)
|
|
13608
|
-
})),
|
|
13609
|
-
externalEventMutations: prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape({
|
|
13610
|
-
callback: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func),
|
|
13611
|
-
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)]),
|
|
13612
|
-
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)]),
|
|
13613
|
-
mutation: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func),
|
|
13614
|
-
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)])
|
|
13615
|
-
})),
|
|
13616
|
-
groupComponent: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node)
|
|
13617
|
-
};
|
|
13618
|
-
VictorySharedEvents.defaultProps = {
|
|
13619
|
-
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7___default().createElement("g", null)
|
|
13620
|
-
};
|
|
13621
|
-
VictorySharedEvents.contextType = victory_core__WEBPACK_IMPORTED_MODULE_14__["default"];
|
|
13622
|
-
|
|
13620
|
+
VictorySharedEvents.contextType = victory_core__WEBPACK_IMPORTED_MODULE_12__["default"];
|
|
13623
13621
|
|
|
13624
13622
|
/***/ }),
|
|
13625
13623
|
|