This repository was archived by the owner on May 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +25
-54
lines changed Expand file tree Collapse file tree 7 files changed +25
-54
lines changed Original file line number Diff line number Diff line change @@ -8,22 +8,18 @@ export default class DatBoolean extends Component {
8
8
static propTypes = {
9
9
className : PropTypes . string ,
10
10
style : PropTypes . object ,
11
- data : PropTypes . object ,
11
+ data : PropTypes . object . isRequired ,
12
12
path : PropTypes . string ,
13
13
label : PropTypes . string ,
14
14
labelWidth : PropTypes . string . isRequired ,
15
- onUpdate : PropTypes . func ,
16
- _onUpdateValue : PropTypes . func
15
+ _onUpdateValue : PropTypes . func . isRequired
17
16
} ;
18
17
19
18
static defaultProps = {
20
19
className : null ,
21
20
style : null ,
22
- data : null ,
23
21
path : null ,
24
- label : null ,
25
- onUpdate : ( ) => null ,
26
- _onUpdateValue : ( ) => null
22
+ label : null
27
23
} ;
28
24
29
25
constructor ( props ) {
@@ -46,10 +42,9 @@ export default class DatBoolean extends Component {
46
42
47
43
handleChange = event => {
48
44
const value = event . target . checked ;
49
- const { onUpdate , _onUpdateValue, path } = this . props ;
45
+ const { _onUpdateValue, path } = this . props ;
50
46
51
47
_onUpdateValue ( path , value ) ;
52
- onUpdate ( value ) ;
53
48
} ;
54
49
55
50
render ( ) {
Original file line number Diff line number Diff line change @@ -9,24 +9,18 @@ export default class DatColor extends Component {
9
9
static propTypes = {
10
10
className : PropTypes . string ,
11
11
style : PropTypes . object ,
12
- data : PropTypes . object ,
12
+ data : PropTypes . object . isRequired ,
13
13
path : PropTypes . string ,
14
14
label : PropTypes . string ,
15
15
labelWidth : PropTypes . string . isRequired ,
16
- liveUpdate : PropTypes . bool ,
17
- onUpdate : PropTypes . func ,
18
- _onUpdateValue : PropTypes . func
16
+ _onUpdateValue : PropTypes . func . isRequired
19
17
} ;
20
18
21
19
static defaultProps = {
22
20
className : null ,
23
21
style : null ,
24
- data : null ,
25
22
path : null ,
26
- label : null ,
27
- liveUpdate : null ,
28
- onUpdate : ( ) => null ,
29
- _onUpdateValue : ( ) => null
23
+ label : null
30
24
} ;
31
25
32
26
constructor ( ) {
@@ -60,10 +54,9 @@ export default class DatColor extends Component {
60
54
61
55
handleChangeColor = color => {
62
56
const value = isString ( color ) ? color : color . hex ;
63
- const { _onUpdateValue, onUpdate , path } = this . props ;
57
+ const { _onUpdateValue, path } = this . props ;
64
58
65
59
_onUpdateValue ( path , value ) ;
66
- onUpdate ( value ) ;
67
60
} ;
68
61
69
62
renderPicker ( ) {
Original file line number Diff line number Diff line change @@ -46,13 +46,11 @@ export default class DatNumber extends Component {
46
46
min : PropTypes . number ,
47
47
max : PropTypes . number ,
48
48
step : PropTypes . number ,
49
- data : PropTypes . object ,
49
+ data : PropTypes . object . isRequired ,
50
50
path : PropTypes . string ,
51
51
label : PropTypes . string ,
52
52
labelWidth : PropTypes . string . isRequired ,
53
- liveUpdate : PropTypes . bool ,
54
- onUpdate : PropTypes . func ,
55
- _onUpdateValue : PropTypes . func ,
53
+ _onUpdateValue : PropTypes . func . isRequired ,
56
54
disableSlider : PropTypes . bool
57
55
} ;
58
56
@@ -62,12 +60,8 @@ export default class DatNumber extends Component {
62
60
min : null ,
63
61
max : null ,
64
62
step : null ,
65
- data : null ,
66
63
path : null ,
67
64
label : null ,
68
- liveUpdate : null ,
69
- onUpdate : ( ) => null ,
70
- _onUpdateValue : ( ) => null ,
71
65
disableSlider : null
72
66
} ;
73
67
@@ -102,10 +96,9 @@ export default class DatNumber extends Component {
102
96
} ;
103
97
104
98
update = value => {
105
- const { onUpdate , _onUpdateValue, path } = this . props ;
99
+ const { _onUpdateValue, path } = this . props ;
106
100
107
101
_onUpdateValue ( path , toNumber ( value ) ) ;
108
- onUpdate ( toNumber ( value ) ) ;
109
102
} ;
110
103
111
104
renderSlider ( width ) {
Original file line number Diff line number Diff line change @@ -10,22 +10,19 @@ export default class DatPresets extends Component {
10
10
static propTypes = {
11
11
className : PropTypes . string ,
12
12
style : PropTypes . object ,
13
- data : PropTypes . object ,
13
+ data : PropTypes . object . isRequired ,
14
14
path : PropTypes . string ,
15
15
label : PropTypes . string . isRequired ,
16
16
options : PropTypes . array . isRequired ,
17
17
labelWidth : PropTypes . string . isRequired ,
18
- liveUpdate : PropTypes . bool ,
19
- onUpdate : PropTypes . func
18
+ liveUpdate : PropTypes . bool . isRequired ,
19
+ onUpdate : PropTypes . func . isRequired
20
20
} ;
21
21
22
22
static defaultProps = {
23
23
className : null ,
24
24
style : null ,
25
- data : null ,
26
- path : null ,
27
- liveUpdate : true ,
28
- onUpdate : ( ) => null
25
+ path : null
29
26
} ;
30
27
31
28
constructor ( ) {
Original file line number Diff line number Diff line change @@ -8,25 +8,22 @@ export default class DatSelect extends Component {
8
8
static propTypes = {
9
9
className : PropTypes . string ,
10
10
style : PropTypes . object ,
11
- data : PropTypes . object ,
11
+ data : PropTypes . object . isRequired ,
12
12
path : PropTypes . string ,
13
13
label : PropTypes . string ,
14
14
options : PropTypes . array . isRequired ,
15
15
labelWidth : PropTypes . string . isRequired ,
16
- liveUpdate : PropTypes . bool ,
16
+ liveUpdate : PropTypes . bool . isRequired ,
17
17
onUpdate : PropTypes . func ,
18
- _onUpdateValue : PropTypes . func
18
+ _onUpdateValue : PropTypes . func . isRequired
19
19
} ;
20
20
21
21
static defaultProps = {
22
22
className : null ,
23
23
style : null ,
24
- data : null ,
25
24
path : null ,
26
25
label : null ,
27
- liveUpdate : true ,
28
- onUpdate : ( ) => null ,
29
- _onUpdateValue : ( ) => null
26
+ onUpdate : ( ) => null
30
27
} ;
31
28
32
29
constructor ( ) {
Original file line number Diff line number Diff line change @@ -8,24 +8,21 @@ export default class DatString extends Component {
8
8
static propTypes = {
9
9
className : PropTypes . string ,
10
10
style : PropTypes . object ,
11
- data : PropTypes . object ,
11
+ data : PropTypes . object . isRequired ,
12
12
path : PropTypes . string ,
13
13
label : PropTypes . string ,
14
14
labelWidth : PropTypes . string . isRequired ,
15
- liveUpdate : PropTypes . bool ,
15
+ liveUpdate : PropTypes . bool . isRequired ,
16
16
onUpdate : PropTypes . func ,
17
- _onUpdateValue : PropTypes . func
17
+ _onUpdateValue : PropTypes . func . isRequired
18
18
} ;
19
19
20
20
static defaultProps = {
21
21
className : null ,
22
22
style : null ,
23
- data : null ,
24
23
path : null ,
25
24
label : null ,
26
- liveUpdate : true ,
27
- onUpdate : ( ) => null ,
28
- _onUpdateValue : ( ) => null
25
+ onUpdate : ( ) => null
29
26
} ;
30
27
31
28
constructor ( ) {
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default class Slider extends Component {
14
14
min : PropTypes . number ,
15
15
max : PropTypes . number ,
16
16
width : PropTypes . number ,
17
- onUpdate : PropTypes . func
17
+ onUpdate : PropTypes . func . isRequired
18
18
} ;
19
19
20
20
static defaultProps = {
@@ -23,8 +23,7 @@ export default class Slider extends Component {
23
23
value : null ,
24
24
min : null ,
25
25
max : null ,
26
- width : null ,
27
- onUpdate : ( ) => null
26
+ width : null
28
27
} ;
29
28
30
29
constructor ( ) {
You can’t perform that action at this time.
0 commit comments