11import Grid from '@material-ui/core /Grid'
2- import RawComponent from '@ docs/raw-component ';
2+ import CodeExample from '../../src/components/code-example ';
33
44import ListOfContents from '../../src/helpers/list-of-contents';
55
@@ -16,29 +16,29 @@ A item of the validate array can be:
1616
1717## Required validator
1818
19- <RawComponent source =" validators/required-validator " />
19+ <CodeExample source =" components/ validators/required-validator" mode = " preview " />
2020
2121## Length validators
2222
23- <RawComponent source =" validators/length-validators " />
23+ <CodeExample mode = " preview " source = " components/ validators/length-validators" />
2424
2525## Number value validators
2626
27- <RawComponent source =" validators/number-validator " />
27+ <CodeExample mode = " preview " source = " components/ validators/number-validator" />
2828
2929## Pattern validators
3030
31- <RawComponent source =" validators/pattern-validator " />
31+ <CodeExample mode = " preview " source = " components/ validators/pattern-validator" />
3232
3333## URL validators
3434
35- <RawComponent source =" validators/url-validator " />
35+ <CodeExample mode = " preview " source = " components/ validators/url-validator" />
3636
3737## Custom function
3838
3939As validator you can provide your custom function:
4040
41- <RawComponent source =" validators/custom-function " />
41+ <CodeExample mode = " preview " source = " components/ validators/custom-function" />
4242
4343The function takes ` value ` as an argument and should return undefined when pasess or string as an error message when fails.
4444
@@ -48,7 +48,7 @@ You can use a Async function as a validator. But it **must be first in the valid
4848
4949You can either use custom function, or custom validator from validator mapper.
5050
51- <RawComponent source =" validators/async-validator " />
51+ <CodeExample mode = " preview " source = " components/ validators/async-validator" />
5252
5353
5454Validator inputs and results are being cached so you will get immediate feedback for recurring values before the validation is actually finished.
@@ -130,13 +130,13 @@ By providing `validateOnMount` the validation will be triggered immediately afte
130130This form of validation enables you to create validation function for whole form. It is useful for some cross validation between multiple fields etc.
131131Detailed information can be found [ here] ( https://final-form.org/docs/react-final-form/examples/record-level-validation ) .
132132
133- <RawComponent source =" validators/record-level-validation " />
133+ <CodeExample mode = " preview " source = " components/ validators/record-level-validation" />
134134
135135# Overwriting default messages
136136
137137You can either specify message attribute while adding validator or override validation message of specific validator globally via Validators config.
138138
139- <RawComponent source =" validators/global-message " />
139+ <CodeExample mode = " preview " source = " components/ validators/global-message" />
140140
141141</Grid >
142142<Grid item xs ={false} md ={2} >
0 commit comments