victory-core 36.6.3 → 36.6.6
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 +25 -0
- package/dist/victory-core.js +2053 -4568
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -2
- package/es/types/callbacks.d.ts +0 -1
- package/es/types/prop-types.d.ts +3 -3
- package/es/v37/clone.d.ts +23 -0
- package/es/v37/clone.js +32 -0
- package/es/v37/index.d.ts +5 -0
- package/es/v37/index.js +4 -0
- package/es/{victory-state → v37/victory-state}/defaults.d.ts +0 -0
- package/es/{victory-state → v37/victory-state}/defaults.js +0 -0
- package/es/v37/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/es/{victory-state → v37/victory-state}/helpers/get-axis-data.js +1 -1
- package/es/{victory-state → v37/victory-state}/helpers/get-data.d.ts +1 -1
- package/es/{victory-state → v37/victory-state}/helpers/get-data.js +1 -1
- package/{lib → es/v37}/victory-state/helpers/get-domain.d.ts +1 -1
- package/es/{victory-state → v37/victory-state}/helpers/get-domain.js +1 -1
- package/{lib → es/v37}/victory-state/helpers/get-range.d.ts +1 -1
- package/es/{victory-state → v37/victory-state}/helpers/get-range.js +2 -2
- package/{lib → es/v37}/victory-state/helpers/get-scale.d.ts +1 -1
- package/es/{victory-state → v37/victory-state}/helpers/get-scale.js +2 -2
- package/es/v37/victory-state/index.d.ts +4 -0
- package/es/{victory-state/index.d.ts → v37/victory-state/index.js} +1 -1
- package/{lib → es/v37}/victory-state/types.d.ts +2 -2
- package/es/{victory-state → v37/victory-state}/types.js +0 -0
- package/{lib → es/v37}/victory-state/victory-provider.d.ts +5 -4
- package/es/{victory-state → v37/victory-state}/victory-provider.js +58 -27
- package/es/v37/victory-state/with-victory-provider.d.ts +7 -0
- package/es/v37/victory-state/with-victory-provider.js +43 -0
- package/es/{victory-util → v37}/with-container.d.ts +2 -2
- package/es/{victory-util → v37}/with-container.js +1 -1
- package/es/v37/with-normalized-props.d.ts +17 -0
- package/es/v37/with-normalized-props.js +18 -0
- package/es/victory-label/victory-label.d.ts +5 -4
- package/es/victory-util/helpers.d.ts +3 -2
- package/es/victory-util/immutable-types.d.ts +2523 -0
- package/es/victory-util/immutable.d.ts +1 -1
- package/es/victory-util/index.d.ts +0 -1
- package/es/victory-util/index.js +1 -2
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -14
- package/lib/types/callbacks.d.ts +0 -1
- package/lib/types/prop-types.d.ts +3 -3
- package/lib/v37/clone.d.ts +23 -0
- package/lib/v37/clone.js +43 -0
- package/lib/v37/index.d.ts +5 -0
- package/lib/v37/index.js +57 -0
- package/lib/{victory-state → v37/victory-state}/defaults.d.ts +0 -0
- package/lib/{victory-state → v37/victory-state}/defaults.js +0 -0
- package/lib/v37/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/lib/{victory-state → v37/victory-state}/helpers/get-axis-data.js +1 -1
- package/lib/{victory-state → v37/victory-state}/helpers/get-data.d.ts +1 -1
- package/lib/{victory-state → v37/victory-state}/helpers/get-data.js +1 -1
- package/{es → lib/v37}/victory-state/helpers/get-domain.d.ts +1 -1
- package/lib/{victory-state → v37/victory-state}/helpers/get-domain.js +1 -1
- package/{es → lib/v37}/victory-state/helpers/get-range.d.ts +1 -1
- package/lib/{victory-state → v37/victory-state}/helpers/get-range.js +2 -2
- package/{es → lib/v37}/victory-state/helpers/get-scale.d.ts +1 -1
- package/lib/{victory-state → v37/victory-state}/helpers/get-scale.js +2 -2
- package/lib/v37/victory-state/index.d.ts +4 -0
- package/lib/{victory-state → v37/victory-state}/index.js +13 -0
- package/{es → lib/v37}/victory-state/types.d.ts +2 -2
- package/lib/{victory-state → v37/victory-state}/types.js +0 -0
- package/{es → lib/v37}/victory-state/victory-provider.d.ts +5 -4
- package/lib/{victory-state → v37/victory-state}/victory-provider.js +60 -28
- package/lib/v37/victory-state/with-victory-provider.d.ts +7 -0
- package/lib/v37/victory-state/with-victory-provider.js +56 -0
- package/lib/{victory-util → v37}/with-container.d.ts +2 -2
- package/lib/{victory-util → v37}/with-container.js +1 -1
- package/lib/v37/with-normalized-props.d.ts +17 -0
- package/lib/v37/with-normalized-props.js +29 -0
- package/lib/victory-label/victory-label.d.ts +5 -4
- package/lib/victory-util/helpers.d.ts +3 -2
- package/lib/victory-util/immutable-types.d.ts +2523 -0
- package/lib/victory-util/immutable.d.ts +1 -1
- package/lib/victory-util/index.d.ts +0 -1
- package/lib/victory-util/index.js +0 -14
- package/package.json +2 -2
- package/src/index.ts +0 -1
- package/src/types/callbacks.ts +0 -2
- package/src/types/prop-types.ts +4 -3
- package/src/v37/clone.tsx +30 -0
- package/src/v37/index.tsx +4 -0
- package/src/{victory-state → v37/victory-state}/defaults.ts +0 -0
- package/src/{victory-state → v37/victory-state}/helpers/get-axis-data.ts +2 -2
- package/src/{victory-state → v37/victory-state}/helpers/get-data.ts +3 -3
- package/src/{victory-state → v37/victory-state}/helpers/get-domain.ts +2 -2
- package/src/{victory-state → v37/victory-state}/helpers/get-range.ts +3 -3
- package/src/{victory-state → v37/victory-state}/helpers/get-scale.ts +6 -3
- package/src/{victory-state → v37/victory-state}/index.ts +1 -0
- package/src/{victory-state → v37/victory-state}/types.ts +2 -2
- package/src/{victory-state → v37/victory-state}/victory-provider.tsx +61 -27
- package/src/v37/victory-state/with-victory-provider.tsx +53 -0
- package/src/{victory-util → v37}/with-container.tsx +2 -2
- package/src/v37/with-normalized-props.tsx +43 -0
- package/src/victory-label/victory-label.tsx +4 -4
- package/src/victory-util/data.ts +1 -1
- package/src/victory-util/helpers.ts +3 -2
- package/src/victory-util/immutable-types.d.ts +2523 -0
- package/src/victory-util/immutable.ts +1 -1
- package/src/victory-util/index.ts +0 -1
- package/es/victory-state/helpers/get-axis-data.d.ts +0 -3
- package/es/victory-state/index.js +0 -2
- package/lib/victory-state/helpers/get-axis-data.d.ts +0 -3
- package/lib/victory-state/index.d.ts +0 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withNormalizedProps = withNormalizedProps;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _victoryState = require("./victory-state");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
function withNormalizedProps(config, WrappedComponent) {
|
|
17
|
+
WrappedComponent.displayName = config.displayName;
|
|
18
|
+
var WithNormalizedProps = (0, _victoryState.withVictoryProvider)(function (props) {
|
|
19
|
+
var normalizedProps = (0, _victoryState.useVictoryContext)(function (v) {
|
|
20
|
+
return v;
|
|
21
|
+
});
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({}, props, normalizedProps), props.children);
|
|
23
|
+
});
|
|
24
|
+
return Object.assign(WithNormalizedProps, {
|
|
25
|
+
displayName: "WithNormalizedProps(".concat(config.displayName),
|
|
26
|
+
defaultProps: config.defaultProps,
|
|
27
|
+
propTypes: config.propTypes
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback
|
|
2
|
+
import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback } from "../types/callbacks";
|
|
3
|
+
import { ValueOrAccessor } from "../types/prop-types";
|
|
3
4
|
import { PaddingProps, VerticalAnchorType, VictoryLabelStyleObject } from "../victory-theme/victory-theme";
|
|
4
5
|
export declare type TextAnchorType = "start" | "middle" | "end" | "inherit";
|
|
5
6
|
export declare type OriginType = {
|
|
@@ -34,11 +35,11 @@ export interface VictoryLabelProps {
|
|
|
34
35
|
tabIndex?: NumberOrCallback;
|
|
35
36
|
text?: string[] | StringOrNumberOrCallback;
|
|
36
37
|
textComponent?: React.ReactElement;
|
|
37
|
-
textAnchor?:
|
|
38
|
+
textAnchor?: ValueOrAccessor<TextAnchorType>;
|
|
38
39
|
title?: string;
|
|
39
|
-
transform?:
|
|
40
|
+
transform?: ValueOrAccessor<string | object>;
|
|
40
41
|
tspanComponent?: React.ReactElement;
|
|
41
|
-
verticalAnchor?:
|
|
42
|
+
verticalAnchor?: ValueOrAccessor<VerticalAnchorType>;
|
|
42
43
|
x?: number;
|
|
43
44
|
y?: number;
|
|
44
45
|
dx?: StringOrNumberOrCallback;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CallbackArgs
|
|
2
|
+
import { CallbackArgs } from "../types/callbacks";
|
|
3
|
+
import { ValueOrAccessor } from "../types/prop-types";
|
|
3
4
|
/**
|
|
4
5
|
* creates an object with some keys excluded
|
|
5
6
|
* replacement for lodash.omit for performance. does not mimic the entire lodash.omit api
|
|
@@ -24,7 +25,7 @@ export declare function getPadding(props: any, name?: string): {
|
|
|
24
25
|
export declare function isTooltip(component: any): boolean;
|
|
25
26
|
export declare function getDefaultStyles(props: any, role: any): any;
|
|
26
27
|
export declare function getStyles(style: any, defaultStyles: any): any;
|
|
27
|
-
export declare function evaluateProp<TValue>(prop:
|
|
28
|
+
export declare function evaluateProp<TValue>(prop: ValueOrAccessor<TValue, CallbackArgs>, props: CallbackArgs): TValue;
|
|
28
29
|
export declare function evaluateStyle(style: any, props: any): any;
|
|
29
30
|
export declare function degreesToRadians(degrees: any): any;
|
|
30
31
|
export declare function radiansToDegrees(radians: any): any;
|