victory-scatter 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-scatter.js +162 -137
- package/dist/victory-scatter.min.js +1 -1
- package/es/helper-methods.d.ts +1 -1
- package/es/helper-methods.js +22 -21
- package/es/victory-scatter.d.ts +1 -0
- package/lib/helper-methods.d.ts +1 -1
- package/lib/helper-methods.js +21 -22
- package/lib/victory-scatter.d.ts +1 -0
- package/package.json +2 -2
- package/src/helper-methods.tsx +7 -3
package/dist/victory-scatter.js
CHANGED
|
@@ -134,27 +134,28 @@ var getCalculatedValues = function (props) {
|
|
|
134
134
|
};
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
var getBaseProps = function (
|
|
138
|
-
var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_3__.modifyProps(
|
|
139
|
-
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
137
|
+
var getBaseProps = function (initialProps, fallbackProps) {
|
|
138
|
+
var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_3__.modifyProps(initialProps, fallbackProps, "scatter");
|
|
139
|
+
|
|
140
|
+
var props = lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, modifiedProps, getCalculatedValues(modifiedProps));
|
|
141
|
+
|
|
142
|
+
var data = props.data,
|
|
143
|
+
domain = props.domain,
|
|
144
|
+
events = props.events,
|
|
145
|
+
height = props.height,
|
|
146
|
+
origin = props.origin,
|
|
147
|
+
padding = props.padding,
|
|
148
|
+
polar = props.polar,
|
|
149
|
+
scale = props.scale,
|
|
150
|
+
name = props.name,
|
|
151
|
+
sharedEvents = props.sharedEvents,
|
|
152
|
+
standalone = props.standalone,
|
|
153
|
+
style = props.style,
|
|
154
|
+
theme = props.theme,
|
|
155
|
+
width = props.width,
|
|
156
|
+
labels = props.labels,
|
|
157
|
+
horizontal = props.horizontal,
|
|
158
|
+
disableInlineStyles = props.disableInlineStyles;
|
|
158
159
|
var initialChildProps = {
|
|
159
160
|
parent: {
|
|
160
161
|
style: style.parent,
|
|
@@ -7175,12 +7176,12 @@ var interpolateFunction = function (a, b) {
|
|
|
7175
7176
|
* differs in that it uses our custom interpolators when interpolating the value of each property in
|
|
7176
7177
|
* an object. This allows the correct interpolation of nested objects, including styles
|
|
7177
7178
|
*
|
|
7178
|
-
* @param {any}
|
|
7179
|
-
* @param {any}
|
|
7179
|
+
* @param {any} startValue - Start value.
|
|
7180
|
+
* @param {any} endValue - End value.
|
|
7180
7181
|
* @returns {Function} An interpolation function.
|
|
7181
7182
|
*/
|
|
7182
7183
|
|
|
7183
|
-
var interpolateObject = function (
|
|
7184
|
+
var interpolateObject = function (startValue, endValue) {
|
|
7184
7185
|
var interpolateTypes = function (x, y) {
|
|
7185
7186
|
if (x === y || !isInterpolatable(x) || !isInterpolatable(y)) {
|
|
7186
7187
|
return interpolateImmediate(x, y);
|
|
@@ -7205,6 +7206,8 @@ var interpolateObject = function (a, b) {
|
|
|
7205
7206
|
|
|
7206
7207
|
var i = {};
|
|
7207
7208
|
var c = {};
|
|
7209
|
+
var a = startValue;
|
|
7210
|
+
var b = endValue;
|
|
7208
7211
|
var k;
|
|
7209
7212
|
|
|
7210
7213
|
if (a === null || typeof a !== "object") {
|
|
@@ -7372,8 +7375,8 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
|
7372
7375
|
step can generate imprecise values, sometimes greater than 1
|
|
7373
7376
|
if this happens set the state to 1 and return, cancelling the timer
|
|
7374
7377
|
*/
|
|
7375
|
-
|
|
7376
|
-
var step =
|
|
7378
|
+
var animationDuration = duration !== undefined ? duration : _this.props.duration;
|
|
7379
|
+
var step = animationDuration ? elapsed / animationDuration : 1;
|
|
7377
7380
|
|
|
7378
7381
|
if (step >= 1) {
|
|
7379
7382
|
_this.setState({
|
|
@@ -7989,8 +7992,7 @@ var getStyles = function (style, props) {
|
|
|
7989
7992
|
}
|
|
7990
7993
|
|
|
7991
7994
|
var getSingleStyle = function (s) {
|
|
7992
|
-
|
|
7993
|
-
var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s, props);
|
|
7995
|
+
var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles, props);
|
|
7994
7996
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, baseStyles, {
|
|
7995
7997
|
fontSize: getFontSize(baseStyles)
|
|
7996
7998
|
});
|
|
@@ -8194,22 +8196,19 @@ var getInlineXOffset = function (calculatedProps, textElements, index) {
|
|
|
8194
8196
|
switch (textAnchor) {
|
|
8195
8197
|
case "start":
|
|
8196
8198
|
return widths.reduce(function (memo, width, i) {
|
|
8197
|
-
|
|
8198
|
-
return memo;
|
|
8199
|
+
return i < index ? memo + width : memo;
|
|
8199
8200
|
}, 0);
|
|
8200
8201
|
|
|
8201
8202
|
case "end":
|
|
8202
8203
|
return widths.reduce(function (memo, width, i) {
|
|
8203
|
-
|
|
8204
|
-
return memo;
|
|
8204
|
+
return i > index ? memo - width : memo;
|
|
8205
8205
|
}, 0);
|
|
8206
8206
|
|
|
8207
8207
|
default:
|
|
8208
8208
|
// middle
|
|
8209
8209
|
return widths.reduce(function (memo, width, i) {
|
|
8210
8210
|
var offsetWidth = i < index ? width : 0;
|
|
8211
|
-
|
|
8212
|
-
return memo;
|
|
8211
|
+
return i === index ? memo + width / 2 : memo + offsetWidth;
|
|
8213
8212
|
}, centerOffset);
|
|
8214
8213
|
}
|
|
8215
8214
|
};
|
|
@@ -8411,8 +8410,8 @@ var defaultProps = {
|
|
|
8411
8410
|
// Magic number from d3.
|
|
8412
8411
|
lineHeight: 1
|
|
8413
8412
|
};
|
|
8414
|
-
var VictoryLabel = function (
|
|
8415
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
8413
|
+
var VictoryLabel = function (initialProps) {
|
|
8414
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
8416
8415
|
|
|
8417
8416
|
if (props.text === null || props.text === undefined) {
|
|
8418
8417
|
return null;
|
|
@@ -8433,7 +8432,7 @@ var VictoryLabel = function (props) {
|
|
|
8433
8432
|
fontSize: currentStyle.fontSize || defaultStyles.fontSize,
|
|
8434
8433
|
capHeight: capHeightPx,
|
|
8435
8434
|
text: line,
|
|
8436
|
-
//
|
|
8435
|
+
// TODO: This looks like a bug:
|
|
8437
8436
|
textSize: _victory_util_textsize__WEBPACK_IMPORTED_MODULE_12__.approximateTextSize(line, currentStyle),
|
|
8438
8437
|
lineHeight: currentLineHeight,
|
|
8439
8438
|
backgroundPadding: getSingleValue(backgroundPadding, i)
|
|
@@ -8926,8 +8925,8 @@ var defaultProps = {
|
|
|
8926
8925
|
role: "presentation",
|
|
8927
8926
|
shapeRendering: "auto"
|
|
8928
8927
|
};
|
|
8929
|
-
var Point = function (
|
|
8930
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
8928
|
+
var Point = function (initialProps) {
|
|
8929
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
8931
8930
|
var userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_5__.getSafeUserProps(props);
|
|
8932
8931
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.pathComponent, _objectSpread(_objectSpread({}, props.events), {}, {
|
|
8933
8932
|
"aria-label": props.ariaLabel,
|
|
@@ -10240,8 +10239,7 @@ function addEvents(WrappedComponent) {
|
|
|
10240
10239
|
value: function applyExternalMutations(props, externalMutations) {
|
|
10241
10240
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5___default()(externalMutations)) {
|
|
10242
10241
|
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
10243
|
-
|
|
10244
|
-
return memo;
|
|
10242
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
10245
10243
|
}, []);
|
|
10246
10244
|
var compiledCallbacks = callbacks.length ? function () {
|
|
10247
10245
|
callbacks.forEach(function (c) {
|
|
@@ -10296,8 +10294,8 @@ function addEvents(WrappedComponent) {
|
|
|
10296
10294
|
}, {
|
|
10297
10295
|
key: "getBaseProps",
|
|
10298
10296
|
value: function getBaseProps(props, getSharedEventState) {
|
|
10299
|
-
|
|
10300
|
-
var sharedParentState =
|
|
10297
|
+
var getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
|
|
10298
|
+
var sharedParentState = getSharedEventStateFunction("parent", "parent");
|
|
10301
10299
|
var parentState = this.getEventState("parent", "parent");
|
|
10302
10300
|
|
|
10303
10301
|
var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, parentState, sharedParentState);
|
|
@@ -10396,13 +10394,15 @@ function addEvents(WrappedComponent) {
|
|
|
10396
10394
|
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_0___default()(this.dataKeys, "all");
|
|
10397
10395
|
|
|
10398
10396
|
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
10397
|
+
var newMemo = memo;
|
|
10398
|
+
|
|
10399
10399
|
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
10400
10400
|
|
|
10401
10401
|
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
10402
|
-
|
|
10402
|
+
newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
10403
10403
|
}
|
|
10404
10404
|
|
|
10405
|
-
return
|
|
10405
|
+
return newMemo;
|
|
10406
10406
|
}, []);
|
|
10407
10407
|
var dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
10408
10408
|
var children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
|
|
@@ -10801,12 +10801,14 @@ function sortData(dataset, sortKey) {
|
|
|
10801
10801
|
} // Ensures previous VictoryLine api for sortKey prop stays consistent
|
|
10802
10802
|
|
|
10803
10803
|
|
|
10804
|
+
var formattedSortKey = sortKey;
|
|
10805
|
+
|
|
10804
10806
|
if (sortKey === "x" || sortKey === "y") {
|
|
10805
|
-
|
|
10807
|
+
formattedSortKey = "_".concat(sortKey);
|
|
10806
10808
|
}
|
|
10807
10809
|
|
|
10808
10810
|
var order = sortOrder === "ascending" ? "asc" : "desc";
|
|
10809
|
-
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset,
|
|
10811
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
|
|
10810
10812
|
} // This method will remove data points that break certain scales. (log scale only)
|
|
10811
10813
|
|
|
10812
10814
|
|
|
@@ -10997,7 +10999,10 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
10997
10999
|
return [];
|
|
10998
11000
|
}
|
|
10999
11001
|
|
|
11000
|
-
var defaultKeys = ["x", "y", "y0"];
|
|
11002
|
+
var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
|
|
11003
|
+
// but we need to figure out why changing it causes regressions in tests.
|
|
11004
|
+
// eslint-disable-next-line no-param-reassign
|
|
11005
|
+
|
|
11001
11006
|
expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
|
|
11002
11007
|
|
|
11003
11008
|
var createAccessor = function (name) {
|
|
@@ -11022,13 +11027,13 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
11022
11027
|
|
|
11023
11028
|
var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
|
|
11024
11029
|
// eslint-disable-line complexity
|
|
11025
|
-
|
|
11030
|
+
var parsedDatum = parseDatum(datum);
|
|
11026
11031
|
var fallbackValues = {
|
|
11027
11032
|
x: index,
|
|
11028
|
-
y:
|
|
11033
|
+
y: parsedDatum
|
|
11029
11034
|
};
|
|
11030
11035
|
var processedValues = expectedKeys.reduce(function (memo, type) {
|
|
11031
|
-
var processedValue = accessor[type](
|
|
11036
|
+
var processedValue = accessor[type](parsedDatum);
|
|
11032
11037
|
var value = processedValue !== undefined ? processedValue : fallbackValues[type];
|
|
11033
11038
|
|
|
11034
11039
|
if (value !== undefined) {
|
|
@@ -11043,7 +11048,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
11043
11048
|
return memo;
|
|
11044
11049
|
}, {});
|
|
11045
11050
|
|
|
11046
|
-
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues,
|
|
11051
|
+
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
|
|
11047
11052
|
|
|
11048
11053
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
|
|
11049
11054
|
dataArr.push(formattedDatum);
|
|
@@ -11154,8 +11159,8 @@ function getStringsFromData(props, axis) {
|
|
|
11154
11159
|
}, []);
|
|
11155
11160
|
var sortedData = sortData(data, props.sortKey, props.sortOrder);
|
|
11156
11161
|
var dataStrings = sortedData.reduce(function (dataArr, datum) {
|
|
11157
|
-
|
|
11158
|
-
dataArr.push(accessor(
|
|
11162
|
+
var parsedDatum = parseDatum(datum);
|
|
11163
|
+
dataArr.push(accessor(parsedDatum));
|
|
11159
11164
|
return dataArr;
|
|
11160
11165
|
}, []).filter(function (datum) {
|
|
11161
11166
|
return typeof datum === "string";
|
|
@@ -11521,18 +11526,18 @@ function padDomain(domain, props, axis) {
|
|
|
11521
11526
|
|
|
11522
11527
|
|
|
11523
11528
|
function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
|
|
11524
|
-
|
|
11525
|
-
|
|
11529
|
+
var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
|
|
11530
|
+
var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
|
|
11526
11531
|
return function (props, axis) {
|
|
11527
11532
|
var propsDomain = getDomainFromProps(props, axis);
|
|
11528
11533
|
|
|
11529
11534
|
if (propsDomain) {
|
|
11530
|
-
return
|
|
11535
|
+
return formatDomainFn(propsDomain, props, axis);
|
|
11531
11536
|
}
|
|
11532
11537
|
|
|
11533
11538
|
var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
11534
|
-
var domain = categories ? getDomainFromCategories(props, axis, categories) :
|
|
11535
|
-
return domain ?
|
|
11539
|
+
var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
|
|
11540
|
+
return domain ? formatDomainFn(domain, props, axis) : undefined;
|
|
11536
11541
|
};
|
|
11537
11542
|
}
|
|
11538
11543
|
/**
|
|
@@ -11565,27 +11570,27 @@ function getDomain(props, axis) {
|
|
|
11565
11570
|
*/
|
|
11566
11571
|
|
|
11567
11572
|
function getDomainFromCategories(props, axis, categories) {
|
|
11568
|
-
|
|
11573
|
+
var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
11569
11574
|
var polar = props.polar,
|
|
11570
11575
|
_props$startAngle = props.startAngle,
|
|
11571
11576
|
startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
|
|
11572
11577
|
_props$endAngle = props.endAngle,
|
|
11573
11578
|
endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
|
|
11574
11579
|
|
|
11575
|
-
if (!
|
|
11580
|
+
if (!categoriesArray) {
|
|
11576
11581
|
return undefined;
|
|
11577
11582
|
}
|
|
11578
11583
|
|
|
11579
11584
|
var minDomain = getMinFromProps(props, axis);
|
|
11580
11585
|
var maxDomain = getMaxFromProps(props, axis);
|
|
11581
|
-
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(
|
|
11586
|
+
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
|
|
11582
11587
|
var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
|
|
11583
11588
|
memo[string] = index + 1;
|
|
11584
11589
|
return memo;
|
|
11585
11590
|
}, {});
|
|
11586
|
-
var categoryValues = stringMap ?
|
|
11591
|
+
var categoryValues = stringMap ? categoriesArray.map(function (value) {
|
|
11587
11592
|
return stringMap[value];
|
|
11588
|
-
}) :
|
|
11593
|
+
}) : categoriesArray;
|
|
11589
11594
|
var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
|
|
11590
11595
|
var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
|
|
11591
11596
|
var categoryDomain = getDomainFromMinMax(min, max);
|
|
@@ -11600,7 +11605,7 @@ function getDomainFromCategories(props, axis, categories) {
|
|
|
11600
11605
|
*/
|
|
11601
11606
|
|
|
11602
11607
|
function getDomainFromData(props, axis, dataset) {
|
|
11603
|
-
|
|
11608
|
+
var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
|
|
11604
11609
|
var polar = props.polar,
|
|
11605
11610
|
_props$startAngle2 = props.startAngle,
|
|
11606
11611
|
startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
|
|
@@ -11609,14 +11614,14 @@ function getDomainFromData(props, axis, dataset) {
|
|
|
11609
11614
|
var minDomain = getMinFromProps(props, axis);
|
|
11610
11615
|
var maxDomain = getMaxFromProps(props, axis);
|
|
11611
11616
|
|
|
11612
|
-
if (
|
|
11617
|
+
if (datasetArray.length < 1) {
|
|
11613
11618
|
return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
|
|
11614
11619
|
}
|
|
11615
11620
|
|
|
11616
|
-
var min = minDomain !== undefined ? minDomain : getExtremeFromData(
|
|
11617
|
-
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(
|
|
11621
|
+
var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
|
|
11622
|
+
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
|
|
11618
11623
|
var domain = getDomainFromMinMax(min, max);
|
|
11619
|
-
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(
|
|
11624
|
+
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
|
|
11620
11625
|
}
|
|
11621
11626
|
/**
|
|
11622
11627
|
* Returns a domain in the form of a two element array given a min and max value.
|
|
@@ -11929,14 +11934,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
11929
11934
|
// eslint-disable-next-line no-invalid-this
|
|
11930
11935
|
|
|
11931
11936
|
|
|
11932
|
-
|
|
11937
|
+
var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
|
|
11933
11938
|
|
|
11934
11939
|
var getTargetProps = function (identifier, type) {
|
|
11935
11940
|
var childName = identifier.childName,
|
|
11936
11941
|
target = identifier.target,
|
|
11937
11942
|
key = identifier.key; // eslint-disable-next-line no-invalid-this
|
|
11938
11943
|
|
|
11939
|
-
var baseType = type === "props" ?
|
|
11944
|
+
var baseType = type === "props" ? newBaseProps : _this2.state || {};
|
|
11940
11945
|
var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
11941
11946
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
11942
11947
|
}; // Returns the state object with the mutation caused by a given eventReturn
|
|
@@ -11953,9 +11958,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
11953
11958
|
}
|
|
11954
11959
|
|
|
11955
11960
|
if (eventReturn.eventKey === "all") {
|
|
11956
|
-
return
|
|
11961
|
+
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");
|
|
11957
11962
|
} else if (eventReturn.eventKey === undefined && eventKey === "parent") {
|
|
11958
|
-
return
|
|
11963
|
+
return newBaseProps[childName] ? lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]) : lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps);
|
|
11959
11964
|
}
|
|
11960
11965
|
|
|
11961
11966
|
return eventReturn.eventKey !== undefined ? eventReturn.eventKey : eventKey;
|
|
@@ -11980,7 +11985,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
11980
11985
|
key: key,
|
|
11981
11986
|
target: target
|
|
11982
11987
|
}, "state");
|
|
11983
|
-
var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState),
|
|
11988
|
+
var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState), newBaseProps);
|
|
11984
11989
|
var childState = baseState[childName] || {};
|
|
11985
11990
|
|
|
11986
11991
|
var filterState = function (state) {
|
|
@@ -12015,7 +12020,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
12015
12020
|
}; // returns an entire mutated state for all children
|
|
12016
12021
|
|
|
12017
12022
|
|
|
12018
|
-
var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(
|
|
12023
|
+
var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent") : childNames;
|
|
12019
12024
|
return Array.isArray(allChildNames) ? allChildNames.reduce(function (memo, childName) {
|
|
12020
12025
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()(memo, getReturnByChild(childName));
|
|
12021
12026
|
}, {}) : getReturnByChild(allChildNames);
|
|
@@ -12024,8 +12029,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
12024
12029
|
|
|
12025
12030
|
var parseEventReturn = function (eventReturn, eventKey) {
|
|
12026
12031
|
return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
|
|
12027
|
-
|
|
12028
|
-
return memo;
|
|
12032
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
|
|
12029
12033
|
}, {}) : parseEvent(eventReturn, eventKey);
|
|
12030
12034
|
};
|
|
12031
12035
|
|
|
@@ -12111,9 +12115,10 @@ function getEventState(eventKey, namespace, childType) {
|
|
|
12111
12115
|
*/
|
|
12112
12116
|
// eslint-disable-next-line max-params
|
|
12113
12117
|
|
|
12114
|
-
function getExternalMutationsWithChildren(mutations
|
|
12115
|
-
baseProps =
|
|
12116
|
-
baseState =
|
|
12118
|
+
function getExternalMutationsWithChildren(mutations) {
|
|
12119
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12120
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
12121
|
+
var childNames = arguments.length > 3 ? arguments[3] : undefined;
|
|
12117
12122
|
return childNames.reduce(function (memo, childName) {
|
|
12118
12123
|
var childState = baseState[childName];
|
|
12119
12124
|
var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
@@ -12135,9 +12140,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
12135
12140
|
*/
|
|
12136
12141
|
// eslint-disable-next-line max-params
|
|
12137
12142
|
|
|
12138
|
-
function getExternalMutations(mutations
|
|
12139
|
-
baseProps =
|
|
12140
|
-
baseState =
|
|
12143
|
+
function getExternalMutations(mutations) {
|
|
12144
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12145
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
12146
|
+
var childName = arguments.length > 3 ? arguments[3] : undefined;
|
|
12141
12147
|
|
|
12142
12148
|
var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
|
|
12143
12149
|
|
|
@@ -12203,8 +12209,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
12203
12209
|
return false;
|
|
12204
12210
|
};
|
|
12205
12211
|
|
|
12206
|
-
|
|
12207
|
-
var scopedMutations = mutations;
|
|
12212
|
+
var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
|
|
12208
12213
|
|
|
12209
12214
|
if (identifier.childName) {
|
|
12210
12215
|
scopedMutations = mutations.filter(function (m) {
|
|
@@ -12243,13 +12248,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
12243
12248
|
|
|
12244
12249
|
function getComponentEvents(props, components) {
|
|
12245
12250
|
var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
|
|
12246
|
-
var _memo;
|
|
12247
|
-
|
|
12248
12251
|
var component = props[componentName];
|
|
12249
12252
|
var defaultEvents = component && component.type && component.type.defaultEvents;
|
|
12250
12253
|
var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
|
|
12251
|
-
|
|
12252
|
-
return memo;
|
|
12254
|
+
return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
|
|
12253
12255
|
}, []);
|
|
12254
12256
|
return events && events.length ? events : undefined;
|
|
12255
12257
|
}
|
|
@@ -12607,6 +12609,7 @@ function reduceChildren(children, iteratee) {
|
|
|
12607
12609
|
|
|
12608
12610
|
var traverseChildren = function (childArray, names, parent) {
|
|
12609
12611
|
return childArray.reduce(function (memo, child, index) {
|
|
12612
|
+
var newMemo = memo;
|
|
12610
12613
|
var childRole = child.type && child.type.role;
|
|
12611
12614
|
var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
|
|
12612
12615
|
|
|
@@ -12624,16 +12627,16 @@ function reduceChildren(children, iteratee) {
|
|
|
12624
12627
|
});
|
|
12625
12628
|
|
|
12626
12629
|
var nestedResults = traverseChildren(nestedChildren, _childNames, child);
|
|
12627
|
-
|
|
12630
|
+
newMemo = combine(newMemo, nestedResults);
|
|
12628
12631
|
} else {
|
|
12629
12632
|
var result = iteratee(child, childName, parent);
|
|
12630
12633
|
|
|
12631
12634
|
if (result) {
|
|
12632
|
-
|
|
12635
|
+
newMemo = combine(newMemo, result);
|
|
12633
12636
|
}
|
|
12634
12637
|
}
|
|
12635
12638
|
|
|
12636
|
-
return
|
|
12639
|
+
return newMemo;
|
|
12637
12640
|
}, initialMemo);
|
|
12638
12641
|
};
|
|
12639
12642
|
|
|
@@ -12659,8 +12662,7 @@ function isHorizontal(props) {
|
|
|
12659
12662
|
var childProps = child.props || {};
|
|
12660
12663
|
|
|
12661
12664
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
12662
|
-
|
|
12663
|
-
return memo;
|
|
12665
|
+
return memo || childProps.horizontal;
|
|
12664
12666
|
}
|
|
12665
12667
|
|
|
12666
12668
|
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
|
|
@@ -12713,11 +12715,13 @@ function isMap(x) {
|
|
|
12713
12715
|
}
|
|
12714
12716
|
function shallowToJS(x, whitelist) {
|
|
12715
12717
|
return isIterable(x) ? x.reduce(function (result, curr, key) {
|
|
12718
|
+
var newCurr = curr;
|
|
12719
|
+
|
|
12716
12720
|
if (whitelist && whitelist[key]) {
|
|
12717
|
-
|
|
12721
|
+
newCurr = shallowToJS(curr);
|
|
12718
12722
|
}
|
|
12719
12723
|
|
|
12720
|
-
result[key] =
|
|
12724
|
+
result[key] = newCurr;
|
|
12721
12725
|
return result;
|
|
12722
12726
|
}, isList(x) ? [] : {}) : x;
|
|
12723
12727
|
}
|
|
@@ -12745,12 +12749,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12745
12749
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
12746
12750
|
|
|
12747
12751
|
|
|
12748
|
-
/* eslint-disable no-use-before-define */
|
|
12749
|
-
|
|
12750
12752
|
|
|
12751
12753
|
// Private Functions
|
|
12752
|
-
function getVerticalAnchor(props
|
|
12753
|
-
datum =
|
|
12754
|
+
function getVerticalAnchor(props) {
|
|
12755
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12754
12756
|
var sign = datum._y >= 0 ? 1 : -1;
|
|
12755
12757
|
var labelStyle = props.style && props.style.labels || {};
|
|
12756
12758
|
|
|
@@ -12763,8 +12765,8 @@ function getVerticalAnchor(props, datum) {
|
|
|
12763
12765
|
return "middle";
|
|
12764
12766
|
}
|
|
12765
12767
|
|
|
12766
|
-
function getTextAnchor(props
|
|
12767
|
-
datum =
|
|
12768
|
+
function getTextAnchor(props) {
|
|
12769
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12768
12770
|
var style = props.style,
|
|
12769
12771
|
horizontal = props.horizontal;
|
|
12770
12772
|
var sign = datum._y >= 0 ? 1 : -1;
|
|
@@ -12779,14 +12781,14 @@ function getTextAnchor(props, datum) {
|
|
|
12779
12781
|
return sign >= 0 ? "start" : "end";
|
|
12780
12782
|
}
|
|
12781
12783
|
|
|
12782
|
-
function getAngle(props
|
|
12783
|
-
datum =
|
|
12784
|
+
function getAngle(props) {
|
|
12785
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12784
12786
|
var labelStyle = props.style && props.style.labels || {};
|
|
12785
12787
|
return datum.angle === undefined ? labelStyle.angle : datum.angle;
|
|
12786
12788
|
}
|
|
12787
12789
|
|
|
12788
|
-
function getPadding(props
|
|
12789
|
-
datum =
|
|
12790
|
+
function getPadding(props) {
|
|
12791
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12790
12792
|
var horizontal = props.horizontal,
|
|
12791
12793
|
style = props.style;
|
|
12792
12794
|
var labelStyle = style.labels || {};
|
|
@@ -12865,8 +12867,9 @@ function getPolarOrientation(degrees) {
|
|
|
12865
12867
|
} // Exported Functions
|
|
12866
12868
|
|
|
12867
12869
|
|
|
12868
|
-
function getText(props
|
|
12869
|
-
datum =
|
|
12870
|
+
function getText(props) {
|
|
12871
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12872
|
+
var index = arguments.length > 2 ? arguments[2] : undefined;
|
|
12870
12873
|
|
|
12871
12874
|
if (datum.label !== undefined) {
|
|
12872
12875
|
return datum.label;
|
|
@@ -14121,11 +14124,10 @@ var Timer = /*#__PURE__*/function () {
|
|
|
14121
14124
|
}, {
|
|
14122
14125
|
key: "subscribe",
|
|
14123
14126
|
value: function subscribe(callback, duration) {
|
|
14124
|
-
duration = this.shouldAnimate ? duration : 0;
|
|
14125
14127
|
var subscriptionID = this.subscribers.push({
|
|
14126
14128
|
startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
|
|
14127
14129
|
callback: callback,
|
|
14128
|
-
duration: duration
|
|
14130
|
+
duration: this.shouldAnimate ? duration : 0
|
|
14129
14131
|
});
|
|
14130
14132
|
this.activeSubscriptions++;
|
|
14131
14133
|
this.start();
|
|
@@ -14312,36 +14314,38 @@ function getInitialChildProps(animate, data) {
|
|
|
14312
14314
|
|
|
14313
14315
|
|
|
14314
14316
|
function getChildBeforeLoad(animate, child, data, cb) {
|
|
14315
|
-
|
|
14317
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
14316
14318
|
onEnd: cb
|
|
14317
14319
|
});
|
|
14318
14320
|
|
|
14319
|
-
if (
|
|
14321
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
14320
14322
|
return {
|
|
14321
|
-
animate:
|
|
14323
|
+
animate: newAnimate,
|
|
14322
14324
|
data: data
|
|
14323
14325
|
};
|
|
14324
14326
|
}
|
|
14325
14327
|
|
|
14326
|
-
var before =
|
|
14328
|
+
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.
|
|
14327
14329
|
|
|
14328
|
-
|
|
14330
|
+
var newData = data.map(function (datum, idx) {
|
|
14329
14331
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
|
|
14330
14332
|
});
|
|
14331
14333
|
return {
|
|
14332
|
-
animate:
|
|
14333
|
-
data:
|
|
14334
|
+
animate: newAnimate,
|
|
14335
|
+
data: newData,
|
|
14334
14336
|
clipWidth: 0
|
|
14335
14337
|
};
|
|
14336
14338
|
} // eslint-disable-next-line max-params
|
|
14337
14339
|
|
|
14338
14340
|
|
|
14339
14341
|
function getChildOnLoad(animate, data, cb) {
|
|
14340
|
-
|
|
14342
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
14341
14343
|
onEnd: cb
|
|
14342
14344
|
});
|
|
14343
14345
|
|
|
14344
|
-
|
|
14346
|
+
var newData = data;
|
|
14347
|
+
|
|
14348
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
14345
14349
|
return {
|
|
14346
14350
|
animate: animate,
|
|
14347
14351
|
data: data
|
|
@@ -14350,12 +14354,12 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
14350
14354
|
|
|
14351
14355
|
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.
|
|
14352
14356
|
|
|
14353
|
-
|
|
14357
|
+
newData = data.map(function (datum, idx) {
|
|
14354
14358
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
|
|
14355
14359
|
});
|
|
14356
14360
|
return {
|
|
14357
|
-
animate:
|
|
14358
|
-
data:
|
|
14361
|
+
animate: newAnimate,
|
|
14362
|
+
data: newData
|
|
14359
14363
|
};
|
|
14360
14364
|
} // eslint-disable-next-line max-params, max-len
|
|
14361
14365
|
|
|
@@ -14364,7 +14368,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
14364
14368
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
14365
14369
|
// transition for all children to have the same duration, delay, etc.
|
|
14366
14370
|
var onExit = animate && animate.onExit;
|
|
14367
|
-
|
|
14371
|
+
|
|
14372
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
|
|
14373
|
+
|
|
14374
|
+
var newData = data;
|
|
14368
14375
|
|
|
14369
14376
|
if (exitingNodes) {
|
|
14370
14377
|
// After the exit transition occurs, trigger the animations for
|
|
@@ -14372,39 +14379,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
14372
14379
|
animate.onEnd = cb;
|
|
14373
14380
|
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.
|
|
14374
14381
|
|
|
14375
|
-
|
|
14382
|
+
newData = data.map(function (datum, idx) {
|
|
14376
14383
|
var key = (datum.key || idx).toString();
|
|
14377
14384
|
return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
14378
14385
|
});
|
|
14379
14386
|
}
|
|
14380
14387
|
|
|
14381
14388
|
return {
|
|
14382
|
-
animate:
|
|
14383
|
-
data:
|
|
14389
|
+
animate: newAnimate,
|
|
14390
|
+
data: newData
|
|
14384
14391
|
};
|
|
14385
14392
|
} // eslint-disable-next-line max-params,max-len
|
|
14386
14393
|
|
|
14387
14394
|
|
|
14388
14395
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
14396
|
+
var newAnimate = animate;
|
|
14397
|
+
var newData = data;
|
|
14398
|
+
|
|
14389
14399
|
if (enteringNodes) {
|
|
14390
14400
|
// Perform a normal animation here, except - when it finishes - trigger
|
|
14391
14401
|
// the transition for entering nodes.
|
|
14392
|
-
|
|
14402
|
+
newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
14393
14403
|
onEnd: cb
|
|
14394
14404
|
});
|
|
14395
14405
|
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
|
|
14396
14406
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
14397
14407
|
// so perform the `onEnter.before` transformation on each node.
|
|
14398
14408
|
|
|
14399
|
-
|
|
14409
|
+
newData = data.map(function (datum, idx) {
|
|
14400
14410
|
var key = (datum.key || idx).toString();
|
|
14401
14411
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
14402
14412
|
});
|
|
14403
14413
|
}
|
|
14404
14414
|
|
|
14405
14415
|
return {
|
|
14406
|
-
animate:
|
|
14407
|
-
data:
|
|
14416
|
+
animate: newAnimate,
|
|
14417
|
+
data: newData
|
|
14408
14418
|
};
|
|
14409
14419
|
} // eslint-disable-next-line max-params, max-len
|
|
14410
14420
|
|
|
@@ -14413,23 +14423,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
14413
14423
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
14414
14424
|
// transition for all children to have the same duration, delay, etc.
|
|
14415
14425
|
var onEnter = animate && animate.onEnter;
|
|
14416
|
-
|
|
14426
|
+
|
|
14427
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
|
|
14428
|
+
|
|
14429
|
+
var newData = data;
|
|
14417
14430
|
|
|
14418
14431
|
if (enteringNodes) {
|
|
14419
14432
|
// Old nodes have been transitioned to their new values, and the
|
|
14420
14433
|
// domain should encompass the nodes that will now enter. So perform
|
|
14421
14434
|
// the `onEnter.after` transformation on each node.
|
|
14422
|
-
|
|
14423
|
-
var after =
|
|
14424
|
-
|
|
14435
|
+
newAnimate.onEnd = cb;
|
|
14436
|
+
var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
|
|
14437
|
+
newData = data.map(function (datum, idx) {
|
|
14425
14438
|
var key = getDatumKey(datum, idx);
|
|
14426
14439
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
|
|
14427
14440
|
});
|
|
14428
14441
|
}
|
|
14429
14442
|
|
|
14430
14443
|
return {
|
|
14431
|
-
animate:
|
|
14432
|
-
data:
|
|
14444
|
+
animate: newAnimate,
|
|
14445
|
+
data: newData
|
|
14433
14446
|
};
|
|
14434
14447
|
}
|
|
14435
14448
|
/**
|
|
@@ -14595,6 +14608,7 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
14595
14608
|
"use strict";
|
|
14596
14609
|
__webpack_require__.r(__webpack_exports__);
|
|
14597
14610
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14611
|
+
/* harmony export */ "assert": () => (/* binding */ assert),
|
|
14598
14612
|
/* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
|
|
14599
14613
|
/* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
|
|
14600
14614
|
/* harmony export */ });
|
|
@@ -14675,6 +14689,18 @@ var testIfSafeProp = function (key) {
|
|
|
14675
14689
|
if (doesPropStartWith(key) || isExactMatch(key)) return true;
|
|
14676
14690
|
return false;
|
|
14677
14691
|
};
|
|
14692
|
+
/**
|
|
14693
|
+
* Asserts that value is not null or undefined, throwing an error if it is.
|
|
14694
|
+
* @param value The value to assert
|
|
14695
|
+
* @param message The error message to throw
|
|
14696
|
+
*/
|
|
14697
|
+
|
|
14698
|
+
|
|
14699
|
+
function assert(value, message) {
|
|
14700
|
+
if (value === undefined || value === null) {
|
|
14701
|
+
throw new Error(message);
|
|
14702
|
+
}
|
|
14703
|
+
}
|
|
14678
14704
|
/**
|
|
14679
14705
|
* getSafeUserProps - function that takes in a props object and removes any
|
|
14680
14706
|
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
@@ -14684,7 +14710,6 @@ var testIfSafeProp = function (key) {
|
|
|
14684
14710
|
* @returns {Object}: object containing remaining acceptable props
|
|
14685
14711
|
*/
|
|
14686
14712
|
|
|
14687
|
-
|
|
14688
14713
|
var getSafeUserProps = function (props) {
|
|
14689
14714
|
var propsToFilter = _objectSpread({}, props);
|
|
14690
14715
|
|