Skip to content

Commit ed228ff

Browse files
committed
docs(vitepress): update files and add new content
close #48
1 parent 0f22987 commit ed228ff

File tree

14 files changed

+320
-52
lines changed

14 files changed

+320
-52
lines changed

dev/components/demo/PrimeInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function submitHandler() {
3939
<slot />
4040
<div class="flex flex-wrap gap-8">
4141
<div class="min-w-30rem basis-1/3 xl:basis-1/4">
42-
<FormKitDataEdit :form-class="formClass" :schema="formSchema" :data="formData" :debug-schema="false" :debug-data="true" form-class="data-edit" @data-saved="submitHandler" />
42+
<FormKitDataEdit :form-class="formClass" :schema="formSchema" :data="formData" :debug-schema="false" :debug-data="true" @data-saved="submitHandler" />
4343
</div>
4444
<div class="">
4545
<Tabs>

docs/.vitepress/config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,15 @@ function sidebarGuide() {
8888
collapsible: true,
8989
items: [
9090
{ text: 'Usage', link: '/guide/usage' },
91-
{ text: 'PrimeVue Inputs', link: '/guide/inputs' },
91+
{ text: 'Input Components', link: '/guide/inputs' },
92+
{ text: 'Output Components', link: '/guide/outputs' },
93+
{ text: 'Data Components', link: '/guide/data' },
9294
{ text: 'Options', link: '/guide/options' },
9395
{ text: 'Composables', link: '/guide/composables' },
9496
{ text: 'Styling', link: '/guide/styling' },
97+
{ text: 'Prefix/Suffix', link: '/guide/prefix' },
9598
{ text: 'Sample Apps', link: '/guide/examples' },
99+
{ text: 'History', link: '/guide/history' },
96100
],
97101
},
98102
]

docs/.vitepress/theme/components/DisplayComponents.vue

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
<script setup lang='ts'>
2-
import { ref } from 'vue'
2+
import { defineProps, ref } from 'vue'
33
4-
const inputs = ['AutoComplete', 'CascadeSelect', 'Checkbox', 'ColorPicker', 'DatePicker', 'Editor', 'InputMask', 'InputNumber', 'InputOtp', 'InputText', 'Knob', 'Listbox', 'MultiSelect', 'Password', 'RadioButton', 'Rating', 'Select', 'SelectButton', 'Slider', 'Textarea', 'ToggleButton', 'ToggleSwitch', 'TreeSelect']
5-
const names = ref(inputs.sort((a, b) => a.localeCompare(b)))
4+
const props = defineProps({
5+
full: {
6+
type: Boolean,
7+
default: false,
8+
},
9+
})
10+
11+
const primeInputWithOptionNames = ['CascadeSelect', 'Listbox', 'MultiSelect', 'RadioButton', 'Select', 'SelectButton', 'TreeSelect']
12+
13+
function primeInputNames() {
14+
if (props.full)
15+
return [...primeInputWithOptionNames, 'AutoComplete', 'Checkbox', 'ColorPicker', 'DatePicker', 'Editor', 'InputMask', 'InputNumber', 'InputOtp', 'InputText', 'Knob', 'Password', 'Rating', 'Slider', 'Textarea', 'ToggleButton', 'ToggleSwitch'].sort()
16+
else
17+
return primeInputWithOptionNames
18+
}
19+
20+
const names = ref(primeInputNames().sort((a, b) => a.localeCompare(b)))
621
</script>
722

823
<template>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<script setup lang='ts'>
2+
import { ref } from 'vue'
3+
4+
const primeOutputNames = ['OutputBoolean', 'OutputDate', 'OutputDuration', 'OutputLink', 'OutputList', 'OutputNumber', 'OutputText']
5+
6+
const names = ref(primeOutputNames.sort((a, b) => a.localeCompare(b)))
7+
</script>
8+
9+
<template>
10+
<div>
11+
<div class="pb-6 grid grid-cols-3 gap-4 content-start ...">
12+
<div v-for="name in names" :key="name" class="">
13+
<a :href="`https://formkit-primevue.netlify.app/outputs/${name}`" target="_new">{{ name }}</a>
14+
</div>
15+
</div>
16+
</div>
17+
</template>
18+
19+
<style scoped>
20+
21+
</style>

docs/.vitepress/theme/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import 'uno.css'
44
import type { Theme } from 'vitepress'
55
import Todo from './components/Todo.vue'
66
import DisplayComponents from './components/DisplayComponents.vue'
7+
import DisplayOutputComponents from './components/DisplayOutputComponents.vue'
78

89
export default {
910
...DefaultTheme,
1011
enhanceApp({ app }: { app: App }) {
1112
app.component('Todo', Todo)
1213
app.component('DisplayComponents', DisplayComponents)
14+
app.component('DisplayOutputComponents', DisplayOutputComponents)
1315
},
1416
} satisfies Theme

docs/guide/composables.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,23 @@ const formData = ref([
4747
])
4848
```
4949

50-
### Repeater
50+
## useFormkitRepeater
5151

5252
To simplify the build of a repeater you can use:
5353

54-
- addList
55-
- addListGroup
54+
- addInsertButton
55+
- addGroupButtons
5656
- addListGroupFunctions
5757

58+
```vue
59+
60+
<script setup lang='ts'>
61+
import { useFormKitRepeater } from '@sfxcode/formkit-primevue/comosables'
62+
63+
const { addInsertButton, addGroupButtons, addListGroupFunctions } = useFormKitRepeater()
64+
65+
</script>
66+
67+
```
68+
5869
A working example can be found in the [repeater demo](https://github.com/sfxcode/formkit-primevue/blob/main/dev/pages/samples/Repeater.vue).

docs/guide/data.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Data
2+
3+
For the simple usage with schema and data values FormKitDataEdit and FormKitDataView (and FormkitDebug) components ars available.
4+
5+
## Usage
6+
7+
To use the components there must be an import or global registration.
8+
9+
### FormKitDataEdit
10+
11+
```vue
12+
13+
<script setup lang='ts'>
14+
15+
import { FormKitDataEdit } from '@sfxcode/formkit-primevue/components'
16+
17+
const formSchema = ref({}) // some schema should be provided
18+
const formData = ref({}) // some data
19+
20+
async function submitHandler(data: any) {
21+
// some action on form submit
22+
}
23+
</script>
24+
25+
<template>
26+
<div>
27+
<FormKitDataEdit :schema="formSchema" :data="formData"
28+
:debug-schema="false" :debug-data="true"
29+
@data-saved="submitHandler" />
30+
</div>
31+
</template>
32+
33+
```
34+
35+
### FormKitDataView
36+
37+
Same as FormKitDataEdit but without Submit button and action.

docs/guide/history.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# History
2+
3+
Only some topics are mentioned ....
4+
5+
## 0.x to 1.0.0 (2023-03-08)
6+
7+
- First version of this framework with PrimeVue 3
8+
9+
## 1.1.x
10+
11+
- Added some styles to visualize errors on prime inputs
12+
13+
## 1.2.x
14+
15+
- Added Radio Button
16+
17+
## 1.3.x
18+
19+
- **FormKit 1.0**
20+
21+
22+
## 1.4.x
23+
24+
- more styling by sass
25+
- default style of all inputs to width of 100% (when it makes sense)
26+
27+
## 1.5.x
28+
29+
- autoAnimate Plugin in ShowCase
30+
- add missing props to some components
31+
- **FormKit 1.5**
32+
33+
## 1.6.x
34+
35+
- Better Option Handling
36+
- Provide simple option usage
37+
38+
## 1.7.x
39+
40+
- TreeSelect
41+
- v-bind for passthrough of missing options
42+
43+
## 1.8.x
44+
45+
- use InputField/InputIcon
46+
- types added
47+
48+
## 1.9.x
49+
50+
- useFormKitSchema composable
51+
- vitest - create some tests
52+
53+
## 1.11.x
54+
55+
- Input Editor
56+
- **FormKit 1.6.5**
57+
58+
## 2.0.x
59+
60+
- Update to **PrimeVue 4**
61+
62+
## 2.1.x
63+
64+
- Stabilize the usage with PrimeVue 4
65+
66+
## 2.3.x
67+
68+
- FormEditor
69+
- Form Outputs
70+
- Better Styling with the provided sass file
71+
- Simple Grid by adding col-[1-12] to outerClass
72+
- Better Prefix / Suffix Handling
73+
74+
## 2.4.x
75+
76+
- change to iconPrefix/iconSuffix

docs/guide/inputs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PrimeVue Inputs
1+
# Input Components
22

33
formkit-primevue tries to integrate as much PrimeVue inputs as possible.
44

@@ -15,4 +15,4 @@ E.g. InputMask -> primeInputMask
1515

1616
## Supported Inputs
1717

18-
<DisplayComponents />
18+
<DisplayComponents :full="true" />

docs/guide/options.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ In some inputs options are needed. There are several ways to deal with the optio
44

55
## Option based Inputs
66

7-
- Listbox
8-
- MultiSelect
9-
- RadioButton
10-
- Select
11-
- SelectButton
7+
<DisplayComponents :full="false" />
128

139
## Ways of Usage
1410

0 commit comments

Comments
 (0)