OrganizationChart PT demo added

pull/3946/head
Tuğçe Küçükoğlu 2023-05-10 11:08:33 +03:00
parent 6dddb5ca86
commit ba4123d2ab
4 changed files with 228 additions and 2 deletions

View File

@ -0,0 +1,175 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card overflow-x-auto">
<OrganizationChart
:value="data"
collapsible
:pt="{
node: ({ context }) => ({
class: context.toggleable ? 'border-orange-400 border-round-sm' : 'border-teal-400 border-round-sm'
})
}"
>
<template #default="slotProps">
<span>{{ slotProps.node.label }}</span>
</template>
</OrganizationChart>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
data: {
label: 'Argentina',
children: [
{
label: 'Argentina',
children: [
{
label: 'Argentina'
},
{
label: 'Croatia'
}
]
},
{
label: 'France',
children: [
{
label: 'France'
},
{
label: 'Morocco'
}
]
}
]
},
code: {
basic: `
<OrganizationChart
:value="data"
collapsible
:pt="{
node: ({ context }) => ({
class: context.toggleable ? 'border-orange-400 border-round-sm' : 'border-teal-400 border-round-sm'
})
}"
>
<template #default="slotProps">
<span>{{ slotProps.node.label }}</span>
</template>
</OrganizationChart>`,
options: `
<template>
<div class="card overflow-x-auto">
<OrganizationChart
:value="data"
collapsible
:pt="{
node: ({ context }) => ({
class: context.toggleable ? 'border-orange-400 border-round-sm' : 'border-teal-400 border-round-sm'
})
}"
>
<template #default="slotProps">
<span>{{ slotProps.node.label }}</span>
</template>
</OrganizationChart>
</div>
</template>
<script>
export default {
data() {
return {
data: {
label: 'Argentina',
children: [
{
label: 'Argentina',
children: [
{
label: 'Argentina'
},
{
label: 'Croatia'
}
]
},
{
label: 'France',
children: [
{
label: 'France'
},
{
label: 'Morocco'
}
]
}
]
}
};
}
};
<\/script>`,
composition: `
<template>
<div class="card overflow-x-auto">
<OrganizationChart
:value="data"
collapsible
:pt="{
node: ({ context }) => ({
class: context.toggleable ? 'border-orange-400 border-round-sm' : 'border-teal-400 border-round-sm'
})
}"
>
<template #default="slotProps">
<span>{{ slotProps.node.label }}</span>
</template>
</OrganizationChart>
</div>
</template>
<script setup>
import { ref } from "vue";
const data = ref({
label: 'Argentina',
children: [
{
label: 'Argentina',
children: [
{
label: 'Argentina'
},
{
label: 'Croatia'
}
]
},
{
label: 'France',
children: [
{
label: 'France'
},
{
label: 'Morocco'
}
]
}
]
});
<\/script>`
}
};
}
};
</script>

View File

@ -0,0 +1,8 @@
<template>
<DocSectionText v-bind="$attrs">
<p>{{ $attrs.description }}</p>
</DocSectionText>
<div class="card">
<img class="w-full" src="https://primefaces.org/cdn/primevue/images/pt/wireframe-placeholder.jpg" />
</div>
</template>

View File

@ -0,0 +1,41 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>OrganizationChart Pass Through</h1>
</div>
<DocSections :docs="docs" />
</div>
<DocSectionNav :docs="docs" />
</template>
<script>
import DocApiTable from '@/components/doc/DocApiTable.vue';
import { getPTOption } from '@/components/doc/helpers/PTHelper.js';
import PtDoc from './PTDoc.vue';
import PTImage from './PTImage.vue';
export default {
data() {
return {
docs: [
{
id: 'pt.image',
label: 'Wireframe',
component: PTImage
},
{
id: 'pt.doc.organizationchart',
label: 'OrganizationChart PT Options',
component: DocApiTable,
data: getPTOption('OrganizationChart')
},
{
id: 'pt.demo',
label: 'Demo',
component: PtDoc
}
]
};
}
};
</script>

View File

@ -1,5 +1,5 @@
<template>
<DocComponent title="Vue Organization Chart Component" header="OrganizationChart" description="OrganizationChart visualizes hierarchical organization data." :componentDocs="docs" :apiDocs="['OrganizationChart']" />
<DocComponent title="Vue Organization Chart Component" header="OrganizationChart" description="OrganizationChart visualizes hierarchical organization data." :componentDocs="docs" :apiDocs="['OrganizationChart']" :ptTabComponent="ptComponent" />
</template>
<script>
@ -10,6 +10,7 @@ import ImportDoc from '@/doc/organizationchart/ImportDoc';
import SelectionDoc from '@/doc/organizationchart/SelectionDoc';
import StyleDoc from '@/doc/organizationchart/StyleDoc';
import TemplateDoc from '@/doc/organizationchart/TemplateDoc';
import PTComponent from '@/doc/organizationchart/pt/index.vue';
export default {
data() {
@ -50,7 +51,8 @@ export default {
label: 'Accessibility',
component: AccessibilityDoc
}
]
],
ptComponent: PTComponent
};
}
};