Skip to content

Commit

Permalink
Checkbox pt demo added
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed May 5, 2023
1 parent dc3bd44 commit 7db93eb
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 3 deletions.
81 changes: 81 additions & 0 deletions doc/checkbox/pt/PTDoc.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card flex justify-content-center">
<Checkbox
v-model="checked"
binary
:pt="{
input: ({ props, state }) => ({
class: state.focused ? 'border-orange-400' : undefined
})
}"
/>
</div>
<DocSectionCode :code="code" />
</template>

<script>
export default {
data() {
return {
checked: false,
code: {
basic: `
<Checkbox
v-model="checked"
binary
:pt="{
input: ({ props, state }) => ({
class: state.focused ? 'border-orange-400' : undefined
})
}"
/>`,
options: `
<template>
<div class="card flex justify-content-center">
<Checkbox
v-model="checked"
binary
:pt="{
input: ({ props, state }) => ({
class: state.focused ? 'border-orange-400' : undefined
})
}"
/>
</div>
</template>
<script>
export default {
data() {
return {
checked: false
};
}
};
<\/script>`,
composition: `
<template>
<div class="card flex justify-content-center">
<Checkbox
v-model="checked"
binary
:pt="{
input: ({ props, state }) => ({
class: state.focused ? 'border-orange-400' : undefined
})
}"
/>
</div>
</template>
<script setup>
import { ref } from "vue";
const checked = ref(false);
<\/script>`
}
};
}
};
</script>
8 changes: 8 additions & 0 deletions doc/checkbox/pt/PTImage.vue
Original file line number Diff line number Diff line change
@@ -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>
41 changes: 41 additions & 0 deletions doc/checkbox/pt/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>Checkbox 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.checkbox',
label: 'Checkbox PT Options',
component: DocApiTable,
data: getPTOption('Checkbox')
},
{
id: 'pt.demo',
label: 'Demo',
component: PtDoc
}
]
};
}
};
</script>
8 changes: 5 additions & 3 deletions pages/checkbox/index.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<template>
<DocComponent title="Vue Checkbox Component" header="Checkbox" description="Checkbox is an extension to standard checkbox element with theming." :componentDocs="docs" :apiDocs="['Checkbox']" />
<DocComponent title="Vue Checkbox Component" header="Checkbox" description="Checkbox is an extension to standard checkbox element with theming." :componentDocs="docs" :apiDocs="['Checkbox']" :ptTabComponent="ptComponent" />
</template>

<script>
import AccessibilityDoc from '@/doc/checkbox/AccessibilityDoc';
import BasicDoc from '@/doc/checkbox/BasicDoc';
import DisabledDoc from '@/doc/checkbox/DisabledDoc';
import DynamicDoc from '@/doc/checkbox/DynamicDoc';
import VeeValidateDoc from '@/doc/checkbox/form/VeeValidateDoc';
import GroupDoc from '@/doc/checkbox/GroupDoc';
import ImportDoc from '@/doc/checkbox/ImportDoc';
import InvalidDoc from '@/doc/checkbox/InvalidDoc';
import StyleDoc from '@/doc/checkbox/StyleDoc';
import VeeValidateDoc from '@/doc/checkbox/form/VeeValidateDoc';
import PTComponent from '@/doc/checkbox/pt/index.vue';
export default {
data() {
Expand Down Expand Up @@ -69,7 +70,8 @@ export default {
label: 'Accessibility',
component: AccessibilityDoc
}
]
],
ptComponent: PTComponent
};
}
};
Expand Down

0 comments on commit 7db93eb

Please sign in to comment.