victory-selection-container
Advanced tools
Comparing version 36.3.2 to 36.4.0
@@ -7,14 +7,20 @@ import _includes from "lodash/includes"; | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
import { Selection, Data, Helpers } from "victory-core"; | ||
@@ -51,3 +57,3 @@ import React from "react"; | ||
} else if (child.type && _isFunction(child.type.getData)) { | ||
child = parent ? React.cloneElement(child, parent.props) : child; | ||
child = parent ? /*#__PURE__*/React.cloneElement(child, parent.props) : child; | ||
var childData = child.props && child.type.getData(child.props); | ||
@@ -257,3 +263,3 @@ return childData ? { | ||
}; | ||
export default _objectSpread({}, SelectionHelpers, { | ||
export default _objectSpread(_objectSpread({}, SelectionHelpers), {}, { | ||
onMouseDown: SelectionHelpers.onMouseDown.bind(SelectionHelpers), | ||
@@ -260,0 +266,0 @@ onMouseUp: SelectionHelpers.onMouseUp.bind(SelectionHelpers), |
@@ -1,13 +0,17 @@ | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -17,10 +21,20 @@ | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
import PropTypes from "prop-types"; | ||
@@ -31,13 +45,13 @@ import React from "react"; | ||
export var selectionContainerMixin = function (base) { | ||
var _class, _temp; | ||
var _class; | ||
return _temp = _class = | ||
/*#__PURE__*/ | ||
function (_base) { | ||
return _class = /*#__PURE__*/function (_base) { | ||
_inherits(VictorySelectionContainer, _base); | ||
var _super = _createSuper(VictorySelectionContainer); | ||
function VictorySelectionContainer() { | ||
_classCallCheck(this, VictorySelectionContainer); | ||
return _possibleConstructorReturn(this, (VictorySelectionContainer.__proto__ || Object.getPrototypeOf(VictorySelectionContainer)).apply(this, arguments)); | ||
return _super.apply(this, arguments); | ||
} | ||
@@ -59,3 +73,3 @@ | ||
var y = Math.min(y1, y2); | ||
return y2 && x2 && x1 && y1 ? React.cloneElement(selectionComponent, { | ||
return y2 && x2 && x1 && y1 ? /*#__PURE__*/React.cloneElement(selectionComponent, { | ||
key: "".concat(name, "-selection"), | ||
@@ -73,3 +87,3 @@ x: x, | ||
value: function getChildren(props) { | ||
return _toConsumableArray(React.Children.toArray(props.children)).concat([this.getRect(props)]); | ||
return [].concat(_toConsumableArray(React.Children.toArray(props.children)), [this.getRect(props)]); | ||
} | ||
@@ -79,67 +93,47 @@ }]); | ||
return VictorySelectionContainer; | ||
}(base), Object.defineProperty(_class, "displayName", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: "VictorySelectionContainer" | ||
}), Object.defineProperty(_class, "propTypes", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: _objectSpread({}, VictoryContainer.propTypes, { | ||
activateSelectedData: PropTypes.bool, | ||
allowSelection: PropTypes.bool, | ||
disable: PropTypes.bool, | ||
onSelection: PropTypes.func, | ||
onSelectionCleared: PropTypes.func, | ||
selectionBlacklist: PropTypes.arrayOf(PropTypes.string), | ||
selectionComponent: PropTypes.element, | ||
selectionDimension: PropTypes.oneOf(["x", "y"]), | ||
selectionStyle: PropTypes.object | ||
}) | ||
}), Object.defineProperty(_class, "defaultProps", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: _objectSpread({}, VictoryContainer.defaultProps, { | ||
activateSelectedData: true, | ||
allowSelection: true, | ||
selectionComponent: React.createElement(Rect, null), | ||
selectionStyle: { | ||
stroke: "transparent", | ||
fill: "black", | ||
fillOpacity: 0.1 | ||
}(base), _defineProperty(_class, "displayName", "VictorySelectionContainer"), _defineProperty(_class, "propTypes", _objectSpread(_objectSpread({}, VictoryContainer.propTypes), {}, { | ||
activateSelectedData: PropTypes.bool, | ||
allowSelection: PropTypes.bool, | ||
disable: PropTypes.bool, | ||
onSelection: PropTypes.func, | ||
onSelectionCleared: PropTypes.func, | ||
selectionBlacklist: PropTypes.arrayOf(PropTypes.string), | ||
selectionComponent: PropTypes.element, | ||
selectionDimension: PropTypes.oneOf(["x", "y"]), | ||
selectionStyle: PropTypes.object | ||
})), _defineProperty(_class, "defaultProps", _objectSpread(_objectSpread({}, VictoryContainer.defaultProps), {}, { | ||
activateSelectedData: true, | ||
allowSelection: true, | ||
selectionComponent: /*#__PURE__*/React.createElement(Rect, null), | ||
selectionStyle: { | ||
stroke: "transparent", | ||
fill: "black", | ||
fillOpacity: 0.1 | ||
} | ||
})), _defineProperty(_class, "defaultEvents", function (props) { | ||
return [{ | ||
target: "parent", | ||
eventHandlers: { | ||
onMouseDown: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseDown(evt, targetProps); | ||
}, | ||
onTouchStart: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseDown(evt, targetProps); | ||
}, | ||
onMouseMove: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseMove(evt, targetProps); | ||
}, | ||
onTouchMove: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseMove(evt, targetProps); | ||
}, | ||
onMouseUp: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseUp(evt, targetProps); | ||
}, | ||
onTouchEnd: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseUp(evt, targetProps); | ||
} | ||
} | ||
}) | ||
}), Object.defineProperty(_class, "defaultEvents", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: function (props) { | ||
return [{ | ||
target: "parent", | ||
eventHandlers: { | ||
onMouseDown: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseDown(evt, targetProps); | ||
}, | ||
onTouchStart: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseDown(evt, targetProps); | ||
}, | ||
onMouseMove: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseMove(evt, targetProps); | ||
}, | ||
onTouchMove: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseMove(evt, targetProps); | ||
}, | ||
onMouseUp: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseUp(evt, targetProps); | ||
}, | ||
onTouchEnd: function (evt, targetProps) { | ||
return props.disable ? {} : SelectionHelpers.onMouseUp(evt, targetProps); | ||
} | ||
} | ||
}]; | ||
} | ||
}), _temp; | ||
}]; | ||
}), _class; | ||
}; | ||
export default selectionContainerMixin(VictoryContainer); |
@@ -6,6 +6,6 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "selectionContainerMixin", { | ||
Object.defineProperty(exports, "SelectionHelpers", { | ||
enumerable: true, | ||
get: function () { | ||
return _victorySelectionContainer.selectionContainerMixin; | ||
return _selectionHelpers.default; | ||
} | ||
@@ -19,6 +19,6 @@ }); | ||
}); | ||
Object.defineProperty(exports, "SelectionHelpers", { | ||
Object.defineProperty(exports, "selectionContainerMixin", { | ||
enumerable: true, | ||
get: function () { | ||
return _selectionHelpers.default; | ||
return _victorySelectionContainer.selectionContainerMixin; | ||
} | ||
@@ -33,2 +33,4 @@ }); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } |
@@ -24,14 +24,20 @@ "use strict"; | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
var SelectionHelpers = { | ||
@@ -67,3 +73,3 @@ getDimension: function (props) { | ||
} else if (child.type && (0, _isFunction2.default)(child.type.getData)) { | ||
child = parent ? _react.default.cloneElement(child, parent.props) : child; | ||
child = parent ? /*#__PURE__*/_react.default.cloneElement(child, parent.props) : child; | ||
var childData = child.props && child.type.getData(child.props); | ||
@@ -278,3 +284,3 @@ return childData ? { | ||
var _default = _objectSpread({}, SelectionHelpers, { | ||
var _default = _objectSpread(_objectSpread({}, SelectionHelpers), {}, { | ||
onMouseDown: SelectionHelpers.onMouseDown.bind(SelectionHelpers), | ||
@@ -281,0 +287,0 @@ onMouseUp: SelectionHelpers.onMouseUp.bind(SelectionHelpers), |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.default = exports.selectionContainerMixin = void 0; | ||
exports.selectionContainerMixin = exports.default = void 0; | ||
@@ -19,14 +19,18 @@ var _propTypes = _interopRequireDefault(require("prop-types")); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -36,22 +40,32 @@ | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var selectionContainerMixin = function (base) { | ||
var _class, _temp; | ||
var _class; | ||
return _temp = _class = | ||
/*#__PURE__*/ | ||
function (_base) { | ||
return _class = /*#__PURE__*/function (_base) { | ||
_inherits(VictorySelectionContainer, _base); | ||
var _super = _createSuper(VictorySelectionContainer); | ||
function VictorySelectionContainer() { | ||
_classCallCheck(this, VictorySelectionContainer); | ||
return _possibleConstructorReturn(this, (VictorySelectionContainer.__proto__ || Object.getPrototypeOf(VictorySelectionContainer)).apply(this, arguments)); | ||
return _super.apply(this, arguments); | ||
} | ||
@@ -73,3 +87,3 @@ | ||
var y = Math.min(y1, y2); | ||
return y2 && x2 && x1 && y1 ? _react.default.cloneElement(selectionComponent, { | ||
return y2 && x2 && x1 && y1 ? /*#__PURE__*/_react.default.cloneElement(selectionComponent, { | ||
key: "".concat(name, "-selection"), | ||
@@ -87,3 +101,3 @@ x: x, | ||
value: function getChildren(props) { | ||
return _toConsumableArray(_react.default.Children.toArray(props.children)).concat([this.getRect(props)]); | ||
return [].concat(_toConsumableArray(_react.default.Children.toArray(props.children)), [this.getRect(props)]); | ||
} | ||
@@ -93,66 +107,46 @@ }]); | ||
return VictorySelectionContainer; | ||
}(base), Object.defineProperty(_class, "displayName", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: "VictorySelectionContainer" | ||
}), Object.defineProperty(_class, "propTypes", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: _objectSpread({}, _victoryCore.VictoryContainer.propTypes, { | ||
activateSelectedData: _propTypes.default.bool, | ||
allowSelection: _propTypes.default.bool, | ||
disable: _propTypes.default.bool, | ||
onSelection: _propTypes.default.func, | ||
onSelectionCleared: _propTypes.default.func, | ||
selectionBlacklist: _propTypes.default.arrayOf(_propTypes.default.string), | ||
selectionComponent: _propTypes.default.element, | ||
selectionDimension: _propTypes.default.oneOf(["x", "y"]), | ||
selectionStyle: _propTypes.default.object | ||
}) | ||
}), Object.defineProperty(_class, "defaultProps", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: _objectSpread({}, _victoryCore.VictoryContainer.defaultProps, { | ||
activateSelectedData: true, | ||
allowSelection: true, | ||
selectionComponent: _react.default.createElement(_victoryCore.Rect, null), | ||
selectionStyle: { | ||
stroke: "transparent", | ||
fill: "black", | ||
fillOpacity: 0.1 | ||
}(base), _defineProperty(_class, "displayName", "VictorySelectionContainer"), _defineProperty(_class, "propTypes", _objectSpread(_objectSpread({}, _victoryCore.VictoryContainer.propTypes), {}, { | ||
activateSelectedData: _propTypes.default.bool, | ||
allowSelection: _propTypes.default.bool, | ||
disable: _propTypes.default.bool, | ||
onSelection: _propTypes.default.func, | ||
onSelectionCleared: _propTypes.default.func, | ||
selectionBlacklist: _propTypes.default.arrayOf(_propTypes.default.string), | ||
selectionComponent: _propTypes.default.element, | ||
selectionDimension: _propTypes.default.oneOf(["x", "y"]), | ||
selectionStyle: _propTypes.default.object | ||
})), _defineProperty(_class, "defaultProps", _objectSpread(_objectSpread({}, _victoryCore.VictoryContainer.defaultProps), {}, { | ||
activateSelectedData: true, | ||
allowSelection: true, | ||
selectionComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Rect, null), | ||
selectionStyle: { | ||
stroke: "transparent", | ||
fill: "black", | ||
fillOpacity: 0.1 | ||
} | ||
})), _defineProperty(_class, "defaultEvents", function (props) { | ||
return [{ | ||
target: "parent", | ||
eventHandlers: { | ||
onMouseDown: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseDown(evt, targetProps); | ||
}, | ||
onTouchStart: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseDown(evt, targetProps); | ||
}, | ||
onMouseMove: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseMove(evt, targetProps); | ||
}, | ||
onTouchMove: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseMove(evt, targetProps); | ||
}, | ||
onMouseUp: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseUp(evt, targetProps); | ||
}, | ||
onTouchEnd: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseUp(evt, targetProps); | ||
} | ||
} | ||
}) | ||
}), Object.defineProperty(_class, "defaultEvents", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: function (props) { | ||
return [{ | ||
target: "parent", | ||
eventHandlers: { | ||
onMouseDown: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseDown(evt, targetProps); | ||
}, | ||
onTouchStart: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseDown(evt, targetProps); | ||
}, | ||
onMouseMove: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseMove(evt, targetProps); | ||
}, | ||
onTouchMove: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseMove(evt, targetProps); | ||
}, | ||
onMouseUp: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseUp(evt, targetProps); | ||
}, | ||
onTouchEnd: function (evt, targetProps) { | ||
return props.disable ? {} : _selectionHelpers.default.onMouseUp(evt, targetProps); | ||
} | ||
} | ||
}]; | ||
} | ||
}), _temp; | ||
}]; | ||
}), _class; | ||
}; | ||
@@ -159,0 +153,0 @@ |
{ | ||
"name": "victory-selection-container", | ||
"version": "36.3.2", | ||
"version": "36.4.0", | ||
"description": "Interactive Selection Component for Victory", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
"prop-types": "^15.5.8", | ||
"victory-core": "^36.3.2" | ||
"victory-core": "^36.4.0" | ||
}, | ||
@@ -34,3 +34,3 @@ "peerDependencies": { | ||
"sideEffects": false, | ||
"gitHead": "18895d1290245732d14332bbbda10336032c9aab" | ||
"gitHead": "2e05481eeb34f9801a90023a131a21aa7deff082" | ||
} |
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
0
711089
13715
Updatedvictory-core@^36.4.0