victory-core 37.3.1 → 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 (53) hide show
  1. package/CHANGELOG.md +6 -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-transition/victory-transition.js +1 -1
  7. package/es/victory-util/add-events.js +1 -1
  8. package/es/victory-util/axis.js +1 -1
  9. package/es/victory-util/data.js +0 -4
  10. package/es/victory-util/domain.js +0 -3
  11. package/es/victory-util/events.d.ts +1 -1
  12. package/es/victory-util/events.js +3 -9
  13. package/es/victory-util/helpers.js +0 -1
  14. package/es/victory-util/label-helpers.js +0 -1
  15. package/es/victory-util/merge-refs.d.ts +1 -1
  16. package/es/victory-util/scale.js +0 -1
  17. package/es/victory-util/transitions.js +3 -7
  18. package/es/victory-util/type-helpers.js +1 -1
  19. package/es/victory-util/wrapper.js +0 -1
  20. package/lib/victory-animation/util.js +1 -1
  21. package/lib/victory-container/victory-container.js +3 -3
  22. package/lib/victory-transition/victory-transition.js +1 -1
  23. package/lib/victory-util/add-events.js +1 -1
  24. package/lib/victory-util/axis.js +1 -1
  25. package/lib/victory-util/data.js +0 -5
  26. package/lib/victory-util/domain.js +0 -4
  27. package/lib/victory-util/events.d.ts +1 -1
  28. package/lib/victory-util/events.js +3 -10
  29. package/lib/victory-util/helpers.js +0 -2
  30. package/lib/victory-util/label-helpers.js +0 -2
  31. package/lib/victory-util/merge-refs.d.ts +1 -1
  32. package/lib/victory-util/scale.js +0 -2
  33. package/lib/victory-util/transitions.js +3 -7
  34. package/lib/victory-util/type-helpers.js +1 -1
  35. package/lib/victory-util/wrapper.js +0 -1
  36. package/package.json +6 -10
  37. package/src/victory-animation/util.ts +1 -1
  38. package/src/victory-container/victory-container.tsx +3 -3
  39. package/src/victory-primitives/point.tsx +2 -2
  40. package/src/victory-transition/victory-transition.tsx +1 -1
  41. package/src/victory-util/add-events.tsx +1 -1
  42. package/src/victory-util/axis.tsx +1 -1
  43. package/src/victory-util/common-props.tsx +3 -3
  44. package/src/victory-util/data.ts +0 -3
  45. package/src/victory-util/domain.ts +0 -2
  46. package/src/victory-util/events.ts +14 -12
  47. package/src/victory-util/helpers.ts +0 -1
  48. package/src/victory-util/label-helpers.ts +0 -1
  49. package/src/victory-util/merge-refs.ts +2 -0
  50. package/src/victory-util/scale.ts +0 -1
  51. package/src/victory-util/transitions.ts +3 -5
  52. package/src/victory-util/type-helpers.ts +1 -1
  53. package/src/victory-util/wrapper.tsx +1 -2
@@ -82,7 +82,7 @@ export const interpolateFunction = function (a, b) {
82
82
  return b;
83
83
  }
84
84
  return function () {
85
- /* eslint-disable no-invalid-this, prefer-rest-params */
85
+ /* eslint-disable prefer-rest-params */
86
86
  const aval = typeof a === "function" ? a.apply(this, arguments) : a;
87
87
  const bval = typeof b === "function" ? b.apply(this, arguments) : b;
88
88
  return interpolate(aval, bval)(t);
@@ -103,9 +103,9 @@ export const VictoryContainer = initialProps => {
103
103
  ...style,
104
104
  width: responsive ? style?.width : dimensions.width,
105
105
  height: responsive ? style?.height : dimensions.height,
106
- pointerEvents: "none",
107
- touchAction: "none",
108
- position: "relative"
106
+ pointerEvents: style?.pointerEvents ?? "none",
107
+ touchAction: style?.touchAction ?? "none",
108
+ position: style?.position ?? "relative"
109
109
  },
110
110
  "data-ouia-component-id": ouiaId,
111
111
  "data-ouia-component-type": ouiaType,
@@ -25,7 +25,7 @@ export class VictoryTransition extends React.Component {
25
25
  componentDidMount() {
26
26
  this.setState({
27
27
  nodesShouldLoad: true
28
- }); // eslint-disable-line react/no-did-mount-set-state
28
+ });
29
29
  }
30
30
  shouldComponentUpdate(nextProps) {
31
31
  if (!isEqual(this.props, nextProps)) {
@@ -61,7 +61,7 @@ const defaultComponents = [{
61
61
  export function addEvents(WrappedComponent, options) {
62
62
  if (options === void 0) {
63
63
  options = {};
64
- } // eslint-disable-next-line @typescript-eslint/no-empty-interface
64
+ } // eslint-disable-next-line @typescript-eslint/no-empty-object-type
65
65
  // @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
66
66
  class AddEventsMixin extends WrappedComponent {
67
67
  constructor(props) {
@@ -271,7 +271,7 @@ export function getTicks(props, scale, filterZero) {
271
271
  * @param {String} axis: either x or y
272
272
  * @returns {Array} returns a domain from tickValues
273
273
  */
274
- // eslint-disable-next-line max-statements
274
+
275
275
  function getDomainFromData(props, axis) {
276
276
  const {
277
277
  polar,
@@ -6,7 +6,6 @@ import _orderBy from "lodash/orderBy";
6
6
  import _property from "lodash/property";
7
7
  import _isPlainObject from "lodash/isPlainObject";
8
8
  import _uniq from "lodash/uniq";
9
- /* eslint-disable no-use-before-define */
10
9
  import React from "react";
11
10
  import * as Helpers from "./helpers";
12
11
  import * as Collection from "./collection";
@@ -132,8 +131,6 @@ export function formatDataFromDomain(dataset, domain, defaultBaseline) {
132
131
  const isUnderMinY = underMin(minDomainY);
133
132
  const isOverMaxX = overMax(maxDomainX);
134
133
  const isOverMaxY = overMax(maxDomainY);
135
-
136
- // eslint-disable-next-line complexity
137
134
  return dataset.map(datum => {
138
135
  let {
139
136
  _x,
@@ -244,7 +241,6 @@ export function formatData(dataset, props, expectedKeys) {
244
241
  };
245
242
  }
246
243
  const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
247
- // eslint-disable-line complexity
248
244
  const parsedDatum = parseDatum(datum);
249
245
  const fallbackValues = {
250
246
  x: index,
@@ -1,7 +1,6 @@
1
1
  import _isDate from "lodash/isDate";
2
2
  import _sortedUniq from "lodash/sortedUniq";
3
3
  import _isPlainObject from "lodash/isPlainObject";
4
- /* eslint-disable no-use-before-define */
5
4
  import React from "react";
6
5
  import * as Data from "./data";
7
6
  import * as Scale from "./scale";
@@ -57,8 +56,6 @@ function getExtremeFromData(dataset, axis, type) {
57
56
  }, initialValue);
58
57
  return containsDate ? new Date(result) : result;
59
58
  }
60
-
61
- // eslint-disable-next-line max-statements
62
59
  function padDomain(domain, props, axis) {
63
60
  if (!props.domainPadding) {
64
61
  return domain;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import type { EventMixinCalculatedValues } from "./add-events";
3
3
  declare type ComponentEventKey = string | number;
4
4
  export interface ComponentEvent {
@@ -2,7 +2,6 @@ import _uniq from "lodash/uniq";
2
2
  import _omitBy from "lodash/omitBy";
3
3
  import _pickBy from "lodash/pickBy";
4
4
  import _isEmpty from "lodash/isEmpty";
5
- /* eslint-disable no-use-before-define */
6
5
  import { isFunction } from "./helpers";
7
6
  const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
8
7
 
@@ -50,11 +49,10 @@ getScopedEvents) {
50
49
  */
51
50
  const getAllEvents = () => {
52
51
  // Mandatory usage: `getEvents.bind(this)`
53
- /* eslint-disable no-invalid-this */
52
+
54
53
  if (Array.isArray(this.componentEvents)) {
55
54
  return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
56
55
  }
57
- /* eslint-enable no-invalid-this */
58
56
  return props.events;
59
57
  };
60
58
  const allEvents = getAllEvents();
@@ -79,7 +77,7 @@ export function getScopedEvents(events, namespace, childType, baseProps) {
79
77
  }
80
78
 
81
79
  // Mandatory usage: `getScopedEvents.bind(this)`
82
- // eslint-disable-next-line no-invalid-this
80
+
83
81
  const newBaseProps = baseProps || this.baseProps;
84
82
  // returns the original base props or base state of a given target element
85
83
  const getTargetProps = (identifier, type) => {
@@ -88,7 +86,6 @@ export function getScopedEvents(events, namespace, childType, baseProps) {
88
86
  target,
89
87
  key
90
88
  } = identifier;
91
- // eslint-disable-next-line no-invalid-this
92
89
  const baseType = type === "props" ? newBaseProps : this.state || {};
93
90
  const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
94
91
  return key === "parent" ? base.parent : base[key] && base[key][target];
@@ -115,7 +112,6 @@ export function getScopedEvents(events, namespace, childType, baseProps) {
115
112
 
116
113
  // returns the state object with mutated props applied for a single key
117
114
  const getMutationObject = (key, childName) => {
118
- // eslint-disable-next-line no-invalid-this
119
115
  const baseState = this.state || {};
120
116
  if (!isFunction(eventReturn.mutation)) {
121
117
  return baseState;
@@ -188,11 +184,9 @@ export function getScopedEvents(events, namespace, childType, baseProps) {
188
184
  // into a state mutation, and calls setState
189
185
  // eslint-disable-next-line max-params
190
186
  const onEvent = (evt, childProps, eventKey, eventName) => {
191
- // eslint-disable-next-line no-invalid-this
192
187
  const eventReturn = events[eventName](evt, childProps, eventKey, this);
193
188
  if (!_isEmpty(eventReturn)) {
194
189
  const callbacks = compileCallbacks(eventReturn);
195
- // eslint-disable-next-line no-invalid-this
196
190
  this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
197
191
  }
198
192
  };
@@ -222,7 +216,7 @@ export function getPartialEvents(events, eventKey, childProps) {
222
216
  // eslint-disable-next-line max-params
223
217
  export function getEventState(eventKey, namespace, childType) {
224
218
  // Mandatory usage: `getEventState.bind(this)`
225
- // eslint-disable-next-line no-invalid-this
219
+
226
220
  const state = this.state || {};
227
221
  if (!childType) {
228
222
  return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
@@ -1,7 +1,6 @@
1
1
  import _pick from "lodash/pick";
2
2
  import _property from "lodash/property";
3
3
  import _defaults from "lodash/defaults";
4
- /* eslint-disable no-use-before-define */
5
4
  import React, { isValidElement } from "react";
6
5
  // Private Functions
7
6
 
@@ -1,5 +1,4 @@
1
1
  import _defaults from "lodash/defaults";
2
- /* eslint-disable no-use-before-define */
3
2
  import * as Helpers from "./helpers";
4
3
  // Private Functions
5
4
 
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  declare type Ref<T> = React.MutableRefObject<T> | React.LegacyRef<T> | undefined | null;
3
3
  /**
4
4
  * Used to merge multiple React refs into a single callback ref.
@@ -1,5 +1,4 @@
1
1
  import _isPlainObject from "lodash/isPlainObject";
2
- /* eslint-disable no-use-before-define */
3
2
  import * as Helpers from "./helpers";
4
3
  import * as Collection from "./collection";
5
4
  import * as d3Scale from "victory-vendor/d3-scale";
@@ -136,8 +136,6 @@ function getChildBeforeLoad(animate, child, data, cb) {
136
136
  clipWidth: 0
137
137
  };
138
138
  }
139
-
140
- // eslint-disable-next-line max-params
141
139
  function getChildOnLoad(animate, data, cb) {
142
140
  const newAnimate = Object.assign({}, animate, {
143
141
  onEnd: cb
@@ -160,7 +158,7 @@ function getChildOnLoad(animate, data, cb) {
160
158
  };
161
159
  }
162
160
 
163
- // eslint-disable-next-line max-params, max-len
161
+ // eslint-disable-next-line max-params
164
162
  function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
165
163
  // Whether or not _this_ child has exiting nodes, we want the exit-
166
164
  // transition for all children to have the same duration, delay, etc.
@@ -184,7 +182,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
184
182
  };
185
183
  }
186
184
 
187
- // eslint-disable-next-line max-params,max-len
185
+ // eslint-disable-next-line max-params
188
186
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
189
187
  let newAnimate = animate;
190
188
  let newData = data;
@@ -209,7 +207,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
209
207
  };
210
208
  }
211
209
 
212
- // eslint-disable-next-line max-params, max-len
210
+ // eslint-disable-next-line max-params
213
211
  function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
214
212
  // Whether or not _this_ child has entering nodes, we want the entering-
215
213
  // transition for all children to have the same duration, delay, etc.
@@ -316,8 +314,6 @@ export function getTransitionPropsFactory(props, state, setState) {
316
314
  }
317
315
  return {};
318
316
  };
319
-
320
- // eslint-disable-next-line max-statements, complexity, max-len
321
317
  return function getTransitionProps(child, index) {
322
318
  const data = getChildData(child) || [];
323
319
  const animate = _defaults({}, props.animate, child.props.animate);
@@ -14,7 +14,7 @@ export function getValueForAxis(value, axis) {
14
14
  return value;
15
15
  }
16
16
 
17
- // eslint-disable-next-line @typescript-eslint/ban-types
17
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
18
18
  export function isFunction(func) {
19
19
  return typeof func === "function";
20
20
  }
@@ -169,7 +169,6 @@ export function getDefaultDomainPadding(props, axis, childComponents) {
169
169
  };
170
170
  }
171
171
  export function getDomainFromChildren(props, axis, childComponents) {
172
- // eslint-disable-line max-statements, complexity, max-len
173
172
  const children = childComponents ? childComponents.slice(0) : React.Children.toArray(props.children);
174
173
  const parentData = props.data ? Data.getData(props) : undefined;
175
174
  const {
@@ -91,7 +91,7 @@ const interpolateFunction = function (a, b) {
91
91
  return b;
92
92
  }
93
93
  return function () {
94
- /* eslint-disable no-invalid-this, prefer-rest-params */
94
+ /* eslint-disable prefer-rest-params */
95
95
  const aval = typeof a === "function" ? a.apply(this, arguments) : a;
96
96
  const bval = typeof b === "function" ? b.apply(this, arguments) : b;
97
97
  return (0, _d3Interpolate.interpolate)(aval, bval)(t);
@@ -113,9 +113,9 @@ const VictoryContainer = initialProps => {
113
113
  ...style,
114
114
  width: responsive ? style?.width : dimensions.width,
115
115
  height: responsive ? style?.height : dimensions.height,
116
- pointerEvents: "none",
117
- touchAction: "none",
118
- position: "relative"
116
+ pointerEvents: style?.pointerEvents ?? "none",
117
+ touchAction: style?.touchAction ?? "none",
118
+ position: style?.position ?? "relative"
119
119
  },
120
120
  "data-ouia-component-id": ouiaId,
121
121
  "data-ouia-component-type": ouiaType,
@@ -34,7 +34,7 @@ class VictoryTransition extends _react.default.Component {
34
34
  componentDidMount() {
35
35
  this.setState({
36
36
  nodesShouldLoad: true
37
- }); // eslint-disable-line react/no-did-mount-set-state
37
+ });
38
38
  }
39
39
  shouldComponentUpdate(nextProps) {
40
40
  if (!(0, _reactFastCompare.default)(this.props, nextProps)) {
@@ -69,7 +69,7 @@ const defaultComponents = [{
69
69
  function addEvents(WrappedComponent, options) {
70
70
  if (options === void 0) {
71
71
  options = {};
72
- } // eslint-disable-next-line @typescript-eslint/no-empty-interface
72
+ } // eslint-disable-next-line @typescript-eslint/no-empty-object-type
73
73
  // @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
74
74
  class AddEventsMixin extends WrappedComponent {
75
75
  constructor(props) {
@@ -292,7 +292,7 @@ function getTicks(props, scale, filterZero) {
292
292
  * @param {String} axis: either x or y
293
293
  * @returns {Array} returns a domain from tickValues
294
294
  */
295
- // eslint-disable-next-line max-statements
295
+
296
296
  function getDomainFromData(props, axis) {
297
297
  const {
298
298
  polar,
@@ -30,8 +30,6 @@ var Immutable = _interopRequireWildcard(require("./immutable"));
30
30
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
31
31
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
- /* eslint-disable no-use-before-define */
34
-
35
33
  // Private Functions
36
34
 
37
35
  function parseDatum(datum) {
@@ -151,8 +149,6 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
151
149
  const isUnderMinY = underMin(minDomainY);
152
150
  const isOverMaxX = overMax(maxDomainX);
153
151
  const isOverMaxY = overMax(maxDomainY);
154
-
155
- // eslint-disable-next-line complexity
156
152
  return dataset.map(datum => {
157
153
  let {
158
154
  _x,
@@ -263,7 +259,6 @@ function formatData(dataset, props, expectedKeys) {
263
259
  };
264
260
  }
265
261
  const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
266
- // eslint-disable-line complexity
267
262
  const parsedDatum = parseDatum(datum);
268
263
  const fallbackValues = {
269
264
  x: index,
@@ -26,8 +26,6 @@ var Collection = _interopRequireWildcard(require("./collection"));
26
26
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
27
27
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
- /* eslint-disable no-use-before-define */
30
-
31
29
  // Private Methods
32
30
 
33
31
  function cleanDomain(domain, props, axis) {
@@ -77,8 +75,6 @@ function getExtremeFromData(dataset, axis, type) {
77
75
  }, initialValue);
78
76
  return containsDate ? new Date(result) : result;
79
77
  }
80
-
81
- // eslint-disable-next-line max-statements
82
78
  function padDomain(domain, props, axis) {
83
79
  if (!props.domainPadding) {
84
80
  return domain;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import type { EventMixinCalculatedValues } from "./add-events";
3
3
  declare type ComponentEventKey = string | number;
4
4
  export interface ComponentEvent {
@@ -21,8 +21,6 @@ var _pickBy2 = _interopRequireDefault(require("lodash/pickBy"));
21
21
  var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
22
22
  var _helpers = require("./helpers");
23
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
- /* eslint-disable no-use-before-define */
25
-
26
24
  const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
27
25
 
28
26
  // Normally we'd use Template Literal Types, but we're avoiding it to maximize TS compatibility with TS < 4.1
@@ -69,11 +67,10 @@ getScopedEvents) {
69
67
  */
70
68
  const getAllEvents = () => {
71
69
  // Mandatory usage: `getEvents.bind(this)`
72
- /* eslint-disable no-invalid-this */
70
+
73
71
  if (Array.isArray(this.componentEvents)) {
74
72
  return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
75
73
  }
76
- /* eslint-enable no-invalid-this */
77
74
  return props.events;
78
75
  };
79
76
  const allEvents = getAllEvents();
@@ -98,7 +95,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
98
95
  }
99
96
 
100
97
  // Mandatory usage: `getScopedEvents.bind(this)`
101
- // eslint-disable-next-line no-invalid-this
98
+
102
99
  const newBaseProps = baseProps || this.baseProps;
103
100
  // returns the original base props or base state of a given target element
104
101
  const getTargetProps = (identifier, type) => {
@@ -107,7 +104,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
107
104
  target,
108
105
  key
109
106
  } = identifier;
110
- // eslint-disable-next-line no-invalid-this
111
107
  const baseType = type === "props" ? newBaseProps : this.state || {};
112
108
  const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
113
109
  return key === "parent" ? base.parent : base[key] && base[key][target];
@@ -134,7 +130,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
134
130
 
135
131
  // returns the state object with mutated props applied for a single key
136
132
  const getMutationObject = (key, childName) => {
137
- // eslint-disable-next-line no-invalid-this
138
133
  const baseState = this.state || {};
139
134
  if (!(0, _helpers.isFunction)(eventReturn.mutation)) {
140
135
  return baseState;
@@ -207,11 +202,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
207
202
  // into a state mutation, and calls setState
208
203
  // eslint-disable-next-line max-params
209
204
  const onEvent = (evt, childProps, eventKey, eventName) => {
210
- // eslint-disable-next-line no-invalid-this
211
205
  const eventReturn = events[eventName](evt, childProps, eventKey, this);
212
206
  if (!(0, _isEmpty2.default)(eventReturn)) {
213
207
  const callbacks = compileCallbacks(eventReturn);
214
- // eslint-disable-next-line no-invalid-this
215
208
  this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
216
209
  }
217
210
  };
@@ -241,7 +234,7 @@ function getPartialEvents(events, eventKey, childProps) {
241
234
  // eslint-disable-next-line max-params
242
235
  function getEventState(eventKey, namespace, childType) {
243
236
  // Mandatory usage: `getEventState.bind(this)`
244
- // eslint-disable-next-line no-invalid-this
237
+
245
238
  const state = this.state || {};
246
239
  if (!childType) {
247
240
  return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
@@ -34,8 +34,6 @@ var _react = _interopRequireWildcard(require("react"));
34
34
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
35
35
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
36
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
- /* eslint-disable no-use-before-define */
38
-
39
37
  // Private Functions
40
38
 
41
39
  function getCartesianRange(props, axis) {
@@ -14,8 +14,6 @@ var Helpers = _interopRequireWildcard(require("./helpers"));
14
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- /* eslint-disable no-use-before-define */
18
-
19
17
  // Private Functions
20
18
 
21
19
  function getVerticalAnchor(props, datum) {
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  declare type Ref<T> = React.MutableRefObject<T> | React.LegacyRef<T> | undefined | null;
3
3
  /**
4
4
  * Used to merge multiple React refs into a single callback ref.
@@ -17,8 +17,6 @@ var d3Scale = _interopRequireWildcard(require("victory-vendor/d3-scale"));
17
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
- /* eslint-disable no-use-before-define */
21
-
22
20
  const supportedScaleStrings = ["linear", "time", "log", "sqrt"];
23
21
  // Private Functions
24
22
 
@@ -144,8 +144,6 @@ function getChildBeforeLoad(animate, child, data, cb) {
144
144
  clipWidth: 0
145
145
  };
146
146
  }
147
-
148
- // eslint-disable-next-line max-params
149
147
  function getChildOnLoad(animate, data, cb) {
150
148
  const newAnimate = Object.assign({}, animate, {
151
149
  onEnd: cb
@@ -168,7 +166,7 @@ function getChildOnLoad(animate, data, cb) {
168
166
  };
169
167
  }
170
168
 
171
- // eslint-disable-next-line max-params, max-len
169
+ // eslint-disable-next-line max-params
172
170
  function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
173
171
  // Whether or not _this_ child has exiting nodes, we want the exit-
174
172
  // transition for all children to have the same duration, delay, etc.
@@ -192,7 +190,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
192
190
  };
193
191
  }
194
192
 
195
- // eslint-disable-next-line max-params,max-len
193
+ // eslint-disable-next-line max-params
196
194
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
197
195
  let newAnimate = animate;
198
196
  let newData = data;
@@ -217,7 +215,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
217
215
  };
218
216
  }
219
217
 
220
- // eslint-disable-next-line max-params, max-len
218
+ // eslint-disable-next-line max-params
221
219
  function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
222
220
  // Whether or not _this_ child has entering nodes, we want the entering-
223
221
  // transition for all children to have the same duration, delay, etc.
@@ -324,8 +322,6 @@ function getTransitionPropsFactory(props, state, setState) {
324
322
  }
325
323
  return {};
326
324
  };
327
-
328
- // eslint-disable-next-line max-statements, complexity, max-len
329
325
  return function getTransitionProps(child, index) {
330
326
  const data = getChildData(child) || [];
331
327
  const animate = (0, _defaults2.default)({}, props.animate, child.props.animate);
@@ -25,7 +25,7 @@ function getValueForAxis(value, axis) {
25
25
  return value;
26
26
  }
27
27
 
28
- // eslint-disable-next-line @typescript-eslint/ban-types
28
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
29
29
  function isFunction(func) {
30
30
  return typeof func === "function";
31
31
  }
@@ -194,7 +194,6 @@ function getDefaultDomainPadding(props, axis, childComponents) {
194
194
  };
195
195
  }
196
196
  function getDomainFromChildren(props, axis, childComponents) {
197
- // eslint-disable-line max-statements, complexity, max-len
198
197
  const children = childComponents ? childComponents.slice(0) : _react.default.Children.toArray(props.children);
199
198
  const parentData = props.data ? Data.getData(props) : undefined;
200
199
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-core",
3
- "version": "37.3.1",
3
+ "version": "37.3.2",
4
4
  "description": "Victory Core",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "lodash": "^4.17.21",
24
24
  "react-fast-compare": "^3.2.0",
25
- "victory-vendor": "37.3.1"
25
+ "victory-vendor": "37.3.2"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=16.6.0"
@@ -207,11 +207,9 @@
207
207
  ]
208
208
  },
209
209
  "lint": {
210
- "command": "nps lint:pkg",
210
+ "command": "eslint src",
211
211
  "files": [
212
- "src/**",
213
- "../../.eslintignore",
214
- "../../.eslintrc.js"
212
+ "src/**"
215
213
  ],
216
214
  "output": [],
217
215
  "dependencies": [
@@ -224,11 +222,9 @@
224
222
  ]
225
223
  },
226
224
  "lint:fix": {
227
- "command": "pnpm run lint || nps lint:pkg:fix",
225
+ "command": "eslint --fix src",
228
226
  "files": [
229
- "src/**",
230
- "../../.eslintignore",
231
- "../../.eslintrc.js"
227
+ "src/**"
232
228
  ],
233
229
  "output": [],
234
230
  "dependencies": [
@@ -83,7 +83,7 @@ export const interpolateFunction = function (a, b) {
83
83
  return b;
84
84
  }
85
85
  return function (this: unknown) {
86
- /* eslint-disable no-invalid-this, prefer-rest-params */
86
+ /* eslint-disable prefer-rest-params */
87
87
  const aval = typeof a === "function" ? a.apply(this, arguments) : a;
88
88
  const bval = typeof b === "function" ? b.apply(this, arguments) : b;
89
89
  return interpolate(aval, bval)(t);
@@ -155,9 +155,9 @@ export const VictoryContainer = (initialProps: VictoryContainerProps) => {
155
155
  ...style,
156
156
  width: responsive ? style?.width : dimensions.width,
157
157
  height: responsive ? style?.height : dimensions.height,
158
- pointerEvents: "none",
159
- touchAction: "none",
160
- position: "relative",
158
+ pointerEvents: style?.pointerEvents ?? "none",
159
+ touchAction: style?.touchAction ?? "none",
160
+ position: style?.position ?? "relative",
161
161
  }}
162
162
  data-ouia-component-id={ouiaId}
163
163
  data-ouia-component-type={ouiaType}
@@ -12,9 +12,9 @@ export interface PointProps extends VictoryCommonPrimitiveProps {
12
12
  datum?: any;
13
13
  getPath?: (x: number, y: number, size: number) => string;
14
14
  pathComponent?: React.ReactElement;
15
- // eslint-disable-next-line @typescript-eslint/ban-types
15
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
16
16
  size?: number | Function;
17
- // eslint-disable-next-line @typescript-eslint/ban-types
17
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
18
18
  symbol?: ScatterSymbolType | Function;
19
19
  x?: number;
20
20
  y?: number;
@@ -66,7 +66,7 @@ export class VictoryTransition extends React.Component<
66
66
  }
67
67
 
68
68
  componentDidMount() {
69
- this.setState({ nodesShouldLoad: true }); // eslint-disable-line react/no-did-mount-set-state
69
+ this.setState({ nodesShouldLoad: true });
70
70
  }
71
71
 
72
72
  shouldComponentUpdate(nextProps: VictoryTransitionProps) {