File tree Expand file tree Collapse file tree 6 files changed +32
-20
lines changed Expand file tree Collapse file tree 6 files changed +32
-20
lines changed Original file line number Diff line number Diff line change 4545 "dependencies" : {
4646 "@material-ui/core" : " ^3.5.1" ,
4747 "@material-ui/icons" : " ^3.0.1" ,
48+ "@material-ui/lab" : " ^3.0.0-alpha.25" ,
4849 "ajv" : " ^5.2.3" ,
4950 "babel-runtime" : " ^6.26.0" ,
5051 "core-js" : " ^2.5.7" ,
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ function DefaultArrayItem(props) {
4444 fontWeight : "bold" ,
4545 } ;
4646 return (
47- < Grid container spacing = "12" key = { props . index } >
47+ < Grid container spacing = { 16 } key = { props . index } >
4848 < Grid item xs = { props . hasToolbar ? 9 : 12 } >
4949 { props . children }
5050 </ Grid >
@@ -154,15 +154,15 @@ function DefaultNormalArrayFieldTemplate(props) {
154154
155155 < Grid
156156 container
157- spacing = { 12 }
157+ spacing = { 16 }
158158 className = "array-item-list"
159159 key = { `array-item-list-${ props . idSchema . $id } ` } >
160160 { props . items && props . items . map ( p => DefaultArrayItem ( p ) ) }
161161
162162 { props . canAdd && (
163163 < React . Fragment >
164- < Grid item xs = "10" />
165- < Grid item xs = "2" >
164+ < Grid item xs = { 10 } />
165+ < Grid item xs = { 2 } >
166166 < AddButton
167167 className = "array-item-add"
168168 onClick = { props . onAddClick }
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export default function DefaultTemplate(props) {
3333 let map = {
3434 textarea : true ,
3535 checkboxes : true ,
36+ range : true ,
3637 } ;
3738 console . log ( "mapped" , map [ l ] ) ;
3839 return ! map [ l ] ;
Original file line number Diff line number Diff line change @@ -9,11 +9,10 @@ import mui_fields from "./fields";
99import mui_widgets from "./widgets" ;
1010
1111export default class MuiForm extends Form {
12- constructor ( props ) {
13- let newProps = { ...props } ;
14- super ( newProps ) ;
15- this . props . ErrorList = ErrorList ;
16- }
12+ static defaultProps = {
13+ ErrorList : ErrorList ,
14+ ...Form . defaultProps ,
15+ } ;
1716
1817 getRegistry ( ) {
1918 const { fields, widgets } = getDefaultRegistry ( ) ;
Original file line number Diff line number Diff line change 11import React from "react" ;
22import PropTypes from "prop-types" ;
3+ import { Slider } from "@material-ui/lab" ;
4+ import { Grid , Typography } from "@material-ui/core" ;
35
46import { rangeSpec } from "react-jsonschema-form/lib/utils" ;
57
68function RangeWidget ( props ) {
7- const {
8- schema,
9- value,
10- registry : {
11- widgets : { BaseInput } ,
12- } ,
13- } = props ;
9+ const { schema, value } = props ;
10+
1411 return (
15- < div className = "field-range-wrapper" >
16- < BaseInput type = "range" { ...props } { ...rangeSpec ( schema ) } />
17- < span className = "range-view" > { value } </ span >
18- </ div >
12+ < Grid container style = { { paddingTop : "12px" } } >
13+ < Grid item xs = { 11 } >
14+ < Slider value = { value } { ...props } { ...rangeSpec ( schema ) } />
15+ </ Grid >
16+ < Grid item xs = { 1 } >
17+ < Typography > { value } </ Typography >
18+ </ Grid >
19+ </ Grid >
1920 ) ;
2021}
2122
You can’t perform that action at this time.
0 commit comments