chore(minimap): cleanup minimap node emits
This commit is contained in:
@@ -50,15 +50,14 @@ const elementHeight = toRef(() => height ?? attrs.style?.height ?? defaultHeight
|
|||||||
|
|
||||||
const shapeRendering: ShapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision'
|
const shapeRendering: ShapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision'
|
||||||
|
|
||||||
const nodeColorFunc = toRef((): MiniMapNodeFunc => (typeof nodeColor === 'string' ? () => nodeColor : nodeColor))
|
const nodeColorFunc = computed<MiniMapNodeFunc>(() => (typeof nodeColor === 'string' ? () => nodeColor : nodeColor))
|
||||||
|
|
||||||
const nodeStrokeColorFunc = toRef(
|
const nodeStrokeColorFunc = computed<MiniMapNodeFunc>(() =>
|
||||||
(): MiniMapNodeFunc => (typeof nodeStrokeColor === 'string' ? () => nodeStrokeColor : nodeStrokeColor),
|
typeof nodeStrokeColor === 'string' ? () => nodeStrokeColor : nodeStrokeColor,
|
||||||
)
|
)
|
||||||
|
|
||||||
const nodeClassNameFunc = toRef(
|
const nodeClassNameFunc = computed<MiniMapNodeFunc>(() =>
|
||||||
(): MiniMapNodeFunc =>
|
typeof nodeClassName === 'string' ? () => nodeClassName : typeof nodeClassName === 'function' ? nodeClassName : () => '',
|
||||||
typeof nodeClassName === 'string' ? () => nodeClassName : typeof nodeClassName === 'function' ? nodeClassName : () => '',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const bb = computed(() => getRectOfNodes(nodes.value))
|
const bb = computed(() => getRectOfNodes(nodes.value))
|
||||||
|
|||||||
@@ -74,11 +74,11 @@ export interface MiniMapEmits {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface MiniMapNodeEmits {
|
export interface MiniMapNodeEmits {
|
||||||
(event: 'click', params: NodeMouseEvent): void
|
(event: 'click', params: MouseEvent): void
|
||||||
(event: 'dblclick', params: NodeMouseEvent): void
|
(event: 'dblclick', params: MouseEvent): void
|
||||||
(event: 'mouseenter', params: NodeMouseEvent): void
|
(event: 'mouseenter', params: MouseEvent): void
|
||||||
(event: 'mousemove', params: NodeMouseEvent): void
|
(event: 'mousemove', params: MouseEvent): void
|
||||||
(event: 'mouseleave', params: NodeMouseEvent): void
|
(event: 'mouseleave', params: MouseEvent): void
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MiniMapSlots extends Record<`node-${string}`, (nodeProps: MiniMapNodeProps) => any> {}
|
export interface MiniMapSlots extends Record<`node-${string}`, (nodeProps: MiniMapNodeProps) => any> {}
|
||||||
|
|||||||
Reference in New Issue
Block a user