victory-core 36.4.1 → 36.5.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/dist/victory-core.js +14463 -11478
- package/dist/victory-core.min.js +1 -1
- package/dist/victory-core.min.js.LICENSE.txt +19 -0
- package/es/index.d.ts +18 -941
- package/es/index.js +18 -73
- package/es/types/callbacks.d.ts +37 -0
- 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 +26 -0
- package/es/victory-accessible-group/victory-accessible-group.js +9 -16
- package/es/victory-animation/util.d.ts +67 -0
- package/es/victory-animation/util.js +7 -4
- package/es/victory-animation/victory-animation.d.ts +70 -0
- package/es/victory-animation/victory-animation.js +60 -67
- package/es/victory-clip-container/victory-clip-container.d.ts +77 -0
- package/es/victory-clip-container/victory-clip-container.js +16 -21
- package/es/victory-container/victory-container.d.ts +100 -0
- package/es/victory-container/victory-container.js +32 -31
- package/es/victory-label/victory-label.d.ts +62 -0
- package/es/victory-label/victory-label.js +14 -9
- package/es/victory-portal/portal-context.d.ts +12 -0
- package/es/victory-portal/portal-context.js +3 -3
- package/es/victory-portal/portal.d.ts +29 -0
- package/es/victory-portal/portal.js +26 -33
- package/es/victory-portal/victory-portal.d.ts +32 -0
- package/es/victory-portal/victory-portal.js +24 -22
- package/es/victory-primitives/arc.d.ts +50 -0
- package/es/victory-primitives/arc.js +4 -5
- package/es/victory-primitives/background.d.ts +51 -0
- package/es/victory-primitives/background.js +5 -6
- package/es/victory-primitives/border.d.ts +44 -0
- package/es/victory-primitives/border.js +4 -5
- package/es/victory-primitives/circle.d.ts +3 -0
- package/es/victory-primitives/circle.js +11 -7
- package/es/victory-primitives/clip-path.d.ts +15 -0
- package/es/victory-primitives/clip-path.js +6 -5
- package/es/victory-primitives/index.d.ts +15 -0
- package/es/victory-primitives/index.js +15 -0
- package/es/victory-primitives/line-segment.d.ts +46 -0
- package/es/victory-primitives/line-segment.js +4 -5
- package/es/victory-primitives/line.d.ts +3 -0
- package/es/victory-primitives/line.js +11 -7
- package/es/victory-primitives/path.d.ts +3 -0
- package/es/victory-primitives/path.js +9 -5
- package/es/victory-primitives/point.d.ts +49 -0
- package/es/victory-primitives/point.js +10 -19
- package/es/victory-primitives/rect.d.ts +3 -0
- package/es/victory-primitives/rect.js +11 -7
- package/es/victory-primitives/text.d.ts +17 -0
- package/es/victory-primitives/text.js +7 -5
- package/es/victory-primitives/tspan.d.ts +3 -0
- package/es/victory-primitives/tspan.js +7 -5
- package/es/victory-primitives/types.d.ts +8 -0
- package/es/victory-primitives/types.js +2 -0
- package/es/victory-primitives/whisker.d.ts +59 -0
- package/es/victory-primitives/whisker.js +4 -5
- 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 +3 -0
- package/es/victory-theme/grayscale.js +3 -2
- package/es/victory-theme/material.d.ts +3 -0
- package/es/victory-theme/material.js +3 -2
- package/es/victory-theme/types.d.ts +239 -0
- package/es/victory-theme/types.js +2 -0
- package/es/victory-theme/victory-theme.d.ts +6 -0
- package/es/victory-theme/victory-theme.js +8 -6
- package/es/victory-transition/victory-transition.d.ts +60 -0
- package/es/victory-transition/victory-transition.js +20 -23
- package/es/victory-util/add-events.d.ts +106 -0
- package/es/victory-util/add-events.js +44 -34
- package/es/victory-util/axis.d.ts +51 -0
- package/es/victory-util/axis.js +9 -8
- package/es/victory-util/collection.d.ts +9 -0
- package/es/victory-util/collection.js +6 -6
- 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 -3
- package/es/victory-util/default-transitions.d.ts +5 -0
- package/es/victory-util/default-transitions.js +2 -2
- package/es/victory-util/domain.d.ts +91 -0
- package/es/victory-util/domain.js +6 -4
- 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 -6
- 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 +2 -1
- 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 -5
- 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 -3
- 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 -2
- package/es/victory-util/point-path-helpers.d.ts +10 -0
- package/es/victory-util/point-path-helpers.js +60 -61
- 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 -0
- package/es/victory-util/selection.js +25 -16
- package/es/victory-util/style.d.ts +19 -0
- package/es/victory-util/style.js +2 -3
- package/es/victory-util/textsize.d.ts +37 -0
- package/es/victory-util/textsize.js +9 -6
- package/es/victory-util/timer-context.d.ts +12 -0
- package/es/victory-util/timer-context.js +2 -1
- package/es/victory-util/timer.d.ts +17 -0
- package/es/victory-util/timer.js +15 -9
- 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 +18 -941
- package/lib/index.js +224 -311
- package/lib/types/callbacks.d.ts +37 -0
- 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 +26 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +10 -15
- package/lib/victory-animation/util.d.ts +67 -0
- package/lib/victory-animation/util.js +7 -4
- package/lib/victory-animation/victory-animation.d.ts +70 -0
- package/lib/victory-animation/victory-animation.js +61 -65
- package/lib/victory-clip-container/victory-clip-container.d.ts +77 -0
- package/lib/victory-clip-container/victory-clip-container.js +20 -22
- package/lib/victory-container/victory-container.d.ts +100 -0
- package/lib/victory-container/victory-container.js +35 -31
- package/lib/victory-label/victory-label.d.ts +62 -0
- package/lib/victory-label/victory-label.js +20 -14
- package/lib/victory-portal/portal-context.d.ts +12 -0
- package/lib/victory-portal/portal-context.js +3 -3
- package/lib/victory-portal/portal.d.ts +29 -0
- package/lib/victory-portal/portal.js +27 -31
- package/lib/victory-portal/victory-portal.d.ts +32 -0
- package/lib/victory-portal/victory-portal.js +25 -20
- package/lib/victory-primitives/arc.d.ts +50 -0
- package/lib/victory-primitives/arc.js +7 -7
- package/lib/victory-primitives/background.d.ts +51 -0
- package/lib/victory-primitives/background.js +9 -9
- package/lib/victory-primitives/border.d.ts +44 -0
- package/lib/victory-primitives/border.js +7 -7
- package/lib/victory-primitives/circle.d.ts +3 -0
- package/lib/victory-primitives/circle.js +12 -6
- package/lib/victory-primitives/clip-path.d.ts +15 -0
- package/lib/victory-primitives/clip-path.js +7 -4
- package/lib/victory-primitives/index.d.ts +15 -0
- package/lib/victory-primitives/index.js +188 -0
- package/lib/victory-primitives/line-segment.d.ts +46 -0
- package/lib/victory-primitives/line-segment.js +7 -7
- package/lib/victory-primitives/line.d.ts +3 -0
- package/lib/victory-primitives/line.js +12 -6
- package/lib/victory-primitives/path.d.ts +3 -0
- package/lib/victory-primitives/path.js +10 -4
- package/lib/victory-primitives/point.d.ts +49 -0
- package/lib/victory-primitives/point.js +15 -22
- package/lib/victory-primitives/rect.d.ts +3 -0
- package/lib/victory-primitives/rect.js +12 -6
- package/lib/victory-primitives/text.d.ts +17 -0
- package/lib/victory-primitives/text.js +8 -4
- package/lib/victory-primitives/tspan.d.ts +3 -0
- package/lib/victory-primitives/tspan.js +8 -4
- package/lib/victory-primitives/types.d.ts +8 -0
- package/lib/victory-primitives/types.js +2 -0
- package/lib/victory-primitives/whisker.d.ts +59 -0
- package/lib/victory-primitives/whisker.js +7 -7
- 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 +3 -0
- package/lib/victory-theme/grayscale.js +4 -3
- package/lib/victory-theme/material.d.ts +3 -0
- package/lib/victory-theme/material.js +4 -3
- package/lib/victory-theme/types.d.ts +239 -0
- package/lib/victory-theme/types.js +2 -0
- package/lib/victory-theme/victory-theme.d.ts +6 -0
- package/lib/victory-theme/victory-theme.js +23 -8
- package/lib/victory-transition/victory-transition.d.ts +60 -0
- package/lib/victory-transition/victory-transition.js +22 -23
- package/lib/victory-util/add-events.d.ts +106 -0
- package/lib/victory-util/add-events.js +48 -40
- 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 -6
- 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 -2
- 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 -6
- 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 +2 -1
- 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 -6
- 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 -3
- 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 -2
- package/lib/victory-util/point-path-helpers.d.ts +10 -0
- package/lib/victory-util/point-path-helpers.js +87 -73
- 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 -0
- package/lib/victory-util/selection.js +25 -21
- package/lib/victory-util/style.d.ts +19 -0
- package/lib/victory-util/style.js +2 -3
- package/lib/victory-util/textsize.d.ts +37 -0
- package/lib/victory-util/textsize.js +9 -6
- package/lib/victory-util/timer-context.d.ts +12 -0
- package/lib/victory-util/timer-context.js +2 -1
- package/lib/victory-util/timer.d.ts +17 -0
- package/lib/victory-util/timer.js +15 -9
- 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 +4 -4
- package/src/index.ts +17 -0
- package/src/types/callbacks.ts +53 -0
- package/src/types/prop-types.ts +195 -0
- package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +13 -6
- package/src/victory-animation/{util.js → util.ts} +6 -4
- package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +100 -23
- package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +52 -28
- package/src/victory-container/{victory-container.js → victory-container.tsx} +86 -42
- package/src/victory-label/{victory-label.js → victory-label.tsx} +108 -49
- package/src/victory-portal/portal-context.ts +14 -0
- package/src/victory-portal/{portal.js → portal.tsx} +24 -13
- package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +24 -9
- package/src/victory-primitives/{arc.js → arc.tsx} +22 -10
- package/src/victory-primitives/{background.js → background.tsx} +24 -12
- package/src/victory-primitives/{border.js → border.tsx} +19 -10
- package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
- package/src/victory-primitives/clip-path.tsx +25 -0
- package/src/victory-primitives/index.ts +14 -0
- package/src/victory-primitives/{line-segment.js → line-segment.tsx} +20 -10
- package/src/victory-primitives/{line.js → line.tsx} +4 -3
- package/src/victory-primitives/{path.js → path.tsx} +4 -3
- package/src/victory-primitives/{point.js → point.tsx} +33 -26
- package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
- package/src/victory-primitives/{text.js → text.tsx} +10 -4
- package/src/victory-primitives/tspan.tsx +7 -0
- package/src/victory-primitives/types.ts +19 -0
- package/src/victory-primitives/{whisker.js → whisker.tsx} +34 -19
- 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.js → grayscale.tsx} +63 -62
- package/src/victory-theme/{material.js → material.tsx} +68 -67
- package/src/victory-theme/types.ts +257 -0
- package/src/victory-theme/victory-theme.tsx +5 -0
- package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +82 -33
- package/src/victory-util/{add-events.js → add-events.tsx} +142 -60
- package/src/victory-util/{axis.js → axis.tsx} +17 -19
- package/src/victory-util/{collection.js → collection.tsx} +14 -11
- package/src/victory-util/common-props.tsx +307 -0
- package/src/victory-util/{data.js → data.ts} +14 -11
- package/src/victory-util/{default-transitions.js → default-transitions.ts} +20 -19
- package/src/victory-util/{domain.js → domain.ts} +26 -24
- package/src/victory-util/{events.js → events.ts} +83 -32
- package/src/victory-util/{helpers.js → helpers.ts} +41 -23
- package/src/victory-util/hooks/{index.js → index.ts} +0 -0
- package/src/victory-util/hooks/use-animation-state.js +10 -10
- package/src/victory-util/hooks/use-previous-props.ts +9 -0
- package/src/victory-util/{immutable.js → immutable.ts} +14 -11
- package/src/victory-util/index.ts +28 -0
- package/src/victory-util/{label-helpers.js → label-helpers.ts} +7 -8
- package/src/victory-util/line-helpers.ts +104 -0
- package/src/victory-util/{log.js → log.ts} +1 -2
- package/src/victory-util/point-path-helpers.ts +119 -0
- package/src/victory-util/{prop-types.js → prop-types.ts} +103 -102
- package/src/victory-util/{scale.js → scale.ts} +29 -17
- package/src/victory-util/selection.ts +158 -0
- package/src/victory-util/{style.js → style.ts} +3 -4
- package/src/victory-util/{textsize.js → textsize.ts} +32 -17
- package/src/victory-util/{timer-context.js → timer-context.ts} +1 -1
- package/src/victory-util/{timer.js → timer.ts} +16 -6
- package/src/victory-util/{transitions.js → transitions.ts} +50 -23
- 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 -34
- package/src/index.d.ts +0 -941
- package/src/index.js +0 -51
- package/src/victory-portal/portal-context.js +0 -10
- package/src/victory-primitives/clip-path.js +0 -18
- package/src/victory-primitives/tspan.js +0 -5
- package/src/victory-theme/victory-theme.js +0 -7
- 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/point-path-helpers.js +0 -121
- package/src/victory-util/selection.js +0 -99
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VictoryClipContainer = void 0;
|
|
7
7
|
|
|
8
8
|
var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId"));
|
|
9
9
|
|
|
@@ -23,11 +23,11 @@ var Helpers = _interopRequireWildcard(require("../victory-util/helpers"));
|
|
|
23
23
|
|
|
24
24
|
var UserProps = _interopRequireWildcard(require("../victory-util/user-props"));
|
|
25
25
|
|
|
26
|
-
var _clipPath =
|
|
26
|
+
var _clipPath = require("../victory-primitives/clip-path");
|
|
27
27
|
|
|
28
|
-
var _circle =
|
|
28
|
+
var _circle = require("../victory-primitives/circle");
|
|
29
29
|
|
|
30
|
-
var _rect =
|
|
30
|
+
var _rect = require("../victory-primitives/rect");
|
|
31
31
|
|
|
32
32
|
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); }
|
|
33
33
|
|
|
@@ -51,6 +51,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
51
51
|
|
|
52
52
|
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; }
|
|
53
53
|
|
|
54
|
+
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; }
|
|
55
|
+
|
|
54
56
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
55
57
|
|
|
56
58
|
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); } }
|
|
@@ -59,7 +61,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
59
61
|
|
|
60
62
|
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); }
|
|
61
63
|
|
|
62
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
64
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
63
65
|
|
|
64
66
|
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); }; }
|
|
65
67
|
|
|
@@ -69,9 +71,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
69
71
|
|
|
70
72
|
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; } }
|
|
71
73
|
|
|
72
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
73
|
-
|
|
74
|
-
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; }
|
|
74
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
75
75
|
|
|
76
76
|
var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
77
77
|
_inherits(VictoryClipContainer, _React$Component);
|
|
@@ -84,6 +84,7 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
84
84
|
_classCallCheck(this, VictoryClipContainer);
|
|
85
85
|
|
|
86
86
|
_this = _super.call(this, props);
|
|
87
|
+
_this.clipId = void 0;
|
|
87
88
|
_this.clipId = !(0, _isObject2.default)(props) || props.clipId === undefined ? (0, _uniqueId2.default)("victory-clip-") : props.clipId;
|
|
88
89
|
return _this;
|
|
89
90
|
}
|
|
@@ -259,13 +260,10 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
259
260
|
return VictoryClipContainer;
|
|
260
261
|
}(_react.default.Component);
|
|
261
262
|
|
|
262
|
-
exports.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
_defineProperty(VictoryClipContainer, "role", "container");
|
|
267
|
-
|
|
268
|
-
_defineProperty(VictoryClipContainer, "propTypes", {
|
|
263
|
+
exports.VictoryClipContainer = VictoryClipContainer;
|
|
264
|
+
VictoryClipContainer.displayName = "VictoryClipContainer";
|
|
265
|
+
VictoryClipContainer.role = "container";
|
|
266
|
+
VictoryClipContainer.propTypes = {
|
|
269
267
|
"aria-label": _propTypes.default.string,
|
|
270
268
|
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
|
|
271
269
|
circleComponent: _propTypes.default.element,
|
|
@@ -293,11 +291,11 @@ _defineProperty(VictoryClipContainer, "propTypes", {
|
|
|
293
291
|
transform: _propTypes.default.string,
|
|
294
292
|
translateX: _propTypes.default.number,
|
|
295
293
|
translateY: _propTypes.default.number
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
clipPathComponent: /*#__PURE__*/_react.default.createElement(_clipPath.default, null),
|
|
294
|
+
};
|
|
295
|
+
VictoryClipContainer.defaultProps = {
|
|
296
|
+
circleComponent: /*#__PURE__*/_react.default.createElement(_circle.Circle, null),
|
|
297
|
+
rectComponent: /*#__PURE__*/_react.default.createElement(_rect.Rect, null),
|
|
298
|
+
clipPathComponent: /*#__PURE__*/_react.default.createElement(_clipPath.ClipPath, null),
|
|
302
299
|
groupComponent: /*#__PURE__*/_react.default.createElement("g", null)
|
|
303
|
-
}
|
|
300
|
+
};
|
|
301
|
+
//# sourceMappingURL=victory-clip-container.js.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { OriginType } from "../victory-label/victory-label";
|
|
4
|
+
import { D3Scale } from "../types/prop-types";
|
|
5
|
+
import { VictoryThemeDefinition } from "../victory-theme/types";
|
|
6
|
+
export interface VictoryContainerProps {
|
|
7
|
+
"aria-describedby"?: string;
|
|
8
|
+
"aria-labelledby"?: string;
|
|
9
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
10
|
+
className?: string;
|
|
11
|
+
containerId?: number | string;
|
|
12
|
+
containerRef?: React.Ref<HTMLElement>;
|
|
13
|
+
desc?: string;
|
|
14
|
+
events?: React.DOMAttributes<any>;
|
|
15
|
+
height?: number;
|
|
16
|
+
name?: string;
|
|
17
|
+
origin?: OriginType;
|
|
18
|
+
ouiaId?: number | string;
|
|
19
|
+
ouiaSafe?: boolean;
|
|
20
|
+
ouiaType?: string;
|
|
21
|
+
polar?: boolean;
|
|
22
|
+
portalComponent?: React.ReactElement;
|
|
23
|
+
portalZIndex?: number;
|
|
24
|
+
preserveAspectRatio?: string;
|
|
25
|
+
responsive?: boolean;
|
|
26
|
+
role?: string;
|
|
27
|
+
scale?: {
|
|
28
|
+
x?: D3Scale;
|
|
29
|
+
y?: D3Scale;
|
|
30
|
+
};
|
|
31
|
+
style?: React.CSSProperties;
|
|
32
|
+
tabIndex?: number;
|
|
33
|
+
theme?: VictoryThemeDefinition;
|
|
34
|
+
title?: string;
|
|
35
|
+
width?: number;
|
|
36
|
+
}
|
|
37
|
+
export declare class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
38
|
+
static displayName: string;
|
|
39
|
+
static role: string;
|
|
40
|
+
static propTypes: {
|
|
41
|
+
"aria-describedby": PropTypes.Requireable<string>;
|
|
42
|
+
"aria-labelledby": PropTypes.Requireable<string>;
|
|
43
|
+
children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
44
|
+
className: PropTypes.Requireable<string>;
|
|
45
|
+
containerId: PropTypes.Requireable<string | number>;
|
|
46
|
+
containerRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
+
desc: PropTypes.Requireable<string>;
|
|
48
|
+
events: PropTypes.Requireable<object>;
|
|
49
|
+
height: PropTypes.Requireable<number | undefined>;
|
|
50
|
+
name: PropTypes.Requireable<string>;
|
|
51
|
+
origin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
52
|
+
x: PropTypes.Requireable<number | undefined>;
|
|
53
|
+
y: PropTypes.Requireable<number | undefined>;
|
|
54
|
+
}>>;
|
|
55
|
+
ouiaId: PropTypes.Requireable<string | number>;
|
|
56
|
+
ouiaSafe: PropTypes.Requireable<boolean>;
|
|
57
|
+
ouiaType: PropTypes.Requireable<string>;
|
|
58
|
+
polar: PropTypes.Requireable<boolean>;
|
|
59
|
+
portalComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
60
|
+
portalZIndex: PropTypes.Requireable<number | undefined>;
|
|
61
|
+
preserveAspectRatio: PropTypes.Requireable<string>;
|
|
62
|
+
responsive: PropTypes.Requireable<boolean>;
|
|
63
|
+
role: PropTypes.Requireable<string>;
|
|
64
|
+
style: PropTypes.Requireable<object>;
|
|
65
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
66
|
+
theme: PropTypes.Requireable<object>;
|
|
67
|
+
title: PropTypes.Requireable<string>;
|
|
68
|
+
width: PropTypes.Requireable<number | undefined>;
|
|
69
|
+
};
|
|
70
|
+
static defaultProps: {
|
|
71
|
+
className: string;
|
|
72
|
+
portalComponent: JSX.Element;
|
|
73
|
+
portalZIndex: number;
|
|
74
|
+
responsive: boolean;
|
|
75
|
+
role: string;
|
|
76
|
+
};
|
|
77
|
+
static contextType: React.Context<{
|
|
78
|
+
transitionTimer: import("..").Timer;
|
|
79
|
+
animationTimer: import("..").Timer;
|
|
80
|
+
}>;
|
|
81
|
+
private containerId;
|
|
82
|
+
private portalRef;
|
|
83
|
+
private containerRef;
|
|
84
|
+
private shouldHandleWheel;
|
|
85
|
+
constructor(props: VictoryContainerProps);
|
|
86
|
+
savePortalRef: (portal: any) => any;
|
|
87
|
+
portalUpdate: (key: any, el: any) => void;
|
|
88
|
+
portalRegister: () => number;
|
|
89
|
+
portalDeregister: (key: any) => void;
|
|
90
|
+
saveContainerRef: (container: HTMLElement) => HTMLElement;
|
|
91
|
+
handleWheel: (e: any) => any;
|
|
92
|
+
componentDidMount(): void;
|
|
93
|
+
componentWillUnmount(): void;
|
|
94
|
+
getIdForElement(elementName: any): string;
|
|
95
|
+
getChildren(props: any): any;
|
|
96
|
+
getOUIAProps(props: any): any;
|
|
97
|
+
renderContainer(props: any, svgProps: any, style: any): JSX.Element;
|
|
98
|
+
render(): JSX.Element;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=victory-container.d.ts.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VictoryContainer = void 0;
|
|
7
7
|
|
|
8
8
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
9
9
|
|
|
@@ -21,9 +21,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
21
21
|
|
|
22
22
|
var CustomPropTypes = _interopRequireWildcard(require("../victory-util/prop-types"));
|
|
23
23
|
|
|
24
|
-
var _portal =
|
|
24
|
+
var _portal = require("../victory-portal/portal");
|
|
25
25
|
|
|
26
|
-
var _portalContext =
|
|
26
|
+
var _portalContext = require("../victory-portal/portal-context");
|
|
27
27
|
|
|
28
28
|
var _timerContext = _interopRequireDefault(require("../victory-util/timer-context"));
|
|
29
29
|
|
|
@@ -37,12 +37,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
37
37
|
|
|
38
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
39
|
|
|
40
|
-
function _extends() { _extends = Object.assign
|
|
40
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
41
41
|
|
|
42
42
|
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; }
|
|
43
43
|
|
|
44
44
|
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; }
|
|
45
45
|
|
|
46
|
+
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; }
|
|
47
|
+
|
|
46
48
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
47
49
|
|
|
48
50
|
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); } }
|
|
@@ -51,7 +53,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
51
53
|
|
|
52
54
|
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); }
|
|
53
55
|
|
|
54
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
56
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
55
57
|
|
|
56
58
|
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); }; }
|
|
57
59
|
|
|
@@ -61,22 +63,25 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
61
63
|
|
|
62
64
|
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; } }
|
|
63
65
|
|
|
64
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
65
|
-
|
|
66
|
-
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; }
|
|
66
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
67
67
|
|
|
68
68
|
var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
69
69
|
_inherits(VictoryContainer, _React$Component);
|
|
70
70
|
|
|
71
71
|
var _super = _createSuper(VictoryContainer);
|
|
72
72
|
|
|
73
|
+
// @ts-expect-error Ref will be initialized on mount
|
|
74
|
+
// @ts-expect-error Ref will be initialized on mount
|
|
73
75
|
function VictoryContainer(props) {
|
|
74
76
|
var _this;
|
|
75
77
|
|
|
76
78
|
_classCallCheck(this, VictoryContainer);
|
|
77
79
|
|
|
78
80
|
_this = _super.call(this, props);
|
|
79
|
-
_this.containerId =
|
|
81
|
+
_this.containerId = void 0;
|
|
82
|
+
_this.portalRef = void 0;
|
|
83
|
+
_this.containerRef = void 0;
|
|
84
|
+
_this.shouldHandleWheel = void 0;
|
|
80
85
|
|
|
81
86
|
_this.savePortalRef = function (portal) {
|
|
82
87
|
_this.portalRef = portal;
|
|
@@ -95,18 +100,21 @@ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
95
100
|
return _this.portalRef.portalDeregister(key);
|
|
96
101
|
};
|
|
97
102
|
|
|
98
|
-
_this.saveContainerRef =
|
|
103
|
+
_this.saveContainerRef = function (container) {
|
|
104
|
+
if ((0, _isFunction2.default)(_this.props.containerRef)) {
|
|
105
|
+
_this.props.containerRef(container);
|
|
106
|
+
}
|
|
107
|
+
|
|
99
108
|
_this.containerRef = container;
|
|
100
109
|
return container;
|
|
101
110
|
};
|
|
102
|
-
_this.shouldHandleWheel = props && props.events && props.events.onWheel;
|
|
103
111
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
};
|
|
108
|
-
}
|
|
112
|
+
_this.handleWheel = function (e) {
|
|
113
|
+
return e.preventDefault();
|
|
114
|
+
};
|
|
109
115
|
|
|
116
|
+
_this.containerId = !(0, _isObject2.default)(props) || props.containerId === undefined ? (0, _uniqueId2.default)("victory-container-") : props.containerId;
|
|
117
|
+
_this.shouldHandleWheel = !!(props && props.events && props.events.onWheel);
|
|
110
118
|
return _this;
|
|
111
119
|
}
|
|
112
120
|
|
|
@@ -194,7 +202,7 @@ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
194
202
|
preserveAspectRatio: svgProps.preserveAspectRatio,
|
|
195
203
|
style: portalSvgStyle
|
|
196
204
|
};
|
|
197
|
-
return /*#__PURE__*/_react.default.createElement(_portalContext.
|
|
205
|
+
return /*#__PURE__*/_react.default.createElement(_portalContext.PortalContext.Provider, {
|
|
198
206
|
value: {
|
|
199
207
|
portalUpdate: this.portalUpdate,
|
|
200
208
|
portalRegister: this.portalRegister,
|
|
@@ -248,13 +256,10 @@ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
248
256
|
return VictoryContainer;
|
|
249
257
|
}(_react.default.Component);
|
|
250
258
|
|
|
251
|
-
exports.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
_defineProperty(VictoryContainer, "role", "container");
|
|
256
|
-
|
|
257
|
-
_defineProperty(VictoryContainer, "propTypes", {
|
|
259
|
+
exports.VictoryContainer = VictoryContainer;
|
|
260
|
+
VictoryContainer.displayName = "VictoryContainer";
|
|
261
|
+
VictoryContainer.role = "container";
|
|
262
|
+
VictoryContainer.propTypes = {
|
|
258
263
|
"aria-describedby": _propTypes.default.string,
|
|
259
264
|
"aria-labelledby": _propTypes.default.string,
|
|
260
265
|
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
|
|
@@ -283,14 +288,13 @@ _defineProperty(VictoryContainer, "propTypes", {
|
|
|
283
288
|
theme: _propTypes.default.object,
|
|
284
289
|
title: _propTypes.default.string,
|
|
285
290
|
width: CustomPropTypes.nonNegative
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
_defineProperty(VictoryContainer, "defaultProps", {
|
|
291
|
+
};
|
|
292
|
+
VictoryContainer.defaultProps = {
|
|
289
293
|
className: "VictoryContainer",
|
|
290
|
-
portalComponent: /*#__PURE__*/_react.default.createElement(_portal.
|
|
294
|
+
portalComponent: /*#__PURE__*/_react.default.createElement(_portal.Portal, null),
|
|
291
295
|
portalZIndex: 99,
|
|
292
296
|
responsive: true,
|
|
293
297
|
role: "img"
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
298
|
+
};
|
|
299
|
+
VictoryContainer.contextType = _timerContext.default;
|
|
300
|
+
//# sourceMappingURL=victory-container.js.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback } from "../types/callbacks";
|
|
3
|
+
import { PaddingProps, VerticalAnchorType, VictoryLabelStyleObject } from "../victory-theme/victory-theme";
|
|
4
|
+
export declare type TextAnchorType = "start" | "middle" | "end" | "inherit";
|
|
5
|
+
export declare type OriginType = {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
export declare type LabelOrientationType = "parallel" | "perpendicular" | "vertical";
|
|
10
|
+
export interface VictoryLabelProps {
|
|
11
|
+
angle?: StringOrNumberOrCallback;
|
|
12
|
+
ariaLabel?: StringOrCallback;
|
|
13
|
+
backgroundComponent?: React.ReactElement;
|
|
14
|
+
backgroundStyle?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
15
|
+
backgroundPadding?: PaddingProps | PaddingProps[];
|
|
16
|
+
capHeight?: StringOrNumberOrCallback;
|
|
17
|
+
children?: StringOrNumberOrCallback;
|
|
18
|
+
className?: string;
|
|
19
|
+
datum?: object;
|
|
20
|
+
data?: any[];
|
|
21
|
+
desc?: string;
|
|
22
|
+
direction?: string;
|
|
23
|
+
disableInlineStyles?: boolean;
|
|
24
|
+
events?: React.DOMAttributes<any>;
|
|
25
|
+
groupComponent?: React.ReactElement;
|
|
26
|
+
id?: StringOrNumberOrCallback;
|
|
27
|
+
inline?: boolean;
|
|
28
|
+
labelPlacement?: LabelOrientationType;
|
|
29
|
+
lineHeight?: StringOrNumberOrCallback | (string | number)[];
|
|
30
|
+
origin?: OriginType;
|
|
31
|
+
polar?: boolean;
|
|
32
|
+
renderInPortal?: boolean;
|
|
33
|
+
style?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
34
|
+
tabIndex?: NumberOrCallback;
|
|
35
|
+
text?: string[] | StringOrNumberOrCallback;
|
|
36
|
+
textComponent?: React.ReactElement;
|
|
37
|
+
textAnchor?: TextAnchorType | {
|
|
38
|
+
(): TextAnchorType;
|
|
39
|
+
};
|
|
40
|
+
title?: string;
|
|
41
|
+
transform?: string | object | (() => string | object);
|
|
42
|
+
tspanComponent?: React.ReactElement;
|
|
43
|
+
verticalAnchor?: VerticalAnchorType | {
|
|
44
|
+
(): VerticalAnchorType;
|
|
45
|
+
};
|
|
46
|
+
x?: number;
|
|
47
|
+
y?: number;
|
|
48
|
+
dx?: StringOrNumberOrCallback;
|
|
49
|
+
dy?: StringOrNumberOrCallback;
|
|
50
|
+
}
|
|
51
|
+
declare const defaultStyles: {
|
|
52
|
+
fill: string;
|
|
53
|
+
fontSize: number;
|
|
54
|
+
fontFamily: string;
|
|
55
|
+
stroke: string;
|
|
56
|
+
};
|
|
57
|
+
export declare const VictoryLabel: {
|
|
58
|
+
role: string;
|
|
59
|
+
defaultStyles: typeof defaultStyles;
|
|
60
|
+
} & React.FC<VictoryLabelProps>;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=victory-label.d.ts.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VictoryLabel = void 0;
|
|
7
7
|
|
|
8
8
|
var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
|
|
9
9
|
|
|
@@ -15,13 +15,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
|
|
18
|
-
var _victoryPortal =
|
|
18
|
+
var _victoryPortal = require("../victory-portal/victory-portal");
|
|
19
19
|
|
|
20
|
-
var _rect =
|
|
20
|
+
var _rect = require("../victory-primitives/rect");
|
|
21
21
|
|
|
22
|
-
var _text =
|
|
22
|
+
var _text = require("../victory-primitives/text");
|
|
23
23
|
|
|
24
|
-
var _tspan =
|
|
24
|
+
var _tspan = require("../victory-primitives/tspan");
|
|
25
25
|
|
|
26
26
|
var Helpers = _interopRequireWildcard(require("../victory-util/helpers"));
|
|
27
27
|
|
|
@@ -553,6 +553,7 @@ var VictoryLabel = function (props) {
|
|
|
553
553
|
fontSize: currentStyle.fontSize || defaultStyles.fontSize,
|
|
554
554
|
capHeight: capHeightPx,
|
|
555
555
|
text: line,
|
|
556
|
+
// @ts-expect-error TODO: This looks like a bug:
|
|
556
557
|
textSize: TextSize.approximateTextSize(line, currentStyle),
|
|
557
558
|
lineHeight: currentLineHeight,
|
|
558
559
|
backgroundPadding: getSingleValue(backgroundPadding, i)
|
|
@@ -566,12 +567,13 @@ var VictoryLabel = function (props) {
|
|
|
566
567
|
|
|
567
568
|
var backgroundWithLabel = /*#__PURE__*/_react.default.cloneElement(props.groupComponent, {}, children);
|
|
568
569
|
|
|
569
|
-
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.
|
|
570
|
+
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
|
|
570
571
|
}
|
|
571
572
|
|
|
572
|
-
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.
|
|
573
|
+
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.VictoryPortal, null, label) : label;
|
|
573
574
|
};
|
|
574
575
|
|
|
576
|
+
exports.VictoryLabel = VictoryLabel;
|
|
575
577
|
VictoryLabel.displayName = "VictoryLabel";
|
|
576
578
|
VictoryLabel.role = "label";
|
|
577
579
|
VictoryLabel.defaultStyles = defaultStyles;
|
|
@@ -586,6 +588,7 @@ VictoryLabel.propTypes = {
|
|
|
586
588
|
className: _propTypes.default.string,
|
|
587
589
|
data: _propTypes.default.array,
|
|
588
590
|
datum: _propTypes.default.any,
|
|
591
|
+
// @ts-expect-error "Function is not assignable to string"
|
|
589
592
|
desc: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]),
|
|
590
593
|
direction: _propTypes.default.oneOf(["rtl", "ltr", "inherit"]),
|
|
591
594
|
dx: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.func]),
|
|
@@ -598,8 +601,8 @@ VictoryLabel.propTypes = {
|
|
|
598
601
|
labelPlacement: _propTypes.default.oneOf(["parallel", "perpendicular", "vertical"]),
|
|
599
602
|
lineHeight: _propTypes.default.oneOfType([_propTypes.default.string, CustomPropTypes.nonNegative, _propTypes.default.func, _propTypes.default.array]),
|
|
600
603
|
origin: _propTypes.default.shape({
|
|
601
|
-
x: CustomPropTypes.nonNegative,
|
|
602
|
-
y: CustomPropTypes.nonNegative
|
|
604
|
+
x: CustomPropTypes.nonNegative.isRequired,
|
|
605
|
+
y: CustomPropTypes.nonNegative.isRequired
|
|
603
606
|
}),
|
|
604
607
|
polar: _propTypes.default.bool,
|
|
605
608
|
renderInPortal: _propTypes.default.bool,
|
|
@@ -610,24 +613,27 @@ VictoryLabel.propTypes = {
|
|
|
610
613
|
style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]),
|
|
611
614
|
tabIndex: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
612
615
|
text: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.func, _propTypes.default.array]),
|
|
616
|
+
// @ts-expect-error Function is not assignable to string"
|
|
613
617
|
textAnchor: _propTypes.default.oneOfType([_propTypes.default.oneOf(["start", "middle", "end", "inherit"]), _propTypes.default.func]),
|
|
614
618
|
textComponent: _propTypes.default.element,
|
|
615
619
|
title: _propTypes.default.string,
|
|
616
620
|
transform: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.func]),
|
|
617
621
|
tspanComponent: _propTypes.default.element,
|
|
622
|
+
// @ts-expect-error Function is not assignable to string"
|
|
618
623
|
verticalAnchor: _propTypes.default.oneOfType([_propTypes.default.oneOf(["start", "middle", "end"]), _propTypes.default.func]),
|
|
624
|
+
// @ts-expect-error Number is not assignable to string
|
|
619
625
|
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
626
|
+
// @ts-expect-error Number is not assignable to string
|
|
620
627
|
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
621
628
|
};
|
|
622
629
|
VictoryLabel.defaultProps = {
|
|
623
|
-
backgroundComponent: /*#__PURE__*/_react.default.createElement(_rect.
|
|
630
|
+
backgroundComponent: /*#__PURE__*/_react.default.createElement(_rect.Rect, null),
|
|
624
631
|
groupComponent: /*#__PURE__*/_react.default.createElement("g", null),
|
|
625
632
|
direction: "inherit",
|
|
626
|
-
textComponent: /*#__PURE__*/_react.default.createElement(_text.
|
|
627
|
-
tspanComponent: /*#__PURE__*/_react.default.createElement(_tspan.
|
|
633
|
+
textComponent: /*#__PURE__*/_react.default.createElement(_text.Text, null),
|
|
634
|
+
tspanComponent: /*#__PURE__*/_react.default.createElement(_tspan.TSpan, null),
|
|
628
635
|
capHeight: 0.71,
|
|
629
636
|
// Magic number from d3.
|
|
630
637
|
lineHeight: 1
|
|
631
638
|
};
|
|
632
|
-
|
|
633
|
-
exports.default = _default;
|
|
639
|
+
//# sourceMappingURL=victory-label.js.map
|
|
@@ -0,0 +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>;
|
|
12
|
+
//# sourceMappingURL=portal-context.d.ts.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PortalContext = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -15,6 +15,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
15
|
*/
|
|
16
16
|
var PortalContext = /*#__PURE__*/_react.default.createContext({});
|
|
17
17
|
|
|
18
|
+
exports.PortalContext = PortalContext;
|
|
18
19
|
PortalContext.displayName = "PortalContext";
|
|
19
|
-
|
|
20
|
-
exports.default = _default;
|
|
20
|
+
//# sourceMappingURL=portal-context.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { PortalContextValue } from "./portal-context";
|
|
4
|
+
export interface PortalProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
height?: number;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
viewBox?: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class Portal extends React.Component<PortalProps> implements PortalContextValue {
|
|
12
|
+
static displayName: string;
|
|
13
|
+
static propTypes: {
|
|
14
|
+
className: PropTypes.Requireable<string>;
|
|
15
|
+
height: PropTypes.Requireable<number | undefined>;
|
|
16
|
+
style: PropTypes.Requireable<object>;
|
|
17
|
+
viewBox: PropTypes.Requireable<string>;
|
|
18
|
+
width: PropTypes.Requireable<number | undefined>;
|
|
19
|
+
};
|
|
20
|
+
private readonly map;
|
|
21
|
+
private index;
|
|
22
|
+
constructor(props: PortalProps);
|
|
23
|
+
portalRegister: () => number;
|
|
24
|
+
portalUpdate: (key: number, element: React.ReactElement) => void;
|
|
25
|
+
portalDeregister: (key: number) => void;
|
|
26
|
+
private getChildren;
|
|
27
|
+
render(): JSX.Element;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=portal.d.ts.map
|