victory-core 36.9.2-next.3 → 37.0.0
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 +28 -10
- package/README.md +1 -1
- package/dist/victory-core.js +4449 -6196
- 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-accessible-group/victory-accessible-group.js +9 -15
- package/es/victory-animation/util.d.ts +66 -66
- package/es/victory-animation/util.js +28 -47
- package/es/victory-animation/victory-animation.d.ts +34 -34
- package/es/victory-animation/victory-animation.js +51 -67
- package/es/victory-clip-container/victory-clip-container.d.ts +46 -46
- package/es/victory-clip-container/victory-clip-container.js +153 -229
- package/es/victory-container/victory-container.d.ts +68 -68
- package/es/victory-container/victory-container.js +157 -216
- package/es/victory-label/victory-label.d.ts +58 -58
- package/es/victory-label/victory-label.js +246 -323
- package/es/victory-portal/portal-context.d.ts +11 -11
- package/es/victory-portal/portal-context.js +1 -2
- package/es/victory-portal/portal.d.ts +20 -20
- package/es/victory-portal/portal.js +30 -76
- package/es/victory-portal/victory-portal.d.ts +26 -26
- package/es/victory-portal/victory-portal.js +47 -104
- package/es/victory-primitives/arc.d.ts +14 -14
- package/es/victory-primitives/arc.js +44 -47
- package/es/victory-primitives/background.d.ts +13 -13
- package/es/victory-primitives/background.js +14 -17
- package/es/victory-primitives/border.d.ts +10 -10
- package/es/victory-primitives/border.js +20 -24
- package/es/victory-primitives/circle.d.ts +3 -3
- package/es/victory-primitives/circle.js +13 -27
- package/es/victory-primitives/clip-path.d.ts +7 -7
- package/es/victory-primitives/clip-path.js +3 -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-segment.js +20 -24
- package/es/victory-primitives/line.d.ts +3 -3
- package/es/victory-primitives/line.js +13 -27
- package/es/victory-primitives/path.d.ts +3 -3
- package/es/victory-primitives/path.js +13 -27
- package/es/victory-primitives/point.d.ts +13 -13
- package/es/victory-primitives/point.js +36 -40
- package/es/victory-primitives/rect.d.ts +3 -3
- package/es/victory-primitives/rect.js +13 -27
- package/es/victory-primitives/text.d.ts +8 -8
- package/es/victory-primitives/text.js +15 -28
- package/es/victory-primitives/tspan.d.ts +3 -3
- package/es/victory-primitives/tspan.js +13 -26
- package/es/victory-primitives/types.d.ts +7 -7
- package/es/victory-primitives/whisker.d.ts +15 -15
- package/es/victory-primitives/whisker.js +43 -47
- package/es/victory-theme/grayscale.d.ts +2 -2
- package/es/victory-theme/grayscale.js +22 -22
- package/es/victory-theme/material.d.ts +2 -2
- package/es/victory-theme/material.js +46 -46
- package/es/victory-theme/types.d.ts +238 -238
- package/es/victory-theme/victory-theme.d.ts +5 -5
- package/es/victory-theme/victory-theme.js +3 -3
- package/es/victory-transition/victory-transition.d.ts +53 -53
- package/es/victory-transition/victory-transition.js +126 -206
- package/es/victory-util/add-events.d.ts +126 -126
- package/es/victory-util/add-events.js +265 -380
- package/es/victory-util/axis.d.ts +50 -50
- package/es/victory-util/axis.js +133 -222
- package/es/victory-util/collection.d.ts +15 -8
- package/es/victory-util/collection.js +24 -36
- package/es/victory-util/common-props.d.ts +79 -79
- package/es/victory-util/data.d.ts +74 -74
- package/es/victory-util/data.js +159 -214
- package/es/victory-util/default-transitions.d.ts +4 -4
- package/es/victory-util/default-transitions.js +33 -51
- package/es/victory-util/domain.d.ts +90 -90
- package/es/victory-util/domain.js +122 -171
- package/es/victory-util/events.d.ts +64 -64
- package/es/victory-util/events.js +168 -258
- package/es/victory-util/helpers.d.ts +96 -91
- package/es/victory-util/helpers.js +162 -176
- 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-animation-state.js +61 -99
- package/es/victory-util/hooks/use-previous-props.d.ts +1 -1
- package/es/victory-util/hooks/use-previous-props.js +2 -2
- package/es/victory-util/immutable.d.ts +11 -11
- package/es/victory-util/immutable.js +6 -8
- package/es/victory-util/index.d.ts +26 -26
- package/es/victory-util/label-helpers.d.ts +26 -26
- package/es/victory-util/label-helpers.js +128 -130
- package/es/victory-util/line-helpers.d.ts +4 -4
- package/es/victory-util/line-helpers.js +29 -41
- package/es/victory-util/log.d.ts +1 -1
- package/es/victory-util/log.js +1 -1
- package/es/victory-util/point-path-helpers.d.ts +9 -9
- package/es/victory-util/point-path-helpers.js +89 -49
- package/es/victory-util/scale.d.ts +9 -9
- package/es/victory-util/scale.js +24 -42
- package/es/victory-util/selection.d.ts +28 -28
- package/es/victory-util/selection.js +39 -40
- package/es/victory-util/style.d.ts +18 -18
- package/es/victory-util/style.js +8 -13
- package/es/victory-util/textsize.d.ts +35 -35
- package/es/victory-util/textsize.js +80 -154
- package/es/victory-util/timer-context.d.ts +11 -11
- package/es/victory-util/timer-context.js +2 -2
- package/es/victory-util/timer.d.ts +16 -16
- package/es/victory-util/timer.js +40 -76
- package/es/victory-util/transitions.d.ts +48 -48
- package/es/victory-util/transitions.js +110 -150
- package/es/victory-util/type-helpers.d.ts +9 -9
- package/es/victory-util/type-helpers.js +2 -3
- package/es/victory-util/user-props.d.ts +26 -26
- package/es/victory-util/user-props.js +24 -49
- package/es/victory-util/wrapper.d.ts +33 -37
- package/es/victory-util/wrapper.js +182 -245
- package/lib/index.d.ts +17 -17
- package/lib/index.js +0 -30
- 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-accessible-group/victory-accessible-group.js +9 -19
- package/lib/victory-animation/util.d.ts +66 -66
- package/lib/victory-animation/util.js +28 -63
- package/lib/victory-animation/victory-animation.d.ts +34 -34
- package/lib/victory-animation/victory-animation.js +54 -83
- package/lib/victory-clip-container/victory-clip-container.d.ts +46 -46
- package/lib/victory-clip-container/victory-clip-container.js +156 -243
- package/lib/victory-container/victory-container.d.ts +68 -68
- package/lib/victory-container/victory-container.js +160 -232
- package/lib/victory-label/victory-label.d.ts +58 -58
- package/lib/victory-label/victory-label.js +248 -344
- package/lib/victory-portal/portal-context.d.ts +11 -11
- package/lib/victory-portal/portal-context.js +1 -6
- package/lib/victory-portal/portal.d.ts +20 -20
- package/lib/victory-portal/portal.js +31 -81
- package/lib/victory-portal/victory-portal.d.ts +26 -26
- package/lib/victory-portal/victory-portal.js +50 -116
- package/lib/victory-primitives/arc.d.ts +14 -14
- package/lib/victory-primitives/arc.js +48 -57
- package/lib/victory-primitives/background.d.ts +13 -13
- package/lib/victory-primitives/background.js +16 -28
- package/lib/victory-primitives/border.d.ts +10 -10
- package/lib/victory-primitives/border.js +22 -34
- package/lib/victory-primitives/circle.d.ts +3 -3
- package/lib/victory-primitives/circle.js +16 -36
- package/lib/victory-primitives/clip-path.d.ts +7 -7
- package/lib/victory-primitives/clip-path.js +3 -11
- package/lib/victory-primitives/index.d.ts +14 -14
- package/lib/victory-primitives/index.js +0 -28
- package/lib/victory-primitives/line-segment.d.ts +11 -11
- package/lib/victory-primitives/line-segment.js +22 -34
- package/lib/victory-primitives/line.d.ts +3 -3
- package/lib/victory-primitives/line.js +16 -36
- package/lib/victory-primitives/path.d.ts +3 -3
- package/lib/victory-primitives/path.js +16 -36
- package/lib/victory-primitives/point.d.ts +13 -13
- package/lib/victory-primitives/point.js +38 -52
- package/lib/victory-primitives/rect.d.ts +3 -3
- package/lib/victory-primitives/rect.js +16 -36
- package/lib/victory-primitives/text.d.ts +8 -8
- package/lib/victory-primitives/text.js +15 -33
- package/lib/victory-primitives/tspan.d.ts +3 -3
- package/lib/victory-primitives/tspan.js +13 -31
- package/lib/victory-primitives/types.d.ts +7 -7
- package/lib/victory-primitives/whisker.d.ts +15 -15
- package/lib/victory-primitives/whisker.js +45 -57
- package/lib/victory-theme/grayscale.d.ts +2 -2
- package/lib/victory-theme/grayscale.js +23 -24
- package/lib/victory-theme/material.d.ts +2 -2
- package/lib/victory-theme/material.js +47 -48
- package/lib/victory-theme/types.d.ts +238 -238
- package/lib/victory-theme/victory-theme.d.ts +5 -5
- package/lib/victory-theme/victory-theme.js +2 -7
- package/lib/victory-transition/victory-transition.d.ts +53 -53
- package/lib/victory-transition/victory-transition.js +129 -224
- package/lib/victory-util/add-events.d.ts +126 -126
- package/lib/victory-util/add-events.js +265 -382
- package/lib/victory-util/axis.d.ts +50 -50
- package/lib/victory-util/axis.js +135 -242
- package/lib/victory-util/collection.d.ts +15 -8
- package/lib/victory-util/collection.js +24 -43
- package/lib/victory-util/common-props.d.ts +79 -79
- package/lib/victory-util/data.d.ts +74 -74
- package/lib/victory-util/data.js +160 -239
- package/lib/victory-util/default-transitions.d.ts +4 -4
- package/lib/victory-util/default-transitions.js +33 -54
- package/lib/victory-util/domain.d.ts +90 -90
- package/lib/victory-util/domain.js +123 -193
- package/lib/victory-util/events.d.ts +64 -64
- package/lib/victory-util/events.js +167 -274
- package/lib/victory-util/helpers.d.ts +96 -91
- package/lib/victory-util/helpers.js +166 -204
- package/lib/victory-util/hooks/index.d.ts +2 -2
- package/lib/victory-util/hooks/index.js +0 -2
- package/lib/victory-util/hooks/use-animation-state.d.ts +21 -21
- package/lib/victory-util/hooks/use-animation-state.js +63 -113
- package/lib/victory-util/hooks/use-previous-props.d.ts +1 -1
- package/lib/victory-util/hooks/use-previous-props.js +2 -7
- package/lib/victory-util/immutable.d.ts +11 -11
- package/lib/victory-util/immutable.js +6 -18
- package/lib/victory-util/index.d.ts +26 -26
- package/lib/victory-util/index.js +2 -51
- package/lib/victory-util/label-helpers.d.ts +26 -26
- package/lib/victory-util/label-helpers.js +130 -141
- package/lib/victory-util/line-helpers.d.ts +4 -4
- package/lib/victory-util/line-helpers.js +31 -49
- package/lib/victory-util/log.d.ts +1 -1
- package/lib/victory-util/log.js +1 -2
- package/lib/victory-util/point-path-helpers.d.ts +9 -9
- package/lib/victory-util/point-path-helpers.js +91 -63
- package/lib/victory-util/scale.d.ts +9 -9
- package/lib/victory-util/scale.js +26 -57
- package/lib/victory-util/selection.d.ts +28 -28
- package/lib/victory-util/selection.js +41 -49
- package/lib/victory-util/style.d.ts +18 -18
- package/lib/victory-util/style.js +8 -16
- package/lib/victory-util/textsize.d.ts +35 -35
- package/lib/victory-util/textsize.js +80 -157
- package/lib/victory-util/timer-context.d.ts +11 -11
- package/lib/victory-util/timer-context.js +2 -8
- package/lib/victory-util/timer.d.ts +16 -16
- package/lib/victory-util/timer.js +40 -76
- package/lib/victory-util/transitions.d.ts +48 -48
- package/lib/victory-util/transitions.js +110 -152
- package/lib/victory-util/type-helpers.d.ts +9 -9
- package/lib/victory-util/type-helpers.js +2 -9
- package/lib/victory-util/user-props.d.ts +26 -26
- package/lib/victory-util/user-props.js +25 -59
- package/lib/victory-util/wrapper.d.ts +33 -37
- package/lib/victory-util/wrapper.js +184 -279
- 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,12 +1,12 @@
|
|
|
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>;
|
|
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>;
|
|
12
12
|
//# sourceMappingURL=portal-context.d.ts.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* The React context object consumers may use to access the context of the
|
|
5
4
|
* portal.
|
|
6
5
|
*/
|
|
7
|
-
export
|
|
6
|
+
export const PortalContext = /*#__PURE__*/React.createContext({});
|
|
8
7
|
PortalContext.displayName = "PortalContext";
|
|
@@ -1,21 +1,21 @@
|
|
|
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
|
-
}
|
|
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
|
+
}
|
|
21
21
|
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -1,79 +1,33 @@
|
|
|
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); }
|
|
20
|
-
|
|
21
1
|
import React from "react";
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
delete _this.map[key];
|
|
48
|
-
|
|
49
|
-
_this.forceUpdate();
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
_this.map = {};
|
|
53
|
-
_this.index = 1;
|
|
54
|
-
return _this;
|
|
2
|
+
export class Portal extends React.Component {
|
|
3
|
+
static displayName = "Portal";
|
|
4
|
+
constructor(props) {
|
|
5
|
+
super(props);
|
|
6
|
+
this.map = {};
|
|
7
|
+
this.index = 1;
|
|
8
|
+
}
|
|
9
|
+
portalRegister = () => {
|
|
10
|
+
return ++this.index;
|
|
11
|
+
};
|
|
12
|
+
portalUpdate = (key, element) => {
|
|
13
|
+
this.map[key] = element;
|
|
14
|
+
this.forceUpdate();
|
|
15
|
+
};
|
|
16
|
+
portalDeregister = key => {
|
|
17
|
+
delete this.map[key];
|
|
18
|
+
this.forceUpdate();
|
|
19
|
+
};
|
|
20
|
+
getChildren() {
|
|
21
|
+
return Object.keys(this.map).map(key => {
|
|
22
|
+
const el = this.map[key];
|
|
23
|
+
return el ? /*#__PURE__*/React.cloneElement(el, {
|
|
24
|
+
key
|
|
25
|
+
}) : el;
|
|
26
|
+
});
|
|
55
27
|
}
|
|
56
28
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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";
|
|
29
|
+
// Overridden in victory-core-native
|
|
30
|
+
render() {
|
|
31
|
+
return /*#__PURE__*/React.createElement("svg", this.props, this.getChildren());
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
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
|
-
}
|
|
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
|
+
}
|
|
27
27
|
//# sourceMappingURL=victory-portal.d.ts.map
|
|
@@ -1,115 +1,58 @@
|
|
|
1
1
|
import _defaults from "lodash/defaults";
|
|
2
|
-
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
|
|
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
|
-
|
|
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); }
|
|
22
|
-
|
|
23
2
|
import React from "react";
|
|
24
3
|
import * as Log from "../victory-util/log";
|
|
25
4
|
import * as Helpers from "../victory-util/helpers";
|
|
26
5
|
import { PortalContext } from "./portal-context";
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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;
|
|
47
|
-
}
|
|
48
|
-
|
|
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;
|
|
6
|
+
export class VictoryPortal extends React.Component {
|
|
7
|
+
static displayName = "VictoryPortal";
|
|
8
|
+
static role = "portal";
|
|
9
|
+
static defaultProps = {
|
|
10
|
+
groupComponent: /*#__PURE__*/React.createElement("g", null)
|
|
11
|
+
};
|
|
12
|
+
static contextType = PortalContext;
|
|
13
|
+
componentDidMount() {
|
|
14
|
+
if (!this.checkedContext) {
|
|
15
|
+
if (typeof this.context.portalUpdate !== "function") {
|
|
16
|
+
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
17
|
+
Log.warn(msg);
|
|
18
|
+
this.renderInPlace = true;
|
|
60
19
|
}
|
|
61
|
-
|
|
62
|
-
this.forceUpdate();
|
|
20
|
+
this.checkedContext = true;
|
|
63
21
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
22
|
+
this.forceUpdate();
|
|
23
|
+
}
|
|
24
|
+
componentDidUpdate() {
|
|
25
|
+
if (!this.renderInPlace) {
|
|
26
|
+
this.portalKey = this.portalKey || this.context.portalRegister();
|
|
27
|
+
this.context.portalUpdate(this.portalKey, this.element);
|
|
71
28
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this.context.portalDeregister(this.portalKey);
|
|
77
|
-
}
|
|
78
|
-
} // Overridden in victory-core-native
|
|
79
|
-
|
|
80
|
-
}, {
|
|
81
|
-
key: "renderPortal",
|
|
82
|
-
value: function renderPortal(child) {
|
|
83
|
-
if (this.renderInPlace) {
|
|
84
|
-
return child;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
this.element = child;
|
|
88
|
-
return null;
|
|
29
|
+
}
|
|
30
|
+
componentWillUnmount() {
|
|
31
|
+
if (this.context && this.context.portalDeregister) {
|
|
32
|
+
this.context.portalDeregister(this.portalKey);
|
|
89
33
|
}
|
|
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"]));
|
|
34
|
+
}
|
|
102
35
|
|
|
103
|
-
|
|
104
|
-
|
|
36
|
+
// Overridden in victory-core-native
|
|
37
|
+
renderPortal(child) {
|
|
38
|
+
if (this.renderInPlace) {
|
|
39
|
+
return child;
|
|
105
40
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
};
|
|
115
|
-
|
|
41
|
+
this.element = child;
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
const children = Array.isArray(this.props.children) ? this.props.children[0] : this.props.children;
|
|
46
|
+
const {
|
|
47
|
+
groupComponent
|
|
48
|
+
} = this.props;
|
|
49
|
+
const childProps = children && children.props || {};
|
|
50
|
+
const standardProps = childProps.groupComponent ? {
|
|
51
|
+
groupComponent,
|
|
52
|
+
standalone: false
|
|
53
|
+
} : {};
|
|
54
|
+
const newProps = _defaults(standardProps, childProps, Helpers.omit(this.props, ["children", "groupComponent"]));
|
|
55
|
+
const child = children && /*#__PURE__*/React.cloneElement(children, newProps);
|
|
56
|
+
return this.renderPortal(child);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -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,39 +1,33 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
1
|
/* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 2, 180] }]*/
|
|
8
2
|
import React from "react";
|
|
9
3
|
import * as Helpers from "../victory-util/helpers";
|
|
10
4
|
import { Path } from "./path";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
5
|
+
const getArcPath = props => {
|
|
6
|
+
const {
|
|
7
|
+
cx,
|
|
8
|
+
cy,
|
|
9
|
+
r,
|
|
10
|
+
startAngle,
|
|
11
|
+
endAngle,
|
|
12
|
+
closedPath
|
|
13
|
+
} = props;
|
|
14
|
+
// Always draw the path as two arcs so that complete circles may be rendered.
|
|
15
|
+
const halfAngle = Math.abs(endAngle - startAngle) / 2 + startAngle;
|
|
16
|
+
const x1 = cx + r * Math.cos(Helpers.degreesToRadians(startAngle));
|
|
17
|
+
const y1 = cy - r * Math.sin(Helpers.degreesToRadians(startAngle));
|
|
18
|
+
const x2 = cx + r * Math.cos(Helpers.degreesToRadians(halfAngle));
|
|
19
|
+
const y2 = cy - r * Math.sin(Helpers.degreesToRadians(halfAngle));
|
|
20
|
+
const x3 = cx + r * Math.cos(Helpers.degreesToRadians(endAngle));
|
|
21
|
+
const y3 = cy - r * Math.sin(Helpers.degreesToRadians(endAngle));
|
|
22
|
+
const largerArcFlag1 = halfAngle - startAngle <= 180 ? 0 : 1;
|
|
23
|
+
const largerArcFlag2 = endAngle - halfAngle <= 180 ? 0 : 1;
|
|
24
|
+
const arcStart = closedPath ? ` M ${cx}, ${cy} L ${x1}, ${y1}` : `M ${x1}, ${y1}`;
|
|
25
|
+
const arc1 = `A ${r}, ${r}, 0, ${largerArcFlag1}, 0, ${x2}, ${y2}`;
|
|
26
|
+
const arc2 = `A ${r}, ${r}, 0, ${largerArcFlag2}, 0, ${x3}, ${y3}`;
|
|
27
|
+
const arcEnd = closedPath ? "Z" : "";
|
|
28
|
+
return `${arcStart} ${arc1} ${arc2} ${arcEnd}`;
|
|
34
29
|
};
|
|
35
|
-
|
|
36
|
-
var evaluateProps = function (props) {
|
|
30
|
+
const evaluateProps = props => {
|
|
37
31
|
/**
|
|
38
32
|
* Potential evaluated props are:
|
|
39
33
|
* `ariaLabel`
|
|
@@ -42,31 +36,34 @@ var evaluateProps = function (props) {
|
|
|
42
36
|
* `style`
|
|
43
37
|
* `tabIndex`
|
|
44
38
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
const ariaLabel = Helpers.evaluateProp(props.ariaLabel, props);
|
|
40
|
+
const desc = Helpers.evaluateProp(props.desc, props);
|
|
41
|
+
const id = Helpers.evaluateProp(props.id, props);
|
|
42
|
+
const style = Helpers.evaluateStyle(Object.assign({
|
|
49
43
|
stroke: "black",
|
|
50
44
|
fill: "none"
|
|
51
45
|
}, props.style), props);
|
|
52
|
-
|
|
46
|
+
const tabIndex = Helpers.evaluateProp(props.tabIndex, props);
|
|
53
47
|
return Object.assign({}, props, {
|
|
54
|
-
ariaLabel
|
|
55
|
-
desc
|
|
56
|
-
id
|
|
57
|
-
style
|
|
58
|
-
tabIndex
|
|
48
|
+
ariaLabel,
|
|
49
|
+
desc,
|
|
50
|
+
id,
|
|
51
|
+
style,
|
|
52
|
+
tabIndex
|
|
59
53
|
});
|
|
60
54
|
};
|
|
61
|
-
|
|
62
|
-
var defaultProps = {
|
|
55
|
+
const defaultProps = {
|
|
63
56
|
pathComponent: /*#__PURE__*/React.createElement(Path, null),
|
|
64
57
|
role: "presentation",
|
|
65
58
|
shapeRendering: "auto"
|
|
66
59
|
};
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
export const Arc = initialProps => {
|
|
61
|
+
const props = evaluateProps({
|
|
62
|
+
...defaultProps,
|
|
63
|
+
...initialProps
|
|
64
|
+
});
|
|
65
|
+
return /*#__PURE__*/React.cloneElement(props.pathComponent, {
|
|
66
|
+
...props.events,
|
|
70
67
|
"aria-label": props.ariaLabel,
|
|
71
68
|
d: getArcPath(props),
|
|
72
69
|
style: props.style,
|
|
@@ -77,5 +74,5 @@ export var Arc = function (initialProps) {
|
|
|
77
74
|
shapeRendering: props.shapeRendering,
|
|
78
75
|
transform: props.transform,
|
|
79
76
|
clipPath: props.clipPath
|
|
80
|
-
})
|
|
77
|
+
});
|
|
81
78
|
};
|
|
@@ -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
|