Skip to content

Commit 59bae95

Browse files
committed
chore(package): update to formkit-primevue-nuxt module 1.2.2, add needed formkit.config.ts and modify nuxt.config.ts to changed properties for formkitPrimevue
1 parent 49ef7ca commit 59bae95

File tree

5 files changed

+514
-419
lines changed

5 files changed

+514
-419
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ THX to [antfu / Vitesse Nuxt3](https://github.com/antfu/vitesse-nuxt3) for start
2525
## Nuxt Modules (included in formkit-prinevue-nuxt)
2626

2727
- [FormKit-PrimeVue-Nuxt](https://github.com/sfxcode/formkit-primevue-nuxt) - FormKit PrimeVue Nuxt Module
28-
- [PrimeVue-Nuxt](https://primevue.org/nuxt/) PrimeVue Nuxt Module
29-
- [FormKit](https://formkit.com/) - Validation
30-
- [I18n](https://v8.i18n.nuxtjs.org) - Integration with [Vue I18n](https://vue-i18n.intlify.dev/)
28+
- [PrimeVue-Nuxt](https://primevue.org/nuxt/) PrimeVue UI Framework
29+
- [FormKit-Nuxt](https://formkit.com/) - Form Handling
30+
- [I18n-Nuxt](https://v8.i18n.nuxtjs.org) - Integration with [Vue I18n](https://vue-i18n.intlify.dev/)
3131

3232
## Nuxt Modules (additional)
3333

@@ -43,14 +43,15 @@ THX to [antfu / Vitesse Nuxt3](https://github.com/antfu/vitesse-nuxt3) for start
4343

4444
### FormKit PrimeVue Nuxt
4545

46+
Module options for FormKit PrimeVue Nuxt.
47+
Below are the default values, if they fit your needs, you don't need to add them to your nuxt.config.ts.
48+
4649
```typescript
47-
formkitPrimevue: {
48-
includePrimeIcons: true,
50+
formkitPrimevue: {
51+
includePrimeIcons: true,
4952
includeStyles: true,
50-
formkitAutoConfig: true,
51-
formkitLocale: 'en',
52-
formkitPluginAnimate: true,
53-
formkitPluginAsterisk: true,
53+
installFormKit: true,
54+
installI18N: true,
5455
},
5556
```
5657

formkit.config.ts

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// formkit.config.ts
2+
import type { DefaultConfigOptions } from '@formkit/vue'
3+
import { createAutoAnimatePlugin } from '@formkit/addons'
4+
import { de, en } from '@formkit/i18n'
5+
import { primeInputs, primeOutputs } from '@sfxcode/formkit-primevue'
6+
import { addPrimeAsteriskPlugin } from '@sfxcode/formkit-primevue/plugins'
7+
8+
const config: DefaultConfigOptions = {
9+
locales: { en, de },
10+
// Define the active locale
11+
locale: 'en',
12+
inputs: { ...primeInputs, ...primeOutputs },
13+
14+
plugins: [
15+
createAutoAnimatePlugin(
16+
{
17+
/* optional AutoAnimate config */
18+
// default:
19+
duration: 250,
20+
easing: 'ease-in-out',
21+
},
22+
{
23+
/* optional animation targets object */
24+
// default:
25+
global: ['outer', 'inner'],
26+
form: ['form'],
27+
repeater: ['items'],
28+
},
29+
),
30+
addPrimeAsteriskPlugin,
31+
],
32+
}
33+
34+
export default config

nuxt.config.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,15 @@ export default defineNuxtConfig({
2020
},
2121

2222
modules: [
23-
'@unocss/nuxt',
2423
'@pinia/nuxt',
2524
'@nuxt/content',
2625
'@vueuse/nuxt',
2726
'@nuxt/test-utils/module',
2827
'@nuxt/image',
2928
'@nuxt/fonts',
3029
'@sfxcode/formkit-primevue-nuxt',
30+
'@unocss/nuxt',
3131
],
32-
formkit: {
33-
autoImport: true,
34-
},
3532
content: {
3633
highlight: {
3734
theme: 'one-dark-pro',
@@ -54,10 +51,8 @@ export default defineNuxtConfig({
5451
formkitPrimevue: {
5552
includePrimeIcons: true,
5653
includeStyles: true,
57-
formkitAutoConfig: true,
58-
formkitLocale: 'en',
59-
formkitPluginAnimate: true,
60-
formkitPluginAsterisk: true,
54+
installFormKit: true,
55+
installI18N: true,
6156
},
6257
primevue: {
6358
autoImport: true,

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@nuxt/test-utils": "^3.14.4",
3434
"@pinia/nuxt": "^0.7.0",
3535
"@primevue/themes": "^4.2.2",
36-
"@sfxcode/formkit-primevue-nuxt": "^1.1.7",
36+
"@sfxcode/formkit-primevue-nuxt": "^1.2.2",
3737
"@tiptap/extension-highlight": "^2.9.1",
3838
"@tiptap/extension-text-align": "^2.9.1",
3939
"@tiptap/extension-text-style": "^2.9.1",
@@ -55,6 +55,7 @@
5555
"unstorage": "^1.13.1",
5656
"vitest": "^2.1.5",
5757
"vue-sidebar-menu": "^5.4.2"
58+
5859
},
5960
"packageManager": "pnpm@9.13.2+sha256.ccce81bf7498c5f0f80e31749c1f8f03baba99d168f64590fc7e13fad3ea1938"
6061
}

0 commit comments

Comments
 (0)