Skip to content

Commit 34d0681

Browse files
committed
docs: use formkit nuxt
1 parent c9a386e commit 34d0681

File tree

5 files changed

+232
-41
lines changed

5 files changed

+232
-41
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@nuxt/kit": "^3.14.159",
3838
"@nuxtjs/i18n": "^8.5.6",
3939
"@primevue/nuxt-module": "^4.2.2",
40+
"@formkit/nuxt": "^1.6.9",
4041
"@sfxcode/formkit-primevue": "^2.6.6"
4142
},
4243
"devDependencies": {
@@ -53,5 +54,6 @@
5354
"typescript": "latest",
5455
"vitest": "^2.1.5",
5556
"vue-tsc": "^2.1.10"
56-
}
57+
},
58+
"packageManager": "[email protected]+sha256.ccce81bf7498c5f0f80e31749c1f8f03baba99d168f64590fc7e13fad3ea1938"
5759
}

playground/formkit.config.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { defineFormKitConfig } from '@formkit/vue'
2+
import { createAutoAnimatePlugin } from '@formkit/addons'
3+
import '@formkit/addons/css/multistep.css'
4+
import { primeInputs, primeOutputs } from '@sfxcode/formkit-primevue'
5+
import { addPrimeAsteriskPlugin } from '@sfxcode/formkit-primevue/plugins'
6+
import { de, en, es, fr, tr } from '@formkit/i18n'
7+
8+
export default defineFormKitConfig(() => {
9+
return {
10+
locales: { de, en, es, fr, tr },
11+
// Define the active locale
12+
locale: en,
13+
inputs: { ...primeInputs, ...primeOutputs },
14+
plugins: [addPrimeAsteriskPlugin,
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+
],
31+
}
32+
})

pnpm-lock.yaml

Lines changed: 156 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/module.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export default defineNuxtModule<ModuleOptions>({
4848

4949
const resolver = createResolver(import.meta.url)
5050
await installModule('@primevue/nuxt-module')
51+
// Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`
52+
addPlugin(resolver.resolve('./runtime/plugin'))
53+
54+
await installModule('@formkit/nuxt', { defaultConfig: true, configFile: 'formkit.config.ts', autoImport: true })
5155

5256
if (_options.installI18N)
5357
await installModule('@nuxtjs/i18n')
@@ -87,8 +91,5 @@ export default defineNuxtModule<ModuleOptions>({
8791
filePath: NPM_PCK_FORMKIT_PRIMEVUE,
8892
}),
8993
)
90-
91-
// Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`
92-
addPlugin(resolver.resolve('./runtime/plugin'))
9394
},
9495
})

0 commit comments

Comments
 (0)