Skip to content

Commit 67a702d

Browse files
committed
Add documentation for Ant Wizard in the mappers section
1 parent cf62f49 commit 67a702d

File tree

4 files changed

+61
-1
lines changed

4 files changed

+61
-1
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import CommonWizard from '../wizard.md';
2+
3+
This a custom component. OnSubmit will send only values from visited steps.
4+
5+
**Props**
6+
7+
|Prop|Type|Default|Description|
8+
|-------------|-------------|-------------|-------------|
9+
|buttonLabels|object of nodes | see below | Labels for buttons |
10+
|stepsInfo|array of objects| [] | Titles for steps |
11+
|WizardProps | object | {} | Props passed to the root div |
12+
|ButtonToolbarProps | object | {} | Props passed to the div wrapping buttons |
13+
|DirectionButtonProps | object | {} | Props passed to the div wrapping back/next buttons |
14+
|CancelButtonProps| object | {} | Props passed to the cancel button |
15+
|BackButtonProps| object | {} | Props passed to the back button |
16+
|NextButtonProps| object | {} | Props passed to the next button |
17+
|SubmitButtonProps| object | {} | Props passed to the submit button |
18+
19+
**stepsInfo**
20+
21+
```jsx
22+
stepsInfo: [
23+
{ title: 'Add a source', subTitle: 'Source' },
24+
{ title: 'Configure a source' },
25+
{ title: 'Summary' }
26+
]
27+
```
28+
29+
Supplying `stepsInfo` will create a steps component on top of the form displaying each step title and allowing for easy navigation. It should be an array of objects, one per step.
30+
31+
The object items will be passed as props to a step component. See [here](https://ant.design/components/steps/#Steps.Step).
32+
33+
**Default buttonLabels**
34+
35+
```jsx
36+
{
37+
cancel: 'Cancel',
38+
back: 'Back',
39+
next: 'Next',
40+
submit: 'Submit',
41+
}
42+
```
43+
44+
You can rewrite only selection of them, e.g.
45+
46+
```jsx
47+
{
48+
submit: 'Deploy',
49+
}
50+
```
51+
52+
(Others will stay default)
53+
54+
<CommonWizard />

packages/react-renderer-demo/src/doc-components/field-array.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import SuirFieldArray from './examples-texts/suir/suir-field-array.md';
77
import BlueprintFieldArray from './examples-texts/blueprint/blueprint-field-array.md';
88
import GenericMuiComponent from '../helpers/generic-mui-component';
99
import AntFieldArray from './examples-texts/ant/ant-field-array.md';
10+
1011
const FieldArray = ({ activeMapper }) => {
1112
if (activeMapper === 'mui') {
1213
return <MuiFieldArray />;

packages/react-renderer-demo/src/doc-components/wizard.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import MuiWizard from './examples-texts/mui/mui-wizard.md';
44
import Pf4Wizard from './examples-texts/pf4/pf4-wizard.md';
55
import Pf3Wizard from './examples-texts/pf3/pf3-wizard.md';
66
import SuirWizard from './examples-texts/suir/suir-wizard.md';
7+
import AntWizard from './examples-texts/ant/ant-wizard.md'
78
import BlueprintWizard from './examples-texts/blueprint/blueprint-wizard.md';
89
import GenericMuiComponent from '../helpers/generic-mui-component';
910

@@ -28,6 +29,10 @@ const Wizard = ({ activeMapper }) => {
2829
return <BlueprintWizard />;
2930
}
3031

32+
if (activeMapper === 'ant') {
33+
return <AntWizard />;
34+
}
35+
3136
return <GenericMuiComponent activeMapper={activeMapper} component="wizard" />;
3237
};
3338

packages/react-renderer-demo/src/helpers/generic-mui-component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const mapperLinks = {
5454
[componentTypes.TABS]: 'tabs',
5555
[componentTypes.DATE_PICKER]: 'date-picker',
5656
[componentTypes.TIME_PICKER]: 'time-picker',
57-
[componentTypes.WIZARD]: 'steps',
57+
[componentTypes.WIZARD]: '',
5858
[componentTypes.SWITCH]: 'switch',
5959
[componentTypes.TEXTAREA]: 'input/#Input.TextArea',
6060
[componentTypes.SELECT]: 'select',

0 commit comments

Comments
 (0)