victory-core 36.9.2-next.3 → 36.9.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 (147) hide show
  1. package/CHANGELOG.md +22 -10
  2. package/README.md +1 -1
  3. package/dist/victory-core.js +124 -493
  4. package/dist/victory-core.min.js +1 -1
  5. package/es/index.d.ts +17 -17
  6. package/es/types/callbacks.d.ts +36 -36
  7. package/es/types/prop-types.d.ts +129 -129
  8. package/es/victory-accessible-group/victory-accessible-group.d.ts +10 -10
  9. package/es/victory-animation/util.d.ts +66 -66
  10. package/es/victory-animation/victory-animation.d.ts +34 -34
  11. package/es/victory-clip-container/victory-clip-container.d.ts +46 -46
  12. package/es/victory-container/victory-container.d.ts +68 -68
  13. package/es/victory-label/victory-label.d.ts +58 -58
  14. package/es/victory-portal/portal-context.d.ts +11 -11
  15. package/es/victory-portal/portal.d.ts +20 -20
  16. package/es/victory-portal/victory-portal.d.ts +26 -26
  17. package/es/victory-primitives/arc.d.ts +14 -14
  18. package/es/victory-primitives/background.d.ts +13 -13
  19. package/es/victory-primitives/border.d.ts +10 -10
  20. package/es/victory-primitives/circle.d.ts +3 -3
  21. package/es/victory-primitives/clip-path.d.ts +7 -7
  22. package/es/victory-primitives/index.d.ts +14 -14
  23. package/es/victory-primitives/line-segment.d.ts +11 -11
  24. package/es/victory-primitives/line.d.ts +3 -3
  25. package/es/victory-primitives/path.d.ts +3 -3
  26. package/es/victory-primitives/point.d.ts +13 -13
  27. package/es/victory-primitives/rect.d.ts +3 -3
  28. package/es/victory-primitives/text.d.ts +8 -8
  29. package/es/victory-primitives/tspan.d.ts +3 -3
  30. package/es/victory-primitives/types.d.ts +7 -7
  31. package/es/victory-primitives/whisker.d.ts +15 -15
  32. package/es/victory-theme/grayscale.d.ts +2 -2
  33. package/es/victory-theme/material.d.ts +2 -2
  34. package/es/victory-theme/types.d.ts +238 -238
  35. package/es/victory-theme/victory-theme.d.ts +5 -5
  36. package/es/victory-transition/victory-transition.d.ts +53 -53
  37. package/es/victory-util/add-events.d.ts +126 -126
  38. package/es/victory-util/add-events.js +4 -8
  39. package/es/victory-util/axis.d.ts +50 -50
  40. package/es/victory-util/axis.js +13 -6
  41. package/es/victory-util/collection.d.ts +15 -8
  42. package/es/victory-util/collection.js +16 -0
  43. package/es/victory-util/common-props.d.ts +79 -79
  44. package/es/victory-util/data.d.ts +74 -74
  45. package/es/victory-util/default-transitions.d.ts +4 -4
  46. package/es/victory-util/domain.d.ts +90 -90
  47. package/es/victory-util/events.d.ts +64 -64
  48. package/es/victory-util/helpers.d.ts +96 -91
  49. package/es/victory-util/helpers.js +12 -1
  50. package/es/victory-util/hooks/index.d.ts +2 -2
  51. package/es/victory-util/hooks/use-animation-state.d.ts +21 -21
  52. package/es/victory-util/hooks/use-previous-props.d.ts +1 -1
  53. package/es/victory-util/immutable.d.ts +11 -11
  54. package/es/victory-util/index.d.ts +26 -26
  55. package/es/victory-util/label-helpers.d.ts +26 -26
  56. package/es/victory-util/line-helpers.d.ts +4 -4
  57. package/es/victory-util/log.d.ts +1 -1
  58. package/es/victory-util/point-path-helpers.d.ts +9 -9
  59. package/es/victory-util/scale.d.ts +9 -9
  60. package/es/victory-util/selection.d.ts +28 -28
  61. package/es/victory-util/style.d.ts +18 -18
  62. package/es/victory-util/textsize.d.ts +35 -35
  63. package/es/victory-util/timer-context.d.ts +11 -11
  64. package/es/victory-util/timer.d.ts +16 -16
  65. package/es/victory-util/transitions.d.ts +48 -48
  66. package/es/victory-util/type-helpers.d.ts +9 -9
  67. package/es/victory-util/user-props.d.ts +26 -26
  68. package/es/victory-util/wrapper.d.ts +33 -37
  69. package/es/victory-util/wrapper.js +2 -2
  70. package/lib/index.d.ts +17 -17
  71. package/lib/types/callbacks.d.ts +36 -36
  72. package/lib/types/prop-types.d.ts +129 -129
  73. package/lib/victory-accessible-group/victory-accessible-group.d.ts +10 -10
  74. package/lib/victory-animation/util.d.ts +66 -66
  75. package/lib/victory-animation/victory-animation.d.ts +34 -34
  76. package/lib/victory-clip-container/victory-clip-container.d.ts +46 -46
  77. package/lib/victory-container/victory-container.d.ts +68 -68
  78. package/lib/victory-label/victory-label.d.ts +58 -58
  79. package/lib/victory-portal/portal-context.d.ts +11 -11
  80. package/lib/victory-portal/portal.d.ts +20 -20
  81. package/lib/victory-portal/victory-portal.d.ts +26 -26
  82. package/lib/victory-primitives/arc.d.ts +14 -14
  83. package/lib/victory-primitives/background.d.ts +13 -13
  84. package/lib/victory-primitives/border.d.ts +10 -10
  85. package/lib/victory-primitives/circle.d.ts +3 -3
  86. package/lib/victory-primitives/clip-path.d.ts +7 -7
  87. package/lib/victory-primitives/index.d.ts +14 -14
  88. package/lib/victory-primitives/line-segment.d.ts +11 -11
  89. package/lib/victory-primitives/line.d.ts +3 -3
  90. package/lib/victory-primitives/path.d.ts +3 -3
  91. package/lib/victory-primitives/point.d.ts +13 -13
  92. package/lib/victory-primitives/rect.d.ts +3 -3
  93. package/lib/victory-primitives/text.d.ts +8 -8
  94. package/lib/victory-primitives/tspan.d.ts +3 -3
  95. package/lib/victory-primitives/types.d.ts +7 -7
  96. package/lib/victory-primitives/whisker.d.ts +15 -15
  97. package/lib/victory-theme/grayscale.d.ts +2 -2
  98. package/lib/victory-theme/material.d.ts +2 -2
  99. package/lib/victory-theme/types.d.ts +238 -238
  100. package/lib/victory-theme/victory-theme.d.ts +5 -5
  101. package/lib/victory-transition/victory-transition.d.ts +53 -53
  102. package/lib/victory-util/add-events.d.ts +126 -126
  103. package/lib/victory-util/add-events.js +6 -6
  104. package/lib/victory-util/axis.d.ts +50 -50
  105. package/lib/victory-util/axis.js +13 -7
  106. package/lib/victory-util/collection.d.ts +15 -8
  107. package/lib/victory-util/collection.js +18 -0
  108. package/lib/victory-util/common-props.d.ts +79 -79
  109. package/lib/victory-util/data.d.ts +74 -74
  110. package/lib/victory-util/default-transitions.d.ts +4 -4
  111. package/lib/victory-util/domain.d.ts +90 -90
  112. package/lib/victory-util/events.d.ts +64 -64
  113. package/lib/victory-util/helpers.d.ts +96 -91
  114. package/lib/victory-util/helpers.js +13 -0
  115. package/lib/victory-util/hooks/index.d.ts +2 -2
  116. package/lib/victory-util/hooks/use-animation-state.d.ts +21 -21
  117. package/lib/victory-util/hooks/use-previous-props.d.ts +1 -1
  118. package/lib/victory-util/immutable.d.ts +11 -11
  119. package/lib/victory-util/index.d.ts +26 -26
  120. package/lib/victory-util/label-helpers.d.ts +26 -26
  121. package/lib/victory-util/line-helpers.d.ts +4 -4
  122. package/lib/victory-util/log.d.ts +1 -1
  123. package/lib/victory-util/point-path-helpers.d.ts +9 -9
  124. package/lib/victory-util/scale.d.ts +9 -9
  125. package/lib/victory-util/selection.d.ts +28 -28
  126. package/lib/victory-util/style.d.ts +18 -18
  127. package/lib/victory-util/textsize.d.ts +35 -35
  128. package/lib/victory-util/timer-context.d.ts +11 -11
  129. package/lib/victory-util/timer.d.ts +16 -16
  130. package/lib/victory-util/transitions.d.ts +48 -48
  131. package/lib/victory-util/type-helpers.d.ts +9 -9
  132. package/lib/victory-util/user-props.d.ts +26 -26
  133. package/lib/victory-util/wrapper.d.ts +33 -37
  134. package/lib/victory-util/wrapper.js +2 -2
  135. package/package.json +6 -3
  136. package/src/types/prop-types.ts +0 -7
  137. package/src/victory-container/victory-container.tsx +195 -171
  138. package/src/victory-portal/portal-context.ts +4 -5
  139. package/src/victory-portal/portal.tsx +42 -5
  140. package/src/victory-portal/victory-portal.tsx +71 -34
  141. package/src/victory-util/add-events.tsx +6 -4
  142. package/src/victory-util/axis.tsx +12 -3
  143. package/src/victory-util/collection.tsx +13 -0
  144. package/src/victory-util/helpers.ts +11 -0
  145. package/src/victory-util/index.ts +0 -1
  146. package/src/victory-util/wrapper.tsx +1 -0
  147. package/src/victory-util/merge-refs.ts +0 -13
@@ -27,6 +27,17 @@ function getPolarRange(props, axis) {
27
27
 
28
28
  // Exported Functions
29
29
 
30
+ /**
31
+ * Creates an object composed of the inverted keys and values of object.
32
+ * If object contains duplicate values, subsequent values overwrite property assignments of previous values.
33
+ */
34
+ export function invert(original: Record<string, string | number>) {
35
+ return Object.entries(original).reduce((acc, current) => {
36
+ acc[current[1]] = current[0];
37
+ return acc;
38
+ }, {});
39
+ }
40
+
30
41
  /**
31
42
  * creates an object with some keys excluded
32
43
  * replacement for lodash.omit for performance. does not mimic the entire lodash.omit api
@@ -1,5 +1,4 @@
1
1
  export * from "./add-events";
2
- export * from "./merge-refs";
3
2
  export * as Axis from "./axis";
4
3
  export * as Collection from "./collection";
5
4
  export * from "./common-props";
@@ -345,6 +345,7 @@ export function getChildStyle(child, index, calculatedProps) {
345
345
  );
346
346
  const labelsStyle = defaults({}, childStyle.labels, style.labels);
347
347
  return {
348
+ ...childStyle,
348
349
  parent: style.parent,
349
350
  data: dataStyle,
350
351
  labels: labelsStyle,
@@ -1,13 +0,0 @@
1
- type Ref<T> = React.MutableRefObject<T> | React.LegacyRef<T> | undefined | null;
2
-
3
- export function mergeRefs<T>(refs: Ref<T>[]): React.RefCallback<T> {
4
- return (value) => {
5
- refs.forEach((ref) => {
6
- if (typeof ref === "function") {
7
- ref(value);
8
- } else if (ref !== null && ref !== undefined) {
9
- (ref as React.MutableRefObject<T | null>).current = value;
10
- }
11
- });
12
- };
13
- }