Gathering detailed insights and metrics for formkit-builder
Gathering detailed insights and metrics for formkit-builder
Gathering detailed insights and metrics for formkit-builder
Gathering detailed insights and metrics for formkit-builder
npm install formkit-builder
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
25
Sure! Here's a template for a README file for your Formkit Builder npm package:
Formkit Builder is a Vue 3 package that provides a wrapper around Formkit forms, offering advanced features such as seamless loading handling, error management, and API calls. It simplifies the process of creating ready-to-use forms by allowing you to pass a sections object, submit handler, and form options.
To install Formkit Builder, you need to have Vue 3 and Formkit installed in your project.
1npm install formkit-builder
or
1yarn add formkit-builder
1<script setup lang="ts"> 2// import { DataCreateForm } from './components'; 3import { FormKitSection, FormKitError, FormKitOptions, FormSubmitHandler } from './types' 4 5const errorHandler: Record<string, FormKitError> = { 6 unique_constraint_roles_role_name_key: { 7 roleName: 'unique_constraint_roles_role_name_key' 8 } 9} 10const redirectRoute: string = 'roles_list' 11const sections: FormKitSection[] = [ 12 { 13 roleInfo: [ 14 { 15 $formkit: 'text', 16 outerClass: 'col-4', 17 name: 'roleName', 18 label: 'roleNameLabel', 19 placeholder: 'roleNamePlaceholder', 20 validation: 'required|length:3' 21 }, 22 { 23 $formkit: 'textarea', 24 outerClass: 'col-8', 25 name: 'roleDescription', 26 label: 'roleDescriptionLabel', 27 placeholder: 'roleDescriptionPlaceholder', 28 validation: '' 29 } 30 ] 31 } 32] 33const options: FormKitOptions = { 34 title: 'role_create', 35 allowBulkDelete: true 36} 37const submitHandler: FormSubmitHandler<any, any, any> = { 38 submit: (req: any) => { 39 console.log(req) 40 return new Promise(async (resolve) => { 41 resolve(null) 42 }) 43 }, 44 errorHandler, 45 redirectRoute 46} 47</script> 48 49<template> 50 <data-create-form :sections="sections" :submitHandler="submitHandler" :options="options" /> 51</template>
1<script setup lang="ts"> 2import type { FormKitSection, FormKitError, FormKitOptions, FormSubmitHandler, FormFindDataHandler } from '@/types' 3import type { RoleUpdateRequest, RoleUpdateResponse, RoleFindRequest, RoleFindResponse } from '@/api/ApiTypes'; 4import apiClient from '@/api/ApiMock'; 5import { useI18n } from 'vue-i18n'; 6 7const { t } = useI18n() 8const errorHandler: Record<string, FormKitError> = { 9 'unique_constraint_roles_role_name_key': { 10 roleName: 'unique_constraint_roles_role_name_key' 11 } 12} 13const redirectRoute: string = 'list' 14const sections: FormKitSection[] = [ 15 { 16 roleInfo: [ 17 { 18 $formkit: 'text', 19 outerClass: "col-4", 20 name: 'roleName', 21 label: t('roleNameLabel'), 22 placeholder: t('roleNamePlaceholder'), 23 validation: 'required|length:3', 24 25 }, 26 { 27 $formkit: 'textarea', 28 outerClass: "col-8", 29 name: 'roleDescription', 30 label: t('roleDescriptionLabel'), 31 placeholder: t('roleDescriptionPlaceholder'), 32 validation: '', 33 }, 34 ], 35 }, 36] 37const options: FormKitOptions = { 38 title: "role_Update", 39 allowBulkDelete: false, 40} 41const submitHandler: FormSubmitHandler<RoleUpdateRequest, RoleUpdateRequest, RoleUpdateResponse> = { 42 submit: apiClient.roleUpdateWithGlobalErr, 43 errorHandler, 44 redirectRoute, 45} 46const findDataHandler: FormFindDataHandler<RoleFindRequest, RoleFindResponse, any> = { 47 findData: apiClient.roleFind, 48 findRequerPropertyName: 'roleId', 49} 50 51</script> 52 53<template> 54 <data-update-form :sections="sections" :findDataHandler="findDataHandler" :submitHandler="submitHandler" 55 :options="options" /> 56</template>
For detailed usage instructions and documentation, please visit the Formkit Builder Documentation.
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue on the GitHub repository.
This package is open source and available under the MIT License.
Formkit Builder is built upon the excellent Formkit library developed by Author's Name. We would like to extend our gratitude to the Formkit team for their amazing work.
Feel free to customize the template to fit your package and add more details as needed. Include sections such as Installation, Usage, Documentation, Contributing, License, and Acknowledgements to provide comprehensive information about your package.
No vulnerabilities found.
No security vulnerabilities found.