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.
- package/CHANGELOG.md +22 -10
- package/README.md +1 -1
- package/dist/victory-core.js +124 -493
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +17 -17
- package/es/types/callbacks.d.ts +36 -36
- package/es/types/prop-types.d.ts +129 -129
- package/es/victory-accessible-group/victory-accessible-group.d.ts +10 -10
- package/es/victory-animation/util.d.ts +66 -66
- package/es/victory-animation/victory-animation.d.ts +34 -34
- package/es/victory-clip-container/victory-clip-container.d.ts +46 -46
- package/es/victory-container/victory-container.d.ts +68 -68
- package/es/victory-label/victory-label.d.ts +58 -58
- package/es/victory-portal/portal-context.d.ts +11 -11
- package/es/victory-portal/portal.d.ts +20 -20
- package/es/victory-portal/victory-portal.d.ts +26 -26
- package/es/victory-primitives/arc.d.ts +14 -14
- package/es/victory-primitives/background.d.ts +13 -13
- package/es/victory-primitives/border.d.ts +10 -10
- package/es/victory-primitives/circle.d.ts +3 -3
- package/es/victory-primitives/clip-path.d.ts +7 -7
- package/es/victory-primitives/index.d.ts +14 -14
- package/es/victory-primitives/line-segment.d.ts +11 -11
- package/es/victory-primitives/line.d.ts +3 -3
- package/es/victory-primitives/path.d.ts +3 -3
- package/es/victory-primitives/point.d.ts +13 -13
- package/es/victory-primitives/rect.d.ts +3 -3
- package/es/victory-primitives/text.d.ts +8 -8
- package/es/victory-primitives/tspan.d.ts +3 -3
- package/es/victory-primitives/types.d.ts +7 -7
- package/es/victory-primitives/whisker.d.ts +15 -15
- package/es/victory-theme/grayscale.d.ts +2 -2
- package/es/victory-theme/material.d.ts +2 -2
- package/es/victory-theme/types.d.ts +238 -238
- package/es/victory-theme/victory-theme.d.ts +5 -5
- package/es/victory-transition/victory-transition.d.ts +53 -53
- package/es/victory-util/add-events.d.ts +126 -126
- package/es/victory-util/add-events.js +4 -8
- package/es/victory-util/axis.d.ts +50 -50
- package/es/victory-util/axis.js +13 -6
- package/es/victory-util/collection.d.ts +15 -8
- package/es/victory-util/collection.js +16 -0
- package/es/victory-util/common-props.d.ts +79 -79
- package/es/victory-util/data.d.ts +74 -74
- package/es/victory-util/default-transitions.d.ts +4 -4
- package/es/victory-util/domain.d.ts +90 -90
- package/es/victory-util/events.d.ts +64 -64
- package/es/victory-util/helpers.d.ts +96 -91
- package/es/victory-util/helpers.js +12 -1
- package/es/victory-util/hooks/index.d.ts +2 -2
- package/es/victory-util/hooks/use-animation-state.d.ts +21 -21
- package/es/victory-util/hooks/use-previous-props.d.ts +1 -1
- package/es/victory-util/immutable.d.ts +11 -11
- package/es/victory-util/index.d.ts +26 -26
- package/es/victory-util/label-helpers.d.ts +26 -26
- package/es/victory-util/line-helpers.d.ts +4 -4
- package/es/victory-util/log.d.ts +1 -1
- package/es/victory-util/point-path-helpers.d.ts +9 -9
- package/es/victory-util/scale.d.ts +9 -9
- package/es/victory-util/selection.d.ts +28 -28
- package/es/victory-util/style.d.ts +18 -18
- package/es/victory-util/textsize.d.ts +35 -35
- package/es/victory-util/timer-context.d.ts +11 -11
- package/es/victory-util/timer.d.ts +16 -16
- package/es/victory-util/transitions.d.ts +48 -48
- package/es/victory-util/type-helpers.d.ts +9 -9
- package/es/victory-util/user-props.d.ts +26 -26
- package/es/victory-util/wrapper.d.ts +33 -37
- package/es/victory-util/wrapper.js +2 -2
- package/lib/index.d.ts +17 -17
- package/lib/types/callbacks.d.ts +36 -36
- package/lib/types/prop-types.d.ts +129 -129
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +10 -10
- package/lib/victory-animation/util.d.ts +66 -66
- package/lib/victory-animation/victory-animation.d.ts +34 -34
- package/lib/victory-clip-container/victory-clip-container.d.ts +46 -46
- package/lib/victory-container/victory-container.d.ts +68 -68
- package/lib/victory-label/victory-label.d.ts +58 -58
- package/lib/victory-portal/portal-context.d.ts +11 -11
- package/lib/victory-portal/portal.d.ts +20 -20
- package/lib/victory-portal/victory-portal.d.ts +26 -26
- package/lib/victory-primitives/arc.d.ts +14 -14
- package/lib/victory-primitives/background.d.ts +13 -13
- package/lib/victory-primitives/border.d.ts +10 -10
- package/lib/victory-primitives/circle.d.ts +3 -3
- package/lib/victory-primitives/clip-path.d.ts +7 -7
- package/lib/victory-primitives/index.d.ts +14 -14
- package/lib/victory-primitives/line-segment.d.ts +11 -11
- package/lib/victory-primitives/line.d.ts +3 -3
- package/lib/victory-primitives/path.d.ts +3 -3
- package/lib/victory-primitives/point.d.ts +13 -13
- package/lib/victory-primitives/rect.d.ts +3 -3
- package/lib/victory-primitives/text.d.ts +8 -8
- package/lib/victory-primitives/tspan.d.ts +3 -3
- package/lib/victory-primitives/types.d.ts +7 -7
- package/lib/victory-primitives/whisker.d.ts +15 -15
- package/lib/victory-theme/grayscale.d.ts +2 -2
- package/lib/victory-theme/material.d.ts +2 -2
- package/lib/victory-theme/types.d.ts +238 -238
- package/lib/victory-theme/victory-theme.d.ts +5 -5
- package/lib/victory-transition/victory-transition.d.ts +53 -53
- package/lib/victory-util/add-events.d.ts +126 -126
- package/lib/victory-util/add-events.js +6 -6
- package/lib/victory-util/axis.d.ts +50 -50
- package/lib/victory-util/axis.js +13 -7
- package/lib/victory-util/collection.d.ts +15 -8
- package/lib/victory-util/collection.js +18 -0
- package/lib/victory-util/common-props.d.ts +79 -79
- package/lib/victory-util/data.d.ts +74 -74
- package/lib/victory-util/default-transitions.d.ts +4 -4
- package/lib/victory-util/domain.d.ts +90 -90
- package/lib/victory-util/events.d.ts +64 -64
- package/lib/victory-util/helpers.d.ts +96 -91
- package/lib/victory-util/helpers.js +13 -0
- package/lib/victory-util/hooks/index.d.ts +2 -2
- package/lib/victory-util/hooks/use-animation-state.d.ts +21 -21
- package/lib/victory-util/hooks/use-previous-props.d.ts +1 -1
- package/lib/victory-util/immutable.d.ts +11 -11
- package/lib/victory-util/index.d.ts +26 -26
- package/lib/victory-util/label-helpers.d.ts +26 -26
- package/lib/victory-util/line-helpers.d.ts +4 -4
- package/lib/victory-util/log.d.ts +1 -1
- package/lib/victory-util/point-path-helpers.d.ts +9 -9
- package/lib/victory-util/scale.d.ts +9 -9
- package/lib/victory-util/selection.d.ts +28 -28
- package/lib/victory-util/style.d.ts +18 -18
- package/lib/victory-util/textsize.d.ts +35 -35
- package/lib/victory-util/timer-context.d.ts +11 -11
- package/lib/victory-util/timer.d.ts +16 -16
- package/lib/victory-util/transitions.d.ts +48 -48
- package/lib/victory-util/type-helpers.d.ts +9 -9
- package/lib/victory-util/user-props.d.ts +26 -26
- package/lib/victory-util/wrapper.d.ts +33 -37
- package/lib/victory-util/wrapper.js +2 -2
- package/package.json +6 -3
- package/src/types/prop-types.ts +0 -7
- package/src/victory-container/victory-container.tsx +195 -171
- package/src/victory-portal/portal-context.ts +4 -5
- package/src/victory-portal/portal.tsx +42 -5
- package/src/victory-portal/victory-portal.tsx +71 -34
- package/src/victory-util/add-events.tsx +6 -4
- package/src/victory-util/axis.tsx +12 -3
- package/src/victory-util/collection.tsx +13 -0
- package/src/victory-util/helpers.ts +11 -0
- package/src/victory-util/index.ts +0 -1
- package/src/victory-util/wrapper.tsx +1 -0
- package/src/victory-util/merge-refs.ts +0 -13
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert length-type parameters from specific measurement units to pixels
|
|
3
|
-
* @param {string} length Css length string value.
|
|
4
|
-
* @param {number} fontSize Current text font-size.
|
|
5
|
-
* @returns {number} Approximate Css length in pixels.
|
|
6
|
-
*/
|
|
7
|
-
export declare const convertLengthToPixels: (length: string, fontSize?: number) => number;
|
|
8
|
-
export interface TextSizeStyleInterface {
|
|
9
|
-
angle?: number;
|
|
10
|
-
fontFamily?: string;
|
|
11
|
-
fontSize?: number | string;
|
|
12
|
-
letterSpacing?: string;
|
|
13
|
-
lineHeight?: number;
|
|
14
|
-
}
|
|
15
|
-
export declare const _approximateTextSizeInternal: {
|
|
16
|
-
impl: (text: string | string[], style?: TextSizeStyleInterface, __debugForceApproximate?: boolean) => {
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Predict text size by font params.
|
|
23
|
-
* @param {string|string[]} text Content for width calculation.
|
|
24
|
-
* @param {Object} style Text styles, ,fontFamily, fontSize, etc.
|
|
25
|
-
* @param {string} style.fontFamily Text fontFamily.
|
|
26
|
-
* @param {(number|string)} style.fontSize Text fontSize.
|
|
27
|
-
* @param {number} style.angle Text rotate angle.
|
|
28
|
-
* @param {string} style.letterSpacing Text letterSpacing(space between letters).
|
|
29
|
-
* @param {number} style.lineHeight Line height coefficient.
|
|
30
|
-
* @returns {number} Approximate text label height.
|
|
31
|
-
*/
|
|
32
|
-
export declare const approximateTextSize: (text: string | string[], style?: TextSizeStyleInterface) => {
|
|
33
|
-
width: number;
|
|
34
|
-
height: number;
|
|
35
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Convert length-type parameters from specific measurement units to pixels
|
|
3
|
+
* @param {string} length Css length string value.
|
|
4
|
+
* @param {number} fontSize Current text font-size.
|
|
5
|
+
* @returns {number} Approximate Css length in pixels.
|
|
6
|
+
*/
|
|
7
|
+
export declare const convertLengthToPixels: (length: string, fontSize?: number) => number;
|
|
8
|
+
export interface TextSizeStyleInterface {
|
|
9
|
+
angle?: number;
|
|
10
|
+
fontFamily?: string;
|
|
11
|
+
fontSize?: number | string;
|
|
12
|
+
letterSpacing?: string;
|
|
13
|
+
lineHeight?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const _approximateTextSizeInternal: {
|
|
16
|
+
impl: (text: string | string[], style?: TextSizeStyleInterface, __debugForceApproximate?: boolean) => {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Predict text size by font params.
|
|
23
|
+
* @param {string|string[]} text Content for width calculation.
|
|
24
|
+
* @param {Object} style Text styles, ,fontFamily, fontSize, etc.
|
|
25
|
+
* @param {string} style.fontFamily Text fontFamily.
|
|
26
|
+
* @param {(number|string)} style.fontSize Text fontSize.
|
|
27
|
+
* @param {number} style.angle Text rotate angle.
|
|
28
|
+
* @param {string} style.letterSpacing Text letterSpacing(space between letters).
|
|
29
|
+
* @param {number} style.lineHeight Line height coefficient.
|
|
30
|
+
* @returns {number} Approximate text label height.
|
|
31
|
+
*/
|
|
32
|
+
export declare const approximateTextSize: (text: string | string[], style?: TextSizeStyleInterface) => {
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
};
|
|
36
36
|
//# sourceMappingURL=textsize.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Timer from "./timer";
|
|
3
|
-
/**
|
|
4
|
-
* The React context object consumers may use to access or override the global
|
|
5
|
-
* timer.
|
|
6
|
-
*/
|
|
7
|
-
declare const TimerContext: React.Context<{
|
|
8
|
-
transitionTimer: Timer;
|
|
9
|
-
animationTimer: Timer;
|
|
10
|
-
}>;
|
|
11
|
-
export default TimerContext;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Timer from "./timer";
|
|
3
|
+
/**
|
|
4
|
+
* The React context object consumers may use to access or override the global
|
|
5
|
+
* timer.
|
|
6
|
+
*/
|
|
7
|
+
declare const TimerContext: React.Context<{
|
|
8
|
+
transitionTimer: Timer;
|
|
9
|
+
animationTimer: Timer;
|
|
10
|
+
}>;
|
|
11
|
+
export default TimerContext;
|
|
12
12
|
//# sourceMappingURL=timer-context.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
declare type TimerCallback = (elapsed: number, duration: number) => void;
|
|
2
|
-
export default class Timer {
|
|
3
|
-
private shouldAnimate;
|
|
4
|
-
private readonly subscribers;
|
|
5
|
-
private activeSubscriptions;
|
|
6
|
-
private timer;
|
|
7
|
-
constructor();
|
|
8
|
-
bypassAnimation(): void;
|
|
9
|
-
resumeAnimation(): void;
|
|
10
|
-
loop: () => void;
|
|
11
|
-
start(): void;
|
|
12
|
-
stop(): void;
|
|
13
|
-
subscribe(callback: TimerCallback, duration: number): number;
|
|
14
|
-
unsubscribe(id: any): void;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
1
|
+
declare type TimerCallback = (elapsed: number, duration: number) => void;
|
|
2
|
+
export default class Timer {
|
|
3
|
+
private shouldAnimate;
|
|
4
|
+
private readonly subscribers;
|
|
5
|
+
private activeSubscriptions;
|
|
6
|
+
private timer;
|
|
7
|
+
constructor();
|
|
8
|
+
bypassAnimation(): void;
|
|
9
|
+
resumeAnimation(): void;
|
|
10
|
+
loop: () => void;
|
|
11
|
+
start(): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
subscribe(callback: TimerCallback, duration: number): number;
|
|
14
|
+
unsubscribe(id: any): void;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
17
|
//# sourceMappingURL=timer.d.ts.map
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { AnimatePropTypeInterface } from "../types/prop-types";
|
|
2
|
-
/**
|
|
3
|
-
* If a parent component has animation enabled, calculate the transitions
|
|
4
|
-
* for any data of any child component that supports data transitions.
|
|
5
|
-
* Data transitions are defined as any two datasets where data nodes exist
|
|
6
|
-
* in the first set and not the second, in the second and not the first,
|
|
7
|
-
* or both.
|
|
8
|
-
*
|
|
9
|
-
* @param {Children} oldChildren this.props.children from old props
|
|
10
|
-
* @param {Children} nextChildren this.props.children from next props
|
|
11
|
-
*
|
|
12
|
-
* @return {Object} Object with the following properties:
|
|
13
|
-
* - nodesWillExit
|
|
14
|
-
* - nodesWillEnter
|
|
15
|
-
* - childrenTransitions
|
|
16
|
-
* - nodesShouldEnter
|
|
17
|
-
*/
|
|
18
|
-
export declare function getInitialTransitionState(oldChildren: any, nextChildren: any): {
|
|
19
|
-
nodesWillExit: boolean;
|
|
20
|
-
nodesWillEnter: boolean;
|
|
21
|
-
childrenTransitions: any;
|
|
22
|
-
nodesShouldEnter: boolean;
|
|
23
|
-
};
|
|
24
|
-
declare type TransitionProps = {
|
|
25
|
-
data: any;
|
|
26
|
-
animate?: AnimatePropTypeInterface;
|
|
27
|
-
clipWidth?: number;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* getTransitionPropsFactory - putting the Java in JavaScript. This will return a
|
|
31
|
-
* function that returns prop transformations for a child, given that child's props
|
|
32
|
-
* and its index in the parent's children array.
|
|
33
|
-
*
|
|
34
|
-
* In particular, this will include an `animate` object that is set appropriately
|
|
35
|
-
* so that each child will be synchronized for each stage of a transition
|
|
36
|
-
* animation. It will also include a transformed `data` object, where each datum
|
|
37
|
-
* is transformed by `animate.onExit` and `animate.onEnter` `before` and `after`
|
|
38
|
-
* functions.
|
|
39
|
-
*
|
|
40
|
-
* @param {Object} props `this.props` for the parent component.
|
|
41
|
-
* @param {Object} state `this.state` for the parent component.
|
|
42
|
-
* @param {Function} setState Function that, when called, will `this.setState` on
|
|
43
|
-
* the parent component with the provided object.
|
|
44
|
-
*
|
|
45
|
-
* @return {Function} Child-prop transformation function.
|
|
46
|
-
*/
|
|
47
|
-
export declare function getTransitionPropsFactory(props: any, state: any, setState: any): (child: any, index: any) => TransitionProps;
|
|
48
|
-
export {};
|
|
1
|
+
import { AnimatePropTypeInterface } from "../types/prop-types";
|
|
2
|
+
/**
|
|
3
|
+
* If a parent component has animation enabled, calculate the transitions
|
|
4
|
+
* for any data of any child component that supports data transitions.
|
|
5
|
+
* Data transitions are defined as any two datasets where data nodes exist
|
|
6
|
+
* in the first set and not the second, in the second and not the first,
|
|
7
|
+
* or both.
|
|
8
|
+
*
|
|
9
|
+
* @param {Children} oldChildren this.props.children from old props
|
|
10
|
+
* @param {Children} nextChildren this.props.children from next props
|
|
11
|
+
*
|
|
12
|
+
* @return {Object} Object with the following properties:
|
|
13
|
+
* - nodesWillExit
|
|
14
|
+
* - nodesWillEnter
|
|
15
|
+
* - childrenTransitions
|
|
16
|
+
* - nodesShouldEnter
|
|
17
|
+
*/
|
|
18
|
+
export declare function getInitialTransitionState(oldChildren: any, nextChildren: any): {
|
|
19
|
+
nodesWillExit: boolean;
|
|
20
|
+
nodesWillEnter: boolean;
|
|
21
|
+
childrenTransitions: any;
|
|
22
|
+
nodesShouldEnter: boolean;
|
|
23
|
+
};
|
|
24
|
+
declare type TransitionProps = {
|
|
25
|
+
data: any;
|
|
26
|
+
animate?: AnimatePropTypeInterface;
|
|
27
|
+
clipWidth?: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* getTransitionPropsFactory - putting the Java in JavaScript. This will return a
|
|
31
|
+
* function that returns prop transformations for a child, given that child's props
|
|
32
|
+
* and its index in the parent's children array.
|
|
33
|
+
*
|
|
34
|
+
* In particular, this will include an `animate` object that is set appropriately
|
|
35
|
+
* so that each child will be synchronized for each stage of a transition
|
|
36
|
+
* animation. It will also include a transformed `data` object, where each datum
|
|
37
|
+
* is transformed by `animate.onExit` and `animate.onEnter` `before` and `after`
|
|
38
|
+
* functions.
|
|
39
|
+
*
|
|
40
|
+
* @param {Object} props `this.props` for the parent component.
|
|
41
|
+
* @param {Object} state `this.state` for the parent component.
|
|
42
|
+
* @param {Function} setState Function that, when called, will `this.setState` on
|
|
43
|
+
* the parent component with the provided object.
|
|
44
|
+
*
|
|
45
|
+
* @return {Function} Child-prop transformation function.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getTransitionPropsFactory(props: any, state: any, setState: any): (child: any, index: any) => TransitionProps;
|
|
48
|
+
export {};
|
|
49
49
|
//# sourceMappingURL=transitions.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ForAxes, AxisType, Tuple, Datum, DatumValue } from "../types/prop-types";
|
|
2
|
-
export declare function hasValueForAxis<T = unknown>(value: unknown | ForAxes<T>, axis: AxisType): value is ForAxes<T>;
|
|
3
|
-
export declare function isTuple<T = unknown>(value: unknown): value is Tuple<T>;
|
|
4
|
-
export declare function getValueForAxis<T = unknown>(value: T | ForAxes<T> | undefined, axis: AxisType): T | undefined;
|
|
5
|
-
export declare function isFunction<T = Function>(func?: unknown): func is T;
|
|
6
|
-
export declare function isDate(value: unknown): value is Date;
|
|
7
|
-
export declare function isKeyValueObject(datum: Datum): datum is {
|
|
8
|
-
[key: string]: DatumValue;
|
|
9
|
-
};
|
|
1
|
+
import { ForAxes, AxisType, Tuple, Datum, DatumValue } from "../types/prop-types";
|
|
2
|
+
export declare function hasValueForAxis<T = unknown>(value: unknown | ForAxes<T>, axis: AxisType): value is ForAxes<T>;
|
|
3
|
+
export declare function isTuple<T = unknown>(value: unknown): value is Tuple<T>;
|
|
4
|
+
export declare function getValueForAxis<T = unknown>(value: T | ForAxes<T> | undefined, axis: AxisType): T | undefined;
|
|
5
|
+
export declare function isFunction<T = Function>(func?: unknown): func is T;
|
|
6
|
+
export declare function isDate(value: unknown): value is Date;
|
|
7
|
+
export declare function isKeyValueObject(datum: Datum): datum is {
|
|
8
|
+
[key: string]: DatumValue;
|
|
9
|
+
};
|
|
10
10
|
//# sourceMappingURL=type-helpers.d.ts.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
declare type SafeAttribute = string;
|
|
3
|
-
/**
|
|
4
|
-
* Asserts that value is not null or undefined, throwing an error if it is.
|
|
5
|
-
* @param value The value to assert
|
|
6
|
-
* @param message The error message to throw
|
|
7
|
-
*/
|
|
8
|
-
export declare function assert<T>(value: T, message?: string): asserts value is NonNullable<T>;
|
|
9
|
-
/**
|
|
10
|
-
* getSafeUserProps - function that takes in a props object and removes any
|
|
11
|
-
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
12
|
-
* object.
|
|
13
|
-
*
|
|
14
|
-
* @param {Object} props: props to be filtered against USER_PROPS_SAFELIST
|
|
15
|
-
* @returns {Object}: object containing remaining acceptable props
|
|
16
|
-
*/
|
|
17
|
-
export declare const getSafeUserProps: <T>(props: T) => Record<SafeAttribute, string>;
|
|
18
|
-
/**
|
|
19
|
-
* Wraps a component and adds safe user props
|
|
20
|
-
*
|
|
21
|
-
* @param {ReactElement} component: parent component
|
|
22
|
-
* @param {Object} props: props to be filtered
|
|
23
|
-
* @returns {ReactElement} modified component
|
|
24
|
-
*/
|
|
25
|
-
export declare const withSafeUserProps: (component: React.ReactElement, props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
26
|
-
export {};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare type SafeAttribute = string;
|
|
3
|
+
/**
|
|
4
|
+
* Asserts that value is not null or undefined, throwing an error if it is.
|
|
5
|
+
* @param value The value to assert
|
|
6
|
+
* @param message The error message to throw
|
|
7
|
+
*/
|
|
8
|
+
export declare function assert<T>(value: T, message?: string): asserts value is NonNullable<T>;
|
|
9
|
+
/**
|
|
10
|
+
* getSafeUserProps - function that takes in a props object and removes any
|
|
11
|
+
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
12
|
+
* object.
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} props: props to be filtered against USER_PROPS_SAFELIST
|
|
15
|
+
* @returns {Object}: object containing remaining acceptable props
|
|
16
|
+
*/
|
|
17
|
+
export declare const getSafeUserProps: <T>(props: T) => Record<SafeAttribute, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Wraps a component and adds safe user props
|
|
20
|
+
*
|
|
21
|
+
* @param {ReactElement} component: parent component
|
|
22
|
+
* @param {Object} props: props to be filtered
|
|
23
|
+
* @returns {ReactElement} modified component
|
|
24
|
+
*/
|
|
25
|
+
export declare const withSafeUserProps: (component: React.ReactElement, props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
26
|
+
export {};
|
|
27
27
|
//# sourceMappingURL=user-props.d.ts.map
|
|
@@ -1,38 +1,34 @@
|
|
|
1
|
-
export declare function addBinsToParentPropsIfHistogram({ children, props, childComponents, parentProps, }: {
|
|
2
|
-
children: any;
|
|
3
|
-
props: any;
|
|
4
|
-
childComponents: any;
|
|
5
|
-
parentProps: any;
|
|
6
|
-
}): any;
|
|
7
|
-
export declare function getDataFromChildren(props: any, childComponents: any): any[][];
|
|
8
|
-
export declare function getData(props: any, childComponents: any): any;
|
|
9
|
-
export declare function getWidth(props: any, groupLength?: any, seriesLength?: any): number;
|
|
10
|
-
export declare function getDefaultDomainPadding(props: any, axis: any, childComponents: any): {
|
|
11
|
-
x: number;
|
|
12
|
-
} | undefined;
|
|
13
|
-
export declare function getDomainFromChildren(props: any, axis: any, childComponents: any): (number | Date)[];
|
|
14
|
-
export declare function getDomain(props: any, axis: any, childComponents: any): any;
|
|
15
|
-
export declare function getScale(props: any, axis: any, childComponents?: any): import("..").D3Scale<any>;
|
|
16
|
-
export declare function getAllEvents(props: any): any;
|
|
17
|
-
export declare function getColor(calculatedProps: any, child: any, index: any): any;
|
|
18
|
-
export declare function getStyle(theme: any, style: any, role: any): any;
|
|
19
|
-
export declare function getChildStyle(child: any, index: any, calculatedProps: any): any
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export declare function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare function
|
|
31
|
-
x: any
|
|
32
|
-
y: any
|
|
33
|
-
};
|
|
34
|
-
export declare function getCategories(props: any, childComponents: any, allStrings?: any): {
|
|
35
|
-
x: any;
|
|
36
|
-
y: any;
|
|
37
|
-
};
|
|
1
|
+
export declare function addBinsToParentPropsIfHistogram({ children, props, childComponents, parentProps, }: {
|
|
2
|
+
children: any;
|
|
3
|
+
props: any;
|
|
4
|
+
childComponents: any;
|
|
5
|
+
parentProps: any;
|
|
6
|
+
}): any;
|
|
7
|
+
export declare function getDataFromChildren(props: any, childComponents: any): any[][];
|
|
8
|
+
export declare function getData(props: any, childComponents: any): any;
|
|
9
|
+
export declare function getWidth(props: any, groupLength?: any, seriesLength?: any): number;
|
|
10
|
+
export declare function getDefaultDomainPadding(props: any, axis: any, childComponents: any): {
|
|
11
|
+
x: number;
|
|
12
|
+
} | undefined;
|
|
13
|
+
export declare function getDomainFromChildren(props: any, axis: any, childComponents: any): (number | Date)[];
|
|
14
|
+
export declare function getDomain(props: any, axis: any, childComponents: any): any;
|
|
15
|
+
export declare function getScale(props: any, axis: any, childComponents?: any): import("..").D3Scale<any>;
|
|
16
|
+
export declare function getAllEvents(props: any): any;
|
|
17
|
+
export declare function getColor(calculatedProps: any, child: any, index: any): any;
|
|
18
|
+
export declare function getStyle(theme: any, style: any, role: any): any;
|
|
19
|
+
export declare function getChildStyle(child: any, index: any, calculatedProps: any): any;
|
|
20
|
+
export declare function getStringsFromCategories(childComponents: any, axis: any): any[];
|
|
21
|
+
export declare function getStringsFromData(childComponents: any): {
|
|
22
|
+
x: number[];
|
|
23
|
+
y: number[];
|
|
24
|
+
};
|
|
25
|
+
export declare function getCategoryAndAxisStringsFromChildren(props: any, axis: any, childComponents: any): any[];
|
|
26
|
+
export declare function getStringsFromChildren(props: any, childComponents: any): {
|
|
27
|
+
x: any[];
|
|
28
|
+
y: any[];
|
|
29
|
+
};
|
|
30
|
+
export declare function getCategories(props: any, childComponents: any, allStrings?: any): {
|
|
31
|
+
x: any;
|
|
32
|
+
y: any;
|
|
33
|
+
};
|
|
38
34
|
//# sourceMappingURL=wrapper.d.ts.map
|
|
@@ -348,11 +348,11 @@ export function getChildStyle(child, index, calculatedProps) {
|
|
|
348
348
|
|
|
349
349
|
var labelsStyle = _defaults({}, childStyle.labels, style.labels);
|
|
350
350
|
|
|
351
|
-
return {
|
|
351
|
+
return _objectSpread(_objectSpread({}, childStyle), {}, {
|
|
352
352
|
parent: style.parent,
|
|
353
353
|
data: dataStyle,
|
|
354
354
|
labels: labelsStyle
|
|
355
|
-
};
|
|
355
|
+
});
|
|
356
356
|
}
|
|
357
357
|
export function getStringsFromCategories(childComponents, axis) {
|
|
358
358
|
var iteratee = function (child) {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export * from "./types/callbacks";
|
|
2
|
-
export * from "./types/prop-types";
|
|
3
|
-
export * from "./victory-accessible-group/victory-accessible-group";
|
|
4
|
-
export * from "./victory-animation/victory-animation";
|
|
5
|
-
export * from "./victory-container/victory-container";
|
|
6
|
-
export * from "./victory-label/victory-label";
|
|
7
|
-
export * from "./victory-transition/victory-transition";
|
|
8
|
-
export * from "./victory-clip-container/victory-clip-container";
|
|
9
|
-
export * from "./victory-theme/types";
|
|
10
|
-
export * from "./victory-theme/victory-theme";
|
|
11
|
-
export * from "./victory-portal/portal";
|
|
12
|
-
export * from "./victory-portal/portal-context";
|
|
13
|
-
export * from "./victory-portal/victory-portal";
|
|
14
|
-
export * from "./victory-primitives";
|
|
15
|
-
export { Border as Box } from "./victory-primitives";
|
|
16
|
-
export type { BorderProps as BoxProps } from "./victory-primitives";
|
|
17
|
-
export * from "./victory-util";
|
|
1
|
+
export * from "./types/callbacks";
|
|
2
|
+
export * from "./types/prop-types";
|
|
3
|
+
export * from "./victory-accessible-group/victory-accessible-group";
|
|
4
|
+
export * from "./victory-animation/victory-animation";
|
|
5
|
+
export * from "./victory-container/victory-container";
|
|
6
|
+
export * from "./victory-label/victory-label";
|
|
7
|
+
export * from "./victory-transition/victory-transition";
|
|
8
|
+
export * from "./victory-clip-container/victory-clip-container";
|
|
9
|
+
export * from "./victory-theme/types";
|
|
10
|
+
export * from "./victory-theme/victory-theme";
|
|
11
|
+
export * from "./victory-portal/portal";
|
|
12
|
+
export * from "./victory-portal/portal-context";
|
|
13
|
+
export * from "./victory-portal/victory-portal";
|
|
14
|
+
export * from "./victory-primitives";
|
|
15
|
+
export { Border as Box } from "./victory-primitives";
|
|
16
|
+
export type { BorderProps as BoxProps } from "./victory-primitives";
|
|
17
|
+
export * from "./victory-util";
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/callbacks.d.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { D3Scale, Datum, ID, ScalePropType } from "./prop-types";
|
|
2
|
-
import { BlockProps, OrientationTypes } from "../victory-theme/types";
|
|
3
|
-
/**
|
|
4
|
-
* This is the first parameter of a callback when a callback is used to
|
|
5
|
-
* resolve the value of a property instead of a concrete value.
|
|
6
|
-
*
|
|
7
|
-
* Note that additional properties here like `scale`, `x`, `y`, etc are resolved
|
|
8
|
-
* values of properties from the VictoryXXXProps for each component.
|
|
9
|
-
*/
|
|
10
|
-
export interface CallbackArgs {
|
|
11
|
-
active?: boolean;
|
|
12
|
-
data?: Datum[];
|
|
13
|
-
datum?: Datum;
|
|
14
|
-
horizontal?: boolean;
|
|
15
|
-
index?: ID;
|
|
16
|
-
x?: number;
|
|
17
|
-
y?: number;
|
|
18
|
-
scale?: ScalePropType | D3Scale | {
|
|
19
|
-
x?: ScalePropType | D3Scale;
|
|
20
|
-
y?: ScalePropType | D3Scale;
|
|
21
|
-
};
|
|
22
|
-
tick?: any;
|
|
23
|
-
ticks?: any;
|
|
24
|
-
text?: any;
|
|
25
|
-
}
|
|
26
|
-
export declare type VictoryStringOrNumberCallback = (args: CallbackArgs) => string | number;
|
|
27
|
-
export declare type VictoryStringCallback = (args: CallbackArgs) => string;
|
|
28
|
-
export declare type StringOrNumberOrCallback = string | number | VictoryStringOrNumberCallback;
|
|
29
|
-
export declare type StringOrCallback = string | VictoryStringCallback;
|
|
30
|
-
export declare type SliceNumberOrCallback<T, P extends string | number | symbol = never> = number | ((props: Omit<T, P>) => number);
|
|
31
|
-
export declare type VictoryNumberCallback = (args: CallbackArgs) => number;
|
|
32
|
-
export declare type VictoryPaddingCallback = (args: CallbackArgs) => number | BlockProps;
|
|
33
|
-
export declare type VictoryOrientationCallback = (args: CallbackArgs) => OrientationTypes;
|
|
34
|
-
export declare type NumberOrCallback = number | VictoryNumberCallback;
|
|
35
|
-
export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
|
|
36
|
-
export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
|
|
1
|
+
import { D3Scale, Datum, ID, ScalePropType } from "./prop-types";
|
|
2
|
+
import { BlockProps, OrientationTypes } from "../victory-theme/types";
|
|
3
|
+
/**
|
|
4
|
+
* This is the first parameter of a callback when a callback is used to
|
|
5
|
+
* resolve the value of a property instead of a concrete value.
|
|
6
|
+
*
|
|
7
|
+
* Note that additional properties here like `scale`, `x`, `y`, etc are resolved
|
|
8
|
+
* values of properties from the VictoryXXXProps for each component.
|
|
9
|
+
*/
|
|
10
|
+
export interface CallbackArgs {
|
|
11
|
+
active?: boolean;
|
|
12
|
+
data?: Datum[];
|
|
13
|
+
datum?: Datum;
|
|
14
|
+
horizontal?: boolean;
|
|
15
|
+
index?: ID;
|
|
16
|
+
x?: number;
|
|
17
|
+
y?: number;
|
|
18
|
+
scale?: ScalePropType | D3Scale | {
|
|
19
|
+
x?: ScalePropType | D3Scale;
|
|
20
|
+
y?: ScalePropType | D3Scale;
|
|
21
|
+
};
|
|
22
|
+
tick?: any;
|
|
23
|
+
ticks?: any;
|
|
24
|
+
text?: any;
|
|
25
|
+
}
|
|
26
|
+
export declare type VictoryStringOrNumberCallback = (args: CallbackArgs) => string | number;
|
|
27
|
+
export declare type VictoryStringCallback = (args: CallbackArgs) => string;
|
|
28
|
+
export declare type StringOrNumberOrCallback = string | number | VictoryStringOrNumberCallback;
|
|
29
|
+
export declare type StringOrCallback = string | VictoryStringCallback;
|
|
30
|
+
export declare type SliceNumberOrCallback<T, P extends string | number | symbol = never> = number | ((props: Omit<T, P>) => number);
|
|
31
|
+
export declare type VictoryNumberCallback = (args: CallbackArgs) => number;
|
|
32
|
+
export declare type VictoryPaddingCallback = (args: CallbackArgs) => number | BlockProps;
|
|
33
|
+
export declare type VictoryOrientationCallback = (args: CallbackArgs) => OrientationTypes;
|
|
34
|
+
export declare type NumberOrCallback = number | VictoryNumberCallback;
|
|
35
|
+
export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
|
|
36
|
+
export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
|
|
37
37
|
//# sourceMappingURL=callbacks.d.ts.map
|