Merge pull request #5115 from dimaMachina/tsdoc-edgetext
fix: improve TSDoc comments for `EdgeLabelOptions` and `EdgeTextProps`
This commit is contained in:
5
.changeset/tame-bulldogs-juggle.md
Normal file
5
.changeset/tame-bulldogs-juggle.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@xyflow/react': patch
|
||||
---
|
||||
|
||||
fix: improve TSDoc comments for `EdgeLabelOptions` and `EdgeTextProps`
|
||||
@@ -8,9 +8,9 @@ function EdgeTextComponent({
|
||||
x,
|
||||
y,
|
||||
label,
|
||||
labelStyle = {},
|
||||
labelStyle,
|
||||
labelShowBg = true,
|
||||
labelBgStyle = {},
|
||||
labelBgStyle,
|
||||
labelBgPadding = [2, 4],
|
||||
labelBgBorderRadius = 2,
|
||||
children,
|
||||
@@ -34,7 +34,7 @@ function EdgeTextComponent({
|
||||
}
|
||||
}, [label]);
|
||||
|
||||
if (typeof label === 'undefined' || !label) {
|
||||
if (!label) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@ export type EdgeLabelOptions = {
|
||||
* custom controls.
|
||||
*/
|
||||
label?: ReactNode;
|
||||
/**
|
||||
* Custom styles to apply to the label.
|
||||
*/
|
||||
labelStyle?: CSSProperties;
|
||||
labelShowBg?: boolean;
|
||||
labelBgStyle?: CSSProperties;
|
||||
@@ -108,7 +111,13 @@ export type DefaultEdgeOptions = DefaultEdgeOptionsBase<Edge>;
|
||||
|
||||
export type EdgeTextProps = SVGAttributes<SVGElement> &
|
||||
EdgeLabelOptions & {
|
||||
/**
|
||||
* The x position where the label should be rendered.
|
||||
*/
|
||||
x: number;
|
||||
/**
|
||||
* The y position where the label should be rendered.
|
||||
*/
|
||||
y: number;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user