victory-core 37.3.0 → 37.3.2

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/victory-core.js +13 -34
  3. package/dist/victory-core.min.js +1 -1
  4. package/es/victory-animation/util.js +1 -1
  5. package/es/victory-container/victory-container.js +3 -3
  6. package/es/victory-theme/types.d.ts +2 -1
  7. package/es/victory-transition/victory-transition.js +1 -1
  8. package/es/victory-util/add-events.js +1 -1
  9. package/es/victory-util/axis.js +1 -1
  10. package/es/victory-util/data.js +0 -4
  11. package/es/victory-util/domain.js +0 -3
  12. package/es/victory-util/events.d.ts +1 -1
  13. package/es/victory-util/events.js +3 -9
  14. package/es/victory-util/helpers.js +0 -1
  15. package/es/victory-util/label-helpers.js +0 -1
  16. package/es/victory-util/merge-refs.d.ts +1 -1
  17. package/es/victory-util/scale.js +0 -1
  18. package/es/victory-util/transitions.js +3 -7
  19. package/es/victory-util/type-helpers.js +1 -1
  20. package/es/victory-util/wrapper.js +0 -1
  21. package/lib/victory-animation/util.js +1 -1
  22. package/lib/victory-container/victory-container.js +3 -3
  23. package/lib/victory-theme/types.d.ts +2 -1
  24. package/lib/victory-transition/victory-transition.js +1 -1
  25. package/lib/victory-util/add-events.js +1 -1
  26. package/lib/victory-util/axis.js +1 -1
  27. package/lib/victory-util/data.js +0 -5
  28. package/lib/victory-util/domain.js +0 -4
  29. package/lib/victory-util/events.d.ts +1 -1
  30. package/lib/victory-util/events.js +3 -10
  31. package/lib/victory-util/helpers.js +0 -2
  32. package/lib/victory-util/label-helpers.js +0 -2
  33. package/lib/victory-util/merge-refs.d.ts +1 -1
  34. package/lib/victory-util/scale.js +0 -2
  35. package/lib/victory-util/transitions.js +3 -7
  36. package/lib/victory-util/type-helpers.js +1 -1
  37. package/lib/victory-util/wrapper.js +0 -1
  38. package/package.json +6 -10
  39. package/src/victory-animation/util.ts +1 -1
  40. package/src/victory-container/victory-container.tsx +3 -3
  41. package/src/victory-primitives/point.tsx +2 -2
  42. package/src/victory-theme/types.ts +2 -1
  43. package/src/victory-transition/victory-transition.tsx +1 -1
  44. package/src/victory-util/add-events.tsx +1 -1
  45. package/src/victory-util/axis.tsx +1 -1
  46. package/src/victory-util/common-props.tsx +3 -3
  47. package/src/victory-util/data.ts +0 -3
  48. package/src/victory-util/domain.ts +0 -2
  49. package/src/victory-util/events.ts +14 -12
  50. package/src/victory-util/helpers.ts +0 -1
  51. package/src/victory-util/label-helpers.ts +0 -1
  52. package/src/victory-util/merge-refs.ts +2 -0
  53. package/src/victory-util/scale.ts +0 -1
  54. package/src/victory-util/transitions.ts +3 -5
  55. package/src/victory-util/type-helpers.ts +1 -1
  56. package/src/victory-util/wrapper.tsx +1 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # victory-core
2
2
 
3
+ ## 37.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix regression to touchAction override in VictoryContainer ([#2953](https://github.com/FormidableLabs/victory/pull/2953))
8
+
9
+ ## 37.3.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Remove duplicate types from interfaces ([#2940](https://github.com/FormidableLabs/victory/pull/2940))
14
+
3
15
  ## 37.3.0
4
16
 
5
17
  ### Minor Changes
@@ -156,7 +156,7 @@ const interpolateFunction = function (a, b) {
156
156
  return b;
157
157
  }
158
158
  return function () {
159
- /* eslint-disable no-invalid-this, prefer-rest-params */
159
+ /* eslint-disable prefer-rest-params */
160
160
  const aval = typeof a === "function" ? a.apply(this, arguments) : a;
161
161
  const bval = typeof b === "function" ? b.apply(this, arguments) : b;
162
162
  return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(aval, bval)(t);
@@ -743,9 +743,9 @@ const VictoryContainer = initialProps => {
743
743
  ...style,
744
744
  width: responsive ? style?.width : dimensions.width,
745
745
  height: responsive ? style?.height : dimensions.height,
746
- pointerEvents: "none",
747
- touchAction: "none",
748
- position: "relative"
746
+ pointerEvents: style?.pointerEvents ?? "none",
747
+ touchAction: style?.touchAction ?? "none",
748
+ position: style?.position ?? "relative"
749
749
  },
750
750
  "data-ouia-component-id": ouiaId,
751
751
  "data-ouia-component-type": ouiaType,
@@ -3448,7 +3448,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
3448
3448
  componentDidMount() {
3449
3449
  this.setState({
3450
3450
  nodesShouldLoad: true
3451
- }); // eslint-disable-line react/no-did-mount-set-state
3451
+ });
3452
3452
  }
3453
3453
  shouldComponentUpdate(nextProps) {
3454
3454
  if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default()(this.props, nextProps)) {
@@ -3662,7 +3662,7 @@ const defaultComponents = [{
3662
3662
  function addEvents(WrappedComponent, options) {
3663
3663
  if (options === void 0) {
3664
3664
  options = {};
3665
- } // eslint-disable-next-line @typescript-eslint/no-empty-interface
3665
+ } // eslint-disable-next-line @typescript-eslint/no-empty-object-type
3666
3666
  // @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
3667
3667
  class AddEventsMixin extends WrappedComponent {
3668
3668
  constructor(props) {
@@ -4217,7 +4217,7 @@ function getTicks(props, scale, filterZero) {
4217
4217
  * @param {String} axis: either x or y
4218
4218
  * @returns {Array} returns a domain from tickValues
4219
4219
  */
4220
- // eslint-disable-next-line max-statements
4220
+
4221
4221
  function getDomainFromData(props, axis) {
4222
4222
  const {
4223
4223
  polar,
@@ -4414,7 +4414,6 @@ __webpack_require__.r(__webpack_exports__);
4414
4414
 
4415
4415
 
4416
4416
 
4417
- /* eslint-disable no-use-before-define */
4418
4417
 
4419
4418
 
4420
4419
 
@@ -4540,8 +4539,6 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
4540
4539
  const isUnderMinY = underMin(minDomainY);
4541
4540
  const isOverMaxX = overMax(maxDomainX);
4542
4541
  const isOverMaxY = overMax(maxDomainY);
4543
-
4544
- // eslint-disable-next-line complexity
4545
4542
  return dataset.map(datum => {
4546
4543
  let {
4547
4544
  _x,
@@ -4652,7 +4649,6 @@ function formatData(dataset, props, expectedKeys) {
4652
4649
  };
4653
4650
  }
4654
4651
  const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
4655
- // eslint-disable-line complexity
4656
4652
  const parsedDatum = parseDatum(datum);
4657
4653
  const fallbackValues = {
4658
4654
  x: index,
@@ -4949,7 +4945,6 @@ __webpack_require__.r(__webpack_exports__);
4949
4945
 
4950
4946
 
4951
4947
 
4952
- /* eslint-disable no-use-before-define */
4953
4948
 
4954
4949
 
4955
4950
 
@@ -5005,8 +5000,6 @@ function getExtremeFromData(dataset, axis, type) {
5005
5000
  }, initialValue);
5006
5001
  return containsDate ? new Date(result) : result;
5007
5002
  }
5008
-
5009
- // eslint-disable-next-line max-statements
5010
5003
  function padDomain(domain, props, axis) {
5011
5004
  if (!props.domainPadding) {
5012
5005
  return domain;
@@ -5342,7 +5335,6 @@ __webpack_require__.r(__webpack_exports__);
5342
5335
 
5343
5336
 
5344
5337
 
5345
- /* eslint-disable no-use-before-define */
5346
5338
 
5347
5339
  const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
5348
5340
 
@@ -5390,11 +5382,10 @@ getScopedEvents) {
5390
5382
  */
5391
5383
  const getAllEvents = () => {
5392
5384
  // Mandatory usage: `getEvents.bind(this)`
5393
- /* eslint-disable no-invalid-this */
5385
+
5394
5386
  if (Array.isArray(this.componentEvents)) {
5395
5387
  return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
5396
5388
  }
5397
- /* eslint-enable no-invalid-this */
5398
5389
  return props.events;
5399
5390
  };
5400
5391
  const allEvents = getAllEvents();
@@ -5419,7 +5410,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
5419
5410
  }
5420
5411
 
5421
5412
  // Mandatory usage: `getScopedEvents.bind(this)`
5422
- // eslint-disable-next-line no-invalid-this
5413
+
5423
5414
  const newBaseProps = baseProps || this.baseProps;
5424
5415
  // returns the original base props or base state of a given target element
5425
5416
  const getTargetProps = (identifier, type) => {
@@ -5428,7 +5419,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
5428
5419
  target,
5429
5420
  key
5430
5421
  } = identifier;
5431
- // eslint-disable-next-line no-invalid-this
5432
5422
  const baseType = type === "props" ? newBaseProps : this.state || {};
5433
5423
  const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
5434
5424
  return key === "parent" ? base.parent : base[key] && base[key][target];
@@ -5455,7 +5445,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
5455
5445
 
5456
5446
  // returns the state object with mutated props applied for a single key
5457
5447
  const getMutationObject = (key, childName) => {
5458
- // eslint-disable-next-line no-invalid-this
5459
5448
  const baseState = this.state || {};
5460
5449
  if (!(0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(eventReturn.mutation)) {
5461
5450
  return baseState;
@@ -5528,11 +5517,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
5528
5517
  // into a state mutation, and calls setState
5529
5518
  // eslint-disable-next-line max-params
5530
5519
  const onEvent = (evt, childProps, eventKey, eventName) => {
5531
- // eslint-disable-next-line no-invalid-this
5532
5520
  const eventReturn = events[eventName](evt, childProps, eventKey, this);
5533
5521
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_3___default()(eventReturn)) {
5534
5522
  const callbacks = compileCallbacks(eventReturn);
5535
- // eslint-disable-next-line no-invalid-this
5536
5523
  this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
5537
5524
  }
5538
5525
  };
@@ -5562,7 +5549,7 @@ function getPartialEvents(events, eventKey, childProps) {
5562
5549
  // eslint-disable-next-line max-params
5563
5550
  function getEventState(eventKey, namespace, childType) {
5564
5551
  // Mandatory usage: `getEventState.bind(this)`
5565
- // eslint-disable-next-line no-invalid-this
5552
+
5566
5553
  const state = this.state || {};
5567
5554
  if (!childType) {
5568
5555
  return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
@@ -5755,7 +5742,6 @@ __webpack_require__.r(__webpack_exports__);
5755
5742
 
5756
5743
 
5757
5744
 
5758
- /* eslint-disable no-use-before-define */
5759
5745
 
5760
5746
  // Private Functions
5761
5747
 
@@ -6492,7 +6478,6 @@ __webpack_require__.r(__webpack_exports__);
6492
6478
  /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6493
6479
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./victory-util/helpers.ts");
6494
6480
 
6495
- /* eslint-disable no-use-before-define */
6496
6481
 
6497
6482
  // Private Functions
6498
6483
 
@@ -7012,7 +6997,6 @@ __webpack_require__.r(__webpack_exports__);
7012
6997
  /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection */ "./victory-util/collection.tsx");
7013
6998
  /* harmony import */ var victory_vendor_d3_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-vendor/d3-scale */ "../../victory-vendor/es/d3-scale.js");
7014
6999
 
7015
- /* eslint-disable no-use-before-define */
7016
7000
 
7017
7001
 
7018
7002
 
@@ -7934,8 +7918,6 @@ function getChildBeforeLoad(animate, child, data, cb) {
7934
7918
  clipWidth: 0
7935
7919
  };
7936
7920
  }
7937
-
7938
- // eslint-disable-next-line max-params
7939
7921
  function getChildOnLoad(animate, data, cb) {
7940
7922
  const newAnimate = Object.assign({}, animate, {
7941
7923
  onEnd: cb
@@ -7958,7 +7940,7 @@ function getChildOnLoad(animate, data, cb) {
7958
7940
  };
7959
7941
  }
7960
7942
 
7961
- // eslint-disable-next-line max-params, max-len
7943
+ // eslint-disable-next-line max-params
7962
7944
  function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
7963
7945
  // Whether or not _this_ child has exiting nodes, we want the exit-
7964
7946
  // transition for all children to have the same duration, delay, etc.
@@ -7982,7 +7964,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
7982
7964
  };
7983
7965
  }
7984
7966
 
7985
- // eslint-disable-next-line max-params,max-len
7967
+ // eslint-disable-next-line max-params
7986
7968
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
7987
7969
  let newAnimate = animate;
7988
7970
  let newData = data;
@@ -8007,7 +7989,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
8007
7989
  };
8008
7990
  }
8009
7991
 
8010
- // eslint-disable-next-line max-params, max-len
7992
+ // eslint-disable-next-line max-params
8011
7993
  function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
8012
7994
  // Whether or not _this_ child has entering nodes, we want the entering-
8013
7995
  // transition for all children to have the same duration, delay, etc.
@@ -8114,8 +8096,6 @@ function getTransitionPropsFactory(props, state, setState) {
8114
8096
  }
8115
8097
  return {};
8116
8098
  };
8117
-
8118
- // eslint-disable-next-line max-statements, complexity, max-len
8119
8099
  return function getTransitionProps(child, index) {
8120
8100
  const data = getChildData(child) || [];
8121
8101
  const animate = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, props.animate, child.props.animate);
@@ -8503,7 +8483,6 @@ function getDefaultDomainPadding(props, axis, childComponents) {
8503
8483
  };
8504
8484
  }
8505
8485
  function getDomainFromChildren(props, axis, childComponents) {
8506
- // eslint-disable-line max-statements, complexity, max-len
8507
8486
  const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
8508
8487
  const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
8509
8488
  const {