victory-brush-container
Advanced tools
Comparing version 30.4.0 to 30.4.1
@@ -56,2 +56,3 @@ import _defaults from "lodash/defaults"; | ||
var brushComponentStyle = brushComponent.props && brushComponent.props.style; | ||
var cursor = !props.allowDrag && !props.allowResize ? "auto" : "move"; | ||
return x[0] !== x[1] && y[0] !== y[1] ? React.cloneElement(brushComponent, { | ||
@@ -63,3 +64,3 @@ key: "".concat(name, "-brush"), | ||
y: Math.min(y[0], y[1]), | ||
cursor: "move", | ||
cursor: cursor, | ||
style: _defaults({}, brushComponentStyle, brushStyle) | ||
@@ -69,2 +70,20 @@ }) : null; | ||
}, { | ||
key: "getCursorPointers", | ||
value: function getCursorPointers(props) { | ||
var cursors = { | ||
"yProps": "ns-resize", | ||
"xProps": "ew-resize" | ||
}; | ||
if (!props.allowResize && props.allowDrag) { | ||
cursors.xProps = "move"; | ||
cursors.yProps = "move"; | ||
} else if (!props.allowResize && !props.allowDrag) { | ||
cursors.xProps = "auto"; | ||
cursors.yProps = "auto"; | ||
} | ||
return cursors; | ||
} | ||
}, { | ||
key: "getHandles", | ||
@@ -85,2 +104,3 @@ value: function getHandles(props, coordinates) { | ||
var cursors = this.getCursorPointers(props); | ||
var yProps = { | ||
@@ -90,3 +110,3 @@ style: style, | ||
height: handleWidth, | ||
cursor: "ns-resize" | ||
cursor: cursors.yProps | ||
}; | ||
@@ -97,3 +117,3 @@ var xProps = { | ||
height: height, | ||
cursor: "ew-resize" | ||
cursor: cursors.xProps | ||
}; | ||
@@ -100,0 +120,0 @@ var handleProps = { |
@@ -71,2 +71,3 @@ "use strict"; | ||
var brushComponentStyle = brushComponent.props && brushComponent.props.style; | ||
var cursor = !props.allowDrag && !props.allowResize ? "auto" : "move"; | ||
return x[0] !== x[1] && y[0] !== y[1] ? _react.default.cloneElement(brushComponent, { | ||
@@ -78,3 +79,3 @@ key: "".concat(name, "-brush"), | ||
y: Math.min(y[0], y[1]), | ||
cursor: "move", | ||
cursor: cursor, | ||
style: (0, _defaults2.default)({}, brushComponentStyle, brushStyle) | ||
@@ -84,2 +85,20 @@ }) : null; | ||
}, { | ||
key: "getCursorPointers", | ||
value: function getCursorPointers(props) { | ||
var cursors = { | ||
"yProps": "ns-resize", | ||
"xProps": "ew-resize" | ||
}; | ||
if (!props.allowResize && props.allowDrag) { | ||
cursors.xProps = "move"; | ||
cursors.yProps = "move"; | ||
} else if (!props.allowResize && !props.allowDrag) { | ||
cursors.xProps = "auto"; | ||
cursors.yProps = "auto"; | ||
} | ||
return cursors; | ||
} | ||
}, { | ||
key: "getHandles", | ||
@@ -98,2 +117,3 @@ value: function getHandles(props, coordinates) { | ||
var style = (0, _defaults2.default)({}, handleComponentStyle, handleStyle); | ||
var cursors = this.getCursorPointers(props); | ||
var yProps = { | ||
@@ -103,3 +123,3 @@ style: style, | ||
height: handleWidth, | ||
cursor: "ns-resize" | ||
cursor: cursors.yProps | ||
}; | ||
@@ -110,3 +130,3 @@ var xProps = { | ||
height: height, | ||
cursor: "ew-resize" | ||
cursor: cursors.xProps | ||
}; | ||
@@ -113,0 +133,0 @@ var handleProps = { |
{ | ||
"name": "victory-brush-container", | ||
"version": "30.4.0", | ||
"version": "30.4.1", | ||
"description": "Interactive Brush Component for Victory", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -86,2 +86,3 @@ import PropTypes from "prop-types"; | ||
const brushComponentStyle = brushComponent.props && brushComponent.props.style; | ||
const cursor = !props.allowDrag && !props.allowResize ? "auto" : "move"; | ||
return x[0] !== x[1] && y[0] !== y[1] ? | ||
@@ -94,3 +95,3 @@ React.cloneElement(brushComponent, { | ||
y: Math.min(y[0], y[1]), | ||
cursor: "move", | ||
cursor, | ||
style: defaults({}, brushComponentStyle, brushStyle) | ||
@@ -100,2 +101,17 @@ }) : null; | ||
getCursorPointers(props) { | ||
const cursors = { | ||
"yProps": "ns-resize", | ||
"xProps": "ew-resize" | ||
}; | ||
if (!props.allowResize && props.allowDrag) { | ||
cursors.xProps = "move"; | ||
cursors.yProps = "move"; | ||
} else if (!props.allowResize && !props.allowDrag) { | ||
cursors.xProps = "auto"; | ||
cursors.yProps = "auto"; | ||
} | ||
return cursors; | ||
} | ||
getHandles(props, coordinates) { | ||
@@ -108,4 +124,7 @@ const { brushDimension, handleWidth, handleStyle, handleComponent, name } = props; | ||
const style = defaults({}, handleComponentStyle, handleStyle); | ||
const yProps = { style, width, height: handleWidth, cursor: "ns-resize" }; | ||
const xProps = { style, width: handleWidth, height, cursor: "ew-resize" }; | ||
const cursors = this.getCursorPointers(props); | ||
const yProps = { style, width, height: handleWidth, cursor: cursors.yProps }; | ||
const xProps = { style, width: handleWidth, height, cursor: cursors.xProps }; | ||
const handleProps = { | ||
@@ -112,0 +131,0 @@ top: brushDimension !== "x" && assign({ x: x[0], y: y[1] - (handleWidth / 2) }, yProps), |
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
1220057
22510