Skip to content

Commit e5a1220

Browse files
committed
Populate new documentation files
1 parent bab0b9c commit e5a1220

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+934
-721
lines changed

packages/react-renderer-demo/src/components/navigation/schemas/mappers.schema.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ const mappersSchema = [
88
linkText: 'Custom mapper',
99
link: 'custom-mapper'
1010
},
11+
{
12+
linkText: 'Global component props',
13+
link: 'global-component-props'
14+
},
15+
{
16+
linkText: 'File input',
17+
link: 'file-input'
18+
},
19+
{
20+
linkText: 'Common components API',
21+
link: 'component-api'
22+
},
23+
{
24+
subHeader: true,
25+
noRoute: true,
26+
title: 'Provided mappers'
27+
},
1128
{
1229
link: 'blueprint-component-mapper',
1330
linkText: 'Blueprint mapper'

packages/react-renderer-demo/src/components/navigation/schemas/schema.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import schemaHooks from './hooks.schema';
66
import mappersSchema from './mappers.schema';
77

88
const schema = [
9+
{
10+
link: 'introduction',
11+
linkText: 'Introduction'
12+
},
913
{
1014
linkText: 'Installation',
1115
link: 'installation'
@@ -54,7 +58,7 @@ const schema = [
5458
},
5559
{
5660
linkText: 'Development setup',
57-
link: 'dev-setup'
61+
link: 'development-setup'
5862
},
5963
{
6064
linkText: 'Releases',

packages/react-renderer-demo/src/components/navigation/schemas/schema.schema.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const schemaNav = [
2121
linkText: 'Initialize on mount'
2222
},
2323
{
24-
component: 'validate-on-mount',
25-
linkText: 'Validate on mount'
24+
component: 'data-types',
25+
linkText: 'Data types'
2626
},
2727
{
2828
subHeader: true,
@@ -35,11 +35,11 @@ const schemaNav = [
3535
},
3636
{
3737
component: 'length-validator',
38-
linkText: 'Lenght validator'
38+
linkText: 'Length validator'
3939
},
4040
{
41-
component: 'Number value validator',
42-
linkText: 'number-value-validator'
41+
linkText: 'Number value validator',
42+
component: 'number-value-validator'
4343
},
4444
{
4545
component: 'pattern-validator',
@@ -110,17 +110,17 @@ const schemaNav = [
110110
component: 'pattern',
111111
linkText: 'Pattern'
112112
},
113-
{
114-
component: 'clearing-condition-field',
115-
linkText: 'Clearing conditional field' // clearing-value
116-
},
117113
{
118114
component: 'condition-nesting',
119-
linkText: 'Condition nesting' // nesting
115+
linkText: 'Condition nesting'
120116
},
121117
{
122118
component: 'condition-sequence',
123-
linkText: 'Condition sequence' // condition sequence
119+
linkText: 'Condition sequence'
120+
},
121+
{
122+
component: 'condition-actions',
123+
linkText: 'Conditional actions'
124124
},
125125
{
126126
component: 'condition-set',
@@ -131,7 +131,7 @@ const schemaNav = [
131131
linkText: 'Conditional visibility'
132132
},
133133
{
134-
component: 'Complex-condition-example',
134+
component: 'complex-condition-example',
135135
linkText: 'Conplex condition example'
136136
},
137137
{

packages/react-renderer-demo/src/pages/renderer/dynamic-fields.md renamed to packages/react-renderer-demo/src/pages/components/field-array.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ import DocPage from '@docs/doc-page';
33

44
<DocPage>
55

6+
# FieldArray
7+
8+
[React Final Form Array](https://github.com/final-form/react-final-form-arrays) is exported via Data Driven Forms.
9+
10+
```jsx
11+
import { FieldArray } from '@data-driven-forms/react-form-renderer';
12+
```
13+
614
# Dynamic fields
715

816
Dynamic fields allow you to add or remove field inputs in your forms. In Data Driven Forms, Field Array is used to provide this functionality. Simillarly to [FieldProvider](/renderer/field-provider) Data driven forms include [React Final Form Arrays](https://github.com/final-form/react-final-form-arrays). Please visit their documentation to learn more about the functionality and implementation.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import DocPage from '@docs/doc-page';
2+
import InputMeta from '../input-meta.md';
3+
4+
<DocPage>
5+
6+
# Field provider
7+
8+
React form renderer is using [react-final-form](https://github.com/final-form/react-final-form) for form state management.
9+
Most of its features are not directly available for consistency and performance reasons. If you want to create any custom
10+
components, you can access these features via `FieldProvider` component or `useFieldApi` hook.
11+
12+
`FieldProvider` is a wrapper using `useFieldApi` to get the access to the form state.
13+
14+
`useFieldApi` is a wrapper around [React Final Form useField hook](https://final-form.org/docs/react-final-form/api/useField).
15+
16+
You can read more about that in [Component mapping](/renderer/component-mapping).
17+
18+
## Implementation of component
19+
20+
Next example shows simple input field with label and error message.
21+
22+
```jsx
23+
import React from 'react';
24+
import { useFieldApi } from '@data-driven-forms/react-form-renderer'
25+
26+
const NewComponent = (props) => {
27+
const { input, meta } = useFieldApi(props);
28+
29+
return (
30+
<div>
31+
<label>{props.label}</label>
32+
<input {...input} />
33+
{meta.error && <label>{meta.error}</label>}
34+
</div>
35+
)
36+
}
37+
38+
export default NewComponent
39+
```
40+
41+
<InputMeta />
42+
43+
</DocPage>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import DocPage from '@docs/doc-page';
2+
3+
<DocPage>
4+
5+
# FormSpy
6+
7+
[FormSpy](https://final-form.org/docs/react-final-form/api/FormSpy) is exported via Data Driven Forms.
8+
9+
```jsx
10+
import { FormSpy } from '@data-driven-forms/react-form-renderer';
11+
```
12+
13+
</DocPage>
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import DocPage from '@docs/doc-page';
2+
3+
<DocPage>
4+
5+
# Form
6+
7+
For testing purposes, you can also import React Final Form's `Form` component.
8+
9+
```jsx
10+
import { Form } from '@data-driven-forms/react-form-renderer';
11+
```
12+
13+
</DocPage>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)