victory-create-container 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # victory-create-container
2
2
 
3
+ ## 37.3.2
4
+
5
+ ## 37.3.1
6
+
7
+ ### Patch Changes
8
+
9
+ - update createContainer types to be backwards compatibile ([#2933](https://github.com/FormidableLabs/victory/pull/2933))
10
+
3
11
  ## 37.3.0
4
12
 
5
13
  ## 37.2.0
@@ -121,6 +121,8 @@ const CONTAINER_COMPONENTS_WEB = {
121
121
  voronoi: victory_voronoi_container__WEBPACK_IMPORTED_MODULE_9__.VictoryVoronoiContainer
122
122
  };
123
123
  function makeCreateContainerFunction(containerComponents, VictoryContainerBase) {
124
+ // Helper type to support backwards compatibility with old types
125
+
124
126
  return function combineContainers(containerA, containerB) {
125
127
  const ContainerA = containerComponents[containerA];
126
128
  const ContainerB = containerComponents[containerB];
@@ -6741,7 +6743,6 @@ const Helpers = {
6741
6743
  return xMoved || yMoved;
6742
6744
  }
6743
6745
  },
6744
- // eslint-disable-next-line max-statements, complexity
6745
6746
  onMouseDown(evt, targetProps) {
6746
6747
  evt.preventDefault();
6747
6748
  const {
@@ -6834,7 +6835,6 @@ const Helpers = {
6834
6835
  })
6835
6836
  }] : {};
6836
6837
  },
6837
- // eslint-disable-next-line max-statements, complexity
6838
6838
  onGlobalMouseMove(evt, targetProps) {
6839
6839
  const {
6840
6840
  scale,
@@ -6921,13 +6921,11 @@ const Helpers = {
6921
6921
  }
6922
6922
  return {};
6923
6923
  },
6924
- // eslint-disable-next-line complexity
6925
6924
  onGlobalMouseUp(evt, targetProps) {
6926
6925
  // if a panning or selection has not been started, ignore the event
6927
6926
  if (!targetProps.isPanning && !targetProps.isSelecting) {
6928
6927
  return {};
6929
6928
  }
6930
- // eslint-disable-line max-statements, complexity
6931
6929
  const {
6932
6930
  x1,
6933
6931
  y1,
@@ -7510,9 +7508,9 @@ const VictoryContainer = initialProps => {
7510
7508
  ...style,
7511
7509
  width: responsive ? style?.width : dimensions.width,
7512
7510
  height: responsive ? style?.height : dimensions.height,
7513
- pointerEvents: "none",
7514
- touchAction: "none",
7515
- position: "relative"
7511
+ pointerEvents: style?.pointerEvents ?? "none",
7512
+ touchAction: style?.touchAction ?? "none",
7513
+ position: style?.position ?? "relative"
7516
7514
  },
7517
7515
  "data-ouia-component-id": ouiaId,
7518
7516
  "data-ouia-component-type": ouiaType,
@@ -10003,7 +10001,7 @@ function getTicks(props, scale, filterZero) {
10003
10001
  * @param {String} axis: either x or y
10004
10002
  * @returns {Array} returns a domain from tickValues
10005
10003
  */
10006
- // eslint-disable-next-line max-statements
10004
+
10007
10005
  function getDomainFromData(props, axis) {
10008
10006
  const {
10009
10007
  polar,
@@ -10200,7 +10198,6 @@ __webpack_require__.r(__webpack_exports__);
10200
10198
 
10201
10199
 
10202
10200
 
10203
- /* eslint-disable no-use-before-define */
10204
10201
 
10205
10202
 
10206
10203
 
@@ -10326,8 +10323,6 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
10326
10323
  const isUnderMinY = underMin(minDomainY);
10327
10324
  const isOverMaxX = overMax(maxDomainX);
10328
10325
  const isOverMaxY = overMax(maxDomainY);
10329
-
10330
- // eslint-disable-next-line complexity
10331
10326
  return dataset.map(datum => {
10332
10327
  let {
10333
10328
  _x,
@@ -10438,7 +10433,6 @@ function formatData(dataset, props, expectedKeys) {
10438
10433
  };
10439
10434
  }
10440
10435
  const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
10441
- // eslint-disable-line complexity
10442
10436
  const parsedDatum = parseDatum(datum);
10443
10437
  const fallbackValues = {
10444
10438
  x: index,
@@ -10631,7 +10625,6 @@ __webpack_require__.r(__webpack_exports__);
10631
10625
 
10632
10626
 
10633
10627
 
10634
- /* eslint-disable no-use-before-define */
10635
10628
 
10636
10629
 
10637
10630
 
@@ -10687,8 +10680,6 @@ function getExtremeFromData(dataset, axis, type) {
10687
10680
  }, initialValue);
10688
10681
  return containsDate ? new Date(result) : result;
10689
10682
  }
10690
-
10691
- // eslint-disable-next-line max-statements
10692
10683
  function padDomain(domain, props, axis) {
10693
10684
  if (!props.domainPadding) {
10694
10685
  return domain;
@@ -11024,7 +11015,6 @@ __webpack_require__.r(__webpack_exports__);
11024
11015
 
11025
11016
 
11026
11017
 
11027
- /* eslint-disable no-use-before-define */
11028
11018
 
11029
11019
  const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
11030
11020
 
@@ -11072,11 +11062,10 @@ getScopedEvents) {
11072
11062
  */
11073
11063
  const getAllEvents = () => {
11074
11064
  // Mandatory usage: `getEvents.bind(this)`
11075
- /* eslint-disable no-invalid-this */
11065
+
11076
11066
  if (Array.isArray(this.componentEvents)) {
11077
11067
  return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
11078
11068
  }
11079
- /* eslint-enable no-invalid-this */
11080
11069
  return props.events;
11081
11070
  };
11082
11071
  const allEvents = getAllEvents();
@@ -11101,7 +11090,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11101
11090
  }
11102
11091
 
11103
11092
  // Mandatory usage: `getScopedEvents.bind(this)`
11104
- // eslint-disable-next-line no-invalid-this
11093
+
11105
11094
  const newBaseProps = baseProps || this.baseProps;
11106
11095
  // returns the original base props or base state of a given target element
11107
11096
  const getTargetProps = (identifier, type) => {
@@ -11110,7 +11099,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11110
11099
  target,
11111
11100
  key
11112
11101
  } = identifier;
11113
- // eslint-disable-next-line no-invalid-this
11114
11102
  const baseType = type === "props" ? newBaseProps : this.state || {};
11115
11103
  const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
11116
11104
  return key === "parent" ? base.parent : base[key] && base[key][target];
@@ -11137,7 +11125,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11137
11125
 
11138
11126
  // returns the state object with mutated props applied for a single key
11139
11127
  const getMutationObject = (key, childName) => {
11140
- // eslint-disable-next-line no-invalid-this
11141
11128
  const baseState = this.state || {};
11142
11129
  if (!(0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(eventReturn.mutation)) {
11143
11130
  return baseState;
@@ -11210,11 +11197,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11210
11197
  // into a state mutation, and calls setState
11211
11198
  // eslint-disable-next-line max-params
11212
11199
  const onEvent = (evt, childProps, eventKey, eventName) => {
11213
- // eslint-disable-next-line no-invalid-this
11214
11200
  const eventReturn = events[eventName](evt, childProps, eventKey, this);
11215
11201
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_3___default()(eventReturn)) {
11216
11202
  const callbacks = compileCallbacks(eventReturn);
11217
- // eslint-disable-next-line no-invalid-this
11218
11203
  this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
11219
11204
  }
11220
11205
  };
@@ -11244,7 +11229,7 @@ function getPartialEvents(events, eventKey, childProps) {
11244
11229
  // eslint-disable-next-line max-params
11245
11230
  function getEventState(eventKey, namespace, childType) {
11246
11231
  // Mandatory usage: `getEventState.bind(this)`
11247
- // eslint-disable-next-line no-invalid-this
11232
+
11248
11233
  const state = this.state || {};
11249
11234
  if (!childType) {
11250
11235
  return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
@@ -11437,7 +11422,6 @@ __webpack_require__.r(__webpack_exports__);
11437
11422
 
11438
11423
 
11439
11424
 
11440
- /* eslint-disable no-use-before-define */
11441
11425
 
11442
11426
  // Private Functions
11443
11427
 
@@ -11906,7 +11890,6 @@ __webpack_require__.r(__webpack_exports__);
11906
11890
  /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
11907
11891
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
11908
11892
 
11909
- /* eslint-disable no-use-before-define */
11910
11893
 
11911
11894
  // Private Functions
11912
11895
 
@@ -12226,7 +12209,6 @@ __webpack_require__.r(__webpack_exports__);
12226
12209
  /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
12227
12210
  /* harmony import */ var victory_vendor_d3_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-vendor/d3-scale */ "../../victory-vendor/es/d3-scale.js");
12228
12211
 
12229
- /* eslint-disable no-use-before-define */
12230
12212
 
12231
12213
 
12232
12214
 
@@ -13233,7 +13215,6 @@ function getDefaultDomainPadding(props, axis, childComponents) {
13233
13215
  };
13234
13216
  }
13235
13217
  function getDomainFromChildren(props, axis, childComponents) {
13236
- // eslint-disable-line max-statements, complexity, max-len
13237
13218
  const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
13238
13219
  const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
13239
13220
  const {
@@ -13591,7 +13572,6 @@ __webpack_require__.r(__webpack_exports__);
13591
13572
  /* harmony import */ var _cursor_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cursor-helpers */ "../../victory-cursor-container/es/cursor-helpers.js");
13592
13573
 
13593
13574
 
13594
- /* eslint-disable complexity */
13595
13575
 
13596
13576
 
13597
13577
 
@@ -13654,7 +13634,6 @@ const useVictoryCursorContainer = initialProps => {
13654
13634
  return victory_core__WEBPACK_IMPORTED_MODULE_5__.getPadding(props);
13655
13635
  };
13656
13636
  const getCursorElements = () => {
13657
- // eslint-disable-line max-statements
13658
13637
  const {
13659
13638
  scale,
13660
13639
  cursorLabelComponent,
@@ -14579,8 +14558,6 @@ class VictoryTooltip extends (react__WEBPACK_IMPORTED_MODULE_4___default().Compo
14579
14558
  y: Math.round(y + adjustments.y[0] - adjustments.y[1])
14580
14559
  };
14581
14560
  }
14582
-
14583
- // eslint-disable-next-line complexity
14584
14561
  getFlyoutCenter(props, dimensions) {
14585
14562
  const {
14586
14563
  x,
@@ -14855,7 +14832,6 @@ __webpack_require__.r(__webpack_exports__);
14855
14832
  /* harmony import */ var _voronoi_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./voronoi-helpers */ "../../victory-voronoi-container/es/voronoi-helpers.js");
14856
14833
 
14857
14834
 
14858
- /* eslint-disable react/no-multi-comp */
14859
14835
 
14860
14836
 
14861
14837
 
@@ -15304,7 +15280,6 @@ class VoronoiHelpersClass {
15304
15280
  return this.getParentMutation([]).concat(...inactiveMutations);
15305
15281
  };
15306
15282
  handleMouseMove = (evt, targetProps) => {
15307
- // eslint-disable-line max-statements
15308
15283
  const activePoints = targetProps.activePoints || [];
15309
15284
  const parentSVG = targetProps.parentSVG || victory_core__WEBPACK_IMPORTED_MODULE_9__.getParentSVG(evt);
15310
15285
  const mousePosition = victory_core__WEBPACK_IMPORTED_MODULE_9__.getSVGEventCoordinates(evt, parentSVG);
@@ -15765,7 +15740,7 @@ const RawZoomHelpers = {
15765
15740
  }
15766
15741
  }];
15767
15742
  },
15768
- // eslint-disable-next-line max-params, max-statements
15743
+ // eslint-disable-next-line max-params
15769
15744
  onMouseMove(evt, targetProps, eventKey, ctx) {
15770
15745
  if (targetProps.panning && targetProps.allowPan) {
15771
15746
  const {