Skip to content

Commit

Permalink
fix(minimap): pass missing minimap node props
Browse files Browse the repository at this point in the history
  • Loading branch information
bcakmakoglu committed Aug 21, 2023
1 parent c9a1c5b commit 5f83367
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/minimap/src/MiniMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ export default {
:key="node.id"
:position="node.computedPosition"
:dimensions="node.dimensions"
:selected="node.selected"
:dragging="node.dragging"
:style="node.style"
:class="nodeClassNameFunc(node)"
:color="nodeColorFunc(node)"
Expand Down
16 changes: 14 additions & 2 deletions packages/minimap/src/MiniMapNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ import { MiniMapSlots } from './types'
export default defineComponent({
name: 'MiniMapNode',
compatConfig: { MODE: 3 },
props: ['id', 'position', 'dimensions', 'strokeWidth', 'strokeColor', 'borderRadius', 'color', 'shapeRendering', 'type'],
props: [
'id',
'type',
'selected',
'dragging',
'position',
'dimensions',
'borderRadius',
'color',
'shapeRendering',
'strokeColor',
'strokeWidth',
],
emits: ['click', 'dblclick', 'mouseenter', 'mousemove', 'mouseleave'],
setup(props: MiniMapNodeProps, { attrs, emit }) {
const miniMapSlots: Slots = inject(MiniMapSlots)!
Expand All @@ -21,7 +33,7 @@ export default defineComponent({

return h('rect', {
id: props.id,
class: ['vue-flow__minimap-node', attrs.class].join(' '),
class: ['vue-flow__minimap-node', attrs.class, { selected: props.selected, dragging: props.dragging }].join(' '),
style,
x: props.position.x,
y: props.position.y,
Expand Down
1 change: 0 additions & 1 deletion packages/minimap/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export interface MiniMapProps {
export interface MiniMapNodeProps {
id: string
type: string
parentNode?: string
selected?: boolean
dragging?: boolean
position: XYPosition
Expand Down

0 comments on commit 5f83367

Please sign in to comment.