feat(additional-components): add Panel component
This commit is contained in:
@@ -6,3 +6,4 @@
|
|||||||
export * from './background'
|
export * from './background'
|
||||||
export * from './controls'
|
export * from './controls'
|
||||||
export * from './minimap'
|
export * from './minimap'
|
||||||
|
export * from './panel'
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
import type { PanelProps } from './types'
|
||||||
|
|
||||||
|
const props = defineProps<PanelProps>()
|
||||||
|
|
||||||
|
const pointerEvents = useVueFlow()
|
||||||
|
const positionClasses = computed(() => `${props.position}`.split('-'))
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="vue-flow__panel" :class="positionClasses" :style="{ pointerEvents }">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export { default as Panel } from './Panel.vue'
|
||||||
|
export * from './types'
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
export enum PanelPosition {
|
||||||
|
TopLeft = 'top-left',
|
||||||
|
TopCenter = 'top-center',
|
||||||
|
TopRight = 'top-right',
|
||||||
|
BottomLeft = 'bottom-left',
|
||||||
|
BottomCenter = 'bottom-center',
|
||||||
|
BottomRight = 'bottom-right',
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PanelProps {
|
||||||
|
position: PanelPosition
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user