1414 <img src =" https://img.shields.io/bundlephobia/min/@agile-ts/multieditor.svg " alt =" npm minified size " /></a >
1515
1616
17- ## ⏰ Short Example
17+ ## 👀 Example
1818``` ts
19- // Let's create our MultiEditor
20- const multiEditor = new MultiEditor (editor => ({
19+ // Create Multieditior
20+ const multiEditor = createMultieditor (editor => ({
2121 data: {
22- id: " myId" , // Inital Id
22+ id: " myId" , // Initial Id
2323 email: undefined , // Inital Email
24- key : undefined , // Inital Name
24+ name : undefined , // Inital Name
2525 },
2626 onSubmit : async (data ) => {
27- console .log (" Submitted " , data ); // <-------------------------------------------
28- }, // |
29- fixedProperties: [" id" ], // Properties that always get passed as data into the onSubmit function
27+ console .log (" Submitted " , data ); // <---------------------------------------------
28+ }, // |
29+ fixedProperties: [" id" ], // Properties that are always passed to the ' onSubmit()' method
3030 validateMethods: {
31- email: editor . Validator (). string (). email (). required () , // Email is requiered, a string and follows the Email regex
32- key: editor . Validator () .string ().max (10 ).min (2 ).required (), // Name is required, a string, has to be shorter than 10 and longer than 2 chars
31+ email: agileResolver ( isString , isEmail , isRequired ) , // Validation with tree shakable validation methods
32+ name: yupResolver ( Yup .string ().max (10 ).min (2 ).required ()) , // Validation with external validatiors like Yup
3333 },
34- editableProperties: [" email" , " key " ], // Properties that can be edited
34+ editableProperties: [" email" , " name " ], // Properties that can be edited
3535}));
3636
37- // Lets update the requiered properties to validate the Editor
37+ // Update Multieditor values in the UI-Form
3838multiEditor .setValue (" email" , " test@test.com" );
39- multiEditor .setValue (" key " , " Jeff" );
39+ multiEditor .setValue (" name " , " Jeff" );
4040
41- // Now we can submit the Editor and see what the onSubmit will log
41+ // Submit Multieditor and see what the ' onSubmit()' method will log
4242multiEditor .submit ();
4343// Submited {
4444// id: "myId",
45- // key : "Jeff",
45+ // name : "Jeff",
4646// email: "test@test.com"
4747// }
4848```
49- _ Do you want to see it in action? Click [ here] ( https://codesandbox.io/s/multieditor-yxt4x ) ._
5049
50+ ### ⛳️ Sandbox
51+ Test the Multieditor yourself in a [ codesandbox] ( https://codesandbox.io/s/multieditor-yxt4x ) .
52+ It's only one click away. Just select your preferred Framework below.
5153
52- ## ❓ Why Agile MultiEditor
54+ - [ React ] ( https://codesandbox.io/s/multieditor-yxt4x )
5355
54- #### 🚅 Straightforward
55- Write minimalistic, boilerplate free code that captures your intent. <br />
56- ** For instance**
57- - Simple Validation
58- ``` ts
59- // Email is requiered, a string and follows the Email regex
60- EDITOR .Validator ().string ().email ().required ()
61- ```
62- - Compute Value
63- ``` ts
64- // Force Name to be lowercase
65- key : (value ) => {
66- return value .toLowerCase ();
67- }
68- ```
56+ More examples can be found in the [ Example section] ( https://agile-ts.org/docs/examples ) .
6957
7058
71- #### 🎯 Easy to Use
72- Learn the powerful and simple tools of Agile MultiEditor in a short amount of time.
59+ ## ❓ Why Multieditor
7360
61+ #### 🚅 Straightforward
62+ Write minimalistic, boilerplate-free code that captures your intent.
63+ ``` ts
64+ // Simple and tree shakable inbuilt validation
65+ agileResolver (isRequired , isString (' custom error message' ), isEmail );
66+
67+ // Easy integration with external validation libraries like Yup
68+ yupResolver (Yup .string ().email ());
69+
70+ // Easy value compution
71+ computeMethods : {
72+ name : (value ) => {
73+ return value .toLowerCase ();
74+ }
75+ }
76+ ```
7477
75- #### 🍃 Lightweight
76- Agile Api has an unpacked size of [ 14.1kB] ( https://bundlephobia.com/result?p=@agile-ts/multieditor@0.0.6 )
77- and [ 0 external dependencies] ( https://www.npmjs.com/package/@agile-ts/multieditor ) .
78+ ### 🤸 Flexible
79+ - Works in nearly any UI-Framework (currently supported are [ React] ( https://reactjs.org/ ) , [ React-Native] ( https://reactnative.dev/ ) and [ Vue] ( https://vuejs.org/ ) ).
80+ - Surly behaves with the workflow that suits you best.
81+ - Has ** 0** external dependencies.
82+
83+ ### ⚡️ Fast
84+ Minimizes the number of re-renders
85+ and validate computation.
7886
7987
8088## ⬇️ Installation
@@ -88,10 +96,33 @@ Therefore, we have created a table which shows which versions fit together witho
8896
8997| @agile-ts/multieditor | @agile-ts/core | NPM Version |
9098| ----------------------| ----------------------- | ------------------------ |
91- | v0.0.7 + | v0.0.7 + | v6+ |
92- | v0.0.6 | v0.0.3 - v0.0.6 | v6+ |
99+ | v0.0.22 + | v0.2.5 + | v6+ |
100+
93101_ Other Versions aren't supported anymore_
94102
95103
96104## 📄 Documentation
97- The Agile MultiEditor Docs are located [ here] ( https://agile-ts.org/docs/ )
105+ Does the Multieditor sound interesting to you?
106+ Take a look at our ** [ documentation] ( https://agile-ts.org/docs/introduction ) ** ,
107+ to learn more about its functionalities and capabilities.
108+ If you have any further questions,
109+ feel free to join our [ Community Discord] ( https://discord.gg/T9GzreAwPH ) .
110+ We will be happy to help you.
111+
112+
113+ ## 👨💻 Contribute
114+ Get a part of AgileTs and start contributing. We welcome any meaningful contribution. 😀
115+ To find out more about contributing, check out the [ CONTRIBUTING.md] ( https://github.com/agile-ts/agile/blob/master/CONTRIBUTING.md ) .
116+
117+ <a href =" https://codeclimate.com/github/agile-ts/agile/coverage.svg " >
118+ <img src =" https://codeclimate.com/github/agile-ts/agile/badges/gpa.svg " alt =" Maintainability " />
119+ </a >
120+
121+ ### ♥️ Contributors
122+
123+ <a href =" https://github.com/agile-ts/agile/graphs/contributors " >
124+ <img src =" https://contrib.rocks/image?repo=agile-ts/agile " />
125+ </a >
126+
127+ [ Become a contributor] ( https://github.com/agile-ts/agile/blob/master/CONTRIBUTING.md )
128+
0 commit comments