victory-core 36.4.0 → 36.5.1
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 +45735 -12154
- package/dist/victory-core.min.js +2 -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 +19 -23
- 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 +17 -10
- 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 +45 -38
- 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 +31 -14
- 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 +17 -3
- 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 +24 -24
- 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 +24 -15
- 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 +146 -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 +49 -47
- 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 +29 -14
- 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 +25 -4
- 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 +6 -6
- 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} +55 -29
- package/src/victory-container/{victory-container.js → victory-container.tsx} +86 -42
- package/src/victory-label/{victory-label.js → victory-label.tsx} +112 -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 +121 -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} +143 -64
- 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} +26 -8
- 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
|
|
|
@@ -21,11 +21,13 @@ var CustomPropTypes = _interopRequireWildcard(require("../victory-util/prop-type
|
|
|
21
21
|
|
|
22
22
|
var Helpers = _interopRequireWildcard(require("../victory-util/helpers"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var UserProps = _interopRequireWildcard(require("../victory-util/user-props"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _clipPath = require("../victory-primitives/clip-path");
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _circle = require("../victory-primitives/circle");
|
|
29
|
+
|
|
30
|
+
var _rect = require("../victory-primitives/rect");
|
|
29
31
|
|
|
30
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); }
|
|
31
33
|
|
|
@@ -49,6 +51,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
49
51
|
|
|
50
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; }
|
|
51
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
|
+
|
|
52
56
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
53
57
|
|
|
54
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); } }
|
|
@@ -57,7 +61,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
57
61
|
|
|
58
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); }
|
|
59
63
|
|
|
60
|
-
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); }
|
|
61
65
|
|
|
62
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); }; }
|
|
63
67
|
|
|
@@ -67,9 +71,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
67
71
|
|
|
68
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; } }
|
|
69
73
|
|
|
70
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
71
|
-
|
|
72
|
-
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); }
|
|
73
75
|
|
|
74
76
|
var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
75
77
|
_inherits(VictoryClipContainer, _React$Component);
|
|
@@ -82,6 +84,7 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
82
84
|
_classCallCheck(this, VictoryClipContainer);
|
|
83
85
|
|
|
84
86
|
_this = _super.call(this, props);
|
|
87
|
+
_this.clipId = void 0;
|
|
85
88
|
_this.clipId = !(0, _isObject2.default)(props) || props.clipId === undefined ? (0, _uniqueId2.default)("victory-clip-") : props.clipId;
|
|
86
89
|
return _this;
|
|
87
90
|
}
|
|
@@ -113,6 +116,7 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
113
116
|
}, {
|
|
114
117
|
key: "renderClippedGroup",
|
|
115
118
|
value: function renderClippedGroup(props, clipId) {
|
|
119
|
+
var userProps = UserProps.getSafeUserProps(props);
|
|
116
120
|
var style = props.style,
|
|
117
121
|
events = props.events,
|
|
118
122
|
transform = props.transform,
|
|
@@ -129,9 +133,8 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
129
133
|
clipPath: "url(#".concat(clipId, ")")
|
|
130
134
|
}, events);
|
|
131
135
|
return /*#__PURE__*/_react.default.cloneElement(groupComponent, _objectSpread(_objectSpread({}, groupProps), {}, {
|
|
132
|
-
"aria-label": props["aria-label"],
|
|
133
136
|
tabIndex: tabIndex
|
|
134
|
-
}), [clipComponent].concat(_toConsumableArray(_react.default.Children.toArray(children))));
|
|
137
|
+
}, userProps), [clipComponent].concat(_toConsumableArray(_react.default.Children.toArray(children))));
|
|
135
138
|
}
|
|
136
139
|
}, {
|
|
137
140
|
key: "renderGroup",
|
|
@@ -257,13 +260,10 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
257
260
|
return VictoryClipContainer;
|
|
258
261
|
}(_react.default.Component);
|
|
259
262
|
|
|
260
|
-
exports.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
_defineProperty(VictoryClipContainer, "role", "container");
|
|
265
|
-
|
|
266
|
-
_defineProperty(VictoryClipContainer, "propTypes", {
|
|
263
|
+
exports.VictoryClipContainer = VictoryClipContainer;
|
|
264
|
+
VictoryClipContainer.displayName = "VictoryClipContainer";
|
|
265
|
+
VictoryClipContainer.role = "container";
|
|
266
|
+
VictoryClipContainer.propTypes = {
|
|
267
267
|
"aria-label": _propTypes.default.string,
|
|
268
268
|
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
|
|
269
269
|
circleComponent: _propTypes.default.element,
|
|
@@ -291,11 +291,11 @@ _defineProperty(VictoryClipContainer, "propTypes", {
|
|
|
291
291
|
transform: _propTypes.default.string,
|
|
292
292
|
translateX: _propTypes.default.number,
|
|
293
293
|
translateY: _propTypes.default.number
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
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),
|
|
300
299
|
groupComponent: /*#__PURE__*/_react.default.createElement("g", null)
|
|
301
|
-
}
|
|
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
|
|
|
@@ -35,6 +35,8 @@ var Style = _interopRequireWildcard(require("../victory-util/style"));
|
|
|
35
35
|
|
|
36
36
|
var TextSize = _interopRequireWildcard(require("../victory-util/textsize"));
|
|
37
37
|
|
|
38
|
+
var UserProps = _interopRequireWildcard(require("../victory-util/user-props"));
|
|
39
|
+
|
|
38
40
|
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); }
|
|
39
41
|
|
|
40
42
|
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; }
|
|
@@ -495,6 +497,7 @@ var renderLabel = function (calculatedProps, tspanValues) {
|
|
|
495
497
|
tabIndex = calculatedProps.tabIndex,
|
|
496
498
|
tspanComponent = calculatedProps.tspanComponent,
|
|
497
499
|
textComponent = calculatedProps.textComponent;
|
|
500
|
+
var userProps = UserProps.getSafeUserProps(calculatedProps);
|
|
498
501
|
|
|
499
502
|
var textProps = _objectSpread(_objectSpread({
|
|
500
503
|
"aria-label": ariaLabel,
|
|
@@ -510,7 +513,7 @@ var renderLabel = function (calculatedProps, tspanValues) {
|
|
|
510
513
|
desc: Helpers.evaluateProp(desc, calculatedProps),
|
|
511
514
|
tabIndex: Helpers.evaluateProp(tabIndex, calculatedProps),
|
|
512
515
|
id: id
|
|
513
|
-
});
|
|
516
|
+
}, userProps);
|
|
514
517
|
|
|
515
518
|
var tspans = text.map(function (line, i) {
|
|
516
519
|
var currentStyle = tspanValues[i].style;
|
|
@@ -550,6 +553,7 @@ var VictoryLabel = function (props) {
|
|
|
550
553
|
fontSize: currentStyle.fontSize || defaultStyles.fontSize,
|
|
551
554
|
capHeight: capHeightPx,
|
|
552
555
|
text: line,
|
|
556
|
+
// @ts-expect-error TODO: This looks like a bug:
|
|
553
557
|
textSize: TextSize.approximateTextSize(line, currentStyle),
|
|
554
558
|
lineHeight: currentLineHeight,
|
|
555
559
|
backgroundPadding: getSingleValue(backgroundPadding, i)
|
|
@@ -563,12 +567,13 @@ var VictoryLabel = function (props) {
|
|
|
563
567
|
|
|
564
568
|
var backgroundWithLabel = /*#__PURE__*/_react.default.cloneElement(props.groupComponent, {}, children);
|
|
565
569
|
|
|
566
|
-
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.
|
|
570
|
+
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
|
|
567
571
|
}
|
|
568
572
|
|
|
569
|
-
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.
|
|
573
|
+
return props.renderInPortal ? /*#__PURE__*/_react.default.createElement(_victoryPortal.VictoryPortal, null, label) : label;
|
|
570
574
|
};
|
|
571
575
|
|
|
576
|
+
exports.VictoryLabel = VictoryLabel;
|
|
572
577
|
VictoryLabel.displayName = "VictoryLabel";
|
|
573
578
|
VictoryLabel.role = "label";
|
|
574
579
|
VictoryLabel.defaultStyles = defaultStyles;
|
|
@@ -583,6 +588,7 @@ VictoryLabel.propTypes = {
|
|
|
583
588
|
className: _propTypes.default.string,
|
|
584
589
|
data: _propTypes.default.array,
|
|
585
590
|
datum: _propTypes.default.any,
|
|
591
|
+
// @ts-expect-error "Function is not assignable to string"
|
|
586
592
|
desc: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]),
|
|
587
593
|
direction: _propTypes.default.oneOf(["rtl", "ltr", "inherit"]),
|
|
588
594
|
dx: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.func]),
|
|
@@ -595,8 +601,8 @@ VictoryLabel.propTypes = {
|
|
|
595
601
|
labelPlacement: _propTypes.default.oneOf(["parallel", "perpendicular", "vertical"]),
|
|
596
602
|
lineHeight: _propTypes.default.oneOfType([_propTypes.default.string, CustomPropTypes.nonNegative, _propTypes.default.func, _propTypes.default.array]),
|
|
597
603
|
origin: _propTypes.default.shape({
|
|
598
|
-
x: CustomPropTypes.nonNegative,
|
|
599
|
-
y: CustomPropTypes.nonNegative
|
|
604
|
+
x: CustomPropTypes.nonNegative.isRequired,
|
|
605
|
+
y: CustomPropTypes.nonNegative.isRequired
|
|
600
606
|
}),
|
|
601
607
|
polar: _propTypes.default.bool,
|
|
602
608
|
renderInPortal: _propTypes.default.bool,
|
|
@@ -607,24 +613,27 @@ VictoryLabel.propTypes = {
|
|
|
607
613
|
style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]),
|
|
608
614
|
tabIndex: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
609
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"
|
|
610
617
|
textAnchor: _propTypes.default.oneOfType([_propTypes.default.oneOf(["start", "middle", "end", "inherit"]), _propTypes.default.func]),
|
|
611
618
|
textComponent: _propTypes.default.element,
|
|
612
619
|
title: _propTypes.default.string,
|
|
613
620
|
transform: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.func]),
|
|
614
621
|
tspanComponent: _propTypes.default.element,
|
|
622
|
+
// @ts-expect-error Function is not assignable to string"
|
|
615
623
|
verticalAnchor: _propTypes.default.oneOfType([_propTypes.default.oneOf(["start", "middle", "end"]), _propTypes.default.func]),
|
|
624
|
+
// @ts-expect-error Number is not assignable to string
|
|
616
625
|
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
626
|
+
// @ts-expect-error Number is not assignable to string
|
|
617
627
|
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
618
628
|
};
|
|
619
629
|
VictoryLabel.defaultProps = {
|
|
620
|
-
backgroundComponent: /*#__PURE__*/_react.default.createElement(_rect.
|
|
630
|
+
backgroundComponent: /*#__PURE__*/_react.default.createElement(_rect.Rect, null),
|
|
621
631
|
groupComponent: /*#__PURE__*/_react.default.createElement("g", null),
|
|
622
632
|
direction: "inherit",
|
|
623
|
-
textComponent: /*#__PURE__*/_react.default.createElement(_text.
|
|
624
|
-
tspanComponent: /*#__PURE__*/_react.default.createElement(_tspan.
|
|
633
|
+
textComponent: /*#__PURE__*/_react.default.createElement(_text.Text, null),
|
|
634
|
+
tspanComponent: /*#__PURE__*/_react.default.createElement(_tspan.TSpan, null),
|
|
625
635
|
capHeight: 0.71,
|
|
626
636
|
// Magic number from d3.
|
|
627
637
|
lineHeight: 1
|
|
628
638
|
};
|
|
629
|
-
|
|
630
|
-
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
|