Skip to content

Commit e43593c

Browse files
authored
Merge pull request #234 from rvsia/makeHeadersConsistent
Make headers in demo consistent
2 parents 1edf413 + cf1cbb5 commit e43593c

21 files changed

+124
-192
lines changed

packages/react-renderer-demo/src/app/pages/renderer/component-api.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import ExampleLink from '@docs/components/common/example-link';
88
<Grid container item>
99
<Grid item xs={12} md={10}>
1010

11-
### Components API
11+
# Components API
1212

13-
### Common props for all form fields
13+
# Common props for all form fields
1414

1515
There is very short list of that can be applied to every form field
1616

@@ -38,7 +38,7 @@ Others: <br/>
3838
&nbsp;&nbsp;tab/tab item <br/>
3939
&nbsp;&nbsp;wizard <br/>
4040

41-
### FormGroup wrapped components
41+
# FormGroup wrapped components
4242

4343
Basic components are wrapped in formGroup. FormGroup provides a standard API to show labels, helper texts, errors, etc.
4444

@@ -55,23 +55,23 @@ All those components provides a shared group of props:
5555
|isReadOnly|boolean|Is the field readOnly?|
5656
|initialValue|custom|There are two ways how to set initial values in the form: you can use either the <RouterLink href="/renderer/renderer-api"><Link>initialValues</Link></RouterLink> prop for the whole form or you can set the value in the schema for each field separately. For more information, please see [here](https://final-form.org/docs/react-final-form/types/FieldProps#initialvalue).|
5757

58-
#### Text field
58+
## Text field
5959

6060
|Prop|Type|Description|
6161
|----|:--:|----------:|
6262
|placeholder|node/string|A placeholder|
6363

6464
<ExampleLink to='text-field' />
6565

66-
#### Text area
66+
## Text area
6767

6868
|Prop|Type|Description|
6969
|----|:--:|----------:|
7070
|placeholder|node/string|A placeholder|
7171

7272
<ExampleLink to='textarea-field' />
7373

74-
#### Select
74+
## Select
7575

7676
|Prop|Type|Description|
7777
|----|:--:|----------:|
@@ -86,7 +86,7 @@ All those components provides a shared group of props:
8686

8787
<ExampleLink to='select-field' />
8888

89-
#### Checkbox
89+
## Checkbox
9090

9191
|Prop|Type|Description|
9292
|----|:--:|----------:|
@@ -96,15 +96,15 @@ All those components provides a shared group of props:
9696
<br />
9797
<ExampleLink to='checkbox' text='Single checkbox example'/>
9898

99-
#### Radio
99+
## Radio
100100

101101
|Prop|Type|Description|
102102
|----|:--:|----------:|
103103
|options|array|Options in format { label: 'Label', value: value }|
104104

105105
<ExampleLink to='radio' />
106106

107-
#### Switch
107+
## Switch
108108

109109
|Prop|Type|Description|
110110
|----|:--:|----------:|
@@ -113,7 +113,7 @@ All those components provides a shared group of props:
113113

114114
<ExampleLink to='switch-field' />
115115

116-
#### Datepicker
116+
## Datepicker
117117

118118
This component is using [react-day-picker](https://react-day-picker.js.org/docs/) as a base component.
119119

@@ -131,17 +131,17 @@ This component is using [react-day-picker](https://react-day-picker.js.org/docs/
131131

132132
<ExampleLink to='date-picker' />
133133

134-
#### Timepicker
134+
## Timepicker
135135

136136
|Prop|Type|Description|
137137
|----|:--:|----------:|
138138
|placeholder|node/string|A placeholder|
139139

140140
<ExampleLink to='time-picker' />
141141

142-
### Others components
142+
# Others components
143143

144-
#### Subform
144+
## Subform
145145

146146
|Prop|Type|Description|
147147
|----|:--:|----------:|
@@ -151,7 +151,7 @@ This component is using [react-day-picker](https://react-day-picker.js.org/docs/
151151

152152
<ExampleLink to='sub-form' />
153153

154-
#### Tab/tab item
154+
## Tab/tab item
155155

156156
Tab <br/>
157157

@@ -168,7 +168,7 @@ Tab item <br/>
168168

169169
<ExampleLink to='tabs' />
170170

171-
#### Wizard
171+
## Wizard
172172

173173
Wizard <br />
174174

packages/react-renderer-demo/src/app/pages/renderer/component-mapping.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import ListOfContents from '../../src/helpers/list-of-contents';
77
<Grid container item>
88
<Grid item xs={12} md={10}>
99

10-
## Introduction
10+
# Introduction
1111

1212
In order to successfully render a form via FormRenderer you need to assign component mappers. Component mapper is an object of React components,
1313
where key is a component identifier and value is the Component. The identifiers must be equivalent to `componentTypes` in your schema.
1414

1515
There are two types of component mappers required by FormRenderer: `layoutMapper` and `formFieldsMapper`.
1616

1717

18-
### LayoutMapper
18+
## LayoutMapper
1919
In layout mapper you have to define your form layout components like form wrapper, form groups etc.
2020

2121

22-
### FormFieldsMapper
22+
## FormFieldsMapper
2323
Form fields mapper defines form inputs which can mutate the form state.
2424

25-
## Creating layoutMapper
25+
# Creating layoutMapper
2626

2727
Layout mapper components define the form layout. There are several different components which you have to implement. If you don't need
2828
any special wrapper for the component, you can define it as `React.Fragment`.
@@ -46,36 +46,36 @@ Check the example below to see a simple implementation of layout components.
4646

4747
<RawComponent source="component-mapper/layout-mapper" />
4848

49-
### Layout components props
49+
## Layout components props
5050

51-
#### FormWrapper
51+
### FormWrapper
5252
|Prop|Type|Description|Value|Customizable|
5353
|----|----|-----------|-----|------------|
5454
|children|node|Content of the form||Based on form schema|
5555

56-
#### Button
56+
### Button
5757
|Prop|Type|Description|Value|Customizable|
5858
|----|----|-----------|-----|------------|
5959
|label|string|Button label|"Submit", "Cancel", "Reset"|Yes, \`buttonsLabels\` FormRenderer prop|
6060
|variant|string|Variant of button. Submit button will receive "primary" value |"primary", undefined|No|
6161
|onClick|function|Button click event handler|function|Yes, \`onSubmit\`, \`onCancel\`, \`onReset\` FormRenderer props|
6262

63-
#### ButtonGroup
63+
### ButtonGroup
6464
|Prop|Type|Description|Value|Customizable|
6565
|----|----|-----------|-----|------------|
6666
|children|node|Wrapper around form buttons||No|
6767

68-
#### Title
68+
### Title
6969
|Prop|Type|Description|Customizable|
7070
|----|----|-----------|------------|
7171
|children|node|Form title|no|
7272

73-
#### Description
73+
### Description
7474
|Prop|Type|Description|Customizable|
7575
|----|----|-----------|------------|
7676
|children|node|Form description|no|
7777

78-
## Creating formFieldsMapper
78+
# Creating formFieldsMapper
7979

8080
Form fields mapper defines components that are rendered from input schema. Each component in mapper must have an unique key,
8181
which corresponds to `componentType` in input schema. Keys names can be chosen but there are some predefined constants

packages/react-renderer-demo/src/app/pages/renderer/condition.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import Link from 'next/link';
22

3-
### Conditional fields
43
import Grid from '@material-ui/core/Grid'
54

65
import ListOfContents from '../../src/helpers/list-of-contents';
76

87
<Grid container item>
98
<Grid item xs={12} md={10}>
109

11-
## Conditional fields
10+
# Conditional fields
1211

1312
You can show a field only if it meets a condition:
1413

15-
### Schema
14+
## Schema
1615

1716
```jsx
1817
{
@@ -35,9 +34,9 @@ You can show a field only if it meets a condition:
3534

3635
`when` - is name of field where the value is stored, **always required!**
3736

38-
### Conditions
37+
## Conditions
3938

40-
#### Is
39+
### Is
4140

4241
`is` - test if the value is equal
4342

@@ -50,7 +49,7 @@ condition: {
5049
// Foo == 'Bar' => true
5150
// Foo == 'Not a Bar' => false
5251
```
53-
#### Is empty
52+
### Is empty
5453

5554
`isEmpty` - tests if the value is empty (using [lodash function](https://lodash.com/docs/4.17.11#isEmpty))
5655

@@ -70,7 +69,7 @@ condition: {
7069
// Foo = false => true
7170
// Foo = true => false
7271
```
73-
#### Is not empty
72+
### Is not empty
7473

7574
`isNotEmpty` - tests if the value is not empty (using [lodash function](https://lodash.com/docs/4.17.11#isEmpty))
7675

@@ -90,7 +89,7 @@ condition: {
9089
// Foo = true => false
9190
// Foo = true => true
9291
```
93-
#### Pattern
92+
### Pattern
9493

9594
`pattern` - tests if the value matches the pattern
9695

@@ -104,7 +103,7 @@ condition: {
104103
// Foo = 'Foo foo baar!' => true
105104
```
106105

107-
#### Not match
106+
### Not match
108107

109108
`notMatch` - reverse `is`/`pattern` condition
110109

@@ -129,7 +128,7 @@ condition: {
129128
// Foo = 'bar' => false
130129
```
131130

132-
### Clearing values
131+
## Clearing values
133132

134133
If you need to clear values after switching fields, please see <Link href="/renderer/unmounting"><a>here</a></Link>.
135134

packages/react-renderer-demo/src/app/pages/renderer/data-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import ListOfContents from '../../src/helpers/list-of-contents';
66
<Grid container item>
77
<Grid item xs={12} md={10}>
88

9-
## Introduction
9+
# Introduction
1010

1111
You can specify a type of a component by providing `dataType`, which will automatically validates the component value.
1212
Because almost everything in HTML inputs is outputed as a string, adding the `dataType` props will also cast the value to given type.
1313

14-
### Available dataTypes
14+
## Available dataTypes
1515

1616
```jsx
1717
['integer', 'float', 'number', 'boolean', 'string']

packages/react-renderer-demo/src/app/pages/renderer/development-setup.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ import ListOfContents from '../../src/helpers/list-of-contents';
55
<Grid container item>
66
<Grid item xs={12} md={10}>
77

8-
### Development setup
8+
# Development setup
99

1010
Data Driven Forms is a monorepo which uses [Lerna](https://github.com/lerna/lerna), so you can use all its commands as well.
1111

12-
#### Install
12+
## Install
1313

1414
```console
1515
yarn install
1616
```
1717

18-
#### Build
18+
## Build
1919

2020
```console
2121
yarn build
@@ -25,7 +25,7 @@ All packages are linked together by default, so if you run a `yarn build` in a p
2525

2626
Don't forget to build all packages, which are linked together!
2727

28-
#### Run a package
28+
## Run a package
2929

3030
Each package has a small playground `package/demo`, where you can test your changes.
3131

@@ -34,7 +34,7 @@ cd packages/pf3-component-mapper
3434
yarn start
3535
```
3636

37-
#### Run documentation
37+
## Run documentation
3838

3939
The documentation is a server-side rendered React application based on [NextJS framework](https://nextjs.org/).
4040

@@ -43,14 +43,14 @@ cd packages/react-renderer-demo
4343
yarn dev
4444
```
4545

46-
#### How to clean?
46+
## How to clean?
4747

4848
```console
4949
rm yarn.lock
5050
yarn lerna clean # will delete all node_modules
5151
```
5252

53-
### Tests
53+
# Tests
5454

5555
Tests needed to be run from the core folder.
5656

@@ -60,7 +60,7 @@ yarn test
6060
yarn test packages/pf3-component-mapper
6161
```
6262

63-
### Commits
63+
# Commits
6464

6565
Data Driven Forms uses [Semantic Release](https://github.com/semantic-release/commit-analyzer)
6666

@@ -83,7 +83,7 @@ Please, do not use Semantic Release, if you update only the demo.
8383

8484
All packages are releasing together and they share the version number.
8585

86-
### Changes to documentation
86+
# Changes to documentation
8787

8888
If your changes influence API or add new features, you should describe these new options in the `demo` repository. Thanks!
8989

0 commit comments

Comments
 (0)