@sfxcode/formkit-nuxt-ui 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +385 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +29 -0
- package/dist/runtime/components/FUDataDebug.d.vue.ts +43 -0
- package/dist/runtime/components/FUDataDebug.vue +30 -0
- package/dist/runtime/components/FUDataDebug.vue.d.ts +43 -0
- package/dist/runtime/components/FUDataEdit.d.vue.ts +180 -0
- package/dist/runtime/components/FUDataEdit.vue +141 -0
- package/dist/runtime/components/FUDataEdit.vue.d.ts +180 -0
- package/dist/runtime/components/FUDataView.d.vue.ts +73 -0
- package/dist/runtime/components/FUDataView.vue +49 -0
- package/dist/runtime/components/FUDataView.vue.d.ts +73 -0
- package/dist/runtime/components/inputs/FUCheckbox.d.vue.ts +27 -0
- package/dist/runtime/components/inputs/FUCheckbox.vue +33 -0
- package/dist/runtime/components/inputs/FUCheckbox.vue.d.ts +27 -0
- package/dist/runtime/components/inputs/FUCheckboxGroup.d.vue.ts +38 -0
- package/dist/runtime/components/inputs/FUCheckboxGroup.vue +34 -0
- package/dist/runtime/components/inputs/FUCheckboxGroup.vue.d.ts +38 -0
- package/dist/runtime/components/inputs/FUColorPicker.d.vue.ts +22 -0
- package/dist/runtime/components/inputs/FUColorPicker.vue +27 -0
- package/dist/runtime/components/inputs/FUColorPicker.vue.d.ts +22 -0
- package/dist/runtime/components/inputs/FUInput.d.vue.ts +44 -0
- package/dist/runtime/components/inputs/FUInput.vue +50 -0
- package/dist/runtime/components/inputs/FUInput.vue.d.ts +44 -0
- package/dist/runtime/components/inputs/FUInputDate.d.vue.ts +51 -0
- package/dist/runtime/components/inputs/FUInputDate.vue +52 -0
- package/dist/runtime/components/inputs/FUInputDate.vue.d.ts +51 -0
- package/dist/runtime/components/inputs/FUInputMenu.d.vue.ts +73 -0
- package/dist/runtime/components/inputs/FUInputMenu.vue +65 -0
- package/dist/runtime/components/inputs/FUInputMenu.vue.d.ts +73 -0
- package/dist/runtime/components/inputs/FUInputNumber.d.vue.ts +43 -0
- package/dist/runtime/components/inputs/FUInputNumber.vue +49 -0
- package/dist/runtime/components/inputs/FUInputNumber.vue.d.ts +43 -0
- package/dist/runtime/components/inputs/FUInputTags.d.vue.ts +47 -0
- package/dist/runtime/components/inputs/FUInputTags.vue +53 -0
- package/dist/runtime/components/inputs/FUInputTags.vue.d.ts +47 -0
- package/dist/runtime/components/inputs/FUInputTime.d.vue.ts +50 -0
- package/dist/runtime/components/inputs/FUInputTime.vue +50 -0
- package/dist/runtime/components/inputs/FUInputTime.vue.d.ts +50 -0
- package/dist/runtime/components/inputs/FUPinInput.d.vue.ts +30 -0
- package/dist/runtime/components/inputs/FUPinInput.vue +37 -0
- package/dist/runtime/components/inputs/FUPinInput.vue.d.ts +30 -0
- package/dist/runtime/components/inputs/FURadioGroup.d.vue.ts +37 -0
- package/dist/runtime/components/inputs/FURadioGroup.vue +35 -0
- package/dist/runtime/components/inputs/FURadioGroup.vue.d.ts +37 -0
- package/dist/runtime/components/inputs/FUSelect.d.vue.ts +48 -0
- package/dist/runtime/components/inputs/FUSelect.vue +51 -0
- package/dist/runtime/components/inputs/FUSelect.vue.d.ts +48 -0
- package/dist/runtime/components/inputs/FUSelectMenu.d.vue.ts +73 -0
- package/dist/runtime/components/inputs/FUSelectMenu.vue +62 -0
- package/dist/runtime/components/inputs/FUSelectMenu.vue.d.ts +73 -0
- package/dist/runtime/components/inputs/FUSlider.d.vue.ts +29 -0
- package/dist/runtime/components/inputs/FUSlider.vue +36 -0
- package/dist/runtime/components/inputs/FUSlider.vue.d.ts +29 -0
- package/dist/runtime/components/inputs/FUSwitch.d.vue.ts +28 -0
- package/dist/runtime/components/inputs/FUSwitch.vue +34 -0
- package/dist/runtime/components/inputs/FUSwitch.vue.d.ts +28 -0
- package/dist/runtime/components/inputs/FUTextarea.d.vue.ts +44 -0
- package/dist/runtime/components/inputs/FUTextarea.vue +50 -0
- package/dist/runtime/components/inputs/FUTextarea.vue.d.ts +44 -0
- package/dist/runtime/components/output/FUIcon.d.vue.ts +38 -0
- package/dist/runtime/components/output/FUIcon.vue +21 -0
- package/dist/runtime/components/output/FUIcon.vue.d.ts +38 -0
- package/dist/runtime/components/output/FUOutputBoolean.d.vue.ts +30 -0
- package/dist/runtime/components/output/FUOutputBoolean.vue +56 -0
- package/dist/runtime/components/output/FUOutputBoolean.vue.d.ts +30 -0
- package/dist/runtime/components/output/FUOutputDate.d.vue.ts +30 -0
- package/dist/runtime/components/output/FUOutputDate.vue +52 -0
- package/dist/runtime/components/output/FUOutputDate.vue.d.ts +30 -0
- package/dist/runtime/components/output/FUOutputLink.d.vue.ts +28 -0
- package/dist/runtime/components/output/FUOutputLink.vue +78 -0
- package/dist/runtime/components/output/FUOutputLink.vue.d.ts +28 -0
- package/dist/runtime/components/output/FUOutputList.d.vue.ts +29 -0
- package/dist/runtime/components/output/FUOutputList.vue +143 -0
- package/dist/runtime/components/output/FUOutputList.vue.d.ts +29 -0
- package/dist/runtime/components/output/FUOutputNumber.d.vue.ts +28 -0
- package/dist/runtime/components/output/FUOutputNumber.vue +52 -0
- package/dist/runtime/components/output/FUOutputNumber.vue.d.ts +28 -0
- package/dist/runtime/components/output/FUOutputText.d.vue.ts +26 -0
- package/dist/runtime/components/output/FUOutputText.vue +35 -0
- package/dist/runtime/components/output/FUOutputText.vue.d.ts +26 -0
- package/dist/runtime/composables/useFormKitRepeater.d.ts +5 -0
- package/dist/runtime/composables/useFormKitRepeater.js +54 -0
- package/dist/runtime/composables/useFormKitSchema.d.ts +26 -0
- package/dist/runtime/composables/useFormKitSchema.js +58 -0
- package/dist/runtime/definitions/index.d.ts +26 -0
- package/dist/runtime/definitions/index.js +28 -0
- package/dist/runtime/definitions/input.d.ts +17 -0
- package/dist/runtime/definitions/input.js +81 -0
- package/dist/runtime/definitions/output.d.ts +7 -0
- package/dist/runtime/definitions/output.js +31 -0
- package/dist/runtime/formkit.config.d.ts +3 -0
- package/dist/runtime/formkit.config.js +33 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +5 -0
- package/dist/runtime/plugins/index.d.ts +3 -0
- package/dist/runtime/plugins/index.js +55 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/utils/useFormKitInput.d.ts +13 -0
- package/dist/runtime/utils/useFormKitInput.js +42 -0
- package/dist/runtime/utils/useFormKitOutput.d.ts +10 -0
- package/dist/runtime/utils/useFormKitOutput.js +73 -0
- package/dist/types.d.mts +3 -0
- package/package.json +91 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-present sfxcode (Tom)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
# FormKit Nuxt UI
|
|
2
|
+
|
|
3
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
|
+
[![License][license-src]][license-href]
|
|
6
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
7
|
+
|
|
8
|
+
> **⚠️ Work in Progress**: This project is under active development. APIs, components, and features may change without notice. While the core functionality is stable, expect breaking changes in minor versions until v1.0.0 is released. Use with caution in production environments.
|
|
9
|
+
|
|
10
|
+
> Seamless integration between FormKit form handling and Nuxt UI components for Nuxt 4
|
|
11
|
+
|
|
12
|
+
FormKit Nuxt UI bridges the gap between [FormKit](https://formkit.com/)'s powerful form management and [Nuxt UI](https://ui.nuxt.com/)'s beautiful component library, providing a complete solution for building forms in Nuxt applications.
|
|
13
|
+
|
|
14
|
+
- [✨ Release Notes](/CHANGELOG.md)
|
|
15
|
+
- [🏀 Live Playground](https://github.com/sfxcode/formkit-nuxt-ui/tree/main/playground)
|
|
16
|
+
- [📖 FormKit Documentation](https://formkit.com/)
|
|
17
|
+
- [🎨 Nuxt UI Documentation](https://ui.nuxt.com/)
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
✨ **16 Input Components** - Complete set of FormKit-wrapped Nuxt UI input components
|
|
22
|
+
- `nuxtUICheckbox` - Single checkbox with label and description
|
|
23
|
+
- `nuxtUICheckboxGroup` - Multiple checkbox selection
|
|
24
|
+
- `nuxtUIColorPicker` - Color selection with multiple formats
|
|
25
|
+
- `nuxtUIInput` - Text input with various types (text, email, password, etc.)
|
|
26
|
+
- `nuxtUIInputDate` - Date and time picker with range support
|
|
27
|
+
- `nuxtUIInputMenu` - Dropdown menu with searchable options
|
|
28
|
+
- `nuxtUIInputNumber` - Number input with increment/decrement buttons
|
|
29
|
+
- `nuxtUIInputTags` - Tag input with custom delimiters
|
|
30
|
+
- `nuxtUIInputTime` - Time picker with 12/24-hour format
|
|
31
|
+
- `nuxtUIPinInput` - PIN/OTP entry component
|
|
32
|
+
- `nuxtUIRadioGroup` - Radio button group for single selection
|
|
33
|
+
- `nuxtUISelect` - Select dropdown with search
|
|
34
|
+
- `nuxtUISelectMenu` - Advanced select with grouping
|
|
35
|
+
- `nuxtUISlider` - Range slider for numeric values
|
|
36
|
+
- `nuxtUISwitch` - Toggle switch for boolean states
|
|
37
|
+
- `nuxtUITextarea` - Multi-line text input with autoresize
|
|
38
|
+
|
|
39
|
+
📊 **6 Output Components** - Display-only components for read-only data
|
|
40
|
+
- `nuxtUIOutputBoolean` - Boolean display with custom icons
|
|
41
|
+
- `nuxtUIOutputDate` - Formatted date/time display
|
|
42
|
+
- `nuxtUIOutputLink` - URL display with navigation
|
|
43
|
+
- `nuxtUIOutputList` - List display with separators and badge styles
|
|
44
|
+
- `nuxtUIOutputNumber` - Formatted number display (currency, percentage)
|
|
45
|
+
- `nuxtUIOutputText` - Styled text display with icons
|
|
46
|
+
|
|
47
|
+
🎯 **Form Management** - Powerful form utilities
|
|
48
|
+
- `FUDataEdit` - Edit forms with schema-based configuration
|
|
49
|
+
- `FUDataView` - Read-only data display with schema support
|
|
50
|
+
- `FUDataDebug` - Development tool for form debugging
|
|
51
|
+
|
|
52
|
+
🔧 **Composables** - Reusable form logic
|
|
53
|
+
- `useFormKitInput` - Input component utilities
|
|
54
|
+
- `useFormKitOutput` - Output component utilities
|
|
55
|
+
- `useFormKitRepeater` - Repeatable form sections
|
|
56
|
+
- `useFormKitSchema` - Schema-based form generation
|
|
57
|
+
|
|
58
|
+
🎨 **Full Nuxt UI Integration** - All components respect Nuxt UI theming
|
|
59
|
+
- Color modes (light/dark)
|
|
60
|
+
- Design tokens
|
|
61
|
+
- Accessibility features
|
|
62
|
+
- Responsive design
|
|
63
|
+
|
|
64
|
+
✅ **TypeScript Support** - Full type safety with IntelliSense
|
|
65
|
+
⚡ **SSR Compatible** - Works seamlessly with Nuxt's server-side rendering
|
|
66
|
+
🔄 **Auto-imports** - Components and composables auto-imported
|
|
67
|
+
📝 **Validation** - Built-in FormKit validation support
|
|
68
|
+
|
|
69
|
+
## Quick Setup
|
|
70
|
+
|
|
71
|
+
Install the module to your Nuxt application:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Using pnpm (recommended)
|
|
75
|
+
pnpm add @sfxcode/formkit-nuxt-ui
|
|
76
|
+
|
|
77
|
+
# Using npm
|
|
78
|
+
npm install @sfxcode/formkit-nuxt-ui
|
|
79
|
+
|
|
80
|
+
# Using yarn
|
|
81
|
+
yarn add @sfxcode/formkit-nuxt-ui
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Add the module to your `nuxt.config.ts`:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
export default defineNuxtConfig({
|
|
88
|
+
modules: [
|
|
89
|
+
'@nuxt/ui',
|
|
90
|
+
'@sfxcode/formkit-nuxt-ui'
|
|
91
|
+
]
|
|
92
|
+
})
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
That's it! You can now use FormKit Nuxt UI components in your Nuxt app ✨
|
|
96
|
+
|
|
97
|
+
## Usage
|
|
98
|
+
|
|
99
|
+
### Basic Form Example
|
|
100
|
+
|
|
101
|
+
```vue
|
|
102
|
+
<template>
|
|
103
|
+
<FormKit
|
|
104
|
+
type="form"
|
|
105
|
+
@submit="handleSubmit"
|
|
106
|
+
>
|
|
107
|
+
<FormKit
|
|
108
|
+
type="nuxtUIInput"
|
|
109
|
+
name="email"
|
|
110
|
+
label="Email Address"
|
|
111
|
+
placeholder="your.email@example.com"
|
|
112
|
+
validation="required|email"
|
|
113
|
+
/>
|
|
114
|
+
|
|
115
|
+
<FormKit
|
|
116
|
+
type="nuxtUIInput"
|
|
117
|
+
name="password"
|
|
118
|
+
input-type="password"
|
|
119
|
+
label="Password"
|
|
120
|
+
validation="required|length:8"
|
|
121
|
+
/>
|
|
122
|
+
|
|
123
|
+
<FormKit
|
|
124
|
+
type="nuxtUICheckbox"
|
|
125
|
+
name="terms"
|
|
126
|
+
label="I agree to the terms and conditions"
|
|
127
|
+
validation="accepted"
|
|
128
|
+
/>
|
|
129
|
+
|
|
130
|
+
<UButton type="submit">
|
|
131
|
+
Sign Up
|
|
132
|
+
</UButton>
|
|
133
|
+
</FormKit>
|
|
134
|
+
</template>
|
|
135
|
+
|
|
136
|
+
<script setup lang="ts">
|
|
137
|
+
const handleSubmit = (data: any) => {
|
|
138
|
+
console.log('Form submitted:', data)
|
|
139
|
+
}
|
|
140
|
+
</script>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Schema-Based Form
|
|
144
|
+
|
|
145
|
+
```vue
|
|
146
|
+
<template>
|
|
147
|
+
<FUDataEdit
|
|
148
|
+
:data="formData"
|
|
149
|
+
:schema="userSchema"
|
|
150
|
+
@submit="handleSubmit"
|
|
151
|
+
/>
|
|
152
|
+
</template>
|
|
153
|
+
|
|
154
|
+
<script setup lang="ts">
|
|
155
|
+
const formData = ref({
|
|
156
|
+
name: '',
|
|
157
|
+
email: '',
|
|
158
|
+
age: 0,
|
|
159
|
+
subscribe: false
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
const userSchema = [
|
|
163
|
+
{
|
|
164
|
+
$formkit: 'nuxtUIInput',
|
|
165
|
+
name: 'name',
|
|
166
|
+
label: 'Full Name',
|
|
167
|
+
validation: 'required'
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
$formkit: 'nuxtUIInput',
|
|
171
|
+
name: 'email',
|
|
172
|
+
inputType: 'email',
|
|
173
|
+
label: 'Email',
|
|
174
|
+
validation: 'required|email'
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
$formkit: 'nuxtUIInputNumber',
|
|
178
|
+
name: 'age',
|
|
179
|
+
label: 'Age',
|
|
180
|
+
min: 0,
|
|
181
|
+
max: 120
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
$formkit: 'nuxtUISwitch',
|
|
185
|
+
name: 'subscribe',
|
|
186
|
+
label: 'Subscribe to newsletter'
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
|
|
190
|
+
const handleSubmit = (data: any) => {
|
|
191
|
+
console.log('Form submitted:', data)
|
|
192
|
+
}
|
|
193
|
+
</script>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Advanced Number Input with Formatting
|
|
197
|
+
|
|
198
|
+
```vue
|
|
199
|
+
<FormKit
|
|
200
|
+
type="nuxtUIInputNumber"
|
|
201
|
+
name="price"
|
|
202
|
+
label="Product Price"
|
|
203
|
+
:min="0"
|
|
204
|
+
:step="0.01"
|
|
205
|
+
:format-options="{
|
|
206
|
+
style: 'currency',
|
|
207
|
+
currency: 'USD'
|
|
208
|
+
}"
|
|
209
|
+
validation="required|min:0"
|
|
210
|
+
/>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Output Components for Display
|
|
214
|
+
|
|
215
|
+
```vue
|
|
216
|
+
<template>
|
|
217
|
+
<FUDataView
|
|
218
|
+
:data="userData"
|
|
219
|
+
:schema="displaySchema"
|
|
220
|
+
/>
|
|
221
|
+
</template>
|
|
222
|
+
|
|
223
|
+
<script setup lang="ts">
|
|
224
|
+
const userData = ref({
|
|
225
|
+
name: 'John Doe',
|
|
226
|
+
email: 'john@example.com',
|
|
227
|
+
price: 1234.56,
|
|
228
|
+
tags: ['Vue', 'Nuxt', 'TypeScript'],
|
|
229
|
+
isActive: true
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
const displaySchema = [
|
|
233
|
+
{
|
|
234
|
+
$formkit: 'nuxtUIOutputText',
|
|
235
|
+
name: 'name',
|
|
236
|
+
label: 'Name',
|
|
237
|
+
leadingIcon: 'i-heroicons-user'
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
$formkit: 'nuxtUIOutputLink',
|
|
241
|
+
name: 'email',
|
|
242
|
+
label: 'Email',
|
|
243
|
+
leadingIcon: 'i-heroicons-envelope'
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
$formkit: 'nuxtUIOutputNumber',
|
|
247
|
+
name: 'price',
|
|
248
|
+
label: 'Price',
|
|
249
|
+
formatOptions: {
|
|
250
|
+
style: 'currency',
|
|
251
|
+
currency: 'USD'
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
$formkit: 'nuxtUIOutputList',
|
|
256
|
+
name: 'tags',
|
|
257
|
+
label: 'Technologies',
|
|
258
|
+
listType: 'badge',
|
|
259
|
+
color: 'primary'
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
$formkit: 'nuxtUIOutputBoolean',
|
|
263
|
+
name: 'isActive',
|
|
264
|
+
label: 'Status',
|
|
265
|
+
trueValue: 'Active',
|
|
266
|
+
falseValue: 'Inactive'
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
</script>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Component Props
|
|
273
|
+
|
|
274
|
+
All components support their respective Nuxt UI component props plus FormKit-specific props like `name`, `label`, `help`, `validation`, etc.
|
|
275
|
+
|
|
276
|
+
Refer to the [Nuxt UI documentation](https://ui.nuxt.com/) for component-specific props and the [FormKit documentation](https://formkit.com/) for validation and form handling.
|
|
277
|
+
|
|
278
|
+
## Examples
|
|
279
|
+
|
|
280
|
+
The playground includes comprehensive examples for all components:
|
|
281
|
+
|
|
282
|
+
### Input Components
|
|
283
|
+
- [Checkbox](./playground/app/pages/components/input/checkbox.vue)
|
|
284
|
+
- [CheckboxGroup](./playground/app/pages/components/input/checkbox-group.vue)
|
|
285
|
+
- [ColorPicker](./playground/app/pages/components/input/color-picker.vue)
|
|
286
|
+
- [Input](./playground/app/pages/components/input/input.vue)
|
|
287
|
+
- [InputDate](./playground/app/pages/components/input/input-date.vue)
|
|
288
|
+
- [InputMenu](./playground/app/pages/components/input/input-menu.vue)
|
|
289
|
+
- [InputNumber](./playground/app/pages/components/input/input-number.vue)
|
|
290
|
+
- [InputTags](./playground/app/pages/components/input/input-tags.vue)
|
|
291
|
+
- [InputTime](./playground/app/pages/components/input/input-time.vue)
|
|
292
|
+
- [PinInput](./playground/app/pages/components/input/pin-input.vue)
|
|
293
|
+
- [RadioGroup](./playground/app/pages/components/input/radio-group.vue)
|
|
294
|
+
- [Select](./playground/app/pages/components/input/select.vue)
|
|
295
|
+
- [SelectMenu](./playground/app/pages/components/input/select-menu.vue)
|
|
296
|
+
- [Slider](./playground/app/pages/components/input/slider.vue)
|
|
297
|
+
- [Switch](./playground/app/pages/components/input/switch.vue)
|
|
298
|
+
- [Textarea](./playground/app/pages/components/input/textarea.vue)
|
|
299
|
+
|
|
300
|
+
### Output Components
|
|
301
|
+
- [OutputBoolean](./playground/app/pages/components/output/boolean.vue)
|
|
302
|
+
- [OutputDate](./playground/app/pages/components/output/date.vue)
|
|
303
|
+
- [OutputLink](./playground/app/pages/components/output/link.vue)
|
|
304
|
+
- [OutputList](./playground/app/pages/components/output/list.vue)
|
|
305
|
+
- [OutputNumber](./playground/app/pages/components/output/number.vue)
|
|
306
|
+
- [OutputText](./playground/app/pages/components/output/text.vue)
|
|
307
|
+
|
|
308
|
+
## Development
|
|
309
|
+
|
|
310
|
+
<details>
|
|
311
|
+
<summary>Local development setup</summary>
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
# Clone the repository
|
|
315
|
+
git clone https://github.com/sfxcode/formkit-nuxt-ui.git
|
|
316
|
+
cd formkit-nuxt-ui
|
|
317
|
+
|
|
318
|
+
# Install dependencies (using pnpm)
|
|
319
|
+
pnpm install
|
|
320
|
+
|
|
321
|
+
# Generate type stubs
|
|
322
|
+
pnpm dev:prepare
|
|
323
|
+
|
|
324
|
+
# Start development server with playground
|
|
325
|
+
pnpm dev
|
|
326
|
+
|
|
327
|
+
# Build the playground
|
|
328
|
+
pnpm dev:build
|
|
329
|
+
|
|
330
|
+
# Run ESLint
|
|
331
|
+
pnpm lint
|
|
332
|
+
|
|
333
|
+
# Run tests
|
|
334
|
+
pnpm test
|
|
335
|
+
pnpm test:watch
|
|
336
|
+
|
|
337
|
+
# Build the module
|
|
338
|
+
pnpm build
|
|
339
|
+
|
|
340
|
+
# Release new version
|
|
341
|
+
pnpm release
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
</details>
|
|
345
|
+
|
|
346
|
+
## Requirements
|
|
347
|
+
|
|
348
|
+
- Nuxt 4.x
|
|
349
|
+
- Vue 3.x
|
|
350
|
+
- @nuxt/ui 4.3.0+
|
|
351
|
+
- @formkit/vue 1.x
|
|
352
|
+
- @formkit/nuxt 1.x
|
|
353
|
+
|
|
354
|
+
## Contributing
|
|
355
|
+
|
|
356
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
357
|
+
|
|
358
|
+
1. Fork the repository
|
|
359
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
360
|
+
3. Commit your changes using [Conventional Commits](https://www.conventionalcommits.org/) (`git commit -m 'feat: add amazing feature'`)
|
|
361
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
362
|
+
5. Open a Pull Request
|
|
363
|
+
|
|
364
|
+
## License
|
|
365
|
+
|
|
366
|
+
[MIT License](./LICENSE) © 2024-present [sfxcode](https://github.com/sfxcode)
|
|
367
|
+
|
|
368
|
+
## Credits
|
|
369
|
+
|
|
370
|
+
- [FormKit](https://formkit.com/) - Form framework for Vue
|
|
371
|
+
- [Nuxt UI](https://ui.nuxt.com/) - UI library for Nuxt
|
|
372
|
+
- [Nuxt](https://nuxt.com/) - The Intuitive Vue Framework
|
|
373
|
+
|
|
374
|
+
<!-- Badges -->
|
|
375
|
+
[npm-version-src]: https://img.shields.io/npm/v/@sfxcode/formkit-nuxt-ui/latest.svg?style=flat&colorA=020420&colorB=00DC82
|
|
376
|
+
[npm-version-href]: https://npmjs.com/package/@sfxcode/formkit-nuxt-ui
|
|
377
|
+
|
|
378
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/@sfxcode/formkit-nuxt-ui.svg?style=flat&colorA=020420&colorB=00DC82
|
|
379
|
+
[npm-downloads-href]: https://npm.chart.dev/@sfxcode/formkit-nuxt-ui
|
|
380
|
+
|
|
381
|
+
[license-src]: https://img.shields.io/npm/l/@sfxcode/formkit-nuxt-ui.svg?style=flat&colorA=020420&colorB=00DC82
|
|
382
|
+
[license-href]: https://npmjs.com/package/@sfxcode/formkit-nuxt-ui
|
|
383
|
+
|
|
384
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt
|
|
385
|
+
[nuxt-href]: https://nuxt.com
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, addImportsDir, addComponent } from '@nuxt/kit';
|
|
2
|
+
|
|
3
|
+
const module$1 = defineNuxtModule({
|
|
4
|
+
meta: {
|
|
5
|
+
name: "formkit-nuxt-ui",
|
|
6
|
+
configKey: "formkitNuxtUi",
|
|
7
|
+
compatibility: {
|
|
8
|
+
nuxt: ">=4.0.0"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
// Default configuration options of the Nuxt module
|
|
12
|
+
defaults: {},
|
|
13
|
+
setup(_options, _nuxt) {
|
|
14
|
+
const resolver = createResolver(import.meta.url);
|
|
15
|
+
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
16
|
+
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
17
|
+
const NPM_PCK_FORMKIT_NUXT_UI = "@sfxcode/formkit-nuxt-ui";
|
|
18
|
+
const componentNames = ["FUDataView", "FUDataEdit", "FUDataDebug"];
|
|
19
|
+
componentNames.forEach(
|
|
20
|
+
(name) => addComponent({
|
|
21
|
+
name,
|
|
22
|
+
filePath: resolver.resolve("./runtime/components/" + name + ".vue"),
|
|
23
|
+
chunkName: NPM_PCK_FORMKIT_NUXT_UI
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
data: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
default: null;
|
|
9
|
+
};
|
|
10
|
+
header: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
textClass: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
data: {
|
|
20
|
+
type: ObjectConstructor;
|
|
21
|
+
default: null;
|
|
22
|
+
};
|
|
23
|
+
header: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
textClass: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{}>, {
|
|
32
|
+
data: Record<string, any>;
|
|
33
|
+
header: string;
|
|
34
|
+
textClass: string;
|
|
35
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
36
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
data: {
|
|
4
|
+
type: Object,
|
|
5
|
+
default: null
|
|
6
|
+
},
|
|
7
|
+
header: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "Debug"
|
|
10
|
+
},
|
|
11
|
+
textClass: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "text-xs"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<div class="formkit-debug">
|
|
20
|
+
<h3 class="text-lg font-semibold mb-2">
|
|
21
|
+
{{ header }}
|
|
22
|
+
</h3>
|
|
23
|
+
<slot />
|
|
24
|
+
<pre
|
|
25
|
+
v-if="data"
|
|
26
|
+
:class="textClass"
|
|
27
|
+
>{{ data }}</pre>
|
|
28
|
+
<span v-else>No Data available</span>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
data: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
default: null;
|
|
9
|
+
};
|
|
10
|
+
header: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
textClass: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
data: {
|
|
20
|
+
type: ObjectConstructor;
|
|
21
|
+
default: null;
|
|
22
|
+
};
|
|
23
|
+
header: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
textClass: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{}>, {
|
|
32
|
+
data: Record<string, any>;
|
|
33
|
+
header: string;
|
|
34
|
+
textClass: string;
|
|
35
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
36
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|