victory-tooltip
Advanced tools
Comparing version 37.3.2 to 37.3.3
# victory-tooltip | ||
## 37.3.3 | ||
### Patch Changes | ||
- Remove deprecated babel-plugin-lodash plugin ([#2965](https://github.com/FormidableLabs/victory/pull/2965)) | ||
* Improve types in victory-core helpers ([#2999](https://github.com/FormidableLabs/victory/pull/2999)) | ||
## 37.3.2 | ||
@@ -4,0 +12,0 @@ |
@@ -1,3 +0,3 @@ | ||
import _defaults from "lodash/defaults"; | ||
import React from "react"; | ||
import defaults from "lodash/defaults"; | ||
import { Helpers, Path, UserProps } from "victory-core"; | ||
@@ -96,3 +96,3 @@ const getVerticalPath = props => { | ||
export const Flyout = initialProps => { | ||
const props = evaluateProps(_defaults({}, initialProps, defaultProps)); | ||
const props = evaluateProps(defaults({}, initialProps, defaultProps)); | ||
const userProps = UserProps.getSafeUserProps(props); | ||
@@ -99,0 +99,0 @@ |
@@ -38,3 +38,3 @@ import React from "react"; | ||
} | ||
declare type InternalEvaluatedProps = VictoryTooltipProps & { | ||
type InternalEvaluatedProps = VictoryTooltipProps & { | ||
centerOffset: { | ||
@@ -61,3 +61,3 @@ x: number; | ||
}; | ||
declare type EventHandlers = Record<string, (props?: any) => { | ||
type EventHandlers = Record<string, (props?: any) => { | ||
target: string; | ||
@@ -64,0 +64,0 @@ mutation: () => { |
@@ -1,7 +0,7 @@ | ||
import _orderBy from "lodash/orderBy"; | ||
import _isPlainObject from "lodash/isPlainObject"; | ||
import _uniqueId from "lodash/uniqueId"; | ||
import _defaults from "lodash/defaults"; | ||
import React from "react"; | ||
import { TextSize, Helpers, LabelHelpers, VictoryLabel, VictoryTheme, VictoryPortal } from "victory-core"; | ||
import defaults from "lodash/defaults"; | ||
import uniqueId from "lodash/uniqueId"; | ||
import isPlainObject from "lodash/isPlainObject"; | ||
import orderBy from "lodash/orderBy"; | ||
import { Flyout } from "./flyout"; | ||
@@ -70,3 +70,3 @@ const fallbackProps = { | ||
super(props); | ||
this.id = props.id === undefined ? _uniqueId("tooltip-") : props.id; | ||
this.id = props.id === undefined ? uniqueId("tooltip-") : props.id; | ||
} | ||
@@ -112,5 +112,5 @@ getDefaultOrientation(props) { | ||
const defaultLabelStyles = theme && theme.tooltip && theme.tooltip.style ? theme.tooltip.style : {}; | ||
const baseLabelStyle = Array.isArray(props.style) ? props.style.map(s => _defaults({}, s, defaultLabelStyles)) : _defaults({}, props.style, defaultLabelStyles); | ||
const baseLabelStyle = Array.isArray(props.style) ? props.style.map(s => defaults({}, s, defaultLabelStyles)) : defaults({}, props.style, defaultLabelStyles); | ||
const defaultFlyoutStyles = theme && theme.tooltip && theme.tooltip.flyoutStyle ? theme.tooltip.flyoutStyle : {}; | ||
const baseFlyoutStyle = props.flyoutStyle ? _defaults({}, props.flyoutStyle, defaultFlyoutStyles) : defaultFlyoutStyles; | ||
const baseFlyoutStyle = props.flyoutStyle ? defaults({}, props.flyoutStyle, defaultFlyoutStyles) : defaultFlyoutStyles; | ||
const style = Array.isArray(baseLabelStyle) ? baseLabelStyle.map(s => Helpers.evaluateStyle(s, props)) : Helpers.evaluateStyle(baseLabelStyle, props); | ||
@@ -162,5 +162,3 @@ const flyoutStyle = Helpers.evaluateStyle(baseFlyoutStyle, Object.assign({}, props, { | ||
})) || this.getLabelPadding(style); | ||
const flyoutPadding = Helpers.getPadding({ | ||
padding | ||
}); | ||
const flyoutPadding = Helpers.getPadding(padding); | ||
const pointerWidth = Helpers.evaluateProp(props.pointerWidth, Object.assign({}, props, { | ||
@@ -206,4 +204,4 @@ active, | ||
}); | ||
const offsetX = _isPlainObject(centerOffset) && centerOffset?.x !== undefined ? Helpers.evaluateProp(centerOffset.x, evaluatedProps) : 0; | ||
const offsetY = _isPlainObject(centerOffset) && centerOffset?.y !== undefined ? Helpers.evaluateProp(centerOffset.y, evaluatedProps) : 0; | ||
const offsetX = isPlainObject(centerOffset) && centerOffset?.x !== undefined ? Helpers.evaluateProp(centerOffset.x, evaluatedProps) : 0; | ||
const offsetY = isPlainObject(centerOffset) && centerOffset?.y !== undefined ? Helpers.evaluateProp(centerOffset.y, evaluatedProps) : 0; | ||
return { | ||
@@ -325,4 +323,4 @@ ...evaluatedProps, | ||
const center = { | ||
x: _isPlainObject(props.center) && props.center.x !== undefined ? props.center.x : flyoutCenter.x, | ||
y: _isPlainObject(props.center) && props.center.y !== undefined ? props.center.y : flyoutCenter.y | ||
x: isPlainObject(props.center) && props.center.x !== undefined ? props.center.x : flyoutCenter.x, | ||
y: isPlainObject(props.center) && props.center.y !== undefined ? props.center.y : flyoutCenter.y | ||
}; | ||
@@ -391,3 +389,3 @@ const centerWithOffset = { | ||
}; | ||
return _defaults({}, labelComponent.props, { | ||
return defaults({}, labelComponent.props, { | ||
key: `${this.id}-label-${index}`, | ||
@@ -427,3 +425,3 @@ text, | ||
}]; | ||
return _orderBy(gaps, "val", "desc")[0].side; | ||
return orderBy(gaps, "val", "desc")[0].side; | ||
} | ||
@@ -451,3 +449,3 @@ getFlyoutProps(props, calculatedValues) { | ||
const pointerOrientation = Helpers.evaluateProp(props.pointerOrientation, props); | ||
return _defaults({}, flyoutComponent.props, { | ||
return defaults({}, flyoutComponent.props, { | ||
x, | ||
@@ -454,0 +452,0 @@ y, |
@@ -7,4 +7,4 @@ "use strict"; | ||
exports.Flyout = void 0; | ||
var _defaults2 = _interopRequireDefault(require("lodash/defaults")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _defaults = _interopRequireDefault(require("lodash/defaults")); | ||
var _victoryCore = require("victory-core"); | ||
@@ -104,3 +104,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const Flyout = initialProps => { | ||
const props = evaluateProps((0, _defaults2.default)({}, initialProps, defaultProps)); | ||
const props = evaluateProps((0, _defaults.default)({}, initialProps, defaultProps)); | ||
const userProps = _victoryCore.UserProps.getSafeUserProps(props); | ||
@@ -107,0 +107,0 @@ |
@@ -38,3 +38,3 @@ import React from "react"; | ||
} | ||
declare type InternalEvaluatedProps = VictoryTooltipProps & { | ||
type InternalEvaluatedProps = VictoryTooltipProps & { | ||
centerOffset: { | ||
@@ -61,3 +61,3 @@ x: number; | ||
}; | ||
declare type EventHandlers = Record<string, (props?: any) => { | ||
type EventHandlers = Record<string, (props?: any) => { | ||
target: string; | ||
@@ -64,0 +64,0 @@ mutation: () => { |
@@ -7,8 +7,8 @@ "use strict"; | ||
exports.VictoryTooltip = void 0; | ||
var _orderBy2 = _interopRequireDefault(require("lodash/orderBy")); | ||
var _isPlainObject2 = _interopRequireDefault(require("lodash/isPlainObject")); | ||
var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId")); | ||
var _defaults2 = _interopRequireDefault(require("lodash/defaults")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _victoryCore = require("victory-core"); | ||
var _defaults = _interopRequireDefault(require("lodash/defaults")); | ||
var _uniqueId = _interopRequireDefault(require("lodash/uniqueId")); | ||
var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject")); | ||
var _orderBy = _interopRequireDefault(require("lodash/orderBy")); | ||
var _flyout = require("./flyout"); | ||
@@ -78,3 +78,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
super(props); | ||
this.id = props.id === undefined ? (0, _uniqueId2.default)("tooltip-") : props.id; | ||
this.id = props.id === undefined ? (0, _uniqueId.default)("tooltip-") : props.id; | ||
} | ||
@@ -120,5 +120,5 @@ getDefaultOrientation(props) { | ||
const defaultLabelStyles = theme && theme.tooltip && theme.tooltip.style ? theme.tooltip.style : {}; | ||
const baseLabelStyle = Array.isArray(props.style) ? props.style.map(s => (0, _defaults2.default)({}, s, defaultLabelStyles)) : (0, _defaults2.default)({}, props.style, defaultLabelStyles); | ||
const baseLabelStyle = Array.isArray(props.style) ? props.style.map(s => (0, _defaults.default)({}, s, defaultLabelStyles)) : (0, _defaults.default)({}, props.style, defaultLabelStyles); | ||
const defaultFlyoutStyles = theme && theme.tooltip && theme.tooltip.flyoutStyle ? theme.tooltip.flyoutStyle : {}; | ||
const baseFlyoutStyle = props.flyoutStyle ? (0, _defaults2.default)({}, props.flyoutStyle, defaultFlyoutStyles) : defaultFlyoutStyles; | ||
const baseFlyoutStyle = props.flyoutStyle ? (0, _defaults.default)({}, props.flyoutStyle, defaultFlyoutStyles) : defaultFlyoutStyles; | ||
const style = Array.isArray(baseLabelStyle) ? baseLabelStyle.map(s => _victoryCore.Helpers.evaluateStyle(s, props)) : _victoryCore.Helpers.evaluateStyle(baseLabelStyle, props); | ||
@@ -170,5 +170,3 @@ const flyoutStyle = _victoryCore.Helpers.evaluateStyle(baseFlyoutStyle, Object.assign({}, props, { | ||
})) || this.getLabelPadding(style); | ||
const flyoutPadding = _victoryCore.Helpers.getPadding({ | ||
padding | ||
}); | ||
const flyoutPadding = _victoryCore.Helpers.getPadding(padding); | ||
const pointerWidth = _victoryCore.Helpers.evaluateProp(props.pointerWidth, Object.assign({}, props, { | ||
@@ -214,4 +212,4 @@ active, | ||
}); | ||
const offsetX = (0, _isPlainObject2.default)(centerOffset) && centerOffset?.x !== undefined ? _victoryCore.Helpers.evaluateProp(centerOffset.x, evaluatedProps) : 0; | ||
const offsetY = (0, _isPlainObject2.default)(centerOffset) && centerOffset?.y !== undefined ? _victoryCore.Helpers.evaluateProp(centerOffset.y, evaluatedProps) : 0; | ||
const offsetX = (0, _isPlainObject.default)(centerOffset) && centerOffset?.x !== undefined ? _victoryCore.Helpers.evaluateProp(centerOffset.x, evaluatedProps) : 0; | ||
const offsetY = (0, _isPlainObject.default)(centerOffset) && centerOffset?.y !== undefined ? _victoryCore.Helpers.evaluateProp(centerOffset.y, evaluatedProps) : 0; | ||
return { | ||
@@ -333,4 +331,4 @@ ...evaluatedProps, | ||
const center = { | ||
x: (0, _isPlainObject2.default)(props.center) && props.center.x !== undefined ? props.center.x : flyoutCenter.x, | ||
y: (0, _isPlainObject2.default)(props.center) && props.center.y !== undefined ? props.center.y : flyoutCenter.y | ||
x: (0, _isPlainObject.default)(props.center) && props.center.x !== undefined ? props.center.x : flyoutCenter.x, | ||
y: (0, _isPlainObject.default)(props.center) && props.center.y !== undefined ? props.center.y : flyoutCenter.y | ||
}; | ||
@@ -399,3 +397,3 @@ const centerWithOffset = { | ||
}; | ||
return (0, _defaults2.default)({}, labelComponent.props, { | ||
return (0, _defaults.default)({}, labelComponent.props, { | ||
key: `${this.id}-label-${index}`, | ||
@@ -435,3 +433,3 @@ text, | ||
}]; | ||
return (0, _orderBy2.default)(gaps, "val", "desc")[0].side; | ||
return (0, _orderBy.default)(gaps, "val", "desc")[0].side; | ||
} | ||
@@ -459,3 +457,3 @@ getFlyoutProps(props, calculatedValues) { | ||
const pointerOrientation = _victoryCore.Helpers.evaluateProp(props.pointerOrientation, props); | ||
return (0, _defaults2.default)({}, flyoutComponent.props, { | ||
return (0, _defaults.default)({}, flyoutComponent.props, { | ||
x, | ||
@@ -462,0 +460,0 @@ y, |
{ | ||
"name": "victory-tooltip", | ||
"version": "37.3.2", | ||
"version": "37.3.3", | ||
"description": "Tooltip Component for Victory", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
"lodash": "^4.17.19", | ||
"victory-core": "37.3.2" | ||
"victory-core": "37.3.3" | ||
}, | ||
@@ -184,28 +184,2 @@ "peerDependencies": { | ||
}, | ||
"format": { | ||
"command": "nps format:pkg", | ||
"files": [ | ||
"src/**", | ||
"*.json", | ||
"../../.prettierignore", | ||
"../../.prettierrc.json" | ||
], | ||
"output": [], | ||
"packageLocks": [ | ||
"pnpm-lock.yaml" | ||
] | ||
}, | ||
"format:fix": { | ||
"command": "pnpm run format || nps format:pkg:fix", | ||
"files": [ | ||
"src/**", | ||
"*.json", | ||
"../../.prettierignore", | ||
"../../.prettierrc.json" | ||
], | ||
"output": [], | ||
"packageLocks": [ | ||
"pnpm-lock.yaml" | ||
] | ||
}, | ||
"lint": { | ||
@@ -273,4 +247,2 @@ "command": "eslint src", | ||
"types:create": "wireit", | ||
"format": "wireit", | ||
"format:fix": "wireit", | ||
"lint": "wireit", | ||
@@ -277,0 +249,0 @@ "lint:fix": "wireit", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
455102
9589
259822
+ Addedvictory-core@37.3.3(transitive)
+ Addedvictory-vendor@37.3.3(transitive)
- Removedvictory-core@37.3.2(transitive)
- Removedvictory-vendor@37.3.2(transitive)
Updatedvictory-core@37.3.3