victory-core 37.0.3-next.0 → 37.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -4
- package/dist/victory-core.js +25 -28
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +18 -18
- package/es/types/callbacks.d.ts +36 -36
- package/es/types/prop-types.d.ts +130 -130
- package/es/victory-accessible-group/victory-accessible-group.d.ts +10 -10
- package/es/victory-animation/util.d.ts +66 -66
- package/es/victory-animation/victory-animation.d.ts +34 -34
- package/es/victory-clip-container/victory-clip-container.d.ts +46 -46
- package/es/victory-container/victory-container.d.ts +62 -62
- package/es/victory-container/victory-container.js +2 -2
- package/es/victory-label/victory-label.d.ts +58 -58
- package/es/victory-portal/portal-context.d.ts +12 -12
- package/es/victory-portal/portal-context.js +0 -3
- package/es/victory-portal/portal-outlet.d.ts +11 -11
- package/es/victory-portal/portal-outlet.js +4 -6
- package/es/victory-portal/portal.d.ts +9 -9
- package/es/victory-portal/victory-portal.d.ts +9 -9
- package/es/victory-portal/victory-portal.js +16 -14
- package/es/victory-primitives/arc.d.ts +14 -14
- package/es/victory-primitives/background.d.ts +13 -13
- package/es/victory-primitives/border.d.ts +10 -10
- package/es/victory-primitives/circle.d.ts +3 -3
- package/es/victory-primitives/clip-path.d.ts +7 -7
- package/es/victory-primitives/index.d.ts +14 -14
- package/es/victory-primitives/line-segment.d.ts +11 -11
- package/es/victory-primitives/line.d.ts +3 -3
- package/es/victory-primitives/path.d.ts +3 -3
- package/es/victory-primitives/point.d.ts +13 -13
- package/es/victory-primitives/rect.d.ts +3 -3
- package/es/victory-primitives/text.d.ts +8 -8
- package/es/victory-primitives/tspan.d.ts +3 -3
- package/es/victory-primitives/types.d.ts +7 -7
- package/es/victory-primitives/whisker.d.ts +15 -15
- package/es/victory-theme/grayscale.d.ts +2 -2
- package/es/victory-theme/material.d.ts +2 -2
- package/es/victory-theme/types.d.ts +238 -238
- package/es/victory-theme/victory-theme.d.ts +5 -5
- package/es/victory-transition/victory-transition.d.ts +53 -53
- package/es/victory-util/add-events.d.ts +126 -126
- package/es/victory-util/axis.d.ts +50 -50
- package/es/victory-util/collection.d.ts +15 -15
- package/es/victory-util/common-props.d.ts +79 -79
- package/es/victory-util/data.d.ts +74 -74
- package/es/victory-util/default-transitions.d.ts +4 -4
- package/es/victory-util/domain.d.ts +90 -90
- package/es/victory-util/events.d.ts +64 -64
- package/es/victory-util/helpers.d.ts +96 -96
- package/es/victory-util/hooks/index.d.ts +2 -2
- package/es/victory-util/hooks/use-animation-state.d.ts +21 -21
- package/es/victory-util/hooks/use-previous-props.d.ts +1 -1
- package/es/victory-util/immutable.d.ts +11 -11
- package/es/victory-util/index.d.ts +27 -27
- package/es/victory-util/label-helpers.d.ts +26 -26
- package/es/victory-util/line-helpers.d.ts +4 -4
- package/es/victory-util/log.d.ts +1 -1
- package/es/victory-util/merge-refs.d.ts +12 -12
- package/es/victory-util/point-path-helpers.d.ts +9 -9
- package/es/victory-util/scale.d.ts +9 -9
- package/es/victory-util/selection.d.ts +28 -28
- package/es/victory-util/style.d.ts +18 -18
- package/es/victory-util/textsize.d.ts +35 -35
- package/es/victory-util/timer-context.d.ts +11 -11
- package/es/victory-util/timer.d.ts +16 -16
- package/es/victory-util/transitions.d.ts +48 -48
- package/es/victory-util/type-helpers.d.ts +9 -9
- package/es/victory-util/user-props.d.ts +26 -26
- package/es/victory-util/wrapper.d.ts +33 -33
- package/lib/index.d.ts +18 -18
- package/lib/types/callbacks.d.ts +36 -36
- package/lib/types/prop-types.d.ts +130 -130
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +10 -10
- package/lib/victory-animation/util.d.ts +66 -66
- package/lib/victory-animation/victory-animation.d.ts +34 -34
- package/lib/victory-clip-container/victory-clip-container.d.ts +46 -46
- package/lib/victory-container/victory-container.d.ts +62 -62
- package/lib/victory-container/victory-container.js +2 -2
- package/lib/victory-label/victory-label.d.ts +58 -58
- package/lib/victory-portal/portal-context.d.ts +12 -12
- package/lib/victory-portal/portal-context.js +0 -3
- package/lib/victory-portal/portal-outlet.d.ts +11 -11
- package/lib/victory-portal/portal-outlet.js +4 -6
- package/lib/victory-portal/portal.d.ts +9 -9
- package/lib/victory-portal/victory-portal.d.ts +9 -9
- package/lib/victory-portal/victory-portal.js +16 -14
- package/lib/victory-primitives/arc.d.ts +14 -14
- package/lib/victory-primitives/background.d.ts +13 -13
- package/lib/victory-primitives/border.d.ts +10 -10
- package/lib/victory-primitives/circle.d.ts +3 -3
- package/lib/victory-primitives/clip-path.d.ts +7 -7
- package/lib/victory-primitives/index.d.ts +14 -14
- package/lib/victory-primitives/line-segment.d.ts +11 -11
- package/lib/victory-primitives/line.d.ts +3 -3
- package/lib/victory-primitives/path.d.ts +3 -3
- package/lib/victory-primitives/point.d.ts +13 -13
- package/lib/victory-primitives/rect.d.ts +3 -3
- package/lib/victory-primitives/text.d.ts +8 -8
- package/lib/victory-primitives/tspan.d.ts +3 -3
- package/lib/victory-primitives/types.d.ts +7 -7
- package/lib/victory-primitives/whisker.d.ts +15 -15
- package/lib/victory-theme/grayscale.d.ts +2 -2
- package/lib/victory-theme/material.d.ts +2 -2
- package/lib/victory-theme/types.d.ts +238 -238
- package/lib/victory-theme/victory-theme.d.ts +5 -5
- package/lib/victory-transition/victory-transition.d.ts +53 -53
- package/lib/victory-util/add-events.d.ts +126 -126
- package/lib/victory-util/axis.d.ts +50 -50
- package/lib/victory-util/collection.d.ts +15 -15
- package/lib/victory-util/common-props.d.ts +79 -79
- package/lib/victory-util/data.d.ts +74 -74
- package/lib/victory-util/default-transitions.d.ts +4 -4
- package/lib/victory-util/domain.d.ts +90 -90
- package/lib/victory-util/events.d.ts +64 -64
- package/lib/victory-util/helpers.d.ts +96 -96
- package/lib/victory-util/hooks/index.d.ts +2 -2
- package/lib/victory-util/hooks/use-animation-state.d.ts +21 -21
- package/lib/victory-util/hooks/use-previous-props.d.ts +1 -1
- package/lib/victory-util/immutable.d.ts +11 -11
- package/lib/victory-util/index.d.ts +27 -27
- package/lib/victory-util/label-helpers.d.ts +26 -26
- package/lib/victory-util/line-helpers.d.ts +4 -4
- package/lib/victory-util/log.d.ts +1 -1
- package/lib/victory-util/merge-refs.d.ts +12 -12
- package/lib/victory-util/point-path-helpers.d.ts +9 -9
- package/lib/victory-util/scale.d.ts +9 -9
- package/lib/victory-util/selection.d.ts +28 -28
- package/lib/victory-util/style.d.ts +18 -18
- package/lib/victory-util/textsize.d.ts +35 -35
- package/lib/victory-util/timer-context.d.ts +11 -11
- package/lib/victory-util/timer.d.ts +16 -16
- package/lib/victory-util/transitions.d.ts +48 -48
- package/lib/victory-util/type-helpers.d.ts +9 -9
- package/lib/victory-util/user-props.d.ts +26 -26
- package/lib/victory-util/wrapper.d.ts +33 -33
- package/package.json +5 -2
- package/src/victory-container/victory-container.tsx +18 -18
- package/src/victory-portal/portal-context.tsx +0 -6
- package/src/victory-portal/portal-outlet.tsx +4 -3
- package/src/victory-portal/victory-portal.tsx +19 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# victory-core
|
|
2
2
|
|
|
3
|
-
## 37.
|
|
3
|
+
## 37.1.0
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Refactor containers and portal to function components ([#2799](https://github.com/FormidableLabs/victory/pull/2799))
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
- victory-vendor@37.0.3-next.0
|
|
9
|
+
* Pin all internal victory package versions ([#2876](https://github.com/FormidableLabs/victory/pull/2876))
|
|
9
10
|
|
|
10
11
|
## 37.0.2
|
|
11
12
|
|
package/dist/victory-core.js
CHANGED
|
@@ -635,9 +635,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
635
635
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
636
636
|
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "./victory-portal/portal.tsx");
|
|
637
637
|
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/user-props */ "./victory-util/user-props.ts");
|
|
638
|
-
/* harmony import */ var
|
|
638
|
+
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "./victory-util/merge-refs.ts");
|
|
639
639
|
/* harmony import */ var _victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-portal/portal-outlet */ "./victory-portal/portal-outlet.tsx");
|
|
640
|
-
/* harmony import */ var
|
|
640
|
+
/* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-portal/portal-context */ "./victory-portal/portal-context.tsx");
|
|
641
641
|
|
|
642
642
|
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); }
|
|
643
643
|
|
|
@@ -737,7 +737,7 @@ const VictoryContainer = initialProps => {
|
|
|
737
737
|
};
|
|
738
738
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
739
739
|
}, []);
|
|
740
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
740
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
|
|
741
741
|
className: className,
|
|
742
742
|
style: {
|
|
743
743
|
...style,
|
|
@@ -750,8 +750,8 @@ const VictoryContainer = initialProps => {
|
|
|
750
750
|
"data-ouia-component-id": ouiaId,
|
|
751
751
|
"data-ouia-component-type": ouiaType,
|
|
752
752
|
"data-ouia-safe": ouiaSafe,
|
|
753
|
-
ref: (0,
|
|
754
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
|
|
753
|
+
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
754
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__.PortalProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
|
|
755
755
|
width: width,
|
|
756
756
|
height: height,
|
|
757
757
|
tabIndex: tabIndex,
|
|
@@ -1312,9 +1312,6 @@ const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().
|
|
|
1312
1312
|
PortalContext.displayName = "PortalContext";
|
|
1313
1313
|
const usePortalContext = () => {
|
|
1314
1314
|
const context = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(PortalContext);
|
|
1315
|
-
if (!context) {
|
|
1316
|
-
throw new Error("`usePortalContext` must be used within a `<PortalProvider />`");
|
|
1317
|
-
}
|
|
1318
1315
|
return context;
|
|
1319
1316
|
};
|
|
1320
1317
|
const PortalProvider = _ref => {
|
|
@@ -1370,12 +1367,10 @@ const PortalOutlet = _ref => {
|
|
|
1370
1367
|
...props
|
|
1371
1368
|
} = _ref;
|
|
1372
1369
|
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_1__.usePortalContext)();
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
}) : node;
|
|
1378
|
-
});
|
|
1370
|
+
if (!portalContext) {
|
|
1371
|
+
return null;
|
|
1372
|
+
}
|
|
1373
|
+
const children = Array.from(portalContext.children.values());
|
|
1379
1374
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
|
|
1380
1375
|
};
|
|
1381
1376
|
|
|
@@ -1441,26 +1436,28 @@ const VictoryPortal = initialProps => {
|
|
|
1441
1436
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
1442
1437
|
_victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
|
|
1443
1438
|
}
|
|
1439
|
+
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
1440
|
+
const {
|
|
1441
|
+
groupComponent
|
|
1442
|
+
} = props;
|
|
1443
|
+
const childProps = children && children.props || {};
|
|
1444
|
+
const standardProps = childProps.groupComponent ? {
|
|
1445
|
+
groupComponent,
|
|
1446
|
+
standalone: false
|
|
1447
|
+
} : {};
|
|
1448
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
|
|
1449
|
+
key: childProps.key ?? id
|
|
1450
|
+
});
|
|
1451
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
|
|
1444
1452
|
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
1445
|
-
|
|
1446
|
-
const {
|
|
1447
|
-
groupComponent
|
|
1448
|
-
} = props;
|
|
1449
|
-
const childProps = children && children.props || {};
|
|
1450
|
-
const standardProps = childProps.groupComponent ? {
|
|
1451
|
-
groupComponent,
|
|
1452
|
-
standalone: false
|
|
1453
|
-
} : {};
|
|
1454
|
-
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]));
|
|
1455
|
-
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
|
|
1456
|
-
portalContext.addChild(id, child);
|
|
1453
|
+
portalContext?.addChild(id, child);
|
|
1457
1454
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1458
1455
|
}, [props.children]);
|
|
1459
1456
|
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
1460
|
-
return () => portalContext
|
|
1457
|
+
return () => portalContext?.removeChild(id);
|
|
1461
1458
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1462
1459
|
}, []);
|
|
1463
|
-
return null;
|
|
1460
|
+
return portalContext ? null : child;
|
|
1464
1461
|
};
|
|
1465
1462
|
VictoryPortal.role = "portal";
|
|
1466
1463
|
|