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 +36
-19
lines changed Expand file tree Collapse file tree 7 files changed +36
-19
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,10 @@ export default class DatBoolean extends Component {
57
57
< span className = "label-text" style = { { width : labelWidth } } >
58
58
{ labelText }
59
59
</ span >
60
- < span className = "checkbox-container" >
60
+ < span
61
+ className = "checkbox-container"
62
+ style = { { width : `calc(100% - ${ labelWidth } )` } }
63
+ >
61
64
< input
62
65
type = "checkbox"
63
66
checked = { this . state . value }
Original file line number Diff line number Diff line change @@ -91,7 +91,12 @@ export default class DatColor extends Component {
91
91
< span className = "label-text" style = { { width : labelWidth } } >
92
92
{ labelText }
93
93
</ span >
94
- < div style = { { backgroundColor : value , width : '100%' } } >
94
+ < div
95
+ style = { {
96
+ backgroundColor : value ,
97
+ width : `calc(100% - ${ labelWidth } )`
98
+ } }
99
+ >
95
100
< div
96
101
className = "swatch"
97
102
onClick = { this . handleClickColorPicker }
Original file line number Diff line number Diff line change @@ -143,19 +143,23 @@ export default class DatNumber extends Component {
143
143
< span className = "label-text" style = { { width : labelWidth } } >
144
144
{ labelText }
145
145
</ span >
146
- { hasSlider && disableSlider !== true
147
- ? this . renderSlider ( sliderWidth )
148
- : null }
149
- < input
150
- type = "number"
151
- step = { step }
152
- min = { min }
153
- max = { max }
154
- inputMode = "numeric"
155
- value = { this . state . value }
156
- style = { { width : `${ inputWidth } %` } }
157
- onChange = { this . handleChange }
158
- />
146
+ < span
147
+ style = { { display : 'inherit' , width : `calc(100% - ${ labelWidth } )` } }
148
+ >
149
+ { hasSlider && disableSlider !== true
150
+ ? this . renderSlider ( sliderWidth )
151
+ : null }
152
+ < input
153
+ type = "number"
154
+ step = { step }
155
+ min = { min }
156
+ max = { max }
157
+ inputMode = "numeric"
158
+ value = { this . state . value }
159
+ style = { { width : `${ inputWidth } %` } }
160
+ onChange = { this . handleChange }
161
+ />
162
+ </ span >
159
163
</ label >
160
164
</ li >
161
165
) ;
Original file line number Diff line number Diff line change @@ -68,7 +68,10 @@ export default class DatPresets extends Component {
68
68
< span className = "label-text" style = { { width : labelWidth } } >
69
69
{ labelText }
70
70
</ span >
71
- < select onChange = { this . handleChange } >
71
+ < select
72
+ onChange = { this . handleChange }
73
+ style = { { width : `calc(100% - ${ labelWidth } )` } }
74
+ >
72
75
{ options . map ( preset => {
73
76
return Object . keys ( preset ) . map ( key => {
74
77
return (
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export default class DatSelect extends Component {
64
64
< select
65
65
value = { value }
66
66
onChange = { this . handleChange }
67
- style = { { width : ' 100%' } }
67
+ style = { { width : `calc( 100% - ${ labelWidth } )` } }
68
68
>
69
69
{ options . map ( ( item , index ) => (
70
70
// eslint-disable-next-line react/no-array-index-key
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ export default class DatString extends Component {
85
85
{ labelText }
86
86
</ span >
87
87
< input
88
+ style = { { width : `calc(100% - ${ labelWidth } )` } }
88
89
type = "text"
89
90
value = { this . state . value }
90
91
onChange = { this . handleChange }
Original file line number Diff line number Diff line change @@ -12,15 +12,16 @@ export default class DatGui extends Component {
12
12
children : PropTypes . node . isRequired ,
13
13
onUpdate : PropTypes . func . isRequired ,
14
14
liveUpdate : PropTypes . bool ,
15
- labelWidth : PropTypes . string . isRequired ,
15
+ labelWidth : PropTypes . string ,
16
16
className : PropTypes . string ,
17
17
style : PropTypes . object
18
18
} ;
19
19
20
20
static defaultProps = {
21
21
liveUpdate : true ,
22
22
className : null ,
23
- style : null
23
+ style : null ,
24
+ labelWidth : '40%'
24
25
} ;
25
26
26
27
handleUpdateValue = ( path , value ) => {
You can’t perform that action at this time.
0 commit comments