refactor(core,additional-components): move panel component to core pkg

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2022-12-13 14:53:44 +01:00
committed by Braks
parent 3f4e6961c0
commit 4fb26533cd
8 changed files with 12 additions and 274 deletions
@@ -0,0 +1,14 @@
<script lang="ts" setup>
import type { PanelProps } from '../../types'
const props = defineProps<PanelProps>()
const { userSelectionActive } = useVueFlow()
const positionClasses = computed(() => `${props.position}`.split('-'))
</script>
<template>
<div class="vue-flow__panel" :class="positionClasses" :style="{ pointerEvents: userSelectionActive ? 'none' : 'all' }">
<slot />
</div>
</template>
+2
View File
@@ -7,6 +7,8 @@ export { default as VueFlow } from './container/VueFlow/VueFlow.vue'
export { default as Handle } from './components/Handle/Handle.vue'
export { default as Panel } from './components/Panel/Panel.vue'
export {
StraightEdge,
StepEdge,
+1
View File
@@ -8,3 +8,4 @@ export * from './store'
export * from './hooks'
export * from './changes'
export * from './handle'
export * from './panel'
+12
View File
@@ -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
}