Gathering detailed insights and metrics for react-form-model-controller
Gathering detailed insights and metrics for react-form-model-controller
Gathering detailed insights and metrics for react-form-model-controller
Gathering detailed insights and metrics for react-form-model-controller
Enhances productivity with TypeScript IDE support, simplifies data serialization/deserialization and validation.
npm install react-form-model-controller
Typescript
Module System
Node Version
NPM Version
61.8
Supply Chain
89.1
Quality
81
Maintenance
50
Vulnerability
98.2
License
TypeScript (93.64%)
Shell (4.23%)
JavaScript (2.13%)
Total Downloads
737
Last Day
1
Last Week
5
Last Month
28
Last Year
737
1 Stars
53 Commits
1 Watching
8 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
0.0.9
Package Id
react-form-model-controller@0.0.9
Unpacked Size
130.86 kB
Size
36.54 kB
File Count
27
NPM Version
10.7.0
Node Version
18.20.3
Publised On
07 Jul 2024
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-58.3%
5
Compared to previous week
Last month
154.5%
28
Compared to previous month
Last year
0%
737
Compared to previous year
8
18
Boosts productivity through TypeScript IDE support, streamlines data serialization/deserialization and validation, and offers customizable UI with render props for seamless server communication. A class model-based React form system utilizing decorators and metadata reflection.
This form system enhances productivity with TypeScript IDE support, simplifies data serialization/deserialization and validation, and provides customizable UI with render props for seamless server communication.
npm install react-form-model-controller
yarn add react-form-model-controller
pnpm add react-form-model-controller
Define model and create hook.
Use created hook in your component.
Target | Description | Type | Required |
---|---|---|---|
name | Name of the field defined in the model | string | required |
refValues | Fields that will trigger re-rendering and are included in the values | Array<keyof TFormModel> | optional |
validator | Function to validate the field | (value: T) => string | null | undefined | optional |
validateOnMount | Whether to validate the field when it is mounted | boolean | optional |
Target | Description | Type |
---|---|---|
value | Value of the field | TValue |
values | Values of the fields passed in refValues | Partial<TFormModel> |
error | Error message | string | undefined | null |
fieldHandler | Handler for the field corresponding to the Field component | (TValue) => void |
getFieldHandler | Getter for a specific field handler | (key: TKey, value: TFormModel[TKey]) => void |
getComplexFieldHandler | Getter for a handler used in complex field settings | (key: TKey, path: string (inferred by TypeScript), value: TValue) => void |
Target | Description | Type |
---|---|---|
setValue | Update the value of a specific field | (key: TKey, value: TFormModel[TKey]) => void |
setValues | Update the entire model | (values: TFormModel) => void |
validate | Validate a specific field | (key: TKey) => boolean |
validateAll | Validate all fields | (key: TKey, value: TFormModel[TKey]) => boolean |
undo | Undo the form update (experimental) | () => void |
reset | Reset the form | () => void |
read | Fetch data from the server, convert to the model, and set the form | (data: DataResponse) => void |
write | Convert model data to the interface expected by the server | () => WriteResult(server expected data) |
No vulnerabilities found.
No security vulnerabilities found.