victory-create-container 36.6.0 → 36.6.1

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # victory-create-container
2
2
 
3
+ ## 36.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`d1f281104`](https://github.com/FormidableLabs/victory/commit/d1f281104c7598c43e220dafd57546ab03daeeb5)]:
8
+ - victory-core@36.6.1
9
+ - victory-cursor-container@36.6.1
10
+ - victory-brush-container@36.6.1
11
+ - victory-selection-container@36.6.1
12
+ - victory-voronoi-container@36.6.1
13
+ - victory-zoom-container@36.6.1
14
+
3
15
  ## 36.6.0
4
16
 
5
17
  ### Patch Changes
@@ -16320,7 +16320,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
16320
16320
  var USER_PROPS_SAFELIST = {
16321
16321
  startsWith: ["data-", "aria-"],
16322
16322
  exactMatch: []
16323
- };
16323
+ }; // Normally we'd use Template Literal Types, but we're avoiding it to maximize TS compatibility with TS < 4.1
16324
+
16325
+ // `data-${string}` | `aria-${string}`;
16324
16326
 
16325
16327
  /**
16326
16328
  * doesPropStartWith: Function that takes a prop's key and runs it against all
@@ -16936,7 +16938,7 @@ function getCategories(props, childComponents, allStrings) {
16936
16938
  "use strict";
16937
16939
  __webpack_require__.r(__webpack_exports__);
16938
16940
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16939
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
16941
+ /* harmony export */ "CursorHelpers": () => (/* binding */ CursorHelpers)
16940
16942
  /* harmony export */ });
16941
16943
  /* harmony import */ var lodash_mapValues__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/mapValues */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/mapValues.js");
16942
16944
  /* harmony import */ var lodash_mapValues__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_mapValues__WEBPACK_IMPORTED_MODULE_0__);
@@ -16949,102 +16951,137 @@ __webpack_require__.r(__webpack_exports__);
16949
16951
 
16950
16952
 
16951
16953
 
16952
- 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; }
16954
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16953
16955
 
16954
- 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; }
16956
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
16955
16957
 
16956
- 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; }
16958
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16957
16959
 
16958
16960
 
16959
16961
  var ON_MOUSE_MOVE_THROTTLE_MS = 16;
16960
- var CursorHelpers = {
16961
- getDimension: function (props) {
16962
- var horizontal = props.horizontal,
16963
- cursorDimension = props.cursorDimension;
16964
16962
 
16965
- if (!horizontal || !cursorDimension) {
16966
- return cursorDimension;
16967
- }
16963
+ var CursorHelpersClass = /*#__PURE__*/function () {
16964
+ function CursorHelpersClass() {
16965
+ var _this = this;
16968
16966
 
16969
- return cursorDimension === "x" ? "y" : "x";
16970
- },
16971
- withinBounds: function (point, bounds) {
16972
- var _mapValues2 = lodash_mapValues__WEBPACK_IMPORTED_MODULE_0___default()(bounds, Number),
16973
- x1 = _mapValues2.x1,
16974
- x2 = _mapValues2.x2,
16975
- y1 = _mapValues2.y1,
16976
- y2 = _mapValues2.y2;
16967
+ _classCallCheck(this, CursorHelpersClass);
16977
16968
 
16978
- var _mapValues3 = lodash_mapValues__WEBPACK_IMPORTED_MODULE_0___default()(point, Number),
16979
- x = _mapValues3.x,
16980
- y = _mapValues3.y;
16969
+ this.handleMouseMove = function (evt, targetProps) {
16970
+ var onCursorChange = targetProps.onCursorChange,
16971
+ domain = targetProps.domain;
16981
16972
 
16982
- return x >= Math.min(x1, x2) && x <= Math.max(x1, x2) && y >= Math.min(y1, y2) && y <= Math.max(y1, y2);
16983
- },
16984
- onMouseMove: function (evt, targetProps) {
16985
- var onCursorChange = targetProps.onCursorChange,
16986
- domain = targetProps.domain;
16987
- var cursorDimension = this.getDimension(targetProps);
16988
- var parentSVG = targetProps.parentSVG || victory_core__WEBPACK_IMPORTED_MODULE_3__.getParentSVG(evt);
16989
- var cursorSVGPosition = victory_core__WEBPACK_IMPORTED_MODULE_3__.getSVGEventCoordinates(evt, parentSVG);
16990
- var cursorValue = victory_core__WEBPACK_IMPORTED_MODULE_3__.getDataCoordinates(targetProps, targetProps.scale, cursorSVGPosition.x, cursorSVGPosition.y);
16991
- var inBounds = this.withinBounds(cursorValue, {
16992
- x1: domain.x[0],
16993
- x2: domain.x[1],
16994
- y1: domain.y[0],
16995
- y2: domain.y[1]
16996
- });
16973
+ var cursorDimension = _this.getDimension(targetProps);
16997
16974
 
16998
- if (!inBounds) {
16999
- cursorValue = null;
17000
- }
16975
+ var parentSVG = targetProps.parentSVG || victory_core__WEBPACK_IMPORTED_MODULE_3__.getParentSVG(evt);
16976
+ var cursorSVGPosition = victory_core__WEBPACK_IMPORTED_MODULE_3__.getSVGEventCoordinates(evt, parentSVG);
16977
+ var cursorValue = victory_core__WEBPACK_IMPORTED_MODULE_3__.getDataCoordinates(targetProps, targetProps.scale, cursorSVGPosition.x, cursorSVGPosition.y);
16978
+
16979
+ var inBounds = _this.withinBounds(cursorValue, {
16980
+ x1: domain.x[0],
16981
+ x2: domain.x[1],
16982
+ y1: domain.y[0],
16983
+ y2: domain.y[1]
16984
+ });
17001
16985
 
17002
- if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_1___default()(onCursorChange)) {
17003
- if (inBounds) {
17004
- var value = cursorDimension ? cursorValue[cursorDimension] : cursorValue;
17005
- onCursorChange(value, targetProps);
17006
- } else if (cursorValue !== targetProps.cursorValue) {
17007
- onCursorChange(targetProps.defaultCursorValue || null, targetProps);
16986
+ if (!inBounds) {
16987
+ cursorValue = null;
17008
16988
  }
17009
- }
17010
16989
 
17011
- return [{
17012
- target: "parent",
17013
- eventKey: "parent",
17014
- mutation: function () {
17015
- return {
17016
- cursorValue: cursorValue,
17017
- parentSVG: parentSVG
17018
- };
16990
+ if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_1___default()(onCursorChange)) {
16991
+ if (cursorValue) {
16992
+ var value = cursorDimension ? cursorValue[cursorDimension] : cursorValue;
16993
+ onCursorChange(value, targetProps);
16994
+ } else if (cursorValue !== targetProps.cursorValue) {
16995
+ onCursorChange(targetProps.defaultCursorValue || null, targetProps);
16996
+ }
17019
16997
  }
17020
- }];
17021
- },
17022
- onTouchEnd: function (evt, targetProps) {
17023
- var onCursorChange = targetProps.onCursorChange;
17024
16998
 
17025
- if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_1___default()(targetProps.onCursorChange)) {
17026
- onCursorChange(null, targetProps);
17027
- }
16999
+ return [{
17000
+ target: "parent",
17001
+ eventKey: "parent",
17002
+ mutation: function () {
17003
+ return {
17004
+ cursorValue: cursorValue,
17005
+ parentSVG: parentSVG
17006
+ };
17007
+ }
17008
+ }];
17009
+ };
17028
17010
 
17029
- return [{
17030
- target: "parent",
17031
- eventKey: "parent",
17032
- mutation: function () {
17033
- return {
17034
- cursorValue: null
17035
- };
17011
+ this.onMouseMove = lodash_throttle__WEBPACK_IMPORTED_MODULE_2___default()(this.handleMouseMove, ON_MOUSE_MOVE_THROTTLE_MS, {
17012
+ leading: true,
17013
+ trailing: false
17014
+ });
17015
+ this.onMouseLeave = this.handleMouseMove;
17016
+
17017
+ this.onTouchEnd = function (evt, targetProps) {
17018
+ var onCursorChange = targetProps.onCursorChange;
17019
+
17020
+ if (lodash_isFunction__WEBPACK_IMPORTED_MODULE_1___default()(targetProps.onCursorChange)) {
17021
+ onCursorChange(null, targetProps);
17036
17022
  }
17037
- }];
17023
+
17024
+ return [{
17025
+ target: "parent",
17026
+ eventKey: "parent",
17027
+ mutation: function () {
17028
+ return {
17029
+ cursorValue: null
17030
+ };
17031
+ }
17032
+ }];
17033
+ };
17038
17034
  }
17039
- };
17040
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_objectSpread(_objectSpread({}, CursorHelpers), {}, {
17041
- onMouseMove: lodash_throttle__WEBPACK_IMPORTED_MODULE_2___default()(CursorHelpers.onMouseMove.bind(CursorHelpers), ON_MOUSE_MOVE_THROTTLE_MS, {
17042
- leading: true,
17043
- trailing: false
17044
- }),
17035
+
17036
+ _createClass(CursorHelpersClass, [{
17037
+ key: "getDimension",
17038
+ value: function getDimension(props) {
17039
+ var horizontal = props.horizontal,
17040
+ cursorDimension = props.cursorDimension;
17041
+
17042
+ if (!horizontal || !cursorDimension) {
17043
+ return cursorDimension;
17044
+ }
17045
+
17046
+ return cursorDimension === "x" ? "y" : "x";
17047
+ }
17048
+ }, {
17049
+ key: "withinBounds",
17050
+ value: function withinBounds(point, bounds) {
17051
+ var _mapValues2 = lodash_mapValues__WEBPACK_IMPORTED_MODULE_0___default()(bounds, Number),
17052
+ x1 = _mapValues2.x1,
17053
+ x2 = _mapValues2.x2,
17054
+ y1 = _mapValues2.y1,
17055
+ y2 = _mapValues2.y2;
17056
+
17057
+ var _mapValues3 = lodash_mapValues__WEBPACK_IMPORTED_MODULE_0___default()(point, Number),
17058
+ x = _mapValues3.x,
17059
+ y = _mapValues3.y;
17060
+
17061
+ return x >= Math.min(x1, x2) && x <= Math.max(x1, x2) && y >= Math.min(y1, y2) && y <= Math.max(y1, y2);
17062
+ }
17063
+ }]);
17064
+
17065
+ return CursorHelpersClass;
17066
+ }();
17067
+
17068
+ var CursorHelpers = new CursorHelpersClass();
17069
+ /* {
17070
+ ...CursorHelpers,
17071
+ onMouseMove: throttle(
17072
+ CursorHelpers.onMouseMove.bind(CursorHelpers),
17073
+ ON_MOUSE_MOVE_THROTTLE_MS,
17074
+ {
17075
+ leading: true,
17076
+ trailing: false,
17077
+ },
17078
+ ),
17045
17079
  onMouseLeave: CursorHelpers.onMouseMove.bind(CursorHelpers),
17046
- onTouchEnd: CursorHelpers.onTouchEnd.bind(CursorHelpers)
17047
- }));
17080
+ onTouchEnd: CursorHelpers.onTouchEnd.bind(CursorHelpers),
17081
+ };
17082
+
17083
+
17084
+ */
17048
17085
  //# sourceMappingURL=cursor-helpers.js.map
17049
17086
 
17050
17087
  /***/ }),
@@ -17058,8 +17095,8 @@ var CursorHelpers = {
17058
17095
  "use strict";
17059
17096
  __webpack_require__.r(__webpack_exports__);
17060
17097
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17061
- /* harmony export */ "cursorContainerMixin": () => (/* binding */ cursorContainerMixin),
17062
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
17098
+ /* harmony export */ "VictoryCursorContainer": () => (/* binding */ VictoryCursorContainer),
17099
+ /* harmony export */ "cursorContainerMixin": () => (/* binding */ cursorContainerMixin)
17063
17100
  /* harmony export */ });
17064
17101
  /* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js");
17065
17102
  /* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isObject__WEBPACK_IMPORTED_MODULE_0__);
@@ -17122,11 +17159,12 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
17122
17159
 
17123
17160
 
17124
17161
 
17125
- var cursorContainerMixin = function (base) {
17162
+ function cursorContainerMixin(Base) {
17126
17163
  var _class;
17127
17164
 
17128
- return _class = /*#__PURE__*/function (_base) {
17129
- _inherits(VictoryCursorContainer, _base);
17165
+ // @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
17166
+ return _class = /*#__PURE__*/function (_Base) {
17167
+ _inherits(VictoryCursorContainer, _Base);
17130
17168
 
17131
17169
  var _super = _createSuper(VictoryCursorContainer);
17132
17170
 
@@ -17196,7 +17234,7 @@ var cursorContainerMixin = function (base) {
17196
17234
  name = props.name,
17197
17235
  horizontal = props.horizontal,
17198
17236
  theme = props.theme;
17199
- var cursorDimension = _cursor_helpers__WEBPACK_IMPORTED_MODULE_5__["default"].getDimension(props);
17237
+ var cursorDimension = _cursor_helpers__WEBPACK_IMPORTED_MODULE_5__.CursorHelpers.getDimension(props);
17200
17238
  var cursorValue = this.getCursorPosition(props);
17201
17239
  var cursorLabelOffset = this.getCursorLabelOffset(props);
17202
17240
 
@@ -17269,7 +17307,7 @@ var cursorContainerMixin = function (base) {
17269
17307
  }]);
17270
17308
 
17271
17309
  return VictoryCursorContainer;
17272
- }(base), _class.displayName = "VictoryCursorContainer", _class.propTypes = _objectSpread(_objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE_6__.VictoryContainer.propTypes), {}, {
17310
+ }(Base), _class.displayName = "VictoryCursorContainer", _class.propTypes = _objectSpread(_objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE_6__.VictoryContainer.propTypes), {}, {
17273
17311
  cursorDimension: prop_types__WEBPACK_IMPORTED_MODULE_7___default().oneOf(["x", "y"]),
17274
17312
  cursorLabel: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func),
17275
17313
  cursorLabelComponent: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().element),
@@ -17295,22 +17333,22 @@ var cursorContainerMixin = function (base) {
17295
17333
  target: "parent",
17296
17334
  eventHandlers: {
17297
17335
  onMouseLeave: function (evt, targetProps) {
17298
- return props.disable ? {} : _cursor_helpers__WEBPACK_IMPORTED_MODULE_5__["default"].onMouseLeave(evt, targetProps);
17336
+ return props.disable ? {} : _cursor_helpers__WEBPACK_IMPORTED_MODULE_5__.CursorHelpers.onMouseLeave(evt, targetProps);
17299
17337
  },
17300
17338
  onTouchCancel: function () {
17301
17339
  return [];
17302
17340
  },
17303
17341
  onMouseMove: function (evt, targetProps) {
17304
- return props.disable ? {} : _cursor_helpers__WEBPACK_IMPORTED_MODULE_5__["default"].onMouseMove(evt, targetProps);
17342
+ return props.disable ? {} : _cursor_helpers__WEBPACK_IMPORTED_MODULE_5__.CursorHelpers.onMouseMove(evt, targetProps);
17305
17343
  },
17306
17344
  onTouchMove: function (evt, targetProps) {
17307
- return props.disable ? {} : _cursor_helpers__WEBPACK_IMPORTED_MODULE_5__["default"].onMouseMove(evt, targetProps);
17345
+ return props.disable ? {} : _cursor_helpers__WEBPACK_IMPORTED_MODULE_5__.CursorHelpers.onMouseMove(evt, targetProps);
17308
17346
  }
17309
17347
  }
17310
17348
  }];
17311
17349
  }, _class;
17312
- };
17313
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cursorContainerMixin(victory_core__WEBPACK_IMPORTED_MODULE_6__.VictoryContainer));
17350
+ }
17351
+ var VictoryCursorContainer = cursorContainerMixin(victory_core__WEBPACK_IMPORTED_MODULE_6__.VictoryContainer);
17314
17352
  //# sourceMappingURL=victory-cursor-container.js.map
17315
17353
 
17316
17354
  /***/ }),