victory-stack
Advanced tools
Comparing version 31.1.0 to 31.2.0
@@ -0,1 +1,2 @@ | ||
import _isEmpty from "lodash/isEmpty"; | ||
import _defaults from "lodash/defaults"; | ||
@@ -25,2 +26,3 @@ import _assign from "lodash/assign"; | ||
import { getChildren, getCalculatedProps } from "./helper-methods"; | ||
import isEqual from "react-fast-compare"; | ||
var fallbackProps = { | ||
@@ -51,3 +53,2 @@ width: 450, | ||
_this.setAnimationState = Wrapper.setAnimationState.bind(_assertThisInitialized(_this)); | ||
_this.events = Wrapper.getAllEvents(props); | ||
} | ||
@@ -59,16 +60,13 @@ | ||
_createClass(VictoryStack, [{ | ||
key: "componentWillMount", | ||
value: function componentWillMount() { | ||
this.events = Wrapper.getAllEvents(this.props); | ||
} | ||
}, { | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(nextProps) { | ||
key: "shouldComponentUpdate", | ||
value: function shouldComponentUpdate(nextProps) { | ||
if (this.props.animate) { | ||
this.setAnimationState(this.props, nextProps); | ||
if (!isEqual(this.props, nextProps)) { | ||
this.setAnimationState(this.props, nextProps); | ||
return false; | ||
} | ||
} | ||
this.events = Wrapper.getAllEvents(nextProps); | ||
} // the old ones were bad | ||
return true; | ||
} | ||
}, { | ||
@@ -138,8 +136,9 @@ key: "getNewChildren", | ||
var container = standalone ? this.renderContainer(containerComponent, containerProps) : groupComponent; | ||
var events = Wrapper.getAllEvents(props); | ||
if (this.events) { | ||
if (!_isEmpty(events)) { | ||
return React.createElement(VictorySharedEvents, { | ||
container: container, | ||
eventKey: eventKey, | ||
events: this.events, | ||
events: events, | ||
externalEventMutations: externalEventMutations | ||
@@ -146,0 +145,0 @@ }, newChildren); |
@@ -8,2 +8,4 @@ "use strict"; | ||
var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty")); | ||
var _defaults2 = _interopRequireDefault(require("lodash/defaults")); | ||
@@ -23,2 +25,4 @@ | ||
var _reactFastCompare = _interopRequireDefault(require("react-fast-compare")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -67,3 +71,2 @@ | ||
_this.setAnimationState = _victoryCore.Wrapper.setAnimationState.bind(_assertThisInitialized(_this)); | ||
_this.events = _victoryCore.Wrapper.getAllEvents(props); | ||
} | ||
@@ -75,16 +78,13 @@ | ||
_createClass(VictoryStack, [{ | ||
key: "componentWillMount", | ||
value: function componentWillMount() { | ||
this.events = _victoryCore.Wrapper.getAllEvents(this.props); | ||
} | ||
}, { | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(nextProps) { | ||
key: "shouldComponentUpdate", | ||
value: function shouldComponentUpdate(nextProps) { | ||
if (this.props.animate) { | ||
this.setAnimationState(this.props, nextProps); | ||
if (!(0, _reactFastCompare.default)(this.props, nextProps)) { | ||
this.setAnimationState(this.props, nextProps); | ||
return false; | ||
} | ||
} | ||
this.events = _victoryCore.Wrapper.getAllEvents(nextProps); | ||
} // the old ones were bad | ||
return true; | ||
} | ||
}, { | ||
@@ -159,7 +159,9 @@ key: "getNewChildren", | ||
if (this.events) { | ||
var events = _victoryCore.Wrapper.getAllEvents(props); | ||
if (!(0, _isEmpty2.default)(events)) { | ||
return _react.default.createElement(_victorySharedEvents.VictorySharedEvents, { | ||
container: container, | ||
eventKey: eventKey, | ||
events: this.events, | ||
events: events, | ||
externalEventMutations: externalEventMutations | ||
@@ -166,0 +168,0 @@ }, newChildren); |
{ | ||
"name": "victory-stack", | ||
"version": "31.1.0", | ||
"version": "31.2.0", | ||
"description": "Stack Layout Component for Victory", | ||
@@ -24,3 +24,4 @@ "keywords": [ | ||
"prop-types": "^15.5.8", | ||
"victory-core": "^31.1.0" | ||
"react-fast-compare": "^2.0.0", | ||
"victory-core": "^31.2.0" | ||
}, | ||
@@ -27,0 +28,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
import { assign, defaults } from "lodash"; | ||
import { assign, defaults, isEmpty } from "lodash"; | ||
import PropTypes from "prop-types"; | ||
@@ -7,2 +7,3 @@ import React from "react"; | ||
import { getChildren, getCalculatedProps } from "./helper-methods"; | ||
import isEqual from "react-fast-compare"; | ||
@@ -77,18 +78,15 @@ const fallbackProps = { | ||
this.setAnimationState = Wrapper.setAnimationState.bind(this); | ||
this.events = Wrapper.getAllEvents(props); | ||
} | ||
} | ||
componentWillMount() { | ||
this.events = Wrapper.getAllEvents(this.props); | ||
} | ||
componentWillReceiveProps(nextProps) { | ||
shouldComponentUpdate(nextProps) { | ||
if (this.props.animate) { | ||
this.setAnimationState(this.props, nextProps); | ||
if (!isEqual(this.props, nextProps)) { | ||
this.setAnimationState(this.props, nextProps); | ||
return false; | ||
} | ||
} | ||
this.events = Wrapper.getAllEvents(nextProps); | ||
return true; | ||
} | ||
// the old ones were bad | ||
getNewChildren(props, childComponents, calculatedProps) { | ||
@@ -145,3 +143,4 @@ const children = getChildren(props, childComponents, calculatedProps); | ||
: groupComponent; | ||
if (this.events) { | ||
const events = Wrapper.getAllEvents(props); | ||
if (!isEmpty(events)) { | ||
return ( | ||
@@ -151,3 +150,3 @@ <VictorySharedEvents | ||
eventKey={eventKey} | ||
events={this.events} | ||
events={events} | ||
externalEventMutations={externalEventMutations} | ||
@@ -154,0 +153,0 @@ > |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1215556
21956
4
+ Addedreact-fast-compare@^2.0.0
Updatedvictory-core@^31.2.0