0.5.1 • Published 1 year ago
@novin-dev/formalite v0.5.1
Formalite
Generate MUI form with few line of code
Website Link
Documents Link
Install
npm i --save @novin-dev/formalite
Usage
a simple from widh one textView
import React, { useMemo } from "react";
import * as Yup from "yup";
import {
Formalite,
ViewTypes,
useFormaliteRef
} from "@novin-dev/formalite";
import type { MainType } from "@novin-dev/formalite";
const validation = Yup.object({
title: Yup.string().required(),
});
type ValidationType = Yup.InferType<typeof validation>;
const iniValues: ValidationType = {
title: "123",
};
export const TextView = () => {
const formRef = useFormaliteRef<ValidationType>();
const formString = useMemo<MainType>(() => {
return {
title: {
type: ViewTypes.TextView,
layoutProps: {
md: 6,
xs: 12,
},
mustRegex:
/^([1-9]d*(.)d{1,4}|0?(.)d*[1-9]d*|0?|[1-9]d*|[1-9]d*(.))$/,
inputProps: {
label: "Title Input",
helperText: "Helper text",
placeholder: "some other title",
onChange: (value) => {
console.log(value);
},
},
},
};
}, []);
return (
<Formalite<ValidationType>
lang="en"
formString={formString}
initialValues={iniValues}
validationSchema={validation}
formRef={formRef}
onSubmit={(values) => {
console.log(values);
}}
/>
);
};
0.5.0
1 year ago
0.5.1
1 year ago
0.4.1
1 year ago
0.4.3
1 year ago
0.4.2
1 year ago
0.4.0
1 year ago
0.3.1
1 year ago
0.1.10
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.9
2 years ago
0.2.3
2 years ago
0.1.4
2 years ago
0.2.2
2 years ago
0.1.6
2 years ago
0.2.4
2 years ago
0.1.5
2 years ago
0.1.3
2 years ago
0.1.0
2 years ago
0.0.10
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.2.7
2 years ago