victory-area 36.0.0 → 36.1.0
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/dist/victory-area.js +308 -327
- package/es/victory-area.js +1 -3
- package/lib/victory-area.js +1 -3
- package/package.json +3 -3
package/dist/victory-area.js
CHANGED
|
@@ -437,9 +437,7 @@ var options = {
|
|
|
437
437
|
}]
|
|
438
438
|
};
|
|
439
439
|
|
|
440
|
-
var VictoryArea =
|
|
441
|
-
/*#__PURE__*/
|
|
442
|
-
function (_React$Component) {
|
|
440
|
+
var VictoryArea = /*#__PURE__*/function (_React$Component) {
|
|
443
441
|
_inherits(VictoryArea, _React$Component);
|
|
444
442
|
|
|
445
443
|
function VictoryArea() {
|
|
@@ -16961,9 +16959,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
16961
16959
|
|
|
16962
16960
|
|
|
16963
16961
|
|
|
16964
|
-
var VictoryAnimation =
|
|
16965
|
-
/*#__PURE__*/
|
|
16966
|
-
function (_React$Component) {
|
|
16962
|
+
var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
16967
16963
|
_inherits(VictoryAnimation, _React$Component);
|
|
16968
16964
|
|
|
16969
16965
|
function VictoryAnimation(props, context) {
|
|
@@ -17250,9 +17246,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
17250
17246
|
|
|
17251
17247
|
|
|
17252
17248
|
|
|
17253
|
-
var VictoryClipContainer =
|
|
17254
|
-
/*#__PURE__*/
|
|
17255
|
-
function (_React$Component) {
|
|
17249
|
+
var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
17256
17250
|
_inherits(VictoryClipContainer, _React$Component);
|
|
17257
17251
|
|
|
17258
17252
|
function VictoryClipContainer(props) {
|
|
@@ -17563,9 +17557,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
17563
17557
|
|
|
17564
17558
|
|
|
17565
17559
|
|
|
17566
|
-
var VictoryContainer =
|
|
17567
|
-
/*#__PURE__*/
|
|
17568
|
-
function (_React$Component) {
|
|
17560
|
+
var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
17569
17561
|
_inherits(VictoryContainer, _React$Component);
|
|
17570
17562
|
|
|
17571
17563
|
function VictoryContainer(props) {
|
|
@@ -18511,9 +18503,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
18511
18503
|
|
|
18512
18504
|
|
|
18513
18505
|
|
|
18514
|
-
var Portal =
|
|
18515
|
-
/*#__PURE__*/
|
|
18516
|
-
function (_React$Component) {
|
|
18506
|
+
var Portal = /*#__PURE__*/function (_React$Component) {
|
|
18517
18507
|
_inherits(Portal, _React$Component);
|
|
18518
18508
|
|
|
18519
18509
|
function Portal(props) {
|
|
@@ -18632,9 +18622,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
18632
18622
|
|
|
18633
18623
|
|
|
18634
18624
|
|
|
18635
|
-
var VictoryPortal =
|
|
18636
|
-
/*#__PURE__*/
|
|
18637
|
-
function (_React$Component) {
|
|
18625
|
+
var VictoryPortal = /*#__PURE__*/function (_React$Component) {
|
|
18638
18626
|
_inherits(VictoryPortal, _React$Component);
|
|
18639
18627
|
|
|
18640
18628
|
function VictoryPortal() {
|
|
@@ -19593,9 +19581,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
19593
19581
|
|
|
19594
19582
|
|
|
19595
19583
|
|
|
19596
|
-
var VictoryTransition =
|
|
19597
|
-
/*#__PURE__*/
|
|
19598
|
-
function (_React$Component) {
|
|
19584
|
+
var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
19599
19585
|
_inherits(VictoryTransition, _React$Component);
|
|
19600
19586
|
|
|
19601
19587
|
function VictoryTransition(props, context) {
|
|
@@ -19896,365 +19882,362 @@ var defaultComponents = [{
|
|
|
19896
19882
|
name: "labels"
|
|
19897
19883
|
}];
|
|
19898
19884
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (WrappedComponent, options) {
|
|
19899
|
-
return (
|
|
19900
|
-
|
|
19901
|
-
function (_WrappedComponent) {
|
|
19902
|
-
_inherits(addEvents, _WrappedComponent);
|
|
19885
|
+
return /*#__PURE__*/function (_WrappedComponent) {
|
|
19886
|
+
_inherits(addEvents, _WrappedComponent);
|
|
19903
19887
|
|
|
19904
|
-
|
|
19905
|
-
|
|
19888
|
+
function addEvents(props) {
|
|
19889
|
+
var _this;
|
|
19906
19890
|
|
|
19907
|
-
|
|
19891
|
+
_classCallCheck(this, addEvents);
|
|
19908
19892
|
|
|
19909
|
-
|
|
19910
|
-
|
|
19911
|
-
|
|
19912
|
-
|
|
19893
|
+
_this = _possibleConstructorReturn(this, (addEvents.__proto__ || Object.getPrototypeOf(addEvents)).call(this, props));
|
|
19894
|
+
var getScopedEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
19895
|
+
var boundGetEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getEvents.bind(_assertThisInitialized(_this));
|
|
19896
|
+
_this.state = {};
|
|
19913
19897
|
|
|
19914
|
-
|
|
19915
|
-
|
|
19916
|
-
|
|
19917
|
-
|
|
19918
|
-
_this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
|
|
19898
|
+
_this.getEvents = function (p, target, eventKey) {
|
|
19899
|
+
return boundGetEvents(p, target, eventKey, getScopedEvents);
|
|
19900
|
+
};
|
|
19919
19901
|
|
|
19920
|
-
|
|
19902
|
+
_this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
|
|
19921
19903
|
|
|
19922
|
-
|
|
19904
|
+
var calculatedValues = _this.getCalculatedValues(props);
|
|
19923
19905
|
|
|
19924
|
-
|
|
19925
|
-
_this.calculatedState = _this.getStateChanges(props);
|
|
19926
|
-
_this.globalEvents = {};
|
|
19927
|
-
_this.prevGlobalEventKeys = [];
|
|
19928
|
-
_this.boundGlobalEvents = {};
|
|
19929
|
-
return _this;
|
|
19930
|
-
}
|
|
19906
|
+
_this.cacheValues(calculatedValues);
|
|
19931
19907
|
|
|
19932
|
-
|
|
19933
|
-
|
|
19934
|
-
|
|
19935
|
-
|
|
19936
|
-
|
|
19937
|
-
|
|
19938
|
-
|
|
19939
|
-
if (animating || newMutation) {
|
|
19940
|
-
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
19941
|
-
this.externalMutations = externalMutations;
|
|
19942
|
-
this.applyExternalMutations(nextProps, externalMutations);
|
|
19943
|
-
return true;
|
|
19944
|
-
}
|
|
19908
|
+
_this.externalMutations = _this.getExternalMutations(props);
|
|
19909
|
+
_this.calculatedState = _this.getStateChanges(props);
|
|
19910
|
+
_this.globalEvents = {};
|
|
19911
|
+
_this.prevGlobalEventKeys = [];
|
|
19912
|
+
_this.boundGlobalEvents = {};
|
|
19913
|
+
return _this;
|
|
19914
|
+
}
|
|
19945
19915
|
|
|
19946
|
-
|
|
19916
|
+
_createClass(addEvents, [{
|
|
19917
|
+
key: "shouldComponentUpdate",
|
|
19918
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
19919
|
+
var externalMutations = this.getExternalMutations(nextProps);
|
|
19920
|
+
var animating = this.props.animating || this.props.animate;
|
|
19921
|
+
var newMutation = !react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(externalMutations, this.externalMutations);
|
|
19947
19922
|
|
|
19948
|
-
|
|
19949
|
-
|
|
19950
|
-
|
|
19951
|
-
|
|
19923
|
+
if (animating || newMutation) {
|
|
19924
|
+
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
19925
|
+
this.externalMutations = externalMutations;
|
|
19926
|
+
this.applyExternalMutations(nextProps, externalMutations);
|
|
19927
|
+
return true;
|
|
19928
|
+
}
|
|
19952
19929
|
|
|
19953
|
-
|
|
19954
|
-
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
19955
|
-
return true;
|
|
19956
|
-
}
|
|
19930
|
+
var calculatedState = this.getStateChanges(nextProps);
|
|
19957
19931
|
|
|
19958
|
-
|
|
19932
|
+
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.calculatedState, calculatedState)) {
|
|
19933
|
+
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
19934
|
+
return true;
|
|
19959
19935
|
}
|
|
19960
|
-
}, {
|
|
19961
|
-
key: "componentDidMount",
|
|
19962
|
-
value: function componentDidMount() {
|
|
19963
|
-
var _this2 = this;
|
|
19964
|
-
|
|
19965
|
-
var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
|
|
19966
19936
|
|
|
19967
|
-
|
|
19968
|
-
|
|
19969
|
-
|
|
19970
|
-
this.prevGlobalEventKeys = globalEventKeys;
|
|
19937
|
+
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.props, nextProps)) {
|
|
19938
|
+
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
19939
|
+
return true;
|
|
19971
19940
|
}
|
|
19972
|
-
}, {
|
|
19973
|
-
key: "componentDidUpdate",
|
|
19974
|
-
value: function componentDidUpdate(prevProps) {
|
|
19975
|
-
var _this3 = this;
|
|
19976
19941
|
|
|
19977
|
-
|
|
19978
|
-
|
|
19942
|
+
return false;
|
|
19943
|
+
}
|
|
19944
|
+
}, {
|
|
19945
|
+
key: "componentDidMount",
|
|
19946
|
+
value: function componentDidMount() {
|
|
19947
|
+
var _this2 = this;
|
|
19979
19948
|
|
|
19980
|
-
|
|
19949
|
+
var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
|
|
19981
19950
|
|
|
19982
|
-
|
|
19951
|
+
globalEventKeys.forEach(function (key) {
|
|
19952
|
+
return _this2.addGlobalListener(key);
|
|
19953
|
+
});
|
|
19954
|
+
this.prevGlobalEventKeys = globalEventKeys;
|
|
19955
|
+
}
|
|
19956
|
+
}, {
|
|
19957
|
+
key: "componentDidUpdate",
|
|
19958
|
+
value: function componentDidUpdate(prevProps) {
|
|
19959
|
+
var _this3 = this;
|
|
19983
19960
|
|
|
19984
|
-
|
|
19985
|
-
|
|
19986
|
-
});
|
|
19961
|
+
var calculatedState = this.getStateChanges(prevProps);
|
|
19962
|
+
this.calculatedState = calculatedState;
|
|
19987
19963
|
|
|
19988
|
-
|
|
19964
|
+
var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
|
|
19989
19965
|
|
|
19990
|
-
|
|
19991
|
-
return _this3.addGlobalListener(key);
|
|
19992
|
-
});
|
|
19993
|
-
this.prevGlobalEventKeys = globalEventKeys;
|
|
19994
|
-
}
|
|
19995
|
-
}, {
|
|
19996
|
-
key: "componentWillUnmount",
|
|
19997
|
-
value: function componentWillUnmount() {
|
|
19998
|
-
var _this4 = this;
|
|
19966
|
+
var removedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(this.prevGlobalEventKeys, globalEventKeys);
|
|
19999
19967
|
|
|
20000
|
-
|
|
20001
|
-
|
|
20002
|
-
|
|
20003
|
-
}
|
|
20004
|
-
}, {
|
|
20005
|
-
key: "addGlobalListener",
|
|
20006
|
-
value: function addGlobalListener(key) {
|
|
20007
|
-
var _this5 = this;
|
|
20008
|
-
|
|
20009
|
-
var boundListener = function (event) {
|
|
20010
|
-
var listener = _this5.globalEvents[key];
|
|
20011
|
-
return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
|
|
20012
|
-
};
|
|
19968
|
+
removedGlobalEventKeys.forEach(function (key) {
|
|
19969
|
+
return _this3.removeGlobalListener(key);
|
|
19970
|
+
});
|
|
20013
19971
|
|
|
20014
|
-
|
|
20015
|
-
window.addEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), boundListener);
|
|
20016
|
-
}
|
|
20017
|
-
}, {
|
|
20018
|
-
key: "removeGlobalListener",
|
|
20019
|
-
value: function removeGlobalListener(key) {
|
|
20020
|
-
window.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
|
|
20021
|
-
} // compile all state changes from own and parent state. Order doesn't matter, as any state
|
|
20022
|
-
// state change should trigger a re-render
|
|
20023
|
-
|
|
20024
|
-
}, {
|
|
20025
|
-
key: "getStateChanges",
|
|
20026
|
-
value: function getStateChanges(props) {
|
|
20027
|
-
var _this6 = this;
|
|
20028
|
-
|
|
20029
|
-
if (!this.hasEvents) {
|
|
20030
|
-
return {};
|
|
20031
|
-
}
|
|
19972
|
+
var addedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(globalEventKeys, this.prevGlobalEventKeys);
|
|
20032
19973
|
|
|
20033
|
-
|
|
20034
|
-
|
|
19974
|
+
addedGlobalEventKeys.forEach(function (key) {
|
|
19975
|
+
return _this3.addGlobalListener(key);
|
|
19976
|
+
});
|
|
19977
|
+
this.prevGlobalEventKeys = globalEventKeys;
|
|
19978
|
+
}
|
|
19979
|
+
}, {
|
|
19980
|
+
key: "componentWillUnmount",
|
|
19981
|
+
value: function componentWillUnmount() {
|
|
19982
|
+
var _this4 = this;
|
|
20035
19983
|
|
|
20036
|
-
|
|
20037
|
-
|
|
19984
|
+
this.prevGlobalEventKeys.forEach(function (key) {
|
|
19985
|
+
return _this4.removeGlobalListener(key);
|
|
19986
|
+
});
|
|
19987
|
+
}
|
|
19988
|
+
}, {
|
|
19989
|
+
key: "addGlobalListener",
|
|
19990
|
+
value: function addGlobalListener(key) {
|
|
19991
|
+
var _this5 = this;
|
|
19992
|
+
|
|
19993
|
+
var boundListener = function (event) {
|
|
19994
|
+
var listener = _this5.globalEvents[key];
|
|
19995
|
+
return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
|
|
19996
|
+
};
|
|
20038
19997
|
|
|
20039
|
-
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20054
|
-
|
|
20055
|
-
|
|
20056
|
-
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
20057
|
-
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
20058
|
-
memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
20059
|
-
return memo;
|
|
20060
|
-
}, []);
|
|
20061
|
-
var compiledCallbacks = callbacks.length ? function () {
|
|
20062
|
-
callbacks.forEach(function (c) {
|
|
20063
|
-
return c();
|
|
20064
|
-
});
|
|
20065
|
-
} : undefined;
|
|
20066
|
-
this.setState(externalMutations, compiledCallbacks);
|
|
20067
|
-
}
|
|
19998
|
+
this.boundGlobalEvents[key] = boundListener;
|
|
19999
|
+
window.addEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), boundListener);
|
|
20000
|
+
}
|
|
20001
|
+
}, {
|
|
20002
|
+
key: "removeGlobalListener",
|
|
20003
|
+
value: function removeGlobalListener(key) {
|
|
20004
|
+
window.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
|
|
20005
|
+
} // compile all state changes from own and parent state. Order doesn't matter, as any state
|
|
20006
|
+
// state change should trigger a re-render
|
|
20007
|
+
|
|
20008
|
+
}, {
|
|
20009
|
+
key: "getStateChanges",
|
|
20010
|
+
value: function getStateChanges(props) {
|
|
20011
|
+
var _this6 = this;
|
|
20012
|
+
|
|
20013
|
+
if (!this.hasEvents) {
|
|
20014
|
+
return {};
|
|
20068
20015
|
}
|
|
20069
|
-
}, {
|
|
20070
|
-
key: "getCalculatedValues",
|
|
20071
|
-
value: function getCalculatedValues(props) {
|
|
20072
|
-
var sharedEvents = props.sharedEvents;
|
|
20073
|
-
var components = WrappedComponent.expectedComponents;
|
|
20074
|
-
var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
20075
|
-
var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
|
|
20076
|
-
return undefined;
|
|
20077
|
-
};
|
|
20078
|
-
var baseProps = this.getBaseProps(props, getSharedEventState);
|
|
20079
20016
|
|
|
20080
|
-
|
|
20081
|
-
|
|
20082
|
-
});
|
|
20017
|
+
var getState = function (key, type) {
|
|
20018
|
+
var result = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
|
|
20083
20019
|
|
|
20084
|
-
|
|
20085
|
-
|
|
20086
|
-
return {
|
|
20087
|
-
componentEvents: componentEvents,
|
|
20088
|
-
getSharedEventState: getSharedEventState,
|
|
20089
|
-
baseProps: baseProps,
|
|
20090
|
-
dataKeys: dataKeys,
|
|
20091
|
-
hasEvents: hasEvents,
|
|
20092
|
-
events: events
|
|
20093
|
-
};
|
|
20094
|
-
}
|
|
20095
|
-
}, {
|
|
20096
|
-
key: "getExternalMutations",
|
|
20097
|
-
value: function getExternalMutations(props) {
|
|
20098
|
-
var sharedEvents = props.sharedEvents,
|
|
20099
|
-
externalEventMutations = props.externalEventMutations;
|
|
20100
|
-
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
20101
|
-
}
|
|
20102
|
-
}, {
|
|
20103
|
-
key: "cacheValues",
|
|
20104
|
-
value: function cacheValues(obj) {
|
|
20105
|
-
var _this7 = this;
|
|
20020
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
|
|
20021
|
+
};
|
|
20106
20022
|
|
|
20107
|
-
|
|
20108
|
-
|
|
20109
|
-
|
|
20023
|
+
options = options || {};
|
|
20024
|
+
var components = options.components || defaultComponents;
|
|
20025
|
+
var stateChanges = components.map(function (component) {
|
|
20026
|
+
if (!props.standalone && component.name === "parent") {
|
|
20027
|
+
// don't check for changes on parent props for non-standalone components
|
|
20028
|
+
return undefined;
|
|
20029
|
+
} else {
|
|
20030
|
+
return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
|
|
20031
|
+
return getState(key, component.name);
|
|
20032
|
+
}).filter(Boolean);
|
|
20033
|
+
}
|
|
20034
|
+
}).filter(Boolean);
|
|
20035
|
+
return stateChanges;
|
|
20036
|
+
}
|
|
20037
|
+
}, {
|
|
20038
|
+
key: "applyExternalMutations",
|
|
20039
|
+
value: function applyExternalMutations(props, externalMutations) {
|
|
20040
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
20041
|
+
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
20042
|
+
memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
20043
|
+
return memo;
|
|
20044
|
+
}, []);
|
|
20045
|
+
var compiledCallbacks = callbacks.length ? function () {
|
|
20046
|
+
callbacks.forEach(function (c) {
|
|
20047
|
+
return c();
|
|
20048
|
+
});
|
|
20049
|
+
} : undefined;
|
|
20050
|
+
this.setState(externalMutations, compiledCallbacks);
|
|
20110
20051
|
}
|
|
20111
|
-
}
|
|
20112
|
-
|
|
20113
|
-
|
|
20114
|
-
|
|
20115
|
-
|
|
20116
|
-
|
|
20052
|
+
}
|
|
20053
|
+
}, {
|
|
20054
|
+
key: "getCalculatedValues",
|
|
20055
|
+
value: function getCalculatedValues(props) {
|
|
20056
|
+
var sharedEvents = props.sharedEvents;
|
|
20057
|
+
var components = WrappedComponent.expectedComponents;
|
|
20058
|
+
var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
20059
|
+
var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
|
|
20060
|
+
return undefined;
|
|
20061
|
+
};
|
|
20062
|
+
var baseProps = this.getBaseProps(props, getSharedEventState);
|
|
20117
20063
|
|
|
20118
|
-
|
|
20064
|
+
var dataKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(baseProps).filter(function (key) {
|
|
20065
|
+
return key !== "parent";
|
|
20066
|
+
});
|
|
20119
20067
|
|
|
20120
|
-
|
|
20121
|
-
|
|
20068
|
+
var hasEvents = props.events || props.sharedEvents || componentEvents;
|
|
20069
|
+
var events = this.getAllEvents(props);
|
|
20070
|
+
return {
|
|
20071
|
+
componentEvents: componentEvents,
|
|
20072
|
+
getSharedEventState: getSharedEventState,
|
|
20073
|
+
baseProps: baseProps,
|
|
20074
|
+
dataKeys: dataKeys,
|
|
20075
|
+
hasEvents: hasEvents,
|
|
20076
|
+
events: events
|
|
20077
|
+
};
|
|
20078
|
+
}
|
|
20079
|
+
}, {
|
|
20080
|
+
key: "getExternalMutations",
|
|
20081
|
+
value: function getExternalMutations(props) {
|
|
20082
|
+
var sharedEvents = props.sharedEvents,
|
|
20083
|
+
externalEventMutations = props.externalEventMutations;
|
|
20084
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
20085
|
+
}
|
|
20086
|
+
}, {
|
|
20087
|
+
key: "cacheValues",
|
|
20088
|
+
value: function cacheValues(obj) {
|
|
20089
|
+
var _this7 = this;
|
|
20122
20090
|
|
|
20123
|
-
|
|
20091
|
+
lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(obj).forEach(function (key) {
|
|
20092
|
+
_this7[key] = obj[key];
|
|
20093
|
+
});
|
|
20094
|
+
}
|
|
20095
|
+
}, {
|
|
20096
|
+
key: "getBaseProps",
|
|
20097
|
+
value: function getBaseProps(props, getSharedEventState) {
|
|
20098
|
+
getSharedEventState = getSharedEventState || this.getSharedEventState;
|
|
20099
|
+
var sharedParentState = getSharedEventState("parent", "parent");
|
|
20100
|
+
var parentState = this.getEventState("parent", "parent");
|
|
20124
20101
|
|
|
20125
|
-
|
|
20126
|
-
}
|
|
20127
|
-
}, {
|
|
20128
|
-
key: "getAllEvents",
|
|
20129
|
-
value: function getAllEvents(props) {
|
|
20130
|
-
if (Array.isArray(this.componentEvents)) {
|
|
20131
|
-
var _componentEvents;
|
|
20102
|
+
var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentState, sharedParentState);
|
|
20132
20103
|
|
|
20133
|
-
|
|
20134
|
-
|
|
20104
|
+
var parentPropsList = baseParentProps.parentControlledProps;
|
|
20105
|
+
var parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_4___default()(baseParentProps, parentPropsList) : {};
|
|
20135
20106
|
|
|
20136
|
-
|
|
20137
|
-
}
|
|
20138
|
-
}, {
|
|
20139
|
-
key: "getComponentProps",
|
|
20140
|
-
value: function getComponentProps(component, type, index) {
|
|
20141
|
-
var name = this.props.name || WrappedComponent.role;
|
|
20142
|
-
var key = this.dataKeys && this.dataKeys[index] || index;
|
|
20143
|
-
var id = "".concat(name, "-").concat(type, "-").concat(key);
|
|
20144
|
-
var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
|
|
20145
|
-
|
|
20146
|
-
if (!baseProps && !this.hasEvents) {
|
|
20147
|
-
return undefined;
|
|
20148
|
-
}
|
|
20107
|
+
var modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentProps, props);
|
|
20149
20108
|
|
|
20150
|
-
|
|
20151
|
-
|
|
20109
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
20110
|
+
}
|
|
20111
|
+
}, {
|
|
20112
|
+
key: "getAllEvents",
|
|
20113
|
+
value: function getAllEvents(props) {
|
|
20114
|
+
if (Array.isArray(this.componentEvents)) {
|
|
20115
|
+
var _componentEvents;
|
|
20152
20116
|
|
|
20153
|
-
|
|
20154
|
-
|
|
20155
|
-
key: id
|
|
20156
|
-
}, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
|
|
20157
|
-
id: id
|
|
20158
|
-
});
|
|
20117
|
+
return Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
|
|
20118
|
+
}
|
|
20159
20119
|
|
|
20160
|
-
|
|
20120
|
+
return props.events;
|
|
20121
|
+
}
|
|
20122
|
+
}, {
|
|
20123
|
+
key: "getComponentProps",
|
|
20124
|
+
value: function getComponentProps(component, type, index) {
|
|
20125
|
+
var name = this.props.name || WrappedComponent.role;
|
|
20126
|
+
var key = this.dataKeys && this.dataKeys[index] || index;
|
|
20127
|
+
var id = "".concat(name, "-").concat(type, "-").concat(key);
|
|
20128
|
+
var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
|
|
20129
|
+
|
|
20130
|
+
if (!baseProps && !this.hasEvents) {
|
|
20131
|
+
return undefined;
|
|
20132
|
+
}
|
|
20161
20133
|
|
|
20162
|
-
|
|
20163
|
-
|
|
20164
|
-
});
|
|
20165
|
-
}
|
|
20134
|
+
if (this.hasEvents) {
|
|
20135
|
+
var baseEvents = this.getEvents(this.props, type, key);
|
|
20166
20136
|
|
|
20167
|
-
|
|
20137
|
+
var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
|
|
20168
20138
|
index: index,
|
|
20169
20139
|
key: id
|
|
20170
|
-
}, component.props, baseProps, {
|
|
20140
|
+
}, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
|
|
20171
20141
|
id: id
|
|
20172
20142
|
});
|
|
20173
|
-
}
|
|
20174
|
-
}, {
|
|
20175
|
-
key: "renderContainer",
|
|
20176
|
-
value: function renderContainer(component, children) {
|
|
20177
|
-
var isContainer = component.type && component.type.role === "container";
|
|
20178
|
-
var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
|
|
20179
|
-
|
|
20180
|
-
if (parentProps.events) {
|
|
20181
|
-
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
|
|
20182
|
-
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
|
|
20183
|
-
}
|
|
20184
20143
|
|
|
20185
|
-
|
|
20144
|
+
var events = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _events__WEBPACK_IMPORTED_MODULE_11__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
|
|
20145
|
+
|
|
20146
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_7___default()({}, componentProps, {
|
|
20147
|
+
events: events
|
|
20148
|
+
});
|
|
20186
20149
|
}
|
|
20187
|
-
}, {
|
|
20188
|
-
key: "animateComponent",
|
|
20189
|
-
value: function animateComponent(props, defaultAnimationWhitelist) {
|
|
20190
|
-
var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
|
|
20191
|
-
return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
|
|
20192
|
-
animate: props.animate,
|
|
20193
|
-
animationWhitelist: animationWhitelist
|
|
20194
|
-
}, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
|
|
20195
|
-
} // Used by `VictoryLine` and `VictoryArea`
|
|
20196
|
-
|
|
20197
|
-
}, {
|
|
20198
|
-
key: "renderContinuousData",
|
|
20199
|
-
value: function renderContinuousData(props) {
|
|
20200
|
-
var _this8 = this;
|
|
20201
|
-
|
|
20202
|
-
var dataComponent = props.dataComponent,
|
|
20203
|
-
labelComponent = props.labelComponent,
|
|
20204
|
-
groupComponent = props.groupComponent;
|
|
20205
|
-
|
|
20206
|
-
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
|
|
20207
|
-
|
|
20208
|
-
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
20209
|
-
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
20210
|
-
|
|
20211
|
-
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
20212
|
-
memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
20213
|
-
}
|
|
20214
20150
|
|
|
20215
|
-
|
|
20216
|
-
|
|
20217
|
-
|
|
20218
|
-
|
|
20219
|
-
|
|
20151
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
|
|
20152
|
+
index: index,
|
|
20153
|
+
key: id
|
|
20154
|
+
}, component.props, baseProps, {
|
|
20155
|
+
id: id
|
|
20156
|
+
});
|
|
20157
|
+
}
|
|
20158
|
+
}, {
|
|
20159
|
+
key: "renderContainer",
|
|
20160
|
+
value: function renderContainer(component, children) {
|
|
20161
|
+
var isContainer = component.type && component.type.role === "container";
|
|
20162
|
+
var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
|
|
20163
|
+
|
|
20164
|
+
if (parentProps.events) {
|
|
20165
|
+
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
|
|
20166
|
+
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
|
|
20220
20167
|
}
|
|
20221
|
-
}, {
|
|
20222
|
-
key: "renderData",
|
|
20223
|
-
value: function renderData(props) {
|
|
20224
|
-
var _this9 = this;
|
|
20225
|
-
|
|
20226
|
-
var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
|
|
20227
|
-
var dataComponent = props.dataComponent,
|
|
20228
|
-
labelComponent = props.labelComponent,
|
|
20229
|
-
groupComponent = props.groupComponent;
|
|
20230
|
-
var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
|
|
20231
|
-
var dataProps = _this9.getComponentProps(dataComponent, "data", index);
|
|
20232
|
-
|
|
20233
|
-
if (shouldRenderDatum(dataProps.datum)) {
|
|
20234
|
-
validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
|
|
20235
|
-
}
|
|
20236
20168
|
|
|
20237
|
-
|
|
20238
|
-
|
|
20239
|
-
|
|
20240
|
-
|
|
20169
|
+
return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(component, parentProps, children);
|
|
20170
|
+
}
|
|
20171
|
+
}, {
|
|
20172
|
+
key: "animateComponent",
|
|
20173
|
+
value: function animateComponent(props, defaultAnimationWhitelist) {
|
|
20174
|
+
var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
|
|
20175
|
+
return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
|
|
20176
|
+
animate: props.animate,
|
|
20177
|
+
animationWhitelist: animationWhitelist
|
|
20178
|
+
}, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
|
|
20179
|
+
} // Used by `VictoryLine` and `VictoryArea`
|
|
20180
|
+
|
|
20181
|
+
}, {
|
|
20182
|
+
key: "renderContinuousData",
|
|
20183
|
+
value: function renderContinuousData(props) {
|
|
20184
|
+
var _this8 = this;
|
|
20185
|
+
|
|
20186
|
+
var dataComponent = props.dataComponent,
|
|
20187
|
+
labelComponent = props.labelComponent,
|
|
20188
|
+
groupComponent = props.groupComponent;
|
|
20189
|
+
|
|
20190
|
+
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
|
|
20191
|
+
|
|
20192
|
+
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
20193
|
+
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
20194
|
+
|
|
20195
|
+
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
20196
|
+
memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
20197
|
+
}
|
|
20241
20198
|
|
|
20242
|
-
|
|
20243
|
-
|
|
20244
|
-
|
|
20199
|
+
return memo;
|
|
20200
|
+
}, []);
|
|
20201
|
+
var dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
20202
|
+
var children = [react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
|
|
20203
|
+
return this.renderContainer(groupComponent, children);
|
|
20204
|
+
}
|
|
20205
|
+
}, {
|
|
20206
|
+
key: "renderData",
|
|
20207
|
+
value: function renderData(props) {
|
|
20208
|
+
var _this9 = this;
|
|
20209
|
+
|
|
20210
|
+
var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
|
|
20211
|
+
var dataComponent = props.dataComponent,
|
|
20212
|
+
labelComponent = props.labelComponent,
|
|
20213
|
+
groupComponent = props.groupComponent;
|
|
20214
|
+
var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
|
|
20215
|
+
var dataProps = _this9.getComponentProps(dataComponent, "data", index);
|
|
20216
|
+
|
|
20217
|
+
if (shouldRenderDatum(dataProps.datum)) {
|
|
20218
|
+
validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
|
|
20219
|
+
}
|
|
20245
20220
|
|
|
20246
|
-
|
|
20247
|
-
|
|
20221
|
+
return validDataComponents;
|
|
20222
|
+
}, []);
|
|
20223
|
+
var labelComponents = this.dataKeys.map(function (_dataKey, index) {
|
|
20224
|
+
var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
|
|
20248
20225
|
|
|
20249
|
-
|
|
20226
|
+
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
20227
|
+
return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps);
|
|
20228
|
+
}
|
|
20250
20229
|
|
|
20251
|
-
return
|
|
20252
|
-
}
|
|
20253
|
-
}]);
|
|
20230
|
+
return undefined;
|
|
20231
|
+
}).filter(Boolean);
|
|
20254
20232
|
|
|
20255
|
-
|
|
20256
|
-
|
|
20257
|
-
|
|
20233
|
+
var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
|
|
20234
|
+
|
|
20235
|
+
return this.renderContainer(groupComponent, children);
|
|
20236
|
+
}
|
|
20237
|
+
}]);
|
|
20238
|
+
|
|
20239
|
+
return addEvents;
|
|
20240
|
+
}(WrappedComponent);
|
|
20258
20241
|
});
|
|
20259
20242
|
|
|
20260
20243
|
/***/ }),
|
|
@@ -23658,9 +23641,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
23658
23641
|
|
|
23659
23642
|
|
|
23660
23643
|
|
|
23661
|
-
var Timer =
|
|
23662
|
-
/*#__PURE__*/
|
|
23663
|
-
function () {
|
|
23644
|
+
var Timer = /*#__PURE__*/function () {
|
|
23664
23645
|
function Timer() {
|
|
23665
23646
|
_classCallCheck(this, Timer);
|
|
23666
23647
|
|
package/es/victory-area.js
CHANGED
package/lib/victory-area.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-area",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.1.0",
|
|
4
4
|
"description": "Area Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"d3-shape": "^1.2.0",
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
24
|
"prop-types": "^15.5.8",
|
|
25
|
-
"victory-core": "^36.
|
|
25
|
+
"victory-core": "^36.1.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.6.0 || ^17.0.0"
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"version": "yarn run nps build-libs && nps build-dists"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "038cd9b70d9ce54ac6b861014165583760734c99"
|
|
35
35
|
}
|