Skip to content

Commit

Permalink
docs: add slot documentation for Controls
Browse files Browse the repository at this point in the history
  • Loading branch information
bcakmakoglu committed Jun 15, 2022
1 parent 32086e0 commit 3162b79
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
23 changes: 6 additions & 17 deletions docs/src/.vuepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,23 @@ function capitalize(str: string) {
}

const typedocSidebarEntries = (): SidebarConfigArray => {
const filePath = resolve(
__dirname,
'../../typedocs'
)
const filePath = resolve(__dirname, '../../typedocs')

const docsModules = readdirSync(filePath).filter(name => statSync(`${filePath}/${name}`).isDirectory())
const docsModules = readdirSync(filePath).filter((name) => statSync(`${filePath}/${name}`).isDirectory())

const sidebarItems = docsModules.map(module => {
const sidebarItems = docsModules.map((module) => {
let children = readdirSync(`${filePath}/${module}/`).map(entry => `/typedocs/${module}/${entry}`)

if (module === 'variables') {
children = children.filter(child => {
children = children.filter((child) => {
return child.includes('default')
})
}

return { text: capitalize(module), children }
})

return [
{
text: 'TypeDocs',
link: '/typedocs/',
children: [
...sidebarItems,
],
}
]
return [...sidebarItems]
}

export default {
Expand Down Expand Up @@ -100,7 +89,7 @@ export default {
'/typedocs/': typedocSidebarEntries(),
},
navbar: [
{ text: `v${vueFlowVersion.value}`, link: '' },
{ text: `v${vueFlowVersion.value}`, link: '/' },
{ text: 'Guide', link: '/guide/', activeMatch: '^/guide/' },
{
text: 'Examples',
Expand Down
25 changes: 25 additions & 0 deletions docs/src/guide/components/controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,28 @@ To use the controls simply pass the `Controls` component as a child to the `VueF
| zoom-out | Zoom-out btn clicked |
| fit-view | Fit-view btn clicked |
| interaction-change | Interaction locked/unlocked |

## Slots

### Control Buttons

| Name | Definition |
|---------------------|-------------------------|
| top | slot above default btns |
| control-zoom-in | Zoom-in btn |
| control-zoom-out | Zoom-out btn |
| control-fit-view | Fit-view btn |
| control-interaction | Interaction btn |
| default | slot below default btns |

### Icons

| Name | Definition |
|---------------|---------------------------|
| icon-zoom-in | Zoom-in icon |
| icon-zoom-out | Zoom-out icon |
| icon-fit-view | Fit-view icon |
| icon-lock | Interaction locked icon |
| icon-unlock | Interaction unlocked icon |


0 comments on commit 3162b79

Please sign in to comment.