@uniquedj95/vform 2.0.3 → 3.0.3

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.
Files changed (55) hide show
  1. package/README.md +256 -167
  2. package/dist/components/inputs/BaseInput.vue.d.ts +5 -6
  3. package/dist/components/inputs/BaseInput.vue.d.ts.map +1 -1
  4. package/dist/components/inputs/CheckboxInput.vue.d.ts +2 -3
  5. package/dist/components/inputs/CheckboxInput.vue.d.ts.map +1 -1
  6. package/dist/components/inputs/DateInput.vue.d.ts +2 -3
  7. package/dist/components/inputs/DateInput.vue.d.ts.map +1 -1
  8. package/dist/components/inputs/EmailInput.vue.d.ts +6 -4
  9. package/dist/components/inputs/EmailInput.vue.d.ts.map +1 -1
  10. package/dist/components/inputs/NumberInput.vue.d.ts +6 -4
  11. package/dist/components/inputs/NumberInput.vue.d.ts.map +1 -1
  12. package/dist/components/inputs/PasswordInput.vue.d.ts +6 -4
  13. package/dist/components/inputs/PasswordInput.vue.d.ts.map +1 -1
  14. package/dist/components/inputs/RepeatInput.vue.d.ts.map +1 -1
  15. package/dist/components/inputs/SelectInput.vue.d.ts +2 -1
  16. package/dist/components/inputs/SelectInput.vue.d.ts.map +1 -1
  17. package/dist/components/inputs/TextAreaInput.vue.d.ts +3 -5
  18. package/dist/components/inputs/TextAreaInput.vue.d.ts.map +1 -1
  19. package/dist/components/inputs/TextInput.vue.d.ts +6 -4
  20. package/dist/components/inputs/TextInput.vue.d.ts.map +1 -1
  21. package/dist/components/shared/InputLabel.vue.d.ts +7 -0
  22. package/dist/components/shared/InputLabel.vue.d.ts.map +1 -0
  23. package/dist/components/vForm.vue.d.ts +2 -2
  24. package/dist/components/vForm.vue.d.ts.map +1 -1
  25. package/dist/composables/useCheckboxLabelText.d.ts +10 -0
  26. package/dist/composables/useCheckboxLabelText.d.ts.map +1 -0
  27. package/dist/composables/useDataTransformation.d.ts +11 -0
  28. package/dist/composables/useDataTransformation.d.ts.map +1 -0
  29. package/dist/composables/useFormValidation.d.ts +11 -0
  30. package/dist/composables/useFormValidation.d.ts.map +1 -0
  31. package/dist/composables/useInputProps.d.ts +25 -0
  32. package/dist/composables/useInputProps.d.ts.map +1 -0
  33. package/dist/composables/useInputValidation.d.ts +16 -0
  34. package/dist/composables/useInputValidation.d.ts.map +1 -0
  35. package/dist/composables/useLabelTemplate.d.ts +12 -0
  36. package/dist/composables/useLabelTemplate.d.ts.map +1 -0
  37. package/dist/composables/useValidationStyles.d.ts +10 -0
  38. package/dist/composables/useValidationStyles.d.ts.map +1 -0
  39. package/dist/constants/index.d.ts +41 -0
  40. package/dist/constants/index.d.ts.map +1 -0
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.cjs.js.map +1 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.es.js +793 -701
  45. package/dist/index.es.js.map +1 -1
  46. package/dist/index.umd.js +1 -1
  47. package/dist/index.umd.js.map +1 -1
  48. package/dist/types/index.d.ts +10 -10
  49. package/dist/types/index.d.ts.map +1 -1
  50. package/dist/utils/index.d.ts +1 -0
  51. package/dist/utils/index.d.ts.map +1 -1
  52. package/dist/utils/maskito.d.ts +7 -0
  53. package/dist/utils/maskito.d.ts.map +1 -0
  54. package/dist/vform.css +1 -1
  55. package/package.json +48 -3
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  A dynamic form builder for Vue.js with Ionic components
8
8
 
9
- [![Version](https://img.shields.io/badge/version-2.0.3-blue.svg)](https://github.com/uniquedj95/vform/releases)
9
+ [![Version](https://img.shields.io/badge/version-3.0.3-blue.svg)](https://github.com/uniquedj95/vform/releases)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
11
11
  [![Vue Version](https://img.shields.io/badge/vue-3.5+-brightgreen.svg)](https://vuejs.org/)
12
12
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.5-blue)](https://www.typescriptlang.org/)
@@ -14,9 +14,11 @@ A dynamic form builder for Vue.js with Ionic components
14
14
  [![Ionic Vue](https://img.shields.io/badge/Ionic-8.2-blue)](https://ionicframework.com/)
15
15
  [![Bundle Size](https://img.shields.io/bundlephobia/min/@uniquedj95/vform)](https://bundlephobia.com/package/@uniquedj95/vform)
16
16
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/uniquedj95/vform/pulls)
17
+
17
18
  </div>
18
19
 
19
20
  ## Table of Contents
21
+
20
22
  - [Overview](#overview)
21
23
  - [Features](#features)
22
24
  - [Installation](#installation)
@@ -37,9 +39,11 @@ A dynamic form builder for Vue.js with Ionic components
37
39
  - [Contributors](#contributors)
38
40
 
39
41
  ## Overview
42
+
40
43
  vForm is a Vue.js component that dynamically generates forms based on a provided schema. It leverages Ionic components for a responsive and mobile-friendly design, supporting complex forms with conditional rendering and validation logic. It provides a robust and flexible form-building solution for Vue.js applications, allowing for a high degree of customization and control over the form behavior and appearance.
41
44
 
42
45
  ## Features
46
+
43
47
  - **Dynamic Form Generation**: Create forms dynamically based on a schema definition.
44
48
  - **Conditional Field Rendering**: Fields can be shown or hidden based on other form values.
45
49
  - **Responsive Grid Layout**: Utilizes Ionic Grid for a responsive design that works across different screen sizes.
@@ -59,16 +63,19 @@ vForm is a Vue.js component that dynamically generates forms based on a provided
59
63
  1. Install the package using your preferred package manager:
60
64
 
61
65
  Using NPM:
66
+
62
67
  ```sh
63
68
  npm install @uniquedj95/vform
64
69
  ```
65
-
70
+
66
71
  Using Yarn:
72
+
67
73
  ```sh
68
74
  yarn add @uniquedj95/vform
69
75
  ```
70
76
 
71
77
  2. Make sure you have the required peer dependencies:
78
+
72
79
  - Vue 3.5+
73
80
  - Ionic Vue (for UI components)
74
81
 
@@ -83,227 +90,239 @@ vForm is a Vue.js component that dynamically generates forms based on a provided
83
90
  ```
84
91
 
85
92
  ## Usage
93
+
86
94
  1. Register `VForm` component in your Vue.js application:
87
- ```typescript
88
- // src/main.ts
89
- import { createApp, Plugin } from 'vue';
90
- import App from './App.vue';
91
- import router from './router';
92
- import { IonicVue } from '@ionic/vue';
93
- import { VForm } from '@uniquedj95/vform';
94
-
95
- /* Import CSS styles and other components here */
96
- import '@uniquedj95/vform/vform.css'
97
-
98
- const app = createApp(App)
99
- .use(IonicVue)
100
- .use(VForm as Plugin)
101
- .use(router);
102
-
103
- router.isReady().then(() => {
104
- app.mount('#app');
105
- });
106
- ```
95
+
96
+ ```typescript
97
+ // src/main.ts
98
+ import { createApp, Plugin } from 'vue';
99
+ import App from './App.vue';
100
+ import router from './router';
101
+ import { IonicVue } from '@ionic/vue';
102
+ import { VForm } from '@uniquedj95/vform';
103
+
104
+ /* Import CSS styles and other components here */
105
+ import '@uniquedj95/vform/vform.css';
106
+
107
+ const app = createApp(App)
108
+ .use(IonicVue)
109
+ .use(VForm as Plugin)
110
+ .use(router);
111
+
112
+ router.isReady().then(() => {
113
+ app.mount('#app');
114
+ });
115
+ ```
107
116
 
108
117
  2. Use the component in your template:
109
- ```vue
110
- <template>
111
- <v-form :schema="formSchema" button-placement="end" @submit="onSubmit" />
112
- </template>
113
-
114
- <script setup lang="ts">
115
- import { reactive } from "vue";
116
- import { FormSchema, FormData, ComputedData } from "@uniquedj95/vform";
117
-
118
- const formSchema = reactive<FormSchema>({
119
- // Define your form schema here
120
- fieldId: {
121
- type: 'TextInput', // or other InputType
122
- label: 'Field Label',
123
- placeholder: 'Enter a value',
124
- required: true,
125
- // additional field configuration options
126
- },
127
- // Additional fields
128
- });
129
-
130
- function onSubmit(data: FormData, computedData: ComputedData) {
131
- console.log(data, computedData);
132
- }
133
- </script>
134
- ```
118
+
119
+ ```vue
120
+ <template>
121
+ <v-form :schema="formSchema" button-placement="end" @submit="onSubmit" />
122
+ </template>
123
+
124
+ <script setup lang="ts">
125
+ import { reactive } from 'vue';
126
+ import { FormSchema, FormData, ComputedData } from '@uniquedj95/vform';
127
+
128
+ const formSchema = reactive<FormSchema>({
129
+ // Define your form schema here
130
+ fieldId: {
131
+ type: 'TextInput', // or other InputType
132
+ label: 'Field Label',
133
+ placeholder: 'Enter a value',
134
+ required: true,
135
+ // additional field configuration options
136
+ },
137
+ // Additional fields
138
+ });
139
+
140
+ function onSubmit(data: FormData, computedData: ComputedData) {
141
+ console.log(data, computedData);
142
+ }
143
+ </script>
144
+ ```
135
145
 
136
146
  ## Schema Structure
147
+
137
148
  The schema object should define the structure of the form. Each key in the schema represents a form field with its configuration.
138
149
 
139
150
  ### Example Schema
151
+
140
152
  ```typescript
141
153
  const formSchema: FormSchema = {
142
154
  firstName: {
143
155
  type: 'TextInput',
144
156
  label: 'First Name',
145
157
  required: true,
146
- grid: { xs: '12', md: '6' }
158
+ grid: { xs: '12', md: '6' },
147
159
  },
148
160
  lastName: {
149
161
  type: 'TextInput',
150
162
  label: 'Last Name',
151
163
  required: true,
152
- grid: { xs: '12', md: '6' }
164
+ grid: { xs: '12', md: '6' },
153
165
  },
154
166
  birthDate: {
155
167
  type: 'DateInput',
156
168
  label: 'Date of Birth',
157
169
  required: true,
158
- pattern: 'DD/MMM/YYYY'
170
+ pattern: 'DD/MMM/YYYY',
159
171
  },
160
172
  email: {
161
173
  type: 'EmailInput',
162
174
  label: 'Email Address',
163
175
  required: true,
164
- validation: (value) => {
176
+ validation: value => {
165
177
  if (!value.includes('@')) {
166
178
  return ['Invalid email format'];
167
179
  }
168
180
  return null;
169
- }
181
+ },
170
182
  },
171
183
  category: {
172
184
  type: 'SelectInput',
173
185
  label: 'Category',
174
186
  options: [
175
187
  { label: 'Option 1', value: '1' },
176
- { label: 'Option 2', value: '2', description: { text: 'With an explanation', color: 'secondary', show: 'always' } }
177
- ]
188
+ {
189
+ label: 'Option 2',
190
+ value: '2',
191
+ description: { text: 'With an explanation', color: 'secondary', show: 'always' },
192
+ },
193
+ ],
178
194
  },
179
195
  notes: {
180
196
  type: 'TextAreaInput',
181
197
  label: 'Notes',
182
198
  rows: 4,
183
- autoGrow: true
184
- }
199
+ autoGrow: true,
200
+ },
185
201
  };
186
202
  ```
187
203
 
188
204
  ### Field Configuration Options
189
205
 
190
206
  #### Input Types
207
+
191
208
  The following input types are supported:
192
209
 
193
- | Type | Description |
194
- |------|-------------|
195
- | `TextInput` | Standard text input field |
196
- | `DateInput` | Date picker with customizable format |
197
- | `NumberInput` | Numeric input field |
198
- | `EmailInput` | Input field with email validation |
210
+ | Type | Description |
211
+ | --------------- | -------------------------------------------- |
212
+ | `TextInput` | Standard text input field |
213
+ | `DateInput` | Date picker with customizable format |
214
+ | `NumberInput` | Numeric input field |
215
+ | `EmailInput` | Input field with email validation |
199
216
  | `PasswordInput` | Secure password input with toggle visibility |
200
- | `TextAreaInput` | Multi-line text input |
201
- | `SelectInput` | Dropdown selection |
202
- | `CheckboxInput` | Toggle on/off input |
203
- | `RepeatInput` | Repeatable group of fields |
217
+ | `TextAreaInput` | Multi-line text input |
218
+ | `SelectInput` | Dropdown selection |
219
+ | `CheckboxInput` | Toggle on/off input |
220
+ | `RepeatInput` | Repeatable group of fields |
204
221
 
205
222
  #### Common Properties
206
223
 
207
- | Property | Type | Description | Applies To |
208
- |----------|------|-------------|------------|
209
- | `label` | `string` | The label displayed for the form field | All |
210
- | `placeholder` | `string` | Placeholder text for the input field | Text-based inputs |
211
- | `required` | `boolean` | Determines if the field is required for form submission | All |
212
- | `disabled` | `boolean` | Disables the input field if set to `true` | All |
213
- | `hidden` | `boolean` | Hides the field completely if set to `true` | All |
214
- | `autoFocus` | `boolean` | Automatically focuses the input field on form load | All |
215
- | `error` | `string` | Custom error message for the field | All |
216
- | `fill` | `"solid" \| "outline"` | Defines the fill style of the input field | All |
217
- | `labelPlacement` | `"stacked" \| "start" \| "end" \| "fixed" \| "floating"` | Determines the position of the label | All |
224
+ | Property | Type | Description | Applies To |
225
+ | ---------------- | -------------------------------------------------------- | ------------------------------------------------------- | ----------------- |
226
+ | `label` | `string` | The label displayed for the form field | All |
227
+ | `placeholder` | `string` | Placeholder text for the input field | Text-based inputs |
228
+ | `required` | `boolean` | Determines if the field is required for form submission | All |
229
+ | `disabled` | `boolean` | Disables the input field if set to `true` | All |
230
+ | `hidden` | `boolean` | Hides the field completely if set to `true` | All |
231
+ | `autoFocus` | `boolean` | Automatically focuses the input field on form load | All |
232
+ | `error` | `string` | Custom error message for the field | All |
233
+ | `fill` | `"solid" \| "outline"` | Defines the fill style of the input field | All |
234
+ | `labelPlacement` | `"stacked" \| "start" \| "end" \| "fixed" \| "floating"` | Determines the position of the label | All |
218
235
 
219
236
  #### Layout Properties
220
237
 
221
- | Property | Type | Description |
222
- |----------|------|-------------|
223
- | `grid` | `GridSize` | Specifies responsive grid sizes: `xs`, `sm`, `md`, `lg`, `xl` |
224
- | `icon` | `string` | Icon to display within the input field |
225
- | `prefix` | `string` | Text to display before the input value |
226
- | `suffix` | `string` | Text to display after the input value |
238
+ | Property | Type | Description |
239
+ | -------- | ---------- | ------------------------------------------------------------- |
240
+ | `grid` | `GridSize` | Specifies responsive grid sizes: `xs`, `sm`, `md`, `lg`, `xl` |
241
+ | `icon` | `string` | Icon to display within the input field |
242
+ | `prefix` | `string` | Text to display before the input value |
243
+ | `suffix` | `string` | Text to display after the input value |
227
244
 
228
245
  #### Validation and Dynamic Behavior
229
246
 
230
- | Property | Type | Description |
231
- |----------|------|-------------|
232
- | `validation` | `FormValidator` | Custom validation function: `(value: FormValue, schema?: FormSchema) => Promise<Array<string> \| null> \| Array<string> \| null>` |
233
- | `condition` | `Function` | Function to determine if field should be rendered: `(data: FormData, computedData: ComputedData) => boolean` |
234
- | `computedValue` | `ComputedValueHandler` | Function to compute derived values: `(value: FormValue, schema: FormSchema) => Promise<any> \| any` |
235
- | `onChange` | `Function` | Function triggered on field value changes: `(value: FormValue) => FormValue` |
247
+ | Property | Type | Description |
248
+ | --------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
249
+ | `validation` | `FormValidator` | Custom validation function: `(value: FormValue, schema?: FormSchema) => Promise<Array<string> \| null> \| Array<string> \| null>` |
250
+ | `condition` | `Function` | Function to determine if field should be rendered: `(data: FormData, computedData: ComputedData) => boolean` |
251
+ | `computedValue` | `ComputedValueHandler` | Function to compute derived values: `(value: FormValue, schema: FormSchema) => Promise<any> \| any` |
252
+ | `onChange` | `Function` | Function triggered on field value changes: `(value: FormValue) => FormValue` |
236
253
 
237
254
  #### Text Input Properties
238
255
 
239
- | Property | Type | Description | Applies To |
240
- |----------|------|-------------|------------|
241
- | `minLength` | `number` | Minimum text length | Text-based inputs |
242
- | `maxLength` | `number` | Maximum text length | Text-based inputs |
243
- | `pattern` | `string` | Regular expression pattern for validation | Text-based inputs |
256
+ | Property | Type | Description | Applies To |
257
+ | ----------- | -------- | ----------------------------------------- | ----------------- |
258
+ | `minLength` | `number` | Minimum text length | Text-based inputs |
259
+ | `maxLength` | `number` | Maximum text length | Text-based inputs |
260
+ | `pattern` | `string` | Regular expression pattern for validation | Text-based inputs |
244
261
 
245
262
  #### Number Input Properties
246
263
 
247
- | Property | Type | Description |
248
- |----------|------|-------------|
249
- | `min` | `number \| string` | Minimum value |
250
- | `max` | `number \| string` | Maximum value |
264
+ | Property | Type | Description |
265
+ | -------- | ------------------ | ------------- |
266
+ | `min` | `number \| string` | Minimum value |
267
+ | `max` | `number \| string` | Maximum value |
251
268
 
252
269
  #### TextArea Properties
253
270
 
254
- | Property | Type | Description |
255
- |----------|------|-------------|
256
- | `rows` | `number` | Number of visible text lines |
257
- | `cols` | `number` | Visible width in characters |
271
+ | Property | Type | Description |
272
+ | ---------- | --------- | -------------------------------------------- |
273
+ | `rows` | `number` | Number of visible text lines |
274
+ | `cols` | `number` | Visible width in characters |
258
275
  | `autoGrow` | `boolean` | Automatic height adjustment based on content |
259
- | `counter` | `boolean` | Show character counter |
276
+ | `counter` | `boolean` | Show character counter |
260
277
 
261
278
  #### Date Input Properties
262
279
 
263
- | Property | Type | Description |
264
- |----------|------|-------------|
265
- | `pattern` | `string` | Date format pattern (e.g., "DD/MMM/YYYY") |
280
+ | Property | Type | Description |
281
+ | ------------ | --------- | ------------------------------------------- |
282
+ | `pattern` | `string` | Date format pattern (e.g., "DD/MMM/YYYY") |
266
283
  | `enableTime` | `boolean` | Enable time picker alongside date selection |
267
284
 
268
285
  #### Select Input Properties
269
286
 
270
- | Property | Type | Description |
271
- |----------|------|-------------|
272
- | `options` | `FormOptions` | Array of options or function returning options |
273
- | `multiple` | `boolean` | Allow multiple selections |
274
- | `interface` | `"popover" \| "action-sheet" \| "alert"` | How select options are displayed |
275
- | `optionsPlacement` | `"top" \| "bottom"` | Position of popover options list |
287
+ | Property | Type | Description |
288
+ | ------------------ | ---------------------------------------- | ---------------------------------------------- |
289
+ | `options` | `FormOptions` | Array of options or function returning options |
290
+ | `multiple` | `boolean` | Allow multiple selections |
291
+ | `interface` | `"popover" \| "action-sheet" \| "alert"` | How select options are displayed |
292
+ | `optionsPlacement` | `"top" \| "bottom"` | Position of popover options list |
276
293
 
277
294
  #### RepeatInput Properties
278
295
 
279
- | Property | Type | Description |
280
- |----------|------|-------------|
296
+ | Property | Type | Description |
297
+ | ---------- | ------------ | ------------------------------------- |
281
298
  | `children` | `FormSchema` | Schema for the repeatable field group |
282
299
 
283
300
  ### Form Events
284
301
 
285
- | Event | Description | Signature |
286
- |-------|-------------|-----------|
302
+ | Event | Description | Signature |
303
+ | -------- | ---------------------------------------------------------------- | -------------------------------------------------------------- |
287
304
  | `submit` | Emitted when the form is submitted successfully after validation | `(formData: FormData, computedFormData: ComputedData) => void` |
288
- | `clear` | Emitted when the form fields are cleared to their initial state | `() => void` |
289
- | `cancel` | Emitted when the form submission is canceled, resetting fields | `() => void` |
305
+ | `clear` | Emitted when the form fields are cleared to their initial state | `() => void` |
306
+ | `cancel` | Emitted when the form submission is canceled, resetting fields | `() => void` |
290
307
 
291
308
  ### Form Methods
292
309
 
293
310
  When accessing the VForm via a template ref, you can utilize these methods:
294
311
 
295
- | Method | Description | Return Type |
296
- |--------|-------------|-------------|
297
- | `resetForm()` | Resets all form fields to their initial state | `void` |
298
- | `isFormValid()` | Validates all form fields and returns validation state | `Promise<boolean>` |
299
- | `resolveData()` | Returns the current form data and computed data | `{ formData: FormData, computedData: ComputedData }` |
312
+ | Method | Description | Return Type |
313
+ | --------------- | ------------------------------------------------------ | ---------------------------------------------------- |
314
+ | `resetForm()` | Resets all form fields to their initial state | `void` |
315
+ | `isFormValid()` | Validates all form fields and returns validation state | `Promise<boolean>` |
316
+ | `resolveData()` | Returns the current form data and computed data | `{ formData: FormData, computedData: ComputedData }` |
300
317
 
301
318
  ### Advanced Components
302
319
 
303
320
  #### SelectInput
321
+
304
322
  The SelectInput component provides various display modes for selection options:
305
323
 
306
324
  - **Popover Interface**: Default presentation that displays options in a dropdown.
325
+
307
326
  ```js
308
327
  {
309
328
  type: 'SelectInput',
@@ -323,7 +342,6 @@ The SelectInput component provides various display modes for selection options:
323
342
  options: [...]
324
343
  }
325
344
  ```
326
-
327
345
  - **Alert Interface**: Displays options in a modal dialog.
328
346
  ```js
329
347
  {
@@ -335,6 +353,7 @@ The SelectInput component provides various display modes for selection options:
335
353
  ```
336
354
 
337
355
  #### Custom Buttons
356
+
338
357
  You can add custom action buttons to the form with the `customButtons` prop:
339
358
 
340
359
  ```js
@@ -344,12 +363,13 @@ const customButtons = [
344
363
  icon: 'save',
345
364
  fill: 'outline',
346
365
  color: 'secondary',
347
- action: () => saveDraft()
348
- }
366
+ action: () => saveDraft(),
367
+ },
349
368
  ];
350
369
  ```
351
370
 
352
371
  #### RepeatInput
372
+
353
373
  The RepeatInput component allows for creating repeatable groups of fields:
354
374
 
355
375
  ```js
@@ -374,6 +394,7 @@ The RepeatInput component allows for creating repeatable groups of fields:
374
394
  Each repeated set includes add and remove buttons, allowing the user to dynamically create or delete instances of the field group.
375
395
 
376
396
  #### Option Descriptions
397
+
377
398
  When using SelectInput or CheckboxInput, you can add descriptions to options:
378
399
 
379
400
  ```js
@@ -381,8 +402,8 @@ When using SelectInput or CheckboxInput, you can add descriptions to options:
381
402
  type: 'SelectInput',
382
403
  label: 'Subscription Plan',
383
404
  options: [
384
- {
385
- label: 'Basic',
405
+ {
406
+ label: 'Basic',
386
407
  value: 'basic',
387
408
  description: {
388
409
  text: 'Free plan with limited features',
@@ -390,8 +411,8 @@ When using SelectInput or CheckboxInput, you can add descriptions to options:
390
411
  show: 'always' // or 'onChecked' to show only when selected
391
412
  }
392
413
  },
393
- {
394
- label: 'Premium',
414
+ {
415
+ label: 'Premium',
395
416
  value: 'premium',
396
417
  description: {
397
418
  text: 'Full access to all features',
@@ -404,44 +425,48 @@ When using SelectInput or CheckboxInput, you can add descriptions to options:
404
425
  ```
405
426
 
406
427
  #### Date Pattern Formatting
428
+
407
429
  The DateInput component supports various date pattern formats:
408
430
 
409
- | Pattern | Description | Example |
410
- |---------|-------------|---------|
411
- | DD | Day of the month, two digits with leading zeros | 01 to 31 |
412
- | D | Day of the month without leading zeros | 1 to 31 |
413
- | MMM | Month name, abbreviated | Jan, Feb, Mar, etc. |
414
- | MMMM | Month name, full | January, February, etc. |
415
- | MM | Month as a number, with leading zeros | 01 to 12 |
416
- | M | Month as a number, without leading zeros | 1 to 12 |
417
- | YYYY | Year, four digits | 2025 |
418
- | YY | Year, two digits | 25 |
419
- | HH | Hour, two digits with leading zeros (24-hour) | 00 to 23 |
420
- | mm | Minutes, two digits with leading zeros | 00 to 59 |
421
- | ss | Seconds, two digits with leading zeros | 00 to 59 |
431
+ | Pattern | Description | Example |
432
+ | ------- | ----------------------------------------------- | ----------------------- |
433
+ | DD | Day of the month, two digits with leading zeros | 01 to 31 |
434
+ | D | Day of the month without leading zeros | 1 to 31 |
435
+ | MMM | Month name, abbreviated | Jan, Feb, Mar, etc. |
436
+ | MMMM | Month name, full | January, February, etc. |
437
+ | MM | Month as a number, with leading zeros | 01 to 12 |
438
+ | M | Month as a number, without leading zeros | 1 to 12 |
439
+ | YYYY | Year, four digits | 2025 |
440
+ | YY | Year, two digits | 25 |
441
+ | HH | Hour, two digits with leading zeros (24-hour) | 00 to 23 |
442
+ | mm | Minutes, two digits with leading zeros | 00 to 59 |
443
+ | ss | Seconds, two digits with leading zeros | 00 to 59 |
422
444
 
423
445
  Example: `DD/MMM/YYYY HH:mm:ss` would format as `07/Jun/2025 14:30:00`
424
446
 
425
447
  ### Form Props
426
448
 
427
- | Property | Type | Description | Default |
428
- |----------|------|-------------|---------|
429
- | `schema` | `FormSchema` | The schema object defining the form structure and field configurations | *Required* |
430
- | `showLabels` | `boolean` | Determines if labels are displayed for each field | `true` |
431
- | `showClearButton` | `boolean` | Controls the visibility of the clear/reset button | `true` |
432
- | `showCancelButton` | `boolean` | Controls the visibility of the cancel button | `true` |
433
- | `buttonPlacement` | `'start' \| 'middle' \| 'end'` | Specifies the alignment of action buttons within the form | `'start'` |
434
- | `submitButtonText` | `string` | Custom text for the submit button | `"Submit"` |
435
- | `clearButtonText` | `string` | Custom text for the clear/reset button | `"Reset"` |
436
- | `cancelButtonText` | `string` | Custom text for the cancel button | `"Cancel"` |
437
- | `hideButtons` | `boolean` | When true, hides all action buttons | `false` |
438
- | `customButtons` | `Array<CustomButton>` | Array of custom buttons to add to the form | `[]` |
449
+ | Property | Type | Description | Default |
450
+ | ------------------ | ------------------------------ | ---------------------------------------------------------------------- | ---------- |
451
+ | `schema` | `FormSchema` | The schema object defining the form structure and field configurations | _Required_ |
452
+ | `showLabels` | `boolean` | Determines if labels are displayed for each field | `true` |
453
+ | `showClearButton` | `boolean` | Controls the visibility of the clear/reset button | `true` |
454
+ | `showCancelButton` | `boolean` | Controls the visibility of the cancel button | `true` |
455
+ | `buttonPlacement` | `'start' \| 'middle' \| 'end'` | Specifies the alignment of action buttons within the form | `'start'` |
456
+ | `submitButtonText` | `string` | Custom text for the submit button | `"Submit"` |
457
+ | `clearButtonText` | `string` | Custom text for the clear/reset button | `"Reset"` |
458
+ | `cancelButtonText` | `string` | Custom text for the cancel button | `"Cancel"` |
459
+ | `hideButtons` | `boolean` | When true, hides all action buttons | `false` |
460
+ | `customButtons` | `Array<CustomButton>` | Array of custom buttons to add to the form | `[]` |
439
461
 
440
462
  ## Issue Reporting and Feedback
463
+
441
464
  If you encounter any issues or have suggestions for improvements, please feel free to report them on the [GitHub Issues page](https://github.com/uniquedj95/vform/issues). Your feedback is invaluable in helping us enhance this project.
442
465
 
443
466
  ## Contributors
467
+
444
468
  I welcome contributions from the community! If you'd like to contribute, please follow these steps:
469
+
445
470
  1. Fork the repository.
446
471
  2. Create a new branch for your feature or bug fix.
447
472
  3. Implement your changes and commit them to your branch.
@@ -454,33 +479,97 @@ Thank you to all the [contributors](https://github.com/uniquedj95/vform/graphs/c
454
479
  vForm is built with TypeScript and provides complete type definitions for all components and interfaces. Import the types to get full IntelliSense support in your IDE:
455
480
 
456
481
  ```typescript
457
- import {
458
- FormSchema,
459
- FormData,
460
- ComputedData,
461
- FormField,
482
+ import {
483
+ FormSchema,
484
+ FormData,
485
+ ComputedData,
486
+ FormField,
462
487
  Option,
463
- InputType,
488
+ InputType,
464
489
  FormValidator,
465
490
  ComputedValueHandler,
466
491
  FormOptions,
467
492
  GridSize,
468
- CustomButton
469
- } from "@uniquedj95/vform";
493
+ CustomButton,
494
+ } from '@uniquedj95/vform';
470
495
  ```
471
496
 
472
497
  When defining your form schema, you can use these types for proper type checking:
473
498
 
474
499
  ```typescript
475
- import { reactive } from "vue";
476
- import { FormSchema } from "@uniquedj95/vform";
500
+ import { reactive } from 'vue';
501
+ import { FormSchema } from '@uniquedj95/vform';
477
502
 
478
503
  const myFormSchema = reactive<FormSchema>({
479
504
  // Your form fields here with proper type checking
480
505
  });
481
506
  ```
482
507
 
508
+ ## Development
509
+
510
+ ### Setup
511
+
512
+ ```bash
513
+ # Install dependencies
514
+ npm install
515
+
516
+ # Run tests
517
+ npm run test
518
+
519
+ # Build for production
520
+ npm run build
521
+ ```
522
+
523
+ ### Quality Tools
524
+
525
+ vForm uses several tools to ensure code quality:
526
+
527
+ - **ESLint**: Enforces code style and detects potential issues
528
+
529
+ ```bash
530
+ # Run linting
531
+ npm run lint
532
+ ```
533
+
534
+ - **Prettier**: Formats code consistently
535
+
536
+ ```bash
537
+ # Format code
538
+ npm run format
539
+ ```
540
+
541
+ - **Vitest**: Runs unit tests
542
+ ```bash
543
+ # Run tests
544
+ npm run test
545
+ # Run tests with coverage report
546
+ npm run test:coverage
547
+ # Run tests in watch mode
548
+ npm run test:watch
549
+ ```
550
+
551
+ ### Versioning
552
+
553
+ vForm includes scripts to help with versioning:
554
+
555
+ ```bash
556
+ # Patch update (0.0.x)
557
+ npm run version:patch
558
+
559
+ # Minor update (0.x.0)
560
+ npm run version:minor
561
+
562
+ # Major update (x.0.0)
563
+ npm run version:major
564
+ ```
565
+
566
+ ### Continuous Integration
567
+
568
+ This project uses GitHub Actions for CI/CD:
569
+
570
+ - Pull requests trigger linting, building, and testing
571
+ - Releases are automatically published to npm
572
+
483
573
  ## License
484
574
 
485
575
  vForm is licensed under the MIT License. See the LICENSE file for more information.
486
-