victory-core 36.9.2-next.1 → 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 -9
- package/LICENSE.txt +30 -0
- package/README.md +1 -1
- package/dist/victory-core.js +686 -31464
- package/dist/victory-core.min.js +1 -2
- package/es/index.d.ts +17 -17
- package/es/types/callbacks.d.ts +36 -36
- package/es/types/prop-types.d.ts +129 -130
- 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 -64
- package/es/victory-container/victory-container.js +216 -164
- package/es/victory-label/victory-label.d.ts +58 -58
- package/es/victory-portal/portal-context.d.ts +11 -9
- package/es/victory-portal/portal-context.js +1 -1
- package/es/victory-portal/portal.d.ts +20 -9
- package/es/victory-portal/portal.js +77 -6
- package/es/victory-portal/victory-portal.d.ts +26 -9
- package/es/victory-portal/victory-portal.js +98 -24
- 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 -27
- package/es/victory-util/index.js +0 -1
- 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 -130
- 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 -64
- package/lib/victory-container/victory-container.js +221 -170
- package/lib/victory-label/victory-label.d.ts +58 -58
- package/lib/victory-portal/portal-context.d.ts +11 -9
- package/lib/victory-portal/portal-context.js +1 -1
- package/lib/victory-portal/portal.d.ts +20 -9
- package/lib/victory-portal/portal.js +78 -7
- package/lib/victory-portal/victory-portal.d.ts +26 -9
- package/lib/victory-portal/victory-portal.js +99 -27
- 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 -27
- package/lib/victory-util/index.js +0 -14
- 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 -173
- 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/dist/victory-core.min.js.LICENSE.txt +0 -19
- package/es/victory-util/merge-refs.d.ts +0 -5
- package/es/victory-util/merge-refs.js +0 -11
- package/lib/victory-util/merge-refs.d.ts +0 -5
- package/lib/victory-util/merge-refs.js +0 -18
- package/src/victory-util/merge-refs.ts +0 -13
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback } from "../types/callbacks";
|
|
3
|
-
import { ValueOrAccessor } from "../types/prop-types";
|
|
4
|
-
import { PaddingProps, VerticalAnchorType, VictoryLabelStyleObject } from "../victory-theme/victory-theme";
|
|
5
|
-
export declare type TextAnchorType = "start" | "middle" | "end" | "inherit";
|
|
6
|
-
export declare type OriginType = {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
};
|
|
10
|
-
export declare type LabelOrientationType = "parallel" | "perpendicular" | "vertical";
|
|
11
|
-
export interface VictoryLabelProps {
|
|
12
|
-
angle?: StringOrNumberOrCallback;
|
|
13
|
-
ariaLabel?: StringOrCallback;
|
|
14
|
-
backgroundComponent?: React.ReactElement;
|
|
15
|
-
backgroundStyle?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
16
|
-
backgroundPadding?: PaddingProps | PaddingProps[];
|
|
17
|
-
capHeight?: StringOrNumberOrCallback;
|
|
18
|
-
children?: StringOrNumberOrCallback;
|
|
19
|
-
className?: string;
|
|
20
|
-
datum?: Record<string, any>;
|
|
21
|
-
data?: any[];
|
|
22
|
-
desc?: string;
|
|
23
|
-
direction?: string;
|
|
24
|
-
disableInlineStyles?: boolean;
|
|
25
|
-
events?: React.DOMAttributes<any>;
|
|
26
|
-
groupComponent?: React.ReactElement;
|
|
27
|
-
id?: StringOrNumberOrCallback;
|
|
28
|
-
inline?: boolean;
|
|
29
|
-
labelPlacement?: LabelOrientationType;
|
|
30
|
-
lineHeight?: StringOrNumberOrCallback | (string | number)[];
|
|
31
|
-
origin?: OriginType;
|
|
32
|
-
polar?: boolean;
|
|
33
|
-
renderInPortal?: boolean;
|
|
34
|
-
style?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
35
|
-
tabIndex?: NumberOrCallback;
|
|
36
|
-
text?: string[] | StringOrNumberOrCallback;
|
|
37
|
-
textComponent?: React.ReactElement;
|
|
38
|
-
textAnchor?: ValueOrAccessor<TextAnchorType>;
|
|
39
|
-
title?: string;
|
|
40
|
-
transform?: ValueOrAccessor<string | object>;
|
|
41
|
-
tspanComponent?: React.ReactElement;
|
|
42
|
-
verticalAnchor?: ValueOrAccessor<VerticalAnchorType>;
|
|
43
|
-
x?: number;
|
|
44
|
-
y?: number;
|
|
45
|
-
dx?: StringOrNumberOrCallback;
|
|
46
|
-
dy?: StringOrNumberOrCallback;
|
|
47
|
-
}
|
|
48
|
-
declare const defaultStyles: {
|
|
49
|
-
fill: string;
|
|
50
|
-
fontSize: number;
|
|
51
|
-
fontFamily: string;
|
|
52
|
-
stroke: string;
|
|
53
|
-
};
|
|
54
|
-
export declare const VictoryLabel: {
|
|
55
|
-
role: string;
|
|
56
|
-
defaultStyles: typeof defaultStyles;
|
|
57
|
-
} & React.FC<VictoryLabelProps>;
|
|
58
|
-
export {};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback } from "../types/callbacks";
|
|
3
|
+
import { ValueOrAccessor } from "../types/prop-types";
|
|
4
|
+
import { PaddingProps, VerticalAnchorType, VictoryLabelStyleObject } from "../victory-theme/victory-theme";
|
|
5
|
+
export declare type TextAnchorType = "start" | "middle" | "end" | "inherit";
|
|
6
|
+
export declare type OriginType = {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
export declare type LabelOrientationType = "parallel" | "perpendicular" | "vertical";
|
|
11
|
+
export interface VictoryLabelProps {
|
|
12
|
+
angle?: StringOrNumberOrCallback;
|
|
13
|
+
ariaLabel?: StringOrCallback;
|
|
14
|
+
backgroundComponent?: React.ReactElement;
|
|
15
|
+
backgroundStyle?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
16
|
+
backgroundPadding?: PaddingProps | PaddingProps[];
|
|
17
|
+
capHeight?: StringOrNumberOrCallback;
|
|
18
|
+
children?: StringOrNumberOrCallback;
|
|
19
|
+
className?: string;
|
|
20
|
+
datum?: Record<string, any>;
|
|
21
|
+
data?: any[];
|
|
22
|
+
desc?: string;
|
|
23
|
+
direction?: string;
|
|
24
|
+
disableInlineStyles?: boolean;
|
|
25
|
+
events?: React.DOMAttributes<any>;
|
|
26
|
+
groupComponent?: React.ReactElement;
|
|
27
|
+
id?: StringOrNumberOrCallback;
|
|
28
|
+
inline?: boolean;
|
|
29
|
+
labelPlacement?: LabelOrientationType;
|
|
30
|
+
lineHeight?: StringOrNumberOrCallback | (string | number)[];
|
|
31
|
+
origin?: OriginType;
|
|
32
|
+
polar?: boolean;
|
|
33
|
+
renderInPortal?: boolean;
|
|
34
|
+
style?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
35
|
+
tabIndex?: NumberOrCallback;
|
|
36
|
+
text?: string[] | StringOrNumberOrCallback;
|
|
37
|
+
textComponent?: React.ReactElement;
|
|
38
|
+
textAnchor?: ValueOrAccessor<TextAnchorType>;
|
|
39
|
+
title?: string;
|
|
40
|
+
transform?: ValueOrAccessor<string | object>;
|
|
41
|
+
tspanComponent?: React.ReactElement;
|
|
42
|
+
verticalAnchor?: ValueOrAccessor<VerticalAnchorType>;
|
|
43
|
+
x?: number;
|
|
44
|
+
y?: number;
|
|
45
|
+
dx?: StringOrNumberOrCallback;
|
|
46
|
+
dy?: StringOrNumberOrCallback;
|
|
47
|
+
}
|
|
48
|
+
declare const defaultStyles: {
|
|
49
|
+
fill: string;
|
|
50
|
+
fontSize: number;
|
|
51
|
+
fontFamily: string;
|
|
52
|
+
stroke: string;
|
|
53
|
+
};
|
|
54
|
+
export declare const VictoryLabel: {
|
|
55
|
+
role: string;
|
|
56
|
+
defaultStyles: typeof defaultStyles;
|
|
57
|
+
} & React.FC<VictoryLabelProps>;
|
|
58
|
+
export {};
|
|
59
59
|
//# sourceMappingURL=victory-label.d.ts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface PortalContextValue {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PortalContextValue {
|
|
3
|
+
portalRegister(): number;
|
|
4
|
+
portalUpdate(key: number, element: React.ReactElement): void;
|
|
5
|
+
portalDeregister(key: number): void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The React context object consumers may use to access the context of the
|
|
9
|
+
* portal.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PortalContext: React.Context<PortalContextValue>;
|
|
10
12
|
//# sourceMappingURL=portal-context.d.ts.map
|
|
@@ -4,5 +4,5 @@ import React from "react";
|
|
|
4
4
|
* The React context object consumers may use to access the context of the
|
|
5
5
|
* portal.
|
|
6
6
|
*/
|
|
7
|
-
export var PortalContext = /*#__PURE__*/React.createContext(
|
|
7
|
+
export var PortalContext = /*#__PURE__*/React.createContext({});
|
|
8
8
|
PortalContext.displayName = "PortalContext";
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PortalContextValue } from "./portal-context";
|
|
3
|
+
export interface PortalProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
height?: number;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
viewBox?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class Portal extends React.Component<PortalProps> implements PortalContextValue {
|
|
11
|
+
static displayName: string;
|
|
12
|
+
private readonly map;
|
|
13
|
+
private index;
|
|
14
|
+
constructor(props: PortalProps);
|
|
15
|
+
portalRegister: () => number;
|
|
16
|
+
portalUpdate: (key: number, element: React.ReactElement) => void;
|
|
17
|
+
portalDeregister: (key: number) => void;
|
|
18
|
+
getChildren(): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
19
|
+
render(): JSX.Element;
|
|
20
|
+
}
|
|
10
21
|
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -1,8 +1,79 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4
|
+
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
+
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
|
|
9
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
+
|
|
11
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
+
|
|
13
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
14
|
+
|
|
15
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
|
|
17
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
+
|
|
19
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2
20
|
|
|
3
21
|
import React from "react";
|
|
4
|
-
export var Portal = /*#__PURE__*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
22
|
+
export var Portal = /*#__PURE__*/function (_ref) {
|
|
23
|
+
_inherits(Portal, _ref);
|
|
24
|
+
|
|
25
|
+
var _super = _createSuper(Portal);
|
|
26
|
+
|
|
27
|
+
function Portal(props) {
|
|
28
|
+
var _this;
|
|
29
|
+
|
|
30
|
+
_classCallCheck(this, Portal);
|
|
31
|
+
|
|
32
|
+
_this = _super.call(this, props);
|
|
33
|
+
_this.map = void 0;
|
|
34
|
+
_this.index = void 0;
|
|
35
|
+
|
|
36
|
+
_this.portalRegister = function () {
|
|
37
|
+
return ++_this.index;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
_this.portalUpdate = function (key, element) {
|
|
41
|
+
_this.map[key] = element;
|
|
42
|
+
|
|
43
|
+
_this.forceUpdate();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
_this.portalDeregister = function (key) {
|
|
47
|
+
delete _this.map[key];
|
|
48
|
+
|
|
49
|
+
_this.forceUpdate();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
_this.map = {};
|
|
53
|
+
_this.index = 1;
|
|
54
|
+
return _this;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
_createClass(Portal, [{
|
|
58
|
+
key: "getChildren",
|
|
59
|
+
value: function getChildren() {
|
|
60
|
+
var _this2 = this;
|
|
61
|
+
|
|
62
|
+
return Object.keys(this.map).map(function (key) {
|
|
63
|
+
var el = _this2.map[key];
|
|
64
|
+
return el ? /*#__PURE__*/React.cloneElement(el, {
|
|
65
|
+
key: key
|
|
66
|
+
}) : el;
|
|
67
|
+
});
|
|
68
|
+
} // Overridden in victory-core-native
|
|
69
|
+
|
|
70
|
+
}, {
|
|
71
|
+
key: "render",
|
|
72
|
+
value: function render() {
|
|
73
|
+
return /*#__PURE__*/React.createElement("svg", this.props, this.getChildren());
|
|
74
|
+
}
|
|
75
|
+
}]);
|
|
76
|
+
|
|
77
|
+
return Portal;
|
|
78
|
+
}(React.Component);
|
|
79
|
+
Portal.displayName = "Portal";
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PortalContext } from "./portal-context";
|
|
3
|
+
export interface VictoryPortalProps {
|
|
4
|
+
children?: React.ReactElement;
|
|
5
|
+
groupComponent?: React.ReactElement;
|
|
6
|
+
}
|
|
7
|
+
export interface VictoryPortal {
|
|
8
|
+
context: React.ContextType<typeof PortalContext>;
|
|
9
|
+
}
|
|
10
|
+
export declare class VictoryPortal extends React.Component<VictoryPortalProps> {
|
|
11
|
+
static displayName: string;
|
|
12
|
+
static role: string;
|
|
13
|
+
static defaultProps: {
|
|
14
|
+
groupComponent: JSX.Element;
|
|
15
|
+
};
|
|
16
|
+
static contextType: React.Context<import("./portal-context").PortalContextValue>;
|
|
17
|
+
private checkedContext;
|
|
18
|
+
private portalKey;
|
|
19
|
+
renderInPlace: boolean;
|
|
20
|
+
element: React.ReactElement;
|
|
21
|
+
componentDidMount(): void;
|
|
22
|
+
componentDidUpdate(): void;
|
|
23
|
+
componentWillUnmount(): void;
|
|
24
|
+
renderPortal(child: React.ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
25
|
+
render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
26
|
+
}
|
|
10
27
|
//# sourceMappingURL=victory-portal.d.ts.map
|
|
@@ -1,41 +1,115 @@
|
|
|
1
1
|
import _defaults from "lodash/defaults";
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
|
|
9
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
+
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
|
+
|
|
17
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
+
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
8
22
|
|
|
9
23
|
import React from "react";
|
|
10
24
|
import * as Log from "../victory-util/log";
|
|
11
25
|
import * as Helpers from "../victory-util/helpers";
|
|
12
26
|
import { PortalContext } from "./portal-context";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
groupComponent: /*#__PURE__*/React.createElement("g", null)
|
|
16
|
-
};
|
|
17
|
-
export var VictoryPortal = function (initialProps) {
|
|
18
|
-
var props = _objectSpread(_objectSpread({}, defaultProps), initialProps);
|
|
27
|
+
export var VictoryPortal = /*#__PURE__*/function (_React$Component) {
|
|
28
|
+
_inherits(VictoryPortal, _React$Component);
|
|
19
29
|
|
|
20
|
-
var
|
|
30
|
+
var _super = _createSuper(VictoryPortal);
|
|
21
31
|
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
32
|
+
function VictoryPortal() {
|
|
33
|
+
var _this;
|
|
34
|
+
|
|
35
|
+
_classCallCheck(this, VictoryPortal);
|
|
36
|
+
|
|
37
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
|
+
args[_key] = arguments[_key];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
42
|
+
_this.checkedContext = void 0;
|
|
43
|
+
_this.portalKey = void 0;
|
|
44
|
+
_this.renderInPlace = void 0;
|
|
45
|
+
_this.element = void 0;
|
|
46
|
+
return _this;
|
|
25
47
|
}
|
|
26
48
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
49
|
+
_createClass(VictoryPortal, [{
|
|
50
|
+
key: "componentDidMount",
|
|
51
|
+
value: function componentDidMount() {
|
|
52
|
+
if (!this.checkedContext) {
|
|
53
|
+
if (typeof this.context.portalUpdate !== "function") {
|
|
54
|
+
var msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
55
|
+
Log.warn(msg);
|
|
56
|
+
this.renderInPlace = true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
this.checkedContext = true;
|
|
60
|
+
}
|
|
34
61
|
|
|
35
|
-
|
|
62
|
+
this.forceUpdate();
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "componentDidUpdate",
|
|
66
|
+
value: function componentDidUpdate() {
|
|
67
|
+
if (!this.renderInPlace) {
|
|
68
|
+
this.portalKey = this.portalKey || this.context.portalRegister();
|
|
69
|
+
this.context.portalUpdate(this.portalKey, this.element);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "componentWillUnmount",
|
|
74
|
+
value: function componentWillUnmount() {
|
|
75
|
+
if (this.context && this.context.portalDeregister) {
|
|
76
|
+
this.context.portalDeregister(this.portalKey);
|
|
77
|
+
}
|
|
78
|
+
} // Overridden in victory-core-native
|
|
36
79
|
|
|
37
|
-
|
|
80
|
+
}, {
|
|
81
|
+
key: "renderPortal",
|
|
82
|
+
value: function renderPortal(child) {
|
|
83
|
+
if (this.renderInPlace) {
|
|
84
|
+
return child;
|
|
85
|
+
}
|
|
38
86
|
|
|
39
|
-
|
|
87
|
+
this.element = child;
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "render",
|
|
92
|
+
value: function render() {
|
|
93
|
+
var children = Array.isArray(this.props.children) ? this.props.children[0] : this.props.children;
|
|
94
|
+
var groupComponent = this.props.groupComponent;
|
|
95
|
+
var childProps = children && children.props || {};
|
|
96
|
+
var standardProps = childProps.groupComponent ? {
|
|
97
|
+
groupComponent: groupComponent,
|
|
98
|
+
standalone: false
|
|
99
|
+
} : {};
|
|
100
|
+
|
|
101
|
+
var newProps = _defaults(standardProps, childProps, Helpers.omit(this.props, ["children", "groupComponent"]));
|
|
102
|
+
|
|
103
|
+
var child = children && /*#__PURE__*/React.cloneElement(children, newProps);
|
|
104
|
+
return this.renderPortal(child);
|
|
105
|
+
}
|
|
106
|
+
}]);
|
|
107
|
+
|
|
108
|
+
return VictoryPortal;
|
|
109
|
+
}(React.Component);
|
|
110
|
+
VictoryPortal.displayName = "VictoryPortal";
|
|
111
|
+
VictoryPortal.role = "portal";
|
|
112
|
+
VictoryPortal.defaultProps = {
|
|
113
|
+
groupComponent: /*#__PURE__*/React.createElement("g", null)
|
|
40
114
|
};
|
|
41
|
-
VictoryPortal.
|
|
115
|
+
VictoryPortal.contextType = PortalContext;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
-
export interface ArcProps extends VictoryCommonPrimitiveProps {
|
|
4
|
-
closedPath?: boolean;
|
|
5
|
-
cx?: number;
|
|
6
|
-
cy?: number;
|
|
7
|
-
datum?: any;
|
|
8
|
-
endAngle?: number;
|
|
9
|
-
pathComponent?: React.ReactElement;
|
|
10
|
-
r?: number;
|
|
11
|
-
startAngle?: number;
|
|
12
|
-
type?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const Arc: (initialProps: ArcProps) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
+
export interface ArcProps extends VictoryCommonPrimitiveProps {
|
|
4
|
+
closedPath?: boolean;
|
|
5
|
+
cx?: number;
|
|
6
|
+
cy?: number;
|
|
7
|
+
datum?: any;
|
|
8
|
+
endAngle?: number;
|
|
9
|
+
pathComponent?: React.ReactElement;
|
|
10
|
+
r?: number;
|
|
11
|
+
startAngle?: number;
|
|
12
|
+
type?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const Arc: (initialProps: ArcProps) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
15
15
|
//# sourceMappingURL=arc.d.ts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
-
export interface BackgroundProps extends VictoryCommonPrimitiveProps {
|
|
4
|
-
circleComponent?: React.ReactElement;
|
|
5
|
-
height?: number;
|
|
6
|
-
rectComponent?: React.ReactElement;
|
|
7
|
-
rx?: number;
|
|
8
|
-
ry?: number;
|
|
9
|
-
width?: number;
|
|
10
|
-
x?: number;
|
|
11
|
-
y?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare const Background: (initialProps: BackgroundProps) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
+
export interface BackgroundProps extends VictoryCommonPrimitiveProps {
|
|
4
|
+
circleComponent?: React.ReactElement;
|
|
5
|
+
height?: number;
|
|
6
|
+
rectComponent?: React.ReactElement;
|
|
7
|
+
rx?: number;
|
|
8
|
+
ry?: number;
|
|
9
|
+
width?: number;
|
|
10
|
+
x?: number;
|
|
11
|
+
y?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const Background: (initialProps: BackgroundProps) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
14
14
|
//# sourceMappingURL=background.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
-
export interface BorderProps extends VictoryCommonPrimitiveProps {
|
|
4
|
-
width?: number;
|
|
5
|
-
height?: number;
|
|
6
|
-
rectComponent?: React.ReactElement;
|
|
7
|
-
x?: number;
|
|
8
|
-
y?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare const Border: (initialProps: BorderProps) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
+
export interface BorderProps extends VictoryCommonPrimitiveProps {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
rectComponent?: React.ReactElement;
|
|
7
|
+
x?: number;
|
|
8
|
+
y?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const Border: (initialProps: BorderProps) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
11
11
|
//# sourceMappingURL=border.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VictoryPrimitiveShapeProps } from "./types";
|
|
3
|
-
export declare const Circle: React.ForwardRefExoticComponent<VictoryPrimitiveShapeProps & React.RefAttributes<SVGCircleElement>>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryPrimitiveShapeProps } from "./types";
|
|
3
|
+
export declare const Circle: React.ForwardRefExoticComponent<VictoryPrimitiveShapeProps & React.RefAttributes<SVGCircleElement>>;
|
|
4
4
|
//# sourceMappingURL=circle.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
-
export interface ClipPathProps extends VictoryCommonPrimitiveProps {
|
|
4
|
-
children?: React.ReactNode[] | React.ReactNode;
|
|
5
|
-
clipId?: number | string;
|
|
6
|
-
}
|
|
7
|
-
export declare const ClipPath: (props: ClipPathProps) => JSX.Element;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
+
export interface ClipPathProps extends VictoryCommonPrimitiveProps {
|
|
4
|
+
children?: React.ReactNode[] | React.ReactNode;
|
|
5
|
+
clipId?: number | string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ClipPath: (props: ClipPathProps) => JSX.Element;
|
|
8
8
|
//# sourceMappingURL=clip-path.d.ts.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from "./arc";
|
|
2
|
-
export * from "./background";
|
|
3
|
-
export * from "./border";
|
|
4
|
-
export * from "./circle";
|
|
5
|
-
export * from "./clip-path";
|
|
6
|
-
export * from "./line";
|
|
7
|
-
export * from "./line-segment";
|
|
8
|
-
export * from "./path";
|
|
9
|
-
export * from "./point";
|
|
10
|
-
export * from "./rect";
|
|
11
|
-
export * from "./text";
|
|
12
|
-
export * from "./tspan";
|
|
13
|
-
export * from "./types";
|
|
14
|
-
export * from "./whisker";
|
|
1
|
+
export * from "./arc";
|
|
2
|
+
export * from "./background";
|
|
3
|
+
export * from "./border";
|
|
4
|
+
export * from "./circle";
|
|
5
|
+
export * from "./clip-path";
|
|
6
|
+
export * from "./line";
|
|
7
|
+
export * from "./line-segment";
|
|
8
|
+
export * from "./path";
|
|
9
|
+
export * from "./point";
|
|
10
|
+
export * from "./rect";
|
|
11
|
+
export * from "./text";
|
|
12
|
+
export * from "./tspan";
|
|
13
|
+
export * from "./types";
|
|
14
|
+
export * from "./whisker";
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
-
export interface LineSegmentProps extends VictoryCommonPrimitiveProps {
|
|
4
|
-
datum?: any;
|
|
5
|
-
lineComponent?: React.ReactElement;
|
|
6
|
-
x1?: number;
|
|
7
|
-
x2?: number;
|
|
8
|
-
y1?: number;
|
|
9
|
-
y2?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const LineSegment: (initialProps: LineSegmentProps) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
|
|
3
|
+
export interface LineSegmentProps extends VictoryCommonPrimitiveProps {
|
|
4
|
+
datum?: any;
|
|
5
|
+
lineComponent?: React.ReactElement;
|
|
6
|
+
x1?: number;
|
|
7
|
+
x2?: number;
|
|
8
|
+
y1?: number;
|
|
9
|
+
y2?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const LineSegment: (initialProps: LineSegmentProps) => React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
12
12
|
//# sourceMappingURL=line-segment.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VictoryPrimitiveShapeProps } from "./types";
|
|
3
|
-
export declare const Line: React.ForwardRefExoticComponent<VictoryPrimitiveShapeProps & React.RefAttributes<SVGLineElement>>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryPrimitiveShapeProps } from "./types";
|
|
3
|
+
export declare const Line: React.ForwardRefExoticComponent<VictoryPrimitiveShapeProps & React.RefAttributes<SVGLineElement>>;
|
|
4
4
|
//# sourceMappingURL=line.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VictoryPrimitiveShapeProps } from "./types";
|
|
3
|
-
export declare const Path: React.ForwardRefExoticComponent<VictoryPrimitiveShapeProps & React.RefAttributes<SVGPathElement>>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryPrimitiveShapeProps } from "./types";
|
|
3
|
+
export declare const Path: React.ForwardRefExoticComponent<VictoryPrimitiveShapeProps & React.RefAttributes<SVGPathElement>>;
|
|
4
4
|
//# sourceMappingURL=path.d.ts.map
|