Skip to content

Commit f082f20

Browse files
committed
Added docs for plain text component.
1 parent 605e72a commit f082f20

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

packages/react-renderer-demo/src/common/example-common.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { CopyToClipboard } from 'react-copy-to-clipboard';
2929
import MuiWizzard from '../demo-missing-fields/mui-wizzard/wizzard';
3030
import IconButton from '@material-ui/core/IconButton';
3131
import CloseIcon from '@material-ui/icons/Close';
32+
import TextareaAutosize from '@material-ui/core/TextareaAutosize'
3233

3334
import CodeEditor from './component/code-editor';
3435

@@ -240,6 +241,22 @@ class ComponentExample extends Component {
240241
);
241242
}
242243

244+
if (component === 'textarea'){
245+
return (
246+
<Grid item xs={ 12 } key={ name }>
247+
<TextField
248+
id={ name }
249+
label={ title }
250+
value={ this.state.variants[index].value || '' }
251+
onChange={ ({ target: { value }}) => this.handleExampleVariantChange(value, index) }
252+
margin="normal"
253+
fullWidth
254+
multiline
255+
/>
256+
</Grid>
257+
);
258+
}
259+
243260
return (
244261
<Grid item xs={ 12 } key={ name }>
245262
<FormGroup >

packages/react-renderer-demo/src/common/examples-definitions.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,25 @@ export const baseExamples = [{
349349
component: 'input',
350350
value: 'Checkbox',
351351
}],
352+
}, {
353+
component: componentTypes.PLAIN_TEXT,
354+
linkText: 'Plain Text',
355+
ContentText: GenericComponentText,
356+
variants: [{
357+
name: 'label',
358+
title: 'Label',
359+
component: 'textarea',
360+
value: `Lorem ipsum sem velit. Mauris scelerisque tortor sed lorem dapibus, bibendum scelerisque ligula consequat. Quisque fringilla luctus.
361+
Vestibulum vulputate inceptos himenaeos.`,
362+
}],
363+
value: {
364+
fields: [{
365+
component: componentTypes.PLAIN_TEXT,
366+
name: 'plain-text-component',
367+
label: `Lorem ipsum sem velit. Mauris scelerisque tortor sed lorem dapibus, bibendum scelerisque ligula consequat. Quisque fringilla luctus.
368+
Vestibulum vulputate inceptos himenaeos.`,
369+
}],
370+
},
352371
}, {
353372
component: componentTypes.WIZARD,
354373
linkText: 'Wizard',

0 commit comments

Comments
 (0)