victory-core 36.5.0 → 36.5.3
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/dist/victory-core.js +13817 -10827
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +7 -27
- package/es/index.js +7 -53
- package/es/{types.d.ts → types/callbacks.d.ts} +12 -8
- package/es/types/callbacks.js +2 -0
- package/es/types/prop-types.d.ts +130 -0
- package/es/types/prop-types.js +2 -0
- package/es/victory-accessible-group/victory-accessible-group.d.ts +1 -0
- package/es/victory-accessible-group/victory-accessible-group.js +2 -1
- package/es/victory-animation/util.d.ts +2 -1
- package/es/victory-animation/util.js +6 -4
- package/es/victory-animation/victory-animation.d.ts +1 -0
- package/es/victory-animation/victory-animation.js +2 -1
- package/es/victory-clip-container/victory-clip-container.d.ts +6 -5
- package/es/victory-clip-container/victory-clip-container.js +2 -1
- package/es/victory-container/victory-container.d.ts +8 -7
- package/es/victory-container/victory-container.js +2 -1
- package/es/victory-label/victory-label.d.ts +3 -2
- package/es/victory-label/victory-label.js +4 -4
- package/es/victory-portal/portal-context.d.ts +1 -0
- package/es/victory-portal/portal-context.js +2 -1
- package/es/victory-portal/portal.d.ts +3 -2
- package/es/victory-portal/portal.js +2 -1
- package/es/victory-portal/victory-portal.d.ts +1 -0
- package/es/victory-portal/victory-portal.js +2 -1
- package/es/victory-primitives/arc.d.ts +31 -2
- package/es/victory-primitives/arc.js +3 -2
- package/es/victory-primitives/background.d.ts +31 -2
- package/es/victory-primitives/background.js +3 -2
- package/es/victory-primitives/border.d.ts +28 -2
- package/es/victory-primitives/border.js +3 -2
- package/es/victory-primitives/circle.d.ts +1 -0
- package/es/victory-primitives/circle.js +2 -1
- package/es/victory-primitives/clip-path.d.ts +2 -1
- package/es/victory-primitives/clip-path.js +2 -1
- package/es/victory-primitives/index.d.ts +1 -0
- package/es/victory-primitives/index.js +2 -1
- package/es/victory-primitives/line-segment.d.ts +29 -2
- package/es/victory-primitives/line-segment.js +3 -2
- package/es/victory-primitives/line.d.ts +1 -0
- package/es/victory-primitives/line.js +2 -1
- package/es/victory-primitives/path.d.ts +1 -0
- package/es/victory-primitives/path.js +2 -1
- package/es/victory-primitives/point.d.ts +30 -2
- package/es/victory-primitives/point.js +3 -2
- package/es/victory-primitives/rect.d.ts +1 -0
- package/es/victory-primitives/rect.js +2 -1
- package/es/victory-primitives/text.d.ts +2 -1
- package/es/victory-primitives/text.js +2 -1
- package/es/victory-primitives/tspan.d.ts +2 -1
- package/es/victory-primitives/tspan.js +2 -1
- package/es/victory-primitives/types.d.ts +2 -1
- package/es/victory-primitives/types.js +2 -1
- package/es/victory-primitives/whisker.d.ts +37 -2
- package/es/victory-primitives/whisker.js +3 -2
- package/es/victory-state/defaults.d.ts +3 -0
- package/es/victory-state/defaults.js +3 -0
- package/es/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/es/victory-state/helpers/get-axis-data.js +15 -0
- package/es/victory-state/helpers/get-data.d.ts +15 -0
- package/es/victory-state/helpers/get-data.js +88 -0
- package/es/victory-state/helpers/get-domain.d.ts +6 -0
- package/es/victory-state/helpers/get-domain.js +68 -0
- package/es/victory-state/helpers/get-range.d.ts +6 -0
- package/es/victory-state/helpers/get-range.js +37 -0
- package/es/victory-state/helpers/get-scale.d.ts +6 -0
- package/es/victory-state/helpers/get-scale.js +59 -0
- package/es/victory-state/index.d.ts +3 -0
- package/es/victory-state/index.js +3 -0
- package/es/victory-state/types.d.ts +24 -0
- package/es/victory-state/types.js +2 -0
- package/es/victory-state/victory-provider.d.ts +19 -0
- package/es/victory-state/victory-provider.js +118 -0
- package/es/victory-theme/grayscale.d.ts +2 -1
- package/es/victory-theme/grayscale.js +2 -1
- package/es/victory-theme/material.d.ts +2 -1
- package/es/victory-theme/material.js +2 -1
- package/{lib/victory-theme/victory-theme-definition.d.ts → es/victory-theme/types.d.ts} +3 -8
- package/es/victory-theme/types.js +2 -0
- package/es/victory-theme/victory-theme.d.ts +4 -3
- package/es/victory-theme/victory-theme.js +3 -2
- package/es/victory-transition/victory-transition.d.ts +1 -0
- package/es/victory-transition/victory-transition.js +2 -1
- package/es/victory-util/add-events.d.ts +106 -0
- package/es/victory-util/add-events.js +40 -33
- package/es/victory-util/axis.d.ts +51 -0
- package/es/victory-util/axis.js +9 -7
- package/es/victory-util/collection.d.ts +9 -0
- package/es/victory-util/collection.js +6 -4
- package/es/victory-util/common-props.d.ts +84 -0
- package/es/victory-util/common-props.js +29 -12
- package/es/victory-util/data.d.ts +75 -0
- package/es/victory-util/data.js +2 -1
- package/es/victory-util/default-transitions.d.ts +5 -0
- package/es/victory-util/default-transitions.js +2 -1
- package/es/victory-util/domain.d.ts +91 -0
- package/es/victory-util/domain.js +6 -2
- package/es/victory-util/events.d.ts +65 -0
- package/es/victory-util/events.js +13 -8
- package/es/victory-util/helpers.d.ts +61 -0
- package/es/victory-util/helpers.js +8 -4
- package/es/victory-util/hooks/index.d.ts +3 -0
- package/es/victory-util/hooks/index.js +2 -1
- package/es/victory-util/hooks/use-animation-state.js +4 -3
- package/es/victory-util/hooks/use-previous-props.d.ts +2 -0
- package/es/victory-util/hooks/use-previous-props.js +4 -3
- package/es/victory-util/immutable.d.ts +12 -0
- package/es/victory-util/immutable.js +5 -4
- package/es/victory-util/index.d.ts +29 -0
- package/es/victory-util/index.js +48 -0
- package/es/victory-util/label-helpers.d.ts +27 -0
- package/es/victory-util/label-helpers.js +2 -1
- package/es/victory-util/line-helpers.d.ts +5 -0
- package/es/victory-util/line-helpers.js +24 -6
- package/es/victory-util/log.d.ts +2 -0
- package/es/victory-util/log.js +2 -1
- package/es/victory-util/point-path-helpers.d.ts +1 -0
- package/es/victory-util/point-path-helpers.js +2 -1
- package/es/victory-util/prop-types.d.ts +51 -0
- package/es/victory-util/prop-types.js +35 -44
- package/es/victory-util/scale.d.ts +10 -0
- package/es/victory-util/scale.js +14 -6
- package/es/victory-util/selection.d.ts +25 -23
- package/es/victory-util/selection.js +25 -14
- package/es/victory-util/style.d.ts +19 -0
- package/es/victory-util/style.js +2 -1
- package/es/victory-util/textsize.d.ts +37 -8
- package/es/victory-util/textsize.js +9 -6
- package/es/victory-util/timer-context.d.ts +1 -0
- package/es/victory-util/timer-context.js +2 -1
- package/es/victory-util/timer.d.ts +3 -2
- package/es/victory-util/timer.js +2 -1
- package/es/victory-util/transitions.d.ts +49 -0
- package/es/victory-util/transitions.js +5 -4
- package/es/victory-util/type-helpers.d.ts +10 -0
- package/es/victory-util/type-helpers.js +28 -0
- package/es/victory-util/user-props.d.ts +21 -0
- package/es/victory-util/user-props.js +6 -5
- package/es/victory-util/with-container.d.ts +5 -0
- package/es/victory-util/with-container.js +32 -0
- package/es/victory-util/wrapper.d.ts +38 -0
- package/es/victory-util/wrapper.js +4 -3
- package/lib/index.d.ts +7 -27
- package/lib/index.js +58 -147
- package/lib/{types.d.ts → types/callbacks.d.ts} +12 -8
- package/lib/types/callbacks.js +2 -0
- package/lib/types/prop-types.d.ts +130 -0
- package/lib/types/prop-types.js +2 -0
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +1 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +2 -1
- package/lib/victory-animation/util.d.ts +2 -1
- package/lib/victory-animation/util.js +6 -4
- package/lib/victory-animation/victory-animation.d.ts +1 -0
- package/lib/victory-animation/victory-animation.js +2 -1
- package/lib/victory-clip-container/victory-clip-container.d.ts +6 -5
- package/lib/victory-clip-container/victory-clip-container.js +2 -1
- package/lib/victory-container/victory-container.d.ts +8 -7
- package/lib/victory-container/victory-container.js +2 -1
- package/lib/victory-label/victory-label.d.ts +3 -2
- package/lib/victory-label/victory-label.js +4 -4
- package/lib/victory-portal/portal-context.d.ts +1 -0
- package/lib/victory-portal/portal-context.js +2 -1
- package/lib/victory-portal/portal.d.ts +3 -2
- package/lib/victory-portal/portal.js +2 -1
- package/lib/victory-portal/victory-portal.d.ts +1 -0
- package/lib/victory-portal/victory-portal.js +2 -1
- package/lib/victory-primitives/arc.d.ts +31 -2
- package/lib/victory-primitives/arc.js +4 -3
- package/lib/victory-primitives/background.d.ts +31 -2
- package/lib/victory-primitives/background.js +4 -3
- package/lib/victory-primitives/border.d.ts +28 -2
- package/lib/victory-primitives/border.js +4 -3
- package/lib/victory-primitives/circle.d.ts +1 -0
- package/lib/victory-primitives/circle.js +2 -1
- package/lib/victory-primitives/clip-path.d.ts +2 -1
- package/lib/victory-primitives/clip-path.js +2 -1
- package/lib/victory-primitives/index.d.ts +1 -0
- package/lib/victory-primitives/index.js +2 -1
- package/lib/victory-primitives/line-segment.d.ts +29 -2
- package/lib/victory-primitives/line-segment.js +4 -3
- package/lib/victory-primitives/line.d.ts +1 -0
- package/lib/victory-primitives/line.js +2 -1
- package/lib/victory-primitives/path.d.ts +1 -0
- package/lib/victory-primitives/path.js +2 -1
- package/lib/victory-primitives/point.d.ts +30 -2
- package/lib/victory-primitives/point.js +4 -3
- package/lib/victory-primitives/rect.d.ts +1 -0
- package/lib/victory-primitives/rect.js +2 -1
- package/lib/victory-primitives/text.d.ts +2 -1
- package/lib/victory-primitives/text.js +2 -1
- package/lib/victory-primitives/tspan.d.ts +2 -1
- package/lib/victory-primitives/tspan.js +2 -1
- package/lib/victory-primitives/types.d.ts +2 -1
- package/lib/victory-primitives/types.js +2 -1
- package/lib/victory-primitives/whisker.d.ts +37 -2
- package/lib/victory-primitives/whisker.js +4 -3
- package/lib/victory-state/defaults.d.ts +3 -0
- package/lib/victory-state/defaults.js +11 -0
- package/lib/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/lib/victory-state/helpers/get-axis-data.js +23 -0
- package/lib/victory-state/helpers/get-data.d.ts +15 -0
- package/lib/victory-state/helpers/get-data.js +99 -0
- package/lib/victory-state/helpers/get-domain.d.ts +6 -0
- package/lib/victory-state/helpers/get-domain.js +82 -0
- package/lib/victory-state/helpers/get-range.d.ts +6 -0
- package/lib/victory-state/helpers/get-range.js +46 -0
- package/lib/victory-state/helpers/get-scale.d.ts +6 -0
- package/lib/victory-state/helpers/get-scale.js +74 -0
- package/lib/victory-state/index.d.ts +3 -0
- package/lib/victory-state/index.js +32 -0
- package/lib/victory-state/types.d.ts +24 -0
- package/lib/victory-state/types.js +2 -0
- package/lib/victory-state/victory-provider.d.ts +19 -0
- package/lib/victory-state/victory-provider.js +144 -0
- package/lib/victory-theme/grayscale.d.ts +2 -1
- package/lib/victory-theme/grayscale.js +2 -1
- package/lib/victory-theme/material.d.ts +2 -1
- package/lib/victory-theme/material.js +2 -1
- package/{es/victory-theme/victory-theme-definition.d.ts → lib/victory-theme/types.d.ts} +3 -8
- package/lib/victory-theme/types.js +2 -0
- package/lib/victory-theme/victory-theme.d.ts +4 -3
- package/lib/victory-theme/victory-theme.js +6 -5
- package/lib/victory-transition/victory-transition.d.ts +1 -0
- package/lib/victory-transition/victory-transition.js +2 -1
- package/lib/victory-util/add-events.d.ts +106 -0
- package/lib/victory-util/add-events.js +40 -36
- package/lib/victory-util/axis.d.ts +51 -0
- package/lib/victory-util/axis.js +8 -6
- package/lib/victory-util/collection.d.ts +9 -0
- package/lib/victory-util/collection.js +6 -4
- package/lib/victory-util/common-props.d.ts +84 -0
- package/lib/victory-util/common-props.js +27 -12
- package/lib/victory-util/data.d.ts +75 -0
- package/lib/victory-util/data.js +2 -1
- package/lib/victory-util/default-transitions.d.ts +5 -0
- package/lib/victory-util/default-transitions.js +2 -1
- package/lib/victory-util/domain.d.ts +91 -0
- package/lib/victory-util/domain.js +6 -2
- package/lib/victory-util/events.d.ts +65 -0
- package/lib/victory-util/events.js +13 -9
- package/lib/victory-util/helpers.d.ts +61 -0
- package/lib/victory-util/helpers.js +8 -4
- package/lib/victory-util/hooks/index.d.ts +3 -0
- package/lib/victory-util/hooks/index.js +2 -1
- package/lib/victory-util/hooks/use-animation-state.js +4 -3
- package/lib/victory-util/hooks/use-previous-props.d.ts +2 -0
- package/lib/victory-util/hooks/use-previous-props.js +5 -6
- package/lib/victory-util/immutable.d.ts +12 -0
- package/lib/victory-util/immutable.js +5 -4
- package/lib/victory-util/index.d.ts +29 -0
- package/lib/victory-util/index.js +181 -0
- package/lib/victory-util/label-helpers.d.ts +27 -0
- package/lib/victory-util/label-helpers.js +2 -1
- package/lib/victory-util/line-helpers.d.ts +5 -0
- package/lib/victory-util/line-helpers.js +28 -7
- package/lib/victory-util/log.d.ts +2 -0
- package/lib/victory-util/log.js +2 -1
- package/lib/victory-util/point-path-helpers.d.ts +1 -0
- package/lib/victory-util/point-path-helpers.js +2 -1
- package/lib/victory-util/prop-types.d.ts +51 -0
- package/lib/victory-util/prop-types.js +36 -44
- package/lib/victory-util/scale.d.ts +10 -0
- package/lib/victory-util/scale.js +14 -5
- package/lib/victory-util/selection.d.ts +25 -23
- package/lib/victory-util/selection.js +25 -19
- package/lib/victory-util/style.d.ts +19 -0
- package/lib/victory-util/style.js +2 -1
- package/lib/victory-util/textsize.d.ts +37 -8
- package/lib/victory-util/textsize.js +9 -6
- package/lib/victory-util/timer-context.d.ts +1 -0
- package/lib/victory-util/timer-context.js +2 -1
- package/lib/victory-util/timer.d.ts +3 -2
- package/lib/victory-util/timer.js +2 -1
- package/lib/victory-util/transitions.d.ts +49 -0
- package/lib/victory-util/transitions.js +5 -4
- package/lib/victory-util/type-helpers.d.ts +10 -0
- package/lib/victory-util/type-helpers.js +45 -0
- package/lib/victory-util/user-props.d.ts +21 -0
- package/lib/victory-util/user-props.js +6 -5
- package/lib/victory-util/with-container.d.ts +5 -0
- package/lib/victory-util/with-container.js +44 -0
- package/lib/victory-util/wrapper.d.ts +38 -0
- package/lib/victory-util/wrapper.js +4 -3
- package/package.json +3 -3
- package/src/index.ts +9 -31
- package/src/{types.ts → types/callbacks.ts} +21 -13
- package/src/types/prop-types.ts +195 -0
- package/src/victory-accessible-group/victory-accessible-group.tsx +3 -3
- package/src/victory-animation/util.ts +3 -2
- package/src/victory-animation/victory-animation.tsx +13 -13
- package/src/victory-clip-container/victory-clip-container.tsx +23 -23
- package/src/victory-container/victory-container.tsx +19 -19
- package/src/victory-label/victory-label.tsx +41 -39
- package/src/victory-portal/portal.tsx +1 -1
- package/src/victory-portal/victory-portal.tsx +3 -3
- package/src/victory-primitives/arc.tsx +8 -6
- package/src/victory-primitives/background.tsx +8 -6
- package/src/victory-primitives/border.tsx +8 -6
- package/src/victory-primitives/clip-path.tsx +3 -3
- package/src/victory-primitives/line-segment.tsx +8 -6
- package/src/victory-primitives/point.tsx +10 -8
- package/src/victory-primitives/text.tsx +2 -2
- package/src/victory-primitives/tspan.tsx +1 -1
- package/src/victory-primitives/types.ts +1 -1
- package/src/victory-primitives/whisker.tsx +15 -13
- package/src/victory-state/defaults.ts +2 -0
- package/src/victory-state/helpers/get-axis-data.ts +14 -0
- package/src/victory-state/helpers/get-data.ts +79 -0
- package/src/victory-state/helpers/get-domain.ts +62 -0
- package/src/victory-state/helpers/get-range.ts +39 -0
- package/src/victory-state/helpers/get-scale.ts +64 -0
- package/src/victory-state/index.ts +2 -0
- package/src/victory-state/types.ts +32 -0
- package/src/victory-state/victory-provider.tsx +116 -0
- package/src/victory-theme/grayscale.tsx +62 -62
- package/src/victory-theme/material.tsx +67 -67
- package/src/victory-theme/{victory-theme-definition.ts → types.ts} +10 -14
- package/src/victory-theme/victory-theme.tsx +1 -1
- package/src/victory-transition/victory-transition.tsx +19 -19
- package/src/victory-util/{add-events.js → add-events.tsx} +136 -59
- package/src/victory-util/{axis.js → axis.tsx} +17 -18
- package/src/victory-util/{collection.js → collection.tsx} +14 -10
- package/src/victory-util/common-props.tsx +307 -0
- package/src/victory-util/{data.js → data.ts} +14 -10
- package/src/victory-util/{default-transitions.js → default-transitions.ts} +20 -18
- package/src/victory-util/{domain.js → domain.ts} +26 -23
- package/src/victory-util/{events.js → events.ts} +82 -31
- package/src/victory-util/{helpers.js → helpers.ts} +41 -22
- package/src/victory-util/hooks/{index.js → index.ts} +0 -0
- package/src/victory-util/hooks/use-animation-state.js +12 -12
- package/src/victory-util/hooks/use-previous-props.ts +9 -0
- package/src/victory-util/{immutable.js → immutable.ts} +14 -10
- package/src/victory-util/index.ts +28 -0
- package/src/victory-util/{label-helpers.js → label-helpers.ts} +7 -7
- package/src/victory-util/line-helpers.ts +104 -0
- package/src/victory-util/{log.js → log.ts} +1 -1
- package/src/victory-util/{prop-types.js → prop-types.ts} +103 -101
- package/src/victory-util/{scale.js → scale.ts} +29 -16
- package/src/victory-util/selection.ts +158 -0
- package/src/victory-util/{style.js → style.ts} +3 -3
- package/src/victory-util/{textsize.js → textsize.ts} +32 -17
- package/src/victory-util/timer-context.ts +1 -1
- package/src/victory-util/timer.ts +5 -10
- package/src/victory-util/{transitions.js → transitions.ts} +50 -22
- package/src/victory-util/type-helpers.ts +50 -0
- package/src/victory-util/{user-props.js → user-props.ts} +16 -11
- package/src/victory-util/with-container.tsx +41 -0
- package/src/victory-util/{wrapper.js → wrapper.tsx} +38 -33
- package/es/types.js +0 -1
- package/es/victory-theme/victory-theme-definition.js +0 -1
- package/es/victory-util/types.d.ts +0 -188
- package/es/victory-util/types.js +0 -1
- package/lib/types.js +0 -1
- package/lib/victory-theme/victory-theme-definition.js +0 -1
- package/lib/victory-util/types.d.ts +0 -188
- package/lib/victory-util/types.js +0 -1
- package/src/victory-util/common-props.js +0 -197
- package/src/victory-util/hooks/use-previous-props.js +0 -9
- package/src/victory-util/line-helpers.js +0 -54
- package/src/victory-util/selection.d.ts +0 -23
- package/src/victory-util/selection.js +0 -98
- package/src/victory-util/textsize.d.ts +0 -8
- package/src/victory-util/types.ts +0 -247
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AxisType, D3ScaleFn } from "../../types/prop-types";
|
|
2
|
+
import { VictoryProviderProps } from "../types";
|
|
3
|
+
declare type ScaleProps = Pick<VictoryProviderProps, "data" | "scale">;
|
|
4
|
+
export declare function getScale({ data, ...props }: ScaleProps, axis: AxisType): D3ScaleFn;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=get-scale.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getScale = getScale;
|
|
7
|
+
|
|
8
|
+
var _d3Scale = require("victory-vendor/d3-scale");
|
|
9
|
+
|
|
10
|
+
var Collection = _interopRequireWildcard(require("../../victory-util/collection"));
|
|
11
|
+
|
|
12
|
+
var _typeHelpers = require("../../victory-util/type-helpers");
|
|
13
|
+
|
|
14
|
+
var _getAxisData = require("./get-axis-data");
|
|
15
|
+
|
|
16
|
+
var _excluded = ["data"];
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
+
|
|
26
|
+
var DEFAULT_SCALE = _d3Scale.scaleLinear;
|
|
27
|
+
|
|
28
|
+
function isD3Scale(scale) {
|
|
29
|
+
return (0, _typeHelpers.isFunction)(scale) && (0, _typeHelpers.isFunction)(scale().copy) && (0, _typeHelpers.isFunction)(scale().domain) && (0, _typeHelpers.isFunction)(scale().range);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getD3ScaleFromString(scale) {
|
|
33
|
+
switch (scale) {
|
|
34
|
+
case "linear":
|
|
35
|
+
return _d3Scale.scaleLinear;
|
|
36
|
+
|
|
37
|
+
case "time":
|
|
38
|
+
return _d3Scale.scaleTime;
|
|
39
|
+
|
|
40
|
+
case "log":
|
|
41
|
+
return _d3Scale.scaleLog;
|
|
42
|
+
|
|
43
|
+
case "sqrt":
|
|
44
|
+
return _d3Scale.scaleSqrt;
|
|
45
|
+
|
|
46
|
+
default:
|
|
47
|
+
return DEFAULT_SCALE;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getScale(_ref, axis) {
|
|
52
|
+
var _ref$data = _ref.data,
|
|
53
|
+
data = _ref$data === void 0 ? [] : _ref$data,
|
|
54
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
55
|
+
|
|
56
|
+
var scale = (0, _typeHelpers.getValueForAxis)(props.scale, axis);
|
|
57
|
+
|
|
58
|
+
if (isD3Scale(scale)) {
|
|
59
|
+
return scale;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (typeof scale === "string") {
|
|
63
|
+
return getD3ScaleFromString(scale);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var axisData = (0, _getAxisData.getAxisData)(data, axis);
|
|
67
|
+
|
|
68
|
+
if (Collection.containsDates(axisData)) {
|
|
69
|
+
return _d3Scale.scaleTime;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return DEFAULT_SCALE;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=get-scale.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _victoryProvider = require("./victory-provider");
|
|
8
|
+
|
|
9
|
+
Object.keys(_victoryProvider).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _victoryProvider[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _victoryProvider[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _types = require("./types");
|
|
21
|
+
|
|
22
|
+
Object.keys(_types).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _types[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { D3ScaleFn, Datum, DomainTuple, RangeTuple, ScalePropType, ValueOrAxes } from "../types/prop-types";
|
|
3
|
+
import { PaddingProps } from "../victory-theme/types";
|
|
4
|
+
export interface VictoryCalculatedStateProps {
|
|
5
|
+
data?: Datum[];
|
|
6
|
+
domain?: ValueOrAxes<DomainTuple>;
|
|
7
|
+
height?: number;
|
|
8
|
+
includeZero?: boolean;
|
|
9
|
+
maxDomain?: ValueOrAxes<number>;
|
|
10
|
+
minDomain?: ValueOrAxes<number>;
|
|
11
|
+
padding?: PaddingProps;
|
|
12
|
+
range?: ValueOrAxes<RangeTuple>;
|
|
13
|
+
samples?: number;
|
|
14
|
+
scale?: ValueOrAxes<ScalePropType | D3ScaleFn>;
|
|
15
|
+
sortKey?: string;
|
|
16
|
+
sortOrder?: "ascending" | "descending";
|
|
17
|
+
width?: number;
|
|
18
|
+
x?: string;
|
|
19
|
+
y?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface VictoryProviderProps extends VictoryCalculatedStateProps {
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { D3ScaleFn, DomainTuple, ForAxes } from "../types/prop-types";
|
|
2
|
+
import { FormattedDatum } from "./helpers/get-data";
|
|
3
|
+
import { VictoryCalculatedStateProps, VictoryProviderProps } from "./types";
|
|
4
|
+
declare type ScaleType = Required<ForAxes<D3ScaleFn>>;
|
|
5
|
+
declare type DomainType = Required<ForAxes<DomainTuple>>;
|
|
6
|
+
export interface ContextType {
|
|
7
|
+
data: FormattedDatum[];
|
|
8
|
+
scale: ScaleType;
|
|
9
|
+
domain: DomainType;
|
|
10
|
+
setChildProps: (id: string, props: VictoryProviderProps) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function VictoryProvider({ children, ...initialProps }: VictoryProviderProps): JSX.Element;
|
|
13
|
+
export declare function useVictoryContext<T>(selector: (value: ContextType) => T): T;
|
|
14
|
+
export declare function useScale(): ScaleType;
|
|
15
|
+
export declare function useData(): FormattedDatum[];
|
|
16
|
+
export declare function useDomain(): DomainType;
|
|
17
|
+
export declare function useVictoryProviderSync(id: string, props: VictoryCalculatedStateProps): VictoryCalculatedStateProps;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=victory-provider.d.ts.map
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VictoryProvider = VictoryProvider;
|
|
7
|
+
exports.useData = useData;
|
|
8
|
+
exports.useDomain = useDomain;
|
|
9
|
+
exports.useScale = useScale;
|
|
10
|
+
exports.useVictoryContext = useVictoryContext;
|
|
11
|
+
exports.useVictoryProviderSync = useVictoryProviderSync;
|
|
12
|
+
|
|
13
|
+
var React = _interopRequireWildcard(require("react"));
|
|
14
|
+
|
|
15
|
+
var _getData = require("./helpers/get-data");
|
|
16
|
+
|
|
17
|
+
var _getDomain = require("./helpers/get-domain");
|
|
18
|
+
|
|
19
|
+
var _getRange = require("./helpers/get-range");
|
|
20
|
+
|
|
21
|
+
var _getScale = require("./helpers/get-scale");
|
|
22
|
+
|
|
23
|
+
var _excluded = ["children"];
|
|
24
|
+
|
|
25
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
|
+
|
|
27
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
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; }
|
|
32
|
+
|
|
33
|
+
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; }
|
|
34
|
+
|
|
35
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
36
|
+
|
|
37
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
38
|
+
|
|
39
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
40
|
+
|
|
41
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
42
|
+
|
|
43
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
44
|
+
|
|
45
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
46
|
+
|
|
47
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
48
|
+
|
|
49
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
50
|
+
|
|
51
|
+
var VictoryContext = /*#__PURE__*/(0, React.createContext)(null);
|
|
52
|
+
|
|
53
|
+
function VictoryProvider(_ref) {
|
|
54
|
+
var children = _ref.children,
|
|
55
|
+
initialProps = _objectWithoutProperties(_ref, _excluded);
|
|
56
|
+
|
|
57
|
+
// We need to store the props in state so they can be overwritten by child components
|
|
58
|
+
var _React$useState = React.useState(initialProps),
|
|
59
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
60
|
+
props = _React$useState2[0],
|
|
61
|
+
setProps = _React$useState2[1];
|
|
62
|
+
|
|
63
|
+
var setChildProps = React.useCallback(function (id, newProps) {
|
|
64
|
+
setProps(function (prevProps) {
|
|
65
|
+
return _objectSpread(_objectSpread({}, prevProps), newProps);
|
|
66
|
+
});
|
|
67
|
+
}, []);
|
|
68
|
+
var data = React.useMemo(function () {
|
|
69
|
+
return (0, _getData.getData)(props);
|
|
70
|
+
}, [props]);
|
|
71
|
+
var domain = React.useMemo(function () {
|
|
72
|
+
return {
|
|
73
|
+
x: (0, _getDomain.getDomain)(props, "x"),
|
|
74
|
+
y: (0, _getDomain.getDomain)(props, "y")
|
|
75
|
+
};
|
|
76
|
+
}, [props]);
|
|
77
|
+
var range = React.useMemo(function () {
|
|
78
|
+
return {
|
|
79
|
+
x: (0, _getRange.getRange)(props, "x"),
|
|
80
|
+
y: (0, _getRange.getRange)(props, "y")
|
|
81
|
+
};
|
|
82
|
+
}, [props]);
|
|
83
|
+
var scale = React.useMemo(function () {
|
|
84
|
+
var xBaseScaleFn = (0, _getScale.getScale)(props, "x");
|
|
85
|
+
var yBaseScaleFn = (0, _getScale.getScale)(props, "y"); // @ts-expect-error: This is a valid scale function
|
|
86
|
+
|
|
87
|
+
var xScaleFn = xBaseScaleFn().domain(domain.x).range(range.x); // @ts-expect-error: This is a valid scale function
|
|
88
|
+
|
|
89
|
+
var yScaleFn = yBaseScaleFn().domain(domain.y).range(range.y);
|
|
90
|
+
return {
|
|
91
|
+
x: xScaleFn,
|
|
92
|
+
y: yScaleFn
|
|
93
|
+
};
|
|
94
|
+
}, [props, domain, range]);
|
|
95
|
+
var value = {
|
|
96
|
+
scale: scale,
|
|
97
|
+
data: data,
|
|
98
|
+
domain: domain,
|
|
99
|
+
setChildProps: setChildProps
|
|
100
|
+
};
|
|
101
|
+
return /*#__PURE__*/React.createElement(VictoryContext.Provider, {
|
|
102
|
+
value: value
|
|
103
|
+
}, children);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function useVictoryContext(selector) {
|
|
107
|
+
var context = (0, React.useContext)(VictoryContext);
|
|
108
|
+
|
|
109
|
+
if (!context) {
|
|
110
|
+
throw new Error("useVictoryContext must be used within a VictoryProvider");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return selector(context);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function useScale() {
|
|
117
|
+
return useVictoryContext(function (value) {
|
|
118
|
+
return value.scale;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function useData() {
|
|
123
|
+
return useVictoryContext(function (value) {
|
|
124
|
+
return value.data;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function useDomain() {
|
|
129
|
+
return useVictoryContext(function (value) {
|
|
130
|
+
return value.domain;
|
|
131
|
+
});
|
|
132
|
+
} // This function keeps props in sync betwen the VictoryProvider and child components
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
function useVictoryProviderSync(id, props) {
|
|
136
|
+
var setChildProps = useVictoryContext(function (value) {
|
|
137
|
+
return value.setChildProps;
|
|
138
|
+
});
|
|
139
|
+
React.useEffect(function () {
|
|
140
|
+
setChildProps(id, props);
|
|
141
|
+
}, []);
|
|
142
|
+
return props;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=victory-provider.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { VictoryCommonThemeProps, VictoryDatableProps } from "../
|
|
3
|
-
import {
|
|
2
|
+
import { VictoryCommonThemeProps, VictoryDatableProps } from "../victory-util/common-props";
|
|
3
|
+
import { NumberOrCallback, OrientationOrCallback, PaddingOrCallback, StringOrNumberOrCallback } from "../types/callbacks";
|
|
4
4
|
export declare type BlockProps = {
|
|
5
5
|
top?: number;
|
|
6
6
|
bottom?: number;
|
|
@@ -9,12 +9,6 @@ export declare type BlockProps = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare type PaddingProps = number | BlockProps;
|
|
11
11
|
export declare type OrientationTypes = "top" | "bottom" | "left" | "right";
|
|
12
|
-
export declare type VictoryNumberCallback = (args: CallbackArgs) => number;
|
|
13
|
-
export declare type VictoryPaddingCallback = (args: CallbackArgs) => number | BlockProps;
|
|
14
|
-
export declare type VictoryOrientationCallback = (args: CallbackArgs) => OrientationTypes;
|
|
15
|
-
export declare type NumberOrCallback = number | VictoryNumberCallback;
|
|
16
|
-
export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
|
|
17
|
-
export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
|
|
18
12
|
export declare type VictoryStyleObject = {
|
|
19
13
|
[K in keyof React.CSSProperties]: StringOrNumberOrCallback;
|
|
20
14
|
};
|
|
@@ -242,3 +236,4 @@ export interface VictoryThemeDefinition {
|
|
|
242
236
|
};
|
|
243
237
|
} & VictoryCommonThemeProps & VictoryDatableProps;
|
|
244
238
|
}
|
|
239
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./types";
|
|
2
2
|
export declare const VictoryTheme: {
|
|
3
|
-
grayscale: import("./
|
|
4
|
-
material: import("./
|
|
3
|
+
grayscale: import("./types").VictoryThemeDefinition;
|
|
4
|
+
material: import("./types").VictoryThemeDefinition;
|
|
5
5
|
};
|
|
6
|
+
//# sourceMappingURL=victory-theme.d.ts.map
|
|
@@ -12,16 +12,16 @@ var _grayscale = require("./grayscale");
|
|
|
12
12
|
|
|
13
13
|
var _material = require("./material");
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _types = require("./types");
|
|
16
16
|
|
|
17
|
-
Object.keys(
|
|
17
|
+
Object.keys(_types).forEach(function (key) {
|
|
18
18
|
if (key === "default" || key === "__esModule") return;
|
|
19
19
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
|
-
if (key in exports && exports[key] ===
|
|
20
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
21
21
|
Object.defineProperty(exports, key, {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
get: function () {
|
|
24
|
-
return
|
|
24
|
+
return _types[key];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
@@ -29,4 +29,5 @@ var VictoryTheme = {
|
|
|
29
29
|
grayscale: _grayscale.grayscale,
|
|
30
30
|
material: _material.material
|
|
31
31
|
};
|
|
32
|
-
exports.VictoryTheme = VictoryTheme;
|
|
32
|
+
exports.VictoryTheme = VictoryTheme;
|
|
33
|
+
//# sourceMappingURL=victory-theme.js.map
|
|
@@ -261,4 +261,5 @@ VictoryTransition.propTypes = {
|
|
|
261
261
|
animationWhitelist: _propTypes.default.array,
|
|
262
262
|
children: _propTypes.default.node
|
|
263
263
|
};
|
|
264
|
-
VictoryTransition.contextType = _timerContext.default;
|
|
264
|
+
VictoryTransition.contextType = _timerContext.default;
|
|
265
|
+
//# sourceMappingURL=victory-transition.js.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentEvent } from "./events";
|
|
3
|
+
import * as Events from "./events";
|
|
4
|
+
import { VictoryCommonProps, VictoryDatableProps } from "./common-props";
|
|
5
|
+
import { VictoryLabelableProps } from "../types/prop-types";
|
|
6
|
+
export declare type MixinOptions = {
|
|
7
|
+
components?: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
index?: string;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
export interface EventMixinCommonProps extends VictoryCommonProps, VictoryDatableProps, VictoryLabelableProps {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* These methods will be implemented by the Mixin,
|
|
16
|
+
* and are accessible to the Wrapped Component.
|
|
17
|
+
*
|
|
18
|
+
* To make your Wrapped Component type-safe, use "interface merging" like so:
|
|
19
|
+
* @example
|
|
20
|
+
* interface MyComponent extends EventsMixinClass<MyProps> {}
|
|
21
|
+
* class MyComponent extends React.Component<MyProps> { ... }
|
|
22
|
+
*/
|
|
23
|
+
export interface EventsMixinClass<TProps> {
|
|
24
|
+
renderContainer(component: React.ReactElement, children: React.ReactElement[]): React.ReactElement;
|
|
25
|
+
cacheValues<TThis>(this: TThis, obj: Partial<TThis>): void;
|
|
26
|
+
getEventState: typeof Events.getEventState;
|
|
27
|
+
renderContinuousData(props: TProps): any;
|
|
28
|
+
animateComponent(props: TProps, defaultAnimationWhitelist: any): any;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* These fields are calculated by the Mixin
|
|
32
|
+
*/
|
|
33
|
+
export interface EventMixinCalculatedValues {
|
|
34
|
+
componentEvents: Array<ComponentEvent>;
|
|
35
|
+
getSharedEventState: (key: string, value: string) => unknown;
|
|
36
|
+
baseProps: Record<string, object>;
|
|
37
|
+
dataKeys: string[];
|
|
38
|
+
hasEvents: unknown;
|
|
39
|
+
events: unknown;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* This represents the class itself, including static fields
|
|
43
|
+
*/
|
|
44
|
+
export interface WrappedComponentClass<TProps> {
|
|
45
|
+
new (props: TProps): React.Component<TProps>;
|
|
46
|
+
getBaseProps?(props: TProps): EventMixinCalculatedValues["baseProps"];
|
|
47
|
+
role?: string;
|
|
48
|
+
expectedComponents?: string[];
|
|
49
|
+
}
|
|
50
|
+
export declare function addEvents<TBase extends WrappedComponentClass<TProps>, TProps extends EventMixinCommonProps>(WrappedComponent: TBase, options?: MixinOptions): {
|
|
51
|
+
new (props: TProps): {
|
|
52
|
+
state: {};
|
|
53
|
+
getEventState: (eventKey: string | number, namespace: string, childType?: string | undefined) => any;
|
|
54
|
+
getScopedEvents: (events: any, namespace: any, childType: any, baseProps: any) => {};
|
|
55
|
+
getEvents: (p: any, target: any, eventKey: any) => any;
|
|
56
|
+
externalMutations: {} | undefined;
|
|
57
|
+
calculatedState: {};
|
|
58
|
+
globalEvents: {};
|
|
59
|
+
prevGlobalEventKeys: string[];
|
|
60
|
+
boundGlobalEvents: {};
|
|
61
|
+
shouldComponentUpdate(nextProps: TProps): boolean;
|
|
62
|
+
componentDidMount(): void;
|
|
63
|
+
componentDidUpdate(prevProps: any): void;
|
|
64
|
+
componentWillUnmount(): void;
|
|
65
|
+
addGlobalListener(key: any): void;
|
|
66
|
+
removeGlobalListener(key: any): void;
|
|
67
|
+
getStateChanges(props: any): {};
|
|
68
|
+
applyExternalMutations(props: any, externalMutations: any): void;
|
|
69
|
+
getCalculatedValues(props: any): EventMixinCalculatedValues;
|
|
70
|
+
getExternalMutations(props: TProps): {} | undefined;
|
|
71
|
+
cacheValues(obj: any): void;
|
|
72
|
+
getBaseProps(props: any, getSharedEventState: any): Record<string, object>;
|
|
73
|
+
getAllEvents(props: any): any;
|
|
74
|
+
getComponentProps(component: any, type: any, index: any): any;
|
|
75
|
+
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
76
|
+
animateComponent(props: TProps, defaultAnimationWhitelist: string[]): JSX.Element;
|
|
77
|
+
renderContinuousData(props: TProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
78
|
+
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
79
|
+
context: unknown;
|
|
80
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<TProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
81
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
82
|
+
render(): React.ReactNode;
|
|
83
|
+
readonly props: Readonly<TProps>;
|
|
84
|
+
refs: {
|
|
85
|
+
[key: string]: React.ReactInstance;
|
|
86
|
+
};
|
|
87
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
88
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>): any;
|
|
89
|
+
componentWillMount?(): void;
|
|
90
|
+
UNSAFE_componentWillMount?(): void;
|
|
91
|
+
componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
|
|
92
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
|
|
93
|
+
componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
94
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
95
|
+
componentEvents: ComponentEvent[];
|
|
96
|
+
getSharedEventState: (key: string, value: string) => unknown;
|
|
97
|
+
baseProps: Record<string, object>;
|
|
98
|
+
dataKeys: string[];
|
|
99
|
+
hasEvents: unknown;
|
|
100
|
+
events: unknown;
|
|
101
|
+
};
|
|
102
|
+
getBaseProps?(props: TProps): Record<string, object>;
|
|
103
|
+
role?: string | undefined;
|
|
104
|
+
expectedComponents?: string[] | undefined;
|
|
105
|
+
} & TBase;
|
|
106
|
+
//# sourceMappingURL=add-events.d.ts.map
|